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
all-of-us/raw-data-repository
rdr_service/lib_fhir/fhirclient_4_0_0/models/account_tests.py
1
4654
#!/usr/bin/env python # -*- coding: utf-8 -*- # # Generated from FHIR 4.0.0-a53ec6ee1b on 2019-05-07. # 2019, SMART Health IT. import os import io import unittest import json from . import account from .fhirdate import FHIRDate class AccountTests(unittest.TestCase): def instantiate_from(self, filename): ...
bsd-3-clause
8,311,534,683,422,182,000
50.142857
145
0.672969
false
hobson/pug-nlp
pug/nlp/tests.py
1
1514
#!/usr/bin/env python """ Uses the python unittest module to test this app with `python -m unittest pug.nlp`. """ # from django.test import TestCase from unittest import TestCase, main import doctest from pug.nlp import util, http, penn_treebank_tokenizer, detector_morse class NLPDocTest(TestCase): def test_mod...
mit
-613,868,315,280,102,900
35.926829
145
0.677675
false
dimara/ganeti
lib/hypervisor/hv_xen.py
1
51356
# # # Copyright (C) 2006, 2007, 2008, 2009, 2010, 2011, 2012 Google Inc. # All rights reserved. # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions are # met: # # 1. Redistributions of source code must retain the above copyright no...
bsd-2-clause
2,470,150,960,712,648,000
32.720289
80
0.656574
false
tensorflow/mesh
mesh_tensorflow/transformer/transformer_layers.py
1
85747
# coding=utf-8 # Copyright 2021 The Mesh TensorFlow 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 applicab...
apache-2.0
-6,227,173,806,520,915,000
39.106174
109
0.649749
false
alirizakeles/zato
code/zato-server/src/zato/server/service/internal/email/smtp.py
1
2958
# -*- coding: utf-8 -*- """ Copyright (C) 2014 Dariusz Suchojad <dsuch at zato.io> Licensed under LGPLv3, see LICENSE.txt for terms and conditions. """ from __future__ import absolute_import, division, print_function, unicode_literals # stdlib from contextlib import closing from time import time # Zato from zato.c...
gpl-3.0
4,681,710,267,024,434,000
31.444444
127
0.67089
false
firelab/windninja-mobile
WindNinja-Server/windninja_server/windninjaqueue/manager.py
1
3293
import sys import time import datetime from operator import itemgetter import subprocess import windninja_server.windninjaqueue.windninja as wn import windninja_server.windninjaqueue.queue as wnqueue VERBOSE = False CANCEL = False LOOP_PAUSE = 5 MAX_RUNNING_JOBS = 5 # NOTES: this is a simple 'max' processes queue m...
unlicense
3,838,413,664,077,272,600
32.927835
121
0.583105
false
saisankargochhayat/algo_quest
techdevguide/longestsubsequence.py
1
3538
# The Challenge # Given a string S and a set of words D, find the longest word in D that is a subsequence of S. # Word W is a subsequence of S if some number of characters, possibly zero, can be deleted from S to form W, without reordering the remaining characters. # Note: D can appear in any format (list, hash table...
apache-2.0
2,336,088,256,580,298,000
46.106667
246
0.637033
false
Yaribz/SPADS
plugins/templates/commented/myconfigurableplugin.py
1
1698
# Import the perl module so we can call the SPADS Plugin API import perl # perl.MyConfigurablePlugin is the Perl representation of the MyConfigurablePlugin plugin module # We will use this object to call the plugin API spads=perl.MyConfigurablePlugin # This is the first version of the plugin pluginVersion='0.1' # T...
gpl-3.0
4,510,893,569,707,040,300
37.590909
119
0.765018
false
hpbader42/Klampt
Python/klampt/vis/glinterface.py
1
2832
class GLPluginInterface: """Users can add their own hooks into the visualizer by overloading this class's methods. Each method should return True if the user event was processed. A return value of True stops cascading events to a parent interface.""" def __init__(self): self.window = None...
bsd-3-clause
5,007,778,894,906,032,000
36.76
97
0.629944
false
ismailsunni/healthsites
django_project/core/settings/prod.py
1
2660
# -*- coding: utf-8 -*- from .project import * # noqa # Hosts/domain names that are valid for this site; required if DEBUG is False # See https://docs.djangoproject.com/en/1.5/ref/settings/#allowed-hosts ALLOWED_HOSTS = ['*'] DATABASES = { 'default': { 'ENGINE': 'django.contrib.gis.db.backends.postgis', ...
bsd-2-clause
-4,110,860,493,750,997,000
29.227273
77
0.503008
false
pwil3058/pysm_wsm
scm/scm_events.py
1
1384
### -*- coding: utf-8 -*- ### ### Copyright (C) 2016 Peter Williams <pwil3058@gmail.com> ### ### 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; version 2 of the License only. ### ### This pr...
gpl-2.0
-4,610,620,243,944,773,600
43.645161
153
0.721821
false
LaboratoireMecaniqueLille/crappy
crappy/tool/GUI_Arduino/frame_objects.py
1
6752
# coding: utf-8 import tkinter as tk from tkinter import ttk class FrameObjects(tk.Frame): """A very simple class that should be inherited by frames, to help create and maintain in order the file. How it works: - After frames defined, create a dict (or an orderedDict, for convenience), that will contain e...
gpl-2.0
-4,450,019,639,442,583,000
34.350785
79
0.551392
false
wathen/PhD
MHD/FEniCS/ShiftCurlCurl/CppGradient/Efficient/CurlCurlSecondOrder.py
1
5726
import petsc4py, sys petsc4py.init(sys.argv) from petsc4py import PETSc import os, inspect from dolfin import * import numpy import ExactSol import MatrixOperations as MO import CheckPetsc4py as CP import HiptmairPrecond import HiptmairSetup from timeit import default_timer as timer m = 8 errL2b =numpy.zeros((m-1,1))...
mit
-7,598,322,120,128,838,000
32.48538
191
0.627314
false
CarlosRA97/explorer-interface
GPIO/ventanas.py
1
1952
#!/usr/bin/env python2.7 from Tkinter import * import tkMessageBox # from RPi.GPIO import * # # from wiringpi2 import * from time import sleep pinesGPIO = [2,3,4,17,27,22,10,9,11,14,15,18,23,24,25,8,7] pinesGPIO # setmode(BCM) # setwarnings(False) def stp(pin): setup(pin, OUT) def on(pin): output(pin,1) def...
gpl-2.0
9,020,848,000,113,857,000
18.717172
82
0.620902
false
robcarver17/pysystemtrade
systems/provided/futures_chapter15/rules.py
1
4311
""" Trading rules for futures system """ from syscore.dateutils import ROOT_BDAYS_INYEAR import pandas as pd from sysquant.estimators.vol import robust_vol_calc def ewmac(price, vol, Lfast, Lslow): """ Calculate the ewmac trading rule forecast, given a price and EWMA speeds Lfast, Lslow and vol_lookback ...
gpl-3.0
-4,335,350,251,714,531,000
30.014388
112
0.674785
false
amirfefer/Cyber-Camera
server.py
1
4344
from flask import Flask, render_template, Response,send_file, request, session, redirect, url_for import camera import flask_httpauth import config import os import io import threading import time import hashlib import logging import datetime import ssl import cloud app = Flask(__name__) conf = config.Configuration() ...
gpl-3.0
-3,400,487,777,179,422,000
31.909091
128
0.638352
false
auag92/n2dm
Asap-3.8.4/Projects/NanoparticleMC/resume_amc_gas.py
1
2557
#PBS -l nodes=20:ppn=4:opteron4 #PBS -q verylong #PBS -N amc_n100_conv1 #PBS -m ae import os from montecarlo import SurfaceMonteCarloData from ase.cluster.cubic import FaceCenteredCubic from ase.cluster import data from asap3.MonteCarlo.Metropolis import Metropolis from asap3.MonteCarlo.Moves import SurfaceMove from as...
mit
3,836,986,307,182,625,000
31.782051
108
0.707861
false
gaurav/phylo2owl
tests/test_alt_inputs.py
1
2038
#!/usr/bin/env python """ test_alt_inputs.py: Test whether phylo2owl supports multiple input types, including NEXUS and NexML. All of these file types should return exactly the same RDF/XML output. """ import libphylo2owl import pytest import os def test_newick_convert_to_OWL(path_tre): """ Test all .tre files...
mit
-6,772,687,858,154,553,000
30.84375
94
0.631501
false
rshriram/api
python/istio_api/mcp/v1alpha1/resource_pb2.py
1
3194
# Generated by the protocol buffer compiler. DO NOT EDIT! # source: mcp/v1alpha1/resource.proto import sys _b=sys.version_info[0]<3 and (lambda x:x) or (lambda x:x.encode('latin1')) from google.protobuf import descriptor as _descriptor from google.protobuf import message as _message from google.protobuf import reflec...
apache-2.0
-1,937,891,865,029,663,000
37.481928
397
0.740451
false
channsoden/hannsoden-bioinformatics
WholeGenomePhylogeny/partition_finder_tools.py
1
5531
# defunct partion finder functions def configure_PF(alignment_file, user_tree = '', branchlengths = 'linked', models='GTR+G', criteria = 'aicc', partition = '', search = 'kmeans'): # Create a partition_finder.cfg file cfg = open('partition_finder.cfg', 'w') cfg.write("# ALIGNMENT FILE #\n") cfg.write(...
gpl-3.0
-6,557,690,750,098,337,000
37.950704
152
0.580004
false
gdietz/OpenMEE
edit_funnel_plot_form.py
1
1408
''' Created on Dec 12, 2013 @author: george ''' import sys from PyQt4 import QtCore, QtGui from PyQt4.Qt import * from common_wizard_pages.funnel_page import FunnelPage class EditFunnelPlotForm(QDialog): def __init__(self, funnel_params, parent=None): super(EditFunnelPlotForm, self).__init__(parent) ...
gpl-3.0
8,065,206,704,558,094,000
25.584906
86
0.618608
false
Opticalp/instrumentall
testsuite/python/dataBufferTest.py
1
4601
# -*- coding: utf-8 -*- ## @file testsuite/python/dataBufferTest.py ## @date jul. 2016 ## @author PhRG - opticalp.fr ## ## Test the features of the DataProxy # # Copyright (c) 2016 Ph. Renaud-Goud / Opticalp # # Permission is hereby granted, free of charge, to any person obtaining a copy # of this software and as...
mit
-113,785,671,914,033,140
34.666667
83
0.664203
false
yaybu/touchdown
touchdown/goals/get_signin_url.py
1
1515
# Copyright 2015 Isotoma Limited # # 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
427,314,541,821,620,000
30.5625
74
0.675248
false
hawkrives/project-e.a.s.t.
syllogizmos/truthfinder.py
1
1254
""" truthfinder.py - given a statement and a list of truths, determine whether or not the statement is confirmed (always true), plausible (sometimes true), or busted (never true). Thanks Mythbusters. """ from .constants import CONFIRMED, BUSTED, PLAUSIBLE from .utils import invert de...
mit
8,736,321,739,489,594,000
34.828571
96
0.675439
false
berkmancenter/mediacloud
apps/webapp-api/tests/python/auth/register/test_send_user_activation_token.py
1
1387
from mediawords.db import connect_to_db from webapp.auth.register import add_user, send_user_activation_token from webapp.auth.user import NewUser from webapp.test.dummy_emails import TestDoNotSendEmails class SendUserActivationTokenTestCase(TestDoNotSendEmails): def test_send_user_activation_token(self): ...
agpl-3.0
251,042,372,848,124,100
29.822222
115
0.569575
false
nycz/urd
matrix.py
1
2130
def default_item(): return ('', (0,0)) class Matrix(): def __init__(self): self.data = [[default_item()]] def __str__(self): return '\n'.join(repr(row) for row in self.data) # return '\n'.join('\t|\t'.join(repr(x) for x in row) for row in self.data) def __contains__(self, key...
mit
-8,434,596,789,365,278,000
25.625
83
0.518779
false
HenryHu/pybbs
Board.py
1
46243
#!/usr/bin/env python # vim: set fileencoding=utf-8 : from Util import Util import Config import struct import json import base64 import BCache import User import BRead import BoardManager import UserManager import PostEntry from Error import * from Log import Log from cstruct import CStruct import fcntl import time im...
bsd-2-clause
-6,797,301,592,258,830,000
34.182165
112
0.515176
false
zsjohny/jumpserver
apps/settings/forms/ldap.py
1
1449
# coding: utf-8 # from django import forms from django.utils.translation import ugettext_lazy as _ from common.fields import FormDictField, FormEncryptCharField from .base import BaseForm __all__ = ['LDAPSettingForm'] class LDAPSettingForm(BaseForm): AUTH_LDAP_SERVER_URI = forms.CharField( label=_("L...
gpl-2.0
-8,382,868,198,799,438,000
30.5
79
0.634921
false
radjkarl/imgProcessor
imgProcessor/measure/SNR/SNR_IEC.py
1
1187
# coding=utf-8 from __future__ import division import numpy as np def SNR_IEC(i1, i2, ibg=0, allow_color_images=False): ''' Calculate the averaged signal-to-noise ratio SNR50 as defined by IEC NP 60904-13 needs 2 reference EL images and one background image ''' # ensure images a...
gpl-3.0
-3,386,865,506,410,302,500
33.969697
91
0.613311
false
kingmotley/SickRage
sickbeard/name_parser/parser.py
1
24227
# coding=utf-8 # Author: Nic Wolfe <nic@wolfeden.ca> # URL: http://code.google.com/p/sickbeard/ # # This file is part of SickRage. # # SickRage 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...
gpl-3.0
-3,112,230,909,662,267,000
40.062712
190
0.552772
false
MangoMangoDevelopment/neptune
lib/ros_comm-1.12.0/tools/rosconsole/scripts/generate_speed_test.py
1
5464
#!/usr/bin/python # Software License Agreement (BSD License) # # Copyright (c) 2008, Willow Garage, Inc. # All rights reserved. # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions # are met: # # * Redistributions of source code mus...
bsd-3-clause
-4,139,669,830,327,314,400
50.54717
126
0.690337
false
jasperges/blenderseed
__init__.py
1
2505
# # This source file is part of appleseed. # Visit http://appleseedhq.net/ for additional information and resources. # # This software is released under the MIT license. # # Copyright (c) 2014-2017 The appleseedhq Organization # # Permission is hereby granted, free of charge, to any person obtaining a copy # of this s...
mit
2,158,641,503,584,223,000
30.3125
79
0.712974
false
steingabelgaard/odoo-infrastructure
infrastructure_contract/database.py
1
2074
#-*- coding: utf-8 -*- from openerp import models, fields, api, _ from openerp.exceptions import Warning from urlparse import urlparse class database(models.Model): _inherit = "infrastructure.database" contract_id = fields.Many2one( 'account.analytic.account', string='Contract', doma...
agpl-3.0
-8,775,898,237,925,027,000
34.152542
79
0.543877
false
Ell/goonauth
goonauth/settings.py
1
5913
import os PROJECT_ROOT = os.path.abspath(os.path.join(os.path.dirname(__file__), os.pardir)) PACKAGE_ROOT = os.path.abspath(os.path.dirname(__file__)) DEBUG = True TEMPLATE_DEBUG = DEBUG ADMINS = [ ("Your Name", "your_email@example.com"), ] MANAGERS = ADMINS DATABASES = { "default": { "ENGINE": "d...
mit
-3,595,466,343,944,919,600
26.375
82
0.686961
false
andybalaam/cell
tests/library_tests.py
1
6619
from io import StringIO from tests.util.asserts import assert_that, assert_fails, equals from tests.util.test import test from pycell.env import Env from pycell.eval_ import eval_list from pycell.lexer import lex from pycell.parser import parse import pycell.library # --- Utils def evald(inp, stdout=None): e...
mit
3,013,462,423,744,919,000
20.701639
77
0.529083
false
kunesj/conkyKeep
conkyKeep/build_conkyrc.py
1
1624
#!/usr/bin/env python3 # encoding: utf-8 from .configmanager import CONFIG_MANAGER CONKYRC_TOP = """ -- This file gets automatically generated by build_conkyrc.py conky.config = { """ CONKYRC_BOTTOM = """ total_run_times = 0, alignment = 'top_right', background = true, own_window = true, own_windo...
gpl-3.0
-2,326,281,868,828,864,500
31.48
123
0.606527
false
luismmontielg/pyplotter
setup.py
1
1841
#-*- coding: utf-8 -*- from pyplotter import __version__ import os import sys try: from setuptools import setup except ImportError: from distutils.core import setup try: import subprocess def convert(source, from_format, to_format): p = subprocess.Popen(['pandoc', '--from=' + from_format, '--...
mit
-6,032,588,103,053,640,000
28.222222
92
0.61271
false
OpenMined/PySyft
packages/syft/src/syft/proto/lib/tenseal/vector_pb2.py
1
4088
# -*- coding: utf-8 -*- # Generated by the protocol buffer compiler. DO NOT EDIT! # source: proto/lib/tenseal/vector.proto """Generated protocol buffer code.""" # third party from google.protobuf import descriptor as _descriptor from google.protobuf import message as _message from google.protobuf import reflection as ...
apache-2.0
4,811,195,732,778,571,000
30.446154
293
0.614237
false
h-hirokawa/swampdragon
setup.py
1
1269
import os from setuptools import setup, find_packages def read(fname): return open(os.path.join(os.path.dirname(__file__), fname)).read() setup( name="SwampDragon", version="0.3.8.2", author="Jonas Hagstedt", author_email="hagstedt@gmail.com", description=("SwampDragon is a powerful platform ...
bsd-3-clause
5,141,963,469,735,367,000
33.297297
149
0.611505
false
victorlin/ez2pay
ez2pay/models/user.py
1
6784
from __future__ import unicode_literals import os import hmac import hashlib from . import tables from .base import BaseTableModel class AuthError(RuntimeError): """Authentication error """ class BadPassword(AuthError): """Raised when user tries to authenticate with wrong password """ c...
mit
-8,212,208,020,453,777,000
29.421525
83
0.554245
false
StegSchreck/RatS
tests/unit/trakt/test_trakt_ratings_inserter.py
1
10089
import os from unittest import TestCase from unittest.mock import patch from RatS.trakt.trakt_ratings_inserter import TraktRatingsInserter TESTDATA_PATH = os.path.abspath(os.path.join(os.path.dirname(__file__), os.pardir, os.pardir, 'assets')) class TraktRatingsInserterTest(TestCase): def setUp(self): i...
agpl-3.0
6,564,852,452,856,608,000
44.242152
155
0.658242
false
quentinlautischer/291MiniProject2
lib/python3.5/site-packages/bsddb3/tests/test_replication.py
1
21526
""" Copyright (c) 2008-2015, Jesus Cea Avion <jcea@jcea.es> 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 list of...
apache-2.0
-4,026,968,948,209,069,600
37.855596
97
0.587615
false
SummerLW/Perf-Insight-Report
dashboard/dashboard/task_runner.py
1
3164
# Copyright 2015 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. """A tool to run long running tasks. This allows a task to run in Task Queue which gives about 10 minutes execution time. Usage: In https://chromeperf.app...
bsd-3-clause
4,429,745,478,858,282,000
28.849057
79
0.716814
false
DBuildService/dbs-server
dbs/task_api.py
1
4794
from threading import Thread from celery import Celery from . import tasks from .celery import app __all__ = ('TaskApi', ) def watch_task(task, callback, kwargs=None): """ watch task until it ends and then execute callback: callback(response, **kwargs) where response is a result of task :...
bsd-3-clause
-7,925,442,112,686,777,000
37.66129
110
0.601794
false
anistark/demo
drsftask/drsftask/settings.py
1
2083
""" Django settings for drsftask project. For more information on this file, see https://docs.djangoproject.com/en/1.7/topics/settings/ For the full list of settings and their values, see https://docs.djangoproject.com/en/1.7/ref/settings/ """ # Build paths inside the project like this: os.path.join(BASE_DIR, ...) i...
mit
3,673,530,302,512,262,000
23.22093
71
0.721075
false
open-dynaMIX/experms
src/experms/configfile/check_ownerandgroup.py
1
2097
# -*- coding: utf-8 -*- import sys import pwd import grp def check_ownerandgroup(parser, section, oorg, debug): if oorg == 'owner': switch = "User" else: switch = "Group" if not parser.has_option(section, oorg): if debug: print >> sys.stderr, ("[debug] '%s' in section...
gpl-3.0
8,053,156,925,567,111,000
30.772727
75
0.431092
false
foospidy/DbDat
plugins/mysql/check_privilege_super.py
1
1062
class check_privilege_super(): """ check_privilege_super: The following accounts have the SUPER privilege. Do not grant to non Admin users. """ # References: # https://benchmarks.cisecurity.org/downloads/show-single/index.cfm?file=mysql.102 TITLE = 'SUPER Privilege' CATEGORY = 'Privi...
gpl-2.0
5,287,843,354,588,340,000
28.5
86
0.532015
false
spudmind/parlparse
members/wikipedia-commons.py
1
2989
#!/usr/bin/env python # -*- coding: latin-1 -*- # $Id: bbcconv.py,v 1.4 2005/03/25 23:33:35 theyworkforyou Exp $ # Screen scrape list of links to Lords on Wikipedia, so we can link to the articles. # The Public Whip, Copyright (C) 2003 Francis Irving and Julian Todd # This is free software, and you are welcome to red...
agpl-3.0
-9,160,489,441,203,568,000
35.45122
414
0.606223
false
frankenjoe/pyabp
python/gui_init.py
1
4202
import sys import os import warnings import shutil import glob import logging from PyQt5.QtGui import (QIcon, QFont, QStandardItemModel, QPixmap) from PyQt5.QtCore import (QDate, QDateTime, QRegExp, QSortFilterProxyModel, Qt, QTime, QEvent, QSize) from PyQt5.QtWidgets import (qApp, QApplication, QCheckBox, Q...
gpl-3.0
-4,369,065,053,773,228,000
24.427673
267
0.586625
false
cackharot/fbeazt
src/test/test_order.py
1
3860
import os import unittest from random import randint from bson import json_util from bson.objectid import ObjectId from foodbeazt import fapp from foodbeazt import initdb as fdb from foodbeazt.service.ProductService import ProductService from foodbeazt.service.StoreService import StoreService class CreateOrderTestCa...
apache-2.0
3,235,969,245,412,968,000
36.475728
102
0.573575
false
antontsv/r2d2
sound_manager.py
1
2110
#!/usr/bin/env python import sys import os import time import random import alsaaudio import pyttsx from subprocess import call # # Our sound coordinator # class SoundManager (): SOUND_PLAYER = 'mpg123' SOUNDS_DIR = os.path.dirname(__file__) + '/sounds' SOUND_FILE_EXT = 'mp3' sound_list = [] ...
mit
938,506,079,003,092,900
26.763158
81
0.563981
false
manahl/PythonTrainingExercises
Beginners/strings/solution/strings.py
1
2019
"""With this string: 'monty pythons flying circus' Create a function that returns a sorted string with no duplicate characters (keep any whitespace): Example: ' cfghilmnoprstuy' Create a function that returns the words in reverse order: Example: ['circus', 'flying', 'pythons', 'monty'] Create a function that returns...
bsd-3-clause
4,677,006,892,948,547,000
27.041667
90
0.65478
false
glibin/tortik
tortik_tests/postprocessor_test.py
1
1248
# -*- coding: utf-8 -*- import tornado.web import tornado.ioloop from tornado.testing import AsyncHTTPTestCase from tortik.page import RequestHandler import tornado.curl_httpclient def first_postprocessor(handler, data, callback): callback(handler, data.replace('Hello,', 'Good')) def second_postprocessor(handle...
mit
7,669,365,222,812,050,000
23.96
68
0.64984
false
antoinearnoud/openfisca-france
openfisca_france/scripts/parameters/baremes_ipp/convert_ipp_xlsx_to_openfisca_xml.py
1
5031
#! /usr/bin/env python # -*- coding: utf-8 -*- """ Convertit les barèmes de l'IPP au format XLSX vers le format XML des paramètres d'OpenFisca. Nécessite l'installation de : - ssconvert : - Debian : `apt install gnumeric` - macOS : `brew install gnumeric` - xlrd : `pip install xlrd` """ import argparse imp...
agpl-3.0
1,522,122,010,387,711,000
41.210084
149
0.675294
false
jrgdiz/iria
main.py
1
2878
#!/usr/bin/env python3 # Based on echobot2.py import logging from telegram.ext import Updater, CommandHandler, MessageHandler, Filters from modules.gifsapm import GifsApmHandler from modules.estraviz import EstravizHandler from modules.dice import DiceHandler ######################## # LOGGING ##################...
mit
3,959,728,881,391,342,600
25.394495
82
0.633646
false
NinjaMSP/crossbar
crossbar/controller/test/test_cleanup.py
1
3048
##################################################################################### # # Copyright (c) Crossbar.io Technologies GmbH # # Unless a separate license agreement exists between you and Crossbar.io GmbH (e.g. # you have purchased a commercial license), the license terms below apply. # # Should you enter ...
agpl-3.0
543,509,467,005,742,400
39.64
85
0.677822
false
grounduphq/stexchange
stexchange/stexchange/migrations/0002_auto__add_field_member_member_number.py
1
4201
# -*- coding: utf-8 -*- import datetime from south.db import db from south.v2 import SchemaMigration from django.db import models class Migration(SchemaMigration): def forwards(self, orm): # Adding field 'Member.member_number' db.add_column(u'stexchange_member', 'member_number', ...
mit
3,260,853,255,297,198,000
60.794118
187
0.559629
false
Turupawn/website
games/tests/test_api.py
1
3519
import json from django.test import TestCase from django.urls import reverse from . import factories class TestGameApi(TestCase): def setUp(self): self.num_games = 10 self.games = [] for n in range(self.num_games): self.games.append( factories.GameFactory(name...
agpl-3.0
1,978,588,790,887,498,000
38.539326
98
0.611537
false
DemocracyClub/yournextrepresentative
ynr/apps/people/tests/test_age.py
1
1996
from datetime import date from django.test import TestCase from mock import patch from people.models import Person @patch("people.models.date") class TestAgeCalculation(TestCase): def test_age_full_obvious(self, mock_date): mock_date.today.return_value = date(1977, 9, 3) mock_date.side_effect = ...
agpl-3.0
1,142,260,606,478,011,800
43.355556
78
0.641784
false
SachaMPS/django-cms
cms/page_rendering.py
1
2562
# -*- coding: utf-8 -*- from django.conf import settings from django.core.urlresolvers import resolve, Resolver404 from django.http import Http404 from django.template import RequestContext from django.template.response import TemplateResponse from cms import __version__ from cms.cache.page import set_page_cache from ...
bsd-3-clause
3,315,822,376,916,376,000
36.676471
102
0.699063
false
rclmenezes/sqlalchemy
test/orm/test_eager_relations.py
1
109760
"""tests of joined-eager loaded attributes""" from sqlalchemy.testing import eq_, is_, is_not_ import sqlalchemy as sa from sqlalchemy import testing from sqlalchemy.orm import joinedload, deferred, undefer, \ joinedload_all, backref, eagerload, Session, immediateload from sqlalchemy import Integer, String, Date, ...
mit
6,023,035,421,063,106,000
40.170293
159
0.514404
false
LuaDist/scite
scripts/CheckMentioned.py
1
1510
#!/usr/bin/env python3 # CheckMentioned.py # Find all the symbols in scintilla/include/Scintilla.h and check if they # are mentioned in scintilla/doc/ScintillaDoc.html. import string uninteresting = { "SCINTILLA_H", "SCI_START", "SCI_LEXER_START", "SCI_OPTIONAL_START", # These archaic names are #defined to the Sci_...
isc
-3,569,984,973,400,225,300
28.607843
76
0.721192
false
shanot/imp
modules/isd/examples/ubiquitin/replica_exchange.py
2
8389
#!/usr/bin/env python from __future__ import print_function import sys import os import errno import atexit import random # Comment either this line or the following to attain different communication schemes: # to start pyro try: from IMP.isd.PyroGrid import PyroGrid as Grid # from IMP.isd.FileBasedGrid import ...
gpl-3.0
-2,362,972,254,981,309,000
31.265385
93
0.635594
false
ibm-security-intelligence/api-samples
custom_actions/04_postCustomActions.py
1
12475
#!/usr/bin/env python3 # This sample demonstrates how to use various POST /custom_actions/ endpoints # available REST API. # # WARNING: This sample makes changes to the QRadar system and it is # recommended that it is not run against a production system. # # This script can be run once as custom actions require their n...
apache-2.0
-942,447,492,446,873,600
39.241935
79
0.600561
false
trendels/rhino
rhino/util.py
1
3960
from __future__ import absolute_import import functools import inspect import sys __all__ = [ 'apply_ctx', 'sse_event', ] def _sse_encode(k, v): # splitlines() discards the last trailing newline. Append an unambiguous # newline so that the presence or absence of a trailing newline in the # input...
mit
3,162,224,340,009,377,300
34.675676
83
0.637626
false
tomriddle1234/dgsCalc
dgsCheckFileExists.py
1
2776
# encoding=utf8 #input is a csv file path, and a search target folder import fixutf8 import sys,os import logging import fnmatch import argparse import collections from dgsUtil import * parser = argparse.ArgumentParser(description='This program is to check file existence for DGS. Also generating a log file with the n...
gpl-3.0
-452,347,840,107,884,000
27.06383
167
0.690675
false
pektin/jam
compiler/llvm/builtins.py
1
7773
import logging from functools import partial from .state import State from .util import * from .. import lekvar from . import bindings as llvm def builtins(logger = logging.getLogger()): global printf printf = None string = LLVMType("String") size = LLVMType("Int64") ints = [ LLVMType("In...
mit
-2,096,387,809,883,720,700
32.943231
111
0.602856
false
RealTimeWeb/wikisite
MoinMoin/script/migration/data.py
1
2861
# -*- coding: iso-8859-1 -*- """ MoinMoin - data_dir migration main script (new style) You can use this script to migrate your wiki's data_dir to the format expected by the current MoinMoin code. It will read data/meta to determine what needs to be done and call other migration scripts as needed. ...
apache-2.0
-255,549,108,782,594,600
35.21519
100
0.590703
false
Joneyviana/todolist-django-angular
todolist/users/migrations/0002_auto_20160728_2311.py
1
1044
# -*- coding: utf-8 -*- # Generated by Django 1.9.8 on 2016-07-28 23:11 from __future__ import unicode_literals import django.contrib.auth.models import django.core.validators from django.db import migrations, models class Migration(migrations.Migration): dependencies = [ ('users', '0001_initial'), ...
mit
-3,026,043,773,982,555,600
36.285714
409
0.619732
false
davidwilson-85/easymap
scripts_snp/af-comparison.py
1
3689
import argparse parser = argparse.ArgumentParser() parser.add_argument('-f2_mut', action="store", dest = 'input_mut') parser.add_argument('-f2_wt', action="store", dest = 'input_wt') parser.add_argument('-out', action="store", dest = 'output') parser.add_argument('-f_input', action="store", dest = 'f_input') parser.ad...
gpl-3.0
-8,096,368,997,922,298,000
31.946429
241
0.562754
false
andrewsmedina/horizon
horizon/horizon/dashboards/nova/instances_and_volumes/volumes/tables.py
1
4720
# vim: tabstop=4 shiftwidth=4 softtabstop=4 # Copyright 2011 Nebula, 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 # # ...
apache-2.0
-8,238,992,324,745,336,000
31.551724
78
0.625847
false
charanpald/wallhack
wallhack/viroscopy/ContactGrowthStatistics.py
1
49412
import logging import sys import gc import numpy import os.path import matplotlib.pyplot as plt from datetime import date from sandbox.util.PathDefaults import PathDefaults from sandbox.util.DateUtils import DateUtils from sandbox.util.Latex import Latex from sandbox.util.Util import Util from apgl.graph import * fro...
gpl-3.0
-2,941,962,090,669,283,300
45.881404
327
0.688072
false
pywinauto/pywinauto
pywinauto/controls/hwndwrapper.py
1
67694
# GUI Application automation and testing library # Copyright (C) 2006-2018 Mark Mc Mahon and Contributors # https://github.com/pywinauto/pywinauto/graphs/contributors # http://pywinauto.readthedocs.io/en/latest/credits.html # All rights reserved. # # Redistribution and use in source and binary forms, with or without # ...
bsd-3-clause
4,780,143,445,851,055,000
36.712535
119
0.562354
false
OCA/stock-logistics-barcode
stock_barcodes/tests/test_stock_barcodes_picking.py
1
9539
# Copyright 2108-2019 Sergio Teruel <sergio.teruel@tecnativa.com> # License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl). from odoo.addons.stock_barcodes.tests.test_stock_barcodes import\ TestStockBarcodes class TestStockBarcodesPicking(TestStockBarcodes): def setUp(self): super().setUp() ...
agpl-3.0
5,325,856,234,509,851,000
48.170103
79
0.595974
false
musicmetric/mmpy
src/releasegroup.py
1
2354
from entity import * class Releasegroup(Entity): """ wraps the ReleaseGroup entity type as described at http://developer.musicmetric.com all timeseries are attributes of the form self.<type>_<source>, which sets a dict if there's data """ summary_attrs = ("name", "id", "description", "artist") ...
isc
946,194,491,796,269,400
38.898305
101
0.573917
false
chartjes/liesitoldmykids
defensio/__init__.py
1
4092
import sys def is_python3(): return sys.version_info[0] == 3 if is_python3(): import urllib.parse import http.client else: import urllib import httplib import simplejson as json API_VERSION = '2.0' API_HOST = 'api.defensio.com' LIB_VERSION = '0.9.1' ROOT_NODE = 'defensio-result' FORMAT = 'json' ...
mit
-1,687,678,148,140,367,400
30.476923
114
0.651026
false
ecordell/pymacaroons
tests/functional_tests/serialization_tests.py
1
4067
from nose.tools import * from pymacaroons import Macaroon, Verifier, MACAROON_V1, MACAROON_V2 from pymacaroons.serializers import JsonSerializer class TestSerializationCompatibility(object): def setup(self): pass def test_from_go_macaroon_json_v2(self): # The following macaroon have been gen...
mit
2,849,420,049,449,984,000
51.141026
80
0.621588
false
MostlyOpen/odoo_addons_jcafb
myo_address_cst/__openerp__.py
1
1808
# -*- coding: utf-8 -*- ############################################################################### # # Copyright (C) 2013-Today Carlos Eduardo Vercelino - CLVsol # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU Affero General Public License as published by #...
agpl-3.0
5,349,527,484,942,472,000
35.16
79
0.595686
false
nuobit/odoo-addons
connector_ambugest/models/res_partner/binding.py
1
1728
# Copyright NuoBiT Solutions, S.L. (<https://www.nuobit.com>) # Eric Antones <eantones@nuobit.com> # License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl) from odoo import models, fields from odoo.addons.component.core import Component from odoo.addons.queue_job.job import job class ResPartner(models.Model):...
agpl-3.0
6,374,237,774,410,147,000
32.882353
82
0.637153
false
compiteing/flask-ponypermission
venv/lib/python2.7/site-packages/pony/orm/tests/test_db_session.py
1
12359
from __future__ import absolute_import, print_function, division import unittest from datetime import date from decimal import Decimal from itertools import count from pony.orm.core import * from pony.orm.tests.testutils import * class TestDBSession(unittest.TestCase): def setUp(self): self.d...
mit
4,548,219,634,951,038,500
30.869681
130
0.539607
false
YoungKwonJo/mlxtend
tests/tests_evaluate/test_learning_curves.py
1
2212
from mlxtend.evaluate import plot_learning_curves from sklearn import datasets from sklearn.cross_validation import train_test_split from sklearn.tree import DecisionTreeClassifier import numpy as np def test_training_size(): iris = datasets.load_iris() X = iris.data y = iris.target X_train, X_test,...
bsd-3-clause
5,708,405,864,139,615,000
35.883333
156
0.674503
false
pinobatch/thwaite-nes
tools/dte.py
1
12624
#!/usr/bin/env python3 from __future__ import with_statement, division, print_function, unicode_literals from collections import defaultdict import sys, heapq dte_problem_definition = """ Byte pair encoding, dual tile encoding, or digram coding is a static dictionary compression method first disclosed to the public by...
gpl-3.0
-7,748,505,627,773,324,000
41.08
996
0.631575
false
wjt/markgown
markgown/editor.py
1
3156
#!/usr/bin/python # vim: set fileencoding=utf-8 : # # © 2012 Will Thompson <will@willthompson.co.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 y...
gpl-3.0
1,625,671,300,587,559,700
28.764151
84
0.642472
false
followcat/predator
jobs/definition/batchconvert_cloudshare_jingying.py
1
1798
import Queue import functools import utils.builtin import jobs.definition.cloudshare_jingying from jobs.definition.batchconvert import * class Batchconvert(BatchconvertCloudshare, jobs.definition.cloudshare_jingying.Jingying): CVDB_PATH = 'convert/jingying' ORIGIN_CVDB_PATH = 'output/jing...
lgpl-3.0
9,209,526,226,473,310,000
34.96
91
0.632369
false
davebshow/gremlinclient
tests/test_tornado.py
1
16608
import uuid import unittest from datetime import timedelta import tornado from tornado import gen from tornado.concurrent import Future from tornado.websocket import WebSocketClientConnection from tornado.testing import gen_test, AsyncTestCase from gremlinclient.connection import Stream from gremlinclient.tornado_cli...
mit
-4,324,939,924,405,568,000
32.149701
104
0.543774
false
idigbio-api-hackathon/idigbio-lifemapper
dataretrieval/apiquery.py
1
19565
""" @summary: Module containing functions for API Queries @status: beta @license: gpl2 @copyright: Copyright (C) 2014, University of Kansas Center for Research Lifemapper Project, lifemapper [at] ku [dot] edu, Biodiversity Institute, 1345 Jayhawk Boulevard, Lawrence, Kansas, 66045, USA ...
gpl-3.0
6,396,685,743,791,040,000
36.697495
88
0.510963
false
Macemann/Georgetown-Capstone
app/db/etl/Entities.py
1
1938
import nltk from nltk.corpus import stopwords class EntityExtractor (object): ''' Class used to extract Named Entities from a string ''' def __init__ (self, tweet): self.tweet = tweet self.text = tweet['text'] self.lang = tweet['lang'] self.bool = tweet['text'] and tweet['lang'].find('en') > -1 self.tok...
mit
6,216,132,786,677,719,000
28.363636
103
0.671827
false
NejcZupec/ggrc-core
src/ggrc_basic_permissions/roles/Creator.py
1
6820
# Copyright (C) 2016 Google Inc. # Licensed under http://www.apache.org/licenses/LICENSE-2.0 <see LICENSE file> scope = "System" description = """ This role grants a user basic object creation and editing permission. """ owner_base = [ "Categorization", "Category", "ControlCategory", "ControlAsser...
apache-2.0
-483,051,563,635,922,100
21.360656
78
0.410117
false
wilselby/diy_driverless_car_ROS
rover_cv/camera_cal/src/camera_cal/camera_cal.py
1
6503
#!/usr/bin/env python # -*- coding: utf-8 -*- #https://github.com/paramaggarwal/CarND-Advanced-Lane-Lines/blob/master/Notebook.ipynb from __future__ import print_function from __future__ import division import sys import traceback import rospy import numpy as np import cv2 import pickle import glob import time import m...
bsd-2-clause
-7,558,530,412,846,987,000
36.589595
239
0.564047
false
pekko/tg-stats
markov.py
1
1850
#!/usr/bin/env python3 # coding: utf-8 from analyze import get_msgs from collections import defaultdict import itertools import random import re class TgMarkov(object): START='\x01' STOP='\x02' def __init__(self, msgs): self.table = {} self.user_table = defaultdict(list) prev = ...
mit
9,110,910,635,710,931,000
24.708333
57
0.485946
false
nint8835/NintbotForDiscord
jigsaw_plugins/DiscordMarkov/__init__.py
1
4369
import asyncio import datetime import os import traceback import markovify from NintbotForDiscord.Enums import EventTypes from NintbotForDiscord.Events import MessageSentEvent from NintbotForDiscord.Plugin import BasePlugin class DiscordMarkov(BasePlugin): def __init__(self, manifest, bot_instance): sup...
mit
-3,715,402,684,921,183,000
36.025424
95
0.598077
false
kk7ds/luvs
unifi_ws_server.py
1
19938
import json import logging import os import ssl import time import uuid import yaml import asyncio import websockets STATE = { 'messageId': 123, } def make_message(functionName, responseExpected=False, payload=None, inResponseTo=0): messageId = STATE['messageId'] STATE['messageId'] += ...
gpl-3.0
-5,672,964,510,746,132,000
36.26729
90
0.521467
false
walchko/pyxl320
examples/complex.py
1
2543
#!/usr/bin/env python from __future__ import division, print_function from pyxl320 import ServoSerial from pyxl320 import Packet from pyxl320 import xl320 from pyxl320 import DummySerial from time import sleep # import sys """ This example rotates the servo back and forth while cycling through the different colors of...
mit
8,282,759,322,195,944,000
21.705357
81
0.659851
false
gaberger/pybvc
samples/sampleopenflow/demos/demo1.py
1
4024
#!/usr/bin/python # Copyright (c) 2015, BROCADE COMMUNICATIONS SYSTEMS, INC # All rights reserved. # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions are met: # 1. Redistributions of source code must retain the above copyright n...
bsd-3-clause
188,380,102,392,041,600
33.393162
78
0.629473
false
postmarketOS/pmbootstrap
pmb/chroot/binfmt.py
1
2312
""" Copyright 2018 Oliver Smith This file is part of pmbootstrap. pmbootstrap 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. pmbootstrap ...
gpl-3.0
5,135,424,026,554,633,000
32.028571
73
0.666522
false
shlomif/PySolFC
pysollib/ui/tktile/tkhtml.py
1
15620
#!/usr/bin/env python # -*- mode: python; coding: utf-8; -*- # --------------------------------------------------------------------------- # # Copyright (C) 1998-2003 Markus Franz Xaver Johannes Oberhumer # Copyright (C) 2003 Mt. Hood Playing Card Co. # Copyright (C) 2005-2009 Skomoroh # # This program is free software...
gpl-3.0
-6,246,036,659,752,584,000
33.254386
78
0.535019
false
gaberosser/geo-network
utils.py
1
35093
__author__ = 'gabriel' import numpy as np from data.models import CartesianSpaceTimeData, NetworkData, CartesianData import logging from streetnet import NetPoint, Edge, NetPath from collections import OrderedDict, defaultdict import operator uint_dtypes = [(t, np.iinfo(t)) for t in ( np.uint8, np.uint16, ...
mit
2,971,231,654,931,241,000
37.607261
128
0.571994
false
parhelia/AutomateStuffWithPython
Chapter 12/readCensusExcel.py
1
1340
#! /usr/bin/env python3 # readCensusExcel.py - Tabulates population and number of census tracts for # each county. import openpyxl, pprint print('Opening workbook...') wb = openpyxl.load_workbook('/Users/brisance/Downloads/automate_online-materials/censuspopdata.xlsx') sheet = wb.get_sheet_by_name('Population by Censu...
mit
-5,883,825,633,629,468,000
37.285714
101
0.698507
false
DrPandemic/aigar.io
clients/python/game/models.py
1
6257
from planar import Vec2 from typing import List class UnknownPlayerIdException(Exception): def __init__(self, player_id): super().__init__("Unknown Player ID %d" % player_id) class Game: RANKED_GAME_ID = -1 def __init__(self, id_: int, tick: int, time_left: float, player_id: int, players: List[...
mit
-4,244,628,501,824,059,400
24.962656
112
0.518939
false
ryanjoneil/docker-image-construction
dicp/solvers/network_mosek.py
1
6709
from .most_common import MostCommonHeuristic from .most_time import MostTimeHeuristic from collections import defaultdict from itertools import product from mosek.fusion import Model, Domain, Expr, ObjectiveSense, AccSolutionStatus import sys class NetworkMosek(object): '''Network binary integer program: full mode...
mit
5,227,754,005,832,978,000
38.005814
87
0.411984
false