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
abhattad4/Digi-Menu
digimenu2/django/utils/html.py
36
15061
"""HTML utilities suitable for global use.""" from __future__ import unicode_literals import re import sys import warnings from django.utils import six from django.utils.deprecation import RemovedInDjango20Warning from django.utils.encoding import force_str, force_text from django.utils.functional import allow_lazy ...
bsd-3-clause
3,222,118,259,274,078,000
36.558603
110
0.589138
false
OpenAcademy-OpenStack/nova-scheduler
nova/tests/utils.py
1
6545
# 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 # a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable l...
apache-2.0
-4,108,001,684,054,444,500
31.083333
79
0.51123
false
lilchurro/vent
vent/menu.py
2
5236
#!/usr/bin/env python2.7 # -*- coding: utf-8 -*- import curses import npyscreen import time from threading import Thread from vent.api.actions import Action from vent.api.plugins import Plugin from vent.helpers.meta import Version from vent.helpers.paths import PathDirs from vent.menus.help import HelpForm from vent...
apache-2.0
-3,963,305,740,221,446,000
39.90625
83
0.549847
false
obsh/tornado
demos/chat/chatdemo.py
98
4426
#!/usr/bin/env python # # Copyright 2009 Facebook # # 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 a...
apache-2.0
-7,246,718,500,026,311,000
32.530303
78
0.639629
false
battlecat/Spirit
spirit/comment/models.py
2
2911
# -*- coding: utf-8 -*- from __future__ import unicode_literals from django.db import models from django.utils.translation import ugettext_lazy as _ from django.core.urlresolvers import reverse from django.conf import settings from django.db.models import F from django.utils import timezone from .managers import Com...
mit
7,847,045,089,161,229,000
30.301075
82
0.623841
false
Microvellum/Fluid-Designer
win64-vc/2.78/Python/bin/2.78/scripts/modules/blend_render_info.py
1
2789
#!/usr/bin/env python3 # ##### BEGIN GPL LICENSE BLOCK ##### # # 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 later version. # # ...
gpl-3.0
4,142,007,005,366,595,600
26.343137
100
0.62388
false
Pexego/odoo
addons/note/tests/test_note.py
427
1686
# -*- coding: utf-8 -*- ############################################################################## # # OpenERP, Open Source Business Applications # Copyright (c) 2013-TODAY OpenERP S.A. <http://openerp.com> # # This program is free software: you can redistribute it and/or modify # it under the terms of ...
agpl-3.0
-9,141,620,349,201,796,000
38.209302
84
0.581851
false
joe-antognini/matasano
set1.py
1
6125
#! /usr/bin/env python # # Matasano Crypto Pals # Set 1 # import binascii import base64 from freqs import * from Crypto.Cipher import AES def hex2base64(a): '''Convert a string in hex to a string in base64.''' data = binascii.unhexlify(a) return base64.b64encode(data) def fixedXOR(b1, b2): int1 = int(b1.enc...
mit
811,414,450,245,125,100
26.34375
112
0.677714
false
markoshorro/gem5
src/arch/x86/isa/insts/system/control_registers.py
91
3073
# Copyright (c) 2009 The Regents of The University of Michigan # All rights reserved. # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions are # met: redistributions of source code must retain the above copyright # notice, this list ...
bsd-3-clause
3,357,295,187,732,438,500
34.732558
75
0.70615
false
jymannob/CouchPotatoServer
couchpotato/core/media/movie/providers/trailer/youtube_dl/extractor/brightcove.py
8
12227
# encoding: utf-8 from __future__ import unicode_literals import re import json import xml.etree.ElementTree from .common import InfoExtractor from ..utils import ( compat_urllib_parse, find_xpath_attr, fix_xml_ampersands, compat_urlparse, compat_str, compat_urllib_request, compat_parse_qs...
gpl-3.0
5,111,925,147,519,100,000
42.491103
483
0.565584
false
DANCEcollaborative/forum-xblock
XBlock Integration Files/xdjangobb/xblock/lib/python2.7/site-packages/django/contrib/gis/tests/inspectapp/tests.py
134
5128
from __future__ import absolute_import import os from django.db import connections from django.test import TestCase from django.contrib.gis.gdal import Driver from django.contrib.gis.geometry.test_data import TEST_DATA from django.contrib.gis.utils.ogrinspect import ogrinspect from .models import AllOGRFields clas...
mit
4,559,771,236,913,202,700
38.446154
103
0.604914
false
saikrishnar/Forced-Alignment
Post_1/scripts/run_kaldi/utils/reverse_arpa.py
13
5824
# -*- coding: utf-8 -*- # Copyright 2012 Mirko Hannemann BUT, mirko.hannemann@gmail.com import sys import codecs # for UTF-8/unicode if len(sys.argv) != 2: print 'usage: reverse_arpa arpa.in' sys.exit() arpaname = sys.argv[1] #\data\ #ngram 1=4 #ngram 2=2 #ngram 3=2 # #\1-grams: #-5.234679 a -3.3 #-3.456783 ...
gpl-2.0
7,331,060,838,417,624,000
30.144385
107
0.586882
false
atodorov/anaconda
pyanaconda/modules/storage/devicetree/devicetree_interface.py
6
1430
# # DBus interface for the device tree module # # Copyright (C) 2019 Red Hat, Inc. # # This copyrighted material is made available to anyone wishing to use, # modify, copy, or redistribute it subject to the terms and conditions of # the GNU General Public License v.2, or (at your option) any later version. # This progr...
gpl-2.0
8,311,956,924,022,599,000
46.666667
94
0.788112
false
WoLpH/celery
celery/tests/test_task/test_task_builtins.py
1
1421
from __future__ import with_statement import warnings from celery.task import ping, PingTask, backend_cleanup from celery.tests.compat import catch_warnings from celery.tests.utils import unittest def some_func(i): return i * i class test_deprecated(unittest.TestCase): def test_ping(self): warnin...
bsd-3-clause
-7,564,034,343,120,341,000
29.234043
66
0.608726
false
ThrowDice/watu
friendfeed.py
1
14114
#!/usr/bin/env python # # Copyright 2008 FriendFeed # # 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...
gpl-3.0
8,378,790,483,474,775,000
38.096953
79
0.59317
false
ubc/edx-platform
common/djangoapps/cors_csrf/migrations/0001_initial.py
98
4870
# -*- 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 'XDomainProxyConfiguration' db.create_table('cors_csrf_xdo...
agpl-3.0
5,210,016,644,640,633,000
64.810811
182
0.575154
false
fw1121/BDA_py_demos
demos_ch3/demo3_2.py
19
6319
"""Bayesian Data Analysis, 3rd ed Chapter 3, demo 2 Visualise factored sampling and the corresponding marginal and conditional densities. """ from __future__ import division import os import numpy as np from scipy import stats import matplotlib.pyplot as plt import matplotlib.gridspec as gridspec # import from util...
gpl-3.0
4,816,049,875,706,297,000
31.405128
85
0.643614
false
jrversteegh/softsailor
deps/numpy-1.6.1/numpy/f2py/cb_rules.py
36
20543
#!/usr/bin/env python """ Build call-back mechanism for f2py2e. Copyright 2000 Pearu Peterson all rights reserved, Pearu Peterson <pearu@ioc.ee> Permission to use, modify, and distribute this software is given under the terms of the NumPy License. NO WARRANTY IS EXPRESSED OR IMPLIED. USE AT YOUR OWN RISK. $Date: 20...
gpl-3.0
6,470,493,967,948,109,000
37.113173
238
0.567347
false
fretscha/pfa
config/settings/local.py
1
2385
# -*- coding: utf-8 -*- ''' Local settings - Run in Debug mode - Use console backend for emails - Add Django Debug Toolbar - Add django-extensions as app ''' from .common import * # noqa # DEBUG # ------------------------------------------------------------------------------ DEBUG = env.bool('DJANGO_DEBUG', default...
bsd-3-clause
-3,147,614,161,445,879,000
33.565217
98
0.514885
false
ihatevim/spotbot
plugins/media.py
1
8305
# IMDb lookup plugin by Ghetto Wizard (2011). from util import hook, http import re import datetime from urllib2 import URLError from zipfile import ZipFile from cStringIO import StringIO from lxml import etree from util import hook, http, web base_url = "http://thetvdb.com/api/" api_key = "469B73127CA0C411" # ht...
gpl-3.0
-3,722,851,272,823,198,700
29.421245
149
0.600963
false
pombredanne/mitmproxy
test/test_script.py
24
3236
import os import time import mock from libmproxy import script, flow import tutils def test_simple(): s = flow.State() fm = flow.FlowMaster(None, s) sp = tutils.test_data.path("scripts/a.py") p = script.Script("%s --var 40" % sp, fm) assert "here" in p.ns assert p.run("here") == 41 assert...
mit
-832,964,838,384,346,400
24.085271
76
0.58529
false
cosmo-ethz/CosmoHammer
Tests/test_SampleFileUtil.py
1
2747
""" Test the TestSampleFileUtil module. Execute with py.test -v """ from __future__ import print_function, division, absolute_import, unicode_literals import tempfile import os import numpy import cosmoHammer.Constants as c from cosmoHammer.util.SampleFileUtil import SampleFileUtil class TestSampleFileUtil(object)...
gpl-3.0
1,938,893,600,004,341,500
28.548387
82
0.594467
false
sigma-random/avmplus
test/cmdline/testVMbaseConcurrencySelfTest.py
8
2383
#!/usr/bin/env python # 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/. from cmdutils import * import os def run(): r=RunTestLib() r.run_test('VMbaseConcurre...
mpl-2.0
3,405,532,286,665,639,000
57.121951
124
0.446916
false
lepistone/odoo
addons/plugin_thunderbird/plugin_thunderbird.py
92
2075
# -*- 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,303,867,252,524,487,000
45.111111
163
0.638072
false
datalogics/scons
test/Scanner/scan-once.py
2
2747
#!/usr/bin/env python # # __COPYRIGHT__ # # 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, modify, merge, publish, ...
mit
-7,006,529,820,605,771,000
28.223404
73
0.672734
false
Arable/evepod
lib/python2.7/site-packages/gunicorn/config.py
23
37678
# -*- coding: utf-8 - # # This file is part of gunicorn released under the MIT license. # See the NOTICE for more information. import copy import grp import inspect try: import argparse except ImportError: # python 2.6 from . import argparse_compat as argparse import os import pwd import sys import textwrap im...
apache-2.0
-4,538,162,911,111,370,000
25.348252
82
0.600244
false
prashanthr/wakatime
wakatime/packages/pygments_py2/pygments/formatters/latex.py
72
17615
# -*- coding: utf-8 -*- """ pygments.formatters.latex ~~~~~~~~~~~~~~~~~~~~~~~~~ Formatter for LaTeX fancyvrb output. :copyright: Copyright 2006-2014 by the Pygments team, see AUTHORS. :license: BSD, see LICENSE for details. """ from __future__ import division from pygments.formatter import Forma...
bsd-3-clause
-1,818,971,410,895,378,000
36.006303
85
0.536191
false
cjwagner/test-infra
gubernator/third_party/defusedxml/common.py
55
6086
# defusedxml # # Copyright (c) 2013 by Christian Heimes <christian@python.org> # Licensed to PSF under a Contributor Agreement. # See http://www.python.org/psf/license for licensing details. """Common constants, exceptions and helpe functions """ import sys from types import MethodType PY3 = sys.version_info[0] == 3 P...
apache-2.0
-1,660,862,529,132,021,800
36.337423
76
0.567368
false
abujehad139/damnvid
ui/dMainFrame/dMainGoPanel.py
12
1325
# -*- coding: utf-8 -*- from ..dUI import * def DamnMainStopButton(panel=None, parent=None): stopbutton = wx.Button(panel, -1, DV.l('Stop')) stopbutton.Disable() if parent is not None: panel.Bind(wx.EVT_BUTTON, parent.onStop, stopbutton) return stopbutton class DamnMainGoPanel(wx.Panel): def __init__(self, par...
gpl-3.0
-6,212,333,779,266,651,000
41.741935
184
0.753208
false
dieterich-lab/rp-bp
rpbp/reference_preprocessing/label_orfs.py
1
21436
#! /usr/bin/env python3 """This script labels the ORFs based on their exon transcript structure with respect to annotated coding sequences """ import argparse import logging import pbio.misc.logging_utils as logging_utils import pbio.utils.bed_utils as bed_utils from rpbp.defaults import default_num_cpus logger = ...
mit
-3,953,458,891,053,538,000
43.016427
105
0.603051
false
umitproject/tease-o-matic
django/templatetags/future.py
226
3486
from django.conf import settings from django.template import Library, Node, Template, TemplateSyntaxError from django.template.defaulttags import kwarg_re, include_is_allowed, SsiNode, URLNode from django.utils.encoding import smart_str register = Library() @register.tag def ssi(parser, token): """ Outputs t...
bsd-3-clause
-5,972,750,976,033,834,000
34.212121
86
0.623924
false
OwaJawa/kaggle_diabetic
config.py
5
2232
from datetime import datetime import pprint import os import numpy as np from util import mkdir from data import FEATURE_DIR mkdir(FEATURE_DIR) class Config(object): def __init__(self, layers, cnf=None): self.layers = layers self.cnf = cnf pprint.pprint(cnf) def get(self, k, default...
mit
1,225,369,530,156,937,500
30.43662
75
0.576613
false
pstratem/python-bitcoinlib
examples/make-bootstrap-rpc.py
5
1552
#!/usr/bin/env python3 # Copyright (C) 2013-2014 The python-bitcoinlib developers # # This file is part of python-bitcoinlib. # # It is subject to the license terms in the LICENSE file found in the top-level # directory of this distribution. # # No part of python-bitcoinlib, including this file, may be copied, modifie...
lgpl-3.0
-6,778,725,527,203,040,000
24.866667
120
0.671392
false
rishab96/chessEndGame
userTest.py
1
6281
import copy import chess import chess.syzygy import chess.gaviota import collections from collections import Counter import features from features import * import os.path weight_vector_3_piece = {'black_king_closer_to_winning_square': -1.400000000000001, 'black_opposition': -1.9200000000000015, 'cant catch pawn': 1.0...
gpl-3.0
-7,458,276,060,443,175,000
28.213953
675
0.676166
false
tod31/pyload
module/plugins/crypter/DataHuFolder.py
5
1721
# -*- coding: utf-8 -*- import re from module.plugins.internal.SimpleCrypter import SimpleCrypter class DataHuFolder(SimpleCrypter): __name__ = "DataHuFolder" __type__ = "crypter" __version__ = "0.12" __status__ = "testing" __pattern__ = r'http://(?:www\.)?data\.hu/dir/\w+' __config_...
gpl-3.0
4,683,562,365,460,898,000
39.023256
124
0.507263
false
zcoinui/zetacoin
contrib/devtools/symbol-check.py
138
4151
#!/usr/bin/python # Copyright (c) 2014 Wladimir J. van der Laan # Distributed under the MIT/X11 software license, see the accompanying # file COPYING or http://www.opensource.org/licenses/mit-license.php. ''' A script to check that the (Linux) executables produced by gitian only contain allowed gcc, glibc and libstdc++...
mit
6,980,480,871,588,344,000
35.734513
142
0.643941
false
six600110/xmms2
waftools/plugin.py
7
1326
# Stock plugin configuration and build methods. These factor out the # common tasks carried out by plugins in order to configure and build # themselves. from waflib.Errors import ConfigurationError from copy import copy def plugin(name, source=None, configure=False, build=False, build_replace=False, libs=[...
lgpl-2.1
-768,905,041,178,159,100
33
74
0.573906
false
Mchakravartula/rockstor-core
src/rockstor/scripts/bootstrap.py
2
3111
""" Copyright (c) 2012-2015 RockStor, Inc. <http://rockstor.com> This file is part of RockStor. RockStor 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 la...
gpl-3.0
7,553,824,299,997,519,000
33.566667
84
0.645452
false
liavkoren/djangoDev
tests/bash_completion/tests.py
19
3224
""" A series of tests to establish that the command-line bash completion works. """ import os import sys import unittest from django.apps import apps from django.core.management import ManagementUtility from django.utils.six import StringIO class BashCompletionTests(unittest.TestCase): """ Testing the Python...
bsd-3-clause
302,323,841,785,967,500
34.822222
145
0.641749
false
doismellburning/edx-platform
common/test/acceptance/tests/lms/test_lms_user_preview.py
59
15999
# -*- coding: utf-8 -*- """ Tests the "preview" selector in the LMS that allows changing between Staff, Student, and Content Groups. """ from ..helpers import UniqueCourseTest, create_user_partition_json from ...pages.studio.auto_auth import AutoAuthPage from ...pages.lms.courseware import CoursewarePage from ...pages...
agpl-3.0
-5,675,632,997,812,415,000
40.341085
116
0.623351
false
hacksterio/pygments.rb
vendor/simplejson/simplejson/tests/test_decimal.py
45
2357
import decimal from decimal import Decimal from unittest import TestCase from StringIO import StringIO import simplejson as json class TestDecimal(TestCase): NUMS = "1.0", "10.00", "1.1", "1234567890.1234567890", "500" def dumps(self, obj, **kw): sio = StringIO() json.dump(obj, sio, **kw) ...
mit
-699,755,173,341,936,400
34.712121
77
0.58846
false
suiyuan2009/tensorflow
tensorflow/contrib/ndlstm/python/lstm2d.py
51
8016
# 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 applicable ...
apache-2.0
-1,723,747,539,418,132,000
36.633803
80
0.653693
false
asser/django
tests/admin_custom_urls/tests.py
8
5656
from __future__ import unicode_literals from django.contrib.admin.utils import quote from django.contrib.auth.models import User from django.template.response import TemplateResponse from django.test import TestCase, override_settings from django.urls import reverse from .models import Action, Car, Person @override...
bsd-3-clause
212,359,574,675,670,430
41.526316
117
0.63331
false
cyx1231st/nova
nova/tests/unit/test_wsgi.py
7
11923
# Copyright 2011 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
7,637,383,468,426,998,000
35.35061
79
0.562442
false
cneill/designate
designate/api/v2/controllers/limits.py
7
1830
# Copyright 2013 Hewlett-Packard Development Company, L.P. # # Author: Kiall Mac Innes <kiall@hp.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/L...
apache-2.0
-7,151,026,812,997,425,000
34.192308
75
0.672131
false
drewandersonnz/openshift-tools
openshift/installer/vendored/openshift-ansible-3.9.40/roles/openshift_health_checker/library/ocutil.py
49
2182
#!/usr/bin/python """Interface to OpenShift oc command""" import os import shlex import shutil import subprocess from ansible.module_utils.basic import AnsibleModule ADDITIONAL_PATH_LOOKUPS = ['/usr/local/bin', os.path.expanduser('~/bin')] def locate_oc_binary(): """Find and return oc binary file""" # htt...
apache-2.0
-1,909,341,558,254,379,000
28.890411
91
0.618698
false
Microvellum/Fluid-Designer
win64-vc/2.78/python/lib/heapq.py
19
22930
"""Heap queue algorithm (a.k.a. priority queue). Heaps are arrays for which a[k] <= a[2*k+1] and a[k] <= a[2*k+2] for all k, counting elements from 0. For the sake of comparison, non-existing elements are considered to be infinite. The interesting property of a heap is that a[0] is always its smallest element. Usag...
gpl-3.0
-6,696,523,691,729,215,000
36.7743
81
0.616512
false
schristakidis/p2ner
p2ner/components/overlay/completeclient/completeclient/messages/validationmessages.py
1
2128
# -*- coding: utf-8 -*- # Copyright 2012 Loris Corazza, Sakis Christakidis # # 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 # # U...
apache-2.0
-3,807,659,664,198,416,000
37
141
0.719455
false
wonder-sk/inasafe
safe/impact_functions/volcanic/volcano_point_building/parameter_definitions.py
10
2338
# coding=utf-8 """InaSAFE Disaster risk tool by Australian Aid - Parameter definition for Flood Vector on Building QGIS IF Contact : ole.moller.nielsen@gmail.com .. note:: 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 ...
gpl-3.0
4,474,513,931,792,063,500
33.895522
79
0.686912
false
sansna/PythonWidgets.py
lib3/web/client.py
1
2235
#!/usr/bin/env python # -*- coding: UTF-8 -*- # Author: user # Date : 2021 Jun 27 10:16:32 PM import os import sys sys.path.append(os.path.abspath(os.path.join(os.path.dirname(__file__), "../../"))) import time import ujson import datetime import requests from lib3.decorator.safe_run import safe_run_wrap # App Confi...
lgpl-3.0
-7,470,300,990,349,165,000
26.256098
102
0.683221
false
technologiescollege/s2a_fr
s2a/Python/Lib/test/test_deque.py
60
25329
from collections import deque import unittest from test import test_support, seq_tests import gc import weakref import copy import cPickle as pickle import random import struct BIG = 100000 def fail(): raise SyntaxError yield 1 class BadCmp: def __eq__(self, other): raise RuntimeError class Muta...
gpl-3.0
-917,825,312,585,584,800
30.542964
85
0.514746
false
joone/chromium-crosswalk
tools/telemetry/telemetry/core/memory_cache_http_server_unittest.py
8
2630
# Copyright 2014 The Chromium Authors. All rights reserved. # Use of this source code is governed by a BSD-style license that can be # found in the LICENSE file. import os from telemetry.core import util from telemetry.testing import tab_test_case class MemoryCacheHTTPServerTest(tab_test_case.TabTestCase): def s...
bsd-3-clause
-2,306,623,450,798,709,000
38.848485
79
0.656654
false
apixandru/intellij-community
python/lib/Lib/site-packages/django/db/models/sql/compiler.py
71
43002
from django.core.exceptions import FieldError from django.db import connections from django.db.backends.util import truncate_name from django.db.models.sql.constants import * from django.db.models.sql.datastructures import EmptyResultSet from django.db.models.sql.expressions import SQLEvaluator from django.db.models.sq...
apache-2.0
-7,232,870,361,886,627,000
42.790224
108
0.54623
false
Vogeltak/pauselan
lib/python3.4/site-packages/sqlalchemy/testing/schema.py
79
3446
# testing/schema.py # Copyright (C) 2005-2015 the SQLAlchemy authors and contributors # <see AUTHORS file> # # This module is part of SQLAlchemy and is released under # the MIT License: http://www.opensource.org/licenses/mit-license.php from . import exclusions from .. import schema, event from . import config __all_...
gpl-2.0
6,679,158,915,147,689,000
34.163265
78
0.574869
false
cloudnull/ansible
lib/ansible/module_utils/rax.py
280
11974
# This code is part of Ansible, but is an independent component. # This particular file snippet, and this file snippet only, is BSD licensed. # Modules you write using this snippet, which is embedded dynamically by # Ansible still belong to the author of the module, and may assign their own # license to the complete wo...
gpl-3.0
-1,319,617,370,369,993,200
35.506098
78
0.599048
false
arbrandes/edx-platform
cms/djangoapps/contentstore/tests/test_clone_course.py
4
6454
""" Unit tests for cloning a course between the same and different module stores. """ import json from unittest.mock import Mock, patch from django.conf import settings from opaque_keys.edx.locator import CourseLocator from cms.djangoapps.contentstore.tasks import rerun_course from cms.djangoapps.contentstore.tests...
agpl-3.0
-3,704,254,255,870,012,000
45.431655
183
0.657422
false
ariakerstein/twitterFlaskClone
project/lib/python2.7/site-packages/pip/_vendor/requests/packages/urllib3/fields.py
1007
5833
import email.utils import mimetypes from .packages import six def guess_content_type(filename, default='application/octet-stream'): """ Guess the "Content-Type" of a file. :param filename: The filename to guess the "Content-Type" of using :mod:`mimetypes`. :param default: If no "Cont...
mit
3,025,696,198,304,377,300
31.954802
88
0.585462
false
2013Commons/HUE-SHARK
desktop/core/ext-py/Mako-0.7.2/build/lib.linux-i686-2.7/mako/pygen.py
19
9485
# mako/pygen.py # Copyright (C) 2006-2012 the Mako authors and contributors <see AUTHORS file> # # This module is part of Mako and is released under # the MIT License: http://www.opensource.org/licenses/mit-license.php """utilities for generating and formatting literal Python code.""" import re, string from StringIO ...
apache-2.0
-4,776,506,318,588,996,000
32.515901
79
0.549394
false
sajuptpm/contrail-controller
src/config/svc-monitor/svc_monitor/physical_service_manager.py
1
4391
import uuid from vnc_api.vnc_api import * from instance_manager import InstanceManager from config_db import ( VirtualMachineSM, VirtualMachineInterfaceSM, ServiceApplianceSetSM, ServiceApplianceSM, PhysicalInterfaceSM, ServiceInstanceSM, PortTupleSM) from cfgm_common import svc_info class...
apache-2.0
-214,335,243,265,898,750
35.289256
73
0.524026
false
uclmr/inferbeddings
scripts/guo-fb122/UCL_ARRAY_GUO-FB122_adv_KALE_v2.py
1
4329
#!/usr/bin/env python3 # -*- coding: utf-8 -*- import itertools import os import os.path import sys import argparse import logging def cartesian_product(dicts): return (dict(zip(dicts, x)) for x in itertools.product(*dicts.values())) def summary(configuration): kvs = sorted([(k, v) for k, v in configurati...
mit
5,945,661,182,144,631,000
32.3
112
0.556249
false
devs1991/test_edx_docmode
venv/lib/python2.7/site-packages/nltk/sem/lfg.py
12
6372
# Natural Language Toolkit: Lexical Functional Grammar # # Author: Dan Garrette <dhgarrette@gmail.com> # # Copyright (C) 2001-2012 NLTK Project # URL: <http://www.nltk.org/> # For license information, see LICENSE.TXT from collections import defaultdict from nltk.internals import Counter class FStructure(dict): ...
agpl-3.0
8,872,313,310,597,635,000
31.510204
121
0.493566
false
stevenvo/rpi-gpio-scripts
06_rgb.py
2
1605
#!/usr/bin/env python import RPi.GPIO as GPIO import time colors = [0xFF0000, 0x00FF00, 0x0000FF, 0xFFFF00, 0xFF00FF, 0x00FFFF] LedPinRed = 11 LedPinGreen = 12 LedPinBlue = 13 def setup(Rpin, Gpin, Bpin): global pins global p_R, p_G, p_B pins = {'pin_R': Rpin, 'pin_G': Gpin, 'pin_B': Bpin} GPIO.setmode(GPIO.BOARD...
gpl-2.0
358,925,009,150,959,170
23.692308
72
0.629283
false
plaes/numpy
numpy/lib/tests/test_ufunclike.py
5
1776
""" >>> import numpy.core as nx >>> import numpy.lib.ufunclike as U Test fix: >>> a = nx.array([[1.0, 1.1, 1.5, 1.8], [-1.0, -1.1, -1.5, -1.8]]) >>> U.fix(a) array([[ 1., 1., 1., 1.], [-1., -1., -1., -1.]]) >>> y = nx.zeros(a.shape, float) >>> U.fix(a, y) array([[ 1., 1., 1., 1.], [-1., -1., -1., -...
bsd-3-clause
-3,238,318,318,995,606,000
25.507463
66
0.545045
false
meteorcloudy/tensorflow
tensorflow/python/kernel_tests/lrn_op_test.py
138
5675
# Copyright 2015 The TensorFlow Authors. All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applica...
apache-2.0
-7,399,872,649,974,071,000
34.691824
80
0.622026
false
gautamkrishnar/hatter
venv/lib/python2.7/site-packages/pip/_vendor/html5lib/treewalkers/etree.py
310
4625
from __future__ import absolute_import, division, unicode_literals try: from collections import OrderedDict except ImportError: try: from ordereddict import OrderedDict except ImportError: OrderedDict = dict import gettext _ = gettext.gettext import re from pip._vendor.six import text_typ...
gpl-3.0
-2,966,662,205,089,292,300
32.514493
81
0.502919
false
jmartinm/invenio-master
modules/websubmit/lib/websubmitadmincli.py
21
21304
# -*- coding: utf-8 -*- ## ## This file is part of Invenio. ## Copyright (C) 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010 CERN. ## ## Invenio 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 ve...
gpl-2.0
-7,575,878,664,212,335,000
48.314815
222
0.597353
false
martonw/phantomjs
src/qt/qtwebkit/Tools/Scripts/webkitpy/layout_tests/run_webkit_tests.py
113
20678
# Copyright (C) 2010 Google Inc. All rights reserved. # Copyright (C) 2010 Gabor Rapcsanyi (rgabor@inf.u-szeged.hu), University of Szeged # Copyright (C) 2011 Apple Inc. All rights reserved. # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following ...
bsd-3-clause
4,218,727,070,735,701,000
52.848958
133
0.647258
false
seize-the-dave/XlsxWriter
xlsxwriter/test/comparison/test_chart_column03.py
8
1586
############################################################################### # # Tests for XlsxWriter. # # Copyright (c), 2013-2015, John McNamara, jmcnamara@cpan.org # from ..excel_comparsion_test import ExcelComparisonTest from ...workbook import Workbook class TestCompareXLSXFiles(ExcelComparisonTest): """...
bsd-2-clause
-6,318,711,642,345,014,000
26.344828
84
0.552333
false
huiyi1990/grab
grab/util/module.py
12
2512
import logging import six from grab.spider.base import Spider from grab.spider.error import SpiderInternalError from grab.util.config import build_root_config, build_spider_config SPIDER_REGISTRY = {} logger = logging.getLogger('grab.util.module') def build_spider_registry(config): SPIDER_REGISTRY.clear() ...
mit
2,188,999,851,494,307,800
36.492537
77
0.494029
false
gameduell/duell
bin/mac/python2.7.9/lib/python2.7/encodings/iso8859_11.py
593
12591
""" Python Character Mapping Codec iso8859_11 generated from 'MAPPINGS/ISO8859/8859-11.TXT' with gencodec.py. """#" import codecs ### Codec APIs class Codec(codecs.Codec): def encode(self,input,errors='strict'): return codecs.charmap_encode(input,errors,encoding_table) def decode(self,input,errors...
bsd-2-clause
-2,714,853,334,033,945,000
40.013029
109
0.524819
false
xiaoixa/python
ddkangfu/0003/0003.py
40
1351
#coding=utf-8 import uuid import redis """ 003, 将 0001 题生成的 200 个激活码(或者优惠券)保存到 **Redis** 非关系型数据库中. """ def get_redis_instance(host='localhost', port=6379): return redis.StrictRedis(host=host, port=port) def generate_activation_code(count): code_list = [] for i in xrange(count): code = str(uui...
mit
6,535,911,476,330,265,000
20.262295
57
0.562837
false
cmoutard/mne-python
logo/generate_mne_logos.py
12
6091
# -*- coding: utf-8 -*- """ =============================================================================== Script 'mne logo' =============================================================================== This script makes the logo for MNE. """ # @author: drmccloy # Created on Mon Jul 20 11:28:16 2015 # License: BSD ...
bsd-3-clause
-450,420,799,877,075,100
38.044872
79
0.616976
false
JianyuWang/nova
nova/tests/unit/volume/encryptors/test_cryptsetup.py
21
3918
# Copyright (c) 2013 The Johns Hopkins University/Applied Physics Laboratory # 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/...
apache-2.0
-1,351,330,098,916,937,700
36.673077
78
0.634763
false
Eric-Zhong/odoo
addons/website_membership/controllers/main.py
115
9181
# -*- coding: utf-8 -*- from openerp import SUPERUSER_ID from openerp.addons.web import http from openerp.addons.web.http import request from openerp.addons.website.models.website import unslug from openerp.tools.translate import _ import werkzeug.urls class WebsiteMembership(http.Controller): _references_per_pa...
agpl-3.0
5,106,072,782,130,907,000
53.005882
139
0.606579
false
varunarya10/nova_test_latest
nova/tests/unit/virt/hyperv/test_networkutilsv2.py
68
1724
# Copyright 2013 Cloudbase Solutions Srl # # Licensed under the Apache License, Version 2.0 (the "License"); you may # not use this file except in compliance with the License. You may obtain # a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable ...
apache-2.0
2,912,664,841,234,298,400
37.311111
78
0.703016
false
cad-lab/blog
plugin/liquid_tags/b64img.py
312
3085
""" Image Tag --------- This implements a Liquid-style image tag for Pelican, based on the liquid img tag which is based on the octopress image tag [1]_ Syntax ------ {% b64img [class name(s)] [http[s]:/]/path/to/image [width [height]] [title text | "title text" ["alt text"]] %} Examples -------- {% b64img /images/ni...
agpl-3.0
-3,413,558,366,966,212,600
34.056818
143
0.584117
false
giorgiop/scikit-learn
sklearn/metrics/tests/test_pairwise.py
13
26241
import numpy as np from numpy import linalg from scipy.sparse import dok_matrix, csr_matrix, issparse from scipy.spatial.distance import cosine, cityblock, minkowski, wminkowski from sklearn.utils.testing import assert_greater from sklearn.utils.testing import assert_array_almost_equal from sklearn.utils.testing impo...
bsd-3-clause
-6,666,704,065,889,952,000
37.364035
78
0.638162
false
frdb194/django
django/apps/config.py
224
8284
import os from importlib import import_module from django.core.exceptions import AppRegistryNotReady, ImproperlyConfigured from django.utils._os import upath from django.utils.module_loading import module_has_submodule MODELS_MODULE_NAME = 'models' class AppConfig(object): """ Class representing a Django ap...
bsd-3-clause
-5,344,739,703,794,595,000
39.019324
81
0.59971
false
joongh/robotframework
utest/writer/test_filewriters.py
7
2607
import unittest from robot.parsing import TestCaseFile from robot.parsing.model import TestCaseTable from robot.utils import ET, ETSource, StringIO from robot.utils.asserts import assert_equal def create_test_case_file(): data = TestCaseFile(source='foo.txt') table = TestCaseTable(data) data.testcase_tab...
apache-2.0
3,816,010,579,208,382,500
30.792683
90
0.615267
false
treejames/shaka-player
third_party/gjslint/python-gflags-2.0/tests/flags_modules_for_testing/module_foo.py
139
5150
#!/usr/bin/env python # # Copyright (c) 2009, 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 ...
apache-2.0
5,318,725,639,305,271,000
35.524823
79
0.725631
false
hachreak/invenio-records
setup.py
1
4671
# -*- coding: utf-8 -*- # # This file is part of Invenio. # Copyright (C) 2015, 2016 CERN. # # Invenio 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...
gpl-2.0
979,627,935,618,100,400
28.377358
76
0.609291
false
luofei98/qgis
python/plugins/processing/gui/ProcessingToolbox.py
1
16100
# -*- coding: utf-8 -*- """ *************************************************************************** ProcessingToolbox.py --------------------- Date : August 2012 Copyright : (C) 2012 by Victor Olaya Email : volayaf at gmail dot com *********************...
gpl-2.0
8,404,851,285,079,671,000
38.55774
82
0.574969
false
m1ck/bookadoptions
django/views/decorators/vary.py
307
1285
try: from functools import wraps except ImportError: from django.utils.functional import wraps # Python 2.4 fallback. from django.utils.cache import patch_vary_headers from django.utils.decorators import available_attrs def vary_on_headers(*headers): """ A view decorator that adds the specified heade...
bsd-3-clause
8,697,138,384,699,977,000
30.341463
78
0.645136
false
jiangzhuo/kbengine
kbe/res/scripts/common/Lib/pickletools.py
74
91170
'''"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, indentl...
lgpl-3.0
6,981,653,929,266,455,000
31.352732
85
0.588746
false
niteoweb/libcloud
libcloud/compute/drivers/ecs.py
5
56343
# Licensed to the Apache Software Foundation (ASF) under one or more # contributor license agreements. See the NOTICE file distributed with # this work for additional information regarding copyright ownership. # The ASF licenses this file to You under the Apache License, Version 2.0 # (the "License"); you may not use ...
apache-2.0
-7,534,073,447,265,085,000
35.753425
79
0.531282
false
jvkops/django
django/utils/html_parser.py
348
5155
import re import sys from django.utils import six from django.utils.six.moves import html_parser as _html_parser current_version = sys.version_info use_workaround = current_version < (2, 7, 3) try: HTMLParseError = _html_parser.HTMLParseError except AttributeError: # create a dummy class for Python 3.5+ whe...
bsd-3-clause
-3,491,617,795,175,144,000
39.273438
99
0.495441
false
neithere/monk
tests/molding_tests.py
1
1746
# coding: utf-8 # # Monk is an unobtrusive data modeling, manipulation and validation library. # Copyright © 2011—2015 Andrey Mikhaylenko # # This file is part of Monk. # # Monk is free software: you can redistribute it and/or modify # it under the terms of the GNU Lesser General Public License as publi...
gpl-3.0
2,299,365,321,430,669,600
34.571429
79
0.605852
false
kagetsu-claire/IzuminShogiBot
izumin/math.py
2
1802
# -*- coding: utf-8 -*- import importlib from math import sqrt import psycopg2 import psycopg2.extras from izumin import config if config.IS_PRODUCTION_ENVIRONMENT: db = importlib.import_module("izumin.db") else: db = importlib.import_module("izumin.db_local") def is_prime(x): """ 引数が素数であればTrue、そうで...
mit
-1,485,083,634,431,229,400
22.283582
74
0.546795
false
raptorz/userga
config.py
1
1121
# -*- coding: utf-8 -*- """ default config file :copyright: 20160204 by raptor.zh@gmail.com. """ #from __future__ import unicode_literals import sys PY3=sys.version>"3" from os.path import dirname, abspath, expanduser, join as joinpath import json import logging logger = logging.getLogger(__name__) config...
mit
7,374,102,508,874,562,000
20.980392
77
0.628903
false
eyalfa/spark
python/pyspark/ml/common.py
119
4372
# # Licensed to the Apache Software Foundation (ASF) under one or more # contributor license agreements. See the NOTICE file distributed with # this work for additional information regarding copyright ownership. # The ASF licenses this file to You under the Apache License, Version 2.0 # (the "License"); you may not us...
apache-2.0
3,328,994,861,209,960,400
30.681159
88
0.648902
false
7kbird/chrome
tools/telemetry/telemetry/core/browser_info.py
55
1147
# 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. _check_webgl_supported_script = """ (function () { var c = document.createElement('canvas'); var gl = c.getContext('webgl'); if (gl == null) { gl =...
bsd-3-clause
-3,095,487,572,733,899,000
29.184211
75
0.659983
false
CloudVLab/professional-services
examples/ml-audio-content-profiling/tests/test_perspective_api_function.py
2
5636
#!/usr/bin/env python3 # Copyright 2019 Google Inc. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law o...
apache-2.0
-6,739,563,694,962,739,000
54.254902
84
0.484918
false
huanchenz/STX-h-store
third_party/python/boto/exception.py
9
13323
# Copyright (c) 2006-2010 Mitch Garnaat http://garnaat.org/ # Copyright (c) 2010, Eucalyptus Systems, Inc. # 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 res...
gpl-3.0
-3,715,212,782,118,710,300
29.279545
80
0.639045
false
Mappy/mapnik
bindings/python/build.py
2
8178
# # This file is part of Mapnik (c++ mapping toolkit) # # Copyright (C) 2013 Artem Pavlenko # # Mapnik 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 op...
lgpl-2.1
-5,430,208,795,917,537,000
38.699029
147
0.670946
false
nkgilley/home-assistant
homeassistant/components/mfi/sensor.py
19
3314
"""Support for Ubiquiti mFi sensors.""" import logging from mficlient.client import FailedToLogin, MFiClient import requests import voluptuous as vol from homeassistant.components.sensor import PLATFORM_SCHEMA from homeassistant.const import ( CONF_HOST, CONF_PASSWORD, CONF_PORT, CONF_SSL, CONF_US...
apache-2.0
2,125,428,348,471,313,000
26.163934
83
0.612553
false
kaithar/muhubot
utils/plumbing/http_sink/jisho.py
1
1391
from __future__ import print_function, unicode_literals import json from utils.protocol import Socket as sock from funchain import AsyncCall import traceback tracker = {} cid = 0 def receiver(body): asc = tracker.get(body['cid'], None) if asc: del tracker[body['cid']] asc.fire_callback(body['...
gpl-2.0
-2,430,950,623,312,990,000
31.348837
161
0.600288
false
sgerhart/ansible
lib/ansible/modules/cloud/google/gcp_compute_target_vpn_gateway.py
8
11842
#!/usr/bin/python # -*- coding: utf-8 -*- # # Copyright (C) 2017 Google # GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt) # ---------------------------------------------------------------------------- # # *** AUTO GENERATED CODE *** AUTO GENERATED CODE *** # ...
mit
-36,408,771,567,527,060
32.834286
135
0.589765
false
sumedh123/debatify
venv/lib/python2.7/site-packages/pip/_vendor/html5lib/constants.py
497
86873
from __future__ import absolute_import, division, unicode_literals import string EOF = None E = { "null-character": "Null character in input stream, replaced with U+FFFD.", "invalid-codepoint": "Invalid codepoint in stream.", "incorrectly-placed-solidus": "Solidus (/) incorrectly ...
mit
2,436,745,674,316,254,700
27.00548
94
0.501007
false
mivanov/editkit
editkit/users/models.py
1
1488
import urllib from django.contrib.auth.models import User from django.utils.encoding import smart_str from django.db import models from django.conf import settings from django.contrib.sites.models import Site ####################################################################### # # "Monkey-pathcing is bad, but co...
gpl-2.0
-1,290,577,158,772,022,000
24.655172
77
0.616935
false
p4datasystems/CarnotKE
jyhton/lib-python/2.7/test/test_runpy.py
43
16184
# Test the runpy module import unittest import os import os.path import sys import re import tempfile from test.test_support import verbose, run_unittest, forget from test.script_helper import (temp_dir, make_script, compile_script, make_pkg, make_zip_script, make_zip_pkg) from runpy i...
apache-2.0
7,972,105,450,962,980,000
39.258706
84
0.570996
false