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
StackStorm/st2
st2reactor/st2reactor/rules/matcher.py
3
3079
# Copyright 2020 The StackStorm Authors. # Copyright 2019 Extreme Networks, 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 ...
apache-2.0
-3,724,466,836,075,677,000
33.211111
84
0.603118
false
ranjinidas/Axelrod
axelrod/tests/unit/test_ecosystem.py
4
3370
"""Tests for the Ecosystem class""" import unittest import axelrod class TestEcosystem(unittest.TestCase): @classmethod def setUpClass(cls): cooperators = axelrod.Tournament(players=[ axelrod.Cooperator(), axelrod.Cooperator(), axelrod.Cooperator(), a...
mit
3,322,875,338,283,443,700
34.851064
111
0.605935
false
revoer/keystone-8.0.0
swift/container/sync.py
1
29912
# Copyright (c) 2010-2012 OpenStack Foundation # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agree...
apache-2.0
-2,236,279,326,873,953,000
45.303406
79
0.529888
false
openlawlibrary/pygls
tests/lsp/test_hover.py
1
5452
############################################################################ # Copyright(c) Open Law Library. All rights reserved. # # See ThirdPartyNotices.txt in the project root for additional notices. # # # # Licensed u...
apache-2.0
-3,349,198,200,429,678,000
37.394366
93
0.501651
false
Swiftb0y/P4wnP1
hidtools/mouse/hid_mouse.py
3
4850
#!/usr/bin/python # This file is part of P4wnP1. # # Copyright (c) 2017, Marcus Mengs. # # P4wnP1 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-3.0
287,219,454,957,731,260
26.556818
119
0.664742
false
pedropenna/.emacs.d
elpa/floobits-20160804.1135/floo/common/cert.py
3
4988
CA_CERT = '''-----BEGIN CERTIFICATE----- MIIGNDCCBBygAwIBAgIBGzANBgkqhkiG9w0BAQsFADB9MQswCQYDVQQGEwJJTDEW MBQGA1UEChMNU3RhcnRDb20gTHRkLjErMCkGA1UECxMiU2VjdXJlIERpZ2l0YWwg Q2VydGlmaWNhdGUgU2lnbmluZzEpMCcGA1UEAxMgU3RhcnRDb20gQ2VydGlmaWNh dGlvbiBBdXRob3JpdHkwHhcNMDcxMDI0MjA1NzA5WhcNMTcxMDI0MjA1NzA5WjCB jDELMAkGA1UEBhMCSUw...
gpl-3.0
-8,713,156,703,054,190,000
61.35
64
0.956696
false
dirn/readthedocs.org
readthedocs/restapi/permissions.py
12
1615
from rest_framework import permissions from privacy.backend import AdminPermission class IsOwner(permissions.BasePermission): """ Custom permission to only allow owners of an object to edit it. """ def has_object_permission(self, request, view, obj): # Write permissions are only allowed to th...
mit
3,586,140,166,495,542,000
32.645833
79
0.712074
false
tomprince/alot
alot/ui.py
1
17916
import urwid import logging from twisted.internet import reactor, defer from twisted.python.failure import Failure from settings import config from buffers import BufferlistBuffer import commands from commands import commandfactory from alot.commands import CommandParseError import widgets class InputWrap(urwid.Widg...
gpl-3.0
1,657,993,199,879,393,300
37.038217
79
0.556988
false
tsgit/invenio
modules/websession/lib/websession_regression_tests.py
8
5312
# -*- coding: utf-8 -*- ## ## This file is part of Invenio. ## Copyright (C) 2006, 2007, 2008, 2010, 2011, 2014 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 ## ...
gpl-2.0
6,097,270,312,127,321,000
38.348148
94
0.628389
false
xyzy/androguard
tests/test_ins.py
38
5384
#!/usr/bin/env python # This file is part of Androguard. # # Copyright (C) 2012, Anthony Desnos <desnos at t0t0.fr> # All rights reserved. # # Androguard is free software: you can redistribute it and/or modify # it under the terms of the GNU Lesser General Public License as published by # the Free Software Foundation,...
apache-2.0
-6,049,424,913,585,224,000
39.481203
234
0.495542
false
devilry/devilry-django
devilry/apps/core/tests/test_assignment_group_history.py
1
8857
from django.test import TestCase from django.utils import timezone from django.utils.timezone import timedelta from model_bakery import baker from devilry.apps.core import devilry_core_baker_factories as core_baker from devilry.apps.core.models import AssignmentGroup from devilry.apps.core.models import AssignmentGrou...
bsd-3-clause
-6,874,605,748,674,799,000
49.902299
115
0.605848
false
ichuang/sympy
sympy/stats/tests/test_continuous_rv.py
1
14252
from sympy.stats import (P, E, where, density, variance, covariance, skewness, given, pspace, cdf, ContinuousRV, sample) from sympy.stats import (Arcsin, Benini, Beta, BetaPrime, Cauchy, Chi, Dagum, Exponential, Gamma, Laplace, Logistic, LogNormal, ...
bsd-3-clause
9,090,344,859,402,542,000
29.323404
87
0.532417
false
denny820909/builder
lib/python2.7/site-packages/buildbot_slave-0.8.8-py2.7.egg/buildslave/commands/transfer.py
4
12091
# This file is part of Buildbot. Buildbot 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, version 2. # # This program is distributed in the hope that it will be useful, but WITHOUT # ANY WARRANTY; without eve...
mit
1,681,450,181,126,970,400
32.963483
82
0.553056
false
palladius/gcloud
packages/gcutil-1.7.1/lib/python_gflags/gflags.py
19
104226
#!/usr/bin/env python # # Copyright (c) 2002, 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 ...
gpl-3.0
3,194,141,635,143,222,300
35.417191
80
0.673959
false
gkioxari/RstarCNN
lib/random_data_layer/layer.py
1
6391
# -------------------------------------------------------- # Fast R-CNN # Copyright (c) 2015 Microsoft # Licensed under The MIT License [see LICENSE for details] # Written by Ross Girshick # -------------------------------------------------------- # -------------------------------------------------------- # R*CNN # Wri...
bsd-2-clause
8,975,019,176,434,802,000
36.374269
75
0.570803
false
puruckertom/ubertool
ubertool/sam_old/sam_multiprocessing.py
1
8682
__author__ = 'jflaisha' from concurrent.futures import ProcessPoolExecutor as Pool from functools import partial import logging import multiprocessing #import numpy as np import os import sys import sam_callable try: import superprzm # Import superprzm.dll / .so _dll_loaded = True except ImportError as e: ...
unlicense
-770,549,884,738,831,200
33.728
185
0.608731
false
chokribr/invenio
invenio/modules/oauthclient/contrib/orcid.py
13
6448
# -*- coding: utf-8 -*- # # This file is part of Invenio. # Copyright (C) 2014, 2015 CERN. # # Invenio is free software; you can redistribute it and/or # modify it under the terms of the GNU General Public License as # published by the Free Software Foundation; either version 2 of the # License, or (at your option) any...
gpl-2.0
-6,483,330,020,447,636,000
33.666667
79
0.659429
false
bdoin/GCompris-site
activity/color/closure/closure/bin/build/source.py
18
2723
# Copyright 2009 The Closure Library 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 a...
gpl-3.0
-7,297,649,007,079,266,000
26.23
75
0.668013
false
befelix/scipy
scipy/stats/__init__.py
5
9236
""" ========================================== Statistical functions (:mod:`scipy.stats`) ========================================== .. module:: scipy.stats This module contains a large number of probability distributions as well as a growing library of statistical functions. Each univariate distribution is an insta...
bsd-3-clause
-2,284,062,568,832,896,000
24.584488
94
0.570918
false
kvarkson/django-pdf-to-image-converter
1.4/DjangoPdfToImageConverter/pdfconverter/extra.py
3
1635
from django.db.models import FileField from django.forms import forms from django.template.defaultfilters import filesizeformat from django.utils.translation import ugettext_lazy as _ class ContentTypeRestrictedFileField(FileField): """ Same as FileField, but you can specify: * content_types - list con...
mit
-4,983,840,867,940,917,000
39.9
173
0.611009
false
repotvsupertuga/repo
script.module.gdrive/default.py
1
92648
''' CloudService XBMC Plugin Copyright (C) 2013-2014 ddurdle 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 ver...
gpl-2.0
-7,872,480,484,363,564,000
43.931135
283
0.560778
false
Azure/azure-sdk-for-python
sdk/serialconsole/azure-mgmt-serialconsole/azure/mgmt/serialconsole/_microsoft_serial_console_client.py
1
4023
# coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the MIT License. See License.txt in the project root for license information. # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may ...
mit
-5,325,386,730,990,529,000
44.202247
182
0.673627
false
RedTea/gaedav
pyxml/dom/html/HTMLImageElement.py
4
3892
######################################################################## # # File Name: HTMLImageElement # # ### This file is automatically generated by GenerateHtml.py. ### DO NOT EDIT! """ WWW: http://4suite.com/4DOM e-mail: support@4suite.com Copyright (c) 2000 Fourthought Inc, USA. All Right...
lgpl-2.1
8,082,525,727,885,236,000
25.657534
77
0.581963
false
BorgERP/borg-erp-6of3
addons/point_of_sale/wizard/pos_payment.py
1
4106
# -*- 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,585,044,777,944,473,000
37.018519
96
0.587433
false
flarno11/teslarent
teslarent/manage_views.py
1
8703
import base64 import logging import uuid import datetime from json import encoder from django.conf import settings from django.contrib import admin from django.contrib.admin.views.decorators import staff_member_required from django.http import HttpResponse, HttpResponseForbidden from django.http.response import Http40...
apache-2.0
1,031,027,588,890,160,100
37.171053
166
0.667011
false
JoaquimPatriarca/senpy-for-gis
gasp/pgsql/q/time.py
1
7149
""" Analyse time references in PGTABLES """ def ID_rows_with_temporal_proximity_by_entities(conParam, table, entity_field, day_field, hour_field, hour_decimal_field, time_tolerance, outXlsPath): """ Retrieve rows from one pgtable with some temp...
gpl-3.0
5,071,065,966,288,899,000
37.026596
113
0.504966
false
allanderek/drunken-octo-avenger
app/sgftools.py
2
3309
import re class ParseError(Exception): pass class SgfTree(object): # at the moment just a wrapper around 'nodes', a list of # dictionaries representing SGF tags. This wrapper exists in case # we want to add sub-trees, navigation methods etc. later, in # which case I suggest following the general...
cc0-1.0
-6,763,316,814,104,656,000
24.453846
76
0.508613
false
mjg/PyX-svn
test/functional/test_axis.py
1
3080
#!/usr/bin/env python import sys; sys.path[:0] = ["../.."] import math from pyx import * from pyx.graph.axis.parter import linear as linparter from pyx.graph.axis.painter import regular, ticklength, rotatetext from pyx.graph.axis.texter import rational, default from pyx.graph.axis.axis import lin, pathaxis c = canvas...
gpl-2.0
7,655,938,381,475,660,000
60.6
138
0.600649
false
mbauskar/frappe
frappe/data_migration/doctype/data_migration_connector/connectors/postgres.py
3
1430
from __future__ import unicode_literals import frappe, psycopg2 from .base import BaseConnection class PostGresConnection(BaseConnection): def __init__(self, properties): self.__dict__.update(properties) self._connector = psycopg2.connect("host='{0}' dbname='{1}' user='{2}' password='{3}'".format(self.hostname, ...
mit
1,917,267,790,391,735,000
32.255814
110
0.690909
false
parheliamm/mosquitto-1.3.4
test/lib/02-unsubscribe.py
19
1712
#!/usr/bin/env python # Test whether a client sends a correct UNSUBSCRIBE packet. import inspect import os import subprocess import socket import sys import time # From http://stackoverflow.com/questions/279237/python-import-a-module-from-a-folder cmd_subfolder = os.path.realpath(os.path.abspath(os.path.join(os.path...
bsd-3-clause
-8,659,736,514,398,265,000
25.338462
129
0.691589
false
MrCrawdaddy/humans
humans/urls.py
1
1330
"""humans URL Configuration The `urlpatterns` list routes URLs to views. For more information please see: https://docs.djangoproject.com/en/1.9/topics/http/urls/ Examples: Function views 1. Add an import: from my_app import views 2. Add a URL to urlpatterns: url(r'^$', views.home, name='home') Class-base...
mit
-3,313,737,812,417,281,000
41.903226
109
0.693985
false
shashisp/junction
junction/urls.py
2
3334
# -*- coding: utf-8 -*- from __future__ import absolute_import, unicode_literals # Third Party Stuff from django.conf import settings from django.conf.urls import include, patterns, url from django.conf.urls.static import static from django.contrib import admin from django.views.generic.base import RedirectView, Templ...
mit
140,312,243,866,703,200
40.675
117
0.695561
false
kslundberg/pants
src/python/pants/binaries/binary_util.py
7
11585
# coding=utf-8 # Copyright 2015 Pants project contributors (see CONTRIBUTORS.md). # Licensed under the Apache License, Version 2.0 (see LICENSE). from __future__ import (absolute_import, division, generators, nested_scopes, print_function, unicode_literals, with_statement) import logging impor...
apache-2.0
4,552,434,797,696,347,000
40.523297
101
0.672249
false
AeonGames/AeonEngine
tools/blender/addons/io_images/export.py
1
1485
# Copyright (C) 2017,2019 Rodrigo Jose Hernandez Cordoba # # 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
3,983,112,824,774,501,400
32.75
81
0.66734
false
mjvakili/ccppabc
ccppabc/code/test_emcee.py
1
2414
import sys import numpy as np import emcee from emcee.utils import MPIPool # Choose the "true" parameters. m_true = -0.9594 b_true = 4.294 f_true = 0.534 # Generate some synthetic data from the model. N = 50 x = np.sort(10*np.random.rand(N)) yerr = 0.1+0.5*np.random.rand(N) y = m_true*x+b_true y += np.abs(f_true*y) *...
mit
1,180,406,701,961,943,800
26.431818
88
0.597349
false
redhat-openstack/trove
trove/tests/unittests/api/test_versions.py
3
8858
# Copyright 2013 OpenStack Foundation # 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/lic...
apache-2.0
4,118,092,789,275,633,700
37.181034
78
0.591556
false
Ryanglambert/pybrain
docs/tutorials/networks.py
25
4239
from __future__ import print_function ############################################################################ # PyBrain Tutorial "Networks, Modules, Connections" # # Author: Tom Schaul, tom@idsia.ch ############################################################################ __author__ = 'Tom Schaul, tom@idsia.c...
bsd-3-clause
-4,781,165,897,439,055,000
33.745902
109
0.713612
false
verdverm/pypge
experiments/01_baseline/theann.py
1
3775
from __future__ import absolute_import from __future__ import division from __future__ import print_function import numpy as np import pandas as pd from sklearn.metrics import r2_score import data as DATA import tensorflow.python.platform import tensorflow as tf def run_explicit_loop(): for problem in DATA.expli...
mit
5,630,535,016,137,693,000
28.960317
120
0.62702
false
freeflightsim/ffs-app-engine
ffs-cal.appspot.com/atom/core.py
18
20432
#!/usr/bin/env python # # Copyright (C) 2008 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...
gpl-2.0
1,320,230,897,144,665,300
37.262172
79
0.652702
false
xuxiao19910803/edx
lms/djangoapps/ccx/views.py
9
19058
""" Views related to the Custom Courses feature. """ import csv import datetime import functools import json import logging import pytz from contextlib import contextmanager from copy import deepcopy from cStringIO import StringIO from django.core.urlresolvers import reverse from django.http import ( HttpResponse...
agpl-3.0
5,619,142,379,369,631,000
32.376532
92
0.61082
false
alchemistry/alchemlyb
src/alchemlyb/tests/test_ti_estimators.py
1
6592
"""Tests for all TI-based estimators in ``alchemlyb``. """ import pytest import pandas as pd import alchemlyb from alchemlyb.parsing import gmx, amber, gomc from alchemlyb.estimators import TI import alchemtest.gmx import alchemtest.amber import alchemtest.gomc from alchemtest.gmx import load_benzene from alchemlyb....
bsd-3-clause
2,148,707,599,273,751,000
33.694737
101
0.613774
false
3bot/3bot
threebot/forms.py
1
14674
from django import forms from django.forms.models import modelformset_factory from django.utils.safestring import mark_safe from organizations.models import Organization from organizations.utils import create_organization from threebot.utils import get_possible_parameters, get_possible_worker, get_curr_org from threeb...
bsd-3-clause
-5,820,275,743,983,912,000
39.535912
152
0.612853
false
Intel-tensorflow/tensorflow
tensorflow/compiler/mlir/tensorflow/tests/tf_saved_model/basic_v1_no_variable_lifting.py
6
2020
# Copyright 2021 The TensorFlow Authors. All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applica...
apache-2.0
6,024,694,492,854,849,000
34.438596
80
0.683663
false
krafczyk/spack
var/spack/repos/builtin/packages/icet/package.py
2
2017
############################################################################## # Copyright (c) 2013-2018, Lawrence Livermore National Security, LLC. # Produced at the Lawrence Livermore National Laboratory. # # This file is part of Spack. # Created by Todd Gamblin, tgamblin@llnl.gov, All rights reserved. # LLNL-CODE-64...
lgpl-2.1
2,029,701,255,037,552,600
42.847826
113
0.672286
false
joshrabinowitz/bitcoin
test/functional/p2p_timeouts.py
3
2305
#!/usr/bin/env python3 # Copyright (c) 2016-2017 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 various net timeouts. - Create three bitcoind nodes: no_verack_node - we never send a verack...
mit
821,442,777,463,884,500
30.575342
93
0.689805
false
inkerra/cinder
cinder/openstack/common/processutils.py
2
9178
# vim: tabstop=4 shiftwidth=4 softtabstop=4 # Copyright 2011 OpenStack Foundation. # All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); you may # not use this file except in compliance with the License. You may obtain # a copy of the License at # # http://www.apac...
apache-2.0
5,934,840,926,830,299,000
36.308943
79
0.574853
false
gunnarleffler/instapost
tdg_or_wa_avgs/cwms_read.py
1
8073
# -*- coding: utf-8 -*- import requests import json import pandas as pd from datetime import datetime, timedelta def reindex(df, start_date, end_date, freq): date = pd.date_range(start = datetime(*start_date), end = datetime(*end_date), freq = freq) date = [pd.Timestamp(x) for x in date] df = ...
mit
4,054,802,065,479,725,600
34.253275
149
0.560263
false
codefisher/codefisher_apps
site_crawler/migrations/0001_initial.py
1
1310
# -*- coding: utf-8 -*- from __future__ import unicode_literals from django.db import models, migrations class Migration(migrations.Migration): dependencies = [ ] operations = [ migrations.CreateModel( name='CrawledPage', fields=[ ('id', models.AutoField(...
mit
-2,904,308,545,585,652,700
32.589744
114
0.512977
false
bnaul/scikit-learn
sklearn/linear_model/__init__.py
12
2872
""" The :mod:`sklearn.linear_model` module implements a variety of linear models. """ # See http://scikit-learn.sourceforge.net/modules/sgd.html and # http://scikit-learn.sourceforge.net/modules/linear_model.html for # complete documentation. from ._base import LinearRegression from ._bayes import BayesianRidge, ARDR...
bsd-3-clause
-3,305,525,107,772,083,000
34.9
78
0.601671
false
gajim/python-nbxmpp
nbxmpp/modules/eme.py
1
1740
# Copyright (C) 2018 Philipp Hörist <philipp AT hoerist.com> # # This file is part of nbxmpp. # # 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 opt...
gpl-3.0
221,082,884,221,363,200
35.229167
73
0.6682
false
alunem/bioman
fasta/bmn-FastaRandDivides.py
1
1085
#!/usr/bin/env python import string import sys import os from Bio import SeqIO from Bio.Seq import Seq from Bio.SeqRecord import SeqRecord from StringIO import StringIO import random import tempfile fastafile = sys.argv[1] #fastafile = "/bank/fasta/Roth/E1.454.fasta" randomYorN = sys.argv[2] nbPart=int(sys.argv[3]) #...
gpl-2.0
-8,486,432,452,396,793,000
21.142857
122
0.738249
false
infinit/drake
src/drake/flex.py
1
5564
# Copyright (C) 2011-2016, Quentin "mefyl" Hocquet # # This software is provided "as is" without warranty of any kind, # either expressed or implied, including but not limited to the # implied warranties of fitness for a particular purpose. # # See the LICENSE file for more information. import drake import sys class ...
agpl-3.0
-3,040,151,377,415,750,700
35.847682
300
0.633537
false
palaniyappanBala/rekall
rekall-core/rekall/plugins/collectors/ballast.py
4
1600
# Rekall Memory Forensics # # Copyright 2014 Google Inc. All Rights Reserved. # # 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 v...
gpl-2.0
-4,227,601,355,666,402,300
33.042553
73
0.6975
false
edisonlz/fruit
web_project/base/site-packages/util/thrift/thrifttools.py
1
1984
#!/usr/bin/env python # -*- coding: utf-8 -*- from contextlib import contextmanager import thread import logging from thrift.transport import TSocket, TTransport from thrift.protocol import TBinaryProtocol import settings SERVICE_SELECTION = 0 class ThreadMappedPool(dict): def __new__(cls, master): ret...
apache-2.0
1,768,033,562,762,747,000
24.113924
109
0.62752
false
hyperized/ansible
lib/ansible/modules/network/f5/bigip_irule.py
38
17060
#!/usr/bin/python # -*- coding: utf-8 -*- # # Copyright: (c) 2017, F5 Networks 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', ...
gpl-3.0
-6,118,759,176,677,095,000
28.566724
91
0.578312
false
stephane-martin/salt-debian-packaging
salt-2016.3.3/tests/unit/cloud/clouds/dimensiondata_test.py
2
4949
# -*- coding: utf-8 -*- ''' :codeauthor: `Anthony Shaw <anthonyshaw@apache.org>` tests.unit.cloud.clouds.dimensiondata_test ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ''' # Import Python libs from __future__ import absolute_import import libcloud.security import platform import os # Import Salt Libs from salt.c...
apache-2.0
-612,343,151,610,206,000
27.94152
119
0.599313
false
damian1976/openstack-accounting
util/server.py
1
4730
from .os_data import AccountData import unicodedata import re # 'Server' class # Contains all server accounting data class Server(AccountData): def __init__(self, name): AccountData.__init__(self) m_name = unicodedata.normalize('NFD', re.sub("[\(\[].*?[\)\]]"...
gpl-2.0
8,854,014,067,219,134,000
34.56391
99
0.47611
false
ruslanchasep/bartendro
ui/bartendro/view/ws/drink.py
4
5611
# -*- coding: utf-8 -*- import json from time import sleep from operator import itemgetter from bartendro import app, db, mixer from flask import Flask, request from flask.ext.login import login_required, current_user from werkzeug.exceptions import ServiceUnavailable, BadRequest, InternalServerError from bartendro.mod...
gpl-2.0
8,901,950,534,734,962,000
32.201183
120
0.615933
false
yangbh/Hammer
lib/theHarvester/discovery/baidusearch.py
3
1605
import string import httplib, sys import myparser import re import time class search_baidu: def __init__(self,word,limit,start): self.word=word.replace(' ', '%20') self.results="" self.totalresults="" self.server="www.baidu.com" #self.apiserver="api.search.live.net" self.hostname="www.baidu.com" self.us...
gpl-2.0
-5,663,959,412,377,216,000
33.170213
190
0.708411
false
yezyilomo/dorm
dorm/db.py
1
39874
from flask import Flask from flaskext.mysql import MySQL import random import collections import hashlib import copy ## Database configuration information ################################### app = Flask(__name__) mysql = MySQL() app.config['MYSQL_DATABASE_USER'] = None app.config['MYSQL_DATABASE_PASSWORD'] = None app....
gpl-3.0
465,960,330,465,662,300
44.004515
216
0.610222
false
lancezlin/ml_template_py
lib/python2.7/site-packages/nbconvert/preprocessors/highlightmagics.py
9
3251
"""This preprocessor detect cells using a different language through magic extensions such as `%%R` or `%%octave`. Cell's metadata is marked so that the appropriate highlighter can be used in the `highlight` filter. """ # Copyright (c) Jupyter Development Team. # Distributed under the terms of the Modified BSD License...
mit
-8,252,621,789,074,037,000
31.838384
78
0.604429
false
piffey/ansible
lib/ansible/modules/network/cloudengine/ce_netstream_aging.py
43
18023
#!/usr/bin/python # # This file is part of Ansible # # Ansible is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation, either version 3 of the License, or # (at your option) any later version. # # Ansible is distribut...
gpl-3.0
1,614,553,412,140,755,500
34.339216
107
0.543972
false
ccastell/Transfer-System
Website/env/lib/python3.5/site-packages/django/apps/registry.py
51
17239
import sys import threading import warnings from collections import Counter, OrderedDict, defaultdict from functools import partial from django.core.exceptions import AppRegistryNotReady, ImproperlyConfigured from django.utils import lru_cache from .config import AppConfig class Apps(object): """ A registry...
apache-2.0
6,496,031,672,801,730,000
39.562353
93
0.614711
false
BurtBiel/azure-cli
src/command_modules/azure-cli-keyvault/azure/cli/command_modules/keyvault/custom.py
1
9777
#--------------------------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the MIT License. See License.txt in the project root for license information. #---------------------------------------------------------------------...
mit
588,874,103,861,050,900
51.848649
130
0.563056
false
gaolichuang/py-essential
tests/test_imageutils.py
2
7736
# Copyright (C) 2012 Yahoo! 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
7,356,216,962,662,390,000
37.874372
78
0.558816
false
hyiltiz/labyrinth
labyrinth_lib/Browser.py
2
13346
# Browser.py # This file is part of Labyrinth # # Copyright (C) 2006 - Don Scorgie <Don@Scorgie.org> # - Andreas Sliwka <andreas.sliwka@gmail.com> # # Labyrinth 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 So...
gpl-2.0
4,066,807,916,930,769,000
38.13783
153
0.595909
false
yotomyoto/benzene
tournament/program.py
5
3454
#---------------------------------------------------------------------------- # Connects to a Hex program. #---------------------------------------------------------------------------- import os, string, sys, subprocess from random import randrange from select import select #------------------------------------------...
lgpl-3.0
3,813,835,052,945,766,000
28.521368
77
0.46989
false
jazcollins/models
domain_adaptation/domain_separation/dsn_eval.py
11
5759
# 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 applicab...
apache-2.0
5,395,471,066,504,499,000
34.99375
80
0.64282
false
proxysh/Safejumper-for-Desktop
buildlinux/env32/lib/python2.7/site-packages/twisted/logger/test/test_global.py
12
9902
# Copyright (c) Twisted Matrix Laboratories. # See LICENSE for details. """ Test cases for L{twisted.logger._global}. """ from __future__ import print_function import io from twisted.trial import unittest from .._file import textFileLogObserver from .._observer import LogPublisher from .._logger import Logger from...
gpl-2.0
-1,041,290,754,697,133,000
31.045307
79
0.582812
false
ceos-seo/Data_Cube_v2
labs/dc_mosaicker.py
1
8894
# Copyright 2016 United States Government as represented by the Administrator # of the National Aeronautics and Space Administration. All Rights Reserved. # # Portion of this code is Copyright Geoscience Australia, Licensed under the # Apache License, Version 2.0 (the "License"); you may not use this file # except in c...
apache-2.0
8,956,539,914,278,026,000
36.213389
92
0.624916
false
amitjamadagni/sympy
sympy/mpmath/functions/functions.py
6
17416
from ..libmp.backend import xrange class SpecialFunctions(object): """ This class implements special functions using high-level code. Elementary and some other functions (e.g. gamma function, basecase hypergeometric series) are assumed to be predefined by the context as "builtins" or "low-level" f...
bsd-3-clause
-2,190,033,119,787,205,000
27.55082
84
0.506718
false
ageitgey/face_recognition
examples/benchmark.py
1
2450
import timeit # Note: This example is only tested with Python 3 (not Python 2) # This is a very simple benchmark to give you an idea of how fast each step of face recognition will run on your system. # Notice that face detection gets very slow at large image sizes. So you might consider running face detection on a # ...
mit
-7,453,001,758,066,568,000
30.818182
135
0.697551
false
PhiInnovations/mdp28-linux-bsp
openembedded-core/meta/lib/oe/packagedata.py
2
3067
import codecs def packaged(pkg, d): return os.access(get_subpkgedata_fn(pkg, d) + '.packaged', os.R_OK) def read_pkgdatafile(fn): pkgdata = {} def decode(str): c = codecs.getdecoder("string_escape") return c(str)[0] if os.access(fn, os.R_OK): import re f = file(fn, 'r...
mit
-6,815,879,446,107,291,000
26.141593
90
0.574177
false
alimony/django
django/contrib/postgres/forms/array.py
6
6964
import copy from itertools import chain from django import forms from django.contrib.postgres.validators import ( ArrayMaxLengthValidator, ArrayMinLengthValidator, ) from django.core.exceptions import ValidationError from django.utils.translation import gettext_lazy as _ from ..utils import prefix_validation_erro...
bsd-3-clause
1,099,102,350,406,072,600
33.82
101
0.553274
false
sein-tao/trash-cli
unit_tests/test_list_all_trashinfo_contents.py
2
1611
from mock import Mock, call from nose.tools import assert_equals, assert_items_equal class TestListing: def setUp(self): self.trashdir = Mock() self.trashinfo_reader = Mock() self.listing = Listing(self.trashdir, self.trashinfo_reader) def test_it_should_read_all_trashinfo_from_home_di...
gpl-2.0
7,087,272,222,413,691,000
34.021739
75
0.629423
false
ubuntu-core/snapcraft
tests/spread/plugins/v1/x-local/snaps/from-nilplugin/snap/plugins/x_local_plugin.py
1
1166
# -*- Mode:Python; indent-tabs-mode:nil; tab-width:4 -*- # # Copyright (C) 2020 Canonical Ltd # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License version 3 as # published by the Free Software Foundation. # # This program is distributed in the h...
gpl-3.0
-5,125,575,185,785,636,000
29.684211
71
0.691252
false
sergiorb/askkit
allauth/account/utils.py
11
13863
from datetime import timedelta try: from django.utils.timezone import now except ImportError: from datetime import datetime now = datetime.now import django from django.contrib import messages from django.core.urlresolvers import reverse from django.conf import settings from django.http import HttpResponse...
apache-2.0
-226,021,620,606,552,060
35.481579
79
0.582053
false
unlimitedlabs/orchestra
orchestra/bots/tests/test_basebot.py
2
2810
from orchestra.bots.basebot import BaseBot from orchestra.bots.errors import SlackCommandInvalidRequest from orchestra.bots.tests.fixtures import get_mock_slack_data from orchestra.tests.helpers import OrchestraTestCase class BaseBotTest(OrchestraTestCase): token = get_mock_slack_data().get('token') def test...
apache-2.0
1,715,188,096,944,312,300
36.972973
75
0.611388
false
opendroid-Team/enigma2-4.1
lib/python/Screens/Ci.py
5
11213
from Screen import Screen from Components.ActionMap import ActionMap from Components.ActionMap import NumberActionMap from Components.Label import Label from Components.config import config, ConfigSubsection, ConfigSelection, ConfigSubList, getConfigListEntry, KEY_LEFT, KEY_RIGHT, KEY_0, ConfigNothing, ConfigPIN from ...
gpl-2.0
-3,939,962,232,657,956,400
27.387342
160
0.672791
false
VUIIS/seam
setup.py
1
3188
#!/usr/bin/env python # -*- coding: utf-8 -*- __author__ = 'Scott Burns <scott.s.burns@vanderbilt.edu>' __copyright__ = 'Copyright 2014 Vanderbilt University. All Rights Reserved' from setuptools import setup, find_packages import os import re from io import open import codecs here = os.path.abspath(os.path.dirname...
mit
555,408,630,373,452,800
33.27957
79
0.643036
false
davvid/qtpy
qtpy/tests/test_patch_qheaderview.py
1
3524
from __future__ import absolute_import from qtpy import PYSIDE, PYQT4 from qtpy.QtWidgets import QApplication from qtpy.QtWidgets import QHeaderView from qtpy.QtCore import Qt from qtpy.QtCore import QAbstractListModel import pytest def get_qapp(icon_path=None): qapp = QApplication.instance() if qapp is None...
mit
2,025,572,770,592,096,300
37.725275
78
0.742054
false
Rositsazz/hack33
config/urls.py
2
1599
# -*- coding: utf-8 -*- from __future__ import unicode_literals from django.conf import settings from django.conf.urls import include, url from django.conf.urls.static import static from django.contrib import admin from django.views.generic import TemplateView from django.views import defaults as default_views urlpat...
mit
-3,431,784,249,311,826,000
38
110
0.674171
false
heenbo/mosquitto-heenbo
test/lib/03-publish-c2b-qos1-disconnect.py
7
2303
#!/usr/bin/env python # Test whether a client sends a correct PUBLISH to a topic with QoS 1, then responds correctly to a disconnect. import inspect import os import subprocess import socket import sys import time # From http://stackoverflow.com/questions/279237/python-import-a-module-from-a-folder cmd_subfolder = o...
gpl-3.0
7,890,993,740,533,308,000
28.909091
129
0.663048
false
lmazuel/azure-sdk-for-python
azure-mgmt-network/azure/mgmt/network/v2017_09_01/models/connectivity_issue_py3.py
1
2129
# coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the MIT License. See License.txt in the project root for # license information. # # Code generated by Microsoft (R) AutoRest Code Generator. # Changes ...
mit
-768,324,051,524,460,200
37.709091
77
0.602161
false
yassen-itlabs/py-linux-traffic-control
pyltc/util/cmdline.py
1
5206
""" Command line execution utility module. """ import time import subprocess def popen_factory(): """Returns subprocess.Popen on Linux, otherwise returns MockPopen class assuming this is a test run.""" import platform if platform.system() == 'Linux': return subprocess.Popen class Mock...
mit
8,862,398,151,114,089,000
32.805195
105
0.57184
false
chemelnucfin/tensorflow
tensorflow/python/keras/mixed_precision/experimental/__init__.py
8
1179
# 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 # # Unless required by applica...
apache-2.0
-6,846,957,284,458,253,000
50.26087
104
0.742154
false
xiaokangwang/KKWebVideoDL-X
youtube_dl/extractor/wimp.py
6
1302
import re import base64 from .common import InfoExtractor class WimpIE(InfoExtractor): _VALID_URL = r'(?:http://)?(?:www\.)?wimp\.com/([^/]+)/' _TEST = { u'url': u'http://www.wimp.com/deerfence/', u'file': u'deerfence.flv', u'md5': u'8b215e2e0168c6081a1cf84b2846a2b5', u'info_d...
gpl-3.0
4,256,060,455,791,585,300
35.166667
119
0.544547
false
benthomasson/msa-designer
msa_designer/server.py
1
3482
from gevent import monkey monkey.patch_all() import os import socket import pkg_resources import logging import hashlib import yaml import json from pprint import pprint from jinja2 import Environment, PackageLoader env = Environment(loader=PackageLoader('msa_designer_web', 'templates')) from bottle import route, ...
bsd-3-clause
-5,581,207,329,173,082,000
26.203125
104
0.635267
false
hudora/huTools
huTools/world.py
1
2969
#!/usr/bin/env python # encoding: utf-8 """ hutools/world - countries of the world (to be procise: countries we do buiseness with) Most interesting are the constants COUNTRY_CHOICES and COUNTRIES. COUNTRY_CHOICES = [('DE', 'Deutschland'), ('AT', u'Österreich'), ...] COUNTRIES = ['DE', 'AT', ...] Created by Maximilli...
bsd-3-clause
1,703,927,227,999,649,300
31.911111
96
0.426063
false
dstanek/keystone
keystone/tests/unit/test_v3_controller.py
4
1890
# Copyright 2014 CERN. # # 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, softw...
apache-2.0
-3,008,335,138,926,897,700
34.660377
79
0.679894
false
JohnDoee/autotorrent
autotorrent/at.py
1
22932
from __future__ import division, unicode_literals import os import hashlib import logging import platform from collections import defaultdict from .bencode import bencode, bdecode from .humanize import humanize_bytes from .utils import is_unsplitable, get_root_of_unsplitable, Pieces logger = logging.getLogger('auto...
mit
7,117,655,230,951,537,000
39.161121
158
0.511774
false
nrupatunga/PY-GOTURN
goturn/network/regressor.py
1
5623
# Date: Friday 02 June 2017 05:04:00 PM IST # Email: nrupatunga@whodat.com # Name: Nrupatunga # Description: Basic regressor function implemented from __future__ import print_function import os import glob import numpy as np import sys import cv2 from ..helper import config sys.path.insert(0, config.CAFFE_PATH) impor...
mit
2,089,229,815,870,603,000
31.508671
103
0.586342
false
bobev18/reflective
django2wrap/settings.py
1
5385
import os # Django settings for django2wrap project. SITE_ROOT = os.path.realpath(os.path.dirname(__file__)) # + '/' PROJECT_NAME = os.path.basename(os.path.dirname(__file__)) BASE_DIR = os.path.dirname(os.path.abspath(__file__)) fp = os.path.join(BASE_DIR, 'local_settings.py') try: exec(open(fp,'rt',encoding='ut...
bsd-3-clause
7,251,111,057,287,929,000
32.447205
100
0.69805
false
JackMc/CourseScraper
scraper/carleton/scrape.py
1
3008
from carleton.course import Course import requests from bs4 import BeautifulSoup import datetime import csv FALL = 0 WINTER = 1 SUMMER = 2 # Maps term codes to semesters # Experimentally determined from playing with Carleton Central. _TERM_MAP = {WINTER: '10', SUMMER: '20', FALL: '30'} def _make_term_code(year, te...
mit
8,382,359,165,925,215,000
32.422222
117
0.628657
false
dnowatsc/Varial
varial/test/test_diskio.py
1
3008
import os from ROOT import TH1F from test_histotoolsbase import TestHistoToolsBase from varial.wrappers import FileServiceAlias from varial import diskio from varial import analysis class TestDiskio(TestHistoToolsBase): def setUp(self): super(TestDiskio, self).setUp() if not os.path.exists("test_d...
gpl-3.0
5,906,985,303,420,168,000
32.433333
81
0.622008
false
csachs/openmicroscopy
components/tools/OmeroWeb/test/integration/test_download.py
9
5019
#!/usr/bin/env python # -*- coding: utf-8 -*- # # Copyright (C) 2015 University of Dundee & Open Microscopy Environment. # All rights reserved. # # 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 Free Software Found...
gpl-2.0
3,900,360,906,882,273,000
29.981481
78
0.61845
false
uhjish/bx-python
lib/bx/seq/nib.py
3
2884
""" Classes to support nib files. :Author: James Taylor (james@bx.psu.edu), Bob Harris (rsharris@bx.psu.edu) A nib sequence is a sequence of DNA, using the 10 character alphabet A,C,G,T,N (upper and lower case). The file is packed as 4 bits per character. nib file format --------------- Fields can be in big- or li...
mit
-2,764,153,147,221,239,000
33.333333
91
0.602982
false
trichter/sito
xcorr.py
1
17828
#!/usr/bin/env python # by TR #import logging from obspy.signal.util import nextpow2 from scipy.fftpack import fft, ifft, fftshift, ifftshift from sito._xcorr import xcorr as xcorr_c from sito.util import isnumber, filterResp, smooth, fillArray import logging import numpy as np import obspy.signal from obspy.core.util...
mit
-1,005,370,512,903,102,600
37.339785
129
0.569441
false
lepisma/audire
src/server.py
1
1838
""" Tornado websocket server """ import tornado.ioloop import tornado.web import tornado.websocket import os from threading import Thread from modules import noise, anomaly, message, event settings = {"static_path": os.path.join(os.path.dirname(__file__), "static")} # Runt the audio level thread Thread(target=noise....
gpl-3.0
9,133,335,180,269,070,000
24.527778
77
0.658324
false
mola/qgis
python/plugins/GdalTools/tools/doRasterize.py
3
4207
# -*- coding: utf-8 -*- from PyQt4.QtCore import * from PyQt4.QtGui import * from qgis.core import * from qgis.gui import * from osgeo import ogr from ui_widgetRasterize import Ui_GdalToolsWidget as Ui_Widget from widgetPluginBase import GdalToolsBasePluginWidget as BasePluginWidget import GdalTools_utils as Utils cl...
gpl-2.0
2,840,791,900,625,934,300
35.267241
175
0.700499
false