text stringlengths 0 1.05M | meta dict |
|---|---|
#!/bin/env python
import blank_template
import httplib
import json
import os
import subprocess
import sys
import tarfile
import time
import urllib
import XenAPI
if __name__ == '__main__':
# Load template
fname = sys.argv[1]
template = blank_template.load_template(fname)
# Generate ova.xml
versio... | {
"repo_name": "xenserver/guest-templates",
"path": "json-templates/create-template.py",
"copies": "1",
"size": "2146",
"license": "bsd-2-clause",
"hash": -4038591017914364000,
"line_mean": 32.0153846154,
"line_max": 198,
"alpha_frac": 0.6509785648,
"autogenerated": false,
"ratio": 3.3955696202531... |
#!/bin/env python
import CodeBuildHandler
import LogsWatcher
import sys
import time
import getopt
def main():
#parse command line arguments
try:
opts, args = getopt.getopt(sys.argv[1:],"",["project-name=","source-path=","source-excludes="])
except getopt.GetoptError:
print("Usage: main.py ... | {
"repo_name": "RudolfVonKrugstein/codebuild-runner",
"path": "main.py",
"copies": "1",
"size": "1701",
"license": "mit",
"hash": 4088237788719369000,
"line_mean": 28.3275862069,
"line_max": 144,
"alpha_frac": 0.6560846561,
"autogenerated": false,
"ratio": 3.8224719101123594,
"config_test": fals... |
#!/bin/env/python
import collections
import os
import numpy as np
import matplotlib as mpl
import matplotlib.pyplot as plt
import seaborn as sb
import pandas as pd
import pathlib as pl
# from . import files
from . import amm_results2 as res
# from . import amm_methods as ameth
# sb.set_context('poster')
# sb.set_con... | {
"repo_name": "dblalock/bolt",
"path": "experiments/python/amm_figs2.py",
"copies": "1",
"size": "41039",
"license": "mpl-2.0",
"hash": -5875858268823131000,
"line_mean": 38.3394055609,
"line_max": 105,
"alpha_frac": 0.5712266335,
"autogenerated": false,
"ratio": 2.9631689174550444,
"config_tes... |
#!/bin/env python
import commands
import logging
import os
import string
import shutil
import time
from autopyfactory.interfaces import BatchSubmitInterface
class ExecSubmitPlugin(BatchSubmitInterface):
"""
This Submit Plugin simply executes a provided local executable.
This class is expected to have s... | {
"repo_name": "btovar/autopyfactory",
"path": "autopyfactory/plugins/queue/batchsubmit/Exec.py",
"copies": "1",
"size": "4431",
"license": "apache-2.0",
"hash": -8444466854146670000,
"line_mean": 36.2352941176,
"line_max": 123,
"alpha_frac": 0.6025727827,
"autogenerated": false,
"ratio": 3.767857... |
#!/bin/env python
import commands
import os
import subprocess
import tempfile
class CommandLine(object):
def __init__(self, program):
self.program = program
self.output = None # the std output after execution
self.error = None # the std error after execution
self.sta... | {
"repo_name": "RRCKI/pilot",
"path": "myproxyUtils.py",
"copies": "4",
"size": "9674",
"license": "apache-2.0",
"hash": -946059286747183100,
"line_mean": 34.5661764706,
"line_max": 118,
"alpha_frac": 0.5513748191,
"autogenerated": false,
"ratio": 4.1842560553633215,
"config_test": false,
"has... |
#!/bin/env/python
import copy
import numpy as np
from functools import reduce
import numba
from sklearn.decomposition import PCA
from sklearn import linear_model
from . import subspaces as subs
from joblib import Memory
_memory = Memory('.', verbose=0)
# def bucket_id_to_new_bucket_ids(old_id):
# i = 2 * old_i... | {
"repo_name": "dblalock/bolt",
"path": "experiments/python/clusterize.py",
"copies": "1",
"size": "83157",
"license": "mpl-2.0",
"hash": -890046026884864500,
"line_mean": 36.8330300273,
"line_max": 89,
"alpha_frac": 0.544247628,
"autogenerated": false,
"ratio": 3.245151219512195,
"config_test":... |
#!/bin/env python
import copy
import numpy as np
from numpy import ma
import numpy.linalg as lg
from scipy.linalg import eigh
import warnings
from vmc_postproc import stagflux,sfpnxphz
def geneigh(A,B,tol=1e-12):
"""
Solves the generalized eigenvalue problem also in the case where A and B share a common
n... | {
"repo_name": "EPFL-LQM/gpvmc",
"path": "tools/vmc_postproc/proc.py",
"copies": "2",
"size": "3420",
"license": "mit",
"hash": -4269417613780108000,
"line_mean": 35.7741935484,
"line_max": 141,
"alpha_frac": 0.6043859649,
"autogenerated": false,
"ratio": 2.789559543230016,
"config_test": false,... |
#!/bin/env python
import csv
from dd import def_dict
from postcodes import fix_postcode
import sys
def read_GP_address(gpfile, location_lookup):
"""
GP address file is like this:
201406,A81001,THE DENSHAM SURGERY ,THE HEALTH CENTRE ,LAWSON STREET ,STOCKTON ,CLEVELAND ,TS18 1HU
[0] [1] ... | {
"repo_name": "barryrowlingson/dispensr",
"path": "inst/python/gp_reader.py",
"copies": "1",
"size": "1498",
"license": "mit",
"hash": -6133562587840549000,
"line_mean": 27.8076923077,
"line_max": 108,
"alpha_frac": 0.5794392523,
"autogenerated": false,
"ratio": 3.328888888888889,
"config_test"... |
#!/bin/env python
import csv
import json
import random
import re
import math
import numpy
import operator
rgbstr_regex = re.compile("^\s*?rgb\(\s*?(\d+?)\s*?,\s*?(\d+?)\s*?,\s*?(\d+?)\)\s*?$")
hexstr_regex = re.compile("^#[0-9A-F]{6}$")
def hex_to_rgb(hex):
if hex.startswith("#"):
hex = hex[1:]
i ... | {
"repo_name": "andrewortman/colorbot",
"path": "data/mturk/compile_survey.py",
"copies": "1",
"size": "5079",
"license": "mit",
"hash": -4975977901466481000,
"line_mean": 27.0607734807,
"line_max": 118,
"alpha_frac": 0.5837763339,
"autogenerated": false,
"ratio": 3.0304295942720763,
"config_tes... |
#!/bin/env python
import csv
import urllib2
import os
import json
import io
stops_url = "wienerlinien-ogd-haltestellen.csv"
platforms_url = "wienerlinien-ogd-steige.csv"
lines_url = "wienerlinien-ogd-linien.csv"
def download_file(file_url):
base_url = "http://data.wien.gv.at/csv/"
url = base_url+file_url
... | {
"repo_name": "bajo/wl2gtfs",
"path": "wl2gtfs.py",
"copies": "1",
"size": "3787",
"license": "mit",
"hash": -632752713588117000,
"line_mean": 34.4018691589,
"line_max": 106,
"alpha_frac": 0.5289147082,
"autogenerated": false,
"ratio": 3.483900643974241,
"config_test": false,
"has_no_keywords... |
#!/bin env python
import cyglfw3 as glfw
"""
Tow cyglfw3 application for use with "hello world" examples demonstrating pyopenvr
"""
class CyGLFW3App(object):
"""
Uses the glfw library via the cyglfw3 bindings to create an opengl context, listen to keyboard
and VR HMD/controller events, and clean up
"... | {
"repo_name": "cmbruns/pyopenvr",
"path": "src/openvr/glframework/cyglfw3_app.py",
"copies": "1",
"size": "2519",
"license": "bsd-3-clause",
"hash": -1548980388327096800,
"line_mean": 33.0405405405,
"line_max": 99,
"alpha_frac": 0.6165144899,
"autogenerated": false,
"ratio": 3.875384615384615,
... |
#!/bin/env/python
import datetime
import os
import itertools
import warnings
import numpy as np
import pandas as pd
from files import ensure_dir_exists
try:
from joblib import Memory
memory = Memory('.', verbose=0)
cache = memory.cache
except:
def cache(f):
return f
# =======================... | {
"repo_name": "dblalock/dig",
"path": "tests/pyience.py",
"copies": "1",
"size": "17021",
"license": "mit",
"hash": -4205998782097049600,
"line_mean": 29.9472727273,
"line_max": 85,
"alpha_frac": 0.5664767052,
"autogenerated": false,
"ratio": 3.825803551359856,
"config_test": true,
"has_no_ke... |
#!/bin/env python
import discord
from discord.ext import commands
class Wiki:
def __init__(self, bot):
self.bot = bot
self.color = bot.user_color
self.search_uri = 'http://en.wikipedia.org/w/api.php?action=opensearch&format=json&search={}'
self.random_uri = 'https://en.wikipedia.o... | {
"repo_name": "PrestigeDox/Watashi-SelfBot",
"path": "cogs/wiki.py",
"copies": "1",
"size": "1737",
"license": "mit",
"hash": 5251154619364341000,
"line_mean": 32.4038461538,
"line_max": 117,
"alpha_frac": 0.5889464594,
"autogenerated": false,
"ratio": 3.467065868263473,
"config_test": false,
... |
#!/bin/env python
import discord
import json
from discord.ext import commands
# TODO
# Make this optional because... who needs element data?
class Elements:
def __init__(self, bot):
self.bot = bot
self.subs = str.maketrans("0123456789", "₀₁₂₃₄₅₆₇₈₉")
self.sups = str.maketrans("012345678... | {
"repo_name": "PrestigeDox/Watashi-SelfBot",
"path": "cogs/elements.py",
"copies": "1",
"size": "2232",
"license": "mit",
"hash": -7230354364562403000,
"line_mean": 30.8115942029,
"line_max": 89,
"alpha_frac": 0.5608200456,
"autogenerated": false,
"ratio": 3.7140439932318103,
"config_test": fal... |
#!/bin/env python
import fileinput
import collections
# 'connection_closed_abruptly',
# "broker forced connection closure with reason 'shutdown'",
ignore_ok = [
'Starting RabbitMQ',
'node : rabbit@',
'Memory limit set to',
'Disk free limit set to',
'Limiting to approx',
'FHC r... | {
"repo_name": "ncsa/psync",
"path": "bin/parse_rabbitmq_log.py",
"copies": "1",
"size": "1465",
"license": "bsd-3-clause",
"hash": 771251788112518800,
"line_mean": 25.1607142857,
"line_max": 63,
"alpha_frac": 0.533105802,
"autogenerated": false,
"ratio": 3.970189701897019,
"config_test": false,... |
#!/bin/env python
import fitsio, numpy as np, json
import esutil as eu
from shear_stacking import *
from sys import argv
from multiprocessing import Pool, current_process, cpu_count
from glob import glob
import pylab as plt
def getValues(s, key, functions):
# what values are used for the slices: functions are di... | {
"repo_name": "pmelchior/shear-stacking-tests",
"path": "create_profiles.py",
"copies": "2",
"size": "15892",
"license": "mit",
"hash": -1599109333707025000,
"line_mean": 38.2395061728,
"line_max": 312,
"alpha_frac": 0.5627359678,
"autogenerated": false,
"ratio": 3.583314543404735,
"config_test... |
#!/bin/env/python
import functools
import numpy as np
import pprint
import scipy
import time
from . import amm
from . import matmul_datasets as md
from . import pyience as pyn
from . import compress
from . import amm_methods as methods
from joblib import Memory
_memory = Memory('.', verbose=0)
# NUM_TRIALS = 1
NU... | {
"repo_name": "dblalock/bolt",
"path": "experiments/python/amm_main.py",
"copies": "1",
"size": "22087",
"license": "mpl-2.0",
"hash": -8647691503795290000,
"line_mean": 39.9777365492,
"line_max": 109,
"alpha_frac": 0.538597365,
"autogenerated": false,
"ratio": 3.230983031012288,
"config_test":... |
#!/bin/env python
import getpass
import os
import sys
import traceback
from lxml import etree
from crypt import crypt
import cheshire3
from cheshire3.baseObjects import Session
from cheshire3.server import SimpleServer
from cheshire3.internal import cheshire3Root
from cheshire3.document import StringDocument
from ... | {
"repo_name": "CentreForCorpusResearch/clic",
"path": "dbs/dickens/run.py",
"copies": "2",
"size": "9672",
"license": "mit",
"hash": -3245629148242809300,
"line_mean": 35.0895522388,
"line_max": 82,
"alpha_frac": 0.6156947891,
"autogenerated": false,
"ratio": 3.6103023516237402,
"config_test": ... |
#!/bin/env/python
import glob
import sys
import os
import optparse
import submit_command as sc
import coord_util.trajectory_database as trajdb
#gnat_population_histogram_exe = os.path.split(os.path.abspath(gnat_population_histograms.__file__))[0] + '/gnat_population_histograms.py'
gnat_population_histogram_exe =... | {
"repo_name": "plediii/pbs_util",
"path": "create_scripts_template.py",
"copies": "2",
"size": "2360",
"license": "bsd-3-clause",
"hash": -5474431656016636000,
"line_mean": 31.7777777778,
"line_max": 160,
"alpha_frac": 0.6525423729,
"autogenerated": false,
"ratio": 3.485967503692762,
"config_te... |
#!/bin/env python
import glob, os, string, sys
from sf2utils.sf2parse import Sf2File
from datetime import date
def run(filePaths):
'''
Generate *.swift files for each SoundFont (sf2) file in the current directory.
The Swift files will contain a custom SoundFont definition that lists all of
... | {
"repo_name": "bradhowes/SynthInC",
"path": "SwiftMIDI/SoundFonts/catalog.py",
"copies": "1",
"size": "2976",
"license": "mit",
"hash": -4686997375561465000,
"line_mean": 38.68,
"line_max": 108,
"alpha_frac": 0.5719086022,
"autogenerated": false,
"ratio": 3.820282413350449,
"config_test": false... |
#!/bin/env python
import httplib
import urllib
import os
import pprint
import json
pp = pprint.PrettyPrinter(indent=4)
req_name='cmsdataops_CMSSW_4_2_8_patch6_HiggsReproForCert2011A_Jet_Run2011A-v1_RAW_111115_160930'
url= 'cmsweb.cern.ch'
url_old='localhost:8687'
headers = {"Content-type": "application/x-www-form-... | {
"repo_name": "rovere/utilities",
"path": "get_req_status.py",
"copies": "1",
"size": "3112",
"license": "mit",
"hash": -6724544696595704000,
"line_mean": 38.8974358974,
"line_max": 124,
"alpha_frac": 0.7107969152,
"autogenerated": false,
"ratio": 2.599832915622389,
"config_test": false,
"has... |
#!/bin/env python
import inspect
import sys
import os.path
import threading
from logging import warning
sys.path[0:0] = [ os.path.join( os.path.dirname( inspect.getabsfile( inspect.currentframe() ) ), '..', '..', 'lib' ) ]
from inspect import currentframe
from inspect import getframeinfo
from traceback import form... | {
"repo_name": "dramatis/dramatis",
"path": "test/dramatis/exc_test.py",
"copies": "1",
"size": "1569",
"license": "mit",
"hash": 929302989934346200,
"line_mean": 26.5263157895,
"line_max": 118,
"alpha_frac": 0.5965583174,
"autogenerated": false,
"ratio": 3.4635761589403975,
"config_test": false... |
#!/bin/env python
import inspect
import sys
import os.path
sys.path[0:0] = [ os.path.join( os.path.dirname( inspect.getabsfile( inspect.currentframe() ) ), '..', '..', '..', 'lib' ) ]
from logging import warning
import time
import threading
import dramatis.runtime
sys.path[0:0] = [ os.path.join( os.path.dirname( i... | {
"repo_name": "dramatis/dramatis",
"path": "test/dramatis/runtime/thread_pool_test.py",
"copies": "1",
"size": "2867",
"license": "mit",
"hash": 2594410553374683000,
"line_mean": 29.5,
"line_max": 124,
"alpha_frac": 0.5720265085,
"autogenerated": false,
"ratio": 3.592731829573935,
"config_test"... |
#!/bin/env python
import io
import os
import shutil
import subprocess
import yaml
from ansible.module_utils.basic import AnsibleModule
module = None
def run_or_die(cmd):
if os.system(cmd) != 0:
module.fail_json(msg="Command {} failed".format(cmd))
def repo_exists(repos, name):
for repo in repos:
... | {
"repo_name": "aepifanov/mos_mu",
"path": "modules/add_repo_to_release.py",
"copies": "1",
"size": "2264",
"license": "apache-2.0",
"hash": 4962674975634084000,
"line_mean": 25.6352941176,
"line_max": 78,
"alpha_frac": 0.5450530035,
"autogenerated": false,
"ratio": 3.8307952622673436,
"config_t... |
#!/bin/env python
import io
import yaml
import os
import shutil
import time
from ansible.module_utils.basic import AnsibleModule
module = None
def run_or_die(cmd):
if os.system(cmd) != 0:
module.fail_json(msg="Command {} failed.".format(cmd))
def repo_exists(repos, name):
for repo in repos:
... | {
"repo_name": "aepifanov/mos_mu",
"path": "modules/add_repo_to_astute_yaml.py",
"copies": "1",
"size": "2162",
"license": "apache-2.0",
"hash": 8424064199648633000,
"line_mean": 25.3658536585,
"line_max": 65,
"alpha_frac": 0.5767807586,
"autogenerated": false,
"ratio": 3.6397306397306397,
"conf... |
#!/bin/env python
import io
import yaml
import os
import shutil
from ansible.module_utils.basic import AnsibleModule
module = None
def run_or_die(cmd):
if os.system(cmd) != 0:
module.fail_json(msg="Command {} failed.".format(cmd))
def repo_exists(repos, name):
for repo in repos:
if 'name'... | {
"repo_name": "aepifanov/mos_mu",
"path": "modules/add_repo_to_env.py",
"copies": "1",
"size": "2046",
"license": "apache-2.0",
"hash": -8461805305887951000,
"line_mean": 25.2307692308,
"line_max": 75,
"alpha_frac": 0.5713587488,
"autogenerated": false,
"ratio": 3.6864864864864866,
"config_test... |
#!/bin/env/python
import itertools
import copy
from collections import defaultdict
from sklearn.pipeline import Pipeline
from sklearn.grid_search import GridSearchCV, ParameterGrid
from sklearn.cross_validation import StratifiedKFold
from sklearn.base import BaseEstimator, TransformerMixin, clone
from pandas import D... | {
"repo_name": "dblalock/flock",
"path": "python/utils/learn.py",
"copies": "1",
"size": "11792",
"license": "mit",
"hash": -4178926257099284000,
"line_mean": 30.5294117647,
"line_max": 243,
"alpha_frac": 0.6912313433,
"autogenerated": false,
"ratio": 3.315153219004779,
"config_test": true,
"h... |
#!/bin/env python
import json
from requests_oauthlib import OAuth1Session
import time
import yaml
# Normally we would organize this as a class, but we haven't talked
# about how or why to do that yet
# Getting credentials
with open('../etc/creds.yml', 'r') as f:
creds = yaml.load(f)
# Setting up Twitter OAuth o... | {
"repo_name": "deniederhut/workshop_pyintensive",
"path": "scripts/twitter_bot.py",
"copies": "2",
"size": "1733",
"license": "bsd-2-clause",
"hash": -6092094748268078000,
"line_mean": 31.6981132075,
"line_max": 72,
"alpha_frac": 0.5949221004,
"autogenerated": false,
"ratio": 3.9747706422018347,
... |
#!/bin/env python
import json
def readGraphJson(json_file, extra_attr):
file = open(json_file)
obj = json.load(file)
file.close()
fiedler = obj["r1"]
adj = obj["adj"]
labels = obj["nByi"]
attrs = {}
for attr in extra_attr:
attrs[attr] = obj[attr]
return fiedler, adj, label... | {
"repo_name": "cancerregulome/inspectra",
"path": "python/cross_graphs.py",
"copies": "1",
"size": "2753",
"license": "bsd-3-clause",
"hash": -4910858869551142000,
"line_mean": 30.6551724138,
"line_max": 145,
"alpha_frac": 0.5953505267,
"autogenerated": false,
"ratio": 3.341019417475728,
"confi... |
#!/bin/env python
import libvirt
from uuid import UUID
import csv
from opennode.cli.actions.utils import execute2, execute
from opennode.cli.actions.vm import openvz, list_vms
from opennode.cli.actions.vm import vm_interfaces
def get_uuid(vm):
return str(UUID(bytes=vm.UUID()))
def dump_info(vms, csv):
... | {
"repo_name": "tsudmi/opennode-tui",
"path": "opennode-tui/scripts/on-dump-csv.py",
"copies": "1",
"size": "1606",
"license": "bsd-3-clause",
"hash": 3218690479704339000,
"line_mean": 37.2380952381,
"line_max": 98,
"alpha_frac": 0.5124533001,
"autogenerated": false,
"ratio": 3.8329355608591884,
... |
#!/bin/env python
# Import local helper functions
from lib.tcp_client import tcp_client
from lib.udp_client import udp_client
from lib.logger import logger
def print_help(opt=None,arg=None):
print("Usage:")
print("\t --help : For help menu")
print("\t -h : For help menu")
print("\t -s : Host a... | {
"repo_name": "varunmittal91/Distributed-Key-Value-Store",
"path": "client.py",
"copies": "1",
"size": "2948",
"license": "mit",
"hash": -5075725739815539000,
"line_mean": 30.6989247312,
"line_max": 100,
"alpha_frac": 0.5094979647,
"autogenerated": false,
"ratio": 3.5053507728894173,
"config_te... |
#!/bin/env python
# Import local helper functions
from lib.udp_handler import udp_handler
from lib.tcp_handler import tcp_handler
from lib.logger import logger
def print_help(opt=None,arg=None):
print("Usage:")
print("\t --help : For help menu")
print("\t -h : For help menu")
print("\t -s : Ho... | {
"repo_name": "varunmittal91/Distributed-Key-Value-Store",
"path": "server.py",
"copies": "1",
"size": "2693",
"license": "mit",
"hash": -517171997629047360,
"line_mean": 29.2584269663,
"line_max": 114,
"alpha_frac": 0.5484589677,
"autogenerated": false,
"ratio": 3.803672316384181,
"config_test... |
#!/bin/env python
import logging
from optparse import OptionParser
import sys
import os
import re
import string
import subprocess
import math
import json
sys.path.insert(0, sys.path[0])
from config import *
from funcs import *
class submitSGEJobs:
url = ""
f=""
def __init__(self, url, f ):
self.... | {
"repo_name": "nephantes/dolphin-tools",
"path": "src/submitSGEJobs.py",
"copies": "2",
"size": "7418",
"license": "mit",
"hash": -978201813186712000,
"line_mean": 33.8262910798,
"line_max": 185,
"alpha_frac": 0.5554057697,
"autogenerated": false,
"ratio": 3.175513698630137,
"config_test": true... |
#!/bin/env python
import logging
import datetime
import subprocess
import json
import os
from multiprocessing import Process
from common.utils import Util
class Worker(object):
def __init__(self,db_name,hdfs_app_path,kafka_consumer,conf_type,processes=None):
self._initialize_members(db_name,hdf... | {
"repo_name": "kpeiruza/incubator-spot",
"path": "spot-ingest/pipelines/dns/worker.py",
"copies": "1",
"size": "4347",
"license": "apache-2.0",
"hash": 1062414655404956800,
"line_mean": 42.0396039604,
"line_max": 279,
"alpha_frac": 0.6259489303,
"autogenerated": false,
"ratio": 3.3645510835913313... |
#!/bin/env python
import logging
import json
import os
import sys
import copy
from common.utils import Util, NewFileEvent
from common.kafka_client import KafkaTopic
from multiprocessing import Pool
from common.file_collector import FileWatcher
import time
class Collector(object):
def __init__(self,hdfs_app_p... | {
"repo_name": "kpeiruza/incubator-spot",
"path": "spot-ingest/pipelines/proxy/collector.py",
"copies": "1",
"size": "3746",
"license": "apache-2.0",
"hash": -8344063671626893000,
"line_mean": 35.7254901961,
"line_max": 150,
"alpha_frac": 0.5912973839,
"autogenerated": false,
"ratio": 4.0366379310... |
#!/bin/env python
import logging
import os
import shutil
import string
import subprocess
import time
from autopyfactory.interfaces import BatchSubmitInterface
class ExecSubmitPlugin(BatchSubmitInterface):
"""
This Submit Plugin simply executes a provided local executable.
This class is expected to have ... | {
"repo_name": "PanDAWMS/autopyfactory",
"path": "autopyfactory/plugins/queue/batchsubmit/Exec.py",
"copies": "1",
"size": "4589",
"license": "apache-2.0",
"hash": 4464977141820373000,
"line_mean": 36.6147540984,
"line_max": 123,
"alpha_frac": 0.6023098714,
"autogenerated": false,
"ratio": 3.80198... |
#/bin/env python
import logging
import sys
import getopt
import os
from layer import secretary
from config import load
from yowsup.layers.auth import YowAuthenticationProtocolLayer
from yowsup.layers.protocol_messages import YowMessagesProtocolLayer
from yowsup.layers.protocol_receipts import YowReceiptProtocolLayer
f... | {
"repo_name": "Tsur/whatsapp-secretary-py",
"path": "whatsapp_secretary/cli.py",
"copies": "1",
"size": "2323",
"license": "mit",
"hash": -2625449481945041000,
"line_mean": 26.6547619048,
"line_max": 113,
"alpha_frac": 0.7068445975,
"autogenerated": false,
"ratio": 3.5959752321981426,
"config_t... |
#!/bin/env python
import logging
log = logging.getLogger()
log.setLevel(logging.DEBUG)
# ch = logging.StreamHandler()
# ch.setLevel(logging.DEBUG)
# log.addHandler(ch)
import boto3
import botocore
import json
import argparse
logging.captureWarnings(True)
# from botocore.exceptions import ClientError
from pycfn_cus... | {
"repo_name": "SCH-CISM/pycfn-opsworksinstance",
"path": "pycfn_opsworks_instance/opsworks_instance.py",
"copies": "1",
"size": "6305",
"license": "apache-2.0",
"hash": 7208176530882766000,
"line_mean": 36.0882352941,
"line_max": 115,
"alpha_frac": 0.6304520222,
"autogenerated": false,
"ratio": 4... |
#!/bin/env python
import logging, os, re, argparse, peakparser, discordant
# +1 if a > b
# -1 if a < b
# 0 if a == b
def cmpChrPosList(a,b):
chrA = a[0].lstrip('chr')
if chrA < ':' and chrA > '0': chrA = int(chrA)
chrB = b[0].lstrip('chr')
if chrB < ':' and chrB > '0': chrB = int(chrB)
posA = ... | {
"repo_name": "adamewing/discord-retro",
"path": "lib/mergepairs.py",
"copies": "1",
"size": "5847",
"license": "mit",
"hash": 3369971517591718400,
"line_mean": 39.0479452055,
"line_max": 126,
"alpha_frac": 0.6408414572,
"autogenerated": false,
"ratio": 3.331623931623932,
"config_test": true,
... |
#!/bin/env python
import logging, zmq
log = logging.getLogger('tripled.libtripled')
class tripled:
def __init__(self, master):
self.context = zmq.Context()
self.workers = {}
self.master = self.get_master(master)
def get_master(self, master):
socket = self.context.socket(zmq.... | {
"repo_name": "theonewolf/TripleD",
"path": "src/libtripled.py",
"copies": "1",
"size": "1937",
"license": "mit",
"hash": -487865916217567940,
"line_mean": 32.3965517241,
"line_max": 66,
"alpha_frac": 0.5823438307,
"autogenerated": false,
"ratio": 3.7684824902723735,
"config_test": false,
"ha... |
#! /bin/env python
import math
class Sieve:
def __init__(self, size):
self._sieve = [False] * (size)
def flip(self, n):
self._sieve[n-1] = not self._sieve[n-1]
def reset(self, n):
self._sieve[n-1] = False
def isPrime(self, n):
return self._sieve[n-1]
class Primes:
def __init__... | {
"repo_name": "htomeht/euler",
"path": "util/primes.py",
"copies": "1",
"size": "1294",
"license": "unlicense",
"hash": -6701325943502901000,
"line_mean": 22.1071428571,
"line_max": 63,
"alpha_frac": 0.5154559505,
"autogenerated": false,
"ratio": 2.776824034334764,
"config_test": false,
"has_... |
#!/bin/env/python
import math
infileList = []
keyList = []
cList = (
#"GBR",
#"FIN",
#"CHS",
#"PUR",
#"CLM",
#"IBS",
#"CEU",
#"YRI",
#"CHB",
#"LWK",
#"ASW",
#"MXL",
"TSI"
)
#for i in range(1,23):
# infi... | {
"repo_name": "CORDEA/analysis_of_1000genomes-data",
"path": "programs/OLD/gap.py",
"copies": "1",
"size": "1585",
"license": "apache-2.0",
"hash": 6481388982797740000,
"line_mean": 23.0151515152,
"line_max": 81,
"alpha_frac": 0.3993690852,
"autogenerated": false,
"ratio": 3.394004282655246,
"c... |
#!/bin/env/python
import matplotlib.pyplot as plt
import numpy as np
import os
from numpy import r_
from math import ceil
from viz_utils import saveCurrentPlot, colorForLabel, nameFromDir
from ..utils import sequence as seq
# from ..utils.arrays import meanNormalizeCols, stdNormalizeCols, zNormalizeCols
from ..transf... | {
"repo_name": "dblalock/flock",
"path": "python/viz/one_dimensional.py",
"copies": "1",
"size": "6982",
"license": "mit",
"hash": -4435856508254335500,
"line_mean": 30.0311111111,
"line_max": 94,
"alpha_frac": 0.700658837,
"autogenerated": false,
"ratio": 3.081200353045013,
"config_test": false... |
#!/bin/env python
import matplotlib.pyplot as plt
import numpy as np
class PrimeGraph:
def __init__(self):
plt.figure()
def loadFromFile(self, infilename):
data = np.genfromtxt(infilename, delimiter=',', names=True)
self.xs = data[data.dtype.names[0]]
self.ys = data[data.dty... | {
"repo_name": "upamanyus/primerunning",
"path": "src/primegraph.py",
"copies": "1",
"size": "1878",
"license": "mit",
"hash": -2110624131494527000,
"line_mean": 25.4507042254,
"line_max": 67,
"alpha_frac": 0.5985090522,
"autogenerated": false,
"ratio": 3.2547660311958406,
"config_test": false,
... |
#! /bin/env python
import MySQLdb, os,sys,string,re,threading,subprocess,math,time,socket,logging,getopt,glob,shlex
pm1=MySQLdb.connect(host='127.0.0.1',user='root',db='mnt')
cur1=pm1.cursor()
if __name__=='__main__':
#cmd1 = ['tcpdump', '-i', 'eth1', '-tt','-nn', 'src', '166.111.132.80']
cmd1 = ['/usr/sbin/tcpdu... | {
"repo_name": "neoyk/search",
"path": "tcpdump.py",
"copies": "1",
"size": "1712",
"license": "apache-2.0",
"hash": -442044818787569660,
"line_mean": 29.5714285714,
"line_max": 99,
"alpha_frac": 0.6197429907,
"autogenerated": false,
"ratio": 2.4775687409551375,
"config_test": false,
"has_no_k... |
#!/bin/env python
import nltk
from nltk import wordnet as wn
# TODO: add full dict later
dictionary = ['bigot', 'demur', 'pandiculation', 'perpetuate', 'pedantic', 'euphemism',
'petrify', 'adage', 'resentment', 'aglet']
from nltk.tokenize import RegexpTokenizer
# use jcn_similarity, lin_similarity or... | {
"repo_name": "divkakwani/revd",
"path": "revd/prototype.py",
"copies": "1",
"size": "2041",
"license": "mit",
"hash": -8485407254116457000,
"line_mean": 31.9193548387,
"line_max": 88,
"alpha_frac": 0.6829985301,
"autogenerated": false,
"ratio": 3.169254658385093,
"config_test": false,
"has_n... |
#!/bin/env python
import numpy as np
from matplotlib import pyplot as plt
import argparse
import sys
import parse_ats
def load(fname, density):
dat = np.loadtxt(fname) # units s, mol/s
dat[:,0] = dat[:,0] / 86400. # convert to days
dat[:,1] = dat[:,1] / density * 86400 # convert to m^3/d
return dat
d... | {
"repo_name": "amanzi/ats-dev",
"path": "tools/utils/plot_runoff.py",
"copies": "2",
"size": "2293",
"license": "bsd-3-clause",
"hash": -825317127116271400,
"line_mean": 39.2280701754,
"line_max": 136,
"alpha_frac": 0.6402093328,
"autogenerated": false,
"ratio": 3.1584022038567494,
"config_test... |
#!/bin/env python
import numpy as np
from openff.toolkit.typing.engines.smirnoff.forcefield import ForceField
from openff.toolkit.typing.chemistry import environment
# Function definitions for parsing sections within parameter file
def _parse_nonbon_line( line ):
"""Parse an AMBER frcmod nonbon line and return re... | {
"repo_name": "open-forcefield-group/openforcefield",
"path": "utilities/deprecated/convert_frosst/convert_frcmod_0.1.py",
"copies": "1",
"size": "10119",
"license": "mit",
"hash": 3929437933985549000,
"line_mean": 39.3147410359,
"line_max": 282,
"alpha_frac": 0.607174622,
"autogenerated": false,
... |
#!/bin/env python
import numpy as np
from openff.toolkit.typing.engines.smirnoff.forcefield import ForceField
# Function definitions for parsing sections within parameter file
def _parse_nonbon_line( line ):
"""Parse an AMBER frcmod nonbon line and return relevant parameters in a dictionary. AMBER uses rmin_half ... | {
"repo_name": "open-forcefield-group/openforcefield",
"path": "utilities/deprecated/convert_frosst/convert_frcmod_0.3.py",
"copies": "1",
"size": "10498",
"license": "mit",
"hash": -657903869834383500,
"line_mean": 41.1606425703,
"line_max": 282,
"alpha_frac": 0.6234520861,
"autogenerated": false,
... |
#!/bin/env/python
import numpy as np
from scipy import signal
from scipy import stats
DEFAULT_NONZERO_THRESH = .001
# ------------------------------- Array attribute checks
def isScalar(x):
return not hasattr(x, "__len__")
def isSingleton(x):
return (not isScalar(x)) and (len(x) == 1)
def is1D(x):
return len... | {
"repo_name": "dblalock/dig",
"path": "python/dig/utils/arrays.py",
"copies": "2",
"size": "14097",
"license": "mit",
"hash": -7958994564392240000,
"line_mean": 24.128342246,
"line_max": 83,
"alpha_frac": 0.6590054622,
"autogenerated": false,
"ratio": 2.5842346471127406,
"config_test": false,
... |
#! /bin/env python
import numpy as np
from scipy.spatial import KDTree
from six.moves import zip
from .imapper import IGridMapper, IncompatibleGridError
# from .mapper import IncompatibleGridError
def map_points_to_cells(coords, src_grid, src_point_ids, bad_val=-1):
(dst_x, dst_y) = coords
point_to_cell_i... | {
"repo_name": "csdms/pymt",
"path": "pymt/mappers/celltopoint.py",
"copies": "2",
"size": "1850",
"license": "mit",
"hash": 2727369138523646500,
"line_mean": 27.4615384615,
"line_max": 88,
"alpha_frac": 0.5902702703,
"autogenerated": false,
"ratio": 3.0179445350734095,
"config_test": false,
"... |
#! /bin/env python
import numpy as np
from scipy.spatial import KDTree
from .imapper import IGridMapper, IncompatibleGridError
# from .mapper import IncompatibleGridError
def _flat_view(array):
return array.view().reshape((array.size,))
def copy_good_values(src, dst, bad_val=-999):
"""Copy only the good ... | {
"repo_name": "csdms/coupling",
"path": "pymt/mappers/pointtopoint.py",
"copies": "2",
"size": "4533",
"license": "mit",
"hash": -2349625462266840000,
"line_mean": 27.6898734177,
"line_max": 85,
"alpha_frac": 0.5539377895,
"autogenerated": false,
"ratio": 3.6062052505966586,
"config_test": fals... |
#! /bin/env python
import numpy as np
from six import MAXSIZE
from .igrid import IGrid
from .utils import (
args_as_numpy_arrays,
coordinates_to_numpy_matrix,
get_default_coordinate_names,
get_default_coordinate_units,
)
class UnstructuredPoints(IGrid):
def __init__(self, *args, **kwds):
... | {
"repo_name": "csdms/coupling",
"path": "pymt/grids/unstructured.py",
"copies": "1",
"size": "8078",
"license": "mit",
"hash": -2033936663053008100,
"line_mean": 27.4436619718,
"line_max": 92,
"alpha_frac": 0.5459272097,
"autogenerated": false,
"ratio": 3.6485998193315266,
"config_test": false,... |
#!/bin/env python
import numpy as np
from vmc_postproc import recspace
def delta(kx,ky,params):
return 0.5*(np.exp(1j*params['phi'])*np.cos(kx*2*np.pi)+\
np.exp(-1j*params['phi'])*np.cos(ky*2*np.pi))
def mfham(kx,ky,params):
H=np.zeros([4,4]+list(np.shape(kx)),dtype=complex)
dk=delta(kx,k... | {
"repo_name": "EPFL-LQM/gpvmc",
"path": "tools/vmc_postproc/sfpnxphz.py",
"copies": "2",
"size": "7373",
"license": "mit",
"hash": -56909345887572150,
"line_mean": 54.4360902256,
"line_max": 127,
"alpha_frac": 0.5171571952,
"autogenerated": false,
"ratio": 2.0922247446083997,
"config_test": fal... |
#!/bin/env python
import numpy as np
from void_basics import *
from pylab import *
def Dsigma_histogram(ax, y, mean_method=np.mean, alpha=0.32, samples=10000):
m, CI = bootstrap_confidence_intervals(y, mean_method=mean_method, alpha=alpha, samples=samples)
ax.hist(y, 40, range=[-2,2])
ax.text(0.95,0.95,'$... | {
"repo_name": "pmelchior/void-lensing",
"path": "DeltaSigma_distribution.py",
"copies": "1",
"size": "1798",
"license": "mit",
"hash": -781996545725151500,
"line_mean": 34.96,
"line_max": 123,
"alpha_frac": 0.6184649611,
"autogenerated": false,
"ratio": 2.8585055643879174,
"config_test": false,... |
#! /bin/env python
import numpy as np
import matplotlib as mpl
import matplotlib.pyplot as plt
default_color='C0'
def mpwell(tracks, title=None, mindepth=None, maxdepth=None, tagged_depths=None):
"""Create a well log using matplotlib.
tracks: list of tracks. Each track is a dictionary with a 'traces'
... | {
"repo_name": "g2boojum/matplot-well-log",
"path": "mpwell.py",
"copies": "1",
"size": "3487",
"license": "mit",
"hash": 217484252381299300,
"line_mean": 43.7051282051,
"line_max": 89,
"alpha_frac": 0.6128477201,
"autogenerated": false,
"ratio": 3.8234649122807016,
"config_test": false,
"has_... |
#!/bin/env/python
import numpy as np
import matplotlib.pyplot as plt
from sklearn.decomposition import TruncatedSVD
from ..algo.motif import findMotif, findAllMotifInstances
from ..utils.subseq import simMatFromDistTensor
from viz_utils import plotRect, plotRanges
def findAndPlotMotif(seq, lengths, **kwargs):
moti... | {
"repo_name": "dblalock/flock",
"path": "python/viz/motifs.py",
"copies": "1",
"size": "8148",
"license": "mit",
"hash": 4465334422737102000,
"line_mean": 29.5168539326,
"line_max": 87,
"alpha_frac": 0.692562592,
"autogenerated": false,
"ratio": 2.6445959104186954,
"config_test": false,
"has_... |
#!/bin/env python
import numpy as np
import matplotlib.pyplot as plt
def main():
UNDEFINED = 7
M = 40000
# M = 500
# M = 2
# K = 16
# C = 64
try_Cs = np.array([2, 4, 8, 16, 32, 64, 128])
try_Us = np.array([2, 4, 8, 16, 32, 64, 128])
biases = np.zeros((try_Cs.size, try_Us.size))... | {
"repo_name": "dblalock/bolt",
"path": "experiments/python/debias_scratch.py",
"copies": "1",
"size": "3567",
"license": "mpl-2.0",
"hash": 38274661732410264,
"line_mean": 32.3364485981,
"line_max": 77,
"alpha_frac": 0.5284552846,
"autogenerated": false,
"ratio": 3.1455026455026456,
"config_tes... |
#!/bin/env python
import numpy as np
import matplotlib.pyplot as plt
plt.subplot(211)
x = np.linspace(0.0, 1.0, 200)
k = 1.0
plt.plot(x, np.sin(2.0*np.pi*k*x))
xlabel = [0, 0.5, 1]
xlabelnames = [r"$0$", r"$L/2$", r"$L$"]
ylabel = [-1, 1]
ylabelnames = [r"$-1$", r"$1$"]
ax = plt.gca()
ax.spines['left'].set_pos... | {
"repo_name": "zingale/powerspectrum_test",
"path": "wavenumber.py",
"copies": "1",
"size": "1251",
"license": "bsd-3-clause",
"hash": 6616223161368222000,
"line_mean": 18.2461538462,
"line_max": 42,
"alpha_frac": 0.6698641087,
"autogenerated": false,
"ratio": 2.338317757009346,
"config_test": ... |
#!/bin/env/python
# import numpy as np
import pandas as pd
from pandas.tools.merge import concat
from sklearn.svm import SVC, LinearSVC
# from sklearn.qda import QDA
# from sklearn.lda import LDA
from datasets import datasets as ds
from utils.misc import nowAsString
from utils.learn import tryParams
from analyze.sota... | {
"repo_name": "dblalock/flock",
"path": "python/main/main.py",
"copies": "1",
"size": "2828",
"license": "mit",
"hash": -9040692364787466000,
"line_mean": 29.085106383,
"line_max": 75,
"alpha_frac": 0.7004950495,
"autogenerated": false,
"ratio": 2.8139303482587064,
"config_test": true,
"has_n... |
#!/bin/env python
import numpy as np
import scipy.signal as ss
import astropy.io.fits as fits
import matplotlib.pyplot as plt
inpt = str(raw_input("Nome do Arquivo: "))
lc = fits.open(inpt)
bin = float(raw_input("bin size (or camera resolution): "))
# Convert to big-endian array is necessary to the lombscargle funct... | {
"repo_name": "evandromr/python_scitools",
"path": "plot_periodogramas.py",
"copies": "1",
"size": "2760",
"license": "mit",
"hash": 726614943230193400,
"line_mean": 29,
"line_max": 80,
"alpha_frac": 0.6326086957,
"autogenerated": false,
"ratio": 2.929936305732484,
"config_test": false,
"has_... |
#!/bin/env python
import numpy as np
import scipy.signal as ss
import astropy.io.fits as fits
import matplotlib.pyplot as plt
inpt = str(raw_input("Nome do Arquivo: "))
lc = fits.open(inpt)
bin = float(raw_input("bin size (or camera resolution): "))
# Convert to big-endian array is necessary to the lombscargle func... | {
"repo_name": "evandromr/python_scitools",
"path": "plotperiodogram.py",
"copies": "1",
"size": "1814",
"license": "mit",
"hash": 8216161845557475000,
"line_mean": 25.2898550725,
"line_max": 95,
"alpha_frac": 0.6455347299,
"autogenerated": false,
"ratio": 2.8657187993680884,
"config_test": fals... |
#!/bin/env python
import numpy as np
def get_lensing_data():
"""Get data for the SDSS void lensing analysis.
The data is from SDSS DR8 r-band imaging. See section 2 of the paper for
details. Use get_EBR() to convert to E/B-mode measurements.
Returns:
pyfits HDU, with the data stored in exten... | {
"repo_name": "pmelchior/void-lensing",
"path": "void_basics.py",
"copies": "1",
"size": "13647",
"license": "mit",
"hash": -6535979048365330000,
"line_mean": 37.8803418803,
"line_max": 127,
"alpha_frac": 0.6243130358,
"autogenerated": false,
"ratio": 3.322863403944485,
"config_test": false,
... |
#! /bin/env python
import numpy as np
from ..grids.esmp import EsmpUnstructuredField
from .imapper import IGridMapper
from .mapper import IncompatibleGridError
try:
import ESMF as esmf
except ImportError:
esmf = None
REGRID_METHOD = None
UNMAPPED_ACTION = None
else:
REGRID_METHOD = esmf.RegridMet... | {
"repo_name": "csdms/pymt",
"path": "pymt/mappers/esmp.py",
"copies": "2",
"size": "3756",
"license": "mit",
"hash": -550127701857691500,
"line_mean": 27.0298507463,
"line_max": 79,
"alpha_frac": 0.5977103301,
"autogenerated": false,
"ratio": 3.396021699819168,
"config_test": false,
"has_no_k... |
#!/bin/env python
import numpy as np
from vmc_postproc import recspace
def delta(kx,ky,params):
return 0.5*(np.exp(1j*params['phi']*np.pi)*np.cos(kx*2*np.pi)+\
np.exp(-1j*params['phi']*np.pi)*np.cos(ky*2*np.pi))
def neelk(kx,ky,params):
if params.setdefault('neel_exp',0.0)==0.0:
retu... | {
"repo_name": "bdallapi/gpvmc",
"path": "tools/vmc_postproc/stagflux.py",
"copies": "2",
"size": "2963",
"license": "mit",
"hash": -1366236462437614000,
"line_mean": 34.2738095238,
"line_max": 101,
"alpha_frac": 0.5467431657,
"autogenerated": false,
"ratio": 2.151779230210603,
"config_test": fa... |
#!/bin/env/python
import numpy as np
def energy(A):
if A.ndim < 2 or len(A) < 2:
return 0
diffs = A - A.mean(axis=0)
return np.sum(diffs * diffs)
def run_trial(N=100, D=3, seed=None):
if seed is not None:
np.random.seed(seed)
w0, w = np.random.randn(2, D)
X = np.random.ran... | {
"repo_name": "dblalock/bolt",
"path": "experiments/python/submodular_scratch.py",
"copies": "1",
"size": "3835",
"license": "mpl-2.0",
"hash": 8559674918176215000,
"line_mean": 31.7777777778,
"line_max": 70,
"alpha_frac": 0.4461538462,
"autogenerated": false,
"ratio": 2.6267123287671232,
"conf... |
#!/bin/env python
import numpy
from math import pi, sin, cos, fabs, sqrt
import sys
import time
import ROOT
def RotateCoordinates(points, theta, phi):
# We want to be in a coordinate system such that
# theta is the zenith angle
# and phi is the angle from north (such that pi/2 is east)
rot_phi = numpy... | {
"repo_name": "steveherrin/PhDThesis",
"path": "Thesis/scripts/muon_flux/ProjectedArea.py",
"copies": "1",
"size": "6005",
"license": "mit",
"hash": -1931172530379038000,
"line_mean": 29.7948717949,
"line_max": 98,
"alpha_frac": 0.5645295587,
"autogenerated": false,
"ratio": 2.9920279023418037,
... |
#!/bin/env python
import oauth2 as oauth
import urllib2 as urllib
# See Assginment 6 instructions or README for how to get these credentials
access_token_key = ""
access_token_secret = ""
consumer_key = ""
consumer_secret = ""
_debug = 0
oauth_token = oauth.Token(key=access_token_key, secret=access_token_secret... | {
"repo_name": "kingmolnar/twitter-social-media-tracking",
"path": "public-stream/twitterstream.py",
"copies": "1",
"size": "1702",
"license": "cc0-1.0",
"hash": -290659916025599400,
"line_mean": 26.0158730159,
"line_max": 78,
"alpha_frac": 0.6474735605,
"autogenerated": false,
"ratio": 3.72428884... |
#!/bin/env python
import optparse
from sql import SQL, sql_sink
from common import *
class driver:
def __init__(self, symbols, options):
self.symbols_ = symbols
self.options_ = options
self.request_ = request(diag=False)
def fetch_live(self):
assert len(self.symbols_) > 0... | {
"repo_name": "jodvova/stocks",
"path": "main.py",
"copies": "1",
"size": "3100",
"license": "apache-2.0",
"hash": 5832388723488165000,
"line_mean": 36.8048780488,
"line_max": 114,
"alpha_frac": 0.5422580645,
"autogenerated": false,
"ratio": 3.7259615384615383,
"config_test": false,
"has_no_k... |
#!/bin/env python
import optparse
import threading
import time
import sys
import os
import re
from signal import SIGTERM
from syslog import syslog, LOG_WARNING, LOG_NOTICE
def compare_processes_cmd(process_cmd, pid):
process_cmd = re.sub(" +", " ", process_cmd).strip()
try:
with open("/proc/%s/cmdli... | {
"repo_name": "kmalov/lockrun",
"path": "lockrun.py",
"copies": "1",
"size": "5711",
"license": "mit",
"hash": 4386355304438847000,
"line_mean": 29.5454545455,
"line_max": 104,
"alpha_frac": 0.5508667484,
"autogenerated": false,
"ratio": 3.6964401294498384,
"config_test": false,
"has_no_keywo... |
#!/bin/env python
import os
from distutils.core import setup
name = 'caulk'
version = '0.1'
release = '4'
versrel = version + '-' + release
readme = os.path.join(os.path.dirname(__file__), 'README.rst')
download_url = 'https://github.com/downloads/smartfile/caulk' \
'/' + name + '-' + versr... | {
"repo_name": "pombredanne/caulk",
"path": "setup.py",
"copies": "1",
"size": "1107",
"license": "mit",
"hash": -2371262041651813000,
"line_mean": 29.75,
"line_max": 73,
"alpha_frac": 0.6052393857,
"autogenerated": false,
"ratio": 3.594155844155844,
"config_test": false,
"has_no_keywords": fa... |
#!/bin/env python
import os
from distutils.core import setup
name = 'django_sphinx_db'
version = '0.1'
release = '3'
versrel = version + '-' + release
readme = os.path.join(os.path.dirname(__file__), 'README.rst')
download_url = 'https://github.com/downloads/smartfile/django-sphinx-db' \
'/... | {
"repo_name": "smartfile/django-sphinx-db",
"path": "setup.py",
"copies": "2",
"size": "1297",
"license": "bsd-3-clause",
"hash": -9035347262099439000,
"line_mean": 30.6341463415,
"line_max": 74,
"alpha_frac": 0.6083269082,
"autogenerated": false,
"ratio": 3.643258426966292,
"config_test": fals... |
#!/bin/env python
import os
from setuptools import setup
name = 'django-transfer'
version = '0.4'
readme = os.path.join(os.path.dirname(__file__), 'README.rst')
with open(readme) as readme_file:
long_description = readme_file.read()
setup(
name = name,
version = version,
description = 'A django appli... | {
"repo_name": "smartfile/django-transfer",
"path": "setup.py",
"copies": "1",
"size": "1098",
"license": "mit",
"hash": -2980221008243864600,
"line_mean": 28.6756756757,
"line_max": 93,
"alpha_frac": 0.6111111111,
"autogenerated": false,
"ratio": 3.8526315789473684,
"config_test": false,
"has... |
#!/bin/env python
import os
import csv
import sys
import argparse
import pywbem
import StringIO
import subprocess
import logging
import logging.handlers
from collections import defaultdict
from datetime import datetime, timedelta
log_level = logging.INFO
# User Configurable Parameters
# -----------------------------... | {
"repo_name": "ktelep/EMC-Zabbix-Integration",
"path": "emc_vnx_stats.py",
"copies": "1",
"size": "23339",
"license": "mit",
"hash": -2100271343382282500,
"line_mean": 34.308623298,
"line_max": 79,
"alpha_frac": 0.5766742363,
"autogenerated": false,
"ratio": 3.76921834625323,
"config_test": fal... |
#!/bin/env/python
import os
import itertools
import warnings
import numpy as np
try:
from joblib import Memory
memory = Memory(verbose=0, '.')
cache = memory.cache
except:
def cache(f):
return f
from sequence import uniqueElementPositions
# ================================================================ Con... | {
"repo_name": "dblalock/flock",
"path": "python/utils/pyience.py",
"copies": "2",
"size": "13797",
"license": "mit",
"hash": -3434382891982936000,
"line_mean": 26.2130177515,
"line_max": 82,
"alpha_frac": 0.6418786693,
"autogenerated": false,
"ratio": 3.1207871522280026,
"config_test": true,
... |
#!/bin/env/python
import os
import numpy as np
import matplotlib as mpl
import matplotlib.pyplot as plt
import seaborn as sb
from joblib import Memory
memory = Memory('.', verbose=0)
from ..algo.ff10 import learnFFfromSeq
from ..algo.motif import findMotifPatternInstances, findAllMotifPatternInstances
from ..datase... | {
"repo_name": "dblalock/flock",
"path": "python/viz/figs.py",
"copies": "1",
"size": "28817",
"license": "mit",
"hash": -6338864878702412000,
"line_mean": 30.1872294372,
"line_max": 88,
"alpha_frac": 0.6644688899,
"autogenerated": false,
"ratio": 2.5581003106968487,
"config_test": false,
"has... |
#!/bin/env/python
import os
import numpy as np
import matplotlib.pyplot as plt
import seaborn as sb
import pandas as pd
import pathlib as pl
# from . import files
from . import amm_results as res
from . import amm_methods as ameth
sb.set_context('poster')
# sb.set_context('talk')
# sb.set_cmap('tab10')
RESULTS_DIR... | {
"repo_name": "dblalock/bolt",
"path": "experiments/python/amm_figs.py",
"copies": "1",
"size": "13972",
"license": "mpl-2.0",
"hash": -4348432023627271700,
"line_mean": 34.2828282828,
"line_max": 81,
"alpha_frac": 0.5517463498,
"autogenerated": false,
"ratio": 3.004085142980004,
"config_test":... |
#!/bin/env python
import os
import psutil
import socket
import ssl
from SocketServer import ThreadingMixIn
from jrpc import SimpleTCPServer
from jrpc import SimpleTCPRequestHandler
from jrpc.functions import execute
from jrpc.functions import parseProcesses
from jrpc.functions import parseNetstat
from jrpc.function... | {
"repo_name": "umairghani/py-jrpc",
"path": "examples/myserver-server.py",
"copies": "1",
"size": "8891",
"license": "mit",
"hash": 5087109682504671000,
"line_mean": 27.1392405063,
"line_max": 125,
"alpha_frac": 0.5364975818,
"autogenerated": false,
"ratio": 3.913292253521127,
"config_test": fa... |
#!/bin/env python
import os
import random
import string
class InFile(object):
def __init__(self, fp: str, num_lines: int):
self.path = fp
self.limit = num_lines
def __enter__(self):
self.f = open(self.path, 'rb')
self.current_line = ''
self.next_index = 0
self... | {
"repo_name": "rdhyee/python-taq",
"path": "utils/generate_test_data.py",
"copies": "1",
"size": "3965",
"license": "bsd-2-clause",
"hash": -1454436818156214500,
"line_mean": 30.72,
"line_max": 105,
"alpha_frac": 0.5646910467,
"autogenerated": false,
"ratio": 3.688372093023256,
"config_test": f... |
#!/bin/env python
import os
import re
from future.utils import iteritems
from pandalogger import logger_config
logdir = logger_config.daemon['logdir']
# collect data
data = dict()
with open(os.path.join(logdir, 'panda-db_proxy_pool.log')) as f:
for line in f:
m = re.search('<method=([^>]+)> release lock... | {
"repo_name": "PanDAWMS/panda-harvester",
"path": "pandaharvester/harvestertest/check_log_db_proxy_pool.py",
"copies": "2",
"size": "1983",
"license": "apache-2.0",
"hash": 7534958636288026000,
"line_mean": 23.4814814815,
"line_max": 105,
"alpha_frac": 0.5421079173,
"autogenerated": false,
"ratio... |
#!/bin/env python
import os
import re
from setuptools import setup
VERSION_PATTERN = re.compile(r'^[^#]*__version__\W*\=\W*["\'](.*)["\']')
VERSION = None
with open('requirements.txt') as f:
required = f.read().splitlines()
required = [r for r in required if not r.startswith('git')]
def get_path(path):
re... | {
"repo_name": "smartfile/client-python",
"path": "setup.py",
"copies": "1",
"size": "1509",
"license": "mit",
"hash": 1150536714838163600,
"line_mean": 25.4736842105,
"line_max": 74,
"alpha_frac": 0.6163021869,
"autogenerated": false,
"ratio": 3.7076167076167077,
"config_test": false,
"has_no... |
#!/bin/env python
import os
import re
import sys
import time
import pickle
import random
import socket
import os.path
import traceback
import subprocess
from optparse import OptionParser
VERSION='1.1.0.7'
COLOR = {
'success' : '\33[2;32m', # Green
'fail' : '\033[2;31m', # Red
'bad' : '\033[31... | {
"repo_name": "DarthMaulware/EquationGroupLeaks",
"path": "Leak #4 - Don't Forget Your Base/EQGRP-Auction-File/Linux/etc/autoutils.py",
"copies": "1",
"size": "22459",
"license": "unlicense",
"hash": -6912045329310943000,
"line_mean": 26.2560679612,
"line_max": 97,
"alpha_frac": 0.4876886771,
"auto... |
#!/bin/env python
import os
import sane
import tempfile
import threading
import argparse
import subprocess
import shutil
import time
import re
import pwd
from PIL import Image
MIN_SEVERITY = 1
DEPTH = 8
MODE = 'color'
ADF = 'ADF'
DEVICE_NAME = 'MFP_M277'
DPI = 300
COMPRESSION = 'None'
DIM_DPI = '2480x3508'
LANG = '... | {
"repo_name": "BastiG/pdf-utils",
"path": "scripts/scan-pdf.py",
"copies": "1",
"size": "9444",
"license": "mit",
"hash": 2017508858097403000,
"line_mean": 30.1716171617,
"line_max": 106,
"alpha_frac": 0.5784625159,
"autogenerated": false,
"ratio": 3.431686046511628,
"config_test": false,
"ha... |
#!/bin/env python
import os
import shutil
import string
import subprocess
import sys
from os.path import sep
outBase = '..' + sep + '..' + sep + 'output' + sep + 'calcPhifBenchmark'
def findAveragePotentTime(dataPath):
avgTime = 0
f = open(dataPath + sep + 'performance.csv', 'r')
potentTimeSum = 0
n... | {
"repo_name": "CacheMiss/pic",
"path": "performance_tests/potent_test/benchmarkCalcPhif.py",
"copies": "1",
"size": "2910",
"license": "bsd-2-clause",
"hash": 2990501806515931000,
"line_mean": 25.2162162162,
"line_max": 79,
"alpha_frac": 0.5807560137,
"autogenerated": false,
"ratio": 3.2844243792... |
#!/bin/env python
import os
import shutil
import sys
BACKUP_SUFFIX = '.bak'
def detect(link_target, link, copy=False):
if copy:
try:
return os.path.exists(link)
except OSError:
return False
else:
try:
return os.path.realpath(link) == os.path.realpath(link_target)
except OSError:
return False
d... | {
"repo_name": "bovesan/mistika-hyperspeed",
"path": "hyperspeed/manage.py",
"copies": "1",
"size": "2332",
"license": "apache-2.0",
"hash": -5659701030024426000,
"line_mean": 24.0860215054,
"line_max": 65,
"alpha_frac": 0.6389365352,
"autogenerated": false,
"ratio": 2.9974293059125965,
"config_... |
#!/bin/env/python
import os
import shutil
def ls(dir='.'):
return os.listdir(dir)
def is_hidden(path):
return os.path.basename(path).startswith('.')
def is_visible(path):
return not is_hidden(path)
def join_paths(dir, contents):
return [os.path.join(dir, f) for f in contents]
def files_matchi... | {
"repo_name": "dblalock/bolt",
"path": "experiments/python/datasets/files.py",
"copies": "1",
"size": "2958",
"license": "mpl-2.0",
"hash": 7449211963707530000,
"line_mean": 28,
"line_max": 74,
"alpha_frac": 0.5865449628,
"autogenerated": false,
"ratio": 3.5854545454545454,
"config_test": false... |
#!/bin/env/python
import os
import shutil
def ls():
return os.listdir('.')
def is_hidden(path):
return os.path.basename(path).startswith('.')
def is_visible(path):
return not is_hidden(path)
def join_paths(dir, contents):
return map(lambda f: os.path.join(dir, f), contents)
def files_matching... | {
"repo_name": "dblalock/dig",
"path": "tests/files.py",
"copies": "1",
"size": "2422",
"license": "mit",
"hash": 8330699386142497000,
"line_mean": 24.7659574468,
"line_max": 76,
"alpha_frac": 0.5962014864,
"autogenerated": false,
"ratio": 3.66969696969697,
"config_test": false,
"has_no_keywor... |
#!/bin/env python
import os
import stat
import glob
import subprocess
import time
start_time = time.time()
maxjobs = 5000
# maxjobs = 3000
first_job = 0
jobcount = 0
skipped_jobs = 0
max_concurrent_jobs = 250
qstat_freq = 25
qstat_countdown = 0
os.chdir('jobscripts_150619_prob_octant12_FC_knninit')
all_jobs = glob.gl... | {
"repo_name": "cmbruns/pyktx",
"path": "src/tools/cluster/submit.py",
"copies": "1",
"size": "1666",
"license": "mit",
"hash": 186079300117432860,
"line_mean": 32.32,
"line_max": 130,
"alpha_frac": 0.6338535414,
"autogenerated": false,
"ratio": 3.338677354709419,
"config_test": false,
"has_no... |
#!/bin/env python
import os
import sys
from os.path import dirname
from os.path import join as pathjoin
from setuptools import find_packages
from setuptools import setup
NAME = 'fulltext'
VERSION = '0.7'
if os.name == 'nt' and not sys.maxsize > 2 ** 32:
# https://github.com/btimby/fulltext/issues/79
raise Ru... | {
"repo_name": "btimby/fulltext",
"path": "setup.py",
"copies": "1",
"size": "1562",
"license": "mit",
"hash": 746436517640452100,
"line_mean": 26.4035087719,
"line_max": 79,
"alpha_frac": 0.6446862996,
"autogenerated": false,
"ratio": 3.719047619047619,
"config_test": false,
"has_no_keywords"... |
#!/bin/env python
import os
import sys
from pycparser import parse_file, c_generator, c_ast
sys.path.extend(['.', '..'])
class StructVisitor(c_ast.NodeVisitor):
def visit_Struct(self, node):
try:
if not 'cef_base_t' in node.decls[0].type.type.names:
return
except Attr... | {
"repo_name": "schachmat/cefcapi",
"path": "implement_interface.py",
"copies": "1",
"size": "6346",
"license": "bsd-3-clause",
"hash": -4865883830962268000,
"line_mean": 38.9119496855,
"line_max": 103,
"alpha_frac": 0.5055152852,
"autogenerated": false,
"ratio": 3.317302665969681,
"config_test"... |
#!/bin/env python
import os
import sys
import json
import stat
import traceback
import httplib
import time
import urllib
DEBUG=False
class file(object):
def __init__(self,src):
self.src = src
self.counter = 0
self.filehandle = None
self.positionfile = '/opt/script/odcp-console.txt'
self.positio... | {
"repo_name": "dengxiangyu768/dengxytools",
"path": "ops/analysislog.py",
"copies": "1",
"size": "2429",
"license": "apache-2.0",
"hash": -7778902686039449000,
"line_mean": 24.3020833333,
"line_max": 83,
"alpha_frac": 0.5957184026,
"autogenerated": false,
"ratio": 3.4067321178120618,
"config_te... |
#!/bin/env python
import os
import sys
import string
from xml.dom import minidom
#
# opgen.py -- generates tables and constants for decoding
#
# - itab.c
# - itab.h
#
#
# special mnemonic types for internal purposes.
#
spl_mnm_types = [ 'd3vil', \
'na', \
'grp_r... | {
"repo_name": "linux-kernel-live-patching/ksplice-ud",
"path": "libudis86/opgen.py",
"copies": "1",
"size": "20617",
"license": "bsd-2-clause",
"hash": 12037549972884604,
"line_mean": 31.3150470219,
"line_max": 90,
"alpha_frac": 0.3733326866,
"autogenerated": false,
"ratio": 2.845293955285675,
... |
#!/bin/env python
import os
import sys
import subprocess
import logging
from watchdog.observers import Observer
from watchdog.events import FileSystemEventHandler
class Util(object):
@classmethod
def remove_kafka_topic(cls,zk,topic,logger):
rm_kafka_topic = "kafka-topics --delete --zookeeper {0} ... | {
"repo_name": "kpeiruza/incubator-spot",
"path": "spot-ingest/common/utils.py",
"copies": "1",
"size": "3558",
"license": "apache-2.0",
"hash": -7104384770916794000,
"line_mean": 31.6422018349,
"line_max": 118,
"alpha_frac": 0.6652613828,
"autogenerated": false,
"ratio": 3.634320735444331,
"con... |
#!/bin/env python
import os
import sys
import tornado.httpserver
import tornado.ioloop
import tornado.options
import application as app
# Return the libs path (this path is appended to module search path/sys.path).
def get_libs_path():
zpath = os.getenv("OPENSHIFT_REPO_DIR")
zpath = zpath if zpath else "./"
... | {
"repo_name": "ramr/openshift-tornado-websockets",
"path": "server.py",
"copies": "1",
"size": "1259",
"license": "mit",
"hash": 1590105707471127300,
"line_mean": 26.3695652174,
"line_max": 78,
"alpha_frac": 0.6791104051,
"autogenerated": false,
"ratio": 3.5069637883008355,
"config_test": false... |
#!/bin/env python
import os
import sys
import tornado.httpserver
import tornado.ioloop
import tornado.options
import app_server as app
# Return the libs path (this path is appended to module search path/sys.path).
def get_libs_path():
zpath = os.getenv("OPENSHIFT_REPO_DIR")
zpath = zpath if zpath else "./"
... | {
"repo_name": "fabioz/django-tornado-websockets-openshift",
"path": "app.py",
"copies": "2",
"size": "1427",
"license": "mit",
"hash": 2741129495069067300,
"line_mean": 24.9454545455,
"line_max": 78,
"alpha_frac": 0.6629292221,
"autogenerated": false,
"ratio": 3.6310432569974553,
"config_test":... |
#!/bin/env python
import os
import sys
import tornado.httpserver
import tornado.ioloop
import tornado.options
import server_app as app
# Return the libs path (this path is appended to module search path/sys.path).
def get_libs_path():
zpath = os.getenv("OPENSHIFT_REPO_DIR")
zpath = zpath if zpath else "./"
... | {
"repo_name": "awwong1/apollo",
"path": "app.py",
"copies": "1",
"size": "1427",
"license": "mit",
"hash": -7901936891918308000,
"line_mean": 24.9454545455,
"line_max": 78,
"alpha_frac": 0.6629292221,
"autogenerated": false,
"ratio": 3.6310432569974553,
"config_test": false,
"has_no_keywords"... |
#!/bin/env python
import os
import sys
import unittest
import subprocess
import filecmp
import tempfile
testdb = "spark_ranger_test"
hiveJdbcUrl = 'jdbc:hive2://hdp26-3.openstacklocal:10500/default;principal=hive/_HOST@EXAMPLE.COM'
generateGoldenFiles = False
answerPath = "../resources/answer"
dirPath = tempfile.mkdt... | {
"repo_name": "hortonworks-spark/spark-llap",
"path": "src/test/python/spark-ranger-secure-test.py",
"copies": "1",
"size": "13612",
"license": "apache-2.0",
"hash": 4987497881836160000,
"line_mean": 43.1948051948,
"line_max": 135,
"alpha_frac": 0.5434175727,
"autogenerated": false,
"ratio": 3.24... |
#!/bin/env python
import os
import sys
import uuid
import json
import argparse
import random
def _id_to_container_name_fn(service_id):
tmp = service_id.split(':')
if len(tmp) == 3 or len(tmp) == 4:
return tmp[1]
else:
return service_id
def consul_kv(consul, path, timeout=10):
random... | {
"repo_name": "thefab/docker-consul-driven-haproxy",
"path": "root/usr/local/bin/consul_request.py",
"copies": "1",
"size": "6987",
"license": "mit",
"hash": 7009018682885641000,
"line_mean": 45.8926174497,
"line_max": 216,
"alpha_frac": 0.6099899814,
"autogenerated": false,
"ratio": 3.6447574334... |
#!/bin/env python
import os
import sys
basePath = os.path.dirname(os.path.realpath(__file__))
modulePath = basePath + "/python_modules/lib/python"
print "modulePath " + modulePath
sys.path.append( modulePath )
import defcon
import mutatorMath
import mutatorMath.ufo.document as udoc
import mutatorMath.objects.locatio... | {
"repo_name": "metapolator/mutatormathtools",
"path": "simpleblend.py",
"copies": "1",
"size": "1820",
"license": "apache-2.0",
"hash": 7333757409624274000,
"line_mean": 29.8474576271,
"line_max": 76,
"alpha_frac": 0.6582417582,
"autogenerated": false,
"ratio": 3.4018691588785046,
"config_test"... |
#!/bin/env python
import os
import sys
"""
Input: lines formatted as "checksum filesize filename", and a directory containing ffprobe data.
This tool is useful for two things:
1) Filter away files with missing ffprobe data, and produce output with the same format as the input:
cat data | fileobjectcreator/src/main/... | {
"repo_name": "statsbiblioteket/doms-transformers",
"path": "fileobjectcreator/src/main/python/missingFFProbeFiles.py",
"copies": "1",
"size": "1832",
"license": "apache-2.0",
"hash": 7229683632046696000,
"line_mean": 27.625,
"line_max": 101,
"alpha_frac": 0.6402838428,
"autogenerated": false,
"r... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.