text stringlengths 0 1.05M | meta dict |
|---|---|
__author__ = 'robert'
import os
import json
#TODO: make singleton
class Config:
def __init__(self, filename=None):
if filename is None:
url_root = 'http://d.sc2geeks.com/wp-json'
self.url_obj = url_root + '/sc2obj'
self.url_map = url_root + '/map'
self.url_p... | {
"repo_name": "RobertTheNerd/sc2geeks",
"path": "parser/sc2lib/Config.py",
"copies": "1",
"size": "1274",
"license": "mit",
"hash": -5559766287200555000,
"line_mean": 41.5,
"line_max": 75,
"alpha_frac": 0.5714285714,
"autogenerated": false,
"ratio": 3.4525745257452574,
"config_test": false,
"... |
__author__ = 'robert'
import os
from pypet import Trajectory
import matplotlib.pyplot as plt
def main():
# This time we don't need an environment since we just going to look
# at data in the trajectory
traj = Trajectory('FiringRate', add_time=False)
# Let's load the trajectory from the file
# ... | {
"repo_name": "nigroup/pypet",
"path": "examples/example_13_post_processing/analysis.py",
"copies": "2",
"size": "2774",
"license": "bsd-3-clause",
"hash": 8192726489781234000,
"line_mean": 32.8414634146,
"line_max": 89,
"alpha_frac": 0.6542898342,
"autogenerated": false,
"ratio": 3.3953488372093... |
__author__ = 'robert'
LETTERS = 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'
def main():
myMessage = "Yhwvtroi, 28 Yudq 2016 - Pse bjatw pt foxgf zwjzql bgio qcwelwlar, blsg rmprochek ewrv nsoyr uvs ndcljebv rk pkium hy bef; sjr wutm vljg aybefl ds ydx mchf asx bojw lwfxx, aph fjsbntzaju kkwixit hvbduyzkik wme ylpzs gdrdv. wbu w... | {
"repo_name": "RobertEviston/CollegeWork",
"path": "4th Year Security Labs/Lab 2/Lab2Question4.py",
"copies": "1",
"size": "2285",
"license": "mit",
"hash": 9174562079197249000,
"line_mean": 38.4137931034,
"line_max": 655,
"alpha_frac": 0.6533916849,
"autogenerated": false,
"ratio": 3.08783783783... |
__author__ = 'robert'
from pypet import Environment, Trajectory
from pypet.tests.testutils.ioutils import make_temp_dir, get_log_config
import os
import matplotlib.pyplot as plt
import numpy as np
import time
def job(traj):
traj.f_ares('$set.$', 42, comment='A result')
def get_runtime(length):
filename =... | {
"repo_name": "nigroup/pypet",
"path": "pypet/tests/profiling/speed_analysis/avg_runtima_as_function_of_length.py",
"copies": "2",
"size": "2266",
"license": "bsd-3-clause",
"hash": -356311218822432060,
"line_mean": 28.8289473684,
"line_max": 97,
"alpha_frac": 0.5931156222,
"autogenerated": false,
... |
__author__ = 'robert'
from pypet import Environment, Trajectory,progressbar, Parameter
from pypet.brian import BrianParameter
from pypet.tests.testutils.ioutils import make_temp_dir, get_log_config
import os
from brian import ms
import time
import matplotlib.pyplot as plt
import cProfile as profile
def job(traj):
... | {
"repo_name": "nigroup/pypet",
"path": "pypet/tests/profiling/speed_analysis/many_runs_profiling.py",
"copies": "1",
"size": "1247",
"license": "bsd-3-clause",
"hash": -3118486886508010000,
"line_mean": 22.5471698113,
"line_max": 80,
"alpha_frac": 0.6094627105,
"autogenerated": false,
"ratio": 3.... |
__author__ = 'Robert'
__version__ = 0.1
# Use the same index file for all our responses.
response.view = 'course_of_fire/index.html'
def index():
"""
example action using the internationalization operator T and flash
rendered by views/default/index.html or views/generic.html
if you need a simple wik... | {
"repo_name": "halfdime/MarksmanshipTracker",
"path": "application/controllers/course_of_fire.py",
"copies": "1",
"size": "1777",
"license": "mit",
"hash": -9080212124417030000,
"line_mean": 31.9074074074,
"line_max": 100,
"alpha_frac": 0.6364659539,
"autogenerated": false,
"ratio": 3.70208333333... |
__author__ = 'Robert'
__version__ = 0.1
# Use the same index file for all our responses.
response.view = "report/index.html"
def index():
response.title = "Reports"
return {}
def shooter():
response.title = "Shooter Record"
script = SCRIPT("""
$('document').ready(function(){
... | {
"repo_name": "halfdime/MarksmanshipTracker",
"path": "application/controllers/report.py",
"copies": "1",
"size": "1094",
"license": "mit",
"hash": 2016645223329404000,
"line_mean": 31.1764705882,
"line_max": 96,
"alpha_frac": 0.5164533821,
"autogenerated": false,
"ratio": 3.759450171821306,
"c... |
# / / / / / / / / / / / / / / / / / / / / Imports all pngs for program
background = "Screens/background.png"
cobble = "Screens/cobblepath713.png"
hitscreen = "Screens/splash_hit.png"
frontScreen = "Screens/FrontScreen.png"
scoreBG = "Screens/highscorepage.png"
userNamein = "Screens/usernamein.png"
helpscrn = "Screens... | {
"repo_name": "robertod/Ninja-Run",
"path": "main.py",
"copies": "1",
"size": "17376",
"license": "mit",
"hash": -708766045560474900,
"line_mean": 35.8917197452,
"line_max": 121,
"alpha_frac": 0.560888582,
"autogenerated": false,
"ratio": 3.3871345029239768,
"config_test": false,
"has_no_keyw... |
from BaseHTTPServer import BaseHTTPRequestHandler, HTTPServer
import SocketServer
from signal import signal, SIGPIPE, SIG_DFL
from urlparse import parse_qs
import json
import requests
import time
import datetime
import threading, Queue
import sys
import Module
signal(SIGPIPE, SIG_DFL)
SERVER_CERTS = '/home/pi/ssl/c... | {
"repo_name": "pedrocruz/sensing_bus",
"path": "fog/fog_agent_new_tests.py",
"copies": "1",
"size": "2937",
"license": "apache-2.0",
"hash": -5962055670909383000,
"line_mean": 29.9157894737,
"line_max": 102,
"alpha_frac": 0.6312563841,
"autogenerated": false,
"ratio": 3.500595947556615,
"config... |
from xml.sax.handler import ContentHandler
from xml.sax import make_parser
from smallsmilhandler import SmallSMILHandler
import sys
import urllib
import json
class KaraokeLocal():
my_tags = []
def __init__(self, ficheroSmil):
#parseo el fichero
parser = make_parser()
smilHandler = Sm... | {
"repo_name": "robertoyubero/ptavi-p3",
"path": "karaoke.py",
"copies": "1",
"size": "2864",
"license": "apache-2.0",
"hash": 9025271051362516000,
"line_mean": 33.9268292683,
"line_max": 92,
"alpha_frac": 0.5761173184,
"autogenerated": false,
"ratio": 3.154185022026432,
"config_test": false,
... |
__author__ = 'Robert Smallshire'
class Record(object):
'''A class to which any attribute can be added at construction.'''
def __init__(self, **kwargs):
'''Initialise a Record with an attribute for each keyword argument.
The attributes of a Record are mutable and may be read from and... | {
"repo_name": "mikeckennedy/asq",
"path": "asq/record.py",
"copies": "5",
"size": "1639",
"license": "mit",
"hash": -3162020121804676600,
"line_mean": 32.1458333333,
"line_max": 112,
"alpha_frac": 0.5741305674,
"autogenerated": false,
"ratio": 4.629943502824859,
"config_test": false,
"has_no_... |
from numpy import zeros, asarray, complex128, float64, zeros_like
#pythran export levinson(float64[], float64[])
#pythran export levinson(complex128[], complex128[])
#runas import numpy as np; x = np.arange(1, 4.)*7; y = np.arange(-11., -9.)
def levinson(a, b):
"""Solve a linear Toeplitz system using Levinson re... | {
"repo_name": "serge-sans-paille/pythran",
"path": "pythran/tests/scipy/solve_toeplitz.py",
"copies": "1",
"size": "3546",
"license": "bsd-3-clause",
"hash": 4578262143728540700,
"line_mean": 30.3805309735,
"line_max": 78,
"alpha_frac": 0.5064861816,
"autogenerated": false,
"ratio": 2.84819277108... |
import sys
import os
import yaml
import glob
import shutil
from conda_build.config import config
import subprocess
import traceback
branch = None
if 'TRAVIS_BRANCH' in os.environ:
branch = os.environ['TRAVIS_BRANCH']
if 'APPVEYOR_REPO_BRANCH' in os.environ:
branch = os.environ['APPVEYOR_REPO_BRANCH']
if(bran... | {
"repo_name": "newlawrence/Pyaisa",
"path": "integration/anaconda-push.py",
"copies": "2",
"size": "1131",
"license": "mit",
"hash": -4236628978846558700,
"line_mean": 31.3142857143,
"line_max": 78,
"alpha_frac": 0.6268788683,
"autogenerated": false,
"ratio": 3.3862275449101795,
"config_test": ... |
__author__ = 'robin'
"""
A class that implements a rubstification of the nominal schedule towards uncertain events, such as unexpected
unit delays or swaps.
"""
from STN import *
import scipy
import copy
class robust_STN(object):
"""
calculate and plot a robust schedule
"""
def __init__(self, stn=S... | {
"repo_name": "robin-vjc/pySTN",
"path": "robust_STN.py",
"copies": "1",
"size": "12307",
"license": "mit",
"hash": 3425937781205621000,
"line_mean": 43.9160583942,
"line_max": 110,
"alpha_frac": 0.5571625904,
"autogenerated": false,
"ratio": 3.2696599362380447,
"config_test": false,
"has_no_... |
__author__ = 'Robin'
"""
Graphical interface for pyTetris
"""
from Setup import *
import random
clock = pygame.time.Clock()
t_1 = 1
t_2 = 1
# Start the game with a random tetramino
controller.exec_command(random.choice(TETRAMINOS))
while not model.game_mode == 'game over':
clock.tick(RATE)
# commands to be... | {
"repo_name": "robin-vjc/pytetris",
"path": "gui.py",
"copies": "1",
"size": "2164",
"license": "mit",
"hash": -6652250414233333000,
"line_mean": 28.2432432432,
"line_max": 78,
"alpha_frac": 0.5300369686,
"autogenerated": false,
"ratio": 3.750433275563258,
"config_test": false,
"has_no_keywor... |
__author__ = 'robin'
"""
Implementation of a scheduling system based on the STN model. The data of the problem is
in the __init__() method, and can be changed. Additional constraints can be included as functions
that return cvx.Constraints, and added in the STN.construst_nominal_model() method.
We pack everything in a... | {
"repo_name": "robin-vjc/pySTN",
"path": "STN.py",
"copies": "1",
"size": "15650",
"license": "mit",
"hash": 2572247172148049400,
"line_mean": 43.4602272727,
"line_max": 120,
"alpha_frac": 0.4998722045,
"autogenerated": false,
"ratio": 3.321307300509338,
"config_test": false,
"has_no_keywords... |
__author__ = 'robin'
"""
Implementation of the plotting function, used in the STN.py and robust_STN.py modules.
"""
import matplotlib.pyplot as plt
import numpy as np
def plot_stn_schedule(STN, Y_ijt, color='red', style='ggplot'):
"""
Plot a schedule.
:param STN: an instance of the STN class
:param Y... | {
"repo_name": "robin-vjc/pySTN",
"path": "plotting.py",
"copies": "1",
"size": "2148",
"license": "mit",
"hash": 8984176904270654000,
"line_mean": 42.8367346939,
"line_max": 117,
"alpha_frac": 0.54283054,
"autogenerated": false,
"ratio": 3.5445544554455446,
"config_test": false,
"has_no_keywo... |
__author__ = 'Robin'
""" Settings file, for the GUI of pyTetris """
import pygame, sys
from pygame.locals import *
from tetris import *
from collections import namedtuple
# Instantiate pyTetris engine
# ---------------------------
model = Model()
viewer = Viewer(model)
controller = Controller(model, viewer)
pygame.in... | {
"repo_name": "robin-vjc/pytetris",
"path": "Setup.py",
"copies": "1",
"size": "2871",
"license": "mit",
"hash": -5806644098118003000,
"line_mean": 25.8317757009,
"line_max": 92,
"alpha_frac": 0.5802856148,
"autogenerated": false,
"ratio": 2.9968684759916493,
"config_test": false,
"has_no_key... |
__author__ = 'rob'
from threading import Thread, Event
class AlertManager(Thread):
def __init__(self, alert_manager_config, sonosManager):
Thread.__init__(self)
self.stopRequest = Event()
self.alert_manager_config = alert_manager_config
self.alerts_active = {}
self.sonosMan... | {
"repo_name": "robdobsn/RdHomeServer",
"path": "pyFlaskServer/AlertManager.py",
"copies": "1",
"size": "1803",
"license": "mit",
"hash": 8132293106913547000,
"line_mean": 32.3888888889,
"line_max": 123,
"alpha_frac": 0.6106489185,
"autogenerated": false,
"ratio": 3.8941684665226783,
"config_tes... |
__author__ = 'rob'
import os
import inspect
import importlib
class Konfigure:
def __init__(self, mappings={"FLASK_ENV": "ENV"}, env_keys={'test': 'TestConfig',
'development': 'DevConfig',
... | {
"repo_name": "rmoskal/pyKonfigure",
"path": "konfigure/konfigure.py",
"copies": "1",
"size": "2723",
"license": "mit",
"hash": 7681075124010927000,
"line_mean": 23.5315315315,
"line_max": 95,
"alpha_frac": 0.5673889093,
"autogenerated": false,
"ratio": 3.9693877551020407,
"config_test": true,
... |
__author__ = 'rob'
from HttpHandler import HttpHandler
from threading import Thread, Lock
import time
import re
import json
class AutomationServerUpdateThread(Thread):
the_parent = None
continue_running = True
automation_server_urls = []
def __init__(self, parent, automation_server_info, update_perio... | {
"repo_name": "robdobsn/RdHomeServer",
"path": "pyFlaskServer/AutomationServer.py",
"copies": "1",
"size": "8693",
"license": "mit",
"hash": -3489208062981626400,
"line_mean": 40.7932692308,
"line_max": 171,
"alpha_frac": 0.5643621304,
"autogenerated": false,
"ratio": 3.884271671134942,
"config... |
__author__ = 'rob'
from HttpHandler import HttpHandler
import ICalParser
from threading import Thread, Lock
import time
from datetime import datetime
from datetime import timedelta
class DoorControllerKeepAliveThread(Thread):
def __init__(self, parent, door_controller_url, keepalive_period_secs):
Thread.... | {
"repo_name": "robdobsn/RdHomeServer",
"path": "pyFlaskServer/DoorController.py",
"copies": "1",
"size": "1518",
"license": "mit",
"hash": -7589835552857731000,
"line_mean": 32.7555555556,
"line_max": 121,
"alpha_frac": 0.6712779974,
"autogenerated": false,
"ratio": 4.026525198938992,
"config_t... |
__author__ = 'rob'
import soco
from SonosDevice import SonosDevice
from threading import Thread, Event, Lock
import json
from HttpHandler import HttpHandler
from bson import json_util
from pymongo import MongoClient
class SonosManager(Thread):
def __init__(self, sonos_manager_config, mongo_db_server, media_serve... | {
"repo_name": "robdobsn/RdHomeServer",
"path": "pyFlaskServer/SonosManager.py",
"copies": "1",
"size": "11006",
"license": "mit",
"hash": -7427266821434128000,
"line_mean": 48.8054298643,
"line_max": 530,
"alpha_frac": 0.553879702,
"autogenerated": false,
"ratio": 3.828173913043478,
"config_tes... |
__author__ = 'rob'
import sys, os
from xml.etree import ElementTree
from xml.dom import pulldom
import xml.sax
def slurp(filename):
"""returns a file as a string"""
f = open(filename, 'r')
contents = f.readlines()
f.close()
return ''.join(contents)
def extract (data):
start = data.find('<en-n... | {
"repo_name": "rmoskal/e-springpad",
"path": "evernotebookparser.py",
"copies": "1",
"size": "3104",
"license": "mit",
"hash": -2152546689954211600,
"line_mean": 28.2924528302,
"line_max": 102,
"alpha_frac": 0.53125,
"autogenerated": false,
"ratio": 4.2754820936639115,
"config_test": false,
"... |
__author__ = 'rob'
import urllib2
import httplib
import requests
import requests.exceptions
from werkzeug.urls import url_fix
import time
class HttpHandler:
def __init__(self, libToUse):
self.use_requests = True
if libToUse == "urllib2":
self.use_requests = False
def getTextRespo... | {
"repo_name": "robdobsn/RdHomeServer",
"path": "pyFlaskServer/HttpHandler.py",
"copies": "1",
"size": "2074",
"license": "mit",
"hash": -7436185688639346000,
"line_mean": 38.1320754717,
"line_max": 116,
"alpha_frac": 0.5467695275,
"autogenerated": false,
"ratio": 4.2939958592132506,
"config_tes... |
__author__ = 'Rob'
def atom_pair_energy(atom1, atom2):
energy = 0
import math
sep = math.sqrt((atom1[0] - atom2[0]) ** 2 + (atom1[1] - atom2[1]) ** 2 + (atom1[2] - atom2[2]) ** 2)
if sep != 0: # avoid divide by zero for an atom being paired with itself
energy = (atom1[3] * atom2[3]) / sep
... | {
"repo_name": "rpt26/coulomb_energy",
"path": "coulomb_utils.py",
"copies": "1",
"size": "2557",
"license": "mit",
"hash": 5521263040176598000,
"line_mean": 44.6607142857,
"line_max": 120,
"alpha_frac": 0.6452874462,
"autogenerated": false,
"ratio": 3.536652835408022,
"config_test": false,
"h... |
__author__ = 'rob'
#!/usr/bin/env python
from soco import SoCo
import time
from threading import Thread, Event
SONOS_NONE = -1
SONOS_IDLE = 0
SONOS_PLAY_REQ = 1
SONOS_PAUSE_TRY = 2
SONOS_PAUSE_PEND = 3
SONOS_PLAY_START = 4
SONOS_PLAY_PEND = 5
SONOS_PLAYING = 6
SONOS_RESTORE_PEND = 7
class SonosStateMc:
def __in... | {
"repo_name": "robdobsn/RdHomeServer",
"path": "pyFlaskServer/SonosDevice.py",
"copies": "1",
"size": "9343",
"license": "mit",
"hash": -6894691192089948000,
"line_mean": 37.2909836066,
"line_max": 297,
"alpha_frac": 0.5801134539,
"autogenerated": false,
"ratio": 3.51108605787298,
"config_test"... |
__author__="Rob O'Dwyer"
__date__ ="$Mar 09, 2010 5:34:40 PM$"
from setuptools import setup,find_packages
setup (
name = 'Turk',
version = '0.1.1',
packages = find_packages(),
install_requires=['twisted', 'pyserial', 'PyYAML', 'wokkel'],
author = 'Rob O\'Dwyer',
author_email = 'odwyerrob@gma... | {
"repo_name": "robbles/turk",
"path": "setup.py",
"copies": "1",
"size": "1389",
"license": "mit",
"hash": -8038167709900353000,
"line_mean": 29.8666666667,
"line_max": 91,
"alpha_frac": 0.5867530598,
"autogenerated": false,
"ratio": 3.946022727272727,
"config_test": false,
"has_no_keywords":... |
__author__ = 'robswift'
__author__ = 'robswift'
import os
import sys
import textwrap
def print_short_help():
w = textwrap.TextWrapper()
w.expand_tabs = False
w.width = 120
w.initial_indent = ' '
w.subsequent_indent = '\t\t '
input = " usage: fastheuristic --input [(required) csv file]... | {
"repo_name": "rvswift/EB",
"path": "EB/builder/fastheuristic/fastheuristic_io.py",
"copies": "1",
"size": "7701",
"license": "bsd-3-clause",
"hash": 4915115170816408000,
"line_mean": 34.3256880734,
"line_max": 111,
"alpha_frac": 0.5272042592,
"autogenerated": false,
"ratio": 4.074603174603174,
... |
__author__ = 'robswift'
class EnsembleStorage:
"""
Stores an ensemble's composition and performance
"""
def __init__(self):
"""
class attributes
:return:
"""
self.ensemble = None # a tuple: ('receptor_x', ...., 'receptor_y')
self.auc = None # ... | {
"repo_name": "rvswift/EB",
"path": "EB/builder/utilities/ensemble_storage.py",
"copies": "1",
"size": "1489",
"license": "bsd-3-clause",
"hash": -2706356176772326400,
"line_mean": 29.4081632653,
"line_max": 108,
"alpha_frac": 0.5010073875,
"autogenerated": false,
"ratio": 4.392330383480826,
"c... |
__author__ = 'robswift'
class Molecule:
"""
csv molecule class
"""
def __init__(self):
"""
class attributes
"""
self.id = None
self.status = None
self.bm = None
self.graph = None
self.scores = {}
self.properties = {}
self.tags = ('id', 'sta... | {
"repo_name": "rvswift/EB",
"path": "EB/builder/utilities/molecules.py",
"copies": "1",
"size": "1491",
"license": "bsd-3-clause",
"hash": 3558927152510061600,
"line_mean": 24.2881355932,
"line_max": 54,
"alpha_frac": 0.4433266264,
"autogenerated": false,
"ratio": 4.385294117647059,
"config_tes... |
__author__ = 'robswift'
from collections import defaultdict
from EB.builder.utilities import screener
import numpy as np
from scipy import stats
def get_sort_order(molecules):
"""
Determine the sort order, i.e. ascending for binding energy estimates, or descending for similarity scores. First,
count the ... | {
"repo_name": "rvswift/EB",
"path": "EB/builder/utilities/classification.py",
"copies": "1",
"size": "18857",
"license": "bsd-3-clause",
"hash": -1949875647846376400,
"line_mean": 35.7602339181,
"line_max": 120,
"alpha_frac": 0.6021106221,
"autogenerated": false,
"ratio": 3.2652813852813853,
"c... |
__author__ = 'robswift'
import csv
import os
import re
def write_roc(roc_structure, inputfilename, options, fw_type = None):
"""
writes ROC output
:param roc_structure: a.k.a auc_structure, generated in /common_tools/classification/make_auc_structure()
:param inputfilename: name of the file specified ... | {
"repo_name": "rvswift/EB",
"path": "EB/builder/utilities/output.py",
"copies": "1",
"size": "5817",
"license": "bsd-3-clause",
"hash": -1186330028803440600,
"line_mean": 32.6300578035,
"line_max": 120,
"alpha_frac": 0.5619735259,
"autogenerated": false,
"ratio": 3.3643724696356276,
"config_tes... |
__author__ = 'robswift'
import csv
import os
import sys
def write_csv(target_list, out_dir):
"""
:param target_list:
:return:
"""
if not os.access(out_dir, os.W_OK):
print "%s is not writeable" % out_dir
sys.exit(1)
for target in target_list:
target_pdb_id = target.g... | {
"repo_name": "rvswift/BlastNFilter",
"path": "BlastNFilter/Utilities/OutPut.py",
"copies": "2",
"size": "1833",
"license": "bsd-3-clause",
"hash": -1367397172740828700,
"line_mean": 31.7321428571,
"line_max": 92,
"alpha_frac": 0.5521003819,
"autogenerated": false,
"ratio": 3.601178781925344,
"... |
__author__ = 'robswift'
import os
import gzip
import socket
from BlastNFilter.PreRelease import filtering_sets as filtering_sets
from SequenceBase import Base
from collections import defaultdict
from Bio.Alphabet import generic_protein
from Bio import SeqIO
class Test(Base):
"""
"""
if socket.gethostnam... | {
"repo_name": "rvswift/BlastNFilter",
"path": "BlastNFilter/Blast/Test.py",
"copies": "1",
"size": "5273",
"license": "bsd-3-clause",
"hash": 8569497808005606000,
"line_mean": 33.9205298013,
"line_max": 119,
"alpha_frac": 0.5763322587,
"autogenerated": false,
"ratio": 3.8404952658412235,
"confi... |
__author__ = 'robswift'
import os
import gzip
import sys
import csv
import re
from EB.builder.utilities.molecules import Molecule
def read_csv(csv_file, options, ensemble_list=None):
"""
Read csv and return molList, otherwise print error and exit.
"""
name, ext = os.path.splitext(csv_file)
try:
... | {
"repo_name": "rvswift/EB",
"path": "EB/builder/utilities/csv_interface.py",
"copies": "1",
"size": "5025",
"license": "bsd-3-clause",
"hash": -3362751855913669600,
"line_mean": 31.0127388535,
"line_max": 113,
"alpha_frac": 0.6005970149,
"autogenerated": false,
"ratio": 3.8154897494305238,
"con... |
__author__ = 'robswift'
import os
import sys
from EB.builder.utilities import classification
from EB.builder.utilities.ensemble_storage import EnsembleStorage
from EB.builder.utilities import csv_interface
from EB.builder.utilities import output
from EB.builder.utilities import screener
def run(itf):
"""
run... | {
"repo_name": "rvswift/EB",
"path": "EB/builder/fastheuristic/fastheuristic.py",
"copies": "1",
"size": "3262",
"license": "bsd-3-clause",
"hash": 8259775750129084000,
"line_mean": 32.6288659794,
"line_max": 96,
"alpha_frac": 0.6566523605,
"autogenerated": false,
"ratio": 3.7580645161290325,
"c... |
__author__ = 'robswift'
import os
import sys
import copy
import EB.builder.utilities.csv_interface as csv_interface
import EB.builder.utilities.classification as classification
import EB.builder.utilities.output as output
def run(itf):
"""
Run postanalyze functions.
"""
if not itf:
return 1
#... | {
"repo_name": "rvswift/EB",
"path": "EB/builder/postanalysis/postanalysis.py",
"copies": "1",
"size": "10848",
"license": "bsd-3-clause",
"hash": -988120066581511400,
"line_mean": 29.9088319088,
"line_max": 116,
"alpha_frac": 0.6295169617,
"autogenerated": false,
"ratio": 3.852272727272727,
"co... |
__author__ = 'robswift'
import os
import sys
import itertools
import EB.builder.utilities.csv_interface as csv_interface
import EB.builder.utilities.screener as screener
import EB.builder.utilities.classification as classification
from EB.builder.utilities.ensemble_storage import EnsembleStorage
import EB.builder.util... | {
"repo_name": "rvswift/EB",
"path": "EB/builder/exhaustive/exhaustive.py",
"copies": "1",
"size": "6833",
"license": "bsd-3-clause",
"hash": 5200555314682302000,
"line_mean": 30.9345794393,
"line_max": 119,
"alpha_frac": 0.6487633543,
"autogenerated": false,
"ratio": 3.6384451544195953,
"config... |
__author__ = 'robswift'
import os
import sys
import re
import csv
import gzip
import random
def run(itf):
"""
Run preprocess functions
"""
if not itf:
return 1
# access command-line arguments
options = SplitInput(itf)
# read input
infile = os.path.abspath(options.input)
molLi... | {
"repo_name": "rvswift/EB",
"path": "EB/builder/splitter/splitter.py",
"copies": "1",
"size": "8859",
"license": "bsd-3-clause",
"hash": -1129730619232705500,
"line_mean": 23.8876404494,
"line_max": 106,
"alpha_frac": 0.6169996614,
"autogenerated": false,
"ratio": 3.6683229813664595,
"config_te... |
__author__ = 'robswift'
import os
import sys
import textwrap
def print_short_help():
"""
Prints a short help message.
"""
# initiate TextWrapper class, which will handle all of the string formatting
w = textwrap.TextWrapper()
w.expand_tabs = False
w.width = 130
w.initial_indent = ' '
w.... | {
"repo_name": "rvswift/EB",
"path": "EB/builder/splitter/splitter_io.py",
"copies": "1",
"size": "7133",
"license": "bsd-3-clause",
"hash": -414578199224925630,
"line_mean": 32.9714285714,
"line_max": 110,
"alpha_frac": 0.5366605916,
"autogenerated": false,
"ratio": 4.018591549295775,
"config_t... |
__author__ = 'robswift'
import os
import sys
import textwrap
def print_short_help():
w = textwrap.TextWrapper()
w.expand_tabs = False
w.width = 120
w.initial_indent = ' '
w.subsequent_indent = '\t\t '
input = " usage: slowheuristic --input [(required) csv file] --outname [(required) st... | {
"repo_name": "rvswift/EB",
"path": "EB/builder/slowheuristic/slowheuristic_io.py",
"copies": "1",
"size": "7676",
"license": "bsd-3-clause",
"hash": -4000610285431972400,
"line_mean": 34.537037037,
"line_max": 111,
"alpha_frac": 0.5270974466,
"autogenerated": false,
"ratio": 4.087326943556976,
... |
__author__ = 'robswift'
import os, sys
import textwrap
def print_short_help():
"""
Prints a short help message.
"""
# initiate TextWrapper class, which will handle all of the string formatting
w = textwrap.TextWrapper()
w.expand_tabs = False
w.width = 115
w.initial_indent = ' '
w.subse... | {
"repo_name": "rvswift/EB",
"path": "EB/builder/exhaustive/exhaustive_io.py",
"copies": "1",
"size": "8049",
"license": "bsd-3-clause",
"hash": 7830232807723156000,
"line_mean": 34.4625550661,
"line_max": 111,
"alpha_frac": 0.5336066592,
"autogenerated": false,
"ratio": 4.018472291562656,
"conf... |
__author__ = 'robswift'
import screener
def get_sort_order(molecules):
"""
Count up the total number of scores whose values are positve and negative.
If a greater number are negative, then sort in ascending order (e.g. for binding energy estimates)
Otherwise, sort in descending order (e.g. for similarity value... | {
"repo_name": "rvswift/EB",
"path": "EB/builder/utilities/performance.py",
"copies": "1",
"size": "5603",
"license": "bsd-3-clause",
"hash": 3932750934170737000,
"line_mean": 33.1646341463,
"line_max": 120,
"alpha_frac": 0.5693378547,
"autogenerated": false,
"ratio": 3.4866210329807092,
"config... |
__author__ = 'robswift'
import sys
from collections import defaultdict
from filtering_sets import do_not_call
from BlastNFilter.Blast.Target import Target
def add_ligands(non_polymer):
"""
Remove undesirable residues from the non_polymer_file, and return a list of target objects.
:param non_polymer: absol... | {
"repo_name": "rvswift/BlastNFilter",
"path": "BlastNFilter/PreRelease/ParsePreRelease.py",
"copies": "2",
"size": "2942",
"license": "bsd-3-clause",
"hash": 1950242026717844700,
"line_mean": 35.3209876543,
"line_max": 117,
"alpha_frac": 0.5598232495,
"autogenerated": false,
"ratio": 3.7006289308... |
__author__ = 'robswift'
import sys
app_names = ["exhaustive", "fastheuristic", "slowheuristic", "postanalysis", "splitter"]
apps = {
"exhaustive" : ["exhaustive.exhaustive_io", "exhaustive.exhaustive",
"\t Determine the best performer by considering all possible ensembles, O(2^N)."],
"fast... | {
"repo_name": "rvswift/EB",
"path": "EB/builder/eb_main.py",
"copies": "1",
"size": "2130",
"license": "bsd-3-clause",
"hash": -1979944900794538200,
"line_mean": 29.4285714286,
"line_max": 100,
"alpha_frac": 0.6046948357,
"autogenerated": false,
"ratio": 3.520661157024793,
"config_test": false,... |
__author__ = 'robswift'
def find_best_ensemble(results, options):
"""
Return the best performing ensemble. If the user hasn't specified a FPF, the default behavior sorts ensembles by
largest enrichment factor at the smallest FPF (1 / n, where n is the total number of decoys). If the user supplied
a FP... | {
"repo_name": "rvswift/EB",
"path": "EB/builder/utilities/screener.py",
"copies": "1",
"size": "6585",
"license": "bsd-3-clause",
"hash": -8606409317986369000,
"line_mean": 43.5,
"line_max": 119,
"alpha_frac": 0.6332574032,
"autogenerated": false,
"ratio": 3.664440734557596,
"config_test": fals... |
__author__ = 'robswift'
import os, sys
import textwrap
def print_short_help():
"""
print a short help message
:return:
"""
w = textwrap.TextWrapper()
w.expand_tabs = False
w.width = 125
w.initial_indent = ' '
w.subsequent_indent = '\t\t '
input = "usage: postanalysis --i... | {
"repo_name": "rvswift/EB",
"path": "EB/builder/postanalysis/postanalysis_io.py",
"copies": "1",
"size": "7503",
"license": "bsd-3-clause",
"hash": -162170661628118600,
"line_mean": 33.1090909091,
"line_max": 102,
"alpha_frac": 0.5367186459,
"autogenerated": false,
"ratio": 3.9468700683850604,
... |
__author__ = 'robswift'
__project__ = 'blastnfilter'
import sys
import os
import textwrap
def print_usage():
w = textwrap.TextWrapper()
w.expand_tabs = False
try:
rows, columns = os.popen('stty size', 'r').read().split()
w.width = int(columns)
except ValueError:
pass
w.init... | {
"repo_name": "rvswift/BlastNFilter",
"path": "BlastNFilter/Utilities/IOParser.py",
"copies": "2",
"size": "2279",
"license": "bsd-3-clause",
"hash": 5383612174908292000,
"line_mean": 29.3866666667,
"line_max": 88,
"alpha_frac": 0.5454146556,
"autogenerated": false,
"ratio": 3.8302521008403363,
... |
import db_tools
import numpy as np
import matplotlib
import matplotlib.pyplot as plt
from sklearn import datasets
from sklearn.cross_validation import train_test_split
from sklearn.linear_model import SGDClassifier, Perceptron
from sklearn.linear_model import PassiveAggressiveClassifier
from sklearn.linear_model imp... | {
"repo_name": "mmcnally/StackOverflow-NLP",
"path": "code/src/perceptron.py",
"copies": "1",
"size": "3521",
"license": "mit",
"hash": 4508229483792700000,
"line_mean": 27.168,
"line_max": 207,
"alpha_frac": 0.5731326328,
"autogenerated": false,
"ratio": 3.366156787762906,
"config_test": true,
... |
__author__ = 'rochelle'
#import arcpy
import gdal, osr
import numpy as np
import rasterio
from rasterio.warp import reproject, RESAMPLING
import os
import urllib2
import rasterUtils
def calcTCI(cur_filename, lta_max_filename, lta_min_filename, dst_filename):
# calculate Temperature Condition Index
# TCI = 100... | {
"repo_name": "spatialexplore/idn_vam_wfp",
"path": "python/remotesensing/vegetationAnalysis.py",
"copies": "1",
"size": "7727",
"license": "mit",
"hash": 5659191472711274000,
"line_mean": 45.8363636364,
"line_max": 125,
"alpha_frac": 0.5544195677,
"autogenerated": false,
"ratio": 3.0421259842519... |
__author__ = 'rochelle'
#!/usr/bin/env python
# Import system modules
import os
import subprocess
#from subprocess import call, check_call, check_output, Popen, CalledProcessError, STDOUT
import utilities
def clipRasterToShp(shpfile, in_raster, out_raster, gdal_path, nodata=False,
srcnodata=None, ... | {
"repo_name": "spatialexplore/idn_vam_wfp",
"path": "python/remotesensing/rasterUtils.py",
"copies": "1",
"size": "8757",
"license": "mit",
"hash": 7959175822455513000,
"line_mean": 39.1697247706,
"line_max": 198,
"alpha_frac": 0.587529976,
"autogenerated": false,
"ratio": 3.64875,
"config_test... |
__author__ = 'rochelle'
#!/usr/bin/env python
import csv
import arcpy
import logging
import os
logger = logging.getLogger('LoadPremiseData')
logging.basicConfig(format='%(asctime)s - %(name)s - %(levelname)s - %(message)s', level=logging.DEBUG)
arcpy.env.workspace = r"Database Connections\vampire_vampire_gdb_localho... | {
"repo_name": "spatialexplore/idn_vam_wfp",
"path": "python/market_prices/LoadPremiseData.py",
"copies": "1",
"size": "7212",
"license": "mit",
"hash": -5331628519520161000,
"line_mean": 40.9302325581,
"line_max": 167,
"alpha_frac": 0.5887409872,
"autogenerated": false,
"ratio": 3.444126074498567... |
__author__ = 'rochelle'
#!/usr/bin/env python
import csv
import arcpy
import logging
logger = logging.getLogger('LoadSurveyData')
logging.basicConfig(format='%(asctime)s - %(name)s - %(levelname)s - %(message)s', level=logging.DEBUG)
arcpy.env.workspace = r"Database Connections\vampire_vampire_gdb_localhost.sde"
de... | {
"repo_name": "spatialexplore/idn_vam_wfp",
"path": "python/household_survey/LoadSurveyData.py",
"copies": "1",
"size": "4763",
"license": "mit",
"hash": -5448333428333389000,
"line_mean": 43.5140186916,
"line_max": 132,
"alpha_frac": 0.58282595,
"autogenerated": false,
"ratio": 3.469045884923525... |
__author__ = 'rochelle'
#!/usr/bin/env python
import datetime
import errno
import glob
import os
import re
from collections import defaultdict
from subprocess import check_call, CalledProcessError
#import arcpy
import rasterio
import numpy as np
import urllib2
from osgeo import gdal
from pymodis import downmodis
impo... | {
"repo_name": "spatialexplore/idn_vam_wfp",
"path": "python/remotesensing/modisUtils.py",
"copies": "1",
"size": "26942",
"license": "mit",
"hash": 1423326260474791400,
"line_mean": 43.4603960396,
"line_max": 341,
"alpha_frac": 0.5933857917,
"autogenerated": false,
"ratio": 3.2566179136951527,
... |
__author__ = 'rochelle'
#!/usr/bin/env python
import datetime, time, calendar
import optparse, sys, os, traceback, errno
_defaults = {
'gdal_dir' : '/usr/bin',
'mrt_dir' : '/usr/bin/mrt/bin',
'temp_dir' : '/tmp',
'base_data_dir' : '/srv/Vampire/data/Download',
'base_product_dir' : '/var/lib/openge... | {
"repo_name": "spatialexplore/idn_vam_wfp",
"path": "python/vampire/configGenerator_plj.py",
"copies": "1",
"size": "23810",
"license": "mit",
"hash": 8557408013004774000,
"line_mean": 45.0541586074,
"line_max": 159,
"alpha_frac": 0.5799244015,
"autogenerated": false,
"ratio": 3.370134465675867,
... |
__author__ = 'rochelle'
#!/usr/bin/env python
import re
import functools
import datetime
import dateutil
import calendar
def getFileList():
fileslist = []
return fileslist
def _getMonthFromDayOfYear(doy, year):
date = datetime.datetime(year, 1, 1) + datetime.timedelta(doy)
month = '%s'%date.strftime... | {
"repo_name": "spatialexplore/idn_vam_wfp",
"path": "python/utilities/filenameUtils.py",
"copies": "1",
"size": "2351",
"license": "mit",
"hash": -169861299966177760,
"line_mean": 38.8644067797,
"line_max": 146,
"alpha_frac": 0.6014461931,
"autogenerated": false,
"ratio": 3.073202614379085,
"co... |
__author__ = 'Rockie Yang'
# -*- coding: utf-8 -*-
import hiragana
def level_name(level):
return level['name']
def level_words(level):
return level['words']
def placeholder(word):
return 'placeholder' in word and word['placeholder']
def kana(word):
return word['kana']
def romaji(word):
ret... | {
"repo_name": "rockiey/japanese-learning",
"path": "dictionary.py",
"copies": "2",
"size": "1153",
"license": "mit",
"hash": -394382007499781800,
"line_mean": 18.8793103448,
"line_max": 77,
"alpha_frac": 0.6131830009,
"autogenerated": false,
"ratio": 3.580745341614907,
"config_test": false,
"... |
__author__ = 'Rockie Yang'
import os
import codecs
class Progress():
def __init__(self, words, progress_file = "progress.data"):
self.progress_file = progress_file
# self.practise_dict = practise_dict
self.progress_data = {}
self.words = words
def init_progress(self):
... | {
"repo_name": "rockiey/japanese-learning",
"path": "progress.py",
"copies": "2",
"size": "1621",
"license": "mit",
"hash": 3434737850962369000,
"line_mean": 30.1730769231,
"line_max": 101,
"alpha_frac": 0.5669339914,
"autogenerated": false,
"ratio": 3.675736961451247,
"config_test": false,
"h... |
__author__ = 'Rockie Yang'
references = ['http://www.guidetojapanese.org/learn/grammar/hiragana',
'http://www.guidetojapanese.org/audio/basic_sounds.zip',
'http://www.tokyowithkids.com/fyi/japanese/kana_sounds/cha.wav',
'https://en.wikipedia.org/wiki/Hiragana']
def display(t... | {
"repo_name": "rockie-yang/japanese-learning",
"path": "hiragana.py",
"copies": "2",
"size": "7694",
"license": "mit",
"hash": 6751594099219402000,
"line_mean": 44.3125,
"line_max": 81,
"alpha_frac": 0.3553103448,
"autogenerated": false,
"ratio": 2.68319763138416,
"config_test": false,
"has_n... |
__author__ = 'Rockie Yang'
references = ['http://www.guidetojapanese.org/learn/grammar/hiragana',
'http://www.guidetojapanese.org/audio/basic_sounds.zip']
def display(t):
if len(t) > 3 and t[3] == 'placeholder':
pass
else:
print(t)
monographs = \
[{'name': 'ア行',
'wor... | {
"repo_name": "rockiey/japanese-learning",
"path": "katakana.py",
"copies": "2",
"size": "7611",
"license": "mit",
"hash": 1218435644189165300,
"line_mean": 42.303030303,
"line_max": 81,
"alpha_frac": 0.344156753,
"autogenerated": false,
"ratio": 2.641404805914972,
"config_test": false,
"has_... |
__author__ = 'Roderick Lagunas'
import inspect
import exception
class Core:
class Color:
sys = '\033[0;00m'
darkgray = '\033[0;30m'
red = '\033[0;31m'
green = '\033[0;32m'
brown = '\033[0;33m'
blue = '\033[0;34m'
purple = '\033[0;35m'
cyan = '\033[0... | {
"repo_name": "rdcklinux/cocos2dx-console",
"path": "common/command.py",
"copies": "2",
"size": "2418",
"license": "mit",
"hash": -7108049360752791000,
"line_mean": 32.5833333333,
"line_max": 107,
"alpha_frac": 0.4863523573,
"autogenerated": false,
"ratio": 3.76049766718507,
"config_test": fals... |
__author__ = 'Roderick Lagunas'
from interface.command import CommandInterface
from common import command
class Create(CommandInterface):
name = None
odir = '.'
def __init__(self):
pass
def main(self, args):
try:
self.name = args['name']
except KeyError:
... | {
"repo_name": "rdcklinux/cocos2dx-console",
"path": "module/scene.py",
"copies": "1",
"size": "1887",
"license": "mit",
"hash": -4060379150930270700,
"line_mean": 23.8289473684,
"line_max": 94,
"alpha_frac": 0.5235824059,
"autogenerated": false,
"ratio": 3.8588957055214723,
"config_test": false... |
__author__ = 'rodney'
from .util import radec2xy
from astropy.io import fits as pyfits
import numpy as np
from PythonPhot.photfunctions import rdpsfmodel
from PythonPhot.photfunctions import addtoimarray
def addtofits(fitsin, fitsout, psfmodelfile, position, fluxscale,
coordsys='xy', verbose=False):
... | {
"repo_name": "srodney/hstphot",
"path": "hstphot/hstfakestar.py",
"copies": "1",
"size": "1379",
"license": "bsd-3-clause",
"hash": 2180197917507753700,
"line_mean": 31.8333333333,
"line_max": 85,
"alpha_frac": 0.677302393,
"autogenerated": false,
"ratio": 3.508905852417303,
"config_test": fal... |
import xbmc, xbmcaddon, xbmcgui
import socket
settings = xbmcaddon.Addon(id='script.service.theater-light')
udpPort = int(settings.getSetting("udpPort"))
class MyPlayer(xbmc.Player) :
def __init__ (self):
xbmc.Player.__init__(self)
self.broadcastUDP("<b>theater-lighs<li>config</b>{0... | {
"repo_name": "elrodro83/theater-lights",
"path": "kodi/script.service.theater-light/theater-lights-cli.py",
"copies": "1",
"size": "2092",
"license": "apache-2.0",
"hash": -372926872841469630,
"line_mean": 35.3571428571,
"line_max": 427,
"alpha_frac": 0.6257170172,
"autogenerated": false,
"ratio... |
__author__ = 'Rogelio Negrete - Weffe'
import pickle
import random
import time
from datetime import datetime
class PickleList:
def __init__(self, nameoffile):
self.nameoffile = nameoffile
self.pickle_list = self.load_pickle_list()
def load_pickle_list(self):
with open(self.nameoffile,... | {
"repo_name": "Weffe/NigelThornberry-Bot",
"path": "PickleList.py",
"copies": "1",
"size": "2696",
"license": "mit",
"hash": 725602132936203400,
"line_mean": 30.7176470588,
"line_max": 100,
"alpha_frac": 0.5704747774,
"autogenerated": false,
"ratio": 3.824113475177305,
"config_test": false,
"... |
__author__ = 'rogerjiang'
'''
Purpose:
1. Data augmentation, including:
1.1 random translation in horizontal and vertical directions
1.2 horizontal and vertical flipping
1.3 random rotation
'''
'''
Class blancing:
Each class is trained using a different model, weights should be applied
to the tr... | {
"repo_name": "jiangxu87/dstl_unet",
"path": "utils/train_utils.py",
"copies": "1",
"size": "7467",
"license": "mit",
"hash": 4672483474165745000,
"line_mean": 32.7873303167,
"line_max": 86,
"alpha_frac": 0.5402437391,
"autogenerated": false,
"ratio": 3.4730232558139535,
"config_test": true,
... |
__author__ = 'rogerjiang'
'''
Purposes:
1. Visualization of training data
2. Evaluation of training data augmentation
'''
'''
Notes on the data files:
train_wkt_v4.csv: training labels with ImageId, ClassType, MultipolygonWKT
train_geoson_v3 (similar to train_wkt_v4.csv): training labels with ImageId
(folder name)... | {
"repo_name": "jiangxu87/dstl_unet",
"path": "utils/data_utils.py",
"copies": "1",
"size": "29041",
"license": "mit",
"hash": 8906586301838513000,
"line_mean": 29.83014862,
"line_max": 83,
"alpha_frac": 0.5682999897,
"autogenerated": false,
"ratio": 3.3307718775088886,
"config_test": false,
"... |
__author__ = 'rogerjiang'
'''
This file merges the prediction files for all 10 classes and output a submission
file
'''
import pandas as pd
import os
from shapely import wkt
import sys
data_dir = os.path.join('.', 'submission')
if __name__ == '__main__':
files = []
for cl in range(10):
files.appen... | {
"repo_name": "jiangxu87/dstl_unet",
"path": "merge_submission.py",
"copies": "1",
"size": "1385",
"license": "mit",
"hash": -2187232154268714200,
"line_mean": 26.1568627451,
"line_max": 80,
"alpha_frac": 0.5068592058,
"autogenerated": false,
"ratio": 3.369829683698297,
"config_test": false,
... |
__author__ = 'rogerjiang'
'''
This file performs the training of a U-net convolutional neural network
for pixel-wise classification (or segmentation) of satellite images.
The model performs binary classification for each class. The model parameters
is loaded from ./hypes/hypes.json and you can change "class_type" pa... | {
"repo_name": "jiangxu87/dstl_unet",
"path": "train.py",
"copies": "1",
"size": "18759",
"license": "mit",
"hash": -1633843588229983200,
"line_mean": 40.7817371938,
"line_max": 98,
"alpha_frac": 0.5614904846,
"autogenerated": false,
"ratio": 3.4861549897788513,
"config_test": false,
"has_no_k... |
__author__ = 'rogueleaderr'
import random
import time
def merge_sort(input_list):
if len(input_list) < 2: # it's a leaf
return input_list
else:
# split
split_point = len(input_list) // 2
left_portion, right_portion = input_list[:split_point], input_list[split_point:]
... | {
"repo_name": "rogueleaderr/import_madness",
"path": "screenshots.py",
"copies": "1",
"size": "4840",
"license": "mit",
"hash": 8990502519113950000,
"line_mean": 23.693877551,
"line_max": 107,
"alpha_frac": 0.6200413223,
"autogenerated": false,
"ratio": 3.4670487106017194,
"config_test": false,... |
__author__ = 'Rohan Kanade'
__version__ = '1.0'
__maintainer__ = 'Rohan Kanade'
__email__ = 'github@rohankanade.com'
# Check for unicode support
try:
unicode = unicode
except NameError:
unicode = str
basestring = (str, bytes)
class StateMachineError(Exception):
pass
class StateMachine(object):
... | {
"repo_name": "r0h4n/python-state-machine",
"path": "python_state_machine/StateMachine.py",
"copies": "1",
"size": "4499",
"license": "mit",
"hash": 8105089406172504000,
"line_mean": 31.3669064748,
"line_max": 84,
"alpha_frac": 0.5325627917,
"autogenerated": false,
"ratio": 4.0862851952770205,
... |
__author__ = 'Rohan Khale'
try:
import sys
import os
import logging.config
except ImportError as error:
print (error)
sys.exit(-1)
if os.path.exists(os.path.basename(__file__)+ ".log") and os.path.isfile(os.path.basename(__file__)+ ".log"):
os.unlink(os.path.basename(__file_... | {
"repo_name": "rkhale/python",
"path": "generic questions/prime_generator.py",
"copies": "1",
"size": "1397",
"license": "unlicense",
"hash": -7087079189344969000,
"line_mean": 29.7954545455,
"line_max": 189,
"alpha_frac": 0.5053686471,
"autogenerated": false,
"ratio": 3.796195652173913,
"confi... |
__author__ = 'Rohan'
from Tkinter import *
from tkFileDialog import *
import numpy as np
import matplotlib.pyplot as plt
from scipy import stats
import vgprice
def getelements(vglist, type):
tmplist = []
for i in vglist:
tmplist.append(getattr(i, type))
return tmplist
def createstructarray(lo... | {
"repo_name": "rohanfray/IS602-Final",
"path": "IS602 Final.py",
"copies": "1",
"size": "11225",
"license": "mit",
"hash": -5807645350272842000,
"line_mean": 40.1208791209,
"line_max": 213,
"alpha_frac": 0.6212026726,
"autogenerated": false,
"ratio": 3.0602508178844054,
"config_test": false,
... |
__author__ = 'Rohan'
import unirest
import json
from datetime import datetime
class vgpriceObj(object):
METACRITICPLATFORMDICTIONARY = {"Playstation": 10, "Playstation 3": 1, "GameBoy Advance": 11, "Gamecube": 13,
"Nintendo 3DS": 16, "Nintendo 64": 14, "Nintendo DS": 4, "Plays... | {
"repo_name": "rohanfray/IS602-Final",
"path": "vgprice.py",
"copies": "1",
"size": "2568",
"license": "mit",
"hash": -4443382401401348600,
"line_mean": 32.3506493506,
"line_max": 120,
"alpha_frac": 0.4813084112,
"autogenerated": false,
"ratio": 4.006240249609984,
"config_test": false,
"has_n... |
__author__ = 'rohe0002'
import cgi
from urllib import quote
class Response(object):
_template = None
_status = '200 OK'
_content_type = 'text/html'
_mako_template = None
_mako_lookup = None
def __init__(self, message=None, **kwargs):
self.status = kwargs.get('status', self._status)
... | {
"repo_name": "natebeacham/saml2",
"path": "src/saml2/httputil.py",
"copies": "2",
"size": "4352",
"license": "bsd-2-clause",
"hash": 1417343354706569700,
"line_mean": 33,
"line_max": 77,
"alpha_frac": 0.6121323529,
"autogenerated": false,
"ratio": 3.7260273972602738,
"config_test": false,
"h... |
__author__ = 'rohe0002'
import json
import logging
from urlparse import urlparse
from bs4 import BeautifulSoup
from mechanize import ParseResponseEx
from mechanize._form import ControlNotFoundError, AmbiguityError
from mechanize._form import ListControl
logger = logging.getLogger(__name__)
def pick_interaction(int... | {
"repo_name": "rohe/saml2test",
"path": "src/idp_test/interaction.py",
"copies": "1",
"size": "11489",
"license": "bsd-2-clause",
"hash": 5168999385002811000,
"line_mean": 28.7642487047,
"line_max": 79,
"alpha_frac": 0.5104012534,
"autogenerated": false,
"ratio": 4.493156042236996,
"config_test... |
__author__ = 'rohe0002'
import os
import json
from jwkest.jwe import JWE
import logging
logger = logging.getLogger(__name__)
class Info(object):
def __init__(self):
self.ava = {}
def update(self):
return
def get_consumer_key_and_secret(self, social_service, entity_id):
# Consu... | {
"repo_name": "NORDUnet/IdPproxy",
"path": "src/idpproxy/utils.py",
"copies": "2",
"size": "4247",
"license": "bsd-2-clause",
"hash": -7722250196972024000,
"line_mean": 30,
"line_max": 80,
"alpha_frac": 0.5045914763,
"autogenerated": false,
"ratio": 4.28125,
"config_test": false,
"has_no_keyw... |
__author__ = 'Rohin Kumar Y'
from scipy import integrate
import numpy as np
import math as m
from metrics import *
#from . import *
from param import *
# from correlcalc import *
from multiprocessing import Pool
from multiprocessing import cpu_count
# from __future__ import division
# Om = param.Om
# Ol = param.Ol
pcp... | {
"repo_name": "rohinkumar/correlcalc",
"path": "correlcalc/comovdist.py",
"copies": "1",
"size": "1937",
"license": "mit",
"hash": 7346306885638630000,
"line_mean": 22.9135802469,
"line_max": 97,
"alpha_frac": 0.608673206,
"autogenerated": false,
"ratio": 3.1041666666666665,
"config_test": fals... |
__author__ = 'Rohin Kumar Y'
from scipy.stats import gaussian_kde
import numpy as np
from fileios import *
# Need to parallelize these... Very slow indeed! :(
def kde(x, x_grid, bandwidth=0.2):
"""Kernel Density Estimation with Scipy"""
kdev = gaussian_kde(x, bw_method=bandwidth / x.std(ddof=1))
return k... | {
"repo_name": "rohinkumar/correlcalc",
"path": "correlcalc/genrand.py",
"copies": "1",
"size": "1438",
"license": "mit",
"hash": 2016216921884100900,
"line_mean": 32.4418604651,
"line_max": 131,
"alpha_frac": 0.6766342142,
"autogenerated": false,
"ratio": 2.995833333333333,
"config_test": false... |
__author__ = 'Rohin Kumar Y'
import numpy as np
from fileios import *
from genrand import *
from comovdist import *
from math import pi
# calculate comoving distances and convert to 3xN np array
# comov(z,**kwargs)
# **kwargs 'lcdm', 'lc' model
def datprep(fname, ftype, model):
"""Method to convert input ascii fi... | {
"repo_name": "rohinkumar/correlcalc",
"path": "correlcalc/datprep.py",
"copies": "1",
"size": "5577",
"license": "mit",
"hash": 4456737435905887700,
"line_mean": 34.0754716981,
"line_max": 154,
"alpha_frac": 0.5832885064,
"autogenerated": false,
"ratio": 3.3176680547293276,
"config_test": fals... |
__author__ = 'Rohin Kumar Y'
import os
import astropy.io.ascii as ascii
import astropy.io.fits as fits
from astropy.table import Table
import pymangle
def readinfile(filename, ftype):
"""Method to run basic checks on input data/random files and return contents"""
if os.path.isfile(filename):
dat = asc... | {
"repo_name": "rohinkumar/correlcalc",
"path": "correlcalc/fileios.py",
"copies": "1",
"size": "3517",
"license": "mit",
"hash": 1741433935324297500,
"line_mean": 34.17,
"line_max": 121,
"alpha_frac": 0.5462041513,
"autogenerated": false,
"ratio": 4.147405660377358,
"config_test": false,
"has... |
__author__ = 'Rohin Kumar Y'
# Calculate anisotropic 2pCF
from tpcf import *
import scipy as sp
# antpcf(dat,datR,bins,parmetric,permetric) returns numpy 2d array DD, RR, DR correl
# poserr(xi,DD) returns (1.0+xi)/np.sqrt(DD)
def atpcf(datfile, binspar, binsper, **kwargs):
"""Main function to calculate anisotro... | {
"repo_name": "rohinkumar/correlcalc",
"path": "correlcalc/antpcf.py",
"copies": "1",
"size": "33232",
"license": "mit",
"hash": -6253870132023385000,
"line_mean": 40.8012578616,
"line_max": 401,
"alpha_frac": 0.6021003852,
"autogenerated": false,
"ratio": 3.2,
"config_test": false,
"has_no_k... |
import time
import prettytable
import util
import padho
import dikhao.database.redis_handler
import dikhao.sync
FORMAT_EC2 = {
"zone": "Zone",
"instance_type": "Instance type",
"ec2_private_dns": "Private DNS",
"region": "Region",
"instance_id": "Instance ID",
"ec2_dns": "EC2 DNS",
"state... | {
"repo_name": "rohit01/dikhao",
"path": "dikhao/search.py",
"copies": "1",
"size": "7954",
"license": "mit",
"hash": -8646390168098244000,
"line_mean": 37.6116504854,
"line_max": 80,
"alpha_frac": 0.5359567513,
"autogenerated": false,
"ratio": 3.835101253616201,
"config_test": false,
"has_no_... |
__author__ = 'rohit'
import requests
from xml.dom.minidom import getDOMImplementation
from xml.dom.minidom import parseString
class SmartPlug(object):
"""
Simple class to access a "EDIMAX Smart Plug Switch SP-1101W"
Usage example when used as library:
p = SmartPlug("172.16.100.75", ('admin', '1234'... | {
"repo_name": "rkabadi/pyedimax",
"path": "pyedimax/smartplug.py",
"copies": "1",
"size": "6658",
"license": "mit",
"hash": 8906722951498759000,
"line_mean": 27.0928270042,
"line_max": 115,
"alpha_frac": 0.5641333734,
"autogenerated": false,
"ratio": 4.16125,
"config_test": false,
"has_no_key... |
__author__ = 'rohit'
"""
Objects to represent an positions within an account
"""
class PositionItem(object):
'''
Representation of a single position.
Contains indicative information.
There are fields which may be applicable to certain instrumentType only
e.g. expirationDate is only applicable to... | {
"repo_name": "femtotrader/pytrademonster",
"path": "pytrademonster/objects/positionObjects.py",
"copies": "3",
"size": "1762",
"license": "mit",
"hash": -3882655395820640000,
"line_mean": 28.8644067797,
"line_max": 75,
"alpha_frac": 0.6242905789,
"autogenerated": false,
"ratio": 4.19523809523809... |
# * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * #
# Created using Sam Hocevar's <sam@hocevar.net> Leafify Script as a refrence. #
# Original script contributed by FergusL and Aiena #
# contactable at #blenderpython @ irc.freenode.net #... | {
"repo_name": "Rojuinex/leafify",
"path": "leafify.py",
"copies": "1",
"size": "4283",
"license": "bsd-2-clause",
"hash": 7394314615744894000,
"line_mean": 28.1428571429,
"line_max": 90,
"alpha_frac": 0.5984123278,
"autogenerated": false,
"ratio": 2.8591455273698263,
"config_test": false,
"ha... |
__author__ = 'rolandh'
EDUPERSON_OID = "urn:oid:1.3.6.1.4.1.5923.1.1.1."
X500ATTR_OID = "urn:oid:2.5.4."
NOREDUPERSON_OID = "urn:oid:1.3.6.1.4.1.2428.90.1."
NETSCAPE_LDAP = "urn:oid:2.16.840.1.113730.3.1."
UCL_DIR_PILOT = 'urn:oid:0.9.2342.19200300.100.1.'
PKCS_9 = "urn:oid:1.2.840.113549.1.9.1."
UMICH = "urn:oid:1.3.... | {
"repo_name": "biancini/met",
"path": "saml2/attribute-maps/saml_uri.py",
"copies": "3",
"size": "9075",
"license": "bsd-2-clause",
"hash": 330883571406101000,
"line_mean": 45.0659898477,
"line_max": 68,
"alpha_frac": 0.581707989,
"autogenerated": false,
"ratio": 2.945472249269718,
"config_test... |
__author__ = 'rolandh'
from saml2 import md
from saml2.mdie import from_dict
from saml2 import saml
from saml2.extension import mdui
from saml2.extension import idpdisc
from saml2.extension import dri
from saml2.extension import mdattr
from saml2.extension import ui
import xmldsig
import xmlenc
ONTS = {
saml.NA... | {
"repo_name": "natebeacham/saml2",
"path": "tests/test_22_mdie.py",
"copies": "1",
"size": "1275",
"license": "bsd-2-clause",
"hash": 1923164115449225500,
"line_mean": 26.1276595745,
"line_max": 74,
"alpha_frac": 0.6352941176,
"autogenerated": false,
"ratio": 3.050239234449761,
"config_test": f... |
__author__ = 'rolandh'
from saml2 import soap
from saml2 import samlp
from saml2 import config
from saml2 import ecp
from saml2.profile import ecp as ecp_prof
from saml2.profile import paos
from saml2.client import Saml2Client
def _eq(l1, l2):
if len(l1) == len(l2):
return set(l1) == set(l2)
else:
... | {
"repo_name": "BetterWorks/pysaml2",
"path": "tests/test_63_ecp.py",
"copies": "1",
"size": "2750",
"license": "bsd-2-clause",
"hash": 5848653697441474000,
"line_mean": 39.4411764706,
"line_max": 84,
"alpha_frac": 0.4894545455,
"autogenerated": false,
"ratio": 3.8088642659279777,
"config_test":... |
__author__ = 'rolandh'
NAME = ["givenName", "displayName", "sn", "cn"]
STATIC_ORG_INFO = ["c", "o", "co", "norEduOrgAcronym", "schacHomeOrganization",
'schacHomeOrganizationType']
OTHER = ["eduPersonPrincipalName", "eduPersonScopedAffiliation", "mail",
"eduPersonAssurance"]
R_AND_S = ['edu... | {
"repo_name": "cloudera/hue",
"path": "desktop/core/ext-py/pysaml2-4.9.0/src/saml2/entity_category/swamid.py",
"copies": "2",
"size": "1326",
"license": "apache-2.0",
"hash": -2445069537792322600,
"line_mean": 36.9142857143,
"line_max": 80,
"alpha_frac": 0.6606334842,
"autogenerated": false,
"rat... |
__author__ = 'roland'
class HandlerResponse(object):
def __init__(self, content_processed, outside_html_action=None,
tester_error_description=None,
cookie_jar=None, urllib_request=None, urllib_response=None):
"""
:param content_processed: bool set to True if a sc... | {
"repo_name": "rohe/otest",
"path": "src/otest/contenthandler/__init__.py",
"copies": "1",
"size": "2324",
"license": "apache-2.0",
"hash": 8852372094450842000,
"line_mean": 41.2545454545,
"line_max": 79,
"alpha_frac": 0.6604991394,
"autogenerated": false,
"ratio": 4.521400778210117,
"config_te... |
__author__ = 'roland'
def find_paths(cls, arg, path=None, seen=None, res=None, lev=0):
if lev == 0 and res is None:
res = []
if path is None:
path = []
if seen is None:
seen = [cls]
else:
if cls in seen:
return None
seen.append(cls)
for cn, c... | {
"repo_name": "cloudera/hue",
"path": "desktop/core/ext-py/pysaml2-4.9.0/src/saml2/argtree.py",
"copies": "2",
"size": "2916",
"license": "apache-2.0",
"hash": -2577170783407991300,
"line_mean": 22.9016393443,
"line_max": 79,
"alpha_frac": 0.5216049383,
"autogenerated": false,
"ratio": 3.64956195... |
__author__ = 'Rolf Jagerman'
from aidu_user_management.srv import *
from gui_thread import invoke_in_gui_thread
class AuthenticationClient:
listeners = []
def __init__(self):
pass
@staticmethod
def login_handler(authentication):
invoke_in_gui_thread(AuthenticationClient.process_aut... | {
"repo_name": "MartienLagerweij/aidu",
"path": "aidu_gui/src/aidu_gui/authentication.py",
"copies": "2",
"size": "1623",
"license": "mit",
"hash": 728919870935196000,
"line_mean": 24.375,
"line_max": 89,
"alpha_frac": 0.6611213802,
"autogenerated": false,
"ratio": 4.844776119402985,
"config_tes... |
__author__ = 'Rolf Jagerman'
from PySide import QtGui, QtCore
from add_delivery import AddDelivery
from retrieve_delivery import RetrieveDelivery
from scan_card import ScanCard
from welcome import Welcome
from header import Header
from error import Error
from open_drawer import OpenDrawer
from authentication import Au... | {
"repo_name": "rjagerman/aidu",
"path": "aidu_gui/src/aidu_gui/window.py",
"copies": "2",
"size": "3242",
"license": "mit",
"hash": -1200935539293344800,
"line_mean": 33.1263157895,
"line_max": 119,
"alpha_frac": 0.6326341764,
"autogenerated": false,
"ratio": 4.4594222833562585,
"config_test": ... |
__author__ = 'Rolf Jagerman'
import os
from PySide import QtGui
from loadui import loadUi
from config import UI_DIRECTORY
from authentication import AuthenticationClient, AuthenticationListener
from drawers import Drawers
class Welcome(QtGui.QFrame, AuthenticationListener):
"""
The add delivery form that ena... | {
"repo_name": "rjagerman/aidu",
"path": "aidu_gui/src/aidu_gui/welcome.py",
"copies": "2",
"size": "1826",
"license": "mit",
"hash": 6958554095201223000,
"line_mean": 38.6956521739,
"line_max": 101,
"alpha_frac": 0.6763417306,
"autogenerated": false,
"ratio": 4.022026431718062,
"config_test": f... |
__author__ = 'Rolf Jagerman'
import roslib; roslib.load_manifest('aidu_gui')
from PySide import QtGui, QtCore
from PySide.QtGui import QApplication
from time import sleep
from window import Window
from ros_thread import ROSThread
class Manager:
"""
The manager for the application GUI. This internally handles... | {
"repo_name": "rjagerman/aidu",
"path": "aidu_gui/src/aidu_gui/manager.py",
"copies": "2",
"size": "1734",
"license": "mit",
"hash": -4583290971874678300,
"line_mean": 28.3898305085,
"line_max": 117,
"alpha_frac": 0.6389850058,
"autogenerated": false,
"ratio": 4.389873417721519,
"config_test": ... |
__author__ = 'rolf'
from pymongo import MongoClient
import cv2
import numpy as np
import sys
db = MongoClient()
buttons = db['aidu']['elevator_buttons']
untested = db['aidu']['elevator_buttons_untested']
def get_label(key):
if key == ord('b'):
return 'B'
elif key == ord('k'):
return 'K'
e... | {
"repo_name": "MartienLagerweij/aidu",
"path": "aidu_elevator/src/manual_training.py",
"copies": "2",
"size": "1767",
"license": "mit",
"hash": 2476613462460769300,
"line_mean": 26.1846153846,
"line_max": 93,
"alpha_frac": 0.5336728919,
"autogenerated": false,
"ratio": 3.3151969981238274,
"conf... |
__author__ = 'rolf'
import cv2
import numpy as np
import rospy
from sensor_msgs.msg import CompressedImage
from pymongo import MongoClient
from bson.binary import Binary
db = MongoClient()
fotos = db['aidu']['fotos']
def convert(image, input_type='cv2', output_type='ros'):
assert input_type in ['cv2', 'ros', 'm... | {
"repo_name": "rjagerman/aidu",
"path": "aidu_elevator/src/images.py",
"copies": "2",
"size": "1177",
"license": "mit",
"hash": 6830966844102553000,
"line_mean": 28.425,
"line_max": 91,
"alpha_frac": 0.6380628717,
"autogenerated": false,
"ratio": 3.2694444444444444,
"config_test": false,
"has... |
__author__ = 'Roman Aarkharov'
import simplejson as json
import time
from twisted.python import log
from twisted.internet.task import LoopingCall
from db import Db
from crypt import Crypt
class Leaderboards:
"""
Main game class.
"""
def __init__(self, max_clients, db_name, db_host, db... | {
"repo_name": "romka/leaderboards-server",
"path": "leaderboards.py",
"copies": "1",
"size": "9014",
"license": "mit",
"hash": 5733688229936401000,
"line_mean": 34.4939271255,
"line_max": 176,
"alpha_frac": 0.5564677169,
"autogenerated": false,
"ratio": 3.8178737822956372,
"config_test": false,... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.