text stringlengths 0 1.05M | meta dict |
|---|---|
__author__ = 'arul'
import hdf5_getters as GETTERS
import sys
import numpy as np
import happybase
# import utils.hbaseConnect as hbase
import logging
import operator
import os
from pyspark import SparkContext
logging.basicConfig(filename='debug.txt',level=logging.DEBUG)
ARTIST_ID_COLUMNID='ArtistId'
COLUMN_FAMILY_NAM... | {
"repo_name": "Arulselvanmadhavan/Artist_Recognition_from_Audio_Features",
"path": "DataCleanup/parsingTasks/loadData_PySpark.py",
"copies": "1",
"size": "4686",
"license": "apache-2.0",
"hash": -4754900468129175000,
"line_mean": 31.7692307692,
"line_max": 83,
"alpha_frac": 0.6538625694,
"autogener... |
__author__ = 'arul'
import hdf5_getters as GETTERS
import sys
import numpy as np
import happybase
import utils.hbaseConnect as hbase
import logging
logging.basicConfig(filename='debug.txt',level=logging.DEBUG)
ARTIST_ID_COLUMNID=91
def getColumnValuesDict(features,h5FileName,artistId,trackId):
"""
Prepare a ... | {
"repo_name": "Arulselvanmadhavan/Artist_Recognition_from_Audio_Features",
"path": "MRTasks/parsingTasks/prepareDataSet.py",
"copies": "2",
"size": "3172",
"license": "apache-2.0",
"hash": -5706140139459941000,
"line_mean": 31.7010309278,
"line_max": 89,
"alpha_frac": 0.631147541,
"autogenerated": ... |
__author__ = 'Arunkumar Eli'
__email__ = "elrarun@gmail.com"
from locators import AmazonEc2Locators
from selenium.webdriver.support.ui import Select
from selenium.webdriver.common.by import By
from selenium.webdriver.support.ui import WebDriverWait
from selenium.webdriver.support import expected_conditions as EC
impor... | {
"repo_name": "aruneli/rancher-test",
"path": "ui-selenium-tests/pages/AmazonEc2.py",
"copies": "1",
"size": "8146",
"license": "apache-2.0",
"hash": 6985117429112604000,
"line_mean": 35.6936936937,
"line_max": 136,
"alpha_frac": 0.628038301,
"autogenerated": false,
"ratio": 3.485665382969619,
... |
__author__ = 'Arunkumar Eli'
__email__ = "elrarun@gmail.com"
from locators import AmazonEc2Locators
from selenium.webdriver.support.ui import Select
class AmazonEc2(object):
def __init__(self, driver):
self.driver = driver
def input_access_key(self, val):
element = self.driver.find_element(... | {
"repo_name": "aruneli/rancher-test",
"path": "ui-selenium-tests/pages/AmazonEc2Page.py",
"copies": "1",
"size": "3049",
"license": "apache-2.0",
"hash": -4428168637509758000,
"line_mean": 34.0459770115,
"line_max": 100,
"alpha_frac": 0.6900623155,
"autogenerated": false,
"ratio": 3.2855603448275... |
__author__ = 'Arunkumar Eli'
__email__ = "elrarun@gmail.com"
from locators import AppsLocators
from selenium.webdriver.support.ui import Select
class AddService(object):
def __init__(self, driver):
self.driver = driver
def click_add_service(self):
element = self.driver.find_element(*AppsLoc... | {
"repo_name": "aruneli/rancher-test",
"path": "ui-selenium-tests/pages/AddServicePage.py",
"copies": "1",
"size": "1251",
"license": "apache-2.0",
"hash": 4584286946762751000,
"line_mean": 27.4318181818,
"line_max": 96,
"alpha_frac": 0.6802557954,
"autogenerated": false,
"ratio": 3.42739726027397... |
__author__ = 'Arunkumar Eli'
__email__ = "elrarun@gmail.com"
from locators import DigitalOceanLocators
from selenium.webdriver.support.ui import Select
class DigitalOcean(object):
def __init__(self, driver):
self.driver = driver
def input_access_token(self, val):
element = self.driver.find_... | {
"repo_name": "aruneli/rancher-test",
"path": "ui-selenium-tests/pages/DigitalOceanPage.py",
"copies": "1",
"size": "1997",
"license": "apache-2.0",
"hash": -2613048918078816000,
"line_mean": 32.8474576271,
"line_max": 107,
"alpha_frac": 0.7045568353,
"autogenerated": false,
"ratio": 3.5660714285... |
__author__ = 'Arunkumar Eli'
__email__ = "elrarun@gmail.com"
from locators import InfraHostsLocators
from locators import InfraPageLocators
from selenium.webdriver.common.by import By
from selenium.webdriver.support.ui import WebDriverWait
from selenium.webdriver.support import expected_conditions as ec
from selenium.... | {
"repo_name": "aruneli/rancher-test",
"path": "ui-selenium-tests/pages/InfraHostsPage.py",
"copies": "1",
"size": "6392",
"license": "apache-2.0",
"hash": 562739080124592830,
"line_mean": 35.5257142857,
"line_max": 151,
"alpha_frac": 0.5980913642,
"autogenerated": false,
"ratio": 3.65884373211219... |
__author__ = 'Arunkumar Eli'
__email__ = "elrarun@gmail.com"
from selenium.webdriver.common.by import By
class DigitalOceanLocators(object):
ACCESS_KEY_INPUT = (By.ID, 'accessKey')
SECRET_KEY_INPUT = (By.ID, 'secretKey')
NEXT_BTN = (By.CSS_SELECTOR, "button.btn.btn-primary")
AVAILABILITY_ZONE = (By.XP... | {
"repo_name": "aruneli/rancher-test",
"path": "ui-selenium-tests/locators/PacketLocators.py",
"copies": "2",
"size": "1212",
"license": "apache-2.0",
"hash": -3461568642314811400,
"line_mean": 45.6153846154,
"line_max": 86,
"alpha_frac": 0.6278877888,
"autogenerated": false,
"ratio": 2.5041322314... |
__author__ = 'Arunkumar Eli'
__email__ = "elrarun@gmail.com"
from selenium.webdriver.common.by import By
class Ec2Locators(object):
ACCESS_KEY_INPUT = (By.ID, 'accessKey')
SECRET_KEY_INPUT = (By.ID, 'secretKey')
NEXT_BTN = (By.CSS_SELECTOR, "button.btn.btn-primary")
AVAILABILITY_ZONE = (By.XPATH, "//s... | {
"repo_name": "aruneli/rancher-test",
"path": "ui-selenium-tests/locators/AmazonEc2Locators.py",
"copies": "1",
"size": "1203",
"license": "apache-2.0",
"hash": -4483984712312975400,
"line_mean": 45.2692307692,
"line_max": 86,
"alpha_frac": 0.6251039069,
"autogenerated": false,
"ratio": 2.4855371... |
__author__ = 'arun'
# Echo client program
import socket
HOST = '192.168.1.243' #'192.168.1.243' # The remote host
PORT = 60007 # The same port as used by the server
# s = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
for x in range(0, 130000):
s = socket.socket(socket.AF_INET, socket.SOCK_STREAM... | {
"repo_name": "IPVL/Arun-SocketExample",
"path": "ipv4_client.py",
"copies": "1",
"size": "2715",
"license": "mit",
"hash": 4873359001793046000,
"line_mean": 19.4210526316,
"line_max": 82,
"alpha_frac": 0.5745856354,
"autogenerated": false,
"ratio": 2.825182101977107,
"config_test": false,
"h... |
__author__ = 'arun'
# Echo server program
import socket
HOST = '192.168.1.243' # Symbolic name meaning all available interfaces
PORT = 60007 # Arbitrary non-privileged port
s = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
#sock.setsockopt(socket.SOL_SOCKET, socket.SO_REUSEADDR, 1)
s.bi... | {
"repo_name": "IPVL/Arun-SocketExample",
"path": "ipv4_server.py",
"copies": "1",
"size": "2709",
"license": "mit",
"hash": -7034888843410651000,
"line_mean": 22.7719298246,
"line_max": 87,
"alpha_frac": 0.584717608,
"autogenerated": false,
"ratio": 3.030201342281879,
"config_test": false,
"h... |
__author__ = 'arun'
# Echo server program
import socket
import sys
HOST = None # Symbolic name meaning all available interfaces
PORT = 50007 # Arbitrary non-privileged port
s = None
#address_family = [addr[0] for addr in socket.getaddrinfo(bind_addr[0], bind_addr[1], socket.AF_UNSPEC, socket... | {
"repo_name": "IPVL/Arun-SocketExample",
"path": "ipv6_server.py",
"copies": "1",
"size": "1097",
"license": "mit",
"hash": 5198471251142665000,
"line_mean": 28.6756756757,
"line_max": 175,
"alpha_frac": 0.6061987238,
"autogenerated": false,
"ratio": 3.428125,
"config_test": false,
"has_no_ke... |
"""
First-order integrator using waveform relaxation.
TODO: Implement the waveform relaxation.
class RelaxationIntegrator
---------
A subclass of the SciPy ODE class.
"""
from scipy.integrate import _ode
from scipy.integrate import ode
def runner(_, f, y0, t0, t1, rtol, atol, solout, nsteps, verbosity, f_params):
... | {
"repo_name": "aryamccarthy/gapjunctions",
"path": "gapjunctions/ode.py",
"copies": "1",
"size": "1917",
"license": "mit",
"hash": 6230435410882319000,
"line_mean": 27.6119402985,
"line_max": 78,
"alpha_frac": 0.5946791862,
"autogenerated": false,
"ratio": 3.4171122994652405,
"config_test": fal... |
__author__ = 'asafvaladarsky'
from lxml import etree
from os import walk, sep, path
from logging import info, warning
def main(mainFolderName,schemaFileName, shouldRecursiveSearch):
with open(schemaFileName) as schemaFile:
schemaText = schemaFile.read()
xmlschema = etree.XMLSchema(etree.parse(schemaFi... | {
"repo_name": "hasadna/OpenPress",
"path": "engine/sitemap-generator/xml_validator.py",
"copies": "1",
"size": "1157",
"license": "mit",
"hash": 4078366218172621000,
"line_mean": 31.1666666667,
"line_max": 87,
"alpha_frac": 0.6352636128,
"autogenerated": false,
"ratio": 3.922033898305085,
"conf... |
import threading
import SocketServer
import socket
from xbmc import Monitor
from resources.lib.kodihelper import KodiHelper
from resources.lib.WidevineHTTPRequestHandler import WidevineHTTPRequestHandler
# helper function to select an unused port on the host machine
def select_unused_port():
sock = socket.socket(... | {
"repo_name": "emilsvennesson/kodi-cmore",
"path": "service.py",
"copies": "1",
"size": "1563",
"license": "mit",
"hash": 5214167549105159000,
"line_mean": 29.0576923077,
"line_max": 91,
"alpha_frac": 0.7146513116,
"autogenerated": false,
"ratio": 3.4656319290465634,
"config_test": false,
"ha... |
__author__ = 'Aseem'
__name__ = '0001-0050'
#Most of these are in functions directory
import calendar
import combinatorics
import common
import files
import lcm
import math
import primes
import series
import sys
import utils_ab
from numbers_ab import *
from fractions import Fraction
from itertools import count, islic... | {
"repo_name": "anshbansal/general",
"path": "Python3/project_euler/0001-0050.py",
"copies": "1",
"size": "7832",
"license": "mit",
"hash": -7301582526232317000,
"line_mean": 21.4441260745,
"line_max": 80,
"alpha_frac": 0.5301327886,
"autogenerated": false,
"ratio": 3.3256900212314227,
"config_t... |
__author__ = 'Aseem'
import combinatorics
import common
import files
import math
import numbers_ab
from itertools import count, product
RESOURCES = 'Resources'
def prob_052():
def set_of_digits(cur_num):
return set(str(cur_num))
for num in count(1):
if all(set_of_digits(j * num) == set_of_... | {
"repo_name": "anshbansal/general",
"path": "Python3/project_euler/0051-0100.py",
"copies": "1",
"size": "2113",
"license": "mit",
"hash": 7314602589948776,
"line_mean": 22.4888888889,
"line_max": 90,
"alpha_frac": 0.517274018,
"autogenerated": false,
"ratio": 3.153731343283582,
"config_test": ... |
__author__ = 'Aseem'
import files
import sys
import time
RULER = "====="
def _accumulate(row, sums):
if sums is None:
return row
return ([row[0] + sums[0]]
+ [row[i] + max(sums[i - 1], sums[i]) for i in range(1, len(row) - 1)]
+ [row[-1] + sums[-1]])
def max_path_sum_triangl... | {
"repo_name": "anshbansal/general",
"path": "Python3/project_euler/common.py",
"copies": "1",
"size": "1275",
"license": "mit",
"hash": 7647962960652256000,
"line_mean": 29.380952381,
"line_max": 102,
"alpha_frac": 0.5819607843,
"autogenerated": false,
"ratio": 2.9859484777517564,
"config_test"... |
__author__ = 'Aseem'
import itertools
import math
import numbers_ab
def is_prime(num):
"""Checks whether a number is prime or not"""
if num == 2:
return True
if num % 2 == 0 or num < 2:
return False
temp = int(math.sqrt(num)) + 1
for i in range(3, temp, 2):
if num % i == ... | {
"repo_name": "anshbansal/general",
"path": "Python3/functions/primes.py",
"copies": "1",
"size": "3464",
"license": "mit",
"hash": 2872673660500823600,
"line_mean": 23.5744680851,
"line_max": 74,
"alpha_frac": 0.4884526559,
"autogenerated": false,
"ratio": 3.6045785639958376,
"config_test": fa... |
__author__ = 'Aseem'
import math
import series
def rev_num(num):
if num < 0:
return -int(str(-num)[::-1])
else:
return int(str(num)[::-1])
def is_palindrome(num):
if isinstance(num, str):
return num == num[::-1]
else:
return num == rev_num(num)
def get_binary(num):... | {
"repo_name": "anshbansal/general",
"path": "Python3/functions/numbers_ab.py",
"copies": "1",
"size": "2487",
"license": "mit",
"hash": -3116977569618130000,
"line_mean": 17.1605839416,
"line_max": 82,
"alpha_frac": 0.545637314,
"autogenerated": false,
"ratio": 3.0218712029161603,
"config_test"... |
__author__ = 'Aseem'
def prob_031():
#TODO Needs to be refactored
ways = 1
for i in range(3):
sum_a = i * 100
for j in range(5):
sum_b = sum_a + j*50
if sum_b > 200:
break
for k in range(11):
sum_c = sum_b + k*20
... | {
"repo_name": "anshbansal/general",
"path": "Python3/project_euler/001_050/031.py",
"copies": "1",
"size": "1080",
"license": "mit",
"hash": 1150659492225715500,
"line_mean": 27.4210526316,
"line_max": 52,
"alpha_frac": 0.3157407407,
"autogenerated": false,
"ratio": 4.337349397590361,
"config_t... |
__author__ = 'ashabou'
import argparse
import os
import matplotlib.pyplot as plt
from matplotlib.backends.backend_pdf import PdfPages
import pandas as pd
from sklearn import preprocessing
import numpy as np
from pandas import DataFrame as df
argument_parser = argparse.ArgumentParser()
argument_parser.add_argument("--... | {
"repo_name": "aymen82/kaggler-competitions-scripts",
"path": "dev/abalone/script.py",
"copies": "1",
"size": "2329",
"license": "bsd-3-clause",
"hash": 8202563143351316000,
"line_mean": 27.0722891566,
"line_max": 108,
"alpha_frac": 0.6878488622,
"autogenerated": false,
"ratio": 3.203576341127922... |
__author__ = 'ashabou'
from pyspark import SparkContext
from pyspark.sql import SQLContext
from pyspark.mllib.clustering import KMeans
import logging
sc = SparkContext(appName="db-creator", master="local[*]")
sqc = SQLContext(sc)
logger = sc._jvm.org.apache.log4j
logger.LogManager.getLogger("INFO").setLevel(logger.... | {
"repo_name": "aymen82/SparkImageRecognition",
"path": "scripts/create-codebook.py",
"copies": "1",
"size": "2736",
"license": "apache-2.0",
"hash": 890162988241444400,
"line_mean": 30.8139534884,
"line_max": 99,
"alpha_frac": 0.6370614035,
"autogenerated": false,
"ratio": 3.6,
"config_test": f... |
__author__ = 'ashabou'
from pyspark import SparkContext
from pyspark.sql import SQLContext, Row, functions
from pyspark.mllib.clustering import KMeansModel
from pyspark.mllib.linalg import SparseVector
import logging
sc = SparkContext(appName="db-creator", master="local[*]")
sqc = SQLContext(sc)
logger = sc._jvm.or... | {
"repo_name": "aymen82/SparkImageRecognition",
"path": "scripts/create-global-features.py",
"copies": "1",
"size": "4524",
"license": "apache-2.0",
"hash": 8851838174643259000,
"line_mean": 30.2,
"line_max": 97,
"alpha_frac": 0.6061007958,
"autogenerated": false,
"ratio": 3.732673267326733,
"co... |
__author__ = 'ashabou'
from pyspark import SparkContext
from pyspark.sql import SQLContext, Row
from pyspark.ml.classification import LogisticRegression
from pyspark.ml.feature import Normalizer, StringIndexer
from sklearn.preprocessing import normalize
from pyspark.ml import Pipeline
from pyspark.ml.evaluation impor... | {
"repo_name": "aymen82/SparkImageRecognition",
"path": "scripts/train.py",
"copies": "1",
"size": "4756",
"license": "apache-2.0",
"hash": -1144050385470290200,
"line_mean": 30.9194630872,
"line_max": 107,
"alpha_frac": 0.6759882254,
"autogenerated": false,
"ratio": 3.9015586546349468,
"config_... |
__author__ = 'ashabou'
from pyspark import SparkContext
from pyspark.sql import SQLContext, Row
import logging
sc = SparkContext(appName="db-creator", master="local[*]")
sqc = SQLContext(sc)
logger = sc._jvm.org.apache.log4j
logger.LogManager.getLogger("INFO").setLevel(logger.Level.ERROR)
logger.LogManager.getLogge... | {
"repo_name": "aymen82/SparkImageRecognition",
"path": "projects/state-farm/create-db.py",
"copies": "1",
"size": "3889",
"license": "apache-2.0",
"hash": -3714237832236429300,
"line_mean": 35.6886792453,
"line_max": 118,
"alpha_frac": 0.5690408845,
"autogenerated": false,
"ratio": 3.732245681381... |
__author__ = 'ashabou'
import argparse
import os
import matplotlib.pyplot as plt
from matplotlib.backends.backend_pdf import PdfPages
import numpy as np
import re
from pyspark import SparkContext
from pyspark.sql import SQLContext
from pyspark.mllib.feature import Normalizer, StandardScaler
from pyspark.mllib.recomme... | {
"repo_name": "aymen82/kaggler-competitions-scripts",
"path": "dev/ml-100k/script.py",
"copies": "1",
"size": "7740",
"license": "bsd-3-clause",
"hash": 6466805822790444000,
"line_mean": 33.5535714286,
"line_max": 134,
"alpha_frac": 0.7112403101,
"autogenerated": false,
"ratio": 2.919652961146737... |
__author__ = 'ashabou'
import argparse
import os
import matplotlib.pyplot as plt
from matplotlib.backends.backend_pdf import PdfPages
import pandas as pd
from random import uniform
import numpy as np
from pandas import DataFrame as df
argument_parser = argparse.ArgumentParser()
argument_parser.add_argument("--root-p... | {
"repo_name": "aymen82/kaggler-competitions-scripts",
"path": "dev/rocks-vs-mines/script.py",
"copies": "1",
"size": "2419",
"license": "bsd-3-clause",
"hash": 4496936931537130500,
"line_mean": 25.8777777778,
"line_max": 116,
"alpha_frac": 0.6998759818,
"autogenerated": false,
"ratio": 2.92503022... |
__author__ = 'Ashar Malik'
f = open('dictionary.txt', 'r')
dictionary = f.read().split("\n")
def ces_shift(str, index): #Caesarian shift
str = str.lower()
char_list = []
for char in str:
if not char.isalpha():#ignore non-letters
char_list.append(char)
continue
asc... | {
"repo_name": "asharmalik/Caesar-Cipher-Decoder",
"path": "Cipher.py",
"copies": "1",
"size": "1532",
"license": "apache-2.0",
"hash": -8551643198744929000,
"line_mean": 26.8545454545,
"line_max": 99,
"alpha_frac": 0.6083550914,
"autogenerated": false,
"ratio": 3.3744493392070485,
"config_test"... |
__author__ = 'Ashar Malik'
import csv, time
import smtplib, os
import imaplib
import email
from shutil import rmtree
from email.MIMEMultipart import MIMEMultipart
from email.MIMEBase import MIMEBase
from email.MIMEText import MIMEText
from email.Utils import COMMASPACE, formatdate
from email import Encoders
from os im... | {
"repo_name": "asharmalik/EmailerLite",
"path": "emailerlite.py",
"copies": "1",
"size": "10297",
"license": "apache-2.0",
"hash": -5956263207089413000,
"line_mean": 30.9813664596,
"line_max": 164,
"alpha_frac": 0.5688064485,
"autogenerated": false,
"ratio": 3.817945865776789,
"config_test": fa... |
__author__ = 'asherkhb'
from os import system
from depriciated import config_writers
def runDarkmaster(image_dict, darklist_filename, masterdark_filename, norm_filename,
bot_xo=None, bot_xf=None, bot_yo=None, bot_yf=None,
top_xo=None, top_xf=None, top_yo=None, top_yf=None,
... | {
"repo_name": "acic2015/findr",
"path": "deprecated/run_darkmaster.py",
"copies": "1",
"size": "1969",
"license": "mit",
"hash": 4671566102791164000,
"line_mean": 47.0487804878,
"line_max": 111,
"alpha_frac": 0.5388522092,
"autogenerated": false,
"ratio": 3.7362428842504745,
"config_test": fals... |
__author__ = 'asherkhb'
import os.path
import multiprocessing as mp
import pprint
# Location of darksub and fitscent. If in path can leave, otherwise give path here.
darksub = 'darksub'
fitscent = 'fitscent'
# File Shifts
file_shifts = 'file_shifts.txt'
# Maximum number of parallel processes.
max_processes = 2
# Ju... | {
"repo_name": "acic2015/findr",
"path": "deprecated/run_darksub_fitscent.py",
"copies": "1",
"size": "4790",
"license": "mit",
"hash": -2993255557048280000,
"line_mean": 29.7115384615,
"line_max": 109,
"alpha_frac": 0.611691023,
"autogenerated": false,
"ratio": 3.2607215793056503,
"config_test"... |
__author__ = 'Ashish'
from nltk.tokenize import sent_tokenize
import json
import uuid
class TagTogReader(object):
def __init__(self, file_location):
self.file_location = file_location
self.documents = {}
self.symbols = [',', '.', '(', ')', ':', ';', '[', ']']
self.punctuations = ['.', ',']
self.json_content... | {
"repo_name": "ashishbaghudana/mthesis-ashish",
"path": "miscellaneous/jnlpba2tagtogconverter/TagTogFormat.py",
"copies": "1",
"size": "5926",
"license": "mit",
"hash": -571011975546040700,
"line_mean": 33.0574712644,
"line_max": 172,
"alpha_frac": 0.5968612892,
"autogenerated": false,
"ratio": 2... |
__author__ = 'Ashish'
import pandas as pd
import numpy as np
from pylab import *
#import matplotlib.pyplot as plt
pd.set_option('max_columns', 50)
# pass in column names for each CSV
u_cols = ['user_id', 'age', 'sex', 'occupation', 'zip_code']
users = pd.read_csv('Data\ml-100k\u.user', sep='|', names=u_cols)
r_cols =... | {
"repo_name": "Swaraj1998/MyCode",
"path": "ML-Workshop/day5/analysis2.py",
"copies": "1",
"size": "1665",
"license": "mit",
"hash": -5982947511565101000,
"line_mean": 29.8333333333,
"line_max": 84,
"alpha_frac": 0.627027027,
"autogenerated": false,
"ratio": 2.826825127334465,
"config_test": fa... |
__author__ = 'ashish'
import pandas as pd
import shutil
import sys
import os
import re
import gc
text_features = {'donations.csv': ['donation_message'],
'essays.csv': ['title', 'short_description', 'need_statement', 'essay'],
'resources.csv': ["vendor_name", "project_resou... | {
"repo_name": "ashishsnaik/KDDCup2014",
"path": "kdd_clean_data.py",
"copies": "1",
"size": "2709",
"license": "mit",
"hash": 7743644121689597000,
"line_mean": 29.8705882353,
"line_max": 103,
"alpha_frac": 0.5404208195,
"autogenerated": false,
"ratio": 3.495483870967742,
"config_test": false,
... |
from __future__ import absolute_import, division, print_function
import os
# gpi, future
import gpi
from bart.gpi.borg import IFilePath, OFilePath, Command
# bart
import bart
base_path = bart.__path__[0] # library base for executables
import bart.python.cfl as cfl
class ExternalNode(gpi.NodeAPI):
'''Usage: pic... | {
"repo_name": "nckz/bart",
"path": "gpi/PICS_GPI.py",
"copies": "1",
"size": "2968",
"license": "bsd-3-clause",
"hash": -3354590103709165600,
"line_mean": 29.9166666667,
"line_max": 101,
"alpha_frac": 0.6020889488,
"autogenerated": false,
"ratio": 3.4391657010428736,
"config_test": false,
"ha... |
import numpy as np
import gpi
class ExternalNode(gpi.NodeAPI):
"""Transform coordinates from BNI conventions to BART conventions.
INPUT:
in - a numpy arrary of k-space coordinates in the BNI convention
i.e. (-0.5, 0.5), dimensions: [readouts, pts, xy(z)]
OUTPUT:
out - a numpy ... | {
"repo_name": "nckz/bart",
"path": "gpi/BNI2BART_Traj_GPI.py",
"copies": "1",
"size": "2665",
"license": "bsd-3-clause",
"hash": -332524509410624900,
"line_mean": 33.6103896104,
"line_max": 95,
"alpha_frac": 0.5868667917,
"autogenerated": false,
"ratio": 3.8125894134477827,
"config_test": false... |
__author__ = 'Ash'
import numpy as np
import time
import http.client, urllib.parse
from pprint import pprint
API_KEY = ["H671BFO41N0TP246", "VJEFXKQ0AE4LD80D", "QPHVEZKYTKYNXOQZ"]
n_spine = [8, 8, 1]
means = [65, 55, 60, 58, 52, 60, 70, 50]
fields = list(map(lambda x: "field"+x, map(str, range(1, 9))))
headers = {"Con... | {
"repo_name": "jcuroboclub/White-Roofs",
"path": "fakeData.py",
"copies": "1",
"size": "1152",
"license": "mit",
"hash": -7371103323866162000,
"line_mean": 32.9117647059,
"line_max": 79,
"alpha_frac": 0.5529513889,
"autogenerated": false,
"ratio": 3.272727272727273,
"config_test": false,
"has... |
__author__ = 'ash'
from collections import deque
from sys import maxint
import copy
class Edge:
def __init__(self,node_pair):
self.node_pair = node_pair
def init_weights(self):
"""
Was made because YAML inits only the given fields
"""
self.bandhist = deque()
... | {
"repo_name": "ashepelev/TopologyWeigher",
"path": "source/topology_weigher/TopologyWeigher/Edge.py",
"copies": "1",
"size": "2943",
"license": "apache-2.0",
"hash": 2932807077492739000,
"line_mean": 34.9024390244,
"line_max": 128,
"alpha_frac": 0.584777438,
"autogenerated": false,
"ratio": 3.768... |
__author__ = 'ash'
from collections import deque
from sys import maxint
class Edge:
def __init__(self,node_pair,maxb):
self.node_pair = node_pair
self.maxb = maxb
def init_weights(self):
"""
Was made because YAML inits only the given fields
"""
self.bandhist ... | {
"repo_name": "ashepelev/TopologyWeigher",
"path": "test_framework/Edge.py",
"copies": "1",
"size": "3075",
"license": "apache-2.0",
"hash": 451137867327215400,
"line_mean": 33.5617977528,
"line_max": 128,
"alpha_frac": 0.5798373984,
"autogenerated": false,
"ratio": 3.8198757763975157,
"config_... |
__author__ = 'ash'
from oslo.config import cfg
from nova.scheduler import weights
from nova.db import api as db_api
from nova.openstack.common import log as logging
import TopologyWeigher.utils as topoutils
from TopologyWeigher.BandwidthHistory import BandwidthHistory as BandwidthHistory
from TopologyWeigher.Schedul... | {
"repo_name": "ashepelev/TopologyWeigher",
"path": "source/topology_weigher/topology.py",
"copies": "1",
"size": "5922",
"license": "apache-2.0",
"hash": -4144208654003840500,
"line_mean": 41.3,
"line_max": 108,
"alpha_frac": 0.6501182033,
"autogenerated": false,
"ratio": 4.23,
"config_test": f... |
__author__ = 'ash'
import networkx as nx
import matplotlib.pyplot as plt
class GraphDrawer:
def __init__(self, node_list, edges_list):
self.nodes = node_list
self.edges = edges_list
def get_edges(self):
"""
Extracts pairs of nodes from the Edge objects
"""
ed... | {
"repo_name": "ashepelev/TopologyWeigher",
"path": "test_framework/GraphDrawer.py",
"copies": "1",
"size": "2735",
"license": "apache-2.0",
"hash": -4982703674246230000,
"line_mean": 30.4482758621,
"line_max": 77,
"alpha_frac": 0.526142596,
"autogenerated": false,
"ratio": 3.8684582743988685,
"... |
__author__ = 'ash'
import Node
import Edge
import YamlDoc
from Scheduler import Task
import socket
import fcntl
from struct import *
from nova import db
from nova.openstack.common import log as logging
LOG = logging.getLogger(__name__)
def get_topology(path=None,nodes_file = "nodes.yaml", edges_file = "edges.yaml")... | {
"repo_name": "ashepelev/TopologyWeigher",
"path": "source/topology_weigher/TopologyWeigher/utils.py",
"copies": "1",
"size": "6556",
"license": "apache-2.0",
"hash": -7708099360426881000,
"line_mean": 29.4930232558,
"line_max": 105,
"alpha_frac": 0.6191275168,
"autogenerated": false,
"ratio": 3.... |
__author__ = 'ash'
import Node
import YamlDoc
import socket
import fcntl
from struct import *
from time import sleep
from nova.openstack.common import log as logging
LOG = logging.getLogger(__name__)
def get_topology(path=None,nodes_file = "nodes.yaml", edges_file = "edges.yaml"):
"""
Gets the information a... | {
"repo_name": "ashepelev/TopologyWeigher",
"path": "source/traffic_monitor/TopologyWeigher/utils.py",
"copies": "1",
"size": "4966",
"license": "apache-2.0",
"hash": -3655082678123608600,
"line_mean": 30.0375,
"line_max": 136,
"alpha_frac": 0.625453081,
"autogenerated": false,
"ratio": 3.54714285... |
__author__ = 'ash'
import numpy as np
from sets import Set
import sys
#import pulp
import Node
class Task:
def __init__(self,vm_dep_list,storage_priority,public_priority):
self.vm_dep_list = vm_dep_list
self.storage_priority = storage_priority
self.public_priority = public_priority
@... | {
"repo_name": "ashepelev/TopologyWeigher",
"path": "test_framework/Scheduler.py",
"copies": "1",
"size": "6401",
"license": "apache-2.0",
"hash": 3921595605400946000,
"line_mean": 32.3385416667,
"line_max": 123,
"alpha_frac": 0.5267926886,
"autogenerated": false,
"ratio": 3.80785246876859,
"con... |
__author__ = 'ash'
import random
import time
class TrafficGen:
def __init__(self, node_list, bwhist):
self.node_list = node_list
#self.start = time.clock()
self.traffic = dict()
self.bw_hist = bwhist
self.bw_refresh = 2
self.bw_id = 0 # this field is required for ... | {
"repo_name": "ashepelev/TopologyWeigher",
"path": "test_framework/TrafficGen.py",
"copies": "1",
"size": "2990",
"license": "apache-2.0",
"hash": 5452045898563247000,
"line_mean": 36.8607594937,
"line_max": 153,
"alpha_frac": 0.5444816054,
"autogenerated": false,
"ratio": 3.9707835325365206,
"... |
__author__ = 'ash'
import Scheduler
import Edge
class BandwidthHistory:
def __init__(self,node_list,edge_list):
#self.hist = dict()
sched = Scheduler.Scheduler(node_list, edge_list)
self.route_matrix = sched.calc_routes()
for x in edge_list: # initiate weights with default values
... | {
"repo_name": "ashepelev/TopologyWeigher",
"path": "test_framework/BandwidthHistory.py",
"copies": "1",
"size": "1066",
"license": "apache-2.0",
"hash": -2486157133299029000,
"line_mean": 27.8108108108,
"line_max": 91,
"alpha_frac": 0.5900562852,
"autogenerated": false,
"ratio": 3.472312703583062... |
__author__ = 'ash'
class Node:
"""
Parent for all topology classes
"""
def __init__(self, vid):
self.id = vid # characterized only by id
# def add_neighbours_by_one(self, n):
# self.neighbours.append(n)
# def set_neighbours(self, neigh_list):
# self.neighbours = neigh_lis... | {
"repo_name": "ashepelev/TopologyWeigher",
"path": "source/topology_weigher/TopologyWeigher/Node.py",
"copies": "1",
"size": "1787",
"license": "apache-2.0",
"hash": -180052391738404960,
"line_mean": 20.0235294118,
"line_max": 67,
"alpha_frac": 0.5478455512,
"autogenerated": false,
"ratio": 3.490... |
__author__ = 'Ashoo'
import pandas as pd
import numpy as np
import matplotlib.pyplot as plt
import seaborn as sns
import scipy.stats
import warnings
sns.set(color_codes=True)
# Reading the data where low_memory=False increases the program efficiency
data= pd.read_csv("gapminder.csv", low_memory=False)
# setting variab... | {
"repo_name": "duttashi/Data-Analysis-Visualization",
"path": "scripts/general/chiSquareTest.py",
"copies": "1",
"size": "3347",
"license": "mit",
"hash": 9043964226844690000,
"line_mean": 32.8080808081,
"line_max": 102,
"alpha_frac": 0.7242306543,
"autogenerated": false,
"ratio": 2.8364406779661... |
__author__ = 'ashwin'
__email__ = 'gashwin1@umbc.edu'
"""
All Test Code.
"""
from lib.models.classify import NaiveBayes
data_sep = ","
elim_var = ['$continuous$']
def test_naive_bayes(train_file_reader, test_file_reader):
# Create a Bernoulli NB.
naive_bayes = NaiveBayes()
# Vectorize the training data ... | {
"repo_name": "codehacken/Kb4ML",
"path": "lib/test.py",
"copies": "1",
"size": "2393",
"license": "mit",
"hash": -4860071327679453000,
"line_mean": 38.2295081967,
"line_max": 100,
"alpha_frac": 0.5620559967,
"autogenerated": false,
"ratio": 3.733229329173167,
"config_test": true,
"has_no_key... |
__author__ = 'Ashwin'
__email__ = 'gashwin1@umbc.edu'
"""
Basic LDA module that is used in the project.
"""
import re
from gensim import corpora, models
import operator
class LDAVisualModel:
def __init__(self, word_corpus):
"""
The LDAVisualModel requires list of word lists from the
docum... | {
"repo_name": "codehacken/LDAExplore",
"path": "processdata/lda.py",
"copies": "1",
"size": "4195",
"license": "mit",
"hash": -1563422881210270200,
"line_mean": 33.1056910569,
"line_max": 102,
"alpha_frac": 0.5463647199,
"autogenerated": false,
"ratio": 3.7522361359570664,
"config_test": false,... |
__author__ = 'ashwin'
__email__ = 'gashwin1@umbc.edu'
""""
Implement Standard classifiers.
"""
# Implementing the std. Naive Bayes Algorithm.
# Classification is based on Maximum-Likelihood for selecting the final class.
from sklearn.feature_extraction import DictVectorizer
from sklearn.naive_bayes import BernoulliNB... | {
"repo_name": "codehacken/Kb4ML",
"path": "lib/models/classify.py",
"copies": "1",
"size": "4185",
"license": "mit",
"hash": -5811608597094135000,
"line_mean": 36.3660714286,
"line_max": 118,
"alpha_frac": 0.6384707288,
"autogenerated": false,
"ratio": 3.777075812274368,
"config_test": false,
... |
__author__ = 'Ashwin'
__email__ = 'gashwin1@umbc.edu'
"""
Perform basic file operations that can be used to feed the corpus into
other models such as LDA.
The module uses NLTK's english language tokenizer and stop word
list to clear the document's and generate a set of tokens.
"""
'''
Using nltk to clear stopwords f... | {
"repo_name": "codehacken/LDAExplore",
"path": "processdata/fileops.py",
"copies": "1",
"size": "5671",
"license": "mit",
"hash": -8919080193711374000,
"line_mean": 31.591954023,
"line_max": 111,
"alpha_frac": 0.5780285664,
"autogenerated": false,
"ratio": 3.687256176853056,
"config_test": fals... |
__author__ = 'ashwin'
__email__ = 'gashwin1@umbc.edu'
""""
Standard File Operations.
"""
class FileReader:
def __init__(self, column_var={}, idx2var=[], class_var_name="Classify"):
self.col_var = column_var
self.idx2var = idx2var
self.class_var = class_var_name
# Dispatch table t... | {
"repo_name": "codehacken/Kb4ML",
"path": "lib/stdops/fileops.py",
"copies": "1",
"size": "4563",
"license": "mit",
"hash": -4522964104592991700,
"line_mean": 35.504,
"line_max": 97,
"alpha_frac": 0.5559938637,
"autogenerated": false,
"ratio": 3.796173044925125,
"config_test": false,
"has_no_... |
"""Splunk implementation of the DocManager interface.
Receives documents from an OplogThread and takes the appropriate actions on
Splunk.
"""
import logging
from threading import Timer
import bson.json_util
from mongo_connector import errors
from mongo_connector.constants import (DEFAULT_COMMIT_INTERVAL,
... | {
"repo_name": "asifhj/mongo-connector",
"path": "mongo_connector/doc_managers/splunk_doc_manager.py",
"copies": "1",
"size": "7923",
"license": "apache-2.0",
"hash": 7844574321847292000,
"line_mean": 36.9138755981,
"line_max": 117,
"alpha_frac": 0.5863940427,
"autogenerated": false,
"ratio": 4.18... |
__author__ = 'asifj'
import logging
from kafka import KafkaConsumer
from pymongo import MongoClient
import re
import json
import traceback
import sys
logging.basicConfig(
format='%(asctime)s.%(msecs)s:%(name)s:%(thread)d:%(levelname)s:%(process)d:%(message)s',
level=logging.INFO
)
DB_VM_MONGO_... | {
"repo_name": "asifhj/Python_SOAP_OSSJ_SAP_Fusion_Kafka_Spark_HBase",
"path": "KafkaConsumerDEV-SAPNotesTopic.py",
"copies": "1",
"size": "3074",
"license": "apache-2.0",
"hash": 7600251682130696000,
"line_mean": 33.3333333333,
"line_max": 164,
"alpha_frac": 0.5718932986,
"autogenerated": false,
... |
__author__ = 'asifj'
import requests
from pymongo import MongoClient
from bson import Binary, Code
import json
import csv
import traceback
import logging
from tabulate import tabulate
import datetime
logging.basicConfig(
format='%(asctime)s.%(msecs)s:%(name)s:%(thread)d:%(levelname)s:%(process)d:%(mess... | {
"repo_name": "asifhj/Python_SOAP_OSSJ_SAP_Fusion_Kafka_Spark_HBase",
"path": "srDetails.py",
"copies": "1",
"size": "52967",
"license": "apache-2.0",
"hash": -2022940697461366000,
"line_mean": 59.805134189,
"line_max": 209,
"alpha_frac": 0.5164347613,
"autogenerated": false,
"ratio": 4.458501683... |
__author__ = 'asifj'
import requests
from pymongo import MongoClient
import json
import csv
import traceback
import logging
from tabulate import tabulate
from bson.json_util import dumps
client = MongoClient('10.219.48.134', 27017)
#client = MongoClient('192.168.56.101', 27017)
db = client['ImportedEvents_... | {
"repo_name": "asifhj/Python_SOAP_OSSJ_SAP_Fusion_Kafka_Spark_HBase",
"path": "srAttachements-insert.py",
"copies": "1",
"size": "1313",
"license": "apache-2.0",
"hash": 6190701168526998000,
"line_mean": 30.0243902439,
"line_max": 63,
"alpha_frac": 0.6405178979,
"autogenerated": false,
"ratio": 3... |
__author__ = 'asifj'
import requests
from pymongo import MongoClient
import json
import csv
import traceback
import logging
from tabulate import tabulate
from bson.json_util import dumps
logging.basicConfig(
format='%(asctime)s.%(msecs)s:%(name)s:%(thread)d:%(levelname)s:%(process)d:%(message)s',
l... | {
"repo_name": "asifhj/Python_SOAP_OSSJ_SAP_Fusion_Kafka_Spark_HBase",
"path": "caseNotes.py",
"copies": "1",
"size": "10945",
"license": "apache-2.0",
"hash": -5050272015149065000,
"line_mean": 47.0807174888,
"line_max": 160,
"alpha_frac": 0.4727272727,
"autogenerated": false,
"ratio": 4.55093555... |
__author__ = 'asifj'
import requests
from pymongo import MongoClient
import json
import csv
import traceback
import logging
from tabulate import tabulate
logging.basicConfig(
format='%(asctime)s.%(msecs)s:%(name)s:%(thread)d:%(levelname)s:%(process)d:%(message)s',
level=logging.DEBUG
)
class HBa... | {
"repo_name": "asifhj/Python_SOAP_OSSJ_SAP_Fusion_Kafka_Spark_HBase",
"path": "customerMaster.py",
"copies": "1",
"size": "29036",
"license": "apache-2.0",
"hash": -4879155310968164000,
"line_mean": 68.3050847458,
"line_max": 197,
"alpha_frac": 0.5201818432,
"autogenerated": false,
"ratio": 4.803... |
__author__ = 'asifj'
import logging
from kafka import KafkaConsumer
import json
import traceback
from bson.json_util import dumps
from kafka import SimpleProducer, KafkaClient
from utils import Utils
logging.basicConfig(
format='%(asctime)s.%(msecs)s:%(name)s:%(thread)d:%(levelname)s:%(process)d:%(me... | {
"repo_name": "asifhj/Python_SOAP_OSSJ_SAP_Fusion_Kafka_Spark_HBase",
"path": "KafkaCP.py",
"copies": "1",
"size": "2510",
"license": "apache-2.0",
"hash": 1918513525047149800,
"line_mean": 37.21875,
"line_max": 181,
"alpha_frac": 0.4928286853,
"autogenerated": false,
"ratio": 4.312714776632302,
... |
__author__ = 'asifj'
import requests
from pymongo import MongoClient
import json
import csv
import traceback
import logging
from tabulate import tabulate
from bson.json_util import dumps
client = MongoClient('10.219.48.134', 27017)
#client = MongoClient('192.168.56.101', 27017)
db = client['ImportedEvent... | {
"repo_name": "asifhj/Python_SOAP_OSSJ_SAP_Fusion_Kafka_Spark_HBase",
"path": "srDates-insert.py",
"copies": "1",
"size": "1259",
"license": "apache-2.0",
"hash": 6901324190817669000,
"line_mean": 28.7073170732,
"line_max": 63,
"alpha_frac": 0.6282764098,
"autogenerated": false,
"ratio": 3.393530... |
__author__ = 'Asish Mahapatra: asishkm@gmail.com'
import requests
import re
import os
import img2pdf
from multiprocessing import Process, Manager
import sys
# works only when the scribd document is composed solely of images (.jpg)
img_folder = './images'
DEBUG = True
output_folder = ''
json_pattern = re.compile(... | {
"repo_name": "kluge-iitk/Scribd_Image_Downloader",
"path": "scribd_downloader.py",
"copies": "1",
"size": "4027",
"license": "mit",
"hash": -2268019747635987200,
"line_mean": 25.3202614379,
"line_max": 82,
"alpha_frac": 0.5723863919,
"autogenerated": false,
"ratio": 3.3446843853820596,
"config... |
__author__ = 'Asish Mahapatra: asishkm@gmail.com'
import requests
import re
import os
import img2pdf
from multiprocessing import Process, Manager
import time
json_pattern = re.compile(r'https.*scribdassets.*jsonp')
img_pattern = re.compile(r'orig.*(http.*scribd.{,45}jpg)')
patterns = {'jpg': re.compile(r'([0-9]*)-.*... | {
"repo_name": "kluge-iitk/Scribd_Image_Downloader",
"path": "scribd_downloader1.py",
"copies": "1",
"size": "4727",
"license": "mit",
"hash": 3555740545377851400,
"line_mean": 24.8306010929,
"line_max": 72,
"alpha_frac": 0.5722445526,
"autogenerated": false,
"ratio": 3.511887072808321,
"config_... |
from collections import Counter
import jellyfish
import scipy.stats
from scipy import integrate
import numpy as np
import datetime
import math
#Each function takes two inputs and give back a feature score (a distance measure)
def levenshtein_similarity(s, t):
""" Levenshtein Similarity """
Ns = len(s);
... | {
"repo_name": "YongchaoShang/tika-img-similarity",
"path": "features.py",
"copies": "2",
"size": "2683",
"license": "apache-2.0",
"hash": -8946976321610435000,
"line_mean": 23.1711711712,
"line_max": 125,
"alpha_frac": 0.6880357808,
"autogenerated": false,
"ratio": 3.1902497027348393,
"config_t... |
import itertools
import features as feat
import math
import re
#split a string when we see a transition from one type to another say alpha, numeric, spl chars.
def break_natural_boundaries(string):
stringbreak=[]
if len(string.split(' ')) > 1:
stringbreak = string.split(' ')
else:
spl = '... | {
"repo_name": "harsham05/tika-similarity",
"path": "metalevenshtein.py",
"copies": "2",
"size": "5214",
"license": "apache-2.0",
"hash": 6021096736705333000,
"line_mean": 35.4615384615,
"line_max": 159,
"alpha_frac": 0.6300345224,
"autogenerated": false,
"ratio": 3.464451827242525,
"config_test... |
import nltk
import string
import os
from stemming.porter2 import stem
import io
import sys
import argparse
import csv
import features as feat
# A class to do stylstic extractions from text: To use programatically, initialize the class. This will calculate different kinds of stylistic features from the text,
# eg. ... | {
"repo_name": "YongchaoShang/tika-img-similarity",
"path": "psykey.py",
"copies": "4",
"size": "6723",
"license": "apache-2.0",
"hash": 5051461476537124000,
"line_mean": 36.1436464088,
"line_max": 174,
"alpha_frac": 0.6199613268,
"autogenerated": false,
"ratio": 3.9155503785672683,
"config_test... |
import os
import argparse
import cv2 as cv
from DetectorAPI import DetectorAPI
def blurBoxes(image, boxes):
"""
Argument:
image -- the image that will be edited as a matrix
boxes -- list of boxes that will be blurred, each box must be int the format (x_top_left, y_top_left, x_bottom_right, y_bottom_ri... | {
"repo_name": "grycap/scar",
"path": "examples/mask-detector-workflow/blurry-faces/src/auto_blur_image.py",
"copies": "1",
"size": "3111",
"license": "apache-2.0",
"hash": 4831196582019585000,
"line_mean": 28.9134615385,
"line_max": 137,
"alpha_frac": 0.568948891,
"autogenerated": false,
"ratio":... |
import os
import argparse
import cv2 as cv
def blurBoxes(image, boxes):
"""
Argument:
image -- the image that will be edited as a matrix
boxes -- list of boxes that will be blurred, each box must be int the format (x_top_left, y_top_left, width, height)
Returns:
image -- the blurred imag... | {
"repo_name": "grycap/scar",
"path": "examples/mask-detector-workflow/blurry-faces/src/manual_blur_image.py",
"copies": "1",
"size": "2676",
"license": "apache-2.0",
"hash": -5675342359476043000,
"line_mean": 28.4065934066,
"line_max": 120,
"alpha_frac": 0.5904334828,
"autogenerated": false,
"rat... |
__author__ = 'as'
from bs4 import BeautifulSoup
import json
import sqlite3
import urllib.request
import urllib.parse
import urllib.error
import urllib
import os
from urllib.request import urlretrieve
mapsURL = "http://archives.bulbagarden.net/w/index.php?title=Special:Search&limit=1000&offset=0&profile=images&search... | {
"repo_name": "foxtrot94/ECE-Pokedex",
"path": "Scrapper/scrapper_maps.py",
"copies": "1",
"size": "2269",
"license": "mit",
"hash": -4508411977283524000,
"line_mean": 29.6621621622,
"line_max": 127,
"alpha_frac": 0.6831203173,
"autogenerated": false,
"ratio": 3.4907692307692306,
"config_test":... |
__author__ = 'as'
from bs4 import BeautifulSoup
import json
import sqlite3
import urllib.request
import urllib.parse
import urllib.error
# Needed to convert names with accents to normal
from unidecode import unidecode
# Learn how to scrape from website!
conn = sqlite3.connect('..//database/pokedex.sqlite3')
c = con... | {
"repo_name": "foxtrot94/ECE-Pokedex",
"path": "Scrapper/scrapper_national_id.py",
"copies": "1",
"size": "3403",
"license": "mit",
"hash": -8987059250710883000,
"line_mean": 31.1037735849,
"line_max": 130,
"alpha_frac": 0.7178959741,
"autogenerated": false,
"ratio": 3.3962075848303392,
"config... |
__author__ = 'as'
# from __future__ import print_function
from PIL import Image
from PIL import ImageFileIO
import os
import fnmatch
#
# im = Image.open('Fighter-Front.gif')
# transparency = im.info['transparency']
# im.save('test1.png', transparency=transparency)
#
# im.seek(im.tell()+1)
# transparency = im.info['tr... | {
"repo_name": "foxtrot94/ECE-Pokedex",
"path": "Scrapper/gifToPng.py",
"copies": "1",
"size": "1804",
"license": "mit",
"hash": -3303035394453629400,
"line_mean": 23.7260273973,
"line_max": 76,
"alpha_frac": 0.6435698448,
"autogenerated": false,
"ratio": 3.0016638935108153,
"config_test": false... |
__author__ = 'as'
import bs4
import json
import sqlite3
# scrapper populates the following tables: moves, category, types
#
# used to place what the current generation is, (currently gen 6)
currentGeneration = 6
with open("pokemon.json") as data_file:
data = json.load(data_file)
conn = sqlite3.connect('..//da... | {
"repo_name": "foxtrot94/ECE-Pokedex",
"path": "Scrapper/scrapper_moves.py",
"copies": "1",
"size": "3502",
"license": "mit",
"hash": 5972386433846345000,
"line_mean": 30.2767857143,
"line_max": 121,
"alpha_frac": 0.663335237,
"autogenerated": false,
"ratio": 3.7215727948990436,
"config_test": ... |
__author__ = 'as'
import bs4
import json
import sqlite3
with open("pokemon.json") as data_file:
data = json.load(data_file)
conn = sqlite3.connect('../database/pokedex.sqlite3')
c = conn.cursor()
c.execute("delete from " + "pokemon_abilities")
# this file could possibly "inherit" from "scrapper_pokemon"...
# f... | {
"repo_name": "foxtrot94/ECE-Pokedex",
"path": "Scrapper/scrapper_pokemonAbilities.py",
"copies": "1",
"size": "1105",
"license": "mit",
"hash": -8759316399337368000,
"line_mean": 34.6451612903,
"line_max": 115,
"alpha_frac": 0.7330316742,
"autogenerated": false,
"ratio": 3.4423676012461057,
"c... |
__author__ = 'as'
import bs4;
import sqlite3;
import json;
#import pykemon
### RANDOM CRAP
#pokemonHeight = type(pokemons["alts"][0]["height"])
#len(genArray)
#int(pokemonHeight)
#print(height) #checks the data type
###
# used to place what the current generation is, (currently gen 6)
currentGenera... | {
"repo_name": "foxtrot94/ECE-Pokedex",
"path": "Scrapper/scrapper_pokemon.py",
"copies": "1",
"size": "3113",
"license": "mit",
"hash": -3484669600206293000,
"line_mean": 29.2330097087,
"line_max": 335,
"alpha_frac": 0.5888210729,
"autogenerated": false,
"ratio": 3.7415865384615383,
"config_tes... |
__author__ = 'as'
import sqlite3
## Function that either takes an exact pokemon Name, or pokemonNationalID and returns the pokemonUniqueID
## In the case of megas, of various forms that share the same name, or ID all will be returned
## To use from Scrapper import function_pokemonID
# Connect to database by the sec... | {
"repo_name": "foxtrot94/ECE-Pokedex",
"path": "Scrapper/function_pokemonID.py",
"copies": "1",
"size": "2417",
"license": "mit",
"hash": 2642649068800548000,
"line_mean": 40.6724137931,
"line_max": 138,
"alpha_frac": 0.7662391394,
"autogenerated": false,
"ratio": 3.5130813953488373,
"config_te... |
__author__ = 'as'
# This file:
# 1) finds the generation the pokemon first appeared in,
# 2) links the pokemonID to NationalID,
# 3) links type to typeID
# 4) links ability to abilityID
import json
import bs4
import sqlite3
from Scrapper import function_pokemonID
# Open the json file
with open("pokemon.json") as da... | {
"repo_name": "foxtrot94/ECE-Pokedex",
"path": "Scrapper/scrapper_pokemonTypes.py",
"copies": "1",
"size": "2685",
"license": "mit",
"hash": 1070691331694013200,
"line_mean": 30.6,
"line_max": 137,
"alpha_frac": 0.6629422719,
"autogenerated": false,
"ratio": 3.8302425106990015,
"config_test": f... |
__author__ = 'AssadMahmood'
import os
import requests
from asposecloud import Product
from asposecloud.common import Utils
class Folder:
"""
Wrapper class for Aspose for Cloud Storage API.
The Aspose for Cloud File Storage API let's you upload and download files for use with our Product APIs.
"""
... | {
"repo_name": "asposeforcloud/Aspose_Cloud_SDK_For_Python",
"path": "asposecloud/storage.py",
"copies": "1",
"size": "7339",
"license": "mit",
"hash": 5504752519129291000,
"line_mean": 38.4569892473,
"line_max": 114,
"alpha_frac": 0.6132988146,
"autogenerated": false,
"ratio": 3.792764857881137,
... |
__author__ = 'AssadMahmood'
import requests
import hmac
import hashlib
import re
import string
import os
import json
from urlparse import urlparse
from asposecloud import AsposeApp
from asposecloud import Product
class Utils:
"""
A common collection of utility function to perform various tasks.
"""
... | {
"repo_name": "asposeforcloud/Aspose_Cloud_SDK_For_Python",
"path": "asposecloud/common.py",
"copies": "1",
"size": "6419",
"license": "mit",
"hash": -2058735620956643800,
"line_mean": 31.9179487179,
"line_max": 118,
"alpha_frac": 0.5704938464,
"autogenerated": false,
"ratio": 4.101597444089457,
... |
__author__ = 'AssadMahmood'
import requests
import json
import os.path
from asposecloud import AsposeApp
from asposecloud import Product
from asposecloud.common import Utils
class Document:
"""
Wrapper class for Aspose.PDF API Document Resource.
The Aspose.PDF API let's you manipulate PDF files.
"""
... | {
"repo_name": "asposeforcloud/Aspose_Cloud_SDK_For_Python",
"path": "asposecloud/pdf/__init__.py",
"copies": "1",
"size": "60440",
"license": "mit",
"hash": -279800195546893120,
"line_mean": 35.8536585366,
"line_max": 129,
"alpha_frac": 0.5770350761,
"autogenerated": false,
"ratio": 4.08488780751... |
__author__ = 'AssadMahmood'
import requests
import json
from asposecloud import AsposeApp
from asposecloud import Product
from asposecloud.common import Utils
# ========================================================================
# DOCUMENT CLASS
# =================================================================... | {
"repo_name": "asposeforcloud/Aspose_Cloud_SDK_For_Python",
"path": "asposecloud/words/__init__.py",
"copies": "1",
"size": "56910",
"license": "mit",
"hash": -6134324245572024000,
"line_mean": 35.2484076433,
"line_max": 131,
"alpha_frac": 0.5674398173,
"autogenerated": false,
"ratio": 4.08161801... |
__author__ = 'AssadMahmood'
import requests
import json
from asposecloud import AsposeApp
from asposecloud import Product
from asposecloud.common import Utils
# ========================================================================
# EXTRACTOR CLASS
# ===============================================================... | {
"repo_name": "asposeforcloud/Aspose_Cloud_SDK_For_Python",
"path": "asposecloud/slides/__init__.py",
"copies": "1",
"size": "42867",
"license": "mit",
"hash": -400411937884812740,
"line_mean": 35.7957081545,
"line_max": 151,
"alpha_frac": 0.5720017729,
"autogenerated": false,
"ratio": 4.08919202... |
__author__ = 'AssadMahmood'
import requests
import json
from asposecloud import AsposeApp
from asposecloud import Product
from asposecloud.common import Utils
# ========================================================================
# WORKSHEET CLASS
# ================================================================... | {
"repo_name": "asposeforcloud/Aspose_Cloud_SDK_For_Python",
"path": "asposecloud/cells/__init__.py",
"copies": "1",
"size": "116739",
"license": "mit",
"hash": -3800899888527085000,
"line_mean": 36.3445297505,
"line_max": 155,
"alpha_frac": 0.5711715879,
"autogenerated": false,
"ratio": 4.0527339... |
__author__ = 'AssadMahmood'
import requests
import os
from asposecloud import Product
from asposecloud.common import Utils
class Builder:
"""
Wrapper class for Aspose.Barcode for Cloud API.
The Aspose.Barcode for Cloud let's you generate Barcodes.
"""
def __init__(self):
self.base_uri = ... | {
"repo_name": "asposeforcloud/Aspose_Cloud_SDK_For_Python",
"path": "asposecloud/barcode/__init__.py",
"copies": "1",
"size": "9386",
"license": "mit",
"hash": -4105530374753272300,
"line_mean": 35.5214007782,
"line_max": 130,
"alpha_frac": 0.5904538675,
"autogenerated": false,
"ratio": 3.6880157... |
__author__ = 'AssadMahmood'
import requests
from asposecloud import Product
from asposecloud.common import Utils
class Extractor:
"""
Wrapper class for Aspose.OCR for Cloud API.
The Aspose.OCR for Cloud let's you extract text from image.
"""
def __init__(self, filename):
self.filename = ... | {
"repo_name": "asposeforcloud/Aspose_Cloud_SDK_For_Python",
"path": "asposecloud/ocr/__init__.py",
"copies": "1",
"size": "3084",
"license": "mit",
"hash": -2229402053814823000,
"line_mean": 30.793814433,
"line_max": 118,
"alpha_frac": 0.5771725032,
"autogenerated": false,
"ratio": 3.845386533665... |
__author__ = 'AssadMahmood'
import unittest
import asposecloud
import os.path
import json
from asposecloud.storage import Folder
from asposecloud.cells import Converter
from asposecloud.cells import Workbook
from asposecloud.cells import Worksheet
class TestAsposeCells(unittest.TestCase):
def setUp(self):
... | {
"repo_name": "asposeforcloud/Aspose_Cloud_SDK_For_Python",
"path": "test/test_aspose_cells.py",
"copies": "1",
"size": "5608",
"license": "mit",
"hash": -5273983225701664000,
"line_mean": 32.9878787879,
"line_max": 74,
"alpha_frac": 0.6223252496,
"autogenerated": false,
"ratio": 3.67496723460026... |
__author__ = 'AssadMahmood'
import unittest
import asposecloud
import os.path
import json
from asposecloud.storage import Folder
from asposecloud.common import Utils
class TestAsposeStorage(unittest.TestCase):
def setUp(self):
with open('setup.json') as json_file:
data = json.load(json_file)... | {
"repo_name": "asposeforcloud/Aspose_Cloud_SDK_For_Python",
"path": "test/test_aspose_storage.py",
"copies": "1",
"size": "1231",
"license": "mit",
"hash": 5404796034206046000,
"line_mean": 30.5641025641,
"line_max": 106,
"alpha_frac": 0.6580016247,
"autogenerated": false,
"ratio": 3.428969359331... |
__author__ = 'assadmahmood'
import requests
import json
from asposecloud import Product
from asposecloud import AsposeApp
from asposecloud.common import Utils
class Assignments:
def __init__(self, filename):
self.filename = filename
if not filename:
raise ValueError("filename not s... | {
"repo_name": "asposeforcloud/Aspose_Cloud_SDK_For_Python",
"path": "asposecloud/tasks/__init__.py",
"copies": "1",
"size": "29291",
"license": "mit",
"hash": 3293058250371579400,
"line_mean": 34.7643467643,
"line_max": 118,
"alpha_frac": 0.5766276331,
"autogenerated": false,
"ratio": 4.004237867... |
__author__ = 'assadmahmood'
import requests
from asposecloud import AsposeApp
from asposecloud import Product
from asposecloud.common import Utils
# ========================================================================
# DOCUMENT CLASS
# ========================================================================
cl... | {
"repo_name": "asposeforcloud/Aspose_Cloud_SDK_For_Python",
"path": "asposecloud/imaging/__init__.py",
"copies": "1",
"size": "37583",
"license": "mit",
"hash": 8700172759326975000,
"line_mean": 34.5562913907,
"line_max": 134,
"alpha_frac": 0.5634196312,
"autogenerated": false,
"ratio": 4.0882192... |
__author__ = 'astar'
from sentiment_classifier import SentimentClassifier
from codecs import open
import time
from flask import Flask, render_template, request
app = Flask(__name__)
print "Preparing classifier for sentiment analysis demo"
start_time = time.time()
classifier = SentimentClassifier()
print "Classifier is... | {
"repo_name": "astarostin/MachineLearningSpecializationCoursera",
"path": "course6/week4/demo.py",
"copies": "1",
"size": "1044",
"license": "apache-2.0",
"hash": -5941586927611551000,
"line_mean": 31.625,
"line_max": 99,
"alpha_frac": 0.6925287356,
"autogenerated": false,
"ratio": 3.503355704697... |
__author__ = 'astyler'
from sklearn.preprocessing import StandardScaler
from sklearn.neighbors import NearestNeighbors
import math
import numpy as np
class TripPredictor(object):
def __init__(self, trip, features, feature_weights):
self.features = features
self.feature_weights = feature_weights
... | {
"repo_name": "astyler/hybridpy",
"path": "hybridpy/learning/ensemblepredictor.py",
"copies": "1",
"size": "2387",
"license": "mit",
"hash": -3697026867521184300,
"line_mean": 37.5,
"line_max": 139,
"alpha_frac": 0.6476749057,
"autogenerated": false,
"ratio": 3.807017543859649,
"config_test": f... |
__author__ = 'astyler'
import math
from hybridpy.models.batteries import IdealBattery
class Vehicle(object):
def get_power(self, speed_init, accleration, elevation, gradient, duration):
return 0
class Car(Vehicle):
def __init__(self, mass=1200, cross_area=1.988, drag_coefficient=0.31, rolling_resist... | {
"repo_name": "astyler/hybridpy",
"path": "hybridpy/models/vehicles.py",
"copies": "1",
"size": "2261",
"license": "mit",
"hash": -8714274310161937000,
"line_mean": 34.8888888889,
"line_max": 118,
"alpha_frac": 0.62804069,
"autogenerated": false,
"ratio": 3.3746268656716416,
"config_test": fals... |
__author__ = 'astyler'
import math
class IdealBattery(object):
# forget voltage and consider battery as a bucket of wH
def __init__(self, max_energy_wh=10000.0, voltage=90, name='ideal'):
self.max_energy_wh = max_energy_wh
self.voltage = voltage
self.name = name
def compute_voltag... | {
"repo_name": "astyler/hybridpy",
"path": "hybridpy/models/batteries.py",
"copies": "1",
"size": "1876",
"license": "mit",
"hash": -1565829117979475700,
"line_mean": 38.0833333333,
"line_max": 126,
"alpha_frac": 0.6364605544,
"autogenerated": false,
"ratio": 3.1742808798646363,
"config_test": f... |
__author__ = 'astyler'
import pandas as pd
import numpy as np
import math
import osmapping
from scipy.signal import butter, filtfilt
def load(fname):
trip = pd.read_csv(fname)
elapsed = np.cumsum(trip.PeriodMS / 1000.0)
elapsed -= elapsed[0]
trip['ElapsedSeconds'] = elapsed
# smooth speed
b, a... | {
"repo_name": "astyler/hybridpy",
"path": "hybridpy/dataset/triploader.py",
"copies": "1",
"size": "1887",
"license": "mit",
"hash": 6802950418851111000,
"line_mean": 33.3272727273,
"line_max": 145,
"alpha_frac": 0.6412294648,
"autogenerated": false,
"ratio": 3,
"config_test": false,
"has_no_... |
__author__ = 'astyler'
# foobar
def compute_value_function(trip, init_soc, num_soc_states=1000, electricity_to_fuel_price_ratio=0.25,
sell_to_buy_ratio=0.8, gamma=1.0):
""" Computes the value function for a trip
:param trip: Trip dataframe with columns [TimeIndex (s), Gradient, Spe... | {
"repo_name": "astyler/hybridpy",
"path": "hybridpy/__init__.py",
"copies": "1",
"size": "2338",
"license": "mit",
"hash": -5909510506393004000,
"line_mean": 45.78,
"line_max": 117,
"alpha_frac": 0.6364414029,
"autogenerated": false,
"ratio": 3.189631650750341,
"config_test": false,
"has_no_k... |
__author__ = 'astyler'
import numpy as np
from scipy.interpolate import interp1d
from hybridpy.models import vehicles, batteries
def compute(trip, controls, soc_states=50, gamma=1.0,
cost_function=lambda fuel_rate, power, duration: fuel_rate * duration, vehicle=vehicles.Car(),
battery=batteri... | {
"repo_name": "astyler/hybridpy",
"path": "hybridpy/learning/dynamicprogramming.py",
"copies": "1",
"size": "3108",
"license": "mit",
"hash": 3741719083884593700,
"line_mean": 46.8307692308,
"line_max": 128,
"alpha_frac": 0.6592664093,
"autogenerated": false,
"ratio": 3.776427703523694,
"config... |
___author__ = 'Asus'
from IClassifier import IClassifier
from Utils.utilities import load_stf
from glove import Glove
from scipy.spatial.distance import cosine
from scipy.spatial.distance import euclidean
import numpy as np
class GloveClassifier(IClassifier):
def __init__(self):
self.GloveInstace = None
self.Cent... | {
"repo_name": "dudenzz/word_embedding",
"path": "SimilarityClassification/Classifiers/GloveCenteredESLExtendedClassifier.py",
"copies": "1",
"size": "1662",
"license": "mit",
"hash": -4429539864581486000,
"line_mean": 32.9183673469,
"line_max": 89,
"alpha_frac": 0.6750902527,
"autogenerated": false... |
__author__ = 'Asus'
import argparse
import gzip
import math
import numpy
import re
import sys
import time
import io
from glove import Glove
from copy import deepcopy
import numpy as np
isNumber = re.compile(r'\d+.*')
def norm_word(word):
if isNumber.search(word.lower()):
return '---num---'
elif re.sub(r'\W+', '... | {
"repo_name": "dudenzz/word_embedding",
"path": "CentroidsGeneration/retrofitNew_gloveInstance.py",
"copies": "2",
"size": "5863",
"license": "mit",
"hash": 6047411354934428000,
"line_mean": 35.1913580247,
"line_max": 90,
"alpha_frac": 0.6373870032,
"autogenerated": false,
"ratio": 3.404761904761... |
__author__ = 'Asus'
import sys
import getopt
from QuestionHandling.QuestionBase import QuestionBase
from Classifiers.GloveClassifier import GloveClassifier
from Utils.utilities import load_stf
from Utils.retrofitNew_gloveInstance import retrofit_new
from Utils.retrofitNew_gloveInstance import read_lexicon
import nump... | {
"repo_name": "dudenzz/word_embedding",
"path": "SimilarityRegression/answerQuestions.py",
"copies": "1",
"size": "3309",
"license": "mit",
"hash": -8218101775180354000,
"line_mean": 36.1797752809,
"line_max": 158,
"alpha_frac": 0.6285886975,
"autogenerated": false,
"ratio": 3.688963210702341,
... |
__author__ = 'ASUS'
class ContactHelper:
def __init__(self, app):
self.app = app
def create(self, contact):
wd = self.app.wd
self.init_contact_creation()
self.fill_contacts_form(contact)
self.submit_contact_creation()
def init_contact_creation(self):
wd = ... | {
"repo_name": "alen4ik/python_training",
"path": "fixture/contact.py",
"copies": "1",
"size": "2381",
"license": "apache-2.0",
"hash": -918093524253070700,
"line_mean": 36.21875,
"line_max": 89,
"alpha_frac": 0.6152876942,
"autogenerated": false,
"ratio": 3.5326409495548963,
"config_test": fals... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.