repo_name
stringlengths
5
92
path
stringlengths
4
232
copies
stringclasses
19 values
size
stringlengths
4
7
content
stringlengths
721
1.04M
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
15
997
alpha_frac
float64
0.25
0.97
autogenerated
bool
1 class
IFAEControl/pirelay
pirelay/server.py
1
1591
#!/usr/bin/env python3 import time from concurrent import futures import grpc from .protos import pirelay_pb2 from .protos import pirelay_pb2_grpc from .relay import RelaysArray _ONE_DAY_IN_SECONDS = 60 * 60 * 24 PINS = [21] class PiRelayServer(pirelay_pb2_grpc.PiRelayServicer): def __init__(self, bcm_pins...
lgpl-3.0
-4,084,407,837,345,929,700
25.966102
79
0.574481
false
mwilliamson/python-mammoth
tests/docx/style_map_tests.py
1
4495
import io from zipfile import ZipFile from nose.tools import istest, assert_equal from mammoth.docx.style_map import write_style_map, read_style_map from mammoth.zips import open_zip from mammoth.docx import xmlparser as xml @istest def reading_embedded_style_map_on_document_without_embedded_style_map_returns_none(...
bsd-2-clause
-5,439,335,408,695,723,000
36.14876
164
0.666741
false
tensorflow/model-optimization
tensorflow_model_optimization/g3doc/tools/build_docs.py
1
3663
# 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
1,166,959,432,661,376,000
33.556604
110
0.677041
false
owlabs/incubator-airflow
airflow/executors/__init__.py
1
3891
# -*- 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,116,916,838,794,192,000
36.776699
89
0.72038
false
suutari/shoop
shuup/notify/template.py
1
3011
# -*- coding: utf-8 -*- # This file is part of Shuup. # # Copyright (c) 2012-2016, Shoop Commerce Ltd. All rights reserved. # # This source code is licensed under the AGPLv3 license found in the # LICENSE file in the root directory of this source tree. from __future__ import unicode_literals from django.utils.encoding...
agpl-3.0
-5,120,846,759,464,826,000
32.831461
103
0.645965
false
danic96/Practica1
Practica1/Aplicacio/views.py
1
4321
# from django.shortcuts import render # Create your views here. # from django.http import HttpResponse from django.utils.decorators import method_decorator from django.contrib.auth.decorators import login_required from django.views.generic.edit import CreateView, UpdateView from django.views.generic import DetailVi...
mit
6,965,548,810,274,474,000
27.058442
93
0.707938
false
madjar/aurifere
tests/test_pkgbuild.py
1
1304
import os import unittest here = os.path.dirname(__file__) class PkgbuildTest(unittest.TestCase): def _get_pkgbuild(self): from aurifere.pkgbuild import PKGBUILD return PKGBUILD(os.path.join(here, 'fixtures/PKGBUILD')) def test_attributes(self): p = self._get_pkgbuild() self....
isc
343,255,923,941,644,740
30.047619
75
0.623466
false
CorundumGames/Invasodado
game/ufo.py
1
3605
from math import sin from random import choice, uniform, expovariate from pygame import Rect from core import color from core import config from core.particles import ParticleEmitter from game.block import get_block from game.gameobject import GameObject from game import gamedata ### Co...
gpl-3.0
-1,058,903,097,034,391,700
32.700935
88
0.530929
false
rdo-infra/ci-config
ci-scripts/dlrnapi_promoter/qcow_client.py
1
10534
""" This file contains classes and functionto interact with qcow images servers """ import copy import logging import os import paramiko from common import PromotionError class QcowConnectionClient(object): """ Proxy class for client connection """ _log = logging.getLogger("promoter") def __ini...
apache-2.0
-8,655,361,982,532,262,000
37.445255
80
0.56123
false
parksandwildlife/wastd
occurrence/migrations/0006_auto_20181129_1812.py
1
1084
# Generated by Django 2.0.8 on 2018-11-29 10:12 from django.db import migrations, models class Migration(migrations.Migration): dependencies = [ ('occurrence', '0005_auto_20181025_1720'), ] operations = [ migrations.AlterField( model_name='areaencounter', name='s...
mit
-6,071,923,042,693,717,000
59.222222
738
0.671587
false
csdms/dakota
dakotathon/tests/test_plugin_hydrotrend_run.py
1
3466
#!/usr/bin/env python # # Test running the dakota.plugin.hydrotrend module. # # Call with: # $ nosetests -sv # # Mark Piper (mark.piper@colorado.edu) import os import shutil # import filecmp import glob from nose.tools import with_setup, assert_true from dakotathon.dakota import Dakota from dakotathon.plugins.hydro...
mit
-8,400,592,787,912,912,000
31.092593
81
0.617426
false
kysolvik/reservoir-id
reservoir-id/classifier_train.py
1
6974
#!/usr/bin/env python """ Train random forest classifier Inputs: CSV from build_att_table, small area cutoff Outputs: Packaged up Random Forest model @authors: Kylen Solvik Date Create: 3/17/17 """ # Load libraries import pandas as pd from sklearn import model_selection from sklearn import preprocessing from sklearn....
gpl-3.0
-8,813,554,001,576,761,000
37.10929
88
0.57571
false
ambitioninc/django-user-guide
user_guide/templatetags/user_guide_tags.py
1
2767
""" Template tag for displaying user guides. """ import re from django import template from django.conf import settings from django.template import loader from django.template.defaulttags import CsrfTokenNode from user_guide.models import GuideInfo register = template.Library() # The maximum number of guides to sh...
mit
-4,151,106,416,245,228,000
31.940476
113
0.62378
false
praekelt/django-ultracache
bin/cache-purge-consumer.py
1
3973
"""Subscribe to RabbitMQ and listen for purge instructions continuously. Manage this script through eg. supervisor.""" import json import traceback from multiprocessing.pool import ThreadPool from optparse import OptionParser from time import sleep import pika import requests import yaml class Consumer: channe...
bsd-3-clause
-856,625,678,671,990,400
31.300813
83
0.511956
false
adviti/melange
tests/app/soc/logic/test_dicts.py
1
13831
#!/usr/bin/env python2.5 # # Copyright 2011 the Melange authors. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applic...
apache-2.0
-8,010,192,646,561,666,000
32.327711
82
0.598583
false
myriasofo/CLRS_exercises
algos/testSuite.py
1
6292
''' WHAT: Simple test framework for checking algorithms TASK: *Handle output that's an object, eg. bst that gets modified *option3: optional param - Class (accept input/output as arrays and TURN INTO object) (option1: optional param - comparison function (instead of simple "!=") (option2: optional param - Class (autom...
mit
-4,231,904,569,753,463,300
30.148515
108
0.578512
false
tis-intern-apparel/ApparelStrategy
server/dialogue_system/module/database.py
1
5633
# -*- coding: utf-8 -*- import os import codecs class Personal: point_id = '' user_name = '' user_pronoun = '' sex = '' phone = '' email = '' address = '' class Cloth: cloth_name = '' color_code = '' small_type = '' price = '' image_url = '' big_type = '' cloth...
mit
3,080,065,227,675,096,000
28.005155
96
0.52568
false
django-notifications/django-notifications
notifications/views.py
1
7702
# -*- coding: utf-8 -*- ''' Django Notifications example views ''' from distutils.version import \ StrictVersion # pylint: disable=no-name-in-module,import-error from django import get_version from django.contrib.auth.decorators import login_required from django.forms import model_to_dict from django.shortcuts im...
bsd-3-clause
-8,903,661,375,527,200,000
28.852713
76
0.64321
false
agoose77/hivesystem
tutorial/layers/layer17/layers.py
1
2334
from __future__ import print_function # import the main and action components from maincomponent import maincomponent from action1 import action1component from action2 import action2component from action3 import action3component #import manager components from action3components import animationmanager from action3com...
bsd-2-clause
2,937,745,632,804,940,000
25.522727
70
0.696658
false
cackharot/fbeazt
src/foodbeazt/resources/order.py
1
13147
import time from datetime import datetime from bson import ObjectId, json_util from collections import defaultdict from flask import g, request from flask_mail import Message from flask_restful import Resource from service.OrderService import OrderService, DuplicateOrderException from service.PushNotificationService im...
apache-2.0
4,485,631,413,601,322,000
41.546926
134
0.587663
false
ssssam/calliope
calliope/stat/__init__.py
1
1520
#!/usr/bin/env python3 # Calliope # Copyright (C) 2016 Sam Thursfield <sam@afuera.me.uk> # # 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)...
gpl-2.0
4,141,134,429,499,727,000
30.666667
81
0.667763
false
DrSkippy/Gravitational-Three-Body-Symmetric
sim_pendulum.py
1
1975
#!/usr/bin/env python import csv import sys import numpy as np import pandas as pd import matplotlib.pyplot as plt plt.style.use('ggplot') # arg 1 = w init # arg 2 = n periods # arg 3 = n ratio # time step dt = np.float64(0.00010) # constants L_0 = np.float64(1.0) # unstretched length g = np.float64(9.81) # grav...
cc0-1.0
3,132,915,243,086,640,600
20.944444
77
0.578734
false
metpy/SHARPpy
sharppy/version.py
1
1931
import os.path import subprocess release = False __version__ = '0.2' _repository_path = os.path.split(__file__)[0] _git_file_path = os.path.join(_repository_path, '__git_version__.py') def _minimal_ext_cmd(cmd): # construct minimal environment env = {} for k in ['SYSTEMROOT', 'PATH']: v = os.env...
bsd-3-clause
6,243,977,662,548,874,000
23.75641
81
0.539617
false
brian-o/CS-CourseWork
CS491/Program2/testForks.py
1
2677
############################################################ ''' testForks.py Written by: Brian O'Dell, Spetember 2017 A program to run each program a 500 times per thread count. Then uses the data collected to make graphs and tables that are useful to evaluate the programs running time. ''' ######...
gpl-3.0
5,887,714,014,429,846,000
30.494118
82
0.623086
false
PennyDreadfulMTG/Penny-Dreadful-Tools
modo_bugs/fetcher.py
1
4118
import os import sys from typing import Dict, List, Optional, Tuple from bs4 import BeautifulSoup from bs4.element import Tag from shared import fetch_tools, lazy def search_scryfall(query: str) -> Tuple[int, List[str], List[str]]: """Returns a tuple. First member is an integer indicating how many cards match t...
gpl-3.0
-1,526,794,542,128,501,000
41.020408
140
0.629917
false
heldergg/webpymail
webpymail/sabapp/models.py
1
2844
# -*- coding: utf-8 -*- # sabapp - Simple Address Book Application # Copyright (C) 2008 Helder Guerreiro # This file is part of sabapp. # # sabapp 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 versi...
gpl-3.0
-5,009,104,855,560,248,000
31.318182
77
0.645921
false
silentfuzzle/calibre
src/calibre/devices/kobo/driver.py
1
147621
#!/usr/bin/env python2 # vim:fileencoding=UTF-8:ts=4:sw=4:sta:et:sts=4:ai from __future__ import division __license__ = 'GPL v3' __copyright__ = '2010-2012, Timothy Legge <timlegge@gmail.com>, Kovid Goyal <kovid@kovidgoyal.net> and David Forrester <davidfor@internode.on.net>' __docformat__ = 'restructuredtext en' '...
gpl-3.0
6,730,758,367,339,175,000
49.074966
237
0.549732
false
ghostshellgnome/clamwin
py/ClamTray.py
1
38009
#----------------------------------------------------------------------------- # Name: Tray.py # Product: ClamWin Free Antivirus # # Author: alch [alch at users dot sourceforge dot net] # # Created: 2004/19/03 # Copyright: Copyright alch (c) 2005 # Licence: # This program is free softwa...
gpl-2.0
3,308,064,944,882,480,000
41.839677
260
0.545765
false
gfyoung/pandas
pandas/tests/io/pytables/test_complex.py
1
6374
from warnings import catch_warnings import numpy as np import pytest import pandas.util._test_decorators as td import pandas as pd from pandas import DataFrame, Series import pandas._testing as tm from pandas.tests.io.pytables.common import ensure_clean_path, ensure_clean_store from pandas.io.pytables import read_h...
bsd-3-clause
-5,007,679,795,284,820,000
30.554455
84
0.562441
false
SelfDrivUTT/selfdrivutt
robot/raspberry/controls.py
1
3292
import socket import sys import os import curses from threading import Thread class RemoteControlServer(object): """docstring for Curses_control""" def __init__(self): super(RemoteControl, self).__init__() self.data = '' self.stopped = False self.HOST = os.environ.get('COMMAND_...
mit
2,659,452,182,422,635,000
28.132743
101
0.512151
false
all-of-us/raw-data-repository
rdr_service/alembic/versions/434fb0f05794_add_ignore_and_dev_note_to_genomics_.py
1
1673
"""add ignore and dev note to genomics models. Revision ID: 434fb0f05794 Revises: 994dfe6e53ee Create Date: 2020-09-30 14:39:16.244636 """ from alembic import op import sqlalchemy as sa # revision identifiers, used by Alembic. revision = '434fb0f05794' down_revision = '994dfe6e53ee' branch_labels = None depends_on =...
bsd-3-clause
-7,922,045,653,497,436,000
28.875
111
0.679617
false
dannyroberts/eulxml
eulxml/xmlmap/premis.py
1
5516
# file eulxml/xmlmap/premis.py # # Copyright 2010,2011 Emory University Libraries # # 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,107,150,789,629,381,400
36.020134
95
0.688724
false
mightbejosh/dj-braintree
djbraintree/admin.py
1
6860
# -*- coding: utf-8 -*- """ Note: Django 1.4 support was dropped in #107 https://github.com/pydanny/dj-braintree/pull/107 """ from django.contrib import admin from .models import Transaction from .models import Customer class CustomerHasCardListFilter(admin.SimpleListFilter): title = "card presence" ...
bsd-3-clause
6,652,920,508,881,095,000
23.326241
79
0.525364
false
ericchill/gnofract4d
fract4d/fc.py
1
16906
#!/usr/bin/env python # A compiler from UltraFractal or Fractint formula files to C code # The UltraFractal manual is the best current description of the file # format. You can download it from http://www.ultrafractal.com/uf3-manual.zip # The implementation is based on the outline in "Modern Compiler # Implementatio...
bsd-3-clause
-7,829,546,766,683,979,000
31.827184
133
0.588726
false
devilry/devilry-django
devilry/devilry_group/tests/test_feedbackfeed/mixins/mixin_feedbackfeed_admin.py
1
30195
# -*- coding: utf-8 -*- import mock from django import http from django.conf import settings from django.http import Http404 from django.utils import timezone from model_bakery import baker from devilry.apps.core import models as core_models from devilry.devilry_account import models as account_models from devilry....
bsd-3-clause
-2,731,235,804,573,510,700
59.879032
120
0.646465
false
codilime/cloudify-manager
tests/workflow_tests/test_retrieve_resource_rendering.py
1
2274
######## # Copyright (c) 2013 GigaSpaces 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 # # Unless requir...
apache-2.0
-4,245,692,931,354,031,000
37.542373
79
0.663149
false
sileht/pifpaf
pifpaf/drivers/zookeeper.py
1
2019
# Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software # distributed under the...
apache-2.0
3,448,701,531,717,726,000
30.061538
69
0.600792
false
sam-m888/gramps
gramps/gui/plug/export/_exportassistant.py
1
24356
# # Gramps - a GTK+/GNOME based genealogy program # # Copyright (C) 2004-2007 Donald N. Allingham # Copyright (C) 2008 Brian G. Matherly # Contribution 2009 by Brad Crittenden <brad [AT] bradcrittenden.net> # Copyright (C) 2008 Benny Malengier # Copyright (C) 2010 Jakim Friant # # This program is free...
gpl-2.0
2,831,607,764,847,831,600
36.819876
90
0.565282
false
allo-/django-bingo
bingo/times.py
1
3716
from django.utils import timezone from django.conf import settings from . import config from datetime import datetime, timedelta def now(): return timezone.localtime() def get_times(site): time_now = now() start_time_begin = config.get("start_time_begin", site=site) if start_time_begin is not None: ...
agpl-3.0
6,890,961,281,847,106,000
32.781818
80
0.619214
false
patrickhoefler/lwd
lwd.py
1
7546
#!/usr/bin/python # -*- coding: utf-8 -*- # Functions for turning the Wikidata dump into Linked Data import codecs import glob import gzip import json import math import os import sys import time import xml.etree.cElementTree as ET import settings def process_dump(): # Print some status info print 'Proces...
mit
-7,322,916,570,662,439,000
37.111111
199
0.551816
false
johnbachman/belpy
indra/sources/sofia/api.py
1
5047
import json import time import openpyxl import requests from indra.config import get_config from .processor import SofiaJsonProcessor, SofiaExcelProcessor def process_table(fname): """Return processor by processing a given sheet of a spreadsheet file. Parameters ---------- fname : str The nam...
mit
-2,170,171,834,669,639,000
30.54375
75
0.632059
false
calebmadrigal/algorithms-in-python
heap.py
1
3668
"""heap.py - implementation of a heap priority queue. """ __author__ = "Caleb Madrigal" __date__ = "2015-02-17" import math from enum import Enum from autoresizelist import AutoResizeList class HeapType(Enum): maxheap = 1 minheap = 2 class Heap: def __init__(self, initial_data=None, heap_type=HeapType...
mit
-855,685,561,109,325,200
27.65625
96
0.581516
false
eugenesan/postman
postman/FlickrWorker.py
1
2057
from BaseWorker import * class FlickrWorker(BaseWorker): key = '391fb6763fe0b5011cf52638067e0fed' secret = '369f46a112452186' def __init__(self, parent = None): super(FlickrWorker, self).__init__(parent) def run(self): self.progressSignal.emit(self.stampConfi...
gpl-3.0
-6,879,265,459,719,833,000
36.12963
130
0.557122
false
emmericp/dpdk
app/test/autotest_runner.py
1
14419
# SPDX-License-Identifier: BSD-3-Clause # Copyright(c) 2010-2014 Intel Corporation # The main logic behind running autotests in parallel from __future__ import print_function import StringIO import csv from multiprocessing import Pool, Queue import pexpect import re import subprocess import sys import time import glo...
gpl-2.0
-3,175,455,672,675,276,000
32.377315
80
0.559956
false
unkyulee/elastic-cms
src/web/modules/post/services/config.py
1
2826
import web.util.tools as tools import os from web import app import lib.es as es def get(p): # get host and index from the global config h = tools.get_conf(p['host'], p['navigation']['id'], 'host', 'http://localhost:9200') n = tools.get_conf(p['host'], p['navigation']['id'], 'index', '') return { ...
mit
-7,525,611,961,569,722,000
37.189189
89
0.54954
false
GutenkunstLab/SloppyCell
test/test_FixedPoints.py
1
3610
import unittest import scipy from SloppyCell.ReactionNetworks import * lorenz = Network('lorenz') lorenz.add_compartment('basic') lorenz.add_species('x', 'basic', 0.5) lorenz.add_species('y', 'basic', 0.5) lorenz.add_species('z', 'basic', 0.5) lorenz.add_parameter('sigma', 1.0) lorenz.add_parameter('r', 2.0) lorenz....
bsd-3-clause
-4,611,129,762,351,684,600
43.567901
80
0.565097
false
tcarmelveilleux/IcarusAltimeter
Analysis/altitude_analysis.py
1
1202
# -*- coding: utf-8 -*- """ Created on Tue Jul 14 19:34:31 2015 @author: Tennessee """ import numpy as np import matplotlib.pyplot as plt def altitude(atm_hpa, sea_level_hpa): return 44330 * (1.0 - np.power(atm_hpa / sea_level_hpa, 0.1903)) def plot_alt(): default_msl = 101300.0 pressure = np.l...
mit
4,210,792,572,743,000,600
26.953488
126
0.58985
false
aESeguridad/GERE
venv/lib/python2.7/site-packages/flask_weasyprint/__init__.py
1
7726
# coding: utf8 """ flask_weasyprint ~~~~~~~~~~~~~~~~ Flask-WeasyPrint: Make PDF in your Flask app with WeasyPrint. :copyright: (c) 2012 by Simon Sapin. :license: BSD, see LICENSE for more details. """ import weasyprint from flask import request, current_app from werkzeug.test import Client, Clie...
gpl-3.0
6,181,784,262,939,823,000
35.046729
79
0.612004
false
ThomasHabets/python-pyhsm
examples/yhsm-monitor-exit.py
1
1480
#!/usr/bin/env python # # Copyright (c) 2011, Yubico AB # All rights reserved. # # Utility to send a MONITOR_EXIT command to a YubiHSM. # # MONITOR_EXIT only works if the YubiHSM is in debug mode. It would # be a security problem to allow remote reconfiguration of a production # YubiHSM. # # If your YubiHSM is not in d...
bsd-2-clause
5,347,888,154,988,822,000
24.084746
72
0.618243
false
darvin/qtdjango
src/qtdjango/settings.py
1
5503
# -*- coding: utf-8 -*- from qtdjango.helpers import test_connection __author__ = 'darvin' from qtdjango.connection import * __author__ = 'darvin' from PyQt4.QtCore import * from PyQt4.QtGui import * class BooleanEdit(QCheckBox): def text(self): return QVariant(self.checkState()).toString() def ...
gpl-2.0
3,427,938,179,775,995,000
34.326389
98
0.599568
false
barbarahui/nuxeo-calisphere
s3stash/nxstash_mediajson.py
1
4444
#!/usr/bin/env python # -*- coding: utf-8 -*- from __future__ import unicode_literals import sys import os from s3stash.nxstashref import NuxeoStashRef from deepharvest.deepharvest_nuxeo import DeepHarvestNuxeo from deepharvest.mediajson import MediaJson from dplaingestion.mappers.ucldc_nuxeo_mapper import UCLDCNuxeoM...
bsd-3-clause
-6,770,037,951,671,929,000
32.413534
77
0.602835
false
lalitkumarj/NEXT-psych
gui/base/app_manager/PoolBasedTripletMDS/PoolBasedTripletMDS.py
1
9004
import csv, json, os, requests, sys from wtforms import Form, FieldList, FloatField, FormField, TextField, IntegerField, SelectField, validators, RadioField from jinja2 import Environment, FileSystemLoader import copy from base.models import Experiment from flask import render_template from base.settings import Confi...
apache-2.0
-5,100,060,686,821,481,000
48.745856
170
0.584407
false
anjel-ershova/python_training
fixture/fixture_group.py
1
4896
from model.model_group import Group import random class GroupHelper: def __init__(self, app): self.app = app def select_group_by_index(self, index): wd = self.app.wd wd.find_elements_by_name("selected[]")[index].click() def select_group_by_id(self, id): wd = self.app.wd ...
apache-2.0
4,500,193,398,506,461,700
33.285714
91
0.592708
false
bb111189/Arky2
boilerplate/external/pycountry/__init__.py
1
3459
# vim:fileencoding=utf-8 # Copyright (c) 2008-2011 gocept gmbh & co. kg # See also LICENSE.txt # $Id$ """pycountry""" import os.path import pycountry.db LOCALES_DIR = os.path.join(os.path.dirname(__file__), 'locales') DATABASE_DIR = os.path.join(os.path.dirname(__file__), 'databases') class Countries(pycountry.db...
lgpl-3.0
8,592,734,702,324,915,000
30.445455
78
0.601619
false
abilian/abilian-core
src/abilian/core/models/tests/test_blob.py
1
3462
"""""" import uuid from io import StringIO from flask import Flask from abilian.core.models.blob import Blob from abilian.core.sqlalchemy import SQLAlchemy from abilian.services import repository_service as repository from abilian.services import session_repository_service as session_repository # # Unit tests # def...
lgpl-2.1
-4,471,897,591,690,982,400
26.259843
79
0.666667
false
Phonemetra/TurboCoin
test/functional/rpc_getblockstats.py
1
6826
#!/usr/bin/env python3 # Copyright (c) 2017-2019 TurboCoin # Distributed under the MIT software license, see the accompanying # file COPYING or http://www.opensource.org/licenses/mit-license.php. # # Test getblockstats rpc call # from test_framework.test_framework import TurbocoinTestFramework from test_framework.util...
mit
1,836,108,626,867,167,700
40.621951
121
0.598447
false
savioabuga/django-geonames-field
docs/conf.py
1
8231
# -*- coding: utf-8 -*- # # complexity documentation build configuration file, created by # sphinx-quickstart on Tue Jul 9 22:26:36 2013. # # 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. # # ...
bsd-3-clause
-5,976,811,117,962,675,000
31.405512
80
0.708176
false
ecell/libmoleculizer
python-src/bngparser/src/moleculizer/moleculeinterpreter.py
1
6341
############################################################################### # BNGMZRConverter - A utility program for converting bngl input files to mzr # input files. # Copyright (C) 2007, 2008, 2009 The Molecular Sciences Institute # # Moleculizer is free software; you can redistribute it and/or modify # it ...
gpl-2.0
4,373,819,553,800,396,000
37.664634
130
0.674972
false
GunnerJnr/_CodeInstitute
Stream-2/Back-End-Development/3.Testing/3.Safe-Refactoring/challenge-solution/test_vending_machine.py
1
1027
# import the unit test module import unittest from vending_machine import give_change from vending_machine import give_change_decimal # define a class (inherits from unittest) class TestVendingMachine(unittest.TestCase): # define our method (must because with test_ otherwise the test will not run) def test_re...
mit
-7,425,424,723,672,473,000
41.791667
93
0.667965
false
stackimpact/stackimpact-python
tests/message_queue_test.py
1
1716
import unittest import sys import json import stackimpact from stackimpact.utils import timestamp from test_server import TestServer class MessageQueueTest(unittest.TestCase): def test_flush(self): server = TestServer(5005) server.start() stackimpact._agent = None agent = sta...
bsd-3-clause
476,884,992,317,026,370
21
76
0.521562
false
mpi-sws-rse/antevents-python
examples/event_library_comparison/event.py
1
8071
"""This version uses a traditional event-driven version, using continuation passing style. Each method call is passed a completion callback and an error callback """ from statistics import median import json import asyncio import random import time import hbmqtt.client from collections import deque from antevents.base...
apache-2.0
4,810,702,886,399,499,000
37.251185
100
0.563127
false
saikrishnar/vsm_preparer
scripts/quincontext.py
1
1778
#! /usr/bin/python import os def main(folder): #vectors = [] #f = open('../dictionary/vectors.txt') #for line in f: # representation = line.strip('\n') # vectors.append(representation) #f.close() for d, ds, fs in os.walk(folder): for fname in fs: if fname[-...
gpl-2.0
4,492,283,820,192,578,000
34.56
151
0.45838
false
tomato42/tlsfuzzer
scripts/test-openssl-3712.py
1
9502
# Author: Hubert Kario, (c) 2015 # Released under Gnu GPL v2.0, see LICENSE file for details from __future__ import print_function import traceback import sys import getopt from itertools import chain from random import sample from tlsfuzzer.runner import Runner from tlsfuzzer.messages import Connect, ClientHelloGene...
gpl-2.0
-734,074,567,831,562,600
39.434043
108
0.603452
false
sumeetsk/NEXT-1
apps/DuelingBanditsPureExploration/tests/test_api.py
1
5422
import numpy import numpy as np import numpy.random import random import json import time from datetime import datetime import requests from scipy.linalg import norm import time from multiprocessing import Pool import os import sys try: import next.apps.test_utils as test_utils except: sys.path.append('../../.....
apache-2.0
3,044,284,908,923,959,000
34.907285
96
0.562339
false
Eksmo/calibre
src/calibre/gui2/viewer/position.py
1
1815
#!/usr/bin/env python # vim:fileencoding=UTF-8:ts=4:sw=4:sta:et:sts=4:ai from __future__ import (unicode_literals, division, absolute_import, print_function) __license__ = 'GPL v3' __copyright__ = '2012, Kovid Goyal <kovid@kovidgoyal.net>' __docformat__ = 'restructuredtext en' import json c...
gpl-3.0
-6,051,221,796,672,716,000
24.928571
75
0.534986
false
openego/oeplatform
modelview/migrations/0022_auto_20160303_2233.py
1
1468
# -*- coding: utf-8 -*- # Generated by Django 1.9 on 2016-03-03 21:33 from __future__ import unicode_literals from django.db import migrations, models class Migration(migrations.Migration): dependencies = [("modelview", "0021_auto_20160303_2233")] operations = [ migrations.AlterField( m...
agpl-3.0
-647,503,568,038,892,000
30.234043
80
0.419619
false
AjabWorld/ajabsacco
ajabsacco/core/facades/loans/transactions.py
1
8484
from ajabsacco.core.models import ( LoanTransactionEntry, LoanProduct, LoanAccount, Message as SMSMessage, ) from decimal import Decimal as D from django.db.models import Q, Sum, F from django.utils import timezone from django.db import transaction as db_transaction from ajabsacco.core import code...
apache-2.0
3,779,830,831,397,354,500
45.360656
115
0.658298
false
ArcherSys/ArcherSys
Lib/test/reperf.py
1
1754
<<<<<<< HEAD <<<<<<< HEAD import re import time def main(): s = "\13hello\14 \13world\14 " * 1000 p = re.compile(r"([\13\14])") timefunc(10, p.sub, "", s) timefunc(10, p.split, s) timefunc(10, p.findall, s) def timefunc(n, func, *args, **kw): t0 = time.perf_counter() try: for i in ...
mit
-53,206,256,789,101,470
22.386667
61
0.513683
false
Erotemic/ibeis
dev/_scripts/installers.py
1
16608
#!/usr/bin/env python # -*- coding: utf-8 -*- r""" On mac need to run with sudo Testing: python %HOME%/code/ibeis/_installers/ibeis_pyinstaller_data_helper.py --test-get_data_list python ~/code/ibeis/_installers/ibeis_pyinstaller_data_helper.py --test-get_data_list SeeAlso: _installers/ibeis_pyinstalle...
apache-2.0
5,563,224,776,023,611,000
34.037975
175
0.635718
false
rr-/ida-images
rgb-ida.py
1
3099
import idaapi import librgb from librgb.qt_shims import QtGui # important for PySide legacy IDA from librgb.qt_shims import QtWidgets try: MAJOR, MINOR = map(int, idaapi.get_kernel_version().split(".")) except AttributeError: MAJOR, MINOR = 6, 6 USING_IDA7API = MAJOR > 6 USING_PYQT5 = USING_IDA7API or (MAJOR ...
mit
-2,430,317,480,103,620,600
29.683168
79
0.595999
false
bukun/pycsw
pycsw/server.py
1
35618
# -*- coding: utf-8 -*- # ================================================================= # # Authors: Tom Kralidis <tomkralidis@gmail.com> # Angelos Tzotsos <tzotsos@gmail.com> # # Copyright (c) 2016 Tom Kralidis # Copyright (c) 2015 Angelos Tzotsos # Copyright (c) 2016 James Dickens # Copyright (c) 2016 Ri...
mit
5,338,149,996,846,063,000
39.659817
108
0.534758
false
zencore-dobetter/zencore-utils
src/zencore/utils/redis.py
1
3995
import uuid import math import time import logging import redis as engine from zencore.errors import WrongParameterTypeError from .types import smart_force_to_string logger = logging.getLogger(__name__) class RedisLock(object): def __init__(self, url, name=None, app_name=None, expire=None, prefix="zencore:lock...
mit
3,164,183,319,776,613,000
29.929688
109
0.558474
false
p/webracer
tests/request_via_form_test.py
1
1451
import webracer import nose.plugins.attrib from . import utils from .apps import form_app utils.app_runner_setup(__name__, form_app.app, 8059) @nose.plugins.attrib.attr('client') @webracer.config(host='localhost', port=8059) class RequestViaFormTest(webracer.WebTestCase): def test_get_form_as_url(self): s...
bsd-2-clause
4,729,082,334,174,765,000
28.02
57
0.598897
false
Ichag/django-timelinejs3
timeline/migrations/0009_auto_20150819_0648.py
1
3020
# -*- coding: utf-8 -*- from __future__ import unicode_literals from django.db import models, migrations class Migration(migrations.Migration): dependencies = [ ('timeline', '0008_auto_20150818_2241'), ] operations = [ migrations.AlterField( model_name='options', ...
bsd-3-clause
4,725,792,827,878,784,000
31.12766
61
0.54404
false
do-mpc/do-mpc
testing/test_oscillating_masses_discrete_dae.py
1
3206
# # This file is part of do-mpc # # do-mpc: An environment for the easy, modular and efficient implementation of # robust nonlinear model predictive control # # Copyright (c) 2014-2019 Sergio Lucia, Alexandru Tatulea-Codrean # TU Dortmund. All rights reserved # # do-mpc is free sof...
lgpl-3.0
573,126,971,548,186,750
28.962617
111
0.622895
false
scottgigante/picopore
test/test.py
1
2274
from __future__ import print_function import subprocess import os import errno import shutil import time import signal __test_files__ = ["sample_data/albacore_1d_original.fast5", "sample_data/metrichor_2d_original.fast5"] __test_runs__ = ["lossless", "deep-lossless"] __prefix__ = "picopore.test" __raw_runs__ = [["--fa...
gpl-3.0
-8,761,686,030,981,263,000
30.583333
150
0.616535
false
whiteshield/EHScripter
EHScripter/netsparker.py
1
6143
##!/usr/bin/env python3 # -*- coding: utf-8 -*- import os import sys import re import string from io import StringIO from lxml import etree try: from .util import * except Exception as e: from util import * class NetsparkerToMarkdown: def __init__(self, options): self.options=options self....
gpl-2.0
4,605,033,301,372,981,000
44.503704
196
0.496988
false
swcurran/tfrs
backend/api/models/UserViewModel.py
1
1507
""" REST API Documentation for the NRS TFRS Credit Trading Application The Transportation Fuels Reporting System is being designed to streamline compliance reporting for transportation fuel suppliers in accordance with the Renewable & Low Carbon Fuel Requirements Regulation. OpenAPI spec version: v1 ...
apache-2.0
9,088,370,143,756,785,000
40.861111
208
0.704048
false
vanesa/kid-o
kido/admin/utils.py
1
3921
# -*- coding: utf-8 -*- """ Flask-Admin utilities.""" from flask import abort, redirect, request, url_for from flask_admin import AdminIndexView, expose from flask_admin.base import MenuLink from flask_admin.contrib.sqla import ModelView from flask_login import current_user from functools import wraps from kido impo...
bsd-3-clause
-352,002,768,738,183,740
28.931298
86
0.61872
false
eepgwde/pyeg0
gmus/GMus0.py
1
1699
## @file GMus0.py # @brief Application support class for the Unofficial Google Music API. # @author weaves # # @details # This class uses @c gmusicapi. # # @note # An application support class is one that uses a set of driver classes # to provide a set of higher-level application specific methods. # # @see # https://g...
gpl-3.0
6,076,076,360,128,342,000
30.462963
74
0.656857
false
mdmueller/ascii-profiling
parallel.py
1
4245
import timeit import time from astropy.io import ascii import pandas import numpy as np from astropy.table import Table, Column from tempfile import NamedTemporaryFile import random import string import matplotlib.pyplot as plt import webbrowser def make_table(table, size=10000, n_floats=10, n_ints=0, n_strs=0, float_...
mit
-9,088,434,750,835,889,000
45.141304
122
0.623793
false
patriciohc/carga-de-xls-a-MySQL
Choose_file.py
1
3639
# -*- coding: utf-8 -*- # Form implementation generated from reading ui file 'Choose_file.ui' # # Created: Sat Oct 17 15:55:19 2015 # by: PyQt4 UI code generator 4.10.4 # # WARNING! All changes made in this file will be lost! from PyQt4 import QtCore, QtGui try: _fromUtf8 = QtCore.QString.fromUtf8 except At...
apache-2.0
-8,237,645,389,629,048,000
46.25974
82
0.718054
false
NeuralProsthesisLab/unlock
unlock/analysis/test/test_data_bank.py
1
3421
# Copyright (c) James Percent and Unlock contributors. # 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 copyright notice, # this l...
bsd-3-clause
-8,389,552,375,796,463,000
30.1
82
0.599532
false
c0cky/mediathread
mediathread/djangosherd/api.py
1
4549
# pylint: disable-msg=R0904 from tastypie import fields from tastypie.resources import ModelResource from mediathread.api import UserResource, TagResource from mediathread.assetmgr.models import Asset from mediathread.djangosherd.models import SherdNote, DiscussionIndex from mediathread.projects.models import ProjectN...
gpl-2.0
-7,704,276,080,529,471,000
41.915094
79
0.56386
false
fdslight/fdslight
freenet/handlers/tundev.py
1
5566
#!/usr/bin/env python3 import os, sys import pywind.evtframework.handlers.handler as handler import freenet.lib.fn_utils as fn_utils import freenet.lib.simple_qos as simple_qos try: import fcntl except ImportError: pass class tun_base(handler.handler): __creator_fd = None # 要写入到tun的IP包 ___ip_pac...
bsd-2-clause
794,198,108,318,362,000
23.490741
84
0.567864
false
nuodb/nuodb-django
test/auth/tests/tokens.py
1
2747
import sys from datetime import date, timedelta from django.conf import settings from django.contrib.auth.models import User from django.contrib.auth.tokens import PasswordResetTokenGenerator from django.contrib.auth.tests.utils import skipIfCustomUser from django.test import TestCase from django.utils import unittest...
bsd-3-clause
3,380,484,588,206,988,000
38.242857
88
0.646159
false
durden/dayonetools
dayonetools/services/habit_list.py
1
10350
""" This module provides a way to import data from the Habit List iPhone application (http://habitlist.com/) into Day One Journal (http://dayoneapp.com/) entries. To use this module you must first do a manual export of your data from Habit list. This can be done by the following: - Open Habit List iPhone app ...
mit
-1,088,409,671,153,115,600
35.315789
102
0.648792
false
gtcasl/eiger
Eiger.py
1
20400
#!/usr/bin/python # # \file Eiger.py # \author Eric Anger <eanger@gatech.edu> # \date July 6, 2012 # # \brief Command line interface into Eiger modeling framework # # \changes Added more plot functionality; Benjamin Allan, SNL 5/2013 # import argparse import matplotlib.pyplot as plt import numpy as np import math impo...
bsd-3-clause
8,259,570,660,788,744,000
44.033113
101
0.634265
false
vesellov/bitdust.devel
customer/data_sender.py
1
14665
#!/usr/bin/python # data_sender.py # # Copyright (C) 2008-2018 Veselin Penev, https://bitdust.io # # This file (data_sender.py) is part of BitDust Software. # # BitDust 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 Softwa...
agpl-3.0
4,224,043,803,797,804,000
38.422043
170
0.512104
false
agacek/camkes-tool
camkes/internal/version.py
1
1813
# # Copyright 2014, NICTA # # This software may be distributed and modified according to the terms of # the BSD 2-Clause license. Note that NO WARRANTY is provided. # See "LICENSE_BSD2.txt" for details. # # @TAG(NICTA_BSD) # '''Versioning functionality. This computes a version identifier based on the current source co...
bsd-2-clause
-41,992,440,657,990,110
35.26
79
0.656922
false
ibrica/universe-server
play.py
1
1073
from multiprocessing import Process import time import gym import universe from universe.spaces.vnc_event import keycode from envs import create_env def start_game(model, env_name): """regular Python process, not using torch""" p = Process(target=play_game, args=(model,env_name)) p.start() # Don't wa...
mit
-6,093,060,618,181,687,000
33.645161
130
0.630941
false
droundy/deft
talks/colloquium/figs/plot-walls.py
1
3242
#!/usr/bin/python # We need the following two lines in order for matplotlib to work # without access to an X server. from __future__ import division import matplotlib matplotlib.use('Agg') import pylab, numpy, sys xmax = 2.5 xmin = -0.4 def plotit(dftdata, mcdata): dft_len = len(dftdata[:,0]) dft_dr = dftda...
gpl-2.0
-4,687,526,299,663,627,000
33.489362
99
0.637569
false
AprilBrother/esptool
esptool.py
1
28432
#!/usr/bin/env python # # ESP8266 ROM Bootloader Utility # https://github.com/themadinventor/esptool # # Copyright (C) 2014 Fredrik Ahlberg # # 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; eith...
gpl-2.0
1,992,661,783,218,690,600
38.709497
152
0.573579
false
eharney/cinder
cinder/api/v3/attachments.py
1
11362
# Licensed under the Apache License, Version 2.0 (the "License"); you may # not use this file except in compliance with the License. You may obtain # a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software # d...
apache-2.0
-5,867,306,877,933,996,000
38.451389
79
0.58106
false
turbokongen/home-assistant
homeassistant/components/plex/config_flow.py
1
15991
"""Config flow for Plex.""" import copy import logging from aiohttp import web_response import plexapi.exceptions from plexapi.gdm import GDM from plexauth import PlexAuth import requests.exceptions import voluptuous as vol from homeassistant import config_entries from homeassistant.components.http.view import HomeAs...
apache-2.0
1,489,924,755,053,045,500
36.36215
85
0.598837
false
italomaia/turtle-linux
games/Dynamite/pgu/test.py
1
1624
import pygame from pygame.locals import * import gui screen = pygame.display.set_mode( (640, 480), FULLSCREEN ) # try adding DOUBLEBUF | HWSURFACE # pygame.mouse.set_visible(0) app = gui.App() c = gui.Container(width=640,height=480) ## ## dialog 1 ## t1 = gui.Table() t1.tr() t1.add(gui.Label("Gal Test")) ...
gpl-3.0
4,685,452,212,621,695,000
14.037037
68
0.589286
false
ezbake/ezbake-common-python
thrift/thrift-utils/lib/ezbake/thrift/utils/ezthrifttest.py
1
3296
# Copyright (C) 2013-2014 Computer Sciences Corporation # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by a...
apache-2.0
-5,059,667,138,645,476,000
40.2125
111
0.68932
false
wfx/epack
epack/libarchive/ffi.py
1
7623
# This file is part of a program licensed under the terms of the GNU Lesser # General Public License version 2 (or at your option any later version) # as published by the Free Software Foundation: http://www.gnu.org/licenses/ from __future__ import division, print_function, unicode_literals from ctypes import ( ...
gpl-3.0
-946,142,099,526,545,800
30.114286
79
0.647908
false
chintak/scikit-image
skimage/feature/util.py
1
4726
import numpy as np from skimage.util import img_as_float class FeatureDetector(object): def __init__(self): self.keypoints_ = np.array([]) def detect(self, image): """Detect keypoints in image. Parameters ---------- image : 2D array Input image. ...
bsd-3-clause
973,310,001,294,730,000
28.354037
79
0.585485
false
mbrukman/delayed-replay
tests/proxy_test.py
1
1244
#!/usr/bin/python # # Copyright 2014 Google Inc. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or a...
apache-2.0
-9,002,905,825,614,061,000
29.341463
80
0.634244
false