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
citrix-openstack-build/nova
nova/openstack/common/rootwrap/cmd.py
13
4847
# vim: tabstop=4 shiftwidth=4 softtabstop=4 # Copyright (c) 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-2.0
-5,811,748,242,996,668,000
34.123188
78
0.613782
false
s-store/sstore-soft
third_party/python/boto/cloudfront/identity.py
47
4489
# Copyright (c) 2006-2009 Mitch Garnaat http://garnaat.org/ # # Permission is hereby granted, free of charge, to any person obtaining a # copy of this software and associated documentation files (the # "Software"), to deal in the Software without restriction, including # without limitation the rights to use, copy, modi...
gpl-3.0
-5,685,734,208,164,710,000
35.795082
111
0.61996
false
dwadler/QGIS
python/plugins/processing/gui/BatchPanel.py
3
13573
# -*- coding: utf-8 -*- """ *************************************************************************** BatchPanel.py --------------------- Date : November 2014 Copyright : (C) 2014 by Alexander Bruy Email : alexander dot bruy at gmail dot com *************...
gpl-2.0
-5,032,475,572,203,313,000
40.885802
127
0.57505
false
OSSESAC/odoopubarquiluz
addons/note/tests/__init__.py
159
1105
# -*- 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
-6,112,777,480,440,858,000
39.925926
78
0.61448
false
mancoast/CPythonPyc_test
cpython/235_test_quopri.py
24
5562
from test import test_support import unittest from cStringIO import StringIO from quopri import * ENCSAMPLE = """\ Here's a bunch of special=20 =A1=A2=A3=A4=A5=A6=A7=A8=A9 =AA=AB=AC=AD=AE=AF=B0=B1=B2=B3 =B4=B5=B6=B7=B8=B9=BA=BB=BC=BD=BE =BF=C0=C1=C2=C3=C4=C5=C6 =C7=C8=C9=CA=CB=CC=CD=CE=CF =D0=D1=D2=D3=D4=D5=D6=D7 ...
gpl-3.0
-3,064,768,554,707,127,000
34.426752
163
0.671161
false
sils1297/PyGithub
github/IssueEvent.py
74
4698
# -*- coding: utf-8 -*- # ########################## Copyrights and license ############################ # # # Copyright 2012 Vincent Jacques <vincent@vincent-jacques.net> # # Copyright 2012 Zearin <zearin@gonk.net> ...
gpl-3.0
8,569,877,779,766,652,000
39.153846
100
0.518944
false
jlopp/statoshi
test/functional/rpc_getblockstats.py
34
6874
#!/usr/bin/env python3 # Copyright (c) 2017-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 getblockstats rpc call # from test_framework.test_framework import BitcoinTestFramework from tes...
mit
-7,315,750,585,812,020,000
40.660606
121
0.598778
false
ralphwort/chef-repo
build/pyparsing/examples/scanExamples.py
6
2363
# # scanExamples.py # # Illustration of using pyparsing's scanString,transformString, and searchString methods # # Copyright (c) 2004, 2006 Paul McGuire # from pyparsing import Word, alphas, alphanums, Literal, restOfLine, OneOrMore, \ empty, Suppress, replaceWith # simulate some C++ code testData = ""...
apache-2.0
1,995,607,164,214,624,800
29.506667
103
0.669488
false
gmt/portage
pym/portage/tests/ebuild/test_array_fromfile_eof.py
10
1114
# Copyright 2009-2011 Gentoo Foundation # Distributed under the terms of the GNU General Public License v2 import array import tempfile from portage import _unicode_decode from portage import _unicode_encode from portage.tests import TestCase class ArrayFromfileEofTestCase(TestCase): def testArrayFromfileEof(self)...
gpl-2.0
7,017,836,482,222,591,000
22.702128
66
0.687612
false
MihaiMoldovanu/ansible
lib/ansible/module_utils/facts/network/hurd.py
192
3142
# 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 distributed in the hope that ...
gpl-3.0
-5,626,360,329,980,668,000
35.534884
88
0.528962
false
maxwward/SCOPEBak
askbot/migrations/0092_postize_vote_and_activity.py
2
34359
# encoding: utf-8 import datetime import sys from south.db import db from south.v2 import DataMigration from django.db import models from askbot.migrations import TERM_RED_BOLD, TERM_GREEN, TERM_RESET from askbot.utils.console import ProgressBar class Migration(DataMigration): def forwards(self, orm): m...
gpl-3.0
-118,701,548,680,486,600
82.802439
226
0.560203
false
pedroma-gomezp/Gymkhana_Computer_Networks_II
gymkhana/steps/step5.py
2
2162
#!/usr/bin/python3 # -*- coding:utf-8 -*- import socket from urllib.request import urlopen, Request from urllib.error import URLError, HTTPError import threading from gymkhana.aux.printing_format import green_nd_bold, yellow_nd_bold, colorfill, end_format from gymkhana.aux.my_variables import uclm_url, uclm_port3, my...
gpl-3.0
2,963,034,635,894,279,700
29.027778
93
0.603608
false
whitgroves/taskmap
.venvs/python3.6.0/lib/python3.6/site-packages/setuptools/command/build_ext.py
193
13049
import os import sys import itertools import imp from distutils.command.build_ext import build_ext as _du_build_ext from distutils.file_util import copy_file from distutils.ccompiler import new_compiler from distutils.sysconfig import customize_compiler, get_config_var from distutils.errors import DistutilsError from d...
unlicense
2,898,871,245,359,863,000
38.783537
83
0.57376
false
jkugler/ansible
lib/ansible/playbook/__init__.py
108
3720
# (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
-4,126,468,961,621,017,600
36.959184
145
0.665323
false
dya2/python-for-android
python3-alpha/python3-src/Lib/http/cookies.py
47
20357
#!/usr/bin/env python3 # #### # Copyright 2000 by Timothy O'Malley <timo@alum.mit.edu> # # All Rights Reserved # # Permission to use, copy, modify, and distribute this software # and its documentation for any purpose and without fee is hereby # granted, provided that the above copyright notice appear in...
apache-2.0
2,686,764,588,635,487,700
34.651489
80
0.537702
false
krikru/tensorflow-opencl
tensorflow/python/ops/linalg_grad.py
61
8371
# 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
-8,400,542,503,493,480,000
37.399083
80
0.648787
false
ohmini/thaifoodapi
lib/django/contrib/gis/geos/collections.py
292
4986
""" This module houses the Geometry Collection objects: GeometryCollection, MultiPoint, MultiLineString, and MultiPolygon """ import json from ctypes import byref, c_int, c_uint from django.contrib.gis.geos import prototypes as capi from django.contrib.gis.geos.geometry import ( GEOSGeometry, ProjectInterpolateM...
bsd-3-clause
5,857,931,355,935,844,000
34.112676
113
0.649619
false
jetskijoe/headphones
lib/unidecode/x091.py
252
4655
data = ( 'Ruo ', # 0x00 'Bei ', # 0x01 'E ', # 0x02 'Yu ', # 0x03 'Juan ', # 0x04 'Yu ', # 0x05 'Yun ', # 0x06 'Hou ', # 0x07 'Kui ', # 0x08 'Xiang ', # 0x09 'Xiang ', # 0x0a 'Sou ', # 0x0b 'Tang ', # 0x0c 'Ming ', # 0x0d 'Xi ', # 0x0e 'Ru ', # 0x0f 'Chu ', # 0x10 'Zi ...
gpl-3.0
-1,031,371,103,917,170,700
17.042636
24
0.392911
false
liu602348184/django
tests/staticfiles_tests/settings.py
147
1039
from __future__ import unicode_literals import os.path from django.utils._os import upath TEST_ROOT = os.path.dirname(upath(__file__)) TESTFILES_PATH = os.path.join(TEST_ROOT, 'apps', 'test', 'static', 'test') TEST_SETTINGS = { 'DEBUG': True, 'MEDIA_URL': '/media/', 'STATIC_URL': '/static/', 'MEDIA...
bsd-3-clause
1,231,895,474,931,675,100
31.46875
78
0.631376
false
gpoulin/luigi
test/contrib/sqla_test.py
5
12958
# -*- coding: utf-8 -*- # # Copyright (c) 2015 Gouthaman Balaraman # # 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 applic...
apache-2.0
5,866,685,293,076,455,000
33.280423
120
0.569224
false
Supermaster34/3.0-Kernel-Galaxy-Player-US
Documentation/target/tcm_mod_builder.py
3119
42754
#!/usr/bin/python # The TCM v4 multi-protocol fabric module generation script for drivers/target/$NEW_MOD # # Copyright (c) 2010 Rising Tide Systems # Copyright (c) 2010 Linux-iSCSI.org # # Author: nab@kernel.org # import os, sys import subprocess as sub import string import re import optparse tcm_dir = "" fabric_ops...
gpl-2.0
-3,400,268,836,846,362,000
38.080439
163
0.572742
false
precedenceguo/mxnet
example/image-classification/symbols/inception-bn.py
57
7598
# Licensed to the Apache Software Foundation (ASF) under one # or more contributor license agreements. See the NOTICE file # distributed with this work for additional information # regarding copyright ownership. The ASF licenses this file # to you under the Apache License, Version 2.0 (the # "License"); you may not u...
apache-2.0
6,391,735,376,259,826,000
51.763889
141
0.638457
false
openfun/edx-platform
common/lib/xmodule/xmodule/randomize_module.py
54
3690
import logging import random from xmodule.x_module import XModule, STUDENT_VIEW from xmodule.seq_module import SequenceDescriptor from lxml import etree from xblock.fields import Scope, Integer from xblock.fragment import Fragment log = logging.getLogger('edx.' + __name__) class RandomizeFields(object): choic...
agpl-3.0
7,646,340,217,805,510,000
32.853211
90
0.634959
false
chokribr/PIST
modules/webcomment/lib/webcomment_washer.py
27
4062
from invenio.htmlutils import HTMLWasher import htmlentitydefs import cgi import re RE_HTML_FIRST_NON_QUOTATION_CHAR_ON_LINE = re.compile('[^>]') class EmailWasher(HTMLWasher): """ Wash comments before being sent by email """ line_quotation = '' def handle_starttag(self, tag, attrs): """...
gpl-2.0
-9,098,783,391,136,969,000
39.217822
101
0.499508
false
Changaco/oh-mainline
vendor/packages/Pygments/pygments/lexers/foxpro.py
335
26220
# -*- coding: utf-8 -*- """ pygments.lexers.foxpro ~~~~~~~~~~~~~~~~~~~~~~ Simple lexer for Microsoft Visual FoxPro source code. :copyright: Copyright 2006-2013 by the Pygments team, see AUTHORS. :license: BSD, see LICENSE for details. """ import re from pygments.lexer import RegexLexer from pygm...
agpl-3.0
-8,195,965,402,150,008,000
60.261682
80
0.657628
false
Evfro/polara
polara/recommender/external/turi/turiwrapper.py
1
8039
import numpy as np import turicreate as tc from polara import RecommenderModel class TuriFactorizationRecommender(RecommenderModel): def __init__(self, *args, **kwargs): self.item_side_info = kwargs.pop('item_side_info', None) self.user_side_info = kwargs.pop('user_side_info', None) super(...
mit
-5,259,442,583,101,287,000
38.600985
102
0.557532
false
philoniare/horizon
openstack_dashboard/dashboards/identity/groups/urls.py
64
1248
# Copyright 2013 Hewlett-Packard Development Company, L.P. # # 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 requir...
apache-2.0
6,257,925,113,638,294,000
39.258065
78
0.682692
false
2014c2g2/2015cdag2_0421
static/Brython3.1.1-20150328-091302/Lib/ui/widget.py
706
1774
import random from browser import doc def getMousePosition(e): if e is None: e=win.event if e.pageX or e.pageY: return {'x': e.pageX, 'y': e.pageY} if e.clientX or e.clientY: _posx=e.clientX + doc.body.scrollLeft + doc.documentElement.scrollLeft; _posy=e.clientY + doc.body.scr...
agpl-3.0
-5,032,134,572,866,405,000
28.566667
79
0.606539
false
JIoJIaJIu/servo
tests/wpt/web-platform-tests/tools/wptserve/wptserve/handlers.py
89
13047
import cgi import json import os import traceback import urllib import urlparse from constants import content_types from pipes import Pipeline, template from ranges import RangeParser from request import Authentication from response import MultipartContent from utils import HTTPException __all__ = ["file_handler", "p...
mpl-2.0
8,121,558,563,098,961,000
34.262162
113
0.568483
false
OpenUpgrade/OpenUpgrade
addons/project_timesheet/__init__.py
441
1084
# -*- 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
-4,879,457,577,912,610,000
44.166667
78
0.620849
false
SujaySKumar/django
tests/db_functions/tests.py
193
18491
from __future__ import unicode_literals from datetime import datetime, timedelta from unittest import skipIf, skipUnless from django.db import connection from django.db.models import CharField, TextField, Value as V from django.db.models.expressions import RawSQL from django.db.models.functions import ( Coalesce,...
bsd-3-clause
-6,553,348,332,345,050,000
32.681239
104
0.575631
false
smscannell/crazyflie-clients-python
lib/cfclient/ui/widgets/ai.py
5
8202
#!/usr/bin/env python # -*- coding: utf-8 -*- # # || ____ _ __ # +------+ / __ )(_) /_______________ _____ ___ # | 0xBC | / __ / / __/ ___/ ___/ __ `/_ / / _ \ # +------+ / /_/ / / /_/ /__/ / / /_/ / / /_/ __/ # || || /_____/_/\__/\___/_/ \__,_/ /___/\___/ # # Copyright (C) 20...
gpl-2.0
-8,541,451,677,890,035,000
30.186312
79
0.491953
false
sqlanywhere/sqlany-django
sqlany_django/introspection.py
1
5278
from django import VERSION as djangoVersion if djangoVersion[:2] >= (1, 8): from django.db.backends.base.introspection import BaseDatabaseIntrospection, TableInfo else: from django.db.backends import BaseDatabaseIntrospection from sqlanydb import ProgrammingError, OperationalError import re import sqlanydb cl...
bsd-3-clause
-2,710,835,049,391,630,000
47.422018
114
0.54964
false
jtyuan/racetrack
src/cpu/BaseCPU.py
2
13784
# Copyright (c) 2012-2013 ARM Limited # All rights reserved. # # The license below extends only to copyright in the software and shall # not be construed as granting a license to any other intellectual # property including but not limited to intellectual property relating # to a hardware implementation of the functiona...
bsd-3-clause
6,894,845,125,491,615,000
41.674923
93
0.63697
false
wufulin/PyMusicPlayer
src/util/SongManager.py
1
2318
#encoding=utf-8 ''' @author: wufulin ''' import os import sys sys.path.append("..") from util.Tool import * #################################### #SongManager #歌曲列表管理类 #################################### class SongManager(object): ''' 播放列表管理器 ''' def __init__(self): self.__SongList ...
mit
-7,674,193,373,227,555,000
25.070588
72
0.477888
false
carsongee/edx-platform
common/djangoapps/terrain/stubs/tests/test_xqueue_stub.py
40
6727
""" Unit tests for stub XQueue implementation. """ import mock import unittest import json import requests import time import copy from ..xqueue import StubXQueueService, StubXQueueHandler class FakeTimer(object): """ Fake timer implementation that executes immediately. """ def __init__(self, delay, ...
agpl-3.0
5,017,801,360,472,386,000
36.165746
95
0.618701
false
scippio/bitcoin
qa/rpc-tests/maxuploadtarget.py
27
10783
#!/usr/bin/env python2 # # Distributed under the MIT/X11 software license, see the accompanying # file COPYING or http://www.opensource.org/licenses/mit-license.php. # from test_framework.mininode import * from test_framework.test_framework import BitcoinTestFramework from test_framework.util import * from test_framew...
mit
-3,091,584,682,049,404,000
39.537594
140
0.633497
false
rockneurotiko/django
tests/aggregation_regress/tests.py
82
54019
from __future__ import unicode_literals import datetime import pickle from decimal import Decimal from operator import attrgetter from django.contrib.contenttypes.models import ContentType from django.core.exceptions import FieldError from django.db import connection from django.db.models import ( F, Q, Avg, Coun...
bsd-3-clause
6,589,266,326,023,965,000
40.235878
252
0.57439
false
jinglining/flink
flink-python/setup.py
5
12946
################################################################################ # 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...
apache-2.0
-7,212,608,826,334,563,000
40.229299
99
0.591766
false
sahiljain/catapult
third_party/gsutil/third_party/apitools/apitools/base/py/stream_slice_test.py
23
1677
"""Tests for stream_slice.""" import string import six import unittest2 from apitools.base.py import exceptions from apitools.base.py import stream_slice class StreamSliceTest(unittest2.TestCase): def setUp(self): self.stream = six.StringIO(string.ascii_letters) self.value = self.stream.getval...
bsd-3-clause
-1,640,468,730,291,986,400
32.54
79
0.635063
false
kiran/bart-sign
venv/lib/python2.7/site-packages/pip/_vendor/requests/packages/chardet/hebrewprober.py
2929
13359
######################## BEGIN LICENSE BLOCK ######################## # The Original Code is Mozilla Universal charset detector code. # # The Initial Developer of the Original Code is # Shy Shalom # Portions created by the Initial Developer are Copyright (C) 2005 # the Initial Developer. All Rights Reserved. #...
mit
5,033,851,037,081,444,000
46.204947
79
0.684932
false
rhnvrm/iot-hackerearth
py/sim/wo/work.py
1
5919
from __future__ import division import requests import random import time import threading import rethinkdb as r import math import numpy as np import cv2 import matplotlib from matplotlib import pyplot as plt import matplotlib.patches as patches from scipy.misc import imread import os plt.scatter([0,5],[0,5]) plt.io...
mit
8,277,551,330,745,757,000
27.594203
246
0.608887
false
40223226/2015cdbg8
static/Brython3.1.1-20150328-091302/Lib/multiprocessing/process.py
694
2304
# # Module providing the `Process` class which emulates `threading.Thread` # # multiprocessing/process.py # # Copyright (c) 2006-2008, R Oudkerk # Licensed to PSF under a Contributor Agreement. # __all__ = ['Process', 'current_process', 'active_children'] # # Imports # import os import sys import signal import itert...
gpl-3.0
2,033,552,165,903,966,700
19.571429
78
0.650174
false
xzturn/tensorflow
tensorflow/python/autograph/converters/function_scopes.py
3
4844
# 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
7,454,305,913,532,507,000
35.69697
80
0.680636
false
aronparsons/spacewalk
backend/server/rhnServer/satellite_cert.py
2
7227
# # Copyright (c) 2008--2015 Red Hat, Inc. # # This software is licensed to you under the GNU General Public License, # version 2 (GPLv2). There is NO WARRANTY for this software, express or # implied, including the implied warranties of MERCHANTABILITY or FITNESS # FOR A PARTICULAR PURPOSE. You should have received a c...
gpl-2.0
-2,588,638,581,477,160,400
31.408072
96
0.590978
false
CENDARI/scrapy
tests/test_log.py
15
5670
from io import BytesIO from twisted.python import log as txlog, failure from twisted.trial import unittest from scrapy import log from scrapy.spider import Spider from scrapy.settings import default_settings from scrapy.utils.test import get_crawler class LogTest(unittest.TestCase): def test_get_log_level(self)...
bsd-3-clause
-5,023,048,732,568,320,000
32.550296
88
0.62716
false
Anonymouslemming/ansible
lib/ansible/plugins/action/iosxr_config.py
46
4184
# # (c) 2017, 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...
gpl-3.0
2,829,404,888,841,032,700
36.357143
85
0.61544
false
peihe/incubator-beam
sdks/python/apache_beam/examples/complete/juliaset/juliaset_main.py
18
2269
# # 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
-6,957,329,494,944,434,000
38.12069
80
0.766417
false
romanz/python-trezor
trezorlib/tests/device_tests/test_msg_lisk_getaddress.py
3
1383
# This file is part of the Trezor project. # # Copyright (C) 2012-2018 SatoshiLabs and contributors # # This library is free software: you can redistribute it and/or modify # it under the terms of the GNU Lesser General Public License version 3 # as published by the Free Software Foundation. # # This library is distrib...
lgpl-3.0
6,679,521,086,183,556,000
36.378378
86
0.728127
false
munyirik/python
cpython/Lib/asyncio/queues.py
3
8955
"""Queues""" __all__ = ['Queue', 'PriorityQueue', 'LifoQueue', 'QueueFull', 'QueueEmpty'] import collections import heapq from . import events from . import futures from . import locks from .tasks import coroutine class QueueEmpty(Exception): """Exception raised when Queue.get_nowait() is called on a Queue obj...
bsd-3-clause
-3,033,312,331,713,395,700
30.09375
79
0.591625
false
gauribhoite/personfinder
env/google_appengine/lib/jinja2-2.6/jinja2/parser.py
171
35218
# -*- coding: utf-8 -*- """ jinja2.parser ~~~~~~~~~~~~~ Implements the template parser. :copyright: (c) 2010 by the Jinja Team. :license: BSD, see LICENSE for more details. """ from jinja2 import nodes from jinja2.exceptions import TemplateSyntaxError, TemplateAssertionError from jinja2.utils impo...
apache-2.0
1,582,676,880,388,413,700
38.305804
82
0.545744
false
JioCloud/nova
nova/tests/functional/v3/test_volumes.py
30
14313
# Copyright 2012 Nebula, Inc. # Copyright 2014 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...
apache-2.0
8,041,202,707,964,344,000
39.432203
78
0.585132
false
MagnetoTesting/magneto
magneto/utils/adb.py
3
11444
import os import subprocess import re import threading from functools import wraps from concurrent.futures import Future, wait import time from ..logger import Logger class ADB(object): """ Wrapper for adb commands. Import:: from magneto.utils.adb import ADB :required: Android SDK installe...
apache-2.0
-5,249,573,755,576,974,000
31.511364
150
0.570255
false
likelyzhao/mxnet
python/mxnet/_ctypes/symbol.py
2
7644
# coding: utf-8 # pylint: disable=invalid-name, protected-access, too-many-arguments, global-statement """Symbolic configuration API.""" from __future__ import absolute_import as _abs import ctypes import sys import numpy as _numpy from ..base import _LIB from ..base import c_array, c_str, mx_uint, py_str from ..base...
apache-2.0
-1,260,048,236,609,107,700
32.823009
90
0.567373
false
clovis/PhiloLogic4
python/philologic/runtime/DB.py
2
8445
"""DB class containing many niceties to retrieve data from SQL""" import hashlib import os import sqlite3 from philologic.Config import Config, db_locals_defaults, db_locals_header from philologic.runtime import Query from . import HitList from . import MetadataQuery from . import QuerySyntax from .HitWrapper import...
gpl-3.0
5,255,582,056,090,720,000
39.214286
116
0.520663
false
x2Ident/x2Ident
mitmproxy/mitmproxy/contrib/wbxml/ASWBXMLCodePage.py
2
1832
#!/usr/bin/env python ''' @author: David Shaw, david.shaw.aw@gmail.com Inspired by EAS Inspector for Fiddler https://easinspectorforfiddler.codeplex.com ----- The MIT License (MIT) ----- Filename: ASWBXMLCodePage.py Copyright (c) 2014, David P. Shaw Permission is hereby granted, free of charge, to any pe...
gpl-3.0
-4,017,014,294,127,044,600
33.269231
77
0.736354
false
ryano144/intellij-community
plugins/hg4idea/testData/bin/mercurial/bookmarks.py
91
9671
# Mercurial bookmark support code # # Copyright 2008 David Soria Parra <dsp@php.net> # # This software may be used and distributed according to the terms of the # GNU General Public License version 2 or any later version. from mercurial.i18n import _ from mercurial.node import hex from mercurial import encoding, error...
apache-2.0
8,935,375,259,626,015,000
30.917492
79
0.552683
false
AICP/external_chromium_org
tools/check_ecs_deps/check_ecs_deps.py
43
4858
#!/usr/bin/env python # Copyright 2013 The Chromium Authors. All rights reserved. # Use of this source code is governed by a BSD-style license that can be # found in the LICENSE file. ''' Verifies that builds of the embedded content_shell do not included unnecessary dependencies.''' import os import re import string ...
bsd-3-clause
6,024,392,386,985,473,000
23.049505
78
0.60107
false
Gchorba/Ask
lib/python2.7/site-packages/pip/_vendor/requests/packages/urllib3/_collections.py
172
6278
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): pass try: # Python 2.7+ from co...
mit
7,081,563,941,337,235,000
30.707071
92
0.60481
false
ixc/django-fluent-contents
fluent_contents/plugins/twitterfeed/south_migrations/0001_initial.py
3
6928
# encoding: utf-8 import datetime from south.db import db from south.v2 import SchemaMigration from django.db import models class Migration(SchemaMigration): depends_on = ( ("fluent_contents", "0001_initial"), ) def forwards(self, orm): # Adding model 'TwitterRecentEntriesItem' ...
apache-2.0
9,220,039,852,363,517,000
71.166667
221
0.606813
false
e-gob/plataforma-kioscos-autoatencion
scripts/ansible-play/.venv/lib/python2.7/site-packages/ansible/module_utils/urls.py
2
44764
# 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...
bsd-3-clause
-6,785,287,104,702,830,000
40.295203
159
0.623135
false
recipy/recipy
integration_test/process.py
1
1547
""" Functions to execute commands via the operating system. """ # Copyright (c) 2016 University of Edinburgh. from __future__ import (nested_scopes, generators, division, absolute_import, with_statement, print_function, unicode_literals) from subprocess import call fro...
apache-2.0
-7,822,101,710,626,123,000
30.571429
69
0.678087
false
adereis/avocado
selftests/unit/test_sysinfo.py
1
3553
import os import sys import tempfile import shutil if sys.version_info[:2] == (2, 6): import unittest2 as unittest else: import unittest from avocado.core import sysinfo class SysinfoTest(unittest.TestCase): def setUp(self): self.tmpdir = tempfile.mkdtemp(prefix="sysinfo_unittest") def tes...
gpl-2.0
2,674,357,257,871,580,000
35.628866
78
0.59893
false
pandaxcl/gyp
test/mac/gyptest-postbuild.py
345
1708
#!/usr/bin/env python # Copyright (c) 2011 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. """ Verifies that postbuild steps work. """ import TestGyp import sys if sys.platform == 'darwin': test = TestGyp.TestGyp(formats=['nin...
bsd-3-clause
4,033,501,120,168,870,400
31.226415
72
0.608899
false
Troyhy/django-registration
registration/backends/simple/urls.py
63
1259
""" URLconf for registration and activation, using django-registration's one-step backend. If the default behavior of these views is acceptable to you, simply use a line like this in your root URLconf to set up the default URLs for registration:: (r'^accounts/', include('registration.backends.simple.urls')), Thi...
bsd-3-clause
-8,611,877,359,479,775,000
33.972222
103
0.654488
false
rande/python-shirka
shirka/responders/math.py
1
1027
# vim: set fileencoding=utf-8 : from shirka.responders import Responder from sympy.parsing.sympy_parser import parse_expr import exceptions from shirka.consumers import BaseTestCase class MathResponder(Responder): def name(self): return 'math' def generate(self, request): """ usage: m...
mit
8,518,402,982,846,653,000
29.205882
78
0.647517
false
barbarubra/Don-t-know-What-i-m-doing.
python/src/Lib/ctypes/_endian.py
153
2041
###################################################################### # This file should be kept compatible with Python 2.3, see PEP 291. # ###################################################################### import sys from ctypes import * _array_type = type(c_int * 3) def _other_endian(typ): """Return the t...
apache-2.0
3,581,711,831,481,985,500
33.016667
76
0.5561
false
phalt/django
django/templatetags/tz.py
57
5411
from datetime import datetime, tzinfo import pytz from django.template import Library, Node, TemplateSyntaxError from django.utils import six, timezone register = Library() # HACK: datetime is an old-style class, create a new-style equivalent # so we can define additional attributes. class datetimeobject(datetime,...
bsd-3-clause
1,225,937,099,631,517,000
27.478947
100
0.625762
false
patmcb/odoo
openerp/workflow/instance.py
314
5594
# -*- coding: utf-8 -*- ############################################################################## # # OpenERP, Open Source Management Solution # Copyright (C) 2004-2014 Tiny SPRL (<http://tiny.be>). # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU...
agpl-3.0
-3,875,596,677,799,933,000
40.746269
192
0.632821
false
heisencoder/route-finder
third_party/lib/python/django/contrib/sessions/backends/cached_db.py
103
2723
""" Cached, database-backed sessions. """ import logging from django.contrib.sessions.backends.db import SessionStore as DBStore from django.core.cache import cache from django.core.exceptions import SuspiciousOperation from django.utils import timezone from django.utils.encoding import force_text KEY_PREFIX = "djan...
mit
2,844,811,568,959,429,000
31.416667
78
0.593463
false
GovReady/govready-q
loadtesting/web.py
1
5269
import logging import requests import structlog import parsel from random import sample import re from django.test import Client from django.test import RequestFactory from siteapp.urls import urlpatterns from django.urls.exceptions import Resolver404 as Resolver404 from siteapp.models import * from guidedmodules.m...
gpl-3.0
6,899,913,850,678,223,000
32.138365
144
0.595939
false
glennhickey/toil-vg
src/toil_vg/test/test_vg.py
1
49176
import logging import shlex import shutil import subprocess import tempfile import textwrap import filecmp import shutil from contextlib import closing from unittest import TestCase, skip from urlparse import urlparse from uuid import uuid4 import urllib2, gzip import os, sys import posixpath import pytest from toil...
apache-2.0
6,839,732,807,542,702,000
48.522659
127
0.523141
false
simonwydooghe/ansible
lib/ansible/module_utils/facts/other/ohai.py
232
2307
# 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 distributed in the hope that ...
gpl-3.0
5,229,581,563,457,238,000
31.041667
83
0.641092
false
kmcginn/advent-of-code
2017/day05/jump.py
1
2214
""" from: http://adventofcode.com/2017/day/5 --- Day 5: A Maze of Twisty Trampolines, All Alike --- An urgent interrupt arrives from the CPU: it's trapped in a maze of jump instructions, and it would like assistance from any programs with spare cycles to help find the exit. The message includes a list of the offsets f...
mit
-7,514,168,849,491,919,000
41.576923
100
0.682927
false
rschaad/owlmonitor
docs/conf.py
1
9173
# -*- coding: utf-8 -*- # # OWL Monitor documentation build configuration file, created by # sphinx-quickstart on Fri Apr 29 14:54:08 2016. # # 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. #...
mit
1,531,875,613,987,027,700
31.299296
79
0.706966
false
davidzchen/jsonnet
case_studies/micromanage/cmds.py
6
2679
# Copyright 2015 Google Inc. All rights reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or ag...
apache-2.0
-5,355,482,043,520,836,000
36.732394
83
0.530049
false
abma/pr-downloader
scripts/update-repos.py
2
1875
#!/usr/bin/python3 # updates repos.gz import gzip import os wwwroot = "/home/packages/www/repos.springrts.com" prefix = "http://repos.springrts.com/" streamer = "/home/packages/bin/Streamer" repos = { "main": "http://packages.springrts.com" } assert(os.path.isfile(streamer)) def SetupStreamer(repodir): streamerc...
gpl-2.0
-2,386,254,385,857,449,000
21.590361
62
0.6928
false
Maximilian-Reuter/SickRage-1
lib/hachoir_parser/program/prc.py
86
2766
""" PRC (Palm resource) parser. Author: Sebastien Ponce Creation date: 29 october 2008 """ from hachoir_parser import Parser from hachoir_core.field import (FieldSet, UInt16, UInt32, TimestampMac32, String, RawBytes) from hachoir_core.endian import BIG_ENDIAN class PRCHeader(FieldSet): static_size = 78*8...
gpl-3.0
6,913,437,666,314,705,000
32.731707
111
0.594722
false
tiagofrepereira2012/tensorflow
tensorflow/contrib/learn/python/learn/estimators/dnn_linear_combined_test.py
52
69800
# 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
-3,061,587,275,374,672,000
37.4573
81
0.623152
false
lehmannro/pootle
external_apps/profiles/utils.py
21
1467
""" Utility functions for retrieving and generating forms for the site-specific user profile model specified in the ``AUTH_PROFILE_MODULE`` setting. """ from django import forms from django.conf import settings from django.contrib.auth.models import SiteProfileNotAvailable from django.db.models import get_model def...
gpl-2.0
-5,638,922,468,514,041,000
31.6
69
0.69666
false
chuijiaolianying/robotx
robotx/core/__init__.py
4
3209
"""Dealing with all general issues about command line tool set. And this is command entry point. """ import sys import inspect import optparse from robotx.core.base import BaseCommand from robotx.utils.misc import walk_modules from robotx.core.exceptions import UsageError def _iter_command_classes(module_name): ...
mit
4,690,665,599,637,773,000
25.520661
78
0.607354
false
arifgursel/pyglet
examples/programming_guide/hello_world.py
30
2206
#!/usr/bin/env python # ---------------------------------------------------------------------------- # pyglet # Copyright (c) 2006-2008 Alex Holkner # All rights reserved. # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions # are ...
bsd-3-clause
-4,791,542,460,349,258,000
38.392857
78
0.660471
false
MiltosD/CEF-ELRC
misc/tools/generateDS-2.7a/tests/literal1.py
12
6179
#from out2_sup import * import out2_sup as model_ rootObj = model_.rootTag( comments=[ model_.comments( content_ = [ model_.MixedContainer(1, 0, "", "1. This is a "), model_.MixedContainer(2, 2, "emp", "foolish"), model_.MixedContainer(1, 0, "", " comment. ...
bsd-3-clause
7,735,155,835,734,682,000
27.873832
73
0.35038
false
sergiorua/libcloud
libcloud/compute/ssh.py
10
16719
# 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
-6,114,437,763,272,489,000
30.426692
79
0.562175
false
OsirisSPS/osiris-sps
client/share/plugins/AF9A4C281070FDB0F34CF417CDB168AB38C8A388/lib/curses/has_key.py
154
5627
# # Emulation of has_key() function for platforms that don't use ncurses # import _curses # Table mapping curses keys to the terminfo capability name _capability_names = { _curses.KEY_A1: 'ka1', _curses.KEY_A3: 'ka3', _curses.KEY_B2: 'kb2', _curses.KEY_BACKSPACE: 'kbs', _curses.KEY_BEG: 'kbeg', ...
gpl-3.0
6,662,235,800,893,317,000
28.307292
72
0.571886
false
shanzhenren/ClusType
src/algorithm.py
1
10630
from collections import defaultdict from operator import itemgetter from math import log, sqrt import random as rn import time from numpy import * # install numpy from scipy import * # install scipy from numpy.linalg import norm import numpy.linalg as npl from scipy.sparse import * import scipy.sparse.linalg as spsl fr...
gpl-3.0
519,239,432,099,082,700
35.037288
113
0.480339
false
hakatashi/youtube-dl
youtube_dl/extractor/dw.py
84
4098
# coding: utf-8 from __future__ import unicode_literals from .common import InfoExtractor from ..utils import ( int_or_none, unified_strdate, ) from ..compat import compat_urlparse class DWIE(InfoExtractor): IE_NAME = 'dw' _VALID_URL = r'https?://(?:www\.)?dw\.com/(?:[^/]+/)+(?:av|e)-(?P<id>\d+)' ...
unlicense
9,007,537,498,143,317,000
36.925926
118
0.543945
false
DataReplyUK/datareplyuk
GenesAssociation/spark-2.0.0-bin-hadoop2.7/python/pyspark/ml/param/shared.py
4
21476
# # 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
-921,698,404,348,573,200
32.04
395
0.646349
false
hsaputra/tensorflow
tensorflow/python/saved_model/saved_model.py
18
1768
# 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
5,516,702,611,543,448,000
33.666667
80
0.730769
false
cacahootie/geophoto
geophoto/oembed.py
1
1254
from json import loads from urlparse import urlparse from flask import current_app as app from flask import request def thumbUrl(thumb): return "https://venturelog.imgix.net/articles/" + thumb + \ "?w=200&h=150&fit=crop&crop=entropy&auto=compress,format" def html(article): return '<div><p>' + articl...
mit
6,269,629,177,092,938,000
28.857143
90
0.557416
false
ArmyOfPirates/openwrt
scripts/cfe-partition-tag.py
27
5514
#!/usr/bin/env python3 """ CFE Partition Tag { u32 part_id; u32 part_size; u16 flags; char part_name[33]; char part_version[21]; u32 part_crc32; } """ import argparse import os import struct PART_NAME_SIZE = 33 PART_VERSION_SIZE = 21 CRC32_INIT = 0xFFFFFFFF CRC32_TABLE = [ 0x00000000, 0x77073096, 0xEE0E612...
gpl-2.0
-3,501,883,105,988,488,700
27.86911
62
0.740479
false
cms-externals/openloops
scons-local/scons-local-2.3.0/SCons/Tool/gettext.py
11
2093
"""gettext tool """ # Copyright (c) 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011, 2012, 2013 The SCons Foundation # # Permission is hereby granted, free of charge, to any person obtaining # a copy of this software and associated documentation files (the # "Software"), to deal in the Software with...
gpl-3.0
-4,392,515,747,525,934,600
42.604167
113
0.627807
false
evancich/apm_min_arm_tone
Tools/scripts/update_wiki.py
275
2870
#!/usr/bin/env python ''' update a wordpress wiki page Andrew Tridgell May 2013 See http://codex.wordpress.org/XML-RPC_WordPress_API/Posts ''' import xmlrpclib, sys from optparse import OptionParser parser = OptionParser("update_wiki.py [options] <file>") parser.add_option("--username", help="Wordpress username", de...
gpl-3.0
-353,299,966,069,906,000
30.538462
105
0.630314
false
psaylor/ORCA
server/node_modules/binaryjs/node_modules/binarypack/node_modules/buffercursor/node_modules/verror/node_modules/extsprintf/deps/javascriptlint/javascriptlint/jsparse.py
21
15686
#!/usr/bin/env python2.6 # vim: ts=4 sw=4 expandtab """ Parses a script into nodes. """ import bisect import re import unittest import spidermonkey from spidermonkey import tok, op from util import JSVersion _tok_names = dict(zip( [getattr(tok, prop) for prop in dir(tok)], ['tok.%s' % prop for prop in dir(tok...
mit
2,599,528,253,149,122,000
35.821596
84
0.56356
false
qsnake/werkzeug
werkzeug/http.py
25
19243
# -*- coding: utf-8 -*- """ werkzeug.http ~~~~~~~~~~~~~ Werkzeug comes with a bunch of utilities that help Werkzeug to deal with HTTP data. Most of the classes and functions provided by this module are used by the wrappers, but they are useful on their own, too, especially if the response and ...
bsd-3-clause
-1,447,516,037,968,773,400
32.292388
84
0.612794
false
tectronics/dojango
dojango/data/__init__.py
12
6298
import re __all__ = ('QueryInfo', 'QueryReadStoreInfo', 'JsonRestStoreInfo', 'JsonQueryRestStoreInfo',) class QueryInfoFeatures(object): sorting = True paging = False class QueryInfo(object): '''Usage (is that the right solution?): info = QueryInfo(request) info.extract() ...
bsd-3-clause
-3,075,858,473,408,269,000
33.60989
103
0.534297
false
inuyasha2012/tornado-cat-example
example/main.py
1
8865
# coding=utf-8 from psycopg2.extras import NamedTupleCursor, Json from tornado.web import Application, HTTPError from tornado import gen from tornado.ioloop import IOLoop from tornado.httpserver import HTTPServer from tornado.options import parse_command_line import momoko import os from bank import SelectQuestion, get...
mit
-2,753,240,585,193,565,000
37.958716
119
0.551748
false
leishiran/shadowsocks-1
setup.py
929
1321
import codecs from setuptools import setup with codecs.open('README.rst', encoding='utf-8') as f: long_description = f.read() setup( name="shadowsocks", version="2.8.2", license='http://www.apache.org/licenses/LICENSE-2.0', description="A fast tunnel proxy that help you get through firewalls", ...
apache-2.0
5,970,453,374,294,558,000
32.871795
74
0.628312
false
metaron-uk/xbmc
lib/libUPnP/Neptune/Extras/Tools/Logging/NeptuneLogConsoleMulticast.py
202
3159
#!/usr/bin/env python from struct import * from socket import * from optparse import OptionParser UDP_ADDR = "0.0.0.0" UDP_MULTICAST_ADDR = "239.255.255.100" UDP_PORT = 7724 BUFFER_SIZE = 65536 #HEADER_KEYS = ['Logger', 'Level', 'Source-File', 'Source-Function', 'Source-Line', 'TimeStamp'] HEADER_KEYS = { 'mini': ...
gpl-2.0
-8,601,427,223,578,224,000
35.732558
165
0.58088
false
MagicSolutions/django-cms
cms/migrations/0001_initial.py
15
30501
# -*- coding: utf-8 -*- import datetime from south.db import db from south.v2 import SchemaMigration from django.db import models try: from django.contrib.auth import get_user_model except ImportError: # django < 1.5 from django.contrib.auth.models import User else: User = get_user_model() user_orm_label...
bsd-3-clause
-2,590,371,388,925,091,300
74.497525
184
0.591817
false