text stringlengths 0 1.05M | meta dict |
|---|---|
#/bin/env python3
import nla3d as nla
import sys
def readDispData(filename):
disps = []
with open(filename, 'r') as fin:
fin.readline()
for line in fin:
v = nla.Vec3()
v[0], v[1], v[2] = list(map(float, line.strip().split()))[1:]
disps.append(v)
return disps
def readStressData(filen... | {
"repo_name": "dmitryikh/nla3d",
"path": "test/TETRA0_test.py",
"copies": "2",
"size": "2799",
"license": "mit",
"hash": 6347088908630415000,
"line_mean": 26.4411764706,
"line_max": 103,
"alpha_frac": 0.6352268667,
"autogenerated": false,
"ratio": 2.75492125984252,
"config_test": false,
"has_... |
#/bin/env python3
import nla3d as nla
import sys
def readTempData(filename):
temps = []
with open(filename, 'r') as fin:
fin.readline()
for line in fin:
temps.append(float(line.strip().split()[1]))
return temps
def check(v1, v2, eps=1.0e-7):
assert(abs(v1 - v2) < eps)
def main():
cdb_file... | {
"repo_name": "SchetininVitaliy/nla3d",
"path": "test/QUADTH_test.py",
"copies": "2",
"size": "2135",
"license": "mit",
"hash": -7028802084284083000,
"line_mean": 24.7228915663,
"line_max": 78,
"alpha_frac": 0.6552693208,
"autogenerated": false,
"ratio": 2.824074074074074,
"config_test": false,... |
#/bin/env python3
import nla3d as nla
nodeTable = [ [0.0, 0.0, 0.0]
, [16.0, 0.0, 0.0]
, [16.0, 12.0, 0.0]
, [32.0, 0.0, 0.0]
, [32.0, 12.0, 0.0]
]
nnodes = len(nodeTable)
elementTable = [ [1, 3]
, [1, 2]
, [2, 3]
... | {
"repo_name": "SchetininVitaliy/nla3d",
"path": "test/truss.py",
"copies": "2",
"size": "1822",
"license": "mit",
"hash": -3420863131441637400,
"line_mean": 23.9589041096,
"line_max": 73,
"alpha_frac": 0.579582876,
"autogenerated": false,
"ratio": 2.3063291139240505,
"config_test": false,
"ha... |
#!/bin/env python3
import nltk
import lpd
from utils.word_tokenize import word_tokenize
def tag_ps(tagged_tokens):
tagged_pss = []
for word, wc in tagged_tokens:
try:
d = lpd.find(word)
except KeyError:
try:
d = lpd.find(word.lower())
exce... | {
"repo_name": "meng89/nce",
"path": "utils/ps_tt.py",
"copies": "1",
"size": "3255",
"license": "mit",
"hash": 8756620904439258000,
"line_mean": 21.7622377622,
"line_max": 92,
"alpha_frac": 0.5182795699,
"autogenerated": false,
"ratio": 3.297872340425532,
"config_test": false,
"has_no_keyword... |
#!/bin/env python3
import numpy as np
import cv2
from skimage.measure import block_reduce
from pprint import PrettyPrinter
try:
from comparator.common import *
except:
from common import *
def resize(img, size=(64,64)):
X = img.shape[0]
dx = size[0] - (X % size[0]) if (X % size[0]) != 0 else 0
Y = img.shape[1... | {
"repo_name": "HKervadec/cmp_imgs",
"path": "comparator/comparator.py",
"copies": "1",
"size": "1273",
"license": "mit",
"hash": 9050803637620330000,
"line_mean": 19.5483870968,
"line_max": 58,
"alpha_frac": 0.6582875098,
"autogenerated": false,
"ratio": 2.72008547008547,
"config_test": false,
... |
#!/bin/env python3
import os
import argparse
import functools
import datetime
def coroutine(f):
@functools.wraps(f)
def wrapper(*args, **kwargs):
generator = f(*args, **kwargs)
next(generator)
return generator
return wrapper
@coroutine
def reporter(args, _pipeline):
M = 1024 ... | {
"repo_name": "GwenIves/Exercises",
"path": "pip3/chapter_8/find.py",
"copies": "1",
"size": "3907",
"license": "mit",
"hash": -8199227336841539000,
"line_mean": 22.6787878788,
"line_max": 82,
"alpha_frac": 0.5305861275,
"autogenerated": false,
"ratio": 3.864490603363007,
"config_test": false,
... |
#!/bin/env python3
import os
import json
def json_to_txt(lesson):
try:
title = lesson['title']
except KeyError:
title = ''
s = str(lesson['number']) + ' ' + title + '\n\n\n'
if 'text1' in lesson.keys():
for paragraph in lesson['text1']:
for line in paragraph:
... | {
"repo_name": "meng89/nce",
"path": "utils/json_to_txt.py",
"copies": "1",
"size": "2112",
"license": "mit",
"hash": -546847718672886800,
"line_mean": 29.6470588235,
"line_max": 87,
"alpha_frac": 0.472168906,
"autogenerated": false,
"ratio": 3.52027027027027,
"config_test": false,
"has_no_key... |
import os
import re
import jinja2
__author__ = 'Miles Lacey'
# -----------------------------------------------------------------------------
def expand_abspath(path):
return os.path.abspath(os.path.expanduser(path))
# -----------------------------------------------------------------------------
class GLHeade... | {
"repo_name": "hamsham/LightSky-GL-Loader",
"path": "lsgl/glloader.py",
"copies": "1",
"size": "14049",
"license": "mit",
"hash": -6202242872977781000,
"line_mean": 33.2658536585,
"line_max": 80,
"alpha_frac": 0.5463022279,
"autogenerated": false,
"ratio": 4.038229376257545,
"config_test": fals... |
#!/bin/env python3
import os
import re
import sys
if len(sys.argv) < 2: # or sys.argv[1] == "--help":
print("rename_code.py <source_code_directory>")
print("Update python code to new style.")
sys.exit(0)
old_names = set()
class_names = set()
for (dir, dirs, files) in os.walk(sys.argv[1]):
if dir == ... | {
"repo_name": "google/ci_edit",
"path": "tools/rename_code.py",
"copies": "1",
"size": "1982",
"license": "apache-2.0",
"hash": 5755355520524304000,
"line_mean": 30.9677419355,
"line_max": 77,
"alpha_frac": 0.484863774,
"autogenerated": false,
"ratio": 3.2706270627062706,
"config_test": false,
... |
#!/bin/env python3
import os
import struct
import tempfile
class BinaryRecordFile(object):
def __init__(self, filename, record_size):
self.__record_size = record_size
if os.path.exists(filename):
self.__fh = open(filename, "r+b")
self.__size = self.__get_size()
els... | {
"repo_name": "GwenIves/Exercises",
"path": "pip3/7_1_bike_stock.py",
"copies": "1",
"size": "6757",
"license": "mit",
"hash": 3140169067445549600,
"line_mean": 24.9884615385,
"line_max": 96,
"alpha_frac": 0.5696314933,
"autogenerated": false,
"ratio": 3.6603466955579633,
"config_test": true,
... |
#!/bin/env python3
import os
import sys
from subprocess import call
from os import remove, close
from tempfile import mkstemp
from tempfile import NamedTemporaryFile
from shutil import move
def deriveAppBitsFiles(allBitsFiles):
import re
print("======>>"+"find APP bits files")
new_file = open("AppBitsFi... | {
"repo_name": "shennjia/home",
"path": ".script/cbits.py",
"copies": "1",
"size": "9821",
"license": "unlicense",
"hash": 2203062589571664600,
"line_mean": 31.4125412541,
"line_max": 129,
"alpha_frac": 0.5809998982,
"autogenerated": false,
"ratio": 3.7570772762050497,
"config_test": false,
"h... |
#!/bin/env python3
import os
import sys
if os.path.exists(os.path.expanduser('~/plutokore')):
sys.path.append(os.path.expanduser('~/plutokore'))
else:
sys.path.append(os.path.expanduser('~/uni/plutokore'))
import plutokore as pk
import matplotlib as mpl
mpl.use('PS')
import matplotlib.pyplot as plot
import num... | {
"repo_name": "opcon/plutokore",
"path": "scripts/calculate-luminosity.py",
"copies": "2",
"size": "1986",
"license": "mit",
"hash": -6029596789685566000,
"line_mean": 29.0909090909,
"line_max": 86,
"alpha_frac": 0.6852970796,
"autogenerated": false,
"ratio": 3.3490725126475547,
"config_test": ... |
#!/bin/env python3
import os
import sys
import argparse
import subprocess
def main():
prefix, extension = os.path.splitext(__file__)
child = prefix + "_child" + extension
args = parse_options()
files = get_files(args)
do_grep(files, args, child)
def do_grep(files, args, child):
count = len(... | {
"repo_name": "GwenIves/Exercises",
"path": "pip3/10_1_grep_p.py",
"copies": "1",
"size": "2565",
"license": "mit",
"hash": -5501571933568051000,
"line_mean": 22.9719626168,
"line_max": 98,
"alpha_frac": 0.5695906433,
"autogenerated": false,
"ratio": 3.8746223564954683,
"config_test": false,
... |
#!/bin/env python3
import os
import sys
import curses
HELP = "Press [ARROW KEY] to move the tile, [s] to save current state, and [q] to quit"
def main(stdscr):
screen_height, screen_width = stdscr.getmaxyx();
if len(sys.argv) == 1:
width = height = 4
elif len(sys.argv) == 2:
width = heigh... | {
"repo_name": "zhou13/uastar",
"path": "utils/slider.py",
"copies": "1",
"size": "2503",
"license": "bsd-3-clause",
"hash": -3830803994124272600,
"line_mean": 25.9139784946,
"line_max": 87,
"alpha_frac": 0.4290850979,
"autogenerated": false,
"ratio": 3.5253521126760563,
"config_test": false,
... |
#!/bin/env python3
import os
import tempfile
import pickle
class ImageError(Exception): pass
class CoordinateError(ImageError): pass
class LoadError(ImageError): pass
class SaveError(ImageError): pass
class ExportError(ImageError): pass
XPM_RANGE_START = 32
XPM_RANGE_STOP = 127
XPM_RANGE_LEN = XPM_RANGE_STOP - XPM_R... | {
"repo_name": "GwenIves/Exercises",
"path": "pip3/6_2_image.py",
"copies": "1",
"size": "6206",
"license": "mit",
"hash": -57461097464951240,
"line_mean": 28.4123222749,
"line_max": 93,
"alpha_frac": 0.5299709958,
"autogenerated": false,
"ratio": 3.8285009253547195,
"config_test": false,
"has... |
#!/bin/env python3
import os
def main():
lists = get_lists()
print_list(lists, "Listkeeper")
f = get_int("Choose filename [0 for a new file]: ", 0, len(lists))
if f == 0:
filename = get_new_file(".lst")
else:
filename = lists[f - 1]
process_file(filename)
def get_new_file(e... | {
"repo_name": "GwenIves/Exercises",
"path": "pip3/4_1_listkeeper.py",
"copies": "1",
"size": "3879",
"license": "mit",
"hash": 3419832231668916,
"line_mean": 21.1657142857,
"line_max": 78,
"alpha_frac": 0.5119876257,
"autogenerated": false,
"ratio": 3.8828828828828827,
"config_test": false,
"... |
#!/bin/env python3
import paramiko
from sys import argv
import os
from distutils.version import LooseVersion, StrictVersion
ssh_key = str(argv[1])
remotes = str(argv[2])
if os.path.isfile(remotes):
with open(remotes) as file:
remote_list = file.read()
remotes = remote_list.split()
ssh = paramiko.SS... | {
"repo_name": "Gluzzer/CVE-2016-0728-Check",
"path": "CVE-2016-0728-Check.py",
"copies": "1",
"size": "1100",
"license": "mit",
"hash": 6329067936241616000,
"line_mean": 26.5,
"line_max": 64,
"alpha_frac": 0.6290909091,
"autogenerated": false,
"ratio": 3.6303630363036303,
"config_test": false,
... |
#!/bin/env python3
import ../parse_msg
import sys
import os
from pprint import pprint
if len(sys.argv) > 1:
EML_DIR = sys.argv[1]
eml_res = {}
exp_res = {}
if not os.path.exists(EML_DIR):
print(EML_DIR, ' a ulasilamadi!')
sys.exit(1)
# toplam dosyalar:
cnt = 0
fp = open('farklar', 'w')
for dirpath, dirna... | {
"repo_name": "kyilmaz80/emailrelay-dlp",
"path": "tests/test_parse.py",
"copies": "1",
"size": "1545",
"license": "mit",
"hash": 7328055341160546000,
"line_mean": 29.84,
"line_max": 79,
"alpha_frac": 0.5460440986,
"autogenerated": false,
"ratio": 2.954022988505747,
"config_test": false,
"has... |
#!/bin/env python3
import pickle
import os
class Transaction(object):
def __init__(self, amount, date, ccy="USD", usd_conv_rate=1.0, desc=None):
self.__amount = amount
self.__date = date
self.__ccy = ccy
self.__usd_conv_rate = usd_conv_rate
self.__desc = desc
@property... | {
"repo_name": "GwenIves/Exercises",
"path": "pip3/6_3_trans.py",
"copies": "1",
"size": "3430",
"license": "mit",
"hash": -3202295326097478000,
"line_mean": 24.9848484848,
"line_max": 97,
"alpha_frac": 0.5705539359,
"autogenerated": false,
"ratio": 3.6723768736616704,
"config_test": false,
"h... |
#!/bin/env python3
import random
def rand_list(low, high, length):
return [round(random.uniform(low, high), 2)
for x in range(0, length)]
def rand_queen_list(low, high):
queen_list = [[], []]
rows = [x for x in range(low, high + 1)]
columns = [y for y in range(low, high + 1)]
length ... | {
"repo_name": "VictorRodriguez/personal",
"path": "ec-ea/assigments/assigmt1/assigmt1.py",
"copies": "1",
"size": "2922",
"license": "apache-2.0",
"hash": -8499332325194349000,
"line_mean": 27.6470588235,
"line_max": 79,
"alpha_frac": 0.5619438741,
"autogenerated": false,
"ratio": 3.4215456674473... |
#!/bin/env python3
import re
import pprint
class ContentTypeError(Exception):
pass
def make_cant_break_groups(tagged_pss):
"""这个函数的意义是把标点符号与前面的单词连在一起"""
groups = []
group = []
for one in tagged_pss:
if one[0].isspace():
if group:
groups.append(group)
... | {
"repo_name": "meng89/nce",
"path": "load_txt.py",
"copies": "1",
"size": "5589",
"license": "mit",
"hash": -2013924371966637000,
"line_mean": 22.688034188,
"line_max": 103,
"alpha_frac": 0.5374346022,
"autogenerated": false,
"ratio": 3.804392587508579,
"config_test": false,
"has_no_keywords"... |
import re
from ply import lex, yacc
text = """
@Book{blanchette+summerfield,
author = "Jasmin Blanchette and Mark Summerfield",
title = "C++ GUI Programming with Qt 4,
Second Edition",
publisher = "Prentice Hall",
year = 2008,
address = "New York"
}
@Book{abramowitz+ste... | {
"repo_name": "GwenIves/Exercises",
"path": "pip3/14_bibtex.py",
"copies": "1",
"size": "2743",
"license": "mit",
"hash": 6484439063384672000,
"line_mean": 18.4539007092,
"line_max": 74,
"alpha_frac": 0.4484141451,
"autogenerated": false,
"ratio": 3.1528735632183906,
"config_test": false,
"ha... |
#!/bin/env python3
import re
patchs_ps = {
'appealing/ly': 'əˈpiːlɪŋ/li',
'vast|ness/es': 'nəs/ɪz',
'revil|er/s': 'ə/z',
'connected|ly': 'kəˈnektɪd|li',
'psychological|ly': 'i',
'Papagen|o': 'ʊ',
'sopran|i': 'iː',
'periodont|ic': 'ɪk',
'samurai': 'ˈsæmuraɪ',
'Andreas': 'ˈænd... | {
"repo_name": "meng89/nce",
"path": "utils/lpd_old.py",
"copies": "1",
"size": "6699",
"license": "mit",
"hash": -165474475130863520,
"line_mean": 27.1709401709,
"line_max": 106,
"alpha_frac": 0.4280946602,
"autogenerated": false,
"ratio": 3.0476190476190474,
"config_test": false,
"has_no_key... |
#!/bin/env/python3
import serial
import sys
import glob
def getActivePorts():
""" Find the open serial ports and return as a list.
Main part of the code from:
http://stackoverflow.com/questions/12090503/listing-available-com-ports-with-python
Returns
-------
(list) a list of strings denoting names of o... | {
"repo_name": "UnnamedMoose/serialMonitor",
"path": "SerialMonitor/commsInterface.py",
"copies": "1",
"size": "7470",
"license": "mit",
"hash": -1214105575877059300,
"line_mean": 36.9187817259,
"line_max": 90,
"alpha_frac": 0.7018741633,
"autogenerated": false,
"ratio": 3.6510263929618767,
"con... |
#!/bin/env python3
# Imports
from datetime import datetime, timedelta
from html import parser
from re import compile, I, match, search, sub
from sys import argv, exc_info, stderr
from urllib import error, parse, request
# Project info
__author__ = "Ian Brunelli"
__email__ = "ian@brunelli.me"
__ver... | {
"repo_name": "camporez/tpb2rss",
"path": "tpb2rss.py",
"copies": "1",
"size": "9559",
"license": "apache-2.0",
"hash": -7757838297846836000,
"line_mean": 38.9958158996,
"line_max": 186,
"alpha_frac": 0.5712940684,
"autogenerated": false,
"ratio": 2.606052344601963,
"config_test": false,
"has... |
#!/bin/env python3
########## imports ##########
import sys
import pathlib
# enable modules from the .build folder to be imported
directory = pathlib.Path()
sys.path.append ( str(directory) + "/.build" )
from base_classes import *
from config import *
########## classes ##########
def get_dependencies (component_... | {
"repo_name": "shak-mar/cpp-games",
"path": "build.py",
"copies": "1",
"size": "7957",
"license": "mit",
"hash": 8604055978196324000,
"line_mean": 33.7467248908,
"line_max": 127,
"alpha_frac": 0.6208369989,
"autogenerated": false,
"ratio": 3.9785,
"config_test": false,
"has_no_keywords": fals... |
#!/bin/env python3
import sqlite3
from time import time
import logging
# from .chat_server import random_str
from .crypto import hash
import random, string
import json
def random_str(n):
return ''.join(random.SystemRandom().choice(string.ascii_uppercase + string.digits) for _ in range(n))
class ChatDb:
def _... | {
"repo_name": "Zaeb0s/websocket-chat-server",
"path": "websocketchat/database.py",
"copies": "1",
"size": "10649",
"license": "mit",
"hash": -7962854087273072000,
"line_mean": 34.3787375415,
"line_max": 113,
"alpha_frac": 0.4932857545,
"autogenerated": false,
"ratio": 4.6059688581314875,
"confi... |
#!/bin/env python3
import sys
import logger
try:
import pyaudio
except ImportError:
print('You have to do "workon morse" first.')
sys.exit(10)
import time
import struct
import math
import numpy as np
import json
# path to file holding morse recognition parameters
PARAMS_FILE = 'morse_params.json'
CHUNK ... | {
"repo_name": "rzzzwilson/morse",
"path": "morse/test4.py",
"copies": "1",
"size": "7767",
"license": "mit",
"hash": -8499255709323370000,
"line_mean": 25.7827586207,
"line_max": 128,
"alpha_frac": 0.4476631904,
"autogenerated": false,
"ratio": 3.6688710439300896,
"config_test": false,
"has_n... |
#!/bin/env python3
import sys
import os
import argparse
import numpy
import math
# Parse arguments
parser = argparse.ArgumentParser(description='Visualise a grid')
parser.add_argument('input', type=str, help='input file')
parser.add_argument('--ref', type=str, help='reference file')
parser.add_argument('--dtype', d... | {
"repo_name": "SKA-ScienceDataProcessor/crocodile",
"path": "scripts/show_image.py",
"copies": "1",
"size": "2839",
"license": "apache-2.0",
"hash": 4846938978439784000,
"line_mean": 40.1449275362,
"line_max": 109,
"alpha_frac": 0.6639661853,
"autogenerated": false,
"ratio": 3.580075662042875,
... |
#!/bin/env python3
import sys
import os
import glob
import numpy as np
import pandas as pd
from collections import OrderedDict
RUNSET = sys.argv[1].rstrip('/')
BASEDIR = './'
OUTDIR = 'out'
INTERPOLATION_METHOD = 'nearest'
STEP_FILENAME_GLOB = 'step_*'
MEDFOESP_DETAIL_FILE_GLOB = 'MED-FOESp_*_detail.txt'
DATA_O... | {
"repo_name": "travc/paper-Predicted-MF-Quarantine-Length-Data-and-Code",
"path": "data/MedFoes/collate_longrun_output.py",
"copies": "1",
"size": "3371",
"license": "mit",
"hash": -4124580559732428000,
"line_mean": 34.1145833333,
"line_max": 128,
"alpha_frac": 0.6647878968,
"autogenerated": false,... |
#!/bin/env python3
import sys
import os
import mimetypes
from email import encoders
from email.mime.audio import MIMEAudio
from email.mime.base import MIMEBase
from email.mime.image import MIMEImage
from email.mime.multipart import MIMEMultipart
from email.mime.text import MIMEText
"""
Creates email eml messages from... | {
"repo_name": "kyilmaz80/emailrelay-dlp",
"path": "tests/create_eml_files.py",
"copies": "1",
"size": "2993",
"license": "mit",
"hash": 3140742412084316700,
"line_mean": 34.619047619,
"line_max": 78,
"alpha_frac": 0.555815508,
"autogenerated": false,
"ratio": 3.648780487804878,
"config_test": f... |
#!/bin/env python3
import sys
import os
import subprocess
import random
# Redhawk has only 4 cores per node on compute nodes; 2 GPUs per node; one PCI bus
execfile = 'shockbubble'
if sys.argv.__len__() == 1:
print("Usage : ")
print(" run_radial.py <nodes> <ntasks-per-node> <gpus-per-node> <nout>")
pr... | {
"repo_name": "ForestClaw/forestclaw",
"path": "applications/clawpack/euler/2d/shockbubble_cuda/run_sb.py",
"copies": "1",
"size": "1442",
"license": "bsd-2-clause",
"hash": -4157444301668525600,
"line_mean": 29.6808510638,
"line_max": 92,
"alpha_frac": 0.5783633842,
"autogenerated": false,
"rati... |
#!/bin/env python3
import sys
import os
project_root = os.path.dirname(os.path.dirname(os.path.abspath(__file__)))
sys.path.append(project_root)
import argparse
import astropy
import astropy.units as units
from astropy.coordinates import SkyCoord
import numpy
import numpy.linalg
import h5py
from arl.test_support imp... | {
"repo_name": "SKA-ScienceDataProcessor/crocodile",
"path": "scripts/coalesce_dataset_hdf5.py",
"copies": "1",
"size": "7520",
"license": "apache-2.0",
"hash": -6947783553269534000,
"line_mean": 39.6486486486,
"line_max": 118,
"alpha_frac": 0.628856383,
"autogenerated": false,
"ratio": 3.11903774... |
#!/bin/env python3
import sys
import os
project_root = os.path.dirname(os.path.dirname(os.path.abspath(__file__)))
sys.path.append(project_root)
import argparse
import h5py
import itertools
import numpy
import pylru
from multiprocessing import Process, Array, Queue
import ctypes
import arl.test_support
from crocodil... | {
"repo_name": "SKA-ScienceDataProcessor/crocodile",
"path": "scripts/image_dataset.py",
"copies": "1",
"size": "9132",
"license": "apache-2.0",
"hash": 3867977193446818000,
"line_mean": 37.3697478992,
"line_max": 103,
"alpha_frac": 0.6001971091,
"autogenerated": false,
"ratio": 3.207586933614331,... |
#!/bin/env python3
import sys
import os
project_root = os.path.dirname(os.path.dirname(os.path.abspath(__file__)))
sys.path.append(project_root)
import argparse
import h5py
import numpy
import scipy.optimize
from arl.test_support import import_visibility_from_oskar, export_visibility_to_fits
from crocodile.synthesis... | {
"repo_name": "SKA-ScienceDataProcessor/crocodile",
"path": "scripts/generate_wkernels.py",
"copies": "1",
"size": "2651",
"license": "apache-2.0",
"hash": -6528801060658641000,
"line_mean": 37.9852941176,
"line_max": 112,
"alpha_frac": 0.6589966051,
"autogenerated": false,
"ratio": 3.35569620253... |
#!/bin/env python3
import sys
import os
project_root = os.path.dirname(os.path.dirname(os.path.abspath(__file__)))
sys.path.append(project_root)
import argparse
import h5py
import numpy
from arl.test_support import import_visibility_from_oskar, export_visibility_to_fits
from crocodile.synthesis import kernel_oversam... | {
"repo_name": "SKA-ScienceDataProcessor/crocodile",
"path": "scripts/generate_akernels.py",
"copies": "1",
"size": "3350",
"license": "apache-2.0",
"hash": -5857321115883468000,
"line_mean": 42.5064935065,
"line_max": 101,
"alpha_frac": 0.6358208955,
"autogenerated": false,
"ratio": 3.56382978723... |
#!/bin/env python3
import sys
import os
project_root = os.path.dirname(os.path.dirname(os.path.abspath(__file__)))
sys.path.append(project_root)
import argparse
import h5py
import numpy
import arl.test_support
# Parse arguments
parser = argparse.ArgumentParser(description='Make density bins from visibilities\' UVW ... | {
"repo_name": "SKA-ScienceDataProcessor/crocodile",
"path": "scripts/make_density.py",
"copies": "1",
"size": "3709",
"license": "apache-2.0",
"hash": -4238065427889027600,
"line_mean": 36.4646464646,
"line_max": 103,
"alpha_frac": 0.642760852,
"autogenerated": false,
"ratio": 2.9672,
"config_t... |
#!/bin/env python3
import sys
import os
project_root = os.path.dirname(os.path.dirname(os.path.abspath(__file__)))
sys.path.append(project_root)
import argparse
import numpy
import h5py
import gc
from arl.test_support import *
from arl.visibility_operations import *
# Parse arguments
parser = argparse.ArgumentPars... | {
"repo_name": "SKA-ScienceDataProcessor/crocodile",
"path": "scripts/bin_dataset_hdf5.py",
"copies": "1",
"size": "3120",
"license": "apache-2.0",
"hash": 6084420712922612000,
"line_mean": 29.8910891089,
"line_max": 114,
"alpha_frac": 0.5657051282,
"autogenerated": false,
"ratio": 3.6835891381345... |
#!/bin/env python3
import sys
import os
project_root = os.path.dirname(os.path.dirname(os.path.abspath(__file__)))
sys.path.append(project_root)
import matplotlib as mpl
mpl.use("Agg")
import argparse
import h5py
import itertools
import numpy
import pylru
from multiprocessing import Process, Array, Queue
import ctyp... | {
"repo_name": "SKA-ScienceDataProcessor/crocodile",
"path": "scripts/uvw_coverage.py",
"copies": "1",
"size": "2239",
"license": "apache-2.0",
"hash": -4091412271704946000,
"line_mean": 28.4605263158,
"line_max": 85,
"alpha_frac": 0.6565430996,
"autogenerated": false,
"ratio": 3.029769959404601,
... |
#!/bin/env python3
import sys
import os
project_root = os.path.dirname(os.path.dirname(os.path.abspath(__file__)))
sys.path.append(project_root)
import matplotlib
import matplotlib.pyplot as plt
from mpl_toolkits.mplot3d import Axes3D
import argparse
import h5py
import itertools
import numpy
import random
import tim... | {
"repo_name": "SKA-ScienceDataProcessor/crocodile",
"path": "scripts/analyse_density.py",
"copies": "1",
"size": "9072",
"license": "apache-2.0",
"hash": 5495972182455100000,
"line_mean": 40.2363636364,
"line_max": 112,
"alpha_frac": 0.6053791887,
"autogenerated": false,
"ratio": 2.99208443271767... |
#!/bin/env python3
import sys
import os
sys.path.append(os.path.abspath('/home/patrick/uni/plutokore/'))
import plutokore as pk
from plutokore import jet
from plutokore import io
from plutokore import radio
from plutokore.environments.makino import MakinoProfile
from astropy import units as u
from astropy import cosmo... | {
"repo_name": "opcon/plutokore",
"path": "scripts/plot-surface-brightness.py",
"copies": "2",
"size": "4036",
"license": "mit",
"hash": -6722009150610083000,
"line_mean": 28.7037037037,
"line_max": 106,
"alpha_frac": 0.5648379052,
"autogenerated": false,
"ratio": 2.862241256245539,
"config_test... |
#!/bin/env python3
import sys
import pprint
from PyQt4.QtCore import pyqtSignal
from PyQt4.QtGui import (
QDialog, QApplication, QGridLayout,
QListWidget, QPushButton, QInputDialog
)
class Form(QDialog):
accepted = pyqtSignal(list)
def __init__(self, title, stringlist, parent=None):
super(Fo... | {
"repo_name": "GwenIves/Exercises",
"path": "rgpwp/chapter5.py",
"copies": "1",
"size": "3648",
"license": "mit",
"hash": 5646633404416100000,
"line_mean": 25.2446043165,
"line_max": 67,
"alpha_frac": 0.5783991228,
"autogenerated": false,
"ratio": 3.594088669950739,
"config_test": false,
"has... |
#!/bin/env python3
import sys
import re
import subprocess
def get_change_log(previous_sha):
args = ['git', '--no-pager', 'log', '--merges', '--grep', 'Merge pull request', '--pretty=format:"%h|%s|%b|%p"', 'master...{}'.format(previous_sha)]
log = subprocess.check_output(args)
changes = []
for line i... | {
"repo_name": "getredash/redash",
"path": "bin/get_changes.py",
"copies": "3",
"size": "1062",
"license": "bsd-2-clause",
"hash": 555747470096609150,
"line_mean": 27.7027027027,
"line_max": 152,
"alpha_frac": 0.5536723164,
"autogenerated": false,
"ratio": 3.6122448979591835,
"config_test": fals... |
#!/bin/env python3
import sys
import re
file = open(sys.argv[1], 'r')
src = file.read()
matches = re.search(r'static unsigned int width = (\d*);', src)
width = int(matches.groups(1)[0])
matches = re.search(r'static unsigned int height = (\d*);', src)
height = int(matches.groups(1)[0])
matches = re.search(r'stati... | {
"repo_name": "MightyPork/avr-projects",
"path": "archive/141219_korec-led-globe/globe-timed-experimental/image/getbytes.py",
"copies": "2",
"size": "1414",
"license": "mit",
"hash": 7336677646835155000,
"line_mean": 18.3424657534,
"line_max": 115,
"alpha_frac": 0.5573654391,
"autogenerated": false... |
#!/bin/env python3
import sys
import re
opening_bracket = re.compile(r'\s*{')
function_desc = re.compile(r'\S.+ .+\(.*\)$')
include_directive = re.compile(r'#include "(.*)"')
no_header = re.compile(r'/\* .*(?:n\'t)|(?:not?).*header.* \*/', re.IGNORECASE)
header = re.compile(r'/\* .*header.* \*/', re.IGNORECASE)
end =... | {
"repo_name": "Leo2807/yasOS",
"path": "mkheader.py",
"copies": "1",
"size": "2107",
"license": "mit",
"hash": -4241943065794437600,
"line_mean": 21.6559139785,
"line_max": 79,
"alpha_frac": 0.616516374,
"autogenerated": false,
"ratio": 2.9427374301675977,
"config_test": false,
"has_no_keywor... |
#!/bin/env python3
import sys
import requests
import datetime
import dateutil
import re
import math
from dateutil import parser
from bs4 import BeautifulSoup
# Add Google Calendars here. This can be extraced from the feed url, or from GCal > A Calendar's settings > Private Address [XML]
feed = [] # Your email address... | {
"repo_name": "liamnoone/Python",
"path": "GCalendar.py",
"copies": "1",
"size": "2094",
"license": "mit",
"hash": 7494045133123923000,
"line_mean": 42.625,
"line_max": 169,
"alpha_frac": 0.6876790831,
"autogenerated": false,
"ratio": 3.167927382753404,
"config_test": false,
"has_no_keywords"... |
#!/bin/env python3
import sys
import shutil
import os.path as path
import os
import argparse
import re
import datetime
import textwrap
from pystudentfetcher.studentfinder import StudentFinder, MatchError, validate_date, validate_due
def format_datetime(prefix, d):
rv = "%s date: %s" % (prefix, format(d, "%A, %B %... | {
"repo_name": "northWind87/pystudentfetcher",
"path": "fetch_student.py",
"copies": "1",
"size": "6479",
"license": "mit",
"hash": -8850679022254887000,
"line_mean": 45.2785714286,
"line_max": 202,
"alpha_frac": 0.6413026702,
"autogenerated": false,
"ratio": 4.166559485530547,
"config_test": fa... |
#!/bin/env python3
import sys
import time
import requests
from lxml import html
HOME_PAGE_URL = "https://www.dealabs.com/new.html"
FETCH_DELAY = 60
PAGES_TO_FETCH = 5
DEAL_NAME = 0
DEAL_URL = 1
DEAL_PRICE = 2
DEAL_SCORE = 3
def remove_prefix(s, prefix):
return s if not s.startswith(prefix) else s[len(prefix):]
... | {
"repo_name": "moverest/dealabot",
"path": "dealabot.py",
"copies": "1",
"size": "3927",
"license": "mit",
"hash": -3343622427226717000,
"line_mean": 30.408,
"line_max": 89,
"alpha_frac": 0.5817626083,
"autogenerated": false,
"ratio": 3.549728752260398,
"config_test": false,
"has_no_keywords"... |
#!/bin/env python3
import sys
def main():
if len(sys.argv) == 2:
proc_str = "{}: ".format(sys.argv[1])
else:
proc_str = ""
stdin = sys.stdin.buffer.read()
lines = stdin.decode("utf8", "ignore").splitlines()
pattern = lines[0]
files = lines[1:]
block_size = min(len(pattern... | {
"repo_name": "GwenIves/Exercises",
"path": "pip3/10_1_grep_p_child.py",
"copies": "1",
"size": "1069",
"license": "mit",
"hash": 4284684661822534000,
"line_mean": 23.8604651163,
"line_max": 60,
"alpha_frac": 0.5116931712,
"autogenerated": false,
"ratio": 4.00374531835206,
"config_test": false,... |
#!/bin/env python3
import sys
from PyQt4.QtGui import (
QDialog, QDoubleSpinBox, QComboBox, QLabel,
QFormLayout, QApplication
)
class Form(QDialog):
def __init__(self, parent=None):
def make_spin_box(decimals, end, step, value):
box = QDoubleSpinBox()
box.setDecimals(decim... | {
"repo_name": "GwenIves/Exercises",
"path": "rgpwp/chapter4.py",
"copies": "1",
"size": "1733",
"license": "mit",
"hash": -6523511546541321000,
"line_mean": 24.8656716418,
"line_max": 82,
"alpha_frac": 0.5810732833,
"autogenerated": false,
"ratio": 3.648421052631579,
"config_test": false,
"ha... |
#!/bin/env python3
import sys
from smartcard.System import readers
from smartcard.Exceptions import NoCardException
CALYPSO_CLA = [0x94]
SELECT_INS = [0xA4]
READ_RECORD_INS = [0xB2]
GET_RESPONSE_INS = [0xC0]
TICKETING_COUNTERS_FILE_ID = [0x20, 0x69]
def main():
local_readers = readers()
if local_readers:
... | {
"repo_name": "bparmentier/mobib-reader",
"path": "mobib.py",
"copies": "1",
"size": "1764",
"license": "mit",
"hash": 6946149414528488000,
"line_mean": 29.9473684211,
"line_max": 101,
"alpha_frac": 0.5992063492,
"autogenerated": false,
"ratio": 3.0839160839160837,
"config_test": false,
"has_... |
#!/bin/env python3
import sys
ZERO = [" *** ", " * * ", "* *", "* *", "* *", " * * ", " *** "]
ONE = [" * ", "** ", " * ", " * ", " * ", " * ", "***"]
TWO = [" *** ", "* *", "* * ", " * ", " * ", "* ", "*****"]
THREE = [" *** ", "* *", " *", " ** ", " *", "* *", " *** "]
FOUR ... | {
"repo_name": "GwenIves/Exercises",
"path": "pip3/1_1_big_digits.py",
"copies": "1",
"size": "1620",
"license": "mit",
"hash": 5239272402960436000,
"line_mean": 29,
"line_max": 84,
"alpha_frac": 0.3444444444,
"autogenerated": false,
"ratio": 2.8774422735346357,
"config_test": false,
"has_no_k... |
#!/bin/env python3
import sys,os
import random
import functools
p_sg = ['el', 'la']
p_pl = ['los', 'las']
# func to add prefix
def with_prefix(name):
if name[-1:] == 's':
# plural
return random.choice(p_pl) + ' ' + name
else:
return random.choice(p_sg) + ' ' + name
# Find the path
path = '.'
if len(sys.arg... | {
"repo_name": "MightyPork/los",
"path": "los.py",
"copies": "1",
"size": "1353",
"license": "mit",
"hash": -1210732360452042500,
"line_mean": 17.7916666667,
"line_max": 53,
"alpha_frac": 0.6178861789,
"autogenerated": false,
"ratio": 2.411764705882353,
"config_test": false,
"has_no_keywords":... |
#!/bin/env python3
import sys,os,re
import json
class MessageId:
'''
'''
def __init__( self, mid, **options ):
'''
'''
if type( mid ).__name__ == 'MessageId':
self.__message_id = mid.__str__()
else:
self.__message_id = mid
self.__debug = Fal... | {
"repo_name": "peitur/docker-util",
"path": "lib/Controller/message.py",
"copies": "1",
"size": "8711",
"license": "apache-2.0",
"hash": -9016682213389696000,
"line_mean": 28.7303754266,
"line_max": 221,
"alpha_frac": 0.4952359086,
"autogenerated": false,
"ratio": 3.983081847279378,
"config_tes... |
#!/bin/env python3
import threading
import atexit
from flask import Flask
from flask_ask import Ask, statement
import time
from time import sleep
from concurrent.futures import ThreadPoolExecutor
import logging
import RPi.GPIO as GPIO
import smbus
MAX_DURATION_MINUTES = 60
DEFAULT_DURATION = 5
VALID_ZONES = [1,2]
ZON... | {
"repo_name": "paulreece42/groundskeeper-willie",
"path": "willie.py",
"copies": "1",
"size": "3170",
"license": "mit",
"hash": 6653482021678161000,
"line_mean": 33.8351648352,
"line_max": 206,
"alpha_frac": 0.6690851735,
"autogenerated": false,
"ratio": 3.135509396636993,
"config_test": false,... |
#!/bin/env python3
import unittest
from collections import deque
infinity = float("inf")
class bdeque(deque):
def front(self):
return self[0]
def front_pop(self):
return self.popleft()
def back(self):
return self[-1]
def back_pop(self):
return self.pop()
def back_push(self, x):
retu... | {
"repo_name": "mithro/scheduler-simulator",
"path": "scheduler.py",
"copies": "1",
"size": "29531",
"license": "apache-2.0",
"hash": -2806401971483568600,
"line_mean": 29.4443298969,
"line_max": 102,
"alpha_frac": 0.6144052013,
"autogenerated": false,
"ratio": 3.1253042650015876,
"config_test":... |
#!/bin/env python3
import validators
import re
import json
def is_int(input):
return type(input) == int
def is_str(input):
return type(input) == str
def is_list(input):
return type(input) == list
def is_bool(input):
return is_int(input) and (input == 0 or input == 1)
def is_email(input):
... | {
"repo_name": "Zaeb0s/websocket-chat-server",
"path": "websocketchat/forms.py",
"copies": "1",
"size": "6219",
"license": "mit",
"hash": -6815992787646806000,
"line_mean": 26.1572052402,
"line_max": 165,
"alpha_frac": 0.5121402155,
"autogenerated": false,
"ratio": 3.6156976744186045,
"config_te... |
#!/bin/env python3
import xml.etree.ElementTree as ET
import sys
target_opacities = {'alpha {}'.format(a): a for a in [0.0, 0.1, 0.2, 0.3, 0.4, 0.5, 0.6, 0.7, 0.8, 0.9, 1.0]}
target_gradients = {'white-black': {'type': 'axial', 'extend': 'yes', 'coords': [0, 0, 128, 0],
'stops':... | {
"repo_name": "mbillingr/tools",
"path": "ipe++.py",
"copies": "2",
"size": "6785",
"license": "unlicense",
"hash": -6970185874256088000,
"line_mean": 39.6347305389,
"line_max": 109,
"alpha_frac": 0.4344878408,
"autogenerated": false,
"ratio": 3.597560975609756,
"config_test": false,
"has_no_... |
#!/bin/env python3
'''
Merge VCF files into a big table (or VCF) file.
'''
from __future__ import print_function
import sys;
import re;
import argparse;
parser=argparse.ArgumentParser(description="merge tab delimited files from multiple RNA-Seq samples (usually be a second scan results of rnaseqmut program) into a tab... | {
"repo_name": "davidliwei/rnaseqmut",
"path": "script/merge2ndvcf.py",
"copies": "1",
"size": "3711",
"license": "mit",
"hash": -2502766125789073000,
"line_mean": 29.6694214876,
"line_max": 291,
"alpha_frac": 0.6604688763,
"autogenerated": false,
"ratio": 3.0745650372825186,
"config_test": fals... |
#!/bin/env python3
## MyFLq Interface functions to the MyFLdb produced tables
# MyFLq (My-Forensic-Loci-queries, developer Christophe Van Neste, CC BY-SA 3.0).
version = '1.1.0'
# Python support: version 3
#
# This framework consists out of two parts: (1) A MySQL database backend that is
# populated by calibration ... | {
"repo_name": "beukueb/myflq",
"path": "src/MyFLsite/myflq/MyFLq.py",
"copies": "1",
"size": "134635",
"license": "mit",
"hash": 3474577576393600000,
"line_mean": 51.1436870643,
"line_max": 158,
"alpha_frac": 0.5925947933,
"autogenerated": false,
"ratio": 3.957059722548789,
"config_test": false... |
"""
A John Shots - A tool to get the Security Hash Algorightms (SHA) of all file in a given path.
Author:
Nissar Chababy, @funilrys, contactTATAfunilrysTODTODcom
Contributors:
Let's contribute to A John Shots!
Project link:
https://github.com/funilrys/A-John-Shots
License:
::
MIT License
Copy... | {
"repo_name": "funilrys/A-John-Shots",
"path": "setup.py",
"copies": "1",
"size": "3265",
"license": "mit",
"hash": -8348651099896450000,
"line_mean": 31.65,
"line_max": 129,
"alpha_frac": 0.6799387443,
"autogenerated": false,
"ratio": 3.933734939759036,
"config_test": false,
"has_no_keywords... |
"""
A John Shots - A tool to get the Security Hash Algorightms (SHA) of all file in a given path.
This is the module entry which provides the API endpoints and the CLI.
Author:
Nissar Chababy, @funilrys, contactTATAfunilrysTODTODcom
Contributors:
Let's contribute to A John Shots!
Project link:
https://... | {
"repo_name": "funilrys/A-John-Shots",
"path": "a_john_shots/__init__.py",
"copies": "1",
"size": "6448",
"license": "mit",
"hash": 2685281940826958300,
"line_mean": 28.7050691244,
"line_max": 99,
"alpha_frac": 0.5687247906,
"autogenerated": false,
"ratio": 4.346594740391099,
"config_test": fal... |
"""
A John Shots - A tool to get the Security Hash Algorightms (SHA) of all file in a given path.
This submodule provide the brain of the module.
Author:
Nissar Chababy, @funilrys, contactTATAfunilrysTODTODcom
Contributors:
Let's contribute to A John Shots!
Project link:
https://github.com/funilrys/A-J... | {
"repo_name": "funilrys/A-John-Shots",
"path": "a_john_shots/core.py",
"copies": "1",
"size": "5329",
"license": "mit",
"hash": -8062625729808736000,
"line_mean": 29.2784090909,
"line_max": 93,
"alpha_frac": 0.6108087821,
"autogenerated": false,
"ratio": 4.189465408805032,
"config_test": false,... |
"""
A John Shots - A tool to get the Security Hash Algorightms (SHA) of all file in a given path.
This submodule provide the hashing logic.
Author:
Nissar Chababy, @funilrys, contactTATAfunilrysTODTODcom
Contributors:
Let's contribute to A John Shots!
Project link:
https://github.com/funilrys/A-John-Sh... | {
"repo_name": "funilrys/A-John-Shots",
"path": "a_john_shots/hash.py",
"copies": "1",
"size": "3317",
"license": "mit",
"hash": -7092350370315382000,
"line_mean": 30,
"line_max": 93,
"alpha_frac": 0.6487790172,
"autogenerated": false,
"ratio": 4.236270753512133,
"config_test": false,
"has_no_... |
#!/bin/env python3
"""
filter_reads.py - Set SAM flag 0x200 (QC-fail) for reads failing various criteria.
Criteria:
* Read must be end-to-end mapped without soft clipping or indels and meet cutoffs for MAPQ and NM
* PE reads must have both reads present and meeting all above criteria. Additionally, they must
fac... | {
"repo_name": "ENCODE-DCC/dnase_pipeline",
"path": "dnanexus/dnase-filter-pe/resources/usr/bin/filter_reads.py",
"copies": "1",
"size": "6455",
"license": "mit",
"hash": 8362410002904815000,
"line_mean": 27.6888888889,
"line_max": 151,
"alpha_frac": 0.6223082881,
"autogenerated": false,
"ratio": ... |
#!/bin/env python3
#
# Generate a report of different research teams performances for all available technologies
# in the Paradox Interactive's game Hearts of Iron 2
# usage: tech.py
# <country's research teams definition csv file>
# <list of all technology definition files>
#
import sys
def calc_research_time(t... | {
"repo_name": "GwenIves/Scripts",
"path": "src/hoi2_tech.py",
"copies": "1",
"size": "4596",
"license": "mit",
"hash": 678077309695292400,
"line_mean": 23.9782608696,
"line_max": 91,
"alpha_frac": 0.4869451697,
"autogenerated": false,
"ratio": 4.118279569892473,
"config_test": false,
"has_no_... |
#!/bin/env python3
"""
Generate moprse sounds without using numpy.
"""
import math
import time
from struct import pack
from pyaudio import PyAudio
SampleRate = 22050
def sine_tone(frequency, duration, volume=0.5, sample_rate=22050):
n_samples = int(sample_rate * duration)
print('n_samples=%s' % str(n_samp... | {
"repo_name": "rzzzwilson/morse",
"path": "morse/test7.py",
"copies": "1",
"size": "1693",
"license": "mit",
"hash": 924355107019774500,
"line_mean": 23.8970588235,
"line_max": 89,
"alpha_frac": 0.548730065,
"autogenerated": false,
"ratio": 3.462167689161554,
"config_test": false,
"has_no_key... |
#!/bin/env python3
"""
Generate morse sounds without using numpy.
"""
import math
import random
import struct
import pyaudio
import time
SampleRate = 14400
MaxValue = 2**7 // 2
LeadInOutCycles = 3
def make_tone(frequency=700, duration=1, sample_rate=SampleRate, volume=0.5):
# get number of samples in one tone c... | {
"repo_name": "rzzzwilson/morse",
"path": "morse/test10.py",
"copies": "1",
"size": "1518",
"license": "mit",
"hash": -5502275393513147000,
"line_mean": 26.1071428571,
"line_max": 91,
"alpha_frac": 0.6541501976,
"autogenerated": false,
"ratio": 3.1823899371069184,
"config_test": false,
"has_n... |
#!/bin/env python3
import re
def split(re_string, string):
items = re.split(re_string, string)
if items and items != ['']:
items = items[1:] if items[0] == '' else items
items = items[:-1] if items[-1] == '' else items
return items
def words_split(words):
new_words = []
for w... | {
"repo_name": "meng89/nce",
"path": "utils/word_tokenize.py",
"copies": "1",
"size": "1067",
"license": "mit",
"hash": -5682477220544401000,
"line_mean": 20.34,
"line_max": 87,
"alpha_frac": 0.4442361762,
"autogenerated": false,
"ratio": 3.47557003257329,
"config_test": false,
"has_no_keyword... |
#!/bin/env python3
import sys
import math
import re
class am_express_input(object):
def __init__(self,input):
self.input = re.sub(r'\s',' ',input)
self.input = self.input.replace('{}','')
# self.eval_e = r'[^\d\/\*\+\-]([\d\.]+?\s*?[\/\*\+\-]\s*?[\d\.]+)[^\d\/\*\+\-]'
self.eval_e = r'[^\d\/\*\+\-]([\d\.\-]+... | {
"repo_name": "nerdneilsfield/singledog",
"path": "code/shine.py",
"copies": "1",
"size": "12031",
"license": "mit",
"hash": -929517032266501600,
"line_mean": 33.7716763006,
"line_max": 103,
"alpha_frac": 0.5805834926,
"autogenerated": false,
"ratio": 2.376728565784275,
"config_test": false,
... |
#!/bin/env python3
'''
'''
# Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The ASF licenses this file
# to you under the Apache License, Version 2.0 ... | {
"repo_name": "clearswift/trafficserver",
"path": "tests/tools/traffic-replay/__main__.py",
"copies": "3",
"size": "2207",
"license": "apache-2.0",
"hash": -6272178127762370000,
"line_mean": 50.3255813953,
"line_max": 122,
"alpha_frac": 0.7195287721,
"autogenerated": false,
"ratio": 3.73434856175... |
#!/bin/env python3
########################################################################################################################
#
# main.py
#
# Purpose: Take localstorage PS teams and turn them into text for safe storage in Dropbox, etc.
#
# Author: Braxton J. Schafer (bjschafer) [bjs]
#
# Creation date: 10... | {
"repo_name": "bjschafer/showdown-sync",
"path": "main.py",
"copies": "1",
"size": "1293",
"license": "apache-2.0",
"hash": -9202133104040309000,
"line_mean": 29.7857142857,
"line_max": 120,
"alpha_frac": 0.5274555298,
"autogenerated": false,
"ratio": 3.9662576687116564,
"config_test": true,
... |
#! /bin/env python3
"""
Module for human-readable byte strings.
"""
import sys
_units = ('','k','M','G','T','P','E','Z','Y')
def byte2human(size,
strip = True,
SI = False,
short = False,
length = 3):
"""
Return byte string in human-readible format.... | {
"repo_name": "jan-rybizki/Chempy",
"path": "Chempy/input/yields/West17/byte2human.py",
"copies": "2",
"size": "2642",
"license": "mit",
"hash": 8212912465428359000,
"line_mean": 25.6868686869,
"line_max": 64,
"alpha_frac": 0.4231642695,
"autogenerated": false,
"ratio": 2.971878515185602,
"conf... |
#!/bin/env python3
"""
Program to read morse sounds from the internal microphone and print
the English characters. The program attempts to read dynamic parameters
from the default JSON file ({progname}.json).
Usage: {progname}.py [-f <params_file>] [-h] [-n]
where -f <params_file> means read params from the given ... | {
"repo_name": "rzzzwilson/morse",
"path": "morse/morse.py",
"copies": "1",
"size": "9982",
"license": "mit",
"hash": -5941153996353281000,
"line_mean": 25.6898395722,
"line_max": 106,
"alpha_frac": 0.4868763775,
"autogenerated": false,
"ratio": 3.7498121712997747,
"config_test": false,
"has_n... |
#! /bin/env python3
# TODO - check consistent use of digits for div_lim
# TODO - check use of div_lim for rounding
# TODO - check use of div_lim, dec_lim, rounding for unit_upgrade
import datetime, sys, math
try:
import physconst
except ImportError:
SEC = 31556926
else:
SEC = physconst.SEC
_Units = (''... | {
"repo_name": "jan-rybizki/Chempy",
"path": "Chempy/input/yields/West17/time2human.py",
"copies": "1",
"size": "6462",
"license": "mit",
"hash": 6861916413297865000,
"line_mean": 25.5925925926,
"line_max": 100,
"alpha_frac": 0.4374806561,
"autogenerated": false,
"ratio": 3.455614973262032,
"con... |
#!/bin/env python3
"""
xml_browser
"""
import os
import sys
import re
from collections import deque, defaultdict
from xml.etree import ElementTree as ET
class Assembler():
"""
Assemble XML file based on a directory structure.
Class associated with ``xml_browser assemble`` command
"""
class Inval... | {
"repo_name": "rasguanabana/xml_browser",
"path": "xml_browser.py",
"copies": "1",
"size": "11183",
"license": "mit",
"hash": -2716000644053296000,
"line_mean": 40.4185185185,
"line_max": 99,
"alpha_frac": 0.5299114728,
"autogenerated": false,
"ratio": 4.523867313915858,
"config_test": false,
... |
class NFA:
def __init__(self):
self.transitions = {}
self.start_state = 0
self.num_states = 1
self.accept = set()
self.epsilon = type("epsilon", (object,), {})()
self.alphabet = set()
def add_transition(self, from_state, on_char, to_state):
if from_state not in self.transitions:
self.transitions[fr... | {
"repo_name": "stack-overflow/py_finite_state",
"path": "nfa.py",
"copies": "1",
"size": "4419",
"license": "mit",
"hash": -2506091178835199500,
"line_mean": 25.9451219512,
"line_max": 116,
"alpha_frac": 0.7069472731,
"autogenerated": false,
"ratio": 3.020505809979494,
"config_test": false,
"... |
#!/bin/env python3
#
# Python Bar for i3
#
# Uses i3py.py -> https://github.com/ziberna/i3-py
# Based in wsbar.py en examples dir
#
# © 2015 Daniel Jankowski
import time
import os
import i3ipc
DELIMITER = ''
DELIMITER_SLIM = ''# ''
ACTIVE_FG = '#1D1D1D'
ACTIVE_BG = '#617b6d'
INACTIVE_FG = '#1D1D1D'
INACTIVE_BG ... | {
"repo_name": "dj95/i3-dotfiles",
"path": "panel/powerline/i3ws.py",
"copies": "1",
"size": "5636",
"license": "mit",
"hash": -5349138866754224000,
"line_mean": 45.0901639344,
"line_max": 247,
"alpha_frac": 0.4191712609,
"autogenerated": false,
"ratio": 2.971987315010571,
"config_test": false,
... |
#!/bin/env python3
"""Read JSON taken from the stack analysis DB and re-creates pom.xml from the data."""
import sys
import json
def print_header():
"""Print the header for the pom.xml manifest file."""
print("""
<project>
<modelVersion>4.0.0</modelVersion>
<groupId>com.redhat.bayessian.test</groupId>
... | {
"repo_name": "jpopelka/fabric8-analytics-common",
"path": "integration-tests/hack/json2pom.py",
"copies": "2",
"size": "1429",
"license": "apache-2.0",
"hash": 6654445735867653000,
"line_mean": 24.5178571429,
"line_max": 86,
"alpha_frac": 0.6543037089,
"autogenerated": false,
"ratio": 3.91506849... |
#!/bin/env python3
"""
Run disk io benchmarks
"""
import timeit
import subprocess
import argparse
import sys
import re
import itertools
import os
# TODO improve latency execution
# use small blocksize, eg 4096, to test latency of block access
# TODO create a better total summary after modes are executed
# TODO ... | {
"repo_name": "dgengtek/scripts",
"path": "admin/benchmark_io.py",
"copies": "2",
"size": "6563",
"license": "mit",
"hash": -2286488043610206200,
"line_mean": 26.6919831224,
"line_max": 86,
"alpha_frac": 0.5776321804,
"autogenerated": false,
"ratio": 3.9872417982989066,
"config_test": false,
... |
#!/bin/env python3
'''Sample implementation in Python with Pylget.'''
import io, json, os, pyglet, sys, urllib.request
def load(path):
data = None
if type(path) is str:
if path[:7] == 'http://':
# Data variable is a URL.
try:
data = json.loads(
urllib.request.urlopen(path).read().decode('utf-8')... | {
"repo_name": "PrincessTeruko/anim2d",
"path": "anim2d.py",
"copies": "1",
"size": "2583",
"license": "mit",
"hash": 8284671015044639000,
"line_mean": 25.0909090909,
"line_max": 67,
"alpha_frac": 0.6058846303,
"autogenerated": false,
"ratio": 2.941913439635535,
"config_test": false,
"has_no_k... |
#!/bin/env python3
#
# Script to parse IO trace logs and show some stats
#
import sys
import statistics
# prints average, .99 quantile and maximum value for an array
def print_stat_line(what, st):
def q99(arr):
return statistics.quantiles(arr, n=100)[-1]
print("\t{:18}: avg:{:12.6f} .99:{:12.6f} m... | {
"repo_name": "scylladb/seastar",
"path": "scripts/io-trace-parse.py",
"copies": "3",
"size": "4678",
"license": "apache-2.0",
"hash": -3130679287199461400,
"line_mean": 26.0404624277,
"line_max": 74,
"alpha_frac": 0.5371953826,
"autogenerated": false,
"ratio": 3.3060070671378092,
"config_test"... |
from setuptools import setup, find_packages
from codecs import open
from os import path
# get current directory
cwd = path.abspath(path.dirname(__file__))
# get long description
def getLongDesc():
return open(path.join(cwd, 'README.rst'), encoding='utf-8').read()
# getVersion()
# get current eprl script version
... | {
"repo_name": "borysn/eprl",
"path": "setup.py",
"copies": "1",
"size": "1427",
"license": "mit",
"hash": 6398853086079237000,
"line_mean": 28.1224489796,
"line_max": 70,
"alpha_frac": 0.640504555,
"autogenerated": false,
"ratio": 3.8672086720867207,
"config_test": false,
"has_no_keywords": f... |
#!/bin/env python3
"""Solución ao reto de VigoTech 201710.
O programa recibe coma entrada unha cantidade específica como obxectivo e a
capacidade das xarras. Coma resultado imprime as accións necesarias para que
nunha das xarras consigamos ter a cantidade obxectivo.
Por exemplo::
$ ./main.py 6 4 7
Encher xa... | {
"repo_name": "vigojug/reto",
"path": "201710/migonzalvar/main.py",
"copies": "2",
"size": "8130",
"license": "bsd-3-clause",
"hash": 1249883208430764000,
"line_mean": 24.7120253165,
"line_max": 76,
"alpha_frac": 0.5780923077,
"autogenerated": false,
"ratio": 3.5218899003034245,
"config_test": ... |
#!/bin/env python3
#
# This is a assembler written in Python for the virtual machine
# included in this repo
#
import os
import sys
import struct
class CompilationError(Exception):
def __init__(self, message):
# Initialize exception class
super().__init__(self, message)
# set our message
self.message = messag... | {
"repo_name": "Justasic/Play-VM",
"path": "Assembler2.py",
"copies": "1",
"size": "7324",
"license": "bsd-2-clause",
"hash": 2242937789881446000,
"line_mean": 26.9541984733,
"line_max": 101,
"alpha_frac": 0.5910704533,
"autogenerated": false,
"ratio": 2.85091475282211,
"config_test": false,
"... |
#!/bin/env python3
#
# This is a helper script that fetches the current language and keyboard tables
# and writes the result to a C compatible struct.
#
import os
import sys
import requests
import numpy as np
import traceback
from bs4 import BeautifulSoup
from bs4 import element
intro = '''/* This file is auto generat... | {
"repo_name": "FreeRDP/FreeRDP",
"path": "scripts/fetch_language_identifiers.py",
"copies": "7",
"size": "4254",
"license": "apache-2.0",
"hash": -4360712362917547000,
"line_mean": 31.976744186,
"line_max": 211,
"alpha_frac": 0.5251527974,
"autogenerated": false,
"ratio": 3.595942519019442,
"co... |
# **********
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to
# deal in the Software without restriction, including without limitation the
# rights to use, copy, modify, merge, publish, distribute, sublicense, and/... | {
"repo_name": "Driftwood2D/Driftwood",
"path": "tools/dbedit.py",
"copies": "3",
"size": "8139",
"license": "mit",
"hash": -2420160224639925000,
"line_mean": 29.9467680608,
"line_max": 116,
"alpha_frac": 0.5655485932,
"autogenerated": false,
"ratio": 4.188883170355121,
"config_test": true,
"h... |
#!/bin/env python3
"""
Usage:
sshsession.py [options] [SSHKEY...]
options:
-h, --help Show this screen and exit.
"""
import os
import re
import subprocess
import sys
import logging
logger = logging.getLogger(__name__)
logger.setLevel(logging.INFO)
from pathlib import Path
from docopt import docopt
# TODO ch... | {
"repo_name": "dgengtek/scripts",
"path": "tools/sshsession.py",
"copies": "2",
"size": "4689",
"license": "mit",
"hash": -6396568177719427000,
"line_mean": 23.5497382199,
"line_max": 80,
"alpha_frac": 0.5600341224,
"autogenerated": false,
"ratio": 3.7273449920508743,
"config_test": false,
"h... |
#!/bin/env python3
"""
Use only legal characters from files or current directory
"""
import string
import pathlib
import sys
import os
import click
# docopt(doc, argv=None, help=True, version=None, options_first=False))
@click.command("filename_canonize.py")
@click.argument("filename", nargs=-1, required=False)
@cl... | {
"repo_name": "dgengtek/scripts",
"path": "filesystem/filename_canonize.py",
"copies": "1",
"size": "3182",
"license": "mit",
"hash": -7182522071512945000,
"line_mean": 26.8596491228,
"line_max": 75,
"alpha_frac": 0.5579345088,
"autogenerated": false,
"ratio": 3.868453105968331,
"config_test": ... |
#!/bin/env python3
"""
Watch unseen videos in a folder automatically
"""
import os
import re
import json
import subprocess as sp
import argparse
FOLDER = os.path.expanduser('~/new/')
PROG = 'mpv --fs --alang=jpn,en --slang=jpn,en'
FILETYPES = ['mkv', 'mp4']
class Watcher:
"""
Shows unwatched videos in a fold... | {
"repo_name": "IDex/scripts",
"path": "watcher.py",
"copies": "1",
"size": "6189",
"license": "mit",
"hash": 6151864135487784000,
"line_mean": 35.1929824561,
"line_max": 107,
"alpha_frac": 0.5516238488,
"autogenerated": false,
"ratio": 4.120505992010653,
"config_test": false,
"has_no_keywords... |
#!/bin/env python3
with open("d18.txt") as f:
lines = f.read().splitlines()
dim_x = len(lines)
dim_y = len(lines[0])
lights = {
(x, y) for y, l in enumerate(lines)
for x, c in enumerate(l)
if c == "#"
}
def active_neighbours(x, y):
return sum(
(x_n, y_n) in lights
... | {
"repo_name": "f-koehler/adventofcode",
"path": "d18.py",
"copies": "1",
"size": "1436",
"license": "mit",
"hash": 5000331448500545000,
"line_mean": 22.1612903226,
"line_max": 78,
"alpha_frac": 0.4505571031,
"autogenerated": false,
"ratio": 2.6252285191956126,
"config_test": false,
"has_no_ke... |
import prosite_compiler
class PrositeMatcher:
def __init__(self):
self.machine = None
self.pattern = None
self.match_begin = False
self.match_end = False
def compile(self, pattern):
if pattern and pattern[0] == '<':
self.match_begin = True
pattern = pattern[1:]
if pattern and pattern[-1] == '>':
... | {
"repo_name": "stack-overflow/py_finite_state",
"path": "prosite_matcher.py",
"copies": "1",
"size": "2274",
"license": "mit",
"hash": -7299036495167707000,
"line_mean": 21.5247524752,
"line_max": 71,
"alpha_frac": 0.6398416887,
"autogenerated": false,
"ratio": 2.8039457459926016,
"config_test"... |
import prosite_matcher
if __name__ == '__main__':
print("\n Hi, this is Prosite Matcher! \n")
sequence = input("Sequence: ")
regex = input("Regular expression: ")
if sequence is not None and sequence != "" and regex is not None and regex != "":
prositeMatcher = prosite_matcher.PrositeMatcher()
prositeMatc... | {
"repo_name": "stack-overflow/py_finite_state",
"path": "prosite_app.py",
"copies": "1",
"size": "1190",
"license": "mit",
"hash": -1582297744138443000,
"line_mean": 22.82,
"line_max": 82,
"alpha_frac": 0.6294117647,
"autogenerated": false,
"ratio": 3.0749354005167957,
"config_test": false,
"... |
import string
import nfa
import dfa
PROSITE_ALPHABET_SET = set(string.ascii_uppercase)
def nfa_for_word(word):
lexeme_nfa = nfa.NFA()
lexeme_nfa.add_word(lexeme)
return lexeme_nfa
def parse_uppercase(in_str, i):
lexeme = ""
while i < len(in_str) and (in_str[i].isupper() or in_str[i] == '-'):
while in_str[i]... | {
"repo_name": "stack-overflow/py_finite_state",
"path": "prosite_compiler.py",
"copies": "1",
"size": "3980",
"license": "mit",
"hash": -2256399568984648200,
"line_mean": 22.6964285714,
"line_max": 123,
"alpha_frac": 0.6341708543,
"autogenerated": false,
"ratio": 2.481296758104738,
"config_test... |
#!/bin/env python3
""" Provide access to the data stored in Seek instances.
For now, this is a proof-of-concept implementation for import and export of
entries (users, institutions, investigations, studies, assays, data_file etc.).
usage:
seekAPI.py [-h] [-d [<dir>]] [-c] <action> <url> <type>
<type> is one of pr... | {
"repo_name": "susca/seekAPI",
"path": "seekAPI.py",
"copies": "1",
"size": "10061",
"license": "mit",
"hash": -7622452519828565000,
"line_mean": 36.1254612546,
"line_max": 90,
"alpha_frac": 0.5351356724,
"autogenerated": false,
"ratio": 4.091500610004067,
"config_test": false,
"has_no_keywor... |
#!/bin/env python3
# PYTHON_ARGCOMPLETE_OK
import re
import sys
import argparse
import argcomplete
import bibtexparser
#-------------------------------------------------------------------------------
# Defining input options
#-------------------------------------------------------------------------------
parser = ar... | {
"repo_name": "enochnotsocool/UnixConfig",
"path": "py_script/bibformat.py",
"copies": "1",
"size": "4654",
"license": "mit",
"hash": -8701216215888059000,
"line_mean": 33.4740740741,
"line_max": 139,
"alpha_frac": 0.6261280619,
"autogenerated": false,
"ratio": 3.658805031446541,
"config_test":... |
#!/bin/env python3
# PYTHON_ARGCOMPLETE_OK
#*******************************************************************************
#
# Filename : bibstyle.py
# Description : A simple python script for calling `biber --tool` commands for
# styling .bib files
# Author : Yi-Mu "Enoch" Chen [ ensc@hep1.p... | {
"repo_name": "enochnotsocool/UnixConfig",
"path": "py_script/bibstyle.py",
"copies": "1",
"size": "1447",
"license": "mit",
"hash": 2527373771220150300,
"line_mean": 31.1555555556,
"line_max": 123,
"alpha_frac": 0.5120939876,
"autogenerated": false,
"ratio": 4.2558823529411764,
"config_test": ... |
#!/bin/env python3
# PYTHON_ARGCOMPLETE_OK
#*******************************************************************************
#
# Filename : dvdrip.py
# Description : Simple scripts for ripping a DVD into a standalone .iso file
# Author : Yi-Mu "Enoch" Chen [ ensc@hep1.phys.ntu.edu.tw ]
#
#********************... | {
"repo_name": "enochnotsocool/UnixConfig",
"path": "py_script/dvdrip.py",
"copies": "1",
"size": "2048",
"license": "mit",
"hash": -6378250225276786000,
"line_mean": 27.4444444444,
"line_max": 84,
"alpha_frac": 0.5,
"autogenerated": false,
"ratio": 4.031496062992126,
"config_test": false,
"ha... |
#!/bin/env python3
#python script to parse publications from zotero in html for my academic homepage
# the produced html (written to stdout) is intended to be used as a partial layout for the hugo generated webpage
# aug 2016, Roelof Rietbroek
# This script is called in the following way:
# mkPubList.py STORAGESUBDIROF... | {
"repo_name": "strawpants/homep8ge",
"path": "tools/mkPublist.py",
"copies": "1",
"size": "5082",
"license": "apache-2.0",
"hash": 1894952098494646300,
"line_mean": 42.4358974359,
"line_max": 417,
"alpha_frac": 0.6040928768,
"autogenerated": false,
"ratio": 3.2369426751592356,
"config_test": fa... |
#! /bin/env/python3
# vim: set fileencoding=UTF-8 :
import pywapi
import pprint as pp
import os
import re
import datetime
now = datetime.datetime.now()
# TODO: Use IP address
locations = {}
locations['westford'] = 'USMA0478'
wcr = pywapi.get_weather_from_weather_com(locations['westford'], units='imperial')
conky_loc =... | {
"repo_name": "sacooper/dotfiles",
"path": ".conky_hud/weather/wtr.py",
"copies": "1",
"size": "5245",
"license": "mit",
"hash": 2925674067079966700,
"line_mean": 35.1736111111,
"line_max": 131,
"alpha_frac": 0.4832021501,
"autogenerated": false,
"ratio": 2.9596590909090907,
"config_test": fals... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.