text stringlengths 0 1.05M | meta dict |
|---|---|
#!/bin/python
import os
import subprocess
import datetime
import time
import requests
def info(message):
print('[%s] %s' % (datetime.datetime.now(), message))
def get_solr_version():
r = requests.get('http://localhost:8983/solr/admin/info/system?wt=json')
solr = r.json()['lucene']['solr-impl-version']... | {
"repo_name": "shalinmangar/solr-perf-tools",
"path": "src/python/utils.py",
"copies": "1",
"size": "1454",
"license": "apache-2.0",
"hash": -2757504504400441300,
"line_mean": 25.4363636364,
"line_max": 94,
"alpha_frac": 0.5873452545,
"autogenerated": false,
"ratio": 3.334862385321101,
"config_... |
#!/bin/python
import os
import sys
from flask_script import Server, Manager, Shell
from flask_migrate import Migrate, MigrateCommand
from openedoo.core.db import Query
from openedoo import db,app
from openedoo import config
import unittest
import json
from openedoo.core.libs.get_modul import *
import shutil
import tim... | {
"repo_name": "openedoo/openedoo",
"path": "openedoo/core/management/__init__.py",
"copies": "1",
"size": "2087",
"license": "mit",
"hash": -7577348153223952000,
"line_mean": 27.2027027027,
"line_max": 104,
"alpha_frac": 0.7287973167,
"autogenerated": false,
"ratio": 3.5432937181663835,
"config... |
#!/bin/python
import os
import sys
from flask_script import Server, Manager, Shell
from flask_migrate import Migrate, MigrateCommand
from %(project_name)s.db import Query
from %(project_name)s import app,db
from %(project_name)s import config
import unittest
import json
from openedoo.core.libs.get_modul import *
impor... | {
"repo_name": "openedoo/openedoo",
"path": "openedoo/template_conf/project_template/project_name/management/__init__.py",
"copies": "1",
"size": "1772",
"license": "mit",
"hash": 293714760939493060,
"line_mean": 26.6875,
"line_max": 83,
"alpha_frac": 0.7071106095,
"autogenerated": false,
"ratio":... |
#!/bin/python
import os
import sys
from subprocess import check_output
path = sys.argv[1]
AlgoTypesNeighbor = set(("UserCF", "UserCFIDF", "UserCFIDF2", "UserCFIDF3"))
AlgoTypesFactor = set(("LFM", "SM", "SDM", "SDPM", "SDRPM"))
RPrecision = {}
NDCG20 = {}
FileNameDictRPrecision = {
"UserCF": "neighborhood_rprec.ts... | {
"repo_name": "wangheda/CF4CFP",
"path": "result/extract.py",
"copies": "1",
"size": "3368",
"license": "apache-2.0",
"hash": 8289756438297468000,
"line_mean": 29.6181818182,
"line_max": 119,
"alpha_frac": 0.6713182898,
"autogenerated": false,
"ratio": 2.5808429118773946,
"config_test": false,
... |
#!/bin/python
import os
import sys
import argparse
from datetime import datetime
# Returns a string with only the data we want to look at
# param:
# row, list of strings (one line from eventlog split by tab)
def format_rows(rows):
formatted_rows = ''
for row in rows:
# Get timestamp
display =... | {
"repo_name": "timburbank/nautilus_logfilter",
"path": "logfilter.py",
"copies": "1",
"size": "5076",
"license": "mit",
"hash": 1357295151880050700,
"line_mean": 33.067114094,
"line_max": 88,
"alpha_frac": 0.5078802206,
"autogenerated": false,
"ratio": 3.83963691376702,
"config_test": false,
... |
#!/bin/python
import os;
import sys;
import sqlite3;
"""
This class helps generate large SQLite databases
"""
class Generator:
file_path = "";
max_records = 0;
max_columns = 0;
db_handler = None;
db_cursor = None;
'''
This is the default constructor
'''
def __init__(self):
pass;
'''
This method c... | {
"repo_name": "agancsos/python",
"path": "generate_large.py",
"copies": "1",
"size": "2088",
"license": "mit",
"hash": 338494767459047940,
"line_mean": 20.75,
"line_max": 91,
"alpha_frac": 0.6374521073,
"autogenerated": false,
"ratio": 2.9617021276595743,
"config_test": false,
"has_no_keyword... |
#!/bin/python
import os
import sys
BASE_DIR = os.path.dirname(os.path.dirname(os.path.abspath(__file__)))
sys.path = sys.path + [BASE_DIR]
os.environ.setdefault('DJANGO_SETTINGS_MODULE', 'PiMonitor.settings')
from PIL import Image, ImageDraw
from datetime import timedelta
from django.conf import settings
from django... | {
"repo_name": "polarkac/PiMonitor",
"path": "scripts/render_graphs.py",
"copies": "1",
"size": "1463",
"license": "mit",
"hash": 8574006779981915000,
"line_mean": 31.5111111111,
"line_max": 83,
"alpha_frac": 0.5926179084,
"autogenerated": false,
"ratio": 3.458628841607565,
"config_test": false,... |
#/bin/python
import os
import sys
def num_ids(bits, total_bits):
if total_bits == 32:
bit_dec = 2
else:
bit_dec = 1
num_used = 7;
ret = 3
while bits > 0:
ret += min(num_used, bits)
num_used -= bit_dec
if num_used < 0: num_used = 0
bits -= 8
return 1 << ret
f = open('ip_id_v4.dat', 'w+')
for i ... | {
"repo_name": "Erkan-Yilmaz/twister-core",
"path": "libtorrent/docs/ips.py",
"copies": "38",
"size": "1173",
"license": "mit",
"hash": -8732860746742276000,
"line_mean": 19.9464285714,
"line_max": 70,
"alpha_frac": 0.6300085251,
"autogenerated": false,
"ratio": 2.346,
"config_test": false,
"h... |
#! /bin/python
import os
import sys
def show_help():
print("""usage:
# to seed the result
\x1b[44;97m {file01} ∉ {file02} \x1b[0m, items in file01 not in file02\n
\x1b[93m$ python diff.py --print \x1b[1m{file01} {file02}\x1b[0m
# to save the result in {result}\n
python diff.py --print {file01} {f... | {
"repo_name": "rod-stuchi/dotfiles",
"path": ".scripts/emoji/diff.py",
"copies": "1",
"size": "1825",
"license": "mit",
"hash": 1881073145939681000,
"line_mean": 27.375,
"line_max": 88,
"alpha_frac": 0.5974669604,
"autogenerated": false,
"ratio": 2.71044776119403,
"config_test": false,
"has_n... |
#! /bin/python
import os
import time
import sys
os.environ["SDL_VIDEODRIVER"] = "dummy"
from evdev import InputDevice, categorize, ecodes
import pygame
if __name__ == '__main__':
# Need to pre-init the mixer or the delay between start() and the
# sound is large, approx. 400ms.
# See: http://stackoverflow.com... | {
"repo_name": "merose/MakeyPiano",
"path": "piano.py",
"copies": "1",
"size": "3599",
"license": "apache-2.0",
"hash": 7370472397047840000,
"line_mean": 29.7606837607,
"line_max": 92,
"alpha_frac": 0.6401778272,
"autogenerated": false,
"ratio": 2.911812297734628,
"config_test": false,
"has_no... |
#!/bin/python
import os
HTML_FILE = 'index.html'
BEGIN_TAG = '<!-- ## BEGIN %s ## -->'
END_TAG = '<!-- ## END %s ## -->'
SCRIPT_DIRECTIVE = 'AUTO SCRIPT'
STYLE_DIRECTIVE = 'AUTO STYLE'
CONTROLLER_DIRECTIVE = 'AUTO CONTROLLER'
INIT_DIRECTIVE = 'AUTO INIT'
def file_includer(line_fmt, extensions=None, explicit=None, i... | {
"repo_name": "bluquar/hex-player",
"path": "res/autoscript.py",
"copies": "1",
"size": "2650",
"license": "bsd-3-clause",
"hash": 651638714106809200,
"line_mean": 24.9901960784,
"line_max": 89,
"alpha_frac": 0.6849056604,
"autogenerated": false,
"ratio": 2.915291529152915,
"config_test": false... |
#!/bin/python
import os
PKG_SHOW_CMD = "apt-cache show"
init_package_name = "ros-desktop-full"
def get_pkg_info(pkg_name):
# using strip()[0] to avoid "libc (>= xx.yy.zz)"
command = " ".join([PKG_SHOW_CMD, pkg_name.strip().split(" ")[0]])
outputs = os.popen(command).readlines()
return outputs
def ge... | {
"repo_name": "lazyparser/utilities",
"path": "map_dep_tree.py",
"copies": "1",
"size": "1215",
"license": "mpl-2.0",
"hash": -530335583141296700,
"line_mean": 26,
"line_max": 70,
"alpha_frac": 0.5547325103,
"autogenerated": false,
"ratio": 3.1153846153846154,
"config_test": false,
"has_no_ke... |
#!/bin/python
import os, re
from os import path
class glyph:
def __init__(self, name, value):
self.name = name
self.value = value
self.name_id = name.replace('-', '_')
if self.name_id == "try":
self.name_id = "try_";
elif self.name_id = "linux";
self.name_id = "linux_";
glyphs = []
with open("vari... | {
"repo_name": "mbits-os/JiraDesktop",
"path": "libs/libgui/font_awesome.py",
"copies": "1",
"size": "1610",
"license": "mit",
"hash": 8281379136929070000,
"line_mean": 23.3939393939,
"line_max": 80,
"alpha_frac": 0.5627329193,
"autogenerated": false,
"ratio": 2.410179640718563,
"config_test": f... |
#!/bin/python
import os, re, yaml as pyaml
header = """#Garbage allocation
>An outline for how html tags map to fog syntax and constructs
If you have any ideas or suggestions, please make an issue or fork this repo and make a pull request :)
"""
footer = """
##status translations
1 - will never change<br>
2 - we li... | {
"repo_name": "foglang/garbage-allocation",
"path": "make.py",
"copies": "1",
"size": "1487",
"license": "mit",
"hash": -1870470611577211600,
"line_mean": 35.2682926829,
"line_max": 103,
"alpha_frac": 0.5749831876,
"autogenerated": false,
"ratio": 3.644607843137255,
"config_test": false,
"has... |
#!/bin/python
import os, shutil
import numpy as np
import matplotlib.pyplot as plt
import np_helper as nph
# generate 3D points around points in pts_center using gaussian distribution
def generate_points(Rt_inv, pts_center, pts_sigma, pts_fixed, pts_num, axis_range):
# allocate mem for points
points = np.zeros... | {
"repo_name": "ivankreso/stereo-vision",
"path": "scripts/stereo_model/generate_features.py",
"copies": "1",
"size": "13166",
"license": "bsd-3-clause",
"hash": -3265564925929387500,
"line_mean": 36.2974504249,
"line_max": 125,
"alpha_frac": 0.593498405,
"autogenerated": false,
"ratio": 2.4458480... |
#!/bin/python
import os, sys
import argparse
import re
import zlib, base64
#command line args
parser = argparse.ArgumentParser(description='Generates the macro payload to drop an encoded executable to disk.')
parser.add_argument('--exe', dest='exe_name', action='store', default='test.exe')
parser.add_argument('--out'... | {
"repo_name": "khr0x40sh/MacroShop",
"path": "exeinvba.py",
"copies": "1",
"size": "3630",
"license": "mit",
"hash": -2824720981971596000,
"line_mean": 41.2093023256,
"line_max": 353,
"alpha_frac": 0.6685950413,
"autogenerated": false,
"ratio": 2.694877505567929,
"config_test": false,
"has_no... |
#!/bin/python
import os, sys
import argparse
import re
#if len(sys.args) < 2:
# print ""
#command line args
parser = argparse.ArgumentParser(description='Generates the macro payload to drop an encoded executable to disk.')
parser.add_argument('--exe', dest='exe_name', action='store', default='test.exe')
parser.add_... | {
"repo_name": "daviwesley/MacroShop",
"path": "exeinvba.py",
"copies": "2",
"size": "3004",
"license": "mit",
"hash": -3940915111416990700,
"line_mean": 34.7619047619,
"line_max": 353,
"alpha_frac": 0.655792277,
"autogenerated": false,
"ratio": 2.5631399317406145,
"config_test": false,
"has_n... |
#!/bin/python
import os, sys
import extract_oib_flight_metadata
# Script expects data to be organized by date and location
# i.e. AN_2009_10_16
SOFTWARE_DIR = '/u/smcmich1/icebridge/upload_software'
def main(argsIn):
rootDir = argsIn[0] # The top level folder where the other flights are
yyyymmdd = args... | {
"repo_name": "NeoGeographyToolkit/Tools",
"path": "nsidc_upload/dems/Parallel_BatcherIODEM3PremetSpatialMaker.py",
"copies": "1",
"size": "1629",
"license": "apache-2.0",
"hash": -268088668569028640,
"line_mean": 28.6181818182,
"line_max": 91,
"alpha_frac": 0.5512584408,
"autogenerated": false,
... |
#!/bin/python
import pandas as pd
import numpy as np
import sys
import matplotlib as plot
import apachelog
if len(sys.argv)!=2:
print "Usage: python apache_log_analysis.py <log file>"
sys.exit(0)
else:
apache_log=file(sys.argv[1], 'r').readlines()
#http_err=range(400,418,1)
#Example log line from the available l... | {
"repo_name": "mhabib1981/pySecn00b",
"path": "apache_log_analysis_ex.py",
"copies": "1",
"size": "1181",
"license": "cc0-1.0",
"hash": 5553788998577584000,
"line_mean": 24.1276595745,
"line_max": 159,
"alpha_frac": 0.6443691787,
"autogenerated": false,
"ratio": 2.4350515463917524,
"config_test... |
#!/bin/python
import paramiko
import sys, getopt, string
import os, stat
from stat import S_ISDIR
import commands
def sftp_get_recursive(path, dest, sftp):
item_list = sftp.listdir(path)
dest = str(dest)
if not os.path.isdir(dest):
# local("mkdir %s" % dest)
os.mkdir(dest)
for item i... | {
"repo_name": "dgautam/contrail-puppet",
"path": "contrail/environment/modules/contrail/files/transfer_keys.py",
"copies": "1",
"size": "2334",
"license": "apache-2.0",
"hash": -4905162645171598000,
"line_mean": 24.3695652174,
"line_max": 124,
"alpha_frac": 0.5407026564,
"autogenerated": false,
"... |
#!/bin/python
import platform
import fabric.api
from fabric.contrib.files import exists as remote_exists
from cloudify import ctx
from cloudify.exceptions import NonRecoverableError
def _get_distro_info():
distro, _, release = platform.linux_distribution(
full_distribution_name=False)
return '{0} {... | {
"repo_name": "codilime/cloudify-manager-blueprints",
"path": "components/nginx/scripts/retrieve_agents.py",
"copies": "1",
"size": "1800",
"license": "apache-2.0",
"hash": -6392490545208867000,
"line_mean": 36.5,
"line_max": 78,
"alpha_frac": 0.6238888889,
"autogenerated": false,
"ratio": 3.7190... |
#!/bin/python
import praw
from bs4 import BeautifulSoup
import requests
import sys
import os
import random
import boto3
from boto3.dynamodb.conditions import Key, Attr
from botocore.exceptions import ClientError
from datetime import datetime
from dateutil.relativedelta import relativedelta
# local modules
import secr... | {
"repo_name": "xgi/tagpro-leaderboards-mini",
"path": "leaderboards.py",
"copies": "1",
"size": "5774",
"license": "bsd-3-clause",
"hash": -3233752143544896500,
"line_mean": 30.9005524862,
"line_max": 118,
"alpha_frac": 0.6037409075,
"autogenerated": false,
"ratio": 3.611006879299562,
"config_t... |
#!/bin/python
import primes
import random, timeit, json, math
def random_odd_number(min_bits, max_bits):
bits = random.SystemRandom().randrange(min_bits, max_bits)
min_val = pow(2, bits) + 1
max_val = pow(2, bits + 1) - 1
return random.SystemRandom().randrange(min_val, max_val, 2)
def time_function_... | {
"repo_name": "JesseEmond/benchmarkus-prime",
"path": "benchmark.py",
"copies": "1",
"size": "2024",
"license": "mit",
"hash": 2037826215018716200,
"line_mean": 33.8965517241,
"line_max": 129,
"alpha_frac": 0.6877470356,
"autogenerated": false,
"ratio": 2.9940828402366866,
"config_test": false,... |
#!/bin/python
import pylab as pl
import cPickle
import matplotlib.pyplot as plt
from sklearn import svm, metrics
import numpy as np
import sys
square = 13
imgloc = '../images/v012-penn.10-1hA5D1-cropb.png'
resd={'dot':0,'noise':1,'vein':2}
currimg=plt.imread(imgloc)
pkl_file=open('dots.pkl', 'r')
dots = cPickle.load... | {
"repo_name": "davharris/leafpuppy",
"path": "train_dots.py",
"copies": "1",
"size": "2641",
"license": "bsd-3-clause",
"hash": 6308945765470502000,
"line_mean": 26.5104166667,
"line_max": 152,
"alpha_frac": 0.6641423703,
"autogenerated": false,
"ratio": 2.6436436436436437,
"config_test": false... |
#!/bin/python
import pyPdf
input_pdf = '/home/user/Downloads/mt.pdf'
input_owl_spreadsheet = '/home/user/Downloads/owl_marks.csv'
output_updated_owl = '/home/user/Downloads/owl_with_midterm.csv'
midterm_weight = 10
student_num_col = 3
def main():
# extract student number -> marks dictionary from pdf
pdf = pyPdf.... | {
"repo_name": "matthewbstokes/scripts",
"path": "pdf_owl/pdf_mark_extractor_to_owl_spreadsheet.py",
"copies": "1",
"size": "1291",
"license": "mit",
"hash": 1736044083202007800,
"line_mean": 28.3409090909,
"line_max": 75,
"alpha_frac": 0.654531371,
"autogenerated": false,
"ratio": 2.9678160919540... |
#!bin/python
import random
from sortedcontainers import SortedSet
from array import array
import matplotlib.pyplot as plt
from math import sqrt
# Generate a list of randomly chosen numbers
# stop after the first collision returning
# when it occurred
def birthdayCollision(population):
firstCollision = -1
selected =... | {
"repo_name": "llewelld/birthdayparadox",
"path": "collision.py",
"copies": "1",
"size": "4382",
"license": "mit",
"hash": 2241893330493627000,
"line_mean": 28.2133333333,
"line_max": 114,
"alpha_frac": 0.7457781835,
"autogenerated": false,
"ratio": 3.458563535911602,
"config_test": true,
"ha... |
#!/bin/python
import random
import argparse
import sys
parser = argparse.ArgumentParser(description='Generate a random (or otherwise) C Array')
parser.add_argument('-l','--len', default=16384, type=int, help='Size of Random Array')
parser.add_argument('-r','--range', default=2, type=int, help='Upper Bound on Random V... | {
"repo_name": "VerticalResearchGroup/microbench",
"path": "rand_c_arr.py",
"copies": "1",
"size": "1228",
"license": "mit",
"hash": -430010256439055700,
"line_mean": 25.1276595745,
"line_max": 108,
"alpha_frac": 0.6311074919,
"autogenerated": false,
"ratio": 2.959036144578313,
"config_test": fa... |
#!/bin/python
import random
import logging
class PassphraseGenerator:
def __init__(self, file_urn='word_list.txt'):
self.logger = self.setupLogger()
self.words = self.read_words(file_urn)
def setupLogger(self):
logger = logging.getLogger('PassphraseGenerator')
handler = log... | {
"repo_name": "rijkstofberg/passphrase-generator",
"path": "pg.py",
"copies": "1",
"size": "1870",
"license": "mit",
"hash": 3860896661096433000,
"line_mean": 27.3333333333,
"line_max": 78,
"alpha_frac": 0.5695187166,
"autogenerated": false,
"ratio": 3.7103174603174605,
"config_test": false,
... |
#!/bin/python
import random
random.seed()
"""
Binary Decision Neuron Model (McCullogh-Pitts Model)
"""
class BDN(object):
"""
constructor
@param {int} inputs number of inputs
@param {Array.<double>} [weights] array of weights for the inputs
zeroth element in the array is treated as the activatio... | {
"repo_name": "qwattash/AI",
"path": "perceptron/bdn.py",
"copies": "1",
"size": "1077",
"license": "mit",
"hash": 7225612375694965000,
"line_mean": 25.925,
"line_max": 72,
"alpha_frac": 0.5793871866,
"autogenerated": false,
"ratio": 3.7395833333333335,
"config_test": false,
"has_no_keywords"... |
#!/bin/python
import re, datetime
# convenience decorators for metrics
# true/false tests
def boolean(target):
target.is_metric = True
target.metric_type = 'boolean'
return target
# calculates more aggregate statistics
def real(target):
target.is_metric = True
target.metric_type = 'real'... | {
"repo_name": "sunlightlabs/clearspending",
"path": "completeness/metrics/metric_completeness.py",
"copies": "1",
"size": "4459",
"license": "bsd-3-clause",
"hash": -8518683422943743000,
"line_mean": 32.276119403,
"line_max": 233,
"alpha_frac": 0.6907378336,
"autogenerated": false,
"ratio": 3.153... |
#! /bin/python
import re
import datetime
import pymongo
from pymongo import MongoClient
import requests
from bs4 import BeautifulSoup
REGEX = r'About (.*) results'
keywords = ['Arvind Kejriwal', 'Narendra Modi', 'Rahul Gandhi', 'Sonia Gandhi', 'BJP', 'AAP', 'Congress India']
def number_of_search_results(key):
d... | {
"repo_name": "avinassh/polistats",
"path": "bot.py",
"copies": "1",
"size": "1354",
"license": "mit",
"hash": -7881798229931396000,
"line_mean": 37.7142857143,
"line_max": 125,
"alpha_frac": 0.6580502216,
"autogenerated": false,
"ratio": 3.1784037558685445,
"config_test": false,
"has_no_keyw... |
# /bin/python
import re
import json
from string import Template
import requests
from bs4 import BeautifulSoup
def dowload_top_100():
'''This script will download Top 100 books of last 30 days from Project
Gutenberg and saves them with appropriate file name'''
base_url = 'http://www.gutenberg.myebook.bg/... | {
"repo_name": "avinassh/gre-classics",
"path": "utils.py",
"copies": "1",
"size": "1470",
"license": "mit",
"hash": 2867400614655507500,
"line_mean": 33.2093023256,
"line_max": 94,
"alpha_frac": 0.5911564626,
"autogenerated": false,
"ratio": 3.2666666666666666,
"config_test": false,
"has_no_k... |
#!/bin/python
import re
import sys
from os import path, makedirs, listdir
# fairly simply python script to concatenate the cmake files that make up
# consort into a single file that can be easily distributed or included in other
# projects
master_name = 'consort.cmake'
licence_name = 'LICENSE'
root_path = path.dirn... | {
"repo_name": "consort-cmake/consort-cmake",
"path": "build.py",
"copies": "1",
"size": "2988",
"license": "mit",
"hash": 174259092372211300,
"line_mean": 26.4128440367,
"line_max": 82,
"alpha_frac": 0.5806559572,
"autogenerated": false,
"ratio": 3.507042253521127,
"config_test": false,
"has_... |
#!/bin/python
import requests
from bs4 import BeautifulSoup
from urllib.parse import urlencode, parse_qs
def get_endpoints(url):
r = requests.get(url)
soup = BeautifulSoup(r.text)
return [
soup.find(None, attrs={'rel': rel})['href']
for rel in ('authorization_endpoint', 'token_endpoint',... | {
"repo_name": "kylewm/feverdream",
"path": "scripts/do_get_micropub_access_token.py",
"copies": "2",
"size": "1030",
"license": "bsd-2-clause",
"hash": 861890406499279100,
"line_mean": 24.1219512195,
"line_max": 80,
"alpha_frac": 0.5902912621,
"autogenerated": false,
"ratio": 3.515358361774744,
... |
#!/bin/python
import requests
from bs4 import BeautifulSoup
from urllib.parse import urlencode, parse_qs
# Twitter
ACCESS_TOKEN = 'd2c5a940493c56e99e1acfa834b69f75'
MICROPUB_ENDPOINT = 'http://feverdream.cc/micropub'
if __name__ == '__main__':
r = requests.post(MICROPUB_ENDPOINT, data={
'content': 'Tes... | {
"repo_name": "kylewm/feverdream",
"path": "scripts/do_local_micropub.py",
"copies": "2",
"size": "1113",
"license": "bsd-2-clause",
"hash": 8021694657034801000,
"line_mean": 26.1463414634,
"line_max": 78,
"alpha_frac": 0.5947888589,
"autogenerated": false,
"ratio": 3.1709401709401708,
"config_... |
#!/bin/python
import roomai
class CharacterCardNames:
Bart_Cassidy = "Bart_Cassidy"
#Bart Cassidy = Butch Cassidy – Each time he loses a life point, he immediately draws a normal card from the deck. (4 life points)
Black_Jack = "Black_Jack"
#Black Jack = Tom Ketchum (known as Black Jack) – Durin... | {
"repo_name": "roomai/RoomAI",
"path": "roomai/games/bang/CardCharacter.py",
"copies": "1",
"size": "7105",
"license": "mit",
"hash": -3613125166913183000,
"line_mean": 82.2352941176,
"line_max": 407,
"alpha_frac": 0.7375265018,
"autogenerated": false,
"ratio": 3.218835304822566,
"config_test":... |
#!/bin/python
import roomai
class PlayingCardNames:
Duello = "Duello"
Carabine = "Carabine"
Bang = "Bang"
Emporia = "Emporia"
Volcanic = "Volcanic"
Schofield = "Schofield"
Remington = "Remington"
Panic = "Panic"
Dynamite = "Dynamite"
WellsFarg... | {
"repo_name": "roomai/RoomAI",
"path": "roomai/games/bang/CardPlaying.py",
"copies": "1",
"size": "14455",
"license": "mit",
"hash": -7159758771405802000,
"line_mean": 68.1626794258,
"line_max": 191,
"alpha_frac": 0.7196125908,
"autogenerated": false,
"ratio": 2.896793587174349,
"config_test": ... |
#!/bin/python
import roomai.sevenking
from roomai.sevenking import SevenKingAction
from roomai.sevenking import SevenKingPokerCard
class AlwaysFoldPlayer(roomai.common.AbstractPlayer):
"""
"""
def take_action(self):
"""
Returns:
"""
if "" not in self.available_actions:
... | {
"repo_name": "DMRookie/RoomAI",
"path": "roomai/sevenking/SevenKingPlayer.py",
"copies": "1",
"size": "4446",
"license": "mit",
"hash": -7563295995137158000,
"line_mean": 22.9086021505,
"line_max": 113,
"alpha_frac": 0.5074224022,
"autogenerated": false,
"ratio": 3.9590382902938557,
"config_te... |
#!/bin/python
import serial
import argparse
import math
import sys
parser = argparse.ArgumentParser(description='Interact with the flash programmer.')
parser.add_argument('-b', default=250000, help="Set the baud rate used for communicating with the programmer. Default: 250000.")
parser.add_argument('-c', default=0x40... | {
"repo_name": "Acedio/flash_programmer",
"path": "eep.py",
"copies": "1",
"size": "2982",
"license": "bsd-2-clause",
"hash": 4742647942370526000,
"line_mean": 31.0652173913,
"line_max": 157,
"alpha_frac": 0.6308474576,
"autogenerated": false,
"ratio": 3.1788793103448274,
"config_test": false,
... |
import settings
import requests, json, argparse
from argparse import RawTextHelpFormatter
headers = {'Authorization': 'token ' + settings.GITHUB_TOKEN}
def project_loop_milestones (project, repo_list):
print ("")
print ("***********************")
print ("%s"%(project))
print ("**********************... | {
"repo_name": "AFouques/github_script",
"path": "github_script.py",
"copies": "1",
"size": "4188",
"license": "apache-2.0",
"hash": 65322852024466000,
"line_mean": 42.625,
"line_max": 117,
"alpha_frac": 0.6057784145,
"autogenerated": false,
"ratio": 3.597938144329897,
"config_test": false,
"h... |
#!/bin/python
import shlex
from subprocess import Popen, PIPE
import sys
import rijndael
import base64
import string
import random
import json
import time
import hashlib
import pycurl
from urllib import urlencode
try:
from cStringIO import StringIO
except ImportError:
try:
from StringIO import StringI... | {
"repo_name": "nadams810/kritbit",
"path": "scripts/runcommand.py",
"copies": "1",
"size": "2865",
"license": "mit",
"hash": -7937517966250420000,
"line_mean": 24.8198198198,
"line_max": 103,
"alpha_frac": 0.6712041885,
"autogenerated": false,
"ratio": 3.3198146002317497,
"config_test": false,
... |
#!/bin/python
import signal, sys, ssl, logging
from SimpleWebSocketServer import *
from optparse import OptionParser
from Sabertooth.Sabertooth import Sabertooth as Sabertooth
import Adafruit_BBIO.GPIO as GPIO
import Adafruit_BBIO.PWM as PWM
from Sensors.Adafruit_HMC5883L import Adafruit_HMC5883L as MAG
from Sensors.A... | {
"repo_name": "tdack/BBB-Bot",
"path": "server/robot.py",
"copies": "1",
"size": "12804",
"license": "mit",
"hash": 4144037273213220000,
"line_mean": 36.6617647059,
"line_max": 145,
"alpha_frac": 0.5592783505,
"autogenerated": false,
"ratio": 3.506984387838948,
"config_test": false,
"has_no_k... |
#!/bin/python
import simplejson
import couchdb
conf = simplejson.load(open('traveler/config.json'))
attr = simplejson.load(open('traveler/entry_attributes.json'))
client = couchdb.Server(url=conf['db_url'])
client.resource.credentials = (conf['db_user'], conf['db_pass'])
db = client[conf['db_name']]
print "Removing ... | {
"repo_name": "mwsmith2/traveler-db",
"path": "scripts/clean_traveler_db.py",
"copies": "1",
"size": "5035",
"license": "mit",
"hash": -8374708347442300000,
"line_mean": 20.2447257384,
"line_max": 76,
"alpha_frac": 0.476266137,
"autogenerated": false,
"ratio": 3.7914156626506026,
"config_test":... |
#!/bin/python
import socket
import threading
import signal
import sys
import time
PORT_NUMBER = 5019
# HOSTNAME = "" # Real IP ADDRESS
HOSTNAME = "127.0.0.1" # localhost
# HOSTNAME = socket.gethostname()
class P2P:
connections = []
sock = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
def startListe... | {
"repo_name": "yellokrow/P2P_RelayServer",
"path": "relay.py",
"copies": "1",
"size": "2862",
"license": "mit",
"hash": 7775869599393550000,
"line_mean": 31.1685393258,
"line_max": 85,
"alpha_frac": 0.6261355695,
"autogenerated": false,
"ratio": 3.8938775510204082,
"config_test": false,
"has_... |
#!/bin/python
import sqlite3
from src.channel import channel
from src.message import message
from src.user_state import user_state
from src.contact import contact
class db_client():
"""
Simple sqlite database client
"""
def __init__(self, logger, conf = None):
self.logger = logger
self... | {
"repo_name": "gavincyi/Telex",
"path": "src/db_client.py",
"copies": "1",
"size": "5080",
"license": "apache-2.0",
"hash": 6121499939069827000,
"line_mean": 38.0769230769,
"line_max": 96,
"alpha_frac": 0.5580708661,
"autogenerated": false,
"ratio": 3.791044776119403,
"config_test": false,
"h... |
#!/bin/python
import sqlite3
conn = sqlite3.connect('cache.db')
cur = conn.cursor()
print("""
<!doctype html>
<head>
<title>Fedora FTBFS list</title>
<meta charset="UTF-8">
<style type="text/css">
body {
background-color:white;
text-color:black;
}
table,td {
width: 100%;
padding: 0.2em;
}
td {
font-size: 0.8em... | {
"repo_name": "hrw/fedora-koji-scripts",
"path": "generate-html-page.py",
"copies": "1",
"size": "3741",
"license": "mit",
"hash": -7530781781660230000,
"line_mean": 20.8771929825,
"line_max": 165,
"alpha_frac": 0.639935846,
"autogenerated": false,
"ratio": 2.541440217391304,
"config_test": fal... |
#!/bin/python
import string
from tornado.httputil import HTTPHeaders
from tornado.httpclient import HTTPRequest
from framework.http.wafbypasser.core.hpp_lib import asp_hpp, param_overwrite
from framework.http.wafbypasser.core.placeholder_length import find_length
from framework.http.wafbypasser.core.detection import... | {
"repo_name": "DarKnight24/owtf",
"path": "framework/http/wafbypasser/wafbypasser.py",
"copies": "2",
"size": "15757",
"license": "bsd-3-clause",
"hash": -6634795436473819000,
"line_mean": 47.3343558282,
"line_max": 120,
"alpha_frac": 0.576061433,
"autogenerated": false,
"ratio": 4.27018970189701... |
#!/bin/python
import subprocess
from subprocess import call
import matplotlib as mpl
mpl.use('Agg')
import matplotlib.pyplot as plt
from matplotlib.backends.backend_pdf import PdfPages
import numpy as np
import sys
import os
import MySQLdb
from datetime import datetime
if len(sys.argv) == 1:
print("\n############... | {
"repo_name": "benjamin-cogne/Exome_pipeline",
"path": "Python_package.py",
"copies": "1",
"size": "22219",
"license": "mit",
"hash": -8037931847673131000,
"line_mean": 38.6060606061,
"line_max": 586,
"alpha_frac": 0.4887708718,
"autogenerated": false,
"ratio": 3.3875590791279158,
"config_test"... |
#!/bin/python
import subprocess
import matplotlib as mpl
mpl.use('Agg')
import matplotlib.pyplot as plt
import numpy as np
import sys
import os
### Need one argument: the path of the folder with hist.txt files generated by " bedtools covergae ... | grep 'all' "
fig = plt.figure(1)
ax = plt.subplot(111)
for file in... | {
"repo_name": "benjamin-cogne/Exome_pipeline",
"path": "python/Multiple_exome_plot.py",
"copies": "1",
"size": "1203",
"license": "mit",
"hash": -3473597100810794000,
"line_mean": 24.5957446809,
"line_max": 118,
"alpha_frac": 0.608478803,
"autogenerated": false,
"ratio": 2.6556291390728477,
"co... |
#!/bin/python
import subprocess
import shlex
def run_command(command, pipe_in=''):
'''
Run command and return its output by optionally piping in pipe_in.
Same as
command < pipe_in.txt
where pipe_in.txt contains pipe_in. If no pipe_in is
specified, or pipe_in is '', then just run the comma... | {
"repo_name": "riceissa/ssg-riceissa.com",
"path": "barebones_ssg/commands.py",
"copies": "1",
"size": "1574",
"license": "bsd-2-clause",
"hash": 7345542677962081000,
"line_mean": 30.48,
"line_max": 70,
"alpha_frac": 0.5552731893,
"autogenerated": false,
"ratio": 4.300546448087432,
"config_test... |
#!/bin/python
import subprocess
import shutil
import shlex
def vlc_play(vid):
print(vid)
if vid['VideoFile'] is None:
return
cmd = shutil.which('vlc') + ' --fullscreen --play-and-exit'
if list(vid['VideoFile']) != vid['VideoFile']:
vids = [vid['VideoFile']]
subfs = [vid['SubtitleFile']]
subts = [vid['Subt... | {
"repo_name": "Ben0mega/VideoViewer",
"path": "play.py",
"copies": "1",
"size": "1125",
"license": "mit",
"hash": -4934250556790965000,
"line_mean": 22.4375,
"line_max": 70,
"alpha_frac": 0.6373333333,
"autogenerated": false,
"ratio": 2.6041666666666665,
"config_test": false,
"has_no_keywords... |
#!/bin/python
import subprocess
import sys
import io
import os
import json
to_resolve_path = sys.argv[1]
dest_repo_path = sys.argv[2]
##load all snapshosts to merge
#list snapshots in to_resolve
p = subprocess.Popen(['hdfs', 'dfs', '-ls', to_resolve_path], stdout=subprocess.PIPE) #, shell=True
(output, err) = p.com... | {
"repo_name": "andybab/OfflineESIndexGenerator",
"path": "arange_snapshosts.py",
"copies": "1",
"size": "3517",
"license": "apache-2.0",
"hash": 499237199541525200,
"line_mean": 39.4252873563,
"line_max": 174,
"alpha_frac": 0.6565254478,
"autogenerated": false,
"ratio": 3.2444649446494465,
"con... |
#!/bin/python
import sys, csv, os, imp, pickle
from settings import *
from completeness.statlib import stats
from decimal import Decimal
import doctest
BOOKMARK = 'completeness/bookmark.pickle'
def success_rate(year):
f = open('completeness/output/%d.pickle' % year, 'r')
obj = pickle.load(f)
f.close()
... | {
"repo_name": "sunlightlabs/clearspending",
"path": "completeness/__init__.py",
"copies": "1",
"size": "9711",
"license": "bsd-3-clause",
"hash": 749353592290126000,
"line_mean": 34.1847826087,
"line_max": 178,
"alpha_frac": 0.5350633302,
"autogenerated": false,
"ratio": 3.9,
"config_test": tru... |
#!/bin/python
import sys, getopt, purestorage, json
def usage():
print '{} [ -a | --array ] <array_name> [ -p | --password ] <api token> [ -f | --function ] <function name> [-v | --verbose]'.format(sys.argv[0])
print 'where <function name> can be:'
print ' list_luns [-l | --lun_name] <comma separated li... | {
"repo_name": "PureStorage-OpenConnect/python-scripts",
"path": "rest_interface.py",
"copies": "1",
"size": "12346",
"license": "apache-2.0",
"hash": 4941678728553857000,
"line_mean": 40.569023569,
"line_max": 172,
"alpha_frac": 0.5689292078,
"autogenerated": false,
"ratio": 3.5466819879345017,
... |
#!/bin/python
import sys
from math import sqrt
K, N = raw_input().strip().split(' ')
K, N = [int(K), int(N)]
R = map(int, raw_input().strip().split(' '))
x = []
score = 0
for x_i in xrange(N):
x_temp = map(int, raw_input().strip().split(' '))
if x_temp[0] == 0 and x_temp[1] == 0:
#print K
scor... | {
"repo_name": "spradeepv/dive-into-python",
"path": "hackerrank/contests/week-18/target.py",
"copies": "1",
"size": "1216",
"license": "mit",
"hash": 4562009256999252500,
"line_mean": 26.6363636364,
"line_max": 66,
"alpha_frac": 0.4638157895,
"autogenerated": false,
"ratio": 3.251336898395722,
... |
#!/bin/python
import sys
from PyQt4.QtCore import pyqtSlot, SIGNAL,SLOT, pyqtSignal
from PyQt4.QtCore import QThread
from PyQt4.QtGui import *
from injector_lib import *
from module_rst import Module_RST
from module_dos import Module_DoS
import module_run_script
from module_run_script import Module_Run_Script
class M... | {
"repo_name": "LascaTorbot/injector_gui",
"path": "injector_gui.py",
"copies": "1",
"size": "5555",
"license": "mit",
"hash": 3404663008661615600,
"line_mean": 26.9145728643,
"line_max": 98,
"alpha_frac": 0.6365436544,
"autogenerated": false,
"ratio": 3.4332509270704574,
"config_test": false,
... |
#!/bin/python
import sys
if sys.version_info[0] < 3:
from StringIO import StringIO
else:
from io import StringIO
import pandas as pd
import requests
# PUG URL Prolog
PROLOG = "https://pubchem.ncbi.nlm.nih.gov/rest/pug"
# default encoding for strings
ENCODING = "utf-8"
# Don't report errors
SILENT = False
... | {
"repo_name": "KU-CCB/PyPUG",
"path": "pypug.py",
"copies": "1",
"size": "8083",
"license": "apache-2.0",
"hash": -4191566335516070400,
"line_mean": 32.9621848739,
"line_max": 134,
"alpha_frac": 0.6161078807,
"autogenerated": false,
"ratio": 3.518937744884632,
"config_test": false,
"has_no_ke... |
#!/bin/python
import sys
import codecs
msg ="""Hi {name},
Your talk \"{title}\" has been accepted for SoCal PLS Fall 2015 at Pomona College on Saturday, December 5th, 2015. We'll post a schedule shortly, but if you have any scheduling needs, please let us know as soon as you can. We apologize for the late notice, an... | {
"repo_name": "SoCalPLS/SoCalPLS.github.io",
"path": "archive/emails/accept.py",
"copies": "1",
"size": "1187",
"license": "mit",
"hash": -4801470752598013000,
"line_mean": 30.2368421053,
"line_max": 288,
"alpha_frac": 0.6571187869,
"autogenerated": false,
"ratio": 3.1485411140583555,
"config_t... |
#!/bin/python
import sys
import commands
def dPrint(line):
print(line);
return 0;
def execCommand(command):
result = commands.getstatusoutput(command)
if result[0] != 0:
print("Error occured while executing system command %s " % command);
print("status= %d:" % result[0])
print("error = %s:" % res... | {
"repo_name": "treecode/Bonsai",
"path": "tools/tarScripts/sortSnapshots.py",
"copies": "1",
"size": "2193",
"license": "apache-2.0",
"hash": -8072457497158220000,
"line_mean": 19.8857142857,
"line_max": 72,
"alpha_frac": 0.6155950752,
"autogenerated": false,
"ratio": 3.1553956834532375,
"confi... |
#!/bin/python
import sys
import csv
import cgi
import operator
#html escape function stolen from http://stackoverflow.com/questions/2077283/substitute-special-characters-with-html-entities-in-python
def escape(t): return (t.replace("&", "&").replace("<", "<").replace(">", ">").replace("'", "'").replace(... | {
"repo_name": "manosai/tweepy",
"path": "visualize_data.py",
"copies": "1",
"size": "6181",
"license": "mit",
"hash": 5876652023958151000,
"line_mean": 36.0119760479,
"line_max": 135,
"alpha_frac": 0.6379226662,
"autogenerated": false,
"ratio": 2.7289183222958058,
"config_test": false,
"has_n... |
#!/bin/python
import sys
import csv
import json
import urllib2
from label_map import mturk_labels
import numpy as np
import matplotlib.pyplot as plt
class EMGrader():
"""
Implements EM quality estimation using Troia server.
estimate_data_labels returns the MLE estimates for the labels on each tweet
estimate_work... | {
"repo_name": "manosai/tweepy",
"path": "assignment_4/troia_em_template.py",
"copies": "1",
"size": "6471",
"license": "mit",
"hash": 41543779018218830,
"line_mean": 38.7055214724,
"line_max": 125,
"alpha_frac": 0.6617215268,
"autogenerated": false,
"ratio": 2.9820276497695852,
"config_test": f... |
#!/bin/python
import sys
import dbus
import argparse
parser = argparse.ArgumentParser()
parser.add_argument(
'-t',
'--trunclen',
type=int,
metavar='trunclen'
)
parser.add_argument(
'-f',
'--format',
type=str,
metavar='custom format',
dest='custom_format'
)
parser.add_argument(
... | {
"repo_name": "Vorago/dotfiles",
"path": "home/.config/polybar/spotify.py",
"copies": "2",
"size": "2152",
"license": "mit",
"hash": 72762326320952800,
"line_mean": 22.3913043478,
"line_max": 86,
"alpha_frac": 0.6273234201,
"autogenerated": false,
"ratio": 3.4050632911392404,
"config_test": fal... |
#!/bin/python
import sys
import dbus
import argparse
parser = argparse.ArgumentParser()
parser.add_argument(
'-t',
'--trunclen',
type=int,
metavar='trunclen'
)
parser.add_argument(
'-f',
'--format',
type=str,
metavar='custom format',
dest='custom_format'
)
parser.add_argument(
... | {
"repo_name": "naegi/dotfiles",
"path": "scripts/scripts/spotify_status.py",
"copies": "1",
"size": "3404",
"license": "unlicense",
"hash": -6983061917711354000,
"line_mean": 24.7878787879,
"line_max": 90,
"alpha_frac": 0.6286721504,
"autogenerated": false,
"ratio": 3.4383838383838383,
"config_... |
#!/bin/python
import sys
import json
from collections import OrderedDict
def main():
probe_ring_map = OrderedDict()
probe_mux_map = OrderedDict()
with open('multiplexer-probe-map.md') as f:
mux_id = None
probe_id = None
chan_id = None
for line in f.read().split('\n'... | {
"repo_name": "g2-field-team/field-daq",
"path": "common/scripts/gen-fxpr-sequence/gen-nmr-sequence.py",
"copies": "1",
"size": "2973",
"license": "mit",
"hash": -4098298812707439000,
"line_mean": 25.0789473684,
"line_max": 69,
"alpha_frac": 0.4702320888,
"autogenerated": false,
"ratio": 3.526690... |
#!/bin/python
import sys
import json
import re
import struct
import os
input = sys.stdin
def getHashSize(physicalSize, metadata):
size = physicalSize
if ('meta' in metadata):
size = min(size, metadata['meta']['size'])
return size
def getPath(metadata):
name = metadata['name']['name']
return metadata['... | {
"repo_name": "jonstewart/fsrip",
"path": "extract.py",
"copies": "1",
"size": "1095",
"license": "apache-2.0",
"hash": 6739030537148784000,
"line_mean": 22.8043478261,
"line_max": 109,
"alpha_frac": 0.6374429224,
"autogenerated": false,
"ratio": 3.2111436950146626,
"config_test": false,
"has... |
#/bin/python
import sys
import math
# set your tabs widths here
tabwidth = 4
# function to count how many tabwidths a word plus a space is
# used to calculate how wide a column should be
def countTabs(word):
return int(math.ceil(float(len(word) + 1) / float(tabwidth)))
# only run if this is the main
if __name__... | {
"repo_name": "hoylemd/scripts",
"path": "py/formatSqlOutput.py",
"copies": "1",
"size": "1635",
"license": "mit",
"hash": 8803284991243028000,
"line_mean": 25.8032786885,
"line_max": 81,
"alpha_frac": 0.5229357798,
"autogenerated": false,
"ratio": 4.291338582677166,
"config_test": false,
"ha... |
#!/bin/python
import sys
import os
from warnings import warn
import capnp
import STEventTraceCompressed_capnp
def processSTEventTrace(file):
for stream in (STEventTraceCompressed_capnp.EventStreamCompressed
.read_multiple_packed(file, traversal_limit_in_words=2**63)):
for event in stre... | {
"repo_name": "mdlui/Sigil2",
"path": "src/Backends/SynchroTraceGen/scripts/stgen_capnp_parser_compressed.py",
"copies": "3",
"size": "3076",
"license": "bsd-3-clause",
"hash": 5419101114523342000,
"line_mean": 40.5675675676,
"line_max": 80,
"alpha_frac": 0.4996749025,
"autogenerated": false,
"ra... |
#!/bin/python
import sys
import os
from warnings import warn
import capnp
import STEventTraceUncompressed_capnp
def processSTEventTrace(file):
for stream in (STEventTraceUncompressed_capnp.EventStreamUncompressed
.read_multiple_packed(file, traversal_limit_in_words=2**63)):
for event i... | {
"repo_name": "mdlui/Sigil2",
"path": "src/Backends/SynchroTraceGen/scripts/stgen_capnp_parser_uncompressed.py",
"copies": "3",
"size": "2692",
"license": "bsd-3-clause",
"hash": 1405689105741051100,
"line_mean": 38.0144927536,
"line_max": 80,
"alpha_frac": 0.4981426449,
"autogenerated": false,
"... |
#!/bin/python
import sys
import os
import argparse
import re
import glob
from collections import Iterable
assert sys.version_info >= (3, 0)
def flatten(items):
"""Yield items from any nested iterable; see Reference."""
for x in items:
if isinstance(x, Iterable) and not isinstance(x, (str, bytes)):
... | {
"repo_name": "gabyx/ExecutionGraph",
"path": "tools/correctFlatBufferSchemaIncludes.py",
"copies": "1",
"size": "2966",
"license": "mpl-2.0",
"hash": -8034470776228403000,
"line_mean": 26.9905660377,
"line_max": 84,
"alpha_frac": 0.5714767363,
"autogenerated": false,
"ratio": 4.040871934604905,
... |
#!/bin/python
import sys
import os
import libtorrent
if len(sys.argv) < 3:
print 'usage make_torrent.py file tracker-url'
sys.exit(1)
input = os.path.abspath(sys.argv[1])
fs = libtorrent.file_storage()
#def predicate(f):
# print f
# return True
#libtorrent.add_files(fs, input, predicate)
parent_input = os.path.... | {
"repo_name": "mildred/rasterbar-libtorrent",
"path": "bindings/python/make_torrent.py",
"copies": "19",
"size": "1175",
"license": "bsd-3-clause",
"hash": -7131695921338795000,
"line_mean": 21.1698113208,
"line_max": 77,
"alpha_frac": 0.669787234,
"autogenerated": false,
"ratio": 2.6704545454545... |
#!/bin/python
import sys
import os
import os.path
import optparse
import re
from urlparse import urlparse
import urllib2
import base64
MVN_DOWNLOAD_RE = re.compile(r'\[INFO\] Downloaded: ([^\n]*) \(([^\n]*) ([K]?B) at ([^\n]*) KB\/sec\)')
def calculate(url, username = None, password = None):
result = {}
f = No... | {
"repo_name": "gaol/maven-repository-extension",
"path": "mvntime.py",
"copies": "1",
"size": "3087",
"license": "apache-2.0",
"hash": -5546739273629228000,
"line_mean": 36.6463414634,
"line_max": 183,
"alpha_frac": 0.6232588273,
"autogenerated": false,
"ratio": 3.4186046511627906,
"config_test... |
#!/bin/python
import sys
import os
import subprocess
debug=0
def check_setup():
cmd = './setup.sh'
status = subprocess.call(cmd, shell=True)
if status == 1:
print("check_setup: error")
sys.exit(0)
def prompt_sudo():
ret = 0
if os.geteuid() != 0:
args = [sys.executable] +... | {
"repo_name": "waterdrinker/gblog",
"path": "test/run.py",
"copies": "1",
"size": "2457",
"license": "mit",
"hash": -6307862404802613000,
"line_mean": 25.4193548387,
"line_max": 93,
"alpha_frac": 0.5795685796,
"autogenerated": false,
"ratio": 3.6238938053097347,
"config_test": false,
"has_no_... |
#!/bin/python
import sys
import os
import subprocess
import getopt
def validateFeatureParamFiles(fname):
required = set("RNA")
patient_map = {}
feature_warnings = []
f = open(fname)
#header
f.readline()
errors = []
for line in f:
line = line.strip()
items = ... | {
"repo_name": "DCGenomics/hackathon_v001_epigenomics",
"path": "pipeline_top.py",
"copies": "2",
"size": "3244",
"license": "cc0-1.0",
"hash": 5734417736512130000,
"line_mean": 22.345323741,
"line_max": 112,
"alpha_frac": 0.5631935882,
"autogenerated": false,
"ratio": 3.8209658421672557,
"confi... |
#!/bin/python
import sys
import random
from itertools import product
import time
def miller_rabin_pass(a, s, d, n):
a_to_power = pow(a, d, n)
if a_to_power == 1:
return True
for i in xrange(s-1):
if a_to_power == n - 1:
return True
a_to_power = (a_to_power * a_to_power)... | {
"repo_name": "bicepjai/Puzzles",
"path": "hackerrank/2017/w29/megaprime/megaprime.py",
"copies": "2",
"size": "3469",
"license": "bsd-3-clause",
"hash": 6330422687828795000,
"line_mean": 24.8880597015,
"line_max": 95,
"alpha_frac": 0.4992793312,
"autogenerated": false,
"ratio": 3.348455598455598... |
#!/bin/python
import sys
import re
import Tkinter as tk
from ScrolledText import ScrolledText
import subprocess
import time
def convertToUserFriendly(line):
line = line.replace("--- /dev/null", "[New file]")
line = line.replace("diff --git a/", "File: ")
return line + "\n"
def parseDiffText(diffText):
... | {
"repo_name": "heliosbryan/pet-projects",
"path": "python/diff-viewer/diffViewer.py",
"copies": "1",
"size": "4636",
"license": "mit",
"hash": 4022664329329967000,
"line_mean": 26.4378698225,
"line_max": 76,
"alpha_frac": 0.5923209664,
"autogenerated": false,
"ratio": 3.996551724137931,
"config... |
#! /bin/python
import sys
import re
import tokenizers
# Script
expressions = [{
'regex': re.compile('\s*(\w(?:(?:\w|\d)+)?)\s+(\w(?:(?:\w|\d)+)?)\s*=(.+?);\s*'),
'tokenizer': tokenizers.AttributionExpression
}, {
'regex': re.compile('\s*(\w(?:(?:\w|\d)+)?)\s+(\w(?:(\w|\d)+)?)\s*;\s*'),
'tokenizer': to... | {
"repo_name": "Psidium/tradutores-ga",
"path": "tradutor_lexico.py",
"copies": "1",
"size": "2203",
"license": "mit",
"hash": -7725970017741800000,
"line_mean": 25.2261904762,
"line_max": 94,
"alpha_frac": 0.5705855651,
"autogenerated": false,
"ratio": 3.4102167182662537,
"config_test": false,
... |
#!bin/python
import sys
import smtplib
from email.mime.multipart import MIMEMultipart
from email.mime.text import MIMEText
from db import *
import datetime
from settings import okko_report_from, okko_report_to, okko_smtp_passwd, okko_smtp_server, okko_smtp_server_port, okko_smtp_ssl
DATE_FMT='%Y-%m-%d'
def get_wat... | {
"repo_name": "rdl-telecom/billing",
"path": "okko_report.py",
"copies": "1",
"size": "2622",
"license": "unlicense",
"hash": -4692420194423461000,
"line_mean": 33.0519480519,
"line_max": 127,
"alpha_frac": 0.6094584287,
"autogenerated": false,
"ratio": 3.055944055944056,
"config_test": false,
... |
#!/bin/python
import sys
import time
import logging
from watchdog.observers import Observer
from watchdog.events import LoggingEventHandler, FileSystemEventHandler
import subprocess
if __name__ == "__main__":
logging.basicConfig(level=logging.INFO,
format='%(asctime)s - %(message)s',
... | {
"repo_name": "timblack1/rcl",
"path": "node_changes_listeners/watch.py",
"copies": "2",
"size": "1127",
"license": "bsd-3-clause",
"hash": 4326823681365501400,
"line_mean": 32.1764705882,
"line_max": 88,
"alpha_frac": 0.6184560781,
"autogenerated": false,
"ratio": 3.8203389830508474,
"config_t... |
#!/bin/python
import sys
import urllib2
import xml.etree.cElementTree as ElementTree
import simplejson as json
import datetime
import StringIO
import gzip
import time
import calendar
import math
import pprint
# Parse the diff and write out a simplified version
class OscHandler():
def __init__(self):
self.change... | {
"repo_name": "iandees/osm-stream-process",
"path": "update.py",
"copies": "1",
"size": "6729",
"license": "mit",
"hash": 8940166244959676000,
"line_mean": 31.8243902439,
"line_max": 119,
"alpha_frac": 0.6296626542,
"autogenerated": false,
"ratio": 3.5065138092756643,
"config_test": false,
"h... |
#!/bin/python
import sys
import urllib.request
from bs4 import BeautifulSoup
import re
target_url = sys.argv[1]
print(target_url, file=sys.stderr)
ieee = "http://ieeexplore.ieee.org"
content = urllib.request.urlopen(target_url).read()
#print(content, file=sys.stderr)
parser = BeautifulSoup(content)
items = parser.fi... | {
"repo_name": "ningchi/ningchi-tools",
"path": "script/ieeeabstract.py",
"copies": "1",
"size": "1090",
"license": "mit",
"hash": 5890237516922206000,
"line_mean": 26.9487179487,
"line_max": 67,
"alpha_frac": 0.6458715596,
"autogenerated": false,
"ratio": 2.9700272479564034,
"config_test": fals... |
#!/bin/python
import sys
def main(files):
for file_name in files:
game = 0
white_wins = 0
black_wins = 0
draws = 0
number_of_moves = 0
time = 0
white_time_left = 0
black_time_left = 0
with open(file_name) as f, open(file_name + '_plots.txt', ... | {
"repo_name": "MarkZH/Genetic_Chess",
"path": "analysis/win_lose_draw_plots.py",
"copies": "1",
"size": "4298",
"license": "mit",
"hash": -667446097854192300,
"line_mean": 44.2421052632,
"line_max": 90,
"alpha_frac": 0.3341088879,
"autogenerated": false,
"ratio": 5.440506329113924,
"config_test... |
#!/bin/python
import sys
def main(gene_pool_file_name):
# Read gene file for gene names
header_line = []
current_gene = ''
with open(gene_pool_file_name) as f:
for line in f:
line = line.strip()
if not line:
continue
if ':' in line:
... | {
"repo_name": "MarkZH/Genetic_Chess",
"path": "analysis/gene_pool_analyze.py",
"copies": "1",
"size": "2300",
"license": "mit",
"hash": -1899953516912991000,
"line_mean": 33.8484848485,
"line_max": 105,
"alpha_frac": 0.4326086957,
"autogenerated": false,
"ratio": 4.581673306772909,
"config_test... |
#!/bin/python
import sys
def parse_args():
if len(sys.argv) < 2:
print "Usage: {0} N, where N is the number of rotations to be made".format(sys.argv[0])
print "[+] Using default value of N = 13"
return 13
else:
x = int(sys.argv[1]) % 256
if x < 1:
print "[-]... | {
"repo_name": "abatchy17/SLAE",
"path": "Assignment 4/RotnGen.py",
"copies": "1",
"size": "1068",
"license": "mit",
"hash": 6069745741883149000,
"line_mean": 27.1052631579,
"line_max": 143,
"alpha_frac": 0.5833333333,
"autogenerated": false,
"ratio": 2.656716417910448,
"config_test": false,
"... |
#!/bin/python
import sys
def parseRefGene(fname):
f = open(fname)
for line in f:
line = line.strip()
items = line.split("\t")
yield items
f.close()
def gene_id(rec):
return rec[1]
def chrom(rec):
return rec[2]
def start(rec):
return int(rec[4])
def end(rec):
... | {
"repo_name": "NCBI-Hackathons/hackathon_v001_epigenomics",
"path": "generateRegions.py",
"copies": "2",
"size": "2197",
"license": "cc0-1.0",
"hash": -3287807523842858000,
"line_mean": 19.7358490566,
"line_max": 57,
"alpha_frac": 0.5448338644,
"autogenerated": false,
"ratio": 3.264487369985141,
... |
#!/bin/python
import sys
g_counts = 10
prefix = """/*
{0}
This file autogenerated. Do not modify, as all modifications will be overwritten.
*/
#ifndef __JINI_{1}__
#define __JINI_{1}__
namespace jni {2}
"""
class_prefix = """ {2}
class {1}<{3}>: public MethodBase< {1}<{3}> >
{0}
public:
typedef MethodBase... | {
"repo_name": "mbits-os/jini",
"path": "tools/jini.py",
"copies": "1",
"size": "7048",
"license": "mit",
"hash": 897293093251661400,
"line_mean": 26.3178294574,
"line_max": 114,
"alpha_frac": 0.5295119183,
"autogenerated": false,
"ratio": 3.149240393208222,
"config_test": false,
"has_no_keywo... |
#!/bin/python
import sys
if len(sys.argv) < 2:
print("USAGE: makejson.py [prefix]")
sys.exit()
else:
PREFIX = sys.argv[1]
import csv
def rows(file):
with open(file) as csvfile:
return list(csv.reader(csvfile))
with open(PREFIX + ".names.csv") as namefile:
NAMES = [line[3:-1] for line in... | {
"repo_name": "jackfirth/herbie",
"path": "herbie/compile/makejson.py",
"copies": "1",
"size": "1029",
"license": "mit",
"hash": 8259673757372773000,
"line_mean": 25.3846153846,
"line_max": 94,
"alpha_frac": 0.6005830904,
"autogenerated": false,
"ratio": 2.842541436464088,
"config_test": false,... |
#!/bin/python
import sys
n1,n2,n3 = raw_input().strip().split(' ')
n1,n2,n3 = [int(n1),int(n2),int(n3)]
h1 = map(int,raw_input().strip().split(' '))
h2 = map(int,raw_input().strip().split(' '))
h3 = map(int,raw_input().strip().split(' '))
h1.reverse()
h2.reverse()
h3.reverse()
s1,s2,s3 = [],[],[]
sum1,sum2,sum3 = 0,0... | {
"repo_name": "PlattsSEC/HackerRank",
"path": "algorithms/equal_stacks/prithaj.py",
"copies": "1",
"size": "1250",
"license": "mit",
"hash": -7181915412753055000,
"line_mean": 21.3392857143,
"line_max": 66,
"alpha_frac": 0.528,
"autogenerated": false,
"ratio": 2.5614754098360657,
"config_test":... |
#!/bin/python
import sys
# Lily has a chocolate bar consisting of a row of squares where each square has an integer written on it. She wants to share it with Ron for his birthday, which falls on month and day . Lily only wants to give Ron a piece of chocolate if it contains consecutive squares whose integers sum ... | {
"repo_name": "isendel/algorithms",
"path": "algorithms/prefix_sums/birthday_cake.py",
"copies": "1",
"size": "1027",
"license": "apache-2.0",
"hash": 8863433401869276000,
"line_mean": 33.2333333333,
"line_max": 296,
"alpha_frac": 0.6387536514,
"autogenerated": false,
"ratio": 3.1310975609756095,... |
#!/bin/python
import sys
####### Programme pour mise en forme des gènes ciblés pour l'exome depuis ucsc table browser #######
##### Nécessite 3 arguments: 1) les transcripts canoniques obtenus à partir du table browser de ucsc
###### 2) L'intersection entre le bed obtenu sur ucsc table browser ... | {
"repo_name": "benjamin-cogne/Exome_pipeline",
"path": "python/Gene_exon_coord.py",
"copies": "1",
"size": "3459",
"license": "mit",
"hash": -8771787881078561000,
"line_mean": 48.7246376812,
"line_max": 217,
"alpha_frac": 0.6452929175,
"autogenerated": false,
"ratio": 2.627105666156202,
"config... |
#!/bin/python
import sys
T = int(raw_input().strip())
for a0 in xrange(T):
n = int(raw_input().strip())
q = map(int,raw_input().strip().split(' '))
# your code goes here
numberOfBribes = 0
numberOfBribesAnIndividualCanAfford = 2 #stated in question
for i in xrange(len(q) - 1, 0, -1):
# immed... | {
"repo_name": "blaise-zaga/hackerrank",
"path": "Algorithms/Implementation/NewYearChaos.py",
"copies": "1",
"size": "1189",
"license": "mit",
"hash": -211877538465735420,
"line_mean": 27.3095238095,
"line_max": 74,
"alpha_frac": 0.6038687973,
"autogenerated": false,
"ratio": 3.248633879781421,
... |
#!/bin/python
import sys, os
import subprocess
def get_info():
cmd = subprocess.Popen( ['mocp -i'],stdout=subprocess.PIPE, stderr=subprocess.PIPE,shell=True, close_fds=True)
stdout, stderr = cmd.communicate()
if cmd.returncode:
errmsg = stderr.strip()
if 'server is not running' in errmsg:... | {
"repo_name": "hebecked/my-conky-backup",
"path": ".conky/mocp_info.py",
"copies": "2",
"size": "2284",
"license": "mit",
"hash": -325527652652298560,
"line_mean": 35.253968254,
"line_max": 131,
"alpha_frac": 0.573117338,
"autogenerated": false,
"ratio": 3.5410852713178294,
"config_test": false... |
#! /bin/python
import sys, os, pwd, string
############################################################################
# Object class
############################################################################
# Object Class
class Object:
"""a request object (corresponds to an Object Element in SSSRMAP)"""
# ... | {
"repo_name": "anderbubble/gold",
"path": "lib/sssrmap.py",
"copies": "1",
"size": "20819",
"license": "bsd-3-clause",
"hash": -608646646380458600,
"line_mean": 22.9298850575,
"line_max": 215,
"alpha_frac": 0.5801911715,
"autogenerated": false,
"ratio": 4.079757005682931,
"config_test": false,
... |
#!/bin/python
import sys, socket
from select import select
from threading import Thread
# Connect two terminals to send UDP msgs to each other
# -p the port in which the host(which is you) allows for the client to connect to
# -c the client ip:port which you want to connect to
#python connection.py -c 127.0.0.1:5001 ... | {
"repo_name": "yellokrow/P2P_RelayServer",
"path": "connection.py",
"copies": "1",
"size": "3419",
"license": "mit",
"hash": -5986869677295513000,
"line_mean": 26.1349206349,
"line_max": 109,
"alpha_frac": 0.5861362972,
"autogenerated": false,
"ratio": 3.732532751091703,
"config_test": false,
... |
#!/bin/python
import sys, subprocess, os, re, codecs, shutil, mimetypes
def replace(text, args):
result = text
index = 0
for a in args:
index = index + 1
pattern = "\$\{" + str(index) + "\}"
while(re.search(pattern, result)):
result = re.sub(pattern, a, result)
return result
def handle_codec(path, arg... | {
"repo_name": "toolr/startr",
"path": "python/startr.py",
"copies": "1",
"size": "1550",
"license": "bsd-2-clause",
"hash": -4554141977529902600,
"line_mean": 20.5416666667,
"line_max": 102,
"alpha_frac": 0.6167741935,
"autogenerated": false,
"ratio": 2.714535901926445,
"config_test": false,
... |
#!/bin/python
import threading
import time
import sys
import getopt
#--------------------------------------------------------------
# parameters
#--------------------------------------------------------------
# Times
tps_reflex = 1000 # Reflex trigger
# Droplets : (delay with last droplet, size of the droplet)
d... | {
"repo_name": "leahpar/RainDrop",
"path": "src/rd.py",
"copies": "1",
"size": "5066",
"license": "mit",
"hash": -7833204084301130000,
"line_mean": 24.5707070707,
"line_max": 100,
"alpha_frac": 0.5367153573,
"autogenerated": false,
"ratio": 3.2874756651524986,
"config_test": false,
"has_no_key... |
#!/bin/python
import _thread
import datetime
import glob
import logging
import math
import multiprocessing
import os
import textwrap
import wx
from lactransformer.libs import Logging, FileListWithProjection, TransformerWorkflow
from lactransformer.libs import supported_projections
SUPPORTED_FILETYPES = 'LAS Point C... | {
"repo_name": "KAMI911/lactransformer",
"path": "lactransformer/gui/test.py",
"copies": "1",
"size": "16575",
"license": "mpl-2.0",
"hash": -7841902603953107000,
"line_mean": 39.6274509804,
"line_max": 238,
"alpha_frac": 0.625158371,
"autogenerated": false,
"ratio": 3.6981258366800533,
"config_... |
#!/bin/python
import time
import datetime
import csv
import sys
from Adafruit_BME280 import *
sys.stdout.flush()
sensor = BME280(t_mode=BME280_OSAMPLE_8, p_mode=BME280_OSAMPLE_8, h_mode=BME280_OSAMPLE_8)
file_time= time.strftime("%Y-%m-%d_%H-%M-%S", time.gmtime())
filename = "weather_test_results_"+file_time+".csv"... | {
"repo_name": "bearing/dosenet-raspberrypi",
"path": "weather_test.py",
"copies": "2",
"size": "1311",
"license": "mit",
"hash": 2355450185512691700,
"line_mean": 28.7954545455,
"line_max": 134,
"alpha_frac": 0.6559877956,
"autogenerated": false,
"ratio": 2.7716701902748415,
"config_test": fals... |
#!/bin/python
import time
import datetime
from kivy.app import App
from kivy.clock import Clock
from kivy.properties import StringProperty
from kivy.properties import NumericProperty
from kivy.uix.widget import Widget
from kivy.uix.floatlayout import FloatLayout
from kivy.graphics import *
class SecondsIndicator(Wi... | {
"repo_name": "dwalker0044/KivyDigitalClock",
"path": "main.py",
"copies": "1",
"size": "1494",
"license": "mit",
"hash": 4592193187968789000,
"line_mean": 21.6363636364,
"line_max": 71,
"alpha_frac": 0.6459170013,
"autogenerated": false,
"ratio": 3.830769230769231,
"config_test": false,
"has... |
#!/bin/python
import unittest
from util import Logger
from kdbplus_client import KdbPlusClient
class SqliteClientTest(unittest.TestCase):
@classmethod
def setUpClass(cls):
cls.db_client = KdbPlusClient()
cls.db_client.connect(host='localhost', port=5000)
@classmethod
def tearDownClass... | {
"repo_name": "Aurora-Team/BitcoinExchangeFH",
"path": "befh/test/test_kdbplus_client.py",
"copies": "1",
"size": "6062",
"license": "apache-2.0",
"hash": -8107564526088635000,
"line_mean": 36.4197530864,
"line_max": 101,
"alpha_frac": 0.5722533817,
"autogenerated": false,
"ratio": 3.236518953550... |
#!/bin/python
import unittest
import logging
import os
from src.user_interface import user_interface
class config_test(unittest.TestCase):
def test_constructor(self):
ui = user_interface('TeleXTest',
'TeleXHelpChannel',
os.path.abspath(__file__+ "/... | {
"repo_name": "gavincyi/Telex",
"path": "test/user_interface_test.py",
"copies": "1",
"size": "1527",
"license": "apache-2.0",
"hash": 903510866374666200,
"line_mean": 40.2972972973,
"line_max": 111,
"alpha_frac": 0.5782580223,
"autogenerated": false,
"ratio": 4.35042735042735,
"config_test": t... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.