repo_name
stringlengths
5
92
path
stringlengths
4
221
copies
stringclasses
19 values
size
stringlengths
4
6
content
stringlengths
766
896k
license
stringclasses
15 values
hash
int64
-9,223,277,421,539,062,000
9,223,102,107B
line_mean
float64
6.51
99.9
line_max
int64
32
997
alpha_frac
float64
0.25
0.96
autogenerated
bool
1 class
ratio
float64
1.5
13.6
config_test
bool
2 classes
has_no_keywords
bool
2 classes
few_assignments
bool
1 class
1orwell/yrs2013
fake.py
1
3440
'''Generate necessary dump files''' #options size = 100 regenerate_graph = False days = 1 force_layout = False default = str(size)+'.dat' ### import igraph, pickle, random, os import math from collections import OrderedDict def process(fout): output = os.path.join('data',fout) try: #load graph if...
mit
7,964,937,547,895,710,000
26.96748
173
0.54157
false
3.706897
false
false
false
antiface/audiolazy
audiolazy/lazy_io.py
1
14038
# -*- coding: utf-8 -*- # This file is part of AudioLazy, the signal processing Python package. # Copyright (C) 2012-2014 Danilo de Jesus da Silva Bellini # # AudioLazy 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 Foun...
gpl-3.0
-8,054,913,346,017,574,000
30.195556
79
0.616826
false
4.131254
false
false
false
Answeror/aip
aip/imfs/cascade.py
1
1705
from .base import NameMixin def load_ext(name, bases): return need_raw( name, bases, lambda base: base.load(name) ) def thumbnail_ext(name, width, height, bases): return need_raw( name, bases, lambda base: base.thumbnail(name, width, height) ) def mt...
mit
-1,043,821,107,190,842,800
20.049383
61
0.537243
false
3.747253
false
false
false
JustRamon/SpeechController
SC.py
1
1113
#!/usr/bin/env python3 import speech_recognition as sr import ksr10 import time arm = ksr10.ksr10_class() while 1: r = sr.Recognizer() with sr.Microphone() as source: print("Say something!") audio = r.listen(source) try: rn = r.recognize_google(audio) except sr.UnknownValueError: print("Goog...
gpl-2.0
-2,197,478,390,076,488,000
22.1875
97
0.607367
false
2.625
false
false
false
starbt/flea_market
market/migrations/0006_auto_20161206_2033.py
1
1232
# -*- coding: utf-8 -*- # Generated by Django 1.10.2 on 2016-12-06 12:33 from __future__ import unicode_literals from django.db import migrations, models class Migration(migrations.Migration): dependencies = [ ('market', '0005_auto_20161206_1204'), ] operations = [ migrations.AddField( ...
mit
-7,127,938,892,819,470,000
29.8
160
0.571429
false
3.911111
false
false
false
UbiCastTeam/touchwizard
touchwizard/canvas.py
1
16655
# -*- coding: utf-8 -* import clutter import gobject import easyevent import logging import os import time from touchwizard.loading import LoadingWidget logger = logging.getLogger('touchwizard') class Canvas(clutter.Actor, clutter.Container, easyevent.User): """Wizard main actor which manages the user interfac...
gpl-3.0
398,874,673,450,197,570
36.093541
130
0.593215
false
3.969256
false
false
false
AnthillTech/python-mewa-client
examples/main.py
1
1354
''' Created on 27 lip 2014 @author: Krzysztof Langner ''' from mewa.client import Connection HOST_URL = "ws://mewa.cc:9001/ws" # HOST_URL = "ws://localhost:9000/ws" connection = Connection(HOST_URL) def onConnected(): connection.getDevices() connection.sendEvent("serviceA.event2", "78", True) params =...
bsd-2-clause
3,212,027,003,129,120,000
27.208333
157
0.669129
false
3.351485
false
false
false
rickerc/cinder_audit
cinder/tests/db/test_finish_migration.py
1
2226
# Copyright 2013 IBM Corp. # # Licensed under the Apache License, Version 2.0 (the "License"); you may # not use this file except in compliance with the License. You may obtain # a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed t...
apache-2.0
1,801,730,165,042,376,000
41
78
0.609164
false
4.533605
true
false
false
miguelut/utmbu
mbu/api/scout.py
1
1603
from django.contrib.admin.views.decorators import staff_member_required from django.http import JsonResponse from django.contrib.auth.decorators import permission_required from rest_framework.decorators import api_view from mbu.models import Scout, ScoutCourseInstance, ScoutCourseInstanceSerializer, RegistrationStatus ...
mit
6,069,730,055,826,966,000
32.395833
100
0.69869
false
3.634921
false
false
false
EqAfrica/machinekit
nosetests/test_netcmd.py
1
3441
#!/usr/bin/env python from nose import with_setup from machinekit.nosetests.realtime import setup_module,teardown_module from machinekit.nosetests.support import fnear from machinekit import hal import os def test_component_creation(): global c1,c2 c1 = hal.Component("c1") c1.newpin("s32out", hal.HAL_S32...
lgpl-2.1
-2,024,453,520,305,950,200
24.87218
99
0.610869
false
2.913633
true
false
false
daanwierstra/pybrain
pybrain/rl/learners/search/incrementalcomplexity/incrementalcomplexity.py
1
1767
__author__ = 'Tom Schaul, tom@idsia.ch' # TODO: inheritance! class IncrementalComplexitySearch(object): """ Draft of an OOPS-inspired search that incrementally expands the search space and the allocated time (to a population of search processes). """ def __init__(self, initSearchProcess, maxPhases =...
bsd-3-clause
4,677,843,574,635,908,000
33.666667
99
0.578947
false
4.330882
false
false
false
marteinn/wagtail-alt-generator
wagtailaltgenerator/tests/demosite/settings.py
1
2042
#!/usr/bin/env python import os DEBUG = False TIME_ZONE = "Europe/Stockholm" DATABASES = {"default": {"ENGINE": "django.db.backends.sqlite3"}} SECRET_KEY = "not needed" USE_TZ = True LANGUAGE_CODE = "en" INSTALLED_APPS = [ "django.contrib.contenttypes", "django.contrib.auth", "django.contrib.sites"...
mit
-7,871,863,058,548,776,000
27.760563
78
0.669931
false
3.816822
false
true
false
jparicka/twitter-tools
profiles/models.py
1
1328
from django.db import models from django.contrib.auth.models import User from django.conf import settings class Profile(models.Model): user = models.OneToOneField(User) name = models.CharField(max_length=100, blank=True, verbose_name="name", db_index=True) headline = models.CharField(max_length=...
mit
-2,055,734,439,932,275,200
44.827586
100
0.730422
false
3.47644
false
false
false
rcatwood/Savu
savu/data/data_structures/data_type.py
1
4089
# Copyright 2014 Diamond Light Source 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 applicable law or agreed t...
gpl-3.0
2,109,054,481,640,022,500
33.361345
78
0.604304
false
3.518933
false
false
false
pablolizardo/dotfiles
inkscape/symbols/generate.py
1
1934
#!/usr/bin/env python # -*- coding: utf-8 -*- """ inkscapeSymbolGenerator: A inkscape symbol library generator Copyright (C) 2015 Xavi Julián Olmos See the file LICENSE for copying permission. """ import sys, os import logging from optparse import OptionParser ####Objetivo #If select all merge all files...
gpl-2.0
-4,980,966,128,883,437,000
31.2
84
0.623706
false
3.551471
false
false
false
broxtronix/distributed
distributed/diagnostics/progress.py
1
9766
from __future__ import print_function, division, absolute_import from collections import defaultdict import logging import sys import threading import time from timeit import default_timer import dask from toolz import valmap, groupby, concat from tornado.ioloop import PeriodicCallback, IOLoop from tornado import gen...
bsd-3-clause
-4,504,122,622,001,199,000
32.331058
81
0.574135
false
3.991009
false
false
false
iojancode/botija
plug.livolo.py
1
1887
import time import sys import RPi.GPIO as GPIO off = '1242424352424342424242424242425342524342' b0 = '12424243524243424242424242424242424242424242' b1 = '124242435242434242424242424242534242424242' b2 = '1242424352424342424242424242425353424242' b3 = '124242435242434242424242424242424253424242' b4 = '12424243524243424...
gpl-3.0
-279,637,103,844,104,030
32.122807
66
0.606253
false
2.867781
false
false
false
flipdazed/SoftwareDevelopment
common.py
1
10121
#!/usr/bin/env python # encoding: utf-8 # contains the common actions import random from logs import * class Card(object): """Creates the card objects used in game""" def __init__(self, name, attack, money, cost, name_padding=15, num_padding=2): self.name = name self.cost = cost self....
gpl-3.0
8,199,571,315,852,250,000
35.021352
118
0.545993
false
4.051641
false
false
false
tnagorra/nspell
lib/misc.py
1
2396
# cython: language_level=3 import re class Mreplace: def __init__(self, mydict): self._mydict = mydict self._rx = re.compile('|'.join(map(re.escape, self._mydict))) def replace(self, text): return self._rx.sub(lambda x: self._mydict[x.group(0)], text) class Mmatch: def __init__(s...
gpl-3.0
3,902,317,311,436,835,300
16.40458
70
0.348246
false
2.882427
false
false
false
dkkline/CanSat14-15
feeder/feeder.py
1
3082
""" Contains a tornado-based WebSocket server in charge of supplying connected clients with live or replay data. """ import tornado.ioloop import tornado.web import tornado.websocket from collections import deque from pprint import pprint import json from .config import CACHE_SIZE, PORT, FREQUENCY from groundstat...
mit
-8,494,810,209,948,938,000
21.661765
65
0.61843
false
3.857322
false
false
false
panthorstudios/Gold-Rush
oldgame.py
1
10225
from random import random from random import randint import pygame from pygame.locals import * from miner import Miner from explosion import Explosion class Game(object): TITLE = "Gold Rush!" BOARD_LEFT = 20 BOARD_TOP = 130 SQUARE_SIZE = 32 BLACK = (0,0,0) GREEN=(128,255,128) YELLOW=(255,2...
mit
4,087,435,778,622,428,000
32.52459
140
0.522836
false
3.374587
false
false
false
mpatacchiola/dissecting-reinforcement-learning
src/6/multi-armed-bandit/boltzman_agent_bandit.py
1
4551
#!/usr/bin/env python # MIT License # Copyright (c) 2017 Massimiliano Patacchiola # https://mpatacchiola.github.io/blog/ # # Permission is hereby granted, free of charge, to any person obtaining a copy # of this software and associated documentation files (the "Software"), to deal # in the Software without restriction...
mit
-6,810,992,298,096,698,000
42.342857
117
0.702044
false
3.802005
false
false
false
oesteban/phantomas
phantomas/utils/shm.py
1
6453
""" This module contains an implementation of the real, antipodally symmetric Spherical Harmonics basis as defined in [1]_. References ---------- .. [1] Descoteaux, Maxime, Elaine Angelino, Shaun Fitzgibbons, and Rachid Deriche. "Regularized, fast, and robust analytical Q-ball imaging" Magnetic Resonance in Med...
bsd-3-clause
8,120,573,029,460,389,000
23.819231
80
0.561444
false
3.52623
false
false
false
sassoftware/mint
mint/db/mirror.py
1
5677
# # Copyright (c) SAS Institute Inc. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in w...
apache-2.0
475,335,617,005,576,450
34.93038
83
0.573014
false
4.31711
false
false
false
ikben/troposphere
examples/Route53_RoundRobin.py
1
1994
# Converted from Route53_RoundRobin.template located at: # http://aws.amazon.com/cloudformation/aws-cloudformation-templates/ from troposphere import Join from troposphere import Parameter, Ref, Template from troposphere.route53 import RecordSet, RecordSetGroup t = Template() t.set_description( "AWS CloudFormat...
bsd-2-clause
-3,320,936,269,870,272,000
35.254545
79
0.61334
false
3.894531
false
false
false
cloudtools/troposphere
troposphere/applicationautoscaling.py
1
3322
from . import AWSObject, AWSProperty from .validators import boolean, double, integer, positive_integer class ScalableTargetAction(AWSProperty): props = { "MaxCapacity": (integer, False), "MinCapacity": (integer, False), } class ScheduledAction(AWSProperty): props = { "EndTime": ...
bsd-2-clause
-1,866,505,902,557,993,200
27.393162
80
0.617399
false
4.111386
true
false
false
sportorg/pysport
sportorg/modules/winorient/winorient_server.py
1
2292
import datetime from socket import * from sportorg.utils.time import time_to_hhmmss """ Format of WDB data package - length is 1772 bytes 1) 36b text block at the beginning 2 4132500 0 0 3974600\n bib - finish_time - disqual_status - 0 - start_time 2) binary part bytes 128-131 - card number by...
gpl-3.0
-1,973,854,375,864,043,800
23.126316
82
0.585951
false
3.187761
false
false
false
googleapis/python-compute
google/cloud/compute_v1/services/target_pools/pagers.py
1
5656
# -*- coding: utf-8 -*- # Copyright 2020 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 # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or...
apache-2.0
-9,127,447,600,097,576,000
35.727273
85
0.650813
false
4.3811
false
false
false
keyme/visual-diff
gui.py
1
4290
#!/usr/bin/python3 from functools import partial from math import ceil import tkinter as tk from zoom_map import ZoomMap class _Context(tk.Text): CONTEXT_COUNT = 3 # Lines to display before/after the current one # TODO: What about files with over 99,999 lines? LINE_NUMBER_WIDTH = 5 # Number of charact...
gpl-3.0
-6,514,295,874,511,223,000
39.471698
80
0.571329
false
3.816726
false
false
false
salexkidd/restframework-definable-serializer
definable_serializer/tests/for_test/migrations/0001_initial.py
1
1872
# Generated by Django 2.0 on 2017-12-04 00:09 import definable_serializer.models.compat import definable_serializer.models.fields from django.conf import settings from django.db import migrations, models import django.db.models.deletion class Migration(migrations.Migration): initial = True dependencies = [...
mit
4,701,542,029,549,797,000
33.036364
114
0.573184
false
4.425532
false
false
false
kamar42/merdeka-backend
merdeka/apps/mdk/views.py
1
2179
from django.shortcuts import render from merdeka.apps.utils.func import find_model, make_response, json_response, jsonify, set_data, set_status, set_message, set_child from .models import GoodsChilds def api_view(request, **kwargs): resp = make_response() m = kwargs.get('model', None) # drop if model is e...
mit
2,338,286,988,612,638,700
29.690141
131
0.535108
false
3.404688
false
false
false
DigitalCampus/django-oppia
tests/profile/models/test_models.py
1
9519
from django.core.exceptions import ValidationError from django.db.utils import IntegrityError from oppia.test import OppiaTestCase from profile.models import UserProfile, CustomField, UserProfileCustomField class ProfileCustomFieldsTest(OppiaTestCase): fixtures = ['tests/test_user.json', 'tests/t...
gpl-3.0
2,434,349,495,123,271,000
35.193916
76
0.542809
false
4.19709
true
false
false
matrix-org/synapse
synapse/config/voip.py
1
2161
# Copyright 2014-2016 OpenMarket 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 applicable law or agreed to in w...
apache-2.0
-7,243,922,222,192,386,000
35.016667
81
0.652938
false
4.001852
true
false
false
cognitivefashion/cf-sdk-python
dominant_colors_product.py
1
1998
#------------------------------------------------------------------------------ # Get the dominant colors for an image in the catalog. # GET /v1/catalog/{catalog_name}/dominant_colors/{id}/{image_id} #------------------------------------------------------------------------------ import os import json import requests f...
apache-2.0
-561,431,765,489,356,350
31.754098
101
0.544044
false
3.842308
false
false
false
esthermm/enco
enco_category/models/purchase_report.py
1
4459
# -*- coding: utf-8 -*- # © 2017 Esther Martín - AvanzOSC # License AGPL-3 - See http://www.gnu.org/licenses/agpl-3.0.html from openerp import fields, models from openerp import tools class PurchaseReport(models.Model): _inherit = 'purchase.report' purchase_categ_id = fields.Many2one( comodel_name=...
gpl-3.0
3,419,847,582,266,955,300
46.414894
163
0.475656
false
3.845557
false
false
false
oubiwann/myriad-worlds
myriad/story.py
1
3923
import yaml from myriad.character import Player from myriad.world import Map, World from myriad.item import Item, OpenableItem, OpenableReadableItem, ReadableItem # XXX maybe the story object should have a map attribute assigned based on # story type... e.g., provided ASCII map, procedurally generated map, etc. clas...
mit
-3,348,018,576,291,918,000
35.663551
78
0.604384
false
4.103556
false
false
false
xflows/clowdflows-backend
workflows/api/serializers.py
1
14887
import json from django.contrib.auth.models import User from django.db.models import Prefetch from django.template.loader import render_to_string from rest_framework import serializers from rest_framework.reverse import reverse from mothra.settings import STATIC_URL, MEDIA_URL from streams.models import Stream from w...
mit
7,936,824,907,788,334,000
34.70024
160
0.623363
false
4.083105
false
false
false
ai-se/george
Models/usp05.py
1
7552
""" # The USP05 Data Set Standard header: """ from __future__ import division,print_function import sys sys.dont_write_bytecode = True from lib import * """ @attribute ObjType {FT,PJ,RQ} @attribute IntComplx {5.0,2.0,1.0,4.0,3.0,3.5,2.5,4.5,NULL} @attribute DataFile {18.0,9.0,7.0,12.0,2.0,5.0,4.0,3.0,1.0,11.0,0.0,75...
mit
-1,131,610,790,422,415,400
28.73622
366
0.431674
false
1.537146
false
false
false
V-FEXrt/Pokemon-Spoof-Plus
CableClub/cable_club_trade_center.py
1
1950
from AI.team_manager import TeamManager from cable_club_constants import TradeCenterState, Com def reset(): global tradeCenterState, counter, eat_byte, ate_byte, choice_byte tradeCenterState = TradeCenterState.CHOOSING_TRADE counter = 416 eat_byte = False ate_byte = 0x0 choice_byte = 0 reset()...
mit
-6,544,293,436,902,257,000
25.712329
96
0.638974
false
3.77907
false
false
false
crs4/omero.biobank
test/kb/test_individual.py
1
2096
# BEGIN_COPYRIGHT # END_COPYRIGHT import os, unittest, logging logging.basicConfig(level=logging.ERROR) from bl.vl.kb import KnowledgeBase as KB from kb_object_creator import KBObjectCreator OME_HOST = os.getenv("OME_HOST", "localhost") OME_USER = os.getenv("OME_USER", "root") OME_PASS = os.getenv("OME_PASS", "rome...
gpl-2.0
-3,798,257,073,794,676,700
25.871795
76
0.640744
false
3.195122
true
false
false
wger-project/wger
wger/exercises/tests/test_categories.py
1
3817
# This file is part of wger Workout Manager. # # wger Workout Manager 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 your option) any later version. # # wger W...
agpl-3.0
3,603,420,777,804,712,400
27.066176
95
0.681163
false
3.992678
true
false
false
philanthropy-u/edx-platform
pavelib/prereqs.py
1
11951
""" Install Python and Node prerequisites. """ from __future__ import print_function import hashlib import os import re import sys import subprocess import io from distutils import sysconfig from paver.easy import BuildFailure, sh, task from .utils.envs import Env from .utils.timer import timed PREREQS_STATE_DIR = ...
agpl-3.0
451,403,621,817,372,500
32.759887
114
0.643293
false
3.708036
false
false
false
RedHatQE/cfme_tests
cfme/automate/dialogs/dialog_tab.py
1
2309
import attr from navmazing import NavigateToAttribute from widgetastic.widget import Text from . import AddTabView from . import TabForm from .dialog_box import BoxCollection from cfme.modeling.base import BaseCollection from cfme.modeling.base import BaseEntity from cfme.modeling.base import parent_of_type from cfme....
gpl-2.0
-5,686,583,473,684,868,000
25.848837
91
0.673452
false
3.712219
false
false
false
pyspace/test
pySPACE/missions/nodes/meta/same_input_layer.py
1
22715
""" Combine several other nodes together in parallel This is useful to be combined with the :class:`~pySPACE.missions.nodes.meta.flow_node.FlowNode`. """ import numpy from pySPACE.environments.chains.node_chain import NodeChainFactory from pySPACE.missions.nodes.base_node import BaseNode from pySPACE.resources.data_...
gpl-3.0
4,007,869,671,616,826,000
41.22119
109
0.547215
false
4.593529
false
false
false
googleapis/python-game-servers
google/cloud/gaming_v1/services/realms_service/async_client.py
1
28046
# -*- coding: utf-8 -*- # Copyright 2020 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 # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or...
apache-2.0
-6,299,150,042,904,482,000
38.894737
171
0.606111
false
4.626526
false
false
false
dgzzhb/GAOthello
board.py
1
10425
#!/usr/bin/env python """ game.py Humberto Henrique Campos Pinheiro Game logic. """ from config import WHITE, BLACK, EMPTY from copy import deepcopy class Board: """ Rules of the game """ def __init__ ( self ): self.board = [ [0,0,0,0,0,0,0,0], \ [0,0,0,0...
mit
-6,171,274,448,251,786,000
31.578125
100
0.424077
false
3.900112
false
false
false
sbg/Mitty
mitty/simulation/sequencing/syntheticsequencer.py
1
1955
"""A fully synthetic read model that allows us to produce single end or paired end reads with arbitrary read and template lengths. It's read model format is as follows { 'model_class': 'illumina', 'model_description': '', 'paired': True/False, 'read_length': 100, 'mean_template_length': 300, 'std_template_...
apache-2.0
9,079,642,919,832,840,000
31.04918
103
0.623018
false
2.892012
false
false
false
CNS-OIST/STEPS_Example
publication_models/API_1/Anwar_J Neurosci_2013/extra/constants_hh.py
1
2809
# # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # Okinawa Institute of Science and Technology, Japan. # # This script runs on STEPS 2.x http://steps.sourceforge.net # # H Anwar, I Hepburn, H Nedelescu, W Chen and E De Schutter # Stochastic calcium mechanisms cause dendritic calcium spike...
gpl-2.0
7,726,932,273,181,009,000
22.805085
77
0.533286
false
2.311934
false
false
false
ContinuumIO/ashiba
enaml/enaml/widgets/datetime_selector.py
1
2100
#------------------------------------------------------------------------------ # Copyright (c) 2013, Nucleic Development Team. # # Distributed under the terms of the Modified BSD License. # # The full license is in the file COPYING.txt, distributed with this software. #-------------------------------------------------...
bsd-3-clause
-5,191,797,719,013,015,000
34.59322
79
0.605714
false
5.109489
false
false
false
CuteLemon/Learn
NewsAPI_Scraper/db_operation.py
1
1050
import pymongo as Mongo DB_NAME = 'localhost' DB_PORT = 27017 TEST_JSON = {'url':'http://hello.com','content':'Lemon Tree'} class DB(): def __init__(self,db,port): self.client = Mongo.MongoClient(db,port) self.db = self.client.test self.collect = self.db.test_collect def insert(sel...
gpl-3.0
-5,302,895,376,558,269,000
22.333333
61
0.592381
false
3.322785
true
false
false
bbondy/brianbondy.gae
libs/werkzeug/testsuite/contrib/cache.py
1
5814
# -*- coding: utf-8 -*- """ werkzeug.testsuite.cache ~~~~~~~~~~~~~~~~~~~~~~~~ Tests the cache system :copyright: (c) 2014 by Armin Ronacher. :license: BSD, see LICENSE for more details. """ import os import time import unittest import tempfile import shutil from werkzeug.testsuite import Werkzeug...
mit
1,778,556,580,544,685,600
28.21608
91
0.576367
false
3.55814
true
false
false
jimgong92/allezViens
connect.py
1
8842
from models import * from run import db import sys import math import hashlib import time from communication import sendPickNotificationEmail '''DATABASE INSERTION/UPDATE''' #Adds driver to database def addDriver(id, alias, oLat, oLon, dLat, dLon, date): url = makeURL(id) driver = Driver(id, alias, oLat, oLon, dLa...
mit
5,327,332,219,861,663,000
27.990164
146
0.708776
false
3.272391
false
false
false
aldebaran/qibuild
python/qibuild/test/projects/usefoopymodule/test.py
1
1167
#!/usr/bin/env python # -*- coding: utf-8 -*- # Copyright (c) 2012-2021 SoftBank Robotics. All rights reserved. # Use of this source code is governed by a BSD-style license (see the COPYING file). """ This is an equivalent of a C++ program trying to load a Python module using libqi, but written in Python. """ from __fu...
bsd-3-clause
-454,405,756,292,281,000
29.710526
84
0.615253
false
3.635514
false
false
false
MikeDacre/fyrd
fyrd/job.py
1
56470
# -*- coding: utf-8 -*- """ Class and methods to handle Job submission. This module only defines a single object: the Job class. """ import os as _os import sys as _sys from uuid import uuid4 as _uuid from time import sleep as _sleep from datetime import datetime as _dt from traceback import print_tb as _tb # Try to...
mit
1,620,173,737,660,842,800
34.249688
79
0.518399
false
4.58621
false
false
false
hagabbar/pycbc_copy
pycbc/io/hdf.py
1
31952
# convenience classes for accessing hdf5 trigger files # the 'get_column()' method is implemented parallel to # the existing pylal.SnglInspiralUtils functions import h5py import numpy as np import logging import inspect from lal import LIGOTimeGPS, YRJUL_SI from pycbc_glue.ligolw import ligolw from pycbc_glue.ligol...
gpl-3.0
-1,520,289,452,508,774,400
35.981481
93
0.559339
false
3.6338
false
false
false
zbyte64/django-dockitcms
dockitcms/widgetblock/fields.py
1
1521
from django import forms from dockit import schema from dockitcms.fields import BaseFieldEntry, ListFieldMixin from dockitcms.widgetblock.models import Widget class WidgetField(BaseFieldEntry): field_class = schema.SchemaField def get_field_kwargs(self): kwargs = dict(super(WidgetField, self)....
bsd-3-clause
1,446,314,102,255,688,400
28.823529
99
0.687048
false
3.981675
false
false
false
BackupTheBerlios/espressopp
examples/hadress/hadressFEC/hadressDensityFEC.py
1
8414
#!/usr/bin/env python # -*- coding: utf-8 -*- # relevant imports import sys import time import espresso import mpi4py.MPI as MPI import Tetracryst # Preparation of tetrahedral crystal and constuctions of bonds in tetrahedral liquid from espresso import Real3D, Int3D from espresso.tools import decomp from espresso.to...
gpl-3.0
402,461,459,966,892,200
32.388889
122
0.686475
false
3.019017
false
false
false
Rudd-O/cloud-tool
cloudapis/cloud.py
1
2976
'''Implements the Cloud.com API''' from cloudtool.utils import describe import urllib import urllib2 import os import xml.dom.minidom class CloudAPI: @describe("server", "Management Server host name or address") @describe("responseformat", "Response format: xml or json") def __init__(self, server="127.0.0...
gpl-3.0
-2,088,494,372,221,547,500
25.336283
79
0.673387
false
3.472579
false
false
false
99cloud/keystone_register
openstack_dashboard/api/nova.py
1
18812
# vim: tabstop=4 shiftwidth=4 softtabstop=4 # Copyright 2012 United States Government as represented by the # Administrator of the National Aeronautics and Space Administration. # All Rights Reserved. # # Copyright 2012 Openstack, LLC # Copyright 2012 Nebula, Inc. # Copyright (c) 2012 X.commerce, a business unit of eB...
apache-2.0
3,814,561,238,036,676,000
32.895495
79
0.633638
false
3.832926
false
false
false
hychen/boliau
boliau/plugins/lp_cli/actionlib.py
1
6379
#!/usr/bin/env python # -*- coding: utf-8 -* # # File: lp_cli.py # # Copyright (C) 2012 Hsin-Yi Chen (hychen) # Author(s): Hsin-Yi Chen (hychen) <ossug.hychen@gmail.com> # Permission is hereby granted, free of charge, to any person obtaining a # copy of this software and associated documentation files (the "Software...
mit
4,258,922,284,468,343,000
33.112299
77
0.521555
false
4.134154
false
false
false
rangertaha/salt-manager
salt-manager/webapp/apps/management/commands/bshell.py
1
3463
#!/usr/bin/env python """ """ import os from optparse import make_option from django.core.management.base import NoArgsCommand def starting_imports(): from django.db.models.loading import get_models for m in get_models(): exec "from %s import %s" % (m.__module__, m.__name__) from datetime import ...
mit
-6,263,867,662,607,562,000
34.336735
92
0.6324
false
4.24908
false
false
false
nall/pythonista-tradervue
utils.py
1
5565
# vim: ft=python tabstop=2 shiftwidth=2 expandtab # Copyright (c) 2015, Jon Nall # 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 copyrig...
bsd-3-clause
-2,197,524,809,621,453,300
32.727273
94
0.669003
false
3.646789
false
false
false
smcoll/stormpath-django
django_stormpath/social.py
1
7183
from django.contrib.auth import login as django_login from django.shortcuts import resolve_url from django.core.urlresolvers import reverse from django.conf import settings from stormpath.error import Error as StormpathError from stormpath.resources.provider import Provider from requests_oauthlib import OAuth2Session...
apache-2.0
732,327,008,245,947,000
38.905556
92
0.655019
false
3.972898
false
false
false
jakirkham/lazyflow
lazyflow/operators/opFeatureMatrixCache.py
1
12534
from functools import partial import logging logger = logging.getLogger(__name__) import numpy from lazyflow.graph import Operator, InputSlot, OutputSlot from lazyflow.request import RequestLock, Request, RequestPool from lazyflow.utility import OrderedSignal from lazyflow.roi import getBlockBounds, getIntersectingBl...
lgpl-3.0
-5,391,571,419,154,124,000
47.211538
130
0.631961
false
4.311662
false
false
false
hoaibang07/Webscrap
transcripture/sources/crawler_data.py
1
2804
# -*- encoding: utf-8 -*- import io from bs4 import BeautifulSoup from bs4 import SoupStrainer import urllib2 import urlparse def _remove_div_vdx(soup): for div in soup.find_all('div', class_='vidx'): div.extract() return soup def get_data(urlchuong_list, i): filename = 'urlsach/data/sach' + str...
gpl-2.0
4,626,698,484,316,223,000
34.506329
280
0.557418
false
3.074561
false
false
false
maheshp/novatest
nova/virt/xenapi/vmops.py
1
74575
# vim: tabstop=4 shiftwidth=4 softtabstop=4 # Copyright (c) 2010 Citrix Systems, Inc. # Copyright 2010 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 # # ...
apache-2.0
-5,872,085,318,642,051,000
41.73639
79
0.55996
false
4.21852
false
false
false
sullivat/Markov-Twitter-Bot
src/mybot.test.py
1
1257
#!/usr/bin/env python # -*- coding: utf-8 -*- import datetime as dt import logging import time import tweepy from tweet_builder import * from credentials import * # Housekeeping: do not edit logging.basicConfig(filename='tweet_test.log', level=logging.DEBUG) auth = tweepy.OAuthHandler(CONSUMER_KEY, CONSUMER_SECRE...
bsd-2-clause
-7,918,807,360,116,483,000
22.277778
83
0.61973
false
3.214834
false
false
false
alphagov/notifications-api
migrations/versions/0151_refactor_letter_rates.py
1
3140
""" Revision ID: 0151_refactor_letter_rates Revises: 0150_another_letter_org Create Date: 2017-12-05 10:24:41.232128 """ import uuid from datetime import datetime from alembic import op import sqlalchemy as sa from sqlalchemy.dialects import postgresql revision = '0151_refactor_letter_rates' down_revision = '0150_a...
mit
8,390,699,011,551,367,000
43.225352
105
0.576433
false
3.862239
false
false
false
jpscaletti/rev-assets
rev_assets/__init__.py
1
1570
""" =========================== RevAssets =========================== Makes possible for python web apps to work with hashed static assets generated by other tools like Gulp or Webpack. It does so by reading the manifest generated by the revision tool. """ import json import io __version__ = '1.0.3' class AssetN...
bsd-3-clause
-7,948,017,020,570,609,000
25.166667
71
0.576433
false
4.14248
false
false
false
Python1320/icmpviewer
main.py
1
1217
#!/usr/bin/env python2 QUEUE_NUM = 5 #hush verbosity import logging l=logging.getLogger("scapy.runtime") l.setLevel(49) import os,sys,time from sys import stdout as out import nfqueue,socket from scapy.all import * import GeoIP gi = GeoIP.open("GeoLiteCity.dat",GeoIP.GEOIP_STANDARD) lastip="" def DoGeoIP(pkt): gl...
unlicense
3,581,285,116,070,015,000
15.226667
55
0.653246
false
2.546025
false
false
false
mhabib1981/pySecn00b
zap_xml_parse.py
1
2159
from xml.dom.minidom import parse import xml.dom.minidom import sys import csv #uni_file=open(sys.argv[1],'r') #non_uni_file=uni_file.decode("utf8") dom_tree=parse(sys.argv[1]) collect=dom_tree.documentElement output_data=[[],[],[],[],[],[],[],[]] out_filename=((sys.argv[1].split("/")[-1]).split(".")[0])+".csv" out_fi...
cc0-1.0
-1,634,140,350,638,111,200
22.467391
76
0.695692
false
2.905787
false
false
false
google/fedjax
fedjax/models/stackoverflow.py
1
5453
# Copyright 2021 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 # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, ...
apache-2.0
-2,779,023,789,321,949,700
37.935714
80
0.652174
false
3.648594
false
false
false
lglenat/whmnet
RaspberryPi/readGateway.py
1
12588
#!/usr/bin/python # -*- coding: utf-8 -*- """ readGateway.py script ===================== This script is used in the whmnet project to receive data from the wireless network gateway and send it to a custom server on the web. This script is run on a Raspberry Pi, connected to the Gateway throu...
gpl-3.0
5,445,676,795,377,608,000
36.011765
116
0.516052
false
4.037215
false
false
false
ISRyuu/ISNNTF
test.py
1
3957
import numpy as np def iou(box_1, box_2): box_1_ulx = box_1[0] - box_1[2] * 0.5 box_1_uly = box_1[1] - box_1[3] * 0.5 box_1_lrx = box_1[0] + box_1[2] * 0.5 box_1_lry = box_1[1] + box_1[3] * 0.5 box_2_ulx = box_2[0] - box_2[2] * 0.5 box_2_uly = box_2[1] - box_2[3] * 0.5 box_2_lrx = box_2[...
bsd-3-clause
5,585,448,979,678,535,000
37.048077
87
0.581248
false
2.913844
false
false
false
canaryhealth/nlu_trainer
nlu_trainer/util.py
1
1186
# -*- coding: utf-8 -*- import re def phrase_index(sentence, phrase): ''' Returns the start and end index of phrase (first instance) if it exists in sentence. ex: >>> phrase_index('the quick brown fox jumps over the lazy dog', 'brown fox jumps') (10, 24) ''' phrase = str...
mit
-3,836,816,383,660,354,000
27.926829
79
0.598651
false
3.258242
false
false
false
dprog-philippe-docourt/django-qr-code
setup.py
1
1589
import re from setuptools import setup # Get version without importing with open('qr_code/__init__.py', 'rb') as f: VERSION = str(re.search('__version__ = \'(.+?)\'', f.read().decode('utf-8')).group(1)) setup( name='django-qr-code', version=VERSION, packages=['qr_code', 'qr_code.qrcode', 'qr_code.tem...
bsd-3-clause
7,363,241,608,391,071,000
37.756098
136
0.642542
false
3.730047
false
false
false
laginimaineb/android_fde_bruteforce
structures.py
1
2262
import struct from StringIO import StringIO #The crypt_mnt_ftr structure - see /system/vold/cryptfs.h CRYPT_MNT_FTR = [('magic' , 'I'), ('major_version' , 'H'), ('minor_version' , 'H'), ('ftr_size' , 'I'), ('flags' , 'I'), ...
gpl-2.0
1,956,154,337,582,137,300
36.081967
79
0.438992
false
3.316716
false
false
false
windweaver828/kspeech
commandtools.py
1
1026
#!/usr/bin/env python def isCommand(command, args): index = 0 for arg in args: if isinstance(arg, list): for ar in arg: if isinstance(ar, list): for a in ar: if isinstance(a, list): index-=1 ...
gpl-2.0
3,961,388,683,577,054,700
24.65
49
0.477583
false
4.816901
false
false
false
snakecon/AI_Lab
spider/book/book/pipelines.py
1
4704
#!/usr/bin/env python # -*- coding: utf-8 -*- import hashlib import book.database as db from scrapy import Request from scrapy.utils.misc import arg_to_iter from twisted.internet.defer import DeferredList from scrapy.pipelines.images import ImagesPipeline from book.items import Subject, Meta, Comment class BookPipe...
apache-2.0
2,729,605,431,872,991,000
32.361702
88
0.540816
false
3.85258
false
false
false
stephane-martin/salt-debian-packaging
salt-2016.3.3/salt/modules/dnsutil.py
1
11113
# -*- coding: utf-8 -*- ''' Compendium of generic DNS utilities ''' from __future__ import absolute_import # Import salt libs import salt.utils import socket # Import python libs import logging import time log = logging.getLogger(__name__) def __virtual__(): ''' Generic, should work on any platform (includ...
apache-2.0
-4,666,205,067,642,195,000
27.494872
116
0.579052
false
3.917166
false
false
false
shiburizu/py2discord
py2discord.py
1
8389
import discord import sqlite3 as sql import logging import cleverbot import random logging.basicConfig(level=logging.INFO) import urllib3.contrib.pyopenssl urllib3.contrib.pyopenssl.inject_into_urllib3() from apiclient.discovery import build import apiclient.errors # Please refer to the README to find where you should ...
isc
-2,526,754,386,635,023,000
35.004292
133
0.635713
false
3.351578
false
false
false
LMSlay/wiper
modules/clamav.py
1
2875
# This file is part of Viper - https://github.com/botherder/viper # See the file 'LICENSE' for copying permission. import getopt try: import pyclamd HAVE_CLAMD = True except ImportError: HAVE_CLAMD = False from viper.common.out import * from viper.common.abstracts import Module from viper.core.session im...
bsd-3-clause
-1,005,792,964,719,011,700
29.913978
95
0.510957
false
4.246677
false
false
false
vmendez/DIRAC
Resources/Storage/StorageElement.py
1
35478
""" This is the StorageElement class. """ from types import ListType __RCSID__ = "$Id$" # # custom duty import re import time import datetime import copy import errno # # from DIRAC from DIRAC import gLogger, gConfig, siteName from DIRAC.Core.Utilities import DErrno, DError from DIRAC.Core.Utilities.ReturnValues impor...
gpl-3.0
3,227,499,265,825,615,000
40.34965
141
0.621681
false
4.02017
false
false
false
lukasmartinelli/py14
py14/scope.py
1
2384
import ast from contextlib import contextmanager def add_scope_context(node): """Provide to scope context to all nodes""" return ScopeTransformer().visit(node) class ScopeMixin(object): """ Adds a scope property with the current scope (function, module) a node is part of. """ scopes = []...
mit
1,515,808,432,834,027,300
28.432099
74
0.570889
false
4.219469
false
false
false
faroit/loudness
python/tests/test_FrameGenerator.py
1
1471
import numpy as np import loudness as ln fs = 32000 N = 10000 x = np.arange(0, N) # Input SignalBank bufSize = 32 nEars = 2 nChannels = 1 inputBank = ln.SignalBank() inputBank.initialize(nEars, nChannels, bufSize, int(fs)) # Frame generator frameSize = 2048 hopSize = 32 startAtWindowCentre = True frameGen = ln.Frame...
gpl-3.0
-7,065,117,697,718,872,000
25.745455
82
0.674371
false
3.149893
false
false
false
robinkraft/cloudless
src/cloudless/train/predict.py
1
7335
import os import caffe import numpy as np import plyvel import skimage from caffe_pb2 import Datum import constants def predict(image_path): """ Takes a single image, and makes a prediction whether it has a cloud or not. """ print "Generating prediction for %s..." % image_path net, transformer ...
apache-2.0
-1,540,303,570,774,137,900
33.763033
96
0.647307
false
3.79462
false
false
false
praveenkumar/ansible
lib/ansible/plugins/strategies/linear.py
1
14325
# (c) 2012-2014, Michael DeHaan <michael.dehaan@gmail.com> # # This file is part of Ansible # # Ansible is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation, either version 3 of the License, or # (at your option) an...
gpl-3.0
7,524,632,294,346,595,000
45.209677
179
0.548063
false
4.776592
false
false
false
The-Compiler/qutebrowser
tests/helpers/messagemock.py
1
2576
# vim: ft=python fileencoding=utf-8 sts=4 sw=4 et: # Copyright 2014-2020 Florian Bruhin (The Compiler) <mail@qutebrowser.org> # # This file is part of qutebrowser. # # qutebrowser 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 S...
gpl-3.0
6,713,423,093,732,650,000
27
75
0.667314
false
4.075949
false
false
false
mholgatem/GPIOnext
config/menus.py
1
4183
import time from config.constants import * from config import SQL from cursesmenu import * from cursesmenu.items import * import curses ''' --------------------------------------------------------- This script handles menu navigation RETURNS: dictionary containing device name, number of buttons, number of axis -...
mit
-1,539,677,668,419,638,800
27.346939
109
0.63067
false
3.423993
true
false
false
mahim97/zulip
zerver/management/commands/set_default_streams.py
8
1912
import sys from argparse import ArgumentParser, RawTextHelpFormatter from typing import Any, Dict, Text from zerver.lib.actions import set_default_streams from zerver.lib.management import ZulipBaseCommand class Command(ZulipBaseCommand): help = """Set default streams for a realm Users created under this realm ...
apache-2.0
-3,494,797,348,858,399,000
36.490196
81
0.648536
false
4.094218
false
false
false
endlessm/chromium-browser
third_party/shaderc/src/glslc/test/option_dash_M.py
3
33038
# Copyright 2015 The Shaderc 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 applicable...
bsd-3-clause
-7,187,553,513,730,992,000
42.816976
82
0.602004
false
3.842968
true
false
false
superclass/superwas
nagios.py
1
12906
#!/usr/bin/python # This file is part of Superwas. # # Superwas 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. # # Superwas is dist...
gpl-2.0
-9,097,531,912,660,383,000
36.086207
159
0.707423
false
3.413383
false
false
false
wichert/rest_toolkit
tests/ext/test_colander.py
1
1039
import pytest from pyramid.httpexceptions import HTTPBadRequest from rest_toolkit.abc import EditableResource from rest_toolkit.ext.colander import ColanderSchemaValidationMixin import colander class AccountSchema(colander.Schema): email = colander.SchemaNode(colander.String()) password = colander.SchemaNode(...
bsd-2-clause
5,855,686,844,315,270,000
27.081081
87
0.725698
false
3.935606
false
false
false
yaelelmatad/EtsyApiTest
findSimilarShopsAllShopsByPopularity.py
1
6336
from __future__ import division import json import sys import math import random #hard coded number of similar stores to spit out since HW said 5, could always add to command line nSimilarStores = 5 maxBonus = 0.0005 class vectors: def __init__(self, featureVectorName, multiplier, shopVectors): self.mult...
gpl-3.0
-9,196,436,886,653,949,000
40.142857
360
0.652778
false
4.010127
false
false
false
ZeitOnline/zeit.content.article
src/zeit/content/article/edit/browser/tests/test_rawxml.py
1
1493
import zeit.content.article.edit.browser.testing class Form(zeit.content.article.edit.browser.testing.BrowserTestCase): block_type = 'raw' def test_inline_form_saves_values(self): self.get_article(with_empty_block=True) b = self.browser b.open('editable-body/blockname/@@edit-rawxml?s...
bsd-3-clause
-7,119,949,674,202,443,000
33.72093
82
0.616879
false
3.295806
true
false
false
yeleman/snisi
snisi_maint/management/commands/update-cluster-from-std-csv.py
1
3120
#!/usr/bin/env python # -*- coding: utf-8 -*- # vim: ai ts=4 sts=4 et sw=4 nu from __future__ import (unicode_literals, absolute_import, division, print_function) import logging import os from django.core.management.base import BaseCommand from optparse import make_option from py3compat import...
mit
-835,938,490,400,088,200
31.842105
73
0.501923
false
4.431818
false
false
false
mbartling/TAMU_senior_design
Python/get_xbee_servo.py
1
4195
#! /usr/bin/env python import serial import sys import os import MySQLdb from subprocess import call from datetime import date FORCE_WRITE = 0 HORIZONTAL = 0 VERTICAL = 90 today = date.today() try: address_array = [] # open data base db = MySQLdb.connect(host="localhost", user="", passwd="team05", db="xbee_teensy"...
mit
-2,135,066,010,321,820,200
26.598684
164
0.615256
false
2.947997
false
false
false
Syncleus/apex
src/apex/kiss/kiss_serial.py
1
3486
#!/usr/bin/env python # -*- coding: utf-8 -*- """KISS Core Classes.""" # These imports are for python3 compatibility inside python2 from __future__ import absolute_import from __future__ import division from __future__ import print_function import logging import serial import six from apex.kiss import constants as...
apache-2.0
-7,112,238,142,381,846,000
30.690909
95
0.626219
false
3.732334
false
false
false
khertan/gedit_flake8
gedit_flake8/__init__.py
1
14861
#!/usr/bin/env python # -*- coding: utf-8 -*- """gedit-flake8 : A plugin for gedit to display error and warning from flake8.""" __author__ = "Benoît HERVIER" __copyright__ = "Copyright 2012 " + __author__ __license__ = "GPLv3" __version__ = "0.7.0" __maintainer__ = "Benoît HERVIER" __email__ = "khertan@khertan.net...
gpl-3.0
2,962,702,410,115,638,000
29.95625
77
0.553671
false
4.019205
false
false
false
schocco/mds-web
mds_website/settings.py
1
8687
# -*- coding: utf-8 -*- # Django settings for mds_website project. import os DEBUG = True TEMPLATE_DEBUG = DEBUG PROJECT_DIR = os.path.dirname(__file__) ADMINS = ( # ('Your Name', 'your_email@example.com'), ) MANAGERS = ADMINS DATABASES = { 'default': { 'ENGINE': 'django.contrib.gis.db.backends.pos...
mit
-8,026,578,457,532,090,000
33.200787
127
0.687234
false
3.603069
false
false
false