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
cainmatt/django
django/db/models/fields/related.py
5
118182
from __future__ import unicode_literals import warnings from functools import partial from operator import attrgetter from django import forms from django.apps import apps from django.core import checks, exceptions from django.core.exceptions import FieldDoesNotExist from django.db import connection, connections, rou...
bsd-3-clause
3,037,988,771,969,174,500
41.328797
119
0.568327
false
Nebelhom/WordPuzzleCreator
lib/werkzeug/debug/console.py
314
5557
# -*- coding: utf-8 -*- """ werkzeug.debug.console ~~~~~~~~~~~~~~~~~~~~~~ Interactive console support. :copyright: (c) 2013 by the Werkzeug Team, see AUTHORS for more details. :license: BSD. """ import sys import code from types import CodeType from werkzeug.utils import escape from werkzeug.loca...
apache-2.0
6,249,035,870,519,065,000
25.336493
76
0.573691
false
suncycheng/intellij-community
python/testData/inspections/PyPropertyDefinitionInspection26/test.py
22
6220
import abc class A(object): def __init__(self): self._x = 1 @property def foo(self): return self._x @foo.setter def foo(self, x): self._x = x @foo.deleter def foo(self): pass @property def boo(self): return self._x <warning descr="Names of function and decorator don't matc...
apache-2.0
-2,405,500,138,406,625,300
19.528053
130
0.592444
false
forrestv/bitcoin
contrib/testgen/gen_base58_test_vectors.py
1000
4343
#!/usr/bin/env python ''' Generate valid and invalid base58 address and private key test vectors. Usage: gen_base58_test_vectors.py valid 50 > ../../src/test/data/base58_keys_valid.json gen_base58_test_vectors.py invalid 50 > ../../src/test/data/base58_keys_invalid.json ''' # 2012 Wladimir J. van der Laan # R...
mit
-951,837,210,162,159,000
33.468254
97
0.591066
false
Bismarrck/tensorflow
tensorflow/python/debug/cli/evaluator_test.py
89
11162
# Copyright 2017 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
6,509,914,859,158,450,000
40.649254
80
0.662247
false
giacomov/astromodels
astromodels/core/parameter_transformation.py
2
1122
import numpy as np class ParameterTransformation(object): def forward(self, external_value): raise NotImplementedError("You have to implement this") def backward(self, internal_value): raise NotImplementedError("You have to implement this") class LogarithmicTransformation(ParameterTransf...
bsd-3-clause
4,455,478,577,003,843,600
21.44
80
0.699643
false
avadacatavra/servo
tests/wpt/web-platform-tests/tools/manifest/vcs.py
11
3257
import os import subprocess from .sourcefile import SourceFile class Git(object): def __init__(self, repo_root, url_base): self.root = os.path.abspath(repo_root) self.git = Git.get_func(repo_root) self.url_base = url_base @staticmethod def get_func(repo_path): def git(cmd...
mpl-2.0
-6,813,501,468,117,658,000
33.284211
97
0.498618
false
lthurlow/Network-Grapher
proj/external/numpy-1.7.0/numpy/distutils/fcompiler/absoft.py
89
5525
# http://www.absoft.com/literature/osxuserguide.pdf # http://www.absoft.com/documentation.html # Notes: # - when using -g77 then use -DUNDERSCORE_G77 to compile f2py # generated extension modules (works for f2py v2.45.241_1936 and up) import os from numpy.distutils.cpuinfo import cpu from numpy.distutils.fcompile...
mit
-3,692,320,067,876,852,700
33.748428
155
0.527783
false
sugartom/tensorflow-alien
tensorflow/examples/learn/text_classification.py
39
5106
# Copyright 2016 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 appl...
apache-2.0
660,270,608,775,467,100
33.5
80
0.707991
false
biicode/bii-server
test/model/social_account_test.py
2
2004
import unittest from biicode.server.model.social_account import SocialAccount, SocialAccountToken from biicode.server.model.epoch.utc_datetime import UtcDatetime import datetime class SocialAccountTest(unittest.TestCase): def setUp(self): self.utc_datetime = UtcDatetime.deserialize(datetime.datetime.now()...
mit
-9,038,586,863,494,634,000
44.545455
96
0.616267
false
PythonicNinja/django-ddp
dddp/management/commands/dddp.py
1
5318
"""Django DDP WebSocket service.""" from __future__ import print_function, absolute_import import collections import inspect import optparse import random import signal import socket from django.core.management.base import BaseCommand from django.db import connection, close_old_connections from django.utils.module_l...
mit
2,294,262,070,700,432,100
31.036145
80
0.573524
false
mrkm4ntr/incubator-airflow
airflow/migrations/versions/03bc53e68815_add_sm_dag_index.py
8
1274
# 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
-6,633,541,885,562,129,000
30.85
67
0.744113
false
stuarteberg/numpy
numpy/lib/tests/test_stride_tricks.py
40
14732
from __future__ import division, absolute_import, print_function import numpy as np from numpy.testing import ( run_module_suite, assert_equal, assert_array_equal, assert_raises, assert_ ) from numpy.lib.stride_tricks import ( as_strided, broadcast_arrays, _broadcast_shape, broadcast_to ) def assert_s...
bsd-3-clause
6,835,383,099,777,426,000
33.260465
82
0.530546
false
oseledets/pybtex
pybtex/database/input/bibtexml.py
1
2801
# Copyright (c) 2006, 2007, 2008, 2009, 2010, 2011, 2012 Andrey Golovizin # # 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 ...
mit
3,705,326,811,759,129,600
38.450704
77
0.63513
false
zzzeek/test
mako/ext/beaker_cache.py
2
1947
"""Provide a :class:`.CacheImpl` for the Beaker caching system.""" from mako import exceptions from mako.cache import CacheImpl _beaker_cache = None class BeakerCacheImpl(CacheImpl): """A :class:`.CacheImpl` provided for the Beaker caching system. This plugin is used by default, based on the default ...
mit
390,992,043,370,332,860
33.157895
79
0.577298
false
espadrine/opera
chromium/src/third_party/libvpx/source/libvpx/third_party/googletest/src/xcode/Scripts/versiongenerate.py
3088
4536
#!/usr/bin/env python # # Copyright 2008, 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...
bsd-3-clause
7,998,095,299,691,934,000
44.36
80
0.737654
false
xombiemp/CouchPotatoServer
libs/requests/sessions.py
43
24273
# -*- coding: utf-8 -*- """ requests.session ~~~~~~~~~~~~~~~~ This module provides a Session object to manage and persist settings across requests (cookies, auth, proxies). """ import os from collections import Mapping from datetime import datetime from .auth import _basic_auth_str from .compat import cookielib, Or...
gpl-3.0
-6,701,061,798,473,751,000
34.641703
115
0.604606
false
ai-ku/langvis
jython-2.1/Lib/gzip.py
4
12370
"""Functions that read and write gzipped files. The user of the file doesn't have to worry about the compression, but random access is not allowed.""" # based on Andrew Kuchling's minigzip.py distributed with the zlib module import struct, sys, time import zlib import __builtin__ __all__ = ["GzipFile","o...
mit
-2,339,869,515,513,239,000
32.456825
79
0.503476
false
lambder/bigcouch
couchjs/scons/scons-local-2.0.1/SCons/Options/BoolOption.py
61
2003
# # Copyright (c) 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010 The SCons Foundation # # 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 li...
apache-2.0
-7,988,955,372,094,683,000
39.06
97
0.752371
false
CyanogenMod/android_external_chromium_org
tools/android/adb_profile_chrome/profiler.py
9
2949
# Copyright 2014 The Chromium Authors. All rights reserved. # Use of this source code is governed by a BSD-style license that can be # found in the LICENSE file. import os from adb_profile_chrome import trace_packager from adb_profile_chrome import ui from pylib import constants def _StartTracing(controllers, inte...
bsd-3-clause
8,712,717,741,996,541,000
32.896552
80
0.682943
false
Zord13appdesa/python-for-android
python-modules/twisted/twisted/test/test_socks.py
59
17748
# Copyright (c) 2001-2010 Twisted Matrix Laboratories. # See LICENSE for details. """ Tests for L{twisted.protocol.socks}, an implementation of the SOCKSv4 and SOCKSv4a protocols. """ import struct, socket from twisted.trial import unittest from twisted.test import proto_helpers from twisted.internet import defer, a...
apache-2.0
-6,670,363,254,858,823,000
34.638554
80
0.595391
false
sushramesh/lwc
lib/python2.7/site-packages/pip/utils/outdated.py
191
5555
from __future__ import absolute_import import datetime import json import logging import os.path import sys from pip._vendor import lockfile from pip._vendor.packaging import version as packaging_version from pip.compat import total_seconds, WINDOWS from pip.index import PyPI from pip.locations import USER_CACHE_DIR...
mit
-1,358,175,049,972,279,800
33.079755
78
0.569577
false
certik/python-theora
examples/chop.py
1
1424
#! /usr/bin/env python """ Analog to the oggz-chop program. Example: examples/chop.py -o s.ogv -s 20 -e 30 video.ogv See "./chop.py -h" for help. """ from optparse import OptionParser from theora import Theora, TheoraEncoder def convert(infile, outfile, start, end): print "converting %s to %s, between the tim...
bsd-3-clause
-4,427,279,083,637,898,000
28.666667
80
0.614466
false
tiagoarasilva/django-boilerplate
project_name/lib/audit/middleware.py
1
3075
# Copyright (c) 2009 James Aylett <http://tartarus.org/james/computers/django/> # # 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 ri...
mit
2,165,794,235,012,168,400
44.590909
104
0.694959
false
jpush/jbox
Server/venv/lib/python3.5/site-packages/pip/_vendor/requests/packages/chardet/universaldetector.py
1776
6840
######################## 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
-4,015,657,032,522,133,500
39.235294
86
0.556579
false
xindus40223115/w16b_test
static/Brython3.1.0-20150301-090019/Lib/unittest/test/test_assertions.py
738
15398
import datetime import warnings import unittest from itertools import product class Test_Assertions(unittest.TestCase): def test_AlmostEqual(self): self.assertAlmostEqual(1.00000001, 1.0) self.assertNotAlmostEqual(1.0000001, 1.0) self.assertRaises(self.failureException, ...
gpl-3.0
-6,973,187,124,517,343,000
41.891365
92
0.51195
false
akosel/incubator-airflow
airflow/www_rbac/decorators.py
9
4418
# -*- coding: utf-8 -*- # # 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 #...
apache-2.0
-9,051,525,222,329,713,000
34.344
87
0.562698
false
kuangrewawa/OnosFw
tools/test/topos/obelisk.py
38
2612
#!/usr/bin/env python from mininet.topo import Topo class ObeliskTopo( Topo ): def __init__( self ): Topo.__init__( self ) topSwitch = self.addSwitch('s1',dpid='1000'.zfill(16)) leftTopSwitch = self.addSwitch('s2',dpid='2000'.zfill(16)) rightTopSwitch = self.addSwitch('s5',dpid='50...
apache-2.0
1,814,563,503,752,382,500
36.314286
81
0.617534
false
CeltonMcGrath/TACTIC
src/pyasm/biz/preference.py
6
3572
########################################################### # # Copyright (c) 2005, Southpaw Technology # All Rights Reserved # # PROPRIETARY INFORMATION. This software is proprietary to # Southpaw Technology, and is not to be reproduced, transmitted, # or disclosed in any way without written permi...
epl-1.0
-4,967,089,896,131,039,000
27.125984
78
0.581747
false
AnuchitPrasertsang/robotframework-selenium2library
src/Selenium2Library/locators/tableelementfinder.py
31
3986
from selenium.common.exceptions import NoSuchElementException from Selenium2Library import utils from elementfinder import ElementFinder class TableElementFinder(object): def __init__(self, element_finder=None): if not element_finder: element_finder = ElementFinder() self._element_find...
apache-2.0
-1,989,258,441,963,690,500
42.326087
88
0.558956
false
Ldpe2G/mxnet
python/mxnet/rtc.py
15
4121
"""Interface to runtime cuda kernel compile module.""" from __future__ import absolute_import import ctypes from .base import _LIB, NDArrayHandle, RtcHandle, mx_uint, c_array, check_call class Rtc(object): """MXRtc object in mxnet. This class allow you to write CUDA kernels in Python and call them with ND...
apache-2.0
-3,610,586,737,455,926,000
44.285714
95
0.499879
false
idem2lyon/persomov
libs/cache/__init__.py
99
8343
""" copied from werkzeug.contrib.cache ~~~~~~~~~~~~~~~~~~~~~~ :copyright: (c) 2011 by the Werkzeug Team, see AUTHORS for more details. :license: BSD, see LICENSE for more details. """ from cache.posixemulation import rename from itertools import izip from time import time import os import re import...
gpl-3.0
-8,850,912,241,227,319,000
30.843511
87
0.548843
false
tkjone/guides-django
series_2/p_03/myproject/server/config/settings/base.py
4
8713
# -*- coding: utf-8 -*- """ Django settings for myproject project. For more information on this file, see https://docs.djangoproject.com/en/1.9/topics/settings/ For the full list of settings and their values, see https://docs.djangoproject.com/en/1.9/ref/settings/ """ from __future__ import absolute_import, unicode_...
mit
8,342,975,429,903,870,000
29.465035
100
0.473201
false
gangadhar-kadam/smrterp
erpnext/buying/doctype/purchase_order/purchase_order.py
3
9024
# Copyright (c) 2013, Web Notes Technologies Pvt. Ltd. and Contributors # License: GNU General Public License v3. See license.txt from __future__ import unicode_literals import frappe from frappe.utils import cstr, flt from frappe import msgprint, _, throw from frappe.model.mapper import get_mapped_doc from erpnext.co...
agpl-3.0
-7,721,533,082,421,722,000
33.841699
133
0.669991
false
ericmckean/syzygy
syzygy/build/generate_coverage.py
4
15218
#!python # 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 required by applicable...
apache-2.0
3,955,026,010,808,740,000
34.390698
79
0.636417
false
rushiagr/keystone
keystone/tests/unit/test_contrib_s3_core.py
10
2130
# Copyright 2012 OpenStack Foundation # # 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...
apache-2.0
6,060,047,175,400,259,000
37.727273
75
0.6277
false
molobrakos/home-assistant
homeassistant/components/nest/binary_sensor.py
7
5052
"""Support for Nest Thermostat binary sensors.""" from itertools import chain import logging from homeassistant.components.binary_sensor import BinarySensorDevice from homeassistant.const import CONF_MONITORED_CONDITIONS from . import ( CONF_BINARY_SENSORS, DATA_NEST, DATA_NEST_CONFIG, NestSensorDevice) _LOGGER ...
apache-2.0
-213,200,203,026,963,200
30.974684
79
0.606295
false
JohnOrlando/gnuradio-bitshark
gnuradio-examples/python/usrp/usrp_benchmark_usb.py
11
3302
#!/usr/bin/env python # # Copyright 2004,2005 Free Software Foundation, Inc. # # This file is part of GNU Radio # # GNU Radio 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, or (at your opt...
gpl-3.0
-3,161,924,546,570,675,700
30.150943
86
0.645366
false
ioram7/keystone-federado-pgid2013
build/paste/build/lib.linux-x86_64-2.7/paste/debug/testserver.py
28
3385
# (c) 2005 Clark C. Evans # This module is part of the Python Paste Project and is released under # the MIT License: http://www.opensource.org/licenses/mit-license.php # This code was written with funding by http://prometheusresearch.com """ WSGI Test Server This builds upon paste.util.baseserver to customize it for r...
apache-2.0
-3,639,080,563,956,388,000
35.397849
74
0.636337
false
bjori/grpc
src/python/grpcio_test/grpc_test/framework/foundation/_later_test.py
35
5102
# Copyright 2015, 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 of conditions and the f...
bsd-3-clause
5,994,615,253,012,325,000
32.788079
80
0.698942
false
dfc/beets
test/test_info.py
25
3581
# This file is part of beets. # Copyright 2015, Thomas Scholtes. # # 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,...
mit
1,886,791,080,089,099,800
30.973214
71
0.627199
false
parmegv/keymanager
setup.py
1
4865
# -*- coding: utf-8 -*- # setup.py # Copyright (C) 2013 LEAP # # 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 ...
gpl-3.0
-2,928,850,491,316,940,000
31.218543
77
0.674203
false
nikolas/django-extensions
django_extensions/mongodb/models.py
28
2544
""" Django Extensions abstract base mongoengine Document classes. """ import datetime from django.utils.translation import ugettext_lazy as _ from mongoengine.document import Document from mongoengine.fields import DateTimeField, IntField, StringField from mongoengine.queryset import QuerySetManager from django_exten...
mit
5,918,699,271,887,179,000
33.849315
111
0.705582
false
aflaxman/scikit-learn
sklearn/metrics/regression.py
47
19967
"""Metrics to assess performance on regression task Functions named as ``*_score`` return a scalar value to maximize: the higher the better Function named as ``*_error`` or ``*_loss`` return a scalar value to minimize: the lower the better """ # Authors: Alexandre Gramfort <alexandre.gramfort@inria.fr> # Ma...
bsd-3-clause
4,722,567,385,122,498,000
34.029825
79
0.589122
false
tima/ansible
test/units/module_utils/facts/test_ansible_collector.py
25
12747
# -*- coding: utf-8 -*- # # # 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 later version. # # Ansible is distributed in the hope that it wi...
gpl-3.0
-5,755,613,756,221,977,000
36.055233
101
0.651369
false
fujicoin/electrum-fjc
electrum/x509.py
3
11467
#!/usr/bin/env python # # Electrum - lightweight Bitcoin client # Copyright (C) 2014 Thomas Voegtlin # # 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...
mit
-5,439,504,780,668,002,000
31.856734
139
0.574518
false
slyphon/pants
src/python/pants/goal/run_tracker.py
4
13092
# coding=utf-8 # Copyright 2014 Pants project contributors (see CONTRIBUTORS.md). # Licensed under the Apache License, Version 2.0 (see LICENSE). from __future__ import (absolute_import, division, generators, nested_scopes, print_function, unicode_literals, with_statement) import json import o...
apache-2.0
3,802,772,412,755,832,300
39.036697
100
0.67736
false
wgwoods/anaconda
dracut/driver_updates.py
3
21945
#!/usr/bin/python3 # # Copyright (C) 2015 by Red Hat, Inc. All rights reserved. # # 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 your option) any late...
gpl-2.0
4,975,429,610,738,657,000
33.289063
90
0.61964
false
anhngduc/google-python-exersice
google-python-exercises/basic/solution/string2.py
208
3094
#!/usr/bin/python2.4 -tt # Copyright 2010 Google Inc. # Licensed under the Apache License, Version 2.0 # http://www.apache.org/licenses/LICENSE-2.0 # Google's Python Class # http://code.google.com/edu/languages/google-python-class/ # Additional basic string exercises # D. verbing # Given a string, if its length is a...
apache-2.0
4,579,872,254,210,249,700
28.188679
77
0.636393
false
mtougeron/python-openstacksdk
openstack/tests/unit/auth/test_service_filter.py
2
7250
# 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 # distributed under t...
apache-2.0
-6,729,216,327,489,510,000
44.886076
78
0.641241
false
trac-hacks/trac-oidc
trac_oidc/tests/test_authenticator.py
1
7340
# -*- coding: utf-8 -*- # # Copyright (C) 2015 Geoffrey T. Dairiki # """ """ from __future__ import absolute_import import json import logging from urlparse import parse_qsl, urlsplit, urlunsplit import mock from oauth2client.client import FlowExchangeError import pytest @pytest.fixture def redirect_url(): retu...
bsd-3-clause
5,488,640,400,473,788,000
36.641026
77
0.633515
false
diagramsoftware/odoo
addons/portal/tests/__init__.py
261
1078
# -*- coding: utf-8 -*- ############################################################################## # # OpenERP, Open Source Business Applications # Copyright (c) 2012-TODAY OpenERP S.A. <http://openerp.com> # # This program is free software: you can redistribute it and/or modify # it under the terms of ...
agpl-3.0
5,437,878,046,700,597,000
45.869565
78
0.618738
false
pratikmallya/hue
desktop/core/ext-py/python-ldap-2.3.13/Lib/ldif.py
44
13729
""" ldif - generate and parse LDIF data (see RFC 2849) See http://www.python-ldap.org/ for details. $Id: ldif.py,v 1.56 2010/07/19 08:23:22 stroeder Exp $ Python compability note: Tested with Python 2.0+, but should work with Python 1.5.2+. """ __version__ = '2.3.12' __all__ = [ # constants 'ldif_pattern', #...
apache-2.0
-5,334,279,743,565,623,000
29.173626
109
0.637774
false
kennethreitz/python-logplex
logplex/packages/requests/packages/charade/eucjpprober.py
206
3768
######################## BEGIN LICENSE BLOCK ######################## # The Original Code is mozilla.org 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 Reserved. ...
bsd-2-clause
4,596,553,156,639,948,000
39.866667
78
0.603503
false
xin3liang/platform_external_chromium_org_third_party_WebKit
Tools/Scripts/webkitpy/style/checkers/xcodeproj_unittest.py
48
3070
# Copyright (C) 2011 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: # 1. Redistributions of source code must retain the above copyright # notice, this list of conditions and the ...
bsd-3-clause
-8,856,060,458,466,783,000
43.492754
101
0.715961
false
Bysmyyr/blink-crosswalk
Tools/Scripts/webkitpy/performance_tests/perftestsrunner_unittest.py
17
38706
# Copyright (C) 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 of conditions and the ...
bsd-3-clause
-7,066,038,236,893,051,000
49.728702
201
0.662223
false
Lab603/PicEncyclopedias
jni-build/jni/include/tensorflow/python/client/session.py
3
47046
# 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...
mit
-141,476,206,813,532,000
36.278922
114
0.655911
false
nischalsheth/contrail-controller
src/config/schema-transformer/logger.py
3
5204
# vim: tabstop=4 shiftwidth=4 softtabstop=4 # # Copyright (c) 2016 Juniper Networks, Inc. All rights reserved. # """ Schema Transformer monitor logger """ from sandesh_common.vns.ttypes import Module from cfgm_common.vnc_logger import ConfigServiceLogger from schema_transformer.config_db import DBBaseST, VirtualNetw...
apache-2.0
3,715,075,726,233,246,700
39.65625
79
0.619331
false
promptworks/keystone
keystone/cli.py
2
22753
# Copyright 2012 OpenStack Foundation # # 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...
apache-2.0
6,530,400,440,548,993,000
37.176174
79
0.598646
false
phalt/django
tests/forms_tests/tests/tests.py
6
16659
# -*- coding: utf-8 -*- from __future__ import unicode_literals import datetime from django.core.files.uploadedfile import SimpleUploadedFile from django.db import models from django.forms import ( CharField, FileField, Form, ModelChoiceField, ModelForm, ) from django.forms.models import ModelFormMetaclass from d...
bsd-3-clause
-8,607,105,577,402,918,000
41.068528
127
0.643379
false
femtotrader/rabbit4mt4
receive/Python/receive_logs.py
1
2274
#!/usr/bin/env python # -*- coding: utf-8 -*- import logging import traceback import logging.config import pika import sys import argparse import datetime def get_logging_level_from_name(name): try: name = name.upper() except: name = "CRITICAL" level = logging.getLevelName(name) ...
gpl-2.0
6,788,723,334,755,035,000
30.164384
444
0.633685
false
pganssle/bdateutil
tests.py
1
17387
# bdateutil # --------- # Adds business day logic and improved data type flexibility to # python-dateutil. 100% backwards compatible with python-dateutil, # simply replace dateutil imports with bdateutil. # # Author: ryanss <ryanssdev@icloud.com> # Website: https://github.com/ryanss/bdateutil # License: MIT (s...
mit
-2,911,864,845,392,492,500
46.247283
78
0.525047
false
ernw/dizzy
dizzy/interaction_state.py
1
2155
# interaction_state.py # # Copyright 2018 Daniel Mende <mail@c0decafe.de> # # 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 re...
bsd-3-clause
-2,738,729,564,241,336,000
45.847826
80
0.685847
false
xuxiao19910803/edx
lms/djangoapps/branding/__init__.py
45
2858
from xmodule.modulestore.django import modulestore from xmodule.course_module import CourseDescriptor from django.conf import settings from opaque_keys.edx.locations import SlashSeparatedCourseKey from microsite_configuration import microsite def get_visible_courses(): """ Return the set of CourseDescriptors...
agpl-3.0
6,574,672,148,467,007,000
35.641026
138
0.688244
false
vitaly4uk/django
tests/aggregation_regress/tests.py
66
53789
from __future__ import unicode_literals import datetime import pickle from decimal import Decimal from operator import attrgetter from django.contrib.contenttypes.models import ContentType from django.core.exceptions import FieldError from django.db import connection from django.db.models import ( F, Q, Avg, Coun...
bsd-3-clause
7,692,754,123,880,174,000
40.217625
252
0.574393
false
M3nin0/supreme-broccoli
Web/Flask/site_/lib/python3.5/site-packages/sqlalchemy/ext/declarative/clsregistry.py
55
10817
# ext/declarative/clsregistry.py # Copyright (C) 2005-2016 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 """Routines to handle the string class registry used by declarative. ...
apache-2.0
7,615,088,361,561,003,000
31.978659
79
0.567902
false
poo12138/gem5-stable
src/sim/probe/Probe.py
62
2370
# -*- mode:python -*- # Copyright (c) 2013 ARM Limited # All rights reserved. # # The license below extends only to copyright in the software and shall # not be construed as granting a license to any other intellectual # property including but not limited to intellectual property relating # to a hardware implementatio...
bsd-3-clause
8,322,683,299,318,439,000
49.425532
72
0.788186
false
mattesno1/CouchPotatoServer
couchpotato/core/settings.py
42
8457
from __future__ import with_statement import ConfigParser from hashlib import md5 from CodernityDB.hash_index import HashIndex from couchpotato.api import addApiView from couchpotato.core.event import addEvent, fireEvent from couchpotato.core.helpers.encoding import toUnicode from couchpotato.core.helpers.variable imp...
gpl-3.0
-8,622,863,118,209,742,000
30.091912
149
0.55729
false
Kazade/NeHe-Website
google_appengine/lib/cherrypy/cherrypy/process/win32.py
93
5870
"""Windows service. Requires pywin32.""" import os import win32api import win32con import win32event import win32service import win32serviceutil from cherrypy.process import wspbus, plugins class ConsoleCtrlHandler(plugins.SimplePlugin): """A WSPBus plugin for handling Win32 console events (like Ctrl-C).""" ...
bsd-3-clause
1,845,480,469,559,153,000
32.735632
81
0.58569
false
Cuuuurzel/KiPyCalc
sympy/diffgeom/tests/test_hyperbolic_space.py
74
2447
''' unit test describing the hyperbolic half-plane with the Poincare metric. This is a basic model of hyperbolic geometry on the (positive) half-space {(x,y) \in R^2 | y > 0} with the Riemannian metric ds^2 = (dx^2 + dy^2)/y^2 It has constant negative scalar curvature = -2 https://en.wikipedia.org/wiki/Poincare_ha...
mit
4,280,191,580,177,619,500
27.126437
85
0.531671
false
ak2703/edx-platform
common/lib/symmath/symmath/symmath_check.py
126
12542
#!/usr/bin/python # -*- coding: utf-8 -*- # # File: symmath_check.py # Date: 02-May-12 (creation) # # Symbolic mathematical expression checker for edX. Uses sympy to check for expression equality. # # Takes in math expressions given as Presentation MathML (from ASCIIMathML), converts to Content MathML using Snuggl...
agpl-3.0
-6,169,996,041,442,095,000
37.472393
133
0.560995
false
blaggacao/OpenUpgrade
addons/mrp_byproduct/__openerp__.py
259
1819
# -*- 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
402,619,816,081,690,400
33.320755
78
0.560198
false
yqm/sl4a
python/src/Lib/plat-sunos5/SUNAUDIODEV.py
66
1578
# Symbolic constants for use with sunaudiodev module # The names are the same as in audioio.h with the leading AUDIO_ # removed. from warnings import warnpy3k warnpy3k("the SUNAUDIODEV module has been removed in Python 3.0", stacklevel=2) del warnpy3k # Not all values are supported on all releases of SunOS. # Encodin...
apache-2.0
-6,704,747,245,499,558,000
35.697674
79
0.564639
false
ericgarrigues/ansible-modules-extras
system/locale_gen.py
20
6736
#!/usr/bin/python # -*- coding: utf-8 -*- import os import os.path from subprocess import Popen, PIPE, call import re DOCUMENTATION = ''' --- module: locale_gen short_description: Creates or removes locales. description: - Manages locales by editing /etc/locale.gen and invoking locale-gen. version_added: "1.6" a...
gpl-3.0
2,743,328,600,333,634,600
30.476636
141
0.588331
false
jegger/kivy
kivy/uix/bubble.py
16
12684
''' Bubble ====== .. versionadded:: 1.1.0 .. image:: images/bubble.jpg :align: right The Bubble widget is a form of menu or a small popup where the menu options are stacked either vertically or horizontally. The :class:`Bubble` contains an arrow pointing in the direction you choose. Simple example ------------...
mit
7,869,353,859,527,945,000
32.914439
79
0.570956
false
wfxiang08/django185
django/contrib/auth/middleware.py
172
5116
from django.contrib import auth from django.contrib.auth import load_backend from django.contrib.auth.backends import RemoteUserBackend from django.core.exceptions import ImproperlyConfigured from django.utils.functional import SimpleLazyObject def get_user(request): if not hasattr(request, '_cached_user'): ...
bsd-3-clause
8,544,740,072,199,391,000
41.633333
92
0.663018
false
ojengwa/talk
venv/lib/python2.7/site-packages/django/utils/translation/trans_null.py
84
1536
# These are versions of the functions in django.utils.translation.trans_real # that don't actually do anything. This is purely for performance, so that # settings.USE_I18N = False can use this module rather than trans_real.py. from django.conf import settings from django.utils.encoding import force_text from django.ut...
mit
3,185,623,647,926,365,000
24.6
77
0.723307
false
camptocamp/QGIS
python/plugins/processing/lidar/lastools/lassplit.py
1
2355
# -*- coding: utf-8 -*- """ *************************************************************************** lassplit.py --------------------- Date : August 2012 Copyright : (C) 2012 by Victor Olaya Email : volayaf at gmail dot com --------------------- ...
gpl-2.0
-8,099,768,237,118,897,000
41.053571
117
0.545223
false
sunyihuan326/DeltaLab
shuwei_fengge/practice_two/load_data/knn_outline.py
1
1415
# coding:utf-8 ''' Created on 2017/12/29. @author: chk01 ''' from practice_one.Company.load_material.utils import * from practice_one.model.utils import * from imblearn.over_sampling import RandomOverSampler def preprocessing(trX, teX, trY, teY): res = RandomOverSampler(ratio={0: 700, 1: 700, 2: 700}) m, w, ...
mit
-4,662,336,195,998,147,000
28.479167
86
0.601413
false
oandrew/home-assistant
tests/components/device_tracker/test_owntracks.py
10
28145
"""The tests for the Owntracks device tracker.""" import json import os import unittest from collections import defaultdict from unittest.mock import patch from tests.common import (assert_setup_component, fire_mqtt_message, get_test_home_assistant, mock_mqtt_component) import homeassistant....
mit
6,048,500,633,906,802,000
34.093516
79
0.607177
false
beni55/june
june/utils/mail.py
11
1651
# coding: utf-8 from flask import current_app, url_for, render_template from flask.ext.babel import gettext as _ from flask_mail import Message from .user import create_auth_token def send_mail(app, msg): mail = app.extensions['mail'] if not mail.default_sender: return mail.send(msg) def signup...
bsd-3-clause
-7,252,105,222,293,648,000
26.065574
69
0.588734
false
Rafiot/PyCIRCLean
filecheck/filecheck.py
1
35947
#!/usr/bin/env python3 # -*- coding: utf-8 -*- import os import mimetypes import shlex import subprocess import zipfile import argparse import random import shutil import time import hashlib import oletools.oleid import olefile import officedissector import warnings import exifread from PIL import Image from pdfid imp...
bsd-3-clause
5,973,277,264,772,506,000
42.466747
140
0.56995
false
xingjian-f/Leetcode-solution
304. Range Sum Query 2D - Immutable.py
1
1592
class NumMatrix(object): def __init__(self, matrix): """ initialize your data structure here. :type matrix: List[List[int]] """ self.dp = [range(len(matrix[0])) for i in range(len(matrix))] for i in range(len(matrix)): for j in range(len(matrix[i])): ...
mit
-3,337,564,328,645,928,400
30.235294
69
0.486809
false
gavinelliott/patsi
node_modules/grunt-sass/node_modules/node-sass/node_modules/node-gyp/gyp/pylib/gyp/generator/cmake.py
148
44560
# Copyright (c) 2013 Google Inc. All rights reserved. # Use of this source code is governed by a BSD-style license that can be # found in the LICENSE file. """cmake output module This module is under development and should be considered experimental. This module produces cmake (2.8.8+) input as its output. One CMake...
mit
-7,218,082,783,665,534,000
35.494676
80
0.662545
false
ronuchit/GroundHog
groundhog/layers/ff_layers.py
16
18887
""" Feedforward layers. TODO: write more documentation """ __docformat__ = 'restructedtext en' __authors__ = ("Razvan Pascanu " "KyungHyun Cho " "Caglar Gulcehre ") __contact__ = "Razvan Pascanu <r.pascanu@gmail>" import numpy import copy import theano import theano.tensor as TT from th...
bsd-3-clause
-8,832,714,422,617,155,000
35.960861
115
0.533753
false
megies/numpy
numpy/ma/timer_comparison.py
76
17500
from __future__ import division, absolute_import, print_function import timeit from functools import reduce import numpy as np from numpy import float_ import np.core.fromnumeric as fromnumeric from np.testing.utils import build_err_msg # Fixme: this does not look right. np.seterr(all='ignore') pi = np.pi class ...
bsd-3-clause
-7,649,316,451,598,109,000
37.126362
114
0.484971
false
capturePointer/vigra
vigranumpy/examples/grid_graph_shortestpath.py
8
3978
import vigra import vigra.graphs as vigraph import pylab import numpy np=numpy import sys import matplotlib import pylab as plt import math from matplotlib.widgets import Slider, Button, RadioButtons def makeWeights(gamma): global hessian,gradmag,gridGraph print "hessian",hessian.min(),hessian.max() print ...
mit
1,526,639,020,373,556,000
25.52
100
0.659377
false
chiefspace/udemy-rest-api
udemy_rest_flask1/env/lib/python3.4/site-packages/markupsafe/_constants.py
1535
4795
# -*- coding: utf-8 -*- """ markupsafe._constants ~~~~~~~~~~~~~~~~~~~~~ Highlevel implementation of the Markup string. :copyright: (c) 2010 by Armin Ronacher. :license: BSD, see LICENSE for more details. """ HTML_ENTITIES = { 'AElig': 198, 'Aacute': 193, 'Acirc': 194, 'Agrave': 1...
gpl-2.0
-6,452,721,923,217,905,000
16.958801
50
0.450052
false
azlanismail/prismgames
examples/games/car/networkx/tests/test.py
1
1289
#!/usr/bin/env python import sys from os import path,getcwd def run(verbosity=1,doctest=False,numpy=True): """Run NetworkX tests. Parameters ---------- verbosity: integer, optional Level of detail in test reports. Higher numbers provide more detail. doctest: bool, optional ...
gpl-2.0
1,359,636,146,898,896,000
26.644444
78
0.59038
false
xiandiancloud/ji
common/lib/xmodule/xmodule/tests/xml/test_policy.py
248
1262
""" Tests that policy json files import correctly when loading XML """ from nose.tools import assert_equals, assert_raises # pylint: disable=no-name-in-module from xmodule.tests.xml.factories import CourseFactory from xmodule.tests.xml import XModuleXmlImportTest class TestPolicy(XModuleXmlImportTest): """ ...
agpl-3.0
-4,800,155,057,017,082,000
41.066667
98
0.704437
false
tersmitten/ansible
lib/ansible/modules/packaging/os/homebrew_tap.py
87
6806
#!/usr/bin/python # -*- coding: utf-8 -*- # (c) 2013, Daniel Jaouen <dcj24@cornell.edu> # (c) 2016, Indrajit Raychaudhuri <irc+code@indrajit.com> # # Based on homebrew (Andrew Dunham <andrew@du.nham.ca>) # # GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt) from __future__ imp...
gpl-3.0
-7,140,108,822,832,994,000
25.690196
92
0.554952
false
baidu/Paddle
python/paddle/fluid/tests/unittests/test_sequence_expand.py
1
4061
# Copyright (c) 2018 PaddlePaddle 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 app...
apache-2.0
4,225,064,777,958,325,000
32.841667
76
0.541738
false
invisiblek/python-for-android
python-modules/twisted/twisted/protocols/gps/nmea.py
59
7970
# -*- test-case-name: twisted.test.test_nmea -*- # Copyright (c) 2001-2009 Twisted Matrix Laboratories. # See LICENSE for details. """NMEA 0183 implementation Maintainer: Bob Ippolito The following NMEA 0183 sentences are currently understood:: GPGGA (fix) GPGLL (position) GPRMC (position and time) G...
apache-2.0
7,266,965,071,144,821,000
37.133971
180
0.569385
false
cav71/osc
tests/test_setlinkrev.py
14
4652
import osc.core import osc.oscerr import os from common import GET, PUT, OscTestCase FIXTURES_DIR = os.path.join(os.getcwd(), 'setlinkrev_fixtures') def suite(): import unittest return unittest.makeSuite(TestSetLinkRev) class TestSetLinkRev(OscTestCase): def setUp(self): OscTestCase.setUp(self, co...
gpl-2.0
-1,359,176,530,188,534,300
49.021505
113
0.659931
false
twlizer/plugin.video.Pseudonymous
chardet/gb2312prober.py
231
1722
######################## BEGIN LICENSE BLOCK ######################## # The Original Code is mozilla.org 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 Reserved. ...
gpl-2.0
1,626,406,253,262,029,800
40
69
0.700929
false
gfreed/android_external_chromium-org
third_party/jinja2/compiler.py
121
61899
# -*- coding: utf-8 -*- """ jinja2.compiler ~~~~~~~~~~~~~~~ Compiles nodes into python code. :copyright: (c) 2010 by the Jinja Team. :license: BSD, see LICENSE for more details. """ from cStringIO import StringIO from itertools import chain from copy import deepcopy from jinja2 import nodes from j...
bsd-3-clause
-4,756,405,537,260,084,000
36.537295
86
0.558474
false
0k/OpenUpgrade
addons/l10n_ar/__init__.py
2120
1456
# -*- encoding: utf-8 -*- ############################################################################## # # OpenERP, Open Source Management Solution # Copyright (c) 2011 Cubic ERP - Teradata SAC. (http://cubicerp.com). # # WARNING: This program as such is intended to be used by professional # programmers who take t...
agpl-3.0
-6,307,122,977,793,663,000
44.5
80
0.684753
false
Nick-OpusVL/odoo
openerp/tools/translate.py
62
44976
# -*- 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 GNU...
agpl-3.0
-3,913,251,370,468,359,000
39.22898
143
0.541578
false
aniruddhkanojia/qtile
test/test_bar.py
14
11959
# Copyright (c) 2011 Florian Mounier # Copyright (c) 2012-2013 Craig Barnes # Copyright (c) 2012 roger # Copyright (c) 2012, 2014-2015 Tycho Andersen # Copyright (c) 2014 Sean Vig # # Permission is hereby granted, free of charge, to any person obtaining a copy # of this software and associated documentation files (the ...
mit
5,393,738,090,292,947,000
28.026699
79
0.564512
false
vebin/Wox
PythonHome/Lib/site-packages/setuptools/command/test.py
55
6481
from distutils.errors import DistutilsOptionError from unittest import TestLoader import unittest import sys from pkg_resources import (resource_listdir, resource_exists, normalize_path, working_set, _namespace_packages, add_activation_listener, require, EntryPoint...
mit
-1,090,664,959,929,145,200
36.034286
79
0.567814
false