text stringlengths 0 1.05M | meta dict |
|---|---|
__author__ = 'Timo'
from django import forms
from models import Movie, Director, Studio, Writer, Actor, Genre, Rating
import django_filters
from django_filters.widgets import LinkWidget
class MovieForm(forms.ModelForm):
class Meta:
model = Movie
exclude = ('uploaded_by',)
class WriterForm(forms.Mo... | {
"repo_name": "atimothee/django-playground",
"path": "django_playground/movie_library/forms.py",
"copies": "1",
"size": "1331",
"license": "bsd-3-clause",
"hash": -6665344292650417000,
"line_mean": 35,
"line_max": 99,
"alpha_frac": 0.7227648385,
"autogenerated": false,
"ratio": 3.891812865497076,... |
__author__ = 'Timotheus Kampik'
import sys
from random import randint
from optparse import OptionParser
# import and init pygame
import pygame
pygame.init()
#option parser, get maximum of distribution
parser = OptionParser()
parser.add_option("--rangeMax", type="int", dest="rangeMax",
help="Set maxi... | {
"repo_name": "TimKam/TheNatureOfCodePython",
"path": "Introduction/Example_2_RandomDistribution/randomDistribution.py",
"copies": "1",
"size": "1393",
"license": "mit",
"hash": 4957562132829478000,
"line_mean": 28.0208333333,
"line_max": 111,
"alpha_frac": 0.6654702082,
"autogenerated": false,
"... |
__author__ = 'Timotheus Kampik'
import sys
from random import randint
#import and init pygame
import pygame
pygame.init()
#create screen
window = pygame.display.set_mode((640, 480))
class Walker():
#initiate and draw walker
def __init__(self):
self.x = int(window.get_width() / 2)
self.y = int(... | {
"repo_name": "TimKam/TheNatureOfCodePython",
"path": "Introduction/Example_1_RandomWalkTraditional/traditionalRandomWalk.py",
"copies": "1",
"size": "1393",
"license": "mit",
"hash": -2709051521976481300,
"line_mean": 20.765625,
"line_max": 77,
"alpha_frac": 0.5714285714,
"autogenerated": false,
... |
__author__ = 'Timotheus Kampik'
import sys
from random import uniform
#import and init pygame
import pygame
pygame.init()
#create screen
window = pygame.display.set_mode((640, 480))
class Walker():
#initiate and draw walker
def __init__(self):
self.x = int(window.get_width() / 2)
self.y = int(... | {
"repo_name": "TimKam/TheNatureOfCodePython",
"path": "Introduction/Example_3_RandomWalkTendsToRight/randomWalkTendsToRight.py",
"copies": "1",
"size": "1473",
"license": "mit",
"hash": 5134383985120063000,
"line_mean": 20.9850746269,
"line_max": 77,
"alpha_frac": 0.5709436524,
"autogenerated": fal... |
import numpy as np
from scipy.interpolate import interp1d
import scipy.sparse
from scipy.sparse.linalg import lsqr
from scipy.sparse import lil_matrix
import scipy.stats
import time
def centers_to_bins(coord_centers):
if len(coord_centers) == 0:
return np.zeros(0)
bins = np.zeros(len(coord_centers) + ... | {
"repo_name": "quidditymaster/resampling",
"path": "resampling.py",
"copies": "1",
"size": "24022",
"license": "apache-2.0",
"hash": 7289628868372643000,
"line_mean": 46.5683168317,
"line_max": 172,
"alpha_frac": 0.6227208392,
"autogenerated": false,
"ratio": 3.1728965790516446,
"config_test": ... |
__author__ = 'timp'
g_projects = []
g_repos = {}
g_branches = {}
g_operations = {}
g_owners = {}
class Project():
"""A jenkins project"""
def __init__(self, original, repo, branch, operation, owner):
self.original = original
self.repo = repo
self.branch = branch
self.operation = operation
se... | {
"repo_name": "timp21337/JenkinsApiScripts",
"path": "names.py",
"copies": "1",
"size": "26901",
"license": "artistic-2.0",
"hash": -8731715790719374000,
"line_mean": 53.4574898785,
"line_max": 158,
"alpha_frac": 0.679082562,
"autogenerated": false,
"ratio": 2.801312089971884,
"config_test": tr... |
__author__ = 'timp'
import jenkinsapi
from jenkinsapi.jenkins import Jenkins
import xml.etree.ElementTree as ET
import re
jenkinswalldisplay_version = "0.6.26"
"""
<properties>
<de.pellepelster.jenkins.walldisplay.WallDisplayJobProperty plugin="jenkinswalldisplay@0.6.26">
<wallDisplayName>API Develop - Cucumbe... | {
"repo_name": "timp21337/JenkinsApiScripts",
"path": "update_display_names.py",
"copies": "1",
"size": "2117",
"license": "artistic-2.0",
"hash": 5332026252600689000,
"line_mean": 30.1323529412,
"line_max": 97,
"alpha_frac": 0.6660368446,
"autogenerated": false,
"ratio": 3.23206106870229,
"conf... |
# USAGE
# from the demos folder:
# python demos/contrast_demo.py -i demo_images/bridge.jpg -b 100
# python demos/contrast_demo.py -i demo_images/bridge.jpg --c 50
# import the necessary packages
from __future__ import print_function
import argparse
import cv2
import os
from imutils import adjust_brightness_contrast
... | {
"repo_name": "jrosebr1/imutils",
"path": "demos/contrast_demo.py",
"copies": "1",
"size": "1302",
"license": "mit",
"hash": -2159546219976576300,
"line_mean": 32.3846153846,
"line_max": 86,
"alpha_frac": 0.7188940092,
"autogenerated": false,
"ratio": 3.3045685279187818,
"config_test": false,
... |
__author__ = "Tim Savage"
__author_email__ = "tim.savage@poweredbypenguins.org"
__copyright__ = "Copyright (C) 2013 Tim Savage"
__version__ = "0.3.2"
try:
import simplejson as json
except ImportError:
import json
from jsrn.resources import Resource
from jsrn.fields import *
from jsrn.fields.composite import *
... | {
"repo_name": "timsavage/jsrn",
"path": "src/jsrn/__init__.py",
"copies": "1",
"size": "2312",
"license": "bsd-3-clause",
"hash": 301531588524078140,
"line_mean": 35.125,
"line_max": 119,
"alpha_frac": 0.7071799308,
"autogenerated": false,
"ratio": 3.931972789115646,
"config_test": false,
"ha... |
"""
Functions to aid writing python scripts that process the Scholdoc
AST serialized as JSON.
"""
import sys
import json
def walk(x, action, format, meta):
"""Walk a tree, applying an action to every object.
Returns a modified tree.
"""
if isinstance(x, list):
array = []
for item in ... | {
"repo_name": "timtylin/scholdoc-filters",
"path": "scholdocfilters.py",
"copies": "1",
"size": "4823",
"license": "bsd-3-clause",
"hash": 472394202083752800,
"line_mean": 29.3333333333,
"line_max": 78,
"alpha_frac": 0.5830396019,
"autogenerated": false,
"ratio": 3.5885416666666665,
"config_tes... |
__author__ = 'Timur Gladkikh'
from _collections import defaultdict
from nltk.corpus import stopwords
from nltk import word_tokenize
from nltk.collocations import BigramCollocationFinder
from nltk.metrics import BigramAssocMeasures
from nltk.probability import FreqDist, ConditionalFreqDist
import string
def get_token... | {
"repo_name": "fruser/review-analyzer",
"path": "src/text_utils.py",
"copies": "1",
"size": "3386",
"license": "mit",
"hash": -3911842075190812000,
"line_mean": 30.6448598131,
"line_max": 89,
"alpha_frac": 0.6568222091,
"autogenerated": false,
"ratio": 3.3557978196233895,
"config_test": false,
... |
__author__ = 'Timur Gladkikh'
from stats import *
from file_parser import parser
def print_results(lfeatures):
train_set, test_set = split_label_features(lfeatures)
classifier_lr = log_regression_classifier(train_set)
print('\nLinear Regression Classifier')
model_test(classifier_lr, test_set)
p... | {
"repo_name": "fruser/review-analyzer",
"path": "src/data_exploration.py",
"copies": "1",
"size": "1739",
"license": "mit",
"hash": 6160348769319690000,
"line_mean": 29.5087719298,
"line_max": 83,
"alpha_frac": 0.6848763657,
"autogenerated": false,
"ratio": 3.4435643564356435,
"config_test": fa... |
__author__ = 'Timur Gladkikh'
from stats import *
from utils import *
def combine_response_result(result, response):
for i in range(0, len(response)):
result[i]['api_result'] = response[i]['result'].lower()
result[i]['confidence'] = response[i]['confidence']
return result
def main():
re... | {
"repo_name": "fruser/review-analyzer",
"path": "src/vivekn_api.py",
"copies": "1",
"size": "1195",
"license": "mit",
"hash": 7696739645204359000,
"line_mean": 23.8958333333,
"line_max": 81,
"alpha_frac": 0.5631799163,
"autogenerated": false,
"ratio": 3.665644171779141,
"config_test": false,
... |
__author__ = 'Timur Gladkikh'
import gzip
import json
import dataset
import os
from stuf import stuf
DATA_FILE = '../data/reviews_Movies_and_TV.json.gz'
DB_FILE = '../data/dataset.db'
DB_URL = 'sqlite:///{0}'.format(DB_FILE)
def parser():
if os.path.isfile(DB_FILE):
return dataset.connect(DB_URL, row_typ... | {
"repo_name": "fruser/review-analyzer",
"path": "src/file_parser.py",
"copies": "1",
"size": "1184",
"license": "mit",
"hash": 4457076803969241600,
"line_mean": 21.3396226415,
"line_max": 53,
"alpha_frac": 0.5498310811,
"autogenerated": false,
"ratio": 3.3072625698324023,
"config_test": false,
... |
__author__ = 'Timur Gladkikh'
import semantria
import time
import yaml
import ssl
from stats import *
from utils import *
RESULTS_DIR = '../results/semantria/'
def get_keys():
with open('../conf/api_keys/apis.yml', 'r') as f:
data_map = yaml.safe_load(f)
api_key = data_map['semantria']['api_key... | {
"repo_name": "fruser/review-analyzer",
"path": "src/semantria_api.py",
"copies": "1",
"size": "3031",
"license": "mit",
"hash": 8173670539711550000,
"line_mean": 27.3271028037,
"line_max": 108,
"alpha_frac": 0.5414054767,
"autogenerated": false,
"ratio": 3.751237623762376,
"config_test": false... |
__author__ = 'Timur Gladkikh'
import yaml
from stats import *
from utils import *
def get_api_key():
with open('../conf/api_keys/apis.yml', 'r') as f:
data_map = yaml.safe_load(f)
api_key = data_map['meaningcloud']['api_key']
return api_key
def main():
results_dir = '../results/meaningc... | {
"repo_name": "fruser/review-analyzer",
"path": "src/meaningcloud.py",
"copies": "1",
"size": "1598",
"license": "mit",
"hash": -733263329686639700,
"line_mean": 26.5517241379,
"line_max": 84,
"alpha_frac": 0.5193992491,
"autogenerated": false,
"ratio": 3.5590200445434297,
"config_test": false,... |
__author__ = 'Tina_Chen'
class Polyhedra(object):
"""
Object representing a polyhedra in a structure with central ion site "cation" and surrounding ions site
"peripheralIons"
"""
def __init__(self, cation, peripheral_ions):
"""
:param cation: (Site) Site object representing the ... | {
"repo_name": "tchen0965/structural_descriptors_repo",
"path": "polyhedra.py",
"copies": "1",
"size": "3049",
"license": "mit",
"hash": 8269017807142984000,
"line_mean": 36.1829268293,
"line_max": 120,
"alpha_frac": 0.6388979993,
"autogenerated": false,
"ratio": 4.264335664335665,
"config_test"... |
__author__ = 'tineo'
from os import popen
import sys
from apiclient.http import MediaFileUpload
from os.path import join
from mimetypes import MimeTypes
class Makidifle:
def __init__(self):
self.mime = MimeTypes()
def insert(self, file_name, path_name, folder_id, drive_service):
file_path = ... | {
"repo_name": "tineo/MakiDrivePy",
"path": "makidifile.py",
"copies": "1",
"size": "1910",
"license": "mit",
"hash": 2481060957516130300,
"line_mean": 34.3703703704,
"line_max": 117,
"alpha_frac": 0.5345549738,
"autogenerated": false,
"ratio": 3.6037735849056602,
"config_test": false,
"has_no... |
__author__ = 'Ting'
from CrawlWorker.items import FeedItem, ContentItem
from CrawlWorker.base import FeedSpider, Utils
class StackOverflowSpider(FeedSpider):
name = 'StackOverflowSpider'
allowed_domains = ['stackoverflow.com']
def __init__(self, op=None, **kwargs):
FeedSpider.__init__(self, op, ... | {
"repo_name": "jarvisji/ScrapyCrawler",
"path": "CrawlWorker/spiders/stackoverflow.py",
"copies": "1",
"size": "2916",
"license": "apache-2.0",
"hash": -532767382900136450,
"line_mean": 42.5223880597,
"line_max": 94,
"alpha_frac": 0.6018518519,
"autogenerated": false,
"ratio": 3.857142857142857,
... |
__author__ = 'Ting'
import os
import json
from datetime import datetime
from scrapy import Spider, log
class FeedSpider(Spider):
"""
Defined main feed and scrape process, each site spider should extends this class
There are two steps to crawl items:
1. FEED summary information of recent ... | {
"repo_name": "jarvisji/ScrapyCrawler",
"path": "CrawlWorker/base.py",
"copies": "1",
"size": "11441",
"license": "apache-2.0",
"hash": 5126764749588281000,
"line_mean": 41.6940298507,
"line_max": 118,
"alpha_frac": 0.5823791627,
"autogenerated": false,
"ratio": 3.906111300785251,
"config_test"... |
__author__ = 'tintsing'
from dateutil.relativedelta import relativedelta
from datetime import datetime
from constants import STANDARD_TIME_FORMAT
def remove_nbsp_suffix(raw):
suffix = ' '
pos = raw.find(suffix)
if pos != -1:
return raw[:pos]
return raw
def date_range(start_dt, end_dt, s... | {
"repo_name": "ChenjunZou/QuantBet",
"path": "crawler/CrawlerUtils.py",
"copies": "1",
"size": "1422",
"license": "apache-2.0",
"hash": 4481119828711007000,
"line_mean": 20.5454545455,
"line_max": 64,
"alpha_frac": 0.5893108298,
"autogenerated": false,
"ratio": 3.5285359801488836,
"config_test"... |
__author__ = 'tintsing'
import models
import logging
from constants import DetailTypes
logger = logging.getLogger("bet")
# football db operation
def get_all_football_games():
games = models.FootballGame.objects.all()
return games
def get_league_names():
leagues = models.FootballGame.objects.values_list... | {
"repo_name": "ChenjunZou/QuantBet",
"path": "bet/history/db_utils.py",
"copies": "1",
"size": "3227",
"license": "apache-2.0",
"hash": -709109734322575900,
"line_mean": 28.0720720721,
"line_max": 105,
"alpha_frac": 0.7074682368,
"autogenerated": false,
"ratio": 3.546153846153846,
"config_test"... |
__author__ = 'tintsing'
class SportsOdds (object):
def __init__(self):
self.sports_type = ''
self.vendor = ''
self.round_type = ''
self.league = ''
self.start_time = ''
self.host = ''
self.away = ''
self.host_score = 0
self.away_score = 0
... | {
"repo_name": "ChenjunZou/QuantBet",
"path": "crawler/SportsOdds.py",
"copies": "1",
"size": "1885",
"license": "apache-2.0",
"hash": 4416203795801359000,
"line_mean": 27.1343283582,
"line_max": 110,
"alpha_frac": 0.5236074271,
"autogenerated": false,
"ratio": 2.860394537177542,
"config_test": ... |
__author__ = 'tinyms'
#coding=UTF8
from datetime import datetime
from sqlalchemy import func
from tinyms.core.common import Utils
from tinyms.core.orm import SessionFactory
from tinyms.core.entity import Role, Archives, Account, SecurityPoint
from tinyms.core.annotation import ObjectPool, reg_point
from tinyms.dao.cate... | {
"repo_name": "tinyms/ArchiveX",
"path": "tinyms/core/loader.py",
"copies": "1",
"size": "6738",
"license": "bsd-3-clause",
"hash": -6147278388170759000,
"line_mean": 40.4225352113,
"line_max": 99,
"alpha_frac": 0.5776946617,
"autogenerated": false,
"ratio": 2.4662473794549267,
"config_test": f... |
__author__ = 'tinyms'
#coding=UTF8
from functools import wraps
from tinyms.core.entity import SecurityPoint
from tinyms.core.common import Utils
#for plugin to extends
class EmptyClass(object):
pass
class ObjectPool():
mode_dev = False
server_starups = list()
points = list()
user_security_points... | {
"repo_name": "tinyms/ArchiveX",
"path": "tinyms/core/annotation.py",
"copies": "1",
"size": "6641",
"license": "bsd-3-clause",
"hash": 2181573832988277000,
"line_mean": 20.7985611511,
"line_max": 101,
"alpha_frac": 0.5906915333,
"autogenerated": false,
"ratio": 3.0310155077538767,
"config_test... |
__author__ = 'tinyms'
#coding=UTF8
from inspect import isfunction
from tornado.util import import_object
class NodeType():
End = "End"
Action = "Action"
Fork = "Fork"
Join = "Join"
Form = "Form"
class Node():
def __init__(self, id_, name, parent_id, act=None, type_=None):
self.id = i... | {
"repo_name": "tinyms/ArchiveX",
"path": "tinyms/bpm/nodes.py",
"copies": "1",
"size": "2582",
"license": "bsd-3-clause",
"hash": -8481537805175818000,
"line_mean": 24.21,
"line_max": 69,
"alpha_frac": 0.5357142857,
"autogenerated": false,
"ratio": 3.437926330150068,
"config_test": false,
"ha... |
__author__ = 'tinyms'
#coding=UTF8
from sqlalchemy import func
from tinyms.core.annotation import route, api
from tinyms.core.web import IRequest
from tinyms.core.common import Utils
from tinyms.core.orm import SessionFactory
from tinyms.core.entity import Account, Archives, Role
from tinyms.core.setting import AppSet... | {
"repo_name": "tinyms/ArchiveX",
"path": "tinyms/controller/anonymous.py",
"copies": "1",
"size": "5211",
"license": "bsd-3-clause",
"hash": -8639062152532616000,
"line_mean": 33.9798657718,
"line_max": 113,
"alpha_frac": 0.5712914988,
"autogenerated": false,
"ratio": 3.5497275204359675,
"confi... |
__author__ = 'tinyms'
#coding=UTF8
from sqlalchemy import func
from tinyms.core.common import Utils
from tinyms.core.web import IAuthRequest
from tinyms.core.annotation import route, datatable_provider
from tinyms.core.entity import WorkExperience, LearningExperience, TrainingExperience, Archives
from tinyms.core.sett... | {
"repo_name": "tinyms/ArchiveX",
"path": "tinyms/controller/archives.py",
"copies": "1",
"size": "3523",
"license": "bsd-3-clause",
"hash": -86136319219845060,
"line_mean": 37.5054945055,
"line_max": 113,
"alpha_frac": 0.6640022838,
"autogenerated": false,
"ratio": 3.4614624505928853,
"config_t... |
__author__ = 'tinyms'
#coding=UTF8
from sqlalchemy import join, Column, Integer, String, DateTime, Text, Date, Numeric
from sqlalchemy.orm import column_property
from tinyms.core.orm import Entity, Simplify, many_to_one, many_to_many, entity_manager
#人员档案
@entity_manager()
class Archives(Entity, Simplify):
#编码,... | {
"repo_name": "tinyms/ArchiveX",
"path": "tinyms/core/entity.py",
"copies": "1",
"size": "5535",
"license": "bsd-3-clause",
"hash": -7394135207204593000,
"line_mean": 22.1428571429,
"line_max": 87,
"alpha_frac": 0.6506671978,
"autogenerated": false,
"ratio": 2.6907824222936765,
"config_test": f... |
__author__ = 'tinyms'
#coding=UTF8
from tinyms.core.annotation import ajax,ObjectPool
from tinyms.dao.category import CategoryHelper
from tinyms.dao.account import AccountHelper
from tinyms.core.common import Utils
@ajax("OrgEdit")
class OrgEdit():
__export__ = ["list","add","update","delete","names"]
def lis... | {
"repo_name": "tinyms/ArchiveX",
"path": "tinyms/controller/org.py",
"copies": "1",
"size": "2196",
"license": "bsd-3-clause",
"hash": 1665857676565905700,
"line_mean": 33.328125,
"line_max": 94,
"alpha_frac": 0.5883424408,
"autogenerated": false,
"ratio": 3.8526315789473684,
"config_test": fal... |
__author__ = 'tinyms'
#coding=UTF8
import json
from sqlalchemy.ext.declarative import declarative_base, declared_attr
from sqlalchemy.orm import relationship, backref, class_mapper
from sqlalchemy import Column, Integer, ForeignKey, Table, String
from sqlalchemy.sql.expression import FunctionElement
from sqlalchemy.ext... | {
"repo_name": "tinyms/ArchiveX",
"path": "tinyms/core/orm.py",
"copies": "1",
"size": "9315",
"license": "bsd-3-clause",
"hash": 4436235118008505000,
"line_mean": 34.8714859438,
"line_max": 119,
"alpha_frac": 0.5175232337,
"autogenerated": false,
"ratio": 3.763590391908976,
"config_test": false... |
__author__ = 'tinyms'
#coding=UTF8
import json
from sqlalchemy import or_
from tinyms.core.common import Utils
from tinyms.core.web import IAuthRequest
from tinyms.core.annotation import route, ajax, auth, dataview_provider, datatable_provider
from tinyms.core.orm import SessionFactory
from tinyms.core.entity import Se... | {
"repo_name": "tinyms/ArchiveX",
"path": "tinyms/controller/security.py",
"copies": "1",
"size": "7838",
"license": "bsd-3-clause",
"hash": -6071119859825864000,
"line_mean": 36.5528846154,
"line_max": 120,
"alpha_frac": 0.5793854033,
"autogenerated": false,
"ratio": 3.720819437827537,
"config_... |
__author__ = 'tinyms'
#coding=UTF8
import json
from tinyms.core.orm import SessionFactory
from tinyms.core.entity import Setting
from tinyms.core.common import JsonEncoder
#用户级别设置辅助类
class UserSettingHelper():
def __init__(self, usr_id):
self.usr = "%s" % usr_id
self.setting = dict()
self... | {
"repo_name": "tinyms/ArchiveX",
"path": "tinyms/core/setting.py",
"copies": "1",
"size": "2208",
"license": "bsd-3-clause",
"hash": -2236068843645317600,
"line_mean": 25.487804878,
"line_max": 96,
"alpha_frac": 0.5492633517,
"autogenerated": false,
"ratio": 3.6381909547738696,
"config_test": f... |
__author__ = 'tinyms'
#coding=UTF8
import os
from tornado.web import RequestHandler
from tinyms.core.common import Utils
from tinyms.core.annotation import EmptyClass, ObjectPool, route
from tinyms.core.cache import CacheManager
from tinyms.dao.account import AccountHelper
class IRequest(RequestHandler):
__key_ac... | {
"repo_name": "tinyms/ArchiveX",
"path": "tinyms/core/web.py",
"copies": "1",
"size": "10011",
"license": "bsd-3-clause",
"hash": -8704773139560014000,
"line_mean": 32.9520547945,
"line_max": 91,
"alpha_frac": 0.5151820841,
"autogenerated": false,
"ratio": 3.9166337416041093,
"config_test": fal... |
__author__ = 'tinyms'
#coding=UTF8
import os
import tempfile
from hashlib import md5
from time import time
try:
import cPickle as pickle
except ImportError: # pragma: no cover
import pickle
class CacheManager(object):
__disk_path__ = ""
@staticmethod
def get(threshold=500, default_timeout=300):... | {
"repo_name": "tinyms/ArchiveX",
"path": "tinyms/core/cache.py",
"copies": "1",
"size": "8512",
"license": "bsd-3-clause",
"hash": 1336934257202228000,
"line_mean": 30.7649253731,
"line_max": 84,
"alpha_frac": 0.5391212406,
"autogenerated": false,
"ratio": 4.314242270653827,
"config_test": fals... |
__author__ = 'tinyms'
#coding=UTF8
import xlrd
import xlsxwriter
#Excel 常规操作类
#Ref: http://www.sharejs.com/codes/python/4345
class Excel(object):
@staticmethod
def import_(file_name, sheet_name="", sheet_index=0):
"""
导入Excel数据
:param file_name: 文件名称
:param sheet_name: Sheet名称
... | {
"repo_name": "tinyms/ArchiveX",
"path": "tinyms/core/office.py",
"copies": "1",
"size": "1539",
"license": "bsd-3-clause",
"hash": 1034554767521807100,
"line_mean": 26.6981132075,
"line_max": 60,
"alpha_frac": 0.5173824131,
"autogenerated": false,
"ratio": 3.443661971830986,
"config_test": fal... |
__author__ = 'tinyms'
from lottery.parse import Helper, MatchAnalyzeThread
from tinyms.core.orm import SessionFactory
def last_days():
expects = "http://www.500.com/pages/info/zhongjiang/index.php"
soup = Helper.soup(expects, False)
urls = list()
if soup:
select_box = soup.find("select", id="e... | {
"repo_name": "tinyms/ArchiveX",
"path": "lottery/history.py",
"copies": "1",
"size": "1242",
"license": "bsd-3-clause",
"hash": 7418617749598917000,
"line_mean": 28.5952380952,
"line_max": 97,
"alpha_frac": 0.5925925926,
"autogenerated": false,
"ratio": 3.3658536585365852,
"config_test": false... |
__author__ = 'tinyms'
from sqlalchemy import Column, Integer, String, Numeric, Boolean, Text
from tinyms.core.orm import Simplify, Entity, many_to_one, SessionFactory
SessionFactory.table_name_prefix("lottery_")
class Battle(Entity, Simplify):
score = Column(String(10))
actual_result = Column(Integer)
d... | {
"repo_name": "tinyms/ArchiveX",
"path": "lottery/entity.py",
"copies": "1",
"size": "1442",
"license": "bsd-3-clause",
"hash": -8051347834662291000,
"line_mean": 27.86,
"line_max": 73,
"alpha_frac": 0.6484049931,
"autogenerated": false,
"ratio": 3.0294117647058822,
"config_test": false,
"has... |
__author__ = 'TinyMS'
class Odds_Statistics():
def __init__(self):
pass
def single_company(self, start_odds, end_odds):
changes = dict()
changes["odds_diff"] = ""
changes["model_diff"] = ""
if not start_odds:
return changes
start_float_arr = [float... | {
"repo_name": "tinyms/ArchiveX",
"path": "lottery/odds_statistics.py",
"copies": "1",
"size": "1955",
"license": "bsd-3-clause",
"hash": 4110725021804610600,
"line_mean": 35.7547169811,
"line_max": 93,
"alpha_frac": 0.4750898819,
"autogenerated": false,
"ratio": 3.311224489795918,
"config_test"... |
__author__ = 'tiramola group'
import os, datetime, operator, math, random, itertools, time
import numpy as np
from lib.fuzz import fgraph, fset
from scipy.cluster.vq import kmeans2
from lib.persistance_module import env_vars
from scipy.stats import linregress
from collections import deque
from lib.tiramola_logging imp... | {
"repo_name": "cmantas/tiramola_v3",
"path": "new_decision_module.py",
"copies": "1",
"size": "36005",
"license": "apache-2.0",
"hash": 5974478537816100000,
"line_mean": 51.6388888889,
"line_max": 195,
"alpha_frac": 0.5254825719,
"autogenerated": false,
"ratio": 3.894958892254435,
"config_test"... |
__author__ = 'tirth'
# Implementation of Conway's Game of life
#
# Works best in command line, cmd or terminal,
# try out the sample starting patterns or add in your own!
from os import system, name
from time import sleep
class Cell:
def __init__(self, pos=None, alive=False):
if pos:
self.x_... | {
"repo_name": "tirth/turn-down-for-what",
"path": "python/conways_life.py",
"copies": "1",
"size": "4653",
"license": "mit",
"hash": -4346450906271388000,
"line_mean": 28.7948717949,
"line_max": 75,
"alpha_frac": 0.376802238,
"autogenerated": false,
"ratio": 3.137744767049291,
"config_test": fa... |
__author__ = 'Tirth'
# Simple implementation of PageRank algorithm
#
# Nodes containing values are ranked according to their weight
# and the nodes they link to.
from fractions import Fraction
class Node:
def __init__(self, name, value, weight=1):
self.name = name
self.value = value
self... | {
"repo_name": "tirth/turn-down-for-what",
"path": "python/simple_page_rank.py",
"copies": "1",
"size": "4029",
"license": "mit",
"hash": -7659559232109846000,
"line_mean": 25.6887417219,
"line_max": 79,
"alpha_frac": 0.5557210226,
"autogenerated": false,
"ratio": 3.4583690987124465,
"config_tes... |
__author__ = 'Tirth Patel <complaints@tirthpatel.com>'
from collections import OrderedDict
import pybot
from sudoku import solver
from utils.imaging import *
from utils.windows import *
runs = 3
def open_sudoku_on_chrome():
press('winkey')
pybot.chill_out_for_a_bit()
enter_phrase('google chrome')
... | {
"repo_name": "tirth/PyBot",
"path": "sudoku/stuff.py",
"copies": "1",
"size": "8033",
"license": "mit",
"hash": 2529100264116508700,
"line_mean": 26.5841924399,
"line_max": 79,
"alpha_frac": 0.52186371,
"autogenerated": false,
"ratio": 3.339018302828619,
"config_test": false,
"has_no_keyword... |
__author__ = 'Tirth Patel <complaints@tirthpatel.com>'
import datetime as dt
import xlsxwriter
import nltk
SEPR = ' | '
contacts = {}
class ConvoIter:
def __init__(self, name, convo):
self.name = name
self.convo = convo
self.size = len(self.convo)
self.idx = 0
def next_ts(se... | {
"repo_name": "tirth/PyBot",
"path": "messages/stuff.py",
"copies": "1",
"size": "6635",
"license": "mit",
"hash": 6309452572650622000,
"line_mean": 25.8623481781,
"line_max": 77,
"alpha_frac": 0.5516201959,
"autogenerated": false,
"ratio": 3.373157092018302,
"config_test": false,
"has_no_key... |
__author__ = 'Tirth Patel <complaints@tirthpatel.com>'
import os
from time import time
from re import finditer
from subprocess import Popen, PIPE
from PIL import Image, ImageOps, ImageGrab, ImageChops
from utils.windows import screen_size
# location of tesseract command
tesseract = 'tesseract'
def screen_grab(x=... | {
"repo_name": "tirth/PyBot",
"path": "utils/imaging.py",
"copies": "1",
"size": "4554",
"license": "mit",
"hash": -6671454463195901000,
"line_mean": 28.0127388535,
"line_max": 79,
"alpha_frac": 0.5303030303,
"autogenerated": false,
"ratio": 3.7729908864954433,
"config_test": true,
"has_no_key... |
__author__ = 'Tirth Patel <complaints@tirthpatel.com>'
import pybot
from requests import get as req
from re import findall
from json import loads
from random import shuffle
delimiter = ' '
class Clue:
def __init__(self, number, coords, direction, clue, length, answer=None):
self.number = number
... | {
"repo_name": "tirth/PyBot",
"path": "crossword/solver.py",
"copies": "1",
"size": "7260",
"license": "mit",
"hash": 7039304390783987000,
"line_mean": 29.5042016807,
"line_max": 82,
"alpha_frac": 0.4797520661,
"autogenerated": false,
"ratio": 3.572834645669291,
"config_test": false,
"has_no_k... |
__author__ = 'Tirth Patel <complaints@tirthpatel.com>'
import pybot
import crossword as c
from utils.windows import *
from utils.imaging import *
from os import path
from re import findall
def open_guardian_on_chrome(numb=None):
press('winkey')
pybot.chill_out_for_a_bit()
enter_phrase('google chrome')
... | {
"repo_name": "tirth/PyBot",
"path": "crossword/stuff.py",
"copies": "1",
"size": "4008",
"license": "mit",
"hash": 2484852665789827600,
"line_mean": 27.8417266187,
"line_max": 77,
"alpha_frac": 0.5371756487,
"autogenerated": false,
"ratio": 3.3765796124684075,
"config_test": false,
"has_no_k... |
__author__ = 'Tirth Patel <complaints@tirthpatel.com>'
import random
class Cell:
def __init__(self, row, col, number=0):
self.row_coord = row
self.col_coord = col
self.number = number
self.row, self.col, self.box, self.poss = [], [], [], []
def __str__(self):
return ... | {
"repo_name": "tirth/PyBot",
"path": "sudoku/solver.py",
"copies": "1",
"size": "11308",
"license": "mit",
"hash": 8909511135171305000,
"line_mean": 31.0339943343,
"line_max": 78,
"alpha_frac": 0.4548991864,
"autogenerated": false,
"ratio": 4.017051509769094,
"config_test": true,
"has_no_keyw... |
__author__ = 'Tirth Patel <complaints@tirthpatel.com>'
import re
import os
import sys
import time
import requests as req
BASE_URL = 'http://www.ncbi.nlm.nih.gov/blast/Blast.cgi?'
def search_url(**kwargs):
args = ['{}={}'.format(parameter.upper(), value)
for parameter, value in kwargs.items()]
... | {
"repo_name": "tirth/kleinbot",
"path": "kleinbot.py",
"copies": "1",
"size": "4844",
"license": "mit",
"hash": -5751933469953868000,
"line_mean": 26.3728813559,
"line_max": 105,
"alpha_frac": 0.5805119736,
"autogenerated": false,
"ratio": 3.678056188306758,
"config_test": false,
"has_no_keyw... |
__author__ = 'Tirth Patel <complaints@tirthpatel.com>'
import requests
import re
import json
import os
import atexit
from bs4 import BeautifulSoup
from messages.stuff import *
os.environ['REQUESTS_CA_BUNDLE'] = os.path.join(os.getcwd(), "certs")
json_limit = 5000
headers = {'Host': 'www.facebook.com',
'... | {
"repo_name": "tirth/PyBot",
"path": "messages/fb.py",
"copies": "1",
"size": "6380",
"license": "mit",
"hash": -8565893851997662000,
"line_mean": 31.8917525773,
"line_max": 79,
"alpha_frac": 0.5440438871,
"autogenerated": false,
"ratio": 3.560267857142857,
"config_test": false,
"has_no_keywo... |
__author__ = 'Tirth Patel <complaints@tirthpatel.com>'
import sqlite3
from datetime import datetime
from os import makedirs
from bs4 import BeautifulSoup
import phonenumbers
from messages.stuff import *
def extract_messages_sqlite(database, outfile='sms_all'):
conn = sqlite3.connect(database)
c = conn.cursor... | {
"repo_name": "tirth/PyBot",
"path": "messages/sms.py",
"copies": "1",
"size": "2835",
"license": "mit",
"hash": 6415892471615150000,
"line_mean": 29.8260869565,
"line_max": 128,
"alpha_frac": 0.533686067,
"autogenerated": false,
"ratio": 3.8466757123473543,
"config_test": false,
"has_no_keyw... |
__author__ = 'Tirth Patel <complaints@tirthpatel.com>'
import sqlite3
from os import makedirs
from messages.stuff import *
phonebook = {'me': {'name': 'me', 'type': 'person'}}
contacts = []
def read_contacts(database):
global phonebook
conn = sqlite3.connect(database)
c = conn.cursor()
rows = c.ex... | {
"repo_name": "tirth/PyBot",
"path": "messages/whatsapp.py",
"copies": "1",
"size": "4264",
"license": "mit",
"hash": -4399345737399341600,
"line_mean": 27.2450331126,
"line_max": 90,
"alpha_frac": 0.5466697936,
"autogenerated": false,
"ratio": 3.6351236146632564,
"config_test": false,
"has_n... |
__author__ = 'Tirth Patel <complaints@tirthpatel.com>'
import unittest
from os import path
import crossword.solver as sol
class TestCrossword(unittest.TestCase):
def setUp(self):
pass
def test_something(self):
cells = 13
sample_puzzle = path.realpath('..') + '\\crossword.txt'
... | {
"repo_name": "tirth/PyBot",
"path": "tests/test_crossword.py",
"copies": "1",
"size": "1106",
"license": "mit",
"hash": -3249679974233241600,
"line_mean": 28.8918918919,
"line_max": 71,
"alpha_frac": 0.603074141,
"autogenerated": false,
"ratio": 3.8269896193771626,
"config_test": true,
"has_... |
__author__ = 'Tirth Patel <complaints@tirthpatel.com>'
import win32api as windows
import win32con
from time import sleep
# build command > python -m py2exe.build_exe pybot.py -c -b 0 -x tkinter
# dictionary to hold key name and VK value
VK_CODE = {'backspace': 0x08,
'tab': 0x09,
'clear': 0x0C,
... | {
"repo_name": "tirth/PyBot",
"path": "utils/windows.py",
"copies": "1",
"size": "5793",
"license": "mit",
"hash": -124341326609480580,
"line_mean": 23.7606837607,
"line_max": 72,
"alpha_frac": 0.4408769204,
"autogenerated": false,
"ratio": 2.8536945812807883,
"config_test": false,
"has_no_key... |
__author__ = 'Tirth Patel <complaints@tirthpatel.com>'
# only for five letter images at the moment
import requests
import re
import shutil
import os
def get_img_links(url):
req = requests.get(url)
if req.status_code != 200:
return []
return clean_up(re.findall(r'data-src="//(.*?)"', req.text))... | {
"repo_name": "tirth/turn-down-for-what",
"path": "python/imgur_downloader.py",
"copies": "1",
"size": "1729",
"license": "mit",
"hash": 4224991418220856300,
"line_mean": 24.8208955224,
"line_max": 65,
"alpha_frac": 0.5546558704,
"autogenerated": false,
"ratio": 3.299618320610687,
"config_test"... |
__author__ = 'Tirth Patel <complaints@tirthpatel.com>'
version = '0.0.5'
from time import time, sleep
import sudoku
import crossword
import messages
# import reddit
import rss
debug = True
timings = True
functions = ['sudoku', 'crossword', 'facebook', 'whatsapp', 'reddit',
'rss', 'kill all humans']
tom... | {
"repo_name": "tirth/PyBot",
"path": "pybot.py",
"copies": "1",
"size": "1830",
"license": "mit",
"hash": -2859165619702022700,
"line_mean": 23.0921052632,
"line_max": 78,
"alpha_frac": 0.568852459,
"autogenerated": false,
"ratio": 3.446327683615819,
"config_test": false,
"has_no_keywords": f... |
__author__ = 'Tissue'
import os
import json
import pickle
from sklearn import metrics
import numpy as np
DATA_DIR = "Raw"
TEMP_DIR = "Intermediate"
SAMPLE_DATA = "utfB61962.csv"
def read_json(file_name):
os.chdir(TEMP_DIR)
with open(file_name) as inFile:
ret_dict = json.load(inFile)
os.chdir('..'... | {
"repo_name": "NeowithU/Trajectory",
"path": "Outdated/utilities.py",
"copies": "1",
"size": "2072",
"license": "mit",
"hash": 3371956797892308500,
"line_mean": 27.0135135135,
"line_max": 104,
"alpha_frac": 0.6245173745,
"autogenerated": false,
"ratio": 2.9306930693069306,
"config_test": false,... |
__author__ = 'tivvit'
from google.appengine.api import memcache
from users import Users
from leaderboard import Leaderboard
from backend.cdh_m import User_m, UsersCollection_m, FactionStats_m, Stats_m, FactionUsers_m, Leaderboard_entry_m, Leaderboard_m, FactionFull_m, FactionMinPoints_m
import logging
from google.... | {
"repo_name": "tivvit/devfest-rpg",
"path": "backend/model/game.py",
"copies": "2",
"size": "4955",
"license": "apache-2.0",
"hash": -598933806335349400,
"line_mean": 28.6706586826,
"line_max": 164,
"alpha_frac": 0.5467204844,
"autogenerated": false,
"ratio": 3.684014869888476,
"config_test": f... |
__author__ = 'tivvit'
from google.appengine.ext import ndb
class SolvedQuest(ndb.Model):
id_user = ndb.IntegerProperty()
id_quest = ndb.IntegerProperty()
points = ndb.IntegerProperty()
inserted = ndb.DateTimeProperty(auto_now_add=True)
def add_points(self, user_id, points):
solved = Solv... | {
"repo_name": "gugcz/devfest-rpg",
"path": "backend/model/solved_quest.py",
"copies": "2",
"size": "1059",
"license": "mit",
"hash": -4030412549286737000,
"line_mean": 24.2142857143,
"line_max": 80,
"alpha_frac": 0.5892351275,
"autogenerated": false,
"ratio": 3.405144694533762,
"config_test": f... |
__author__ = 'tivvit'
from google.appengine.ext import ndb
from google.appengine.ext.ndb import msgprop
from protorpc import messages
from backend.cdh_m import Quest_m, QuestsCollection_m
import logging
from faction_names import faction_names
class Quests(ndb.Model):
name = ndb.StringProperty()
faction =... | {
"repo_name": "tivvit/devfest-rpg",
"path": "backend/model/quests.py",
"copies": "2",
"size": "1835",
"license": "apache-2.0",
"hash": 2488414806310494700,
"line_mean": 25.5942028986,
"line_max": 81,
"alpha_frac": 0.6065395095,
"autogenerated": false,
"ratio": 3.5493230174081236,
"config_test":... |
__author__ = 'tjhunter'
from collections import namedtuple
import shelve
import logging
import dropbox
# Ad-hoc logging for this project.
logging.basicConfig(level=logging.DEBUG, format='%(asctime)s %(module)s/%(funcName)s: %(message)s')
class UserInfo(namedtuple("UserInfo", ['uid', 'token', 'cursor'], verbose=True)... | {
"repo_name": "tjhunter/tjhunter-db-filesize",
"path": "python/myapp.py",
"copies": "1",
"size": "3990",
"license": "apache-2.0",
"hash": 7025962205121997000,
"line_mean": 28.776119403,
"line_max": 104,
"alpha_frac": 0.6388471178,
"autogenerated": false,
"ratio": 3.2704918032786887,
"config_tes... |
__author__ = 'tjhunter'
import locale
# Taken from the file:
# http://homepages.inf.ed.ac.uk/imurray2/code/hacks/urlsize
def pretty_print_size(num_bytes):
"""
Output number of bytes according to locale and with IEC binary prefixes
"""
if num_bytes is None:
print('File size unavailable.')
... | {
"repo_name": "tjhunter/tjhunter-db-filesize",
"path": "python/utils.py",
"copies": "1",
"size": "1262",
"license": "apache-2.0",
"hash": 9204742553380986000,
"line_mean": 28.3720930233,
"line_max": 75,
"alpha_frac": 0.5364500792,
"autogenerated": false,
"ratio": 2.9212962962962963,
"config_tes... |
__author__ = 'tjhunter'
import build
import json
import pylab as pl
import numpy as np
# Draws the network as a pdf and SVG file.
fname = build.data_name('kdd/hmm_graph_export.json')
fig = pl.figure("fig1",figsize=(10,10))
ax = fig.gca()
ax.set_axis_off()
node_style={'c':'g', 's':80}
link_style=dict(lw=.01)
with open... | {
"repo_name": "tjhunter/phd-thesis-tjhunter",
"path": "python/kdd/plot_subnetworks.py",
"copies": "1",
"size": "1658",
"license": "apache-2.0",
"hash": 5176818302807811000,
"line_mean": 27.5862068966,
"line_max": 79,
"alpha_frac": 0.6272617612,
"autogenerated": false,
"ratio": 2.504531722054381,
... |
__author__ = 'tjhunter'
'''
Created on Jan 22, 2012
@author: tjhunter
'''
import os
from collections import defaultdict
from mm.path_inference_private.proj_templates import get_evaluation_fnames,\
get_evaluation_data_file
import pickle
from mm.path_inference_private.evaluation import METRIC_NAME_IDX, LEARNING_MET... | {
"repo_name": "tjhunter/phd-thesis-tjhunter",
"path": "python/mm/path_inference_private/plot_utils.py",
"copies": "1",
"size": "2792",
"license": "apache-2.0",
"hash": -4161473030123139000,
"line_mean": 28.0833333333,
"line_max": 92,
"alpha_frac": 0.6489971347,
"autogenerated": false,
"ratio": 3.... |
__author__ = 'tk421'
def metadata_instance(macfile_root, infrastructure_key, role_key, role, infrastructure):
"""
Generate the json metadata to create an instance
"""
# version must be string
macfile_root['version'] = str(macfile_root['version'])
meta = macfile_root
meta['macfile_role_name... | {
"repo_name": "manageacloud/manageacloud-cli",
"path": "maccli/helper/metadata.py",
"copies": "1",
"size": "1447",
"license": "mit",
"hash": -7881713890442217000,
"line_mean": 30.4782608696,
"line_max": 88,
"alpha_frac": 0.6800276434,
"autogenerated": false,
"ratio": 4.230994152046784,
"config_... |
__author__ = 'tkcook'
from gi.repository import Gtk
import os
class FileManager(Gtk.Box):
def __init__(self):
Gtk.Box.__init__(self, orientation=Gtk.Orientation.VERTICAL)
self.button = Gtk.FileChooserButton(title='Choose a Root Folder', action=Gtk.FileChooserAction.SELECT_FOLDER)
self.butt... | {
"repo_name": "tomkcook/capture",
"path": "components.py",
"copies": "1",
"size": "4360",
"license": "mit",
"hash": 2768672706891155500,
"line_mean": 37.5840707965,
"line_max": 134,
"alpha_frac": 0.623853211,
"autogenerated": false,
"ratio": 3.452098178939034,
"config_test": false,
"has_no_ke... |
__author__ = 'tkcook'
import gphoto2 as gp
from gi.repository import Gtk, GLib, GdkPixbuf, Gio
import time
from components import FileManager
from glob import glob
import os
def set_config(camera, context, configs):
config = camera.get_config(context)
for name, value in configs:
child = None
f... | {
"repo_name": "tomkcook/capture",
"path": "capture_window.py",
"copies": "1",
"size": "2429",
"license": "mit",
"hash": 1022215654979106000,
"line_mean": 30.141025641,
"line_max": 97,
"alpha_frac": 0.5953067106,
"autogenerated": false,
"ratio": 3.4405099150141645,
"config_test": true,
"has_no... |
__author__ = 'tkral'
import hashlib
import json
import requests
import sys
import xmltodict
from subprocess import call, check_output
class CCollabReview:
def __init__(self, review_id):
self.review_id = review_id
def __calc_hash(self, review_dict):
review_md5 = 0
artifacts = revie... | {
"repo_name": "timkral/horn",
"path": "heimdall/dataload/ccollabdataloader.py",
"copies": "1",
"size": "2291",
"license": "bsd-3-clause",
"hash": -519593568219385600,
"line_mean": 35.380952381,
"line_max": 109,
"alpha_frac": 0.6481885639,
"autogenerated": false,
"ratio": 3.568535825545171,
"con... |
__author__ = 'tkral'
import hashlib
import os
import requests
import sys
from subprocess import call, check_output
class GitCommit:
def __init__(self, remote_git_repo, local_git_repo, sha1):
self.remote_git_repo = remote_git_repo
self.local_git_repo = local_git_repo
self.sha1 = sha1
... | {
"repo_name": "timkral/horn",
"path": "heimdall/dataload/gitdataloader.py",
"copies": "1",
"size": "5116",
"license": "bsd-3-clause",
"hash": 3523199948691593700,
"line_mean": 43.4956521739,
"line_max": 194,
"alpha_frac": 0.6237294762,
"autogenerated": false,
"ratio": 3.602816901408451,
"config... |
__author__ = 'tmarsha1'
""" find largest palindrome for the product of 2 three digit numbers
(100-999) or (100^2 - 999^2)
Answer is 913 * 993 = 906609
"""
import re
class Word(object):
def __init__(self, values):
concat = ""
for value in values:
concat = concat + ... | {
"repo_name": "bigfatpanda-training/pandas-practical-python-primer",
"path": "training/level-1-the-zen-of-python/dragon-warrior/palindrome/tmarsha1-palindrome.py",
"copies": "1",
"size": "1568",
"license": "artistic-2.0",
"hash": 5529751378237640000,
"line_mean": 25.0344827586,
"line_max": 77,
"alpha... |
__author__ = 'tmkasun'
from pyspark.context import SparkContext, SparkConf
from pyspark.mllib.clustering import KMeans
from matplotlib import pyplot
from conf.configurations import project
from libs.analyser import SparkAnalyser
def main():
# Setup Spark context by setting application name and running mode, `... | {
"repo_name": "tmkasun/bigdata_spark",
"path": "cluster_records.py",
"copies": "1",
"size": "2155",
"license": "apache-2.0",
"hash": 178897734840544640,
"line_mean": 33.7741935484,
"line_max": 108,
"alpha_frac": 0.7118329466,
"autogenerated": false,
"ratio": 3.5856905158069883,
"config_test": f... |
__author__ = 'tmkasun'
from pyspark.context import SparkContext, SparkConf
from pyspark.mllib.linalg import Vectors
from pyspark.mllib.clustering import KMeansModel
from matplotlib import pyplot
import numpy as np
import operator
import csv
from conf.configurations import project
spark_configuration = SparkConf().s... | {
"repo_name": "tmkasun/bigdata_spark",
"path": "prediction.py",
"copies": "1",
"size": "7203",
"license": "apache-2.0",
"hash": -8741161963286395000,
"line_mean": 37.1164021164,
"line_max": 132,
"alpha_frac": 0.6261280022,
"autogenerated": false,
"ratio": 3.7398753894080996,
"config_test": fals... |
__author__ = 'tmkasun'
from pyspark.mllib.linalg import Vectors
import operator
import csv
class SparkAnalyser(object):
def __init__(self, spark_context):
self._sc = spark_context
def load_data(self, location):
"""
Load text file from local disk, Infact it only creating a pointer he... | {
"repo_name": "tmkasun/bigdata_spark",
"path": "libs/analyser.py",
"copies": "1",
"size": "5158",
"license": "apache-2.0",
"hash": -2823268411636629000,
"line_mean": 44.6460176991,
"line_max": 136,
"alpha_frac": 0.55447848,
"autogenerated": false,
"ratio": 4.176518218623482,
"config_test": fals... |
__author__ = 'tmkasun'
from suds.client import Client
from suds.transport.https import HttpAuthenticated
class AdminService(object):
client = None
def __init__(self, api, service_name):
self.tenant = HttpAuthenticated(username=api['username'], password=api['password'])
self.protocol = 'http... | {
"repo_name": "tmkasun/Knnect",
"path": "map_service/lib/wso2/carbon_connect.py",
"copies": "1",
"size": "1077",
"license": "apache-2.0",
"hash": 6877123481771964000,
"line_mean": 32.6875,
"line_max": 99,
"alpha_frac": 0.5450324977,
"autogenerated": false,
"ratio": 4.325301204819277,
"config_te... |
__author__ = 'tmy'
COMMENT_INDICATOR = '#'
URI_INDICATOR = '<'
class NTripleLineParser():
def __init__(self, separator):
self.separator = separator
@staticmethod
def __is_comment_line(line):
return line.startswith(COMMENT_INDICATOR)
@staticmethod
def __strip_uri_indicator(uri):
... | {
"repo_name": "Weissger/TST.NTripleLineParser",
"path": "src/NTripleLineParser.py",
"copies": "1",
"size": "1553",
"license": "mit",
"hash": 4082189452494891000,
"line_mean": 26.2631578947,
"line_max": 85,
"alpha_frac": 0.5299420476,
"autogenerated": false,
"ratio": 3.7694174757281553,
"config_... |
__author__ = 'tmy'
from src.SparqlInterface.src.Interfaces.AbstractClient import SparqlConnectionError
from src.Utilities.Logger import log
def materialize_to_file(instance=None, types=None, target=None, server=None):
if not types:
types = __get_all_types(instance, server)
with open(target, "a+") as ... | {
"repo_name": "Weissger/TST.TypeReasoner",
"path": "src/Materializer/Materializer.py",
"copies": "1",
"size": "1671",
"license": "mit",
"hash": 6881764142038775000,
"line_mean": 36.1333333333,
"line_max": 114,
"alpha_frac": 0.5380011969,
"autogenerated": false,
"ratio": 3.5858369098712446,
"con... |
__author__ = 'tmy'
from src.SparqlInterface.src.Interfaces.AbstractClient import SparqlConnectionError
from src.Utilities.Logger import log
def materialize_to_file(rdf_type=None, target=None, server=None):
parents = __get_all_parents(rdf_type, server)
with open(target, "a+") as f:
for parent in paren... | {
"repo_name": "Weissger/TST.SubClassReasoner",
"path": "src/Materializer/Materializer.py",
"copies": "1",
"size": "1386",
"license": "mit",
"hash": -3182526625897855500,
"line_mean": 35.5,
"line_max": 111,
"alpha_frac": 0.5541125541,
"autogenerated": false,
"ratio": 3.3970588235294117,
"config_... |
__author__ = 'tmy'
import click
from .TypeReasoner import TypeReasoner
@click.command()
@click.option('--server', '-s', default="http://localhost:8585/bigdata/sparql",
help='Uri to the sparql endpoint which stores all materialized RDFS SubClass Information.')
@click.option('--user', '-u', default="admi... | {
"repo_name": "Weissger/TST.TypeReasoner",
"path": "src/__main__.py",
"copies": "1",
"size": "1242",
"license": "mit",
"hash": -2579172675947030000,
"line_mean": 39.0967741935,
"line_max": 105,
"alpha_frac": 0.6320450886,
"autogenerated": false,
"ratio": 3.663716814159292,
"config_test": false,... |
__author__ = 'tmy'
import logging
import inspect
import types
def get_caller_str():
"""
Get name of caller method and context
"""
stack = inspect.stack()
if 'self' in stack[2][0].f_locals:
# for class methods
the_class = stack[2][0].f_locals["self"].__class__
the_method = ... | {
"repo_name": "Weissger/TST.InstanceCounter",
"path": "src/Utilities/Logger.py",
"copies": "1",
"size": "1933",
"license": "mit",
"hash": 7418522232300097000,
"line_mean": 27.4411764706,
"line_max": 86,
"alpha_frac": 0.6171753751,
"autogenerated": false,
"ratio": 3.137987012987013,
"config_test... |
__author__ = 'tmy'
import os
from datetime import datetime
from multiprocessing import Process
from .ProcessManager.ProcessManager import ProcessManager, OccupiedError
from .NTripleLineParser.src.NTripleLineParser import NTripleLineParser
from .SparqlInterface.src import ClientFactory
from .Materializer.Materializer i... | {
"repo_name": "Weissger/TST.SubClassReasoner",
"path": "src/SubClassReasoner.py",
"copies": "1",
"size": "4531",
"license": "mit",
"hash": -7568637972237752000,
"line_mean": 39.0973451327,
"line_max": 121,
"alpha_frac": 0.5299050982,
"autogenerated": false,
"ratio": 4.266478342749529,
"config_t... |
__author__ = 'tmy'
import os
from datetime import datetime
from multiprocessing import Process
import time
from .Materializer.Materializer import materialize_to_file, materialize_to_service
from .NTripleLineParser.src.NTripleLineParser import NTripleLineParser
from .SparqlInterface.src import ClientFactory
from .Proc... | {
"repo_name": "Weissger/TST.TypeReasoner",
"path": "src/TypeReasoner.py",
"copies": "1",
"size": "4536",
"license": "mit",
"hash": 4395110386672220000,
"line_mean": 38.1034482759,
"line_max": 131,
"alpha_frac": 0.5284391534,
"autogenerated": false,
"ratio": 4.455795677799607,
"config_test": fal... |
__author__ = 'tnair'
import os
import json
import argparse
import numpy as np
import gan2d_model
from keras.datasets import mnist
from timeit import default_timer as timer
from keras.optimizers import Adam
_MODEL_TYPES = {"gan_2D": gan2d_model}
def _get_cfg():
parser = argparse.ArgumentParser(description="Main h... | {
"repo_name": "tanyanair/GAN",
"path": "gan2d_train.py",
"copies": "1",
"size": "4740",
"license": "mit",
"hash": -3647796188166731300,
"line_mean": 39.1694915254,
"line_max": 141,
"alpha_frac": 0.6124472574,
"autogenerated": false,
"ratio": 3.2644628099173554,
"config_test": false,
"has_no_k... |
__author__ = 'toadicus'
__all__ = []
import argparse
import os
import sys
from KerbalStuff import KerbalStuff, Mod, ModVersion
from zipfile import is_zipfile
parser = argparse.ArgumentParser(description="Interact with the KerbalStuff API.")
actions = parser.add_subparsers(title="actions")
""":type : argparse._SubPar... | {
"repo_name": "toadicus/PyKStuff",
"path": "PyKStuff.py",
"copies": "1",
"size": "8945",
"license": "unlicense",
"hash": -7640163915335160000,
"line_mean": 27.9514563107,
"line_max": 133,
"alpha_frac": 0.550922303,
"autogenerated": false,
"ratio": 3.559490648627139,
"config_test": false,
"has... |
__author__ = 'toadicus'
from .Mod import Mod
class User:
def __init__(self, json_dict: dict):
self.description = json_dict["description"]
""":type : str"""
self.forum_username = json_dict["forumUsername"]
""":type : str"""
self.irc_nick = json_dict["ircNick"]
""":t... | {
"repo_name": "toadicus/PyKStuff",
"path": "KerbalStuff/User.py",
"copies": "1",
"size": "1368",
"license": "unlicense",
"hash": 2774271546123957000,
"line_mean": 33.225,
"line_max": 71,
"alpha_frac": 0.4305555556,
"autogenerated": false,
"ratio": 4.30188679245283,
"config_test": false,
"has_... |
__author__ = 'toadicus'
import os
import requests
import zipfile
from requests.cookies import RequestsCookieJar
from .ReadOnly import KerbalStuffReadOnly
from .Constants import Constants
from .Mod import Mod, ModVersion
Constants.login = Constants.format_action("/login")
Constants.mod_create = Constants.format_actio... | {
"repo_name": "toadicus/PyKStuff",
"path": "KerbalStuff/ReadWrite.py",
"copies": "1",
"size": "5531",
"license": "unlicense",
"hash": -701771791697063600,
"line_mean": 39.0797101449,
"line_max": 118,
"alpha_frac": 0.6168866389,
"autogenerated": false,
"ratio": 3.996387283236994,
"config_test": ... |
__author__ = 'toadicus'
import requests
import sys
from .Constants import Constants
from .Mod import Mod, ModVersion
from .User import User
from StaticClass import staticclass
Constants.RootUri = "https://kerbalstuff.com"
Constants.ApiUri = Constants.RootUri + "/api"
Constants.UserAgent = "PyKStuff by toadicus"
Cons... | {
"repo_name": "toadicus/PyKStuff",
"path": "KerbalStuff/ReadOnly.py",
"copies": "1",
"size": "4441",
"license": "unlicense",
"hash": -9207162658935332000,
"line_mean": 29.8402777778,
"line_max": 97,
"alpha_frac": 0.6239585679,
"autogenerated": false,
"ratio": 3.5959514170040485,
"config_test": ... |
__author__ = 'toadicus'
class Mod:
def __init__(self, *args, **kwargs):
self.versions = []
""":type : list[ModVersion]"""
self.author = None
""":type : str"""
self.downloads = None
""":type : int"""
self.default_version_id = None
""":type : int"""
... | {
"repo_name": "toadicus/PyKStuff",
"path": "KerbalStuff/Mod.py",
"copies": "1",
"size": "5881",
"license": "unlicense",
"hash": 5347289443360629000,
"line_mean": 37.4444444444,
"line_max": 120,
"alpha_frac": 0.545995579,
"autogenerated": false,
"ratio": 4.000680272108844,
"config_test": false,
... |
__author__ = 'toadicus'
class Namespace():
_instance = None
@classmethod
def __new__(cls, *args, **kwargs):
if cls._instance is None:
obj = super(Namespace, cls).__new__(*args, **kwargs)
obj._config = {}
obj._allow_reassignment = True
obj._initializ... | {
"repo_name": "toadicus/PyKStuff",
"path": "Namespace/Namespace.py",
"copies": "1",
"size": "1275",
"license": "unlicense",
"hash": -9034735351463339000,
"line_mean": 30.9,
"line_max": 119,
"alpha_frac": 0.5552941176,
"autogenerated": false,
"ratio": 4.322033898305085,
"config_test": false,
"... |
__author__='toanqn'
import scrapy
from crawler_film.items import CrawlerFilmItem
class CrawlerFilm(scrapy.Spider):
name = 'phimnhanh'
allowed_domains = ['phimnhanh.com']
start_urls = [
'http://phimnhanh.com/phim-le'
]
def parse(self, response):
for selector in response.xpath('//li... | {
"repo_name": "OnFTA/scrapy-training",
"path": "crawler_film/crawler_film/spiders/phimnhanh.py",
"copies": "1",
"size": "2115",
"license": "mit",
"hash": -4430963121501030000,
"line_mean": 37.2,
"line_max": 110,
"alpha_frac": 0.5940028558,
"autogenerated": false,
"ratio": 3.3723916532905296,
"c... |
__author__='toanqn'
import scrapy
from crawler_film.items import CrawlerFilmItem
class CrawlerFilm(scrapy.Spider):
name = 'phimvuihd'
allowed_domains = ['phimvuihd.net']
start_urls = [
'http://phimvuihd.net/phim-le/'
]
def parse(self, response):
for selector in response.xpath('//d... | {
"repo_name": "OnFTA/scrapy-training",
"path": "crawler_film/crawler_film/spiders/phimvuihd.py",
"copies": "1",
"size": "2584",
"license": "mit",
"hash": -7687867382327671000,
"line_mean": 41.7833333333,
"line_max": 144,
"alpha_frac": 0.603817686,
"autogenerated": false,
"ratio": 3.36435124508519... |
__author__ = 'toanqn'
import scrapy
from crawler_film.items import CrawlerFilmItem
class PhimBatHu(scrapy.Spider):
name = 'phimbathu'
allowed_domains = ['phimbathu.com']
start_urls = [
"http://phimbathu.com/danh-sach/phim-le.html"
]
def parse(self, response):
for selector in resp... | {
"repo_name": "OnFTA/scrapy-training",
"path": "crawler_film/crawler_film/spiders/phimbathu.py",
"copies": "1",
"size": "2451",
"license": "mit",
"hash": 7117995263836036000,
"line_mean": 38.1612903226,
"line_max": 123,
"alpha_frac": 0.5925010301,
"autogenerated": false,
"ratio": 3.32465753424657... |
__author__='toanqn'
import scrapy
import re
from crawler_film.items import CrawlerFilmItem
class CrawlerFilm(scrapy.Spider):
name = 'xemphimbox'
allowed_domains = ['xemphimbox.com']
start_urls = [
'http://xemphimbox.com/phim-le/'
]
def parse(self, response):
for selector in respon... | {
"repo_name": "OnFTA/scrapy-training",
"path": "crawler_film/crawler_film/spiders/xemphimbox.py",
"copies": "1",
"size": "2416",
"license": "mit",
"hash": 3665389445922653000,
"line_mean": 40.3620689655,
"line_max": 124,
"alpha_frac": 0.6031679867,
"autogenerated": false,
"ratio": 3.3135359116022... |
__author__ = 'toast254'
import sys
import pygame
from Data import Map
if not pygame.font:
print('Warning, fonts disabled')
if not pygame.mixer:
print('Warning, sound disabled')
class PyGameMain:
"""The Main PyMan Class - This class handles the main initialization and creating of the Game."""
def __... | {
"repo_name": "emeric254/ISOT",
"path": "old/test.py",
"copies": "1",
"size": "1583",
"license": "mit",
"hash": 8076970912852729000,
"line_mean": 29.4423076923,
"line_max": 114,
"alpha_frac": 0.5281111813,
"autogenerated": false,
"ratio": 3.899014778325123,
"config_test": false,
"has_no_keywo... |
from __future__ import print_function
import tensorflow as tf
from tensorflow.python.ops import ctc_ops as ctc
from tensorflow.contrib.layers import batch_norm
from tensorflow.python.ops import rnn_cell
from tensorflow.python.ops import control_flow_ops
from tensorflow.python.ops.rnn import bidirectional_rnn
from uti... | {
"repo_name": "gundramleifert/exp_tf",
"path": "models/htr_iam/bdlstm_iam_v3.py",
"copies": "1",
"size": "11711",
"license": "apache-2.0",
"hash": 6812943003446956000,
"line_mean": 46.4129554656,
"line_max": 127,
"alpha_frac": 0.6081461873,
"autogenerated": false,
"ratio": 3.393509127789047,
"c... |
import csv
import os
import sys
import re
import glob
import shutil
import argparse
import configparser
import subprocess
import subprocess
from Bio import SeqIO
from .utils import CompletePath
# Get arguments
def get_args():
parser = argparse.ArgumentParser(
description="Mask all positions with low rea... | {
"repo_name": "AntonelliLab/seqcap_processor",
"path": "secapr/process_pileup.py",
"copies": "1",
"size": "1306",
"license": "mit",
"hash": 3263324906858988500,
"line_mean": 23.1851851852,
"line_max": 152,
"alpha_frac": 0.6707503828,
"autogenerated": false,
"ratio": 3.7421203438395416,
"config_... |
import os
import sys
import re
import glob
import shutil
import argparse
from Bio import SeqIO
from .utils import CompletePath
# Get arguments
def get_args():
parser = argparse.ArgumentParser(
description="Set the maximum fraction of missing data that you want to allow in an alignment and drop all sequences abov... | {
"repo_name": "AntonelliLab/seqcap_processor",
"path": "secapr/remove_uninformative_seqs.py",
"copies": "1",
"size": "2167",
"license": "mit",
"hash": 375615249573552200,
"line_mean": 26.7820512821,
"line_max": 150,
"alpha_frac": 0.7203507153,
"autogenerated": false,
"ratio": 3.268476621417798,
... |
import os
import sys
import re
import glob
import shutil
import argparse
import csv
import random
from .utils import CompletePath
# Get arguments
def get_args():
parser = argparse.ArgumentParser(
description="This script will create consensus sequences from pairs of allele sequences, thereby turning allele alig... | {
"repo_name": "AntonelliLab/seqcap_processor",
"path": "secapr/create_consensus_from_alleles.py",
"copies": "1",
"size": "3836",
"license": "mit",
"hash": -9025434443527367000,
"line_mean": 26.7971014493,
"line_max": 254,
"alpha_frac": 0.712721585,
"autogenerated": false,
"ratio": 3.2702472293265... |
'''
Assemble trimmed Illumina read files (fastq)
'''
import os
import sys
import re
import glob
import shutil
import argparse
import subprocess
import pandas as pd
import numpy as np
from Bio import SeqIO
import time
# Complete path function
class CompletePath(argparse.Action):
"""give the full path of an input ... | {
"repo_name": "AntonelliLab/seqcap_processor",
"path": "secapr/assemble_reads.py",
"copies": "1",
"size": "18861",
"license": "mit",
"hash": 3368586213313483000,
"line_mean": 46.2706766917,
"line_max": 312,
"alpha_frac": 0.6016117915,
"autogenerated": false,
"ratio": 3.6376084860173576,
"config... |
__author__ = "Tobias Carryer"
from time import time
class LinearCongruentialGenerator:
"""
A pseudorandom number generator.
"""
def __init__(self, multiplier, increment, modulo, seed=int(time())):
"""
These parameters are saved and used when nextNumber() is called.
modulo is... | {
"repo_name": "TheAlgorithms/Python",
"path": "other/linear_congruential_generator.py",
"copies": "1",
"size": "1085",
"license": "mit",
"hash": -8711082535284353000,
"line_mean": 28.3243243243,
"line_max": 82,
"alpha_frac": 0.6193548387,
"autogenerated": false,
"ratio": 4.063670411985019,
"con... |
__author__ = 'Tobias Endres'
from math import log2, trunc
class Node():
priority = None
parent = None
child = None
left_sib = None
right_sib = None
rank = 0
mark = False
def __init__(self, x: int):
self.priority = x
self.left_sib = self
self.right_sib = self
... | {
"repo_name": "TobEnd/fibonacci-heap",
"path": "FibonnaciHeap.py",
"copies": "1",
"size": "4243",
"license": "mit",
"hash": -8311147701580020000,
"line_mean": 24.255952381,
"line_max": 73,
"alpha_frac": 0.4671223191,
"autogenerated": false,
"ratio": 3.5866441251056638,
"config_test": false,
"... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.