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
cortedeltimo/SickRage
lib/libfuturize/fixes/fix_UserDict.py
51
3845
"""Fix UserDict. Incomplete! TODO: base this on fix_urllib perhaps? """ # Local imports from lib2to3 import fixer_base from lib2to3.fixer_util import Name, attr_chain from lib2to3.fixes.fix_imports import alternates, build_pattern, FixImports MAPPING = {'UserDict': 'collections', } # def alternates(members): # ...
gpl-3.0
3,740,264,090,540,498,400
36.330097
80
0.578934
false
pledra/odoo-product-configurator
website_product_configurator_mrp/controllers/main.py
1
1200
from openerp.http import request from openerp.addons.website_product_configurator.controllers.main import ( WebsiteProductConfig ) class WebsiteProductConfigMrp(WebsiteProductConfig): def cart_update(self, product, post): if post.get('assembly') == 'kit': attr_products = product.attribut...
agpl-3.0
7,855,434,747,765,144,000
37.709677
76
0.6125
false
namecoin/namecore
test/functional/wallet_implicitsegwit.py
48
2424
#!/usr/bin/env python3 # Copyright (c) 2019 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 the wallet implicit segwit feature.""" import test_framework.address as address from test_framework.te...
mit
-6,592,811,673,133,482,000
36.292308
98
0.674092
false
humberos/android_kernel_samsung_smdk4412
tools/perf/scripts/python/failed-syscalls-by-pid.py
11180
2058
# failed system call counts, by pid # (c) 2010, Tom Zanussi <tzanussi@gmail.com> # Licensed under the terms of the GNU GPL License version 2 # # Displays system-wide failed system call totals, broken down by pid. # If a [comm] arg is specified, only syscalls called by [comm] are displayed. import os import sys sys.pa...
gpl-2.0
-6,939,670,984,486,071,000
27.191781
112
0.609815
false
jalavik/harvesting-kit
harvestingkit/scripts/fix_marc_record.py
3
9033
#!/usr/bin/env python # -*- coding: utf-8 -*- ## ## This file is part of Harvesting Kit. ## Copyright (C) 2014 CERN. ## ## Harvesting Kit 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 t...
gpl-2.0
4,726,820,745,643,286,000
35.562753
104
0.548001
false
mfherbst/spack
var/spack/repos/builtin/packages/r-gridextra/package.py
5
1825
############################################################################## # Copyright (c) 2013-2018, Lawrence Livermore National Security, LLC. # Produced at the Lawrence Livermore National Laboratory. # # This file is part of Spack. # Created by Todd Gamblin, tgamblin@llnl.gov, All rights reserved. # LLNL-CODE-64...
lgpl-2.1
-1,614,519,616,321,658,000
45.794872
79
0.680548
false
Yuriy-Leonov/nova
nova/virt/vmwareapi/vmware_images.py
8
8147
# vim: tabstop=4 shiftwidth=4 softtabstop=4 # Copyright (c) 2012 VMware, Inc. # Copyright (c) 2011 Citrix Systems, Inc. # Copyright 2011 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 # ...
apache-2.0
2,949,076,145,159,757,000
42.335106
79
0.613232
false
exercism/xpython
exercises/rest-api/example.py
3
3151
import json class RestAPI: def __init__(self, database=None): self.database = database or {'users': []} def update(self): for user in self.database['users']: owed_by = user['owed_by'] owes = user['owes'] for debtor in list(owed_by.keys()): i...
mit
-3,183,436,242,745,222,700
36.070588
75
0.395747
false
rec/DMXIS
Macros/Python/pickletools.py
5
76619
'''"Executable documentation" for the pickle module. Extensive comments about the pickle protocols and pickle-machine opcodes can be found here. Some functions meant for external use: genops(pickle) Generate all the opcodes in a pickle, as (opcode, arg, position) triples. dis(pickle, out=None, memo=None,...
artistic-2.0
5,298,702,787,502,199,000
31.738001
79
0.573879
false
TurboTurtle/sos
sos/report/plugins/snmp.py
5
1026
# Copyright (C) 2007 Sadique Puthen <sputhenp@redhat.com> # This file is part of the sos project: https://github.com/sosreport/sos # # This copyrighted material is made available to anyone wishing to use, # modify, copy, or redistribute it subject to the terms and conditions of # version 2 of the GNU General Public Li...
gpl-2.0
-3,638,688,149,364,000,000
24.02439
79
0.693957
false
Paul-Ezell/cinder-1
cinder/tests/unit/test_volume_utils.py
9
40038
# Copyright 2011 OpenStack Foundation # All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); you may # not use this file except in compliance with the License. You may obtain # a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless requ...
apache-2.0
1,075,812,181,173,511,400
44.394558
79
0.554398
false
xrg/openerp-server
bin/pychart/zap.py
15
2380
# -*- coding: utf-8 -*- # # Copyright (C) 2000-2005 by Yasushi Saito (yasushi.saito@gmail.com) # # Jockey 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, or (at your option) any # later vers...
agpl-3.0
8,897,508,315,655,689,000
29.126582
71
0.619328
false
kirca/odoo
addons/stock/procurement.py
16
21333
# -*- 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
7,318,562,530,885,715,000
55.287599
292
0.619744
false
balthamos/plover
plover/gui/util.py
7
1868
# Copyright (c) 2013 Hesky Fisher # See LICENSE.txt for details. import sys if sys.platform.startswith('win32'): import win32gui GetForegroundWindow = win32gui.GetForegroundWindow SetForegroundWindow = win32gui.SetForegroundWindow def SetTopApp(): # Nothing else is necessary for windows. ...
gpl-2.0
5,515,011,967,845,564,000
26.880597
75
0.658458
false
duoduo369/leaning-frontend
node_modules/gulp-sass/node_modules/node-sass/node_modules/node-gyp/gyp/pylib/gyp/common_test.py
2542
1970
#!/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. """Unit tests for the common.py file.""" import gyp.common import unittest import sys class TestTopologicallySorted(unittest.TestCase): ...
mit
940,880,455,741,621,800
26.361111
75
0.607614
false
pjenvey/hellanzb
Hellanzb/Daemon.py
2
28607
""" Daemon (aka Ziplick) - Filesystem queue daemon functions. They're all called from inside the twisted reactor loop, except for initialization functions (c) Copyright 2005 Ben Bangert, Philip Jenvey [See end of file] """ import os, re, sys, time, Hellanzb, PostProcessor, PostProcessorUtil from shutil import copy, m...
bsd-3-clause
8,241,517,518,690,693,000
37.868207
102
0.633831
false
havatv/QGIS
python/plugins/MetaSearch/dialogs/xmldialog.py
30
1350
# -*- coding: utf-8 -*- ############################################################################### # # CSW Client # --------------------------------------------------------- # QGIS Catalog Service client. # # Copyright (C) 2014 Tom Kralidis (tomkralidis@gmail.com) # # This source is free software; you can redistri...
gpl-2.0
3,807,566,507,186,138,000
32.75
79
0.602222
false
sysalexis/kbengine
kbe/src/lib/python/Lib/idlelib/tabbedpages.py
86
18418
"""An implementation of tabbed pages using only standard Tkinter. Originally developed for use in IDLE. Based on tabpage.py. Classes exported: TabbedPageSet -- A Tkinter implementation of a tabbed-page widget. TabSet -- A widget containing tabs (buttons) in one or more rows. """ from tkinter import * class InvalidN...
lgpl-3.0
7,990,006,711,624,621,000
35.983936
80
0.568357
false
arunkgupta/gramps
gramps/gen/filters/rules/person/_hasalternatename.py
1
1794
# # Gramps - a GTK+/GNOME based genealogy program # # Copyright (C) 2010 Gramps # # 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
-938,190,663,441,375,900
32.222222
75
0.526198
false
pfalcon/ScratchABlock
xform_inter.py
1
2708
# ScratchABlock - Program analysis and decompilation framework # # Copyright (c) 2015-2018 Paul Sokolovsky # # 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 #...
gpl-3.0
7,595,833,185,750,157,000
34.168831
119
0.681684
false
Parsl/parsl
parsl/tests/configs/comet.py
1
1124
from parsl.config import Config from parsl.launchers import SrunLauncher from parsl.providers import SlurmProvider from parsl.executors import HighThroughputExecutor from .user_opts import user_opts def fresh_config(): return Config( executors=[ HighThroughputExecutor( label='C...
apache-2.0
-1,575,001,041,493,107,200
32.058824
78
0.52847
false
visdesignlab/TulipPaths
tulippaths/connectivityMatrix.py
2
8648
from . import utils from .path import * from .pathFinder import * import copy class ConnectivityMatrix: def __init__(self, graph): self._graph = graph self._paths = [] self._nodes = [] self._initialMatrix = [] self._matrix = [] self._rowLabels = [] self._...
mit
-4,472,252,980,786,112,000
34.012146
106
0.546716
false
tianzhidao28/pyspider
tests/test_fetcher.py
63
12804
#!/usr/bin/env python # -*- encoding: utf-8 -*- # vim: set et sw=4 ts=4 sts=4 ff=unix fenc=utf8: # Author: Binux<i@binux.me> # http://binux.me # Created on 2014-02-15 22:10:35 import os import json import copy import time import umsgpack import subprocess import unittest2 as unittest from multiprocessing impor...
apache-2.0
2,472,003,452,797,581,300
38.481481
96
0.614447
false
kenshay/ImageScript
ProgramData/Android/ADB/platform-tools/systrace/catapult/telemetry/third_party/web-page-replay/third_party/dns/namedict.py
248
2107
# 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 ...
gpl-3.0
1,781,697,565,489,023,200
34.711864
72
0.648315
false
nan86150/ImageFusion
lib/python2.7/site-packages/matplotlib/tests/__init__.py
17
2578
from __future__ import (absolute_import, division, print_function, unicode_literals) import six import difflib import os from matplotlib import rcParams, rcdefaults, use _multiprocess_can_split_ = True # Check that the test directories exist if not os.path.exists(os.path.join( os....
mit
-7,509,536,616,025,931,000
33.837838
78
0.600853
false
destijl/grr
grr/lib/flows/general/windows_vsc_test.py
2
3543
#!/usr/bin/env python """Tests for Windows Volume Shadow Copy flow.""" import stat from grr.lib import aff4 from grr.lib import flags from grr.lib import test_lib # needed for ListVolumeShadowCopies pylint: disable=unused-import from grr.lib.flows.general import windows_vsc # pylint: enable=unused-import from grr.lib....
apache-2.0
-4,680,278,558,029,344,000
30.078947
77
0.650579
false
XiaodunServerGroup/xiaodun-platform
i18n/execute.py
6
1552
import os, subprocess, logging from i18n.config import BASE_DIR LOG = logging.getLogger(__name__) def execute(command, working_directory=BASE_DIR): """ Executes shell command in a given working_directory. Command is a string to pass to the shell. Output is ignored. """ LOG.info("Executing in ...
agpl-3.0
-5,871,596,804,460,276,000
30.673469
116
0.684278
false
artscoop/django-extensions
django_extensions/management/commands/dumpscript.py
24
29506
# -*- coding: UTF-8 -*- """ Title: Dumpscript management command Project: Hardytools (queryset-refactor version) Author: Will Hardy (http://willhardy.com.au) Date: June 2008 Usage: python manage.py dumpscript appname > scripts/scriptname.py $Revision: 217 $ Description: Generates a Py...
mit
-8,925,843,480,743,820,000
36.491741
152
0.605606
false
david-lassonde-adsk/pymel
pymel/util/namedtuple.py
8
5952
""" Cookbook recipe 500261, Raymond Hettinger, planned for inclusion in 2.6 : http://docs.python.org/dev/library/collections.html#collections.namedtuple """ from operator import itemgetter as _itemgetter from keyword import iskeyword as _iskeyword import sys as _sys __all__ = ['namedtuple'] def namedtuple(typenam...
bsd-3-clause
-7,014,750,128,895,671,000
40.048276
126
0.584677
false
onceuponatimeforever/oh-mainline
vendor/packages/kombu/examples/complete_send.py
31
1152
""" Example producer that sends a single message and exits. You can use `complete_receive.py` to receive the message sent. """ from kombu import Connection, Producer, Exchange, Queue #: By default messages sent to exchanges are persistent (delivery_mode=2), #: and queues and exchanges are durable. exchange = Exchan...
agpl-3.0
4,593,339,655,658,135,000
37.4
76
0.694444
false
ahua/pythondotorg
pages/management/commands/fix_success_story_images.py
14
2607
import re import os import requests from urllib.parse import urlparse from django.core.management.base import BaseCommand from django.conf import settings from django.core.files import File from ...models import Page, Image, page_image_path class Command(BaseCommand): """ Fix success story page images """ ...
apache-2.0
-396,239,325,570,602,700
28.965517
73
0.601074
false
andreugrimalt/Theano-Tutorials
5_convolutional_net.py
1
3899
import theano from theano import tensor as T from theano.sandbox.rng_mrg import MRG_RandomStreams as RandomStreams import numpy as np from load import mnist from theano.tensor.nnet.conv import conv2d from theano.tensor.signal.downsample import max_pool_2d import matplotlib.pyplot as plt from mpl_toolkits.axes_grid1 imp...
mit
8,325,993,373,463,679,000
27.669118
96
0.609131
false
prechelt/pyth
pyth/encodings/symbol.py
1
4338
""" Maps Symbol typeface to Unicode, extracted from http://en.wikipedia.org/wiki/Symbol_(typeface) """ from __future__ import absolute_import import codecs import six from six.moves import map decodeTable = { 32: 32, 33: 33, 34: 8704, 35: 35, 36: 8707, 37: 37, 38: 38, 39: 8717, 40: 40, 41: 41, 42: 42, 43: 43...
mit
-7,384,821,434,325,318,000
39.166667
125
0.609267
false
hobarrera/django
tests/template_tests/syntax_tests/test_numpy.py
353
1429
import warnings from unittest import skipIf from django.test import SimpleTestCase from ..utils import setup try: import numpy except ImportError: numpy = False @skipIf(numpy is False, "Numpy must be installed to run these tests.") class NumpyTests(SimpleTestCase): # Ignore numpy deprecation warnings (...
bsd-3-clause
4,778,580,786,112,744,000
28.770833
72
0.603919
false
hronoses/vispy
vispy/app/inputhook.py
21
2446
# -*- coding: utf-8 -*- # Copyright (c) 2015, Vispy Development Team. # Distributed under the (new) BSD License. See LICENSE.txt for more info. """ Support for interactive mode to allow VisPy's event loop to be run alongside a console terminal, without using threads. This code relies on inputhooks built-in to the Pyth...
bsd-3-clause
-2,622,182,783,823,416,000
33.450704
77
0.654129
false
mbauskar/tele-frappe
frappe/model/docfield.py
61
1451
# Copyright (c) 2015, Frappe Technologies Pvt. Ltd. and Contributors # MIT License. See license.txt from __future__ import unicode_literals """docfield utililtes""" import frappe def rename(doctype, fieldname, newname): """rename docfield""" df = frappe.db.sql("""select * from tabDocField where parent=%s and field...
mit
-1,715,768,585,956,874,000
27.470588
85
0.651275
false
BellScurry/gem5-fault-injection
configs/ruby/MESI_Three_Level.py
18
12369
# Copyright (c) 2006-2007 The Regents of The University of Michigan # Copyright (c) 2009,2015 Advanced Micro Devices, Inc. # Copyright (c) 2013 Mark D. Hill and David A. Wood # All rights reserved. # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the fol...
bsd-3-clause
-1,571,782,016,933,889,500
43.333333
78
0.625435
false
sparsebase/stromx
opencv/methodgenerator.py
1
61358
# -*- coding: utf-8 -*- import document import interface import package import rulegenerator import testgenerator class ArgumentVisitorBase(interface.ArgumentVisitor): def visitReturnValue(self, retValue): self.visitAllocation(retValue) class SingleArgumentVisitor(ArgumentVisitorBase): """ V...
apache-2.0
4,111,459,596,911,698,400
36.85256
94
0.519101
false
nmercier/linux-cross-gcc
linux/lib/python2.7/rlcompleter.py
21
5991
"""Word completion for GNU readline. The completer completes keywords, built-ins and globals in a selectable namespace (which defaults to __main__); when completing NAME.NAME..., it evaluates (!) the expression up to the last dot and completes its attributes. It's very cool to do "import sys" type "sys.", hit the com...
bsd-3-clause
7,353,469,912,595,977,000
33.831395
80
0.610416
false
foobert/ansible-modules-core
cloud/amazon/ec2_ami_find.py
77
9793
#!/usr/bin/python # # 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 distribut...
gpl-3.0
5,282,990,556,245,675,000
31.427152
326
0.63719
false
aleisalem/Aion
data_generation/stimulation/Garfield.py
1
20528
#!/usr/bin/python # Python modules import sys, os, shutil, glob, io # Aion modules from Aion.utils.graphics import * from Aion.utils.data import * from Aion.shared.constants import * # Third-party libraries from androguard.session import Session from androguard.misc import AXMLPrinter class Garfield(): """ Gar...
gpl-3.0
4,659,586,532,494,897,000
57.651429
178
0.594895
false
tkruse/rosinstall
src/rosinstall/simple_checkout.py
1
2400
# Software License Agreement (BSD License) # # Copyright (c) 2011, Willow Garage, Inc. # All rights reserved. # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions # are met: # # * Redistributions of source code must retain the above...
bsd-3-clause
-3,648,412,903,565,521,000
43.444444
70
0.710417
false
dnet/suds
suds/sax/__init__.py
200
3253
# This program is free software; you can redistribute it and/or modify # it under the terms of the (LGPL) GNU Lesser General Public License as # published by the Free Software Foundation; either version 3 of the # License, or (at your option) any later version. # # This program is distributed in the hope that it will ...
lgpl-3.0
4,848,617,066,209,912,000
28.844037
76
0.635721
false
Stavitsky/nova
nova/servicegroup/drivers/db.py
23
3982
# Copyright 2012 IBM Corp. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, sof...
apache-2.0
-3,818,948,725,125,328,400
40.051546
79
0.626067
false
youdonghai/intellij-community
python/helpers/pycharm/noserunner.py
30
2391
import sys import os helpers_dir = os.getenv("PYCHARM_HELPERS_DIR", sys.path[0]) if sys.path[0] != helpers_dir: sys.path.insert(0, helpers_dir) from nose_utils import TeamcityPlugin from pycharm_run_utils import debug, import_system_module from pycharm_run_utils import adjust_sys_path adjust_sys_path(False) sh...
apache-2.0
8,742,684,045,064,229,000
23.916667
85
0.590966
false
leesavide/pythonista-docs
Documentation/matplotlib/mpl_examples/pylab_examples/contourf_log.py
9
1350
''' Demonstrate use of a log color scale in contourf ''' from matplotlib import pyplot as P import numpy as np from numpy import ma from matplotlib import colors, ticker, cm from matplotlib.mlab import bivariate_normal N = 100 x = np.linspace(-3.0, 3.0, N) y = np.linspace(-2.0, 2.0, N) X, Y = np.meshgrid(x, y) # A ...
apache-2.0
-2,881,244,948,313,340,000
27.125
77
0.672593
false
jhjguxin/PyCDC
obp.lovelykarrigell/module/Karrigell_QuickForm.py
2
18595
#@ignore #@language python #@ignore #@language python """ Package: Karrigell_QuickForm-1.0.1-alpha Requirements: Karrigell HTTP Server - http://karrigell.sourceforge.net Description: - A simple class that generates html forms with some basic javascript validations. - It is similar to HTML_QuickForm...
gpl-3.0
-562,869,768,854,816,800
37.659044
844
0.479699
false
arnaud-morvan/QGIS
scripts/pyuic-wrapper.py
32
1138
# -*- coding: utf-8 -*- """ *************************************************************************** pyuic-wrapper.py --------------------- Date : March 2016 Copyright : (C) 2016 by Juergen E. Fischer Email : jef at norbit dot de ************************...
gpl-2.0
-7,477,645,079,110,612,000
42.769231
75
0.379613
false
favll/pogom
pogom/pgoapi/protos/POGOProtos/Networking/Responses/CheckAwardedBadgesResponse_pb2.py
16
3622
# Generated by the protocol buffer compiler. DO NOT EDIT! # source: POGOProtos/Networking/Responses/CheckAwardedBadgesResponse.proto import sys _b=sys.version_info[0]<3 and (lambda x:x) or (lambda x:x.encode('latin1')) from google.protobuf import descriptor as _descriptor from google.protobuf import message as _messa...
mit
-260,502,784,545,529,200
41.116279
402
0.764771
false
uglyboxer/linear_neuron
net-p3/lib/python3.5/site-packages/matplotlib/tests/test_patheffects.py
10
5445
from __future__ import (absolute_import, division, print_function, unicode_literals) import six import numpy as np from matplotlib.testing.decorators import image_comparison, cleanup import matplotlib.pyplot as plt import matplotlib.patheffects as path_effects try: # mock in python 3.3+ ...
mit
-2,294,434,757,433,027,600
36.040816
78
0.586777
false
flamusdiu/oauthlib
tests/oauth2/rfc6749/clients/test_base.py
15
8489
# -*- coding: utf-8 -*- from __future__ import absolute_import, unicode_literals from ....unittest import TestCase import datetime from oauthlib import common from oauthlib.oauth2.rfc6749 import utils from oauthlib.oauth2 import Client from oauthlib.oauth2 import InsecureTransportError from oauthlib.oauth2.rfc6749.cli...
bsd-3-clause
6,945,122,839,912,067,000
42.984456
107
0.639769
false
martin31242/rccar
draft7/main.py
1
6464
import web from web import form import socket import RPi.GPIO as GPIO import time from threading import Thread from threading import Lock localhost = "http://" + socket.gethostbyname(socket.gethostname()) + ":8080" print(localhost) global infrared, ultrasonic, servomotor, motor_L1, motor_L2, motor_R1, motor_R2...
mit
-5,398,198,457,091,449,000
20.296552
164
0.562809
false
ronakkhunt/kuma
vendor/packages/translate/lang/el.py
24
2066
#!/usr/bin/env python # -*- coding: utf-8 -*- # # Copyright 2007-2009,2011 Zuza Software Foundation # # This file is part of translate. # # translate is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either vers...
mpl-2.0
3,668,368,906,855,962,600
31.983607
73
0.652087
false
miing/mci_migo
identityprovider/tests/test_models_person.py
1
2438
# Copyright 2010 Canonical Ltd. This software is licensed under the # GNU Affero General Public License version 3 (see the file LICENSE). from random import randint from identityprovider.models.account import Account, LPOpenIdIdentifier from identityprovider.models.const import ( AccountCreationRationale, Acc...
agpl-3.0
-4,815,062,063,230,948,000
40.322034
79
0.678835
false
biocore/qiime
tests/test_estimate_observation_richness.py
15
26872
#!/usr/bin/env python from __future__ import division __author__ = "Jai Ram Rideout" __copyright__ = "Copyright 2013, The QIIME Project" __credits__ = ["Jai Ram Rideout"] __license__ = "GPL" __version__ = "1.9.1-dev" __maintainer__ = "Jai Ram Rideout" __email__ = "jai.rideout@gmail.com" """Test suite for the estimate...
gpl-2.0
903,879,988,594,355,600
32.298637
802
0.487608
false
mattjvincent/file2db
file2db/compat.py
1
2099
# -*- coding: utf-8 -*- # taken from requests library: https://github.com/kennethreitz/requests """ pythoncompat """ import sys # ------- # Pythons # ------- # Syntax sugar. _ver = sys.version_info #: Python 2.x? is_py2 = (_ver[0] == 2) #: Python 3.x? is_py3 = (_ver[0] == 3) #: Python 3.0.x is_py30 = (is_py3 and...
bsd-3-clause
5,656,085,506,239,347,000
19.378641
106
0.618866
false
CydarLtd/ansible
test/units/modules/network/nxos/test_nxos_bgp_af.py
9
3510
# (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 dis...
gpl-3.0
-7,516,185,337,769,937,000
39.344828
111
0.64188
false
EverlyWell/redash
redash/handlers/embed.py
4
3617
import logging import time import pystache from flask import request from authentication import current_org from flask_login import current_user, login_required from flask_restful import abort from redash import models, utils from redash.handlers import routes from redash.handlers.base import (get_object_or_404, org_...
bsd-2-clause
1,757,289,613,887,723,000
35.17
113
0.632845
false
vitaly4uk/django
tests/template_tests/tests.py
183
4760
# -*- coding: utf-8 -*- from __future__ import unicode_literals import sys from django.contrib.auth.models import Group from django.core import urlresolvers from django.template import Context, Engine, TemplateSyntaxError from django.template.base import UNKNOWN_SOURCE from django.test import SimpleTestCase, override...
bsd-3-clause
-4,289,478,907,644,250,000
34.2
90
0.589226
false
Vagab0nd/SiCKRAGE
lib3/unidecode/x05c.py
252
4612
data = ( 'Po ', # 0x00 'Feng ', # 0x01 'Zhuan ', # 0x02 'Fu ', # 0x03 'She ', # 0x04 'Ke ', # 0x05 'Jiang ', # 0x06 'Jiang ', # 0x07 'Zhuan ', # 0x08 'Wei ', # 0x09 'Zun ', # 0x0a 'Xun ', # 0x0b 'Shu ', # 0x0c 'Dui ', # 0x0d 'Dao ', # 0x0e 'Xiao ', # 0x0f 'Ji ', # 0x10...
gpl-3.0
8,620,505,091,597,624,000
16.875969
19
0.384649
false
chaluemwut/fbserver
venv/lib/python2.7/site-packages/sklearn/feature_extraction/text.py
1
49725
# -*- coding: utf-8 -*- # Authors: Olivier Grisel <olivier.grisel@ensta.org> # Mathieu Blondel <mathieu@mblondel.org> # Lars Buitinck <L.J.Buitinck@uva.nl> # Robert Layton <robertlayton@gmail.com> # Jochen Wersdörfer <jochen@wersdoerfer.de> # Roman Sinayev <roman.sinayev@gma...
apache-2.0
6,492,063,182,148,772,000
37.102682
95
0.612179
false
michael-dev2rights/ansible
test/units/modules/network/nxos/test_nxos_ospf.py
47
1964
# (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 dis...
gpl-3.0
-5,415,219,151,378,039,000
34.709091
91
0.708758
false
polimediaupv/edx-platform
common/djangoapps/student/tests/test_reset_password.py
54
10790
""" Test the various password reset flows """ import json import re import unittest from django.core.cache import cache from django.conf import settings from django.test import TestCase from django.test.client import RequestFactory from django.contrib.auth.models import User from django.contrib.auth.hashers import UNU...
agpl-3.0
-1,405,181,507,601,048,000
43.040816
117
0.650417
false
pjdelport/django
django/contrib/messages/tests/cookie.py
9
5435
import json from django.contrib.messages import constants from django.contrib.messages.tests.base import BaseTest from django.contrib.messages.storage.cookie import (CookieStorage, MessageEncoder, MessageDecoder) from django.contrib.messages.storage.base import Message from django.test.utils import override_settin...
bsd-3-clause
4,302,377,318,940,146,000
39.559701
98
0.643054
false
GoogleCloudPlatform/training-data-analyst
courses/machine_learning/deepdive2/end_to_end_ml/solutions/serving/application/lib/werkzeug/routing.py
9
73410
# -*- coding: utf-8 -*- """ werkzeug.routing ~~~~~~~~~~~~~~~~ When it comes to combining multiple controller or view functions (however you want to call them) you need a dispatcher. A simple way would be applying regular expression tests on the ``PATH_INFO`` and calling registered callback fun...
apache-2.0
-4,316,610,109,617,527,300
35.002943
88
0.57074
false
Eric-Zhong/odoo
addons/l10n_gt/__init__.py
411
1113
# -*- encoding: utf-8 -*- ############################################################################## # # Copyright (c) 2009-2010 Soluciones Tecnologócias Prisma S.A. All Rights Reserved. # José Rodrigo Fernández Menegazzo, Soluciones Tecnologócias Prisma S.A. # (http://www.solucionesprisma.com) # # This prog...
agpl-3.0
-6,421,483,809,033,044,000
44.208333
83
0.634806
false
aonotas/chainer
tests/chainer_tests/links_tests/connection_tests/test_highway.py
9
2427
import unittest import numpy import chainer from chainer.backends import cuda from chainer import functions from chainer import gradient_check from chainer import links from chainer import testing from chainer.testing import attr class TestHighway(unittest.TestCase): in_out_size = 3 def setUp(self): ...
mit
657,691,357,233,452,900
28.962963
70
0.587145
false
SofiaReis/django-cms
cms/test_utils/project/sampleapp/south_migrations/0001_initial.py
46
3361
# -*- coding: utf-8 -*- from south.utils import datetime_utils as 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 'Category' db.create_table(u'sampleapp_category', ( ...
bsd-3-clause
-1,341,580,998,721,555,500
50.723077
144
0.587325
false
ojengwa/talk
venv/lib/python2.7/site-packages/setuptools/site-patch.py
720
2389
def __boot(): import sys import os PYTHONPATH = os.environ.get('PYTHONPATH') if PYTHONPATH is None or (sys.platform=='win32' and not PYTHONPATH): PYTHONPATH = [] else: PYTHONPATH = PYTHONPATH.split(os.pathsep) pic = getattr(sys,'path_importer_cache',{}) stdpath = sys.path[le...
mit
-7,284,994,303,212,454,000
30.434211
79
0.549184
false
fiete201/qutebrowser
tests/unit/utils/test_urlmatch.py
2
23551
# vim: ft=python fileencoding=utf-8 sts=4 sw=4 et: # Copyright 2018-2021 Florian Bruhin (The Compiler) <mail@qutebrowser.org> # # This file is part of qutebrowser. # # qutebrowser 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 S...
gpl-3.0
-4,027,391,306,031,630,300
32.259887
152
0.60124
false
abhiQmar/servo
tests/wpt/harness/wptrunner/wptmanifest/tests/test_serializer.py
59
4791
# 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 sys import unittest from cStringIO import StringIO import pytest from .. import parser, serializer class Tok...
mpl-2.0
503,501,327,830,231,300
19.74026
75
0.528908
false
incaser/odoo-odoo
addons/portal/__init__.py
382
1140
# -*- coding: utf-8 -*- ############################################################################## # # OpenERP, Open Source Management Solution # Copyright (C) 2004-2011 OpenERP S.A (<http://www.openerp.com>). # # This program is free software: you can redistribute it and/or modify # it under the terms ...
agpl-3.0
5,356,160,267,481,891,000
39.714286
78
0.629825
false
zetaops/ulakbus
tests/test_ders_ve_sinav_programi_hazirla.py
1
9633
# -*- coding: utf-8 -*- # Copyright (C) 2015 ZetaOps Inc. # # This file is licensed under the GNU General Public License v3 # (GPLv3). See LICENSE.txt for details. from pyoko.db.adapter.db_riak import BlockSave from ulakbus.models import User, DersEtkinligi, SinavEtkinligi, Donem, Room from zengine.lib.test_utils imp...
gpl-3.0
9,206,041,727,838,378,000
39.561702
134
0.5641
false
plone/plone.server
src/plone.server/plone/server/api/content.py
1
14057
# -*- coding: utf-8 -*- from aiohttp.web_exceptions import HTTPMethodNotAllowed from aiohttp.web_exceptions import HTTPNotFound from aiohttp.web_exceptions import HTTPUnauthorized from dateutil.tz import tzlocal from plone.server import app_settings from plone.server import configure from plone.server import _ from plo...
bsd-2-clause
8,761,421,349,418,847,000
35.136247
91
0.638116
false
Zhaoyanzhang/-myflasky
venv/lib/python2.7/site-packages/flask_pagedown/widgets.py
8
1872
from wtforms.widgets import HTMLString, TextArea pagedown_pre_html = '<div class="flask-pagedown">' pagedown_post_html = '</div>' preview_html = ''' <div class="flask-pagedown-preview" id="flask-pagedown-%(field)s-preview"></div> <script type="text/javascript"> f = function() { if (typeof flask_pagedown_converter ...
mit
-7,507,361,360,437,297,000
38.829787
99
0.623932
false
LaoZhongGu/kbengine
kbe/res/scripts/common/Lib/test/test_pow.py
177
4593
import test.support, unittest class PowTest(unittest.TestCase): def powtest(self, type): if type != float: for i in range(-1000, 1000): self.assertEqual(pow(type(i), 0), 1) self.assertEqual(pow(type(i), 1), type(i)) self.assertEqual(pow(type(0), ...
lgpl-3.0
6,284,457,764,751,251,000
34.604651
79
0.451339
false
raghavrv/scikit-learn
sklearn/neighbors/tests/test_approximate.py
12
20126
""" 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
-7,911,277,107,908,676,000
39.49497
78
0.648167
false
wongkwunkit/jinja2
tests/test_utils.py
22
1969
# -*- coding: utf-8 -*- """ jinja2.testsuite.utils ~~~~~~~~~~~~~~~~~~~~~~ Tests utilities jinja uses. :copyright: (c) 2010 by the Jinja Team. :license: BSD, see LICENSE for more details. """ import gc import pytest import pickle from jinja2.utils import LRUCache, escape, object_type_repr @pyt...
bsd-3-clause
260,087,838,911,641,500
24.907895
74
0.554596
false
stopstalk/stopstalk-deployment
private/scripts/populate-institute-to-country.py
1
2063
""" Copyright (c) 2015-2020 Raj Patel(raj454raj@gmail.com), StopStalk 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
-5,490,743,104,678,580,000
41.102041
82
0.740184
false
ambikeshwar1991/gnuradio
gnuradio-core/src/python/gnuradio/gr/qa_wavefile.py
18
1854
#!/usr/bin/env python # # Copyright 2008,2010 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 optio...
gpl-3.0
7,450,838,246,605,623,000
25.869565
72
0.692017
false
frederick-masterton/django
django/views/i18n.py
68
11000
import importlib import json import os import gettext as gettext_module from django import http from django.apps import apps from django.conf import settings from django.template import Context, Template from django.utils.translation import check_for_language, to_locale, get_language, LANGUAGE_SESSION_KEY from django....
bsd-3-clause
5,160,403,279,603,619,000
34.14377
124
0.616
false
talishte/ctigre
env/lib/python2.7/site-packages/django/core/files/uploadedfile.py
223
4156
""" Classes representing uploaded files. """ import os from io import BytesIO from django.conf import settings from django.core.files.base import File from django.core.files import temp as tempfile from django.utils.encoding import force_str __all__ = ('UploadedFile', 'TemporaryUploadedFile', 'InMemoryUploadedFile',...
bsd-2-clause
-2,093,944,621,718,178,800
32.248
92
0.602743
false
futurulus/scipy
scipy/io/harwell_boeing/_fortran_format_parser.py
127
9092
""" Preliminary module to handle fortran formats for IO. Does not use this outside scipy.sparse io for now, until the API is deemed reasonable. The *Format classes handle conversion between fortran and python format, and FortranFormatParser can create *Format instances from raw fortran format strings (e.g. '(3I4)', '(...
bsd-3-clause
1,135,194,666,832,446,300
27.955414
83
0.526067
false
neilLasrado/erpnext
erpnext/assets/doctype/asset_category/asset_category.py
1
4214
# -*- coding: utf-8 -*- # Copyright (c) 2015, Frappe Technologies Pvt. Ltd. and contributors # For license information, please see license.txt from __future__ import unicode_literals import frappe from frappe import _ from frappe.utils import cint, get_link_to_form from frappe.model.document import Document class Ass...
gpl-3.0
-957,132,677,329,818,200
43.368421
128
0.701471
false
sunil07t/e-mission-server
emission/core/wrapper/client.py
1
2709
from __future__ import unicode_literals from __future__ import print_function from __future__ import division from __future__ import absolute_import # # In the current iteration, there is a client object that can be loaded from # the filesystem into the database and its settings loaded from the database. # There are no...
bsd-3-clause
-7,740,760,968,396,766,000
36.625
115
0.721299
false
ktnyt/chainer
chainerx/math/misc.py
2
1549
import chainerx # TODO(sonots): Implement in C++ def square(x): """Returns the element-wise square of the input. Args: x (~chainerx.ndarray or scalar): Input data Returns: ~chainerx.ndarray: Returned array: :math:`y = x * x`. A scalar is returned if ``x`` is a scalar. Note: ...
mit
-5,232,344,844,847,210,000
27.685185
75
0.617818
false
femmerling/DirMaker
box/lib/python2.7/site-packages/migrate/tests/versioning/test_version.py
32
5951
#!/usr/bin/env python # -*- coding: utf-8 -*- from migrate.exceptions import * from migrate.versioning.version import * from migrate.tests import fixture class TestVerNum(fixture.Base): def test_invalid(self): """Disallow invalid version numbers""" versions = ('-1', -1, 'Thirteen', '') f...
mit
-2,385,369,662,488,079,400
34.849398
105
0.60494
false
yodalee/servo
tests/wpt/web-platform-tests/tools/wptserve/docs/conf.py
467
7855
# -*- coding: utf-8 -*- # # wptserve documentation build configuration file, created by # sphinx-quickstart on Wed Aug 14 17:23:24 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 # autogenerated file. # # Al...
mpl-2.0
-2,213,908,267,433,819,100
31.325103
80
0.704901
false
0-wiz-0/audacity
lib-src/libsndfile/src/create_symbols_file.py
39
5490
#!/usr/bin/python # Copyright (C) 2003-2011 Erik de Castro Lopo <erikd@mega-nerd.com> # # 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 ...
gpl-2.0
1,434,331,573,703,367,200
30.193182
80
0.625319
false
calfonso/ansible
lib/ansible/modules/storage/netapp/sf_volume_access_group_manager.py
23
8816
#!/usr/bin/python # (c) 2017, NetApp, Inc # GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt) from __future__ import absolute_import, division, print_function __metaclass__ = type ANSIBLE_METADATA = {'metadata_version': '1.1', 'status': ['preview'], ...
gpl-3.0
2,508,886,156,672,651,000
34.983673
146
0.569646
false
parrt/lolviz
prince_dtree.py
1
12296
import IPython, graphviz, re from io import StringIO from IPython.display import Image import numpy as np import pandas as pd import math from sklearn import tree from sklearn.datasets import load_boston, load_iris from collections import defaultdict import string import re YELLOW = "#fefecd" # "#fbfbd0" # "#FBFEB0" B...
bsd-3-clause
4,516,892,887,511,212,500
40.400673
185
0.571812
false
gilhooley/python_koans
python3/libs/colorama/win32.py
451
4833
# Copyright Jonathan Hartley 2013. BSD 3-Clause license, see LICENSE file. # from winbase.h STDOUT = -11 STDERR = -12 try: from ctypes import windll from ctypes import wintypes except ImportError: windll = None SetConsoleTextAttribute = lambda *_: None else: from ctypes import ( byref, Str...
mit
-5,121,055,237,231,174,000
35.067164
111
0.646389
false
SurfasJones/djcmsrc3
venv/lib/python2.7/site-packages/menus/base.py
13
1838
# -*- coding: utf-8 -*- from django.utils.encoding import smart_str class Menu(object): namespace = None def __init__(self): if not self.namespace: self.namespace = self.__class__.__name__ def get_nodes(self, request): """ should return a list of NavigationNode in...
mit
-5,921,422,685,780,436,000
27.276923
103
0.5642
false
RahulMahalingam/raft
tabs/CrawlerTab.py
11
10084
# # crawler tab implementation # # # Author: Gregory Fleischer (gfleischer@gmail.com) # # Copyright (c) 2011 RAFT Team # # This file is part of RAFT. # # RAFT 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, ei...
gpl-3.0
-957,330,935,414,782,800
42.27897
146
0.701111
false
cboyce93/epitome-xl
src/library_manager.py
1
74166
#!/usr/bin/env python import pygtk import gtk import dill import pango import os import subprocess import time pygtk.require('2.0') from os.path import expanduser from lib.Project import Project from pipeline_editor import PipelineEditor from lib.Module import Module from dialog import Dialog from util.library import...
gpl-3.0
-2,097,769,919,636,555,000
40.666292
216
0.601853
false
stackforge/tricircle
tricircle/api/app.py
1
2566
# Copyright (c) 2015 Huawei, Tech. Co,. Ltd. # 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 # # Unle...
apache-2.0
-6,644,816,085,275,844,000
33.213333
78
0.596259
false
ravindrapanda/tensorflow
tensorflow/contrib/boosted_trees/lib/learner/batch/ordinal_split_handler_test.py
15
47753
# 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,824,184,103,918,374,000
38.56338
84
0.617302
false
TsubameDono/codecombat
scripts/analytics/parseStripePayments.py
97
10435
# Parse Stripe payment info via exported payments.csv files import sys from datetime import tzinfo, timedelta, datetime # TODO: use stripe_customers.csv to match payments to our db data # Stripe file format # id,Description,Created (UTC),Amount,Amount Refunded,Currency,Converted Amount,Converted Amount Refunded,Fee,...
mit
231,390,487,112,283,740
41.246964
683
0.571251
false
r39132/airflow
tests/operators/test_hive_to_mysql.py
4
4630
# -*- 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
-2,513,666,852,661,609,000
41.477064
102
0.687473
false
Passtechsoft/TPEAlpGen
blender/release/scripts/addons_contrib/oscurart_tools/oscurart_objects.py
1
16403
import bpy import math import sys import os import stat import bmesh import time import random from bpy_extras.object_utils import world_to_camera_view ##------------------------ SEARCH AND SELECT ------------------------ ## SETEO VARIABLE DE ENTORNO bpy.types.Scene.SearchAndSelectOt = bpy.props.StringProperty(defaul...
gpl-3.0
-5,322,363,825,178,522,000
36.452055
146
0.597147
false