text stringlengths 0 1.05M | meta dict |
|---|---|
import datetime
# currentDate = datetime.date.today()
# # print(currentDate)
# # print(currentDate.month)
# # print(currentDate.day)
# # print(currentDate.year)
# # print(currentDate.strftime('%d %B %Y'))
# # print(currentDate.strftime('Please attend our event %A, %B %d in the year %Y'))
#
# userInput = input("What is... | {
"repo_name": "areriff/pythonlearncanvas",
"path": "firstMain.py",
"copies": "1",
"size": "1864",
"license": "mit",
"hash": -8787906141495993000,
"line_mean": 32.8909090909,
"line_max": 108,
"alpha_frac": 0.6899141631,
"autogenerated": false,
"ratio": 3.1754684838160134,
"config_test": false,
... |
__author__ = 'argi'
import cv2
import numpy as np
class RectangleDetect:
def black_rectangle(self):
cam = cv2.VideoCapture(0)
n = 0
while True:
return_val, frame = cam.read()
img = cv2.GaussianBlur(frame, (5, 5), 0)
img = cv2.cvtColor(frame, cv2.... | {
"repo_name": "agounaris/python-computer-vision",
"path": "bootstrap/rectangle_detect.py",
"copies": "1",
"size": "1536",
"license": "mit",
"hash": 9066839454569687000,
"line_mean": 31.6808510638,
"line_max": 96,
"alpha_frac": 0.462890625,
"autogenerated": false,
"ratio": 3.7012048192771085,
"c... |
__author__ = 'argi'
import cv2
# import sys
class FaceDetect:
def __init__(self, casc_path):
self.classifier_path = casc_path
def execute(self):
face_cascade = cv2.CascadeClassifier(self.classifier_path)
video_capture = cv2.VideoCapture(0)
while True:
# Cap... | {
"repo_name": "agounaris/python-computer-vision",
"path": "bootstrap/face_detect.py",
"copies": "1",
"size": "1104",
"license": "mit",
"hash": -333928836174764540,
"line_mean": 24.6744186047,
"line_max": 76,
"alpha_frac": 0.527173913,
"autogenerated": false,
"ratio": 3.6435643564356437,
"config... |
__author__ = 'Ariel Anthieni'
#Definicion de Librerias
import os
import datetime
import time
import sys
import shutil
import zipfile
import zlib
#Incorporo las librerias de uso
from extractor import dataraster , generate_ql
#Establecimiento de variables
dir_origen = '/media/sf_prod24/nuevos/l8/'
dir_dest_xml = '/me... | {
"repo_name": "elcoloo/metadata-tools",
"path": "example.py",
"copies": "1",
"size": "4663",
"license": "apache-2.0",
"hash": 7590026418791864000,
"line_mean": 32.7898550725,
"line_max": 108,
"alpha_frac": 0.5794552863,
"autogenerated": false,
"ratio": 3.2092222986923606,
"config_test": false,
... |
__author__ = 'Ariel Anthieni'
#Definicion de Librerias
import os
import json
import csv
import codecs
import geojson
import shapely.wkt
"""
Es necesario que se instalen las librerias geojson y shapely para poder convertir los formatos
pip3 install geojson
pip3 install shapely
"""
#Establecimiento de variables
... | {
"repo_name": "elcoloo/metadata-tools",
"path": "convert-tools/csv_gba_to_geojson.py",
"copies": "1",
"size": "2322",
"license": "apache-2.0",
"hash": 3377855607636281300,
"line_mean": 21.1142857143,
"line_max": 100,
"alpha_frac": 0.5788113695,
"autogenerated": false,
"ratio": 3.3554913294797686,... |
__author__ = 'Ariel Anthieni'
#Definicion de Librerias
import os
import json
import csv
import codecs
#Establecimiento de variables
dir_origen = '/opt/desarrollo/metadata-tools/convert-tools/data/in/'
dir_destino = '/opt/desarrollo/metadata-tools/convert-tools/data/out/'
geocampo = 'geojson'
#Listo los archivos en... | {
"repo_name": "elcoloo/metadata-tools",
"path": "convert-tools/csv_ckan_to_geojson.py",
"copies": "1",
"size": "1993",
"license": "apache-2.0",
"hash": 5535654716330843000,
"line_mean": 21.908045977,
"line_max": 100,
"alpha_frac": 0.5604616157,
"autogenerated": false,
"ratio": 3.366554054054054,
... |
__author__ = 'Ariel Anthieni'
'''
Created on 20/04/2015
'''
#Cargo las librerias
import xml.dom.minidom
class txttoxml():
'''
Esta clases se encarga de convertir un txt separado por un caracter especificado a xml
'''
def __init__(self):
'''
Constructor
'''
"""Funcion ... | {
"repo_name": "elcoloo/metadata-tools",
"path": "conversor.py",
"copies": "1",
"size": "6078",
"license": "apache-2.0",
"hash": -2897060018244600000,
"line_mean": 30.1692307692,
"line_max": 203,
"alpha_frac": 0.5837446528,
"autogenerated": false,
"ratio": 3.469178082191781,
"config_test": false... |
__author__ = 'arif_'
# answer = input('would you like express shipping')
# if answer == 'yes':
# print('that will be an extra $10')
# else:
# print('fine!')
# print('have a nice day')
# favouriteTeam = input('what is your favourite hockey team?\n')
# if favouriteTeam == 'Senators':
# print('Yeah Go Sens Go... | {
"repo_name": "areriff/pythonlearncanvas",
"path": "ifStatement.py",
"copies": "1",
"size": "6126",
"license": "mit",
"hash": -6085333370651347000,
"line_mean": 31.585106383,
"line_max": 184,
"alpha_frac": 0.5935357493,
"autogenerated": false,
"ratio": 3.195618153364632,
"config_test": false,
... |
__author__ = 'arif_'
# import _tkinter
# from tkinter import Tk, Frame, BOTH
#
#
# class Example(Frame):
#
# def __init__(self, parent):
# Frame.__init__(self, parent, background="grey")
#
# self.parent = parent
#
# self.initUI()
#
# def initUI(self):
#
# self.parent.title("My Fi... | {
"repo_name": "areriff/pythonlearncanvas",
"path": "GUI/FirstGUIAttemp.py",
"copies": "1",
"size": "1976",
"license": "mit",
"hash": 1045333555552573800,
"line_mean": 18.9595959596,
"line_max": 60,
"alpha_frac": 0.5151821862,
"autogenerated": false,
"ratio": 3.09717868338558,
"config_test": fal... |
__author__ = 'arif_'
##########Frame
# root = Tk() # Create a blank window
# topFrame = Frame(root) # Make a frame inside the root (main window)
# topFrame.pack(side=TOP) # To put it in and display in the topFrama
# bottomFrame = Frame(root)
# bottomFrame.pack(side=BOTTOM) # The bottom frame
#
# button1 = Button(... | {
"repo_name": "areriff/pythonlearncanvas",
"path": "GUI/SecondGUIAttempt.py",
"copies": "1",
"size": "5515",
"license": "mit",
"hash": 7551459650361346000,
"line_mean": 27.7291666667,
"line_max": 101,
"alpha_frac": 0.6471441523,
"autogenerated": false,
"ratio": 2.9634605051047824,
"config_test"... |
# guests = ['Susan', 'Christopher', 'Bill', 'Satya']
# print(guests[-2])
# print(guests[1])
# guests[1] = 'Steve' # Replacing item from the list
# guests.append('Arif') # Append item to the list
# guests.remove('Satya')
# guests.remove(guests[-2])
# guests.append('Colin')
# del guests[0]
# print(guests[-1:-2])
# print... | {
"repo_name": "areriff/pythonlearncanvas",
"path": "Lists.py",
"copies": "1",
"size": "2028",
"license": "mit",
"hash": 7013777688532116000,
"line_mean": 26.04,
"line_max": 96,
"alpha_frac": 0.6252465483,
"autogenerated": false,
"ratio": 2.956268221574344,
"config_test": false,
"has_no_keywor... |
__author__ = 'arifpz'
__all__ = ["summingFunction", "summingFunctionBackwards", "summingFunctionWithBias", "summingFunctionWithBiasBackward",
"addingValueBackwards", "addingValueBias", "addingValueWeight"]
def summingFunction(detailInputList, weightList):
"""
Basic summing function
Parameter:
... | {
"repo_name": "AiLaboratoryTelU/simple-artificial-neural-network",
"path": "simple_ann/module/forewardFunction.py",
"copies": "1",
"size": "3290",
"license": "apache-2.0",
"hash": 1167965765504542000,
"line_mean": 26.425,
"line_max": 119,
"alpha_frac": 0.6820668693,
"autogenerated": false,
"ratio... |
__author__ = 'arifpz'
import configparser as cp
import json as js
import os
import simple_ga.dataModel.inputDataModel as id
# import simple_ann.dataModel.trainingResultModel as tr
# import simple_ann.dataModel.testingDataModel as td
__all__ = ['similarList', 'readFromJson', 'readFromJsonAsObject', 'writeToJsonFromOb... | {
"repo_name": "AiLaboratoryTelU/simple-genetic-algorithm",
"path": "simple_ga/utility/utility.py",
"copies": "1",
"size": "3578",
"license": "apache-2.0",
"hash": 515974609600689400,
"line_mean": 23.5068493151,
"line_max": 110,
"alpha_frac": 0.6570709894,
"autogenerated": false,
"ratio": 3.742677... |
__author__ = 'arifpz'
# import inspect as ins
import simple_ann.utility.utility as util
import random as rn
__all__ = ["generateZeroList", "generateRandomList", "automaticGeneratorList"]
#TODO implement it, replace old one
def generateZeroList(n):
"""
Method to generate list of zero value
Parameter:
... | {
"repo_name": "AiLaboratoryTelU/simple-artificial-neural-network",
"path": "simple_ann/module/initiationValueGenerator.py",
"copies": "1",
"size": "1983",
"license": "apache-2.0",
"hash": -7077314698566666000,
"line_mean": 22.0581395349,
"line_max": 93,
"alpha_frac": 0.6691880988,
"autogenerated": ... |
__author__ = 'arifpz'
import inspect as ins
__all__ = ["hardLimit"]
# class activationFunction(object):
#
# # Hard limit function
# def hardLimit(self, summing_function, threshold):
# if (summing_function >= threshold):
# return 1
# return 0
#
# #TODO Linear function
# def... | {
"repo_name": "AiLaboratoryTelU/simple-artificial-neural-network",
"path": "simple_ann/module/activationFunction.py",
"copies": "1",
"size": "1555",
"license": "apache-2.0",
"hash": -6979651877092921000,
"line_mean": 22.223880597,
"line_max": 91,
"alpha_frac": 0.5890675241,
"autogenerated": false,
... |
__author__ = 'arifpz'
#TODO implement use scipy/numpy so that matrix can be calculated more effective
# import scipy as sc
# import numpy as np
import simple_ann.dataModel.inputDataModel as id
import simple_ann.module.activationFunction as af
import simple_ann.module.backwardFunction as bf
import simple_ann.module.fo... | {
"repo_name": "AiLaboratoryTelU/simple-artificial-neural-network",
"path": "simple_ann/module/moduleTraining.py",
"copies": "1",
"size": "4686",
"license": "apache-2.0",
"hash": 1418514790147582700,
"line_mean": 32.9565217391,
"line_max": 159,
"alpha_frac": 0.6135296628,
"autogenerated": false,
"... |
__author__ = 'arifpz'
#TODO place where utility function which has dependencies with data model
import os
import simple_ga.dataModel.inputDataModel as id
import simple_ga.utility.utility as util
#TODO refactor method dataTestingResultDumpGenerator, dataTestingDataDumpGenerator, dataTestingResultDumpGenerator, dataInp... | {
"repo_name": "AiLaboratoryTelU/simple-genetic-algorithm",
"path": "simple_ga/utility/utilityDataModel.py",
"copies": "1",
"size": "2231",
"license": "apache-2.0",
"hash": 2626210047720312300,
"line_mean": 38.8571428571,
"line_max": 199,
"alpha_frac": 0.7624383684,
"autogenerated": false,
"ratio"... |
__author__ = 'arimorcos'
import praw
import sys
import os
def getMostRecentComment(userName, redditObject):
userObject = redditObject.get_redditor(userName)
userComments = userObject.get_comments()
comment = None
for comment in userComments:
pass
return comment
def loadLastComment(sa... | {
"repo_name": "arimorcos/blog_analyses",
"path": "reddit/redUserComment.py",
"copies": "1",
"size": "3169",
"license": "mit",
"hash": 819845902646538900,
"line_mean": 29.7766990291,
"line_max": 112,
"alpha_frac": 0.6213316504,
"autogenerated": false,
"ratio": 3.9171817058096416,
"config_test": ... |
__author__ = 'arimorcos'
from flask import render_template
from initialize import flatpages
from settings import POST_DIR
def renderPostList(postList, pageNum=False, tagName=False):
# Number of posts per page
nPostsPerPage = 5
nRecent = 5
# get recent posts
allPosts = getPostList()
recentPo... | {
"repo_name": "arimorcos/arimorcos.github.io",
"path": "helperFunctions.py",
"copies": "1",
"size": "4109",
"license": "mit",
"hash": 4152136772194867000,
"line_mean": 28.7826086957,
"line_max": 114,
"alpha_frac": 0.6108542224,
"autogenerated": false,
"ratio": 3.8691148775894537,
"config_test":... |
__author__ = 'Ari Morcos'
from requests import HTTPError
import praw
from redditDB import RedditDB
import datetime
import time
import itertools
import sys
import os
def createDataset(r, subreddits, startDate=(datetime.datetime.now()-datetime.timedelta(days=7)).strftime('%y%m%d%H%M%S'),
endDate=date... | {
"repo_name": "arimorcos/getRedditDataset",
"path": "redditDataset.py",
"copies": "1",
"size": "6131",
"license": "mit",
"hash": 3926404454779496400,
"line_mean": 31.9623655914,
"line_max": 121,
"alpha_frac": 0.6599249715,
"autogenerated": false,
"ratio": 3.803349875930521,
"config_test": false... |
__author__ = 'arimorcos'
import datetime
import sys
sys.path.extend(['D:\\Documents\\GitHub\\getRedditDataset', 'D:\\Documents\\GitHub\\reddit_analyses'])
from redditDataset import *
if __name__ == '__main__':
shouldOneHour = False
# handle arguments
startDate = sys.argv[1]
endDate = sys.argv[2]
... | {
"repo_name": "arimorcos/blog_analyses",
"path": "reddit/grabNewDefaults.py",
"copies": "1",
"size": "2345",
"license": "mit",
"hash": -2473690510332775000,
"line_mean": 44.9803921569,
"line_max": 123,
"alpha_frac": 0.6102345416,
"autogenerated": false,
"ratio": 3.35,
"config_test": false,
"h... |
__author__ = 'Ari Morcos'
import os
import datetime
import sqlite3
import re
import shutil
import time
class RedditDB:
"""
Class for interfacing with a database for reddit data sets
"""
def __init__(self, dbName='reddit', dbPath=None):
self.__dbName = dbName
self.__dbPath = dbPath
... | {
"repo_name": "arimorcos/getRedditDataset",
"path": "redditDB.py",
"copies": "1",
"size": "6243",
"license": "mit",
"hash": -1921626256419292000,
"line_mean": 31.3471502591,
"line_max": 126,
"alpha_frac": 0.5731218965,
"autogenerated": false,
"ratio": 4.399577167019028,
"config_test": false,
... |
__author__ = 'arimorcos'
import re
import urllib2
import enchant
from textstat.textstat import textstat
def countWords(commentList):
"""
:param commentList: list of text
:return: word count
"""
# get count in each string
commentCount = [len(commentStr.split()) for commentStr in commentList]
... | {
"repo_name": "arimorcos/blog_analyses",
"path": "reddit/celebReddit.py",
"copies": "1",
"size": "1860",
"license": "mit",
"hash": 2472788959114090500,
"line_mean": 21.4096385542,
"line_max": 88,
"alpha_frac": 0.6731182796,
"autogenerated": false,
"ratio": 3.4766355140186915,
"config_test": fal... |
__author__ = 'ariyatan'
from verb_tenses import verb_form
def verb_input():
v_input = raw_input('Enter a verb> \n')
return v_input
def tense_input():
tense = raw_input('Enter the required tense > \n')
return tense
def person_input():
person = raw_input('Enter the person > \n')
return person... | {
"repo_name": "DmitryKey/MTengine",
"path": "grammarer/verb_start.py",
"copies": "1",
"size": "2846",
"license": "mit",
"hash": -7369583508813122000,
"line_mean": 26.9019607843,
"line_max": 195,
"alpha_frac": 0.658116655,
"autogenerated": false,
"ratio": 3.5092478421701605,
"config_test": false... |
__author__ = 'ariyatan'
import csv
#list of adjectives that have synthetic forms of degree of comparison
synth_form_list = []
with open('adj_comp_ex.csv', 'rb') as dc:
for line in dc:
synth_form_list.append(line[:-1])
#I use [:-1] to get rid of '\n' symbol at the end of each row
#list of adjective... | {
"repo_name": "DmitryKey/MTengine",
"path": "grammarer/adj_comparison.py",
"copies": "1",
"size": "2616",
"license": "mit",
"hash": -2629879584691891000,
"line_mean": 32.5384615385,
"line_max": 182,
"alpha_frac": 0.5382262997,
"autogenerated": false,
"ratio": 3.397402597402597,
"config_test": f... |
__author__ = 'ariyatan'
#the class takes a verb ('verb'), required tense ('tense') and person('person').
#In this case 'tense' means not only common tenses, but also verb forms such as participle or adverb or gerund.
#'verb' is infinitive taken from vocabulary during previous stages
#'tense' is received from parser, ... | {
"repo_name": "DmitryKey/MTengine",
"path": "grammarer/verb_tenses.py",
"copies": "1",
"size": "5218",
"license": "mit",
"hash": 1437317416717728300,
"line_mean": 31.0122699387,
"line_max": 112,
"alpha_frac": 0.5201226524,
"autogenerated": false,
"ratio": 3.661754385964912,
"config_test": false... |
__author__ = 'Arkan'
import argparse
import sys
import textwrap
import time
import urllib.request
import libftb.ftb
download_last_mark = 0
def main():
__parse_argv(sys.argv)
def __parse_argv(argv):
root = argparse.ArgumentParser()
subcmds = root.add_subparsers(help='sub-command help')
ls = subc... | {
"repo_name": "Emberwalker/LibFTB",
"path": "ftb.py",
"copies": "1",
"size": "3527",
"license": "mit",
"hash": 1687198733762776800,
"line_mean": 26.3488372093,
"line_max": 84,
"alpha_frac": 0.5245250921,
"autogenerated": false,
"ratio": 3.6286008230452675,
"config_test": false,
"has_no_keywor... |
__author__ = 'Arkan'
import urllib.request
import os.path
import time
import xml.etree.ElementTree as ET
import libftb.internal.parser as parser
CDN_ROOT = "http://ftb.cursecdn.com/FTB2"
def get_packs():
root = __get_or_create_cache()
return parser.packs_xml_to_dict(root)
def get_pack_url(pack_dict, vers... | {
"repo_name": "Emberwalker/LibFTB",
"path": "libftb/ftb.py",
"copies": "1",
"size": "1284",
"license": "mit",
"hash": 1498710901729356800,
"line_mean": 25.2244897959,
"line_max": 104,
"alpha_frac": 0.6292834891,
"autogenerated": false,
"ratio": 3.139364303178484,
"config_test": false,
"has_no... |
__author__ = 'arkilic'
import time
import socket
import sys
from thread import start_new_thread
import broker.config as cfg
from Queue import Queue
def remote_client_thread(conn2, queue):
"""
Function to create client threads!
Whenever a client is connected to the server, a dedicated thread is initiated
... | {
"repo_name": "NSLS-II/brokerStreamServer",
"path": "broker/server/broker_server.py",
"copies": "1",
"size": "2035",
"license": "bsd-3-clause",
"hash": 6594190205256063000,
"line_mean": 26.5,
"line_max": 109,
"alpha_frac": 0.685012285,
"autogenerated": false,
"ratio": 3.5701754385964914,
"confi... |
__author__ = 'arkilic'
import tornado.web, tornado.ioloop
import motor
class NewMessageHandler(tornado.web.RequestHandler):
def get(self):
"""Show a 'compose message' form."""
self.write('''
<form method="post">
<input type="text" name="msg">
<input type="submit">
... | {
"repo_name": "mrkraimer/metadataservice",
"path": "tut_test.py",
"copies": "1",
"size": "1786",
"license": "bsd-3-clause",
"hash": 5936569321055356000,
"line_mean": 27.3492063492,
"line_max": 73,
"alpha_frac": 0.5789473684,
"autogenerated": false,
"ratio": 4.0225225225225225,
"config_test": fa... |
__author__ = 'arkilic'
import csv
import numpy as np
from sklearn.linear_model import SGDRegressor
from sklearn.linear_model import SGDClassifier
import random
import pprint
import sys, logging, struct
logging.basicConfig(level=logging.DEBUG)
import time
import pydoop.pipes as pp
from pydoop.utils import jc_configure... | {
"repo_name": "Sapphirine/Stock-price-Movement-Prediction",
"path": "pydoop/predict_new_mapred.py",
"copies": "1",
"size": "9356",
"license": "apache-2.0",
"hash": -1009239998960549100,
"line_mean": 29.1806451613,
"line_max": 258,
"alpha_frac": 0.6223813596,
"autogenerated": false,
"ratio": 3.440... |
__author__ = 'Armando'
import webapp2
import json
import datetime
from entities.Usuario import Usuario
from time import mktime
class ObtenerUsuario(webapp2.RequestHandler):
def get(self):
in_nombre = self.request.get('nombre')
print 'in_nombre=%r' % in_nombre
usuarios = Usuario.consultar_... | {
"repo_name": "apiconz/you-wrote-here",
"path": "index.py",
"copies": "1",
"size": "1753",
"license": "apache-2.0",
"hash": 7675751481243878000,
"line_mean": 28.7288135593,
"line_max": 90,
"alpha_frac": 0.6177980605,
"autogenerated": false,
"ratio": 3.36468330134357,
"config_test": false,
"ha... |
from collections import Sequence
from itertools import chain
from scipy.sparse import issparse
from scipy.sparse.base import spmatrix
from scipy.sparse import dok_matrix
from scipy.sparse import lil_matrix
import numpy as np
from uplift.validation.check import check_array
def _unique_multiclass(y):
if hasattr(... | {
"repo_name": "psarka/uplift",
"path": "uplift/validation/multiclass.py",
"copies": "1",
"size": "12707",
"license": "bsd-3-clause",
"hash": 3350516679443262000,
"line_mean": 32.6164021164,
"line_max": 79,
"alpha_frac": 0.5705516644,
"autogenerated": false,
"ratio": 3.6821211243117937,
"config_... |
"""
Multi-class / multi-label utility function
==========================================
"""
from collections.abc import Sequence
from itertools import chain
import warnings
from scipy.sparse import issparse
from scipy.sparse.base import spmatrix
from scipy.sparse import dok_matrix
from scipy.sparse import lil_matri... | {
"repo_name": "anntzer/scikit-learn",
"path": "sklearn/utils/multiclass.py",
"copies": "11",
"size": "16256",
"license": "bsd-3-clause",
"hash": 2315962123390929400,
"line_mean": 34.0344827586,
"line_max": 79,
"alpha_frac": 0.5796628937,
"autogenerated": false,
"ratio": 3.7586127167630057,
"con... |
"""
Multi-class / multi-label utility function
==========================================
"""
from collections.abc import Sequence
from itertools import chain
from scipy.sparse import issparse
from scipy.sparse.base import spmatrix
from scipy.sparse import dok_matrix
from scipy.sparse import lil_matrix
import numpy ... | {
"repo_name": "chrsrds/scikit-learn",
"path": "sklearn/utils/multiclass.py",
"copies": "1",
"size": "15256",
"license": "bsd-3-clause",
"hash": -237182039651572700,
"line_mean": 33.4379232506,
"line_max": 79,
"alpha_frac": 0.5774777137,
"autogenerated": false,
"ratio": 3.7155382367267413,
"conf... |
"""
Multi-class / multi-label utility function
==========================================
"""
from collections import Sequence
from itertools import chain
import warnings
from scipy.sparse import issparse
from scipy.sparse.base import spmatrix
from scipy.sparse import dok_matrix
from scipy.sparse import lil_matrix
i... | {
"repo_name": "RPGOne/Skynet",
"path": "scikit-learn-c604ac39ad0e5b066d964df3e8f31ba7ebda1e0e/sklearn/utils/multiclass.py",
"copies": "3",
"size": "11203",
"license": "bsd-3-clause",
"hash": -2981303035437182500,
"line_mean": 31.100286533,
"line_max": 86,
"alpha_frac": 0.5893956976,
"autogenerated"... |
"""
Multi-class / multi-label utility function
==========================================
"""
from __future__ import division
from collections import Sequence
from itertools import chain
import warnings
from scipy.sparse import issparse
from scipy.sparse.base import spmatrix
from scipy.sparse import dok_matrix
from s... | {
"repo_name": "hsuantien/scikit-learn",
"path": "sklearn/utils/multiclass.py",
"copies": "92",
"size": "13986",
"license": "bsd-3-clause",
"hash": 5448907726861517000,
"line_mean": 31.8309859155,
"line_max": 86,
"alpha_frac": 0.5832975833,
"autogenerated": false,
"ratio": 3.7995110024449876,
"c... |
"""
Multi-class / multi-label utility function
==========================================
"""
from __future__ import division
from collections import Sequence
from itertools import chain
from scipy.sparse import issparse
from scipy.sparse.base import spmatrix
from scipy.sparse import dok_matrix
from scipy.sparse impo... | {
"repo_name": "ryfeus/lambda-packs",
"path": "LightGBM_sklearn_scipy_numpy/source/sklearn/utils/multiclass.py",
"copies": "8",
"size": "15200",
"license": "mit",
"hash": -944408530042938500,
"line_mean": 32.9285714286,
"line_max": 79,
"alpha_frac": 0.5803289474,
"autogenerated": false,
"ratio": 3... |
"""
Multi-class / multi-label utility function
==========================================
"""
from __future__ import division
from itertools import chain
from scipy.sparse import issparse
from scipy.sparse.base import spmatrix
from scipy.sparse import dok_matrix
from scipy.sparse import lil_matrix
import numpy as np... | {
"repo_name": "vortex-ape/scikit-learn",
"path": "sklearn/utils/multiclass.py",
"copies": "9",
"size": "15222",
"license": "bsd-3-clause",
"hash": -3505567174184493000,
"line_mean": 33.0536912752,
"line_max": 79,
"alpha_frac": 0.5805413218,
"autogenerated": false,
"ratio": 3.692867540029112,
"c... |
"""
Multi-class / multi-label utility function
==========================================
"""
from __future__ import division
from collections import Sequence
from itertools import chain
import numpy as np
from scipy.sparse import dok_matrix
from scipy.sparse import issparse
from scipy.sparse import lil_matrix
from ... | {
"repo_name": "DailyActie/Surrogate-Model",
"path": "01-codes/scikit-learn-master/sklearn/utils/multiclass.py",
"copies": "1",
"size": "12982",
"license": "mit",
"hash": 2469879870440017000,
"line_mean": 32.5452196382,
"line_max": 79,
"alpha_frac": 0.5711754737,
"autogenerated": false,
"ratio": 3... |
"""
Multi-class / multi-label utility function
==========================================
"""
from collections import Sequence
from itertools import chain
import numpy as np
from ..externals.six import string_types
def _unique_multiclass(y):
if isinstance(y, np.ndarray):
return np.unique(y)
else:
... | {
"repo_name": "Sklearn-HMM/scikit-learn-HMM",
"path": "sklean-hmm/utils/multiclass.py",
"copies": "3",
"size": "10950",
"license": "bsd-3-clause",
"hash": 7673745331732883000,
"line_mean": 30.6473988439,
"line_max": 79,
"alpha_frac": 0.5852054795,
"autogenerated": false,
"ratio": 3.70809346427362... |
"""
Multi-class / multi-label utility function
==========================================
"""
from collections import Sequence
import numpy as np
from ..externals.six import string_types
def unique_labels(*lists_of_labels):
"""Extract an ordered array of unique labels
Parameters
----------
lists_o... | {
"repo_name": "kmike/scikit-learn",
"path": "sklearn/utils/multiclass.py",
"copies": "3",
"size": "3824",
"license": "bsd-3-clause",
"hash": -6581158473212420000,
"line_mean": 27.5373134328,
"line_max": 79,
"alpha_frac": 0.5575313808,
"autogenerated": false,
"ratio": 3.6246445497630333,
"config... |
__author__ = 'arnaud'
#!/usr/bin/env python
#
# Copyright 2001-2002 by Vinay Sajip. All Rights Reserved.
#
# Permission to use, copy, modify, and distribute this software and its
# documentation for any purpose and without fee is hereby granted,
# provided that the above copyright notice appear in all copies and that
... | {
"repo_name": "UniShared/videonotes",
"path": "BufferedSmtpHandler.py",
"copies": "3",
"size": "2304",
"license": "mit",
"hash": 9164536774876668000,
"line_mean": 42.4905660377,
"line_max": 97,
"alpha_frac": 0.7057291667,
"autogenerated": false,
"ratio": 4.189090909090909,
"config_test": false,... |
__author__ = 'Arnaud Wery'
import oauth2 as oauth
import json
from datetime import datetime, date
from urllib import quote_plus
from httplib2 import ServerNotFoundError, MalformedHeader
import time
import socket
json_data = open('oAuth')
oAuth = json.load(json_data)
BASE_URL = oAuth['BASE_URL']
CONSUMER_KEY = oAuth[... | {
"repo_name": "JensNevens/Bachelorproject",
"path": "ipynb/railfetcher.py",
"copies": "2",
"size": "3158",
"license": "mit",
"hash": 6975041219039824000,
"line_mean": 38.475,
"line_max": 268,
"alpha_frac": 0.6073464218,
"autogenerated": false,
"ratio": 3.9425717852684143,
"config_test": false,
... |
__author__ = 'Arnav'
import numpy as np
import matplotlib
import matplotlib.pyplot as plt
import csv
#############Read the years from txt file################
year_list = [];
f= open('../Resources/FullSet/AdditionalFiles/tracks_per_year.txt', 'rU', encoding='utf8')
data=csv.reader(f)
for row in data:
line = row[0]... | {
"repo_name": "nishantnath/MusicPredictiveAnalysis_EE660_USCFall2015",
"path": "Code/Visualizations & Insights/visualize_songs_per_year.py",
"copies": "1",
"size": "1305",
"license": "mit",
"hash": 1562590168239993000,
"line_mean": 24.5882352941,
"line_max": 90,
"alpha_frac": 0.5647509579,
"autogen... |
__author__ = 'Arnav & Nishant'
import pandas
import numpy
import time
start_time=time.time()
import pandas
import numpy
import time
col_meta = ['track_id','song_id','wc_genre', 'wc_year']
col_data_in = [
'track_id', 'song_id',
'AvgBarDuration','Loudness', 'Tempo','ArtistFamiliarity','ArtistHotttne... | {
"repo_name": "nishantnath/MusicPredictiveAnalysis_EE660_USCFall2015",
"path": "Code/Data Generation & Manipulation/MSD_merge_feature_file_with_wikicorrected_genredata.py",
"copies": "1",
"size": "3914",
"license": "mit",
"hash": -1746562432058049800,
"line_mean": 44.523255814,
"line_max": 121,
"alph... |
__author__ = 'Arnav'
import numpy as np
import h5py
import combine_feat as combine
import matplotlib
import matplotlib.pyplot as plt
f_hiphop = h5py.File("G:\project660\Resources\MillionSongSubset\data\A\A\A\TRAAAAW128F429D538.h5", 'r')
f_classic = h5py.File("G:\project660\Resources\MillionSongSubset\data\B\H\H\TRBHH... | {
"repo_name": "nishantnath/MusicPredictiveAnalysis_EE660_USCFall2015",
"path": "Code/Visualizations & Insights/visualize_segment_pitches.py",
"copies": "1",
"size": "3306",
"license": "mit",
"hash": -7723350524344235000,
"line_mean": 44.301369863,
"line_max": 104,
"alpha_frac": 0.6941923775,
"autog... |
__author__ = 'Arnav'
"""
This module provides fuctionality for reducing dimentions of data set by
decomposing a multivariate dataset in a set of successive orthogonal components
that explain a maximum amount of the variance.
"""
def using_PCA(feature_mat, reduced_dim):
"""
Linear dimensionality reduction usin... | {
"repo_name": "nishantnath/MusicPredictiveAnalysis_EE660_USCFall2015",
"path": "Code/Machine_Learning_Algos/10k_Tests/reduce_dimensions.py",
"copies": "1",
"size": "1436",
"license": "mit",
"hash": 7199656445020852000,
"line_mean": 43.875,
"line_max": 124,
"alpha_frac": 0.7527855153,
"autogenerated... |
__author__ = 'Arnav'
# !/usr/bin/env python
'''
Using : Python 2.7+ (backward compatibility exists for Python 3.x if separate environment created)
Required files : hdf5_getters.py
Required packages : numpy, pandas, matplotlib, sklearn
# Uses LDA for classification
'''
import pandas
import matplotlib.pyplot as plt
im... | {
"repo_name": "nishantnath/MusicPredictiveAnalysis_EE660_USCFall2015",
"path": "Code/Machine_Learning_Algos/10k_Tests/ml_classification_lda.py",
"copies": "1",
"size": "2670",
"license": "mit",
"hash": 7879826802542534000,
"line_mean": 45.8421052632,
"line_max": 121,
"alpha_frac": 0.6104868914,
"au... |
__author__ = 'a'
#Parse XML directly from the file path
import xml.etree.ElementTree as xml
import os
import shutil
htmlRendrering = ""
def openScreenToPage():
global htmlRendrering
htmlRendrering += "<html>\n<head>\n"
htmlRendrering += '<link href="{{ STATIC_URL }}home.css" rel="styleshe... | {
"repo_name": "perfidia/screensketch",
"path": "src/screensketch/screenspec/rendering/reading.py",
"copies": "1",
"size": "14075",
"license": "mit",
"hash": -2870505999747858000,
"line_mean": 30.430875576,
"line_max": 151,
"alpha_frac": 0.4758792185,
"autogenerated": false,
"ratio": 3.95476257375... |
__author__ = 'a'
import os
from pydocgen.model import ListStyleProperty, AlignmentProperty, FontEffectProperty, Image, Style, Table
import datetime
now = datetime.datetime.now()
from pydocgen.builders.common import Builder
class DitaMapBuilder(Builder):
"""Class responsible for creating a DITA Map ... | {
"repo_name": "perfidia/pydocgen",
"path": "src/pydocgen/builders/ditamap.py",
"copies": "1",
"size": "1547",
"license": "mit",
"hash": -2343160361916312600,
"line_mean": 33.1590909091,
"line_max": 126,
"alpha_frac": 0.5733678087,
"autogenerated": false,
"ratio": 3.6658767772511847,
"config_tes... |
__author__ = 'arobres, jfernandez'
# -*- coding: utf-8 -*-
from lettuce import step, world
from commons.rest_utils import RestUtils
from commons.product_steps import ProductSteps
from commons.provisioning_steps import ProvisioningSteps
from commons.constants import *
from commons.utils import response_body_to_dict, ge... | {
"repo_name": "Fiware/cloud.SDC",
"path": "test/acceptance/component/get_product_instances/features/get_product_instances.py",
"copies": "2",
"size": "4233",
"license": "apache-2.0",
"hash": -3755589022821014500,
"line_mean": 45.0108695652,
"line_max": 109,
"alpha_frac": 0.7205291755,
"autogenerate... |
__author__ = 'arobres, jfernandez'
from json import JSONEncoder
import requests
from configuration import PUPPET_MASTER_PROTOCOL, PUPPET_WRAPPER_IP, PUPPET_WRAPPER_PORT, CONFIG_KEYSTONE_URL
PUPPET_WRAPPER_SERVER = '{}://{}:{}/puppetwrapper'.format(PUPPET_MASTER_PROTOCOL, PUPPET_WRAPPER_IP,
... | {
"repo_name": "telefonicaid/fiware-puppetwrapper",
"path": "acceptance_tests/commons/rest_utils.py",
"copies": "1",
"size": "4597",
"license": "apache-2.0",
"hash": -1189331993192054800,
"line_mean": 36.3739837398,
"line_max": 119,
"alpha_frac": 0.5908201001,
"autogenerated": false,
"ratio": 3.85... |
__author__ = 'arobres'
# -*- coding: utf-8 -*-
from commons.rest_utils import RestUtils
from commons.constants import URL
import commons.assertions as Assertions
import commons.fabric_utils as Fabutils
from lettuce import step, world, before
from nose.tools import assert_true
api_utils = RestUtils()
@step(u'Give... | {
"repo_name": "telefonicaid/fiware-puppetwrapper",
"path": "acceptance_tests/component/download_module/features/steps.py",
"copies": "1",
"size": "1153",
"license": "apache-2.0",
"hash": 1930313487351474200,
"line_mean": 26.4523809524,
"line_max": 113,
"alpha_frac": 0.7328707719,
"autogenerated": f... |
__author__ = 'arobres'
# -*- coding: utf-8 -*-
from nose.tools import assert_equals, assert_true, assert_in
from constants import INSTALL_GROUP_NAME, INSTALL_NODE_NAME, INSTALL_MANIFEST_GENERATED, OP_SOFTWARE_LIST
HTTP_CODE_NOT_OK = u'Invalid HTTP status code. Status Code obtained is: {}\n RESPONSE OBTAINED IS: {}'
... | {
"repo_name": "telefonicaid/fiware-puppetwrapper",
"path": "acceptance_tests/commons/assertions.py",
"copies": "1",
"size": "2696",
"license": "apache-2.0",
"hash": 6341365427172781000,
"line_mean": 44.7118644068,
"line_max": 120,
"alpha_frac": 0.6442878338,
"autogenerated": false,
"ratio": 4.023... |
__author__ = 'arobres'
from selenium.webdriver.support.ui import Select
class BasePage(object):
url = None
def __init__(self, driver):
self.driver = driver
def navigate(self):
self.driver.get(self.url)
class Homepage(BasePage):
url = "http://localhost:8081/v1.0"
def go_new_use... | {
"repo_name": "twiindan/forum_html",
"path": "test/exercices/exercice2/page_object.py",
"copies": "1",
"size": "2139",
"license": "apache-2.0",
"hash": -5901366508748434000,
"line_mean": 28.7083333333,
"line_max": 88,
"alpha_frac": 0.6526414212,
"autogenerated": false,
"ratio": 3.3265940902021773... |
__author__ = 'arobres'
#AUTHENTICATION CONSTANTS
AUTH = u'auth'
TENANT_NAME = u'tenantName'
USERNAME = u'username'
PASSWORD = u'password'
ACCESS = u'access'
TOKEN = u'token'
TENANT = u'tenant'
ID = u'id'
#PRODUCT_PROPERTIES
PRODUCT_NAME = u'name'
PRODUCT_DESCRIPTION = u'description'
PRODUCT = u'product'
PRODUCTS = u... | {
"repo_name": "Fiware/cloud.SDC",
"path": "test/acceptance/commons/constants.py",
"copies": "2",
"size": "3483",
"license": "apache-2.0",
"hash": 4966594859409688000,
"line_mean": 29.2869565217,
"line_max": 144,
"alpha_frac": 0.6965259833,
"autogenerated": false,
"ratio": 2.9642553191489363,
"c... |
__author__ = 'arobres'
# -*- coding: utf-8 -*-
from lettuce import step, world, before, after
from commons.authentication import get_token
from commons.rest_utils import RestUtils
from commons.product_body import default_product, create_default_attribute_list, create_default_metadata_list,\
create_product_release
... | {
"repo_name": "Fiware/cloud.SDC",
"path": "test/acceptance/component/add_product_release/features/add_product_release.py",
"copies": "2",
"size": "4959",
"license": "apache-2.0",
"hash": -7603671484269627000,
"line_mean": 38.672,
"line_max": 121,
"alpha_frac": 0.7211131276,
"autogenerated": false,
... |
__author__ = 'arobres'
# -*- coding: utf-8 -*-
from lettuce import step, world
from commons.rest_utils import RestUtils
from commons.product_steps import ProductSteps
from commons.provisioning_steps import ProvisioningSteps
from commons.utils import wait_for_task_finished, response_body_to_dict
from commons.constants ... | {
"repo_name": "telefonicaid/fiware-sdc",
"path": "test/acceptance/component/install_product/features/install_product.py",
"copies": "2",
"size": "8313",
"license": "apache-2.0",
"hash": 1754753608863650600,
"line_mean": 37.8457943925,
"line_max": 138,
"alpha_frac": 0.6920485986,
"autogenerated": fa... |
__author__ = 'arobres'
# -*- coding: utf-8 -*-
from commons.rest_utils import RestUtils
from commons.constants import INSTALL, UNINSTALL, ACTION, SOFTWARE_NAME, VERSION
from nose.tools import assert_equals
import commons.assertions as Assertions
import commons.fabric_utils as Fabutils
from lettuce import step, worl... | {
"repo_name": "telefonicaid/fiware-puppetwrapper",
"path": "acceptance_tests/component/delete_node/features/steps.py",
"copies": "1",
"size": "2333",
"license": "apache-2.0",
"hash": 1040673329218511700,
"line_mean": 32.3285714286,
"line_max": 115,
"alpha_frac": 0.6935276468,
"autogenerated": false... |
__author__ = 'arobres'
from bottle import run, template, Bottle, request, response, auth_basic, redirect, static_file, TEMPLATE_PATH
from constants import THEME, SUBJECT, MESSAGES
from collections import defaultdict
import ujson
from sys import argv
import os
from time import sleep
TEMPLATE_PATH.insert(0, os.path.abs... | {
"repo_name": "twiindan/forum_html",
"path": "forum/forum.py",
"copies": "1",
"size": "7710",
"license": "apache-2.0",
"hash": -2373237890052809700,
"line_mean": 24.1960784314,
"line_max": 109,
"alpha_frac": 0.5942931258,
"autogenerated": false,
"ratio": 3.5253772290809327,
"config_test": false... |
__author__ = 'arobres'
from constants import PRODUCT, PRODUCT_DESCRIPTION, PRODUCT_NAME, PRODUCT_ATTRIBUTES, PRODUCT_METADATAS, KEY, \
DESCRIPTION, VALUE, VERSION, ATTRIBUTE_TYPE, ATTRIBUTE_TYPE_PLAIN
from utils import id_generator, delete_keys_from_dict
def simple_product_body(description=None, name=None):
... | {
"repo_name": "telefonicaid/fiware-sdc",
"path": "test/acceptance/commons/product_body.py",
"copies": "2",
"size": "2883",
"license": "apache-2.0",
"hash": -3388338838218715000,
"line_mean": 30,
"line_max": 114,
"alpha_frac": 0.6899063476,
"autogenerated": false,
"ratio": 3.7984189723320156,
"c... |
__author__ = 'arobres'
from utils import delete_keys_when_value_is_none
from constants import PRODUCT_INSTANCE, PRODUCT_INSTANCE_VM, PRODUCT_INSTANCE_VM_HOSTNAME, PRODUCT_INSTANCE_VM_IP, \
PRODUCT_INSTANCE_VM_FQN, PRODUCT_INSTANCE_VM_OSTYPE, PRODUCT, PRODUCT_NAME, VERSION, PRODUCT_INSTANCE_ATTRIBUTES
def install... | {
"repo_name": "telefonicaid/fiware-sdc",
"path": "test/acceptance/commons/installation_body.py",
"copies": "2",
"size": "1517",
"license": "apache-2.0",
"hash": -5828251861232568000,
"line_mean": 49.6,
"line_max": 117,
"alpha_frac": 0.6769940672,
"autogenerated": false,
"ratio": 3.408988764044943... |
__author__ = 'arobres'
from selenium import webdriver
from selenium.webdriver.support.ui import Select
from nose.tools import assert_equals
import requests
requests.get('http://localhost:8081/v1.0/reset')
#DEFINE DATA
subject_data = 'First Message with Selenium!'
message_data = "I'm automating my first test with ... | {
"repo_name": "twiindan/forum_html",
"path": "test/exercices/exercice1.py",
"copies": "1",
"size": "1213",
"license": "apache-2.0",
"hash": -1865776380524027400,
"line_mean": 17.1044776119,
"line_max": 97,
"alpha_frac": 0.7493816983,
"autogenerated": false,
"ratio": 3.024937655860349,
"config_t... |
__author__ = 'arobres'
from selenium import webdriver
from selenium.webdriver.support.ui import Select
from nose.tools import assert_equals
import requests
requests.get('http://localhost:8081/v1.0/reset')
#DEFINE DATA
subject_data = 'First Message with Selenium!'
message_data = "I'm automating my first test with P... | {
"repo_name": "twiindan/forum_html",
"path": "test/solutions/solution1.py",
"copies": "1",
"size": "2050",
"license": "apache-2.0",
"hash": -7051663387366634000,
"line_mean": 26.7027027027,
"line_max": 97,
"alpha_frac": 0.7409756098,
"autogenerated": false,
"ratio": 2.9839883551673947,
"config_... |
__author__ = 'arocchi'
import argparse
from lxml import etree
class SoftHandLoader(object):
def __init__(self,filename):
self.handParameters = dict()
self.jointToLink = dict()
self.urdf = etree.fromstring(file(filename).read())
for transmission_el in self.urdf.iter('transmission'... | {
"repo_name": "arocchi/Klampt",
"path": "Python/control/soft_hand_loader.py",
"copies": "1",
"size": "4864",
"license": "bsd-3-clause",
"hash": 6205676918513388000,
"line_mean": 45.3238095238,
"line_max": 143,
"alpha_frac": 0.5435855263,
"autogenerated": false,
"ratio": 4.087394957983193,
"conf... |
__author__ = 'arosado'
import os
import matplotlib.pyplot as plt
import numpy as np
import scipy.stats as scistats
import pickle
import json
import csv
class BFPData:
currentDirectory = None
currentFile = None
currentFileName = None
currentFileData = None
currentCycleData = None
currentCycleInd... | {
"repo_name": "amrosado/BFPOnlineDataAnalysis",
"path": "BFPDataAnalysis/bfpDataParsing.py",
"copies": "1",
"size": "25979",
"license": "mit",
"hash": -3784311157106568700,
"line_mean": 41.8006589786,
"line_max": 138,
"alpha_frac": 0.5823164864,
"autogenerated": false,
"ratio": 4.162634193238263,... |
__author__ = 'arosado'
import pycurl
import urllib.parse
import collections
import types
from Bio import Entrez
#import HTMLParser
#import sys
from lxml import etree
import lxml.html
import re
import io
import os
import pickle
#import json
Journal = collections.namedtuple('Journal', ['Rank', 'AbrevTitle', 'IsiLink', ... | {
"repo_name": "dgutman/ADRC_Analytics",
"path": "src/bib_vis.py",
"copies": "1",
"size": "12564",
"license": "apache-2.0",
"hash": 7264314239875009000,
"line_mean": 37.188449848,
"line_max": 208,
"alpha_frac": 0.6151703279,
"autogenerated": false,
"ratio": 3.743742550655542,
"config_test": fals... |
__author__ = 'arosado'
import requests
import json
class TciaApiClient:
apiKey = None
baseUrl = None
apiResourceUrl = None
apiFormat = None
sharedResource = '/SharedList'
currentCollection = None
currentBodyPartExamined = None
currentModality = None
currentStudyInstanceUID = None... | {
"repo_name": "amrosado/TciaApiV3ClientPython",
"path": "tciaApiClient.py",
"copies": "1",
"size": "10684",
"license": "mit",
"hash": -3054086094745172500,
"line_mean": 34.9764309764,
"line_max": 189,
"alpha_frac": 0.6543429427,
"autogenerated": false,
"ratio": 4.706607929515418,
"config_test":... |
__author__ = 'Arpana'
import nltk
import string
import itertools
import re
from nltk.tag.simplify import simplify_wsj_tag
from nltk.tokenize.punkt import PunktWordTokenizer
from collections import defaultdict, namedtuple
from nltk.stem.wordnet import WordNetLemmatizer
from nltk.stem import *
class WordFeatureMap(obj... | {
"repo_name": "fa97/cs4740",
"path": "supervised_wsd/wsd.py",
"copies": "1",
"size": "4719",
"license": "bsd-3-clause",
"hash": 6287131626279220000,
"line_mean": 31.3287671233,
"line_max": 120,
"alpha_frac": 0.5638906548,
"autogenerated": false,
"ratio": 3.6496519721577725,
"config_test": false... |
import os,sys
months={'January': 1,'February': 2,'March': 3,'April': 4,'May': 5,'June': 6,
'July': 7, 'August': 8, 'September': 9, 'October': 10, 'November': 11, 'December': 12}
years=[2009,2010,2011,2012,2013]
starttime=['August',2013]
endtime=['August',2013]
def afterStart(month,year):
if year>starttime[1]:
... | {
"repo_name": "noise-lab/nanog-parse",
"path": "nanog-fetch.py",
"copies": "1",
"size": "2260",
"license": "mit",
"hash": -2306739306694920000,
"line_mean": 28.7368421053,
"line_max": 86,
"alpha_frac": 0.5084070796,
"autogenerated": false,
"ratio": 3.8175675675675675,
"config_test": false,
"h... |
__author__ = 'Arpit'
import easygui as eg
import sys
import json
from Course import Course
from Year import Year
import find
import time
import gmailer
from tkinter import *
import io
from PIL import Image,ImageTk
def parse_json_file(json_file):
with open(json_file) as map_data:
data = json.load(ma... | {
"repo_name": "arpitmathur/CourseAvailabilityChecker",
"path": "TkInterGUI.py",
"copies": "1",
"size": "14202",
"license": "mit",
"hash": 2588891568965474000,
"line_mean": 32.8973747017,
"line_max": 242,
"alpha_frac": 0.6120968878,
"autogenerated": false,
"ratio": 3.561183550651956,
"config_tes... |
__author__ = 'Arpit'
import easygui as eg
import sys
import json
from Course import Course
from Year import Year
import find
import time
import gmailer
'''
Function returns a print string of the attributes of the course
@:param parse_json_file the json file to be parsed
@return data the parsed json obje... | {
"repo_name": "arpitmathur/CourseAvailabilityChecker",
"path": "GUI.py",
"copies": "1",
"size": "8463",
"license": "mit",
"hash": 3965745226546013000,
"line_mean": 31.9299610895,
"line_max": 242,
"alpha_frac": 0.6038047974,
"autogenerated": false,
"ratio": 3.843324250681199,
"config_test": fals... |
__author__ = 'Arpit'
import find
import time
import gmailer
'''
Function goes through the course list and checks each course to see if its open or not and if open
it emails the user to notify him/her
@:param course_list the list of courses to check for
@:param year the year and semester to be checked
... | {
"repo_name": "arpitmathur/CourseAvailabilityChecker",
"path": "course_check.py",
"copies": "1",
"size": "1550",
"license": "mit",
"hash": 7235584633744645000,
"line_mean": 34.25,
"line_max": 242,
"alpha_frac": 0.5935483871,
"autogenerated": false,
"ratio": 3.799019607843137,
"config_test": fal... |
__author__ = 'Arpit'
import smtplib
'''
This function uses an SMTP server to access the coursechecker gmail account and emails
the user to notify them that the course is open
@:param sending_address the email address that is sending the email
@:param to_address_list the list of emails to send the email... | {
"repo_name": "arpitmathur/CourseAvailabilityChecker",
"path": "gmailer.py",
"copies": "1",
"size": "1283",
"license": "mit",
"hash": -7413418707060880000,
"line_mean": 40.4193548387,
"line_max": 90,
"alpha_frac": 0.6819953235,
"autogenerated": false,
"ratio": 3.972136222910217,
"config_test": ... |
__author__ = 'Arseniy'
from model.contact import Contact
from random import randrange
import re
def test_phones_on_home_page(app, db):
if len(db.get_contact_list()) == 0:
app.contact.create(Contact(firstname="John", lastname="Snow", address="Hollywood, 11", email2="john@ya.ru",
... | {
"repo_name": "arseny-tsyro/python_training",
"path": "test/test_contact_info.py",
"copies": "1",
"size": "3263",
"license": "apache-2.0",
"hash": 7290096702865734000,
"line_mean": 39.2839506173,
"line_max": 115,
"alpha_frac": 0.6064970886,
"autogenerated": false,
"ratio": 3.0269016697588125,
"... |
__author__ = 'Arseniy'
from model.contact import Contact
from selenium.webdriver.support.select import Select
import re
class ContactHelper:
def __init__(self, app):
self.app = app
def load_home_page(self):
wd = self.app.wd
if len(wd.find_elements_by_link_text("Last name")) > 0:
... | {
"repo_name": "arseny-tsyro/python_training",
"path": "fixture/contact.py",
"copies": "1",
"size": "16725",
"license": "apache-2.0",
"hash": -2131739116607417000,
"line_mean": 45.717877095,
"line_max": 108,
"alpha_frac": 0.5910313901,
"autogenerated": false,
"ratio": 3.3564118001204095,
"config... |
__author__ = 'Arseniy'
from model.project import Project
class ProjectHelper:
def __init__(self, app):
self.app = app
def create(self, project):
wd = self.app.wd
self.load_new_project_page()
# enter values
wd.find_element_by_name("name").click()
wd.find_elemen... | {
"repo_name": "arseny-tsyro/python_training_mantis",
"path": "fixture/project.py",
"copies": "1",
"size": "2132",
"license": "apache-2.0",
"hash": 8910550623397927000,
"line_mean": 34.55,
"line_max": 92,
"alpha_frac": 0.5928705441,
"autogenerated": false,
"ratio": 3.5474209650582362,
"config_te... |
__author__ = 'Arseniy'
from pony.orm import *
from datetime import datetime
from model.group import Group
from model.contact import Contact
from pymysql.converters import decoders
class ORMFixture:
db = Database()
class ORMGroup(db.Entity):
_table_ = 'group_list'
id = PrimaryKey(int, column=... | {
"repo_name": "arseny-tsyro/python_training",
"path": "fixture/orm.py",
"copies": "1",
"size": "3481",
"license": "apache-2.0",
"hash": 508427857461083840,
"line_mean": 38.5568181818,
"line_max": 111,
"alpha_frac": 0.6406205113,
"autogenerated": false,
"ratio": 3.6835978835978835,
"config_test"... |
__author__ = 'Arseniy'
from sys import maxsize
class Contact:
def __init__(self, id=None, firstname=None, middlename=None, lastname=None, nickname=None, title=None, company=None,
address=None, home_num=None, mobile_num=None, work_num=None, fax_num=None, email=None, email2=None,
e... | {
"repo_name": "arseny-tsyro/python_training",
"path": "model/contact.py",
"copies": "1",
"size": "1680",
"license": "apache-2.0",
"hash": -5080716490493946000,
"line_mean": 36.3555555556,
"line_max": 120,
"alpha_frac": 0.6,
"autogenerated": false,
"ratio": 3.5443037974683542,
"config_test": fal... |
__author__ = 'Arseniy'
import mysql.connector
from model.group import Group
from model.contact import Contact
class DbFixture:
def __init__(self, name, host, user, password):
self.name = name
self.host = host
self.user = user
self.password = password
self.connection = mysql... | {
"repo_name": "arseny-tsyro/python_training",
"path": "fixture/db.py",
"copies": "1",
"size": "1781",
"license": "apache-2.0",
"hash": -7507640418382564000,
"line_mean": 39.5,
"line_max": 111,
"alpha_frac": 0.5884334643,
"autogenerated": false,
"ratio": 3.725941422594142,
"config_test": false,
... |
__author__ = 'Arseniy'
class SessionHelper:
def __init__(self, app):
self.app = app
def login(self, username, password):
wd = self.app.wd
self.app.load_login_page()
wd.find_element_by_name("user").click()
wd.find_element_by_name("user").clear()
wd.find_element... | {
"repo_name": "arseny-tsyro/python_training",
"path": "fixture/session.py",
"copies": "1",
"size": "1404",
"license": "apache-2.0",
"hash": -6024874771582733000,
"line_mean": 29.5217391304,
"line_max": 73,
"alpha_frac": 0.5726495726,
"autogenerated": false,
"ratio": 3.375,
"config_test": false,... |
__author__ = 'artem'
import numpy as np
from spacepy import dmarray
from Model import Model
import Parameters
import struct
params = Parameters.Parameters
class NurgushBinData(Model):
def sub_title(self):
return ' time = ' + "{:.2}".format(self['time']) + " "
def get_name(self):
return str(... | {
"repo_name": "arakcheev/python-data-plotter",
"path": "NurgushBinData.py",
"copies": "1",
"size": "3539",
"license": "mit",
"hash": 4935711268080283000,
"line_mean": 32.7047619048,
"line_max": 90,
"alpha_frac": 0.4690590562,
"autogenerated": false,
"ratio": 3.483267716535433,
"config_test": fa... |
__author__ = 'artem'
import numpy as np
import re
from spacepy import dmarray
from Model import Model
import Parameters
params = Parameters.Parameters
class TecData(Model):
def sub_title(self):
return ' time = ' + "{:.2}".format(self['time']) + " "
def get_name(self):
name_groups = re.searc... | {
"repo_name": "arakcheev/python-data-plotter",
"path": "TecData.py",
"copies": "1",
"size": "3856",
"license": "mit",
"hash": -9049732075270245000,
"line_mean": 33.4285714286,
"line_max": 91,
"alpha_frac": 0.4683609959,
"autogenerated": false,
"ratio": 3.48014440433213,
"config_test": false,
... |
__author__ = 'artem'
import os
from FileData import FileData
from Parameters import Parameters
import glob
import matplotlib.pyplot as plt
folder = "/Volumes/Storage/workspace/inasan/SWMF/test/"
pattern = "*.out"
target = folder + "moments/"
if not os.path.exists(target):
os.makedirs(target)
files = glob.glob(f... | {
"repo_name": "arakcheev/python-data-plotter",
"path": "plot_moments.py",
"copies": "1",
"size": "1031",
"license": "mit",
"hash": -4117855354455441000,
"line_mean": 20.9361702128,
"line_max": 90,
"alpha_frac": 0.666343356,
"autogenerated": false,
"ratio": 3.059347181008902,
"config_test": fals... |
__author__ = 'artem'
import sys
from FileData import FileData
from TecData import TecData
from Parameters import Parameters
import glob
import matplotlib.pyplot as plt
import os
import re
import ConfigParser
Config = ConfigParser.ConfigParser()
Config.read("parameters.cfg")
# folder = "/Users/artem/workspace/inasan/... | {
"repo_name": "arakcheev/python-data-plotter",
"path": "plot_contours.py",
"copies": "1",
"size": "1424",
"license": "mit",
"hash": -2461633785335928300,
"line_mean": 21.9677419355,
"line_max": 105,
"alpha_frac": 0.6601123596,
"autogenerated": false,
"ratio": 3.0427350427350426,
"config_test": ... |
__author__ = 'artem'
import sys
import os
from TecData import TecData
from Parameters import Parameters
import glob
import matplotlib.pyplot as plt
import re
folder = "/Volumes/Storage/workspace/inasan/nurgush/exp_grid/"
pattern = "*.dat"
target = folder + "slices/"
if not os.path.exists(target):
os.makedirs(tar... | {
"repo_name": "arakcheev/python-data-plotter",
"path": "plot_srez_pho.py",
"copies": "1",
"size": "3491",
"license": "mit",
"hash": 118869366023374000,
"line_mean": 29.3565217391,
"line_max": 119,
"alpha_frac": 0.6147235749,
"autogenerated": false,
"ratio": 2.6032811334824757,
"config_test": fa... |
"""
This and other `proxy` modules implement the time-dependent mean-field procedure using the existing pyscf
implementations as a black box. The main purpose of these modules is to overcome the existing limitations in pyscf
(i.e. real-only orbitals, davidson diagonalizer, incomplete Bloch space, etc). The primary perf... | {
"repo_name": "sunqm/pyscf",
"path": "pyscf/pbc/tdscf/kproxy.py",
"copies": "1",
"size": "7401",
"license": "apache-2.0",
"hash": -4146807235108862000,
"line_mean": 38.1587301587,
"line_max": 129,
"alpha_frac": 0.6293744089,
"autogenerated": false,
"ratio": 3.5026029342167533,
"config_test": fa... |
"""
This and other `_slow` modules implement the time-dependent Hartree-Fock procedure. The primary performance drawback is
that, unlike other 'fast' routines with an implicit construction of the eigenvalue problem, these modules construct
TDHF matrices explicitly via an AO-MO transformation, i.e. with a O(N^5) complex... | {
"repo_name": "sunqm/pyscf",
"path": "pyscf/pbc/tdscf/krhf_slow.py",
"copies": "1",
"size": "13493",
"license": "apache-2.0",
"hash": 3204777457928965600,
"line_mean": 43.9766666667,
"line_max": 131,
"alpha_frac": 0.5011487438,
"autogenerated": false,
"ratio": 3.6977254042203342,
"config_test":... |
"""
This and other `proxy` modules implement the time-dependent mean-field procedure using the existing pyscf
implementations as a black box. The main purpose of these modules is to overcome the existing limitations in pyscf
(i.e. real-only orbitals, davidson diagonalizer, incomplete Bloch space, etc). The primary perf... | {
"repo_name": "gkc1000/pyscf",
"path": "pyscf/pbc/tdscf/kproxy.py",
"copies": "1",
"size": "7386",
"license": "apache-2.0",
"hash": 8265019224992194000,
"line_mean": 38.2872340426,
"line_max": 129,
"alpha_frac": 0.6292986732,
"autogenerated": false,
"ratio": 3.5054579971523494,
"config_test": f... |
"""
This and other `_slow` modules implement the time-dependent Hartree-Fock procedure. The primary performance drawback is
that, unlike other 'fast' routines with an implicit construction of the eigenvalue problem, these modules construct
TDHF matrices explicitly via an AO-MO transformation, i.e. with a O(N^5) complex... | {
"repo_name": "gkc1000/pyscf",
"path": "pyscf/pbc/tdscf/krhf_slow.py",
"copies": "1",
"size": "13478",
"license": "apache-2.0",
"hash": 8428601316981648000,
"line_mean": 44.0769230769,
"line_max": 131,
"alpha_frac": 0.5009645348,
"autogenerated": false,
"ratio": 3.699698051056821,
"config_test"... |
"""
This and other `_slow` modules implement the time-dependent procedure. The primary performance drawback is
that, unlike other 'fast' routines with an implicit construction of the eigenvalue problem, these modules construct
TDHF matrices explicitly. As a result, regular `numpy.linalg.eig` can be used to retrieve TDH... | {
"repo_name": "gkc1000/pyscf",
"path": "pyscf/tdscf/common_slow.py",
"copies": "1",
"size": "24029",
"license": "apache-2.0",
"hash": 1366597248966445800,
"line_mean": 29.8064102564,
"line_max": 121,
"alpha_frac": 0.567647426,
"autogenerated": false,
"ratio": 3.6139269063016997,
"config_test": ... |
__author__ = 'Artem Sliusar'
#suits idx
heart = 0
diamond = 1
club = 2
spade = 3
# ranks idx
Two = 0
Three = 1
Four = 2
Five = 3
Six = 4
Seven = 5
Eight = 6
Nine = 7
Ten = 8
Jack = 9
Queen = 10
King = 11
Ace ... | {
"repo_name": "Yarmorgun/poker-player-kraken",
"path": "converters.py",
"copies": "1",
"size": "2421",
"license": "mit",
"hash": 1803984931747145500,
"line_mean": 20.8108108108,
"line_max": 73,
"alpha_frac": 0.3453118546,
"autogenerated": false,
"ratio": 3.513788098693759,
"config_test": false,... |
import os
from os.path import join
import matplotlib.pyplot as plt
from sacred import Experiment
from sacred.observers import FileStorageObserver
from modl.datasets.image import load_image
from modl.decomposition.image import ImageDictFact, DictionaryScorer
from modl.feature_extraction.image import LazyCleanPatchExtr... | {
"repo_name": "arthurmensch/modl",
"path": "exps/exp_decompose_images.py",
"copies": "1",
"size": "3480",
"license": "bsd-2-clause",
"hash": 1594253594662026800,
"line_mean": 32.1428571429,
"line_max": 75,
"alpha_frac": 0.5232758621,
"autogenerated": false,
"ratio": 4.306930693069307,
"config_t... |
import warnings
from nilearn.input_data import NiftiMasker
warnings.filterwarnings("ignore", category=DeprecationWarning)
import os
from os.path import expanduser, join
import matplotlib.pyplot as plt
import numpy as np
import seaborn as sns
from joblib import Memory, dump
from joblib import Parallel, delayed
from ... | {
"repo_name": "arthurmensch/modl",
"path": "examples/decompose_fmri_stability.py",
"copies": "1",
"size": "4960",
"license": "bsd-2-clause",
"hash": -6497502614826837000,
"line_mean": 34.1773049645,
"line_max": 79,
"alpha_frac": 0.633266129,
"autogenerated": false,
"ratio": 3.5053003533568905,
... |
"""Author: Arthur Mensch
Benchmarks of sklearn SAGA vs lightning SAGA vs Liblinear. Shows the gain
in using multinomial logistic regression in term of learning time.
"""
import json
import time
from os.path import expanduser
import matplotlib.pyplot as plt
import numpy as np
from sklearn.datasets import fetch_rcv1, ... | {
"repo_name": "vortex-ape/scikit-learn",
"path": "benchmarks/bench_saga.py",
"copies": "7",
"size": "8463",
"license": "bsd-3-clause",
"hash": -6474303244771855000,
"line_mean": 33.6844262295,
"line_max": 79,
"alpha_frac": 0.5358619875,
"autogenerated": false,
"ratio": 3.6588845654993514,
"conf... |
__author__ = 'arthur'
import os
import sys
from PyQt5.QtCore import *
from PyQt5.QtWidgets import *
from PyQt5.QtWebKitWidgets import *
from warehouse import WareHouse
class Window(QWidget):
def __init__(self):
super(Window, self).__init__()
self.setGeometry(300, 300, 1024, 800)
self.se... | {
"repo_name": "Arthraim/warehouse",
"path": "app.py",
"copies": "1",
"size": "1058",
"license": "mit",
"hash": 6612306280471325000,
"line_mean": 23.6279069767,
"line_max": 103,
"alpha_frac": 0.640831758,
"autogenerated": false,
"ratio": 3.4688524590163934,
"config_test": false,
"has_no_keywor... |
__author__ = 'Arthur'
"""
This class is used as a data structure for passenger/driver.
"""
class Member(object):
name = None
address = None
coord = None
isDriver = None
psg_list = None
def __init__(self, name, addr, is_driver=False):
if not name or not addr :
print("Error... | {
"repo_name": "GesusK/multi-driver_carpool",
"path": "MDC/Member.py",
"copies": "1",
"size": "1461",
"license": "mit",
"hash": 1967275530004801000,
"line_mean": 21.4923076923,
"line_max": 63,
"alpha_frac": 0.5386721424,
"autogenerated": false,
"ratio": 3.7270408163265305,
"config_test": false,
... |
__author__ = 'Arthur'
"""
This module is used to cluster the passengers into different group,
each of which is led by a driver.
"""
import googlemaps
from datetime import datetime
from APIkey import APIkey
import data_input
import constants
def psgr_cluster(dvr_list, psg_list, car_capacity):
myname = "psgr_clu... | {
"repo_name": "GesusK/multi-driver_carpool",
"path": "MDC/psgr_cluster.py",
"copies": "1",
"size": "3805",
"license": "mit",
"hash": -2952060516911233500,
"line_mean": 31.5213675214,
"line_max": 116,
"alpha_frac": 0.5844940867,
"autogenerated": false,
"ratio": 3.343585237258348,
"config_test": ... |
__author__ = 'arthurvandermerwe'
AUTH_CODE_MAP = {}
AUTH_CODE_MAP["000"] = "Transaction Approved"
AUTH_CODE_MAP["001"] = "Expired Card"
AUTH_CODE_MAP["002"] = "Unauthorized Usage"
AUTH_CODE_MAP["003"] = "Pin Error"
AUTH_CODE_MAP["004"] = "Invalid Pin"
AUTH_CODE_MAP["005"] = "Bank Unavailable"
AUTH_CODE_MAP["006"] = "C... | {
"repo_name": "sabit/ATM-Transaction-Trace",
"path": "MiddlewareServer/src/AuthCodeMapping.py",
"copies": "2",
"size": "1423",
"license": "mit",
"hash": -2993238271053437400,
"line_mean": 42.1212121212,
"line_max": 61,
"alpha_frac": 0.6964160225,
"autogenerated": false,
"ratio": 2.857429718875502... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.