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
hijiangtao/statePrediction
uniGridDistribution-speedup.py
1
2353
#!/usr/bin/env python # -*- coding: utf-8 -*- # import sys import time import logging import getopt from multiprocessing import Process from util.preprocess import mergeMultiProcessMatFiles from util.UniGridDisOnlyPoints import UniGridDisOnlyPoints def processTask(x, city, directory, inum, onum, GRIDSNUM, subopa...
apache-2.0
-4,500,627,182,522,820,000
21.268041
127
0.658175
false
sorig/shogun
examples/undocumented/python/so_multiclass.py
6
1584
#!/usr/bin/env python import numpy as np def gen_data(num_classes,num_samples,dim): np.random.seed(0) covs = np.array([[[0., -1. ], [2.5, .7]], [[3., -1.5], [1.2, .3]], [[ 2, 0 ], [ .0, 1.5 ]]]) X = np.r_[np.dot(np.random.randn(num_samples, dim), covs[0]) + np.array([0, 10]), np.dot(np.random.randn...
bsd-3-clause
3,464,926,890,474,353,700
28.886792
86
0.672348
false
risd-cs/codedrop-twitterbot
yaml/nodes.py
985
1440
class Node(object): def __init__(self, tag, value, start_mark, end_mark): self.tag = tag self.value = value self.start_mark = start_mark self.end_mark = end_mark def __repr__(self): value = self.value #if isinstance(value, list): # if len(value) == 0: ...
mit
7,904,090,998,520,014,000
28.387755
82
0.511111
false
idealo/mongo-connector
mongo_connector/mongo_connector.py
4
20079
# Copyright 2012 10gen, 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, softw...
apache-2.0
-7,547,913,655,077,246,000
40.83125
79
0.529807
false
anna-effeindzourou/trunk
doc/sphinx/ipython_directive.py
8
18579
# -*- coding: utf-8 -*- """Sphinx directive to support embedded IPython code. This directive allows pasting of entire interactive IPython sessions, prompts and all, and their code will actually get re-executed at doc build time, with all prompts renumbered sequentially. To enable this directive, simply list it in you...
gpl-2.0
5,910,502,342,351,283,000
29.157468
159
0.557194
false
nishad-jobsglobal/odoo-marriot
addons/product/pricelist.py
154
26498
# -*- 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
-592,916,247,887,910,000
48.252788
246
0.554872
false
neuropoly/spinalcordtoolbox
unit_testing/test_deepseg_sc.py
1
3912
#!/usr/bin/env python # -*- coding: utf-8 # pytest unit tests for spinalcordtoolbox.deepseg_sc import pytest import numpy as np import nibabel as nib from keras import backend as K import spinalcordtoolbox as sct from spinalcordtoolbox.image import Image import spinalcordtoolbox.deepseg_sc.core from spinalcordtoolbox...
mit
-3,721,437,269,529,233,400
38.12
113
0.643916
false
net592/OneOps
dashboard/views.py
1
2419
#coding=utf-8 from django.shortcuts import render from django.contrib.auth.decorators import login_required from dashboard.models import * from returner.models import * import logging from shaker.tasks import dashboard_task, grains_task from shaker.check_service import CheckPort, CheckProgress logger = logging.getLogg...
apache-2.0
281,895,467,597,572,540
37.951613
131
0.591304
false
peterm-itr/edx-platform
common/test/acceptance/tests/helpers.py
5
7956
""" Test helper functions and base classes. """ import json import unittest import functools import requests import os from path import path from bok_choy.web_app_test import WebAppTest from opaque_keys.edx.locator import CourseLocator def skip_if_browser(browser): """ Method decorator that skips a test if br...
agpl-3.0
2,847,445,506,556,988,400
27.618705
112
0.576546
false
elventear/ansible
lib/ansible/plugins/callback/minimal.py
10
3874
# (c) 2012-2014, Michael DeHaan <michael.dehaan@gmail.com> # # This file is part of Ansible # # Ansible is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation, either version 3 of the License, or # (at your option) an...
gpl-3.0
-5,184,981,746,824,381,000
44.046512
157
0.648942
false
2015fallproject/2015fallcase1
static/Brython3.2.0-20150701-214155/Lib/encodings/ptcp154.py
34
14327
""" Python Character Mapping Codec generated from 'PTCP154.txt' with gencodec.py. Written by Marc-Andre Lemburg (mal@lemburg.com). (c) Copyright CNRI, All Rights Reserved. NO WARRANTY. (c) Copyright 2000 Guido van Rossum. """#" import codecs ### Codec APIs class Codec(codecs.Codec): def encode...
agpl-3.0
-241,008,941,386,931,800
43.919872
81
0.546381
false
alshedivat/tensorflow
tensorflow/compiler/tests/oom_test.py
7
2989
# 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
-620,567,689,462,652,000
38.328947
80
0.654399
false
CKiilu/scurrae
node_modules/grunt-docker/node_modules/docker/node_modules/pygmentize-bundled/vendor/pygments/pygments/formatters/img.py
268
18059
# -*- coding: utf-8 -*- """ pygments.formatters.img ~~~~~~~~~~~~~~~~~~~~~~~ Formatter for Pixmap output. :copyright: Copyright 2006-2013 by the Pygments team, see AUTHORS. :license: BSD, see LICENSE for details. """ import sys from pygments.formatter import Formatter from pygments.util import ge...
mit
8,399,014,476,050,953,000
31.65642
84
0.551083
false
SusanJL/iris
lib/iris/tests/unit/analysis/scipy_interpolate/test__RegularGridInterpolator.py
16
3938
# (C) British Crown Copyright 2015, Met Office # # This file is part of Iris. # # Iris is free software: you can redistribute it and/or modify it under # the terms of the GNU Lesser General Public License as published by the # Free Software Foundation, either version 3 of the License, or # (at your option) any later ve...
gpl-3.0
-3,297,330,871,129,044,500
39.597938
79
0.622651
false
benjaminbrinkman/open-ad-platform
.venv/lib/python3.4/site-packages/pbr/options.py
99
2371
# 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 the...
mit
-6,603,088,603,400,270,000
43.735849
77
0.736398
false
unseenlaser/python-for-android
python-modules/twisted/twisted/python/dist.py
60
12329
""" Distutils convenience functionality. Don't use this outside of Twisted. Maintainer: Christopher Armstrong """ import sys, os from distutils.command import build_scripts, install_data, build_ext, build_py from distutils.errors import CompileError from distutils import core from distutils.core import Extension tw...
apache-2.0
7,333,104,227,639,396,000
33.152355
79
0.603293
false
cloudera/hue
desktop/core/ext-py/django-ipware-2.1.0/ipware/tests/tests_v1/tests_ipv4.py
2
14544
# -*- coding: utf-8 -*- from django.conf import settings from django.http import HttpRequest from django.test import TestCase from ipware.ip import get_ip from ipware.ip import get_real_ip from ipware.ip import get_trusted_ip class IPv4TestCase(TestCase): """IP address Test""" def test_meta_none(self): ...
apache-2.0
-883,908,780,585,420,000
35.36
117
0.559131
false
piyush0609/scipy
scipy/io/harwell_boeing/tests/test_hb.py
126
2389
from __future__ import division, print_function, absolute_import import os import sys if sys.version_info[0] >= 3: from io import StringIO else: from StringIO import StringIO import tempfile import numpy as np from numpy.testing import TestCase, assert_equal, \ assert_array_almost_equal_nulp from scipy....
bsd-3-clause
-4,004,972,453,254,120,000
32.180556
79
0.562578
false
andreparames/odoo
addons/pos_discount/__init__.py
315
1072
# -*- 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
-7,727,564,469,930,391,000
41.88
79
0.609142
false
ahmed-mahran/hue
desktop/core/ext-py/tablib-0.10.0/tablib/packages/xlwt3/ExcelMagic.py
46
29668
""" lots of Excel Magic Numbers """ # Boundaries BIFF8+ MAX_ROW = 65536 MAX_COL = 256 biff_records = { 0x0000: "DIMENSIONS", 0x0001: "BLANK", 0x0002: "INTEGER", 0x0003: "NUMBER", 0x0004: "LABEL", 0x0005: "BOOLERR", 0x0006: "FORMULA", 0x0007: "STRING", 0x0008: "RO...
apache-2.0
7,660,309,672,042,519,000
32.537835
85
0.413981
false
NeuralEnsemble/python-neo
neo/core/regionofinterest.py
5
5411
from math import floor, ceil class RegionOfInterest: """Abstract base class""" pass class CircularRegionOfInterest(RegionOfInterest): """Representation of a circular ROI *Usage:* >>> roi = CircularRegionOfInterest(20.0, 20.0, radius=5.0) >>> signal = image_sequence.signal_from_region(roi) ...
bsd-3-clause
-851,341,038,118,640,000
30.829412
116
0.535576
false
AccaliaDeElementia/Spearmint
Comic.py
1
4094
#!/usr/bin/env python3 '''Spearmint Comic Comic plugin for Spearmint ''' import os from time import mktime from zipfile import is_zipfile, ZipFile import mimetypes import cherrypy import Utils mimetypes.init() class Comic(object): '''Spearmint Comic Plugin Main Class''' def __init__(self, path=None): ...
mit
-819,664,736,184,811,500
33.116667
77
0.55789
false
Stavitsky/nova
nova/tests/unit/network/test_rpcapi.py
27
13204
# Copyright 2013 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 agre...
apache-2.0
-6,874,535,614,971,943,000
41.731392
79
0.599894
false
ArtRand/signalAlign
scripts/hdp_pipeline.py
2
13032
#!/usr/bin/env python """Master pipeline script for generating trained HDPs for MinION signal data Input: alignments using non-HDP model Output: trained HDP and model The objective of this pipeline is to: 1. use input alignments to make 'build alignment' for generating the initial HDP 2. generates the initial...
mit
3,020,949,472,904,513,000
49.316602
119
0.610344
false
pexip/pygobject
tests/test_ossig.py
1
6285
# -*- coding: utf-8 -*- # Copyright 2017 Christoph Reiter # # This library is free software; you can redistribute it and/or # modify it under the terms of the GNU Lesser General Public # License as published by the Free Software Foundation; either # version 2.1 of the License, or (at your option) any later version. # #...
lgpl-2.1
6,770,880,541,605,651,000
34.111732
79
0.61257
false
googleapis/googleapis-gen
google/ads/googleads/v7/googleads-py/google/ads/googleads/v7/common/types/asset_policy.py
1
2207
# -*- coding: utf-8 -*- # Copyright 2020 Google LLC # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or...
apache-2.0
4,369,349,687,305,149,400
34.596774
108
0.710014
false
sysadminmatmoz/OCB
addons/base_gengo/wizard/base_gengo_translations.py
45
12183
# -*- coding: utf-8 -*- # Part of Odoo. See LICENSE file for full copyright and licensing details. import uuid import logging import re import time from openerp.osv import osv, fields from openerp import tools, SUPERUSER_ID from openerp.tools.translate import _ from openerp.exceptions import UserError _logger = logg...
agpl-3.0
-2,299,994,114,045,600,500
46.589844
212
0.573094
false
jgeskens/django
tests/special_headers/tests.py
4
2696
from django.contrib.auth.models import User from django.test import TestCase from django.test.utils import override_settings @override_settings(PASSWORD_HASHERS=('django.contrib.auth.hashers.SHA1PasswordHasher',)) class SpecialHeadersTest(TestCase): fixtures = ['data.xml'] urls = 'special_headers.urls' d...
bsd-3-clause
4,775,421,884,894,648,000
42.483871
88
0.646884
false
jamesblunt/scrapy
scrapy/contracts/__init__.py
159
5416
import sys import re from functools import wraps from unittest import TestCase from scrapy.http import Request from scrapy.utils.spider import iterate_spider_output from scrapy.utils.python import get_spec class ContractsManager(object): contracts = {} def __init__(self, contracts): for contract in ...
bsd-3-clause
-7,437,758,328,983,048,000
32.432099
82
0.557238
false
qbilius/streams
streams/utils.py
1
13227
import functools import numpy as np import scipy.stats import pandas import matplotlib.pyplot as plt import seaborn as sns def splithalf(data, aggfunc=np.nanmean, rng=None): data = np.array(data) if rng is None: rng = np.random.RandomState(None) inds = list(range(data.shape[0])) rng.shuffle(i...
gpl-3.0
-7,694,729,495,505,891,000
35.043597
129
0.532018
false
lumig242/Hue-Integration-with-CDAP
desktop/core/ext-py/openpyxl-2.3.0-b2/openpyxl/chart/series_factory.py
13
1413
from __future__ import absolute_import # Copyright (c) 2010-2015 openpyxl from .data_source import NumDataSource, NumRef, AxDataSource from .reference import Reference from .series import Series, XYSeries, SeriesLabel, StrRef from ..utils import SHEETRANGE_RE, rows_from_range, quote_sheetname def SeriesFactory(value...
apache-2.0
-7,678,257,453,198,125,000
32.642857
89
0.661005
false
AsgerPetersen/QGIS
python/core/__init__.py
1
5343
# -*- coding: utf-8 -*- """ *************************************************************************** __init__.py --------------------- Date : May 2014 Copyright : (C) 2014 by Nathan Woodrow Email : woodrow dot nathan at gmail dot com ********************...
gpl-2.0
2,135,880,013,839,288,300
31.579268
149
0.572899
false
chjj/bitcoin
qa/rpc-tests/rpcbind_test.py
17
5746
#!/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. # Test for -rpcbind, as well as -rpcallowip and -rpcconnect # Add python-bitcoinrpc to module search path:...
mit
-3,378,742,336,464,755,700
36.311688
110
0.629481
false
SB-BISS/RLACOSarsaLambda
Mountain_Car_Grid_Search.py
1
5705
''' This is a GRID search to find the best parameters of an algorithm. In future developments it will be parallelized. In the Mountain Car Problem, for Sarsa with Tile Coding, we have the parameters from Sutton and Barto Book alpha = 0.5 (then divided by num tilings, so it becomes 0.5/0.8, check the implement...
mit
2,957,828,905,765,643,000
38.190141
233
0.519544
false
BeegorMif/HTPC-Manager
setup.py
1
8776
import re import urllib, ConfigParser from distutils.core import setup import py2exe, sys, os, shutil, datetime, zipfile, subprocess, fnmatch import googlecode_upload from lib.pygithub import github # mostly stolen from the SABnzbd package.py file name = 'SickBeard' version = '0.1' release = name + '-' + version Win...
gpl-3.0
-4,721,852,718,773,956,000
31.14652
232
0.638788
false
barraponto/scrapy
tests/mockserver.py
15
6998
from __future__ import print_function import sys, time, random, os, json from six.moves.urllib.parse import urlencode from subprocess import Popen, PIPE from twisted.web.server import Site, NOT_DONE_YET from twisted.web.resource import Resource from twisted.internet import reactor, defer, ssl from scrapy import twisted...
bsd-3-clause
1,837,426,666,487,394,000
29.828194
106
0.599171
false
thatchristoph/namebench
nb_third_party/dns/rdtypes/IN/APL.py
248
5525
# 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
7,620,110,420,544,238,000
31.5
79
0.548778
false
evansd/whitenoise
docs/conf.py
1
8679
# flake8: noqa # -*- coding: utf-8 -*- # # WhiteNoise documentation build configuration file, created by # sphinx-quickstart on Sun Aug 11 15:22:49 2013. # # This file is execfile()d with the current directory set to its containing dir. # # Note that not all possible configuration values are present in this # autogener...
mit
5,788,423,269,498,770,000
31.750943
87
0.690748
false
midori1/midorinoblog
site-packages/django/core/cache/backends/db.py
80
8853
"Database cache backend." import base64 from datetime import datetime try: from django.utils.six.moves import cPickle as pickle except ImportError: import pickle from django.conf import settings from django.core.cache.backends.base import BaseCache, DEFAULT_TIMEOUT from django.db import connections, transacti...
apache-2.0
6,296,189,301,561,093,000
41.768116
101
0.575398
false
LethusTI/supportcenter
vendor/django/django/views/generic/dates.py
80
19895
import datetime from django.db import models from django.core.exceptions import ImproperlyConfigured from django.http import Http404 from django.utils.encoding import force_unicode from django.utils.translation import ugettext as _ from django.utils import timezone from django.views.generic.base import View from django...
gpl-3.0
1,276,135,359,280,253,200
31.775947
126
0.596984
false
hainm/pythran
pythran/tests/cases/emin.py
5
1559
#from https://gist.github.com/andersx/6061586 #runas run() #bench run() #pythran export run() # A simple energy minimization program that uses steepest descent # and a force field to minimize the energy of water in internal coordinates. # Written by Jan H. Jensen, 2013 def Eandg(rOH,thetaHOH): """" Argumen...
bsd-3-clause
5,472,309,363,139,120,000
22.621212
76
0.597819
false
dincamihai/django-allauth
allauth/socialaccount/providers/amazon/views.py
73
1304
import requests from allauth.socialaccount.providers.oauth2.views import (OAuth2Adapter, OAuth2LoginView, OAuth2CallbackView) from .provider import AmazonProvider class AmazonOAuth2Adapter(OAuth2Adapte...
mit
-6,374,644,953,295,030,000
37.352941
77
0.593558
false
ShineFan/odoo
addons/account/account_move_line.py
109
78511
# -*- 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,625,460,587,861,392,600
53.445908
269
0.564622
false
ltilve/chromium
tools/telemetry/telemetry/core/android_app_unittest.py
3
2050
# 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 logging import time import unittest from pylib.device import intent from telemetry.core import android_app from telemetry.core.backends import androi...
bsd-3-clause
-1,719,569,583,730,337,500
36.962963
80
0.739024
false
Fusion-Rom/android_external_chromium_org
tools/telemetry/telemetry/page/page_runner.py
25
22196
# 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 logging import optparse import os import random import sys import tempfile import time from telemetry import decorators from telemetry.core import br...
bsd-3-clause
-3,345,971,539,491,701,000
38.565062
80
0.672689
false
marcusmueller/gnuradio
grc/core/utils/backports/shlex.py
7
1362
# Copyright 2016 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 option) # any later version. # # G...
gpl-3.0
4,593,593,750,988,702,000
27.978723
70
0.68649
false
iu5team/rms
app/utils/db_utils.py
1
1349
import abc import sqlite3 from django.conf import settings class Connection(object): obj = None DB_PATH = None def __init__(self): super(Connection, self).__init__() self.db_name = settings.DATABASES['default']['NAME'] if self.DB_PATH is None else self.DB_PATH self.conn = sqlite3....
mit
-8,648,841,970,114,870,000
28.977778
115
0.598962
false
diging/jars
cookies/tests/test_aggregate.py
1
8457
import unittest, mock, shutil, tempfile, os from cookies import aggregate from cookies.models import * from django.db import transaction class TestAggregate(unittest.TestCase): def setUp(self): with transaction.atomic(): self.user = User.objects.create(username='bob') self.superco...
gpl-3.0
2,149,628,725,095,094,000
45.723757
187
0.632139
false
cedi4155476/QGIS
python/plugins/processing/algs/qgis/RandomPointsLayer.py
5
4796
# -*- coding: utf-8 -*- """ *************************************************************************** RandomPointsLayer.py --------------------- Date : April 2014 Copyright : (C) 2014 by Alexander Bruy Email : alexander dot bruy at gmail dot com *********...
gpl-2.0
-2,059,608,246,795,716,000
40.344828
118
0.542118
false
nateprewitt/pipenv
pipenv/patched/pip/_vendor/distro.py
330
38349
# Copyright 2015,2016 Nir Cohen # # 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, s...
mit
-948,366,285,724,121,600
34.475486
79
0.621346
false
tundra/neutrino
tests/python/plankton/test_options.py
2
3778
#!/usr/bin/python # Copyright 2013 the Neutrino authors (see AUTHORS). # Licensed under the Apache License, Version 2.0 (see LICENSE). from plankton import options import unittest a = options.ArgumentElement f = options.FlagElement N = None def o(*elms): return options.Options(elements=elms) class OptionsTest...
apache-2.0
6,166,023,337,444,695,000
31.852174
96
0.401535
false
memsharded/conan
conans/util/windows.py
1
4269
import os import subprocess import tempfile from conans.util.env_reader import get_env from conans.util.files import load, mkdir, rmdir, save from conans.util.log import logger from conans.util.sha import sha256 CONAN_LINK = ".conan_link" CONAN_REAL_PATH = "real_path.txt" def conan_expand_user(path): """ wrappe...
mit
3,879,318,092,549,654,500
36.447368
101
0.668306
false
lmorchard/django
tests/urlpatterns_reverse/urls.py
199
5421
import warnings from django.conf.urls import include, patterns, url from django.utils.deprecation import RemovedInDjango110Warning from .views import ( absolute_kwargs_view, defaults_view, empty_view, empty_view_partial, empty_view_wrapped, nested_view, ) other_patterns = [ url(r'non_path_include/$', emp...
bsd-3-clause
1,198,138,442,822,059,800
58.571429
117
0.571112
false
spring-week-topos/nova-week
nova/openstack/common/report/models/version.py
27
1509
# Copyright 2013 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 agre...
apache-2.0
3,346,284,667,992,687,600
33.295455
78
0.71173
false
dmitry-sobolev/ansible
test/runner/lib/import_analysis.py
12
8634
"""Analyze python import statements.""" from __future__ import absolute_import, print_function import ast import os import uuid from lib.util import ( display, ApplicationError, ) VIRTUAL_PACKAGES = set([ 'ansible.module_utils.six', ]) def get_python_module_utils_imports(compile_targets): """Retur...
gpl-3.0
-5,847,929,388,590,848,000
34.530864
130
0.59729
false
marhag87/python-gerrit
gerrit/changes/revision.py
3
1911
""" Revision ====== Manage gerrit revisions for a change id """ from gerrit.error import ( UnhandledError ) class Revision(object): """Manage gerrit revisions""" def __init__(self, gerrit_con, change_id, revision_id): """ :param gerrit_con: The connection object to gerrit :type ...
apache-2.0
1,178,388,909,191,107,000
27.954545
84
0.553114
false
ajclarke/neo-fighting-dojo
scripts/premake/pack-assets.py
1
1254
import os import shutil import packer UNPROCESSED_ASSET_FOLDER = "assets/unprocessed" PROCESSED_ASSET_FOLDER = "assets/preprocessed" TEXTURE_FOLDER = "assets/compiled" print("=== Processing unprocessed assets in {} ===".format( UNPROCESSED_ASSET_FOLDER)) for root, dirs, files in os.walk(UNPROCESSED_ASSET_FOLDE...
gpl-3.0
8,194,004,954,102,526,000
37
78
0.649123
false
mayankcu/Django-social
venv/Lib/site-packages/django/contrib/localflavor/mx/mx_states.py
88
1296
# -*- coding: utf-8 -*- """ A list of Mexican states for use as `choices` in a formfield. This exists in this standalone file so that it's only imported into memory when explicitly needed. """ from django.utils.translation import ugettext_lazy as _ # All 31 states, plus the `Distrito Federal`. STATE_CHOICES = ( ...
bsd-3-clause
-647,177,489,750,312,700
27.666667
74
0.50155
false
ewandor/home-assistant
homeassistant/util/yaml.py
2
11795
"""YAML utility functions.""" import logging import os import sys import fnmatch from collections import OrderedDict from typing import Union, List, Dict import yaml try: import keyring except ImportError: keyring = None try: import credstash # pylint: disable=import-error except ImportError: credsta...
apache-2.0
1,963,855,736,761,035,800
34
79
0.623993
false
dgjustice/ansible
test/units/modules/network/ios/test_ios_system.py
59
5262
# # (c) 2016 Red Hat Inc. # # This file is part of Ansible # # Ansible is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation, either version 3 of the License, or # (at your option) any later version. # # Ansible is d...
gpl-3.0
-8,009,037,755,624,452,000
41.780488
91
0.638731
false
chubbymaggie/ROPgadget
dependencies/capstone-next/bindings/python/test_skipdata.py
3
2417
#!/usr/bin/env python # Capstone Python bindings, by Nguyen Anh Quynnh <aquynh@gmail.com> from __future__ import print_function from capstone import * import binascii from test import to_x, to_hex, to_x_32 X86_CODE32 = b"\x8d\x4c\x32\x08\x01\xd8\x81\xc6\x34\x12\x00\x00\x00\x91\x92" RANDOM_CODE = b"\xed\x00\x00\x00\...
gpl-2.0
-423,858,343,269,658,000
31.662162
177
0.578403
false
domyam97/airlights
slack/venv/lib/python2.7/site-packages/urllib3/_collections.py
95
10204
from __future__ import absolute_import from collections import Mapping, MutableMapping try: from threading import RLock except ImportError: # Platform-specific: No threads available class RLock: def __enter__(self): pass def __exit__(self, exc_type, exc_value, traceback): ...
mit
6,710,038,248,380,406,000
30.987461
92
0.579871
false
durai145/youtube-dl
youtube_dl/extractor/pornhub.py
51
5647
from __future__ import unicode_literals import os import re from .common import InfoExtractor from ..compat import ( compat_urllib_parse_unquote, compat_urllib_parse_unquote_plus, compat_urllib_parse_urlparse, compat_urllib_request, ) from ..utils import ( ExtractorError, str_to_int, ) from .....
unlicense
-5,834,095,702,616,083,000
35.198718
125
0.525412
false
i-am-offline/smarthome
plugins/artnet/__init__.py
12
4335
#!/usr/bin/env python3 # coding=utf-8 # # Copyright 2013 KNX-User-Forum e.V. http://knx-user-forum.de/ # Author mode@gmx.co.uk # # This file is part of SmartHome.py. http://mknx.github.io/smarthome/ # # SmartHome.py is free software: you can redistribute it and/or modify # it under the terms of the ...
gpl-3.0
2,396,173,213,035,261,000
33.133858
88
0.58293
false
felixma/nova
nova/virt/hyperv/basevolumeutils.py
59
5541
# # Copyright 2012 Pedro Navarro Perez # Copyright 2013 Cloudbase Solutions Srl # 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
3,866,446,047,734,009,000
36.187919
78
0.623895
false
Acidburn0zzz/servo
tests/wpt/web-platform-tests/tools/wptrunner/wptrunner/wptcommandline.py
3
36909
from __future__ import absolute_import, print_function import argparse import os import sys from collections import OrderedDict from distutils.spawn import find_executable from datetime import timedelta from six import iterkeys, itervalues, iteritems from . import config from . import wpttest from .formatters import c...
mpl-2.0
-3,341,579,297,384,909,300
53.039531
132
0.57807
false
jacquerie/inspire-next
inspirehep/alembic/cb9f81e8251c_add_record_metadata_indices.py
2
1950
# -*- coding: utf-8 -*- # # This file is part of INSPIRE. # Copyright (C) 2014-2017 CERN. # # INSPIRE 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 ...
gpl-3.0
8,903,968,308,310,055,000
33.210526
99
0.715897
false
potash/scikit-learn
examples/ensemble/plot_voting_decision_regions.py
86
2386
""" ================================================== Plot the decision boundaries of a VotingClassifier ================================================== Plot the decision boundaries of a `VotingClassifier` for two features of the Iris dataset. Plot the class probabilities of the first sample in a toy dataset pred...
bsd-3-clause
5,092,721,051,043,588,000
32.138889
77
0.626572
false
ROAND/dota2herovoices
.buildozer/venv/lib/python2.7/site-packages/distribute-0.6.49-py2.7.egg/setuptools/command/build_ext.py
136
11704
from distutils.command.build_ext import build_ext as _du_build_ext try: # Attempt to use Pyrex for building extensions, if available from Pyrex.Distutils.build_ext import build_ext as _build_ext except ImportError: _build_ext = _du_build_ext import os, sys from distutils.file_util import copy_file from set...
gpl-2.0
1,162,094,801,582,145,500
38.809524
93
0.581596
false
simleo/openmicroscopy
components/tools/OmeroWeb/test/integration/test_links.py
2
9784
#!/usr/bin/env python # -*- coding: utf-8 -*- # Copyright (C) 2015 University of Dundee & Open Microscopy Environment. # All rights reserved. # # This program 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 Founda...
gpl-2.0
-1,390,429,169,507,808,000
37.519685
78
0.569297
false
Phil9l/cosmos
code/data_structures/src/stack/reverse_stack/reverse_stack.py
3
1726
""" Part of Cosmos by OpenGenus Foundation """ # stack class class Stack: def __init__(self): self.items = [] # check if the stack is empty def isEmpty(self): return self.items == [] # push item into the stack def push(self, item): self.items.append(item) # pop item f...
gpl-3.0
-4,150,816,710,682,346,500
22.972222
97
0.563731
false
aprefontaine/TMScheduler
db/base.py
2
8598
import datetime from .creation import DatabaseCreation from ..utils import appid, have_appserver, on_production_server from djangotoolbox.db.base import NonrelDatabaseFeatures, \ NonrelDatabaseOperations, NonrelDatabaseWrapper, NonrelDatabaseClient, \ NonrelDatabaseValidation, NonrelDatabaseIntrospection import...
bsd-3-clause
-1,580,329,246,406,057,700
42.424242
100
0.609211
false
nhomar/odoo-mirror
addons/mail/ir_attachment.py
378
5643
# -*- coding: utf-8 -*- ############################################################################## # # OpenERP, Open Source Management Solution # Copyright (C) 2014-TODAY OpenERP SA (http://www.openerp.com) # # This program is free software: you can redistribute it and/or modify # it under the terms of ...
agpl-3.0
-6,693,661,024,176,355,000
27.790816
101
0.448343
false
adamchainz/ansible
lib/ansible/plugins/shell/sh.py
69
4222
# (c) 2014, Chris Church <chris@ninemoreminutes.com> # # This file is part of Ansible. # # Ansible is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation, either version 3 of the License, or # (at your option) any lat...
gpl-3.0
-8,301,684,304,854,092,000
50.487805
396
0.637613
false
D4rk4/Neural-Network-Trading-Bot
pyTrader/db_access.py
3
2030
import sqlite3 # execute, fetchone, fetchall, commit import os.path # path.isfile timeout = 15 nonce_table = 'nonce' output_table = 'output' def create_nonce_db(): new_nonce_db = sqlite3.connect('auth/nonce.sqlite') new_nonce_db.execute('CREATE TABLE IF NOT EXISTS nonce (current_nonce INTEGER)' ) new_no...
mit
2,186,132,986,971,176,200
34.017241
146
0.671921
false
mikekap/buck
third-party/py/unittest2/unittest2/result.py
152
6133
"""Test result object""" import sys import traceback import unittest from StringIO import StringIO from unittest2 import util from unittest2.compatibility import wraps __unittest = True def failfast(method): @wraps(method) def inner(self, *args, **kw): if getattr(self, 'failfast', False): ...
apache-2.0
6,078,170,640,668,708,000
32.513661
79
0.57851
false
hugegreenbug/libgestures
include/build/ios/clean_env.py
208
2258
#!/usr/bin/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. import os import sys def Main(argv): """This is like 'env -i', but it uses a whitelist of env variables to allow through to the co...
bsd-3-clause
5,757,103,196,688,012,000
28.324675
79
0.637733
false
promptworks/horizon
openstack_dashboard/dashboards/project/loadbalancers/panel.py
33
1733
# 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,829,397,339,263,388,000
34.367347
78
0.652048
false
AlexBourassa/Generic_UI
A_Lab/Tests/ConsoleWidget.py
4
1958
# -*- coding: utf-8 -*- """ This class was borrowed from HyperSpyUI https://github.com/vidartf/hyperspyUI Created on Tue Nov 04 16:04:17 2014 @author: Vidar Tonaas Fauske """ try: from qtconsole.rich_jupyter_widget import RichJupyterWidget from qtconsole.inprocess import QtInProcessKernelManager except Impor...
gpl-2.0
5,722,548,634,991,884,000
30.095238
79
0.654239
false
LynxyssCZ/Flexget
flexget/plugins/filter/seen_movies.py
9
2922
from __future__ import unicode_literals, division, absolute_import from builtins import * # noqa pylint: disable=unused-import, redefined-builtin import logging from collections import defaultdict from flexget import plugin from flexget.event import event from flexget.plugins.filter.seen import FilterSeen log = log...
mit
6,094,412,776,987,740,000
37.96
117
0.584189
false
Regalis/browser-accelerator
browser-accelerator.py
1
9987
#!/usr/bin/python2 # coding=utf-8 # # Copyright 2010 Patryk Jaworski <skorpion9312@gmail.com> # License: GNU GPLv3 # GNUPG=True; GNUPG_MODULE=True; import sys; import tarfile; import commands; import os; import getpass; import shutil; try: import gnupg; except ImportError, e: GNUPG_MODULE=False; GNUPG=False; ...
gpl-3.0
-4,050,809,780,823,815,700
31.216129
213
0.624512
false
jnewbery/bitcoin
test/functional/p2p_leak_tx.py
24
2358
#!/usr/bin/env python3 # Copyright (c) 2017-2020 The Bitcoin Core developers # Distributed under the MIT software license, see the accompanying # file COPYING or http://www.opensource.org/licenses/mit-license.php. """Test that we don't leak txs to inbound peers that we haven't yet announced to""" from test_framework.m...
mit
-4,435,336,301,269,828,600
38.966102
98
0.635708
false
loco-odoo/localizacion_co
openerp/addons-extra/odoo-pruebas/odoo-server/addons/crm_partner_assign/wizard/crm_channel_interested.py
263
3795
# -*- coding: utf-8 -*- ############################################################################## # # OpenERP, Open Source Management Solution # Copyright (C) 2004-2010 Tiny SPRL (<http://tiny.be>). All Rights Reserved # $Id$ # # This program is free software: you can redistribute it and/or modify # ...
agpl-3.0
1,282,683,041,891,395,000
50.283784
160
0.604216
false
maciekcc/tensorflow
tensorflow/contrib/linalg/python/ops/linear_operator_identity.py
31
27452
# 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 applica...
apache-2.0
-7,836,704,889,546,953,000
37.127778
80
0.64611
false
tfiedor/perun
perun/collect/memory/parsing.py
1
5708
"""This module provides methods for parsing raw memory data""" import collections import re from decimal import Decimal import perun.profile.convert as convert import perun.collect.memory.syscalls as syscalls __author__ = "Radim Podola" PATTERN_WORD = re.compile(r"(\w+|[?])") PATTERN_TIME = re.compile(r"\d+([,.]\d*...
gpl-3.0
8,061,640,551,569,402,000
31.248588
90
0.637526
false
msiedlarek/grpc
src/python/grpcio/grpc/framework/interfaces/face/utilities.py
40
6871
# 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
-2,540,404,658,845,487,600
37.601124
80
0.748945
false
jscatena88/snapchat_republisher
bin/updateStory.py
1
1855
#!/usr/bin/env python """Adds whitelisted Friends and Sends Snaps to Story Usage: updateStory.py -u <username> [-p <password> -d <tmpdir> -sv] WHITELIST Options: -h Show usage -u=<username> Username -p=<password> Password(optional, will promp if ommitted) -d=<tmpdir> Wher...
gpl-2.0
-7,845,618,911,190,432,000
27.106061
124
0.611321
false
maysara/pandora_image
pandora/event/migrations/0001_initial.py
1
20453
# -*- coding: utf-8 -*- import datetime from south.db import db from south.v2 import SchemaMigration from django.db import models class Migration(SchemaMigration): def forwards(self, orm): # Adding model 'Event' db.create_table('event_event', ( ('id', self.gf('django.db.models.fields....
gpl-3.0
-4,709,999,592,717,245,000
87.163793
192
0.554735
false
biospi/seamass-windeps
src/boost_1_57_0/libs/python/test/test_pointer_adoption.py
46
1708
# Copyright David Abrahams 2004. Distributed under the Boost # Software License, Version 1.0. (See accompanying # file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) """ >>> from test_pointer_adoption_ext import * >>> num_a_instances() 0 >>> a = create('dynamically allocated') >>> num_a_instances() ...
apache-2.0
-3,803,454,793,635,808,000
17.365591
71
0.612998
false
jackkiej/SickRage
lib/pgi/cffilib/gir/gicallableinfo.py
19
2324
# Copyright 2013 Christoph Reiter # # This library is free software; you can redistribute it and/or # modify it under the terms of the GNU Lesser General Public # License as published by the Free Software Foundation; either # version 2.1 of the License, or (at your option) any later version. from .._compat import xran...
gpl-3.0
7,721,076,455,808,940,000
29.986667
73
0.657057
false
shawnferry/ansible
lib/ansible/plugins/connections/paramiko_ssh.py
4
14549
# (c) 2012, Michael DeHaan <michael.dehaan@gmail.com> # # This file is part of Ansible # # Ansible is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation, either version 3 of the License, or # (at your option) any lat...
gpl-3.0
-1,324,625,205,339,831,600
35.739899
198
0.600591
false
dschwen/libmesh
contrib/eigen/3.2.9/scripts/relicense.py
315
2368
# This file is part of Eigen, a lightweight C++ template library # for linear algebra. # # Copyright (C) 2012 Keir Mierle <mierle@gmail.com> # # 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://m...
lgpl-2.1
5,250,300,388,069,533,000
33.318841
77
0.684544
false
luckielordie/conan
conans/test/integration/options_test.py
1
7636
import unittest from conans.test.utils.tools import TestClient from conans.paths import CONANINFO from conans.util.files import load import os class OptionsTest(unittest.TestCase): def general_scope_options_test_package_test(self): client = TestClient() conanfile = """from conans import ConanFile...
mit
7,394,234,129,616,943,000
39.834225
94
0.619434
false
hujiajie/chromium-crosswalk
chrome/common/extensions/docs/server2/chained_compiled_file_system.py
79
4205
# 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. from compiled_file_system import CompiledFileSystem from docs_server_utils import StringIdentity from file_system import FileNotFoundError from future import...
bsd-3-clause
2,607,512,192,751,770,600
43.734043
80
0.705826
false
esotericnomen/concordance
concordance.py
1
5106
#! /usr/bin/env python # coding: utf-8 """ ############################################################################## # Description : This module reads the I/P document and prints # # # Meaningful unique words # # # Count of occurance in the document and # # # Number of senses ...
gpl-3.0
2,508,080,648,036,619,300
32.565789
94
0.625637
false
tardyp/buildbot
master/buildbot/db/migrate/versions/058_add_build_data_length.py
5
1187
# This file is part of Buildbot. Buildbot 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, version 2. # # This program is distributed in the hope that it will be useful, but WITHOUT # ANY WARRANTY; without even...
gpl-2.0
-7,646,691,359,099,551,000
39.931034
92
0.754002
false
boyleworkflow/boyle
boyleworkflow/core.py
1
2520
from typing import Mapping, Union, Any, Iterable, NewType, Sequence, Tuple, List import itertools import attr from boyleworkflow.util import id_property from boyleworkflow.storage import Storage, Digest from boyleworkflow.loc import Loc, check_valid_loc, normalize_loc @attr.s(auto_attribs=True, frozen=True) class R...
lgpl-3.0
5,867,308,437,519,058,000
23.705882
80
0.642063
false
WSDC-NITWarangal/django
tests/aggregation_regress/models.py
282
3288
# -*- coding: utf-8 -*- from django.contrib.contenttypes.fields import ( GenericForeignKey, GenericRelation, ) from django.contrib.contenttypes.models import ContentType from django.db import models from django.utils.encoding import python_2_unicode_compatible @python_2_unicode_compatible class Author(models.Mode...
bsd-3-clause
2,147,042,671,368,976,000
28.621622
103
0.710766
false
clouddocx/boto
tests/unit/s3/test_lifecycle.py
115
3946
# 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 without restriction, including # without limitation the rights ...
mit
316,574,617,151,365,400
39.680412
78
0.647238
false
Alberto-Beralix/Beralix
i386-squashfs-root/usr/share/software-center/softwarecenter/backend/installbackend.py
2
3088
# Copyright (C) 2010 Canonical # # Authors: # Michael Vogt # # 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; version 3. # # This program is distributed in the hope that it will be useful, but W...
gpl-3.0
-1,022,264,158,266,484,600
39.631579
117
0.688795
false