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
eventql/eventql
deps/3rdparty/spidermonkey/mozjs/python/pyasn1/test/codec/cer/test_decoder.py
51
1126
from pyasn1.type import univ from pyasn1.codec.cer import decoder from pyasn1.compat.octets import ints2octs, str2octs, null from pyasn1.error import PyAsn1Error from sys import version_info if version_info[0:2] < (2, 7) or \ version_info[0:2] in ( (3, 0), (3, 1) ): try: import unittest2 as unittest ...
agpl-3.0
-3,430,036,311,243,917,300
35.322581
101
0.619005
false
wweiradio/django
tests/many_to_one_null/tests.py
142
6484
from __future__ import unicode_literals from django.test import TestCase from .models import Article, Car, Driver, Reporter class ManyToOneNullTests(TestCase): def setUp(self): # Create a Reporter. self.r = Reporter(name='John Smith') self.r.save() # Create an Article. se...
bsd-3-clause
8,762,076,632,573,437,000
45.314286
96
0.607033
false
JonasThomas/free-cad
src/Mod/Cam/InitGui.py
1
2807
# Cam gui init module # (c) 2003 Juergen Riegel # # Gathering all the information to start FreeCAD # This is the second one of three init scripts, the third one # runs when the gui is up #*************************************************************************** #* (c) Juergen Riegel (juergen.riegel@web.d...
lgpl-2.1
2,344,667,046,316,897,000
38.1
77
0.408621
false
easyfmxu/zulip
zerver/templatetags/app_filters.py
125
1391
from django.template import Library register = Library() def and_n_others(values, limit): # A helper for the commonly appended "and N other(s)" string, with # the appropriate pluralization. return " and %d other%s" % (len(values) - limit, "" if len(values) == limit + 1 else...
apache-2.0
4,221,161,055,198,376,400
35.605263
75
0.607477
false
hughperkins/kgsgo-dataset-preprocessor
thirdparty/future/src/libpasteurize/fixes/fix_unpacking.py
60
5954
u""" Fixer for: (a,)* *b (,c)* [,] = s for (a,)* *b (,c)* [,] in d: ... """ from lib2to3 import fixer_base from itertools import count from lib2to3.fixer_util import (Assign, Comma, Call, Newline, Name, Number, token, syms, Node, Leaf) from libfuturize.fixer_util import indentation, sui...
mpl-2.0
-6,180,410,996,486,944,000
48.616667
370
0.589016
false
bluemonk482/tdparse
src/sklearnSVM.py
1
3651
import os, time from argparse import ArgumentParser import numpy as np from sklearn import svm, metrics from sklearn.model_selection import GridSearchCV from sklearn.model_selection import ShuffleSplit, GroupKFold from sklearn.datasets import load_svmlight_file from sklearn.externals import joblib from utilities import...
mit
7,369,335,634,591,469,000
33.45283
155
0.674062
false
dpgoetz/sos
setup.py
1
1592
#!/usr/bin/python # Copyright (c) 2010-2011 OpenStack, LLC. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable...
apache-2.0
8,222,653,511,160,833,000
29.615385
69
0.650754
false
Andrew-McNab-UK/DIRAC
tests/Integration/DataManagementSystem/Test_Client_FTS.py
2
8332
""" This is a test of the chain FTSClient -> FTSManagerHandler -> FTSDB It supposes that the DB is present, and that the service is running """ from DIRAC.Core.Base.Script import parseCommandLine parseCommandLine() import unittest #import mock import uuid from DIRAC import gLogger from DIRAC.DataManagementS...
gpl-3.0
-3,193,231,821,281,611,000
35.704846
148
0.572252
false
dcroc16/skunk_works
google_appengine/lib/PyAMF-0.6.1/pyamf/remoting/gateway/wsgi.py
39
6037
# Copyright (c) The PyAMF Project. # See LICENSE.txt for details. """ WSGI server implementation. The Python Web Server Gateway Interface (WSGI) is a simple and universal interface between web servers and web applications or frameworks. The WSGI interface has two sides: the "server" or "gateway" side, and the "appli...
mit
1,187,094,304,863,197,400
32.17033
79
0.579593
false
jfozard/pyvol
pyvol/renderer.py
1
24178
import sys import os.path import numpy as np import numpy.linalg as la import math import warnings # Suppress UserWarning from external.transform module warnings.filterwarnings("ignore", module="external.transform", lineno=1833) from mesh.GLmesh import GLMesh import OpenGL.GL from OpenGL.GL import ( GL_ELEME...
mit
-577,476,755,980,050,200
31.151596
87
0.569609
false
suyashphadtare/vestasi-update-erp
erpnext/stock/doctype/material_request/material_request.py
4
12308
# Copyright (c) 2013, Web Notes Technologies Pvt. Ltd. and Contributors # License: GNU General Public License v3. See license.txt # ERPNext - web based ERP (http://erpnext.com) # For license information, please see license.txt from __future__ import unicode_literals import frappe from frappe.utils import cstr, flt f...
agpl-3.0
2,191,341,463,678,461,000
33.188889
158
0.66729
false
40223117cda/2015cd_midterm
static/Brython3.1.1-20150328-091302/Lib/queue.py
818
8835
'''A multi-producer, multi-consumer queue.''' try: import threading except ImportError: import dummy_threading as threading from collections import deque from heapq import heappush, heappop try: from time import monotonic as time except ImportError: from time import time __all__ = ['Empty', 'Full', 'Q...
gpl-3.0
4,280,309,459,507,811,000
34.481928
85
0.599321
false
sho-h/ruby_env
devkit/mingw/bin/lib/encodings/utf_16.py
88
4110
""" Python 'utf-16' Codec Written by Marc-Andre Lemburg (mal@lemburg.com). (c) Copyright CNRI, All Rights Reserved. NO WARRANTY. """ import codecs, sys ### Codec APIs encode = codecs.utf_16_encode def decode(input, errors='strict'): return codecs.utf_16_decode(input, errors, True) class Inc...
mit
4,545,860,734,510,700,500
30.619048
75
0.581265
false
kmike/splash
splash/lua_runner.py
3
5259
# -*- coding: utf-8 -*- from __future__ import absolute_import import abc import lupa from splash.render_options import BadOption from splash.utils import truncated class ImmediateResult(object): def __init__(self, value): self.value = value class AsyncCommand(object): def __init__(self, id, name,...
bsd-3-clause
-6,242,566,095,930,611,000
32.28481
115
0.548013
false
tylertian/Openstack
openstack F/swift/swift/container/updater.py
4
12579
# Copyright (c) 2010-2012 OpenStack, LLC. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to ...
apache-2.0
-8,583,025,766,540,934,000
42.078767
79
0.541935
false
xisisu/RT-Xen
tools/python/xen/xm/cpupool-new.py
41
1702
#============================================================================ # This library is free software; you can redistribute it and/or # modify it under the terms of version 2.1 of the GNU Lesser General Public # License as published by the Free Software Foundation. # # This library is distributed in the hope th...
gpl-2.0
-7,374,985,193,355,048,000
33.04
77
0.60282
false
wandec/grr
config/client.py
2
10674
#!/usr/bin/env python """Configuration parameters for the client.""" from grr.lib import config_lib from grr.lib import rdfvalue # General Client options. config_lib.DEFINE_string("Client.name", "GRR", "The name of the client. This will be used as a base " "name to g...
apache-2.0
7,666,648,529,987,863,000
40.053846
80
0.619262
false
obsrvbl/ona
src/scripts/ona_service/pna_pusher.py
1
1769
# Copyright 2015 Observable Networks # # 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 ...
apache-2.0
-5,677,314,385,284,161,000
27.532258
75
0.661391
false
kristofvanmoffaert/python-omniture
build/lib/tests/testElement.py
3
1771
#!/usr/bin/python import unittest import omniture import os creds = {} creds['username'] = os.environ['OMNITURE_USERNAME'] creds['secret'] = os.environ['OMNITURE_SECRET'] class ElementTest(unittest.TestCase): def setUp(self): fake_list = [{"id":"123","title":"ABC"},{"id":"456","title":"DEF"}] sel...
mit
2,350,486,807,576,203,300
38.355556
81
0.501412
false
rohangoel96/IRCLogParser
IRCLogParser/lib/analysis/user.py
1
18354
import networkx as nx import re import sys from sklearn.feature_extraction.text import CountVectorizer from sklearn.feature_extraction import text from nltk.stem.wordnet import WordNetLemmatizer import numpy as np from sklearn.feature_extraction.text import TfidfVectorizer from sklearn.cluster import KMeans, MiniBatch...
mit
2,470,174,523,778,096,000
42.392435
210
0.553503
false
m2ci-msp/ematoblender
ematoblender/scripts/ema_io/ema_gameserver/ActionBuilder.py
3
1073
__author__ = "Alexander Hewer" __email__ = "hewer@coli.uni-saarland.de" class ActionBuilder: def build_fit_action(self, coilPositions, timeStamp): action = self.__base_action("FIT") action["points"] = coilPositions action["timeStamp"] = timeStamp return action def build_fix_s...
gpl-3.0
-6,492,021,671,536,420,000
25.825
74
0.628145
false
gingerswede/ITSecCardGame
src/View/Card.py
1
2437
''' IDE: Eclipse (PyDev) Python version: 2.7 Operating system: Windows 8.1 @author: Emil Carlsson @copyright: 2015 Emil Carlsson @license: This program is distributed under the terms of the GNU General Public License ''' import Model import Tkinter as tk from Tkconstants import LEFT from PIL import ImageTk from tkFo...
gpl-3.0
7,467,827,042,233,359,000
32.861111
123
0.606894
false
taknevski/tensorflow-xsmm
tensorflow/contrib/learn/python/learn/estimators/test_data.py
122
1988
# 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
621,317,330,921,410,800
34.5
80
0.690141
false
elkingtonmcb/h2o-2
py/testdir_ec2/test_rf_airlines.py
9
2702
import unittest, time, sys sys.path.extend(['.','..','../..','py']) import h2o, h2o_cmd, h2o_rf # RF train parameters paramsTrainRF = { 'ntree' : 50, 'depth' : 30, 'bin_limit' : 10000, 'ignore' : 'AirTime,ArrDelay,DepDelay,CarrierDelay,IsArrDelayed', ...
apache-2.0
8,885,958,220,231,252,000
29.704545
89
0.556625
false
emkailu/PAT3DEM
bin/p3movierun.py
1
3600
#!/usr/bin/env python import os import sys import argparse import time def main(): progname = os.path.basename(sys.argv[0]) usage = progname + """ [options] <f.txt> Run p3movie.py to process movies listed in f.txt, and the movies will be deleted to save space. """ args_def = {'apix':1.25, 'voltage':200, 'time'...
mit
-2,781,681,698,169,035,000
47.648649
322
0.653056
false
yceruto/django
django/db/migrations/autodetector.py
1
21219
import importlib import os import re import sys from django.db.migrations import operations from django.db.migrations.migration import Migration from django.db.models.loading import cache from django.utils import datetime_safe from django.utils.six.moves import input class MigrationAutodetector(object): """ ...
bsd-3-clause
657,672,002,988,850,600
44.730603
170
0.550356
false
pprett/statsmodels
statsmodels/stats/outliers_influence.py
1
27029
# -*- coding: utf-8 -*- """Influence and Outlier Measures Created on Sun Jan 29 11:16:09 2012 Author: Josef Perktold License: BSD-3 """ from collections import defaultdict import numpy as np from statsmodels.regression.linear_model import OLS from statsmodels.tools.decorators import cache_readonly #influence meas...
bsd-3-clause
-5,080,154,501,048,780,000
33.041562
242
0.601835
false
caseyrollins/osf.io
osf/migrations/0095_reset_osf_abstractprovider_licenses_acceptable_id_seq.py
16
1189
# -*- coding: utf-8 -*- # Generated by Django 1.11.9 on 2018-04-12 20:31 from __future__ import unicode_literals from django.db import migrations class Migration(migrations.Migration): dependencies = [ ('osf', '0094_update_preprintprovider_group_auth'), ] operations = [ migrations.RunSQ...
apache-2.0
8,766,156,285,564,077,000
35.030303
126
0.579479
false
lyft/incubator-airflow
airflow/operators/s3_to_redshift_operator.py
4
1190
# # 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...
apache-2.0
566,231,369,469,570,600
41.5
101
0.77395
false
billzorn/mtgencode
lib/cardlib.py
1
41779
# card representation import re import random import utils import transforms from manalib import Manacost, Manatext # Some text prettification stuff that people may not have installed try: from titlecase import titlecase except ImportError: def titlecase(s): return s.title() try: import textwrap ...
mit
-8,405,779,195,405,917,000
39.018199
209
0.523756
false
ikcalB/linuxcnc-mirror
src/hal/user_comps/pyvcp.py
32
3152
#!/usr/bin/env python # This is a component of emc # Copyright 2007 Anders Wallin <anders.wallin@helsinki.fi> # # # 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 versio...
lgpl-2.1
-893,724,590,608,229,100
30.838384
96
0.662437
false
bq/web2board
res/common/Scons/sconsFiles/SCons/Tool/GettextCommon.py
6
17292
"""SCons.Tool.GettextCommon module Used by several tools of `gettext` toolset. """ # Copyright (c) 2001 - 2015 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 withou...
lgpl-3.0
6,808,596,503,597,528,000
40.869249
112
0.587497
false
wimnat/ansible-modules-extras
system/ohai.py
77
1693
#!/usr/bin/python # -*- coding: utf-8 -*- # (c) 2012, Michael DeHaan <michael.dehaan@gmail.com> # # This file is part of Ansible # # Ansible is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation, either version 3 of...
gpl-3.0
-198,532,495,615,928,540
29.232143
79
0.697578
false
jaruba/chromium.src
tools/perf/page_sets/mse_cases.py
9
2010
# 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. from telemetry.page import page as page_module from telemetry.page import page_set as page_set_module class MseCasesPage(page_module.Page): def __init__(...
bsd-3-clause
88,337,884,751,347,600
41.765957
104
0.718408
false
rcomer/iris
lib/iris/tests/test_quickplot.py
3
8026
# Copyright Iris contributors # # This file is part of Iris and is released under the LGPL license. # See COPYING and COPYING.LESSER in the root of the repository for full # licensing details. """ Tests the high-level plotting interface. """ # import iris tests first so that some things can be initialised before impo...
lgpl-3.0
7,142,215,026,940,645,000
30.976096
97
0.577498
false
khosrow/luma-devel
luma/base/gui/design/PluginListWidgetDesign.py
3
1349
# -*- coding: utf-8 -*- # Form implementation generated from reading ui file '/mnt/debris/devel/repo/git/luma-fixes/resources/forms/PluginListWidgetDesign.ui' # # Created: Wed May 25 21:41:09 2011 # by: PyQt4 UI code generator 4.8.3 # # WARNING! All changes made in this file will be lost! from PyQt4 import QtCor...
gpl-2.0
5,215,942,983,867,101,000
39.878788
135
0.737583
false
andiwundsam/_of_normalize
pox/forwarding/l3_learning.py
36
12330
# Copyright 2012-2013 James McCauley # # 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 ...
apache-2.0
-1,384,520,186,230,110,700
35.696429
80
0.599676
false
MicroPyramid/docker-box
dockit/views.py
1
22934
from os import statvfs, uname import time from socket import socket import psutil import uuid import json import requests import subprocess from django.shortcuts import render, HttpResponse, get_object_or_404, redirect from django.http import JsonResponse, HttpResponseRedirect, StreamingHttpResponse, Http404 from docki...
mit
8,501,525,370,346,594,000
37.544538
141
0.598674
false
jbellis/cassandra
bin/cqlsh.py
1
100692
#!/bin/sh # -*- mode: Python -*- # 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....
apache-2.0
-7,604,435,412,886,491,000
39.51992
195
0.605599
false
epage/dialcentral-gtk
src/alarm_handler.py
1
9207
#!/usr/bin/env python import os import time import datetime import ConfigParser import dbus _FREMANTLE_ALARM = "Fremantle" _DIABLO_ALARM = "Diablo" _NO_ALARM = "None" try: import alarm ALARM_TYPE = _FREMANTLE_ALARM except (ImportError, OSError): try: import osso.alarmd as alarmd ALARM_TYPE = _DIABLO_ALARM ...
lgpl-2.1
5,765,287,404,224,552,000
27.504644
141
0.712501
false
khertan/ownNotes
python/requests/packages/charade/escprober.py
206
3273
######################## BEGIN LICENSE BLOCK ######################## # The Original Code is mozilla.org code. # # The Initial Developer of the Original Code is # Netscape Communications Corporation. # Portions created by the Initial Developer are Copyright (C) 1998 # the Initial Developer. All Rights Reserved. ...
gpl-3.0
-5,503,557,915,507,441,000
36.05814
90
0.594562
false
s20121035/rk3288_android5.1_repo
external/chromium_org/tools/site_compare/commands/scrape.py
189
1832
# Copyright (c) 2011 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. """Command for scraping images from a URL or list of URLs. Prerequisites: 1. The command_line package from tools/site_compare 2. Either the IE BHO o...
gpl-3.0
-9,126,213,166,704,437,000
30.050847
85
0.715066
false
bluemask2001/namebench
tools/alexa-subdomains.py
175
2862
#!/usr/bin/env python # 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 # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required...
apache-2.0
-3,072,006,876,109,275,000
27.909091
110
0.656534
false
zhuyue1314/FuzzLabs
requests/file_JPEG_B.py
7
120707
# ============================================================================= # JPEG Image Descriptor - BIG # This file is part of the FuzzLabs Fuzzing Framework # # Author: FuzzLabs # Date: 21/07/2015 # # Original file MD5 sum: 4dde17f30fee6e6120a58d890a4ec572 # Original file SHA1 sum: 1e1d1c90b4b0dd9ad5719be96...
gpl-2.0
4,826,037,338,798,373,000
49.909743
105
0.427125
false
xbmc/atv2
xbmc/lib/libPython/Python/Lib/plat-irix6/ERRNO.py
9
2657
# Generated by h2py from /usr/include/errno.h # Included from sys/errno.h # Included from standards.h __KBASE = 1000 __IRIXBASE = 1000 __FTNBASE = 4000 __FTNLAST = 5999 EPERM = 1 ENOENT = 2 ESRCH = 3 EINTR = 4 EIO = 5 ENXIO = 6 E2BIG = 7 ENOEXEC = 8 EBADF = 9 ECHILD = 10 EAGAIN = 11 ENOMEM = 12 EACCES = 13 EFAULT = 1...
gpl-2.0
-3,379,772,789,383,802,400
13.761111
45
0.722619
false
iksaif/euscan
pym/euscan/ebuild.py
1
3030
import os import sys import imp import portage from portage.const import VDB_PATH from portage import _encodings from portage import _shell_quote from portage import _unicode_decode from portage import _unicode_encode # Stolen from the ebuild command def package_from_ebuild(ebuild): pf = None if ebuild.endsw...
gpl-2.0
4,692,673,941,692,296,000
33.044944
77
0.623432
false
Vishluck/sympy
sympy/calculus/tests/test_finite_diff.py
53
7632
from sympy.core.compatibility import range from sympy import S, symbols, Function from sympy.calculus.finite_diff import ( apply_finite_diff, finite_diff_weights, as_finite_diff ) def test_apply_finite_diff(): x, h = symbols('x h') f = Function('f') assert (apply_finite_diff(1, [x-h, x+h], [f(x-h), f(...
bsd-3-clause
8,290,661,811,520,628,000
42.118644
79
0.420597
false
wuliming/pcp
src/pcp/uptime/pcp-uptime.py
1
4952
#!/usr/bin/env pmpython # # Copyright (C) 2014-2015 Red Hat. # # 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. # # This...
lgpl-2.1
-1,472,993,923,372,764,200
35.681481
79
0.605816
false
muffinresearch/addons-server
apps/reviews/tests/test_feeds.py
15
1267
# -*- coding: utf-8 -*- import mock from nose.tools import eq_ import amo.tests from reviews import feeds from translations.models import Translation class FeedTest(amo.tests.TestCase): # Rub some unicode all over the reviews feed. def setUp(self): super(FeedTest, self).setUp() self.feed = f...
bsd-3-clause
4,392,879,817,638,339,600
26.977778
74
0.610802
false
DaanHoogland/cloudstack
test/integration/component/test_storage_motion.py
6
12352
# 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
-2,496,114,136,823,592,400
38.717042
119
0.471017
false
eucalyptus/se34euca
se34euca/lib/EucaUITestLib_Base.py
1
30882
import unittest import time from selenium import webdriver from selenium.webdriver.common.by import By from selenium.webdriver.support.ui import Select from selenium.common.exceptions import NoSuchElementException class UICheckException(Exception): def __init__(self, message): raise Exception(message) ...
bsd-2-clause
2,593,085,313,972,353,000
44.017493
182
0.612428
false
cmdunkers/DeeperMind
PythonEnv/lib/python2.7/site-packages/numpy/distutils/exec_command.py
63
20462
#!/usr/bin/env python """ exec_command Implements exec_command function that is (almost) equivalent to commands.getstatusoutput function but on NT, DOS systems the returned status is actually correct (though, the returned status values may be different by a factor). In addition, exec_command takes keyword arguments fo...
bsd-3-clause
-7,783,612,222,099,138,000
30.431644
125
0.531473
false
gurbrinder/Arduino
arduino-core/src/processing/app/i18n/python/requests/packages/urllib3/_collections.py
309
2903
# urllib3/_collections.py # Copyright 2008-2012 Andrey Petrov and contributors (see CONTRIBUTORS.txt) # # This module is part of urllib3 and is released under # the MIT License: http://www.opensource.org/licenses/mit-license.php from collections import MutableMapping from threading import Lock try: # Python 2.7+ ...
lgpl-2.1
6,464,324,841,185,763,000
29.882979
92
0.622804
false
c0defreak/python-for-android
python-build/python-libs/gdata/src/gdata/webmastertools/service.py
136
22175
#!/usr/bin/python # # Copyright (C) 2008 Yu-Jie Lin # # 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
-2,000,862,741,228,793,900
41.974806
85
0.672559
false
yatinkumbhare/openstack-nova
nova/tests/unit/virt/xenapi/test_agent.py
65
17659
# Copyright 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 requ...
apache-2.0
-5,720,196,361,520,841,000
36.732906
78
0.604564
false
lamarmeigs/django-clean-fields
tests/test_utils.py
1
2929
from __future__ import absolute_import from __future__ import division from __future__ import print_function from __future__ import unicode_literals from unittest import TestCase from django.db import models from mock import patch from clean_fields.utils import ( get_model_field_value, get_model_field_names, par...
mit
424,422,824,718,670,700
33.05814
73
0.618983
false
virtool/virtool
virtool/app_routes.py
2
2008
import logging import os import sys import virtool.account.api import virtool.analyses.api import virtool.caches.api import virtool.downloads.api import virtool.files.api import virtool.genbank.api import virtool.groups.api import virtool.history.api import virtool.hmm.api import virtool.http.auth import virtool.http....
mit
-5,007,283,597,566,174,000
23.790123
65
0.715139
false
bright-sparks/chromium-spacewalk
tools/telemetry/telemetry/page/actions/tap.py
45
2540
# 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. import os from telemetry.page.actions import page_action class TapAction(page_action.PageAction): def __init__(self, selector=None, text=None, element_f...
bsd-3-clause
6,865,275,245,653,709,000
34.774648
77
0.641732
false
anushreejangid/csm-ut
tests/test_decorators.py
4
2597
# ============================================================================= # # Copyright (c) 2016, Cisco Systems # All rights reserved. # # # Author: Klaudiusz Staniek # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions are met...
bsd-2-clause
-4,386,403,867,107,160,000
32.294872
79
0.666923
false
grap/OCB
openerp/report/render/makohtml2html/__init__.py
76
1120
# -*- coding: utf-8 -*- ############################################################################## # # OpenERP, Open Source Management Solution # Copyright (C) 2004-2009 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,706,057,298,652,971,000
40.481481
78
0.623214
false
smishenk/blink-crosswalk
Tools/Scripts/webkitpy/layout_tests/controllers/test_result_writer.py
39
13796
# Copyright (C) 2011 Google Inc. All rights reserved. # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions are # met: # # * Redistributions of source code must retain the above copyright # notice, this list of conditions and the ...
bsd-3-clause
7,838,468,105,251,990,000
45.92517
119
0.676355
false
VasLem/KinectPainting
OptGridSearchCV.py
1
7990
''' An optimized method for GridSearchCV, which iteratively performs grid search and reduces the span of the parameters after each iteration. Made to make the life of an engineer less boring. ''' import numpy as np from sklearn.model_selection import GridSearchCV from sklearn.svm import LinearSVC def optGridSearchCV(...
bsd-3-clause
9,006,919,210,648,966,000
43.636872
84
0.551314
false
openstack/neutron-lib
neutron_lib/api/definitions/address_scope.py
1
3800
# Copyright (c) 2015 Huawei Technologies Co.,LTD. # # 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 app...
apache-2.0
2,690,646,805,858,251,000
38.583333
78
0.502105
false
elemhsb/mallorca
sw/airborne/test/ahrs/ahrs_utils.py
15
5172
#! /usr/bin/env python # $Id$ # Copyright (C) 2011 Antoine Drouin # # This file is part of Paparazzi. # # Paparazzi is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 2, or (at your option) # an...
gpl-2.0
-2,419,002,201,354,788,400
31.528302
130
0.576566
false
tefasmile/Mi_Blog
node_modules/grunt-docker/node_modules/docker/node_modules/pygmentize-bundled/vendor/pygments/build-3.3/pygments/lexers/_sourcemodbuiltins.py
95
21984
# -*- coding: utf-8 -*- """ pygments.lexers._sourcemodbuiltins ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ This file contains the names of SourceMod functions. It is able to re-generate itself. Do not edit the FUNCTIONS list by hand. :copyright: Copyright 2006-2013 by the Pygments team, see AUTHORS. ...
mit
5,969,303,944,340,581,000
19.507463
85
0.718477
false
msingh172/youtube-dl
youtube_dl/extractor/udemy.py
33
7277
from __future__ import unicode_literals import re from .common import InfoExtractor from ..compat import ( compat_urllib_parse, compat_urllib_request, ) from ..utils import ( ExtractorError, ) class UdemyIE(InfoExtractor): IE_NAME = 'udemy' _VALID_URL = r'https?://www\.udemy\.com/(?:[^#]+#/lectu...
unlicense
-9,180,964,793,883,346,000
34.847291
115
0.568778
false
rvalyi/OpenUpgrade
addons/account_analytic_analysis/account_analytic_analysis.py
6
46929
# -*- 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,848,177,783,421,742,000
51.907554
324
0.553219
false
bdang2012/taiga-back
taiga/projects/attachments/admin.py
21
1362
# Copyright (C) 2014 Andrey Antukh <niwi@niwi.be> # Copyright (C) 2014 Jesús Espino <jespinog@gmail.com> # Copyright (C) 2014 David Barragán <bameda@dbarragan.com> # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU Affero General Public License as # published by the F...
agpl-3.0
-4,051,200,520,628,720,600
37.857143
96
0.744118
false
Phil-LiDAR2-Geonode/pl2-geonode
geonode/contrib/geosites/tests.py
22
9742
import json from tastypie.test import ResourceTestCase from django.test.utils import override_settings from django.contrib.sites.models import Site from django.core.urlresolvers import reverse from guardian.shortcuts import get_anonymous_user from guardian.shortcuts import remove_perm from geonode.base.populate_test...
gpl-3.0
4,893,117,651,201,253,000
42.297778
114
0.630363
false
StuartLittlefair/astropy
astropy/table/operations.py
3
54015
""" High-level table operations: - join() - setdiff() - hstack() - vstack() - dstack() """ # Licensed under a 3-clause BSD style license - see LICENSE.rst from copy import deepcopy import collections import itertools from collections import OrderedDict, Counter from collections.abc import Mapping, Sequence import nu...
bsd-3-clause
-3,773,813,914,212,446,000
36.536484
97
0.585911
false
AsherBond/MondocosmOS
opencollada/Externals/LibXML/genChRanges.py
13
15491
#!/usr/bin/python -u # # Portions of this script have been (shamelessly) stolen from the # prior work of Daniel Veillard (genUnicode.py) # # I, however, take full credit for any bugs, errors or difficulties :-) # # William Brack # October 2003 # # 18 October 2003 # Modified to maintain binary compatibility with previou...
agpl-3.0
-6,665,304,771,697,966,000
25.801038
83
0.617003
false
drix00/microanalysis_file_format
pySpectrumFileFormat/OxfordInstruments/INCA/test_ReadSpectrumFullResults.py
1
3406
#!/usr/bin/env python # -*- coding: utf-8 -*- """ .. py:currentmodule:: pySpectrumFileFormat.OxfordInstruments.INCA.test_ReadSpectrumFullResults :synopsis: Tests for the module :py:mod:`pySpectrumFileFormat.OxfordInstruments.INCA.ReadSpectrumFullResults` .. moduleauthor:: Hendrix Demers <hendrix.demers@mail.mcgill...
apache-2.0
668,749,397,166,777,600
33.40404
112
0.682619
false
UdhayaBalaji/pdf-annotation
jni/freetype/src/tools/docmaker/utils.py
515
3063
# Utils (c) 2002, 2004, 2007, 2008 David Turner <david@freetype.org> # import string, sys, os, glob # current output directory # output_dir = None # This function is used to sort the index. It is a simple lexicographical # sort, except that it places capital letters before lowercase ones. # def index_sort( s1, ...
gpl-3.0
-6,345,247,982,270,304,000
22.204545
75
0.558929
false
ecederstrand/django
django/contrib/sessions/models.py
347
1298
from __future__ import unicode_literals from django.contrib.sessions.base_session import ( AbstractBaseSession, BaseSessionManager, ) class SessionManager(BaseSessionManager): use_in_migrations = True class Session(AbstractBaseSession): """ Django provides full support for anonymous sessions. The s...
bsd-3-clause
-5,901,559,119,429,592,000
34.081081
74
0.74037
false
besser82/shogun
examples/undocumented/python/tests_check_commwordkernel_memleak.py
4
4446
#!/usr/bin/env python import shogun as sg parameter_list=[[10,7,0,False]] def tests_check_commwordkernel_memleak (num, order, gap, reverse): import gc from shogun import Alphabet,StringCharFeatures,StringWordFeatures,DNA from shogun import MSG_DEBUG from shogun import CommWordStringKernel, IdentityKernelNormalizer...
bsd-3-clause
6,804,381,076,543,419,000
50.697674
70
0.632928
false
windedge/odoo
addons/crm_claim/report/__init__.py
446
1080
# -*- coding: utf-8 -*- ############################################################################## # # OpenERP, Open Source Management Solution # Copyright (C) 2004-2010 Tiny SPRL (<http://tiny.be>). # # This program is free software: you can redistribute it and/or modify # it under the terms of the...
agpl-3.0
-9,214,949,531,543,535,000
42.2
79
0.610185
false
minhphung171093/GreenERP_V7
openerp/addons/base_report_designer/__openerp__.py
110
1796
# -*- 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,251,983,726,859,393,000
40.767442
90
0.610245
false
fjorba/invenio
modules/weblinkback/lib/weblinkbackadminlib.py
25
9958
# -*- coding: utf-8 -*- ## ## This file is part of Invenio. ## Copyright (C) 2011 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) a...
gpl-2.0
-8,957,430,308,902,561,000
42.867841
219
0.61197
false
daajoe/asp_horn_backdoors
reduct.py
1
3403
#!/usr/bin/env python # # Copyright 2015 # Johannes K. Fichte, Vienna University of Technology, Austria # # reduct.py 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 y...
gpl-2.0
7,826,689,695,546,485,000
33.373737
162
0.634146
false
furiousdave/django-avatar
avatar/tests.py
54
5563
import os.path from django.test import TestCase from django.core.urlresolvers import reverse from django.conf import settings from django.contrib.auth.models import User from avatar.settings import AVATAR_DEFAULT_URL, AVATAR_MAX_AVATARS_PER_USER from avatar.util import get_primary_avatar from avatar.models import Av...
bsd-3-clause
-1,348,964,253,422,253,000
40.207407
98
0.660435
false
MSOpenTech/edx-platform
openedx/core/lib/django_test_client_utils.py
20
1555
""" This file includes the monkey-patch for requests' PATCH method, as we are using older version of django that does not contains the PATCH method in its test client. """ # pylint: disable=protected-access from __future__ import unicode_literals from urlparse import urlparse from django.test.client import RequestF...
agpl-3.0
2,123,233,854,696,187,600
27.796296
99
0.677814
false
hfp/tensorflow-xsmm
tensorflow/python/data/experimental/benchmarks/optimize_benchmark.py
2
6143
# 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
221,944,058,790,068,930
36.919753
80
0.634706
false
mdboom/pytest
testing/test_helpconfig.py
188
2031
from _pytest.main import EXIT_NOTESTSCOLLECTED import pytest def test_version(testdir, pytestconfig): result = testdir.runpytest("--version") assert result.ret == 0 #p = py.path.local(py.__file__).dirpath() result.stderr.fnmatch_lines([ '*pytest*%s*imported from*' % (pytest.__version__, ) ]...
mit
-7,984,480,400,166,079,000
28.434783
60
0.628262
false
xflows/clowdflows
streams/management/commands/run_streams.py
2
1655
from django.core.management.base import NoArgsCommand class Command(NoArgsCommand): help = 'check for streams that need to be executed and execute them' option_list = NoArgsCommand.option_list def handle_noargs(self, **options): import time from streams.models import Stream ...
mit
-6,001,318,406,068,965,000
40.435897
81
0.503323
false
bobcolner/material-girl
tests/test_user_model.py
118
6851
import unittest import time from datetime import datetime from app import create_app, db from app.models import User, AnonymousUser, Role, Permission, Follow class UserModelTestCase(unittest.TestCase): def setUp(self): self.app = create_app('testing') self.app_context = self.app.app_context() ...
mit
7,981,475,183,913,897,000
35.248677
80
0.605313
false
sunu/oh-missions-oppia-beta
extensions/rules/coord_two_dim_test.py
5
1551
# coding: utf-8 # # Copyright 2014 The Oppia 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 requi...
apache-2.0
-4,486,460,033,662,515,700
39.815789
76
0.687943
false
magus424/powerline
tests/test_provided_config_files.py
1
6114
# vim:fileencoding=utf-8:noet '''Dynamic configuration files tests.''' from __future__ import (unicode_literals, division, absolute_import, print_function) import sys import os import json import tests.vim as vim_module from tests.lib import Args, urllib_read, replace_attr from tests import TestCase VBLOCK = chr...
mit
1,446,998,702,411,007,500
34.546512
164
0.662251
false
jimsimon/sky_engine
sky/engine/bindings/scripts/blink_idl_parser.py
14
19028
# Copyright (C) 2013 Google Inc. All rights reserved. # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions are # met: # # * Redistributions of source code must retain the above copyright # notice, this list of conditions and the ...
bsd-3-clause
8,406,969,239,828,916,000
40.72807
104
0.606527
false
Juniper/tempest
tempest/lib/services/volume/v2/volumes_client.py
1
14434
# Copyright 2012 OpenStack Foundation # All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); you may # not use this file except in compliance with the License. You may obtain # a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless requ...
apache-2.0
-1,772,969,374,854,571,300
40.005682
94
0.630941
false
camagenta/youtube-dl
test/test_utils.py
34
31908
#!/usr/bin/env python # coding: utf-8 from __future__ import unicode_literals # Allow direct execution import os import sys import unittest sys.path.insert(0, os.path.dirname(os.path.dirname(os.path.abspath(__file__)))) # Various small unit tests import io import json import xml.etree.ElementTree from youtube_dl.u...
unlicense
-8,999,150,385,650,242,000
42.767538
157
0.585688
false
CydarLtd/ansible
test/runner/injector/injector.py
163
7660
#!/usr/bin/env python """Interpreter and code coverage injector for use with ansible-test. The injector serves two main purposes: 1) Control the python interpreter used to run test tools and ansible code. 2) Provide optional code coverage analysis of ansible code. The injector is executed one of two ways: 1) On the...
gpl-3.0
6,201,717,823,917,175,000
28.921875
130
0.624151
false
DistortedSignal/markov-lib
markov_test.py
1
4459
# -*- coding: utf-8 -*- import markov_tool as mt ins = mt.InstanceList() if ins._get_native_types() != (0, {}): print "There was a problem instantiating the InstanceList." print ins._get_native_types() ins['a'] = 1 if ins['a'] != 1 or ins._get_native_types() != (1, {'a': 1}): print "There was a problem s...
mit
4,949,502,489,702,389,000
44.459184
112
0.653872
false
mancoast/CPythonPyc_test
fail/313_test_tokenize.py
2
34326
# -*- coding: utf-8 -*- doctests = """ Tests for the tokenize module. The tests can be really simple. Given a small fragment of source code, print out a table with tokens. The ENDMARK is omitted for brevity. >>> dump_tokens("1 + 1") ENCODING 'utf-8' (0, 0) (0, 0) NUMBER '1' (1, 0) (...
gpl-3.0
-417,329,898,033,671,040
36.477596
79
0.413391
false
junmin-kim/TizenRT
build/tools/esp32/esptool_py/partition_offset.py
10
1806
#!/usr/bin/python # Copyright 2019 Samsung Electronics 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 ...
apache-2.0
-2,394,829,788,470,384,000
33.730769
75
0.644518
false
lulandco/SickRage
lib/chardet/sjisprober.py
53
3690
######################## BEGIN LICENSE BLOCK ######################## # The Original Code is mozilla.org code. # # The Initial Developer of the Original Code is # Netscape Communications Corporation. # Portions created by the Initial Developer are Copyright (C) 1998 # the Initial Developer. All Rights Reserved. # # Con...
gpl-3.0
6,384,045,970,724,176,000
40.931818
78
0.611111
false
MPIB/Lagerregal
devicetypes/tests.py
1
2366
from django.test import TestCase from django.test.client import Client from django.urls import reverse from model_mommy import mommy from devicetypes.models import Type from users.models import Lageruser class TypeTests(TestCase): def setUp(self): self.client = Client() Lageruser.objects.create...
bsd-3-clause
1,365,449,709,732,354,800
37.786885
109
0.669062
false
mollstam/UnrealPy
UnrealPyEmbed/Development/Python/2015.08.07-Python2710-x64-Source-vs2015/Python27/Source/django-1.8.2/tests/postgres_tests/models.py
26
1983
from django.contrib.postgres.fields import ( ArrayField, BigIntegerRangeField, DateRangeField, DateTimeRangeField, FloatRangeField, HStoreField, IntegerRangeField, ) from django.db import connection, models class IntegerArrayModel(models.Model): field = ArrayField(models.IntegerField()) class NullableIn...
mit
2,265,538,229,964,017,200
29.984375
78
0.740292
false
batermj/algorithm-challenger
code-analysis/programming_anguage/python/source_codes/Python3.5.9/Python-3.5.9/Lib/stringprep.py
205
12917
# This file is generated by mkstringprep.py. DO NOT EDIT. """Library that exposes various tables found in the StringPrep RFC 3454. There are two kinds of tables: sets, for which a member test is provided, and mappings, for which a mapping function is provided. """ from unicodedata import ucd_3_2_0 as unicodedata ass...
apache-2.0
-4,906,076,524,788,755,000
46.488971
175
0.647132
false
simontakite/sysadmin
pythonscripts/pythonnetworkingcoookbook/chapter7/7_7_configure_Apache_for_hosting_website_remotely.py
4
1458
#!/usr/bin/env python # Python Network Programming Cookbook -- Chapter - 7 # This program is optimized for Python 2.7. # It may run on any other version with/without modifications. from getpass import getpass from fabric.api import env, put, sudo, prompt from fabric.contrib.files import exists WWW_DOC_ROOT = "/data/a...
gpl-2.0
5,984,934,789,058,762,000
36.384615
103
0.660494
false
alphafoobar/intellij-community
python/helpers/docutils/utils.py
40
24558
# $Id: utils.py 6394 2010-08-20 11:26:58Z milde $ # Author: David Goodger <goodger@python.org> # Copyright: This module has been placed in the public domain. """ Miscellaneous utilities for the documentation utilities. """ __docformat__ = 'reStructuredText' import sys import os import os.path import warnings import ...
apache-2.0
2,989,172,734,709,786,600
35.382222
84
0.603632
false