text stringlengths 0 1.05M | meta dict |
|---|---|
#!/bin/python3
enum = {}
previousValue = None
def parse(line):
global previousValue
line = line.strip()
if len(line) == 0:
return None, None
id = line.find("//")
if id != -1:
line = line[:id]
line = line.strip()
line = line[:-1]
line = line.split("=")
line[0] = line... | {
"repo_name": "RavenX8/osIROSE-new",
"path": "src/findenum.py",
"copies": "1",
"size": "1266",
"license": "apache-2.0",
"hash": 3269135541981214700,
"line_mean": 24.8367346939,
"line_max": 56,
"alpha_frac": 0.5023696682,
"autogenerated": false,
"ratio": 3.5069252077562325,
"config_test": false,... |
# !/bin/python3
####################### Example ###############################################
#def rootMethod(b):
# return b
#def lower10(val):
# if val < 10:
# return (True, val)
# return (False, val)
#def greater10(val):
# if val > 10:
# return (True, val)
# return (False, val)
#def ... | {
"repo_name": "KHP-Informatics/sleepsight-analytics",
"path": "tools/tree.py",
"copies": "1",
"size": "2717",
"license": "apache-2.0",
"hash": 7862752816503016000,
"line_mean": 28.5326086957,
"line_max": 90,
"alpha_frac": 0.5351490615,
"autogenerated": false,
"ratio": 3.8,
"config_test": false,... |
#!/bin/python3
""" Fibonacci number generation
The program takes an input N from the command line
It uses a non-recursive technique to generate the value of N
Checks for conditions mentioned in the coding challenge.
"""
import math
import sys
def is_prime(n):
""" Checks if F(n) is prime. Returns True if F(n) is ... | {
"repo_name": "sai-y/swift-coding-challenge",
"path": "fibonacci.py",
"copies": "1",
"size": "1372",
"license": "mit",
"hash": 5014802833007081000,
"line_mean": 19.7878787879,
"line_max": 62,
"alpha_frac": 0.500728863,
"autogenerated": false,
"ratio": 3.396039603960396,
"config_test": false,
... |
#!/bin/python3
from aux_fun import *
from array import *
from random import *
from math import *
from ctypes import *
#### Header ####
print(" ")
print(" Greetings.")
print(" This is an SSA for electrochemical systems, developed and implemented")
print(" by Beruski, O. This script follows the description given in:")
... | {
"repo_name": "beruski/ec-ssa",
"path": "Python3/ec_ssa.py",
"copies": "1",
"size": "15833",
"license": "mit",
"hash": -1612355750063526700,
"line_mean": 31.4446721311,
"line_max": 79,
"alpha_frac": 0.4659255984,
"autogenerated": false,
"ratio": 3.0929869115061535,
"config_test": false,
"has_... |
#!/bin/python3
from collections import namedtuple
"""
Given a set of line segments and points, determine how many segs overlap each
point.
naive is n^2.
fast_count is nlogn. Build a sorted list of starts, stops, points, do a scan
keeping a running count of segments, emit counts for each point found.
A fancier imple... | {
"repo_name": "rmsr/misc",
"path": "coursera/algorithmic-toolbox/week4/points_and_segments.py",
"copies": "1",
"size": "1612",
"license": "isc",
"hash": 7948804324102838000,
"line_mean": 27.7857142857,
"line_max": 78,
"alpha_frac": 0.6302729529,
"autogenerated": false,
"ratio": 3.7314814814814814... |
#!/bin/python3
from curses import wrapper
import curses
import os
class Window():
def __init__(self, x, y, w, h, wintype = 0):
self.x = x
self.y = y
self.w = w
self.h = h
self.wintype = wintype
self.win = curses.newwin(h,w,y,x)
self.win.immedok(True)
... | {
"repo_name": "MCSH/xjournal",
"path": "main.py",
"copies": "1",
"size": "4291",
"license": "mit",
"hash": -6851173421705483000,
"line_mean": 26.3312101911,
"line_max": 91,
"alpha_frac": 0.4693544628,
"autogenerated": false,
"ratio": 3.621097046413502,
"config_test": false,
"has_no_keywords":... |
# /bin/python3
from datetime import datetime
import discord
from discord.ext import commands
from discord.ext.commands import ExtensionAlreadyLoaded
import database
import asyncio
import socketio
from dateutil.parser import isoparse
import config
import checks
import logging
from eddn import eddn
intents = discord.... | {
"repo_name": "nisanick/Prisma_Machina",
"path": "bot.py",
"copies": "1",
"size": "6557",
"license": "mit",
"hash": 1249675824853614800,
"line_mean": 31.775,
"line_max": 211,
"alpha_frac": 0.6793287567,
"autogenerated": false,
"ratio": 3.6497772828507795,
"config_test": true,
"has_no_keywords... |
#!bin/python3
from error import error
from database import database
class admin:
def __init__(self):
self.file_name = "out.txt" #the file where the output will be saved
self.commands = {
"help":"Show this message",
"exit":"Quit this program",
"speeders": "Outputs speeders an... | {
"repo_name": "msemple1111/average_alpr",
"path": "admin.py",
"copies": "1",
"size": "3936",
"license": "mit",
"hash": -6350596994077639000,
"line_mean": 52.1891891892,
"line_max": 152,
"alpha_frac": 0.6407520325,
"autogenerated": false,
"ratio": 3.6209751609935603,
"config_test": false,
"has... |
#!./bin/python3
from functools import wraps
from rpc import RTorrentXMLRPCClient
import os
from flask import Flask, g, json, request
from flask_jwt import JWT, jwt_required
app = Flask(__name__)
RTORRENT_XMLRPC_CONFIG_PATH = './cfg/rtorrent-interface.cfg'
#Set this to something long and random, use for json web token
... | {
"repo_name": "lfxgroove/rtorrent-interface",
"path": "rtorrent-interface.py",
"copies": "1",
"size": "3536",
"license": "mit",
"hash": -201007240135869200,
"line_mean": 28.4666666667,
"line_max": 84,
"alpha_frac": 0.6391402715,
"autogenerated": false,
"ratio": 3.433009708737864,
"config_test":... |
#!/bin/python3
from itertools import product
def generate_planning_domain(columns, rows, filename):
print("Inizio la generazione del planning domain.\n")
#~ Inizializzo il dominio di planning
planning_domain = """(define (domain robot)
(:requirements :ekab)\n"""
#~ Genero i predicati per ogni colonna e riga... | {
"repo_name": "stawo/ekabPlanner",
"path": "test/robotProblemGenerator.py",
"copies": "1",
"size": "10804",
"license": "mit",
"hash": -3196294989245976000,
"line_mean": 34.6567656766,
"line_max": 150,
"alpha_frac": 0.6250462792,
"autogenerated": false,
"ratio": 2.500347141865309,
"config_test":... |
#!/bin/python3
from json import load, dump
from copy import deepcopy
import argparse
def parse_arguments():
parser = argparse.ArgumentParser(
description="Copy translations from other db.")
parser.add_argument('--from-file', help='source json files',
metavar='FILE', action=... | {
"repo_name": "molovik/Starbound_RU",
"path": "tools/copy_the_same.py",
"copies": "10",
"size": "1768",
"license": "apache-2.0",
"hash": -6493882908707840000,
"line_mean": 32.358490566,
"line_max": 73,
"alpha_frac": 0.5938914027,
"autogenerated": false,
"ratio": 3.8602620087336246,
"config_test... |
#!/bin/python3
from PIL import Image, ImageOps
cursors = ({
'name': 'arrow',
'offset': (-1, -1),
'clr': (
0xFF, 0xFF, 0x80, 0x01, 0x80, 0x02, 0x80, 0x0C,
0x80, 0x10, 0x80, 0x10, 0x80, 0x08, 0x80, 0x04,
0x80, 0x02, 0x80, 0x01, 0x80, 0x02, 0x8C, 0x04,
... | {
"repo_name": "SametSisartenep/dotfiles",
"path": ".icons/plan9/src/cursors/conv.py",
"copies": "1",
"size": "12234",
"license": "isc",
"hash": -1541437486538377200,
"line_mean": 38.2115384615,
"line_max": 75,
"alpha_frac": 0.4679581494,
"autogenerated": false,
"ratio": 2.055098269779943,
"conf... |
#!bin/python3
from toroid import app, database, tournament
from toroid.warrior import Warrior
from sys import exit, stdout
from getpass import getpass
from itertools import combinations
from sys import argv
# The -h and --help flags mean "only show usage/help"
if '-h' in argv or '--help' in argv:
print("TOROID SUI... | {
"repo_name": "SilverWingedSeraph/corewar32",
"path": "toroid/runtournament.py",
"copies": "1",
"size": "2847",
"license": "apache-2.0",
"hash": -2212313616419842800,
"line_mean": 29.6129032258,
"line_max": 108,
"alpha_frac": 0.6487530734,
"autogenerated": false,
"ratio": 3.2724137931034485,
"c... |
#!/bin/python3
from twitchircclient import TwitchIrcClient
import time
from test_config import *
#This is a python-script for testing the client automatically
#It joins the given usernames own channel (to have mod privelegies) and test sending messages,
#getting notes, timeouts, changing roomstate and so on.
#TODO: A... | {
"repo_name": "lepelog/twitchIrcClient",
"path": "irc_real_test.py",
"copies": "1",
"size": "3072",
"license": "mit",
"hash": -4653895018481027000,
"line_mean": 31.6808510638,
"line_max": 101,
"alpha_frac": 0.6767578125,
"autogenerated": false,
"ratio": 3.878787878787879,
"config_test": false,
... |
#!/bin/python3
# Generates matrix for GitHub Actions
# For workflow https://github.com/kivymd/KivyMD/blob/master/.github/workflows/build-demos.yml
# See https://stackoverflow.com/a/62953566/11948346
import json
import os
import sys
from pathlib import Path
diff = sys.argv[1]
all_demos = ["kitchen_sink", "crane", "for... | {
"repo_name": "kivymd/KivyMD",
"path": ".ci/generate_matrix.py",
"copies": "1",
"size": "1150",
"license": "mit",
"hash": 7734865538843878000,
"line_mean": 31.8571428571,
"line_max": 93,
"alpha_frac": 0.6634782609,
"autogenerated": false,
"ratio": 3.1767955801104972,
"config_test": false,
"ha... |
#!/bin/python3
# https://hackernoon.com/timsort-the-fastest-sorting-algorithm-youve-never-heard-of-36b28417f399
# https://pt.wikipedia.org/wiki/Timsort
# based off of this code https://gist.github.com/nandajavarma/a3a6b62f34e74ec4c31674934327bbd3
# Brandon Skerritt
# https://skerritt.tech
def binary_search(the_array, ... | {
"repo_name": "neiesc/Problem-solving",
"path": "Implementation/Sort Algorithms/timsort.py",
"copies": "1",
"size": "2733",
"license": "mit",
"hash": -5232938781224659000,
"line_mean": 28.3978494624,
"line_max": 96,
"alpha_frac": 0.5876326381,
"autogenerated": false,
"ratio": 3.2809123649459786,
... |
#!/bin/python3
# https://www.hackerrank.com/challenges/between-two-sets/
import os
#
# Complete the getTotalX function below.
#
def getTotalX(a, b):
total = 0
a.sort()
b.sort()
range_min = max(a)
range_max = min(b)
for i in range(range_min, range_max + 1):
# tempa = a.copy()
... | {
"repo_name": "benhunter/py-stuff",
"path": "hackerrank/between-two-sets.py",
"copies": "1",
"size": "1096",
"license": "mit",
"hash": -3584462224008327700,
"line_mean": 18.2280701754,
"line_max": 57,
"alpha_frac": 0.4708029197,
"autogenerated": false,
"ratio": 3.15850144092219,
"config_test": ... |
#!/bin/python3
# https://www.hackerrank.com/challenges/minimum-swaps-2/problem?h_l=playlist&slugs%5B%5D=interview&slugs%5B%5D=interview-preparation-kit&slugs%5B%5D=arrays
# Complete the minimumSwaps function below.
def minimumSwapsIndex(arr):
count = 0
for item in range(1, len(arr)):
index = arr.index(... | {
"repo_name": "benhunter/py-stuff",
"path": "hackerrank/arrays-minimum-swaps.py",
"copies": "1",
"size": "1394",
"license": "mit",
"hash": -3965731405601342000,
"line_mean": 25.3018867925,
"line_max": 155,
"alpha_frac": 0.5387374462,
"autogenerated": false,
"ratio": 3.063736263736264,
"config_t... |
#!/bin/python3
import argparse
import html
from net_deserializer.node import Node, LeafNode
from net_deserializer.records import deserialize
def dump(node, indent, prefix=''):
if isinstance(node, LeafNode):
if node.has_value():
print(prefix + '<{name}>{value}</{name}>'.format(
n... | {
"repo_name": "rr-/net_deserializer",
"path": "net_deserializer/__main__.py",
"copies": "1",
"size": "1221",
"license": "mit",
"hash": -8971299195276732000,
"line_mean": 32,
"line_max": 75,
"alpha_frac": 0.6068796069,
"autogenerated": false,
"ratio": 3.780185758513932,
"config_test": false,
"... |
#!/bin/python3
import argparse
import os
import shlex
import socket
import subprocess
import sys
from datetime import datetime
MINIMUM_WATCHED_PERCENTAGE = 80
MINIMUM_DURATION = 300 # five minutes
IGNORE_ONLINE_STREAMS = True
REMOTE_HOST = "drizzle"
REMOTE_CMD = "echo %s>>data/playback.lst"
ALLOWED_EXTENSIONS = [
... | {
"repo_name": "rr-/dotfiles",
"path": "cfg/mpv/config/scripts/playback_logger.py",
"copies": "1",
"size": "2404",
"license": "mit",
"hash": 8613427974215998000,
"line_mean": 24.5744680851,
"line_max": 79,
"alpha_frac": 0.5623960067,
"autogenerated": false,
"ratio": 3.9735537190082644,
"config_t... |
#!/bin/python3
import argparse
SPACE_DEFAULT = ":blank:"
FILLED_DEFAULT = ":kappa:"
FILLED2_DEFAULT = ":pagchomp:"
FILLED3_DEFAULT = ":pagchomp:"
FILLED4_DEFAULT = ":kappa:"
DEFAULT_VALUES = [SPACE_DEFAULT, FILLED_DEFAULT, FILLED2_DEFAULT, FILLED3_DEFAULT, FILLED4_DEFAULT]
HEIGHT = 5
LETTER_BITMAPS_5 = {
"a": [[0... | {
"repo_name": "zekna/emoji-spelling",
"path": "memes.py",
"copies": "1",
"size": "7632",
"license": "mit",
"hash": 1410098183015255300,
"line_mean": 29.2857142857,
"line_max": 161,
"alpha_frac": 0.3502358491,
"autogenerated": false,
"ratio": 2.5602146930560217,
"config_test": false,
"has_no_k... |
#!/bin/python3
import blinkstick.blinkstick as blinkstick
import pygame
from pygame.locals import *
import time
import numpy
from random import randint
import pygame.surfarray as surfarray
import os, sys
# from TwitterAPI import TwitterAPI
BLACK = (0, 0, 0)
WHITE = (255, 255, 255)
class Canopto:
'The Matrix of L... | {
"repo_name": "fenceFoil/canopto",
"path": "Canopto.py",
"copies": "1",
"size": "10718",
"license": "bsd-3-clause",
"hash": -8629285163482416000,
"line_mean": 38.9925373134,
"line_max": 130,
"alpha_frac": 0.5302295204,
"autogenerated": false,
"ratio": 3.222489476849068,
"config_test": false,
... |
#!/bin/python3
import csv
import sys
import math
import fnmatch
import os
from collections import OrderedDict
from graphviz import Digraph
from cyclefind import CycleFind
class CycleDetect(object):
def __init__(self, use_last=[], threshold=1.5):
self.reset()
self.use_last = use_last
self.th... | {
"repo_name": "joequant/cycle-detector",
"path": "cycledetect.py",
"copies": "1",
"size": "8402",
"license": "bsd-2-clause",
"hash": 1950859478202011100,
"line_mean": 34.905982906,
"line_max": 76,
"alpha_frac": 0.4025232088,
"autogenerated": false,
"ratio": 3.7932279909706548,
"config_test": fa... |
#!/bin/python3
import functools
import textwrap
import yaml
import pprint
import os.path
import warnings
import parser
##Used for getting the size of the terminal
def getTerminalSize():
import os
env = os.environ
def ioctl_GWINSZ(fd):
try:
import fcntl, termios, struct, os
... | {
"repo_name": "chao-master/YaaaaaaS",
"path": "game2.py",
"copies": "1",
"size": "7319",
"license": "mit",
"hash": -1356809804057853000,
"line_mean": 29.4958333333,
"line_max": 149,
"alpha_frac": 0.5197431343,
"autogenerated": false,
"ratio": 3.9583558680367767,
"config_test": false,
"has_no_... |
#!/bin/python3
import functools
import textwrap
import yaml
import pprint
import os.path
import warnings
##Used for getting the size of the terminal
def getTerminalSize():
import os
env = os.environ
def ioctl_GWINSZ(fd):
try:
import fcntl, termios, struct, os
cr = struct.unp... | {
"repo_name": "chao-master/YaaaaaaS",
"path": "game.py",
"copies": "1",
"size": "7466",
"license": "mit",
"hash": -8994316667337982000,
"line_mean": 29.5983606557,
"line_max": 149,
"alpha_frac": 0.5229038307,
"autogenerated": false,
"ratio": 3.941921858500528,
"config_test": false,
"has_no_ke... |
#!/bin/python3
import hashlib
import hmac
import logging
from Crypto.Cipher import Blowfish, AES
from . import protocol
from .crypto_utils import _prf, shex, getrandbytes
from .common import Channel, InvalidHMACError, InvalidPacketError
PING_DATA = bytes([
0x2a, 0x18, 0x7b, 0xf3, 0x64, 0x1e, 0xb4, 0xcb,
0x07... | {
"repo_name": "0xa/pyopenvpn",
"path": "pyopenvpn/data_channel.py",
"copies": "1",
"size": "7209",
"license": "mit",
"hash": -2120609860307852500,
"line_mean": 29.9399141631,
"line_max": 90,
"alpha_frac": 0.5837148009,
"autogenerated": false,
"ratio": 3.5830019880715707,
"config_test": false,
... |
#!/bin/python3
import json
import os
import subprocess
from sys import argv
from math import sqrt
if argv[1] == 'test':
prog = "./bin/main"
args = " --size=100:100 -a 0.1 --windvel=1 --windangle=-135 --diff=1 --resolution=10 -q -n "
logarg = " --log=batch/log_%d_%d.txt"
startarg = " --start=%d:%d"
sourcearg = " -... | {
"repo_name": "neurovertex/infotaxis",
"path": "scripts/batchtest.py",
"copies": "1",
"size": "2487",
"license": "bsd-3-clause",
"hash": 428169572455271360,
"line_mean": 29.7160493827,
"line_max": 97,
"alpha_frac": 0.6192199437,
"autogenerated": false,
"ratio": 2.6345338983050848,
"config_test"... |
#!/bin/python3
import logging
from argparse import ArgumentParser
from datetime import datetime, timedelta
from scapy.all import *
from pyopenvpn import Client, Settings
class PingClient:
def __init__(self, args):
self.host = args.host
self.interval = timedelta(seconds=args.interval)
self... | {
"repo_name": "0xa/pyopenvpn",
"path": "ping_client.py",
"copies": "1",
"size": "2682",
"license": "mit",
"hash": 4249131689041720300,
"line_mean": 32.9493670886,
"line_max": 87,
"alpha_frac": 0.5521998509,
"autogenerated": false,
"ratio": 3.9096209912536444,
"config_test": false,
"has_no_key... |
# !/bin/python3
import numpy as np
import matplotlib.pyplot as pl
from pykalman import KalmanFilter
# The module focuses on regularising time intervals to once per minute,
# including imputation of missing values, using the Kalman filter.
class KalmanImputation:
@property
def imputedObservations(self):
... | {
"repo_name": "KHP-Informatics/sleepsight-analytics",
"path": "preprocessing/imputation.py",
"copies": "1",
"size": "2961",
"license": "apache-2.0",
"hash": -7537831287941239000,
"line_mean": 39.5616438356,
"line_max": 116,
"alpha_frac": 0.5997973658,
"autogenerated": false,
"ratio": 3.9218543046... |
# !/bin/python3
import numpy as np
import pandas as pd
import datetime
from tools import TreeLeaf, TreeNode
# Module to categorise values into:
# 1. Not missing
# 2. Missing, due to PACKAGE LOSS
# 3. Missing, due to NOT WEARING THE DEVICE
# 4. Missing, due to NOT CHARGING THE DEVICE
# Note: the decision tree is specif... | {
"repo_name": "KHP-Informatics/sleepsight-analytics",
"path": "analysis/missingness.py",
"copies": "1",
"size": "6269",
"license": "apache-2.0",
"hash": 2121097021109210400,
"line_mean": 41.9452054795,
"line_max": 107,
"alpha_frac": 0.5811134152,
"autogenerated": false,
"ratio": 3.945248584015103... |
# !/bin/python3
import numpy as np
import seaborn as sns
import pandas as pd
import matplotlib.pyplot as plt
import datetime
class QuickPlot:
def __init__(self, identifier='SleepSight', path='/'):
self.outputPath = path
self.identifier = identifier
self.colours = ['b', 'g', 'r', 'c', 'm', ... | {
"repo_name": "KHP-Informatics/sleepsight-analytics",
"path": "tools/vis.py",
"copies": "1",
"size": "3330",
"license": "apache-2.0",
"hash": 1145755094201153400,
"line_mean": 37.7209302326,
"line_max": 121,
"alpha_frac": 0.5795795796,
"autogenerated": false,
"ratio": 3.5883620689655173,
"confi... |
#!/bin/python3
import numpy as np
TEMPLATE_OMEGA_WT = 0.4
def PIP_identification(P, P_time, Q_length=7):
"""
Input:
P_time: time sequence (numpy array)
P: input sequence (numpy array)
Q_length: number of PIPs
Output:
returns PIPs
"""
N = len(P)
... | {
"repo_name": "silicon-beach/stock-analysis",
"path": "recognizer.py",
"copies": "1",
"size": "7973",
"license": "mit",
"hash": -899399829795859300,
"line_mean": 28.861423221,
"line_max": 140,
"alpha_frac": 0.5773234667,
"autogenerated": false,
"ratio": 3.2020080321285143,
"config_test": false,... |
#!/bin/python3
import os
import argparse
import json
package_tree = ""
onyx_root = ""
def check_version(package_version, dep_version_string):
may_be_greater = dep_version_string.startswith(">=")
dep_ver = dep_version_string.replace(">=", "")
print(package_version)
print(dep_ver)
# TODO: Lexigraphic comparison d... | {
"repo_name": "heatd/Onyx",
"path": "buildpkg/build_sys.py",
"copies": "1",
"size": "4763",
"license": "mit",
"hash": 4376637801772585000,
"line_mean": 25.6089385475,
"line_max": 124,
"alpha_frac": 0.6754146546,
"autogenerated": false,
"ratio": 3.04539641943734,
"config_test": false,
"has_no_... |
# !/bin/python3
import os
import json
import numpy as np
import pandas as pd
import datetime
import pickle
from HipDynamics import LookUpTable
# Participant data object
class Participant:
@property
def info(self):
return self.__info
@info.setter
def info(self, info):
self.__info = in... | {
"repo_name": "KHP-Informatics/sleepsight-analytics",
"path": "tools/participant.py",
"copies": "1",
"size": "21539",
"license": "apache-2.0",
"hash": -702475203196785700,
"line_mean": 35.8818493151,
"line_max": 131,
"alpha_frac": 0.5814568921,
"autogenerated": false,
"ratio": 3.9176064023281194,... |
#!/bin/python3
import os
import sys
import bs4
import urllib, urllib.error
import subprocess
def get(url):
try:
return urllib.request.urlopen(url).read()
except Exception as e:
print(e)
return ''
def link(page, attrs=None):
urls = []
soup = bs4.BeautifulSoup(page, "lxml")
d... | {
"repo_name": "1dot75cm/repo-checker",
"path": "example/getpdf.py",
"copies": "1",
"size": "1792",
"license": "mit",
"hash": 6373593716042763000,
"line_mean": 27.4444444444,
"line_max": 74,
"alpha_frac": 0.5239955357,
"autogenerated": false,
"ratio": 3.49317738791423,
"config_test": false,
"h... |
#!/bin/python3
import os
import sys
import smtplib
import fileinput
import tempfile
import urllib.request
from email.mime.multipart import MIMEMultipart
from email.mime.text import MIMEText
from email.mime.base import MIMEBase
from email.utils import COMMASPACE, formatdate
debug=False
VERISURE=False
STATUS=""
try:
... | {
"repo_name": "tomhur/domoticz-scripts",
"path": "parse-email.py",
"copies": "1",
"size": "1719",
"license": "mit",
"hash": 5055840927149776000,
"line_mean": 22.875,
"line_max": 74,
"alpha_frac": 0.6940081443,
"autogenerated": false,
"ratio": 2.7242472266244055,
"config_test": false,
"has_no_... |
#!/bin/python3
import psycopg2
import pickle
import sys, os
import exiftool
import hashlib
def hash_bytestr_iter(bytesiter, hasher, ashexstr=False):
for block in bytesiter:
hasher.update(block)
return (hasher.hexdigest() if ashexstr else hasher.digest())
def file_as_blockiter(afile, blocksize=65536):
with afil... | {
"repo_name": "leelouch/dupphoto",
"path": "computePhotosSum.py",
"copies": "1",
"size": "2374",
"license": "mit",
"hash": -379182699406343940,
"line_mean": 21.3962264151,
"line_max": 137,
"alpha_frac": 0.6293176074,
"autogenerated": false,
"ratio": 2.5860566448801743,
"config_test": false,
"... |
#!/bin/python3
import random
import logging
import socket
import io
import ipaddress
import threading
import select
import time
import queue
from argparse import ArgumentParser
from datetime import datetime, timedelta
from scapy.all import *
from pyopenvpn import Client, Settings
class SOCKS5Connection(threading.Thr... | {
"repo_name": "0xa/pyopenvpn",
"path": "ovpn_proxy.py",
"copies": "1",
"size": "8065",
"license": "mit",
"hash": -1897711206213048000,
"line_mean": 32.0532786885,
"line_max": 94,
"alpha_frac": 0.5477991321,
"autogenerated": false,
"ratio": 3.8904968644476603,
"config_test": false,
"has_no_key... |
#!/bin/python3
import re
from pprint import pprint
def escape_parser(data):
return data.lstrip(" \t\n")
def string_parser(data):
data = escape_parser(data)
if data[0] == '"':
data = data[1:]
index = data.find('"')
while data[index-1] == '\\':
index += data[index+1:].fin... | {
"repo_name": "alenthomas/py_json_parser",
"path": "j_parser.py",
"copies": "1",
"size": "3460",
"license": "mit",
"hash": -4773274434129664000,
"line_mean": 27.1300813008,
"line_max": 80,
"alpha_frac": 0.513583815,
"autogenerated": false,
"ratio": 3.5450819672131146,
"config_test": false,
"h... |
#!/bin/python3
import re
import sys
#ATOM-SPECIFIC BLOCK FOR BUILDING CODE:
#import os
#print(os.getcwd())
#DOMTBLOUT=open("Hsapiens_genome_proteins_RHIM_Pfam_model.Present.Pfam.domtblout", 'r') #VARIABLE INITIALIZED AS VARIABLE ON LINE 32 FOR FINAL VERSION
#######################################
#Function will conve... | {
"repo_name": "mtassia/Scripts",
"path": "Best_fit_domains.py",
"copies": "1",
"size": "8290",
"license": "mit",
"hash": 6834905390464877000,
"line_mean": 52.8311688312,
"line_max": 310,
"alpha_frac": 0.7180940893,
"autogenerated": false,
"ratio": 3.304105221203667,
"config_test": true,
"has_... |
#!/bin/python3
import requests
import configparser
import signal
import sys
from json import loads
from time import time, sleep
from os.path import realpath, expanduser, exists
from os import makedirs, geteuid, getenv
from shutil import rmtree
#Change this!
APP_ID="[APP ID]"
APP_SECRET="[APP SECRET]"
if geteuid() == 0... | {
"repo_name": "Half-Shot/fatmo",
"path": "fatmo.py",
"copies": "1",
"size": "4922",
"license": "mit",
"hash": 1336067372747302100,
"line_mean": 32.2567567568,
"line_max": 116,
"alpha_frac": 0.5954896384,
"autogenerated": false,
"ratio": 3.7063253012048194,
"config_test": true,
"has_no_keyword... |
#!/bin/python3
import requests
import time
import os
import sys
import re
from html.parser import HTMLParser
import config
import logger
_CONFIGFILE = 'config.yaml'
_WAIT = 0.25 # global rait limiting value, don't set to 0
_EXT = re.compile('^http.*/download/[0-9]+/[^\.]+(\.[a-zA-Z]{2,4})\?token=.*$')
log = logger.... | {
"repo_name": "tdreyer1/da_downloader",
"path": "da_downloader/da_downloader.py",
"copies": "1",
"size": "12490",
"license": "mit",
"hash": 8563632583164771000,
"line_mean": 38.5253164557,
"line_max": 129,
"alpha_frac": 0.5569255404,
"autogenerated": false,
"ratio": 4.023840206185567,
"config_t... |
#!bin/python3
import scipy
import numpy as np
from skimage.measure import compare_ssim
from array import UnboundedArray
def rgb2gray(rgb):
r, g, b = rgb[:, :, 0], rgb[:, :, 1], rgb[:, :, 2]
# Scipy implements: r * 299/1000 + g * 587/1000 + b * 114/1000
# that is the ITU-R 601-2 luma transform
# Note... | {
"repo_name": "viniciusd/DCO1008---Digital-Signal-Processing",
"path": "projeto1/main.py",
"copies": "1",
"size": "1764",
"license": "mit",
"hash": 5289781958068916000,
"line_mean": 31.0727272727,
"line_max": 80,
"alpha_frac": 0.5833333333,
"autogenerated": false,
"ratio": 3.0309278350515463,
"... |
#!/bin/python3
import shutil
import graph_tool.all as gt
import numpy as np
import modules.distance_matrix as distance_matrix
import modules.graph_io as graph_io
import modules.layout_io as layout_io
import modules.thesne as thesne
import modules.user_input as usr_input
import modules.animation as animations
from mod... | {
"repo_name": "HanKruiger/tsnetwork",
"path": "src/tsnetwork.py",
"copies": "1",
"size": "17075",
"license": "mit",
"hash": 8829132729099388000,
"line_mean": 56.1070234114,
"line_max": 291,
"alpha_frac": 0.5864128843,
"autogenerated": false,
"ratio": 3.7371416064784415,
"config_test": true,
"... |
#!/bin/python3
import ssl
import random
import logging
from . import protocol
from .crypto_utils import shex, KeySource
from .common import Channel, InvalidPacketError, AuthFailed, ProtocolLogicError
from .settings import Settings
def encode_string(s):
data = bytes()
data += (len(s) + 1).to_bytes(2, 'big')
... | {
"repo_name": "0xa/pyopenvpn",
"path": "pyopenvpn/control_channel.py",
"copies": "1",
"size": "9082",
"license": "mit",
"hash": 8666241711913147000,
"line_mean": 32.7620817844,
"line_max": 89,
"alpha_frac": 0.5483373706,
"autogenerated": false,
"ratio": 3.5671641791044775,
"config_test": false,... |
#!/bin/python3
import sys
def DFS(graph, start):
L = 0
S = []
Q = [start]
while Q:
current = Q.pop()
if current not in S:
S.append(current)
L +=1
if graph[current]:
for n in graph[current]:
Q.append(n)
return S, ... | {
"repo_name": "kakaba2009/MachineLearning",
"path": "python/src/algorithm/coding/graph/roads_libraries.py",
"copies": "1",
"size": "1092",
"license": "apache-2.0",
"hash": -7808003410333921000,
"line_mean": 27.7368421053,
"line_max": 57,
"alpha_frac": 0.5009157509,
"autogenerated": false,
"ratio"... |
#!/bin/python3
import sys
import itertools
def is_beautiful(s):
"""
Are the splits in `s` beautiful?
"""
leading_zeros = [d[0] == '0' for d in s]
increasing = [int(s[i - 1]) + 1 == int(s[i]) for i in range(1, len(s))]
res = not any(leading_zeros) and all(increasing)
if res: # match, look ... | {
"repo_name": "JuanCTorres/interview-prep-solutions",
"path": "hackerrank/src/algorithms/strings/separate_the_numbers.py",
"copies": "1",
"size": "2395",
"license": "mit",
"hash": 1054447331787093200,
"line_mean": 30.1038961039,
"line_max": 89,
"alpha_frac": 0.5482254697,
"autogenerated": false,
... |
#!/bin/python3
import sys
# print board
def print_board(board):
for row in board:
print(''.join(row))
# get possible locations
def get_poss_locs(board, word):
poss_locs = []
length = len(word)
# horizontal possible location
for i in range(10):
for j in range(10 - length + 1):
... | {
"repo_name": "rootulp/hackerrank",
"path": "python/temp.py",
"copies": "1",
"size": "2037",
"license": "mit",
"hash": -8184292464403598000,
"line_mean": 22.4137931034,
"line_max": 58,
"alpha_frac": 0.4928816888,
"autogenerated": false,
"ratio": 3.586267605633803,
"config_test": false,
"has_n... |
#!/bin/python3
import sys, os, tempfile, zlib, configparser
from itertools import chain
from functools import partial
from fractions import Fraction
CurPage = None
CurStaff = None
CurMultiVoice = None
Config = configparser.ConfigParser()
Config.read(os.path.join(os.path.dirname(os.path.realpath(__file__)), "settings.i... | {
"repo_name": "Lleuad/nwc2ly",
"path": "nwc2ly.py",
"copies": "1",
"size": "36400",
"license": "bsd-3-clause",
"hash": 9103761285454935000,
"line_mean": 33.114339269,
"line_max": 169,
"alpha_frac": 0.5052472527,
"autogenerated": false,
"ratio": 3.432343234323432,
"config_test": true,
"has_no_... |
#!/bin/python3
import yaml
import warnings
import re
import functools
from collections import OrderedDict,defaultdict
##Generic Base Class that builds and handles the other's common methods
class GenericBlock(object):
def __init__(self,parent,key):
self.parent = parent
self.game = parent.game
... | {
"repo_name": "chao-master/YaaaaaaS",
"path": "parser.py",
"copies": "1",
"size": "3423",
"license": "mit",
"hash": -8104004086440393000,
"line_mean": 27.2892561983,
"line_max": 76,
"alpha_frac": 0.526146655,
"autogenerated": false,
"ratio": 3.9075342465753424,
"config_test": false,
"has_no_k... |
#!/bin/python3
import yaml,pprint,functools
class ifBlock(yaml.YAMLObject):
yaml_tag = "!if"
def __init__(self,ifStates):
self.ifStates = ifStates
@classmethod
def from_yaml(cls,loader,node):
return ifBlock([(k.value,v.value) for k,v in node.value])
def get(self,instance):
for k,v in self.ifStates:
... | {
"repo_name": "chao-master/YaaaaaaS",
"path": "reader.py",
"copies": "1",
"size": "2030",
"license": "mit",
"hash": -1175330667690975500,
"line_mean": 19.31,
"line_max": 59,
"alpha_frac": 0.6433497537,
"autogenerated": false,
"ratio": 2.8194444444444446,
"config_test": false,
"has_no_keywords... |
""" Little example script of a cmdline interface.
Author: Julien Delplanque
"""
import argparse
import getpass
import traceback
from raspi_rest_client import *
ERROR_FILE = "error.log"
def main():
""" Main function of this program.
"""
# Arguments parsing
parser = argparse.ArgumentParser(
... | {
"repo_name": "juliendelplanque/raspirestmonitor",
"path": "client/cmd_interface.py",
"copies": "1",
"size": "2827",
"license": "mit",
"hash": 1502322038598717200,
"line_mean": 41.8333333333,
"line_max": 87,
"alpha_frac": 0.5818889282,
"autogenerated": false,
"ratio": 3.9428172942817294,
"confi... |
#!/bin/python3
# Modifies the Cargo.toml file's version number
import sys
import subprocess
from subprocess import PIPE, Popen
# opens Cargo.toml, reads the current major and minor
# version, then adds the build number and commit
# hash, then writes this to the file
def main(filename, full_symver):
try:
... | {
"repo_name": "srottem/indy-sdk",
"path": "vcx/ci/change_toml_version.py",
"copies": "3",
"size": "2774",
"license": "apache-2.0",
"hash": -5377990253396516000,
"line_mean": 24.4495412844,
"line_max": 73,
"alpha_frac": 0.5684931507,
"autogenerated": false,
"ratio": 3.2828402366863907,
"config_t... |
#!/bin/python3
# Modifies the Cargo.toml file's version number
import sys
# opens Cargo.toml, reads the current major and minor
# version, then adds the build number and commit
# hash, then writes this to the file
def main(filename, full_symver):
try:
f = open(filename, 'r')
output = ""
f... | {
"repo_name": "Artemkaaas/indy-sdk",
"path": "vcx/ci/change_toml_version.py",
"copies": "1",
"size": "2018",
"license": "apache-2.0",
"hash": -1554071243912528000,
"line_mean": 25.2077922078,
"line_max": 73,
"alpha_frac": 0.5584737364,
"autogenerated": false,
"ratio": 3.4495726495726498,
"confi... |
#!/bin/python3
# A Binary tree node
class Node:
# Constructor to create a new node
def __init__(self, data):
self.data = data
self.hight= 0
self.left = None
self.right = None
#
# A function to do postorder tree traversal
def printPreorder(root):
if r... | {
"repo_name": "MarsBighead/mustang",
"path": "Python/tree/get-tree-hight.py",
"copies": "1",
"size": "2077",
"license": "mit",
"hash": -5176111146228856000,
"line_mean": 19.362745098,
"line_max": 64,
"alpha_frac": 0.5204622051,
"autogenerated": false,
"ratio": 3.4105090311986865,
"config_test":... |
#!/bin/python3
# ascmidi2notes.py
# (c) 2017 by Milan Gruner
# Part of project "AlgorithMuss"
# Parses the output of mid2asc.c
# See: http://www.archduke.org/midi/
import csv
import sys
import re
from itertools import groupby
from fractions import *
default_note = {
"bar": 1,
"crotchet": 0,
"track": 0,
"channel"... | {
"repo_name": "lemilonkh/algorithmuss",
"path": "overtone/tools/ascmidi2notes.py",
"copies": "1",
"size": "2311",
"license": "mit",
"hash": -9203580757030462000,
"line_mean": 19.8198198198,
"line_max": 61,
"alpha_frac": 0.6161834704,
"autogenerated": false,
"ratio": 2.70926143024619,
"config_te... |
#!/bin/python3
"""
bumper
======
Version bumping interface.
Allows bumping by specified version and SemVer semantics.
"""
from abc import ABCMeta, abstractmethod
from garden.log import logger
import argparse
import enum
import re
_logger = logger
#: Regex for matching version numbers
RE_VERSION = '(?P<version>(?:... | {
"repo_name": "jad-b/garden",
"path": "garden/bumper.py",
"copies": "1",
"size": "3597",
"license": "mit",
"hash": 8393990297540685000,
"line_mean": 25.8432835821,
"line_max": 84,
"alpha_frac": 0.6144008896,
"autogenerated": false,
"ratio": 3.7429760665972944,
"config_test": false,
"has_no_ke... |
#!/bin/python3
class Img(object):
'''
Base image class
'''
def __init__(self, fname):
'''
'''
self.fname = fname
self.data = self.read_binary(fname)
def verify(self, condition, err_str):
'''
Verification function to catch issues.
'''
... | {
"repo_name": "jon-stewart/imghide",
"path": "img.py",
"copies": "1",
"size": "1445",
"license": "mit",
"hash": 2472753335583649000,
"line_mean": 17.2911392405,
"line_max": 77,
"alpha_frac": 0.4934256055,
"autogenerated": false,
"ratio": 4.262536873156342,
"config_test": false,
"has_no_keywor... |
#!/bin/python3
class Node:
def __init__(self, data):
self.data = data
self.left = None
self.right = None
def addLeft(self, node):
self.left = node
def addRight(self, node):
self.right = node
node = Node(1)
n1 = Node (2)
n2 = Node (3)
node.addLeft(n1)
node.addRight(n2)
n4 = Node(4)
n5 = N... | {
"repo_name": "chenthillrulz/fun_with_python",
"path": "binary_tree.py",
"copies": "1",
"size": "1086",
"license": "apache-2.0",
"hash": -5452017021619583000,
"line_mean": 17.1,
"line_max": 52,
"alpha_frac": 0.650092081,
"autogenerated": false,
"ratio": 2.7218045112781954,
"config_test": false,... |
# Copyright (c) 2014 TheLastProject
# This file is part of FoxUp, released under the MIT license
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
# in the Software without restriction, including without limi... | {
"repo_name": "TheLastProject/PyFoxUp",
"path": "main.py",
"copies": "1",
"size": "9340",
"license": "mit",
"hash": -7003980510581352000,
"line_mean": 31.543554007,
"line_max": 167,
"alpha_frac": 0.5801927195,
"autogenerated": false,
"ratio": 3.9442567567567566,
"config_test": false,
"has_no_... |
# Copyright (C) 2017 Quentin "Naccyde" Deslandes.
# Redistribution and use of this file is allowed according to the terms of the MIT license.
# For details see the LICENSE file distributed with yall.
import sys
import os
import requests
import json
import argparse
import subprocess
import fnmatch
owner = 'naccyde'
r... | {
"repo_name": "Naccyde/yall",
"path": "resources/artifacts.py",
"copies": "1",
"size": "8066",
"license": "mit",
"hash": -3583864605895255000,
"line_mean": 33.7672413793,
"line_max": 127,
"alpha_frac": 0.615298785,
"autogenerated": false,
"ratio": 3.6431797651309847,
"config_test": false,
"ha... |
# Copyright (©) 2015-2016 Lucas Maugère, Thomas Mijieux
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
# http://www.apache.org/licenses/LICENSE-2.0
# Unless required by applicable law or a... | {
"repo_name": "tomtix/osux",
"path": "src/taikorank/test/colors.py",
"copies": "1",
"size": "1218",
"license": "apache-2.0",
"hash": 617008843260614000,
"line_mean": 32.7777777778,
"line_max": 74,
"alpha_frac": 0.5945723684,
"autogenerated": false,
"ratio": 3.909967845659164,
"config_test": fal... |
#!/bin/python3
# Day 22: binary search trees
class Node:
def __init__(self, data):
self.right = self.left = None
self.data = data
class Solution:
def insert(self, root, data):
if root is None:
return Node(data)
else:
if data <= root.data:
... | {
"repo_name": "jerryasher/hackerrank30",
"path": "22/bst.py",
"copies": "1",
"size": "1311",
"license": "unlicense",
"hash": -8030915108226165000,
"line_mean": 20.85,
"line_max": 67,
"alpha_frac": 0.5324180015,
"autogenerated": false,
"ratio": 3.6620111731843576,
"config_test": false,
"has_no... |
#!/bin/python 3
# Day 24: more linked lists
class Node:
def __init__(self, data):
self.data = data
self.next = None
class Solution:
def insert(self, head, data):
p = Node(data)
if head is None:
head = p
elif head.next is None:
head.next = p
... | {
"repo_name": "jerryasher/hackerrank30",
"path": "24/linkedlist.py",
"copies": "1",
"size": "1155",
"license": "unlicense",
"hash": 5104845704597232000,
"line_mean": 21.2115384615,
"line_max": 48,
"alpha_frac": 0.5264069264,
"autogenerated": false,
"ratio": 4.081272084805653,
"config_test": fal... |
#!/bin/python3
## debugger.py
## Jacob Butler
## 15 October 2017
##
## This script will do a comparison between the output from the ByteSyzed memory dump
## and a debug file with the correct memory and register values written in it
##
## The first argument to the script is the output from the memory dump
## The secon... | {
"repo_name": "cjemerson/bytesyzed",
"path": "debugger.py",
"copies": "1",
"size": "2683",
"license": "mit",
"hash": 2638292957451102700,
"line_mean": 25.3039215686,
"line_max": 120,
"alpha_frac": 0.6757361163,
"autogenerated": false,
"ratio": 3.0385050962627407,
"config_test": false,
"has_no... |
#!/bin/python3
def get_permutation(n, k):
if (k == 0):
return list(range(1, n + 1));
batch_size = 2 * k;
if (n % batch_size != 0):
return -1;
resultant_array = [0] * (n + 1); # not using array index 0
for i in range(int(n / batch_size)):
for j in range(1, int(batch_size ... | {
"repo_name": "sazzadBuet08/programming-contest",
"path": "hackar_rank/pratice_problem_from_hackthon/Absolute_permutation.py",
"copies": "1",
"size": "1025",
"license": "apache-2.0",
"hash": 8606374868432419000,
"line_mean": 20.3541666667,
"line_max": 63,
"alpha_frac": 0.5004878049,
"autogenerated"... |
#!/bin/python3
def makeType(name, fields):
#TODO validate fields
#must be an iterable of the types (string, type, bool)
membersDict = {'fields': fields}
def repr(instance):
repr_string = name + "("
i = 0
for field in instance.fields:
if i > 0:
... | {
"repo_name": "plainas/experiments",
"path": "python/InputTypeAnnotations.py",
"copies": "1",
"size": "1088",
"license": "mit",
"hash": -5173500061521516000,
"line_mean": 26.225,
"line_max": 86,
"alpha_frac": 0.5091911765,
"autogenerated": false,
"ratio": 3.7909407665505226,
"config_test": fals... |
#!/bin/python3
#DEMODULATING THE RDS SIGNAL AND DUMPING RECEIVED PACKETS
#Tarmo Tanilsoo, 2016
import wave
import array
import time
from math import pi
from numpy import arctan2 as atan2, absolute, std, diff, copy, sort
from bitarray import bitarray
def codeVector(block):
global matrix
vector=bitarray("000... | {
"repo_name": "es5nhc/rdsdemod",
"path": "demod.py",
"copies": "1",
"size": "9041",
"license": "mit",
"hash": 1798224653105914000,
"line_mean": 42.8883495146,
"line_max": 229,
"alpha_frac": 0.6760314125,
"autogenerated": false,
"ratio": 3.8636752136752137,
"config_test": false,
"has_no_keywor... |
#!/bin/python3
dict = {}
def my_anagram(a, b):
count = [0] * 26;
for c in a:
count[ord(c) - 97] += 1;
for c in b:
count[ord(c) - 97] += -1;
if (count[ord(c) - 97] == -1):
return 0;
for c in count:
if (c != 0):
return 0;
return 1;
def sher... | {
"repo_name": "sazzadBuet08/programming-contest",
"path": "hackar_rank/pratice_problem_from_hackthon/Sherlock_Anagrams.py",
"copies": "1",
"size": "1394",
"license": "apache-2.0",
"hash": 8221458813828145000,
"line_mean": 20.4461538462,
"line_max": 62,
"alpha_frac": 0.4713055954,
"autogenerated": f... |
#!/bin/python3
DIRECTIONS = {
'n': (0, -1),
's': (0, 1),
'e': (1, 0),
'w': (-1, 0),
}
def get_route(preferred_direction):
x_pos, y_pos = preferred_direction
return [
preferred_direction,
(y_pos, x_pos),
(-y_pos, -x_pos),
(-x_pos, -y_pos)
]
class Boar... | {
"repo_name": "avenet/hackerrank",
"path": "contests/university_codesprint_3/the_snake_vs_the_wind.py",
"copies": "1",
"size": "1856",
"license": "mit",
"hash": -2290564859688754400,
"line_mean": 21.9135802469,
"line_max": 86,
"alpha_frac": 0.4698275862,
"autogenerated": false,
"ratio": 3.2618629... |
#!/bin/python3
#
# Example on how to load a Spark DataFrame from KairosDB data.
# Maybe need some adjustments.
#
# Written by @paladini on 09/2015.
# paladini@lisha.ufsc.br
#
from pyspark import SparkContext
from pyspark.sql import SQLContext
from pyspark.sql.functions import *
from connection import Connection
import... | {
"repo_name": "paladini/pySpark-connector-kairosdb",
"path": "build/lib/sconnk/dataframe.py",
"copies": "2",
"size": "1029",
"license": "mit",
"hash": -4186994308077193000,
"line_mean": 24.75,
"line_max": 62,
"alpha_frac": 0.6899902818,
"autogenerated": false,
"ratio": 3.146788990825688,
"confi... |
#!/bin/python3
#
# Examples:
# python3 info.py -p /dev/ttyUSB0
#
import sys
import fcntl
import argparse
from time import sleep
sys.path.append("../")
import buttshock.et312
def main():
modes = {0x76:"Waves", 0x77:"Stroke", 0x78:"Climb", 0x79:"Combo", 0x7a:"Intense", 0x7b:"Rhythm",
0x7c:"Audio1... | {
"repo_name": "metafetish/buttshock-py",
"path": "examples/et312-info.py",
"copies": "1",
"size": "3960",
"license": "bsd-3-clause",
"hash": 5735036672246622000,
"line_mean": 38.6,
"line_max": 121,
"alpha_frac": 0.5694444444,
"autogenerated": false,
"ratio": 2.9685157421289357,
"config_test": f... |
#!/bin/python3
from BlumBlumShub import BlumBlumShub
from time import time
from LCG import LCG
from MillerRabin import MillerRabin
from SolovayStrassen import SolovayStrassen
# Os tamanhos a serem considerados.
size_list = [40, 56, 80, 128, 168, 224, 256, 512, 1024, 2048, 4096]
# Gera uma semente para testar os gera... | {
"repo_name": "Ghabriel/ComputerSecurity",
"path": "t1/main.py",
"copies": "1",
"size": "2659",
"license": "apache-2.0",
"hash": 383334243406226050,
"line_mean": 30.0588235294,
"line_max": 90,
"alpha_frac": 0.6643939394,
"autogenerated": false,
"ratio": 2.75,
"config_test": false,
"has_no_key... |
#!/bin/python3
from Canopto import Canopto
import pygame
from pygame import *
from pygame.locals import *
from pygame.transform import *
import time
from random import randint
from random import random
from colorsys import *
import sys
from tween import *
from itertools import chain
import text
display_size = (8, 8)
... | {
"repo_name": "fenceFoil/canopto",
"path": "EndOfClasses1.py",
"copies": "1",
"size": "2457",
"license": "bsd-3-clause",
"hash": -8531521213492961000,
"line_mean": 30.9220779221,
"line_max": 130,
"alpha_frac": 0.6768416768,
"autogenerated": false,
"ratio": 2.6881838074398248,
"config_test": fal... |
#!/bin/python3
from Canopto import Canopto
import pygame
from pygame import *
from pygame.locals import *
import time
from colorsys import *
import sys
import json
import datetime
# scroll text across canopto. blocks. fg & bg are colors
def scrollText (canopto, text, fg = (0xFF, 0x33, 0xFF), bg = (0x00, 0x00, 0x00, 0... | {
"repo_name": "fenceFoil/canopto",
"path": "text.py",
"copies": "1",
"size": "3088",
"license": "bsd-3-clause",
"hash": 6691178131693874000,
"line_mean": 35.3294117647,
"line_max": 122,
"alpha_frac": 0.6875,
"autogenerated": false,
"ratio": 3.072636815920398,
"config_test": true,
"has_no_keyw... |
#!/bin/python3
from Canopto import Canopto
import pygame
from pygame import *
from pygame.locals import *
import time
from random import randint
from colorsys import *
import sys
import numpy
import math
display_size = (8, 8)
cans = Canopto (display_size[0], display_size[1], True, True)
# Plays Conway's Game of Lif... | {
"repo_name": "fenceFoil/canopto",
"path": "cgol.py",
"copies": "1",
"size": "5575",
"license": "bsd-3-clause",
"hash": 4482390389635102000,
"line_mean": 28.9731182796,
"line_max": 93,
"alpha_frac": 0.6608071749,
"autogenerated": false,
"ratio": 2.974919957310566,
"config_test": false,
"has_n... |
#!/bin/python3
from Canopto import Canopto
import pygame
from pygame import *
from pygame.locals import *
import time
from random import randint
from colorsys import *
import sys
display_size = (8, 8)
cans = Canopto (display_size[0], display_size[1], True, True)
# Create an image, wider than the display, with random... | {
"repo_name": "fenceFoil/canopto",
"path": "NarrowWavyLines01.py",
"copies": "1",
"size": "1459",
"license": "bsd-3-clause",
"hash": 2710826725089136000,
"line_mean": 27.6274509804,
"line_max": 144,
"alpha_frac": 0.6991089788,
"autogenerated": false,
"ratio": 2.9897540983606556,
"config_test": ... |
#!/bin/python3
from Canopto import Canopto
import pygame
from pygame import *
from pygame.locals import *
import time
from random import randint
from random import random
from colorsys import *
import sys
display_size = (8, 8)
cans = Canopto (display_size[0], display_size[1], True, True)
# Create image of random col... | {
"repo_name": "fenceFoil/canopto",
"path": "Disco01-niner.py",
"copies": "1",
"size": "1307",
"license": "bsd-3-clause",
"hash": 4165712386693780000,
"line_mean": 22.7818181818,
"line_max": 72,
"alpha_frac": 0.6702371844,
"autogenerated": false,
"ratio": 2.866228070175439,
"config_test": false,... |
#!/bin/python3
from Canopto import Canopto
import pygame
from pygame.locals import *
import time
import random
from colorsys import *
c = Canopto(8, 8, True, True)
c.bs.clear()
c.bs.send_data(0)
while True:
x = random.randint(0, c.width-1)
last_x = x
for y in range(0, c.height+1):
# Write new position as a whit... | {
"repo_name": "fenceFoil/canopto",
"path": "Snowflakes01.py",
"copies": "1",
"size": "1123",
"license": "bsd-3-clause",
"hash": -7751412693575355000,
"line_mean": 26.4146341463,
"line_max": 130,
"alpha_frac": 0.6464826358,
"autogenerated": false,
"ratio": 2.3347193347193347,
"config_test": fals... |
#!/bin/python3
from feedparser import parse
from feedparse import loadURLs,addFeed,removeFeed
from PyQt5.QtWidgets import QMainWindow,QAction,qApp,QApplication,QInputDialog, QLabel, QComboBox, QWidget, QMessageBox
from PyQt5.QtGui import QIcon
import sys
class FeedGUI(QMainWindow):
def __init__(self,):
Q... | {
"repo_name": "nickfarrington/YAFP",
"path": "gui.py",
"copies": "1",
"size": "3967",
"license": "mit",
"hash": -6997338394854806000,
"line_mean": 32.905982906,
"line_max": 129,
"alpha_frac": 0.5825560877,
"autogenerated": false,
"ratio": 3.967,
"config_test": false,
"has_no_keywords": false,... |
#!/bin/python3
from functools import reduce
class LargestProduct(object):
def __init__(self, num, num_consecutive_digits):
self.num = num
self.num_consecutive_digits = num_consecutive_digits
def largest_product(self):
return max(self.product_of_consecutive_digits())
def product... | {
"repo_name": "rootulp/hackerrank",
"path": "python/euler008.py",
"copies": "1",
"size": "1151",
"license": "mit",
"hash": -2091880205272748000,
"line_mean": 27.0731707317,
"line_max": 69,
"alpha_frac": 0.6298870547,
"autogenerated": false,
"ratio": 3.6773162939297124,
"config_test": false,
"... |
#!/bin/python3
from __future__ import print_function
"""
Benchmark creator, for Cassius.
Uses Selenium Webdriver to download new benchmarks for Cassius.
Opens a page in Firefox, causes it to execute get_bench.js, and saves the result.
"""
import selenium, selenium.webdriver
import os, sys
import warnings
try:
i... | {
"repo_name": "uwplse/Cassius",
"path": "capture/capture.py",
"copies": "1",
"size": "4931",
"license": "mit",
"hash": -6517526996503176000,
"line_mean": 35.7985074627,
"line_max": 111,
"alpha_frac": 0.5862908132,
"autogenerated": false,
"ratio": 3.8403426791277258,
"config_test": false,
"has... |
#!/bin/python3
from itertools import groupby
# Special palindromic string conditions:
# 1. All of the characters are the same, e.g. aaa.
# 2. All characters except the middle one are the same, e.g. aadaa.
# Referenced this hint:
# 1. Build a list of tuples such that the string "aaabbc" => [("a", 3), ("b", 2), ("c", ... | {
"repo_name": "rootulp/hackerrank",
"path": "python/special-palindrome-again.py",
"copies": "1",
"size": "1506",
"license": "mit",
"hash": -8494646713960301000,
"line_mean": 29.12,
"line_max": 92,
"alpha_frac": 0.6460823373,
"autogenerated": false,
"ratio": 3.354120267260579,
"config_test": fal... |
#!/bin/python3
from pid import PIDArduino
from autotune import PIDAutotune
from kettle import Kettle
from collections import deque, namedtuple
import sys
import math
import logging
import argparse
import matplotlib.pyplot as plt
LOG_FORMAT = '%(name)s: %(message)s'
Simulation = namedtuple(
'Simulation',
['na... | {
"repo_name": "hirschmann/pid-autotune",
"path": "sim.py",
"copies": "1",
"size": "9683",
"license": "mit",
"hash": 881887233747105000,
"line_mean": 34.9665427509,
"line_max": 93,
"alpha_frac": 0.591627907,
"autogenerated": false,
"ratio": 3.3167637984230374,
"config_test": false,
"has_no_key... |
#!/bin/python3
from queue import Queue, Empty
from threading import Thread, Event
from collections import OrderedDict
import socket
import time
from typing import List
import sys
import pyudev
import evdev
from evdev import ecodes
from web_server import WebServerManager
from hid_report import HidReport
class HidDa... | {
"repo_name": "miikka-h/Projektikurssi17",
"path": "pi3/advanced_main.py",
"copies": "1",
"size": "19538",
"license": "mit",
"hash": 8964188603477327000,
"line_mean": 35.7928436911,
"line_max": 144,
"alpha_frac": 0.5543328044,
"autogenerated": false,
"ratio": 4.293846153846154,
"config_test": f... |
#!/bin/python3
from queue import Queue, Empty
from threading import Thread, Event
from collections import OrderedDict
import socket
import time
from typing import List
import pyudev
import evdev
from evdev import ecodes
from web_server import WebServerManager
from hid_report import HidReport
class HidDataSocket():... | {
"repo_name": "miikka-h/Projektikurssi17",
"path": "pi3/advanced_modded_main.py",
"copies": "1",
"size": "21033",
"license": "mit",
"hash": 6952753328208408000,
"line_mean": 34.7096774194,
"line_max": 144,
"alpha_frac": 0.532211287,
"autogenerated": false,
"ratio": 4.259416767922236,
"config_te... |
#!/bin/python3
# Generate orchestration templates from imput data
#
# Support different template types:
# AWS CloudFormation
# OpenStack Heat Orchestration Template (HOT)
# Input data format is JSON
# Output is a orchestration template
# Requirements:
# troposphere, source: https://github.com/cloudtools/tropos... | {
"repo_name": "magreiner/orchestration-tools",
"path": "template/template.py",
"copies": "1",
"size": "3348",
"license": "apache-2.0",
"hash": -4032011054671496700,
"line_mean": 28.6283185841,
"line_max": 83,
"alpha_frac": 0.5722819594,
"autogenerated": false,
"ratio": 4.428571428571429,
"confi... |
#!/bin/ python3
""" Gui for the downloader """
import argparse
import queue
import time
import threading
import download
from tkinter import Frame, messagebox, HORIZONTAL, Button, Tk, BOTH, BOTTOM, Entry
from tkinter import ttk
class ThreadedTask(threading.Thread):
def __init__(self, queue, url):
thr... | {
"repo_name": "Lapz/wuxiaWorldDownloader",
"path": "gui.py",
"copies": "1",
"size": "2234",
"license": "mit",
"hash": 7301812643047665000,
"line_mean": 24.6781609195,
"line_max": 82,
"alpha_frac": 0.5854968666,
"autogenerated": false,
"ratio": 3.8517241379310345,
"config_test": false,
"has_no... |
#!/bin/python3
# https://www.hackerrank.com/challenges/mini-max-sum/problem
"""
The algorithm used to solve this problem is the following:
1. Get the minimum element of the array
2. Get the maximum element of the array
3. Get the sum of all the elements in the array
4. Calculate the min sum -> sum(arr) - max_element
... | {
"repo_name": "julianespinel/trainning",
"path": "hackerrank/mini_max_sum.py",
"copies": "2",
"size": "1581",
"license": "mit",
"hash": -4642218407879188000,
"line_mean": 35.7674418605,
"line_max": 81,
"alpha_frac": 0.7280202404,
"autogenerated": false,
"ratio": 3.4369565217391305,
"config_test... |
#!/bin/python3
#
# ** Implement a GAME mode **
#
# We want a training mode for the ET312 that works similarly to the modes
# that the ET302R has. You can already put the ET312 box into audio mode
# and use audio signals to trigger, but what if we want to trigger via
# serial instead without adding/configuring an extra... | {
"repo_name": "metafetish/buttshock-py",
"path": "examples/shockcade/etgame.py",
"copies": "1",
"size": "5687",
"license": "bsd-3-clause",
"hash": 7153175109346208000,
"line_mean": 37.6870748299,
"line_max": 126,
"alpha_frac": 0.5621593107,
"autogenerated": false,
"ratio": 3.5948166877370418,
"... |
#!/bin/python3
import argparse
import configparser
import json
import logging as log
import os
import requests
import sys
from tabulate import tabulate
if os.path.isfile('config.ini'):
config = configparser.ConfigParser()
config.read('config.ini')
email = config['rage4']['username']
api_key= config['r... | {
"repo_name": "jaredledvina/rage4",
"path": "rage4.py",
"copies": "1",
"size": "5366",
"license": "mit",
"hash": -3807463918687065600,
"line_mean": 34.5364238411,
"line_max": 86,
"alpha_frac": 0.5644800596,
"autogenerated": false,
"ratio": 3.9895910780669146,
"config_test": true,
"has_no_keyw... |
#!/bin/python3
import argparse
import os
import sys
parser = argparse.ArgumentParser(description='Displays a voronoi diagram for a given dataset.')
parser.add_argument('-i', '--input', type=str, help='Filename of the input to classify, must be a CSV file')
parser.add_argument('-c', '--category', type=int, help='Colu... | {
"repo_name": "hausp/INE5443",
"path": "t1/voronoi.py",
"copies": "1",
"size": "1169",
"license": "apache-2.0",
"hash": 8039538457951080000,
"line_mean": 32.4,
"line_max": 108,
"alpha_frac": 0.6903336185,
"autogenerated": false,
"ratio": 3.005141388174807,
"config_test": false,
"has_no_keywor... |
#!/bin/python3
import argparse
import re
from img import Img
from png import Png
from gif import Gif
def identify_file(fname):
'''
Look for supported file signatures and return the matching subclass.
Base class Img is returned if unsupported file type.
'''
image_list = [Png, Gif, Img]
return... | {
"repo_name": "jon-stewart/imghide",
"path": "imghide.py",
"copies": "1",
"size": "1171",
"license": "mit",
"hash": 1621834402308034600,
"line_mean": 23.3958333333,
"line_max": 84,
"alpha_frac": 0.6447480786,
"autogenerated": false,
"ratio": 3.659375,
"config_test": false,
"has_no_keywords": ... |
#!/bin/python3
import argparse
import re
import random
#import sys
if __name__ == '__main__':
parser = argparse.ArgumentParser(description='Generate ECDSA CAVP test vectors.')
parser.add_argument('FILE_VER', type=str, help='CAVP rsp file.')
parser.add_argument('FILE_GEN', type=str, help='CAVP txt file.'... | {
"repo_name": "mitls/hacl-star",
"path": "specs/ecdsap256/cavp_parse.py",
"copies": "1",
"size": "5422",
"license": "apache-2.0",
"hash": 6193129689847460000,
"line_mean": 29.2905027933,
"line_max": 129,
"alpha_frac": 0.4201401697,
"autogenerated": false,
"ratio": 3.82909604519774,
"config_test... |
#!/bin/python3
import argparse
import re
import random
if __name__ == '__main__':
parser = argparse.ArgumentParser(description='Generate HMAC-DRBG CAVP test vectors.')
parser.add_argument('FILE', type=str, help='CAVP rsp file.')
parser.add_argument('--prob', type=int, choices=range(1,100), default=1, help... | {
"repo_name": "mitls/hacl-star",
"path": "specs/drbg/cavp_parse.py",
"copies": "1",
"size": "2670",
"license": "apache-2.0",
"hash": 8940584498288721000,
"line_mean": 33.6753246753,
"line_max": 129,
"alpha_frac": 0.4951310861,
"autogenerated": false,
"ratio": 3.7394957983193278,
"config_test": ... |
#!/bin/python3
import argparse
import sys, os
import subprocess
import shutil
import urllib.request
from zipfile import ZipFile
import re
parser = argparse.ArgumentParser(description='Set up a Kattis skeleton')
parser.add_argument('name', help='the name of the problem')
args = parser.parse_args()
subprocess.check_ca... | {
"repo_name": "danielschemmel/kattis_skeleton",
"path": "get.py",
"copies": "1",
"size": "1924",
"license": "mit",
"hash": -4770196116115313000,
"line_mean": 33.375,
"line_max": 147,
"alpha_frac": 0.6444906445,
"autogenerated": false,
"ratio": 2.9019607843137254,
"config_test": false,
"has_no... |
#!/bin/python3
import colorsys
import sys
# Color scheme formula:
# dictionary of all the keys found in the color.conf file, with as value
# a tuple of hue, saturation, and value adjustments
recipe1 = {
"dmenu color": {
"c_m_normal_bg": (0, -0.5, -0.7),
"c_m_normal_fg": (0, -0.8, 0),
"c_m... | {
"repo_name": "michd/dotfiles",
"path": ".config/i3/config.d/available/colorgen.py",
"copies": "1",
"size": "6248",
"license": "unlicense",
"hash": 8756795267686845000,
"line_mean": 27.9259259259,
"line_max": 79,
"alpha_frac": 0.509603073,
"autogenerated": false,
"ratio": 2.6340640809443507,
"c... |
#!/bin/python3
import copy
import operator
from collections import Counter
from collections import defaultdict
from functools import reduce
def prod(iterable):
return reduce(operator.mul, iterable, 1)
class HashableDict(dict):
def __key(self):
return tuple((k, self[k]) for k in sorted(self))
d... | {
"repo_name": "rootulp/hackerrank",
"path": "python/ctci-coin-change.py",
"copies": "1",
"size": "1519",
"license": "mit",
"hash": 9197019292732108000,
"line_mean": 28.2115384615,
"line_max": 77,
"alpha_frac": 0.6175115207,
"autogenerated": false,
"ratio": 3.6166666666666667,
"config_test": fal... |
!#/bin/python3
import csv
import fractions
#read in file data to memory
def fileto_memory():
data = []
with open('rawdata.csv', 'r') as file:
reader = csv.reader(file, delimiter=',')
for row in reader:
data += row
# data in row appears as:
# timestamp, then
# data, then... | {
"repo_name": "bjester/project-leda",
"path": "util/leda-decode.py",
"copies": "1",
"size": "4939",
"license": "mit",
"hash": 6247830475791265000,
"line_mean": 33.0620689655,
"line_max": 110,
"alpha_frac": 0.613484511,
"autogenerated": false,
"ratio": 3.3621511232130703,
"config_test": false,
... |
#!/bin/python3
import csv
import json
import sys
# usage: tsv_to_json.py tsv_file
# 0 1 2 3 4 5
fields = ['available', 'type', 'group', 'native', 'botanical', 'common',
# 6 7 8 9
'zones14_17',... | {
"repo_name": "kielni/toyon",
"path": "scripts/tsv_to_json.py",
"copies": "1",
"size": "1597",
"license": "mit",
"hash": -7728094270400161000,
"line_mean": 29.1320754717,
"line_max": 78,
"alpha_frac": 0.3907326237,
"autogenerated": false,
"ratio": 3.4642082429501087,
"config_test": false,
"ha... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.