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
mgaio/parameter-framework
test/functional-tests-legacy/PfwTestCase/Types/tUINT32.py
8
10768
#!/usr/bin/python2 # -*-coding:utf-8 -* # Copyright (c) 2011-2015, Intel Corporation # All rights reserved. # # Redistribution and use in source and binary forms, with or without modification, # are permitted provided that the following conditions are met: # # 1. Redistributions of source code must retain the above co...
bsd-3-clause
-1,395,111,987,062,695,000
42.419355
133
0.530461
false
pilliq/mongo-web-shell
webapps/ivs/app.py
2
1132
# Copyright 2013 10gen 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...
apache-2.0
4,052,007,786,757,980,700
28.789474
77
0.718198
false
andresailer/DIRAC
ResourceStatusSystem/scripts/dirac-rss-query-dtcache.py
2
11477
#!/usr/bin/env python """ dirac-rss-query-dtcache Select/Add/Delete a new DownTime entry for a given Site or Service. Usage: dirac-rss-query-dtcache [option] <query> Queries: [select|add|delete] Options: --downtimeID= The ID of the downtime --element= ...
gpl-3.0
1,818,955,768,687,439,000
29.202632
113
0.589004
false
hubert667/AIR
build/celery/build/lib.linux-i686-2.7/celery/tests/backends/test_database.py
2
6207
from __future__ import absolute_import, unicode_literals from datetime import datetime from pickle import loads, dumps from celery import states from celery.exceptions import ImproperlyConfigured from celery.utils import uuid from celery.tests.case import ( AppCase, SkipTest, depends_on_current_app, ...
gpl-3.0
3,857,248,766,893,806,600
30.668367
77
0.61044
false
cnsoft/kbengine-cocos2dx
kbe/src/lib/python/Tools/scripts/abitype.py
2
5568
#!/usr/bin/env python3 # This script converts a C file to use the PEP 384 type definition API # Usage: abitype.py < old_code > new_code import re, sys ###### Replacement of PyTypeObject static instances ############## # classify each token, giving it a one-letter code: # S: static # T: PyTypeObject # I: ident # W: wh...
lgpl-3.0
-8,365,371,471,603,880,000
26.564356
72
0.490481
false
philipp-sumo/kitsune
scripts/l10n_completion.py
4
5090
#!/usr/bin/env python """ Goes through locale files and gives a breakdown of percentage translated by app for each locale. Requires: * polib For usage help, type:: $ python l10n_completion.py --help """ from optparse import OptionParser import json import os import site # Add site path to pick up libs SCRIP...
bsd-3-clause
1,739,279,512,074,451,500
23.009434
81
0.583301
false
yqm/sl4a
python/src/Mac/Demo/PICTbrowse/ICONbrowse.py
34
4944
"""browsepict - Display all "ICON" resources found""" import FrameWork import EasyDialogs from Carbon import Res from Carbon import Qd from Carbon import Win from Carbon import Controls from Carbon import List from Carbon import Icn import macresource # # Resource definitions ID_MAIN=512 MAIN_LIST=1 MAIN_SHOW=2 # Wh...
apache-2.0
-6,544,238,846,289,256,000
29.708075
74
0.581917
false
mapazarr/astropy_scripts
astropy_scripts/gammapy_bg_cube_models_utilities.py
1
13601
from __future__ import (absolute_import, division, print_function, unicode_literals) # python 2 as python 3 from astropy.units import Quantity from astropy.coordinates import Angle from gammapy.background import Cube __all__ = ['CubeUtils', ] class CubeUtils(): def plot_images(...
gpl-2.0
7,517,918,737,353,990,000
43.887789
113
0.490258
false
JR--Chen/flasky
migrations/versions/07ed638162d1_.py
1
2134
"""empty message Revision ID: 07ed638162d1 Revises: Create Date: 2017-10-03 19:51:05.854322 """ from alembic import op import sqlalchemy as sa # revision identifiers, used by Alembic. revision = '07ed638162d1' down_revision = None branch_labels = None depends_on = None def upgrade(): # ### commands auto gene...
mit
-5,977,526,651,945,121,000
34.566667
82
0.657919
false
alliance-genome/agr
indexer/test/testJsonLoader.py
3
5211
import json import argparse import os import fnmatch from mods import MOD parser = argparse.ArgumentParser(description='Test loader for JSON basic gene info file.') parser.add_argument('-d', '--data', help='JSON data file', required=True) args = parser.parse_args() # def load_genes(self): genes = MOD.genes def ge...
mit
2,404,008,043,715,498,500
41.713115
120
0.513145
false
repotvsupertuga/repo
plugin.video.SportsDevil/service/oscrypto/_win/symmetric.py
7
30673
# coding: utf-8 from __future__ import unicode_literals, division, absolute_import, print_function from .._errors import pretty_message from .._ffi import ( buffer_from_bytes, bytes_from_buffer, deref, new, null, pointer_set, struct, struct_bytes, unwrap, write_to_buffer, ) from...
gpl-2.0
6,002,887,324,985,147,000
25.328755
107
0.560102
false
daenamkim/ansible
lib/ansible/modules/windows/win_scheduled_task_stat.py
21
10125
#!/usr/bin/python # -*- coding: utf-8 -*- # Copyright (c) 2017 Ansible Project # GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt) # this is a windows documentation stub. actual code lives in the .ps1 # file of the same name ANSIBLE_METADATA = {'metadata_version': '1.1', ...
gpl-3.0
-587,307,774,060,826,000
26.588556
92
0.622914
false
stevekuznetsov/ansible
lib/ansible/modules/cloud/openstack/os_keystone_service.py
15
6470
#!/usr/bin/python # Copyright 2016 Sam Yaple # # This module 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 software is distr...
gpl-3.0
1,704,064,927,533,865,000
28.678899
82
0.609583
false
rbalda/neural_ocr
env/lib/python2.7/site-packages/matplotlib/tests/test_animation.py
7
2669
from __future__ import (absolute_import, division, print_function, unicode_literals) from matplotlib.externals import six import os import tempfile import numpy as np from nose import with_setup from matplotlib import pyplot as plt from matplotlib import animation from matplotlib.testing.nosec...
mit
243,882,891,836,134,560
28.655556
74
0.60547
false
solvire/ordo_electro
ordo_electro/users/migrations/0001_initial.py
64
2694
# -*- coding: utf-8 -*- from __future__ import unicode_literals from django.db import models, migrations import django.utils.timezone import django.core.validators class Migration(migrations.Migration): dependencies = [ ('auth', '0001_initial'), ] operations = [ migrations.CreateModel( ...
bsd-3-clause
3,848,806,492,422,327,300
66.35
289
0.639198
false
rpufky/trafficserver
tests/gold_tests/body_factory/http204_response.test.py
2
3842
''' Tests that 204 responses conform to rfc2616, unless custom templates override. ''' # 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 license...
apache-2.0
-425,446,826,282,480,260
39.442105
187
0.728787
false
villawang/SNAP
src/modules/Speech/obj_animals.py
2
9177
from framework.latentmodule import LatentModule from direct.gui.DirectGui import DirectButton #from direct.gui.DirectGuiGlobals import RIDGE from panda3d.core import NodePath from panda3d.core import TextProperties, TextPropertiesManager import random import time import itertools class Main(LatentModule): def __in...
bsd-3-clause
-5,678,417,561,880,071,000
49.701657
227
0.543315
false
trol73/avr-lcd-module-128x128
software/python/test.py
1
5665
#!/usr/bin/python # -*- coding: windows-1251 -*- import random import time import sys from display import Display __author__ = 'Trol' #dev = Display('com4', 56000) #dev = Display('/dev/tty.wchusbserial14230', 57600) dev = Display('simulator://localhost', 3310) #dev = Display('/dev/tty.wchusbserial14230', 9600) #p...
gpl-3.0
190,954,994,993,616,100
25.853081
125
0.665843
false
alon/polinax
libs/external_libs/python-openid-2.1.1/openid/test/test_examples.py
87
6315
"Test some examples." import socket import os.path, unittest, sys, time from cStringIO import StringIO import twill.commands, twill.parse, twill.unit from openid.consumer.discover import \ OpenIDServiceEndpoint, OPENID_1_1_TYPE from openid.consumer.consumer import AuthRequest class TwillTest(twill.unit.TestInf...
gpl-2.0
2,315,778,230,040,911,000
33.135135
77
0.613302
false
IntelPython/ibench
ibench/benchmarks/bench.py
1
2459
# Copyright (C) 2016-2018 Intel Corporation # # SPDX-License-Identifier: MIT from __future__ import print_function import gc import numpy as np import sys import time class Bench: _dtype = np.double def __init__(self, cmd): self.name = self.__class__.__name__ self._cmd = cmd def _log(sel...
mit
719,797,664,914,553,500
30.126582
75
0.394063
false
sebastienc/kubernetes-py
kubernetes_py/models/v1/NodeCondition.py
3
4420
#!/usr/bin/env python # -*- coding: utf-8 -*- # # This file is subject to the terms and conditions defined in # file 'LICENSE.md', which is part of this source code package. # from kubernetes_py.utils import filter_model, is_valid_date_time class NodeCondition(object): """ https://kubernetes.io/docs/api-refe...
apache-2.0
8,967,870,095,249,835,000
32.484848
112
0.514932
false
Svaazz/escaner-web
langES.py
1
1359
def main(palabra): return { 'cabecera1':"""\ ################ Escaner Web ############### URL actual: """, 'cabecera2':""" ############################################ """, 'menu1':""" 0. Salir. 1. Buscar cadena de caracteres. 2. Guardar contenido en el disco. 3. Cambiar url. 4. Escanear puertos ...
gpl-2.0
-4,261,498,559,207,561,700
33.846154
96
0.551876
false
blrm/robottelo
robottelo/ui/usergroup.py
2
3578
# -*- encoding: utf-8 -*- """Implements User groups UI.""" from robottelo.constants import FILTER from robottelo.ui.base import Base, UIError from robottelo.ui.locators import locators, common_locators, tab_locators from robottelo.ui.navigator import Navigator class UserGroup(Base): """Implements the CRUD functio...
gpl-3.0
4,123,606,780,255,651,000
39.202247
78
0.57043
false
markovmodel/PyEMMA
pyemma/_base/parallel.py
1
2643
def get_n_jobs(logger=None): def _from_hardware(): import psutil count = psutil.cpu_count(logical=True) if count is None: # this might happen if psutil cannot determine cpu count count = 1 return count def _from_env(var): import os e = os.getenv(va...
lgpl-3.0
-1,765,059,281,379,586,000
35.205479
120
0.586455
false
Donkyhotay/MoonPy
zope/testing/loghandler.py
4
2690
############################################################################## # # Copyright (c) 2003 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. # THIS SO...
gpl-3.0
-8,170,583,359,952,592,000
33.935065
78
0.597398
false
googledatalab/pydatalab
solutionbox/image_classification/setup.py
1
1682
# Copyright 2017 Google Inc. All rights reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except # in compliance with the License. You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed ...
apache-2.0
-218,534,776,819,365,820
30.148148
99
0.701546
false
NMGRL/pychron
pychron/graph/graph_container.py
2
1295
# =============================================================================== # Copyright 2012 Jake Ross # # 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/licens...
apache-2.0
1,270,623,409,349,355,500
38.242424
81
0.555212
false
kambysese/mne-python
examples/inverse/plot_covariance_whitening_dspm.py
16
6905
""" .. _ex-covariance-whitening-dspm: =================================================== Demonstrate impact of whitening on source estimates =================================================== This example demonstrates the relationship between the noise covariance estimate and the MNE / dSPM source amplitudes. It c...
bsd-3-clause
-6,566,026,213,573,782,000
36.93956
79
0.606807
false
tkacikdominik/auto-gate-opener
masters/raspiMaster/RFMregisters.py
11
28225
#!/usr/bin/env python # ********************************************************************************** # Registers used in driver definition for HopeRF RFM69W/RFM69HW, Semtech SX1231/1231H # ********************************************************************************** # Copyright Felix Rusu (2014), felix@lowp...
mit
7,627,521,435,502,395,000
24.823422
154
0.737998
false
rbarlow/pulp
server/pulp/server/content/web/settings.py
1
2140
import ConfigParser import logging import os from pulp.server import logs as pulp_logs from pulp.server import config try: log_level = config.config.get('server', 'log_level') log_level = getattr(logging, log_level.upper()) except (ConfigParser.NoOptionError, AttributeError): # If the user didn't provide...
gpl-2.0
-637,786,438,337,442,700
25.419753
95
0.618224
false
tensorflow/model-optimization
tensorflow_model_optimization/python/core/quantization/keras/collaborative_optimizations/cluster_preserve/cluster_utils.py
1
4629
# 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
7,384,233,385,050,128,000
36.330645
80
0.668395
false
PowerShellEmpire/Empire
lib/modules/powershell/collection/ninjacopy.py
10
4109
from lib.common import helpers class Module: def __init__(self, mainMenu, params=[]): self.info = { 'Name': 'Invoke-NinjaCopy', 'Author': ['@JosephBialek'], 'Description': ('Copies a file from an NTFS partitioned volume by reading the ' 'r...
bsd-3-clause
4,989,571,720,808,305,000
37.046296
151
0.506449
false
jswope00/GAI
lms/djangoapps/courseware/tests/test_lti_integration.py
2
4365
"""LTI integration tests""" import oauthlib from . import BaseTestXmodule from collections import OrderedDict import mock import urllib class TestLTI(BaseTestXmodule): """ Integration test for lti xmodule. It checks overall code, by assuring that context that goes to template is correct. As part of ...
agpl-3.0
2,582,122,145,585,736,000
40.971154
134
0.616953
false
chepazzo/trigger
trigger/tacacsrc.py
10
18387
# -*- coding: utf-8 -*- """Abstract interface to .tacacsrc credentials file. Designed to interoperate with the legacy DeviceV2 implementation, but provide a reasonable API on top of that. The name and format of the .tacacsrc file are not ideal, but compatibility matters. """ __author__ = 'Jathan McCollum, Mark Thom...
bsd-3-clause
-1,090,951,858,817,401,900
34.982387
101
0.579268
false
QiJune/Paddle
python/paddle/fluid/tests/unittests/test_generate_proposals.py
1
12161
# Copyright (c) 2018 PaddlePaddle 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://w_idxw.apache.org/licenses/LICENSE-2.0 # # Unless required by ...
apache-2.0
1,997,622,117,950,681,600
37.003125
83
0.573308
false
fenglu-g/incubator-airflow
airflow/contrib/example_dags/example_kubernetes_executor.py
5
2972
# -*- coding: utf-8 -*- # # 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 #...
apache-2.0
8,213,031,048,003,607,000
29.639175
89
0.626514
false
dbarbier/ot-svn
python/doc/sphinxext/numpydoc/traitsdoc.py
3
4289
""" ========= traitsdoc ========= Sphinx extension that handles docstrings in the Numpy standard format, [1] and support Traits [2]. This extension can be used as a replacement for ``numpydoc`` when support for Traits is required. .. [1] http://projects.scipy.org/numpy/wiki/CodingStyleGuidelines#docstring-standard ....
gpl-3.0
-7,121,825,357,035,882,000
28.176871
84
0.553043
false
klahnakoski/TestFailures
pyLibrary/jsons/stream.py
1
12653
# encoding: utf-8 # # # 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/. # # Author: Kyle Lahnakoski (kyle@lahnakoski.com) # from __future__ import unicode_literals from __...
mpl-2.0
3,811,702,646,630,441,000
31.864935
123
0.497827
false
mdunker/usergrid
utils/usergrid-util-python/usergrid_tools/iterators/simple_iterator.py
2
3154
# */ # * 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...
apache-2.0
2,936,233,379,535,304,700
30.237624
167
0.651871
false
w4ngyi/flocker
flocker/common/test/test_defer.py
15
4612
# Copyright Hybrid Logic Ltd. See LICENSE file for details. """ Tests for ``flocker.common._defer``. """ import gc from .._defer import gather_deferreds from twisted.internet.defer import fail, FirstError, succeed, Deferred from twisted.python.failure import Failure from twisted.trial.unittest import TestCase cl...
apache-2.0
4,349,294,221,273,305,600
31.027778
77
0.626409
false
LUTAN/tensorflow
tensorflow/python/tools/saved_model_cli.py
1
24543
# 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
6,151,665,894,734,196,000
37.650394
81
0.673308
false
felipeacsi/python-acoustics
acoustics/cepstrum.py
2
7228
""" Cepstrum ======== """ import numpy as np __all__ = ['complex_cepstrum', 'real_cepstrum', 'inverse_complex_cepstrum', 'minimum_phase'] def complex_cepstrum(x, n=None): r"""Compute the complex cepstrum of a real sequence. Parameters ---------- x : ndarray Real sequence to compute complex...
bsd-3-clause
-8,833,180,735,673,191,000
28.028112
117
0.608744
false
andrei-alpha/Jessica
aiml2/PatternMgr.py
11
11309
# This class implements the AIML pattern-matching algorithm described # by Dr. Richard Wallace at the following site: # http://www.alicebot.org/documentation/matching.html import marshal import pprint import re import string import sys class PatternMgr: # special dictionary keys _UNDERSCORE = 0 _STAR ...
mit
-1,342,189,491,186,077,400
32.166163
100
0.638164
false
tumbl3w33d/ansible
lib/ansible/modules/network/fortimanager/fmgr_secprof_spam.py
38
20467
#!/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
663,343,243,589,913,700
32.44281
117
0.626472
false
google/transperf
orch.py
1
12654
#!/usr/bin/env python2 # # Copyright 2019 Google 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 # # https://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law ...
apache-2.0
5,007,469,360,055,953,000
34.247911
80
0.589537
false
rvalyi/openerp-pt_br
tests_use_case/test_services_sale_to_invoice.py
2
5603
def test_services_sale_to_invoice(oerp): #create empty fiscal classification for the service prod_fc_obj = oerp.pool.get('account.product.fiscal.classification') prod_fc_id = prod_fc_obj.create(oerp.cr, 1, { 'name': 'isento', 'description': 'isento' }) assert prod_fc_obj.brows...
agpl-3.0
-7,878,128,426,028,735,000
31.017143
120
0.553097
false
hammerlab/mhcflurry
downloads-generation/models_class1_processing/generate_hyperparameters.variants.py
1
1335
""" Generate grid of hyperparameters """ from sys import stdout, argv from copy import deepcopy from yaml import dump, load import argparse parser = argparse.ArgumentParser(usage=__doc__) parser.add_argument( "production_hyperparameters", metavar="data.json", help="Production (i.e. standard) hyperparamete...
apache-2.0
3,774,828,461,157,599,000
28.666667
84
0.682397
false
bbxyard/bbxyard
yard/skills/66-python/cookbook/yvhai/demo/misc/baidu_search.py
1
1949
import requests import re import os class getURLs(object): """docstring for getURLs""" def __init__(self): super(getURLs, self).__init__() ''' 输入参数:搜索关键字 输出:此关键字的url到文本 ''' def getURL(self, keyword, filename): page_count = 0 url = 'http://www...
apache-2.0
3,222,734,550,536,684,500
31.534483
130
0.540541
false
tjcsl/ion
intranet/apps/eighth/tests/eighth_test.py
1
4222
from django.contrib.auth import get_user_model from django.urls import reverse from ....test.ion_test import IonTestCase from ....utils.date import get_senior_graduation_year from ...users.models import User from ..models import EighthActivity, EighthBlock, EighthRoom, EighthScheduledActivity class EighthAbstractTes...
gpl-2.0
-3,497,730,511,037,716,000
37.036036
141
0.632165
false
gaddman/ansible
lib/ansible/plugins/inventory/constructed.py
17
5105
# Copyright (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 = ''' name: constructed plugin_type: inventory version_added: "2.4" sh...
gpl-3.0
-5,281,298,789,278,184,000
39.19685
131
0.653281
false
keisuke-umezawa/chainer
tests/chainer_tests/links_tests/normalization_tests/test_group_normalization.py
2
6006
import unittest import numpy import chainer from chainer import backend from chainer.backends import cuda from chainer import gradient_check from chainer import links from chainer import testing from chainer.testing import attr from chainer.testing import condition @testing.parameterize(*(testing.product({ 'sha...
mit
-4,029,064,935,668,502,500
31.117647
79
0.622211
false
weidwonder/async-iter
async_iter/async_iter.py
1
7094
import datetime import operator __version__ = '0.1.3' try: import Queue except ImportError: import queue as Queue import threading import sys class ThreadPool: """ Customized thread pool """ class TreadPoolException(Exception): pass class NULLKEY: pass def __init_...
mit
-13,911,177,805,058,664
30.811659
87
0.508317
false
Juniper/contrail-dev-controller
src/config/vnc_openstack/vnc_openstack/tests/test_apply_sn_host_routes.py
5
3940
import testscenarios import testtools from vnc_openstack.neutron_plugin_db import DBInterface load_tests = testscenarios.load_tests_apply_scenarios class FakeRouteTable(object): def __init__(self, prefix, next_hop): self.prefix = prefix self.next_hop = next_hop def get_prefix(self): r...
apache-2.0
-8,307,272,795,508,546,000
39.618557
77
0.603553
false
blockstack/secret-sharing
secretsharing/primes.py
4
1686
# -*- coding: utf-8 -*- """ Secret Sharing ~~~~~ :copyright: (c) 2014 by Halfmoon Labs :license: MIT, see LICENSE for more details. """ def calculate_mersenne_primes(): """ Returns all the mersenne primes with less than 500 digits. All primes: 3, 7, 31, 127, 8191, 131071, 524287, ...
mit
-2,968,743,116,229,238,300
31.423077
79
0.64828
false
pothosware/gnuradio
gr-analog/python/analog/qa_pll_carriertracking.py
40
6967
#!/usr/bin/env python # # Copyright 2004,2007,2010-2013 Free Software Foundation, Inc. # # This file is part of GNU Radio # # GNU Radio 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, or (at ...
gpl-3.0
-244,564,971,308,946,240
43.375796
79
0.687814
false
grompe/magnet2
plugin_command_quote.py
1
3344
# Magnet2 by Grom PE. Public domain. import xmpp, random, time from magnet_api import * from magnet_utils import * quote_db = {} def getquote(bot, room, number): if not room in quote_db: return if number > len(quote_db[room]) or number < 1: return return quote_db[room][number-1] def addquote(bot, room, quotedi...
gpl-3.0
5,436,325,580,419,295,000
30.54717
97
0.646232
false
randynobx/ansible
lib/ansible/plugins/action/nxos.py
25
5627
# # (c) 2016 Red Hat Inc. # # This file is part of Ansible # # Ansible is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation, either version 3 of the License, or # (at your option) any later version. # # Ansible is d...
gpl-3.0
-3,456,524,099,627,244,500
37.806897
122
0.595344
false
franek/weboob
modules/bp/pages/login.py
1
3010
# -*- coding: utf-8 -*- # Copyright(C) 2010-2011 Nicolas Duhamel # # This file is part of weboob. # # weboob 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 Foundation, either version 3 of the License, or # (at yo...
agpl-3.0
-8,613,565,864,074,060,000
35.707317
165
0.72392
false
9929105/KEEP
keep_backend/backend/views.py
2
5989
import json from backend.forms import RegistrationFormUserProfile from backend.forms import ResendActivationForm from django.core import serializers from django.core.urlresolvers import reverse from django.contrib.sites.models import RequestSite from django.contrib.auth.decorators import login_required from django.co...
mit
5,847,736,867,595,743,000
35.742331
93
0.599098
false
SeiryuZ/HemeWeb
src/jobs/migrations/0013_auto_20160811_1728.py
1
1957
# -*- coding: utf-8 -*- # Generated by Django 1.9.7 on 2016-08-11 17:28 from __future__ import unicode_literals import core.fields import django.core.validators from django.db import migrations, models import jobs.models class Migration(migrations.Migration): dependencies = [ ('jobs', '0012_auto_2016080...
lgpl-3.0
6,790,212,518,610,137,000
39.770833
178
0.61676
false
haymeister/pico-python
picoscope/ps3000.py
1
12218
# This is the instrument-specific file for the PS3000a series of instruments. # # pico-python is Copyright (c) 2013-2014 By: # Colin O'Flynn <coflynn@newae.com> # Mark Harfouche <mark.harfouche@gmail.com> # All rights reserved. # # Redistribution and use in source and binary forms, with or without # modification, are p...
bsd-2-clause
-5,850,059,524,549,964,000
42.173145
104
0.584957
false
scotte/pitmon
pitmon/poller.py
1
2197
import threading import time import copy from cyberqinterface.cyberqinterface import CyberQInterface import config # TODO: param url and json file class Poller(threading.Thread): last = dict() def setUrl(self, url): self.url = url def run(self): cyberq = CyberQInterface(self.url) ...
gpl-3.0
6,111,166,735,283,216,000
33.328125
101
0.476104
false
asljivo1/802.11ah-ns3
ns-3/.waf-1.8.12-f00e5b53f6bbeab1384a38c9cc5d51f7/waflib/Tools/irixcc.py
11
1166
#! /usr/bin/env python # encoding: utf-8 # WARNING! Do not edit! https://waf.io/book/index.html#_obtaining_the_waf_file import os from waflib import Utils from waflib.Tools import ccroot,ar from waflib.Configure import conf @conf def find_irixcc(conf): v=conf.env cc=None if v['CC']:cc=v['CC'] elif'CC'in conf.envir...
gpl-2.0
3,673,663,501,022,139,400
23.808511
78
0.638079
false
cmelange/ansible
lib/ansible/modules/system/ping.py
27
2108
#!/usr/bin/python # -*- coding: utf-8 -*- # (c) 2012, Michael DeHaan <michael.dehaan@gmail.com> # (c) 2016, Toshio Kuratomi <tkuratomi@ansible.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...
gpl-3.0
-3,172,555,400,153,637,400
30.462687
96
0.675996
false
faith0811/zerorpc-python
tests/test_middleware_before_after_exec.py
18
10456
# -*- coding: utf-8 -*- # Open Source Initiative OSI - The MIT License (MIT):Licensing # # The MIT License (MIT) # Copyright (c) 2015 François-Xavier Bourlet (bombela+zerorpc@gmail.com) # # Permission is hereby granted, free of charge, to any person obtaining a copy of # this software and associated documentation files...
mit
-4,923,409,510,136,008,000
31.671875
81
0.685509
false
AntonioMeireles/kubernetes
cluster/juju/charms/trusty/kubernetes/unit_tests/lib/test_registrator.py
1
1601
import json from mock import MagicMock, patch, call from path import Path import pytest import sys d = Path('__file__').parent.abspath() / 'hooks' sys.path.insert(0, d.abspath()) from lib.registrator import Registrator class TestRegistrator(): def setup_method(self, method): self.r = Registrator() ...
apache-2.0
5,970,473,903,873,341,000
34.577778
274
0.620237
false
daniel-kurushin/rpd-pnipu
forms/loginform.py
1
2058
#!usr/bin/python3 # -*- coding: utf-8 -*- from bs4 import BeautifulSoup as BS from exceptions import WrongPasswordError, WrongUsernameError class LoginForm(): """Форма входа в систему.""" def __init__(self, login = None, password = None, redirect = None, error = None): self.login = login self...
gpl-3.0
5,073,613,259,733,811,000
34.963636
85
0.594034
false
cloudbase/cinder
cinder/tests/unit/volume/drivers/test_kaminario.py
4
22382
# Copyright (c) 2016 by Kaminario Technologies, Ltd. # 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
2,579,874,778,422,397,000
39.843066
79
0.626709
false
kenwang815/KodiPlugins
script.module.youtube.dl/lib/youtube_dl/extractor/xiami.py
10
5458
# coding: utf-8 from __future__ import unicode_literals from .common import InfoExtractor from ..compat import compat_urllib_parse_unquote from ..utils import int_or_none class XiamiBaseIE(InfoExtractor): _API_BASE_URL = 'http://www.xiami.com/song/playlist/cat/json/id' def _download_webpage(self, *args, **k...
gpl-2.0
-4,041,594,635,501,467,600
31.095238
96
0.503895
false
mate-desktop/python-mate
examples/popt/goption.py
1
1040
#!/usr/bin/python """ http://live.mate.org/MateGoals/PoptGOption Since MATE 2.10, GLib provides GOption, a commandline option parser. The help output of your program will be much nicer :-) And it will enable us to slowly get rid of popt (even if libmate will still have to depend on it for compatibility reasons). ""...
lgpl-2.1
-3,691,591,839,829,570,600
27.888889
79
0.610577
false
massmutual/scikit-learn
sklearn/linear_model/tests/test_least_angle.py
1
20886
from nose.tools import assert_equal import numpy as np from scipy import linalg from sklearn.cross_validation import train_test_split from sklearn.utils.testing import assert_array_almost_equal from sklearn.utils.testing import assert_true from sklearn.utils.testing import assert_less from sklearn.utils.testing impor...
bsd-3-clause
-7,071,752,152,734,517,000
37.393382
79
0.603371
false
maas/maas
src/provisioningserver/utils/dhclient.py
1
2326
# Copyright 2016 Canonical Ltd. This software is licensed under the # GNU Affero General Public License version 3 (see the file LICENSE). """Helpers for inspecting dhclient.""" import os import re from provisioningserver.utils.fs import read_text_file from provisioningserver.utils.ps import get_running_pids_with_c...
agpl-3.0
2,141,347,903,114,189,300
32.710145
74
0.583835
false
wofanli/trex-core
scripts/external_libs/PyYAML-3.01/lib/yaml/error.py
2
2551
__all__ = ['Mark', 'YAMLError', 'MarkedYAMLError'] class Mark: def __init__(self, name, index, line, column, buffer, pointer): self.name = name self.index = index self.line = line self.column = column self.buffer = buffer self.pointer = pointer def get_snippet...
apache-2.0
3,833,400,392,857,612,300
33.013333
91
0.529596
false
synergeticsedx/deployment-wipro
common/lib/xmodule/xmodule/graders.py
9
17427
""" Code used to calculate learner grades. """ from __future__ import division import abc from collections import OrderedDict import inspect import logging import random import sys log = logging.getLogger("edx.courseware") class ScoreBase(object): """ Abstract base class for encapsulating fields of values...
agpl-3.0
524,207,887,401,977,540
41.608802
117
0.640673
false
GetBlimp/boards-backend
blimp_boards/users/authentication.py
2
1085
from rest_framework import exceptions from rest_framework.authentication import SessionAuthentication from rest_framework_jwt.settings import api_settings from rest_framework_jwt.authentication import JSONWebTokenAuthentication from .models import User jwt_decode_handler = api_settings.JWT_DECODE_HANDLER class JWT...
agpl-3.0
3,154,375,411,323,548,700
26.820513
76
0.657143
false
wfxiang08/changes
migrations/versions/4cd8cf6a0894_migrate_projectplan.py
3
1152
"""Migrate ProjectPlan Revision ID: 4cd8cf6a0894 Revises: 40429d3569cf Create Date: 2014-10-09 14:39:25.015079 """ # revision identifiers, used by Alembic. revision = '4cd8cf6a0894' down_revision = '40429d3569cf' from alembic import op from sqlalchemy.sql import table import sqlalchemy as sa def upgrade(): co...
apache-2.0
-501,917,456,218,966,340
23.510638
72
0.612847
false
linglaiyao1314/SFrame
oss_src/unity/python/sframe/meta/asttools/mutators/prune_mutator.py
15
4454
''' Created on Jul 18, 2011 @author: sean ''' import _ast from ...asttools import Visitor, visit_children def removeable(self, node): ''' node is removable only if all of its children are as well. ''' throw_away = [] for child in self.children(node): throw_away.append(self.visit(child)) ...
bsd-3-clause
-184,397,281,524,205,570
23.882682
137
0.577009
false
mcameron/ansible-modules-extras
cloud/lxc/lxc_container.py
9
55307
#!/usr/bin/python # -*- coding: utf-8 -*- # (c) 2014, Kevin Carter <kevin.carter@rackspace.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
-6,807,965,647,202,754,000
30.914022
79
0.545464
false
Qalthos/ansible
lib/ansible/plugins/test/core.py
23
6524
# (c) 2012, Jeroen Hoekx <jeroen@hoekx.be> # # 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
-8,003,654,895,887,327,000
31.29703
101
0.622624
false
lowitty/server
libsLinux/twisted/python/components.py
12
14954
# -*- test-case-name: twisted.python.test.test_components -*- # Copyright (c) Twisted Matrix Laboratories. # See LICENSE for details. """ Component architecture for Twisted, based on Zope3 components. Using the Zope3 API directly is strongly recommended. Everything you need is in the top-level of the zope.interface ...
mit
926,785,324,209,291,100
32.454139
85
0.667514
false
chuckinator0/Projects
scripts/topological_sort.py
1
1428
''' implement topological sort, which ensures an ordering of nodes so that no node is a parent of subsequent nodes. This assumes the input is a directed acyclic graph. For testing whether a directed graph is acyclic, see course_schedule.py ''' def dfs(graph, node, sorted_stack, visited, unvisited): # Remove node fr...
gpl-3.0
7,894,138,620,116,242,000
25.943396
111
0.70028
false
cbingos/hongmafund
reversion/management/commands/deleterevisions.py
5
8642
from __future__ import unicode_literals, print_function import datetime, operator, sys from optparse import make_option from django.core.management.base import BaseCommand from django.core.management.base import CommandError from django.db.models import Q, Count from django.contrib.contenttypes.models import ContentT...
mit
8,268,570,829,352,667,000
40.956311
223
0.568271
false
robbielynch/RoblySearch
roblyparser/tests/test_html_object.py
1
12322
from unittest import TestCase from roblyparser.html_object import HTMLObject from roblyparser.tokeniser import Tokens __author__ = 'robbie' class TestHTMLObject(TestCase): def setUp(self): pass def test_tokens_to_html_object_with_title(self): tokens = ["asdf", "<title>", "My title", "</title...
gpl-2.0
2,325,503,287,242,228,700
45.153558
129
0.56809
false
gautam1858/tensorflow
tensorflow/tools/compatibility/ast_edits_test.py
1
14493
# Copyright 2018 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
-330,397,979,769,243,000
32.394009
80
0.599186
false
chrisnatali/networkx
examples/subclass/printgraph.py
22
4198
""" Example subclass of the Graph class. """ __author__ = """Aric Hagberg (hagberg@lanl.gov)""" # Copyright (C) 2004-2015 by # Aric Hagberg <hagberg@lanl.gov> # Dan Schult <dschult@colgate.edu> # Pieter Swart <swart@lanl.gov> # All rights reserved. # BSD license. # __docformat__ = "restructuredtext e...
bsd-3-clause
1,883,637,800,204,080,000
30.096296
76
0.551215
false
ifduyue/sentry
tests/sentry/rules/conditions/test_tagged_event.py
2
3503
from __future__ import absolute_import from sentry.testutils.cases import RuleTestCase from sentry.rules.conditions.tagged_event import TaggedEventCondition, MatchType class TaggedEventConditionTest(RuleTestCase): rule_cls = TaggedEventCondition def get_event(self): event = self.event event....
bsd-3-clause
5,913,063,096,808,753,000
28.191667
80
0.511562
false
eethomas/eucalyptus
clc/eucadmin/eucadmin/deregistercluster.py
7
1481
# Copyright 2011-2012 Eucalyptus Systems, Inc. # # Redistribution and use of this software 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 ...
gpl-3.0
2,586,381,569,849,591,000
50.068966
74
0.792032
false
podemos-info/odoo
addons/project_scrum/wizard/mail_compose_message.py
9
2973
# -*- coding: utf-8 -*- ############################################################################## # # OpenERP, Open Source Management Solution # Copyright (C) 2010-Today OpenERP SA (<http://www.openerp.com>) # # This program is free software: you can redistribute it and/or modify # it under the terms o...
agpl-3.0
5,355,073,175,629,351,000
44.738462
182
0.595358
false
sssstest/GameEditor
IdeRoomEditor.py
1
14028
#!/usr/bin/env python #@section License # #Copyright (C) 2013 ssss #This file is a part of the GameEditor. # #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 #(a...
gpl-3.0
-5,768,723,233,643,562,000
33.895522
122
0.722626
false
futuresimple/mantrid
docs/conf.py
3
6198
# -*- coding: utf-8 -*- # # This file is execfile()d with the current directory set to its containing dir. # # Note that not all possible configuration values are present in this # autogenerated file. # # All configuration values have a default; values that are commented out # serve to show the default. import sys, os...
bsd-3-clause
2,324,899,010,967,776,000
31.450262
80
0.711036
false
zstyblik/infernal-twin
build/reportlab/tests/test_platypus_preformatted.py
14
8797
#Copyright ReportLab Europe Ltd. 2000-2012 #see license.txt for license details """Tests for context-dependent indentation """ __version__='''$Id: test_platypus_indents.py 3660 2010-02-08 18:17:33Z damian $''' from reportlab.lib.testutils import setOutDir,makeSuiteForClasses, outputfile, printLocation setOutDir(__name_...
gpl-3.0
3,968,867,683,454,857,700
40.107477
168
0.634535
false
vlachoudis/sl4a
python/src/Tools/msi/uuids.py
30
3332
# This should be extended for each Python release. # The product code must change whenever the name of the MSI file # changes, and when new component codes are issued for existing # components. See "Changing the Product Code". As we change the # component codes with every build, we need a new product code # each time. ...
apache-2.0
1,758,707,389,805,203,000
61.867925
88
0.653661
false
iemejia/beam
sdks/python/apache_beam/examples/wordcount.py
5
3201
# # Licensed to the Apache Software Foundation (ASF) under one or more # contributor license agreements. See the NOTICE file distributed with # this work for additional information regarding copyright ownership. # The ASF licenses this file to You under the Apache License, Version 2.0 # (the "License"); you may not us...
apache-2.0
-8,632,369,254,348,716,000
33.053191
78
0.706967
false
madgik/exareme
Exareme-Docker/src/exareme/exareme-tools/madis/src/functions/__init__.py
1
21051
"""functions """ VERSION = "1.9" import setpath import os.path import os import apsw import sqltransform import traceback import logging import re import sys import copy try: from collections import OrderedDict except ImportError: # Python 2.6 from lib.collections26 import OrderedDict try: from inspe...
mit
-3,170,617,962,619,249,700
32.627796
178
0.584485
false
fwilhe/PasswordCard
makePasswordCard.py
2
1266
#!/usr/bin/env python3 # Generate a CSV-File which represents a "password-card" as # described in c't 18/2014 page 92 # Licence: MIT # Author: Florian Wilhelm # TODO Would be nice to have other output-formats like PNG or PDF.. import random import csv # should not include ambiguous characters like l and 1 or O and 0...
mit
-7,846,098,407,043,835,000
23.823529
68
0.64613
false
IsmaelRLG/simpbot
setup.py
1
1944
#!/usr/bin/env python # SimpBot - Simple IRC Bot # # Author: Ismael Lugo <ismaelrlgv@gmail.com> # GIT: https://github.com/IsmaelRLG/simpbot try: from setuptools import setup, find_packages except ImportError: print("Please install the setuptools package") exit(1) from os import walk from os.path import jo...
mit
-4,043,737,842,383,184,000
31.949153
80
0.64249
false
Azure/azure-sdk-for-python
sdk/databoxedge/azure-mgmt-databoxedge/azure/mgmt/databoxedge/v2020_09_01_preview/aio/operations/_bandwidth_schedules_operations.py
1
21158
# 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
3,205,760,804,020,748,300
48.434579
224
0.644106
false
hgl888/chromium-crosswalk
build/android/tombstones.py
29
8049
#!/usr/bin/env python # # Copyright 2013 The Chromium Authors. All rights reserved. # Use of this source code is governed by a BSD-style license that can be # found in the LICENSE file. # # Find the most recent tombstone file(s) on all connected devices # and prints their stacks. # # Assumes tombstone file was created ...
bsd-3-clause
-2,705,359,559,284,274,000
30.940476
80
0.64977
false
David-Amaro/bank-payment
account_banking_payment_export/models/account_invoice.py
11
1328
# -*- coding: utf-8 -*- ############################################################################## # # Copyright (C) 2014 ACSONE SA (<http://acsone.eu>). # # All other contributions are (C) by their respective contributors # # All Rights Reserved # # This program is free software: you can redistribute i...
agpl-3.0
1,036,410,154,919,120,900
36.942857
78
0.612199
false
ruslanosipov/space
lib/event.py
1
6924
"""Input-to-event converter.""" import pygame pygame.init() pygame.key.set_repeat(100, 100) TRACK_EVENTS = [ pygame.QUIT, pygame.KEYDOWN] IGNORE_EVENTS = [ pygame.ACTIVEEVENT, pygame.KEYUP, pygame.MOUSEMOTION, pygame.MOUSEBUTTONUP, pygame.MOUSEBUTTONDOWN, pygame.JOYAXISMOTION, p...
gpl-2.0
-5,839,716,009,599,773,000
33.62
79
0.39948
false