repo_name
stringlengths
5
100
path
stringlengths
4
299
copies
stringclasses
990 values
size
stringlengths
4
7
content
stringlengths
666
1.03M
license
stringclasses
15 values
hash
int64
-9,223,351,895,964,839,000
9,223,297,778B
line_mean
float64
3.17
100
line_max
int64
7
1k
alpha_frac
float64
0.25
0.98
autogenerated
bool
1 class
asser/django
tests/utils_tests/test_regex_helper.py
448
1784
from __future__ import unicode_literals import unittest from django.utils import regex_helper class NormalizeTests(unittest.TestCase): def test_empty(self): pattern = r"" expected = [('', [])] result = regex_helper.normalize(pattern) self.assertEqual(result, expected) def te...
bsd-3-clause
-1,635,560,719,436,992,300
33.980392
71
0.570628
false
sonofeft/PyHatch
pyhatch/examples/example_1.py
1
1057
import sys import os from pyhatch.hatch_supt import Hatch SIMPLEDESC='''PyProTem acts as a temporary project for test purposes.''' LONGDESC="""Use pyProTem to test tox usage locally, travis CI on checkin to GitHub, tk_nosy to watch files locally and alert breakage, operation under both python 2 and 3 on Windows an...
gpl-3.0
7,262,015,263,681,618,000
33.096774
76
0.637654
false
natanlailari/PennApps2015-Heartmates
venv/lib/python2.7/site-packages/pip/_vendor/requests/packages/urllib3/response.py
328
10347
# urllib3/response.py # Copyright 2008-2013 Andrey Petrov and contributors (see CONTRIBUTORS.txt) # # This module is part of urllib3 and is released under # the MIT License: http://www.opensource.org/licenses/mit-license.php import logging import zlib import io from ._collections import HTTPHeaderDict from .exceptio...
apache-2.0
5,544,893,342,892,006,000
32.594156
89
0.580845
false
lokeshjindal15/pd-gem5
src/arch/alpha/AlphaInterrupts.py
69
1754
# Copyright (c) 2008 The Regents of The University of Michigan # 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 list ...
bsd-3-clause
-2,305,042,434,960,316,000
50.588235
72
0.788483
false
henridwyer/scikit-learn
sklearn/gaussian_process/regression_models.py
259
2166
# -*- coding: utf-8 -*- # Author: Vincent Dubourg <vincent.dubourg@gmail.com> # (mostly translation, see implementation details) # Licence: BSD 3 clause """ The built-in regression models submodule for the gaussian_process module. """ import numpy as np def constant(x): """ Zero order polynomial (...
bsd-3-clause
-6,285,011,764,685,540,000
23.337079
79
0.54386
false
Arafatk/sympy
sympy/vector/coordsysrect.py
9
24501
from sympy.core.basic import Basic from sympy.vector.scalar import BaseScalar from sympy import eye, trigsimp, ImmutableMatrix as Matrix, Symbol from sympy.core.compatibility import string_types, range from sympy.core.cache import cacheit from sympy.vector.orienters import (Orienter, AxisOrienter, BodyOrienter, ...
bsd-3-clause
-2,273,897,078,371,305,700
33.508451
78
0.553161
false
jhg/django
tests/utils_tests/test_baseconv.py
326
1787
from unittest import TestCase from django.utils.baseconv import ( BaseConverter, base2, base16, base36, base56, base62, base64, ) from django.utils.six.moves import range class TestBaseConv(TestCase): def test_baseconv(self): nums = [-10 ** 10, 10 ** 10] + list(range(-100, 100)) for converte...
bsd-3-clause
-366,946,338,648,132,350
37.847826
76
0.63906
false
abhishekgahlot/scikit-learn
examples/applications/topics_extraction_with_nmf.py
106
2313
""" ======================================================== Topics extraction with Non-Negative Matrix Factorization ======================================================== This is a proof of concept application of Non Negative Matrix Factorization of the term frequency matrix of a corpus of documents so as to extra...
bsd-3-clause
7,327,240,810,867,790,000
36.306452
77
0.677043
false
RoshaneH/INFO3180lab4
lib/werkzeug/testsuite/datastructures.py
97
27488
# -*- coding: utf-8 -*- """ werkzeug.testsuite.datastructures ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Tests the functionality of the provided Werkzeug datastructures. TODO: - FileMultiDict - Immutable types undertested - Split up dict tests :copyright: (c) 2013 by Armin Ronacher....
apache-2.0
-3,760,828,392,168,323,000
33.883249
98
0.550531
false
G33KS44n/mysql-5.6
xtrabackup/test/python/testtools/runtest.py
42
7648
# Copyright (c) 2009-2010 testtools developers. See LICENSE for details. """Individual test case execution.""" __all__ = [ 'MultipleExceptions', 'RunTest', ] import sys from testtools.testresult import ExtendedToOriginalDecorator class MultipleExceptions(Exception): """Represents many exceptions r...
gpl-2.0
3,612,749,660,103,432,000
37.24
79
0.598326
false
garoose/eecs494.p2
jni/external/freetype2/src/tools/docmaker/docmaker.py
463
2766
#!/usr/bin/env python # # DocMaker (c) 2002, 2004, 2008 David Turner <david@freetype.org> # # This program is a re-write of the original DocMaker took used # to generate the API Reference of the FreeType font engine # by converting in-source comments into structured HTML. # # This new version is capable of outputting ...
mit
-2,914,701,671,262,738,000
25.09434
81
0.587852
false
lindycoder/fake-switches
fake_switches/dell10g/command_processor/enabled.py
4
9868
# Copyright 2015 Internap. # # 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, so...
apache-2.0
-2,264,788,642,547,545,000
44.685185
157
0.536786
false
rgommers/numpy
numpy/core/tests/test_shape_base.py
4
27579
import pytest import numpy as np from numpy.core import ( array, arange, atleast_1d, atleast_2d, atleast_3d, block, vstack, hstack, newaxis, concatenate, stack ) from numpy.core.shape_base import (_block_dispatcher, _block_setup, _block_concatenate, _block_slicing) from nu...
bsd-3-clause
4,504,274,726,209,969,000
35.003916
98
0.490917
false
cole945/binutils-gdb
gdb/testsuite/gdb.python/py-frame-args.py
41
2186
# Copyright (C) 2013-2014 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 later version. # # This progr...
gpl-2.0
1,987,379,879,682,412,500
28.146667
71
0.658737
false
spulec/moto
tests/test_resourcegroups/test_resourcegroups.py
1
8542
from __future__ import unicode_literals import boto3 import json import sure # noqa from moto import mock_resourcegroups @mock_resourcegroups def test_create_group(): resource_groups = boto3.client("resource-groups", region_name="us-east-1") response = resource_groups.create_group( Name="test_reso...
apache-2.0
5,990,390,767,077,057,000
29.949275
87
0.604542
false
kisel/trex-core
scripts/external_libs/nose-1.3.4/python3/nose/tools/nontrivial.py
11
4170
"""Tools not exempt from being descended into in tracebacks""" import time __all__ = ['make_decorator', 'raises', 'set_trace', 'timed', 'with_setup', 'TimeExpired', 'istest', 'nottest'] class TimeExpired(AssertionError): pass def make_decorator(func): """ Wraps a test decorator so as to pr...
apache-2.0
414,459,001,142,602,940
26.615894
76
0.548921
false
cloudsigma/cgroupspy
cgroupspy/test/test_interfaces.py
1
8905
""" Copyright (c) 2014, CloudSigma AG 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 list of conditions and the fo...
bsd-3-clause
-7,094,775,070,949,177,000
33.118774
104
0.623358
false
imre-kerr/swarm-epuck
controllers/swarm_controller/webann.py
2
1182
# This uses the EpuckBasic code as the interface to webots, and the epuck2 code to connect an ANN # to webots. import epuck2 import epuck_basic as epb import graph import prims1 # The webann is a descendent of the webot "controller" class, and it has the ANN as an attribute. class WebAnn(epb.EpuckBasic): def __...
mit
-1,951,144,392,266,925,000
34.818182
141
0.687817
false
terbolous/CouchPotatoServer
libs/pyutil/test/deprecated/test_picklesaver.py
106
1340
#!/usr/bin/env python # Copyright (c) 2002 Luke 'Artimage' Nelson # Copyright (c) 2005-2010 Zooko Wilcox-O'Hearn # This file is part of pyutil; see README.rst for licensing terms. import os try: from twisted.trial import unittest except ImportError, le: print "Skipping %s since it requires Twisted and Twist...
gpl-3.0
6,023,810,781,254,622,000
36.222222
107
0.635821
false
colinbrislawn/bioconda-recipes
recipes/fgbio/fgbio.py
7
2575
#!/opt/anaconda1anaconda2anaconda3/bin/python # # Wrapper script for invoking the jar. # # This script is written for use with the Conda package manager and is ported # from a bash script that does the same thing, adapting the style in # the peptide-shaker wrapper # (https://github.com/bioconda/bioconda-recipes/blob/ma...
mit
-1,821,160,741,558,966,800
29.294118
101
0.649709
false
alexlo03/ansible
lib/ansible/modules/crypto/openssl_privatekey.py
25
10503
#!/usr/bin/python # -*- coding: utf-8 -*- # (c) 2016, Yanis Guenane <yanis+ansible@guenane.org> # 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': '...
gpl-3.0
-7,459,033,477,999,473,000
32.663462
159
0.601066
false
jhseu/tensorflow
tensorflow/compiler/mlir/tensorflow/tests/tf_saved_model/shapes_for_arguments.py
21
1840
# Copyright 2019 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
8,293,778,285,904,808,000
39
90
0.695109
false
Hasimir/pyjs
examples/widgets/__main__.py
8
1045
#!/usr/bin/env python # -*- coding: utf-8 -*- TARGETS = [ 'Widgets.py', ] PACKAGE = { 'title': 'Widgets', 'desc': 'Widgets example', } def setup(targets): '''Setup example for translation, MUST call util.setup(targets).''' util.setup(targets) def translate(): '''Translate example, MUST c...
apache-2.0
2,599,677,662,264,465,000
18.716981
77
0.591388
false
vaporry/dapp-bin
serpent_gamble/prepare.py
5
2914
# This is an ultra-minimal "dapp framework" that simplifies the deployment # process by generating a config.js file that specifies the ABI for all of # the contracts that you need and also includes the ability to update # addresses. By default, it simply scans through every .se and .sol file in # the current directory ...
mit
-3,283,710,245,870,542,000
41.852941
83
0.683253
false
Zhongqilong/mykbengineer
kbe/res/scripts/common/Lib/profile.py
102
22021
#! /usr/bin/env python3 # # Class for profiling python code. rev 1.0 6/2/94 # # Written by James Roskind # Based on prior profile module by Sjoerd Mullender... # which was hacked somewhat by: Guido van Rossum """Class for profiling Python code.""" # Copyright Disney Enterprises, Inc. All Rights Reserved. # Licens...
lgpl-3.0
5,958,273,207,825,448,000
36.387097
80
0.586894
false
alu0100207385/dsi_3Django
django/contrib/gis/db/backends/spatialite/creation.py
117
5699
import os from django.conf import settings from django.core.cache import get_cache from django.core.cache.backends.db import BaseDatabaseCache from django.core.exceptions import ImproperlyConfigured from django.db.backends.sqlite3.creation import DatabaseCreation class SpatiaLiteCreation(DatabaseCreation): def cr...
bsd-3-clause
6,522,156,155,211,061,000
43.178295
103
0.593964
false
0x19/werkzeug
bench/wzbench.py
4
12441
#!/usr/bin/env python # -*- coding: utf-8 -*- """ wzbench ~~~~~~~ A werkzeug internal benchmark module. It's used in combination with hg bisect to find out how the Werkzeug performance of some internal core parts changes over time. :copyright: 2009 by the Werkzeug Team, see AUTHORS for more d...
bsd-3-clause
-5,434,094,080,824,894,000
26.513274
79
0.551383
false
ovnicraft/edx-platform
common/djangoapps/course_action_state/tests/test_managers.py
126
7219
# pylint: disable=invalid-name, attribute-defined-outside-init """ Tests for basic common operations related to Course Action State managers """ from ddt import ddt, data from django.test import TestCase from collections import namedtuple from opaque_keys.edx.locations import CourseLocator from course_action_state.mode...
agpl-3.0
-2,961,681,727,057,095,700
44.11875
118
0.655492
false
nanolearningllc/edx-platform-cypress-2
cms/djangoapps/contentstore/courseware_index.py
60
26790
""" Code to allow module store to interface with courseware index """ from __future__ import absolute_import from abc import ABCMeta, abstractmethod from datetime import timedelta import logging import re from six import add_metaclass from django.conf import settings from django.utils.translation import ugettext as _ ...
agpl-3.0
1,328,666,044,457,507,800
40.728972
120
0.628705
false
dongjoon-hyun/tensorflow
tensorflow/python/saved_model/utils_test.py
62
5133
# Copyright 2015 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
-1,380,299,723,406,448,400
45.243243
80
0.696863
false
gymnasium/edx-platform
lms/djangoapps/certificates/tests/tests.py
9
10197
""" Tests for the certificates models. """ from datetime import datetime, timedelta from ddt import data, ddt, unpack from pytz import UTC from django.conf import settings from milestones.tests.utils import MilestonesTestCaseMixin from mock import patch from nose.plugins.attrib import attr from badges.tests.factories ...
agpl-3.0
-7,107,257,180,835,421,000
43.334783
120
0.64872
false
oihane/odoo
addons/product/report/__init__.py
452
1080
# -*- coding: utf-8 -*- ############################################################################## # # OpenERP, Open Source Management Solution # Copyright (C) 2004-2010 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
6,273,127,101,776,185,000
44
79
0.612037
false
msmolens/VTK
ThirdParty/ZopeInterface/zope/interface/tests/test_interface.py
30
72591
############################################################################## # # Copyright (c) 2001, 2002 Zope Foundation and Contributors. # All Rights Reserved. # # This software is subject to the provisions of the Zope Public License, # Version 2.1 (ZPL). A copy of the ZPL should accompany this distribution. # TH...
bsd-3-clause
-5,660,409,157,293,757,000
33.749162
80
0.58656
false
menardorama/ReadyNAS-Add-ons
headphones-1.0.0/debian/headphones/apps/headphones/lib/requests/auth.py
120
6669
# -*- coding: utf-8 -*- """ requests.auth ~~~~~~~~~~~~~ This module contains the authentication handlers for Requests. """ import os import re import time import hashlib from base64 import b64encode from .compat import urlparse, str from .cookies import extract_cookies_to_jar from .utils import parse_dict_header, ...
gpl-2.0
3,736,381,122,403,699,700
30.909091
88
0.556605
false
unatv2/unatv2
qa/rpc-tests/listtransactions.py
145
6081
#!/usr/bin/env python # Copyright (c) 2014 The Bitcoin Core developers # Distributed under the MIT/X11 software license, see the accompanying # file COPYING or http://www.opensource.org/licenses/mit-license.php. # Exercise the listtransactions API # Add python-bitcoinrpc to module search path: import os import sys sy...
mit
515,628,013,720,518,500
37.980769
105
0.569314
false
saketkc/statsmodels
tools/backport_pr.py
30
5263
#!/usr/bin/env python """ Backport pull requests to a particular branch. Usage: backport_pr.py branch [PR] e.g.: python tools/backport_pr.py 0.13.1 123 to backport PR #123 onto branch 0.13.1 or python tools/backport_pr.py 1.x to see what PRs are marked for backport that have yet to be applied. Copied fr...
bsd-3-clause
-6,453,828,736,326,143,000
29.777778
97
0.598708
false
PulsePod/evepod
lib/python2.7/site-packages/pip/vendor/html5lib/filters/whitespace.py
1730
1142
from __future__ import absolute_import, division, unicode_literals import re from . import _base from ..constants import rcdataElements, spaceCharacters spaceCharacters = "".join(spaceCharacters) SPACES_REGEX = re.compile("[%s]+" % spaceCharacters) class Filter(_base.Filter): spacePreserveElements = frozenset...
apache-2.0
7,045,932,464,951,442,000
29.052632
90
0.590193
false
sergev/mraa
examples/python/rgblcd.py
43
1470
#!/usr/bin/env python # Author: Brendan Le Foll <brendan.le.foll@intel.com> # Copyright (c) 2014 Intel Corporation. # # 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, inc...
mit
-5,626,878,122,901,954,000
36.692308
75
0.765986
false
pypa/setuptools
setuptools/command/setopt.py
6
5051
from distutils.util import convert_path from distutils import log from distutils.errors import DistutilsOptionError import distutils import os import configparser from setuptools import Command __all__ = ['config_file', 'edit_config', 'option_base', 'setopt'] def config_file(kind="local"): """Get the filename o...
mit
-9,051,294,473,781,537,000
33.128378
79
0.567214
false
gonesurfing/Quisk_rpi_remote
hiqsdr/quisk_hardware.py
1
13927
# This is a sample hardware file for UDP control. Use this file for my 2010 transceiver # described in QEX and for the improved version HiQSDR. To turn on the extended # features in HiQSDR, update your FPGA firmware to version 1.1 or later and use use_rx_udp = 2. from __future__ import print_function import struct,...
gpl-2.0
-1,035,308,506,490,065,200
39.841642
125
0.625476
false
dmoliveira/networkx
networkx/generators/community.py
30
11963
"""Generators for classes of graphs used in studying social networks.""" import itertools import math import random import networkx as nx # Copyright(C) 2011 by # Ben Edwards <bedwards@cs.unm.edu> # Aric Hagberg <hagberg@lanl.gov> # All rights reserved. # BSD license. __author__ = """\n""".join(['Ben Edw...
bsd-3-clause
5,867,875,322,336,766,000
28.321078
79
0.584302
false
hjarmstrong/Odme-plusplus
3rd/build/tools/build/v2/test/TestCmd.py
44
20065
""" TestCmd.py: a testing framework for commands and scripts. The TestCmd module provides a framework for portable automated testing of executable commands and scripts (in any language, not just Python), especially commands and scripts that require file system interaction. In addition to running tests and evaluating...
mit
875,181,952,193,361,700
33.066214
80
0.59088
false
staranjeet/fjord
vendor/packages/translate-toolkit/translate/search/indexing/CommonIndexer.py
3
25337
# -*- coding: utf-8 -*- # # Copyright 2008 Zuza Software Foundation # # This file is part of translate. # # translate 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 y...
bsd-3-clause
-4,645,252,010,590,716,000
39.932149
85
0.588507
false
dmeulen/home-assistant
tests/conftest.py
8
1542
"""Setup some common test helper things.""" import functools import logging import pytest import requests_mock as _requests_mock from homeassistant import util from homeassistant.util import location from .common import async_test_home_assistant from .test_util.aiohttp import mock_aiohttp_client logging.basicConfig...
mit
3,167,877,439,778,532,000
24.7
77
0.69131
false
thezawad/flexx
flexx/ui/_formlayout.py
20
8438
""" Example: .. UIExample:: 200 from flexx import ui class Example(ui.Widget): def init(self): with ui.FormLayout(): ui.Label(text='Pet name:') self.b1 = ui.LineEdit() ui.Label(text='Pet Age:') self.b2 = ui.LineEdit()...
bsd-2-clause
-3,415,314,386,201,838,600
35.528139
103
0.50474
false
louietsai/python-for-android
python-build/python-libs/gdata/build/lib/gdata/tlslite/X509CertChain.py
238
6861
"""Class representing an X.509 certificate chain.""" from utils import cryptomath class X509CertChain: """This class represents a chain of X.509 certificates. @type x509List: list @ivar x509List: A list of L{tlslite.X509.X509} instances, starting with the end-entity certificate and with ever...
apache-2.0
-6,394,964,883,665,253,000
35.917127
79
0.552398
false
miniconfig/home-assistant
homeassistant/components/switch/netio.py
15
5672
""" The Netio switch component. For more details about this platform, please refer to the documentation at https://home-assistant.io/components/switch.netio/ """ import logging from collections import namedtuple from datetime import timedelta import voluptuous as vol from homeassistant.core import callback from home...
mit
-4,531,606,275,309,736,400
28.388601
75
0.639457
false
TaiSakuma/AlphaTwirl
tests/unit/roottree/test_EventBuilder.py
1
2175
import unittest import sys from alphatwirl.roottree import EventBuilderConfig ##__________________________________________________________________|| hasROOT = False try: import ROOT hasROOT = True except ImportError: pass if hasROOT: from alphatwirl.roottree.EventBuilder import EventBuilder ##______...
bsd-3-clause
-6,923,056,598,544,100,000
28.391892
105
0.514943
false
TheWaunaKeeganOrganization/Yahtzee
src/yahtzee_categories.py
1
1373
from collections import Counter def ones(d): return 1*d.count(1) def twos(d): return 2*d.count(2) def threes(d): return 3*d.count(3) def fours(d): return 4*d.count(4) def fives(d): return 5*d.count(5) def sixes(d): return 6*d.count(6) def threeOfAKind(d): if max(Counter(d).itervalues())>=3: return sum(d...
gpl-3.0
-3,669,609,660,809,892,000
18.338028
163
0.672251
false
chaos-adept/timelyb
appengine_config.py
1
1421
#!/usr/bin/env python # # Copyright 2010 Google 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 applicable law o...
gpl-3.0
5,118,230,771,141,126,000
37.405405
74
0.746657
false
glenux/contrib-mitro
browser-ext/third_party/firefox-addon-sdk/python-lib/simplejson/encoder.py
67
13492
""" Implementation of JSONEncoder """ import re try: from simplejson._speedups import encode_basestring_ascii as c_encode_basestring_ascii except ImportError: pass ESCAPE = re.compile(r'[\x00-\x1f\\"\b\f\n\r\t]') ESCAPE_ASCII = re.compile(r'([\\"]|[^\ -~])') HAS_UTF8 = re.compile(r'[\x80-\xff]') ESCAPE_DCT = ...
gpl-3.0
-5,677,495,146,495,276,000
34.044156
89
0.532983
false
westial/NdArrayIndexer.py
tests/test_NdArrayIndexer_3axes.py
1
4489
#!/usr/bin/env python # # Testing ndarray with 3 axes # import numpy as np from NdArrayIndexer import NdArrayIndexer # Structure of unsorted list to be converted in the same shape as testing_array testing_list = [ [[[7, 2, 76], [132, 32, 1], [201, 23, 224], [201, 23, 224]], [[101, 102, 103], [111, 112, 113]...
gpl-3.0
8,476,150,344,816,096,000
47.804348
79
0.462018
false
gerryhd/diabot-assistant
lib/python2.7/site-packages/jinja2/compiler.py
117
62929
# -*- coding: utf-8 -*- """ jinja2.compiler ~~~~~~~~~~~~~~~ Compiles nodes into python code. :copyright: (c) 2017 by the Jinja Team. :license: BSD, see LICENSE for more details. """ from itertools import chain from copy import deepcopy from keyword import iskeyword as is_python_keyword from functo...
gpl-3.0
-8,858,153,802,111,853,000
37.06957
87
0.548936
false
OTWillems/GEO1005
SpatialDecision/external/networkx/generators/tests/test_directed.py
77
1313
#!/usr/bin/env python """Generators - Directed Graphs ---------------------------- """ from nose.tools import * from networkx import * from networkx.generators.directed import * class TestGeneratorsDirected(): def test_smoke_test_random_graphs(self): G=gn_graph(100) G=gnr_graph(100,0.5) G...
gpl-2.0
-3,057,644,906,477,777,000
35.472222
66
0.605484
false
joequant/zipline
zipline/finance/blotter.py
29
14087
# # Copyright 2014 Quantopian, 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 applicable law or agreed to in wr...
apache-2.0
-1,606,639,483,723,169,500
30.514541
78
0.582168
false
kangkot/arangodb
3rdParty/V8-4.3.61/third_party/python_26/Lib/site-packages/pythonwin/pywin/Demos/app/demoutils.py
34
1309
# Utilities for the demos import sys, win32api, win32con, win32ui NotScriptMsg = """\ This demo program is not designed to be run as a Script, but is probably used by some other test program. Please try another demo. """ NeedGUIMsg = """\ This demo program can only be run from inside of Pythonwin You must start Py...
apache-2.0
-4,294,163,530,055,966,000
24.173077
91
0.721161
false
idegtiarov/gnocchi-rep
gnocchi/ceilometer/resources/ceph_account.py
1
1072
# # Copyright 2015 Mirantis 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 applicable law or agreed to in writ...
apache-2.0
4,732,176,125,918,304,000
33.580645
75
0.677239
false
hassanabidpk/django
django/template/library.py
348
12752
import functools import warnings from importlib import import_module from django.utils import six from django.utils.deprecation import RemovedInDjango20Warning from django.utils.html import conditional_escape from django.utils.inspect import getargspec from django.utils.itercompat import is_iterable from .base import...
bsd-3-clause
-311,783,738,985,000,260
37.642424
96
0.572146
false
40223110/2015cda_0512
static/Brython3.1.0-20150301-090019/Lib/_string.py
625
1112
"""string helper module""" import re class __loader__(object): pass def formatter_field_name_split(fieldname): """split the argument as a field name""" _list=[] for _name in fieldname: _parts = _name.split('.') for _item in _parts: is_attr=False #fix me if re....
gpl-3.0
4,717,848,820,400,724,000
25.47619
63
0.488309
false
aexeagmbh/django-allauth
allauth/socialaccount/providers/paypal/views.py
60
1606
import requests from allauth.socialaccount.providers.oauth2.views import (OAuth2Adapter, OAuth2LoginView, OAuth2CallbackView) from .provider import PaypalProvider class PaypalOAuth2Adapter(OAuth2Adapter...
mit
-1,780,012,782,342,218,500
36.348837
81
0.603985
false
hiroakis/ansible
v1/ansible/module_utils/cloudstack.py
118
13221
# -*- coding: utf-8 -*- # # (c) 2015, René Moser <mail@renemoser.net> # # This code is part of Ansible, but is an independent component. # This particular file snippet, and this file snippet only, is BSD licensed. # Modules you write using this snippet, which is embedded dynamically by Ansible # still belong to the aut...
gpl-3.0
-3,366,101,794,507,996,000
34.923913
110
0.571407
false
zasdfgbnm/tensorflow
tensorflow/python/ops/nn_batchnorm_test.py
5
30554
# Copyright 2015 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
8,058,398,854,068,209,000
43.539359
80
0.595699
false
nimbis/django-cms
cms/management/commands/subcommands/tree.py
4
5434
# -*- coding: utf-8 -*- from __future__ import absolute_import, print_function, unicode_literals from collections import OrderedDict from cms.models import Page, CMSPlugin from .base import SubcommandsCommand def get_descendant_ids(root_id): """ Returns the a generator of primary keys which represent d...
bsd-3-clause
-8,145,501,329,662,888,000
34.285714
84
0.552079
false
raboof/supybot
plugins/Alias/config.py
15
2179
### # Copyright (c) 2005, Jeremiah Fincher # 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 list of conditi...
bsd-3-clause
-6,640,934,482,933,848,000
48.522727
79
0.770078
false
alexforencich/python-ivi
ivi/tektronix/tektronixDPO4032.py
2
1646
""" Python Interchangeable Virtual Instrument Library Copyright (c) 2016-2017 Alex Forencich 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...
mit
647,397,318,233,043,200
38.190476
86
0.753949
false
petrutlucian94/nova
nova/objects/__init__.py
9
2746
# Copyright 2013 IBM Corp. # # 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 agree...
apache-2.0
8,639,524,802,835,525,000
43.290323
78
0.678077
false
40023154/0628
static/Brython3.1.1-20150328-091302/Lib/warnings.py
752
13825
"""Python part of the warnings subsystem.""" # Note: function level imports should *not* be used # in this module as it may cause import lock deadlock. # See bug 683658. import linecache import sys __all__ = ["warn", "showwarning", "formatwarning", "filterwarnings", "resetwarnings", "catch_warnings"] def...
gpl-3.0
2,274,583,030,067,186,400
34.178117
79
0.605425
false
coronary/RandomEpisode
depends/Lib/site-packages/setuptools/__init__.py
130
5019
"""Extensions to the 'distutils' for large or complex distributions""" import os import functools import distutils.core import distutils.filelist from distutils.util import convert_path from fnmatch import fnmatchcase from six.moves import filter, map import setuptools.version from setuptools.extension import Extens...
mit
-7,721,178,500,660,913,000
30.36875
79
0.630803
false
tangfeixiong/nova
nova/tests/unit/objects/test_objects.py
2
59782
# Copyright 2013 IBM Corp. # # 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 agree...
apache-2.0
7,287,952,346,851,566,000
40.030885
79
0.597186
false
RachitKansal/scikit-learn
examples/mixture/plot_gmm_classifier.py
250
3918
""" ================== GMM classification ================== Demonstration of Gaussian mixture models for classification. See :ref:`gmm` for more information on the estimator. Plots predicted labels on both training and held out test data using a variety of GMM classifiers on the iris dataset. Compares GMMs with sp...
bsd-3-clause
7,780,601,851,362,544,000
31.65
77
0.649311
false
jboeuf/grpc
src/python/grpcio_testing/grpc_testing/_common.py
27
4481
# Copyright 2017 gRPC authors. # # 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...
apache-2.0
-6,973,001,175,500,439,000
26.660494
77
0.665923
false
amith01994/intellij-community
python/lib/Lib/site-packages/django/contrib/contenttypes/tests.py
87
2781
from django import db from django.conf import settings from django.contrib.contenttypes.models import ContentType from django.contrib.sites.models import Site from django.contrib.contenttypes.views import shortcut from django.core.exceptions import ObjectDoesNotExist from django.http import HttpRequest from django.test...
apache-2.0
-1,773,615,672,891,090,400
39.304348
96
0.666667
false
nelson-liu/scikit-learn
sklearn/cluster/affinity_propagation_.py
30
10689
"""Affinity Propagation clustering algorithm.""" # Author: Alexandre Gramfort alexandre.gramfort@inria.fr # Gael Varoquaux gael.varoquaux@normalesup.org # License: BSD 3 clause import numpy as np from ..base import BaseEstimator, ClusterMixin from ..utils import as_float_array, check_array from ..utils.valid...
bsd-3-clause
-33,798,193,160,427,796
31.990741
79
0.597717
false
ztemt/NX505J_5.1_kernel
scripts/build-all.py
1474
10189
#! /usr/bin/env python # Copyright (c) 2009-2013, The Linux Foundation. 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 # ...
gpl-2.0
5,816,693,650,134,767,000
34.134483
80
0.58465
false
steynovich/ansible-modules-extras
cloud/vmware/vmware_vsan_cluster.py
64
3944
#!/usr/bin/python # -*- coding: utf-8 -*- # (c) 2015, Russell Teague <rteague2 () csc.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 ...
gpl-3.0
6,137,269,441,481,967,000
29.338462
90
0.681542
false
PictureYo-self/Picture-Yo-self
code/colorpicker10.py
6
2691
#// screen manager imported from http://kivy.org/docs/api-kivy.uix.screenmanager.html from kivy.app import App from kivy.uix.floatlayout import FloatLayout from kivy.uix.boxlayout import BoxLayout from kivy.lang import Builder from random import random from kivy.uix.widget import Widget from kivy.graphics import Color...
gpl-2.0
-4,871,375,092,691,057,000
27.62766
85
0.708658
false
widdowquinn/THAPBI-pycits
pycits/cd_hit.py
1
3265
#!/usr/bin/env python # # cd_hit * (clusterassembled reads with database) # cd_hit_est used as this is the nt clustering tool # http://weizhongli-lab.org/lab-wiki/doku.php?id=cd-hit-user-guide # follow this link to get the download. # https://github.com/weizhongli/cdhit # cd_hit-0.9.10-bin-64.tar.gz # # (c) The James H...
mit
5,297,080,511,318,774,000
32.316327
79
0.583461
false
mbrukman/flocker
admin/functional/test_aws.py
14
1570
import shutil import os from unittest import skipIf import boto from effect import Effect, sync_perform, ComposedDispatcher from twisted.python.filepath import FilePath from twisted.trial.unittest import SynchronousTestCase from ..aws import boto_dispatcher, UploadToS3 from flocker.provision._effect import dispatcher...
apache-2.0
-4,089,517,158,436,252,700
29.192308
78
0.657962
false
hughperkins/kgsgo-dataset-preprocessor
dataset_partitioner.py
1
7011
#!/usr/bin/python # # Copyright Hugh Perkins 2015 hughperkins at gmail # # This Source Code Form is subject to the terms of the Mozilla Public License, # v. 2.0. If a copy of the MPL was not distributed with this file, You can # obtain one at http://mozilla.org/MPL/2.0/. # goal of this is to partition the data into ...
mpl-2.0
7,069,289,450,345,646,000
36.693548
105
0.637712
false
mattlevesque/py-shrt-lkr
py_shrt_lkr/tests_ORG.py
2
1767
import unittest import transaction from pyramid import testing from .core.models import DBSession # class TestMyViewSuccessCondition(unittest.TestCase): # def setUp(self): # self.config = testing.setUp() # from sqlalchemy import create_engine # engine = create_engine('sqlite://') # from .models import ( # ...
gpl-2.0
-24,629,280,700,605,896
23.541667
68
0.696661
false
BT-rmartin/odoo
addons/account/wizard/account_move_line_select.py
385
2800
# -*- coding: utf-8 -*- ############################################################################## # # OpenERP, Open Source Management Solution # Copyright (C) 2004-2010 Tiny SPRL (<http://tiny.be>). # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU...
agpl-3.0
-1,376,323,157,273,474,000
38.43662
91
0.585
false
asposewords/Aspose_Words_Cloud
Examples/Python/Examples/GetSpecificRunOfParagraphFromWordDocument.py
2
1537
import asposewordscloud from asposewordscloud.WordsApi import WordsApi from asposewordscloud.WordsApi import ApiException from asposewordscloud.models import RunResponse import asposestoragecloud from asposestoragecloud.StorageApi import StorageApi from asposestoragecloud.StorageApi import ResponseMessage apiKey = "...
mit
2,533,365,269,384,234,500
33.155556
96
0.748861
false
mhaessig/servo
tests/wpt/css-tests/tools/pywebsocket/src/setup.py
434
2863
#!/usr/bin/env python # # Copyright 2012, 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 list...
mpl-2.0
8,322,786,399,046,040,000
37.689189
75
0.699965
false
lfz/Guided-Denoise
Attackset/fgsm_inresv2_random/attack_iter.py
1
10010
"""Implementation of sample attack.""" from __future__ import absolute_import from __future__ import division from __future__ import print_function import os import numpy as np from scipy.misc import imread from scipy.misc import imsave from nets import inception_v3, inception_v4, inception_resnet_v2, resnet_v2 fro...
apache-2.0
-4,969,050,275,284,841,000
36.490637
117
0.625774
false
Captnoord/openpli-enigma2
lib/python/Screens/ChoiceBox.py
10
4653
from Screens.Screen import Screen from Components.ActionMap import NumberActionMap from Components.Label import Label from Components.ChoiceList import ChoiceEntryComponent, ChoiceList from Components.Sources.StaticText import StaticText import enigma class ChoiceBox(Screen): def __init__(self, session, title = "", l...
gpl-2.0
3,890,250,496,846,714,400
27.722222
133
0.649688
false
hpcuantwerpen/easybuild-easyblocks
easybuild/easyblocks/b/blacs.py
3
8124
## # Copyright 2009-2021 Ghent University # # This file is part of EasyBuild, # originally created by the HPC team of Ghent University (http://ugent.be/hpc/en), # with support of Ghent University (http://ugent.be/hpc), # the Flemish Supercomputer Centre (VSC) (https://www.vscentrum.be), # Flemish Research Foundation (F...
gpl-2.0
-2,881,020,283,697,042,400
35.430493
119
0.555268
false
cjayb/mne-python
tutorials/source-modeling/plot_eeg_no_mri.py
4
2723
# -*- coding: utf-8 -*- """ .. _tut-eeg-fsaverage-source-modeling: EEG forward operator with a template MRI ======================================== This tutorial explains how to compute the forward operator from EEG data using the standard template MRI subject ``fsaverage``. .. caution:: Source reconstruction witho...
bsd-3-clause
-7,828,864,551,540,037,000
32.207317
78
0.63643
false
artas360/pythran
pythran/tests/cases/periodic_dist.py
5
1259
#pythran export dist(float [], float[], float[], int, bool, bool, bool) #runas import numpy as np ; N = 20 ; x = np.arange(0., N, 0.1) ; L = 4 ; periodic = True ; dist(x, x, x, L,periodic, periodic, periodic) #bench import numpy as np ; N = 300 ; x = np.arange(0., N, 0.1) ; L = 4 ; periodic = True ; dist(x, x, x, L,per...
bsd-3-clause
1,999,330,602,204,667,100
34.971429
172
0.585385
false
emedvedev/st2
st2actions/tests/unit/test_async_runner.py
8
1802
# Licensed to the StackStorm, Inc ('StackStorm') 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 use th...
apache-2.0
-2,797,841,502,659,849,000
31.763636
77
0.68091
false
SectorLabs/django-postgres-extra
psqlextra/partitioning/manager.py
1
4538
from typing import List, Optional, Tuple from django.db import connections from psqlextra.models import PostgresPartitionedModel from .config import PostgresPartitioningConfig from .constants import AUTO_PARTITIONED_COMMENT from .error import PostgresPartitioningError from .partition import PostgresPartition from .p...
mit
6,080,695,867,918,829,000
32.124088
78
0.612164
false
nealegibson/Infer
src/GPKernelFunctions.py
1
10701
""" Useful (non-periodic) GP Kernel Functions """ import numpy as np import scipy.spatial from scipy.special import gamma,kv ################################################################################################### #Exponential class def SqExponentialRad(X,Y,theta,white_noise=False): """ Standard square...
gpl-3.0
-2,814,045,030,075,659,300
30.289474
100
0.605271
false
dsajkl/reqiop
common/lib/xmodule/xmodule/progress.py
127
4896
''' Progress class for modules. Represents where a student is in a module. Useful things to know: - Use Progress.to_js_status_str() to convert a progress into a simple status string to pass to js. - Use Progress.to_js_detail_str() to convert a progress into a more detailed string to pass to js. In particular...
agpl-3.0
-8,059,264,056,538,215,000
29.409938
84
0.571078
false
tdr130/pupy
pupy/modules/socks5proxy.py
6
7573
# -*- coding: UTF8 -*- # -------------------------------------------------------------- # Copyright (c) 2015, Nicolas VERDIER (contact@n1nj4.eu) # All rights reserved. # # Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: # ...
bsd-3-clause
-2,831,836,035,528,928,000
34.890995
756
0.710022
false
darshanthaker/nupic
external/linux32/lib/python2.6/site-packages/matplotlib/afm.py
69
15057
""" This is a python interface to Adobe Font Metrics Files. Although a number of other python implementations exist (and may be more complete than mine) I decided not to go with them because either they were either 1) copyrighted or used a non-BSD compatible license 2) had too many dependencies and I wanted a fr...
agpl-3.0
8,105,868,437,981,154,000
29.479757
109
0.561998
false
nejucomo/sgg
spiralgalaxygame/demiurge.py
1
4151
import random from math import sin, pi from spiralgalaxygame.body import Body, BodyKind from spiralgalaxygame.geometry import Vector, Circle from spiralgalaxygame.discdist import DiscreteDistribution def generate_galaxy_bodies(randgen = random.random, parentmu = 1000, ...
agpl-3.0
2,978,818,440,894,455,000
37.794393
107
0.634064
false
badjr/pysal
pysal/core/IOHandlers/mat.py
20
4377
import pysal import os.path import scipy.io as sio import pysal.core.FileIO as FileIO from pysal.weights import W from pysal.weights.util import full, full2W from warnings import warn __author__ = "Myunghwa Hwang <mhwang4@gmail.com>" __all__ = ["MatIO"] class MatIO(FileIO.FileIO): """ Opens, reads, and write...
bsd-3-clause
425,294,960,405,319,200
24.011429
81
0.570939
false
rpoleski/MulensModel
examples/use_cases/use_case_14_coordinate_system.py
1
1988
""" Use Case 14 - jcy MulensModel will be written assuming the coordinate system (t0,u0,alpha) are defined relative to the center of mass. This is not always the most efficient choice for fitting. This use case covers the conversion from center of magnification coordinates to center of mass coordinates. Essentially, i...
mit
4,294,409,651,524,645,000
29.584615
78
0.666499
false
kmoocdev2/edx-platform
cms/djangoapps/models/settings/course_metadata.py
1
8977
""" Django module for Course Metadata class -- manages advanced settings and related parameters """ from django.conf import settings from django.utils.translation import ugettext as _ from six import text_type from xblock.fields import Scope from xblock_django.models import XBlockStudioConfigurationFlag from xmodule.m...
agpl-3.0
1,728,035,875,643,045,600
36.560669
101
0.605993
false
rebstar6/servo
python/servo/devenv_commands.py
5
6435
# Copyright 2013 The Servo Project Developers. See the COPYRIGHT # file at the top-level directory of this distribution. # # Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or # http://www.apache.org/licenses/LICENSE-2.0> or the MIT license # <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your #...
mpl-2.0
5,119,622,410,882,245,000
37.532934
115
0.573737
false
keyurpatel076/MissionPlannerGit
Lib/site-packages/scipy/fftpack/pseudo_diffs.py
57
12479
""" Differential and pseudo-differential operators. """ # Created by Pearu Peterson, September 2002 __all__ = ['diff', 'tilbert','itilbert','hilbert','ihilbert', 'cs_diff','cc_diff','sc_diff','ss_diff', 'shift'] from numpy import pi, asarray, sin, cos, sinh, cosh, tanh, iscomplexobj i...
gpl-3.0
-1,442,905,106,283,307,800
27.886574
80
0.570639
false