text stringlengths 0 1.05M | meta dict |
|---|---|
"""" @author: Eugene Yurtsev @date 2013-07-25
Defines gates that operate on DataFrames.
API:
DataFrame -- pandas object
gate1 -- a polygon gate.
Gates:
ThresholdGate
IntervalGate
QuadGate
PolyGate
"""
import numpy
import pylab as pl
from matplotlib.path import Path
from FlowCytometryTools.co... | {
"repo_name": "eyurtsev/FlowCytometryTools",
"path": "FlowCytometryTools/core/gates.py",
"copies": "1",
"size": "14853",
"license": "mit",
"hash": 3749078073424954000,
"line_mean": 29.312244898,
"line_max": 108,
"alpha_frac": 0.5429206221,
"autogenerated": false,
"ratio": 4.101905550952775,
"co... |
__author__ = 'evancox'
from sklearn.ensemble import RandomForestClassifier
from sklearn_pmml.convert.model import EstimatorConverter
from sklearn_pmml.convert.tree import DecisionTreeConverter
from sklearn_pmml.convert.utils import estimator_to_converter
import sklearn_pmml.pmml as pmml
class RandomForestClassifier... | {
"repo_name": "kod3r/sklearn-pmml",
"path": "sklearn_pmml/convert/random_forest.py",
"copies": "3",
"size": "1773",
"license": "mit",
"hash": 3690359261645871000,
"line_mean": 39.3181818182,
"line_max": 107,
"alpha_frac": 0.7168640722,
"autogenerated": false,
"ratio": 4.191489361702128,
"config... |
__author__ = 'Evan Downing'
import sys
import os
import datetime
import random
# Extracts words from file
def extract_words(fn):
with open(fn, 'r') as fr:
final_words = list()
# Get each line in the file
for line in fr:
# Split the line into words
words = line.sp... | {
"repo_name": "evandowning/Markov-Text-Generator",
"path": "markov.py",
"copies": "1",
"size": "6363",
"license": "mit",
"hash": -5612768951993392000,
"line_mean": 25.7352941176,
"line_max": 79,
"alpha_frac": 0.5668709728,
"autogenerated": false,
"ratio": 4.225099601593626,
"config_test": false... |
from subprocess import call
import numpy as np
import matplotlib.pyplot as plt
import matplotlib
import time
import string
from operator import itemgetter
import CO2Properties_1_0 as co2
def process_t2_output(sim_title, parallel = False, split = 0,\
double_balance = False, num_outputs = 1):
grid = T2grid(... | {
"repo_name": "evanl/vesa_tough_comparison",
"path": "tough/t2/t2_output_funcs.py",
"copies": "1",
"size": "38727",
"license": "mit",
"hash": -699983124813343900,
"line_mean": 34.174386921,
"line_max": 85,
"alpha_frac": 0.4831512898,
"autogenerated": false,
"ratio": 3.5825161887141537,
"config_... |
import eclipse_cells as ec
import numpy as np
import matplotlib.pyplot as plt
class Injector(object):
def __init__(self, index, x, y, ratio, layer_id, end_days, mass_rate):
self.index = index
self.x = x
self.y = y
self.ratio = ratio
self.layer_id = layer_id
self.end_... | {
"repo_name": "evanl/vesa_tough_comparison",
"path": "vesa/vesa_v02_13/vesa_writing_functions.py",
"copies": "2",
"size": "13731",
"license": "mit",
"hash": -9216154520381325000,
"line_mean": 34.3891752577,
"line_max": 87,
"alpha_frac": 0.4657344694,
"autogenerated": false,
"ratio": 3.30230880230... |
import numpy as np
import matplotlib.pyplot as plt
import matplotlib
from mpl_toolkits.mplot3d import Axes3D
import read_eclipse as re
import eclipse_cells as ec
from time import clock
import string
from subprocess import call
class T2Input(object):
def __init__(self, sim_title, cp_vals, two_d = False, uniform = F... | {
"repo_name": "evanl/vesa_tough_comparison",
"path": "tough/t2/t2_input_funcs.py",
"copies": "1",
"size": "68764",
"license": "mit",
"hash": 8226467469716751000,
"line_mean": 34.1554192229,
"line_max": 92,
"alpha_frac": 0.4814583212,
"autogenerated": false,
"ratio": 3.432364979534791,
"config_t... |
import numpy as np
import matplotlib.pyplot as plt
import matplotlib
from mpl_toolkits.mplot3d import Axes3D
import string
def write_separator(f, keyword):
""" writes for the following keywords
START ROCKS
MULTI PARAM
SOLVR GENER
TIMES FOFT
GOFT COFT
ELEME INCON
ENDCY CONNE
MESHMA... | {
"repo_name": "evanl/comparison_scripts",
"path": "input_t2_funcs.py",
"copies": "1",
"size": "48178",
"license": "mit",
"hash": -5394822925414078000,
"line_mean": 31.9084699454,
"line_max": 94,
"alpha_frac": 0.4464900992,
"autogenerated": false,
"ratio": 3.217228714524207,
"config_test": false... |
import numpy as np
import matplotlib.pyplot as plt
import matplotlib
from time import time, clock
import sys
import os
from subprocess import call
import tough.t2.process_t2_output as pt2
import vesa.VESA_02_01_13.vesa_reading_functions as vr
class Compare:
def __init__(self, sim_titles, num_vesa_sims,
... | {
"repo_name": "evanl/comparison_scripts",
"path": "compare.py",
"copies": "1",
"size": "15283",
"license": "mit",
"hash": 497512243999983600,
"line_mean": 38.7994791667,
"line_max": 91,
"alpha_frac": 0.5043512399,
"autogenerated": false,
"ratio": 3.476569608735214,
"config_test": false,
"has_... |
import numpy as np
import matplotlib.pyplot as plt
import matplotlib
import time
import string
from operator import itemgetter
import CO2Properties_1_0 as co2
class T2grid(object):
""" This class represents an overarching structure to post-process a
TOUGH2 simulation.
The aim is that this... | {
"repo_name": "evanl/comparison_scripts",
"path": "output_t2_funcs.py",
"copies": "1",
"size": "33643",
"license": "mit",
"hash": 6821100465271560000,
"line_mean": 34.117954071,
"line_max": 85,
"alpha_frac": 0.471539399,
"autogenerated": false,
"ratio": 3.516567366990697,
"config_test": false,
... |
import sys
from subprocess import call
import numpy as np
import matplotlib.pyplot as plt
import output_t2_funcs as t2o
def process_t2_output(sim_title, parallel = False, split = 0,\
double_balance = False):
# this must be changed to reflect the input data
# create an output grid object
grid = t2o.... | {
"repo_name": "evanl/comparison_scripts",
"path": "process_t2_output.py",
"copies": "1",
"size": "4356",
"license": "mit",
"hash": 4180710368356577300,
"line_mean": 29.0413793103,
"line_max": 77,
"alpha_frac": 0.5328282828,
"autogenerated": false,
"ratio": 3.2900302114803623,
"config_test": fal... |
import sys
import numpy as np
import matplotlib.pyplot as plt
import t2_output_funcs as ot2f
if __name__ == '__main__':
print "PROCESSING TOUGH2 OUTPUT FOR " + str(sys.argv[1])
if len(sys.argv) != 2:
sys.exit( "Please specify a simulation title")
sim_title = sys.argv[1]
# for hydrostatic simula... | {
"repo_name": "evanl/vesa_tough_comparison",
"path": "tough/t2/t2_process_output.py",
"copies": "1",
"size": "2712",
"license": "mit",
"hash": -5323842470426932000,
"line_mean": 29.4719101124,
"line_max": 82,
"alpha_frac": 0.584439528,
"autogenerated": false,
"ratio": 3.32760736196319,
"config_... |
import sys
import string
from time import clock
import read_eclipse as re
import eclipse_cells as ec
import input_t2_funcs as it2f
from subprocess import call
def create_t2_input(sim_title, two_d = False, uniform = False,\
sleipner = False, hydro = False, hydro_directory = False,\
num_steps = 11, days_... | {
"repo_name": "evanl/comparison_scripts",
"path": "create_t2_input.py",
"copies": "1",
"size": "8188",
"license": "mit",
"hash": -5712825509210548000,
"line_mean": 29.2140221402,
"line_max": 80,
"alpha_frac": 0.5383488031,
"autogenerated": false,
"ratio": 3.0382189239332096,
"config_test": fals... |
import sys
import string
import t2_input_funcs as it2f
# TODO clean up processing routines into a returnable object that can be
# called by other routines.
# TODO comment post-processing routines
if __name__ == '__main__':
""" t2_create_input is run in the following way from a command line
or shell scr... | {
"repo_name": "evanl/vesa_tough_comparison",
"path": "tough/t2/t2_create_input.py",
"copies": "1",
"size": "5116",
"license": "mit",
"hash": 4176298321731987000,
"line_mean": 31.7948717949,
"line_max": 80,
"alpha_frac": 0.5908913213,
"autogenerated": false,
"ratio": 3.424364123159304,
"config_t... |
import vesa_reading_functions as vr
from subprocess import call
import sys
from time import time, clock
import glob
def move_files(fmt, sim_title):
print ('moving all ' + fmt + ' files to the directory ' + sim_title)
movestring = "cp " + "*" + fmt + " " + sim_title
call(movestring, shell=True)
call (["... | {
"repo_name": "evanl/vesa_tough_comparison",
"path": "vesa/vesa_v02_13/vesa_output_read.py",
"copies": "1",
"size": "2537",
"license": "mit",
"hash": 6363863196672849000,
"line_mean": 31.9480519481,
"line_max": 79,
"alpha_frac": 0.5798186835,
"autogenerated": false,
"ratio": 3.1437422552664187,
... |
import vesa_writing_functions as wf
import read_eclipse as re
import eclipse_cells as ec
from time import clock
import sys
def vesa_make_input(layer_id, uniform = False, hydro = False,\
timestep_days = 1., output_days = 365, simtime_years = 11,\
homogeneous = False, xlocs = [1600.0], ylocs = [2057.75])... | {
"repo_name": "evanl/vesa_tough_comparison",
"path": "vesa/vesa_v02_13/vesa_make_input.py",
"copies": "1",
"size": "4208",
"license": "mit",
"hash": -4063986810421478400,
"line_mean": 29.4927536232,
"line_max": 81,
"alpha_frac": 0.5501425856,
"autogenerated": false,
"ratio": 2.8625850340136054,
... |
__author__ = 'Evan Murawski'
import unittest
import backend
from backend.interactions import *
from backend.beam import Beam
import backend.solver as solver
from backend.solver import SolverError
import backend.shearmomentgenerator as shearmomentgenerator
from backend.shearmomentgenerator import Shear_Moment_... | {
"repo_name": "EvanMurawski/BeamAnalyzer",
"path": "beamanalyzer/test/test.py",
"copies": "1",
"size": "6877",
"license": "mit",
"hash": 5072345714018758000,
"line_mean": 39.4397590361,
"line_max": 97,
"alpha_frac": 0.6145121419,
"autogenerated": false,
"ratio": 3.0202020202020203,
"config_test... |
import os, sys
from tilde.connectors import viewer_wrap
def list(path, root):
output = ''
error = None
dirs = []
files = []
try:
for item in os.listdir(root + path):
if os.path.isdir(root + path + os.sep + item):
dirs.append(item)
else: files.appen... | {
"repo_name": "ansobolev/tilde",
"path": "tilde/connectors/local.py",
"copies": "1",
"size": "1092",
"license": "mit",
"hash": 1703508961433210000,
"line_mean": 27,
"line_max": 63,
"alpha_frac": 0.586996337,
"autogenerated": false,
"ratio": 3.664429530201342,
"config_test": false,
"has_no_key... |
__author__ = 'evgeny'
from features import logfbank
from collections import defaultdict
import scipy.io.wavfile as wav
import os
import numpy as np
sph2pipe = "/Users/evgeny/kaldi3/tools/sph2pipe_v2.5/sph2pipe"
window = 0.025
step = 0.01
nfilt = 40
fftsize = 512
left_context = 6
right_context = 2
def getAudio(path... | {
"repo_name": "notimesea/VADnnet",
"path": "extractFeats.py",
"copies": "1",
"size": "2325",
"license": "mit",
"hash": 4210710514707254000,
"line_mean": 26.6785714286,
"line_max": 91,
"alpha_frac": 0.5238709677,
"autogenerated": false,
"ratio": 3.4292035398230087,
"config_test": false,
"has_n... |
__author__ = 'evgeny'
from features import logfbank
import scipy.io.wavfile as wav
import os
sph2pipe = "/Users/evgeny/kaldi3/tools/sph2pipe_v2.5/sph2pipe"
window = 0.025
step = 0.01
nfilt = 40
fftsize = 512
def extractLogFBank(path):
os.system(sph2pipe + " -f wav " + path + " tmp.wav")
(rate, sig) = wav.r... | {
"repo_name": "notimesea/VADnnet",
"path": "prepareData.py",
"copies": "1",
"size": "1027",
"license": "mit",
"hash": -4582549134729462300,
"line_mean": 24.0731707317,
"line_max": 73,
"alpha_frac": 0.547224927,
"autogenerated": false,
"ratio": 3.1993769470404985,
"config_test": false,
"has_no... |
__author__ = 'evilkhaoskat'
import sys
import os
import GitHelper
# AA means Awesome-Awesomeness
AA_GIT_LINK = "https://github.com/bayandin/awesome-awesomeness.git"
AA_DIR_NAME = "awesome-awesomeness"
AA_MAIN_FILE = "README.md"
def get_dir_to_clone(argv):
"""
:param argv: list of string
:return: anothe... | {
"repo_name": "EvilKhaosKat/awesome-awesomeness_backuper",
"path": "main.py",
"copies": "1",
"size": "1590",
"license": "apache-2.0",
"hash": 3113030123583820000,
"line_mean": 26.8947368421,
"line_max": 112,
"alpha_frac": 0.6251572327,
"autogenerated": false,
"ratio": 3.2515337423312882,
"confi... |
from hcdev.exception import EncodeInputError
class ex094morse:
def __init__(self):
pass
morse_alpha = 'ABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789'
morse_encode = ['.-', '-...', '-.-.', '-.', '.', '..-.', '--.', '....', '..', '.---', '-.-', '.-..', '--', '-.',
'---', '.--.', '--.-', '... | {
"repo_name": "HCDevelopers/MultiEncoder",
"path": "hcdev/encodings/morse.py",
"copies": "1",
"size": "1145",
"license": "mit",
"hash": -4868578671829863000,
"line_mean": 37.1666666667,
"line_max": 116,
"alpha_frac": 0.4331877729,
"autogenerated": false,
"ratio": 3.6698717948717947,
"config_tes... |
__author__ = 'exleym'
from pandas.tseries.offsets import BDay
import pandas_datareader.data as web
import datetime
import numpy as np
class Asset(object):
def __init__(self, ticker, name, price=None):
self.ticker = ticker
self.name = name
self.price = price
self.pricer = None
... | {
"repo_name": "exleym/simpaq",
"path": "assets/standard.py",
"copies": "1",
"size": "3969",
"license": "mit",
"hash": -2805078671970513000,
"line_mean": 31.5409836066,
"line_max": 108,
"alpha_frac": 0.6006550768,
"autogenerated": false,
"ratio": 3.4876977152899826,
"config_test": false,
"has_... |
__author__ = 'exleym'
"""
Numerical Pricers
-----------------------
LatticePricer
FDPricer
MCPricer
"""
import datetime
import numpy as np
from . import Pricer
from ..processes import Tree, MonteCarlo
from ..solvers import LSM
class DCF(object):
def __init__(self):
pass
def pric... | {
"repo_name": "exleym/simpaq",
"path": "pricers/numerical.py",
"copies": "1",
"size": "10526",
"license": "mit",
"hash": -7786320738592342000,
"line_mean": 44.3706896552,
"line_max": 120,
"alpha_frac": 0.6100133004,
"autogenerated": false,
"ratio": 3.654861111111111,
"config_test": false,
"ha... |
__author__ = 'exley'
"""
Finite Difference Models included in the SimPack library
-----------------------------------------------------------
Exley
9/29/2016
Classes representing different finite-difference approximations to
differential equation solutions for pricing option-like securities.
"... | {
"repo_name": "exleym/simpaq",
"path": "fd.py",
"copies": "1",
"size": "1449",
"license": "mit",
"hash": 1633142386032203000,
"line_mean": 31.2,
"line_max": 87,
"alpha_frac": 0.5838509317,
"autogenerated": false,
"ratio": 4.025,
"config_test": false,
"has_no_keywords": false,
"few_assignmen... |
__author__ = 'Exter, 0xBADDCAFE'
import wx
class FTDropTarget(wx.DropTarget):
"""
Implements drop target functionality to receive files and text
receiver - any WX class that can bind to events
evt - class that comes from wx.lib.newevent.NewCommandEvent call
class variable ID_DROP_FILE
class... | {
"repo_name": "exter/pycover",
"path": "droptarget.py",
"copies": "1",
"size": "1525",
"license": "mit",
"hash": 7178383847887333000,
"line_mean": 31.4468085106,
"line_max": 110,
"alpha_frac": 0.6255737705,
"autogenerated": false,
"ratio": 3.674698795180723,
"config_test": false,
"has_no_keyw... |
__author__ = 'Exter'
# -*- coding: utf-8 -*-
###########################################################################
## Python code generated with wxFormBuilder (version Jun 5 2014)
## http://www.wxformbuilder.org/
##
## PLEASE DO "NOT" EDIT THIS FILE!
############################################################... | {
"repo_name": "exter/pycover",
"path": "tools/frame_test.py",
"copies": "1",
"size": "5509",
"license": "mit",
"hash": -155232775188530850,
"line_mean": 36.7397260274,
"line_max": 226,
"alpha_frac": 0.6460337629,
"autogenerated": false,
"ratio": 2.669089147286822,
"config_test": false,
"has_n... |
__author__ = 'eya'
from model.contact import Contact
from model.group import Group
from fixture.orm import OrmFixture
import random
orm_db = OrmFixture(host="127.0.0.1", name="addressbook", user="root", password="")
def test_add_contact_to_group(app, db):
if len(db.get_group_list()) == 0:
app.group.creat... | {
"repo_name": "elenay/python_training",
"path": "tests/test_add_and_delete_contact_to_group.py",
"copies": "1",
"size": "1604",
"license": "apache-2.0",
"hash": -5417786136906610000,
"line_mean": 42.3513513514,
"line_max": 101,
"alpha_frac": 0.6826683292,
"autogenerated": false,
"ratio": 3.176237... |
__author__ = 'eya'
from model.group import Group
class GroupHelper:
def __init__(self, app):
self.app = app
def open_groups_page(self):
wd = self.app.wd
if not (wd.current_url.endswith("/group.php") and len(wd.find_elements_by_name("new"))>0):
wd.find_element_by_link_text(... | {
"repo_name": "elenay/python_training",
"path": "fixture/group.py",
"copies": "1",
"size": "3683",
"license": "apache-2.0",
"hash": -2800737757782597600,
"line_mean": 31.592920354,
"line_max": 98,
"alpha_frac": 0.5853923432,
"autogenerated": false,
"ratio": 3.4582159624413147,
"config_test": fa... |
__author__ = 'eya'
import mysql.connector
from model.group import Group
from model.contact import Contact
class DbFixture:
def __init__(self, host, name, user, password):
self.host = host
self.name = name
self.user = user
self.password = password
self.connection = mysql.con... | {
"repo_name": "elenay/python_training",
"path": "fixture/db.py",
"copies": "1",
"size": "1794",
"license": "apache-2.0",
"hash": 4507882216709881300,
"line_mean": 40.7441860465,
"line_max": 176,
"alpha_frac": 0.5986622074,
"autogenerated": false,
"ratio": 4.231132075471698,
"config_test": false... |
__author__ = 'eya'
import pytest
from fixture.application import Application
import jsonpickle
import json
import importlib
import os.path
from fixture.db import DbFixture
fixture = None
target = None
def load_config(file):
global target
if target is None:
config_file = os.path.join(os.path.dirname(o... | {
"repo_name": "elenay/python_training",
"path": "conftest.py",
"copies": "1",
"size": "2450",
"license": "apache-2.0",
"hash": -5501872651173114000,
"line_mean": 31.68,
"line_max": 129,
"alpha_frac": 0.6795918367,
"autogenerated": false,
"ratio": 3.6731634182908546,
"config_test": true,
"has_... |
__author__ = 'eya'
import re
from model.contact import Contact
def test_all_fields_on_edit_page(app, db):
contacts_from_db = db.get_contact_list()
index = range(len(contacts_from_db))
contacts_from_edit_page = []
for i in index:
contact_from_edit_page = app.contact.get_contact_info_from_edit_p... | {
"repo_name": "elenay/python_training",
"path": "tests/test_all_contact_fields.py",
"copies": "1",
"size": "2372",
"license": "apache-2.0",
"hash": -4916982317373740000,
"line_mean": 52.9318181818,
"line_max": 187,
"alpha_frac": 0.6387015177,
"autogenerated": false,
"ratio": 3.262723521320495,
... |
__author__ = 'eya'
class SessionHelper:
def __init__(self, app):
self.app = app
def login(self, username, password):
wd = self.app.wd
self.app.open_home_page()
wd.find_element_by_name("user").click()
wd.find_element_by_name("user").clear()
wd.find_element_by_n... | {
"repo_name": "elenay/python_training",
"path": "fixture/session.py",
"copies": "1",
"size": "1476",
"license": "apache-2.0",
"hash": 1578895778544200200,
"line_mean": 29.1224489796,
"line_max": 73,
"alpha_frac": 0.5650406504,
"autogenerated": false,
"ratio": 3.3545454545454545,
"config_test": ... |
__author__ = 'eyuelabebe'
import pygame
from Game import *
from Game.Scenes import *
from Game.Shared import GameConstants
class Breakout(object):
def __init__(self):
self.__lives = 5
self.__score = 0
self.__level = Level(self)
self.__level.load(0)
self.__pad = Pad((0, ... | {
"repo_name": "EyuelAbebe/pygame_pluralsight",
"path": "Game/Breakout.py",
"copies": "1",
"size": "1711",
"license": "mit",
"hash": 1009826851908065300,
"line_mean": 18.2359550562,
"line_max": 94,
"alpha_frac": 0.5429573349,
"autogenerated": false,
"ratio": 3.933333333333333,
"config_test": fal... |
__author__ = 'f7b'
from mpi4py import MPI
from pcircle.globals import G, T
from pcircle.utils import getLogger
# module variables
log = getLogger(__name__)
def colorstr(c):
if c == G.BLACK:
return "black"
elif c == G.WHITE:
return "white"
elif c == G.TERMINATE:
return "terminate"... | {
"repo_name": "olcf/pcircle",
"path": "legacy/pcircle/token.py",
"copies": "1",
"size": "4797",
"license": "apache-2.0",
"hash": 6799578176447363000,
"line_mean": 29.1698113208,
"line_max": 76,
"alpha_frac": 0.5468000834,
"autogenerated": false,
"ratio": 4.027707808564232,
"config_test": false,... |
__author__ = 'f7b'
import argparse
import sys
from mpi4py import MPI
def tally_hosts():
""" How many physical hosts are there? """
localhost = MPI.Get_processor_name()
hosts = MPI.COMM_WORLD.gather(localhost)
if hosts:
hostcnt = len(set(hosts))
else:
hostcnt = 0
hostcnt = MPI.... | {
"repo_name": "olcf/pcircle",
"path": "legacy/pcircle/mpihelper.py",
"copies": "1",
"size": "1358",
"license": "apache-2.0",
"hash": -2258868723639818000,
"line_mean": 23.6909090909,
"line_max": 89,
"alpha_frac": 0.6288659794,
"autogenerated": false,
"ratio": 3.891117478510029,
"config_test": f... |
__author__ = 'f7b'
import collections
class CommonEqualityMixin(object):
def __eq__(self, other):
return (isinstance(other, self.__class__)
and self.__dict__ == other.__dict__)
def __ne__(self, other):
return not self.__eq__(other)
# class FileItem0(CommonEqualityMixin):
# ... | {
"repo_name": "olcf/pcircle",
"path": "legacy/pcircle/fdef.py",
"copies": "1",
"size": "2533",
"license": "apache-2.0",
"hash": -3876498910177555500,
"line_mean": 27.1444444444,
"line_max": 90,
"alpha_frac": 0.5448085274,
"autogenerated": false,
"ratio": 3.3863636363636362,
"config_test": false... |
__author__ = 'f7b'
import time
import os
MAX_TRIES = 5
SLEEP = 0.1
def readn(fd, size):
tries = 0
ret = ''
while len(ret) < size:
try:
buf = os.read(fd, size - len(ret))
except OSError as e:
raise IOError(e.message)
if len(buf) > 0:
tries = MAX... | {
"repo_name": "olcf/pcircle",
"path": "legacy/pcircle/cio.py",
"copies": "1",
"size": "1055",
"license": "apache-2.0",
"hash": 852711004423523500,
"line_mean": 19.6862745098,
"line_max": 75,
"alpha_frac": 0.4502369668,
"autogenerated": false,
"ratio": 3.6759581881533103,
"config_test": false,
... |
__author__ = 'f7b'
"""
SO thread:
http://stackoverflow.com/questions/2281850/timeout-function-if-it-takes-too-long-to-finish
"""
from functools import wraps
import errno
import os
import signal
class TimeoutError(Exception):
pass
def timeout2(seconds=10, error_message=os.strerror(errno.ETIME)):
"""
Us... | {
"repo_name": "olcf/pcircle",
"path": "legacy/pcircle/timeout.py",
"copies": "1",
"size": "1632",
"license": "apache-2.0",
"hash": -672611307884212000,
"line_mean": 21.3561643836,
"line_max": 90,
"alpha_frac": 0.587622549,
"autogenerated": false,
"ratio": 4.00982800982801,
"config_test": false,... |
import os, sys, re
import traceback
from optparse import OptionParser
import fileinput
import datetime
from quicksect import IntervalTree
import gzip
import numpy as np
import collections
from functools import partial
from rosetta.parallel.parallel_easy import imap_easy
from scipy.sparse import bsr_matrix, coo_matrix
... | {
"repo_name": "aehrc/ngsane",
"path": "tools/fithic-fixedBins/readData.py",
"copies": "3",
"size": "26442",
"license": "bsd-3-clause",
"hash": -4316481260362912000,
"line_mean": 36.4002828854,
"line_max": 163,
"alpha_frac": 0.5592617805,
"autogenerated": false,
"ratio": 4.1071761416589005,
"con... |
__author__ = 'Fabian Dill <fabian.dill@web.de>'
__copyright__ = 'Copyright (C) 2010 Fabian Dill'
"""
You are allowed to modify, distribute and use this file however you may see fit,
except you may not claim this work as yours.
If you use this I would like to get credit, but that is not mandatory.
"""
from os import en... | {
"repo_name": "flying-sheep/omnitool",
"path": "splashlib.py",
"copies": "2",
"size": "1233",
"license": "mit",
"hash": 5912227581702839000,
"line_mean": 27.6744186047,
"line_max": 80,
"alpha_frac": 0.6342254663,
"autogenerated": false,
"ratio": 3.2109375,
"config_test": false,
"has_no_keywor... |
__author__ = 'Fabian Isensee'
from collections import OrderedDict
from lasagne.layers import (InputLayer, ConcatLayer, Pool2DLayer, ReshapeLayer, DimshuffleLayer, NonlinearityLayer,
DropoutLayer, Deconv2DLayer, batch_norm)
try:
from lasagne.layers.dnn import Conv2DDNNLayer as ConvLayer
e... | {
"repo_name": "Lasagne/Recipes",
"path": "modelzoo/Unet.py",
"copies": "1",
"size": "5245",
"license": "mit",
"hash": -5308046284089658000,
"line_mean": 78.4696969697,
"line_max": 186,
"alpha_frac": 0.6861773117,
"autogenerated": false,
"ratio": 2.8787047200878155,
"config_test": false,
"has_... |
__author__ = 'Fabian Isensee'
import numpy as np
import lasagne
def batch_generator(data, target, BATCH_SIZE, shuffle=False):
if shuffle:
while True:
ids = np.random.choice(len(data), BATCH_SIZE)
yield data[ids], target[ids]
else:
for idx in range(0, len(data), BATCH_SIZ... | {
"repo_name": "Lasagne/Recipes",
"path": "examples/UNet/generators.py",
"copies": "1",
"size": "3381",
"license": "mit",
"hash": -69542681958784240,
"line_mean": 35.75,
"line_max": 303,
"alpha_frac": 0.6143152913,
"autogenerated": false,
"ratio": 3.2540904716073147,
"config_test": false,
"has... |
import types
import unittest
import pygsl.math
from pygsl._numobj import *
import pygsl._mlab as mlab
from pygsl import Float, Complex, ArrayType
fcmp = pygsl.math.fcmp
def iscomplex_default(a):
return type(a) is types.ComplexType
def iscomplex_numpy(a):
if type(a) == ArrayType:
return a.dtypechar in... | {
"repo_name": "juhnowski/FishingRod",
"path": "production/pygsl-0.9.5/tests/gsl_test.py",
"copies": "1",
"size": "4118",
"license": "mit",
"hash": -6197326386941628000,
"line_mean": 31.6825396825,
"line_max": 79,
"alpha_frac": 0.4354055367,
"autogenerated": false,
"ratio": 3.075429424943988,
"c... |
import unittest
import pygsl
from pygsl.linalg import *
from gsl_test import *
import pygsl._numobj as numx
class LinalgTestCase(GSLTestCase):
def testLU_decomp(self):
(lu, p, s) = LU_decomp(self.m1_4)
(l,u) = LU_unpack(lu)
dot = numx.dot(l,u)
result = zeros((4,4), Float)
fo... | {
"repo_name": "juhnowski/FishingRod",
"path": "production/pygsl-0.9.5/tests/linalg_test.py",
"copies": "1",
"size": "8573",
"license": "mit",
"hash": 9077708265051763000,
"line_mean": 31.9730769231,
"line_max": 79,
"alpha_frac": 0.5174384696,
"autogenerated": false,
"ratio": 2.718135700697527,
... |
"""
Functions for solving linear systems.
The library provides simple linear algebra operations which operate
directly on the gsl_vector and gsl_matrix objects. These are intended
for use with "small" systems where simple algorithms are acceptable.
Anyone interested in large systems will want to use the sophisticated... | {
"repo_name": "poojavade/Genomics_Docker",
"path": "Dockerfiles/gedlab-khmer-filter-abund/pymodules/python2.7/lib/python/pygsl/linalg.py",
"copies": "1",
"size": "24076",
"license": "apache-2.0",
"hash": 9100835218011323000,
"line_mean": 29.7091836735,
"line_max": 79,
"alpha_frac": 0.64969264,
"aut... |
"""
This chapter describes functions for creating and manipulating
permutations. A permutation p is represented by an array of n integers
in the range 0 .. n-1, where each value p_i occurs once and only once.
The application of a permutation p to a vector v yields a new vector v'
where v'_i = v_{p_i}. For example, ... | {
"repo_name": "poojavade/Genomics_Docker",
"path": "Dockerfiles/gedlab-khmer-filter-abund/pymodules/python2.7/lib/python/pygsl/permutation.py",
"copies": "1",
"size": "1646",
"license": "apache-2.0",
"hash": 4491957192934827000,
"line_mean": 29.4814814815,
"line_max": 77,
"alpha_frac": 0.6221142163,
... |
r"""
BLAS - Basic Linear Algebra Subprograms
GSL provides dense vector and matrix objects, based on the relevant built-in
types. The library provides an interface to the BLAS operations which apply to
these objects.
PyGSL only provides the functions working on "native" Python datatypes, i.e.
double and complex_double... | {
"repo_name": "poojavade/Genomics_Docker",
"path": "Dockerfiles/gedlab-khmer-filter-abund/pymodules/python2.7/lib/python/pygsl/blas.py",
"copies": "1",
"size": "25271",
"license": "apache-2.0",
"hash": 3953551223508775000,
"line_mean": 31.6921086675,
"line_max": 82,
"alpha_frac": 0.6427525622,
"aut... |
r"""
This module provides functions for computing eigenvalues and eigenvectors of
matrices using the gsl.
There are routines for real symmetric and complex hermitian matrices, and
eigenvalues can be computed with or without eigenvectors. The algorithms used
are symmetric bidiagonalization followed by QR reduc... | {
"repo_name": "poojavade/Genomics_Docker",
"path": "Dockerfiles/gedlab-khmer-filter-abund/pymodules/python2.7/lib/python/pygsl/eigen.py",
"copies": "1",
"size": "3827",
"license": "apache-2.0",
"hash": 8672791967813833000,
"line_mean": 35.7980769231,
"line_max": 78,
"alpha_frac": 0.7081264698,
"aut... |
__author__ = 'Fabian'
import os
import zipfile
import pygame
import array
pygame.init()
import threading
ziplock = threading.Lock()
RGBA_FORMAT = "RGBA"
RGB_FORMAT = "RGB"
BENCHMARK = True
formats = [RGBA_FORMAT, RGB_FORMAT]
from concurrent.futures import ThreadPoolExecutor
threadpool = ThreadPoolExecutor(10)
from h... | {
"repo_name": "Berserker66/omnitool",
"path": "omnitool/Resources/resourcepack.py",
"copies": "2",
"size": "1647",
"license": "mit",
"hash": -3135374794141121000,
"line_mean": 23.9696969697,
"line_max": 80,
"alpha_frac": 0.6399514268,
"autogenerated": false,
"ratio": 3.334008097165992,
"config_... |
__author__ = 'Fabian'
import zipfile
import json
class ModFile():
infolocation = None
def __init__(self, path):
self.path = path
def check(self):
try:
with zipfile.ZipFile(self.path) as zip:
zip.testzip()
files = zip.namelist()
info =... | {
"repo_name": "Berserker66/FactorioManager",
"path": "FactorioManager/ModFile.py",
"copies": "1",
"size": "1211",
"license": "mit",
"hash": -7104669804368467000,
"line_mean": 27.8571428571,
"line_max": 96,
"alpha_frac": 0.5260115607,
"autogenerated": false,
"ratio": 4.569811320754717,
"config_t... |
__author__ = 'Fabian'
import sys
import appdirs
import os
import shutil
join = os.path.join
directories = appdirs.AppDirs("FactorioManager", "", roaming=True)
configpath = join(directories.user_config_dir, "config.cfg")
tempfolder = appdirs.user_cache_dir("FactorioManager", "", opinion=False)
log = join(tempfolder, ... | {
"repo_name": "vlajos/FactorioManager",
"path": "FactorioManager/paths.py",
"copies": "1",
"size": "1351",
"license": "mit",
"hash": 1224271955993349000,
"line_mean": 28.3913043478,
"line_max": 93,
"alpha_frac": 0.6498889711,
"autogenerated": false,
"ratio": 3.545931758530184,
"config_test": tr... |
__author__ = 'Fabian'
import requests
import json
import os
import sys
from .paths import tempfolder
def convert(mod):
return mod
def download(mod, target = tempfolder, callback = None):
print("Downloading", mod["title"])
url = mod["releases"][0]["files"][0]["mirror"]
if not url:
url = mod[... | {
"repo_name": "vlajos/FactorioManager",
"path": "FactorioManager/remoteapi.py",
"copies": "1",
"size": "1333",
"license": "mit",
"hash": 3205027518357684000,
"line_mean": 24.6346153846,
"line_max": 61,
"alpha_frac": 0.5716429107,
"autogenerated": false,
"ratio": 3.702777777777778,
"config_test"... |
__author__ = "Fabio Giuseppe Di Benedetto"
from rcmp_inter_communication import threading
from rcmp_command import logging, RCMP_LOGGER_NAME, CREATE_SERVICE_SPACE, START_SERVICE_LAUNCHER, \
START_SERVICE_NODE, DELETE_SERVICE_SPACE, KILL_SERVICE_LAUNCHER, KILL_SERVICE_NODE, \
DELETE_ALL_L_SERVICE_SPACE, KILL_AL... | {
"repo_name": "FIWARE-RoboticsGE/Robotics",
"path": "RCM/src/rcm_platform/rcmp_ms.py",
"copies": "2",
"size": "23504",
"license": "mit",
"hash": -447115528028013400,
"line_mean": 68.1294117647,
"line_max": 119,
"alpha_frac": 0.5420779442,
"autogenerated": false,
"ratio": 4.18891463197291,
"conf... |
__author__ = "Fabio Giuseppe Di Benedetto"
from rcmp_node import logging, RCMP_LOGGER_NAME, RCMPlatformNode
from rcmp_inter_communication import RCMPInterCommunicationClient, RCMPMessage
START_SERVICE_NODE = 'SN'
KILL_SERVICE_NODE = 'KN'
KILL_ALL_L_SERVICE_NODE = 'KALN'
READ_SERVICE_NODE = 'RN'
CREATE_SERVICE_SPACE =... | {
"repo_name": "FIWARE-RoboticsGE/Robotics",
"path": "RCM/src/rcm_platform/rcmp_command.py",
"copies": "2",
"size": "8359",
"license": "mit",
"hash": -774761927561513600,
"line_mean": 43.4627659574,
"line_max": 120,
"alpha_frac": 0.5992343582,
"autogenerated": false,
"ratio": 3.7184163701067616,
... |
__author__ = "Fabio Giuseppe Di Benedetto"
from rcmp_node import logging, RCMP_LOGGER_NAME, threading, RCMPlatformNode
from rcmp_inter_communication import RCMPInterCommunicationClient, RCMPMessage
PAIRING_EVENT = 'PGE'
UPDATE_EVENT = 'UE'
PAIRED_EVENT = 'PDE'
ROLLBACK_UPDATE_EVENT = 'RUE'
ROLLBACK_UPDATE_ALL_EVENT =... | {
"repo_name": "FIWARE-RoboticsGE/Robotics",
"path": "RCM/src/rcm_platform/rcmp_event.py",
"copies": "2",
"size": "37952",
"license": "mit",
"hash": 5548435413084285000,
"line_mean": 54.485380117,
"line_max": 120,
"alpha_frac": 0.5456892917,
"autogenerated": false,
"ratio": 4.121633362293657,
"c... |
__author__ = "Fabio Giuseppe Di Benedetto"
from twisted.internet import reactor
from twisted.web import http
from twisted.web.resource import Resource, NoResource
from twisted.web.server import Site
from rcmp_node import logging, RCMP_LOGGER_NAME
from rcmp_inter_communication import RCMPInterCommunicationClient, RCMPM... | {
"repo_name": "Fiware/i2nd.Robotics",
"path": "RCM/src/rcm_platform/rcmp_ext_connector.py",
"copies": "2",
"size": "14536",
"license": "mit",
"hash": -6880151844501273000,
"line_mean": 39.9464788732,
"line_max": 108,
"alpha_frac": 0.6291964777,
"autogenerated": false,
"ratio": 3.952147906470908,
... |
__author__ = "Fabio Giuseppe Di Benedetto"
import logging
import os.path
import socket
import signal
import threading
import netifaces
platform_folder = "/opt/rcm-platform"
log_folder_name = "log"
log_folder = os.path.join(platform_folder, log_folder_name)
RCMP_LOGGER_NAME = "RCMPlatformNodeLog"
class RCMPlatformN... | {
"repo_name": "FIWARE-RoboticsGE/Robotics",
"path": "RCM/src/rcm_platform/rcmp_node.py",
"copies": "2",
"size": "29562",
"license": "mit",
"hash": -1944257174108648200,
"line_mean": 55.0948766603,
"line_max": 119,
"alpha_frac": 0.5841621,
"autogenerated": false,
"ratio": 3.974455498789997,
"con... |
__author__ = "Fabio Giuseppe Di Benedetto"
import os
from rcmp_command import RCMPlatformNode, RCMPCommandAgent, RCMPMessage
from rcmp_service_command import ServiceSpace
class PNodeInstance(RCMPCommandAgent):
M_ADDRESS_KEY = "m_address"
PI_NAME_KEY = "pi_name"
PI_ADDRESS_KEY = "pi_address"
PI_TYPE_... | {
"repo_name": "Fiware/i2nd.Robotics",
"path": "RCM/src/rcm_platform/rcmp_platform_command.py",
"copies": "2",
"size": "26082",
"license": "mit",
"hash": 8219530350981138000,
"line_mean": 53.3375,
"line_max": 112,
"alpha_frac": 0.564642282,
"autogenerated": false,
"ratio": 3.902738291186593,
"co... |
__author__ = "Fabio Giuseppe Di Benedetto"
import select
import Queue
from rcmp_inter_communication import threading, socket, RCMPMessage, RCMPDispatcher
from rcmp_event import logging, RCMP_LOGGER_NAME, PNodeInstance
from rcmp_node import RCMPlatformNode, try_execution
class WDogManager:
def __init__(self, pni... | {
"repo_name": "FIWARE-RoboticsGE/Robotics",
"path": "RCM/src/rcm_platform/rcmp_wd.py",
"copies": "2",
"size": "21448",
"license": "mit",
"hash": -2360000805655919600,
"line_mean": 53.9948717949,
"line_max": 121,
"alpha_frac": 0.547463633,
"autogenerated": false,
"ratio": 4.2547113667923036,
"co... |
__author__ = "Fabio Giuseppe Di Benedetto"
import socket
from SocketServer import ThreadingTCPServer, BaseRequestHandler
import json
import os
import errno
import time
from rcmp_node import logging, RCMP_LOGGER_NAME, threading, netifaces
DEFAULT_SERVER_ADDRESS = netifaces.ifaddresses("tun0")[netifaces.AF_INET][0]["ad... | {
"repo_name": "FIWARE-RoboticsGE/Robotics",
"path": "RCM/src/rcm_platform/rcmp_inter_communication.py",
"copies": "2",
"size": "11149",
"license": "mit",
"hash": -2628400055180960300,
"line_mean": 41.5534351145,
"line_max": 116,
"alpha_frac": 0.6092923132,
"autogenerated": false,
"ratio": 4.51559... |
__author__ = "Fabio Giuseppe Di Benedetto"
import sqlite3
import os.path
from rcmp_node import logging, RCMP_LOGGER_NAME, RCMPlatformNode
class RCMPRoboticsDataManager:
"""The database manager for rcm platform robotics data."""
DEFAULT_DB_DIR = "/opt/rcm-platform/"
DEFAULT_DB_NAME = "robotics_data.db"
... | {
"repo_name": "FIWARE-RoboticsGE/Robotics",
"path": "RCM/src/rcm_platform/rcmp_robotics_data.py",
"copies": "2",
"size": "39754",
"license": "mit",
"hash": 5044349762153271000,
"line_mean": 55.8726752504,
"line_max": 137,
"alpha_frac": 0.58298536,
"autogenerated": false,
"ratio": 3.90012753850681... |
__author__ = "Fabio Giuseppe Di Benedetto"
import subprocess
import select
import re
import os
import copy
from rcmp_node import signal, threading
from rcmp_command import RCMPlatformNode, RCMPCommandAgent, RCMPMessage
class SLogicInstance(RCMPCommandAgent):
SLG_NAME_KEY = "slg_name"
SLG_SS_SIDE_KEY = "ss_s... | {
"repo_name": "FIWARE-RoboticsGE/Robotics",
"path": "RCM/src/rcm_platform/rcmp_service_command.py",
"copies": "2",
"size": "90513",
"license": "mit",
"hash": 8122247777356507000,
"line_mean": 51.2894280763,
"line_max": 119,
"alpha_frac": 0.5557323257,
"autogenerated": false,
"ratio": 3.8815129293... |
__author__ = "Fabio Tea <ft2011@gmail.com>"
import feedparser
from urllib.request import urlopen
from sopel.tools import SopelMemory, SopelMemoryWithDefault
from sopel.module import commands, example, NOLIMIT, require_privilege, OP, require_admin
from sopel.config.types import (StaticSection, ValidatedAttribute,... | {
"repo_name": "f4bio/sopel-rss",
"path": "rss.py",
"copies": "1",
"size": "3833",
"license": "mit",
"hash": -2965704924288018000,
"line_mean": 28.4206349206,
"line_max": 89,
"alpha_frac": 0.6146621445,
"autogenerated": false,
"ratio": 3.595684803001876,
"config_test": true,
"has_no_keywords":... |
__author__ = "Fabrizio Costa"
__copyright__ = "Copyright 2015, Fabrizio Costa"
__credits__ = ["Fabrizio Costa", "Bjoern Gruening"]
__license__ = "GPL"
__version__ = "0.1"
__maintainer__ = "Fabrizio Costa"
__email__ = "costa@informatik.uni-freiburg.de"
__status__ = "Production"
import dill
from itertools import izip_lo... | {
"repo_name": "antworteffekt/EDeN",
"path": "eden/__init__.py",
"copies": "1",
"size": "3633",
"license": "mit",
"hash": 7482499363498641000,
"line_mean": 31.1504424779,
"line_max": 92,
"alpha_frac": 0.6707954858,
"autogenerated": false,
"ratio": 3.5033751205400194,
"config_test": false,
"has... |
__author__ = 'Fabrizio Lungo<fab@lungo.co.uk>'
import unittest
import shutil
import os
import sys
sys.path.append(os.path.realpath('../../lib/yamlconfig'))
from config import Configuration
from __exceptions__ import FileNotFound
testdir = './files'
testconfig = testdir + '/config.yml'
exampledir = '../examples/yaml... | {
"repo_name": "flungo/python-yaml-config",
"path": "test/lib/config_test.py",
"copies": "1",
"size": "1810",
"license": "mit",
"hash": -7895425643966679000,
"line_mean": 28.6885245902,
"line_max": 120,
"alpha_frac": 0.6453038674,
"autogenerated": false,
"ratio": 4.2992874109263655,
"config_test... |
__author__ = 'faculty'
from measurements.models import Area, Category, Location, Measurement
import random
from django.core.management.base import BaseCommand
from django.utils import timezone
class Command(BaseCommand):
help = "adds sample entities to the application"
def handle(self, *args, **options):
... | {
"repo_name": "dhruvaldarji/InternetProgramming",
"path": "Assignment_6/measurements/management/commands/add_data.py",
"copies": "1",
"size": "2848",
"license": "mit",
"hash": -8542491947190770000,
"line_mean": 33.313253012,
"line_max": 82,
"alpha_frac": 0.4750702247,
"autogenerated": false,
"rat... |
__author__ = 'fahadadeel'
import jpype
import shutil
class CheckFormat:
def __init__(self,dataDir):
self.dataDir = dataDir
self.Document = jpype.JClass("com.aspose.words.Document")
self.File = jpype.JClass("java.io.File")
self.LoadFormat = jpype.JClass("com.aspose.words.LoadFormat... | {
"repo_name": "ali-salman/Aspose_Words_Java",
"path": "Plugins/Aspose_Words_Java_for_Python/loadingandsaving/__init__.py",
"copies": "5",
"size": "2900",
"license": "mit",
"hash": -2942166151267420000,
"line_mean": 42.9545454545,
"line_max": 80,
"alpha_frac": 0.5868965517,
"autogenerated": false,
... |
__author__ = 'fahadadeel'
import jpype
class AccessSlides:
def __init__(self, dataDir):
print "init func"
self.dataDir = dataDir
self.Presentation=jpype.JClass("com.aspose.slides.Presentation")
self.SaveFormat=jpype.JClass("com.aspose.slides.SaveFormat")
def ma... | {
"repo_name": "asposeslides/Aspose_Slides_Java",
"path": "Plugins/Aspose-Slides-Java-for-Python/WorkingWithSlidesInPresentation/__init__.py",
"copies": "2",
"size": "21809",
"license": "mit",
"hash": 341984341085694700,
"line_mean": 37.2614035088,
"line_max": 139,
"alpha_frac": 0.6176349214,
"autog... |
__author__ = 'fahadadeel'
import jpype
class AddImage:
def __init__(self, dataDir):
print "init func"
self.dataDir = dataDir
self.Presentation=jpype.JClass("com.aspose.slides.Presentation")
self.SaveFormat=jpype.JClass("com.aspose.slides.SaveFormat")
self.TextAnchorType=jpy... | {
"repo_name": "aspose-slides/Aspose.Slides-for-Java",
"path": "Plugins/Aspose-Slides-Java-for-Python/WorkingWithTables/__init__.py",
"copies": "2",
"size": "11845",
"license": "mit",
"hash": -5349087530930657000,
"line_mean": 40.4195804196,
"line_max": 132,
"alpha_frac": 0.6296327564,
"autogenerate... |
__author__ = 'fahadadeel'
import jpype
class AddingLineShape:
def __init__(self, dataDir):
print "init func"
self.dataDir = dataDir
self.Presentation=jpype.JClass("com.aspose.slides.Presentation")
self.SaveFormat=jpype.JClass("com.aspose.slides.SaveFormat")
... | {
"repo_name": "asposeslides/Aspose_Slides_Java",
"path": "Plugins/Aspose-Slides-Java-for-Python/WorkingWithShapes/__init__.py",
"copies": "2",
"size": "16899",
"license": "mit",
"hash": -418978940197860030,
"line_mean": 35.8169934641,
"line_max": 110,
"alpha_frac": 0.6398011717,
"autogenerated": fa... |
__author__ = 'fahadadeel'
import jpype
class AddingWorksheetstoNewExcelFile:
def __init__(self,dataDir):
self.dataDir = dataDir
self.Workbook = jpype.JClass("com.aspose.cells.Workbook")
self.SaveFormat = jpype.JClass("com.aspose.cells.SaveFormat")
def main(self):
... | {
"repo_name": "fahadadeel/Aspose.Cells-for-Java",
"path": "Plugins/Aspose-Cells-Java-for-Python/WorkingWithWorksheets/__init__.py",
"copies": "3",
"size": "17360",
"license": "mit",
"hash": 7599067354554532000,
"line_mean": 30.2248201439,
"line_max": 93,
"alpha_frac": 0.6305299539,
"autogenerated":... |
__author__ = 'fahadadeel'
import jpype
class AddSmartArt:
def __init__(self, dataDir):
print "init func"
self.dataDir = dataDir
self.Presentation=jpype.JClass("com.aspose.slides.Presentation")
self.SaveFormat=jpype.JClass("com.aspose.slides.SaveFormat")
self.SmartArtLayoutT... | {
"repo_name": "asposeslides/Aspose_Slides_Java",
"path": "Plugins/Aspose-Slides-Java-for-Python/WorkingWithSmartArt/__init__.py",
"copies": "2",
"size": "2525",
"license": "mit",
"hash": -2189132712762897700,
"line_mean": 30.9746835443,
"line_max": 105,
"alpha_frac": 0.6605940594,
"autogenerated": ... |
__author__ = 'fahadadeel'
import jpype
class ChartToImage:
def __init__(self,dataDir):
self.dataDir = dataDir
self.Workbook = jpype.JClass("com.aspose.cells.Workbook")
self.ChartType = jpype.JClass("com.aspose.cells.ChartType")
self.ImageOrPrintOptions = jpype.JClass("com.aspose.c... | {
"repo_name": "fahadadeel/Aspose.Cells-for-Java",
"path": "Plugins/Aspose-Cells-Java-for-Python/WorkingWithFiles/__init__.py",
"copies": "3",
"size": "17186",
"license": "mit",
"hash": -8844298875229713000,
"line_mean": 33.7914979757,
"line_max": 98,
"alpha_frac": 0.6317351332,
"autogenerated": fal... |
__author__ = 'fahadadeel'
import jpype
class Converter:
def __init__(self,dataDir):
self.dataDir = dataDir
self.MailMessage = jpype.JClass("com.aspose.email.MailMessage")
self.SaveOptions = jpype.JClass("com.aspose.email.SaveOptions")
def main(self):
# Initialize and... | {
"repo_name": "asposeemail/Aspose_Email_Java",
"path": "Plugins/Aspose.Email Java for Python/ProgrammingEmail/__init__.py",
"copies": "4",
"size": "11006",
"license": "mit",
"hash": 6181654381649974000,
"line_mean": 34.8534201954,
"line_max": 101,
"alpha_frac": 0.6403779756,
"autogenerated": false,... |
__author__ = 'fahadadeel'
import jpype
class ConvertingToHtml:
def __init__(self, dataDir):
print "init func"
self.dataDir = dataDir
self.Presentation=jpype.JClass("com.aspose.slides.Presentation")
self.SaveFormat=jpype.JClass("com.aspose.slides.SaveFormat")
self.HtmlOption... | {
"repo_name": "asposeslides/Aspose_Slides_Java",
"path": "Plugins/Aspose-Slides-Java-for-Python/WorkingWithPresentation/__init__.py",
"copies": "2",
"size": "12829",
"license": "mit",
"hash": 3484839217266270700,
"line_mean": 32.3246753247,
"line_max": 88,
"alpha_frac": 0.6555460285,
"autogenerated... |
__author__ = 'fahadadeel'
import jpype
class CreateChart:
def __init__(self, dataDir):
print "init func"
self.dataDir = dataDir
self.Presentation=jpype.JClass("com.aspose.slides.Presentation")
self.ChartType=jpype.JClass("com.aspose.slides.ChartType")
self.NullableBool=jpyp... | {
"repo_name": "aspose-slides/Aspose.Slides-for-Java",
"path": "Plugins/Aspose-Slides-Java-for-Python/WorkingWithCharts/__init__.py",
"copies": "2",
"size": "43206",
"license": "mit",
"hash": -3802602067215998000,
"line_mean": 42.5115810675,
"line_max": 152,
"alpha_frac": 0.6884229042,
"autogenerate... |
__author__ = 'fahadadeel'
import jpype
class CreateTextBox:
def __init__(self, dataDir):
print "init func"
self.dataDir = dataDir
self.Presentation=jpype.JClass("com.aspose.slides.Presentation")
self.SaveFormat=jpype.JClass("com.aspose.slides.SaveFormat")
self.ShapeType... | {
"repo_name": "aspose-slides/Aspose.Slides-for-Java",
"path": "Plugins/Aspose-Slides-Java-for-Python/WorkingWithText/__init__.py",
"copies": "2",
"size": "18796",
"license": "mit",
"hash": -8696708804849990000,
"line_mean": 35.712890625,
"line_max": 122,
"alpha_frac": 0.6540221324,
"autogenerated":... |
__author__ = 'fahadadeel'
import jpype
class HelloWorld:
def __init__(self, dataDir):
print "init func"
self.dataDir = dataDir
self.Presentation=jpype.JClass("com.aspose.slides.Presentation")
self.ShapeType=jpype.JClass("com.aspose.slides.ShapeType")
self.FillType=jpype.JCl... | {
"repo_name": "asposeslides/Aspose_Slides_Java",
"path": "Plugins/Aspose-Slides-Java-for-Python/IntroductionToPresentation/__init__.py",
"copies": "2",
"size": "1829",
"license": "mit",
"hash": 8127689505833694000,
"line_mean": 37.9361702128,
"line_max": 158,
"alpha_frac": 0.6659376709,
"autogenera... |
__author__ = 'fahadadeel'
import jpype
class HelloWorld:
def __init__(self, dataDir):
self.dataDir = dataDir
def main(self):
"""
: The path to the documents directory. :
"""
Document = jpype.JClass("com.aspose.words.Document")
DocumentBuilder = jpype.JCla... | {
"repo_name": "aspose-words/Aspose.Words-for-Java",
"path": "Plugins/Aspose_Words_Java_for_Python/quickstart/__init__.py",
"copies": "2",
"size": "7795",
"license": "mit",
"hash": -1576453970862353000,
"line_mean": 34.7568807339,
"line_max": 132,
"alpha_frac": 0.6638871071,
"autogenerated": false,
... |
__author__ = 'fahadadeel'
import jpype
class MailMergeFormFields:
def __init__(self,dataDir):
self.dataDir = dataDir
self.Document = jpype.JClass("com.aspose.words.Document")
def main(self):
# Load the template document.
doc = self.Document(self.dataDir + "Template.doc")
... | {
"repo_name": "asposewords/Aspose_Words_Java",
"path": "Plugins/Aspose_Words_Java_for_Python/mailmergeandreporting/__init__.py",
"copies": "5",
"size": "2496",
"license": "mit",
"hash": 504970321531503900,
"line_mean": 33.1917808219,
"line_max": 114,
"alpha_frac": 0.6330128205,
"autogenerated": fal... |
__author__ = 'fahadadeel'
import jpype
class RowsAndColumns:
def __init__(self,dataDir):
self.dataDir = dataDir
self.Workbook = jpype.JClass("com.aspose.cells.Workbook")
def main(self):
# Inserting a Row
self.insert_row()
# Inserting Multiple Rows
... | {
"repo_name": "aspose-cells/Aspose.Cells-for-Java",
"path": "Plugins/Aspose-Cells-Java-for-Python/WorkingWithRowsAndColumns/__init__.py",
"copies": "3",
"size": "12197",
"license": "mit",
"hash": -4585820294568626000,
"line_mean": 29.725440806,
"line_max": 133,
"alpha_frac": 0.6384356809,
"autogene... |
__author__ = 'fahadadeel'
import jpype
class ConcatenatePdfFiles:
def __init__(self, dataDir):
self.dataDir = dataDir
self.Document = jpype.JClass("com.aspose.pdf.Document")
def main(self):
doc= self.Document()
pdf = self.Document()
pdf=self.dataDir + 'input1... | {
"repo_name": "aspose-pdf/Aspose.Pdf-for-Java",
"path": "Plugins/Aspose_Pdf_Java_for_Python/WorkingWithPages/__init__.py",
"copies": "1",
"size": "7869",
"license": "mit",
"hash": -5191099510250690000,
"line_mean": 37.1492537313,
"line_max": 312,
"alpha_frac": 0.5662727157,
"autogenerated": false,
... |
__author__ = 'fahadadeel'
import jpype
class AddHtml:
def __init__(self, dataDir):
print "init func"
self.dataDir = dataDir
self.Document = jpype.JClass("com.aspose.pdf.Document")
self.HtmlFragment=jpype.JClass("com.aspose.pdf.HtmlFragment")
self.MarginInfo=jpype.... | {
"repo_name": "aspose-pdf/Aspose.Pdf-for-Java",
"path": "Plugins/Aspose_Pdf_Java_for_Python/WorkingWithText/__init__.py",
"copies": "1",
"size": "5236",
"license": "mit",
"hash": -4319196974659084000,
"line_mean": 34.6293706294,
"line_max": 148,
"alpha_frac": 0.6208938121,
"autogenerated": false,
... |
__author__ = 'fahadadeel'
import jpype
class PdfToDoc:
def __init__(self, dataDir):
print "init func"
self.dataDir = dataDir
self.Document = jpype.JClass("com.aspose.pdf.Document")
def main(self):
doc= self.Document()
pdf = self.Document()
pdf... | {
"repo_name": "aspose-pdf/Aspose.Pdf-for-Java",
"path": "Plugins/Aspose_Pdf_Java_for_Python/WorkingWithDocumentConversion/__init__.py",
"copies": "1",
"size": "2965",
"license": "mit",
"hash": 851071295541080800,
"line_mean": 28.2551020408,
"line_max": 77,
"alpha_frac": 0.5959527825,
"autogenerated... |
__author__ = 'Fahim and Sajid'
from math import *
from random import *
from pygame import *
size = width, height = 1200, 800
screen = display.set_mode(size)
myClock = time.Clock()
font.init()
mixer.init()
def splitter(pic, row, col):
x, y = pic.get_size()
xsplit = int(x / col)
ysplit = int(y / row)
... | {
"repo_name": "XxHundredShellsxX/zelda-game",
"path": "src/Main.py",
"copies": "1",
"size": "126443",
"license": "mit",
"hash": -7997626833867842000,
"line_mean": 39.4488163788,
"line_max": 172,
"alpha_frac": 0.4663603363,
"autogenerated": false,
"ratio": 3.7230728461221365,
"config_test": fals... |
__author__ = 'Fahim and Sajid'
from pygame import *
from math import *
from random import*
size = width, height = 1200, 800
screen = display.set_mode(size)
myClock = time.Clock()
font.init()
def splitter(pic, row, col):
x, y = pic.get_size()
xsplit = int(x / col)
ysplit = int(y / row)
images = []
... | {
"repo_name": "XxHundredShellsxX/zelda-game",
"path": "src/test.py",
"copies": "1",
"size": "118286",
"license": "mit",
"hash": 7198972390304665000,
"line_mean": 37.3423014587,
"line_max": 308,
"alpha_frac": 0.4725073128,
"autogenerated": false,
"ratio": 3.5778107135295363,
"config_test": false... |
__author__ = 'faner'
def check_callable(target):
if not (target and callable(target)):
raise TypeError('target is not callable!')
class PromiseRunner(object):
def __init__(self, promiseObj, run):
self._promiseObj = promiseObj
from threading import Thread
def _run_wrap():
... | {
"repo_name": "faner-father/pypromise",
"path": "promise/api.py",
"copies": "1",
"size": "1735",
"license": "mit",
"hash": -5522657514075819000,
"line_mean": 23.8,
"line_max": 55,
"alpha_frac": 0.5936599424,
"autogenerated": false,
"ratio": 4.101654846335697,
"config_test": false,
"has_no_key... |
__author__ = 'Fang'
import datetime
import utilities as util
import math
WAY_DATA = "ways_dict"
INER_DATA_DIR = "Intermediate"
LOG_FILE = "Logs/Create_gids.log"
STEP = 0.02
def get_geo_range():
min_lat = min_lon = 1000000
max_lat = max_lon = -1000000
for item in ways_dirt.values():
for node in it... | {
"repo_name": "NeowithU/Trajectory",
"path": "Create_Grids.py",
"copies": "1",
"size": "3782",
"license": "mit",
"hash": 8420309790808045000,
"line_mean": 36.0882352941,
"line_max": 169,
"alpha_frac": 0.5563194077,
"autogenerated": false,
"ratio": 2.7808823529411764,
"config_test": false,
"ha... |
__author__ = 'Fang'
import json
import os
import datetime
import utilities as util
INIT_DATA_DIR = "Raw"
NODE_DATA = "3n.json"
WAY_DATA = "3w.json"
INER_DATA_DIR = "Intermediate"
GEO_RANGE = '116.318,27.147,122.481,35.178'
LOG_FILE = "Logs/Prepare_ways.log"
def get_nodes():
os.chdir(INER_DATA_DIR)
if not os.... | {
"repo_name": "NeowithU/Trajectory",
"path": "Prepare_Ways.py",
"copies": "1",
"size": "2934",
"license": "mit",
"hash": 8445864520978537000,
"line_mean": 32.3409090909,
"line_max": 102,
"alpha_frac": 0.5596455351,
"autogenerated": false,
"ratio": 2.9847405900305186,
"config_test": false,
"ha... |
__author__ = 'Fang'
import os
import math
import json
import datetime
import utilities as util
INIT_DATA_DIR = "Raw"
RAW_NODE_DATA = "3n.json"
RAW_WAY_DATA = "3w.json"
INER_DATA_DIR = "Intermediate"
GEO_RANGE = '116.318,27.147,122.481,35.178'
LOG_FILE = "Logs/PreProcess.log"
WAY_DATA = "ways_dict"
STEP = 0.02
class ... | {
"repo_name": "NeowithU/Trajectory",
"path": "Outdated/PreProcess.py",
"copies": "1",
"size": "5448",
"license": "mit",
"hash": -4385657036776436700,
"line_mean": 36.8402777778,
"line_max": 173,
"alpha_frac": 0.5058737151,
"autogenerated": false,
"ratio": 3.174825174825175,
"config_test": false... |
__author__ = 'Fang'
import sys
import urllib
doc_path = sys.argv[1]
result_path = sys.argv[2]
# doc_path ="/Users/Fang/Documents/Bioinformatics/test/test_shell/filelist.txt"
# result_path="/Users/Fang/Documents/Bioinformatics/test/test_shell/result.txt"
infile = file(doc_path)
output_file = file(result_path, "w+")
wh... | {
"repo_name": "zhangfang615/Tuberculosis",
"path": "scripts/FileDownload.py",
"copies": "1",
"size": "1193",
"license": "apache-2.0",
"hash": 8453231441592695000,
"line_mean": 36.28125,
"line_max": 101,
"alpha_frac": 0.6512992456,
"autogenerated": false,
"ratio": 2.945679012345679,
"config_test... |
__author__ = 'Fang'
__date__= '2016.6.18'
__email__= 'fza34@sfu.ca'
__function__ = 'Tuberculosis simulation'
import random
import copy
class patient:
def __init__(self):
self.removal = False
self.resistant = False
self.eventlist = []
self.mutation = {}
self.... | {
"repo_name": "zhangfang615/Tuberculosis",
"path": "TB_simulation.py",
"copies": "1",
"size": "12646",
"license": "apache-2.0",
"hash": -5653783979102127000,
"line_mean": 44.1605839416,
"line_max": 218,
"alpha_frac": 0.6315040329,
"autogenerated": false,
"ratio": 3.46181220914317,
"config_test"... |
__author__ = 'Fang Zhang'
__date__= '2016.5.3'
__email__= 'fza34@sfu.ca'
__function__ = 'check snp in reference'
import linecache
import sys
reference_path = sys.argv[1]
# reference_path = "/Users/Fang/Documents/Bioinformatics/test/polyTB_new/reference/H37Rv_AL123456.3.fasta"
SNP_vcf_path = sys.argv[2]
# SNP_vcf_path... | {
"repo_name": "zhangfang615/Tuberculosis",
"path": "scripts/checkSNP.py",
"copies": "1",
"size": "1293",
"license": "apache-2.0",
"hash": -8702013728996646000,
"line_mean": 32.1538461538,
"line_max": 127,
"alpha_frac": 0.6272235112,
"autogenerated": false,
"ratio": 2.9930555555555554,
"config_t... |
__author__ = 'FarhanKhwaja'
from datetime import datetime
import pandas as pd
from sklearn.externals import joblib
import FeatureEngineering
import numpy as np
if __name__ == '__main__':
start = datetime.now()
print('Start time : ',start)
train = pd.read_csv("InputFiles/train.csv", chunksize = 5000000, iter... | {
"repo_name": "farhankhwaja/INF550",
"path": "SourceCode/SGDClassifier/FeaturesUniqueness.py",
"copies": "1",
"size": "1307",
"license": "apache-2.0",
"hash": 7761364846314269000,
"line_mean": 35.3333333333,
"line_max": 171,
"alpha_frac": 0.596786534,
"autogenerated": false,
"ratio": 3.5134408602... |
__author__ = 'FarhanKhwaja'
import pandas as pd
import numpy as np
from datetime import datetime
from sklearn.linear_model import SGDClassifier
from sklearn.feature_extraction import FeatureHasher
from sklearn.cross_validation import StratifiedKFold
from sklearn.metrics import roc_curve,auc
import matplotlib.pyplot as... | {
"repo_name": "farhankhwaja/INF550",
"path": "SourceCode/SGDClassifier/ROC_SGD.py",
"copies": "1",
"size": "1715",
"license": "apache-2.0",
"hash": -4278159707481584000,
"line_mean": 31.3773584906,
"line_max": 111,
"alpha_frac": 0.67696793,
"autogenerated": false,
"ratio": 3.0845323741007196,
"... |
__author__ = 'FarhanKhwaja'
import pandas as pd
import numpy as np
from datetime import datetime
from sklearn.linear_model import SGDClassifier
import FeatureEngineering
if __name__ == '__main__':
start = datetime.now()
fe = FeatureEngineering.FeatureEngineering()
# Train classifier
clf = SGDClass... | {
"repo_name": "farhankhwaja/INF550",
"path": "SourceCode/SGDClassifier/FeatureHasher_SGD.py",
"copies": "1",
"size": "1344",
"license": "apache-2.0",
"hash": 5701406197032033000,
"line_mean": 28.2173913043,
"line_max": 85,
"alpha_frac": 0.609375,
"autogenerated": false,
"ratio": 3.334987593052109... |
__author__ = 'FarhanKhwaja'
import pandas as pd
import numpy as np
from sklearn.feature_extraction import FeatureHasher
from sklearn.pipeline import Pipeline
from datetime import datetime, date, time
class FeatureEngineering:
def __int__(self):
self.y_train = []
self.X_train = []
# add two ... | {
"repo_name": "farhankhwaja/INF550",
"path": "SourceCode/SGDClassifier/FeatureEngineering.py",
"copies": "1",
"size": "4080",
"license": "apache-2.0",
"hash": 7927671263198510000,
"line_mean": 50,
"line_max": 189,
"alpha_frac": 0.6259803922,
"autogenerated": false,
"ratio": 3.311688311688312,
"... |
__author__ = "Fariz Rahman"
import numpy as np
from .game import Game
actions = {0:'left', 1:'right', 2:'up', 3:'down', 4:'idle'}
forbidden_moves = [(0, 1), (1, 0), (2, 3), (3, 2)]
class Snake(Game):
def __init__(self, grid_size=10, snake_length=3):
self.grid_size = grid_size
self.snake_length ... | {
"repo_name": "bhillmann/2048-rl",
"path": "qlearning4k/games/snake.py",
"copies": "1",
"size": "3898",
"license": "mit",
"hash": -3091059074357047300,
"line_mean": 26.6453900709,
"line_max": 89,
"alpha_frac": 0.4910210364,
"autogenerated": false,
"ratio": 3.3174468085106383,
"config_test": fal... |
__author__ = 'farrukh'
from pymote import *
from numpy import sign, sqrt, array, pi, sin, cos
from numpy.random import rand
tests = 1
class Toplogy(NetworkGenerator):
def generate_star_ehwsn_network(self, center=None, x_radius=100, y_radius=100, sector=1.0, clusters=1, is_random=0):
"""
Generate... | {
"repo_name": "farrukhshahzad/JS-NetSim",
"path": "Python code/toplogies.py",
"copies": "3",
"size": "10182",
"license": "mit",
"hash": -1614564170158406000,
"line_mean": 38.4651162791,
"line_max": 120,
"alpha_frac": 0.487821646,
"autogenerated": false,
"ratio": 3.635130310603356,
"config_test"... |
__author__ = 'fatcloud'
import cv2
import numpy as np
from cam import MyCam
class MotionDetector(object):
def __init__(self, N=1, shape=(480,640,3)):
self._N = N
self._frame = [None] * (2 * N + 1)
self._index = 0
for i in range(2 * N + 1):
self._frame[i] = np.full(sha... | {
"repo_name": "ironbox360/PyCV-time",
"path": "experiments/differential_screen_tracker/motion_detect.py",
"copies": "3",
"size": "1407",
"license": "mit",
"hash": 8272246806430037000,
"line_mean": 23.6842105263,
"line_max": 57,
"alpha_frac": 0.5053304904,
"autogenerated": false,
"ratio": 3.065359... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.