text
stringlengths
0
1.05M
meta
dict
#!/bin/python """ https://www.hackerrank.com/challenges/ctci-find-the-running-median/problem """ # heapq given for historical reasons # it works. but not as fast in python # as insort implementation version import heapq from bisect import insort def _insert(a_item, min_heap, max_heap, n): if n%2: ...
{ "repo_name": "codecakes/algorithms_monk", "path": "sort/heap_running_list.py", "copies": "1", "size": "1524", "license": "mit", "hash": 8385643063532431000, "line_mean": 25.275862069, "line_max": 74, "alpha_frac": 0.5603674541, "autogenerated": false, "ratio": 2.880907372400756, "config_test":...
#!/bin/python # Implementation of mmwall's "Poor man's RPC" # The goal is do RPC to change wallpaper remotely without relying on an additional custom client-server layer. # This cannot be done in pure python, so some pre-existing external tools are used. import subprocess import shutil import os import platform REM...
{ "repo_name": "esabouraud/mmwall", "path": "src/set_wallpaper_remote.py", "copies": "1", "size": "6917", "license": "bsd-3-clause", "hash": 3019607527171836000, "line_mean": 36.3891891892, "line_max": 163, "alpha_frac": 0.6948098887, "autogenerated": false, "ratio": 2.6727202472952087, "config_...
#!/bin/python import argparse from lxml import etree from datetime import datetime import numpy as np import os import plotting ######################################################################## class TrackPoint: def __init__(self): self.time = datetime.min self.lat = -1 self.lon = ...
{ "repo_name": "s-kanev/runstats", "path": "stats.py", "copies": "1", "size": "7044", "license": "mit", "hash": 8229880255692796000, "line_mean": 26.8418972332, "line_max": 101, "alpha_frac": 0.5093696763, "autogenerated": false, "ratio": 3.8724573941726224, "config_test": false, "has_no_keywo...
#!/bin/python import argparse import json import logging import socket import time import kombu def accept(port): sock = socket.socket() sock.setsockopt(socket.SOL_SOCKET, socket.SO_REUSEADDR, 1) sock.bind(('0.0.0.0', port)) sock.listen(1) return sock.accept() def main(url, port, queue_name): ...
{ "repo_name": "sparkhara/caravan-pathfinder", "path": "caravan_pathfinder.py", "copies": "1", "size": "2252", "license": "mit", "hash": 38907704665537464, "line_mean": 33.1212121212, "line_max": 80, "alpha_frac": 0.5488454707, "autogenerated": false, "ratio": 4.322456813819578, "config_test": f...
#!/bin/python import argparse import logging import os import yaml from collections import OrderedDict if __name__ == "__main__": parser = argparse.ArgumentParser(description = "Creates a module.yaml file for each of the specified directories") parser.add_argument("--loglevel", default = "INFO", choices = ["D...
{ "repo_name": "bdecoste/cct_module", "path": "generate_module.py", "copies": "3", "size": "2215", "license": "apache-2.0", "hash": 3675777419291255000, "line_mean": 40.7924528302, "line_max": 137, "alpha_frac": 0.6311512415, "autogenerated": false, "ratio": 4.064220183486238, "config_test": fal...
#!/bin/python import argparse import notes def parse_args(): """ Parses the arguments """ # Parsers declaration parser = argparse.ArgumentParser() subparsers = parser.add_subparsers(help='commands', dest='subparser') # List notes list_parser = subparsers.add_parser('list', help='List...
{ "repo_name": "nocternology/takenote", "path": "src/cli.py", "copies": "1", "size": "1846", "license": "mit", "hash": 615670109187573600, "line_mean": 28.3015873016, "line_max": 78, "alpha_frac": 0.5920910076, "autogenerated": false, "ratio": 3.775051124744376, "config_test": false, "has_no_k...
#!/bin/python import argparse import os import os.path import sys import zipfile import re import io from PIL import Image # In Memory zipfile class InMemZip(object): def __init__(self): self.byteBuf = io.BytesIO() def write(self, filename, data): with zipfile.ZipFile(self.byteBuf, 'a') as tm...
{ "repo_name": "imdn/scripts", "path": "comic-tool.py", "copies": "1", "size": "11563", "license": "unlicense", "hash": 4783435693594784000, "line_mean": 38.8724137931, "line_max": 147, "alpha_frac": 0.5513275102, "autogenerated": false, "ratio": 3.6930693069306932, "config_test": false, "has_...
#! /bin/python import argparse import os PYBABEL = 'pybabel' PATH_TRANSLATIONS = 'translations' parse = argparse.ArgumentParser(description='Quick translate') parse.add_argument( '-a', '--action', help='Action to execute', required=True, choices=['init', 'update', 'compile'] ) parse.add_argumen...
{ "repo_name": "jhbez/ProjectV", "path": "app/tr.py", "copies": "1", "size": "1139", "license": "apache-2.0", "hash": 7693003945767278000, "line_mean": 32.5, "line_max": 105, "alpha_frac": 0.6101843723, "autogenerated": false, "ratio": 3.430722891566265, "config_test": false, "has_no_keywords"...
#!/bin/python import argparse import ossn import sys if __name__ == '__main__': # Parse our arguments parser = argparse.ArgumentParser() parser.add_argument('ossn', help='Path to OSSN') output_group = parser.add_mutually_exclusive_group() output_group.add_argument("--yaml", help="output to YAML", ...
{ "repo_name": "nkinder/ossn-tools", "path": "test.py", "copies": "1", "size": "1192", "license": "apache-2.0", "hash": -1477975601357538800, "line_mean": 26.7209302326, "line_max": 68, "alpha_frac": 0.5553691275, "autogenerated": false, "ratio": 3.6564417177914113, "config_test": false, "has_...
#!/bin/python import argparse import requests """ A simple script to post nagios notifications to slack Similar to https://raw.github.com/tinyspeck/services-examples/master/nagios.pl But adds proxy support Note: If your internal proxy only exposes an http interface, you will need to be running a modern version of u...
{ "repo_name": "al4/python-slack_nagios", "path": "slack_nagios.py", "copies": "1", "size": "2175", "license": "mit", "hash": 4747048161564671000, "line_mean": 34.0806451613, "line_max": 230, "alpha_frac": 0.6611494253, "autogenerated": false, "ratio": 3.6189683860232944, "config_test": false, ...
#!/bin/python import argparse import struct MAX_FILENAME = 64 def main(): parser = argparse.ArgumentParser(description='Packages several binary files into a ultra simple archive format.') parser.add_argument('outfile') parser.add_argument('endianness', choices=['big','little']) parser.add_argument('file', nargs=...
{ "repo_name": "whitingjp/pak", "path": "src/pak.py", "copies": "1", "size": "1204", "license": "mit", "hash": 631735352813919000, "line_mean": 23.08, "line_max": 114, "alpha_frac": 0.657807309, "autogenerated": false, "ratio": 2.9223300970873787, "config_test": false, "has_no_keywords": false...
#!/bin/python import argparse import sys def check_color(value): if value.upper() in ("YW", "NW"): return value.upper() if len(value.split(',')) == 3: return value raise argparse.ArgumentTypeError("%s is an invalid color/schema" % value) def restyle(data, color="NW", direction="RL", same...
{ "repo_name": "gems-uff/noworkflow", "path": "capture/noworkflow/resources/helper/df_style.py", "copies": "1", "size": "2204", "license": "mit", "hash": -7603655065335817000, "line_mean": 34.5483870968, "line_max": 77, "alpha_frac": 0.5426497278, "autogenerated": false, "ratio": 3.873462214411248...
#!/bin/python import argparse import sys from befh.exchanges.gateway import ExchangeGateway from befh.exchanges.bitmex import ExchGwBitmex from befh.exchanges.btcc import ExchGwBtccSpot, ExchGwBtccFuture from befh.exchanges.bitfinex import ExchGwBitfinex from befh.exchanges.okcoin import ExchGwOkCoin from befh.exchan...
{ "repo_name": "Aurora-Team/BitcoinExchangeFH", "path": "befh/bitcoinexchangefh.py", "copies": "1", "size": "7458", "license": "apache-2.0", "hash": 4447363816198641700, "line_mean": 42.6140350877, "line_max": 118, "alpha_frac": 0.6647894878, "autogenerated": false, "ratio": 3.388459791004089, "...
#!/bin/python import argparse import sys parser = argparse.ArgumentParser(description="converts biallelic haploid vcf to fasta") parser.add_argument('-i', action="store", dest="input_vcf", type=str) parser.add_argument('-o', action="store", dest="output_fasta", type=str) try: options=parser.parse_args() except: ...
{ "repo_name": "ruidlpm/Utils", "path": "vcf2fasta.py", "copies": "1", "size": "2372", "license": "mit", "hash": 8060590860016512000, "line_mean": 23.2040816327, "line_max": 87, "alpha_frac": 0.568296796, "autogenerated": false, "ratio": 3.359773371104816, "config_test": false, "has_no_keyword...
#!/bin/python import argparse import tempfile import os import shutil import serial import serial.tools.list_ports as list_ports import sys import unittest from kubos import init, target, build, flash, clean from kubos.test.utils import get_arg_list, KubosTestCase class SDKIntegrationTest(KubosTestCase): uart_re...
{ "repo_name": "kyleparrott/kubos-sdk", "path": "kubos/test/integration/test.py", "copies": "1", "size": "2998", "license": "apache-2.0", "hash": 886412486139964900, "line_mean": 31.9450549451, "line_max": 134, "alpha_frac": 0.6324216144, "autogenerated": false, "ratio": 3.756892230576441, "conf...
#! /bin/python import argparse import zmq import numpy as np import time np.set_printoptions(threshold=np.nan) context = zmq.Context() parser = argparse.ArgumentParser() parser.add_argument('input_port') parser.add_argument('fusion_port') parser.add_argument('identity') args = parser.parse_args() # Socket to recei...
{ "repo_name": "benghaem/senmo-process", "path": "examples/process-ecg.py", "copies": "2", "size": "1078", "license": "mit", "hash": -8663846155703644000, "line_mean": 19.7307692308, "line_max": 64, "alpha_frac": 0.6753246753, "autogenerated": false, "ratio": 2.6486486486486487, "config_test": f...
#!bin/python import argparse import numpy as np import pandas as pd def select_chair(df, area1, date, start_time, end_time, area2=None, area3=None, mode="all"): """ Select chairs by their area of expertise and whether they give a talk in the session they are supposed to chair. The ...
{ "repo_name": "dhuppenkothen/ConferenceChairs", "path": "code/chair_selection.py", "copies": "1", "size": "7610", "license": "mit", "hash": -1088291429898854000, "line_mean": 34.7276995305, "line_max": 98, "alpha_frac": 0.5868593955, "autogenerated": false, "ratio": 3.918640576725026, "config_t...
#!/bin/python import base64 from itertools import * import sys import getopt from hashlib import * class colors: red = "\033[1;31m" white = "\033[1;37m" normal = "\033[0;00m" blue = "\033[1;34m" green = "\033[1;32m" lightblue = "\033[0;34m" def main(argv): charset = '' ch_length = '' out_file_name =...
{ "repo_name": "BlacKnight-RH/b_f0rc3r", "path": "b_f0rc3r.py", "copies": "1", "size": "3683", "license": "mit", "hash": 6791885720410222000, "line_mean": 28.464, "line_max": 109, "alpha_frac": 0.5093673636, "autogenerated": false, "ratio": 2.684402332361516, "config_test": false, "has_no_keyw...
#!/bin/python import base64 import copy from trex_stl_lib.api import * from trex_stl_lib.services.trex_stl_ap import * from trex_stl_lib.utils import text_tables, parsing_opts from trex_stl_lib.utils.parsing_opts import ArgumentPack, ArgumentGroup, is_valid_file, check_mac_addr, check_ipv4_addr, MUTEX from scapy.contr...
{ "repo_name": "dimagol/trex-core", "path": "scripts/automation/trex_control_plane/stl/trex_stl_lib/trex_stl_wlc.py", "copies": "2", "size": "39551", "license": "apache-2.0", "hash": -2704871740456318500, "line_mean": 38.3934262948, "line_max": 191, "alpha_frac": 0.5476473414, "autogenerated": false...
#!/bin/python import bit_bootstrappable_decryption import logging class BootstrappableDecryption(object): def __init__(self, short_odd_modulus, log=logging.getLogger(__name__)): self.__log = log self.__log.info("Creating BoostrappableDecryption with odd_modulus={odd_mod}".format(odd_mod=short_odd_...
{ "repo_name": "UMComp4140ATeam/Raymond", "path": "src/bootstrappable_decryption.py", "copies": "1", "size": "1077", "license": "mit", "hash": -1161800992498359000, "line_mean": 45.8695652174, "line_max": 156, "alpha_frac": 0.6805942433, "autogenerated": false, "ratio": 3.6508474576271186, "conf...
#!/bin/python import calendar import time import feedparser def cTL(tidutc): return time.localtime(calendar.timegm(tidutc)) def cTU(tidloc): return time.mktime(tidloc) def sjekkFeed(feed, lesttall): antallNyePoster = 0; sammendrag = [] tittler = [] linker = [] datoer = [] tidlocup = ...
{ "repo_name": "joards/simple-python-rss-to-mail", "path": "hentrss.py", "copies": "1", "size": "1361", "license": "mit", "hash": -5203836871509949000, "line_mean": 27.375, "line_max": 83, "alpha_frac": 0.5841293167, "autogenerated": false, "ratio": 3.0311804008908685, "config_test": false, "h...
#!/bin/python import ciphertext import logging import math import numpy class HomomorphicArithmetic(object): def __init__(self, dimension, odd_modulus, log=logging.getLogger(__name__)): self.__dimension = dimension self.__odd_modulus = odd_modulus self.__log = log self.__log.info("...
{ "repo_name": "UMComp4140ATeam/Raymond", "path": "src/homomorphic_arithmetic.py", "copies": "1", "size": "4149", "license": "mit", "hash": 6190027089251055000, "line_mean": 52.8831168831, "line_max": 217, "alpha_frac": 0.6174981923, "autogenerated": false, "ratio": 3.6172624237140365, "config_t...
#!/bin/python import ck.kernel as ck import copy import re import argparse import os import json ####################################### # Description: # # KERNEL = xgemm client # INPUT = SIZE (M,N,K); PRECISION # OUTPUT = CONFIGURATION ####################################### ''' Set interval or Resolutio...
{ "repo_name": "ctuning/ck-math", "path": "script/explore-clblast-matrix-size/clblast-client-benchmarking-multilibs.py", "copies": "1", "size": "9190", "license": "bsd-3-clause", "hash": -2456647809949266400, "line_mean": 30.4726027397, "line_max": 132, "alpha_frac": 0.5210010881, "autogenerated": f...
#!/bin/python import ck.kernel as ck import copy import re import argparse import os ####################################### # Description: # # KERNEL = xgemm client # INPUT = SIZE (M,N,K); PRECISION # OUTPUT = CONFIGURATION ####################################### ''' Set interval or Resolution 25% Set re...
{ "repo_name": "ctuning/ck-math", "path": "script/explore-acl-matrix-size/acl-client-benchmarking.py", "copies": "1", "size": "6875", "license": "bsd-3-clause", "hash": 8700378833344560000, "line_mean": 28.3803418803, "line_max": 132, "alpha_frac": 0.5565090909, "autogenerated": false, "ratio": 3....
#!/bin/python import ck.kernel as ck import copy import re import argparse import os.path import json ####################################### # Description: # # KERNEL = Xgemm # INPUT = SIZE (M,N,K); PRECISION # OUTPUT = CONFIGURATION ####################################### ''' Set interval or Resolution...
{ "repo_name": "ctuning/ck-math", "path": "script/explore-matrix-size-gemm-libs/explore-matrix-size-gemm-libs-benchmarking.py", "copies": "1", "size": "7786", "license": "bsd-3-clause", "hash": 5463818210966104000, "line_mean": 30.5222672065, "line_max": 132, "alpha_frac": 0.5160544567, "autogenerat...
#!/bin/python import collections from collections import Counter from sys import argv script, filename1, filename2, filename3 = argv import re from Bio import SeqIO p = open(filename1) #HMMTOP output file record_dict = SeqIO.index(filename2, "fasta") #FASTA file outfile = open(filename3, "w+") #Filename for extract...
{ "repo_name": "zamanianlab/50HGI", "path": "scripts/auxillary/HMMTOP_extract.py", "copies": "1", "size": "2480", "license": "mit", "hash": 6619480532153885000, "line_mean": 27.5172413793, "line_max": 89, "alpha_frac": 0.622983871, "autogenerated": false, "ratio": 2.6467449306296693, "config_tes...
#!/bin/python import ConfigParser import requests import sys import os # read the api key from the config file def getApiKey(): config = ConfigParser.ConfigParser() config.read('lifx.cfg') return config.get('api key', 'key') def getInstructions(): return "Instructions:" #TODO add instructi...
{ "repo_name": "danmac/lifx-python", "path": "lifx.py", "copies": "1", "size": "1481", "license": "mit", "hash": -8756858456478445000, "line_mean": 25.9454545455, "line_max": 82, "alpha_frac": 0.5752869683, "autogenerated": false, "ratio": 4.03542234332425, "config_test": true, "has_no_keyword...
#!/bin/python import couchdb, sys, json, os, glob, time, csv import matplotlib.pyplot as plt import numpy as np from uuid import uuid4 # This script creates/replaces a fake database # Variables db_name = 'traveler_db' path_to_file = os.path.dirname(os.path.realpath(__file__)) def unique_filename(upload_file): ...
{ "repo_name": "mwsmith2/traveler-db", "path": "scripts/enter_old_nmr_data.py", "copies": "1", "size": "2167", "license": "mit", "hash": 3206095547514525000, "line_mean": 20.8888888889, "line_max": 80, "alpha_frac": 0.6155976004, "autogenerated": false, "ratio": 2.8326797385620917, "config_test"...
#!/bin/python import couchdb, sys, json, os, glob, time import matplotlib.pyplot as plt import numpy as np from uuid import uuid4 # This script creates/replaces a fake database # Variables db_name = 'fake_traveler_db' width = [25.0, 0.2] length = [140.0, 0.2] loc = ['uw', 'ky', 'fnal', 'cornell'] author = ['Matthias...
{ "repo_name": "mwsmith2/traveler-db", "path": "scripts/make_fake_xtal_db.py", "copies": "1", "size": "4064", "license": "mit", "hash": -8191043947545667000, "line_mean": 27.0275862069, "line_max": 80, "alpha_frac": 0.6186023622, "autogenerated": false, "ratio": 2.8222222222222224, "config_test"...
#! bin/python import csv, json, requests, sys, time from bs4 import BeautifulSoup filepath = "IRONMAN_Results" raceURLS = [("im_arizona_2014","http://www.ironman.com/triathlon/events/americas/ironman/arizona/results.aspx"), ("im_austrailia_2015","http://www.ironman.com/triathlon/events/asiapac/ironman/au...
{ "repo_name": "SwimByteRun/IronScrape", "path": "IronScrape.py", "copies": "1", "size": "9885", "license": "mit", "hash": 7616510947165475000, "line_mean": 53.3186813187, "line_max": 132, "alpha_frac": 0.6514921598, "autogenerated": false, "ratio": 3.2146341463414636, "config_test": false, "h...
#!/bin/python import csv from label_map import gold_labels, mturk_labels class ControlsGrader(): """ Implements embedded control quality estimation. estimate_data_labels returns a set of approved labels for each tweet, where the label is approved if it was provided by a worker who correctly labeled the control twe...
{ "repo_name": "manosai/tweepy", "path": "assignment_4/embedded_controls.py", "copies": "1", "size": "2594", "license": "mit", "hash": -5386491693445517000, "line_mean": 41.5245901639, "line_max": 169, "alpha_frac": 0.6931380108, "autogenerated": false, "ratio": 3.22636815920398, "config_test": ...
#!/bin/python import csv import json def get_bool(entry): if entry == "y": return True; if entry == "n": return False; raise Exception("Unexpected boolean: " + entry); def is_present(entry): return entry and not entry == "na" def get_images(pictures, credits): images = []; fo...
{ "repo_name": "charmasaur/alps-insects", "path": "assets/original_data/extract_data.py", "copies": "1", "size": "4316", "license": "apache-2.0", "hash": -9112034703629004000, "line_mean": 30.2753623188, "line_max": 98, "alpha_frac": 0.593141798, "autogenerated": false, "ratio": 3.4975688816855754...
#!/bin/python import csv import operator from label_map import mturk_labels class MajorityVoteGrader(): """ Implements majority vote quality estimation. estimate_data_labels returns the most popular label for each tweet estimate_worker_qualities returns, for each worker, the proportion of labels which matched th...
{ "repo_name": "manosai/tweepy", "path": "assignment_4/majority_vote_template.py", "copies": "1", "size": "2996", "license": "mit", "hash": -4499466325474759700, "line_mean": 40.6111111111, "line_max": 110, "alpha_frac": 0.7009345794, "autogenerated": false, "ratio": 3.18384697130712, "config_te...
#!/bin/python import csv import operator import numpy as np import matplotlib.pyplot as plt #Read the data from the csvs that were output by quality_estimation.py tweet_data = [row for row in csv.DictReader(open('data_quality_estimates.csv'))] worker_data = [row for row in csv.DictReader(open('worker_quality_estimate...
{ "repo_name": "manosai/tweepy", "path": "assignment_4/analysis_template.py", "copies": "1", "size": "2951", "license": "mit", "hash": -8736425082707636000, "line_mean": 47.3770491803, "line_max": 135, "alpha_frac": 0.7133175195, "autogenerated": false, "ratio": 3.2607734806629836, "config_test"...
#!/bin/python import csv import sys f = open(sys.argv[1], 'rb') cr = csv.reader(f) cr.next() lRefs = []; for row in cr: lRefs.append(row[4]) dGamesPerRef = {}; dFoulsPerRef = {}; dAFoulsPerRef = {}; dHFoulsPerRef = {}; dYellowsPerRef = {}; dAYellowsPerRef = {}; dHYellowsPerRef = {}; dRedsPerRef = {}; dARedsPe...
{ "repo_name": "jsmithedin/Scottish-Football-Analysis", "path": "scripts/refsOverSeason.py", "copies": "1", "size": "1988", "license": "mit", "hash": 6007706390170227000, "line_mean": 24.8181818182, "line_max": 353, "alpha_frac": 0.5819919517, "autogenerated": false, "ratio": 2.4757160647571608, ...
#!/bin/python import csv data_file = "_data/projects.csv" def add_to_set(input_list,output_set): for el in input_list: el = el.strip() if el: output_set.add(el.strip()) def main(): #Initialise the main dictionary data = {} tags = set() ...
{ "repo_name": "tejpochiraju/tejpochiraju.github.io", "path": "tag_pages.py", "copies": "1", "size": "3013", "license": "mit", "hash": -1236609783463576800, "line_mean": 31.3978494624, "line_max": 98, "alpha_frac": 0.5675406572, "autogenerated": false, "ratio": 3.385393258426966, "config_test": ...
#!/bin/python import daemon import zmq import os import sys import subprocess import argparse import json import logging logger = logging.getLogger('gdam_netcdf_subscriber') import lockfile def parse_args(): parser = argparse.ArgumentParser( description='Listens for GDAM to process new glider binary ...
{ "repo_name": "USF-COT/glider_netcdf_writer", "path": "scripts/scripts-bin/gdam_netcdf_subscriber.py", "copies": "1", "size": "4588", "license": "mit", "hash": 1095737028299349200, "line_mean": 23.6666666667, "line_max": 76, "alpha_frac": 0.5810810811, "autogenerated": false, "ratio": 3.823333333...
#!/bin/python import dash_core_components as dcc import dash_html_components as html import datetime allStyle = { 'width': '1100', 'margin-left': 'auto', 'margin-right': 'auto', 'font-family': 'overpass', 'background-color': '#F3F3F3' } def getLay...
{ "repo_name": "Gab0/gekkoJaponicus", "path": "promoterz/webServer/layout.py", "copies": "1", "size": "2566", "license": "mit", "hash": 2444019061845647400, "line_mean": 28.4942528736, "line_max": 127, "alpha_frac": 0.5416991426, "autogenerated": false, "ratio": 3.881996974281392, "config_test":...
#!/bin/python import dash_core_components as dcc from evaluation.gekko.statistics import epochStatisticsNames, periodicStatisticsNames def updateWorldGraph(app, WORLD): environmentData = [ { } ] populationGroupData = [ { 'x': [locale.position[0]], 'y': [lo...
{ "repo_name": "Gab0/gekkoJaponicus", "path": "promoterz/webServer/graphs.py", "copies": "1", "size": "4130", "license": "mit", "hash": 3132296835316437500, "line_mean": 24.9748427673, "line_max": 85, "alpha_frac": 0.4682808717, "autogenerated": false, "ratio": 4.105367793240557, "config_test": ...
#!/bin/python import datetime import constants onClickJS = ''' function zp(num,count) { var ret = num + ''; while(ret.length < count) { ret = "0" + ret; } return ret; } function doClick(ev, msec, pts) { d = new Date(msec); top.location = "../logs/" + d.getFullYear() + "." + zp(1+d...
{ "repo_name": "shalinmangar/solr-perf-tools", "path": "src/python/graphutils.py", "copies": "1", "size": "13797", "license": "apache-2.0", "hash": 2307369374098576000, "line_mean": 44.0849673203, "line_max": 211, "alpha_frac": 0.6152507973, "autogenerated": false, "ratio": 3.003701284563466, "c...
#!/bin/python import datetime class channel: class channel_type: DEAD = 0 LIVE = 1 HELP = 2 def __init__(self, channel_id=0, source_id=0, source_chat_id='',\ target_id=0, target_chat_id='', public=0, type=channel_type.DEAD, match=0): """ Constructor ...
{ "repo_name": "gavincyi/Telex", "path": "src/channel.py", "copies": "1", "size": "3372", "license": "apache-2.0", "hash": -8937159047453514000, "line_mean": 27.1, "line_max": 92, "alpha_frac": 0.5014827995, "autogenerated": false, "ratio": 4.127294981640147, "config_test": false, "has_no_keyw...
#!/bin/python import datetime class contact: def __init__(self, chat_id='', phone_number='', first_name='', last_name=''): """ Constructor """ curr_datetime = datetime.datetime.now() self.date = curr_datetime.strftime("%Y%m%d") self.time = curr_datetime.strftime("%H...
{ "repo_name": "gavincyi/Telex", "path": "src/contact.py", "copies": "1", "size": "2231", "license": "apache-2.0", "hash": -8735639732793733000, "line_mean": 25.8795180723, "line_max": 81, "alpha_frac": 0.5087404751, "autogenerated": false, "ratio": 4.170093457943925, "config_test": false, "ha...
#!/bin/python import datetime class user_state: class states: UNDEF = 0 START = 1 QUERY_PENDING_MSG = 2 QUERY_PENDING_CONFIRM = 3 RESPONSE_PENDING_ID = 4 RESPONSE_PENDING_MSG = 5 RESPONSE_PENDING_CONFIRM = 6 MATCH_PENDING_ID = 7 MATCH_PENDING...
{ "repo_name": "gavincyi/Telex", "path": "src/user_state.py", "copies": "1", "size": "7512", "license": "apache-2.0", "hash": -5896506084598837000, "line_mean": 30.3, "line_max": 111, "alpha_frac": 0.5090521832, "autogenerated": false, "ratio": 4.372526193247963, "config_test": false, "has_no_...
#!/bin/python import datetime class message(): def __init__(self, msg_id=0, channel_id=0, source_id=0, source_chat_id='',\ msg=''): curr_datetime = datetime.datetime.now() self.date = curr_datetime.strftime("%Y%m%d") self.time = curr_datetime.strftime("%H:%M:%S.%f %z") ...
{ "repo_name": "gavincyi/Telex", "path": "src/message.py", "copies": "1", "size": "2393", "license": "apache-2.0", "hash": 7252492162518465000, "line_mean": 27.8313253012, "line_max": 80, "alpha_frac": 0.4918512328, "autogenerated": false, "ratio": 4.183566433566433, "config_test": false, "has...
#!/bin/python import dropbox2, u1file import os, sys, traceback class Universal_Use(): def __init__(self): pass def user_data(self): output = [] dropbox2.log_in_or_out(True) output.append('\nDropbox:') output.append(dropbox2.user_data()) output.append(str(dropbox2.file_data(''))) output.append('\nUbu...
{ "repo_name": "bry012/Combicloud", "path": "combicloud.py", "copies": "1", "size": "4310", "license": "mit", "hash": -3899792733567703000, "line_mean": 30.9259259259, "line_max": 135, "alpha_frac": 0.6856148492, "autogenerated": false, "ratio": 2.7824402840542284, "config_test": false, "has_n...
#!/bin/python import fabric.api from fabric.contrib.files import exists as remote_exists from cloudify import ctx def retrieve(agent_packages): ctx.logger.info('Downloading Cloudify Agents...') for agent, source in agent_packages.items(): # if source is not a downloadable link, it will not be downl...
{ "repo_name": "Cloudify-PS/cloudify-manager-blueprints", "path": "components/nginx/scripts/retrieve_agents.py", "copies": "3", "size": "1706", "license": "apache-2.0", "hash": -1737819390044796200, "line_mean": 38.6744186047, "line_max": 78, "alpha_frac": 0.5949589683, "autogenerated": false, "ra...
#! /bin/python import feedparser from Downloader.ResourceDownloader import ResourceDownloader from Util.LoggerFactory.LoggerFactory import LoggerFactory class ImagesDownloader: _projectRoot = '../../../' _logger = LoggerFactory().getLogger('ImagesDownloader') _rd = ResourceDownloader() def __i...
{ "repo_name": "PodSearch/PodSearch", "path": "src/ImagesDownloader/ImagesDownloader.py", "copies": "1", "size": "1493", "license": "bsd-3-clause", "hash": -208393209558971900, "line_mean": 30.1041666667, "line_max": 86, "alpha_frac": 0.6383121232, "autogenerated": false, "ratio": 4.27793696275071...
#!/bin/python import fnmatch import os import re import shutil import subprocess if (not os.path.exists("tools")): os.sys.exit("ERROR: This script should be started from the root of the git repo.") matches = [] for root, dirnames, filenames in os.walk('.'): for filename in fnmatch.filter(filenames, '*.cpp'): if ...
{ "repo_name": "agusbena/godot", "path": "tools/translations/extract.py", "copies": "1", "size": "1743", "license": "mit", "hash": -2358954399415718000, "line_mean": 22.5540540541, "line_max": 112, "alpha_frac": 0.6316695353, "autogenerated": false, "ratio": 2.8295454545454546, "config_test": fa...
#!/bin/python import fnmatch import os import shutil import subprocess import sys line_nb = False for arg in sys.argv[1:]: if arg == "--with-line-nb": print("Enabling line numbers in the context locations.") line_nb = True else: os.sys.exit("Non supported argument '" + arg + "'. Abor...
{ "repo_name": "Paulloz/godot", "path": "editor/translations/extract.py", "copies": "3", "size": "6252", "license": "mit", "hash": -2880749051287174700, "line_mean": 32.2553191489, "line_max": 118, "alpha_frac": 0.5291106846, "autogenerated": false, "ratio": 3.6076168493941143, "config_test": fa...
#!/bin/python import fnmatch import os import shutil import subprocess import sys line_nb = False for arg in sys.argv[1:]: if (arg == "--with-line-nb"): print("Enabling line numbers in the context locations.") line_nb = True else: os.sys.exit("Non supported argument '" + arg + "'. Ab...
{ "repo_name": "Marqin/godot", "path": "editor/translations/extract.py", "copies": "25", "size": "3756", "license": "mit", "hash": 5517608039721165000, "line_mean": 29.7868852459, "line_max": 117, "alpha_frac": 0.5604366347, "autogenerated": false, "ratio": 3.5601895734597155, "config_test": fal...
#!/bin/python import fnmatch import os import shutil import subprocess import sys line_nb = False for arg in sys.argv[1:]: if (arg == "--with-line-nb"): print("Enabling line numbers in the context locations.") line_nb = True else: os.sys.exit("Non supported argument '" + arg + "'. Aborting.") if (not os.p...
{ "repo_name": "est31/godot", "path": "tools/translations/extract.py", "copies": "4", "size": "3162", "license": "mit", "hash": -9170374170648537000, "line_mean": 25.5714285714, "line_max": 114, "alpha_frac": 0.6299810247, "autogenerated": false, "ratio": 2.9277777777777776, "config_test": false...
#!/bin/python import fnmatch import os latencies = [] # dir_modifier = "retime" dir_modifier = "done_23" target = "aws" # ONLY USE THIS SCRIPT FOR AWS TARGET "aws" or "zynq" if ("zynq" in target): rootdir = os.environ['SPATIAL_HOME'] elif ("aws" in target): rootdir = os.environ['RPT_HOME'] algs = [] for item in...
{ "repo_name": "stanford-ppl/spatial-lang", "path": "utilities/aws_scraper.py", "copies": "1", "size": "3278", "license": "mit", "hash": 4880265593375868000, "line_mean": 32.793814433, "line_max": 126, "alpha_frac": 0.5976205003, "autogenerated": false, "ratio": 2.513803680981595, "config_test":...
#!/bin/python import getopt, getpass, gmail, re, signal, sys, urllib2, time from pylms.server import Server from pylms.player import Player _example = 'start.py -u someuser@gmail.com -s squeezeserver.host' _refresh_seconds = 60 _services = { 'bandcamp': ['https://\w+\.bandcamp\.com/track/[\w-]+', 'http:', '"(//\w...
{ "repo_name": "bgrindy/pygmail2lms", "path": "start.py", "copies": "1", "size": "3618", "license": "mit", "hash": 7747323713795061000, "line_mean": 32.1926605505, "line_max": 117, "alpha_frac": 0.5655058043, "autogenerated": false, "ratio": 3.478846153846154, "config_test": false, "has_no_key...
#!/bin/python import getopt import glob import os import sys # only rename if -r specified rename = False # directory of files to rename - cwd by default filedir = os.getcwd() # base file name base = "" # file number num = 1 # number of zeroes to pad file number with pad = 0 # glob pattern pattern = "" # get cm...
{ "repo_name": "milesdave/f2all", "path": "f2all.py", "copies": "1", "size": "1804", "license": "mit", "hash": -2817981505994643500, "line_mean": 21, "line_max": 79, "alpha_frac": 0.6313747228, "autogenerated": false, "ratio": 3.042158516020236, "config_test": false, "has_no_keywords": false, ...
##!/bin/python import getopt import json import os # import random import shutil import sys import time class CommandLine(object): def __init__(self): self.quiz = False self.topic = "" self.section = "" self.randomQ = False self.all_questions =...
{ "repo_name": "Alovia/QuickQuiz", "path": "quickquiz.py", "copies": "1", "size": "7195", "license": "apache-2.0", "hash": 9055331040703000000, "line_mean": 27.78, "line_max": 100, "alpha_frac": 0.5669214732, "autogenerated": false, "ratio": 3.9729431253451133, "config_test": false, "has_no_ke...
#!/bin/python import glob import numpy as np import matplotlib.pyplot as plt import paths NUM_RECORDINGS = 594 DATA_DIR = paths.MSRC_12 # OUTPUT_DATA_DIR = './data' # Notes: # -Tagstream times are sort of in the middle of the gesture, but # not really; they're sometimes very close to the beginning or # the end; ...
{ "repo_name": "dblalock/clean-datasets", "path": "readMSRC12.py", "copies": "1", "size": "4469", "license": "mit", "hash": -8616942050990089000, "line_mean": 28.9932885906, "line_max": 75, "alpha_frac": 0.6775565003, "autogenerated": false, "ratio": 2.7299938912645083, "config_test": false, "...
#!/bin/python import glob import os import re import shutil import traceback import datetime import requests import sys import time import constants import graphutils import utils SLACK = '-enable-slack-bot' in sys.argv and 'SLACK_BOT_TOKEN' in os.environ QUICK = '-quick' in sys.argv CLOUD_TEST_ONLY = '-cloud-test-...
{ "repo_name": "shalinmangar/solr-perf-tools", "path": "src/python/bench.py", "copies": "1", "size": "56673", "license": "apache-2.0", "hash": -1924065468843384000, "line_mean": 45.9925373134, "line_max": 225, "alpha_frac": 0.5704303637, "autogenerated": false, "ratio": 3.5844032635506924, "conf...
#!/bin/python import glob, re, shutil, fileinput, os def toUpper(pattern): return pattern.group(1).upper() def replaceInFile(filename, pattern, replacement): for line in fileinput.FileInput(filename, inplace=1): print re.sub(pattern, replacement, line), sourceProjectName = "EmptyExample" sourceModelPath = ...
{ "repo_name": "shiffman/ofxFaceTracker", "path": "update-projects.py", "copies": "1", "size": "2811", "license": "mit", "hash": 2348334601746966000, "line_mean": 36.48, "line_max": 87, "alpha_frac": 0.7524012807, "autogenerated": false, "ratio": 3.483271375464684, "config_test": false, "has_n...
#!/bin/python import glob, re, shutil, fileinput, os def toUpper(pattern): return pattern.group(1).upper() def replaceInFile(filename, pattern, replacement): for line in fileinput.FileInput(filename, inplace=1): print re.sub(pattern, replacement, line), sourceProjectName = "EmptyExample" # windows code::block...
{ "repo_name": "Giladx/ofxFaceTracker", "path": "update-projects.py", "copies": "1", "size": "1694", "license": "mit", "hash": -7400561086733730000, "line_mean": 34.3125, "line_max": 74, "alpha_frac": 0.7621015348, "autogenerated": false, "ratio": 3.3021442495126707, "config_test": false, "has...
#!/bin/python import hashlib from multiprocessing import cpu_count import os import os.path import shutil import subprocess import urllib2 OPENSSL_VERSION = "1.0.2a" if cpu_count() > 2: MAKE_OPT = "-j%d" % (cpu_count() / 2) else: MAKE_OPT = "" ARCHS = [ ("i386", "iphonesimulator", "darwin-i386-cc"), ("x86_64"...
{ "repo_name": "nowsecure/nscrypto-cpp", "path": "external/build-libcrypto.py", "copies": "1", "size": "5183", "license": "mit", "hash": 6366736894106841000, "line_mean": 27.9553072626, "line_max": 122, "alpha_frac": 0.6511672776, "autogenerated": false, "ratio": 2.7805793991416308, "config_test...
#!/bin/python import httplib2 import os import io from apiclient import discovery from apiclient.http import MediaIoBaseDownload from oauth2client import client, file, tools from oauth2client.file import Storage import openpyxl from openpyxl import Workbook # import employees try: import argparse flags = ...
{ "repo_name": "countable-web/satchel", "path": "services/accounting/payment.py", "copies": "1", "size": "9070", "license": "mit", "hash": -1972241027427195400, "line_mean": 36.949790795, "line_max": 104, "alpha_frac": 0.5095920617, "autogenerated": false, "ratio": 4.329355608591886, "config_tes...
#!/bin/python import io import os import re from subprocess import CalledProcessError, check_call, check_output # before anything else, cd to repo root repo_root = check_output('git rev-parse --show-toplevel', shell=True) repo_root = repo_root.strip() os.chdir(repo_root) def shell(cmd): check_call(cmd, shell=True...
{ "repo_name": "lcary/nbd", "path": "scripts/test_install.py", "copies": "1", "size": "1100", "license": "mit", "hash": -4673482198605067000, "line_mean": 21.9166666667, "line_max": 69, "alpha_frac": 0.6718181818, "autogenerated": false, "ratio": 3.1884057971014492, "config_test": false, "has_...
#!/bin/python import io import os import re import setuptools from subprocess import check_call, check_output import sys # before anything else, cd to repo root repo_root = check_output('git rev-parse --show-toplevel', shell=True) repo_root = repo_root.strip() os.chdir(repo_root) def shell(cmd): check_call(cmd, s...
{ "repo_name": "lcary/nbd", "path": "scripts/pypi_upload.py", "copies": "1", "size": "1885", "license": "mit", "hash": 8547762006753921000, "line_mean": 28.453125, "line_max": 88, "alpha_frac": 0.6663129973, "autogenerated": false, "ratio": 3.162751677852349, "config_test": false, "has_no_keyw...
#!/bin/python import jinja2 import os import re def _extract_role(node): """Return the site.pp content of a specific node""" manifest = '' in_manifest = False with open('site.pp', 'r') as site_pp: for line in site_pp: if in_manifest == True and re.search('^}', line): break if in_manif...
{ "repo_name": "Spredzy/infra-ci", "path": "ci.py", "copies": "1", "size": "1775", "license": "apache-2.0", "hash": -5689808370207390000, "line_mean": 28.5833333333, "line_max": 89, "alpha_frac": 0.6529577465, "autogenerated": false, "ratio": 3.3239700374531833, "config_test": false, "has_no_k...
#!/bin/python import json from enum import Enum class State(Enum): QUESTION = 0 ANSWERS = 1 CORRECT = 2 IMAGE = 3 def new_question(): return {'answers' : []} questions_list = [] state = State.CORRECT question_id = 0 answer_id = 0 with open('questions.txt', 'r') as q: question_dict = new_que...
{ "repo_name": "atrookey/atrookey.github.io", "path": "qgen.py", "copies": "1", "size": "1283", "license": "mit", "hash": 6102552392563858000, "line_mean": 25.7291666667, "line_max": 67, "alpha_frac": 0.5113016368, "autogenerated": false, "ratio": 3.9355828220858897, "config_test": false, "has...
#!/bin/python import json from pprint import pprint as pp import Monstr.Core.Utils as Utils import Monstr.Core.DB as DB import Monstr.Core.BaseModule as BaseModule from Monstr.Core.DB import Column, Integer, String, Text, DateTime class SSB(BaseModule.BaseModule): name = 'SSB' table_schemas = {'main': (Co...
{ "repo_name": "tier-one-monitoring/monstr", "path": "Monstr/Modules/SSB/SSB.py", "copies": "1", "size": "6595", "license": "apache-2.0", "hash": 5982103241242316000, "line_mean": 45.7730496454, "line_max": 180, "alpha_frac": 0.5084154663, "autogenerated": false, "ratio": 3.888561320754717, "con...
#!/bin/python import json import sys import time import requests def update_provider_context(manager_ip): username = "{{ ctx.node.properties.admin_username }}" password = "{{ ctx.node.properties.admin_password }}" auth = (username, password) headers = {"Tenant": "default_tenant", 'Content-Type': 'ap...
{ "repo_name": "Cloudify-PS/cloudify-manager-blueprints", "path": "components/manager-ip-setter/scripts/update-provider-context.py", "copies": "2", "size": "1891", "license": "apache-2.0", "hash": -7487261991867401000, "line_mean": 30, "line_max": 78, "alpha_frac": 0.5684822845, "autogenerated": fal...
#!/bin/python import json jsonin = './tl_2010_36061_tract10.geojson' jsonout = './staic/jsonout.geojson' results = '../../Data/Test/2015-aggregated/heriarchical-clusters.csv' # results = "./Combined_Results.csv" def insert(infile, outfile): clusterAssignments = {} i = 0 for line in open(infile): ...
{ "repo_name": "xuther/nyc-taxi-data", "path": "visualization/061/addclusterdata.py", "copies": "1", "size": "1042", "license": "mit", "hash": -5194791326702067000, "line_mean": 25.05, "line_max": 92, "alpha_frac": 0.5489443378, "autogenerated": false, "ratio": 3.7347670250896057, "config_test":...
#!/bin/python import logging import math import numpy import simple_error_distribution import rvg ''' Generates the secret keys, the evaluation key, and the public key that will be used in the homomorphic encryption scheme. ''' class SomewhatHomomorphicKeygen(object): def __init__(self, dimension, multiplicative_...
{ "repo_name": "UMComp4140ATeam/Raymond", "path": "src/somewhat_homomorphic_keygen.py", "copies": "1", "size": "5254", "license": "mit", "hash": 3921744029806720500, "line_mean": 54.3157894737, "line_max": 242, "alpha_frac": 0.5934526075, "autogenerated": false, "ratio": 4.173153296266879, "conf...
#!/bin/python import logging import psutil import time import socket class process_info: def __init__(self, name): self.active = False self.name = name self.connections = {} class connection_info: def __init__(self): self.valid = False self.established = False ...
{ "repo_name": "frans-fuerst/netusage", "path": "netusage.py", "copies": "1", "size": "3422", "license": "mit", "hash": 7308450125682498000, "line_mean": 28.7565217391, "line_max": 100, "alpha_frac": 0.5207481005, "autogenerated": false, "ratio": 4.293601003764115, "config_test": false, "has_n...
#!bin/python #import logging #log_filename = 'smser.log' import sys import traceback import signal import smpplib import threading import settings from time import sleep import datetime import random from service.amqp import Publisher, Consumer import logging import json logging.basicConfig( file...
{ "repo_name": "rdl-telecom/billing", "path": "smser.py", "copies": "1", "size": "4777", "license": "unlicense", "hash": 1933270183893430000, "line_mean": 34.3851851852, "line_max": 118, "alpha_frac": 0.5698136906, "autogenerated": false, "ratio": 3.8555286521388217, "config_test": false, "has...
#!/bin/python import math import bdn """ Single Layer Rosenblatt (1957) Perceptron implementation The Ronseblatt perceptron always converges to a correct solution, if the problem can be learned by a single-layer net, no matter how the initial weights are chosen. Here such weights are chosen as random positive values...
{ "repo_name": "qwattash/AI", "path": "perceptron/perceptron.py", "copies": "1", "size": "4489", "license": "mit", "hash": -8485604780396280000, "line_mean": 31.7664233577, "line_max": 93, "alpha_frac": 0.6259746046, "autogenerated": false, "ratio": 3.201854493580599, "config_test": false, "ha...
#!/bin/python import math import numpy import simple_error_distribution import somewhat_homomorphic_keygen import rvg class BootstrappableKeygen(object): def __init__(self, short_dimension, long_dimension, multiplicative_depth, short_odd_modulus, long_odd_modulus, matrix_rows, short_seed=1, long_seed=1): ...
{ "repo_name": "UMComp4140ATeam/Raymond", "path": "src/bootstrappable_keygen.py", "copies": "1", "size": "2735", "license": "mit", "hash": -657079731894406100, "line_mean": 44.6, "line_max": 192, "alpha_frac": 0.6259597806, "autogenerated": false, "ratio": 3.7672176308539944, "config_test": fals...
#!/bin/python import math import os import random import re import sys # Complete the climbingLeaderboard function below. def _getinitRank(arr): initRank = [0] * len(arr) initRank[0] = 1 for i in range(1, len(arr)): if arr[i-1] == arr[i]: initRank[i] = initRank[i-1] else: ...
{ "repo_name": "MithileshCParab/HackerRank-10DaysOfStatistics", "path": "Problem Solving/Algorithms/Implementation/climbing_the_leaderboard.py", "copies": "1", "size": "1616", "license": "apache-2.0", "hash": 2822227921186163700, "line_mean": 22.7647058824, "line_max": 51, "alpha_frac": 0.5327970297, ...
#!/bin/python import math import os import random import re import sys # Complete the triplets function below. # Complete the triplets function below. def _binarySearch(arr, key): if arr[0] > key: return 0 elif arr[len(arr)-1] <= key: return len(arr) else: low = 0 high = le...
{ "repo_name": "MithileshCParab/HackerRank-10DaysOfStatistics", "path": "Interview Preparation Kit/Search/triple_sum.py", "copies": "1", "size": "1545", "license": "apache-2.0", "hash": 3911219815874529000, "line_mean": 26.1052631579, "line_max": 54, "alpha_frac": 0.5145631068, "autogenerated": fals...
#!/bin/python import math import os import random import re import sys DCT = { ')': '(', ']': '[', '}': '{' } BRACKETS = DCT.values() + DCT.keys() def ast_bracket(expr): stack = [] for br in expr: if br in BRACKETS: if stack: sym = DCT.get(br, Non...
{ "repo_name": "codecakes/algorithms_monk", "path": "stacks/ast_brackets.py", "copies": "1", "size": "1389", "license": "mit", "hash": 2798854284607811000, "line_mean": 23.8035714286, "line_max": 97, "alpha_frac": 0.4384449244, "autogenerated": false, "ratio": 3.9685714285714284, "config_test": ...
#!/bin/python import math def SumOfFactors(f_1, f_2): for key in f_2.keys(): if (key in f_1): f_1[key] += f_2[key] else: f_1[key] = f_2[key] return f_1; def PrimeFactorsOfNumber(n): sqrt_n = int(math.sqrt(n)) if (n == sqrt_n * sqrt_n): # Perfect square return SumOfFactors( P...
{ "repo_name": "aawc/ProjectEuler", "path": "05/evenlyDivisible.py", "copies": "1", "size": "1404", "license": "mit", "hash": 803839657825577600, "line_mean": 22.7966101695, "line_max": 50, "alpha_frac": 0.6153846154, "autogenerated": false, "ratio": 3.106194690265487, "config_test": false, "h...
#!/bin/python import matplotlib matplotlib.use('TKAgg') import numpy as np from matplotlib import pyplot as plt import time, sys import matplotlib.animation as animation WIDTH = 32 HEIGHT = 32 np.set_printoptions(precision=2, suppress=True, linewidth=200, threshold=2000) np.random.seed(1000) arrA = np.random.rando...
{ "repo_name": "gregfriedland/AuroraV6", "path": "src/bzr.py", "copies": "1", "size": "1515", "license": "mit", "hash": 3958660957119631400, "line_mean": 23.0476190476, "line_max": 78, "alpha_frac": 0.6191419142, "autogenerated": false, "ratio": 2.416267942583732, "config_test": false, "has_no...
#!/bin/python import matplotlib.pyplot as plt from matplotlib.widgets import Button from matplotlib.patches import Rectangle import matplotlib.gridspec as gridspec import cPickle #import random imgloc = '../images/v012-penn.10-1hA5D1-cropb.png' currimg=plt.imread(imgloc) square = 13 data=[] resd={'dot':0,'noise':1,...
{ "repo_name": "davharris/leafpuppy", "path": "bg_trainer.py", "copies": "1", "size": "1766", "license": "bsd-3-clause", "hash": 5900344820123743000, "line_mean": 31.1090909091, "line_max": 109, "alpha_frac": 0.6359003398, "autogenerated": false, "ratio": 2.8622366288492707, "config_test": false...
#!/bin/python import Monstr.Core.Utils as Utils import Monstr.Core.DB as DB import Monstr.Core.BaseModule as BaseModule from datetime import timedelta import json from Monstr.Core.DB import Column, Integer, String, DateTime, Text, UniqueConstraint from sqlalchemy.sql import func class PhedexErrors(BaseModule.BaseM...
{ "repo_name": "tier-one-monitoring/monstr", "path": "Monstr/Modules/PhedexErrors/PhedexErrors.py", "copies": "1", "size": "6670", "license": "apache-2.0", "hash": -1436613626996143000, "line_mean": 47.3405797101, "line_max": 152, "alpha_frac": 0.4625187406, "autogenerated": false, "ratio": 4.4825...
#!/bin/python import mysql.connector from datetime import datetime, date, time, timedelta import pytz from tzlocal import get_localzone localtz = get_localzone() #schedule follows format: #schedule = [{"DayOfWeek" : 0, "OnTime" : time(10, 00, 00, tzinfo=localtz), "OffTime" : time(13, 0, 0, tzinfo=localtz), "State": "...
{ "repo_name": "fowie/PiCoolerControl", "path": "MySQL.py", "copies": "1", "size": "1895", "license": "apache-2.0", "hash": -8617479239223989000, "line_mean": 34.7547169811, "line_max": 278, "alpha_frac": 0.6860158311, "autogenerated": false, "ratio": 2.93343653250774, "config_test": false, "h...
#!./bin/python import numpy as np import cv2 #640 x 426 cap = cv2.VideoCapture(0) # take first frame of the video ret,frame = cap.read() # setup initial location of window r,h,c,w = 250,90,400,125 # simply hardcoded the values track_window = (c,r,w,h) # set up the ROI for tracking roi = frame[r:r+h, c:c+w] hsv_ro...
{ "repo_name": "progrn/tracking", "path": "meanshift.py", "copies": "1", "size": "1294", "license": "mit", "hash": -3372558278592417300, "line_mean": 24.88, "line_max": 80, "alpha_frac": 0.6282843895, "autogenerated": false, "ratio": 2.651639344262295, "config_test": false, "has_no_keywords": ...
#!/bin/python import numpy as np import datetime import inspect import hashlib import uuid # ================================================================ # Constants # ================================================================ # ================================================================ # Functions #...
{ "repo_name": "dblalock/flock", "path": "python/utils/misc.py", "copies": "2", "size": "1114", "license": "mit", "hash": -225082147502602340, "line_mean": 18.2068965517, "line_max": 66, "alpha_frac": 0.4174147217, "autogenerated": false, "ratio": 4.050909090909091, "config_test": false, "has_...
#!/bin/python import numpy as np import matplotlib.pyplot as plt from matplotlib.widgets import Button import random imgloc = '../images/v012-penn.10-1hA5D1-cropb.png' currimg=plt.imread(imgloc) square = 21 data=[] resd={'dot':0,'noise':1,'vein':2} currbox=0 def moveCurrBox(img, width): w=int(width/2) #i=...
{ "repo_name": "davharris/leafpuppy", "path": "learnset_creator.py", "copies": "1", "size": "1982", "license": "bsd-3-clause", "hash": 7580600653205965000, "line_mean": 22.0465116279, "line_max": 59, "alpha_frac": 0.6362260343, "autogenerated": false, "ratio": 2.6497326203208558, "config_test": ...
#!/bin/python import numpy as np import matplotlib.pyplot as plt import math from PIL import Image, ImageDraw # FUNCTIONS class Line: def __init__(self, xs, ys, xe, ye, pxs, pys, pxe, pye): self.xs=xs self.ys=ys self.xe=xe self.ye=ye self.pxs=math.floor((pxs+3)*100) ...
{ "repo_name": "ploth/landmarkCreation", "path": "landmarkCreation.py", "copies": "1", "size": "7945", "license": "mit", "hash": -5153707802070077000, "line_mean": 31.1659919028, "line_max": 197, "alpha_frac": 0.613593455, "autogenerated": false, "ratio": 2.2975708502024292, "config_test": false...
#!/bin/python import numpy as np import os import inspect from scipy.misc import imresize # ================================================================ # Constants # ================================================================ # ================================================================ # Functions # ...
{ "repo_name": "dblalock/clean-datasets", "path": "utils.py", "copies": "1", "size": "5640", "license": "mit", "hash": 8392193020564937000, "line_mean": 21.6506024096, "line_max": 79, "alpha_frac": 0.6363475177, "autogenerated": false, "ratio": 3.004794885455514, "config_test": false, "has_no_...
#!/bin/python import numpy as np import tensorflow as tf import algorithms class KuhnPokerCRMPlayer(algorithms.CRMPlayer): """ """ def __init__(self, num_players=2): """ Args: num_players: """ self.graph = tf.Graph() self.num_players = num_play...
{ "repo_name": "DMRookie/RoomAI", "path": "models/crm/crm_fivecardstud/CRMForFiveCardStud.py", "copies": "1", "size": "5884", "license": "mit", "hash": 2925932285751964700, "line_mean": 37.4575163399, "line_max": 122, "alpha_frac": 0.5193745751, "autogenerated": false, "ratio": 3.4530516431924885,...
#!/bin/python import numpy as np class Environment(object): def __init__(self, state): self.state = state self.intrinsic_dynamics = lambda x: x def evolve(self, evolution_function=None): if evolution_function == None: evolution_function = self.intrinsic_dynamics sel...
{ "repo_name": "corcra/pRLy", "path": "MDP/agents.py", "copies": "1", "size": "2904", "license": "mit", "hash": 7846640716998874000, "line_mean": 32.7674418605, "line_max": 73, "alpha_frac": 0.5826446281, "autogenerated": false, "ratio": 4.366917293233083, "config_test": false, "has_no_keyword...
#!/bin/python import numpy as np # generate 3D points around points in pts_center using gaussian distribution def generate_points(pts_center, pts_sigma, pts_fixed, pts_num, axis_range): # allocate mem for points points = np.zeros([4, pts_num.sum()]) istart = 0 for i in range(pts_center.shape[1]): ...
{ "repo_name": "ivankreso/stereo-vision", "path": "scripts/stereo_model_sba/generate_3d_points.py", "copies": "1", "size": "2622", "license": "bsd-3-clause", "hash": -8150057295518705000, "line_mean": 37, "line_max": 90, "alpha_frac": 0.501525553, "autogenerated": false, "ratio": 2.664634146341463...
#!/bin/python import numpy import test_utils import unittest from src import bootstrappable_keygen class MockSomewhatHomomorphicKeygen(object): def generate_keys(self): return numpy.array([1, 2, 3, 4], dtype=numpy.integer), {(0, 0): [4, 3], (0, 1): [1, 0], (1, 0): [2, 1], (1, 1): [3, 0]}, None class Boo...
{ "repo_name": "UMComp4140ATeam/Raymond", "path": "tst/bootstrappable_keygen_test.py", "copies": "1", "size": "2054", "license": "mit", "hash": 5056427419776653000, "line_mean": 37.7735849057, "line_max": 137, "alpha_frac": 0.5457643622, "autogenerated": false, "ratio": 3.25, "config_test": true...
#!/bin/python import numpy import test_utils import unittest from src import somewhat_homomorphic_keygen class SomewhatHomomorphicKeygenTest(unittest.TestCase): def test_keygen(self): self.maxDiff = None # Need to reduce odd modulus check for tests so object initialization doesn't through errors ...
{ "repo_name": "UMComp4140ATeam/Raymond", "path": "tst/somewhat_homomorphic_keygen_test.py", "copies": "1", "size": "2046", "license": "mit", "hash": 7241480097407283000, "line_mean": 42.5531914894, "line_max": 135, "alpha_frac": 0.5557184751, "autogenerated": false, "ratio": 3.3540983606557377, ...
#!/bin/python import os, fnmatch from subprocess import call class RunPandoc(): def runPandoc(self, fileName): pandoc="C:\\Program Files (x86)\\Pandoc\\bin\\pandoc.exe" paramData={"fileName": fileName, "ext1":"md", "ext2":"html"} markdownName="%(fileName)s.%(ext1)s" % paramData htmlName="%(fileName)s.%(ext2...
{ "repo_name": "donlee888/JsObjects", "path": "Python/PandocConvert/PandocConvert.py", "copies": "2", "size": "1118", "license": "mit", "hash": 7997837273954380000, "line_mean": 33.9375, "line_max": 78, "alpha_frac": 0.6887298748, "autogenerated": false, "ratio": 3.122905027932961, "config_test"...
#!/bin/python import os, functools, subprocess, sys def target_sort(a, b): if a == b: return 0 # all target is first if a == 'all': return -1 if b == 'all': return 1 # .PHONY is last if a == '.PHONY': return 1 if b == '.PHONY': return -1 # Sor...
{ "repo_name": "MarkZH/Genetic_Chess", "path": "create_Makefile.py", "copies": "1", "size": "7756", "license": "mit", "hash": -910171520029627600, "line_mean": 39.3958333333, "line_max": 153, "alpha_frac": 0.5582774626, "autogenerated": false, "ratio": 3.238413361169102, "config_test": false, ...
#!/bin/python import os from cStringIO import StringIO as IO def scan_block(G, P, G_index, start_col, R, r, c): gr = G_index gc = start_col pr = 0 pc = 0 # O(r*c) # matrix traversal while gr < R and gc < C: while pc < c and pr < r: if G[gr][gc] != P[pr][pc]: ...
{ "repo_name": "codecakes/algorithms_monk", "path": "search/grid_pattern_search.py", "copies": "1", "size": "2437", "license": "mit", "hash": 3753589240874153000, "line_mean": 28.0119047619, "line_max": 91, "alpha_frac": 0.4677882643, "autogenerated": false, "ratio": 2.856975381008206, "config_t...
#!/bin/python import os from flask import Flask, Response, request, abort, render_template_string, send_from_directory import Image import StringIO app = Flask(__name__) WIDTH = 1000 HEIGHT = 800 TEMPLATE = ''' <!DOCTYPE html> <html> <head> <title></title> <meta charset="utf-8" /> <style> body { mar...
{ "repo_name": "akshayub/NITKart", "path": "Images/server.py", "copies": "1", "size": "2603", "license": "mit", "hash": -7879664205809767000, "line_mean": 25.5612244898, "line_max": 226, "alpha_frac": 0.5535920092, "autogenerated": false, "ratio": 3.367399741267788, "config_test": false, "has_...
#!/bin/python import os from os.path import dirname, join, exists, relpath, splitext import json from json_tools import list_field_paths, field_by_path from shutil import copy from utils import get_answer from bisect import insort_left from codecs import open as copen from sys import platform if platform == "win32": ...
{ "repo_name": "Seagull42/Starbound_RU", "path": "tools/merge_from_mod.py", "copies": "10", "size": "9072", "license": "apache-2.0", "hash": -2663091135598319600, "line_mean": 36.643153527, "line_max": 87, "alpha_frac": 0.6604938272, "autogenerated": false, "ratio": 3.7737104825291183, "config_t...
#!/bin/python import os import couchdb import simplejson basepath = os.path.dirname(__file__) conf_file = open(os.path.join(basepath, '../traveler/config.json')) conf = simplejson.loads(conf_file.read()) img_types = conf['image_types'] s = couchdb.Server(conf['db_url']) s.resource.credentials = (conf['db_user'], con...
{ "repo_name": "mwsmith2/traveler-db", "path": "scripts/correct_opt_img.py", "copies": "1", "size": "1208", "license": "mit", "hash": 8019437176952397000, "line_mean": 18.4838709677, "line_max": 67, "alpha_frac": 0.4966887417, "autogenerated": false, "ratio": 3.63855421686747, "config_test": fal...
#!/bin/python import os import glob import numpy as np import matplotlib.pyplot as plt import paths from ..utils.files import ensureDirExists NUM_RECORDINGS = 594 DATA_DIR = paths.MSRC_12 # OUTPUT_DATA_DIR = './data' join = os.path.join FIG_SAVE_DIR = join('figs','msrc') SAVE_DIR_LINE_GRAPH = join(FIG_SAVE_DIR, 'l...
{ "repo_name": "dblalock/dig", "path": "python/dig/datasets/msrc.py", "copies": "2", "size": "6204", "license": "mit", "hash": -6428818928532626000, "line_mean": 28.1267605634, "line_max": 82, "alpha_frac": 0.6803675048, "autogenerated": false, "ratio": 2.7009142359599476, "config_test": false, ...
#!/bin/python import os import kombu from collections import namedtuple class Config(object): """ Get parameters from environment, or defaults if not specified. """ # Flask DEBUG setting - not used. DEBUG = False # Logging. LOG_THRESHOLD_LEVEL = os.getenv('LOG_THRESHOLD_LEVEL', 'ERROR') ...
{ "repo_name": "LandRegistry/register-publisher", "path": "config.py", "copies": "1", "size": "3279", "license": "mit", "hash": -8675215683456979000, "line_mean": 43.9178082192, "line_max": 148, "alpha_frac": 0.7005184507, "autogenerated": false, "ratio": 3.466173361522199, "config_test": true, ...
#!/bin/python import os import re import sys import errno directives = { '_UNICODE': { 'regex': r'_UNICODE\(0x([A-Fa-f0-9]{4})\)', 'parser': lambda m: unichr(int(m.group(1), 16)) } } def line_repl(ln): ret = ln.decode('utf-8'); if re.match(r'^\s*$', ret) or ret == '': return ''; # Replace end of line...
{ "repo_name": "eerotal/nsbcomp", "path": "nsbcomp/compiler.py", "copies": "1", "size": "1346", "license": "bsd-3-clause", "hash": 3283949570731522000, "line_mean": 19.7076923077, "line_max": 57, "alpha_frac": 0.6144130758, "autogenerated": false, "ratio": 2.8158995815899583, "config_test": fals...