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
Ervii/garage-time
pajamas/src/python/twitter/common/java/java_types.py
16
3364
# ================================================================================================== # Copyright 2011 Twitter, Inc. # -------------------------------------------------------------------------------------------------- # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use thi...
apache-2.0
8,350,146,626,122,375,000
25.912
100
0.593044
false
scorphus/django
django/http/multipartparser.py
332
24331
""" Multi-part parsing for file uploads. Exposes one class, ``MultiPartParser``, which feeds chunks of uploaded data to file upload handlers for processing. """ from __future__ import unicode_literals import base64 import binascii import cgi import sys from django.conf import settings from django.core.exceptions imp...
bsd-3-clause
9,021,312,800,619,488,000
34.833579
115
0.54671
false
yohanko88/gem5-DC
src/mem/ExternalSlave.py
47
2722
# Copyright (c) 2014 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 functionality ...
bsd-3-clause
-4,316,072,244,522,135,600
49.407407
72
0.770757
false
cysuncn/python
crawler/rent/dataAnalyse/ziroomAnalysis.py
1
13803
# -*- coding: utf-8 -*- """ Created on Mon Jul 3 12:16:17 2017 @author: zhanglu01 """ import json import pandas as pd import matplotlib.pyplot as plot import ziroomAnalysis.geohash as geohash def line_json_load(filename): with open(filename, 'r', encoding='utf-8') as f: lines = f.readlines() df =...
gpl-3.0
8,947,725,804,130,120,000
49.169231
281
0.658054
false
larsmans/numpy
numpy/lib/_version.py
156
4867
"""Utility to compare (Numpy) version strings. The NumpyVersion class allows properly comparing numpy version strings. The LooseVersion and StrictVersion classes that distutils provides don't work; they don't recognize anything like alpha/beta/rc/dev versions. """ from __future__ import division, absolute_import, pri...
bsd-3-clause
-938,907,198,040,730,000
30.198718
79
0.542223
false
javaos74/neutron
neutron/agent/linux/daemon.py
25
8046
# Copyright 2012 New Dream Network, LLC (DreamHost) # # 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 a...
apache-2.0
-6,902,880,326,241,736,000
30.307393
78
0.587124
false
alistairlow/tensorflow
tensorflow/python/ops/batch_norm_benchmark.py
76
10818
# 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,299,069,431,636,660,000
40.13308
80
0.622481
false
wisechengyi/pants
contrib/node/src/python/pants/contrib/node/register.py
1
2405
# Copyright 2015 Pants project contributors (see CONTRIBUTORS.md). # Licensed under the Apache License, Version 2.0 (see LICENSE). from pants.build_graph.build_file_aliases import BuildFileAliases from pants.goal.task_registrar import TaskRegistrar as task from pants.contrib.node.subsystems.resolvers.node_preinstalle...
apache-2.0
-6,013,051,004,353,510,000
44.377358
93
0.769647
false
castlest/shell-detection
coherence-elliptical-kernel/main.py
1
7932
''' Author: S.T. Castle Created: 2015-03-15 ''' #import math import numpy as np from scipy import ndimage from scipy import stats import scipy.ndimage.filters import scipy.linalg #import skimage.feature import cv2 from matplotlib import pyplot as plt def main(): ''' Run the explicit coherence enhancing filt...
bsd-3-clause
-3,475,256,884,563,383,300
29.390805
86
0.570852
false
mantiz/ansible-modules-core
system/group.py
22
11974
#!/usr/bin/python # -*- coding: utf-8 -*- # (c) 2012, Stephen Fromm <sfromm@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 Lice...
gpl-3.0
-6,953,487,122,588,984,000
28.712159
105
0.553449
false
pacav69/namebench
nb_third_party/dns/rdtypes/nsbase.py
248
2995
# Copyright (C) 2003-2007, 2009, 2010 Nominum, Inc. # # Permission to use, copy, modify, and distribute this software and its # documentation for any purpose with or without fee is hereby granted, # provided that the above copyright notice and this permission notice # appear in all copies. # # THE SOFTWARE IS PROVIDED ...
apache-2.0
8,030,598,358,509,952,000
35.52439
79
0.674457
false
benedeku/HolaMundo
androguard/core/api_specific_resources/aosp_permissions/aosp_permissions_api22.py
15
109292
#!/usr/bin/python # -*- coding: utf-8 -*- ################################################# ### Extracted from platform version: 5.1.1 ################################################# AOSP_PERMISSIONS = { 'android.permission.REMOTE_AUDIO_PLAYBACK': { 'permissionGroup': 'android.permission-group.SYSTEM_TOO...
apache-2.0
-240,796,728,726,969,900
45.666097
339
0.645903
false
jhutar/spacewalk
backend/server/rhnSQL/sql_lib.py
10
2020
# # Copyright (c) 2008--2016 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
-7,498,323,149,111,601,000
38.607843
77
0.65
false
reedloden/ansible
test/units/template/test_safe_eval.py
205
1956
# (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
-3,776,018,680,366,353,400
37.352941
90
0.700409
false
woggle/mesos-old
third_party/boto-2.0b2/boto/rds/regioninfo.py
44
1466
# 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...
apache-2.0
1,574,689,957,919,910,100
44.8125
74
0.744884
false
tbinjiayou/Odoo
addons/website_quote/controllers/main.py
64
8730
# -*- coding: utf-8 -*- ############################################################################## # # OpenERP, Open Source Management Solution # Copyright (C) 2013-Today OpenERP SA (<http://www.openerp.com>). # # This program is free software: you can redistribute it and/or modify # it under the terms ...
agpl-3.0
-1,246,941,616,504,873,700
50.352941
123
0.61386
false
citrix-openstack-build/python-cinderclient
cinderclient/v2/volume_snapshots.py
2
4489
# Copyright (c) 2013 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 ...
apache-2.0
4,122,782,427,818,010,600
31.294964
79
0.605257
false
yousafsyed/casperjs
bin/Lib/site-packages/pip/_vendor/distlib/util.py
190
51230
# # Copyright (C) 2012-2013 The Python Software Foundation. # See LICENSE.txt and CONTRIBUTORS.txt. # import codecs from collections import deque import contextlib import csv from glob import iglob as std_iglob import io import json import logging import os import py_compile import re import shutil import socket import...
mit
7,711,995,428,896,941,000
31.526984
88
0.5374
false
bhermanmit/openmc
openmc/lattice.py
1
49870
from __future__ import division from abc import ABCMeta from collections import OrderedDict, Iterable from math import sqrt, floor from numbers import Real, Integral from xml.etree import ElementTree as ET from six import add_metaclass, string_types import numpy as np import openmc.checkvalue as cv import openmc @...
mit
-1,257,014,688,468,529,000
33.776848
88
0.531923
false
Dioptas/pymatgen
pymatgen/analysis/diffraction/xrd.py
2
14721
# coding: utf-8 from __future__ import division, unicode_literals """ This module implements an XRD pattern calculator. """ from six.moves import filter from six.moves import map from six.moves import zip __author__ = "Shyue Ping Ong" __copyright__ = "Copyright 2012, The Materials Project" __version__ = "0.1" __mai...
mit
-7,566,398,026,972,946,000
37.236364
80
0.562122
false
mlperf/training_results_v0.7
Google/benchmarks/transformer/implementations/transformer-research-TF-tpu-v4-16/lingvo/core/gpipe.py
3
21822
# Lint as: python2, python3 # Copyright 2019 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 # ...
apache-2.0
5,127,807,589,178,423,000
35.069421
104
0.655806
false
hperala/kontuwikibot
scripts/transferbot.py
1
5140
#!/usr/bin/python # -*- coding: utf-8 -*- """ This script transfers pages from a source wiki to a target wiki. It also copies edit history to a subpage. -tolang: The target site code. -tosite: The target site family. -prefix: Page prefix on the new site. -overwrite: Existing pages...
mit
-4,923,138,518,003,091,000
27.876404
130
0.6393
false
pollen/pyrobus
pyluos/modules/stepper.py
1
6265
from .module import Module, interact from copy import copy import time class Stepper(Module): # target modes _MODE_COMPLIANT = 11 _MODE_POWER = 10 _MODE_ROT_SPEED = 8 _MODE_ROT_POSITION = 7 _MODE_TRANS_SPEED = 6 _MODE_TRANS_POSITION = 5 # report modes _ROTATION_POSITION = 4 _ROT...
mit
-1,966,648,560,035,132,400
34.8
136
0.5917
false
arante/pyloc
microblog/flask/lib/python3.5/site-packages/sqlalchemy/dialects/mssql/pymssql.py
32
3143
# mssql/pymssql.py # Copyright (C) 2005-2017 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 """ .. dialect:: mssql+pymssql :name: pymssql :dbapi: pymssql :connects...
gpl-3.0
-6,690,095,442,713,778,000
31.402062
75
0.593382
false
markpasc/leapfrog
leapfrog/management/commands/fetchnewcontent.py
1
3457
from datetime import datetime, timedelta import logging from optparse import make_option from django.core.management.base import NoArgsCommand, CommandError from sentry.client.base import SentryClient from leapfrog.models import * from leapfrog.poll import facebook from leapfrog.poll import flickr from leapfrog.poll ...
mit
390,493,912,007,743,600
35.776596
133
0.586925
false
jhsenjaliya/incubator-airflow
airflow/hooks/dbapi_hook.py
14
9338
# -*- coding: utf-8 -*- # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software ...
apache-2.0
-2,128,538,227,673,085,400
34.105263
84
0.572071
false
cstipkovic/spidermonkey-research
python/mock-1.0.0/mock.py
12
75204
# mock.py # Test tools for mocking and patching. # Copyright (C) 2007-2012 Michael Foord & the mock team # E-mail: fuzzyman AT voidspace DOT org DOT uk # mock 1.0 # http://www.voidspace.org.uk/python/mock/ # Released subject to the BSD License # Please see http://www.voidspace.org.uk/python/license.shtml # Scripts m...
mpl-2.0
-1,589,103,552,366,199,300
30.920204
86
0.576685
false
dgies/incubator-airflow
tests/plugins_manager.py
10
2500
# -*- coding: utf-8 -*- # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software ...
apache-2.0
1,599,353,087,137,742,300
34.714286
74
0.7068
false
DataONEorg/d1_python
client_onedrive/src/d1_onedrive/impl/object_tree.py
1
7907
#!/usr/bin/env python # This work was created by participants in the DataONE project, and is # jointly copyrighted by participating institutions in DataONE. For # more information on DataONE, see our web site at http://dataone.org. # # Copyright 2009-2019 DataONE # # Licensed under the Apache License, Version 2.0 (t...
apache-2.0
5,663,729,983,710,462,000
35.606481
93
0.642975
false
VitalPet/odoo
addons/hr_attendance/report/timesheet.py
53
6044
# -*- 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
-6,262,463,413,037,306,000
47.352
189
0.537889
false
madphysicist/numpy
numpy/core/umath.py
17
2040
""" Create the numpy.core.umath namespace for backward compatibility. In v1.16 the multiarray and umath c-extension modules were merged into a single _multiarray_umath extension module. So we replicate the old namespace by importing from the extension module. """ from . import _multiarray_umath from ._multiarray_umat...
bsd-3-clause
2,319,660,639,319,883,000
55.666667
79
0.637255
false
dya2/python-for-android
python3-alpha/python3-src/Lib/plat-os2emx/SOCKET.py
134
1804
# Generated by h2py from f:/emx/include/sys/socket.h # Included from sys/types.h FD_SETSIZE = 256 # Included from sys/uio.h FREAD = 1 FWRITE = 2 SOCK_STREAM = 1 SOCK_DGRAM = 2 SOCK_RAW = 3 SOCK_RDM = 4 SOCK_SEQPACKET = 5 SO_DEBUG = 0x0001 SO_ACCEPTCONN = 0x0002 SO_REUSEADDR = 0x0004 SO_KEEPALIVE = 0x0008 SO_DONTROUTE...
apache-2.0
2,652,523,692,577,220,000
16.018868
52
0.690133
false
cosmoharrigan/opencog
opencog/python/utility/evolutionary.py
34
9725
__author__ = 'keyvan' from random import randrange, random as rand def new_offspring(parent): return type(parent)(parent=parent) def new_individual(population): return population.type_of_individuals(population=population) class IndividualBase(object): """ An individual object should be a collection ...
agpl-3.0
8,430,398,277,400,121,000
32.650519
97
0.58838
false
Wafflespeanut/servo
tests/wpt/web-platform-tests/old-tests/webdriver/navigation/auth_tests.py
141
1389
import os import sys import unittest import ConfigParser sys.path.insert(1, os.path.abspath(os.path.join(__file__, "../.."))) import base_test from selenium.common import exceptions from wptserve import server from wptserve.router import any_method from wptserve.handlers import basic_auth_handler class WebDriverAuthT...
mpl-2.0
4,914,874,426,347,779,000
32.071429
91
0.671706
false
bhargav2408/python-for-android
python3-alpha/python3-src/Lib/test/test_unicode.py
46
70367
""" Test script for the Unicode implementation. Written by Marc-Andre Lemburg (mal@lemburg.com). (c) Copyright CNRI, All Rights Reserved. NO WARRANTY. """#" import codecs import struct import sys import unittest import warnings from test import support, string_tests import _string # Error handling (bad decoder retu...
apache-2.0
5,521,352,596,109,696,000
42.800747
119
0.535753
false
riteshshrv/django
django/utils/inspect.py
146
2383
from __future__ import absolute_import import inspect from django.utils import six def getargspec(func): if six.PY2: return inspect.getargspec(func) sig = inspect.signature(func) args = [ p.name for p in sig.parameters.values() if p.kind == inspect.Parameter.POSITIONAL_OR_KEYWOR...
bsd-3-clause
-4,888,022,589,057,534,000
28.7875
89
0.628619
false
omni5cience/django-inlineformfield
.tox/py27/lib/python2.7/site-packages/django/core/serializers/python.py
66
6259
""" A Python "serializer". Doesn't do much serializing per se -- just converts to and from basic Python data types (lists, dicts, strings, etc.). Useful as a basis for other serializers. """ from __future__ import unicode_literals from django.apps import apps from django.conf import settings from django.core.serialize...
mit
-8,639,798,484,450,191,000
38.613924
123
0.577728
false
ganboing/malwarecookbook
8/vmauto.py
2
10452
#!/usr/bin/python # Copyright (C) 2010 Michael Ligh # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation, either version 3 of the License, or # (at your option) any later version. # # This program i...
gpl-3.0
-5,811,620,513,969,238,000
30.768997
76
0.51837
false
beezee/GAE-Django-site
django/utils/tzinfo.py
313
2511
"Implementation of tzinfo classes for use with datetime.datetime." import time from datetime import timedelta, tzinfo from django.utils.encoding import smart_unicode, smart_str, DEFAULT_LOCALE_ENCODING class FixedOffset(tzinfo): "Fixed offset in minutes east from UTC." def __init__(self, offset): if i...
bsd-3-clause
9,048,706,431,704,335,000
31.61039
92
0.560335
false
HybridF5/jacket
jacket/tests/storage/unit/test_infortrend_common.py
1
77414
# Copyright (c) 2015 Infortrend Technology, 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 # # ...
apache-2.0
-3,588,588,623,414,764,500
36.343946
79
0.58461
false
beni55/augmented-traffic-control
tests/vagrant.py
18
1676
# # Copyright (c) 2014, Facebook, Inc. # All rights reserved. # # This source code is licensed under the BSD-style license found in the # LICENSE file in the root directory of this source tree. An additional grant # of patent rights can be found in the PATENTS file in the same directory. # # from subprocess impor...
bsd-3-clause
-3,252,400,537,153,008,600
23.289855
78
0.571599
false
szibis/Diamond
test.py
16
10774
#!/usr/bin/env python # coding=utf-8 ############################################################################### import os import sys import inspect import traceback import optparse import logging import configobj try: # python 2.6 import unittest2 as unittest except ImportError: import unittest try:...
mit
5,983,240,316,757,261,000
32.253086
79
0.515129
false
theshteves/tweet-the-wolf
pips/requests/packages/urllib3/util/retry.py
67
9924
import time import logging from ..exceptions import ( ConnectTimeoutError, MaxRetryError, ProtocolError, ReadTimeoutError, ResponseError, ) from ..packages import six log = logging.getLogger(__name__) class Retry(object): """ Retry configuration. Each retry attempt will create a new Re...
mit
-5,864,905,635,595,292,000
33.821053
104
0.6184
false
40223150/2015cd_0505
static/Brython3.1.1-20150328-091302/Lib/unittest/test/test_functiontestcase.py
791
5478
import unittest from .support import LoggingResult class Test_FunctionTestCase(unittest.TestCase): # "Return the number of tests represented by the this test object. For # TestCase instances, this will always be 1" def test_countTestCases(self): test = unittest.FunctionTestCase(lambda: None) ...
agpl-3.0
7,415,413,454,982,814,000
37.041667
78
0.640197
false
Neural-Network/TicTacToe
pybrain/rl/environments/renderer.py
31
1454
# obsolete - should be deleted if there are no objections. __author__ = 'Thomas Rueckstiess, ruecksti@in.tum.de' from pybrain.utilities import abstractMethod import threading class Renderer(threading.Thread): """ The general interface for a class displays what is happening in an environment. The renderer...
bsd-3-clause
-6,415,988,037,488,247,000
34.463415
103
0.649243
false
kevclarx/ansible
lib/ansible/modules/remote_management/ipmi/ipmi_boot.py
69
6041
#!/usr/bin/python # -*- coding: utf-8 -*- # # 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. ...
gpl-3.0
3,111,394,037,258,476,000
29.664975
124
0.642609
false
xiandiancloud/edx-platform
lms/djangoapps/staticbook/tests.py
30
10797
""" Test the lms/staticbook views. """ import textwrap import mock import requests from django.test.utils import override_settings from django.core.urlresolvers import reverse, NoReverseMatch from courseware.tests.modulestore_config import TEST_DATA_MIXED_MODULESTORE from student.tests.factories import UserFactory,...
agpl-3.0
-1,714,016,926,622,389,000
38.405109
99
0.624247
false
PatidarWeb/poedit
deps/boost/tools/build/test/core_actions_quietly.py
51
1038
#!/usr/bin/python # Copyright 2007 Rene Rivera. # Copyright 2011 Steven Watanabe # Distributed under the Boost Software License, Version 1.0. # (See accompanying file LICENSE_1_0.txt or http://www.boost.org/LICENSE_1_0.txt) import BoostBuild t = BoostBuild.Tester(pass_toolset=0) t.write("file.jam", """\ actions qui...
mit
8,556,046,986,476,709,000
16.016393
81
0.629094
false
arvinddoraiswamy/mywebappscripts
BurpExtensions/third_party_referer_record.py
4
1651
from burp import IBurpExtender from burp import IHttpListener from burp import IProxyListener import re import sys import os urls_in_scope=['testblah.com','qa.ooboob.com'] #Adding directory to the path where Python searches for modules module_folder = os.path.dirname('/home/arvind/Documents/Me/My_Projects/Git/WebAppse...
mit
-3,157,165,895,975,647,700
37.395349
115
0.7553
false
chvrga/outdoor-explorer
java/play-1.4.4/python/Lib/multiprocessing/forking.py
3
14804
# # Module for starting a process object using os.fork() or CreateProcess() # # multiprocessing/forking.py # # Copyright (c) 2006-2008, R Oudkerk --- see COPYING.txt # import os import sys import signal from multiprocessing import util, process __all__ = ['Popen', 'assert_spawning', 'exit', 'duplicate'...
mit
4,554,600,541,349,377,500
29.298097
86
0.527695
false
Diwaniya-Labs/django-rest-forum
discussion/serializers.py
1
1857
# -*- coding: utf-8 -*- from __future__ import unicode_literals import logging from rest_framework import serializers from models import Category, Post, Announcement # initiate logger logging.getLogger(__name__) class CategorySerializer(serializers.HyperlinkedModelSerializer): """ CategorySerializer "...
lgpl-3.0
1,007,860,584,481,104,500
24.452055
92
0.642973
false
xavfernandez/packaging
packaging/__about__.py
1
1078
# Copyright 2014 Donald Stufft # # 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, so...
apache-2.0
-1,691,703,856,832,753,700
33.774194
74
0.680891
false
mpatacchiola/naogui
zpgc_2016b/include/pynaoqi-python2.7-2.1.3.3-linux64/qi/test/test_async.py
4
1534
#! /usr/bin/python2 import qi def add(a, b): return a + b def fail(): assert(False) def err(): raise RuntimeError("sdsd") def test_async_fun(): f = qi.async(add, 21, 21) assert(f.value() == 42) def test_async_error(): f = qi.async(err) assert(f.hasError() == True) assert(f.error(...
mit
509,612,197,251,668,740
17.481928
55
0.563885
false
inveniosoftware/es-jsonschema
setup.py
2
4456
# -*- coding: utf-8 -*- # # This file is part of DoMapping. # Copyright (C) 2015, 2016, 2017 CERN. # # DoMapping 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 o...
gpl-2.0
-2,923,128,059,409,224,700
28.509934
76
0.631059
false
seewindcn/tortoisehg
src/tortoisehg/hgqt/cmdcore.py
1
30355
# cmdcore.py - run Mercurial commands in a separate thread or process # # Copyright 2010 Yuki KODAMA <endflow.net@gmail.com> # # This software may be used and distributed according to the terms of the # GNU General Public License version 2, incorporated herein by reference. import os, signal, struct, sys, time from P...
gpl-2.0
5,279,366,517,448,379,000
34.586166
80
0.613902
false
nhuntwalker/astroML
examples/datasets/plot_sdss_galaxy_colors.py
3
1300
""" SDSS Galaxy Colors ------------------ The function :func:`fetch_sdss_galaxy_colors` used below actually queries the SDSS CASjobs server for the colors of the 50,000 galaxies. Below we extract the :math:`u - g` and :math:`g - r` colors for 5000 stars, and scatter-plot the results """ # Author: Jake VanderPlas <vand...
bsd-2-clause
9,176,028,315,602,242,000
26.083333
73
0.613846
false
xiaom/zenodo
zenodo/modules/deposit/views.py
1
13106
# -*- coding: utf-8 -*- # # This file is part of Zenodo. # Copyright (C) 2016, 2017 CERN. # # Zenodo 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 l...
gpl-2.0
2,436,981,744,659,328,000
31.60199
79
0.626507
false
TalShafir/ansible
lib/ansible/modules/storage/netapp/na_ontap_cluster_ha.py
9
4439
#!/usr/bin/python # (c) 2018, 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,991,673,485,521,594,400
32.37594
101
0.60802
false
BhallaLab/moose-thalamocortical
gui/glcellloader.py
2
3616
# glcellloader.py --- # # Filename: loadcell.py # Description: # Author: Subhasis Ray # Maintainer: # Created: Thu Feb 4 20:34:34 2010 (+0530) # Version: # Last-Updated: Sat Jun 26 15:50:44 2010 (+0530) # By: Subhasis Ray # Update #: 107 # URL: # Keywords: # Compatibility: # # # Commentary: #...
lgpl-2.1
-2,762,349,288,564,038,700
26.603053
93
0.662334
false
cjcjameson/gpdb
src/test/tinc/tincrepo/mpp/gpdb/tests/storage/walrepl/crash/test_failover_recovery_mode.py
7
8700
""" Copyright (c) 2004-Present Pivotal Software, Inc. This program and the accompanying materials are made available under the terms of the 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....
apache-2.0
-946,853,281,864,539,400
46.540984
162
0.705747
false
trolldbois/python-haystack-reverse
test/haystack/reverse/test_re_string.py
1
8993
#!/usr/bin/env python # -*- coding: utf-8 -*- """Tests for haystack.reverse.structure.""" from __future__ import print_function import logging import unittest from haystack.reverse import re_string __author__ = "Loic Jaquemet" __copyright__ = "Copyright (C) 2012 Loic Jaquemet" __license__ = "GPL" __maintainer__ = "...
gpl-3.0
1,890,807,046,266,380,000
42.444444
663
0.621706
false
bitforks/robofab
Lib/robofab/tools/remote.py
10
4500
"""Remote control for MacOS FontLab. initFontLabRemote() registers a callback for appleevents and runFontLabRemote() sends the code from a different application, such as a Mac Python IDE or Python interpreter. """ from robofab.world import world if world.inFontLab and world.mac is not None: from Carbon import AE as ...
bsd-3-clause
5,489,660,968,046,802,000
24.72
93
0.719111
false
bcl/pykickstart
pykickstart/commands/unsupported_hardware.py
2
2002
# # Brian C. Lane <bcl@redhat.com> # # Copyright 2012 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. This program is distributed in the hope that it # will be useful,...
gpl-2.0
-7,143,314,107,902,704,000
40.708333
149
0.732767
false
saullocastro/pyNastran
pyNastran/utils/atmosphere2.py
1
25930
""" Contains the following atmospheric functions: - density = atm_density(alt, mach) - mach = atm_mach(alt, velocity) - velocity = atm_velocity(alt, mach) - pressure = atm_pressure(alt) - temperature = atm_temperature(alt) - sos = atm_speed_of_sound(alt) - mu = atm_dynamic_viscosity_mu(alt) - nu = atm_kinemati...
lgpl-3.0
-2,162,192,701,255,446,500
28.036954
97
0.510644
false
iabdalkader/micropython
tools/autobuild/remove_old_firmware.py
4
2047
#!/usr/bin/env python3 import re, subprocess, sys DEBUG = False DRY_RUN = False NUM_KEEP_PER_BOARD = 4 def main(): ssh_machine = sys.argv[1] ssh_firmware_dir = sys.argv[2] # SSH to get list of existing files. p = subprocess.run( ["ssh", ssh_machine, "find", ssh_firmware_dir, "-name", "\\*-...
mit
-4,163,122,365,741,004,000
27.430556
90
0.527601
false
popazerty/obh-gui
lib/python/Components/Sources/FrontendInfo.py
130
2058
from enigma import iPlayableService from Source import Source from Components.PerServiceDisplay import PerServiceBase from enigma import eDVBResourceManager class FrontendInfo(Source, PerServiceBase): def __init__(self, service_source = None, frontend_source = None, navcore = None): self.navcore = None Source.__i...
gpl-2.0
-3,967,158,451,127,864,000
29.716418
83
0.737123
false
yhteentoimivuuspalvelut/ckanext-ytp-request
ckanext/ytp/request/model.py
1
1860
import uuid import datetime from sqlalchemy import Column, MetaData, ForeignKey from sqlalchemy import types from sqlalchemy.ext.declarative import declarative_base from ckan.lib.base import model log = __import__('logging').getLogger(__name__) Base = declarative_base() metadata = MetaData() """CANCEL state is equi...
agpl-3.0
114,957,272,706,660,060
32.818182
123
0.731183
false
autosportlabs/RaceCapture_App
test/autosportlabs/racecapture/config/test_rcpconfig.py
1
2389
import unittest import json from autosportlabs.racecapture.config.rcpconfig import CANChannels, CANChannel, CANMapping CAN_CHANNEL_1 = '{"nm":"CHAN1", "ut": "UNITS1", "min":-55, "max":55,"prec":2,"sr":25, "bm": false, "type":0, "bus":0, "id":1234, "idMask":0, "offset":23, "len":19, "subId":-1, "mult":1.23, "div":3.45,...
gpl-3.0
131,497,603,579,101,090
57.268293
242
0.660109
false
mormegil-cz/gnubg
scripts/matchseries.py
1
4437
# # matchseries.py # # Martin Janke <lists@janke.net>, 2004 # Achim Mueller <ace@gnubg.org>, 2004 # Joern Thyssen <jth@gnubg.org>, 2004 # # This program is free software; you can redistribute it and/or modify # it under the terms of version 3 or later of the GNU General Public License as # published by the Free Softwar...
gpl-3.0
1,085,751,724,382,163,500
29.183673
79
0.595898
false
stumoodie/PathwayEditor
libs/antlr-3.4/runtime/Python/antlr3/tree.py
19
81569
""" @package antlr3.tree @brief ANTLR3 runtime package, tree module This module contains all support classes for AST construction and tree parsers. """ # begin[licence] # # [The "BSD licence"] # Copyright (c) 2005-2008 Terence Parr # All rights reserved. # # Redistribution and use in source and binary forms, with or...
apache-2.0
-6,973,759,712,010,267,000
27.691171
98
0.590972
false
danielcbit/vdt
src/flow-monitor/bindings/modulegen__gcc_LP64.py
4
368610
from pybindgen import Module, FileCodeSink, param, retval, cppclass, typehandlers import pybindgen.settings import warnings class ErrorHandler(pybindgen.settings.ErrorHandler): def handle_error(self, wrapper, exception, traceback_): warnings.warn("exception %r in wrapper %s" % (exception, wrapper)) ...
gpl-2.0
6,720,483,516,833,697,000
64.542319
934
0.610415
false
shanemikel/beets
beets/autotag/__init__.py
22
5255
# This file is part of beets. # Copyright 2015, Adrian Sampson. # # 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, ...
mit
-2,119,564,025,558,684,400
35.748252
79
0.604757
false
AdaptiveApplications/carnegie
tarc_bus_locator_client/numpy-1.8.1/numpy/core/tests/test_deprecations.py
10
12074
""" Tests related to deprecation warnings. Also a convenient place to document how deprecations should eventually be turned into errors. """ from __future__ import division, absolute_import, print_function import sys import operator import warnings from nose.plugins.skip import SkipTest import numpy as np from numpy...
mit
3,396,622,765,224,489,000
40.349315
88
0.614709
false
ejona86/grpc
bazel/test/python_test_repo/namespaced/upper/example/no_import_strip_test.py
10
1200
# Copyright 2020 the gRPC authors. # # 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 wri...
apache-2.0
1,718,546,913,805,981,200
33.285714
74
0.721667
false
spring-week-topos/nova-week
nova/tests/cells/test_cells_manager.py
9
37769
# Copyright (c) 2012 Rackspace Hosting # 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 req...
apache-2.0
8,284,733,239,838,965,000
45.628395
79
0.571262
false
eternalthinker/flask-server-rq-example
venv/lib/python2.7/site-packages/pip/_vendor/cachecontrol/caches/file_cache.py
87
2715
import hashlib import os from pip._vendor.lockfile import FileLock from ..cache import BaseCache def _secure_open_write(filename, fmode): # We only want to write to this file, so open it in write only mode flags = os.O_WRONLY # os.O_CREAT | os.O_EXCL will fail if the file already exists, so we only ...
apache-2.0
-5,781,336,057,983,727,000
28.835165
79
0.610313
false
kadircet/CENG
783/HW2/cs231n/gradient_check.py
1
3423
import numpy as np from random import randrange def eval_numerical_gradient(f, x, verbose=False, h=0.00001): """ a naive implementation of numerical gradient of f at x - f should be a function that takes a single argument - x is the point (numpy array) to evaluate the gradient at """ fx = f(x) # evalua...
gpl-3.0
1,622,936,011,128,171,000
27.764706
103
0.625475
false
rahushen/ansible
lib/ansible/modules/cloud/amazon/ec2_vpc_nat_gateway_facts.py
23
4647
#!/usr/bin/python # Copyright: Ansible Project # 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
6,257,304,758,791,408,000
29.175325
141
0.674414
false
linked67/p2pool-cannabiscoin
p2pool/util/memoize.py
281
1737
import itertools class LRUDict(object): def __init__(self, n): self.n = n self.inner = {} self.counter = itertools.count() def get(self, key, default=None): if key in self.inner: x, value = self.inner[key] self.inner[key] = self.counter.next(), value ...
gpl-3.0
9,061,743,024,023,048,000
24.925373
75
0.52274
false
jmesteve/saas3
openerp/addons/procurement/wizard/schedulers_all.py
3
2883
# -*- 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
-3,731,652,838,594,725,000
40.782609
244
0.628512
false
alajara/servo
tests/wpt/web-platform-tests/old-tests/webdriver/modal/alerts_test.py
141
6347
import os import sys import unittest sys.path.insert(1, os.path.abspath(os.path.join(__file__, "../.."))) import base_test from selenium.common import exceptions from selenium.webdriver.support import wait class AlertsTest(base_test.WebDriverBaseTest): def setUp(self): self.wait = wait.WebDriverWait(self....
mpl-2.0
4,453,838,091,665,188,000
41.885135
113
0.652277
false
iulian787/spack
var/spack/repos/builtin/packages/pangomm/package.py
5
2457
# Copyright 2013-2020 Lawrence Livermore National Security, LLC and other # Spack Project Developers. See the top-level COPYRIGHT file for details. # # SPDX-License-Identifier: (Apache-2.0 OR MIT) from spack import * class Pangomm(AutotoolsPackage): """Pangomm is a C++ interface to Pango.""" homepage = "htt...
lgpl-2.1
4,309,856,843,038,819,000
58.926829
96
0.774522
false
icebreaker/dotfiles
gnome/gnome2/gedit/plugins.symlink/rails_extract_partial.py
1
5285
# -*- coding: utf8 -*- # vim: ts=4 nowrap expandtab textwidth=80 # Rails Extract Partial Plugin # Copyright © 2008 Alexandre da Silva / Carlos Antonio da Silva # # This file is part of Gmate. # # See LICENTE.TXT for licence information import gedit import gtk import gnomevfs import os.path class ExtractPartialPlugin(...
mit
2,217,527,663,597,545,200
39.96124
102
0.541635
false
Donkyhotay/MoonPy
zope/tal/talgenerator.py
1
33082
############################################################################## # # Copyright (c) 2001, 2002 Zope Corporation and Contributors. # All Rights Reserved. # # This software is subject to the provisions of the Zope Public License, # Version 2.1 (ZPL). A copy of the ZPL should accompany this distribution. # T...
gpl-3.0
7,624,557,642,647,283,000
37.647196
78
0.532011
false
tarikgwa/nfd
newfies/apirest/queue_serializers.py
1
3182
# -*- coding: utf-8 -*- # # Newfies-Dialer License # http://www.newfies-dialer.org # # 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/. # # Copyright (C) 2011-2014 Star2Bil...
mpl-2.0
-1,203,077,438,379,998,200
32.851064
179
0.512256
false
kkdd/arangodb
3rdParty/V8-4.3.61/third_party/python_26/Lib/popen2.py
304
8416
"""Spawn a command with pipes to its stdin, stdout, and optionally stderr. The normal os.popen(cmd, mode) call spawns a shell command and provides a file interface to just the input or output of the process depending on whether mode is 'r' or 'w'. This module provides the functions popen2(cmd) and popen3(cmd) which r...
apache-2.0
2,173,791,982,428,935,200
40.870647
80
0.600523
false
hugobowne/playing_with_twitter
sql_test.py
1
3384
# -*- coding: utf-8 -*- """ Created on Fri Nov 6 16:52:06 2015 @author: hugobowne-anderson """ #http://zetcode.com/db/sqlitepythontutorial/ import sqlite3 as lite import sys import json import unicodedata ###########MAKE LIST OF TWEETS:################ ##set deirectory here: tweets_data_path = '/Users/hugobowne-a...
gpl-2.0
3,515,991,253,576,091,000
23.882353
122
0.606087
false
kehao95/Wechat_LearnHelper
src/env/lib/python3.5/site-packages/setuptools/command/install_egg_info.py
423
4001
from distutils import log, dir_util import os from setuptools import Command from setuptools.archive_util import unpack_archive import pkg_resources class install_egg_info(Command): """Install an .egg-info directory for the package""" description = "Install an .egg-info directory for the package" user_...
gpl-3.0
-3,933,340,830,873,861,000
33.491379
78
0.564109
false
Jet-Streaming/framework
deps/googletest/googlemock/scripts/generator/cpp/gmock_class_test.py
395
11356
#!/usr/bin/env python # # Copyright 2009 Neal Norwitz All Rights Reserved. # Portions Copyright 2009 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 # # ...
mpl-2.0
1,054,858,551,118,140,400
24.348214
78
0.669866
false
cschnei3/forseti-security
google/cloud/security/common/gcp_type/instance_template.py
1
2890
# Copyright 2017 Google Inc. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, s...
apache-2.0
7,970,875,797,921,052,000
25.513761
74
0.590657
false
pkainz/pylearn2
pylearn2/sandbox/cuda_convnet/tests/test_weight_acts_strided.py
44
6942
from __future__ import print_function __authors__ = "Heng Luo" from pylearn2.testing.skip import skip_if_no_gpu skip_if_no_gpu() import numpy as np from theano.compat.six.moves import xrange from theano import shared from theano.tensor import grad, constant from pylearn2.sandbox.cuda_convnet.filter_acts import Filte...
bsd-3-clause
-2,609,343,402,291,728,400
44.372549
125
0.52881
false
ArneBab/pypyjs
website/demo/home/rfk/repos/pypy/lib-python/2.7/codeop.py
306
5999
r"""Utilities to compile possibly incomplete Python source code. This module provides two interfaces, broadly similar to the builtin function compile(), which take program text, a filename and a 'mode' and: - Return code object if the command is complete and valid - Return None if the command is incomplete - Raise Sy...
mit
1,598,128,228,509,328,600
34.708333
76
0.686781
false
Distrotech/intellij-community
python/helpers/profiler/thrift/protocol/TBase.py
208
2637
# # 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
-7,867,977,959,424,157,000
31.555556
75
0.664391
false
jeremiahyan/odoo
addons/hw_drivers/interface.py
2
3092
# -*- coding: utf-8 -*- # Part of Odoo. See LICENSE file for full copyright and licensing details. import logging from threading import Thread import time from odoo.addons.hw_drivers.main import drivers, interfaces, iot_devices _logger = logging.getLogger(__name__) class InterfaceMetaClass(type): def __new__(c...
gpl-3.0
1,864,465,946,710,547,700
43.171429
136
0.629043
false
markeTIC/OCB
addons/l10n_hr/__openerp__.py
430
2728
# -*- encoding: utf-8 -*- ############################################################################## # # OpenERP, Open Source Management Solution # Module: l10n_hr # Author: Goran Kliska # mail: goran.kliska(AT)slobodni-programi.hr # Copyright: Slobodni programi d.o.o., Zagreb # Contributions: #...
agpl-3.0
3,005,991,445,651,609,000
32.9875
80
0.613829
false
smutt/dpkt
dpkt/arp.py
3
1143
# $Id: arp.py 23 2006-11-08 15:45:33Z dugsong $ # -*- coding: utf-8 -*- """Address Resolution Protocol.""" from __future__ import absolute_import from . import dpkt # Hardware address format ARP_HRD_ETH = 0x0001 # ethernet hardware ARP_HRD_IEEE802 = 0x0006 # IEEE 802 hardware # Protocol address format ARP_PRO_IP =...
bsd-3-clause
179,643,461,044,020,160
26.214286
61
0.587052
false
YangSongzhou/django
django/forms/forms.py
27
19335
""" Form classes """ from __future__ import unicode_literals import copy from collections import OrderedDict from django.core.exceptions import NON_FIELD_ERRORS, ValidationError from django.forms.fields import Field, FileField # pretty_name is imported for backwards compatibility in Django 1.9 from django.forms.util...
bsd-3-clause
-1,412,304,935,638,184,700
39.114108
113
0.568451
false
adoosii/edx-platform
lms/djangoapps/instructor/tests/views/test_instructor_dashboard.py
37
11133
""" Unit tests for instructor_dashboard.py. """ import ddt from mock import patch from django.conf import settings from django.core.urlresolvers import reverse from django.test.client import RequestFactory from django.test.utils import override_settings from courseware.tabs import get_course_tab_list from courseware....
agpl-3.0
-6,971,935,308,173,646,000
42.830709
116
0.660289
false
consulo/consulo-mercurial
src/test/resources/bin/mercurial/templatekw.py
92
13228
# templatekw.py - common changeset template keywords # # Copyright 2005-2009 Matt Mackall <mpm@selenic.com> # # This software may be used and distributed according to the terms of the # GNU General Public License version 2 or any later version. from node import hex import patch, util, error import hbisect # This help...
apache-2.0
-6,425,674,166,305,016,000
32.40404
80
0.612035
false
ppanczyk/ansible
lib/ansible/plugins/callback/log_plays.py
23
3178
# (C) 2012, Michael DeHaan, <michael.dehaan@gmail.com> # (c) 2017 Ansible Project # 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 DOCUMENTATION = ''' callback: log_plays type: n...
gpl-3.0
-190,734,733,666,752,770
32.808511
105
0.642228
false