repo_name stringlengths 5 100 | path stringlengths 4 294 | copies stringclasses 990
values | size stringlengths 4 7 | content stringlengths 666 1M | license stringclasses 15
values |
|---|---|---|---|---|---|
frankiecjunle/yunblog | venv/lib/python2.7/site-packages/flask/json.py | 121 | 9183 | # -*- coding: utf-8 -*-
"""
flask.jsonimpl
~~~~~~~~~~~~~~
Implementation helpers for the JSON support in Flask.
:copyright: (c) 2015 by Armin Ronacher.
:license: BSD, see LICENSE for more details.
"""
import io
import uuid
from datetime import date
from .globals import current_app, request
from ._... | mit |
marqh/iris | lib/iris/tests/unit/fileformats/pp_load_rules/test__convert_scalar_realization_coords.py | 5 | 1687 | # (C) British Crown Copyright 2014 - 2017, Met Office
#
# This file is part of Iris.
#
# Iris is free software: you can redistribute it and/or modify it under
# the terms of the GNU Lesser General Public License as published by the
# Free Software Foundation, either version 3 of the License, or
# (at your option) any l... | lgpl-3.0 |
izonder/intellij-community | python/helpers/pydev/tests/test_jysimpleTipper.py | 54 | 9616 | #line to run:
#java -classpath D:\bin\jython-2.1\jython.jar;D:\bin\eclipse331_1\plugins\org.junit_3.8.2.v200706111738\junit.jar;D:\bin\eclipse331_1\plugins\org.apache.ant_1.7.0.v200706080842\lib\ant.jar org.python.util.jython w:\org.python.pydev\pysrc\tests\test_jysimpleTipper.py
import unittest
import os
import sys
... | apache-2.0 |
changhoonhahn/centralMS | centralms/tests/sfrs.py | 1 | 12560 | '''
Functions for handling star formation rates
'''
import time
import numpy as np
# --- local ---
import util as UT
def LogSFR_sfms(logMstar, z_in, sfms_dict=None):
''' Wrapper for SFMS star formation rates
'''
if sfms_dict['name'] == 'constant_offset':
# the offset from the average SF... | mit |
campbe13/openhatch | vendor/packages/twisted/twisted/test/test_strcred.py | 18 | 21740 | # Copyright (c) Twisted Matrix Laboratories.
# See LICENSE for details.
"""
Tests for L{twisted.cred.strcred}.
"""
import os
import StringIO
from twisted import plugin
from twisted.trial import unittest
from twisted.cred import credentials, checkers, error, strcred
from twisted.plugins import cred_file, cred_anonymo... | agpl-3.0 |
pipermerriam/django | django/db/backends/oracle/creation.py | 209 | 16009 | import sys
import time
from django.conf import settings
from django.db.backends.base.creation import BaseDatabaseCreation
from django.db.utils import DatabaseError
from django.utils.functional import cached_property
from django.utils.six.moves import input
TEST_DATABASE_PREFIX = 'test_'
PASSWORD = 'Im_a_lumberjack'
... | bsd-3-clause |
qbektrix/namebench | libnamebench/base_ui.py | 172 | 10284 | # Copyright 2009 Google Inc. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or ... | apache-2.0 |
mahak/neutron | neutron/tests/unit/objects/test_subnetpool.py | 2 | 7681 | # Copyright (c) 2015 OpenStack Foundation.
# All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless... | apache-2.0 |
ticosax/django | django/contrib/sessions/backends/base.py | 15 | 11460 | from __future__ import unicode_literals
import base64
import logging
import string
from datetime import datetime, timedelta
from django.conf import settings
from django.contrib.sessions.exceptions import SuspiciousSession
from django.core.exceptions import SuspiciousOperation
from django.utils import timezone
from dj... | bsd-3-clause |
ErBa508/data-science-from-scratch | code/gradient_descent.py | 53 | 5895 | from __future__ import division
from collections import Counter
from linear_algebra import distance, vector_subtract, scalar_multiply
import math, random
def sum_of_squares(v):
"""computes the sum of squared elements in v"""
return sum(v_i ** 2 for v_i in v)
def difference_quotient(f, x, h):
return (f(x +... | unlicense |
HertzCoin/HertzCoin | contrib/bitrpc/bitrpc.py | 2348 | 7835 | from jsonrpc import ServiceProxy
import sys
import string
# ===== BEGIN USER SETTINGS =====
# if you do not set these you will be prompted for a password for every command
rpcuser = ""
rpcpass = ""
# ====== END USER SETTINGS ======
if rpcpass == "":
access = ServiceProxy("http://127.0.0.1:8332")
else:
access = Ser... | mit |
redmi/android_kernel_HM2014811 | tools/perf/scripts/python/event_analyzing_sample.py | 4719 | 7393 | # event_analyzing_sample.py: general event handler in python
#
# Current perf report is already very powerful with the annotation integrated,
# and this script is not trying to be as powerful as perf report, but
# providing end user/developer a flexible way to analyze the events other
# than trace points.
#
# The 2 dat... | gpl-2.0 |
bottompawn/kbengine | kbe/res/scripts/common/Lib/idlelib/CodeContext.py | 128 | 8353 | """CodeContext - Extension to display the block context above the edit window
Once code has scrolled off the top of a window, it can be difficult to
determine which block you are in. This extension implements a pane at the top
of each IDLE edit window which provides block structure hints. These hints are
the lines w... | lgpl-3.0 |
MikeAmy/django | tests/foreign_object/test_empty_join.py | 232 | 1498 | from django.test import TestCase
from .models import SlugPage
class RestrictedConditionsTests(TestCase):
def setUp(self):
slugs = [
'a',
'a/a',
'a/b',
'a/b/a',
'x',
'x/y/z',
]
SlugPage.objects.bulk_create([SlugPage(sl... | bsd-3-clause |
drnextgis/mapproxy | mapproxy/image/transform.py | 7 | 12917 | # This file is part of the MapProxy project.
# Copyright (C) 2010 Omniscale <http://omniscale.de>
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE... | apache-2.0 |
zahodi/ansible | lib/ansible/utils/module_docs_fragments/sros.py | 40 | 2972 | #
# (c) 2015, Peter Sprygada <psprygada@ansible.com>
#
# This file is part of Ansible
#
# Ansible is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any late... | gpl-3.0 |
40223208/2015cdb_g4_0420 | static/Brython3.1.1-20150328-091302/Lib/browser/local_storage.py | 617 | 2786 | # local storage in browser
import sys
from javascript import JSObject
class __UnProvided():
pass
class LocalStorage():
storage_type = "local_storage"
def __init__(self):
if not sys.has_local_storage:
raise EnvironmentError("LocalStorage not available")
self.store = JSObject(__... | gpl-3.0 |
Phonebooth/depot_tools | third_party/boto/gs/__init__.py | 265 | 1076 | # Copyright 2010 Google Inc.
#
# Permission is hereby granted, free of charge, to any person obtaining a
# copy of this software and associated documentation files (the
# "Software"), to deal in the Software without restriction, including
# without limitation the rights to use, copy, modify, merge, publish, dis-
# trib... | bsd-3-clause |
shakamunyi/nova | nova/scheduler/filters/trusted_filter.py | 6 | 9890 | # Copyright (c) 2012 Intel, Inc.
# Copyright (c) 2011-2012 OpenStack Foundation
# All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.o... | apache-2.0 |
tjsavage/full_nonrel_starter | django/core/urlresolvers.py | 159 | 17094 | """
This module converts requested URLs to callback view functions.
RegexURLResolver is the main class here. Its resolve() method takes a URL (as
a string) and returns a tuple in this format:
(view_function, function_args, function_kwargs)
"""
import re
from threading import local
from django.http import Http40... | bsd-3-clause |
aimas/TuniErp-8.0 | addons/website_gengo/__openerp__.py | 385 | 1387 | # -*- coding: utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Management Solution
# Copyright (C) 2013-Today OpenERP S.A. (<http://www.openerp.com>).
#
# This program is free software: you can redistribute it and/or modify
# it under the term... | agpl-3.0 |
soderstrom-rikard/linux | tools/perf/scripts/python/syscall-counts-by-pid.py | 1996 | 2105 | # system call counts, by pid
# (c) 2010, Tom Zanussi <tzanussi@gmail.com>
# Licensed under the terms of the GNU GPL License version 2
#
# Displays system-wide system call totals, broken down by syscall.
# If a [comm] arg is specified, only syscalls called by [comm] are displayed.
import os, sys
sys.path.append(os.env... | gpl-2.0 |
ai-ku/langvis | dependencies/jython-2.1/Lib/string.py | 10 | 12746 | # module 'string' -- A collection of string operations
# Warning: most of the code you see here isn't normally used nowadays. With
# Python 1.6, many of these functions are implemented as methods on the
# standard string object. They used to be implemented by a built-in module
# called strop, but strop is now obsolet... | mit |
sahilshekhawat/sympy | sympy/combinatorics/generators.py | 45 | 8270 | from __future__ import print_function, division
from sympy.combinatorics.permutations import Permutation
from sympy.utilities.iterables import variations, rotate_left
from sympy.core.symbol import symbols
from sympy.matrices import Matrix
from sympy.core.compatibility import range
def symmetric(n):
"""
Gener... | bsd-3-clause |
sosreport/sos | sos/report/plugins/ebpf.py | 4 | 2827 | # This file is part of the sos project: https://github.com/sosreport/sos
#
# This copyrighted material is made available to anyone wishing to use,
# modify, copy, or redistribute it subject to the terms and conditions of
# version 2 of the GNU General Public License.
#
# See the LICENSE file in the source distribution ... | gpl-2.0 |
dhongu/l10n-romania | __unported__/l10n_ro_account_bank_statement/account_bank_statement.py | 1 | 17548 | # -*- coding: utf-8 -*-
##############################################################################
#
# Author: Fekete Mihai <mihai.fekete@forbiom.eu>
# Copyright (C) 2014 FOREST AND BIOMASS SERVICES ROMANIA SA
# (http://www.forbiom.eu).
#
# This program is free software: you can redistribute it and/or... | agpl-3.0 |
mlewe/trueskill_kicker | league/admin.py | 1 | 1770 | from django.conf.urls import url
from django.contrib import admin
from django.shortcuts import render
from league.models import Player, Match
class MatchAdmin(admin.ModelAdmin):
change_list_template = 'admin/league/match_list.html'
list_display = ('score', 'team1_player1', 'team1_player2', 'team2_player1',
... | apache-2.0 |
thinkwhale/MyTakeOnQuotes | node_modules/grunt-docker/node_modules/docker/node_modules/pygmentize-bundled/vendor/pygments/build-2.7/pygments/style.py | 270 | 3743 | # -*- coding: utf-8 -*-
"""
pygments.style
~~~~~~~~~~~~~~
Basic style object.
:copyright: Copyright 2006-2013 by the Pygments team, see AUTHORS.
:license: BSD, see LICENSE for details.
"""
from pygments.token import Token, STANDARD_TYPES
class StyleMeta(type):
def __new__(mcs, name, bases,... | mit |
wanglongqi/sympy | sympy/physics/mechanics/particle.py | 39 | 7771 | from __future__ import print_function, division
__all__ = ['Particle']
from sympy import sympify
from sympy.physics.vector import Point
from sympy.utilities.exceptions import SymPyDeprecationWarning
class Particle(object):
"""A particle.
Particles have a non-zero mass and lack spatial extension; they take ... | bsd-3-clause |
ykim362/mxnet | example/image-classification/symbols/inception-bn.py | 57 | 7598 | # Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The ASF licenses this file
# to you under the Apache License, Version 2.0 (the
# "License"); you may not u... | apache-2.0 |
skynet/stashboard | docs/conf.py | 14 | 6998 | # -*- coding: utf-8 -*-
#
# Stashboard documentation build configuration file, created by
# sphinx-quickstart on Thu May 19 00:03:13 2011.
#
# This file is execfile()d with the current directory set to its containing dir.
#
# Note that not all possible configuration values are present in this
# autogenerated file.
#
# ... | mit |
nsol-nmsu/ns3-smartgrid | bindings/python/ns3modulescan-modular.py | 186 | 11846 | #! /usr/bin/env python
import sys
import os.path
import pybindgen.settings
from pybindgen.gccxmlparser import ModuleParser, PygenClassifier, PygenSection, WrapperWarning, find_declaration_from_name
from pybindgen.typehandlers.codesink import FileCodeSink
from pygccxml.declarations import templates
from pygccxml.decla... | gpl-2.0 |
MortalViews/incubator-airflow | airflow/contrib/operators/emr_add_steps_operator.py | 14 | 2092 | # -*- coding: utf-8 -*-
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
... | apache-2.0 |
gauravbose/digital-menu | digimenu2/build/lib.linux-x86_64-2.7/django/views/generic/detail.py | 103 | 6696 | from __future__ import unicode_literals
from django.core.exceptions import ImproperlyConfigured
from django.db import models
from django.http import Http404
from django.utils.translation import ugettext as _
from django.views.generic.base import ContextMixin, TemplateResponseMixin, View
class SingleObjectMixin(Conte... | bsd-3-clause |
ariegg/webiopi-drivers | chips/clock/osrtc/__init__.py | 4 | 11955 | # Copyright 2014-2016 Andreas Riegg - t-h-i-n-x.net
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by appli... | apache-2.0 |
hwu25/AppPkg | Applications/Python/Python-2.7.2/Lib/netrc.py | 55 | 4698 | """An object-oriented interface to .netrc files."""
# Module and documentation by Eric S. Raymond, 21 Dec 1998
import os, shlex
__all__ = ["netrc", "NetrcParseError"]
class NetrcParseError(Exception):
"""Exception raised on syntax errors in the .netrc file."""
def __init__(self, msg, filename=No... | bsd-2-clause |
ianatpn/nupictest | tests/unit/py2/nupic/support/configuration_test.py | 7 | 29987 | #!/usr/bin/env python
# ----------------------------------------------------------------------
# Numenta Platform for Intelligent Computing (NuPIC)
# Copyright (C) 2013, Numenta, Inc. Unless you have an agreement
# with Numenta, Inc., for a separate license for this software code, the
# following terms and conditions ... | gpl-3.0 |
UdjinM6/omim | 3party/protobuf/python/google/protobuf/internal/encoder.py | 73 | 26730 | # Protocol Buffers - Google's data interchange format
# Copyright 2008 Google Inc. All rights reserved.
# https://developers.google.com/protocol-buffers/
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are
# met:
#
# * Redi... | apache-2.0 |
gripped/xbmc | tools/Linux/FEH.py | 43 | 4457 | import os
import sys
import re
AvailableOutputs = []
Output = None
try:
from qt import *
AvailableOutputs.append("--error-output=Qt")
except:
pass
try:
import pygtk
pygtk.require('2.0')
import gtk
AvailableOutputs.append("--error-output=GTK")
except:
pass
try:
import pygame
imp... | gpl-2.0 |
juanalfonsopr/odoo | openerp/addons/base/ir/ir_default.py | 342 | 1883 | # -*- coding: utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Management Solution
# Copyright (C) 2004-2009 Tiny SPRL (<http://tiny.be>).
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the... | agpl-3.0 |
wrren/gs | deps/Catch/scripts/releaseNotes.py | 25 | 1666 | import os
import re
import urllib2
import json
from scriptCommon import catchPath
from scriptCommon import runAndCapture
issueNumberRe = re.compile( r'(.*?)#([0-9]*)([^0-9]?.*)' )
rootPath = os.path.join( catchPath, 'include/' )
versionPath = os.path.join( rootPath, "internal/catch_version.hpp" )
hashes = runAndCa... | mit |
Darkdadaah/pywikibot-core | tests/python_tests.py | 6 | 1840 | #!/usr/bin/python
# -*- coding: utf-8 -*-
"""Tests Python features."""
#
# (C) Pywikibot team, 2015
#
# Distributed under the terms of the MIT license.
from __future__ import absolute_import, unicode_literals
import unicodedata
try:
import unicodedata2
except ImportError:
unicodedata2 = None
from pywikibot.to... | mit |
dmsurti/mayavi | examples/mayavi/mlab/protein.py | 3 | 4813 | """
Visualize a protein graph structure downloaded from the protein database in
standard pdb format.
We parse the pdb file, but extract only a very small amount of
information: the type of atoms, their positions, and the links between them.
Most of the complexity of this example comes from the code turning the
PDB in... | bsd-3-clause |
andresailer/DIRAC | Resources/Computing/BatchSystems/LSF.py | 4 | 5616 | #########################################################################################
# LSF.py
# 10.11.2014
# Author: A.T.
#########################################################################################
""" LSF.py is a DIRAC independent class representing LSF batch system.
LSF objects are used as bac... | gpl-3.0 |
sogelink/ansible | lib/ansible/modules/windows/win_owner.py | 16 | 1048 | #!/usr/bin/python
# Copyright 2015, Hans-Joachim Kliemeck <git@kliemeck.de>
# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
ANSIBLE_METADATA = {'metadata_version': '1.1',
'status': ['preview'],
'supported_by': 'core'}
DOCUMENTATION ... | gpl-3.0 |
kriswuollett/grpc | tools/distrib/check_vsprojects.py | 42 | 3186 | #!/usr/bin/env python2.7
# Copyright 2016, Google Inc.
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are
# met:
#
# * Redistributions of source code must retain the above copyright
# notice, this li... | bsd-3-clause |
pwmarcz/django | django/contrib/gis/utils/ogrinspect.py | 35 | 9137 | """
This module is for inspecting OGR data sources and generating either
models for GeoDjango and/or mapping dictionaries for use with the
`LayerMapping` utility.
"""
from django.utils.six.moves import zip
# Requires GDAL to use.
from django.contrib.gis.gdal import DataSource
from django.contrib.gis.gdal.field import O... | bsd-3-clause |
uclouvain/osis | education_group/tests/views/publication_contact/test_update.py | 1 | 4229 |
#
# OSIS stands for Open Student Information System. It's an application
# designed to manage the core business of higher education institutions,
# such as universities, faculties, institutes and professional schools.
# The core business involves the administration of students, teachers,
# courses, prog... | agpl-3.0 |
jakeylube95/namebench | nb_third_party/jinja2/_stringdefs.py | 412 | 404256 | # -*- coding: utf-8 -*-
"""
jinja2._stringdefs
~~~~~~~~~~~~~~~~~~
Strings of all Unicode characters of a certain category.
Used for matching in Unicode-aware languages. Run to regenerate.
Inspired by chartypes_create.py from the MoinMoin project, original
implementation from Pygments.
:co... | apache-2.0 |
brainwane/zulip | docs/conf.py | 4 | 11256 | #
# zulip-contributor-docs documentation build configuration file, created by
# sphinx-quickstart on Mon Aug 17 16:24:04 2015.
#
# This file is execfile()d with the current directory set to its
# containing dir.
#
# Note that not all possible configuration values are present in this
# autogenerated file.
#
# All config... | apache-2.0 |
Davidjohnwilson/sympy | sympy/functions/special/tests/test_tensor_functions.py | 78 | 4852 | from sympy import (
adjoint, conjugate, Dummy, Eijk, KroneckerDelta, LeviCivita, Symbol,
symbols, transpose,
)
from sympy.core.compatibility import range
from sympy.physics.secondquant import evaluate_deltas, F
x, y = symbols('x y')
def test_levicivita():
assert Eijk(1, 2, 3) == LeviCivita(1, 2, 3)
a... | bsd-3-clause |
DarthMaulware/EquationGroupLeaks | Leak #5 - Lost In Translation/windows/Resources/Ops/PyScripts/windows/periodic.py | 1 | 7892 |
import optparse
import random
import sys
from datetime import datetime
import dsz
HEADING = 'Starting the periodic command runner...\n'
COMMAND_PROMPT = 'What command would you like to run'
DEFAULT_COMMAND = 'ping localhost'
DEFAULT_PERIOD_MINUTES = '10-15'
CONFIRM_PERIOD_MSG = "Going to run the command '%s' every %s ... | unlicense |
sirex/Misago | misago/users/api/userendpoints/username.py | 8 | 1987 | from django.core.exceptions import PermissionDenied
from django.db import IntegrityError
from django.utils.translation import ugettext as _
from rest_framework import status
from rest_framework.response import Response
from misago.conf import settings
from misago.users.namechanges import UsernameChanges
from misago.... | gpl-2.0 |
caphrim007/ansible | lib/ansible/modules/monitoring/logentries.py | 122 | 4339 | #!/usr/bin/python
# -*- coding: utf-8 -*-
# (c) 2013, Ivan Vanderbyl <ivan@app.io>
# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
from __future__ import absolute_import, division, print_function
__metaclass__ = type
ANSIBLE_METADATA = {'metadata_version': '1.1',
... | gpl-3.0 |
4shadoww/stabilizerbot | core/lib/chardet/jpcntx.py | 289 | 19643 | ######################## BEGIN LICENSE BLOCK ########################
# The Original Code is Mozilla Communicator client code.
#
# The Initial Developer of the Original Code is
# Netscape Communications Corporation.
# Portions created by the Initial Developer are Copyright (C) 1998
# the Initial Developer. All Rights R... | mit |
sahiljain/catapult | third_party/gsutil/gslib/storage_uri_builder.py | 38 | 1936 | # -*- coding: utf-8 -*-
# Copyright 2012 Google Inc. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless require... | bsd-3-clause |
MrYsLab/PyMata | setup.py | 1 | 1206 | #!/usr/bin/env python
from setuptools import setup
with open('README.md') as f:
long_description = f.read()
setup(
name='PyMata',
packages=['PyMata'],
#install_requires=['pyserial==2.7'],
install_requires=['pyserial'],
version='2.20',
description="A Python Protocol Abstraction Library F... | agpl-3.0 |
cyli/volatility | volatility/plugins/linux/check_syscall_arm.py | 13 | 4200 | # Volatility
#
# This file is part of Volatility.
#
# Volatility is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 2 of the License, or
# (at your option) any later version.
#
# Volatility is dist... | gpl-2.0 |
thnee/ansible | test/units/modules/network/onyx/test_onyx_syslog_remote.py | 9 | 4087 | #
# Copyright: Ansible Project
# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
# Make coding more python3-ish
from __future__ import (absolute_import, division, print_function)
__metaclass__ = type
from units.compat.mock import patch
from ansible.modules.network.onyx impor... | gpl-3.0 |
rafiqsaleh/VERCE | verce-hpc-pe/src/networkx/generators/tests/test_bipartite.py | 41 | 6214 | #!/usr/bin/env python
from nose.tools import *
from networkx import *
from networkx.generators.bipartite import *
"""Generators - Bipartite
----------------------
"""
class TestGeneratorsBipartite():
def test_configuration_model(self):
aseq=[3,3,3,3]
bseq=[2,2,2,2,2]
assert_raises(network... | mit |
shaib/openbudgets | openbudgets/apps/entities/views/api.py | 3 | 6503 | from rest_framework import generics
from openbudgets.apps.international.utilities import translated_fields
from openbudgets.apps.entities import serializers
from openbudgets.apps.entities import models
class DomainList(generics.ListAPIView):
"""Called via an API endpoint that represents a list of domains."""
... | bsd-3-clause |
squarewave24/rafalbuch.com | node_modules/grunt-docker/node_modules/docker/node_modules/pygmentize-bundled/vendor/pygments/build-3.3/pygments/lexers/special.py | 95 | 3062 | # -*- coding: utf-8 -*-
"""
pygments.lexers.special
~~~~~~~~~~~~~~~~~~~~~~~
Special lexers.
:copyright: Copyright 2006-2013 by the Pygments team, see AUTHORS.
:license: BSD, see LICENSE for details.
"""
import re
import io
from pygments.lexer import Lexer
from pygments.token import Token, Error,... | mit |
mrtenda/CoilSnake | coilsnake/model/eb/blocks.py | 4 | 3188 | import hashlib
import os
from coilsnake.exceptions.common.exceptions import CoilSnakeError
from coilsnake.model.common.blocks import Block, Rom
from coilsnake.model.common.ips import IpsPatch
from coilsnake.modules.eb.EbModule import comp, decomp
from coilsnake.exceptions.eb.exceptions import InvalidEbCompressedDataEr... | gpl-3.0 |
sudheesh001/oh-mainline | vendor/packages/twill/twill/other_packages/_mechanize_dist/_useragent.py | 19 | 13416 | """Convenient HTTP UserAgent class.
This is a subclass of urllib2.OpenerDirector.
Copyright 2003-2006 John J. Lee <jjl@pobox.com>
This code is free software; you can redistribute it and/or modify it under
the terms of the BSD or ZPL 2.1 licenses (see the file COPYING.txt
included with the distribution).
"""
impor... | agpl-3.0 |
cloud3edu/code-dot-org-old | blockly-core/i18n/js_to_json.py | 9 | 2930 | #!/usr/bin/python
# Gives the translation status of the specified apps and languages.
#
# Copyright 2013 Google Inc.
# http://blockly.googlecode.com/
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the Lic... | apache-2.0 |
j4/horizon | openstack_dashboard/dashboards/project/loadbalancers/tabs.py | 30 | 5169 | # Copyright 2013, Big Switch Networks, Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applic... | apache-2.0 |
pjg101/SickRage | lib/sqlalchemy/dialects/sqlite/base.py | 77 | 39335 | # sqlite/base.py
# Copyright (C) 2005-2014 the SQLAlchemy authors and contributors <see AUTHORS file>
#
# This module is part of SQLAlchemy and is released under
# the MIT License: http://www.opensource.org/licenses/mit-license.php
"""
.. dialect:: sqlite
:name: SQLite
Date and Time Types
-------------------
SQ... | gpl-3.0 |
gviejo/ThalamusPhysio | python/main_make_ISOMAP_HD_parallel.py | 1 | 4902 | #!/usr/bin/env python
'''
File name: main_ripp_mod.py
Author: Guillaume Viejo
Date created: 16/08/2017
Python Version: 3.5.2
'''
import sys
import numpy as np
import pandas as pd
import scipy.io
from functions import *
# from pylab import *
# import ipyparallel
from multiprocessing import Pool
imp... | gpl-3.0 |
munyirik/python | cpython/Tools/scripts/pickle2db.py | 116 | 4021 | #!/usr/bin/env python3
"""
Synopsis: %(prog)s [-h|-b|-g|-r|-a|-d] [ picklefile ] dbfile
Read the given picklefile as a series of key/value pairs and write to a new
database. If the database already exists, any contents are deleted. The
optional flags indicate the type of the output database:
-a - open using db... | bsd-3-clause |
99designs/colorific | colorific/script.py | 1 | 4123 | # -*- coding: utf-8 -*-
#
# script.py
# colorific
#
import sys
import optparse
from colorific import config
from colorific.palette import (
extract_colors, print_colors, save_palette_as_image, color_stream_mt,
color_stream_st)
class Application(object):
def __init__(self):
self.parser = self.c... | isc |
itkovian/sqlalchemy | lib/sqlalchemy/dialects/mysql/mysqldb.py | 59 | 6564 | # mysql/mysqldb.py
# Copyright (C) 2005-2015 the SQLAlchemy authors and contributors
# <see AUTHORS file>
#
# This module is part of SQLAlchemy and is released under
# the MIT License: http://www.opensource.org/licenses/mit-license.php
"""
.. dialect:: mysql+mysqldb
:name: MySQL-Python
:dbapi: mysqldb
:co... | mit |
chengsoonong/digbeta | python/digbeta/environment.py | 2 | 1577 | """Classes for representing the environment"""
import numpy as np
class Environment(object):
"""Generic class for environment, empty for the time being"""
def __init__(self):
pass
class MAB(Environment):
"""Multi-armed bandit problem with arms given in the 'arms' list"""
def __init__(self, ... | gpl-3.0 |
vinriviere/m68k-atari-mint-binutils-gdb | gdb/python/lib/gdb/command/frame_filters.py | 5 | 16256 | # Frame-filter commands.
# Copyright (C) 2013-2020 Free Software Foundation, Inc.
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 3 of the License, or
# (at your option) any late... | gpl-2.0 |
dset0x/invenio-deposit | invenio_deposit/fields/author.py | 7 | 1479 | # -*- coding: utf-8 -*-
#
# This file is part of Invenio.
# Copyright (C) 2012, 2013, 2014, 2015 CERN.
#
# Invenio is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License as
# published by the Free Software Foundation; either version 2 of the
# License, or (at your... | gpl-2.0 |
kdwink/intellij-community | python/lib/Lib/site-packages/django/contrib/localflavor/ro/ro_counties.py | 428 | 1231 | # -*- coding: utf-8 -*-
"""
A list of Romanian counties as `choices` in a formfield.
This exists as a standalone file so that it's only imported into memory when
explicitly needed.
"""
COUNTIES_CHOICES = (
('AB', u'Alba'),
('AR', u'Arad'),
('AG', u'Argeş'),
('BC', u'Bacău'),
('BH', u'Bihor'),
... | apache-2.0 |
pentestfail/TA-FireEye_TAP | bin/ta_fireeye_tap/solnlib/packages/requests/packages/chardet/mbcsgroupprober.py | 2769 | 1967 | ######################## BEGIN LICENSE BLOCK ########################
# The Original Code is Mozilla Universal charset detector code.
#
# The Initial Developer of the Original Code is
# Netscape Communications Corporation.
# Portions created by the Initial Developer are Copyright (C) 2001
# the Initial Developer. All R... | mit |
alejamp/ardupilot | mk/PX4/Tools/genmsg/src/genmsg/__init__.py | 215 | 2116 | # Software License Agreement (BSD License)
#
# Copyright (c) 2011, Willow Garage, Inc.
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions
# are met:
#
# * Redistributions of source code must retain the above ... | gpl-3.0 |
etuna-SBF-kog/Stadsparken | env/lib/python2.7/site-packages/django/contrib/sessions/tests.py | 73 | 16329 | from __future__ import with_statement
from datetime import datetime, timedelta
import shutil
import string
import tempfile
import warnings
from django.conf import settings
from django.contrib.sessions.backends.db import SessionStore as DatabaseSession
from django.contrib.sessions.backends.cache import SessionStore as... | gpl-3.0 |
yize/grunt-tps | tasks/lib/python/Lib/python2.7/encodings/palmos.py | 647 | 2936 | """ Python Character Mapping Codec for PalmOS 3.5.
Written by Sjoerd Mullender (sjoerd@acm.org); based on iso8859_15.py.
"""#"
import codecs
### Codec APIs
class Codec(codecs.Codec):
def encode(self,input,errors='strict'):
return codecs.charmap_encode(input,errors,encoding_map)
def decode(self,inp... | mit |
wangchulab/CIMAGE | python/peptideCalcAdductMZ.py | 1 | 1687 | #!/usr/bin/env python
# calculate peptide mass, either monoisotopic or AA-based avergaed mass
# mono -- absolute monoisotopic mass
# mz -- monoisotopic mass with C13 adjustment
# avg -- use average aa mass
import sys
import os
from sys import argv
if len(argv) != 4:
print 'Usage: %s <peptide_sequence> <mono|mz|a... | mit |
sinkuri256/python-for-android | python3-alpha/python3-src/Lib/py_compile.py | 46 | 6575 | """Routine to "compile" a .py file to a .pyc (or .pyo) file.
This module has intimate knowledge of the format of .pyc files.
"""
import builtins
import errno
import imp
import marshal
import os
import sys
import tokenize
import traceback
MAGIC = imp.get_magic()
__all__ = ["compile", "main", "PyCompileError"]
clas... | apache-2.0 |
Tatsh-ansible/ansible | contrib/inventory/cloudforms.py | 145 | 18040 | #!/usr/bin/env python
# vim: set fileencoding=utf-8 :
#
# Copyright (C) 2016 Guido Günther <agx@sigxcpu.org>
#
# This script is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
... | gpl-3.0 |
ammarkhann/FinalSeniorCode | lib/python2.7/site-packages/future/backports/xmlrpc/client.py | 81 | 48133 | #
# XML-RPC CLIENT LIBRARY
# $Id$
#
# an XML-RPC client interface for Python.
#
# the marshalling and response parser code can also be used to
# implement XML-RPC servers.
#
# Notes:
# this version is designed to work with Python 2.1 or newer.
#
# History:
# 1999-01-14 fl Created
# 1999-01-15 fl Changed dateTime to u... | mit |
azaghal/ansible | test/units/plugins/inventory/test_constructed.py | 48 | 7438 | # -*- coding: utf-8 -*-
# Copyright 2019 Alan Rominger <arominge@redhat.net>
#
# This file is part of Ansible
#
# Ansible is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# ... | gpl-3.0 |
freevoid/django-datafilters | sample_proj/polls/tests.py | 2 | 2066 | from django.test import TestCase
class FilterViewTestCase(TestCase):
fixtures = ['polls/initial_data.json']
def _test_common(self, url):
response = self.client.get(url)
self.assertEqual(response.status_code, 200)
polls = response.context_data['polls']
self.assertEqual(len(pol... | mit |
google/makani | analysis/util/simdata_analysis/test/score_prob_test.py | 1 | 1426 | # Copyright 2020 Makani Technologies LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to... | apache-2.0 |
pussinboot/sol | sol/config.py | 1 | 4316 | # defines global variables
import os
import pickle
import importlib
import sol.themer as themer
class SingletonDecorator:
def __init__(self, klass):
self.klass = klass
self.instance = None
def __call__(self, *args, **kwds):
if self.instance is None:
self.instance = self.kl... | mit |
wuhy80/zhihu-py3 | zhihu/topic.py | 3 | 11311 | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
__author__ = '7sDream'
from .common import *
import time
class Topic:
"""答案类,请使用``ZhihuClient.topic``方法构造对象."""
@class_common_init(re_topic_url)
def __init__(self, url, name=None, session=None):
"""创建话题类实例.
:param url: 话题url
:para... | mit |
bbc/kamaelia | Sketches/MPS/Participate/KamaeliaWebServer.py | 3 | 9706 | #!/usr/bin/python
# -*- coding: utf-8 -*-
# Copyright 2010 British Broadcasting Corporation and Kamaelia Contributors(1)
#
# (1) Kamaelia Contributors are listed in the AUTHORS file and at
# http://www.kamaelia.org/AUTHORS - please extend this file,
# not this notice.
#
# Licensed under the Apache License, Ver... | apache-2.0 |
cfossace/test | pyexiftool-master/test/test_exiftool.py | 3 | 3705 | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
import unittest
import exiftool
import warnings
import os
class TestExifTool(unittest.TestCase):
def setUp(self):
self.et = exiftool.ExifTool()
def tearDown(self):
if hasattr(self, "et"):
self.et.terminate()
i... | mit |
alexlo03/ansible | test/units/modules/network/f5/test_bigiq_application_https_waf.py | 5 | 6196 | # -*- coding: utf-8 -*-
#
# Copyright: (c) 2017, F5 Networks Inc.
# GNU General Public License v3.0 (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
from __future__ import (absolute_import, division, print_function)
__metaclass__ = type
import os
import json
import sys
from nose.plugins.skip import SkipTest... | gpl-3.0 |
pinterb/st2contrib | packs/elasticsearch/actions/lib/esbase_action.py | 12 | 1075 | # pylint: disable=no-member
from utils import get_client
from st2actions.runners.pythonrunner import Action
import logging
class ESBaseAction(Action):
def __init__(self, config=None):
super(ESBaseAction, self).__init__(config=config)
self._client = None
@property
def client(self):
... | apache-2.0 |
irwinlove/django | django/contrib/gis/db/backends/postgis/operations.py | 168 | 15689 | import re
from django.conf import settings
from django.contrib.gis.db.backends.base.operations import \
BaseSpatialOperations
from django.contrib.gis.db.backends.postgis.adapter import PostGISAdapter
from django.contrib.gis.db.backends.postgis.pgraster import (
from_pgraster, to_pgraster,
)
from django.contrib... | bsd-3-clause |
wan-qy/electron | script/lib/config.py | 7 | 1927 | #!/usr/bin/env python
import errno
import os
import platform
import sys
BASE_URL = os.getenv('LIBCHROMIUMCONTENT_MIRROR') or \
'https://s3.amazonaws.com/github-janky-artifacts/libchromiumcontent'
PLATFORM = {
'cygwin': 'win32',
'darwin': 'darwin',
'linux2': 'linux',
'win32': 'win32',
}[sys.platform]
ve... | mit |
supercheetah/diceroller | pyinstaller/utils/BinDepend.py | 1 | 2123 | #! /usr/bin/env python
#
# Build packages using spec files
#
# Copyright (C) 2005-2011, Giovanni Bajo
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 2 of the License, or
# (at ... | artistic-2.0 |
shaufi10/odoo | addons/payment_paypal/models/res_company.py | 422 | 1752 | # -*- coding: utf-8 -*-
from openerp.osv import fields, osv
class ResCompany(osv.Model):
_inherit = "res.company"
def _get_paypal_account(self, cr, uid, ids, name, arg, context=None):
Acquirer = self.pool['payment.acquirer']
company_id = self.pool['res.users'].browse(cr, uid, uid, context=co... | agpl-3.0 |
frreiss/tensorflow-fred | tensorflow/python/profiler/profiler_v2.py | 3 | 7106 | # Copyright 2020 The TensorFlow Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applica... | apache-2.0 |
TheDegree0/menescraper | menescraper/menescraper/lib/python2.7/site-packages/pip/_vendor/html5lib/treewalkers/genshistream.py | 1730 | 2278 | from __future__ import absolute_import, division, unicode_literals
from genshi.core import QName
from genshi.core import START, END, XML_NAMESPACE, DOCTYPE, TEXT
from genshi.core import START_NS, END_NS, START_CDATA, END_CDATA, PI, COMMENT
from . import _base
from ..constants import voidElements, namespaces
class ... | gpl-2.0 |
havard024/prego | crm/lib/python2.7/site-packages/django/contrib/gis/geos/coordseq.py | 219 | 5438 | """
This module houses the GEOSCoordSeq object, which is used internally
by GEOSGeometry to house the actual coordinates of the Point,
LineString, and LinearRing geometries.
"""
from ctypes import c_double, c_uint, byref
from django.contrib.gis.geos.base import GEOSBase, numpy
from django.contrib.gis.geos.error impo... | mit |
QISKit/qiskit-sdk-py | qiskit/test/providers/backend.py | 1 | 2470 | # -*- coding: utf-8 -*-
# This code is part of Qiskit.
#
# (C) Copyright IBM 2017, 2019.
#
# This code is licensed under the Apache License, Version 2.0. You may
# obtain a copy of this license in the LICENSE.txt file in the root directory
# of this source tree or at http://www.apache.org/licenses/LICENSE-2.0.
#
# Any... | apache-2.0 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.