text stringlengths 0 1.05M | meta dict |
|---|---|
AT_DEFAULT_CLASSES = ['at-status', 'tooltipped', 'tooltipped-nw']
AT_HINT_TEMPLATE = 'Last {last_nucliotides_count} bases at the 3`' \
+ 'end {dont}include {residue_length} A or T residues'
def generate_A_T_hint(checkStatus, type):
dont = '' if checkStatus else 'don`t '
last_nucliotides_count... | {
"repo_name": "ujenjt/miprimer",
"path": "view.py",
"copies": "1",
"size": "1841",
"license": "mit",
"hash": 3959264833405796400,
"line_mean": 25.6811594203,
"line_max": 93,
"alpha_frac": 0.5817490494,
"autogenerated": false,
"ratio": 3.1906412478336224,
"config_test": false,
"has_no_keywords... |
# ATDM Assignment 1
# Jens Raaby, May 2013
import sampling
def main():
bn_given = sampling.BN()
bn_given.add_node("x1",[],{(True,): 0.3})
bn_given.add_node("x2",[],{(True,): 0.2})
bn_given.add_node("x3",[],{(True,): 0.5})
bn_given.add_node("x4",["x1","x2","x3"],{(False,False,False): ... | {
"repo_name": "jensraaby/AdvancedTopicsDataModelling",
"path": "BayesianNetworks/run.py",
"copies": "1",
"size": "2131",
"license": "mit",
"hash": -1457039912658071800,
"line_mean": 35.7413793103,
"line_max": 72,
"alpha_frac": 0.3749413421,
"autogenerated": false,
"ratio": 3.7918149466192173,
"... |
# ATDM Bayesian networks
# Jens Raaby, May 2013
"""
This file contains the code for Bayesian Networks with Binary Random Variables
Ancestral sampling and markov blanket sampling are implemented
"""
# We use the built in random generator and ordered dictionary libraries
import random
from collections import OrderedDi... | {
"repo_name": "jensraaby/AdvancedTopicsDataModelling",
"path": "BayesianNetworks/sampling.py",
"copies": "1",
"size": "16214",
"license": "mit",
"hash": -8626689307434455000,
"line_mean": 32.8496868476,
"line_max": 180,
"alpha_frac": 0.5459479462,
"autogenerated": false,
"ratio": 4.34575180916644... |
# ATDM Bayesian networks
# Jens Raaby, May 2013
# This script runs some examples using the popular wet grass network
import sampling
def main():
# We create the network used in the Sampling and MCMC lecture slides
bn = sampling.BN()
bn.add_node("Cloudy",[],{(True,): 0.5})
bn.add_node("Sprinkler",["Cl... | {
"repo_name": "jensraaby/AdvancedTopicsDataModelling",
"path": "BayesianNetworks/wetgrass.py",
"copies": "1",
"size": "1721",
"license": "mit",
"hash": 8525560771570223000,
"line_mean": 34.8541666667,
"line_max": 112,
"alpha_frac": 0.553747821,
"autogenerated": false,
"ratio": 3.435129740518962,
... |
"""A Team Cowboy API client."""
import hashlib
import httplib
import json
import random
import sys
import time
import urllib
class TeamCowboyException(Exception):
"""A Team Cowboy error."""
pass
class TeamCowboy(object):
"""A Team Cowboy API client."""
def __init__(self, public_key, private_key):
"""C... | {
"repo_name": "kjiwa/sportszone-exporter",
"path": "teamcowboy.py",
"copies": "1",
"size": "5274",
"license": "mit",
"hash": 2379251952279876000,
"line_mean": 26.3264248705,
"line_max": 79,
"alpha_frac": 0.6224876754,
"autogenerated": false,
"ratio": 3.6778242677824267,
"config_test": true,
"... |
# A tee for TCP, similar to `socal -v`.
#
# | server
# client ---|
# | stdout
import socket
from select import select
import sys
import logging
import socks
class TcpTee:
def __init__(self, source_port, destination, proxy = None):
self.destination = destination
self.teesock =... | {
"repo_name": "the729/sync-over-the-wall",
"path": "tcptee_proxy.py",
"copies": "1",
"size": "2986",
"license": "mit",
"hash": -7445304767545405000,
"line_mean": 31.1182795699,
"line_max": 116,
"alpha_frac": 0.5880776959,
"autogenerated": false,
"ratio": 3.7845373891001266,
"config_test": false... |
"""A teeny Flask app to demonstrate how Grift can be used
Install requirements:
pip install -r requirements.txt
Start the server:
python app.py
Start the server in DEBUG mode:
DEBUG=1 python app.py
Once the server is running, try:
curl http://localhost:5000/varz
curl http://localhost:5000/check/grift
"""
... | {
"repo_name": "cranti/grift",
"path": "examples/flask_app/app.py",
"copies": "1",
"size": "1108",
"license": "apache-2.0",
"hash": -5103685061938468000,
"line_mean": 20.7254901961,
"line_max": 68,
"alpha_frac": 0.7003610108,
"autogenerated": false,
"ratio": 3.307462686567164,
"config_test": tru... |
""" A template Class for top-level experimental runs. """
import os
from numpy.random import RandomState
from multiprocessing import Pool
from simfMRI.io import write_hdf, get_model_names
from simfMRI.analysis.plot import hist_t
from simfMRI.mapreduce import create_chunks, reduce_chunks
from simfMRI.misc import process... | {
"repo_name": "parenthetical-e/simfMRI",
"path": "runclass.py",
"copies": "1",
"size": "3264",
"license": "bsd-2-clause",
"hash": 2605480870608707600,
"line_mean": 29.5140186916,
"line_max": 80,
"alpha_frac": 0.5367647059,
"autogenerated": false,
"ratio": 4.147395171537484,
"config_test": false... |
""" A template for creating commands.
author: Brian Schrader
since: 2016-01-13
"""
import copy, collections
from .tokens import Input, Output, FileToken, PathToken, CommentToken
from .command import Command
class Ticker(object):
def __init__(self, maxlen, value=0):
self.maxlen = maxlen
self.va... | {
"repo_name": "Sonictherocketman/metapipe",
"path": "metapipe/models/command_template.py",
"copies": "2",
"size": "4897",
"license": "mit",
"hash": -2550317245633691000,
"line_mean": 28.6787878788,
"line_max": 80,
"alpha_frac": 0.5942413723,
"autogenerated": false,
"ratio": 3.7756360832690823,
... |
""" A template that evaluates to muliple jobs and places them back on the queue.
author: Brian Schrader
since: 2016-02-19
"""
from .job import Job
class JobTemplate(Job):
def __init__(self, alias, command_template, depends_on, queue, job_class):
super(JobTemplate, self).__init__(alias, command_template,... | {
"repo_name": "TorkamaniLab/metapipe",
"path": "metapipe/models/job_template.py",
"copies": "2",
"size": "1959",
"license": "mit",
"hash": 945301795400278100,
"line_mean": 29.1384615385,
"line_max": 82,
"alpha_frac": 0.5758039816,
"autogenerated": false,
"ratio": 3.933734939759036,
"config_test... |
# A template the for the .h file
PPF_h_template = """
#ifndef {RefUpper:s}_H
#define {RefUpper:s}_H
class {Ref:s}Class : public Fluid{{
public:
{Ref:s}Class();
~{Ref:s}Class(){{}};
double psatL(double);
double psatV(double);
double rhosatL(double);
double rhosat... | {
"repo_name": "henningjp/CoolProp",
"path": "dev/pseudo-pure/templates.py",
"copies": "2",
"size": "1950",
"license": "mit",
"hash": 2423575279145354000,
"line_mean": 23.375,
"line_max": 86,
"alpha_frac": 0.6041025641,
"autogenerated": false,
"ratio": 2.5523560209424083,
"config_test": false,
... |
# A template to be stored as .ycm_extra_conf.py either in the directory containing
# the sources to be edited or in one of the parent directories of them.
import os
import ycm_core
# If there is one, use the compilation database in .compdb/compile_commands.json
# For more details: http://clang.llvm.org/docs/JSONCompil... | {
"repo_name": "MauroCalderara/LinAlg",
"path": ".ycm_extra_conf.py",
"copies": "1",
"size": "3470",
"license": "bsd-3-clause",
"hash": 8560277842327933000,
"line_mean": 28.6581196581,
"line_max": 85,
"alpha_frac": 0.6550432277,
"autogenerated": false,
"ratio": 3.7112299465240643,
"config_test":... |
"""A Temporal Linkage implementation used in a DNC.
This Temporal Linkage is implemented as defined in the DNC architecture
in DeepMind's Nature paper:
http://www.nature.com/nature/journal/vaop/ncurrent/full/nature20101.html
Author: Austin Derrow-Pinion
"""
import collections
import sonnet as snt
import tensorflow a... | {
"repo_name": "derrowap/DNC-TensorFlow",
"path": "src/dnc/temporal_linkage.py",
"copies": "1",
"size": "8980",
"license": "mit",
"hash": -4269342627658478000,
"line_mean": 47.8043478261,
"line_max": 79,
"alpha_frac": 0.588752784,
"autogenerated": false,
"ratio": 4.076259645937358,
"config_test"... |
'''A temporary module to save random Github repos to the database.'''
from wtfhack.base.models import *
import random
from github import Github
LANGUAGES = ['Android',
'PHP',
'Clojure',
'Haskell',
'Java',
'Javascript',
'Coffeescript',
... | {
"repo_name": "sloria/wtfhack",
"path": "wtfhack/base/genrepos.py",
"copies": "1",
"size": "1738",
"license": "bsd-3-clause",
"hash": -7940944990533169000,
"line_mean": 31.1851851852,
"line_max": 93,
"alpha_frac": 0.5448791715,
"autogenerated": false,
"ratio": 4.108747044917258,
"config_test": ... |
"""A temporary plugin for debugging tests
This is useful for finding tests that do not cleanup after themselves.
Usage:
- Uncomment 'corehq.tests.noseplugins.debug.DebugPlugin' in testsettings.py
- Customize DebugPlugin below to inspect state.
Tips:
- Write to `sys.__stdout__` to bypass stdout and logging collecto... | {
"repo_name": "qedsoftware/commcare-hq",
"path": "corehq/tests/noseplugins/debug.py",
"copies": "2",
"size": "1781",
"license": "bsd-3-clause",
"hash": -2115986498254101000,
"line_mean": 30.2456140351,
"line_max": 75,
"alpha_frac": 0.6103312746,
"autogenerated": false,
"ratio": 3.8971553610503284... |
""" A temporary test program
This is the details.
"""
# import collections
# import functools
# c = collections.defaultdict(str)
# c["a"] = "a"
# print(len(c))
# if c["a"] == "":
# print("OK")
# s = "\taa bb"
# if s.startswith("\t"):
# p = s.split(" ")
# print(p)
# l1 = [1, 2, 3, 1, 4, 5]
# for ... | {
"repo_name": "quchunguang/test",
"path": "testpy3/tmp.py",
"copies": "1",
"size": "1927",
"license": "mit",
"hash": -1689538153275200800,
"line_mean": 17.1226415094,
"line_max": 75,
"alpha_frac": 0.5096304008,
"autogenerated": false,
"ratio": 2.3570552147239265,
"config_test": false,
"has_no... |
# A temporary wrapper to connect to the HLC LLVM binaries.
# Currently, connect to commandline interface.
from __future__ import print_function, absolute_import
import sys
from subprocess import check_call, check_output
import subprocess
import tempfile
import os
import re
from collections import namedtuple
from numba ... | {
"repo_name": "cpcloud/numba",
"path": "numba/roc/hlc/hlc.py",
"copies": "2",
"size": "10064",
"license": "bsd-2-clause",
"hash": 2596910983498962400,
"line_mean": 31.7817589577,
"line_max": 88,
"alpha_frac": 0.5308028617,
"autogenerated": false,
"ratio": 3.8426880488736157,
"config_test": fals... |
# A temporary wrapper to connect to the HLC LLVM binaries.
# Currently, connect to commandline interface.
import sys
from subprocess import check_call, check_output
import subprocess
import tempfile
import os
import re
from collections import namedtuple
from numba.roc.hsadrv import devices
from .common import AMDGCNMod... | {
"repo_name": "sklam/numba",
"path": "numba/roc/hlc/hlc.py",
"copies": "4",
"size": "9883",
"license": "bsd-2-clause",
"hash": -1925057852013914600,
"line_mean": 31.8338870432,
"line_max": 88,
"alpha_frac": 0.5301021957,
"autogenerated": false,
"ratio": 3.8321054672353627,
"config_test": false,... |
""" A temporay library to help eRSA reporting until Nectar reporting APIs are availabe
"""
from keystoneauth1.identity import v3
from keystoneauth1 import session
from keystoneclient.v3 import client
from novaclient import client as nova_client
AUTH_URL = 'https://keystone.rc.nectar.org.au:5000/v3'
NOVA_VERSION = 2
... | {
"repo_name": "eResearchSA/reporting-unified",
"path": "nectar.py",
"copies": "1",
"size": "6817",
"license": "apache-2.0",
"hash": -6430687438402267000,
"line_mean": 35.2606382979,
"line_max": 94,
"alpha_frac": 0.6186005574,
"autogenerated": false,
"ratio": 3.7332968236582693,
"config_test": f... |
""" ATEMview Location Window """
from PyQt5 import QtCore, QtWidgets
import pyqtgraph as pg
import numpy as np
from .ATEMWidget import ATEMWidget
from .colormaps import jetCM, jetBrush
class LocWidget(ATEMWidget):
"""docstring for LocWidget"""
def __init__(self, parent):
super(LocWidget, self).__init_... | {
"repo_name": "dwfmarchant/ATEMview",
"path": "ATEMview/LocWindow.py",
"copies": "1",
"size": "10027",
"license": "mit",
"hash": 3609604442642518000,
"line_mean": 39.2690763052,
"line_max": 104,
"alpha_frac": 0.5918021342,
"autogenerated": false,
"ratio": 3.755430711610487,
"config_test": false... |
# a tentative script to upload all existing drstree "versions" into CMIP sqlite database
# each variable, mip, experiment, model, ensemble combination add a new instance in "instance"
# for each instance there should be at least one version in "version" table
# for each version add at least one file in table "files"
... | {
"repo_name": "coecms/ARCCSSive",
"path": "database_updates/upload_drstree.py",
"copies": "1",
"size": "3256",
"license": "apache-2.0",
"hash": -1362004406274418000,
"line_mean": 41.8421052632,
"line_max": 114,
"alpha_frac": 0.640970516,
"autogenerated": false,
"ratio": 3.621802002224694,
"conf... |
'''A terminal client for sillygo.
'''
from . import game
import sys
import re
import itertools as it
class Turn:
'''Base class for a player's turn, which may be
{Move, Pass, Resign}.
'''
def __init__(self, player):
self.player = player
class Move(Turn):
def __init__(self, player, positi... | {
"repo_name": "DouglasOrr/Snippets",
"path": "sillygo/sillygo/terminal.py",
"copies": "1",
"size": "3511",
"license": "mit",
"hash": -6208216835398346000,
"line_mean": 26.0076923077,
"line_max": 79,
"alpha_frac": 0.5545428653,
"autogenerated": false,
"ratio": 3.8582417582417583,
"config_test": ... |
# A test for MixerDLL
#
# By nitzel
#
# You might want to configure the dll-path in line 16
#
import mixer_dll
import TimerControl # timed callbacks
import os # OS-check
import copy
if os.name != 'nt':
print "Need to be run on windows"
exit()
mixerdll = mixer_dll.get_mixer_dll("../MixerDLL/R... | {
"repo_name": "nitzel/MixerDLL",
"path": "PythonExamples/test.py",
"copies": "1",
"size": "2763",
"license": "unlicense",
"hash": 6618153901830990000,
"line_mean": 24.8224299065,
"line_max": 238,
"alpha_frac": 0.6894679696,
"autogenerated": false,
"ratio": 2.8513931888544892,
"config_test": fal... |
# A test game
from Satay.HTTPGame.Game import Map, Item, NPC, HTTPGame as GameMode
from Satay.Base import NumeratedList, Dynamic, DialogMap, Dialog, Response, Action, Condition, Event
from HTTPCommands.basic import go
objects = {
"mPuddle":Map(
name="A Puddle",
desc="You see a nice puddle here.",
... | {
"repo_name": "Valdez42/Satay",
"path": "httpgame.py",
"copies": "1",
"size": "2076",
"license": "mit",
"hash": 3462000343207408600,
"line_mean": 19.9696969697,
"line_max": 100,
"alpha_frac": 0.5207129094,
"autogenerated": false,
"ratio": 3.2236024844720497,
"config_test": false,
"has_no_keyw... |
# A test game
from Satay.PorkStyleTextGame.Game import Map, Item, NPC, PorkStyleTextGame as GameMode
from Satay.Base import NumeratedList, Dynamic, DialogMap, Dialog, Response, Action, Condition, Event
from Commands.kill import kill, murder
from Commands.basic import look, go, get, take, drop, inventory, inv, i, save, ... | {
"repo_name": "Valdez42/Satay",
"path": "agame.py",
"copies": "1",
"size": "5394",
"license": "mit",
"hash": -5041521262312477000,
"line_mean": 26.3807106599,
"line_max": 105,
"alpha_frac": 0.4584723767,
"autogenerated": false,
"ratio": 3.756267409470752,
"config_test": false,
"has_no_keyword... |
import numpy as np
import tensorflow as tf
N_CLASSES = 9
def _conv1d(x, W, b, is_training=None, name='conv', strides=1):
''' Conv1D wrapper'''
# input tensor x: [batch, in_eight=1, in_width, in_channels]
# kernel tensor W: [filter_height=0, filter_width, in_channels, out_channels]
x = tf.nn.con... | {
"repo_name": "seg/2016-ml-contest",
"path": "itwm/ConvNet.py",
"copies": "1",
"size": "11408",
"license": "apache-2.0",
"hash": 3764891055311675400,
"line_mean": 42.5419847328,
"line_max": 125,
"alpha_frac": 0.5626753156,
"autogenerated": false,
"ratio": 3.372154892107597,
"config_test": false... |
"""A test implementation of a PEG program builder in Python.
The PEG matcher needs to be in C for speed, but the instruction stream can be
built in Python and comprezssed into a C-style structure at the last minute,
just before matching. This allows for higher-level access to the instructions,
and hence more flex... | {
"repo_name": "moreati/ppeg",
"path": "PythonImpl.py",
"copies": "1",
"size": "1677",
"license": "mit",
"hash": -7725728969135295000,
"line_mean": 26.4237288136,
"line_max": 78,
"alpha_frac": 0.6064400716,
"autogenerated": false,
"ratio": 3.3406374501992033,
"config_test": false,
"has_no_keyw... |
"""A testing suite for trie data structure."""
from trie import TrieTree
import pytest
@pytest.fixture
def empty_trie():
"""And empty TrieTree."""
return TrieTree()
@pytest.fixture
def three_word_trie_no_overlap():
"""A trie with three words that do not overlap."""
new_trie = TrieTree()
new_trie... | {
"repo_name": "CaHudson94/data-structures",
"path": "src/working/test_trie.py",
"copies": "1",
"size": "7330",
"license": "mit",
"hash": -1627935082516621600,
"line_mean": 31.7232142857,
"line_max": 79,
"alpha_frac": 0.6750341064,
"autogenerated": false,
"ratio": 3.1608451918930576,
"config_tes... |
'a test module'
__author__ = 'zhayangtao'
import sys
def test():
args = sys.argv
if len(args) == 1:
print('Hello, world!')
elif len(args) == 2:
print('Hello, $s!' % args[1])
else:
print('Too many arguments')
if __name__ == '__main__':
test()
"""
Module documentation
Word... | {
"repo_name": "zhayangtao/HelloPython",
"path": "python01/PythonModule.py",
"copies": "1",
"size": "1745",
"license": "apache-2.0",
"hash": 5411620409957738000,
"line_mean": 14.9724770642,
"line_max": 63,
"alpha_frac": 0.5336013785,
"autogenerated": false,
"ratio": 3.38715953307393,
"config_tes... |
# A Test Program for pipeTestService.py
#
# Install and start the Pipe Test service, then run this test
# either from the same machine, or from another using the "-s" param.
#
# Eg: pipeTestServiceClient.py -s server_name Hi There
# Should work.
from win32pipe import *
from win32file import *
from win32event import *
... | {
"repo_name": "windyuuy/opera",
"path": "chromium/src/third_party/python_26/Lib/site-packages/win32/Demos/service/pipeTestServiceClient.py",
"copies": "17",
"size": "4173",
"license": "bsd-3-clause",
"hash": 6698579987453669000,
"line_mean": 33.4876033058,
"line_max": 121,
"alpha_frac": 0.5823148814,... |
# A test program that generates a word document.
import sys
import os
from win32com.client import gencache
# When built with py2exe, it assumes 'Word.Application.9' is installed
# on the machine performing the build. The typelibs from the local machine
# will be used to generate makepy files, and those generat... | {
"repo_name": "pupboss/xndian",
"path": "deploy/site-packages/py2exe/samples/pywin32/com_typelib/build_gen/word/docmaker.py",
"copies": "1",
"size": "1062",
"license": "mit",
"hash": -1564788382075116800,
"line_mean": 31.1875,
"line_max": 75,
"alpha_frac": 0.7146892655,
"autogenerated": false,
"r... |
# a test scene used to help develop collision code for cocos.
# This code is so you can run the samples without installing the package
import sys
import os
sys.path.insert(0, os.path.join(os.path.dirname(__file__), '..'))
testinfo = "f 10 0.033, s, f 20 0.033, s, f 30 0.033, s, f 30 0.033, s, q"
tags = "collision"
i... | {
"repo_name": "eevee/cocos2d-mirror",
"path": "test/test_all_collisions.py",
"copies": "1",
"size": "9036",
"license": "bsd-3-clause",
"hash": -5006280332121477000,
"line_mean": 34.8571428571,
"line_max": 89,
"alpha_frac": 0.5722664896,
"autogenerated": false,
"ratio": 3.496904024767802,
"confi... |
# a test scene used to help develop collision code for cocos.
# This code is so you can run the samples without installing the package
import sys
import os
sys.path.insert(0, os.path.join(os.path.dirname(__file__), '..'))
testinfo = "f 10 0.033, s, f 20 0.033, s, f 30 0.033, s, f 30 0.033, s, q"
tags = "colli... | {
"repo_name": "shadowmint/nwidget",
"path": "lib/cocos2d-0.5.5/test/test_all_collisions.py",
"copies": "1",
"size": "9288",
"license": "apache-2.0",
"hash": -5754364714064246000,
"line_mean": 34.8571428571,
"line_max": 89,
"alpha_frac": 0.5567398794,
"autogenerated": false,
"ratio": 3.54503816793... |
# a test scene used to help develop collision code for summa.
# This code is so you can run the samples without installing the package
import sys
import os
sys.path.insert(0, os.path.join(os.path.dirname(__file__), '..'))
testinfo = "f 10 0.033, s, f 20 0.033, s, f 30 0.033, s, f 30 0.033, s, q"
tags = "collision"
i... | {
"repo_name": "shackra/thomas-aquinas",
"path": "tests/test_all_collisions.py",
"copies": "1",
"size": "9036",
"license": "bsd-3-clause",
"hash": 6257474981547206000,
"line_mean": 34.8571428571,
"line_max": 89,
"alpha_frac": 0.5722664896,
"autogenerated": false,
"ratio": 3.496904024767802,
"con... |
"""A test script that downloads blobs from a reflector server"""
import argparse
import itertools
import json
import random
import subprocess
import sys
def main():
parser = argparse.ArgumentParser()
parser.add_argument('reflector_ip')
parser.add_argument('--ssh-key')
parser.add_argument('--size', typ... | {
"repo_name": "zestyr/lbry",
"path": "scripts/download_blobs_from_reflector.py",
"copies": "1",
"size": "2458",
"license": "mit",
"hash": 178935417038363230,
"line_mean": 29.725,
"line_max": 88,
"alpha_frac": 0.6159479251,
"autogenerated": false,
"ratio": 3.7469512195121952,
"config_test": fals... |
# A test suite for pdb; at the moment, this only validates skipping of
# specified test modules (RFE #5142).
import imp
import sys
from test import test_support
# This little helper class is essential for testing pdb under doctest.
from test_doctest import _FakeInput
class PdbTestInput(object):
"""C... | {
"repo_name": "hwu25/AppPkg",
"path": "Applications/Python/Python-2.7.2/Lib/test/test_pdb.py",
"copies": "7",
"size": "8721",
"license": "bsd-2-clause",
"hash": 2975681377854749700,
"line_mean": 28.3867595819,
"line_max": 92,
"alpha_frac": 0.557160876,
"autogenerated": false,
"ratio": 3.529340348... |
# A test suite for pdb; not very comprehensive at the moment.
import doctest
import os
import pdb
import sys
import types
import unittest
import subprocess
import textwrap
from test import support
# This little helper class is essential for testing pdb under doctest.
from test.test_doctest import _FakeInput
class P... | {
"repo_name": "yotchang4s/cafebabepy",
"path": "src/main/python/test/test_pdb.py",
"copies": "2",
"size": "36525",
"license": "bsd-3-clause",
"hash": -6751383355134666000,
"line_mean": 31.3230088496,
"line_max": 98,
"alpha_frac": 0.5332511978,
"autogenerated": false,
"ratio": 3.5300086981733836,
... |
"""A test suite for solverwrappers that implement solve methods for
canonical linear constraints. Wrapppers considered include:
'cvxpy', 'qpOASES', "ecos", 'hotqpOASES', 'seidel'.
"""
import pytest
import numpy as np
import numpy.testing as npt
import toppra
import toppra.constraint as constraint
import cvxpy
from ..... | {
"repo_name": "hungpham2511/toppra",
"path": "tests/tests/solverwrapper/test_basic_can_linear.py",
"copies": "1",
"size": "8575",
"license": "mit",
"hash": -3632063118896570400,
"line_mean": 43.2010309278,
"line_max": 112,
"alpha_frac": 0.6681049563,
"autogenerated": false,
"ratio": 3.19962686567... |
"""A test suite that doesn't query the Google API.
Avoiding direct network access is benefitial in that it markedly speeds up
testing, avoids error-prone credential setup, and enables validation even if
internet access is unavailable.
"""
from datetime import datetime
import unittest
try:
import ConfigParser
excep... | {
"repo_name": "ShivaShinde/gspread",
"path": "tests/mock_tests.py",
"copies": "1",
"size": "3995",
"license": "mit",
"hash": 3669611813422431700,
"line_mean": 33.1452991453,
"line_max": 79,
"alpha_frac": 0.6515644556,
"autogenerated": false,
"ratio": 4.0030060120240485,
"config_test": true,
"... |
"""A test that all code scores above a 9.25 in pylint"""
import subprocess
import re
import os.path
SCORE_REGEXP = re.compile(
r'^Your\ code\ has\ been\ rated\ at\ (\-?[0-9\.]+)/10')
TOOLS_ROOT = os.path.dirname(os.path.dirname(__file__))
def parse_score(pylint_output):
"""Parse the score out of pylint's o... | {
"repo_name": "mmorenobarm/mbed-os",
"path": "tools/test/pylint.py",
"copies": "61",
"size": "1359",
"license": "apache-2.0",
"hash": -1846970968414263800,
"line_mean": 27.3125,
"line_max": 76,
"alpha_frac": 0.5849889625,
"autogenerated": false,
"ratio": 3.5669291338582676,
"config_test": false... |
# A test that stresses the serve handles. We spin up a backend with a bunch
# (0-2) of replicas that just forward requests to another backend.
#
# By comparing using the forward replicas with just calling the worker
# replicas, we measure the (latency) overhead in the handle. This answers
# the question: How much of a ... | {
"repo_name": "ray-project/ray",
"path": "python/ray/serve/benchmarks/handle.py",
"copies": "1",
"size": "3481",
"license": "apache-2.0",
"hash": -3951125213691100700,
"line_mean": 30.6454545455,
"line_max": 79,
"alpha_frac": 0.6575696639,
"autogenerated": false,
"ratio": 3.734978540772532,
"co... |
"""A test that subscribes to NumPy arrays.
Uses REQ/REP (on PUB/SUB socket + 1) to synchronize
"""
#-----------------------------------------------------------------------------
# Copyright (c) 2010 Brian Granger
#
# Distributed under the terms of the New BSD License. The full license is in
# the file COPYING.BSD... | {
"repo_name": "swn1/pyzmq",
"path": "examples/pubsub/subscriber.py",
"copies": "8",
"size": "1937",
"license": "bsd-3-clause",
"hash": -4551727521045227000,
"line_mean": 25.1756756757,
"line_max": 78,
"alpha_frac": 0.5322663913,
"autogenerated": false,
"ratio": 3.521818181818182,
"config_test":... |
"""A text based UI, implemented with cmd2: https://bitbucket.org/catherinedevlin/cmd2
BeamAnalyzer v0.4.0
Copyright 2014 Evan Murawski
License: MIT
"""
__author__ = 'Evan Murawski'
from backend.beam import Beam
from backend.interactions import InteractionLocationError, Interaction, Force, Moment, Dist_Force
import cm... | {
"repo_name": "EvanMurawski/BeamAnalyzer",
"path": "beamanalyzer/textinterface.py",
"copies": "1",
"size": "7669",
"license": "mit",
"hash": -5240379892001479000,
"line_mean": 30.4303278689,
"line_max": 162,
"alpha_frac": 0.5694353892,
"autogenerated": false,
"ratio": 4.109860664523044,
"config... |
""" A text editor. """
# Standard library imports.
from os.path import basename
# Enthought library imports.
from pyface.workbench.api import TraitsUIEditor
from pyface.api import FileDialog, CANCEL
from traits.api import Code, Instance
from traitsui.api import CodeEditor, Group, Item, View
from traitsui.key_binding... | {
"repo_name": "LTS5/connectomeviewer",
"path": "cviewer/plugins/text_editor/editor/text_editor.py",
"copies": "1",
"size": "6824",
"license": "bsd-3-clause",
"hash": 5050727498481671000,
"line_mean": 27.0823045267,
"line_max": 79,
"alpha_frac": 0.4457796014,
"autogenerated": false,
"ratio": 4.798... |
"""A text library.
TextLib stores a set of strings containing English text as compact binary
data. It can also generate Pico-8 Lua code capable of accessing a string given
the string's string ID (returned by the encoder method). The goal is to make it
easy to write Pico-8 games that use a large quantity of English tex... | {
"repo_name": "dansanderson/p8advent",
"path": "p8advent/textlib.py",
"copies": "1",
"size": "16277",
"license": "mit",
"hash": -7760836072420984000,
"line_mean": 36.6782407407,
"line_max": 90,
"alpha_frac": 0.604534005,
"autogenerated": false,
"ratio": 3.5773626373626373,
"config_test": false,... |
#at first I try to do it in place, but it was too hard.
# Definition for an interval.
class Interval:
def __init__(self, s=0, e=0):
self.start = s
self.end = e
class Solution:
# @param intervals, a list of Intervals
# @param newInterval, a Interval
# @return a list of Interval
def i... | {
"repo_name": "sureleo/leetcode",
"path": "archive/python/array/InsertInterval.py",
"copies": "2",
"size": "1935",
"license": "mit",
"hash": -7709369809358563000,
"line_mean": 27.0434782609,
"line_max": 62,
"alpha_frac": 0.5390180879,
"autogenerated": false,
"ratio": 3.9651639344262297,
"config... |
# A theater seating chart is implemented as a table of ticket prices, like this:
# 10 10 10 10 10 10 10 10 10 10
# 10 10 10 10 10 10 10 10 10 10
# 10 10 10 10 10 10 10 10 10 10
# 10 10 20 20 20 20 20 20 10 10
# 10 10 20 20 20 20 20 20 10 10
# 10 10 20 20 20 20 20 20 10 10
# 20 20 30 30 40 40 30 30 20 20
# 20 30 30 40 5... | {
"repo_name": "futurepr0n/Books-solutions",
"path": "Python-For-Everyone-Horstmann/Chapter6-Lists/P6.26.py",
"copies": "1",
"size": "2303",
"license": "mit",
"hash": 5629236307621983000,
"line_mean": 35,
"line_max": 101,
"alpha_frac": 0.5445071646,
"autogenerated": false,
"ratio": 2.9225888324873... |
"""Athena Query
Submits the appropriate Security Fairy
query to Athena.
"""
import re
import boto3
import logging
from datetime import datetime, timedelta
from setup_logger import create_logger
from botocore.exceptions import ProfileNotFound
logger = create_logger(name="athena_query.py", logging_level=logging.INFO)
... | {
"repo_name": "1Strategy/security-fairy",
"path": "athena_query.py",
"copies": "1",
"size": "2886",
"license": "apache-2.0",
"hash": 5804082585751560000,
"line_mean": 26.4952380952,
"line_max": 87,
"alpha_frac": 0.5914760915,
"autogenerated": false,
"ratio": 3.6764331210191084,
"config_test": f... |
"""Athena URL Configuration
The `urlpatterns` list routes URLs to views. For more information please see:
https://docs.djangoproject.com/en/1.9/topics/http/urls/
Examples:
Function views
1. Add an import: from my_app import views
2. Add a URL to urlpatterns: url(r'^$', views.home, name='home')
Class-base... | {
"repo_name": "zhengxiaowai/Athena",
"path": "Athena/urls.py",
"copies": "1",
"size": "1217",
"license": "mit",
"hash": 770156306794120300,
"line_mean": 38.2580645161,
"line_max": 81,
"alpha_frac": 0.7058340181,
"autogenerated": false,
"ratio": 3.4089635854341735,
"config_test": false,
"has_n... |
"""A thesaurus of words the player might use, so you can easily accept
synonyms of the word you want.
e.g. This will recognise take, pick, get or collect::
if do[0] in weatbag.words.take:
#...
"""
# Verbs
move = {'move', 'walk', 'go', 'travel', 'cross', 'pace', 'traverse'}
give = {'give', 'feed', 'present... | {
"repo_name": "takluyver/weatbag",
"path": "weatbag/words.py",
"copies": "1",
"size": "1158",
"license": "mit",
"hash": 3742032054259640300,
"line_mean": 33.0588235294,
"line_max": 99,
"alpha_frac": 0.5820379965,
"autogenerated": false,
"ratio": 2.776978417266187,
"config_test": false,
"has_n... |
"""A thin layer on top of the requests package that provides niceties
such as retry policy, rate limit, and more logging.
"""
__all__ = [
'HttpError',
'Client',
'ForwardingClient',
'Request',
'Response',
]
import functools
import time
import logging
import requests
import requests.cookies
try:
... | {
"repo_name": "clchiou/garage",
"path": "py/garage/garage/http/clients.py",
"copies": "1",
"size": "8037",
"license": "mit",
"hash": -3906384966088583000,
"line_mean": 27.9100719424,
"line_max": 77,
"alpha_frac": 0.5837999253,
"autogenerated": false,
"ratio": 4.117315573770492,
"config_test": f... |
"""A thin, practical wrapper around terminal coloring, styling, and
positioning"""
from contextlib import contextmanager
import curses
from curses import setupterm, tigetnum, tigetstr, tparm
from fcntl import ioctl
from six import text_type, string_types
try:
from io import UnsupportedOperation as IOUnsupportedOp... | {
"repo_name": "erikrose/blessings",
"path": "blessings/__init__.py",
"copies": "1",
"size": "22310",
"license": "mit",
"hash": 8873629933045182000,
"line_mean": 38.5567375887,
"line_max": 79,
"alpha_frac": 0.6069475571,
"autogenerated": false,
"ratio": 4.39779223339247,
"config_test": false,
... |
"""A thin, practical wrapper around terminal coloring, styling, and
positioning"""
from contextlib import contextmanager
import curses
from curses import setupterm, tigetnum, tigetstr, tparm
try:
from fcntl import ioctl
except ImportError:
from hackwindows import ioctl
try:
from io import UnsupportedOper... | {
"repo_name": "syg5201314/demoCollection",
"path": "freeline/freeline_core/terminal.py",
"copies": "12",
"size": "22168",
"license": "apache-2.0",
"hash": 7924426690968879000,
"line_mean": 38.0970017637,
"line_max": 110,
"alpha_frac": 0.610519668,
"autogenerated": false,
"ratio": 4.38970297029703... |
'''a thin shim for the parts of requests we use'''
import urllib2
class BetterHTTPErrorProcessor(urllib2.BaseHandler):
# a substitute/supplement to urllib2.HTTPErrorProcessor
# that doesn't raise exceptions on status codes 201,204,206
def http_error_201(self, request, response, code, msg, hdrs):
re... | {
"repo_name": "marianoguerra/ioriodb",
"path": "tools/oldreq.py",
"copies": "2",
"size": "2590",
"license": "mpl-2.0",
"hash": -4649068526563540000,
"line_mean": 31.7848101266,
"line_max": 65,
"alpha_frac": 0.6459459459,
"autogenerated": false,
"ratio": 3.848439821693908,
"config_test": false,
... |
"""A thin wrapper around the C extension.
In this module the term 'matrix' is abused to mean numpy array.
"""
import itertools
import numpy as np
import hmmusbuf
import hmmusnodisk
MISSING = 127
def is_stochastic_vector(v):
if len(v.shape) != 1:
return False
if any(x<0 for x in v):
return F... | {
"repo_name": "argriffing/hmmus",
"path": "hmmus/hmm.py",
"copies": "1",
"size": "8312",
"license": "mit",
"hash": 3920345940688776700,
"line_mean": 35.9422222222,
"line_max": 78,
"alpha_frac": 0.7136669875,
"autogenerated": false,
"ratio": 3.986570743405276,
"config_test": false,
"has_no_key... |
"""A thin wrapping of the VoIP.ms REST API to make it slightly less than
horrible to use.
"""
import contextlib
from collections import Mapping
import requests
from functools import partial
def validate_response(response_obj):
"""Check for HTTP failures, API failures, and return JSON."""
if response_obj.stat... | {
"repo_name": "dwf/didroute",
"path": "didroute/api.py",
"copies": "1",
"size": "3985",
"license": "mit",
"hash": -3783722952712917000,
"line_mean": 31.6639344262,
"line_max": 79,
"alpha_frac": 0.582434128,
"autogenerated": false,
"ratio": 4.120992761116856,
"config_test": false,
"has_no_keyw... |
"""A third example on how to modify the Seamless environment,
adding direct Cython support via an ipy template
The graph is then saved and re-loaded
"""
import traceback
from seamless.highlevel import Context, Cell, Transformer
ctx = Context()
env = ctx.environment
# Define a transformer in IPython format that uses... | {
"repo_name": "sjdv1982/seamless",
"path": "tests/highlevel/environment3.py",
"copies": "1",
"size": "3192",
"license": "mit",
"hash": -7037300985390984000,
"line_mean": 24.1417322835,
"line_max": 82,
"alpha_frac": 0.6948621554,
"autogenerated": false,
"ratio": 3.363540569020021,
"config_test":... |
"""A thorough test of polling PAIR sockets."""
#-----------------------------------------------------------------------------
# Copyright (c) 2010 Brian Granger
#
# Distributed under the terms of the New BSD License. The full license is in
# the file COPYING.BSD, distributed as part of this software.
#------------... | {
"repo_name": "caidongyun/pyzmq",
"path": "examples/poll/pair.py",
"copies": "10",
"size": "1400",
"license": "bsd-3-clause",
"hash": 5877415166944736000,
"line_mean": 24.0178571429,
"line_max": 78,
"alpha_frac": 0.6392857143,
"autogenerated": false,
"ratio": 2.9723991507430996,
"config_test": ... |
"""A thorough test of polling REQ/REP sockets."""
#-----------------------------------------------------------------------------
# Copyright (c) 2010 Brian Granger
#
# Distributed under the terms of the New BSD License. The full license is in
# the file COPYING.BSD, distributed as part of this software.
#---------... | {
"repo_name": "Mustard-Systems-Ltd/pyzmq",
"path": "examples/poll/reqrep.py",
"copies": "10",
"size": "1776",
"license": "bsd-3-clause",
"hash": 833007640773809900,
"line_mean": 24.014084507,
"line_max": 78,
"alpha_frac": 0.6537162162,
"autogenerated": false,
"ratio": 2.9748743718592965,
"confi... |
"""A thread-based worker pool."""
from __future__ import absolute_import, division, print_function
__metaclass__ = type
import threading
import time
import socket
from six.moves import queue
__all__ = ('WorkerThread', 'ThreadPool')
class TrueyZero:
"""Object which equals and does math like the integer 0 but... | {
"repo_name": "Southpaw-TACTIC/TACTIC",
"path": "3rd_party/python3/site-packages/cheroot/workers/threadpool.py",
"copies": "3",
"size": "9345",
"license": "epl-1.0",
"hash": -7128710743203117000,
"line_mean": 32.8586956522,
"line_max": 78,
"alpha_frac": 0.531835206,
"autogenerated": false,
"ratio... |
"""A thread-based worker pool.
.. spelling::
joinable
"""
from __future__ import absolute_import, division, print_function
__metaclass__ = type
import collections
import threading
import time
import socket
import warnings
from six.moves import queue
from jaraco.functools import pass_none
__all__ = ('WorkerT... | {
"repo_name": "cherrypy/cheroot",
"path": "cheroot/workers/threadpool.py",
"copies": "1",
"size": "10586",
"license": "bsd-3-clause",
"hash": 3695387501319372300,
"line_mean": 31.1762917933,
"line_max": 78,
"alpha_frac": 0.5483657661,
"autogenerated": false,
"ratio": 4.500850340136054,
"config_... |
"""A threading based handler.
The :class:`SequentialThreadingHandler` is intended for regular Python
environments that use threads.
.. warning::
Do not use :class:`SequentialThreadingHandler` with applications
using asynchronous event loops (like gevent). Use the
:class:`~kazoo.handlers.gevent.Sequential... | {
"repo_name": "cloudera/hue",
"path": "desktop/core/ext-py/kazoo-2.8.0/kazoo/handlers/threading.py",
"copies": "3",
"size": "9459",
"license": "apache-2.0",
"hash": 1722115173394408400,
"line_mean": 31.5051546392,
"line_max": 79,
"alpha_frac": 0.589597209,
"autogenerated": false,
"ratio": 4.40568... |
"""A thread-safe way to interrupt a Hub waiting on IO."""
import os
import errno
from greennet import get_hub
class Trigger(object):
__slots__ = ('hub', '_gun', '_trigger', '_closed')
def __init__(self, hub=None):
self.hub = get_hub() if hub is None else hub
self._gun, self._trigg... | {
"repo_name": "dhain/greennet",
"path": "greennet/trigger.py",
"copies": "1",
"size": "1319",
"license": "mit",
"hash": -4995111651672118000,
"line_mean": 24.862745098,
"line_max": 64,
"alpha_frac": 0.506444276,
"autogenerated": false,
"ratio": 3.984894259818731,
"config_test": false,
"has_no... |
# A tile
class tile():
def __init__(self):
self.x = 0
self.y = 0
self.image = None
# A level
class level():
levelSizeX = 0
levelSizeY = 0
levelTiles = []
def setLevelSize(self, x, y):
levelSizeX = x
levelSizeY = y
# Class for manipulating tiles
class levelM... | {
"repo_name": "tacocats/2DEngine",
"path": "tools/tile_editor/scene_module.py",
"copies": "1",
"size": "4107",
"license": "mit",
"hash": 6780308149456524000,
"line_mean": 39.2647058824,
"line_max": 122,
"alpha_frac": 0.6177258339,
"autogenerated": false,
"ratio": 3.5527681660899653,
"config_tes... |
# The usual caveats re microsheduler time periods applies: if you need millisecond accuracy
# (or better) use a hardware timer. Times can easily be -0 +20mS or more, depending on other threads
from usched import Sched, microsWhen, seconds, after, microsUntil, Timeout, wait
def _f(): pass
FunctionType = type(_f) # Fu... | {
"repo_name": "peterhinch/Micropython-scheduler",
"path": "delay.py",
"copies": "1",
"size": "2764",
"license": "mit",
"hash": -1824798438218552600,
"line_mean": 41.5230769231,
"line_max": 102,
"alpha_frac": 0.6512301013,
"autogenerated": false,
"ratio": 4.100890207715134,
"config_test": false,... |
"""A time estimator by running TensorFlow operators."""
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
import time
import logging
import tensorflow as tf
import numpy as np
from six.moves import range
from paleo.profilers.base import BaseProfiler, TimeMe... | {
"repo_name": "TalwalkarLab/paleo",
"path": "paleo/profilers/tensorflow_profiler.py",
"copies": "1",
"size": "13589",
"license": "apache-2.0",
"hash": 1647011751058073600,
"line_mean": 41.465625,
"line_max": 79,
"alpha_frac": 0.5143866362,
"autogenerated": false,
"ratio": 4.344309462915601,
"co... |
"""A timer for APOGEE exposures
History:
2013-08-20: EM: moved to STUI
2013-03-11: EM: changed voice to mac system Glass.wav
2013-04-20: EM: multiple refinement, added format and colors,
changed time left for None if no exposures left in sop sequence.
2013-04-22: EM:
changed colors to self.fgList=["black", "F... | {
"repo_name": "r-owen/stui",
"path": "TUI/Scripts/APOGEE/Timer.py",
"copies": "1",
"size": "4828",
"license": "bsd-3-clause",
"hash": -2246721755276038700,
"line_mean": 36.1384615385,
"line_max": 114,
"alpha_frac": 0.6371168186,
"autogenerated": false,
"ratio": 3.1148387096774193,
"config_test"... |
"""A timer for BOSS exposures
History:
2013-04-20 EM: bossTimer.py
2013-04-20 EM: added color and sound
2013-04-22 EM: added check button on/off sound, default on.
2012-04-24 EM: added ProgressBar
2012-05-17 EM: cut label text to just "bossTimer"
2013-08-20 EM: moved to STUI
2014-03-05 changed keyword name sopModel.d... | {
"repo_name": "r-owen/stui",
"path": "TUI/Scripts/BOSS/Timer.py",
"copies": "1",
"size": "5154",
"license": "bsd-3-clause",
"hash": -2323548263877116000,
"line_mean": 37.1777777778,
"line_max": 108,
"alpha_frac": 0.6076833527,
"autogenerated": false,
"ratio": 3.2152214597629443,
"config_test": ... |
"""A time zone-aware DateTime field.
When saving, naive datetime objects are assumed to belong to the local time
zone and are converted to UTC. When loading from the database the naive datetime
objects are converted to UTC.
These field types require database support. MySQL 5 will not work.
"""
from datetime import da... | {
"repo_name": "aarontropy/django-datebook",
"path": "timezones/fields.py",
"copies": "1",
"size": "1755",
"license": "bsd-3-clause",
"hash": -4751013411956499000,
"line_mean": 32.7692307692,
"line_max": 80,
"alpha_frac": 0.6866096866,
"autogenerated": false,
"ratio": 4.398496240601504,
"config_... |
"""A tiny python command line browser for sterkinekor."""
from setuptools import setup, find_packages
from codecs import open
from os import path
from sterpy import *
here = path.abspath(path.dirname(__file__))
try:
from pypandoc import convert
read_md = lambda f: convert(f, 'rst')
except ImportError:
... | {
"repo_name": "spookyUnknownUser/ster-py",
"path": "setup.py",
"copies": "1",
"size": "1299",
"license": "mit",
"hash": -2038899313034461400,
"line_mean": 29.2093023256,
"line_max": 90,
"alpha_frac": 0.6481909161,
"autogenerated": false,
"ratio": 3.700854700854701,
"config_test": false,
"has_... |
# a tiny Tkinter calculator (improved v.1.2)
# tested with Python25 vegaseat 01apr2007
"""
calculator has a layout like this ...
< display >
7 8 9 * C
4 5 6 / M->
1 2 3 - ->M
0 . = + neg
"""
import Tkinter as tk
def click(key):
global memory
if key == '=':
# avoid division b... | {
"repo_name": "sniemi/SamPy",
"path": "sandbox/src1/calc.py",
"copies": "1",
"size": "2210",
"license": "bsd-2-clause",
"hash": 6566794073251775000,
"line_mean": 25.3095238095,
"line_max": 78,
"alpha_frac": 0.4936651584,
"autogenerated": false,
"ratio": 3.1258840169731257,
"config_test": false,... |
''' A tiny web browser '''
import sys
from PyQt4 import QtGui, QtCore, QtWebKit
class TinySurfer(QtGui.QMainWindow):
''' A tiny web browser written in PyQt4 '''
def __init__(self, url):
super(TinySurfer, self).__init__()
### Window elements ###
prog_bar = QtGui.QProgressBar()
... | {
"repo_name": "LucasRMehl/TinySurfer",
"path": "TinySurfer.py",
"copies": "1",
"size": "3533",
"license": "mit",
"hash": 6478411829416603000,
"line_mean": 47.397260274,
"line_max": 135,
"alpha_frac": 0.654118313,
"autogenerated": false,
"ratio": 3.616171954964176,
"config_test": false,
"has_n... |
"""atlang: An extensible static type system inside Python."""
import ast # Python standard library's abstract syntax module
import inspect # for accessing source code for functions
import textwrap # for stripping leading spaces
import cypy # helper functions
import six # Python 2-3 compatibility, e.g. metaclasses
# TO... | {
"repo_name": "atlang/atlang",
"path": "atlang/__init__.py",
"copies": "1",
"size": "4395",
"license": "mit",
"hash": -7340469608900118000,
"line_mean": 28.3,
"line_max": 86,
"alpha_frac": 0.6919226394,
"autogenerated": false,
"ratio": 3.5047846889952154,
"config_test": false,
"has_no_keyword... |
import urllib
from types import MethodType
from atlas.error import AtlasError
from atlas.portability import urlopen, urlencode, get_content_type, load_response
from atlas.utils import *
BASE_URL = 'https://atlas.metabroadcast.com/3.0/%s.json'
class API(object):
"""Atlas API"""
def __getattribute__(self... | {
"repo_name": "micrypt/atlas-client",
"path": "atlas/api.py",
"copies": "1",
"size": "1362",
"license": "mit",
"hash": 8000419465201347000,
"line_mean": 27.9787234043,
"line_max": 94,
"alpha_frac": 0.5866372981,
"autogenerated": false,
"ratio": 3.982456140350877,
"config_test": false,
"has_no... |
import os
import click
from ..core import Core
from ..errors import AdaLinkError
from ..programmers import JLink, STLink, RasPi2
class STLink_ATSAMD21G18(STLink):
# ATSAMD21G18-specific STLink-based programmer. Required to add custom
# wipe function, and to use the load_image command for programming (the
... | {
"repo_name": "adafruit/Adafruit_Adalink",
"path": "adalink/cores/atsamd21g18.py",
"copies": "1",
"size": "6600",
"license": "mit",
"hash": 9126105905442820000,
"line_mean": 41.8571428571,
"line_max": 162,
"alpha_frac": 0.6160606061,
"autogenerated": false,
"ratio": 3.658536585365854,
"config_t... |
# Atmel Programmer Case Design (For USBAsp v2)
# Gustave Granroth 03/28/2014
# Imports
import math
import os
import subprocess
# Standard conversion factors
INtoMM = 25.4
DEGtoRAD = math.pi/180
# Command storage holders (for block-applications of geometry)
global itemCount
itemCount = 1 # The item count we are at .... | {
"repo_name": "GuMiner/Python-BRLCAD-Interface",
"path": "example-programmer.py",
"copies": "1",
"size": "7464",
"license": "mit",
"hash": 6867379496540566000,
"line_mean": 34.2122641509,
"line_max": 105,
"alpha_frac": 0.6038317256,
"autogenerated": false,
"ratio": 2.7400881057268722,
"config_t... |
""" ATM_FORUM_TC_MIB
"""
import re
import collections
from enum import Enum
from ydk.types import Empty, YList, YLeafList, DELETE, Decimal64, FixedBitsDict
from ydk.errors import YPYError, YPYModelError
class AtmservicecategoryEnum(Enum):
"""
AtmservicecategoryEnum
ATM Service Categories use thi... | {
"repo_name": "111pontes/ydk-py",
"path": "cisco-ios-xe/ydk/models/cisco_ios_xe/ATM_FORUM_TC_MIB.py",
"copies": "1",
"size": "1116",
"license": "apache-2.0",
"hash": -6826419721329018000,
"line_mean": 12.95,
"line_max": 79,
"alpha_frac": 0.5958781362,
"autogenerated": false,
"ratio": 3.3214285714... |
#AtmGrid.py
import _pickle as pickle
import re, glob, os
import numpy as np
def split_file(file_m, ametal, path):
i = 0
with open(file_m) as f:
for line in f:
line = line.strip()
m1 = re.search(r'TEFF (\d*\.) GRAVITY (\d*\.\d*) LTE.*', line)
m2 = re.search(r'EFF ... | {
"repo_name": "msotov/SPECIES",
"path": "AtmosGrid.py",
"copies": "1",
"size": "4781",
"license": "mit",
"hash": 2748870351980825600,
"line_mean": 27.9757575758,
"line_max": 87,
"alpha_frac": 0.4540891027,
"autogenerated": false,
"ratio": 2.9403444034440342,
"config_test": false,
"has_no_keyw... |
## Atmospheric Refraction Model
import numpy as np
import scipy.interpolate
import astropy.time
import astropy.coordinates
import astropy.units as u
import specsim
import tpcorr.distortion
# helper function for shifting angles to desired range
def normalize_angle(angle):
while angle <= -180:
angle += ... | {
"repo_name": "dmargala/tpcorr",
"path": "tpcorr/pointing.py",
"copies": "1",
"size": "5269",
"license": "mit",
"hash": -1439445773586322700,
"line_mean": 43.6525423729,
"line_max": 132,
"alpha_frac": 0.6314291137,
"autogenerated": false,
"ratio": 3.3818998716302953,
"config_test": false,
"ha... |
"""Atmospheric soundings.
--- NOTATION ---
The following letters will be used throughout this module.
T = number of lead times
n = number of storm objects
p = number of pressure levels, not including surface
P = number of pressure levels, including surface
F = number of sounding fields
N = number of soundings = T*n... | {
"repo_name": "thunderhoser/GewitterGefahr",
"path": "gewittergefahr/gg_utils/soundings.py",
"copies": "1",
"size": "61534",
"license": "mit",
"hash": -3512333549687126500,
"line_mean": 39.6701916722,
"line_max": 80,
"alpha_frac": 0.6597815842,
"autogenerated": false,
"ratio": 3.3568272325568707,... |
""" ATM_TC_MIB
This MIB Module provides Textual Conventions
and OBJECT\-IDENTITY Objects to be used by
ATM systems.
"""
import re
import collections
from enum import Enum
from ydk.types import Empty, YList, YLeafList, DELETE, Decimal64, FixedBitsDict
from ydk.errors import YPYError, YPYModelError
from ydk.mod... | {
"repo_name": "111pontes/ydk-py",
"path": "cisco-ios-xe/ydk/models/cisco_ios_xe/ATM_TC_MIB.py",
"copies": "1",
"size": "21903",
"license": "apache-2.0",
"hash": -6047229158690702000,
"line_mean": 22.4006410256,
"line_max": 79,
"alpha_frac": 0.6399579966,
"autogenerated": false,
"ratio": 3.6855123... |
'''ATM-> Will have to make c_graph_from_string for each statement, and
combinde it all into a single c_graph'''
from network_base import *
from network_classes import *
def clean_number(string):
tmp = list(string)
to_kill = []
allowed = ['1','2','3','4','5','6','7','8','9','0','.']
for i in xrange(0,len(tmp)... | {
"repo_name": "mrkev/Netword",
"path": "network_speak.py",
"copies": "1",
"size": "3698",
"license": "mit",
"hash": 3331139863811786000,
"line_mean": 23.8187919463,
"line_max": 88,
"alpha_frac": 0.6563007031,
"autogenerated": false,
"ratio": 2.7271386430678466,
"config_test": false,
"has_no_k... |
atom_attrs = ['name',
'atomic_num',
'bond_degree_no_Hs',
'bond_degree_with_Hs',
'total_bond_degree',
'explicit_valence',
'implicit_valence',
'total_valence',
'formal_charge',
'hybridization',
... | {
"repo_name": "salotz/mast",
"path": "tmp/atom_type_test.py",
"copies": "1",
"size": "4474",
"license": "mit",
"hash": -3091541759368563000,
"line_mean": 29.6438356164,
"line_max": 91,
"alpha_frac": 0.5746535539,
"autogenerated": false,
"ratio": 3.7221297836938434,
"config_test": false,
"has_... |
# atom class
from scipy.interpolate import interp1d
import numpy as np
import pandas as pd
import sys, os
here = os.path.dirname(os.path.abspath(__file__))
class atom:
'''
The atom class contains relevent parameters for determining the ionization
rate in a strong field. Parameters come from 'Fundamentals ... | {
"repo_name": "c-benko/HHG_phasematching_fsEC",
"path": "src/atom.py",
"copies": "1",
"size": "6243",
"license": "mit",
"hash": 1651633357280067000,
"line_mean": 41.1689189189,
"line_max": 178,
"alpha_frac": 0.5093734978,
"autogenerated": false,
"ratio": 2.6924072476272647,
"config_test": false... |
"""ATOM feed feature
Generates ATOM feed of recent items entered into the application
"""
import flask
from database_setup import Item
from flask import request
from flask import url_for
from sqlalchemy import desc
from sqlalchemy.orm import sessionmaker
from urlparse import urljoin
from werkzeug.contrib.atom impor... | {
"repo_name": "novastorm/udacity-item-catalog",
"path": "vagrant/catalog/routes/feed.py",
"copies": "1",
"size": "1204",
"license": "bsd-2-clause",
"hash": 6449308096781487000,
"line_mean": 24.6170212766,
"line_max": 79,
"alpha_frac": 0.6677740864,
"autogenerated": false,
"ratio": 3.8838709677419... |
"""ATOM Handler.
Returns CHP incident data in the ATOM format.
"""
import re
import time
import urllib
import webapp2
from xml.etree import ElementTree
from utils import incident_request
class AtomHandler(incident_request.RequestHandler):
def get(self):
self.get_incidents()
# 304 check
if self.is_not_modif... | {
"repo_name": "lectroidmarc/SacTraffic",
"path": "appengine/handlers/atom_data.py",
"copies": "1",
"size": "4408",
"license": "isc",
"hash": -9053671855219560000,
"line_mean": 33.7086614173,
"line_max": 124,
"alpha_frac": 0.6671960073,
"autogenerated": false,
"ratio": 3.048409405255878,
"config... |
'''Atomic-access classes: generic locked objects, atomic dictionaries (ducks!) and atomic lists.
'''
import threading
from collections import UserDict, UserList
class LockedObject(object):
def __init__(self):
self.object_lock = threading.RLock()
def __enter__(self):
self.object_lock.__enter_... | {
"repo_name": "SublimeHaskell/SublimeHaskell",
"path": "internals/atomics.py",
"copies": "2",
"size": "1293",
"license": "mit",
"hash": -2937804385535685000,
"line_mean": 27.1086956522,
"line_max": 113,
"alpha_frac": 0.618716164,
"autogenerated": false,
"ratio": 4.02803738317757,
"config_test":... |
# Atomic coordinate translation and rotation functions;
# Functions of calculations of distance of atom pair, angle of three atoms and torsion of four atoms were also included.
# -- by Lifeng Zhao, 02,4th,2009
import sys
from math import *
import numpy as np
from math import sqrt
from copy import deepcopy
class bc... | {
"repo_name": "sethbrin/QM",
"path": "version1/python2/lib_atomcoords.py",
"copies": "2",
"size": "9170",
"license": "mit",
"hash": 3693669950180911000,
"line_mean": 26.4550898204,
"line_max": 120,
"alpha_frac": 0.5242093784,
"autogenerated": false,
"ratio": 2.578740157480315,
"config_test": fa... |
# Copyright (c) 2012, 2015 Cisco Systems, Inc. and others. All rights reserved.
#
# This program and the accompanying materials are made available under the
# terms of the Eclipse Public License v1.0 which accompanies this distribution,
# and is available at http://www.eclipse.org/legal/epl-v10.html
import binascii
... | {
"repo_name": "bigdataops/bgpcep",
"path": "pcep/pcepy/message/data.py",
"copies": "2",
"size": "20032",
"license": "epl-1.0",
"hash": -4086094602018899500,
"line_mean": 30.2024922118,
"line_max": 113,
"alpha_frac": 0.5679412939,
"autogenerated": false,
"ratio": 4.0839959225280325,
"config_test... |
# Atomic Emission
# This is a Ruby program to determine the Atomic Emisssion details
# around Hydrogen. By exciting the electron into higher energy levels
# and measuring the Energy emitted afterwards when the electron returns
# to lower energy levels it is possible to determine whether the energy
# levels are chara... | {
"repo_name": "Jpowell10/firstrepo",
"path": "AtomicEmission.py",
"copies": "1",
"size": "3668",
"license": "cc0-1.0",
"hash": 2049667833132276700,
"line_mean": 47.9066666667,
"line_max": 121,
"alpha_frac": 0.7333696838,
"autogenerated": false,
"ratio": 3.856992639327024,
"config_test": false,
... |
# atomic model
import os
import logging
import cPickle as pickle
from collections import OrderedDict
import h5py
import numpy as np
import pandas as pd
from scipy import interpolate
from astropy import table, units, constants
from pandas import DataFrame
class AtomDataNotPreparedError(Exception):
pass
logger ... | {
"repo_name": "orbitfold/tardis",
"path": "tardis/atomic.py",
"copies": "2",
"size": "25864",
"license": "bsd-3-clause",
"hash": -1458541272111465500,
"line_mean": 37.317037037,
"line_max": 120,
"alpha_frac": 0.599713888,
"autogenerated": false,
"ratio": 3.678566349025743,
"config_test": false,... |
# atomic model
import logging
import numpy as np
import pandas as pd
from scipy import interpolate
from collections import OrderedDict
from astropy import units as u
from tardis import constants as const
from astropy.units import Quantity
from tardis.io.atom_data.util import resolve_atom_data_fname
class AtomDataN... | {
"repo_name": "tardis-sn/tardis",
"path": "tardis/io/atom_data/base.py",
"copies": "1",
"size": "20609",
"license": "bsd-3-clause",
"hash": -1922457817749226000,
"line_mean": 33.4056761269,
"line_max": 139,
"alpha_frac": 0.550390606,
"autogenerated": false,
"ratio": 4.039396315170522,
"config_t... |
# atomic model
#TODO revisit import statements and reorganize
from scipy import interpolate
import numpy as np
import logging
import os
import h5py
import cPickle as pickle
from astropy import table, units
from collections import OrderedDict
from pandas import DataFrame
import pandas as pd
logger = logging.getL... | {
"repo_name": "aoifeboyle/tardis",
"path": "tardis/atomic.py",
"copies": "1",
"size": "25229",
"license": "bsd-3-clause",
"hash": 716640913223025300,
"line_mean": 37.4588414634,
"line_max": 119,
"alpha_frac": 0.6014903484,
"autogenerated": false,
"ratio": 3.654787773431841,
"config_test": false... |
# atomic model
#TODO revisit import statements and reorganize
from scipy import interpolate
import numpy as np
import logging
import os
import h5py
from astropy import table, units
from collections import OrderedDict
from pandas import DataFrame
import pandas as pd
try:
import sqlparse
sqlparse_available... | {
"repo_name": "mklauser/tardis",
"path": "tardis/atomic.py",
"copies": "2",
"size": "24202",
"license": "bsd-3-clause",
"hash": -6643197128063644000,
"line_mean": 37.661341853,
"line_max": 120,
"alpha_frac": 0.6006528386,
"autogenerated": false,
"ratio": 3.651478575739288,
"config_test": false,... |
"""AtomNumber module.
An ndarray to store atom densities with string, integer, or slice indexing.
"""
from collections import OrderedDict
import numpy as np
class AtomNumber:
"""Stores local material compositions (atoms of each nuclide).
Parameters
----------
local_mats : list of str
Materi... | {
"repo_name": "shikhar413/openmc",
"path": "openmc/deplete/atom_number.py",
"copies": "8",
"size": "5881",
"license": "mit",
"hash": 8249292659338720000,
"line_mean": 26.4813084112,
"line_max": 82,
"alpha_frac": 0.5584084339,
"autogenerated": false,
"ratio": 4.115465360391882,
"config_test": fa... |
"""AtomNumber module.
An ndarray to store atom densities with string, integer, or slice indexing.
"""
from collections import OrderedDict
import numpy as np
class AtomNumber(object):
"""Stores local material compositions (atoms of each nuclide).
Parameters
----------
local_mats : list of str
... | {
"repo_name": "johnnyliu27/openmc",
"path": "openmc/deplete/atom_number.py",
"copies": "3",
"size": "5889",
"license": "mit",
"hash": 5851957125132762000,
"line_mean": 26.5186915888,
"line_max": 82,
"alpha_frac": 0.5586687044,
"autogenerated": false,
"ratio": 4.115303983228512,
"config_test": f... |
# atom.py
from tmps.fio import IO
from tmps.units import h, muB, Li7_props
import numpy as np
from scipy.interpolate import interp1d
from numpy.linalg import eigvals
from sympy.physics.wigner import clebsch_gordan
import matplotlib.pyplot as plt
class Atom(IO):
def __init__(
self,
props=Li7_prop... | {
"repo_name": "lhillber/tmps",
"path": "tmps/atom.py",
"copies": "1",
"size": "5570",
"license": "mit",
"hash": -3093035417001571300,
"line_mean": 31.9585798817,
"line_max": 86,
"alpha_frac": 0.4393177738,
"autogenerated": false,
"ratio": 2.907098121085595,
"config_test": false,
"has_no_keywo... |
"""atom.py: ...
"""
import numpy as np
from numpy import nan
import scipy.linalg as spl
import sympy.physics.units as u
import piratechem as pc
class Atom(pc.atom.Atom):
"""Allow each atom to contain more specific quantum chemical
properties than piratechem can currently handle.
"""
def __init__(se... | {
"repo_name": "berquist/orcaparse",
"path": "orcaparse/atom.py",
"copies": "1",
"size": "7226",
"license": "mpl-2.0",
"hash": 1116140616378187600,
"line_mean": 29.4894514768,
"line_max": 77,
"alpha_frac": 0.488928868,
"autogenerated": false,
"ratio": 3.4117091595845137,
"config_test": false,
... |
# Copyright (C) 1999 CAMP and Jakob Schiotz <schiotz@fysik.dtu.dk>
"""Implements a list of atoms where the data is stored in multiarrays.
Two versions are implemented, one where all information is stored in
cartesian coordinates, and one where they are stored in scaled space.
In both versions most access is done th... | {
"repo_name": "auag92/n2dm",
"path": "Asap-3.8.4/Python/asap3/Internal/AtomsInArrays.py",
"copies": "1",
"size": "9614",
"license": "mit",
"hash": 5146565814414365000,
"line_mean": 34.0875912409,
"line_max": 79,
"alpha_frac": 0.6177449553,
"autogenerated": false,
"ratio": 3.903369874137231,
"co... |
# a toolbox for music songs similarity weighting, song clustering, and so on
import csv
import logging
import os
import shutil
import numpy as np
import scipy
from matplotlib.pyplot import specgram
from scipy.io import wavfile
from sklearn.cluster import KMeans
SONGS_DIR = '/home/lucasx/Documents/Dataset/CloudMusic/1... | {
"repo_name": "EclipseXuLu/DataHouse",
"path": "DataHouse/music/music_util.py",
"copies": "1",
"size": "2961",
"license": "mit",
"hash": 2072908451617201200,
"line_mean": 30.5,
"line_max": 84,
"alpha_frac": 0.608578183,
"autogenerated": false,
"ratio": 3.15,
"config_test": false,
"has_no_keyw... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.