text
stringlengths
0
1.05M
meta
dict
__author__ = 'Renato' from time import sleep from ctypes import * user32 = windll.user32 from input_structures import * import hardware_scan_code as sc import virtual_key_code as vk def mouse_event(): print('Mouse Event not implemented yet...') def hardware_event(): print('Hardware event not implem...
{ "repo_name": "pastahito/PyStrokes", "path": "pkghito/combo/pressreleasev1.py", "copies": "1", "size": "1722", "license": "mit", "hash": 299257257776584060, "line_mean": 26.3492063492, "line_max": 92, "alpha_frac": 0.662601626, "autogenerated": false, "ratio": 2.9947826086956524, "config_test":...
__author__ = 'Renato' from time import sleep from input_structures import * # Here ctypes is imported implicitly and user32 is bound to windll.user32 from pyctionary import arrows, numbers, letters def mouse_event(): print('Mouse Event not implemented yet...') def hardware_event(): print('Hardware event n...
{ "repo_name": "pastahito/PyStrokes", "path": "pkghito/combo/pressrelease.py", "copies": "1", "size": "1874", "license": "mit", "hash": -5934570602935164000, "line_mean": 22.1358024691, "line_max": 115, "alpha_frac": 0.6478121665, "autogenerated": false, "ratio": 3.077175697865353, "config_test"...
__author__ = 'Renato' from time import sleep from pressreleasev2 import press_release, press, release from Hook3v2 import execute # print("3:", hex(17179869235), hex(17179869235>>32), hex(17179869235%256)) # print("Q:", hex(68719476817), hex(68719476817>>32), hex(68719476817%256)) # print("W:", hex(73014444119), hex...
{ "repo_name": "pastahito/PyStrokes", "path": "pkghito/Zen.py", "copies": "1", "size": "2776", "license": "mit", "hash": 3102738032388085000, "line_mean": 24.2363636364, "line_max": 104, "alpha_frac": 0.5536743516, "autogenerated": false, "ratio": 2.8530318602261047, "config_test": false, "has...
__author__ = 'Renato' VK_LBUTTON = 0x01 # Left mouse button VK_RBUTTON = 0x02 # Right mouse button VK_CANCEL = 0x03 # Control-break processing VK_MBUTTON = 0x04 # Middle mouse button (three-button mouse) VK_XBUTTON1 = 0x05 # X1 mouse button VK_XBUTTON2 = 0x06 # X2 mouse button # 0x07 Undefined VK_BACK = 0x08 # BA...
{ "repo_name": "pastahito/PyStrokes", "path": "pkghito/const/virtual_key_code.py", "copies": "1", "size": "6436", "license": "mit", "hash": 3954926452961271000, "line_mean": 32.5260416667, "line_max": 267, "alpha_frac": 0.6472964574, "autogenerated": false, "ratio": 2.3801775147928996, "config_t...
__author__ = 'Renato' __project__ = 'cuarentadefiebre' __date__ = '21/02/2015' from ctypes import * from KeyboardHook import KeyboardHook import win32con user32 = windll.user32 keyboardHook = KeyboardHook() ################################################## # returns a function pointer to the fn paramater # # assume...
{ "repo_name": "pastahito/PyStrokes", "path": "pkghito/KeyboardHookTest1.py", "copies": "1", "size": "1244", "license": "mit", "hash": 8985170113692454000, "line_mean": 34.5428571429, "line_max": 121, "alpha_frac": 0.6125401929, "autogenerated": false, "ratio": 3.6588235294117646, "config_test":...
__author__ = 'Renato' __project__ = 'cuarentadefiebre' __date__ = '21/02/2015' from ctypes import * import win32con import win32api import win32gui class KeyboardHook: """ Written by: TwhK / Kheldar What do? Installs a global keyboard hook To install the hook, call the (gasp!) installHook() function...
{ "repo_name": "pastahito/PyStrokes", "path": "pkghito/KeyboardHook.py", "copies": "1", "size": "1924", "license": "mit", "hash": -8696842790423289000, "line_mean": 31.0833333333, "line_max": 90, "alpha_frac": 0.6216216216, "autogenerated": false, "ratio": 4.059071729957806, "config_test": false...
__author__ = 'rencui' from afinn import Afinn import numpy import json from textstat.textstat import textstat from nltk.stem.porter import * from tokenizer import simpleTokenize import logging from scipy.sparse import csr_matrix import matplotlib.pyplot as plt import matplotlib as mat from sklearn.ensemble import Extra...
{ "repo_name": "renhaocui/tweetInfluencer", "path": "featureAnalyzer.py", "copies": "2", "size": "7156", "license": "mit", "hash": -2500986423443976700, "line_mean": 27.624, "line_max": 188, "alpha_frac": 0.6447736165, "autogenerated": false, "ratio": 3.2645985401459856, "config_test": false, ...
__author__ = 'rencui' from collections import OrderedDict import math from nltk.corpus import stopwords stopwordList = stopwords.words('english') posTweetFile = open('adData/analysis/ranked/NERoutput.pos', 'r') negTweetFile = open('adData/analysis/ranked/NERoutput.neg', 'r') posTokenFile = open('adData/analysis/ranked...
{ "repo_name": "renhaocui/tweetInfluencer", "path": "tweetAnalyzer.py", "copies": "2", "size": "1543", "license": "mit", "hash": -6524856584037376000, "line_mean": 28.1320754717, "line_max": 89, "alpha_frac": 0.680492547, "autogenerated": false, "ratio": 3.129817444219067, "config_test": false, ...
__author__ = 'rencui' from utilities import tokenizer def lcsLen(a, b): table = [[0] * (len(b) + 1) for _ in xrange(len(a) + 1)] for i, ca in enumerate(a, 1): for j, cb in enumerate(b, 1): table[i][j] = ( table[i - 1][j - 1] + 1 if ca == cb else max(table[i]...
{ "repo_name": "renhaocui/activityExtractor", "path": "duplicate_remover.py", "copies": "1", "size": "2631", "license": "mit", "hash": -8846945236357656000, "line_mean": 32.7435897436, "line_max": 71, "alpha_frac": 0.4104903079, "autogenerated": false, "ratio": 4.278048780487805, "config_test": ...
__author__ = 'rencui' import json import twitter import time from sets import Set import os logFile = open('log', 'w') brandList = [] listFile = open('brand.list', 'r') for line in listFile: brandList.append(line.strip()) listFile.close() for brand in brandList: if not os.path.isdir('adData//' + brand): ...
{ "repo_name": "renhaocui/adPlatform", "path": "adTweetTracker.py", "copies": "2", "size": "2817", "license": "mit", "hash": 7691490317504673000, "line_mean": 30.3, "line_max": 136, "alpha_frac": 0.5750798722, "autogenerated": false, "ratio": 3.3535714285714286, "config_test": false, "has_no_k...
__author__ = 'rencui' import json import twitter import time from sets import Set brandList = ['amazon', 'dominos', 'Gap', 'Jeep', 'AppStore', 'Chilis', 'Colgate', 'Motorola', 'AmericanExpress', 'Microsoft'] logFile = open('log', 'w') c_k = 'NNFnQv3zyeM99IDXg1IOrtMcQ' c_s = 'GDc4vZtorwOiPgDNiaGrWDTWfqKN...
{ "repo_name": "renhaocui/adPlatform", "path": "tweetTracker.py", "copies": "2", "size": "2161", "license": "mit", "hash": -5605170936854547000, "line_mean": 30.3333333333, "line_max": 112, "alpha_frac": 0.5816751504, "autogenerated": false, "ratio": 3.3144171779141103, "config_test": false, "...
__author__ = 'rencui' import json def blend(fileSize, offset): print 'blending tweets...' brandList = [] listFile = open('brand.list', 'r') for line in listFile: brandList.append(line.strip()) listFile.close() combinedOutFile = open('dataset/ConsolidatedTweets/total.json', 'w') to...
{ "repo_name": "renhaocui/tweetInfluencer", "path": "tweetBlender.py", "copies": "2", "size": "4166", "license": "mit", "hash": -1681307062268366000, "line_mean": 49.8048780488, "line_max": 157, "alpha_frac": 0.4954392703, "autogenerated": false, "ratio": 4.353187042842215, "config_test": false,...
__author__ = 'rencui' import numpy import json from textstat.textstat import textstat import utilities from sklearn.feature_extraction.text import * from sklearn import svm from tokenizer import simpleTokenize import logging from scipy.sparse import hstack, csr_matrix from sklearn.externals import joblib import pickle ...
{ "repo_name": "renhaocui/adPlatform", "path": "modelUtility.py", "copies": "2", "size": "20933", "license": "mit", "hash": 3395404150406915000, "line_mean": 34.9073756432, "line_max": 146, "alpha_frac": 0.6195958534, "autogenerated": false, "ratio": 3.6912361135602185, "config_test": true, "h...
__author__ = 'rencui' import statistics as stat def hourMapper(hour): input = int(hour) if 0 <= input < 6: output = 0 elif 6 <= input < 12: output = 1 elif 12 <= input < 18: output = 2 else: output = 3 return output def analyzer(groupSize, groupTitle): # t...
{ "repo_name": "renhaocui/tweetInfluencer", "path": "groupAnalysis.py", "copies": "2", "size": "9448", "license": "mit", "hash": -1103076897976951800, "line_mean": 41.7556561086, "line_max": 108, "alpha_frac": 0.5764182896, "autogenerated": false, "ratio": 3.6791277258566977, "config_test": fals...
__author__ = 'rencui' def contenter(indexList): print 'generating content....' for group in indexList: totalRankedFile1 = open('adData/analysis/ranked/1/topic'+str(group)+'.pos', 'r') totalRankedFile2 = open('adData/analysis/ranked/2/topic'+str(group)+'.neg', 'r') outputFile1 = open('ad...
{ "repo_name": "renhaocui/adPlatform", "path": "contenter.py", "copies": "2", "size": "1583", "license": "mit", "hash": -7848430473923913000, "line_mean": 33.4347826087, "line_max": 96, "alpha_frac": 0.6272899558, "autogenerated": false, "ratio": 3.3538135593220337, "config_test": false, "has_...
__author__ = 'rencui' from nltk.corpus import wordnet as wn from tokenizer import simpleTokenize import string def genSyn(word): outputList = [] syns = wn.synsets('huge') for item in syns: for token in item.lemmas(): name = token.name() if name != word: outp...
{ "repo_name": "renhaocui/ensembleTopic", "path": "crossRef.py", "copies": "1", "size": "1442", "license": "mit", "hash": -552496044701658050, "line_mean": 27.2745098039, "line_max": 60, "alpha_frac": 0.6047156727, "autogenerated": false, "ratio": 3.337962962962963, "config_test": false, "has_...
__author__ = 'renderle' import logging import json import restcall from openweather.OpenWeatherParser import OpenWeatherParser def __evaluateTemp(temp): base = 15 if temp < 0: # seems to be very cold # we add the negative temp to base -> return value will be lower than base return ba...
{ "repo_name": "ralfe/wpi", "path": "src/openweather/openweather.py", "copies": "1", "size": "4927", "license": "mit", "hash": -2988650237101780500, "line_mean": 29.4135802469, "line_max": 109, "alpha_frac": 0.5384615385, "autogenerated": false, "ratio": 3.2824783477681545, "config_test": false,...
__author__ = 'rene_esteves' class exam_01: def somadig(self, input): if input < 0: #base case return int(self.somadig(self, -input)) if input == 0: #base case return 0 return input%10 + int(self.somadig(self, input/10)) exam_01.somadig(exam_01, 10000); ##########...
{ "repo_name": "renestvs/data_structure_project", "path": "data_structure/exam/exam_01.py", "copies": "1", "size": "2853", "license": "mit", "hash": -7563423156025508000, "line_mean": 21.4645669291, "line_max": 90, "alpha_frac": 0.3473536628, "autogenerated": false, "ratio": 3.579673776662484, "...
__author__ = 'rene_esteves' def factorial(input): if input < 1: # base case return 1 else: return input * factorial(input - 1) # recursive call def sum(input): if input == 1: # base_case return 1 else: return input + sum(input - 1) # recursive call def fibonacci...
{ "repo_name": "renestvs/data_structure_project", "path": "data_structure/first_bim/class_02.py", "copies": "1", "size": "5443", "license": "mit", "hash": -7041359791366177000, "line_mean": 24.3162790698, "line_max": 100, "alpha_frac": 0.551166636, "autogenerated": false, "ratio": 3.54592833876221...
__author__ = 'rene_' def descrente(n): print(n) if n == 0: #base case return 0 return descrente(n-1) #recursive call def crescente(n): if n == 0: return print (n) crescente(n-1) return print(n) # def descre(n): # print (n) # if n == 0: # return print(n) # d...
{ "repo_name": "renestvs/data_structure_project", "path": "data_structure/first_bim/exercise.py", "copies": "1", "size": "2507", "license": "mit", "hash": 203619104344941440, "line_mean": 19.2177419355, "line_max": 58, "alpha_frac": 0.5125648185, "autogenerated": false, "ratio": 2.75192096597146, ...
__author__ = 'rene_' from django.test import TestCase from data_structure.second_bim import graphs, pattern_searching, dynamic_programing class Second_Bim_Test(TestCase): # ============================================== # ================= patterns =================== # =============================================...
{ "repo_name": "renestvs/data_structure_project", "path": "data_structure/test/second_bim_test.py", "copies": "1", "size": "10162", "license": "mit", "hash": -2515672002104182300, "line_mean": 34.7852112676, "line_max": 111, "alpha_frac": 0.3515056091, "autogenerated": false, "ratio": 3.3165796344...
__author__ = 'renhao.cui' from scipy import stats import json from datetime import datetime import tweetTextCleaner import sys reload(sys) sys.setdefaultencoding('utf8') filterTerms = ['iphone 7', 'pikachu', 'pokemon go', 'macbook pro'] def outlierExtractor(): print 'extracting outliers...' brandList = [] ...
{ "repo_name": "renhaocui/tweetInfluencer", "path": "dataLabeler.py", "copies": "2", "size": "9812", "license": "mit", "hash": -5098807560071772000, "line_mean": 45.0657276995, "line_max": 196, "alpha_frac": 0.5368935997, "autogenerated": false, "ratio": 3.8828650573802928, "config_test": false,...
__author__ = 'renhao.cui' from sklearn import cross_validation import os import shutil import glob import subprocess import readable_infer as ri import modelUtility import sys def modifyFiles(fileName): file = open(fileName, 'r') fileContent = [] for line in file: fileContent.append(line.replace('L...
{ "repo_name": "renhaocui/ensembleTopic", "path": "LLDATopicModeling.py", "copies": "1", "size": "3628", "license": "mit", "hash": 5526030936372243000, "line_mean": 37.6063829787, "line_max": 151, "alpha_frac": 0.6507717751, "autogenerated": false, "ratio": 3.28921124206709, "config_test": true,...
__author__ = 'renhao.cui' import json import os import re from langdetect import detect puncList = ''' !()-[]{};:'"\,<>./?@#$%^&*_~''' def extractLinks(input): urls = re.findall("(?P<url>https?://[^\s]+)", input) if len(urls) != 0: for url in urls: input = input.replace(url, '<URL>') r...
{ "repo_name": "renhaocui/ensembleTopic", "path": "dataGenerator.py", "copies": "1", "size": "3386", "license": "mit", "hash": -3735844265939051000, "line_mean": 29.2410714286, "line_max": 85, "alpha_frac": 0.5005906675, "autogenerated": false, "ratio": 3.955607476635514, "config_test": false, ...
__author__ = 'renhao.cui' import json import statistics as stat inputFile = open('adData//total.tweet', 'r') favRatioFullList = [] favRetRatioFullList = [] list1=[] list2=[] favRatioList = [] favRetRatioList = [] followerLabelList = [] followerLabelFullList = [] listLabelList = [] listLabelFullList = [] friendLabelLi...
{ "repo_name": "renhaocui/adPlatform", "path": "labelStatGenerator.py", "copies": "2", "size": "3547", "license": "mit", "hash": -6662066167830334000, "line_mean": 32.4622641509, "line_max": 77, "alpha_frac": 0.7603608683, "autogenerated": false, "ratio": 3.3462264150943395, "config_test": false...
__author__ = 'renhao.cui' import operator from sklearn.ensemble import RandomForestClassifier, GradientBoostingClassifier, AdaBoostClassifier from sklearn import cross_validation from sklearn.feature_extraction.text import * import modelUtility import sys def normalization(scoreList): outputList = [] total = s...
{ "repo_name": "renhaocui/ensembleTopic", "path": "ensembleBaselines.py", "copies": "1", "size": "2327", "license": "mit", "hash": 3918214679644892000, "line_mean": 34.2727272727, "line_max": 151, "alpha_frac": 0.6506231199, "autogenerated": false, "ratio": 3.7232, "config_test": true, "has_no...
__author__ = 'renhao.cui' import operator import crossRef as cr import math def genFreq(corpus, data): corpusCount = {} for word in corpus: corpusCount[word] = 0.0 for uttr in data: for word in uttr: corpusCount[word] += 1 sorted_corpusCount = sorted(corpusCount.items(), key...
{ "repo_name": "renhaocui/ensembleTopic", "path": "utilities.py", "copies": "1", "size": "15809", "license": "mit", "hash": -2015798510082563800, "line_mean": 33.5174672489, "line_max": 107, "alpha_frac": 0.5550635714, "autogenerated": false, "ratio": 3.865281173594132, "config_test": true, "h...
__author__ = 'renhao.cui' import re import numpy as np import json def POSRatio(inputList): out = [] temp = [] for item in inputList: temp.append(float(item)) if sum(temp) == 0: out = [0.0, 0.0, 0.0] else: for item in temp: out.append(item/sum(temp)) return ...
{ "repo_name": "renhaocui/adPlatform", "path": "utilities.py", "copies": "2", "size": "2769", "license": "mit", "hash": 7620709621656766000, "line_mean": 26.4158415842, "line_max": 99, "alpha_frac": 0.5864933189, "autogenerated": false, "ratio": 3.336144578313253, "config_test": false, "has_no...
__author__ = 'renhao.cui' import time import json import twitter import os import properties def oauth_login(): # credentials for OAuth CONSUMER_KEY = properties.twitter_cred['c_k'] CONSUMER_SECRET = properties.twitter_cred['c_s'] OAUTH_TOKEN = properties.twitter_cred['a_t'] OAUTH_TOKEN_SECRET = p...
{ "repo_name": "renhaocui/activityExtractor", "path": "collector/placeTweetCollector.py", "copies": "1", "size": "5713", "license": "mit", "hash": 8405248559508126000, "line_mean": 39.5177304965, "line_max": 199, "alpha_frac": 0.4901102748, "autogenerated": false, "ratio": 4.2007352941176475, "c...
__author__ = 'renhao.cui' import time import json import twitter import properties def oauth_login(): # credentials for OAuth CONSUMER_KEY = properties.twitter_cred['c_k'] CONSUMER_SECRET = properties.twitter_cred['c_s'] OAUTH_TOKEN = properties.twitter_cred['a_t'] OAUTH_TOKEN_SECRET = properties....
{ "repo_name": "renhaocui/activityExtractor", "path": "collector/followerCollecter.py", "copies": "1", "size": "3054", "license": "mit", "hash": -3301222435686479400, "line_mean": 39.1842105263, "line_max": 149, "alpha_frac": 0.4911591356, "autogenerated": false, "ratio": 4.5787106446776615, "co...
__author__ = 'renhao.cui' import time import json import twitter import requests import properties def oauth_login(): # credentials for OAuth CONSUMER_KEY = properties.twitter_cred['c_k'] CONSUMER_SECRET = properties.twitter_cred['c_s'] OAUTH_TOKEN = properties.twitter_cred['a_t'] OAUTH_TOKEN_SECR...
{ "repo_name": "renhaocui/activityExtractor", "path": "collector/placeCollector.py", "copies": "1", "size": "8299", "license": "mit", "hash": 8882476855936934000, "line_mean": 39.881773399, "line_max": 195, "alpha_frac": 0.474033016, "autogenerated": false, "ratio": 4.2690329218107, "config_test...
__author__ = 'renhao.cui' import time from TwitterSearch import * recordFile = open("tweetData//SpeedStick", 'a') c_k = 'NNFnQv3zyeM99IDXg1IOrtMcQ' c_s = 'GDc4vZtorwOiPgDNiaGrWDTWfqKNW2ZzMOTUkpJuF7gLdBCLZI' a_t = '141612471-AnWgHssHt5rtOhlC8Cmy6GwEge9Z81v8MHQw6nXr' a_t_s = 'gNE1nOhhc5CJoinMR6eUuyYBLR8YT3wK0tRb4yTUAY...
{ "repo_name": "renhaocui/ensembleTopic", "path": "extractTweet.py", "copies": "1", "size": "1460", "license": "mit", "hash": -5779153065095448000, "line_mean": 38.4864864865, "line_max": 118, "alpha_frac": 0.6376712329, "autogenerated": false, "ratio": 2.8076923076923075, "config_test": false, ...
__author__ = 'renhao.cui' def longestLength(input): outputLength = 0 for key, value in input.items(): length = 0 if value != '-1' and value != '_': length += 1 if value == '0': if length > outputLength: outputLength = length ...
{ "repo_name": "renhaocui/adPlatform", "path": "parserExtractor.py", "copies": "2", "size": "4115", "license": "mit", "hash": -6558275372185734000, "line_mean": 35.4159292035, "line_max": 140, "alpha_frac": 0.520291616, "autogenerated": false, "ratio": 3.5352233676975944, "config_test": false, ...
""" SCU is a module that wraps the findscu and movescu commands, which are part of DCMTK. Usage involves the instantiation of an SCU object, which maintains knowledge of the caller and callee (data requester and data source, respectively). Specific Query objects are constructed (e.g., SeriesQuery, if you intend to s...
{ "repo_name": "scitran/reaper", "path": "reaper/scu.py", "copies": "1", "size": "6536", "license": "mit", "hash": -7283210400278798000, "line_mean": 31.8442211055, "line_max": 127, "alpha_frac": 0.5947062424, "autogenerated": false, "ratio": 3.5521739130434784, "config_test": false, "has_no_k...
__author__ = 'rensholmer' from gff import Gff from gffsubpart import GffSubPart,TranslateError from itertools import groupby import uuid import re class Parser(object): """ Parser object gff3 formatted annotation files. The parse() method return the processed Gff object. Has several methods for known incorrectly ...
{ "repo_name": "holmrenser/gff_toolkit", "path": "gff_toolkit/parser.py", "copies": "1", "size": "12368", "license": "mit", "hash": -593923268348445700, "line_mean": 33.4512534819, "line_max": 135, "alpha_frac": 0.6697121604, "autogenerated": false, "ratio": 2.9773712084737602, "config_test": fa...
__author__ = 'rensholmer' from gffsubpart import GffSubPart from itertools import groupby #groupby for fasta parsing import pprint from intervaltree import IntervalTree, Interval class Gff(object): """ Work in progess: holds GffSubParts object """ _combos = [{'gene':{'mRNA':['CDS','exon','five_prime_UTR','three_p...
{ "repo_name": "holmrenser/gff_toolkit", "path": "gff_toolkit/gff.py", "copies": "1", "size": "17582", "license": "mit", "hash": 7307567065455138000, "line_mean": 30.3964285714, "line_max": 162, "alpha_frac": 0.662780116, "autogenerated": false, "ratio": 3.004956417706375, "config_test": false, ...
__author__ = 'rensholmer' import re import pprint class TranslateError(Exception): pass class SeqError(Exception): pass class CoordinateError(Exception): pass class IDError(Exception): pass class GffSubPart(object): """ Work in progress: contained by Gff object basically this is one line of a gff file, with p...
{ "repo_name": "holmrenser/gff_toolkit", "path": "gff_toolkit/gffsubpart.py", "copies": "1", "size": "14394", "license": "mit", "hash": -9140619193330741000, "line_mean": 29.6255319149, "line_max": 170, "alpha_frac": 0.6237321106, "autogenerated": false, "ratio": 2.8373743347131875, "config_test...
__author__ = 'RetroPy' import sys import pygame from pygame.locals import * from lib.lang_en import * from lib.colors import * VERSION = '0' pygame.init() # TODO create a calculator button management screen. SCREEN_WIDTH = 300 BUTTON_BUFFER = 2 # this is the small border separating the buttons from each other. BU...
{ "repo_name": "retropy/calculator", "path": "caculator.py", "copies": "1", "size": "4457", "license": "unlicense", "hash": 6816022802500200000, "line_mean": 44.0303030303, "line_max": 130, "alpha_frac": 0.6028718869, "autogenerated": false, "ratio": 3.0319727891156463, "config_test": false, "...
__author__ = 'Reuven' import sys class GetInfo(): def __init__(self): self.u_name = "" self.age = "" self.uid = "" def get_name(self): while self.u_name.isalpha() is False: self.u_name = raw_input("Please enter your name:")[:20] if self.u_name == "exit...
{ "repo_name": "reuvenderay/PythonProjects", "path": "enterInfo.py", "copies": "1", "size": "1339", "license": "mit", "hash": 198898928807572000, "line_mean": 30.1395348837, "line_max": 106, "alpha_frac": 0.5197908887, "autogenerated": false, "ratio": 3.3475, "config_test": false, "has_no_keyw...
__author__ = 'reverendken' import urllib.parse import os import json import requests from ws4py.client.threadedclient import WebSocketClient import slackapi.messages API_BASE = "https://slack.com/api/" SLACK_TOKEN = None def func_once(func): """A decorator that runs a function only once.""" def decorated...
{ "repo_name": "reverendken/slackbots", "path": "slackapi/slackapi.py", "copies": "1", "size": "3122", "license": "apache-2.0", "hash": 844622598363946100, "line_mean": 23.2093023256, "line_max": 74, "alpha_frac": 0.6092248559, "autogenerated": false, "ratio": 3.6772673733804475, "config_test": ...
__author__ = 'reverendken' import logging class SlackMessage(object): def __init__(self, api, message): self._message = message self._api = api @classmethod def is_this_type(cls, message): return message['type'] == cls.MESSAGE_TYPE @classmethod def get_message(cls, api,...
{ "repo_name": "reverendken/slackbots", "path": "slackapi/messages.py", "copies": "1", "size": "1387", "license": "apache-2.0", "hash": -6112296878510480000, "line_mean": 24.2363636364, "line_max": 111, "alpha_frac": 0.6164383562, "autogenerated": false, "ratio": 3.7486486486486488, "config_test...
import boto3 import collections import datetime import botocore ec2_client = boto3.client('ec2',region_name='ap-southeast-2') sns = boto3.client('sns') retention_days = 28 # Custmised retention timezone_offset = 11 # AEST timezone def lambda_handler(event, context): try: # Get all instances in your AWS...
{ "repo_name": "RexChenjq/AWS-Image-Backup", "path": "Lambda-AMI-Backup.py", "copies": "1", "size": "3554", "license": "mit", "hash": -7671283578384057000, "line_mean": 41.8313253012, "line_max": 266, "alpha_frac": 0.5998874508, "autogenerated": false, "ratio": 3.9314159292035398, "config_test":...
import boto3 import collections import datetime import time import sys import botocore ec2_client = boto3.client('ec2',region_name='ap-southeast-2') ec2_resource = boto3.resource('ec2',region_name='ap-southeast-2') sns = boto3.client('sns') images_all = ec2_resource.images.filter(Owners=["self"]) # All AMIs belong to...
{ "repo_name": "RexChenjq/AWS-Image-Backup", "path": "Lambda-Backup-Purge.py", "copies": "1", "size": "4620", "license": "mit", "hash": 8344895638693818000, "line_mean": 42.5943396226, "line_max": 137, "alpha_frac": 0.5357142857, "autogenerated": false, "ratio": 4.524975514201763, "config_test":...
__author__ = 'reyoung' class ICommand(object): def __init__(self): pass @staticmethod def get_key(): """ @type return: str """ return None @staticmethod def process(*args, **kwargs): """ @type return: str """ return "" cla...
{ "repo_name": "reyoung/SlideGen2", "path": "slidegen2/iengine.py", "copies": "1", "size": "1631", "license": "mit", "hash": -3168098177323693600, "line_mean": 20.76, "line_max": 79, "alpha_frac": 0.5248313918, "autogenerated": false, "ratio": 4.150127226463105, "config_test": false, "has_no_k...
from __future__ import absolute_import, print_function import tweepy from tweepy.streaming import StreamListener from tweepy import OAuthHandler from tweepy import Stream import json import key global api from nltk.tag import pos_tag from nltk.chunk import ne_chunk from nltk import sent_tokenize, word_tokenize, po...
{ "repo_name": "rhnvrm/swdel-lost-and-found-twitter-bot", "path": "bot.py", "copies": "1", "size": "4681", "license": "mit", "hash": 3470040683106467300, "line_mean": 34.7328244275, "line_max": 142, "alpha_frac": 0.513779107, "autogenerated": false, "ratio": 3.827473426001635, "config_test": fal...
__author__ = 'rhnvrm <hello@rohanverma.net>' import cv2 import pysrt import argparse def mid(x,y): return (x+y)/2 def save_new_frame(file, ms, text): videocapture = cv2.VideoCapture(videofile) videocapture.set(cv2.cv.CV_CAP_PROP_POS_MSEC,ms) success, image = videocapture.read() height, width = image.shape[:2...
{ "repo_name": "rhnvrm/SubScribe", "path": "script.py", "copies": "1", "size": "1344", "license": "mit", "hash": -5304574423828281000, "line_mean": 26.4285714286, "line_max": 106, "alpha_frac": 0.6569940476, "autogenerated": false, "ratio": 2.531073446327684, "config_test": false, "has_no_keyw...
import os import re import tweepy from tweepy import OAuthHandler from textblob import TextBlob class TwitterClient(object): ''' Generic Twitter Class for the App ''' def __init__(self, query, retweets_only=False, with_sentiment=False): # keys and tokens from the Twitter Dev Console c...
{ "repo_name": "vkku/GBAS", "path": "labeled-tweet-generator-master/twitter.py", "copies": "1", "size": "2849", "license": "mit", "hash": -1142032435606983300, "line_mean": 33.743902439, "line_max": 102, "alpha_frac": 0.5584415584, "autogenerated": false, "ratio": 3.8604336043360434, "config_tes...
__author__ = 'rhowell' from vector3 import Vec3, random_in_unit_sphere, reflect, unit_vector, dot from ray import Ray class Material: def scatter(self, ray_in, hit_record): """ :param ray_in: :param hit_record: :return: Tuple of bool, Vec3 attenuation, Ray scattered """ ...
{ "repo_name": "rustyhowell/raytracer_py", "path": "material.py", "copies": "1", "size": "1197", "license": "mit", "hash": -2873229904224474600, "line_mean": 30.5, "line_max": 86, "alpha_frac": 0.6299081036, "autogenerated": false, "ratio": 3.2615803814713895, "config_test": false, "has_no_key...
__author__ = 'rhythmicstar' from Bio.Seq import Seq from Bio.Alphabet import generic_dna def separate(geneId): sep = '.' splitGeneId = geneId.partition(sep) splittingGeneId = splitGeneId[0] splittingGeneId = splittingGeneId.strip("'") splittingGeneId = splittingGeneId.strip('"') return splitti...
{ "repo_name": "jessicalettes/orthoexon", "path": "orthoexon/util.py", "copies": "1", "size": "2144", "license": "bsd-3-clause", "hash": 1613265322894580200, "line_mean": 31.5, "line_max": 79, "alpha_frac": 0.6231343284, "autogenerated": false, "ratio": 3.4358974358974357, "config_test": false, ...
# AUTHOR RICCARDO BONETTO import numpy as np import pandas as pd import data_utils from sklearn import preprocessing as pre from sklearn.model_selection import StratifiedKFold from sklearn.metrics import confusion_matrix from sklearn.ensemble import RandomForestClassifier from sklearn.decomposition import KernelPCA ...
{ "repo_name": "bonettor/PubNative_Challenge", "path": "random_forest.py", "copies": "1", "size": "4654", "license": "mit", "hash": -8929591406814065000, "line_mean": 36.24, "line_max": 114, "alpha_frac": 0.6897292651, "autogenerated": false, "ratio": 3.037859007832898, "config_test": true, "h...
# AUTHOR RICCARDO BONETTO import numpy as np import pandas as pd import tensorflow as tf import math import os.path import data_utils from sklearn import preprocessing as pre from sklearn.model_selection import StratifiedKFold from sklearn.decomposition import PCA, KernelPCA _batch_size = 64 _num_units = 1024 _r...
{ "repo_name": "bonettor/PubNative_Challenge", "path": "neural_classifier_balanced_train.py", "copies": "1", "size": "7899", "license": "mit", "hash": 8691127707045802000, "line_mean": 31.6446280992, "line_max": 98, "alpha_frac": 0.6802126852, "autogenerated": false, "ratio": 3.0241194486983156, ...
# AUTHOR RICCARDO BONETTO import numpy as np import pandas as pd import tensorflow as tf import math import os.path from sklearn import preprocessing as pre from sklearn.model_selection import StratifiedKFold from sklearn.decomposition import PCA, KernelPCA _batch_size = 64 _num_units = 1024 _learning_rate = 1e-...
{ "repo_name": "bonettor/PubNative_Challenge", "path": "neural_ensemble.py", "copies": "1", "size": "4430", "license": "mit", "hash": -1086887894818395500, "line_mean": 30.4255319149, "line_max": 97, "alpha_frac": 0.6902934537, "autogenerated": false, "ratio": 2.9932432432432434, "config_test": ...
# AUTHOR RICCARDO BONETTO import numpy as np import pandas as pd from sklearn import preprocessing as pre from sklearn.model_selection import StratifiedKFold from sklearn.linear_model import SGDClassifier from sklearn.metrics import confusion_matrix from sklearn import svm from sklearn.ensemble import RandomForestC...
{ "repo_name": "bonettor/PubNative_Challenge", "path": "random_forest_classifier.py", "copies": "1", "size": "6956", "license": "mit", "hash": 7484307017951063000, "line_mean": 33.6119402985, "line_max": 103, "alpha_frac": 0.6995399655, "autogenerated": false, "ratio": 2.961260110685398, "config...
__author__="Riccardo Zaccarelli, PhD <riccardo(at)gfz-potsdam.de, riccardo.zaccarelli(at)gmail.com>" __date__ ="Dec 3, 2014 8:37:25 PM" """" Global keys used for parameters I/O operations and language settings: please PROVIDE ONLY VARIABLES WITH NO LEADING UNDERSCORES ASSOCIATED TO A STRINGS as a convention (not manda...
{ "repo_name": "GFZ-Centre-for-Early-Warning/caravan", "path": "caravan/settings/globalkeys.py", "copies": "1", "size": "1067", "license": "bsd-3-clause", "hash": -4291882714585654300, "line_mean": 28.6388888889, "line_max": 100, "alpha_frac": 0.7066541706, "autogenerated": false, "ratio": 2.68765...
from keras import backend as K from keras.engine.topology import Layer from keras import initializers, regularizers, constraints class AttentionWithContext(Layer): """ Attention operation, with a context/query vector, for temporal data. Supports Masking. Follows the work of Yang et al. [h...
{ "repo_name": "huajianjiu/Radical_CR_Encoder", "path": "attention.py", "copies": "1", "size": "4970", "license": "apache-2.0", "hash": 5072157338841319000, "line_mean": 39.0725806452, "line_max": 102, "alpha_frac": 0.5753672771, "autogenerated": false, "ratio": 3.991164658634538, "config_test":...
__author__ = 'Richard Lincoln, r.w.lincoln@gmail.com' from math import pi, atan, exp import xml.etree.ElementTree as ET from pathdata import svg SVG_NS = "http://www.w3.org/2000/svg" KML_NS = "http://www.opengis.net/kml/2.2" SVG_PATH = "SYSFigureA13Ungrouped.svg" KML_PATH = "/tmp/UKGrid.kml" #COLOR_400 = "rgb(0%,0%...
{ "repo_name": "rwl/pylon", "path": "examples/national_grid/svg2kml.py", "copies": "1", "size": "6535", "license": "apache-2.0", "hash": 3206892913114844000, "line_mean": 37.6686390533, "line_max": 87, "alpha_frac": 0.4399387911, "autogenerated": false, "ratio": 3.2544820717131473, "config_test"...
__author__ = 'Richard Lincoln, r.w.lincoln@gmail.com' import csv #import kmldom import zipfile import xml.etree.ElementTree as ET import geolocator.gislib import pylon file = zipfile.ZipFile("spt.kmz", "r") #for name in file.namelist(): # data = file.read(name) # print name, len(data), repr(data[:40]) #eleme...
{ "repo_name": "rwl/pylon", "path": "examples/national_grid/national_grid.py", "copies": "1", "size": "24525", "license": "apache-2.0", "hash": -1830515599985148700, "line_mean": 42.7946428571, "line_max": 118, "alpha_frac": 0.6684607543, "autogenerated": false, "ratio": 2.259327498848457, "conf...
__author__ = 'Richard Lincoln, r.w.lincoln@gmail.com' import os import csv import zipfile import xml.etree.ElementTree as ET ns = "http://www.opengis.net/kml/2.2" file = zipfile.ZipFile("national_grid.kmz", "r") tree = ET.parse(file.open("doc.kml")) # Python 2.6 and later. #tree = ET.parse("doc.kml") root = tree.ge...
{ "repo_name": "rwl/pylon", "path": "examples/national_grid/placemark.py", "copies": "1", "size": "5858", "license": "apache-2.0", "hash": -7586042087920700000, "line_mean": 39.965034965, "line_max": 115, "alpha_frac": 0.5500170707, "autogenerated": false, "ratio": 2.9144278606965175, "config_te...
__author__ = 'Richard Lincoln, r.w.lincoln@gmail.com' import os import sys import math import csv import logging import pylon logger = logging.getLogger() logger = logging.getLogger() logger.addHandler(logging.StreamHandler(sys.stdout)) logger.setLevel(logging.DEBUG) DATA_DIR = "./data/" BUS_DATA = [os.path.join(D...
{ "repo_name": "rwl/pylon", "path": "examples/national_grid/ngt.py", "copies": "1", "size": "15406", "license": "apache-2.0", "hash": 6221700435734940000, "line_mean": 32.9339207048, "line_max": 124, "alpha_frac": 0.5307023238, "autogenerated": false, "ratio": 3.2055763628797336, "config_test": ...
__author__ = 'Richard Lincoln, r.w.lincoln@gmail.com' import os.path import math import zipfile import xml.etree.ElementTree as ET NS_KML = "http://www.opengis.net/kml/2.2" MERC_SCALE = 1e5 NGT_PATH = "national_grid.kmz" NGT_PATH_PATH = "ngt_path.kml" CITIES_PATH = "uk_cities.kmz" OUT_PATH = "/home/rwl/latex/tikz/t...
{ "repo_name": "rwl/pylon", "path": "examples/national_grid/tikz.py", "copies": "1", "size": "5617", "license": "apache-2.0", "hash": -8223690530542464000, "line_mean": 31.6569767442, "line_max": 151, "alpha_frac": 0.5695210967, "autogenerated": false, "ratio": 2.7945273631840797, "config_test":...
__author__ = 'Richard Lincoln, r.w.lincoln@gmail.com' """ This example demonstrates how optimise power flow with Pyreto. """ import sys import logging import numpy import scipy.io import pylab import pylon import pyreto from pyreto.util import plotGenCost from pybrain.rl.agents import LearningAgent from pybrain.rl....
{ "repo_name": "rwl/pylon", "path": "examples/pyreto/rlopf.py", "copies": "1", "size": "5046", "license": "apache-2.0", "hash": -1618333267561434400, "line_mean": 32.417218543, "line_max": 78, "alpha_frac": 0.7128418549, "autogenerated": false, "ratio": 2.826890756302521, "config_test": false, ...
__author__ = 'Richard Lincoln, r.w.lincoln@gmail.com' """ This example demonstrates how Pyreto can simulate a discrete representation of a power exchange auction market. """ import sys import logging import pylab from scipy import array import pylon import pyreto.discrete import pyreto.continuous import pyreto.roth...
{ "repo_name": "rwl/pylon", "path": "examples/pyreto/discrete.py", "copies": "1", "size": "3874", "license": "apache-2.0", "hash": -7894151263399118000, "line_mean": 32.6869565217, "line_max": 96, "alpha_frac": 0.7222509035, "autogenerated": false, "ratio": 2.8997005988023954, "config_test": fal...
__author__ = 'Richard Lincoln, r.w.lincoln@gmail.com' """ This example demonstrates how to compute Nash equilibria. """ import numpy from scipy.io import mmwrite from pyreto import SmartMarket, DISCRIMINATIVE from pyreto.discrete import MarketEnvironment, ProfitTask from common import setup_logging, get_case6ww s...
{ "repo_name": "rwl/pylon", "path": "examples/pyreto/thesis/nash.py", "copies": "1", "size": "2816", "license": "apache-2.0", "hash": -4056260172365007400, "line_mean": 24.1428571429, "line_max": 67, "alpha_frac": 0.4950284091, "autogenerated": false, "ratio": 2.6122448979591835, "config_test": ...
__author__ = 'Richard Lincoln, r.w.lincoln@gmail.com' """ This example demonstrates how to produce a publication plot of generator costs using matplotlib. """ import matplotlib #matplotlib.use('WXAgg')#'TkAgg') #matplotlib.rc('font', **{'family': 'sans-serif', # 'sans-serif': ['Computer Moder...
{ "repo_name": "rwl/pylon", "path": "examples/pyreto/thesis/costplot.py", "copies": "1", "size": "3546", "license": "apache-2.0", "hash": -2222257614788683800, "line_mean": 31.8333333333, "line_max": 81, "alpha_frac": 0.5795262267, "autogenerated": false, "ratio": 2.952539550374688, "config_test...
__author__ = 'Richard Lincoln, r.w.lincoln@gmail.com' """ This example demonstrates how to solve an OPF problem. """ import sys import logging import numpy import scipy.io from os.path import join, dirname import pylon logging.basicConfig(stream=sys.stdout, level=logging.DEBUG) # Define a path to the data file. C...
{ "repo_name": "rwl/pylon", "path": "examples/load_profile.py", "copies": "1", "size": "2176", "license": "apache-2.0", "hash": 7393101631954396000, "line_mean": 32.4769230769, "line_max": 78, "alpha_frac": 0.6465992647, "autogenerated": false, "ratio": 2.5214368482039395, "config_test": false, ...
__author__ = 'Richard Lincoln, r.w.lincoln@gmail.com' """ This example demonstrates how to use Pylon to simulate a power exchange auction market. """ #import matplotlib #matplotlib.use('WXAgg')#'TkAgg') #matplotlib.rc('font', **{'family': 'sans-serif', # 'sans-serif': ['Computer Modern Sans s...
{ "repo_name": "rwl/pylon", "path": "examples/pyreto/auction.py", "copies": "1", "size": "7666", "license": "apache-2.0", "hash": 4991188410634317000, "line_mean": 31.4830508475, "line_max": 81, "alpha_frac": 0.6575789199, "autogenerated": false, "ratio": 3.083668543845535, "config_test": false,...
__author__ = 'Richard Lincoln, r.w.lincoln@gmail.com' """ This example demonstrates how to use Pyreto to simulate an episodic power exchange auction market. """ import sys import logging import pylab import scipy import pyreto.util import pyreto.continuous from pylon import Case, OPF from pybrain.rl.agents import ...
{ "repo_name": "rwl/pylon", "path": "examples/pyreto/episodic.py", "copies": "1", "size": "4892", "license": "apache-2.0", "hash": 3114543547355565600, "line_mean": 32.7379310345, "line_max": 84, "alpha_frac": 0.6860179886, "autogenerated": false, "ratio": 3.0594121325828643, "config_test": fals...
__author__ = 'Richard Lincoln, r.w.lincoln@gmail.com' """ This example demonstrates how to use the discrete Roth-Erev reinforcement learning algorithms to learn the n-armed bandit task. """ import pylab import scipy from pybrain.rl.agents import LearningAgent from pybrain.rl.explorers import BoltzmannExplorer #@Unus...
{ "repo_name": "rwl/pylon", "path": "examples/pyreto/bandit.py", "copies": "1", "size": "1933", "license": "apache-2.0", "hash": -6356878838941284000, "line_mean": 30.6885245902, "line_max": 77, "alpha_frac": 0.651319193, "autogenerated": false, "ratio": 2.924357034795764, "config_test": false, ...
__author__ = 'Richard Lincoln, r.w.lincoln@gmail.com' """ This script creates the plots published in Learning to Trade Power by Richard Lincoln. """ import matplotlib #matplotlib.use('WXAgg')#'TkAgg') #matplotlib.rc('font', **{'family': 'sans-serif', # 'sans-serif': ['Computer Modern Sans ser...
{ "repo_name": "rwl/pylon", "path": "examples/pyreto/thesis/plot.py", "copies": "1", "size": "21533", "license": "apache-2.0", "hash": -2250265373309537300, "line_mean": 31.4781297134, "line_max": 81, "alpha_frac": 0.5429805415, "autogenerated": false, "ratio": 2.9396587030716725, "config_test":...
__author__ = 'Richard Lincoln, r.w.lincoln@gmail.com' """ This script runs the first experiment from chapter 5 of Learning to Trade Power by Richard Lincoln. """ from numpy import array, zeros, mean, std from pyreto import DISCRIMINATIVE, FIRST_PRICE #@UnusedImport import pyreto.continuous import pyreto.roth_erev #...
{ "repo_name": "rwl/pylon", "path": "examples/pyreto/thesis/ex5_1.py", "copies": "1", "size": "11771", "license": "apache-2.0", "hash": 820916370239000800, "line_mean": 27.1602870813, "line_max": 81, "alpha_frac": 0.6033472092, "autogenerated": false, "ratio": 3.4825443786982246, "config_test": ...
__author__ = 'Richard Lincoln, r.w.lincoln@gmail.com' """ This script runs the first experiment from chapter 6 of Learning to Trade Power by Richard Lincoln. """ from time import time from numpy import zeros, mean, std from pylon import PQ import pyreto.continuous from pyreto import DISCRIMINATIVE, FIRST_PRICE #@U...
{ "repo_name": "rwl/pylon", "path": "examples/pyreto/thesis/ex6_1.py", "copies": "1", "size": "12162", "license": "apache-2.0", "hash": 3403872204168090000, "line_mean": 27.7517730496, "line_max": 79, "alpha_frac": 0.600148002, "autogenerated": false, "ratio": 3.244930629669157, "config_test": f...
__author__ = "Richard Lindsley" import sys import os import argparse import logging PY3 = sys.version_info.major == 3 try: if not PY3: import sip sip.setapi('QDate', 2) sip.setapi('QDateTime', 2) sip.setapi('QString', 2) sip.setapi('QTextStream', 2) sip.setapi('QTi...
{ "repo_name": "richli/dame", "path": "dame/dame.py", "copies": "1", "size": "1829", "license": "mit", "hash": 7447573134521931000, "line_mean": 28.9836065574, "line_max": 74, "alpha_frac": 0.6014215418, "autogenerated": false, "ratio": 3.579256360078278, "config_test": false, "has_no_keywords...
__author__ = 'richard' import cPickle as pickle import os from roboskeeter.io import i_o EXPERIMENT_PATH = i_o.get_directory('EXPERIMENT_PATH') def store_mosquito_pickle(experiment): pickle.dump(experiment, open(os.path.join(EXPERIMENT_PATH, "controls.p"), "wb")) ref_data = score.get_data(exper.kinematics)...
{ "repo_name": "isomerase/RoboSkeeter", "path": "roboskeeter/io/pickle_experiments.py", "copies": "2", "size": "1205", "license": "mit", "hash": -6245025051093537000, "line_mean": 33.4285714286, "line_max": 110, "alpha_frac": 0.712033195, "autogenerated": false, "ratio": 3.0352644836272042, "con...
__author__ = 'richard' import numpy as np from roboskeeter.math import math_toolbox class Flight(): def __init__(self, random_f_strength, stim_f_strength, damping_coeff): self.random_f_strength = random_f_strength self.stim_f_strength = stim_f_strength # TODO: separate surge strength, cast streng...
{ "repo_name": "isomerase/RoboSkeeter", "path": "roboskeeter/flight.py", "copies": "2", "size": "3556", "license": "mit", "hash": -3536590644379134500, "line_mean": 29.1355932203, "line_max": 113, "alpha_frac": 0.5292463442, "autogenerated": false, "ratio": 4.390123456790123, "config_test": fals...
__author__ = 'richard' import os import pickle import score_y from roboskeeter.io import i_o reload(score_y) reload(kinematics) EXPERIMENT_PATH = i_o.get_directory('EXPERIMENT_PATH') def store_mosquito_pickle(): MOSQUITOES = kinematics.ExperimentalKinematics() MOSQUITOES.experiment_data_to_DF(experimental...
{ "repo_name": "isomerase/RoboSkeeter", "path": "roboskeeter/io/pickle_experimentsY.py", "copies": "2", "size": "1407", "license": "mit", "hash": -3268704572040629000, "line_mean": 32.5, "line_max": 111, "alpha_frac": 0.7192608387, "autogenerated": false, "ratio": 2.9010309278350515, "config_tes...
__author__ = 'richard' from scipy.stats import ks_2samp from roboskeeter.experiments import load_experiment class Scoring(): def __init__(self, condition='Control', score_weights=None, reference_data=None ): self.condition = condition ...
{ "repo_name": "isomerase/mozziesniff", "path": "roboskeeter/math/scoring/scoring.py", "copies": "2", "size": "2563", "license": "mit", "hash": 2628433812028469000, "line_mean": 36.1449275362, "line_max": 105, "alpha_frac": 0.5864221615, "autogenerated": false, "ratio": 4.4342560553633215, "conf...
__author__ = 'Richard' from threading import Thread TRUPPENPREIS = 100 UEBERNAHMEPREIS = 1000 LOOT = 200 MODEEFFEKT = 0.3 MODERABATT = 1 - MODEEFFEKT class DummyAI (object): def __init__(self): self.player = None def add_player(self, player): self.player = player @staticmethod def...
{ "repo_name": "TurnTheTideTM/AI", "path": "ProjectNeurons/core.py", "copies": "1", "size": "14436", "license": "mit", "hash": -6265866879669322000, "line_mean": 29.7803837953, "line_max": 96, "alpha_frac": 0.5289553893, "autogenerated": false, "ratio": 3.5723830734966593, "config_test": false, ...
__author__ = 'richard' import logging from datetime import datetime from scipy.optimize import minimize_scalar, basinhopping, brute from roboskeeter import experiments from roboskeeter.math.scoring import scoring logging.basicConfig(filename='basin_hopping.log', level=logging.DEBUG) # TODO: save guesses and their ...
{ "repo_name": "isomerase/RoboSkeeter", "path": "roboskeeter/math/optimizers/optimizer.py", "copies": "2", "size": "10155", "license": "mit", "hash": -9188319098102907000, "line_mean": 36.8955223881, "line_max": 172, "alpha_frac": 0.5179714426, "autogenerated": false, "ratio": 3.737578211262422, ...
__author__ = 'richard' import logging from datetime import datetime from scipy.optimize import minimize_scalar from roboskeeter.experiments import start_simulation from roboskeeter.scripts import load_mosquito_kde_data_dicts # wrapper func for agent 3D def fly_wrapper(BOUNCE_COEFF, *args): """ :param bias_...
{ "repo_name": "isomerase/mozziesniff", "path": "roboskeeter/math/optimizers/optimizer_y.py", "copies": "2", "size": "3179", "license": "mit", "hash": 1887114110103095000, "line_mean": 31.1111111111, "line_max": 120, "alpha_frac": 0.509594212, "autogenerated": false, "ratio": 3.762130177514793, ...
__author__ = 'richard' import numpy as np from numpy import * from matplotlib import pyplot as plt from matplotlib.patches import FancyArrowPatch from mpl_toolkits.mplot3d import proj3d class Arrow3D(FancyArrowPatch): def __init__(self, xs, ys, zs, *args, **kwargs): FancyArrowPatch.__init__(self, (0, 0)...
{ "repo_name": "isomerase/mozziesniff", "path": "roboskeeter/plotting/simple_3D_vectors.py", "copies": "2", "size": "2196", "license": "mit", "hash": 7632813179791669000, "line_mean": 30.3714285714, "line_max": 117, "alpha_frac": 0.5869763206, "autogenerated": false, "ratio": 2.783269961977186, ...
__author__ = 'richard' """ """ from roboskeeter.math.kinematic_math import DoMath # from roboskeeter.math.scoring.scoring import Scoring from roboskeeter.simulator import Simulator from roboskeeter.environment import Environment from roboskeeter.observations import Observations from roboskeeter.plotting.plot_funcs_wra...
{ "repo_name": "isomerase/mozziesniff", "path": "roboskeeter/experiments.py", "copies": "2", "size": "8222", "license": "mit", "hash": -5902927779284093000, "line_mean": 40.9489795918, "line_max": 141, "alpha_frac": 0.5488932133, "autogenerated": false, "ratio": 4.288993218570683, "config_test":...
__author__ = "Richard O'Dwyer" __email__ = "richard@richard.do" __license__ = "None" import re def process_log(log): requests = get_requests(log) files = get_files(requests) totals = file_occur(files) return totals def get_requests(f): log_line = f.read() pat = (r'' '(\d+.\d+.\d+.\...
{ "repo_name": "GeekyTheory/Nginx-Log-Parser", "path": "main.py", "copies": "1", "size": "2340", "license": "apache-2.0", "hash": -1548898559441928200, "line_mean": 22.6363636364, "line_max": 84, "alpha_frac": 0.5260683761, "autogenerated": false, "ratio": 3.611111111111111, "config_test": false...
from __future__ import with_statement import os import threading import logging import phantom from sickbeard import classes # number of log files to keep NUM_LOGS = 3 # log size in bytes LOG_SIZE = 10000000 # 10 megs ERROR = logging.ERROR WARNING = logging.WARNING MESSAGE = logging.INFO DEBUG = logging.DEBUG...
{ "repo_name": "rosterloh/Phantom", "path": "phantom/logger.py", "copies": "1", "size": "5092", "license": "mit", "hash": 5747848737475109000, "line_mean": 30.245398773, "line_max": 118, "alpha_frac": 0.5551846033, "autogenerated": false, "ratio": 4.0284810126582276, "config_test": false, "has...
import re from scrapy.spider import BaseSpider from scrapy.selector import HtmlXPathSelector from crawly.items import CrawlyItem from crawly.models import db, Domain, Template def get_urls(): """get stored urls from database (tb_domain)""" for url in db.session.query(Domain).outerjoin(Template).\ f...
{ "repo_name": "icyrizard/webcrawler", "path": "crawly/crawly/spiders/crawly_spider.py", "copies": "1", "size": "2925", "license": "mit", "hash": 1440366602569276400, "line_mean": 30.7934782609, "line_max": 78, "alpha_frac": 0.5733333333, "autogenerated": false, "ratio": 4.0344827586206895, "con...
__author__ = 'richardxx' import mongoctl.repository as repository from mongoctl.utils import document_pretty_string from mongoctl.mongoctl_logging import log_info, log_error from mongoctl.objects.sharded_cluster import ShardedCluster from mongoctl.objects.replicaset_cluster import ReplicaSetCluster from mongoctl.er...
{ "repo_name": "richardxx/mongoctl-service", "path": "mongoctl/commands/cluster/control.py", "copies": "2", "size": "3639", "license": "mit", "hash": 77479544986945020, "line_mean": 30.1025641026, "line_max": 90, "alpha_frac": 0.6281945589, "autogenerated": false, "ratio": 4.443223443223443, "co...
__author__ = "Richie Foreman <richie.foreman@gmail.com>" import os import time import logging import httplib2 import json import base64 try: from Crypto.Signature import PKCS1_v1_5 from Crypto.Hash import SHA256 from Crypto.PublicKey import RSA except: ImportError("You need to enable or install PyCryp...
{ "repo_name": "timblakely/bigbrain", "path": "bigbrain/bigbrain/oauth2/PyCryptoSignedJWT.py", "copies": "1", "size": "11121", "license": "apache-2.0", "hash": -759607463517080200, "line_mean": 31.1416184971, "line_max": 260, "alpha_frac": 0.6238647604, "autogenerated": false, "ratio": 3.970367725...
__author__ = 'richss' """ The MIT License (MIT) Copyright (c) 2015 Richard S. Stansbury Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the righ...
{ "repo_name": "richss/TwitterBots", "path": "InitialTwitterBot/QueryBot.py", "copies": "1", "size": "5742", "license": "mit", "hash": 7135950102573124000, "line_mean": 33.5963855422, "line_max": 109, "alpha_frac": 0.6649251132, "autogenerated": false, "ratio": 4.136887608069165, "config_test": ...
__author__ = 'Rick Dean' __doc__ = ' ' #Created by Rick on 2017-01-02. import numpy as np from bokeh.resources import CDN from bokeh.embed import file_html from bokeh.plotting import figure from bokeh.layouts import column from sklearn.cluster import KMeans class Visuals: @staticmethod def k_means_2(data): tr...
{ "repo_name": "deandevl/num_sci_server_projects", "path": "Fleet Drivers K-Means/Code/Visuals.py", "copies": "1", "size": "1366", "license": "mit", "hash": -7728043479034923000, "line_mean": 31.5238095238, "line_max": 103, "alpha_frac": 0.6383601757, "autogenerated": false, "ratio": 3.17674418604...
__author__ = 'Rick Dean' __doc__ = ' ' #Created by Rick on 2017-03-16. import numpy as np import numpy.ma as ma import statsmodels.api as sm from scipy import stats from statsmodels.sandbox.regression.predstd import wls_prediction_std from bokeh.layouts import column,layout from bokeh.resources import CDN from bokeh....
{ "repo_name": "deandevl/num_sci_server_projects", "path": "Predicting Home Prices/Code/Visuals.py", "copies": "1", "size": "8017", "license": "mit", "hash": -8065592742411729000, "line_mean": 40.3298969072, "line_max": 120, "alpha_frac": 0.6357739803, "autogenerated": false, "ratio": 3.0367424242...
__author__ = 'Rick Dean' __doc__ = ' ' #Created by Rick on 2017-03-19. import re import csv type_map = dict(byte=int, int=int, long=int, float=float, double=float) var_info = [] names = [] for line in open('2002FemPreg.dct'): match = re.search( r'_column\(([^)]*)\)', line) if match: start = int(match.group(1...
{ "repo_name": "deandevl/num_sci_server_projects", "path": "ThinkStats/Code/convert_dat_to_csv_file.py", "copies": "1", "size": "1228", "license": "mit", "hash": -1735799985719256000, "line_mean": 24.6041666667, "line_max": 71, "alpha_frac": 0.6083061889, "autogenerated": false, "ratio": 2.6929824...
__author__ = 'Rick Qiu' from bs4 import BeautifulSoup def parse_problem_archive(htmldoc): """ This function is to handle below page: http://community.topcoder.com/tc?module=ProblemArchive&sc=0&sd=asc&er=10000 it returns a list and each element is a diction like below: {'name':'Aaagmnrs', 'url'...
{ "repo_name": "rick-qiu/tcgrabber", "path": "parser.py", "copies": "1", "size": "2481", "license": "mit", "hash": 5625924998386320000, "line_mean": 34.4428571429, "line_max": 202, "alpha_frac": 0.6473196292, "autogenerated": false, "ratio": 2.8848837209302327, "config_test": false, "has_no_ke...
__author__ = 'Rick Qiu' import configuration import urllib.request import urllib.response import urllib.parse class FileGrabber: def __init__(self): data = urllib.parse.urlencode(query={'username':configuration.username, 'password':configuration.password, ...
{ "repo_name": "rick-qiu/tcgrabber", "path": "filegrabber.py", "copies": "1", "size": "1324", "license": "mit", "hash": -4106924808885736000, "line_mean": 36.8571428571, "line_max": 101, "alpha_frac": 0.6246223565, "autogenerated": false, "ratio": 3.8941176470588235, "config_test": false, "has...
__author__ = "Rick Sherman" __credits__ = "Jeremy Schulman, Nitin Kumar" import unittest from nose.plugins.attrib import attr from jnpr.junos import Device from jnpr.junos.utils.start_shell import StartShell from mock import patch, MagicMock, call @attr('unit') class TestStartShell(unittest.TestCase): @patch('...
{ "repo_name": "JamesNickerson/py-junos-eznc", "path": "tests/unit/utils/test_start_shell.py", "copies": "1", "size": "1815", "license": "apache-2.0", "hash": 5519609518240943000, "line_mean": 34.5882352941, "line_max": 87, "alpha_frac": 0.6567493113, "autogenerated": false, "ratio": 3.31204379562...
__author__ = "Rick Sherman" __credits__ = "Jeremy Schulman" import unittest import os from nose.plugins.attrib import attr from jnpr.junos import Device from jnpr.junos.op.phyport import PhyPortStatsTable from jnpr.junos.op.ethport import EthPortTable from ncclient.manager import Manager, make_device_handler from nc...
{ "repo_name": "JamesNickerson/py-junos-eznc", "path": "tests/unit/factory/test_optable.py", "copies": "1", "size": "3679", "license": "apache-2.0", "hash": 2455931987863321600, "line_mean": 32.1441441441, "line_max": 78, "alpha_frac": 0.6121228595, "autogenerated": false, "ratio": 3.3907834101382...
__author__ = "Rick Sherman, Nitin Kumar" __credits__ = "Jeremy Schulman" import unittest from nose.plugins.attrib import attr from mock import MagicMock, patch from jnpr.junos import Device from jnpr.junos.factory.view import View from jnpr.junos.op.phyport import PhyPortStatsTable, PhyPortStatsView from lxml import e...
{ "repo_name": "pklimai/py-junos-eznc", "path": "tests/unit/factory/test_view.py", "copies": "3", "size": "7145", "license": "apache-2.0", "hash": -7663567226459055000, "line_mean": 36.6052631579, "line_max": 78, "alpha_frac": 0.5321203639, "autogenerated": false, "ratio": 3.729123173277662, "co...
__author__ = "Rick Sherman, Nitin Kumar" __credits__ = "Jeremy Schulman" import unittest2 as unittest from nose.plugins.attrib import attr from mock import MagicMock, patch, mock_open import os from lxml import etree from ncclient.manager import Manager, make_device_handler from ncclient.transport import SS...
{ "repo_name": "JamesNickerson/py-junos-eznc", "path": "tests/unit/test_device.py", "copies": "1", "size": "19176", "license": "apache-2.0", "hash": 6140360169622676000, "line_mean": 39.3275862069, "line_max": 120, "alpha_frac": 0.6009073842, "autogenerated": false, "ratio": 3.808540218470705, "...
__author__ = "Rick Sherman" import unittest2 as unittest from nose.plugins.attrib import attr from mock import patch import os import json from jnpr.junos import Device from jnpr.junos.factory.to_json import PyEzJSONEncoder, TableJSONEncoder, TableViewJSONEncoder from jnpr.junos.op.routes import RouteSummaryTable fro...
{ "repo_name": "b1naryth1ef/py-junos-eznc", "path": "tests/unit/factory/test_to_json.py", "copies": "4", "size": "3883", "license": "apache-2.0", "hash": 4896008544439438000, "line_mean": 41.6703296703, "line_max": 153, "alpha_frac": 0.5912953902, "autogenerated": false, "ratio": 3.454626334519573...
__author__ = 'Ricky' from flask import Flask, render_template from flask_mail import Mail, Message #*** Remember to change the email sender at production time! *** def send_welcome_email(email, plan): app = Flask(__name__) mail = Mail() mail.init_app(app) msg = Message("You've successfully signed up f...
{ "repo_name": "rcharp/Simple", "path": "app/pages/emails.py", "copies": "1", "size": "2665", "license": "bsd-2-clause", "hash": 5112438206537319000, "line_mean": 34.0657894737, "line_max": 117, "alpha_frac": 0.5909943715, "autogenerated": false, "ratio": 4.056316590563166, "config_test": false,...
__author__ = 'Ricky' import stripe from flask import session import time from date import * from eventClass import Event import threading import Queue from calc import calculate, chartify import inspect from flask_cache import Cache from flask_user import current_user from app.app_and_db import app from stripeErrorCla...
{ "repo_name": "rcharp/Simple", "path": "app/pages/events.py", "copies": "1", "size": "6300", "license": "bsd-2-clause", "hash": 4319358812082459000, "line_mean": 31.6476683938, "line_max": 168, "alpha_frac": 0.6233333333, "autogenerated": false, "ratio": 3.884093711467324, "config_test": false,...
__author__ = 'rico jonschkowski' import cv2 import scipy.ndimage import numpy as np from sklearn import preprocessing # @UnresolvedImport from sklearn.svm import SVC # @UnresolvedImport from sklearn.linear_model import LogisticRegression from sklearn.preprocessing import PolynomialFeatures from sklearn.pipeline imp...
{ "repo_name": "start-jsk/jsk_apc", "path": "jsk_apc2016_common/python/jsk_apc2016_common/rbo_segmentation/probabilistic_segmentation.py", "copies": "1", "size": "30350", "license": "bsd-3-clause", "hash": 6323820982267696000, "line_mean": 48.7540983607, "line_max": 209, "alpha_frac": 0.6198682043, ...