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
idlead/scikit-learn
sklearn/neighbors/tests/test_approximate.py
26
19053
""" Testing for the approximate neighbor search using Locality Sensitive Hashing Forest module (sklearn.neighbors.LSHForest). """ # Author: Maheshakya Wijewardena, Joel Nothman import numpy as np import scipy.sparse as sp from sklearn.utils.testing import assert_array_equal from sklearn.utils.testing import assert_a...
bsd-3-clause
162,638,874,500,540,320
38.859833
78
0.645358
false
jotes/boto
tests/integration/cloudsearch/test_cert_verification.py
126
1577
# Copyright (c) 2012 Mitch Garnaat http://garnaat.org/ # Copyright (c) 2012 Amazon.com, Inc. or its affiliates. # All rights reserved. # # 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 withou...
mit
-2,745,756,725,946,839,000
39.435897
86
0.769816
false
listamilton/supermilton.repository
plugin.audio.soundcloud/resources/lib/nightcrawler/utils/nightcrawler_datetime.py
6
3497
__author__ = 'bromix' import datetime import re __RE_MATCH_TIME_ONLY__ = re.compile(r'^(?P<hour>[0-9]{2})([:]?(?P<minute>[0-9]{2})([:]?(?P<second>[0-9]{2}))?)?$') __RE_MATCH_DATE_ONLY__ = re.compile(r'^(?P<year>[0-9]{4})[-]?(?P<month>[0-9]{2})[-]?(?P<day>[0-9]{2})$') __RE_MATCH_DATETIME__ = re.compile( r'^(?P<yea...
gpl-2.0
-3,221,486,769,737,255,000
51.19403
145
0.52016
false
cngo-github/nupic
nupic/regions/PictureSensorExplorers/random.py
17
5518
# ---------------------------------------------------------------------- # 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 apply: # # This progra...
agpl-3.0
7,226,964,607,680,718,000
39.277372
90
0.631932
false
AutorestCI/azure-sdk-for-python
azure-servicefabric/azure/servicefabric/models/application_upgrade_update_description.py
1
1962
# coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the MIT License. See License.txt in the project root for # license information. # # Code generated by Microsoft (R) AutoRest Code Generator. # Changes ...
mit
-4,854,172,201,391,566,000
40.744681
110
0.643221
false
ocefpaf/paegan-transport
tests/test_capability.py
2
1860
import unittest from paegan.transport.models.behaviors.capability import Capability import os import json class CapabilityTest(unittest.TestCase): def test_from_json(self): data = open(os.path.normpath(os.path.join(os.path.dirname(__file__), "./resources/files/capability_behavior.json"))).read() ...
gpl-3.0
-4,382,981,262,348,133,400
29
131
0.583871
false
BlaisProteomics/mzStudio
mzStudio/Filter_management.py
1
11580
__author__ = 'Scott Ficarro, William Max Alexander' __version__ = '1.0' #Filter management import re def Onms1(filter_dict, id): filter_dict["mode"]="ms1" filter_dict["analyzer"]=id.groups()[0] filter_dict["data"]= "+cent" if id.groups()[1]== "c" else "+prof" filter_dict["mr"]='[' + id.groups()[2]+'-...
gpl-3.0
-6,871,480,503,593,793,000
38.660959
143
0.532038
false
jalr/privacyidea
privacyidea/webui/login.py
1
3977
# -*- coding: utf-8 -*- # # http://www.privacyidea.org # (c) cornelius kölbel, privacyidea.org # # 2016-01-07 Cornelius Kölbel <cornelius@privacyidea.org> # Add password reset # 2015-11-04 Cornelius Kölbel <cornelius@privacyidea.org> # Add REMOTE_USER check # 2014-12-22 Cornelius Kölbel, <corneliu...
agpl-3.0
-8,248,389,636,730,156,000
40.375
79
0.653575
false
yunity/yunity-core
karrot/activities/stats.py
1
2443
from influxdb_metrics.loader import write_points from karrot.groups.stats import group_tags def activity_tags(activity): tags = group_tags(activity.place.group) tags.update({ 'place': str(activity.place.id), 'type': str(activity.activity_type.id), 'type_name': activity.activity_type.n...
agpl-3.0
-8,917,572,228,737,258,000
22.490385
93
0.559558
false
JoshRosen/hyde
tests/test_htaccess.py
58
1455
""" Tests of .htaccess file generation. For now, this just checks whether the demo site's generated .htaccess file matches a known good file. """ import os import sys from django.conf import settings TEST_ROOT = os.path.dirname(os.path.abspath(__file__)) ROOT = os.path.abspath(TEST_ROOT + "/..") sys.path = [ROOT]...
mit
-6,906,234,302,093,116,000
26.980769
77
0.685911
false
blackzw/openwrt_sdk_dev1
staging_dir/host/lib/python2.7/distutils/sysconfig.py
24
22287
"""Provide access to Python's configuration information. The specific configuration variables available depend heavily on the platform and configuration. The values may be retrieved using get_config_var(name), and the list of variables is available via get_config_vars().keys(). Additional convenience functions are a...
gpl-2.0
2,468,130,321,922,786,300
36.457143
79
0.55068
false
richardcs/ansible
lib/ansible/modules/windows/win_find.py
52
9498
#!/usr/bin/python # -*- coding: utf-8 -*- # Copyright: (c) 2016, Ansible Project # GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt) # this is a windows documentation stub. actual code lives in the .ps1 # file of the same name ANSIBLE_METADATA = {'metadata_version': '1.1', ...
gpl-3.0
8,206,608,275,604,538,000
30.66
137
0.607496
false
Vimos/scikit-learn
examples/svm/plot_separating_hyperplane_unbalanced.py
25
1866
""" ================================================= SVM: Separating hyperplane for unbalanced classes ================================================= Find the optimal separating hyperplane using an SVC for classes that are unbalanced. We first find the separating plane with a plain SVC and then plot (dashed) the ...
bsd-3-clause
-6,662,398,273,144,955,000
26.850746
73
0.638264
false
snakeleon/YouCompleteMe-x86
python/ycm/vimsupport.py
1
38641
# Copyright (C) 2011-2012 Google Inc. # 2016 YouCompleteMe contributors # # This file is part of YouCompleteMe. # # YouCompleteMe 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 versi...
gpl-3.0
-4,747,731,343,125,738,000
36.262295
80
0.680055
false
bdupharm/sqlalchemy
test/ext/test_mutable.py
4
28657
from sqlalchemy import Integer, ForeignKey, String from sqlalchemy.types import PickleType, TypeDecorator, VARCHAR from sqlalchemy.orm import mapper, Session, composite from sqlalchemy.orm.mapper import Mapper from sqlalchemy.orm.instrumentation import ClassManager from sqlalchemy.testing.schema import Table, Column fr...
mit
3,245,192,614,248,937,500
23.081513
81
0.521897
false
accomac/namebench
nb_third_party/dns/inet.py
248
3236
# Copyright (C) 2003-2007, 2009, 2010 Nominum, Inc. # # Permission to use, copy, modify, and distribute this software and its # documentation for any purpose with or without fee is hereby granted, # provided that the above copyright notice and this permission notice # appear in all copies. # # THE SOFTWARE IS PROVIDED ...
apache-2.0
-8,383,943,129,031,979,000
28.962963
79
0.67707
false
szopu/django
django/contrib/gis/gdal/srs.py
15
12001
""" The Spatial Reference class, represents OGR Spatial Reference objects. Example: >>> from django.contrib.gis.gdal import SpatialReference >>> srs = SpatialReference('WGS84') >>> print(srs) GEOGCS["WGS 84", DATUM["WGS_1984", SPHEROID["WGS 84",6378137,298.257223563, AUTHORITY...
bsd-3-clause
-8,488,082,755,403,751,000
33.386819
97
0.606116
false
Workday/OpenFrame
tools/telemetry/third_party/gsutilz/third_party/boto/boto/sqs/__init__.py
129
1705
# Copyright (c) 2006-2012 Mitch Garnaat http://garnaat.org/ # # 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, modi...
bsd-3-clause
-6,729,986,868,454,010,000
36.065217
74
0.731378
false
darktears/chromium-crosswalk
tools/perf/page_sets/login_helpers/login_utils.py
25
2047
# Copyright 2015 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 json import os DEFAULT_CREDENTIAL_PATH = os.path.join( os.path.dirname(__file__), os.path.pardir, 'data', 'credentials.json') def GetAccountNa...
bsd-3-clause
1,304,870,046,101,211,600
34.912281
80
0.707377
false
tgarc/rideagg
requests/packages/urllib3/contrib/ntlmpool.py
714
4741
# urllib3/contrib/ntlmpool.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 """ NTLM authenticating pool, contributed by erikcederstran Issue #10, see: http://co...
apache-2.0
-4,282,719,765,499,277,000
38.508333
77
0.563805
false
bkg/django-spillway
spillway/fields.py
1
2068
"""Serializer fields""" from __future__ import absolute_import import collections from django.contrib.gis import geos, forms from django.db.models.query import QuerySet from rest_framework import renderers from rest_framework.fields import Field, FileField from spillway.compat import json from spillway.forms import f...
bsd-3-clause
8,417,814,746,003,711,000
35.280702
78
0.624758
false
godfather1103/WeiboRobot
python27/1.0/lib/ctypes/test/test_python_api.py
35
2955
from ctypes import * import unittest, sys from ctypes.test import requires ################################################################ # This section should be moved into ctypes\__init__.py, when it's ready. from _ctypes import PyObj_FromPtr ################################################################ from...
gpl-3.0
-3,551,256,397,170,205,700
31.833333
75
0.609814
false
tlakshman26/cinder-https-changes
cinder/volume/flows/api/manage_existing.py
17
6017
# 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 # d...
apache-2.0
-5,200,845,347,089,317,000
38.326797
80
0.629051
false
3dfxsoftware/cbss-addons
poi_pos_cashier_lock/__init__.py
3
1093
# -*- 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...
gpl-2.0
-3,884,220,087,608,075,300
42.72
79
0.612992
false
joeythesaint/yocto-autobuilder
lib/python2.7/site-packages/Twisted-12.2.0-py2.7-linux-x86_64.egg/twisted/test/test_threads.py
5
13048
# Copyright (c) Twisted Matrix Laboratories. # See LICENSE for details. """ Test methods in twisted.internet.threads and reactor thread APIs. """ import sys, os, time from twisted.trial import unittest from twisted.internet import reactor, defer, interfaces, threads, protocol, error from twisted.python import fail...
gpl-2.0
-3,127,258,037,412,609,000
30.669903
88
0.610668
false
harrisonfeng/pip
pip/_vendor/distlib/resources.py
224
10615
# -*- coding: utf-8 -*- # # Copyright (C) 2013 Vinay Sajip. # Licensed to the Python Software Foundation under a contributor agreement. # See LICENSE.txt and CONTRIBUTORS.txt. # from __future__ import unicode_literals import bisect import io import logging import os import pkgutil import shutil import sys import types...
mit
6,260,637,594,249,480,000
29.328571
79
0.57739
false
thenenadx/forseti-security
google/cloud/security/notifier/pipelines/email_violations_pipeline.py
2
5623
# Copyright 2017 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 or agreed to in writing, ...
apache-2.0
-1,986,754,406,607,161,900
35.512987
86
0.596479
false
mpurzynski/MozDef
tests/alerts/geomodel/test_factors.py
1
2514
from datetime import datetime import alerts.geomodel.alert as alert import alerts.geomodel.factors as factors class MockMMDB: '''Mocks a MaxMind database connection with a dictionary of records mapping IP adresses to dictionaries containing information about ASNs. ''' def __init__(self, records): ...
mpl-2.0
4,193,586,732,723,276,300
26.933333
79
0.622514
false
Captain-Coder/tribler
Tribler/Core/Modules/channel/channel.py
1
5233
import codecs import collections import logging import os from binascii import hexlify from twisted.internet import reactor from twisted.internet.defer import DeferredList from Tribler.Core.Modules.channel.channel_rss import ChannelRssParser import Tribler.Core.Utilities.json_util as json from Tribler.Core.simpledefs ...
lgpl-3.0
408,128,318,443,822,500
39.253846
105
0.626027
false
rayrrr/luigi
test/contrib/hadoop_test.py
5
18230
# -*- coding: utf-8 -*- # # Copyright 2012-2015 Spotify AB # # 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...
apache-2.0
4,818,683,136,632,209,000
33.990403
151
0.638289
false
vkscool/nupic
tests/unit/nupic/data/functionsource_test.py
9
3242
#!/usr/bin/env python # ---------------------------------------------------------------------- # Numenta Platform for Intelligent Computing (NuPIC) # Copyright (C) 2015, 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
2,396,145,193,685,214,700
28.743119
74
0.657002
false
denny820909/builder
lib/python2.7/site-packages/Twisted-12.2.0-py2.7-linux-x86_64.egg/twisted/python/test/test_hashlib.py
27
3308
# Copyright (c) Twisted Matrix Laboratories. # See LICENSE for details. """ Tests for L{twisted.python.hashlib} """ from twisted.trial.unittest import TestCase from twisted.python.hashlib import md5, sha1 class HashObjectTests(TestCase): """ Tests for the hash object APIs presented by L{hashlib}, C{md5} an...
mit
-9,003,209,054,997,459,000
35.755556
79
0.59341
false
TripleDogDare/RadioWCSpy
backend/env/lib/python2.7/site-packages/setuptools/archive_util.py
520
6609
"""Utilities for extracting common archive formats""" __all__ = [ "unpack_archive", "unpack_zipfile", "unpack_tarfile", "default_filter", "UnrecognizedFormat", "extraction_drivers", "unpack_directory", ] import zipfile import tarfile import os import shutil import posixpath import contextlib from pkg_resourc...
mit
6,863,717,354,658,220,000
37.876471
80
0.59888
false
bharath2020/SmartHome
temperature-sensor/temperature_sensor.py
1
1403
import Adafruit_DHT import time import json import httplib import sys URL='bb-smart-home.herokuapp.com' DEVICE_NAME ='raspberry' def temperature_humidity(sensor,pin): humidity, temperature = Adafruit_DHT.read_retry(sensor,pin) if humidity is not None and temperature is not None: return [temperature,humidity] els...
apache-2.0
4,824,320,751,990,559,000
22.383333
93
0.689237
false
boundarydevices/android_external_chromium_org
build/android/gyp/get_device_configuration.py
103
2134
#!/usr/bin/env python # # Copyright 2013 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. """Gets and writes the configurations of the attached devices. This configuration is used by later build steps to determine which de...
bsd-3-clause
-725,697,956,545,568,900
30.850746
78
0.694939
false
Ale-/civics
apps/api/urls.py
1
1342
from django.conf.urls import url, include from apps.models.models import Initiative from . import views urlpatterns = [ url(r'^initiative$', views.initiative_service, name='get_initiative'), url(r'^initiatives$', views.initiatives_service, name='get_initiatives'), url(r'^initiatives_featured$', views.initi...
gpl-3.0
-6,798,705,396,211,632,000
62.904762
104
0.709389
false
dol-sen/gentoo-keys
gkeys/log.py
1
2035
# #-*- coding:utf-8 -*- """ Gentoo-Keys - Log.py Logging module, placeholder for our site-wide logging module @copyright: 2012 by Brian Dolbec <dol-sen> <dol-sen@users.sourceforge.net> @license: GNU GPL2, see COPYING for details. """ import logging import time import os NAMESPACE = 'gentoo-keys' l...
gpl-2.0
-4,769,913,257,405,994,000
26.876712
89
0.665848
false
ljbade/libswiftnav
python/tests/test_lambda.py
1
4184
#!/usr/bin/env python # Copyright (C) 2015 Swift Navigation Inc. # Copyright (C) 2007-2008 by T.TAKASU, All rights reserved. # Contact: Bhaskar Mookerji <mookerji@swiftnav.com> # # This source is subject to the license found in the file 'LICENSE' which must # be be distributed together with this source. All other right...
lgpl-3.0
-7,782,011,976,936,969,000
57.929577
123
0.564532
false
thumbor-community/shortener
tc_shortener/handlers/shortener.py
1
3214
# -*- coding: utf-8 -*- # Copyright (c) 2016, thumbor-community # Use of this source code is governed by the MIT license that can be # found in the LICENSE file. import os.path import tornado.gen as gen import tornado.web import urlparse import json from thumbor.handlers.imaging import ImagingHandler from thumbor.ut...
mit
-4,749,873,652,435,877,000
30.821782
119
0.604543
false
gannetson/django
django/middleware/security.py
510
1753
import re from django.conf import settings from django.http import HttpResponsePermanentRedirect class SecurityMiddleware(object): def __init__(self): self.sts_seconds = settings.SECURE_HSTS_SECONDS self.sts_include_subdomains = settings.SECURE_HSTS_INCLUDE_SUBDOMAINS self.content_type_no...
bsd-3-clause
-3,206,852,689,767,109,000
39.767442
87
0.639475
false
Lujeni/ansible
lib/ansible/modules/network/fortios/fortios_system_proxy_arp.py
13
9662
#!/usr/bin/python from __future__ import (absolute_import, division, print_function) # Copyright 2019 Fortinet, 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 Lic...
gpl-3.0
3,690,931,810,667,862,500
28.457317
97
0.595736
false
Lujeni/ansible
test/units/modules/cloud/amazon/test_aws_api_gateway.py
13
1943
# # (c) 2016 Michael De La Rue # # This file is part of Ansible # 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 import sys import pytest from ansible.mo...
gpl-3.0
4,581,670,735,787,515,000
27.15942
100
0.656716
false
lorentey/swift
utils/build_swift/argparse/__init__.py
23
1658
# This source file is part of the Swift.org open source project # # Copyright (c) 2014 - 2017 Apple Inc. and the Swift project authors # Licensed under Apache License v2.0 with Runtime Library Exception # # See https://swift.org/LICENSE.txt for license information # See https://swift.org/CONTRIBUTORS.txt for the list o...
apache-2.0
-6,325,372,504,280,638,000
29.145455
79
0.705066
false
acshi/osf.io
addons/github/tests/utils.py
16
9354
import mock import github3 from addons.github.api import GitHubClient from github3.repos.branch import Branch from addons.base.tests.base import OAuthAddonTestCaseMixin, AddonTestCase from addons.github.models import GitHubProvider from addons.github.tests.factories import GitHubAccountFactory class GitHubAddonTestC...
apache-2.0
-3,486,838,000,893,198,300
62.202703
176
0.670836
false
dennisss/sympy
sympy/mpmath/libmp/libmpi.py
18
27592
""" Computational functions for interval arithmetic. """ from .backend import xrange from .libmpf import ( ComplexResult, round_down, round_up, round_floor, round_ceiling, round_nearest, prec_to_dps, repr_dps, dps_to_prec, bitcount, from_float, fnan, finf, fninf, fzero, fhalf, fone, fnone, ...
bsd-3-clause
6,755,097,340,505,862,000
28.51016
96
0.51051
false
jckarter/swift
test/SourceKit/Inputs/sourcekitd_path_sanitize.py
20
1315
#!/usr/bin/env python # sourcekitd_path_sanitize.py - Cleans up paths from sourcekitd-test output # # This source file is part of the Swift.org open source project # # Copyright (c) 2014 - 2019 Apple Inc. and the Swift project authors # Licensed under Apache License v2.0 with Runtime Library Exception # # See https://s...
apache-2.0
-2,236,739,221,591,201,300
40.09375
78
0.642586
false
rajadhva/servo
tests/wpt/harness/wptrunner/browsers/b2g.py
117
8016
# 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/. import os import tempfile import shutil import subprocess import fxos_appgen import gaiatest import mozdevice import mo...
mpl-2.0
-4,245,111,516,723,204,600
31.987654
97
0.625374
false
javiplx/debian-devel
cobbler/config.py
3
7320
""" Config.py is a repository of the Cobbler object model Copyright 2006-2008, Red Hat, Inc Michael DeHaan <mdehaan@redhat.com> 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 th...
gpl-2.0
6,417,711,532,995,990,000
28.28
90
0.651503
false
Javantea/satispy
satispy/cnf.py
1
5607
cnfClass = None class Variable(object): def __init__(self, name, inverted=False): self.name = name self.inverted = inverted def __neg__(self): v = Variable(self.name) v.inverted = not self.inverted return v def __and__(self, other): c = cnfClass.create_from...
bsd-3-clause
8,187,691,783,595,902,000
24.143498
83
0.478687
false
RouxRC/weboob
modules/happn/module.py
4
12367
# -*- coding: utf-8 -*- # Copyright(C) 2014 Roger Philibert # # This file is part of weboob. # # weboob is free software: you can redistribute it and/or modify # it under the terms of the GNU Affero General Public License as published by # the Free Software Foundation, either version 3 of the License, or # (at yo...
agpl-3.0
6,980,842,452,687,811,000
40.780405
152
0.568287
false
geminy/aidear
oss/qt/qt-everywhere-opensource-src-5.9.0/qtwebengine/src/3rdparty/chromium/tools/auto_bisect/ttest_test.py
58
4977
# 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. """Unit tests for ttest module.""" import unittest import ttest # This test case accesses private functions of the ttest module. # pylint: disable=W0212 ...
gpl-3.0
5,798,815,850,344,160,000
37.284615
77
0.649588
false
popcornmix/xbmc
lib/gtest/test/gtest_xml_test_utils.py
1815
8876
#!/usr/bin/env python # # Copyright 2006, 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...
gpl-2.0
-8,071,842,440,726,334,000
44.752577
79
0.685557
false
mrunge/horizon
openstack_dashboard/dashboards/admin/hypervisors/tabs.py
59
1512
# 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 th...
apache-2.0
2,749,678,698,690,136,000
33.363636
78
0.722222
false
garretlh/nimbus
nimbus-drivers/src/main/python/nimbusdrivers/wmr9x8.py
3
25529
# # Copyright (c) 2012 Will Page <compenguy@gmail.com> # See the file LICENSE.txt for your full rights. # # Derivative of vantage.py and wmr100.py, credit to Tom Keffer """Classes and functions for interfacing with Oregon Scientific WM-918, WMR9x8 and WMR-968 weather stations See http://wx200.planetfall.com/wx200...
gpl-3.0
7,729,560,288,982,013,000
39.651274
317
0.562733
false
yitian134/chromium
media/tools/layout_tests/layouttest_analyzer_runner.py
27
8716
#!/usr/bin/env python # Copyright (c) 2012 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. """Main function to run the layout test analyzer. The purpose of this script is to run the layout test analyzer for various teams ...
bsd-3-clause
1,601,093,831,142,974,000
40.308057
79
0.588687
false
adamlwgriffiths/Pyglet
doc/ext/autosummary/__init__.py
5
17735
# -*- coding: utf-8 -*- """ sphinx.ext.autosummary ~~~~~~~~~~~~~~~~~~~~~~ Sphinx extension that adds an autosummary:: directive, which can be used to generate function/method/attribute/etc. summary lists, similar to those output eg. by Epydoc and other API doc generation tools. An :autolink: r...
bsd-3-clause
3,258,018,589,657,534,500
31.781885
80
0.546941
false
tmxdyf/CouchPotatoServer
libs/pyutil/cache.py
106
27000
# Copyright (c) 2002-2010 Zooko "Zooko" Wilcox-O'Hearn """ This module offers three implementations of an LRUCache, which is a dict that drops items according to a Least-Recently-Used policy if the dict exceeds a fixed maximum size. Warning: if -O optimizations are not turned on then LRUCache performs extensive self...
gpl-3.0
-8,383,256,995,888,754,000
35.734694
268
0.553741
false
lihui7115/ChromiumGStreamerBackend
components/test/data/password_manager/automated_tests/environment.py
33
11064
# 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. """The testing Environment class. It holds the WebsiteTest instances, provides them with credentials, provides clean browser environment, runs the tests, an...
bsd-3-clause
-371,550,160,261,439,940
35.757475
79
0.680224
false
dklyle/trove-dashboard
trove_dashboard/content/database_clusters/panel.py
4
1044
# Copyright (c) 2014 eBay Software Foundation # Copyright 2015 HP Software, LLC # 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
-6,443,922,097,102,972,000
33.8
78
0.728927
false
classgrade/classgrade
classgrade/gradapp/tasks.py
1
8924
# coding=utf-8 import csv import logging from random import shuffle from django.core.mail import send_mail from django.core.exceptions import ObjectDoesNotExist from django.contrib.auth.models import User from xkcdpass import xkcd_password as xp from unidecode import unidecode from classgrade import settings from grada...
mit
1,299,347,187,517,545,200
40.85446
80
0.609759
false
linearregression/phoenix-1
bin/phoenix_utils.py
9
6567
#!/usr/bin/env python ############################################################################ # # 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 A...
apache-2.0
1,069,044,411,455,931,600
40.04375
140
0.651744
false
hehongliang/tensorflow
tensorflow/python/data/experimental/kernel_tests/serialization/csv_dataset_serialization_test.py
21
2558
# Copyright 2018 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
-4,256,782,599,199,834,600
34.041096
106
0.663409
false
A-HostMobile/MobileApp
node_modules/node-gyp/gyp/pylib/gyp/__init__.py
1524
22178
#!/usr/bin/env python # Copyright (c) 2012 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. import copy import gyp.input import optparse import os.path import re import shlex import sys import traceback from gyp.common import GypErr...
apache-2.0
-4,365,298,078,568,985,600
39.470803
80
0.653395
false
jzoldak/edx-platform
common/djangoapps/student/tests/test_auto_auth.py
9
11047
from django.test import TestCase from django.test.client import Client from django.contrib.auth.models import User from django.conf import settings from django_comment_common.models import ( Role, FORUM_ROLE_ADMINISTRATOR, FORUM_ROLE_MODERATOR, FORUM_ROLE_STUDENT) from django_comment_common.utils import seed_permis...
agpl-3.0
6,176,892,705,580,892,000
37.761404
98
0.628949
false
drhee/toxoMine
intermine/python/tests/test_templates.py
2
7133
import unittest from test import WebserviceTest from intermine.webservice import * from intermine.query import Template from intermine.constraints import TemplateConstraint class TestTemplates(WebserviceTest): # pragma: no cover def setUp(self): self.service = Service(self.get_test_root()) def testG...
lgpl-2.1
-5,947,286,798,809,874,000
54.726563
174
0.632132
false
abloomston/sympy
sympy/matrices/expressions/matadd.py
65
3328
from __future__ import print_function, division from sympy.core.compatibility import reduce from operator import add from sympy.core import Add, Basic, sympify from sympy.functions import adjoint from sympy.matrices.matrices import MatrixBase from sympy.matrices.expressions.transpose import transpose from sympy.strat...
bsd-3-clause
1,540,280,051,992,657,200
27.93913
81
0.589243
false
CapOM/ChromiumGStreamerBackend
tools/telemetry/third_party/webpagereplay/third_party/dns/reversename.py
248
2931
# Copyright (C) 2006, 2007, 2009, 2010 Nominum, Inc. # # Permission to use, copy, modify, and distribute this software and its # documentation for any purpose with or without fee is hereby granted, # provided that the above copyright notice and this permission notice # appear in all copies. # # THE SOFTWARE IS PROVIDED...
bsd-3-clause
3,328,371,620,511,037,000
38.08
79
0.678949
false
spbguru/repo1
external/linux32/lib/python2.6/site-packages/matplotlib/backends/backend_emf.py
69
22336
""" Enhanced Metafile backend. See http://pyemf.sourceforge.net for the EMF driver library. """ from __future__ import division try: import pyemf except ImportError: raise ImportError('You must first install pyemf from http://pyemf.sf.net') import os,sys,math,re from matplotlib import verbose, __version__,...
gpl-3.0
-3,724,137,892,488,907,000
34.680511
285
0.593705
false
CTSRD-SOAAP/chromium-42.0.2311.135
third_party/yasm/source/patched-yasm/modules/arch/x86/gen_x86_insn.py
18
292359
#! /usr/bin/env python # x86 instructions and prefixes data and code generation # # Copyright (C) 2002-2007 Peter Johnson # # 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 reta...
bsd-3-clause
6,448,233,108,947,430,000
34.06765
87
0.572214
false
ufkapano/py-quats
src/qtools.py
1
1769
#!/usr/bin/python import math import random from quats import Quat # Rotates a vector with respect to a quat. # The vector is from R^3, the result is from R^3, rot_quat is a unit quat. def rotate1(vector, unit_quat): """Return the rotated vector (rot_quat used).""" # From a vector to a quaternion. vec_qua...
bsd-3-clause
-1,138,746,812,285,651,800
32.377358
74
0.630865
false
Learningtribes/edx-platform
common/djangoapps/terrain/stubs/http.py
28
8643
""" Stub implementation of an HTTP service. """ from BaseHTTPServer import HTTPServer, BaseHTTPRequestHandler import urllib import urlparse import threading import json from functools import wraps from lazy import lazy from logging import getLogger LOGGER = getLogger(__name__) def require_params(method, *required_k...
agpl-3.0
-2,408,353,338,454,857,000
29.867857
110
0.563462
false
ToBaer94/PygameTowerDefense
level.py
1
4685
import pygame as pg import tilerenderer from tower import Tower, CannonTower, ExplosiveTower, FireTower, SlowTower, MultiTower, LaserTower, CrescentTower from trap import Mine from creep import Creep, Worm, Behemoth, SwiftWalker from os import path, pardir import random Vector = pg.math.Vector2 CREEP = 0 WORM = 1 B...
lgpl-3.0
-3,432,906,512,746,219,000
31.310345
123
0.56286
false
AlanCoding/tower-cli
tower_cli/utils/__init__.py
2
1424
# Copyright 2015, Ansible, Inc. # Luke Sneeringer <lsneeringer@ansible.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 License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless requi...
apache-2.0
-8,482,099,844,143,323,000
29.956522
74
0.708567
false
sssemil/cjdns
node_build/dependencies/libuv/build/gyp/test/no-cpp/gyptest-no-cpp.py
47
1500
#!/usr/bin/env python # Copyright (c) 2012 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. """ Checks that C-only targets aren't linked against libstdc++. """ import TestGyp import re import subprocess import sys # set |match| t...
gpl-3.0
-153,318,755,400,534,500
28.411765
78
0.658
false
cntnboys/410Lab6
build/django/build/lib.linux-x86_64-2.7/django/db/migrations/questioner.py
119
7690
from __future__ import print_function, unicode_literals import importlib import os import sys from django.apps import apps from django.db.models.fields import NOT_PROVIDED from django.utils import datetime_safe, six, timezone from django.utils.six.moves import input from .loader import MIGRATIONS_MODULE_NAME class...
apache-2.0
-7,378,668,924,852,154,000
41.252747
112
0.568921
false
Sidney84/pa-chromium
remoting/tools/zip2msi.py
76
8258
#!/usr/bin/env python # Copyright (c) 2012 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. """Generates .msi from a .zip archive or an unpacked directory. The structure of the input archive or directory should look like t...
bsd-3-clause
2,143,500,821,137,932,300
31.007752
80
0.684064
false
seales/PHINet
PHINetCloud/node_modules/npm/node_modules/node-gyp/gyp/pylib/gyp/input.py
292
114315
# Copyright (c) 2012 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. from compiler.ast import Const from compiler.ast import Dict from compiler.ast import Discard from compiler.ast import List from compiler.ast import Module from co...
mit
7,821,233,886,918,997,000
39.068349
80
0.655522
false
ATIX-AG/foreman-ansible-modules
plugins/modules/setting.py
1
3129
#!/usr/bin/python # -*- coding: utf-8 -*- # (c) 2018 Matthias M Dellweg (ATIX AG) # # 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 lat...
gpl-3.0
1,121,765,926,957,675,000
26.9375
146
0.673058
false
2014c2g23/2015cda
static/Brython3.1.1-20150328-091302/Lib/unittest/test/test_skipping.py
744
5173
import unittest from .support import LoggingResult class Test_TestSkipping(unittest.TestCase): def test_skipping(self): class Foo(unittest.TestCase): def test_skip_me(self): self.skipTest("skip") events = [] result = LoggingResult(events) test = Foo("t...
gpl-3.0
-2,829,013,341,953,221,000
33.718121
75
0.553064
false
Bitl/RBXLegacy-src
Cut/RBXLegacyDiscordBot/lib/requests/cookies.py
109
18208
# -*- coding: utf-8 -*- """ requests.cookies ~~~~~~~~~~~~~~~~ Compatibility code to be able to use `cookielib.CookieJar` with requests. requests.utils imports from here, so be careful with imports. """ import copy import time import calendar import collections from ._internal_utils import to_native_string from .co...
gpl-3.0
7,624,994,782,876,321,000
32.594096
111
0.619892
false
Carreau/pytest
testing/test_recwarn.py
3
2465
import py, pytest from _pytest.recwarn import WarningsRecorder def test_WarningRecorder(recwarn): showwarning = py.std.warnings.showwarning rec = WarningsRecorder() assert py.std.warnings.showwarning != showwarning assert not rec.list py.std.warnings.warn_explicit("hello", UserWarning, "xyz", 13) ...
mit
8,458,440,122,280,732,000
29.8125
82
0.640162
false
0111001101111010/open-health-inspection-api
venv/lib/python2.7/site-packages/flask/logging.py
838
1398
# -*- coding: utf-8 -*- """ flask.logging ~~~~~~~~~~~~~ Implements the logging support for Flask. :copyright: (c) 2011 by Armin Ronacher. :license: BSD, see LICENSE for more details. """ from __future__ import absolute_import from logging import getLogger, StreamHandler, Formatter, getLoggerClas...
gpl-2.0
7,072,004,076,150,725,000
30.066667
78
0.673104
false
xhchrn/gegan
model/utils.py
1
3045
# -*- coding: utf-8 -*- from __future__ import print_function from __future__ import absolute_import import os import glob import math import imageio import scipy.misc as misc import numpy as np from PIL import Image def pad_seq(seq, batch_size): # pad the sequence to be the multiples of batch_size seq_len ...
apache-2.0
1,268,040,335,941,444,600
28.563107
109
0.598686
false
Ninjakow/TrueSkill
lib/numpy/core/tests/test_dtype.py
30
25540
from __future__ import division, absolute_import, print_function import sys import numpy as np from numpy.core.test_rational import rational from numpy.testing import ( TestCase, run_module_suite, assert_, assert_equal, assert_raises, dec ) def assert_dtype_equal(a, b): assert_equal(a, b) assert_equa...
gpl-3.0
4,538,219,826,675,778,600
39.929487
87
0.454072
false
naparuba/opsbro
opsbro/misc/internalcherrypy/cherrypy/lib/cpstats.py
49
22770
"""CPStats, a package for collecting and reporting on program statistics. Overview ======== Statistics about program operation are an invaluable monitoring and debugging tool. Unfortunately, the gathering and reporting of these critical values is usually ad-hoc. This package aims to add a centralized place for gather...
mit
535,599,295,233,021,200
32.144105
79
0.568336
false
darkryder/django
django/template/context_processors.py
55
2497
""" A set of request processors that return dictionaries to be merged into a template context. Each function takes the request object as its only parameter and returns a dictionary to add to the context. These are referenced from the 'context_processors' option of the configuration of a DjangoTemplates backend and use...
bsd-3-clause
6,531,566,482,020,059,000
28.72619
90
0.682419
false
ewindisch/nova
nova/api/ec2/ec2utils.py
13
13554
# Copyright 2010 United States Government as represented by the # Administrator of the National Aeronautics and Space Administration. # 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 ...
apache-2.0
4,229,424,420,122,837,000
30.230415
78
0.600044
false
Kraymer/keroaek
keroaek/vlc.py
1
292112
#! /usr/bin/python # Python ctypes bindings for VLC # # Copyright (C) 2009-2012 the VideoLAN team # $Id: $ # # Authors: Olivier Aubert <contact at olivieraubert.net> # Jean Brouwers <MrJean1 at gmail.com> # Geoff Salmon <geoff.salmon at gmail.com> # # This library is free software; you can redistribu...
mit
-1,027,754,649,359,717,600
40.387362
639
0.640285
false
pombredanne/pants
src/python/pants/backend/jvm/subsystems/zinc_language_mixin.py
10
1890
# coding=utf-8 # Copyright 2015 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) class ZincLanguageM...
apache-2.0
744,384,407,442,373,200
38.375
96
0.694709
false
Nihn/Diamond-1
src/diamond/handler/sentry.py
28
10750
# coding=utf-8 """ Diamond handler that check if values are too high or too low, if so send an alert to a Sentry server This handler requires the Python module Raven: http://raven.readthedocs.org/en/latest/index.html To work this handler need a similar configuration: [[SentryHandler]] # Create a new project in Sen...
mit
-9,114,600,094,117,070,000
28.778393
78
0.535256
false
richardbeare/ITK
Wrapping/Generators/Doc/doxy2swig.py
2
11932
#!/usr/bin/env python """Doxygen XML to SWIG docstring converter. Converts Doxygen generated XML files into a file containing docstrings that can be used by SWIG-1.3.x. Note that you need to get SWIG version > 1.3.23 or use Robin Dunn's docstring patch to be able to use the resulting output. Usage: doxy2swig.py i...
apache-2.0
-4,989,223,519,457,796,000
31.161725
73
0.535535
false
styx0x6/gremlins
lib/thirdparty/requests/sessions.py
115
26216
# -*- 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, Ord...
agpl-3.0
-1,262,245,502,181,787,000
35.16
115
0.607301
false
NicolasLM/sauna
sauna/plugins/ext/memcached.py
2
3980
import re import socket from sauna.plugins import (Plugin, bytes_to_human, human_to_bytes, PluginRegister) my_plugin = PluginRegister('Memcached') @my_plugin.plugin() class Memcached(Plugin): def __init__(self, config): super().__init__(config) self.config = { ...
bsd-2-clause
-6,250,320,950,122,258,000
33.017094
79
0.511809
false
dablak/boto
boto/iam/connection.py
7
53721
# Copyright (c) 2010-2011 Mitch Garnaat http://garnaat.org/ # Copyright (c) 2010-2011, Eucalyptus Systems, 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, includin...
mit
4,627,381,419,281,405,000
36.436237
115
0.607472
false
kelseyoo14/Wander
venv_2_7/lib/python2.7/site-packages/setuptools/command/develop.py
450
6610
from distutils.util import convert_path from distutils import log from distutils.errors import DistutilsError, DistutilsOptionError import os import glob from pkg_resources import Distribution, PathMetadata, normalize_path from setuptools.command.easy_install import easy_install from setuptools.compat import PY3 impor...
artistic-2.0
-1,250,253,063,081,173,500
38.112426
79
0.590015
false
shakamunyi/sahara
sahara/service/api/v2/job_binaries.py
1
2190
# Copyright (c) 2016 Red Hat, 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,050,976,151,662,859,000
29.416667
77
0.707763
false
camptocamp/mapproxy
mapproxy/seed/script.py
6
15430
# 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
762,165,162,741,193,500
39.39267
103
0.545431
false
thomasrstorey/Inter-pre-in-vention
backend/node_modules/fast-levenshtein/node_modules/grunt-npm-install/node_modules/npm/node_modules/node-gyp/gyp/pylib/gyp/xcodeproj_file.py
505
118664
# Copyright (c) 2012 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. """Xcode project file generator. This module is both an Xcode project file generator and a documentation of the Xcode project file format. Knowledge of the proje...
mit
-1,765,615,399,850,035,500
40.088643
80
0.653661
false
OCA/l10n-brazil
l10n_br_stock_account/__manifest__.py
1
1134
# Copyright (C) 2014 Renato Lima - Akretion # License AGPL-3 - See http://www.gnu.org/licenses/agpl-3.0.html { "name": "Brazilian Localization WMS Accounting", "category": "Localisation", "license": "AGPL-3", "author": "Akretion, Odoo Community Association (OCA)", "website": "https://github.com/OC...
agpl-3.0
6,697,735,454,450,464,000
28.076923
64
0.565256
false
hastexo/edx-platform
lms/lib/xblock/test/test_mixin.py
8
21705
""" Tests of the LMS XBlock Mixin """ import ddt from nose.plugins.attrib import attr from lms_xblock.mixin import ( INVALID_USER_PARTITION_GROUP_VALIDATION_COMPONENT, INVALID_USER_PARTITION_GROUP_VALIDATION_UNIT, INVALID_USER_PARTITION_VALIDATION_COMPONENT, INVALID_USER_PARTITION_VALIDATION_UNIT, ...
agpl-3.0
-1,265,558,384,570,753,500
43.205703
120
0.655287
false