text stringlengths 0 1.05M | meta dict |
|---|---|
#!/bin/python
import unittest
import os
from file_client import FileClient
from util import Logger
path = 'test\\'
table_name = 'test_query'
columns = ['date', 'time', 'k', 'v', 'v2']
types = ['text', 'text', 'int PRIMARY KEY', 'text', 'decimal(10,5)']
class SqliteClientTest(unittest.TestCase):
@classmethod
... | {
"repo_name": "Aurora-Team/BitcoinExchangeFH",
"path": "befh/test/test_file_client.py",
"copies": "1",
"size": "4185",
"license": "apache-2.0",
"hash": -1054063822543044000,
"line_mean": 35.0775862069,
"line_max": 83,
"alpha_frac": 0.5734767025,
"autogenerated": false,
"ratio": 3.206896551724138,... |
#!/bin/python
import unittest
from pg import PassphraseGenerator
class TestMatrixMethods(unittest.TestCase):
def setUp(self):
pass
def test_number_generator(self):
pg = PassphraseGenerator()
rstart = 1
rstop = 6
number = pg.generate_random_number(rstart, rstop)
... | {
"repo_name": "rijkstofberg/passphrase-generator",
"path": "test_pg.py",
"copies": "1",
"size": "1541",
"license": "mit",
"hash": -2280469146010247700,
"line_mean": 31.1041666667,
"line_max": 79,
"alpha_frac": 0.6145360156,
"autogenerated": false,
"ratio": 3.6516587677725116,
"config_test": tru... |
#!/bin/python
import unittest
from src import somewhat_homomorphic_scheme
def add_then_multiply(arithmetic, ciphertexts, evaluation_key):
output_c1 = arithmetic.homomorphic_add(ciphertexts[0:4])
output_c2 = arithmetic.homomorphic_add(ciphertexts[4:])
final_output = arithmetic.homomorphic_multiply(output_... | {
"repo_name": "UMComp4140ATeam/Raymond",
"path": "experiments/somewhat_homomorphic_experiment.py",
"copies": "1",
"size": "3112",
"license": "mit",
"hash": -3280892806252231000,
"line_mean": 41.0675675676,
"line_max": 106,
"alpha_frac": 0.6886246787,
"autogenerated": false,
"ratio": 3.78128797083... |
#!/bin/python
import urllib2
from lxml import etree
from lxml import objectify
import random
import base64
import ssl
print_query = False
#Dump Object Function
def dump(obj):
for attr in dir(obj):
print "obj.%s = %s" % (attr, getattr(obj, attr))
#Request parser
def request(connection, call, parameters... | {
"repo_name": "Red5d/pnexpose",
"path": "pnexpose.py",
"copies": "1",
"size": "20781",
"license": "bsd-3-clause",
"hash": -2534890087946230000,
"line_mean": 36.9215328467,
"line_max": 151,
"alpha_frac": 0.6138780617,
"autogenerated": false,
"ratio": 4.011001737116387,
"config_test": true,
"ha... |
#!/bin/python
import urllib2
import re
def gettxt():
"""all page txt"""
try:
username = "ci"
password = "sp12345678"
top_level_url = "http://glue.spolo.org"
url = "http://glue.spolo.org/trac/glue/wiki/xuanran001-3.0/www?format=txt"
# create a password manager
p... | {
"repo_name": "xxd3vin/spolo",
"path": "pageman/main.py",
"copies": "1",
"size": "1414",
"license": "mit",
"hash": 7029896839851010000,
"line_mean": 23.8070175439,
"line_max": 82,
"alpha_frac": 0.5707213579,
"autogenerated": false,
"ratio": 3.5888324873096447,
"config_test": false,
"has_no_ke... |
#!/bin/python
import urllib, urllib2, base64, sys, json
if (len(sys.argv) != 4):
print "This fetches ticket data related to a sprint.ly product and writes"
print "it to sprintlyData.json"
print ""
print "Please run again with the following arguments:"
print "1. Username"
print "2. API key (fro... | {
"repo_name": "SteveRidout/sprintly-to-github",
"path": "getSprintlyData.py",
"copies": "1",
"size": "2961",
"license": "mit",
"hash": 1823513585635805200,
"line_mean": 27.2,
"line_max": 113,
"alpha_frac": 0.6214116852,
"autogenerated": false,
"ratio": 3.5760869565217392,
"config_test": false,
... |
#!/bin/python
import urllib, urllib2, base64, sys, json, time
from datetime import datetime
if (len(sys.argv) != 5):
print "This pushes sprintly data in sprintlyData.json to github"
print ""
print "Please run again with the following arguments:"
print "1. Github username"
print "2. Github password... | {
"repo_name": "SteveRidout/sprintly-to-github",
"path": "sendToGithub.py",
"copies": "1",
"size": "5197",
"license": "mit",
"hash": -611340245906296800,
"line_mean": 30.119760479,
"line_max": 99,
"alpha_frac": 0.5907254185,
"autogenerated": false,
"ratio": 3.720114531138153,
"config_test": fals... |
#!./bin/python
import xmlrpc.client
import configparser
import os
from unixstreamtransport import UnixStreamTransport
class RTorrentXMLRPCClient(xmlrpc.client.ServerProxy):
def __init__(self, config_path):
self._config_path = config_path
config = configparser.ConfigParser()
config.read(sel... | {
"repo_name": "lfxgroove/rtorrent-interface",
"path": "rpc.py",
"copies": "1",
"size": "3373",
"license": "mit",
"hash": 7827064944836876000,
"line_mean": 38.6823529412,
"line_max": 217,
"alpha_frac": 0.5760450637,
"autogenerated": false,
"ratio": 3.4278455284552845,
"config_test": true,
"has... |
#!/bin/python
import yaml
import telegram
from io import open
class user_interface():
class keyboard:
HIDDEN = 0
NO_EFFECT = 1
START = 2
BACK = 3
YES_NO = 4
YES_CONTACT_NO = 5
def __init__(self, platform, channel_name, file_path):
self.platform = platfo... | {
"repo_name": "gavincyi/Telex",
"path": "src/user_interface.py",
"copies": "1",
"size": "13428",
"license": "apache-2.0",
"hash": 6014385936260705000,
"line_mean": 39.4457831325,
"line_max": 112,
"alpha_frac": 0.4999255287,
"autogenerated": false,
"ratio": 4.6803764377832,
"config_test": false,... |
#!/bin/python
import zmq
from threading import Thread, Condition
from protocol import compose_mining_result, parse_mining_task
from cpu_miner import mine
context = zmq.Context()
HOST = "tcp://127.0.0.1:"
PORT = 8080
pending_template = None
template = None
template_received = Condition()
def listening_thread():
... | {
"repo_name": "DrPandemic/pickaxe",
"path": "miner/miner.py",
"copies": "1",
"size": "1493",
"license": "mit",
"hash": -16439236602411600,
"line_mean": 24.3050847458,
"line_max": 79,
"alpha_frac": 0.6563965171,
"autogenerated": false,
"ratio": 3.9497354497354498,
"config_test": false,
"has_no... |
#!/bin/python
# Include the Dropbox SDK libraries
from dropbox import client, rest, session
import os, sys
# Get your app key and secret from the Dropbox developer website
APP_KEY = ''
APP_SECRET = ''
TOKEN = './access.txt'
# ACCESS_TYPE should be 'dropbox' or 'app_folder' as configured for your app
ACCESS_TYPE = 'dro... | {
"repo_name": "bry012/Combicloud",
"path": "dropbox2.py",
"copies": "1",
"size": "2717",
"license": "mit",
"hash": 484805123679625860,
"line_mean": 27.3020833333,
"line_max": 89,
"alpha_frac": 0.6783216783,
"autogenerated": false,
"ratio": 2.856992639327024,
"config_test": false,
"has_no_keyw... |
#!/bin/python
"""
In this challenge, don't print every time you move an element. Instead, print the array after each iteration of the insertion-sort, i.e., whenever the next element is placed at its correct position.
Since the array composed of just the first element is already "sorted", begin printing from the second... | {
"repo_name": "codecakes/algorithms",
"path": "algorithms/code30DaysImp/insertion_sort.py",
"copies": "1",
"size": "1432",
"license": "mit",
"hash": 8560613179226939000,
"line_mean": 26.5576923077,
"line_max": 223,
"alpha_frac": 0.6724860335,
"autogenerated": false,
"ratio": 3.4841849148418493,
... |
#!/bin/python
#
# IOC processor for manual and automatic sources
# by Garrett Elkins
# V 0.9
# 8/21/17
#
import csv
import urllib2
import datetime
import os
import re
def main():
master_list = list()
# Open the configuration file and pull sources
with open('input.csv') as sources_file:
sources = ... | {
"repo_name": "lonewolf896/psychic-octo-fortnight",
"path": "ioc_processor.py",
"copies": "1",
"size": "6275",
"license": "mit",
"hash": 5001887912357768000,
"line_mean": 31.1794871795,
"line_max": 130,
"alpha_frac": 0.5767330677,
"autogenerated": false,
"ratio": 3.9968152866242037,
"config_tes... |
#!/bin/python
# JIRAPy Interface for JIRA JSON API
# Written by Ewen McCahon, 2017
# Version 0.0.1
import json
import logging
import requests
if __name__ == "__main__":
print "JIRAPy Helper Classes. Import for helpful functions"
class JiraTicket:
"""
JIRATicket
Helper Library for using the JIRA JSON... | {
"repo_name": "Neko-Design/jirapy",
"path": "jirapy/jirapy.py",
"copies": "1",
"size": "3509",
"license": "apache-2.0",
"hash": -301761424184098300,
"line_mean": 32.419047619,
"line_max": 95,
"alpha_frac": 0.550584212,
"autogenerated": false,
"ratio": 4.305521472392638,
"config_test": false,
... |
#!/bin/python
# Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The ASF licenses this file
# to you under the Apache License, Version 2.0 (the
# "License")... | {
"repo_name": "kou/arrow",
"path": "cpp/src/arrow/util/bpacking_simd_codegen.py",
"copies": "4",
"size": "6611",
"license": "apache-2.0",
"hash": -2514633555260278000,
"line_mean": 30.6315789474,
"line_max": 100,
"alpha_frac": 0.5690515807,
"autogenerated": false,
"ratio": 3.84137129575828,
"co... |
#<license>MIT License</license>
#<author>Anjum Ahuja</author>
#<repo>https://github.com/jack8daniels2/pixels</repo>
import os
import urllib
import random
#from PIL import Image
colors = ['#779ECB', '#A1CAF1', '#ADDFAD', '#DEA5A4','#CB99C9', '#B39EB5']
image_types = ['jpg','tif']
top = 'images'
def generate_image_md... | {
"repo_name": "jack8daniels2/pixels",
"path": "generate_metadata.py",
"copies": "1",
"size": "1415",
"license": "mit",
"hash": 8573691290397309000,
"line_mean": 33.512195122,
"line_max": 90,
"alpha_frac": 0.5950530035,
"autogenerated": false,
"ratio": 3.036480686695279,
"config_test": false,
... |
#!/bin/python
# Maze solver
from itertools import permutations
SPACE = " "
WALL = "#"
PATH = "*"
START = "S"
EXIT = "E"
STACK = []
test_maze = """\
#########################################
# # # # # #
# # # ### # # ### # ####### ### ####### #
# #S# # # # # # # # #
... | {
"repo_name": "Timidger/Daily-Programmer",
"path": "Python/MazeSolver.py",
"copies": "1",
"size": "4374",
"license": "mit",
"hash": 208999939074094800,
"line_mean": 31.4,
"line_max": 70,
"alpha_frac": 0.3477366255,
"autogenerated": false,
"ratio": 2.904382470119522,
"config_test": false,
"has... |
#!/bin/python
# Migration script for Redis keystore and WARC layout from Webrecorder 2.0 -> Webrecorder 3.0
#
# Assumes WARCs stored in S3
#
# Designed to run with S3 credentials and following env variables:
# SRC_REDIS: url to src redis
# DEST_REDIS: url to dest redis
# DEST_PREFIX: destination in form of 's3://bucke... | {
"repo_name": "webrecorder/webrecorder",
"path": "webrecorder/migration_scripts/migrate3.0.py",
"copies": "1",
"size": "10369",
"license": "apache-2.0",
"hash": -4166814371071790600,
"line_mean": 26.5771276596,
"line_max": 95,
"alpha_frac": 0.5336097984,
"autogenerated": false,
"ratio": 3.4877228... |
#!/bin/python
# -*- Mode: python; c-basic-offset: 4; indent-tabs-mode: nil; tab-width: 40 -*-
# This Source Code Form is subject to the terms of the Mozilla Public
# License, v. 2.0. If a copy of the MPL was not distributed with this
# file, You can obtain one at http://mozilla.org/MPL/2.0/.
'''
Script to generate Th... | {
"repo_name": "jrconlin/mc_backup",
"path": "base/widget/generate_themed_views.py",
"copies": "1",
"size": "2179",
"license": "mpl-2.0",
"hash": -1323086115921022000,
"line_mean": 32.0151515152,
"line_max": 79,
"alpha_frac": 0.6727856815,
"autogenerated": false,
"ratio": 3.415360501567398,
"con... |
#!/bin/python
# -*- Mode: python; indent-tabs-mode: nil; tab-width: 40 -*-
# This Source Code Form is subject to the terms of the Mozilla Public
# License, v. 2.0. If a copy of the MPL was not distributed with this
# file, You can obtain one at http://mozilla.org/MPL/2.0/.
'''
Script to generate Themed*.java source f... | {
"repo_name": "Yukarumya/Yukarum-Redfoxes",
"path": "mobile/android/base/java/org/mozilla/gecko/widget/themed/generate_themed_views.py",
"copies": "1",
"size": "2416",
"license": "mpl-2.0",
"hash": 5311017197452365000,
"line_mean": 32.5555555556,
"line_max": 98,
"alpha_frac": 0.6684602649,
"autogen... |
#!/bin/python
#
# My attempt at implementing SCIRL from:
# Klein, Edouard, et al. "Inverse reinforcement learning through structured
# classification." Advances in Neural Information Processing Systems. 2012
# http://papers.nips.cc/paper/4551-inverse
#
from MDP import mdp
import numpy as np
import sys
# === feature e... | {
"repo_name": "corcra/pRLy",
"path": "SCIRL/SCIRL.py",
"copies": "1",
"size": "7757",
"license": "mit",
"hash": 8612482125213167000,
"line_mean": 40.7043010753,
"line_max": 106,
"alpha_frac": 0.5900476989,
"autogenerated": false,
"ratio": 3.7257444764649374,
"config_test": false,
"has_no_keyw... |
#!/bin/python
"""
1. Write a function called has_duplicates that takes a list and returns True if there is any
element that appears more than once. It should not modify the original list.
2. If there are 23 students in your class, what are the chances that two of you have the same
birthday? You can estimate this prob... | {
"repo_name": "tarunchhabra26/fss16dst",
"path": "code/3/birthday_paradox.py",
"copies": "1",
"size": "2295",
"license": "apache-2.0",
"hash": 1398459707330841000,
"line_mean": 27.6875,
"line_max": 107,
"alpha_frac": 0.6801742919,
"autogenerated": false,
"ratio": 3.943298969072165,
"config_test... |
"""
author : Akshay Vilekar
Load the dialog box and choose file
"""
## imports
import tkFileDialog
import tkMessageBox
import tkSimpleDialog
import os
# global variable filename
infilename = ''
def encrypt():
global infilename
## open the temporary file and deal with it
filep = ... | {
"repo_name": "ak2703/Cifrare",
"path": "load.py",
"copies": "1",
"size": "2100",
"license": "mit",
"hash": 1135697034958695200,
"line_mean": 25.582278481,
"line_max": 126,
"alpha_frac": 0.5104761905,
"autogenerated": false,
"ratio": 4.030710172744722,
"config_test": false,
"has_no_keywords":... |
#!/bin/python
"""
Build a calendar.
A meeting is stored as a tuple of integers (start_time, end_time).
These integers represent the number of 30-minute blocks past 9:00am.
For example:
(2, 3)# Meeting from 10:00-10:30 am
(6, 9)# Meeting from 12:00-1:30 pm
Write a function merge_ranges() that takes a list of multi... | {
"repo_name": "bt3gl/Python-and-Algorithms-and-Data-Structures",
"path": "First_edition_2014/other_resources/interview_cake/strings/hical_str_manipulation.py",
"copies": "1",
"size": "1789",
"license": "mit",
"hash": 7442724739509805000,
"line_mean": 34.0784313725,
"line_max": 121,
"alpha_frac": 0.68... |
#!/bin/python
"""
cmb.py
jlazear
2/3/15
Generates C_l's.
NOTE: This module is currently minimally functional. The Python wrapper of
CLASS is significantly less powerful and easy to use than the C version.
Currently, this module only allows the user to import the Lambda-CDM model from
the CLASS default lcdm parameter... | {
"repo_name": "jlazear/cmb",
"path": "lib/cmb.py",
"copies": "1",
"size": "9131",
"license": "apache-2.0",
"hash": 8636586633105455000,
"line_mean": 35.8225806452,
"line_max": 80,
"alpha_frac": 0.6166903954,
"autogenerated": false,
"ratio": 3.568190699491989,
"config_test": false,
"has_no_key... |
#!/bin/python
"""
Consider an array of integers, A = [a1,a2, ...., an] . The distance between two indices, i and , j is denoted by .
d[i,j] =
Given A, find the minimum d[i,j] such that A[i] = A[j] and . In other words, find the minimum distance between any
pair of equal elements in the array. If no such value exist... | {
"repo_name": "tarunchhabra26/PythonPlayground",
"path": "Minimum Value Distances/distance.py",
"copies": "1",
"size": "1159",
"license": "mit",
"hash": -7742646074053732000,
"line_mean": 22.6530612245,
"line_max": 116,
"alpha_frac": 0.6212251941,
"autogenerated": false,
"ratio": 3.01038961038961... |
#!/bin/python
"""
Context
Given a 2D Array, :
1 1 1 0 0 0
0 1 0 0 0 0
1 1 1 0 0 0
0 0 0 0 0 0
0 0 0 0 0 0
0 0 0 0 0 0
We define an hourglass in to be a subset of values with indices falling in this pattern in 's graphical representation:
a b c
d
e f g
There are hourglasses in , and an hourglass sum is the sum o... | {
"repo_name": "codecakes/algorithms_monk",
"path": "matrix_array_sum/2d_grid_pattern_maxsum.py",
"copies": "1",
"size": "1766",
"license": "mit",
"hash": -5520410341138681000,
"line_mean": 19.5465116279,
"line_max": 155,
"alpha_frac": 0.5917327293,
"autogenerated": false,
"ratio": 2.6437125748502... |
#!/bin/python
"""
conversions.py
jlazear
1/20/15
Unit conversions for working with CMB data.
Example:
<example code here>
"""
__version__ = 20150120
__releasestatus__ = 'beta'
import numpy as np
c = 299792458. # m/s
h = 6.62606957e-34 # m^2*kg/s
kB = 1.3806488e-23 # m^2*kg/s^2 K
MJypsr = 1.e-20 # (W... | {
"repo_name": "jlazear/cmb",
"path": "lib/conversions.py",
"copies": "1",
"size": "2603",
"license": "apache-2.0",
"hash": -3841861156112606700,
"line_mean": 25.5714285714,
"line_max": 79,
"alpha_frac": 0.651555897,
"autogenerated": false,
"ratio": 2.998847926267281,
"config_test": false,
"ha... |
#
# Copyright 2014 Gedare Bloom (gedare@rtems.org)
#
# This file's license is 2-clause BSD as in this distribution's LICENSE.2 file.
#
##
## Generate param.h and param.i for benchmark
##
import random
import math
import sys
import getopt
import array
import os
import copy
## TODO:
#
# Make each task have separate ... | {
"repo_name": "gedare/pqstbench",
"path": "generators/genparams.py",
"copies": "1",
"size": "20971",
"license": "bsd-2-clause",
"hash": -3890658423335656000,
"line_mean": 28.0457063712,
"line_max": 182,
"alpha_frac": 0.5763673645,
"autogenerated": false,
"ratio": 2.9248256624825664,
"config_tes... |
#
# Copyright 2014 Gedare Bloom (gedare@rtems.org)
#
# This file's license is 2-clause BSD.
##
## Replace license terms in C source and header files
##
import getopt
import os
import re
import string
import subprocess
import sys
def usage():
print "\
Usage: modify-license.py -[hm]\n\
-h --help print t... | {
"repo_name": "gedare/scripts",
"path": "modify-license.py",
"copies": "1",
"size": "4808",
"license": "bsd-2-clause",
"hash": 1345014356381481200,
"line_mean": 28.4969325153,
"line_max": 104,
"alpha_frac": 0.5754991681,
"autogenerated": false,
"ratio": 3.8742949234488315,
"config_test": false,... |
#
# Copyright 2020 StreamSets Inc.
#
# 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 agreed to in wr... | {
"repo_name": "kunickiaj/datacollector",
"path": "dist/src/test/libexec/mock_cmd.py",
"copies": "2",
"size": "1627",
"license": "apache-2.0",
"hash": -2809864338798765000,
"line_mean": 35.9772727273,
"line_max": 147,
"alpha_frac": 0.7240319607,
"autogenerated": false,
"ratio": 3.575824175824176,
... |
#
# Copyright (c) 2013-2015 Kevin Steves <kevin.steves@pobox.com>
#
# Permission to use, copy, modify, and distribute this software for any
# purpose with or without fee is hereby granted, provided that the above
# copyright notice and this permission notice appear in all copies.
#
# THE SOFTWARE IS PROVIDED "AS IS" A... | {
"repo_name": "kyilmaz80/paloalto",
"path": "pan-python-master/build/scripts-2.7/panwfapi.py",
"copies": "1",
"size": "19930",
"license": "apache-2.0",
"hash": 5510168722725714000,
"line_mean": 31.3538961039,
"line_max": 80,
"alpha_frac": 0.5015554441,
"autogenerated": false,
"ratio": 4.205528592... |
#!/bin/python
def contains(input_list, e):
""" determines whether e is contained in the list """
for elem in input_list: # elem is short for element (an item in the list)
if elem == e:
return True
return False
integer_list = [0, 1, 2, 3]
print("")
print("Does the list contain 3?:",... | {
"repo_name": "introprogramming/exercises",
"path": "exercises/getting_started/contains.py",
"copies": "1",
"size": "1244",
"license": "mit",
"hash": 7768904217428564000,
"line_mean": 28.619047619,
"line_max": 78,
"alpha_frac": 0.6864951768,
"autogenerated": false,
"ratio": 3.5141242937853105,
... |
#!/bin/python
"""
Each round, players receive a score between 0 and 100, which you use to rank them from highest to lowest. So far you're using an algorithm that sorts in O(n\lg{n})O(nlgn) time, but players are complaining that their rankings aren't updated fast enough. You need a faster sorting algorithm.
Write a fu... | {
"repo_name": "bt3gl/Python-and-Algorithms-and-Data-Structures",
"path": "First_edition_2014/other_resources/interview_cake/data_structures/angry_bird.py",
"copies": "1",
"size": "1032",
"license": "mit",
"hash": 6447115090634996000,
"line_mean": 26.8918918919,
"line_max": 289,
"alpha_frac": 0.678294... |
#!/bin/python
newVolumeScript=[
"#! /bin/bash",
"# For this script it's advisable to use a shell, such as Bash,",
"# that supports a TAR_FD value greater than 9.",
"echo Preparing volume $TAR_VOLUME of $TAR_ARCHIVE.",
"name=`expr $TAR_ARCHIVE : '\(.*\)-.*'`",
"case $TAR_SUBCOMMAND in",
"-c) ;;",
"-d|-x|-t) test ... | {
"repo_name": "treecode/Bonsai",
"path": "tools/tarScripts/tarSnapshots.py",
"copies": "1",
"size": "2841",
"license": "apache-2.0",
"hash": -496440654286366140,
"line_mean": 24.1415929204,
"line_max": 144,
"alpha_frac": 0.6244280183,
"autogenerated": false,
"ratio": 2.981112277019937,
"config_... |
"""
Fault Injection Tool
Authors: Nisrine jafri, Thomas Given-Wilson
Contact: nisrine.jafri@inria.fr
"""
# Required imports
import mmap
import sys, getopt
import os.path
import argparse
from argparse import RawTextHelpFormatter,SUPPRESS
"""
Fault Models Functions
"""
"""
Function ZeroByteFM(infile,outfile,posi... | {
"repo_name": "nisrine/Fault-Injection-Tool",
"path": "faultinject.py",
"copies": "1",
"size": "10861",
"license": "mit",
"hash": -5458767839418044000,
"line_mean": 35.4463087248,
"line_max": 495,
"alpha_frac": 0.6663290673,
"autogenerated": false,
"ratio": 3.4945302445302446,
"config_test": fa... |
#!/bin/python
# +-----------------------------------------------------------------------+
# | File Name: turing_bot.py |
# +-----------------------------------------------------------------------+
# | Description: Turing watches an IRC channel and responds to prompts |
#... | {
"repo_name": "wyldbrian/turing",
"path": "turing_bot.py",
"copies": "1",
"size": "23643",
"license": "mit",
"hash": 7076673057906263000,
"line_mean": 36.8894230769,
"line_max": 155,
"alpha_frac": 0.5054773083,
"autogenerated": false,
"ratio": 3.776233828461907,
"config_test": true,
"has_no_k... |
#!/bin/python
"""
@file
@brief Utility to support the parsing and transformation of tabular
representations of state machines into other formats
Part of StateTableTools - https://github.com/bright-tools/StateTableTools
@author John Bailey <dev@brightsilence.com>
@copyright Copyright 201... | {
"repo_name": "bright-tools/StateTableTools",
"path": "src/StateTable.py",
"copies": "1",
"size": "4971",
"license": "apache-2.0",
"hash": 211327661592767780,
"line_mean": 34.0070422535,
"line_max": 102,
"alpha_frac": 0.574733454,
"autogenerated": false,
"ratio": 4.11166253101737,
"config_test"... |
#!/bin/python
"""
fill
"""
from optparse import OptionParser
import prody
from sys import exit
import numpy as np
from math import sin, cos
from subprocess import check_call
import csv
def normalize_list( l ):
m = min( l )
r = max( l ) - m
l = [ ( x - m )/ r for x in l ]
return l
def initialize_res_score ( mod... | {
"repo_name": "flicopter/ppi_feature_trees",
"path": "Scripts/contactmap.py",
"copies": "1",
"size": "8491",
"license": "mit",
"hash": 2654640978644205000,
"line_mean": 30.2169117647,
"line_max": 121,
"alpha_frac": 0.6399717348,
"autogenerated": false,
"ratio": 2.5300953516090585,
"config_test"... |
#!/bin/python
"""
foregrounds.py
jlazear
1/20/15
Tools for constructing CMB foregrounds.
Long description
Example:
<example code here>
"""
__version__ = 20150120
__releasestatus__ = 'beta'
import inspect
import os
import numpy as np
from astropy.io import fits
import healpy as hp
import lib
# Path to the cmb/... | {
"repo_name": "jlazear/cmb",
"path": "lib/foregrounds.py",
"copies": "1",
"size": "7013",
"license": "apache-2.0",
"hash": -278290131313522800,
"line_mean": 33.0436893204,
"line_max": 79,
"alpha_frac": 0.6589191501,
"autogenerated": false,
"ratio": 3.312706660368446,
"config_test": false,
"ha... |
#!bin/python
from bs4 import BeautifulSoup
import argparse
import io
import os
import re
import sys
import time
import urllib
import urlparse
parser = argparse.ArgumentParser(description= \
'Converts Blogger export to seperate jekyll markdown files.')
parser.add_argument("Input", help="The Blogger... | {
"repo_name": "progrn/csb",
"path": "convert.py",
"copies": "1",
"size": "4021",
"license": "mit",
"hash": -6646992567531626000,
"line_mean": 24.13125,
"line_max": 82,
"alpha_frac": 0.5891569261,
"autogenerated": false,
"ratio": 3.5710479573712255,
"config_test": true,
"has_no_keywords": fals... |
#!/bin/python
"""
Functions used for post-docking analysis
"""
from optparse import OptionParser
import prody
from sys import exit
import numpy as np
from math import sin, cos
from subprocess import check_call
import csv
def normalize_list( l ):
m = min( l )
r = max( l ) - m
l = [ ( x - m )/ r for x in l ]
retu... | {
"repo_name": "flicopter/ppi_feature_trees",
"path": "Scripts/dockingpp.py",
"copies": "1",
"size": "2555",
"license": "mit",
"hash": -3348296411975741400,
"line_mean": 22.018018018,
"line_max": 80,
"alpha_frac": 0.6340508806,
"autogenerated": false,
"ratio": 2.539761431411531,
"config_test": f... |
#!/bin/python
"""
generate_images.py
jlazear
1/22/15
Generates images used in the docs files.
Example:
$ python generate_images.py
"""
__version__ = 20150122
__releasestatus__ = 'beta'
import os
import sys
import argparse
import wget
import numpy as np
import healpy as hp
import matplotlib.pyplot as plt
imgpath... | {
"repo_name": "jlazear/cmb",
"path": "docs/img/generate_images.py",
"copies": "1",
"size": "10216",
"license": "apache-2.0",
"hash": 4496414005100550000,
"line_mean": 35.2269503546,
"line_max": 104,
"alpha_frac": 0.5720438528,
"autogenerated": false,
"ratio": 2.6377485153627678,
"config_test": ... |
#!/bin/python
"""
get_data.py
jlazear
1/6/15
Pull WMAP data from LAMBDA.
Example:
$ cd /path/to/cmb/data
$ python get_data.py
Make sure the cmb base directory is in your $PYTHONPATH.
"""
__version__ = 20150106
__releasestatus__ = 'beta'
import inspect
import os
import tarfile
import wget
import lib
# Path to th... | {
"repo_name": "jlazear/cmb",
"path": "data/get_data.py",
"copies": "1",
"size": "1759",
"license": "apache-2.0",
"hash": -9077885547268138000,
"line_mean": 27.8524590164,
"line_max": 79,
"alpha_frac": 0.6219442865,
"autogenerated": false,
"ratio": 2.6530920060331824,
"config_test": false,
"ha... |
#!/bin/python
"""
Given a 6x6 2D Array, A:
1 1 1 0 0 0
0 1 0 0 0 0
1 1 1 0 0 0
0 0 0 0 0 0
0 0 0 0 0 0
0 0 0 0 0 0
We can find 16 hourglasses in A; we define an hourglass in A to be a subset of values with indexes falling in this pattern in A's graphical representation:
a b c
d
e f g
The sum of an hourglass is t... | {
"repo_name": "codecakes/algorithms",
"path": "algorithms/code30DaysImp/grid_sum.py",
"copies": "1",
"size": "2636",
"license": "mit",
"hash": -1132130831841018900,
"line_mean": 21.3474576271,
"line_max": 155,
"alpha_frac": 0.5250379363,
"autogenerated": false,
"ratio": 2.6870540265035676,
"con... |
#!/bin/python
"""
Given a list of integers, find the highest product you can get from three of the integers.
The input list_of_ints will always have at least three integers.
"""
def highest_num(list_of_ints):
if len(list_of_ints) == 3:
return list_of_ints[0]*list_of_ints[1]*list_of_ints[2]
sorted_l... | {
"repo_name": "bt3gl/Python-and-Algorithms-and-Data-Structures",
"path": "First_edition_2014/other_resources/interview_cake/math/highest_product_3_int.py",
"copies": "1",
"size": "1615",
"license": "mit",
"hash": -955249357560629200,
"line_mean": 28.9259259259,
"line_max": 90,
"alpha_frac": 0.5727554... |
#!/bin/python
"""
Given two integers, L and R, find the maximal value of A xor B, where A and B satisfy the following condition:
L<=A<=B<=R
Input Format
The input contains two lines; L is present in the first line and R in the second line.
Constraints
1<=L<=R<=10**3
Output Format
The maximal value as mentioned i... | {
"repo_name": "codecakes/algorithms",
"path": "algorithms/code30DaysImp/maximum_xor_range.py",
"copies": "1",
"size": "1345",
"license": "mit",
"hash": 197934301444556060,
"line_mean": 15.2168674699,
"line_max": 110,
"alpha_frac": 0.5821561338,
"autogenerated": false,
"ratio": 2.717171717171717,
... |
#!/bin/python
"""
ilc_foreground_cleaning.py
jlazear
2/11/15
One-line description
Long description
Example:
<example code here>
"""
__version__ = 20150211
import inspect
import os
import collections
import numpy as np
import healpy as hp
import lib
datapath = os.path.abspath(os.path.dirname(os.path.abspath(i... | {
"repo_name": "jlazear/cmb",
"path": "calculations/ilc_foreground_cleaning.py",
"copies": "1",
"size": "10940",
"license": "apache-2.0",
"hash": -4562576813394552300,
"line_mean": 37.7943262411,
"line_max": 84,
"alpha_frac": 0.5871115174,
"autogenerated": false,
"ratio": 3.139167862266858,
"con... |
#!/bin/python
"""
ilc.py
jlazear
1/16/15
Internal Linear Combination method of foreground cleaning.
Provides tools for generating CMB maps with foregrounds cleaned using
the Internal Linear Combination (ILC) method.
Example:
See main() of this file.
"""
__version__ = 20150116
__releasestatus__ = 'beta'
import num... | {
"repo_name": "jlazear/cmb",
"path": "lib/ilc.py",
"copies": "1",
"size": "5783",
"license": "apache-2.0",
"hash": 2278436478382290200,
"line_mean": 31.8579545455,
"line_max": 78,
"alpha_frac": 0.6327165831,
"autogenerated": false,
"ratio": 3.3466435185185186,
"config_test": false,
"has_no_ke... |
#!/bin/python
import smtplib
import imaplib
import email
def send_email(to_addr, contents, username, password):
server = smtplib.SMTP('smtp.gmail.com:587')
server.starttls()
server.login(username, password)
server.sendmail(username,to_addr,contents)
server.quit()
def receive_email_user(from_addr, username, pas... | {
"repo_name": "ericponce/assassin-server",
"path": "src/email_util.py",
"copies": "1",
"size": "1529",
"license": "mit",
"hash": 6358917304260219000,
"line_mean": 21.8358208955,
"line_max": 54,
"alpha_frac": 0.6801831262,
"autogenerated": false,
"ratio": 2.7952468007312614,
"config_test": false... |
#!/bin/python
import struct
from somnLib import *
class SomnPacketType():
Unknown = "Unknown"
Message = "Message"
RouteRequest = "RouteRequest"
BadRoute = "BadRoute"
AddConnection = "AddConnection"
DropConnection = "DropConnection"
NodeEnrollment = "NodeEnrollment"
class SomnPacket:
... | {
"repo_name": "squidpie/somn",
"path": "src/somnPkt.py",
"copies": "1",
"size": "10961",
"license": "mit",
"hash": -7430636544424103000,
"line_mean": 39.003649635,
"line_max": 160,
"alpha_frac": 0.5761335645,
"autogenerated": false,
"ratio": 3.812521739130435,
"config_test": false,
"has_no_ke... |
#!/bin/python
"""
Inserts a banner into every .html file found in the specified directory.
Two arguments to the script are the banner.html file location, and the
folder containing the html files.
"""
import sys
import os.path
import re
with open(sys.argv[1], 'rb') as f:
banner_html = f.read()
banner_and_body_t... | {
"repo_name": "datagovuk/reserve",
"path": "insert_banner.py",
"copies": "1",
"size": "1262",
"license": "mit",
"hash": 8439894771598247000,
"line_mean": 26.4347826087,
"line_max": 95,
"alpha_frac": 0.6275752773,
"autogenerated": false,
"ratio": 3.448087431693989,
"config_test": false,
"has_n... |
#!/bin/python
"""
I want to learn some big words so people think I'm smart.
I opened up a dictionary to a page in the middle and started flipping through, looking for words I didn't know. I put each word I didn't know at increasing indices in a huge list I created in memory. When I reached the end of the dictionary, ... | {
"repo_name": "bt3gl/Python-and-Algorithms-and-Data-Structures",
"path": "First_edition_2014/other_resources/interview_cake/sort_and_search/big_words.py",
"copies": "1",
"size": "1989",
"license": "mit",
"hash": 2225308641171349800,
"line_mean": 27.4285714286,
"line_max": 332,
"alpha_frac": 0.6540975... |
#!/bin/python
"""
Julius Caesar protected his confidential information by encrypting it in a cipher. Caesar's cipher rotated every letter in a string by a fixed number, , making it unreadable by his enemies. Given a string, , and a number, , encrypt and print the resulting string.
Note: The cipher only encrypts lett... | {
"repo_name": "codecakes/algorithms_monk",
"path": "implementation/ceaser_cipher.py",
"copies": "1",
"size": "1897",
"license": "mit",
"hash": 1941885005891208000,
"line_mean": 32.8928571429,
"line_max": 302,
"alpha_frac": 0.7016341592,
"autogenerated": false,
"ratio": 3.690661478599222,
"confi... |
#!/bin/python
'''
Library for formulating and solving game trees as linear programs.
'''
class Node(object):
'''Abstract class to represent a node in the game tree.'''
def solve(self):
'''
Should populate the solutions dictionary.
solutions: TerminalNode ==> list of lists of inequali... | {
"repo_name": "jdhenke/ally",
"path": "core.py",
"copies": "1",
"size": "4087",
"license": "mit",
"hash": -6676500947068619000,
"line_mean": 32.5,
"line_max": 85,
"alpha_frac": 0.5923660387,
"autogenerated": false,
"ratio": 4.347872340425532,
"config_test": false,
"has_no_keywords": false,
... |
#!/bin/python
"""
Lisa just got a new math workbook. A workbook contains exercise problems, grouped into chapters.
There are nn chapters in Lisa's workbook, numbered from 11 to nn.
The ii-th chapter has titi problems, numbered from 11 to titi.
Each page can hold up to kk problems. There are no empty pages or unnecess... | {
"repo_name": "codecakes/algorithms_monk",
"path": "implementation/lisa_workbook_array_single_iter.py",
"copies": "1",
"size": "2037",
"license": "mit",
"hash": -8569141708702701000,
"line_mean": 30.2615384615,
"line_max": 205,
"alpha_frac": 0.6484490399,
"autogenerated": false,
"ratio": 3.489690... |
#!/bin/python
"""
Main user interface and controller for Tinbergen.
"""
import sys
import os
import gobject
import gtk
import gst
import tbdatamodel
import string
#import math
NO_TIME = float('nan')
if __name__ == '__main__':
# Get the path to this script using sys.argv[0]
script_dir = os.path.dirname(sys.a... | {
"repo_name": "biogeo/tinbergen",
"path": "tinbergen.py",
"copies": "1",
"size": "24413",
"license": "mit",
"hash": -2740307959091446000,
"line_mean": 40.0302521008,
"line_max": 91,
"alpha_frac": 0.5875148486,
"autogenerated": false,
"ratio": 3.7403094836831623,
"config_test": true,
"has_no_k... |
#!./bin/python
"""
MySQL based Ansible Dynamic Inventory
Objectives defined in the personal_project.md:
* Connect to a remote mysql server and run select commands.
* Take the return data from mysql select commands and create a specifically
useful dictionary of results (if dictionary is the right data model for
my... | {
"repo_name": "UWPCE-PythonCert/IntroPython2016",
"path": "students/jhefner/personal_project/mysql_ADI.py",
"copies": "2",
"size": "8204",
"license": "unlicense",
"hash": 5307034585919131000,
"line_mean": 36.4657534247,
"line_max": 102,
"alpha_frac": 0.5997074598,
"autogenerated": false,
"ratio":... |
#!/bin/python
'''
Given a set of distinct integers, nums, return all possible subsets.
Note:
Elements in a subset must be in non-descending order.
The solution set must not contain duplicate subsets.
input = [1,2,3]
output expected:[
[3],
[1],
[2],
[1,2,3],
[1,3],
[2,3],
[1,2],
[]
]
'''
class Soluti... | {
"repo_name": "dramaticlly/Python4Interview",
"path": "subset.py",
"copies": "1",
"size": "1285",
"license": "mit",
"hash": -2022943816247786500,
"line_mean": 18.4848484848,
"line_max": 68,
"alpha_frac": 0.6046692607,
"autogenerated": false,
"ratio": 2.6549586776859506,
"config_test": false,
... |
#!/bin/python
"""
noise.py
jlazear
3/11/15
Noise for PIPER.
Long description
Example:
<example code here>
"""
__version__ = 20150311
__releasestatus__ = 'beta'
import numpy as np
from scipy.integrate import quad
import scipy.constants
def dPdT(nu_min, nu_max, T=2.7260, eta_optical=0.42, eta_detector=0.5,
... | {
"repo_name": "jlazear/cmb",
"path": "lib/noise.py",
"copies": "1",
"size": "2545",
"license": "apache-2.0",
"hash": 5849432030973555000,
"line_mean": 29.3095238095,
"line_max": 80,
"alpha_frac": 0.6,
"autogenerated": false,
"ratio": 3.001179245283019,
"config_test": false,
"has_no_keywords":... |
#!/bin/python
################################################################################
# Notes:
# This program is only intended to be called as main from the Moka compiler
# and *not* from the command line proper. If you try it and something
# breaks, not my fault.
# The passed arguments are pre-vetted... | {
"repo_name": "AffogatoLang/Moka-Rust",
"path": "resources/py_env/interp_runner.py",
"copies": "1",
"size": "1424",
"license": "bsd-3-clause",
"hash": -9170102429837726000,
"line_mean": 25.3703703704,
"line_max": 80,
"alpha_frac": 0.6088483146,
"autogenerated": false,
"ratio": 3.807486631016043,
... |
#!/bin/python
'''
@Title: Sam and sub-strings
@Problem Statement:
Samantha and Sam are playing a game. They have 'N' balls in front of them, each ball numbered from 0 to 9, except the first ball
which is numbered from 1 to 9. Samantha calculates all the sub-strings of the number thus formed, one by one.
If the s... | {
"repo_name": "archit47/Competitive-Programming",
"path": "src/hackerrank/Summation of Substring Numbers.py",
"copies": "1",
"size": "1325",
"license": "mit",
"hash": 6992151578617039000,
"line_mean": 30.5714285714,
"line_max": 161,
"alpha_frac": 0.6694339623,
"autogenerated": false,
"ratio": 2.6... |
#!/bin/python
#NOTE: This script only runs in Linux and requires pdflatex in order to create pdfs
import argparse
import logging
logging.getLogger("scapy.runtime").setLevel(logging.ERROR)
from scapy.all import *
#The default ports to scan in none are specified
default_ports = [5,8,20,21,22,23,25,53,67,68,69,79,80,88... | {
"repo_name": "jdgoal512/port-scanner",
"path": "scan.py",
"copies": "1",
"size": "20331",
"license": "mit",
"hash": -3427896160057081000,
"line_mean": 42.0741525424,
"line_max": 219,
"alpha_frac": 0.492990999,
"autogenerated": false,
"ratio": 4.414983713355049,
"config_test": false,
"has_no_... |
#!/bin/python
"""
plot_funcs
jlazear
2/26/15
Collection of useful plotting functions.
"""
__version__ = 20150226
__releasestatus__ = 'beta'
import matplotlib.gridspec as gridspec
import matplotlib.pyplot as plt
import numpy as np
def resid_plot(xs1, ys1, xs2, ys2, label1=None, label2=None,
xlabel=N... | {
"repo_name": "jlazear/cmb",
"path": "util/plot_funcs.py",
"copies": "1",
"size": "3499",
"license": "apache-2.0",
"hash": 8643946999092729000,
"line_mean": 31.1100917431,
"line_max": 88,
"alpha_frac": 0.5867390683,
"autogenerated": false,
"ratio": 2.9477674810446506,
"config_test": false,
"h... |
#!/bin/python
'''
PROBLEM 4: Plus Minus:
---------------------
Given an array of integers, calculate which fraction of its elements are
positive, which fraction of its elements are negative, and which fraction of its
elements are zeroes, respectively. Print the decimal value of each fraction on a
new line.
Note: This... | {
"repo_name": "rolandovillca/python_introduction_basic",
"path": "hackerrank.com/04_plus_minus.py",
"copies": "4",
"size": "1750",
"license": "mit",
"hash": -64439998761917100,
"line_mean": 25.1343283582,
"line_max": 80,
"alpha_frac": 0.6937142857,
"autogenerated": false,
"ratio": 3.6082474226804... |
#!/bin/python
'''
PROBLEM: Diagonal Difference:
----------------------------
Given a square matrix of size N x N, calculate the absolute difference between
the sums of its diagonals.
INPUT FORMAT:
------------
The first line contains a single integer, N. The next N lines denote the
matrix's rows, with each line conta... | {
"repo_name": "rolandovillca/python_basis",
"path": "hackerrank.com/03_diagonal_difference.py",
"copies": "4",
"size": "1308",
"license": "mit",
"hash": 4569657962120378400,
"line_mean": 18.5373134328,
"line_max": 79,
"alpha_frac": 0.6055045872,
"autogenerated": false,
"ratio": 3.3711340206185567... |
#!/bin/python
"""
Problem Statement
Given an integer, N, traverse its digits (d1,d2,...,dn) and determine how many digits evenly divide N (i.e.: count the number of times N divided by each digit di has a remainder of 0). Print the number of evenly divisible digits.
Note: Each digit is considered to be unique, so eac... | {
"repo_name": "codecakes/algorithms",
"path": "algorithms/practice/integer_divisible.py",
"copies": "1",
"size": "1804",
"license": "mit",
"hash": 2048442279566833000,
"line_mean": 27.5714285714,
"line_max": 229,
"alpha_frac": 0.6444444444,
"autogenerated": false,
"ratio": 3.435114503816794,
"c... |
#!/bin/python
"""
Problem Statement
The Utopian Tree goes through 2 cycles of growth every year. Each spring, it doubles in height. Each summer, its height increases by 1 meter.
Laura plants a Utopian Tree sapling with a height of 1 meter at the onset of spring. How tall will her tree be after N growth cycles?
Inpu... | {
"repo_name": "codecakes/algorithms",
"path": "algorithms/practice/utopian_tree.py",
"copies": "1",
"size": "1474",
"license": "mit",
"hash": -7050609329440690000,
"line_mean": 25.1964285714,
"line_max": 245,
"alpha_frac": 0.7066848568,
"autogenerated": false,
"ratio": 3.0733752620545074,
"conf... |
#!/bin/python
"""
Problem Statement
You're given an array of integers. Can you find what fraction of the elements are positive numbers, negative numbers and zeroes? Print the value of the fractions in decimal form with 3 decimal places.
Input Format
The first line contains N: the size of the array.
The next line co... | {
"repo_name": "codecakes/algorithms",
"path": "algorithms/practice/intFractionTotal.py",
"copies": "1",
"size": "1674",
"license": "mit",
"hash": -7820572845764640000,
"line_mean": 33.1020408163,
"line_max": 281,
"alpha_frac": 0.7335329341,
"autogenerated": false,
"ratio": 3.646288209606987,
"c... |
#!/bin/python
'''
robot move from top left to bottom right, ask # of unique paths
move allowed: RIGHT and DOWN only
obstacle grid: 0 means pass, 1 means blocking
[
[0,0,0],
[0,1,0],
[0,0,0]
]
The total number of unique paths is 2.
'''
def uniquePathsWithObstacles(obstacleGrid):
"""
:type obstacleGrid:... | {
"repo_name": "dramaticlly/Python4Interview",
"path": "uniquepath.py",
"copies": "1",
"size": "1749",
"license": "mit",
"hash": -3526778453698385400,
"line_mean": 22.9589041096,
"line_max": 70,
"alpha_frac": 0.5054316752,
"autogenerated": false,
"ratio": 3.1456834532374103,
"config_test": false... |
#!/bin/python
#
# script to pre-process sign data into normalized form
# very specific to the file format the sign generates
# 2015 kg
#
import os
import csv
import datetime
import sys
dir = sys.argv[1]
csv_output_filename = "all_data.csv"
csv_write_file = open(csv_output_filename, 'ab')
def dow(date):
days=["M... | {
"repo_name": "kgorman/WMG_speed",
"path": "raw/process_raw_data.py",
"copies": "1",
"size": "1733",
"license": "mit",
"hash": -8885233380556486000,
"line_mean": 29.4035087719,
"line_max": 86,
"alpha_frac": 0.5603000577,
"autogenerated": false,
"ratio": 3.648421052631579,
"config_test": false,
... |
"""
Simple script to list FTFBS packages in Koji
Author: Marcin Juszkiewicz <mjuszkiewicz@redhat.com>
License: GPLv2+
"""
import argparse
from progress.bar import Bar
from common import *
def parse_args():
parser = argparse.ArgumentParser(description="Query Koji for FTBFS list")
parser.add_argument("-a", "--arch... | {
"repo_name": "hrw/fedora-koji-scripts",
"path": "get-failed-builds.py",
"copies": "1",
"size": "1576",
"license": "mit",
"hash": 4392141913114003500,
"line_mean": 21.5142857143,
"line_max": 120,
"alpha_frac": 0.6846446701,
"autogenerated": false,
"ratio": 2.9239332096474953,
"config_test": fal... |
#
# The MIT License (MIT)
#
# Copyright (c) 2015 JP Senior jp.senior@gmail.com
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
# in the Software without restriction, including without limitation the rights
... | {
"repo_name": "jpsenior/threataggregator",
"path": "feeds.py",
"copies": "1",
"size": "3105",
"license": "mit",
"hash": 3591784298306768400,
"line_mean": 38.8076923077,
"line_max": 83,
"alpha_frac": 0.6821256039,
"autogenerated": false,
"ratio": 3.6702127659574466,
"config_test": false,
"has_... |
try:
import difflib
import urllib
import re
import os
import csv
import socket
import time
import datetime
import geoip2.database
import geoip2.errors
import gzip
import maxminddb.errors
import netaddr
import json
except ImportError as e:
print "Error: Please... | {
"repo_name": "jbremer/threataggregator",
"path": "threataggregator.py",
"copies": "1",
"size": "23007",
"license": "mit",
"hash": 8432725225558065000,
"line_mean": 33.545045045,
"line_max": 119,
"alpha_frac": 0.6074672926,
"autogenerated": false,
"ratio": 3.7409756097560978,
"config_test": fal... |
import sys
import difflib
import re
import os
import csv
import socket
import time
import datetime
import geoip2.database
import geoip2.errors
import gzip
import maxminddb.errors
import netaddr
import json
import requests
from feeds import feeds
import config
FACILITY = dict(kern=0, user=1, mail=2, daemon=3, auth=4,... | {
"repo_name": "jpsenior/threataggregator",
"path": "threataggregator.py",
"copies": "1",
"size": "23696",
"license": "mit",
"hash": -6805537626368646000,
"line_mean": 33.2427745665,
"line_max": 119,
"alpha_frac": 0.6051232275,
"autogenerated": false,
"ratio": 3.7541191381495564,
"config_test": ... |
# This file is a part of Woopi Project
#
# Copyright (c) 2015 Thomas Pajon
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
# in the Software without restriction, including without limitation the rights
# t... | {
"repo_name": "Didimus45/Woopi",
"path": "woopi.py",
"copies": "1",
"size": "9613",
"license": "mit",
"hash": 8117875022733907000,
"line_mean": 39.9063829787,
"line_max": 175,
"alpha_frac": 0.5644439821,
"autogenerated": false,
"ratio": 4.365576748410536,
"config_test": false,
"has_no_keyword... |
#
# This file is part of LiteSPI
#
# Copyright (c) 2020 Antmicro <www.antmicro.com>
# SPDX-License-Identifier: BSD-2-Clause
import os
import sys
def linux_extract():
# Constant parts of code
header = \
"""#include <json-c/json.h>
#include <stdio.h>
#include <stdint.h>
#include <stdbool.h>
typedef unsigned c... | {
"repo_name": "litex-hub/litespi",
"path": "tools/spi_nor_config_generator/linux_spi_nor_extract.py",
"copies": "1",
"size": "5778",
"license": "bsd-2-clause",
"hash": 6832230233618942000,
"line_mean": 29.4105263158,
"line_max": 94,
"alpha_frac": 0.5919003115,
"autogenerated": false,
"ratio": 3.1... |
#!/bin/python
'''
This file provides the endpoints for the demo interface.
The functions in this file should be called from NodeJS to
obtain and update datapoints.
Description of functionality
---
data model:
datapoint = { str(noun phrase) : { 'score': float(controversy score), 'confidence':float(confidence)}}
es... | {
"repo_name": "ControCurator/controcurator",
"path": "python_code/endpoints_old.py",
"copies": "1",
"size": "7450",
"license": "mit",
"hash": -8116842775599314000,
"line_mean": 20.469740634,
"line_max": 121,
"alpha_frac": 0.4786577181,
"autogenerated": false,
"ratio": 3.2181425485961124,
"confi... |
#!/bin/python
#
###
# This is a Python 2.73 web scraper/browser emulater which uses the
# timetable.student.curtin.edu.au web app to construct a html
# timetable for all classes in building 314 computer labs.
# It uses a headless browser to interact with the website which means that
# it sometimes encounters errors, o... | {
"repo_name": "LukeHealy/labtools",
"path": "CUTS/src/cuts.py",
"copies": "1",
"size": "8862",
"license": "mit",
"hash": 1380214905154515200,
"line_mean": 28.0557377049,
"line_max": 166,
"alpha_frac": 0.5689460618,
"autogenerated": false,
"ratio": 3.1358811040339702,
"config_test": false,
"ha... |
#!/bin/python
"""
This script will create private repositories on Bitbucket for each student.
The repo name will be same as the university ID of the student.
Input : List of students ids, Bitbucket credentials
usage:
$python create_repos.py
the above will consider the file path mentioned in dir_settings.py
$pyth... | {
"repo_name": "avinassh/itworkshop-scripts",
"path": "create_repos.py",
"copies": "1",
"size": "1291",
"license": "mit",
"hash": -4357330894318121500,
"line_mean": 25.3469387755,
"line_max": 96,
"alpha_frac": 0.6886134779,
"autogenerated": false,
"ratio": 3.3795811518324608,
"config_test": fals... |
#!../bin/python
"""
This script will generate a dependency graph of the given bob package(s) using the external tool ``dot``.
Packages can be either specified as a list of ``--packages`` or read from (several) ``--package-files``.
The latter option is mostly useful to generate a dot graph for all Bob packages.
The ou... | {
"repo_name": "tiagofrepereira2012/bob.extension",
"path": "bob/extension/scripts/dependency_graph.py",
"copies": "1",
"size": "6680",
"license": "bsd-3-clause",
"hash": -6968429231214462000,
"line_mean": 44.1351351351,
"line_max": 184,
"alpha_frac": 0.672005988,
"autogenerated": false,
"ratio": ... |
#!/bin/python
"""
This script will put assignments into the student repositories. First add new
assignments in master-repo/assignments and commit your changes. The directory
name of the newly added assignment is the assignment id (assignment-x) is required.
The script will first pull the student's repo from bitbuck... | {
"repo_name": "avinassh/itworkshop-scripts",
"path": "unused-scripts/put-assigments.py",
"copies": "1",
"size": "1708",
"license": "mit",
"hash": 3532941482161757700,
"line_mean": 32.5098039216,
"line_max": 94,
"alpha_frac": 0.6914519906,
"autogenerated": false,
"ratio": 3.588235294117647,
"con... |
#!/bin/python
"""
This script will send the invitation email to the all the students
Input : List of students (their ids and email ids), Bitbucket credentials
usage:
$python invite_users.py
the above will consider the students info file mentioned in dir_settings.py
$python invite_users.py students-info.json
"""... | {
"repo_name": "avinassh/itworkshop-scripts",
"path": "invite_uers.py",
"copies": "1",
"size": "1263",
"license": "mit",
"hash": 7018204230434842000,
"line_mean": 27.7272727273,
"line_max": 109,
"alpha_frac": 0.6959619952,
"autogenerated": false,
"ratio": 3.2805194805194806,
"config_test": false... |
#!/bin/python
"""
This script will take assignment solutions from each student repository. Based
on the timestamp given, it finds out the last commit made before timestamp
(i.e. deadline) and it checks out that revision, rsyncs the solution folder
of the required assignment with the solutions-repo and resets to HE... | {
"repo_name": "avinassh/itworkshop-scripts",
"path": "take_solutions.py",
"copies": "1",
"size": "6761",
"license": "mit",
"hash": -5639496038919761000,
"line_mean": 37.8563218391,
"line_max": 348,
"alpha_frac": 0.641621062,
"autogenerated": false,
"ratio": 3.5981905268759977,
"config_test": fa... |
#!/bin/python
''
treeds.py for tree data structure, taken from StackOverflow at https://stackoverflow.com/questions/2358045/how-can-i-implement-a-tree-in-python-are-there-any-built-in-data-structures-in
''
class Node:
"""
Class Node
"""
def __init__(self, value):
self.left = None
self.... | {
"repo_name": "estradjm/Class-Work",
"path": "Machine_Learning/Decision_Trees/treeds.py",
"copies": "1",
"size": "1103",
"license": "apache-2.0",
"hash": -6342271073647481000,
"line_mean": 25.9024390244,
"line_max": 185,
"alpha_frac": 0.5883952856,
"autogenerated": false,
"ratio": 3.9676258992805... |
#!/bin/python
"""
show.py
~~~~~~~
Script to converts markdown text in html code and show it in a web browser.
This script only is use to show the markdown text in a web browser.
This script isn't necessary to use mpiece package.
Command options:
- Show help:
- $ show.py --help
- Converts filename in h... | {
"repo_name": "davidnotplay/mpiece",
"path": "examples/show.py",
"copies": "1",
"size": "4289",
"license": "bsd-3-clause",
"hash": -5289498640518096000,
"line_mean": 26.1392405063,
"line_max": 93,
"alpha_frac": 0.671641791,
"autogenerated": false,
"ratio": 3.0112359550561796,
"config_test": fal... |
#!/bin/python
########################################################
# uarmControlCSV.py
# Written by Mark Millar
# Date created 2015-01-11
# Date modified 2015-01-14
# Version 0.2
# To use this program, excute with the CSV location as
# user argument 1 and uarm serial port as argument 2
# E.g. ./uarmControlCSV pos... | {
"repo_name": "ojko/uArm",
"path": "uarmControlCSV.py",
"copies": "1",
"size": "3439",
"license": "mit",
"hash": 4747306176034433000,
"line_mean": 30.2727272727,
"line_max": 323,
"alpha_frac": 0.6783948822,
"autogenerated": false,
"ratio": 3.2814885496183206,
"config_test": false,
"has_no_key... |
#!/bin/python
########################################################
# uarmController.py
# Written by Mark Millar
# Date created 2015-01-19
# Date modified 2015-01-19
# Version 0.1
# To use this program, excute with the
# serial port as argument 1
# E.g. ./uarmController /dev/ttyUSB0
#
############################... | {
"repo_name": "ojko/uArm",
"path": "uarmController.py",
"copies": "1",
"size": "5096",
"license": "mit",
"hash": -822158475009091800,
"line_mean": 27.7966101695,
"line_max": 323,
"alpha_frac": 0.6242150706,
"autogenerated": false,
"ratio": 3.1149144254278727,
"config_test": false,
"has_no_key... |
#!/bin/python
########################################################
# uarmControl.py
# Written by Mark Millar
# Date created 2015-01-07
# Date modified 2015-01-14
# Version 0.2
# To use this program, excute with the end effector
# coordinates as user arguments 1 through 5 and uarm
# serial port as argument 6
# E.... | {
"repo_name": "ojko/uArm",
"path": "uarmControl.py",
"copies": "1",
"size": "3355",
"license": "mit",
"hash": 5500161420653641000,
"line_mean": 31.9019607843,
"line_max": 323,
"alpha_frac": 0.6760059613,
"autogenerated": false,
"ratio": 3.198284080076263,
"config_test": false,
"has_no_keyword... |
"""
USAGE:
blind_features.py (-d <dir> | <image>...)
"""
__author__ = 'Stephen Zakrewsky'
import cv2
import docopt
import json
import math
import numpy as np
import os
import pywt
import scipy.ndimage
def spatial_edge_distribution2(img):
lb = abs(cv2.Laplacian(img[:,:,0],cv2.CV_32F))
lg = abs(cv2.Lapl... | {
"repo_name": "szakrewsky/ICPR16",
"path": "blind_features.py",
"copies": "1",
"size": "13973",
"license": "mit",
"hash": 225750044322021020,
"line_mean": 28.8568376068,
"line_max": 143,
"alpha_frac": 0.5324554498,
"autogenerated": false,
"ratio": 2.4748494509387178,
"config_test": false,
"ha... |
#!/bin/python
"""
USAGE:
convolution-example.py <image>
"""
import cv2
import math
import numpy as np
import docopt
kernel = np.array([[1,2,1],
[2,4,2],
[1,2,1]])
def upsample(img, kernel, r):
upsample_img = np.zeros((img.shape[0]*r, img.shape[1]*r, 3), dtype='uint8')
... | {
"repo_name": "szakrewsky/convolution-example",
"path": "convolution-example.py",
"copies": "1",
"size": "1756",
"license": "mit",
"hash": -1108562897165316500,
"line_mean": 27.7868852459,
"line_max": 79,
"alpha_frac": 0.4851936219,
"autogenerated": false,
"ratio": 2.912106135986733,
"config_te... |
#!/bin/python
"""
USAGE:
feature-point-detector-example.py <image>
"""
import cv2
import math
import numpy as np
import docopt
from scipy import signal
G = np.outer(signal.gaussian(5, 1), signal.gaussian(5, 1))
def derivative_of_gaussian(x):
return -(math.exp(-math.pow(x,2)/2)*x)/math.sqrt(2*math.pi)
d... | {
"repo_name": "szakrewsky/feature-point-detector-example",
"path": "feature-point-detector-example.py",
"copies": "1",
"size": "1390",
"license": "mit",
"hash": 1572008425630082600,
"line_mean": 27.3673469388,
"line_max": 113,
"alpha_frac": 0.6158273381,
"autogenerated": false,
"ratio": 2.4131944... |
#!/bin/python
"""
USAGE:
homography-example.py <image>
"""
import cv2
import numpy as np
import docopt
points1 = []
points2 = []
arguments = docopt.docopt(__doc__)
img1 = cv2.imread(arguments['<image>'])
img1_display = img1.copy()
img2 = np.zeros(img1.shape)
def mark(img, x, y):
for i in range(y-5, y+5):
... | {
"repo_name": "szakrewsky/homography-example",
"path": "homography-example.py",
"copies": "1",
"size": "1388",
"license": "mit",
"hash": -3860514333935913500,
"line_mean": 24.7037037037,
"line_max": 77,
"alpha_frac": 0.5878962536,
"autogenerated": false,
"ratio": 2.7485148514851487,
"config_tes... |
#!/bin/python
#
# usage:
# ./python create_chord.py $N_CHORDS
# - take one of the pids (one of the list from the first line) and replace
# - assign that number to PORT
# ./python fuse_dfs.py <mountpoint>
# unmount with fusermount -u <mountpoint>
#
# Brief Summary
# =============
# This is a FS implemented on top... | {
"repo_name": "gaston770/python-chord",
"path": "fuse_dfs.py",
"copies": "1",
"size": "9328",
"license": "mit",
"hash": 3686428216511653400,
"line_mean": 27.1842900302,
"line_max": 91,
"alpha_frac": 0.5374142367,
"autogenerated": false,
"ratio": 3.64375,
"config_test": false,
"has_no_keywords... |
#!/bin/python
"""
USAGE:
text-search.py <string> <image>...
"""
from classifier import load_classifier
import cv2
import docopt
from features import hogdesc
import mserfeatures
import numpy as np
import ocr
from random import randint
from rectutils import find_words, next_on_same_line, on_consecutive_line, same_... | {
"repo_name": "szakrewsky/text-search",
"path": "text-search.py",
"copies": "1",
"size": "5310",
"license": "mit",
"hash": 8513646398555844000,
"line_mean": 34.4066666667,
"line_max": 124,
"alpha_frac": 0.556873823,
"autogenerated": false,
"ratio": 3.2818294190358466,
"config_test": false,
"h... |
#!/bin/python
"""
Users on longer flights like to start a second movie right when their first one ends,
but they complain that the plane usually lands before they can see the ending.
So you're building a feature for choosing two movies whose total runtimes will equal the exact flight length.
Write a function that t... | {
"repo_name": "bt3gl/Python-and-Algorithms-and-Data-Structures",
"path": "First_edition_2014/other_resources/interview_cake/data_structures/inflight_entrain.py",
"copies": "1",
"size": "1352",
"license": "mit",
"hash": 4279518883503159300,
"line_mean": 31.2142857143,
"line_max": 109,
"alpha_frac": 0.... |
#!/bin/python
"""
util.py
jlazear
6/8/15
Utilities for working with the calculation modules.
Example:
<example code here>
"""
__version__ = 20150608
__releasestatus__ = 'beta'
import inspect
import os
import numpy as np
import healpy as hp
import matplotlib.pyplot as plt
import lib
import calculations.ilc_foregr... | {
"repo_name": "jlazear/cmb",
"path": "calculations/util.py",
"copies": "1",
"size": "4362",
"license": "apache-2.0",
"hash": 4555743927885683700,
"line_mean": 32.8139534884,
"line_max": 95,
"alpha_frac": 0.6304447501,
"autogenerated": false,
"ratio": 2.7245471580262337,
"config_test": true,
"... |
#!/bin/python
#
#
# Vendors
#
#import wxversion
#wxversion.select('2.8')
import wx,re
#import wx.calendar as cal
import wx.grid as gridlib
import sys
import time
import faulthandler
#import psycopg2
import json
from datetime import datetime
from wx.lib.masked import TimeCtrl
import wx.lib.masked as masked
from decim... | {
"repo_name": "fuspu/RHP-POS",
"path": "vendors.py",
"copies": "1",
"size": "60556",
"license": "mit",
"hash": -3710368120729187000,
"line_mean": 38.7609980302,
"line_max": 204,
"alpha_frac": 0.5366272541,
"autogenerated": false,
"ratio": 3.7909102291223236,
"config_test": false,
"has_no_keyw... |
#!/bin/python
"""
wmap.py
jlazear
1/16/15
Tools for loading WMAP data from LAMBDA data files.
Example:
> map_K = load_wmap_maps('../data/wmap_band_smth_imap_r9_9yr_K_v5.fits')
"""
__version__ = 20150116
__releasestatus__ = 'beta'
import numpy as np
import healpy as hp
from astropy.io import fits
def load_wmap_ma... | {
"repo_name": "jlazear/cmb",
"path": "lib/wmap.py",
"copies": "1",
"size": "6083",
"license": "apache-2.0",
"hash": 9170955231496715000,
"line_mean": 31.3617021277,
"line_max": 79,
"alpha_frac": 0.5697846457,
"autogenerated": false,
"ratio": 3.076884167931209,
"config_test": false,
"has_no_ke... |
#!/bin/python
"""
Write a function that returns a list of all the duplicate files.
the first item is the duplicate file
the second item is the original file
For example:
[('/tmp/parker_is_dumb.mpg', '/home/parker/secret_puppy_dance.mpg'),
('/home/trololol.mov', '/etc/apache2/httpd.conf')]
You can assume each fil... | {
"repo_name": "bt3gl/Python-and-Algorithms-and-Data-Structures",
"path": "First_edition_2014/other_resources/interview_cake/data_structures/file_system_hashing.py",
"copies": "1",
"size": "2306",
"license": "mit",
"hash": 8205589297862007000,
"line_mean": 29.3552631579,
"line_max": 92,
"alpha_frac": ... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.