text stringlengths 0 1.05M | meta dict |
|---|---|
__author__ = 'dskola'
import datetime
import multiprocessing
import os
import numpy
from pgtools import toolbox
THREADS = 8
REPORTING_INTERVAL = 1000000
CHAINFILE_BASEPATH = os.path.join(os.environ['HOME'], 'oasis_local/chain_files')
INTERVAL_BASEPATH = os.path.join(os.environ['HOME'], 'oasis_local/best_intervals')
I... | {
"repo_name": "phageghost/pg_tools",
"path": "pgtools/filterchains.py",
"copies": "1",
"size": "40553",
"license": "mit",
"hash": 6889451658138998000,
"line_mean": 50.2032828283,
"line_max": 214,
"alpha_frac": 0.5634601632,
"autogenerated": false,
"ratio": 4.1876290788930195,
"config_test": fal... |
__author__ = 'dudevil'
import pickle
import functools
import operator
import numpy as np
import pandas as pd
import theano
import theano.tensor as T
from importlib import import_module
from theano.tensor.nnet import conv
from sklearn.metrics import confusion_matrix
import lasagne
def load_config(file):
model = im... | {
"repo_name": "brotherofken/national_data_science_bowl_2",
"path": "theano/utils.py",
"copies": "1",
"size": "9222",
"license": "mit",
"hash": 8307978762404682000,
"line_mean": 33.0332103321,
"line_max": 120,
"alpha_frac": 0.6142919106,
"autogenerated": false,
"ratio": 3.3208498379546274,
"conf... |
__author__ = 'du'
from flask import request
from flask_restful import Resource
from sqlalchemy.orm.exc import NoResultFound
from . import model, app
db_session = model.db.session
class User(Resource):
def get(self, name=None):
if name == None:
ret = [u.to_dict() for u in db_session.query(mode... | {
"repo_name": "lucidfrontier45/flasktest",
"path": "flask_app/api.py",
"copies": "1",
"size": "1204",
"license": "mit",
"hash": -1464723072159459800,
"line_mean": 32.4444444444,
"line_max": 75,
"alpha_frac": 0.5481727575,
"autogenerated": false,
"ratio": 3.510204081632653,
"config_test": false,... |
__author__ = 'du'
from abc import ABCMeta, abstractmethod
from six import add_metaclass
import numpy as np
from chainer import Chain, Variable, optimizers
from chainer import functions as F
from sklearn import base
@add_metaclass(ABCMeta)
class BaseChainerEstimator(base.BaseEstimator):
def __init__(self, optimi... | {
"repo_name": "lucidfrontier45/scikit-chainer",
"path": "skchainer/__init__.py",
"copies": "1",
"size": "2853",
"license": "mit",
"hash": -3201765955294883300,
"line_mean": 29.6774193548,
"line_max": 88,
"alpha_frac": 0.6032246758,
"autogenerated": false,
"ratio": 3.690815006468305,
"config_tes... |
__author__ = 'du'
import numpy as np
from chainer import Chain, functions as F
from . import BaseChainerEstimator, ChainerTransformer
class AutoEncoder(ChainerTransformer):
def __init__(self, activation=F.relu, **params):
super(ChainerTransformer, self).__init__(**params)
self.activation = activ... | {
"repo_name": "lucidfrontier45/scikit-chainer",
"path": "skchainer/autoencoder.py",
"copies": "1",
"size": "1771",
"license": "mit",
"hash": -5188878840998669000,
"line_mean": 31.7962962963,
"line_max": 81,
"alpha_frac": 0.6335403727,
"autogenerated": false,
"ratio": 3.513888888888889,
"config_... |
__author__ = 'du'
import string
import itertools
import gspread
alphabets = list(string.uppercase) + map(lambda (x, y): x + y, itertools.product(string.uppercase, repeat=2))
class GspreadReader():
def __init__(self, account, passwd, sheet_name=None, sheet_id=0, offset=0, buffer_len=10, return_type="list"):
... | {
"repo_name": "lucidfrontier45/GspreadReader",
"path": "gspread_reader/__init__.py",
"copies": "1",
"size": "1539",
"license": "mit",
"hash": -2254107020518066400,
"line_mean": 32.4565217391,
"line_max": 114,
"alpha_frac": 0.559454191,
"autogenerated": false,
"ratio": 3.5136986301369864,
"confi... |
__author__ = "Dusan (Ph4r05) Klinec"
__copyright__ = "Copyright (C) 2014 Dusan (ph4r05) Klinec"
__license__ = "Apache License, Version 2.0"
__version__ = "1.0"
class Visitor(object):
def __init__(self, verbose=False):
self.verbose = verbose
def __getattr__(self, name):
if not name.startswith(... | {
"repo_name": "ph4r05/plyprotobuf",
"path": "plyproto/model.py",
"copies": "1",
"size": "13444",
"license": "apache-2.0",
"hash": 9030689716238338000,
"line_mean": 33.035443038,
"line_max": 162,
"alpha_frac": 0.5973668551,
"autogenerated": false,
"ratio": 3.5584965590259396,
"config_test": fals... |
__author__ = "Dusan (Ph4r05) Klinec"
__copyright__ = "Copyright (C) 2014 Dusan (ph4r05) Klinec"
__license__ = "Apache License, Version 2.0"
__version__ = "1.0"
import ply.lex as lex
import ply.yacc as yacc
from .model import *
class ProtobufLexer(object):
keywords = ('double', 'float', 'int32', 'int64', 'uint32',... | {
"repo_name": "ph4r05/plyprotobuf",
"path": "plyproto/parser.py",
"copies": "1",
"size": "14479",
"license": "apache-2.0",
"hash": 7008831320122760000,
"line_mean": 32.5939675174,
"line_max": 148,
"alpha_frac": 0.5016921058,
"autogenerated": false,
"ratio": 3.2275969683459653,
"config_test": fa... |
__author__ = "Dusan (Ph4r05) Klinec"
__copyright__ = "Copyright (C) 2014 Dusan (ph4r05) Klinec"
__license__ = "Apache License, Version 2.0"
__version__ = "1.0"
import ply.lex as lex
import ply.yacc as yacc
from .model import *
import pdb
from helpers import LexHelper, LU
from logicparser import FOLParser, FOLLexer, ... | {
"repo_name": "sb98052/plyprotobuf",
"path": "plyxproto/parser.py",
"copies": "1",
"size": "17897",
"license": "apache-2.0",
"hash": 3872666395009803300,
"line_mean": 32.1425925926,
"line_max": 216,
"alpha_frac": 0.5122087501,
"autogenerated": false,
"ratio": 3.239862418537292,
"config_test": f... |
__author__ = 'Dustin Schoenbrun'
__license__ = 'Apache License 2.0'
__version__ = '0.1'
__email__ = 'dschoenb@redhat.com'
__status__ = 'Alpha'
from manilaclient import client
from iridium.libs.openstack import keystone
from iridium.plugins.inspector import Plugin
class ManilaBase(object):
"""
ManilaBase is u... | {
"repo_name": "Toure/Iridium",
"path": "iridium/libs/openstack/manila.py",
"copies": "1",
"size": "3240",
"license": "apache-2.0",
"hash": -1116679111179386100,
"line_mean": 40.0253164557,
"line_max": 117,
"alpha_frac": 0.649691358,
"autogenerated": false,
"ratio": 4.0754716981132075,
"config_t... |
__author__ = 'Duy'
import json
import requests
from django.http import HttpResponse
from django.views import generic
from .models import portal
import api.soql
class IndexView(generic.ListView):
"""Index Page"""
model = portal
context_object_name = 'list_of_resources'
template_name = 'api/index.html'
... | {
"repo_name": "jthidalgojr/greengov2015-TeamAqua",
"path": "api/views.py",
"copies": "1",
"size": "5252",
"license": "mit",
"hash": 3418645400061470000,
"line_mean": 33.3333333333,
"line_max": 129,
"alpha_frac": 0.6172886519,
"autogenerated": false,
"ratio": 3.466666666666667,
"config_test": fa... |
__author__ = 'dvirsky'
import logging
import types
import redis
import bson
from bson.errors import BSONError
import time
import datetime
from . import queries
class Message(object):
"""
A message represent a single protocol message passed between the client and server
"""
GET = "GET"
GET_RES... | {
"repo_name": "EverythingMe/meduza-py",
"path": "meduza/client.py",
"copies": "1",
"size": "6697",
"license": "bsd-2-clause",
"hash": -4099016243756097000,
"line_mean": 24.2716981132,
"line_max": 115,
"alpha_frac": 0.6034045095,
"autogenerated": false,
"ratio": 4.329023917259211,
"config_test":... |
__author__ = 'dwae'
import pandas as pd
from supplies import param, depend, Params
class Shadow(Params):
def __init__(self, data, **kws):
super().__init__(**kws)
self.data = data
@depend
def data(self):
""" data the shadow is based on """
@param
def depth(self, val=12):... | {
"repo_name": "gameduell/dslib",
"path": "dslib/tsa/expand.py",
"copies": "1",
"size": "1052",
"license": "mit",
"hash": 4582572136651816400,
"line_mean": 21.3829787234,
"line_max": 79,
"alpha_frac": 0.5342205323,
"autogenerated": false,
"ratio": 3.6655052264808363,
"config_test": false,
"has... |
__author__ = 'dwayn'
import paramiko
import socket
import pipes
from errors import *
import pymysql.cursors
class SSHManager:
def __init__(self, settings):
self.client = paramiko.SSHClient()
self.hostname = None
self.__connected = False
self.instance = None
self.dbconn = N... | {
"repo_name": "dwayn/aws-management-suite",
"path": "amslib/ssh/sshmanager.py",
"copies": "1",
"size": "4352",
"license": "mit",
"hash": 2455829723607193000,
"line_mean": 41.6666666667,
"line_max": 168,
"alpha_frac": 0.6082261029,
"autogenerated": false,
"ratio": 3.992660550458716,
"config_test... |
__author__ = 'dwayn'
import paramiko
import socket
import pipes
from errors import *
class SSHManager:
def __init__(self):
self.client = paramiko.SSHClient()
self.hostname = None
self.__connected = False
# connect to a host
def connect(self, hostname, port=22, username=None, pas... | {
"repo_name": "ThisLife/aws-management-suite",
"path": "amslib/ssh/sshmanager.py",
"copies": "1",
"size": "2517",
"license": "mit",
"hash": -5700372170879556000,
"line_mean": 37.7230769231,
"line_max": 168,
"alpha_frac": 0.6034962257,
"autogenerated": false,
"ratio": 3.866359447004608,
"config_... |
__author__ = 'dwayn'
import time
import re
import os
import boto.ec2
import argparse
from amslib.core.manager import BaseManager
from amslib.ssh.sshmanager import SSHManager
from errors import *
class VolumeManager(BaseManager):
def __get_boto_conn(self, region):
if region not in self.boto_conns:
... | {
"repo_name": "ThisLife/aws-management-suite",
"path": "amslib/ebs/volume.py",
"copies": "1",
"size": "47861",
"license": "mit",
"hash": 9199104681686428000,
"line_mean": 51.1361655773,
"line_max": 221,
"alpha_frac": 0.5842544034,
"autogenerated": false,
"ratio": 3.9016059346213416,
"config_tes... |
__author__ = 'dwayn'
import time
import types
import datetime
import re
import argparse
import boto.ec2
from amslib.core.manager import BaseManager
from volume import VolumeManager
from amslib.ssh.sshmanager import SSHManager
from errors import *
class SnapshotSchedule:
def __init__(self):
self.schedule_i... | {
"repo_name": "ThisLife/aws-management-suite",
"path": "amslib/ebs/snapshot.py",
"copies": "1",
"size": "55783",
"license": "mit",
"hash": -2950520001269379000,
"line_mean": 51.5263653484,
"line_max": 242,
"alpha_frac": 0.5906817489,
"autogenerated": false,
"ratio": 4.078897338403042,
"config_t... |
__author__ = 'dwayn'
import os
def env(keys, dflt):
if isinstance(keys, basestring):
keys = [ keys ]
for key in keys:
if os.environ.has_key(key):
return os.environ.get(key)
return dflt
# All settings can be set via the environment or explicitly within this file. To give a set... | {
"repo_name": "ThisLife/aws-management-suite",
"path": "sample_settings.py",
"copies": "1",
"size": "2288",
"license": "mit",
"hash": -228154992099358340,
"line_mean": 43.8823529412,
"line_max": 112,
"alpha_frac": 0.680506993,
"autogenerated": false,
"ratio": 3.3207547169811322,
"config_test": ... |
__author__ = 'dwcaraway'
from scrapy.spider import BaseSpider
from scrapy.selector import Selector
from scrapy.http import Request
import urlparse
import re
import lxml
import datetime
from dayton.items import DaytonlocalItem
import phonenumbers
facebook_matcher = re.compile('.*GoHere=(.*facebook.*)')
twitter_matcher... | {
"repo_name": "dwcaraway/scrapers",
"path": "dayton/spiders/dayton_local_spider.py",
"copies": "1",
"size": "5232",
"license": "unlicense",
"hash": -4473017245853202000,
"line_mean": 36.1063829787,
"line_max": 114,
"alpha_frac": 0.562117737,
"autogenerated": false,
"ratio": 3.8669623059866964,
... |
__author__ = 'dwcaraway'
from scrapy.spider import BaseSpider
from scrapy.selector import Selector
import urlparse
import urllib2
import lxml
import datetime
from dayton.items import DaytonOhioPDFItem
from scrapy.http import Request
class DaytonOhioPDFSpider(BaseSpider):
"""Crawls daytonohio.gov looking for PDF d... | {
"repo_name": "dwcaraway/scrapers",
"path": "dayton/spiders/daytonohio_pdf_spider.py",
"copies": "1",
"size": "2172",
"license": "unlicense",
"hash": -7858756081427362000,
"line_mean": 34.0322580645,
"line_max": 103,
"alpha_frac": 0.635359116,
"autogenerated": false,
"ratio": 3.650420168067227,
... |
__author__ = 'dwcaraway'
from scrapy.spider import Spider
from scrapy.selector import Selector
from scrapy.http import FormRequest
import datetime
from dayton.items import DaytonChamberItem
import phonenumbers
class DaytonChamberSpider(Spider):
name = "dayton_chamber"
allowed_domains = ["daytonchamber.org"]
... | {
"repo_name": "luvzNPR/scrapers",
"path": "dayton/spiders/dayton_chamber_spider.py",
"copies": "1",
"size": "3764",
"license": "unlicense",
"hash": 8911588090358450000,
"line_mean": 30.8983050847,
"line_max": 104,
"alpha_frac": 0.5167375133,
"autogenerated": false,
"ratio": 4.386946386946387,
"... |
__author__ = 'dwcaraway'
from scrapy.spider import Spider
from scrapy.selector import Selector
from scrapy.http import Request
import urlparse
import re
import lxml
import datetime
from dayton.items import DaytonlocalItem
import phonenumbers
facebook_matcher = re.compile('.*GoHere=(.*facebook.*)')
twitter_matcher = r... | {
"repo_name": "luvzNPR/scrapers",
"path": "dayton/spiders/dayton_local_spider.py",
"copies": "1",
"size": "5224",
"license": "unlicense",
"hash": -3823683400879106000,
"line_mean": 36.0496453901,
"line_max": 114,
"alpha_frac": 0.5614471669,
"autogenerated": false,
"ratio": 3.863905325443787,
"c... |
__author__ = 'dwcaraway'
from scrapy.spider import Spider
from scrapy.selector import Selector
import urlparse
import urllib2
import lxml
import datetime
from dayton.items import DaytonOhioPDFItem
from scrapy.http import Request
class DaytonOhioPDFSpider(Spider):
"""Crawls daytonohio.gov looking for PDF documents... | {
"repo_name": "luvzNPR/scrapers",
"path": "dayton/spiders/daytonohio_pdf_spider.py",
"copies": "1",
"size": "2164",
"license": "unlicense",
"hash": -8542907108818481000,
"line_mean": 33.9032258065,
"line_max": 103,
"alpha_frac": 0.6340110906,
"autogenerated": false,
"ratio": 3.643097643097643,
... |
__author__ = 'dwliv_000'
#coding:utf-8
import pygraf
#z=pygraf.graf(3,[[2,1],[2,3],[3,1],[1,3],[1,2],[3,2]])#неориентированный граф
#z=pygraf.graf(3,[[2,1],[2,3],[3,1],[1,3],[3,2]])#ориентированный граф
#t=[] - тест памяти и времени выполнения
#for j in range(2,1000000):
# t.append([1,j,1])
#z=pygraf.graf(... | {
"repo_name": "PxyUp/pygraf",
"path": "test.py",
"copies": "1",
"size": "1151",
"license": "apache-2.0",
"hash": 5749931182227258000,
"line_mean": 32.8965517241,
"line_max": 117,
"alpha_frac": 0.6247524752,
"autogenerated": false,
"ratio": 1.6134185303514377,
"config_test": false,
"has_no_key... |
__author__ = 'dwliv_000'
from pygraf.rebro import *
#coding:utf-8
class graf:
def __init__(self,n,mas): # inzilize graf(n-count point,mas =[[1,2]...] massive [point,point]
self.__graff={}#массив графа в виде словаря
self.__count=n
link=self.__graff
self.__mas_comp=[]
... | {
"repo_name": "PxyUp/pygraf",
"path": "pygraf/__init__.py",
"copies": "1",
"size": "5827",
"license": "apache-2.0",
"hash": -6831745434627999000,
"line_mean": 31.5662650602,
"line_max": 104,
"alpha_frac": 0.415649677,
"autogenerated": false,
"ratio": 3.268035190615836,
"config_test": false,
"... |
__author__ = 'DYEDEN'
import time
tempo = time.clock()
from arcpy import Array, da, AddField_management, \
Point, Polyline, SpatialReference, CreateFeatureclass_management, \
Exists, Dissolve_management, Delete_management, env, ListFields, CopyFeatures_management
from math import sqrt, acos, degrees, sin,cos, t... | {
"repo_name": "dyeden/app_automatico",
"path": "app_automatico_projeto_antigo/linhas_largura_rio.py",
"copies": "1",
"size": "20637",
"license": "bsd-3-clause",
"hash": -7521709776689378000,
"line_mean": 51.1161616162,
"line_max": 525,
"alpha_frac": 0.5924795271,
"autogenerated": false,
"ratio": ... |
__author__ = 'DYEDEN'
import time
tempo = time.clock()
from arcpy import Array , SelectLayerByLocation_management, MakeFeatureLayer_management, da, SelectLayerByAttribute_management, CopyFeatures_management, AddField_management, \
Point, Polyline, Polygon, Describe, Extent, SpatialReference, CreateFeatureclass... | {
"repo_name": "dyeden/app_automatico",
"path": "app_automatico_projeto_antigo/definir_app.py",
"copies": "1",
"size": "5389",
"license": "bsd-3-clause",
"hash": -3587375485384099300,
"line_mean": 56.9569892473,
"line_max": 525,
"alpha_frac": 0.6259046205,
"autogenerated": false,
"ratio": 3.008933... |
__author__ = 'dylanjf'
import os
import pickle
import logging
import scipy as sp
import numpy as np
from re import sub
from sklearn.grid_search import GridSearchCV
from sklearn import cross_validation
logger = logging.getLogger(__name__)
N_TREES = 300
INITIAL_PARAMS = {
'LogisticRegression': {'C': 1, 'penalty':... | {
"repo_name": "dylanjf/stumbleupon",
"path": "src/su_code/ModelEnsemble.py",
"copies": "1",
"size": "10254",
"license": "mit",
"hash": -2403680246457326600,
"line_mean": 36.0180505415,
"line_max": 115,
"alpha_frac": 0.5749951239,
"autogenerated": false,
"ratio": 3.849099099099099,
"config_test"... |
__author__ = 'Dylan J. Hellems'
import random, sys, math
robots = 10
oil = 50
metal = 0
expansion = 0
expand_chance = 0.5
improved_expand = False
improved_collect = False
improved_upkeep = False
def rand_event():
global robots, oil, metal, expand_chance, improved_collect, improved_expand, expansion
rand = r... | {
"repo_name": "dah6ce/Robot-Survival",
"path": "Prototypes/prototype.py",
"copies": "1",
"size": "5265",
"license": "mit",
"hash": -406859484699401700,
"line_mean": 27.3064516129,
"line_max": 107,
"alpha_frac": 0.5126305793,
"autogenerated": false,
"ratio": 3.8096960926193923,
"config_test": fa... |
__author__ = 'Dylan J. Hellems'
import random, sys, math
robots = 10
oil = 50
metal = 0
expansion = 0
fortification = 0
expand_chance = 0.5
improved_expand = False
improved_collect = False
improved_upkeep = False
def rand_event():
global robots, oil, metal, expand_chance, improved_collect, improved_expand, expa... | {
"repo_name": "dah6ce/Robot-Survival",
"path": "Prototypes/prototype2.py",
"copies": "1",
"size": "6000",
"license": "mit",
"hash": 7692706057407857000,
"line_mean": 29,
"line_max": 122,
"alpha_frac": 0.5325,
"autogenerated": false,
"ratio": 3.802281368821293,
"config_test": false,
"has_no_ke... |
__author__ = 'Dylan J. Hellems'
import random, sys, math
robots = {1: 500, 2: 0, 3: 0}
actions = 2
max_actions = 4
oil = 50
metal = 0
components = 0
expansion = 0
fortification = 0
expand_chance = 0.5
improved_expand = False
improved_collect = False
improved_upkeep = False
def choose(val, val2, req):
print("Whi... | {
"repo_name": "dah6ce/Robot-Survival",
"path": "Prototypes/prototype3.py",
"copies": "1",
"size": "10735",
"license": "mit",
"hash": -5158225179636221000,
"line_mean": 32.6520376176,
"line_max": 156,
"alpha_frac": 0.5399161621,
"autogenerated": false,
"ratio": 3.572379367720466,
"config_test": ... |
__author__ = 'dylan'
import pygame
from pygame.locals import *
from OpenGL.GL import *
from OpenGL.GLU import *
from OGL import *
import time
from macros import *
import math
import OGL
from test_gravitation import *
from objects import enemy, player
class Base:
def __init__(self , width , height , caption):
... | {
"repo_name": "elgrandt/ShooterInc",
"path": "base.py",
"copies": "1",
"size": "2854",
"license": "mit",
"hash": -3963901055233956000,
"line_mean": 33.8048780488,
"line_max": 110,
"alpha_frac": 0.5812894184,
"autogenerated": false,
"ratio": 2.7363374880153404,
"config_test": false,
"has_no_ke... |
__author__ = 'dy'
from gensim.models.word2vec import Word2Vec
import numpy as np
import matplotlib.pyplot as plt
from cs224d.datasets.data_utils import *
dataset = StanfordSentiment()
sentences = dataset.sentences()
model = Word2Vec(sentences, size=100, window=5, min_count=5, workers=4)
# model.save_word2vec_format("... | {
"repo_name": "hack1nt0/word2vec",
"path": "baseline.py",
"copies": "1",
"size": "1127",
"license": "apache-2.0",
"hash": 7644555499954677000,
"line_mean": 39.25,
"line_max": 282,
"alpha_frac": 0.6823425022,
"autogenerated": false,
"ratio": 2.9196891191709846,
"config_test": false,
"has_no_ke... |
__author__ = 'DY'
from main import *
import time
from cs224d.datasets.data_utils import *
# Implement your skip-gram and CBOW models here
# Interface to the dataset for negative sampling
# dataset = type('dummy', (), {})()
class DummyDataset:
def __init__(self):
self.seed = np.uint32(time.time())
... | {
"repo_name": "hack1nt0/word2vec",
"path": "word2vec.py",
"copies": "1",
"size": "14876",
"license": "apache-2.0",
"hash": -3976030596513797000,
"line_mean": 39.5340599455,
"line_max": 282,
"alpha_frac": 0.5678945953,
"autogenerated": false,
"ratio": 3.8409501678285567,
"config_test": false,
... |
__author__ = 'DY'
import numpy as np
class XNN():
def __init__(self, objNeuron):
self.root = objNeuron
self.topo = []
self.topoSort(objNeuron)
# self.topo.reverse()
def topoSort(self, tail):
if tail.pre is not None:
for preChd in tail.pre:
s... | {
"repo_name": "hack1nt0/word2vec",
"path": "neuron.py",
"copies": "1",
"size": "2354",
"license": "apache-2.0",
"hash": -6259161857554821000,
"line_mean": 25.1555555556,
"line_max": 89,
"alpha_frac": 0.5356839422,
"autogenerated": false,
"ratio": 3.03741935483871,
"config_test": false,
"has_n... |
__author__ = 'DY'
# Run some setup code for this notebook. Don't modify anything in this cell.
import random
import numpy as np
#from cs224d.data_utils import *
import matplotlib.pyplot as plt
# This is a bit of magic to make matplotlib figures appear inline in the notebook
# rather than in a new window.
#%matplotlib... | {
"repo_name": "hack1nt0/word2vec",
"path": "main.py",
"copies": "1",
"size": "9984",
"license": "apache-2.0",
"hash": 4984585141242491000,
"line_mean": 31.3106796117,
"line_max": 105,
"alpha_frac": 0.5221354167,
"autogenerated": false,
"ratio": 3.244718882027949,
"config_test": false,
"has_no... |
__author__ = ['Dzmitry Malyshau']
__bpydoc__ = 'Action module of KRI exporter.'
import bpy
from io_kri.common import *
### ANIMATION CURVES ###
def gather_anim(ob,log):
ad = ob.animation_data
if not ad: return []
all = [ns.action for nt in ad.nla_tracks for ns in nt.strips]
if ad.action not in ([None]+all):
... | {
"repo_name": "kvark/claymore",
"path": "etc/blender/io_kri/action.py",
"copies": "1",
"size": "3454",
"license": "apache-2.0",
"hash": 6214433643370159000,
"line_mean": 25.7751937984,
"line_max": 80,
"alpha_frac": 0.6357845976,
"autogenerated": false,
"ratio": 2.47954055994257,
"config_test": ... |
__author__ = ['Dzmitry Malyshau']
__bpydoc__ = 'Mesh module of KRI exporter.'
import mathutils
from io_kri.common import *
def calc_TBN(verts, uvs):
va = verts[1].co - verts[0].co
vb = verts[2].co - verts[0].co
n0 = n1 = va.cross(vb)
tan,bit,hand = None,None,1.0
if uvs!=None and n1.length_squared>0.0:
ta = uv... | {
"repo_name": "kvark/claymore",
"path": "etc/blender/io_kri_mesh/mesh.py",
"copies": "1",
"size": "14827",
"license": "apache-2.0",
"hash": 2353780079695240700,
"line_mean": 28.4771371769,
"line_max": 96,
"alpha_frac": 0.6101031901,
"autogenerated": false,
"ratio": 2.3765026446545923,
"config_t... |
__author__ = ['Dzmitry Malyshau']
__bpydoc__ = 'Scene module of KRI exporter.'
import mathutils
import math
from io_kri.common import *
from io_kri.action import *
from io_kri_mesh.mesh import *
def cook_mat(mat,log):
textures = []
for mt in mat.texture_slots:
if mt == None: continue
it = mt.texture
if it ==... | {
"repo_name": "kvark/claymore",
"path": "etc/blender/io_kri_scene/scene.py",
"copies": "1",
"size": "9450",
"license": "apache-2.0",
"hash": -7633860836504355000,
"line_mean": 26.6315789474,
"line_max": 94,
"alpha_frac": 0.6046560847,
"autogenerated": false,
"ratio": 2.4609375,
"config_test": f... |
__author__ = ['Dzmitry Malyshau']
__bpydoc__ = 'Settings & Writing access for KRI exporter.'
class Settings:
showInfo = True
showWarning = True
breakError = False
putNormal = True
putTangent = False
putQuat = False
putUv = True
putColor = True
compressUv = True
doQuatInt = False
fakeQuat = 'Auto'
logInfo... | {
"repo_name": "kvark/claymore",
"path": "etc/blender/io_kri/common.py",
"copies": "1",
"size": "2453",
"license": "apache-2.0",
"hash": -3517749741731447000,
"line_mean": 23.7777777778,
"line_max": 78,
"alpha_frac": 0.6167957603,
"autogenerated": false,
"ratio": 2.400195694716243,
"config_test"... |
__author__ = 'Dzmitry'
from model.contact import Contact
from random import randrange
def test_modify_contact_firstname(app, db, check_ui):
if len(db.get_contact_list()) == 0:
app.contact.create(Contact(firstname="test"))
old_contacts = db.get_contact_list()
index = randrange(len(old_contacts))
... | {
"repo_name": "duskat/python_training",
"path": "test/test_modify_concatc.py",
"copies": "1",
"size": "1229",
"license": "apache-2.0",
"hash": -8592542107180306000,
"line_mean": 44.5555555556,
"line_max": 115,
"alpha_frac": 0.690805533,
"autogenerated": false,
"ratio": 3.259946949602122,
"confi... |
__author__ = 'Dzmitry'
from model.contact import Contact
import random
import string
import os.path
import json
import jsonpickle
def random_data_symbols(prefix, maxlen):
symbols = string.ascii_letters + string.digits + " "*5
return prefix + "".join([random.choice(symbols) for i in range(random.randrange(maxl... | {
"repo_name": "duskat/python_training",
"path": "generator/contact.py",
"copies": "1",
"size": "1260",
"license": "apache-2.0",
"hash": 9155766966530554000,
"line_mean": 36.0588235294,
"line_max": 105,
"alpha_frac": 0.6777777778,
"autogenerated": false,
"ratio": 3.5,
"config_test": false,
"ha... |
__author__ = 'Dzmitry'
from model.contact import Contact
import re
class ContactHelper:
def __init__(self, app):
self.app = app
def create(self, contact):
wd = self.app.wd
self.app.open_home_page()
# init new contact creation
wd.find_element_by_link_text("add new").cli... | {
"repo_name": "duskat/python_training",
"path": "fixture/contact.py",
"copies": "1",
"size": "8439",
"license": "apache-2.0",
"hash": 6428208835872947000,
"line_mean": 41.8375634518,
"line_max": 141,
"alpha_frac": 0.6041000118,
"autogenerated": false,
"ratio": 3.4193679092382494,
"config_test":... |
__author__ = 'Dzmitry'
from model.contact import Group
class ContactHelper:
def __init__(self, app):
self.app = app
def create(self, contact):
wd = self.app.wd
wd.get("http://localhost/addressbook/")
# init new contact creation
wd.find_element_by_link_text("add new").c... | {
"repo_name": "MilaPetrova/python-training-group3",
"path": "contact_Dima.py",
"copies": "1",
"size": "3567",
"license": "apache-2.0",
"hash": -3630092095431280600,
"line_mean": 37.7717391304,
"line_max": 110,
"alpha_frac": 0.6069526213,
"autogenerated": false,
"ratio": 3.5142857142857142,
"con... |
__author__ = 'Dzmitry'
from model.group import Group
import random
import string
import os.path
import jsonpickle
import getopt
import sys
#???????? ?????????? ?? ???????? ??????
"""try:
opts, args = getopt.getopt(sys.argv[1:], "n:f:", ["number of groups", "file"])
except getopt.GetoptError as err:
getopt.usa... | {
"repo_name": "duskat/python_training",
"path": "generator/group.py",
"copies": "1",
"size": "1086",
"license": "apache-2.0",
"hash": -22820244017429540,
"line_mean": 24.2558139535,
"line_max": 117,
"alpha_frac": 0.6049723757,
"autogenerated": false,
"ratio": 3.0591549295774647,
"config_test": ... |
__author__ = 'Dzmitry'
from model.group import Group
class GroupHelper:
def __init__(self, app):
self.app = app
def return_to_group_page(self):
wd = self.app.wd
wd.find_element_by_link_text("group page").click()
def create(self, group):
wd = self.app.wd
self.open_... | {
"repo_name": "duskat/python_training",
"path": "fixture/group.py",
"copies": "1",
"size": "3971",
"license": "apache-2.0",
"hash": 5782586546836947000,
"line_mean": 30.768,
"line_max": 100,
"alpha_frac": 0.5877612692,
"autogenerated": false,
"ratio": 3.432152117545376,
"config_test": false,
... |
__author__ = 'Dzmitry'
from pony.orm import *
from datetime import datetime
from model.contact import Contact
from model.group import Group
from pymysql.converters import decoders
class ORMFixture:
db = Database()
class ORMGroup(db.Entity):
_table_ = "group_list"
id = PrimaryKey(int, column=... | {
"repo_name": "duskat/python_training",
"path": "fixture/orm.py",
"copies": "1",
"size": "2726",
"license": "apache-2.0",
"hash": -6009103058174761000,
"line_mean": 40.3181818182,
"line_max": 126,
"alpha_frac": 0.6632428467,
"autogenerated": false,
"ratio": 3.62982689747004,
"config_test": fals... |
__author__ = 'Dzmitry'
from sys import maxsize
class Contact:
def __init__(self, lastname=None, firstname=None, nickname=None, title=None, company=None, address=None,
email=None, email2=None, email3=None,
homephone=None, mobilephone=None, workphone=None, secondaryphone=None,
... | {
"repo_name": "duskat/python_training",
"path": "model/contact.py",
"copies": "1",
"size": "1410",
"license": "apache-2.0",
"hash": -5603186733587643000,
"line_mean": 37.1351351351,
"line_max": 166,
"alpha_frac": 0.6141843972,
"autogenerated": false,
"ratio": 3.8315217391304346,
"config_test": ... |
__author__ = 'Dzmitry'
import mysql.connector
from model.group import Group
from model.contact import Contact
class DbFixture:
def __init__(self, host, name, user, password):
self.host = host
self.name = name
self.user = user
self.password = password
self.connection = mysql... | {
"repo_name": "duskat/python_training",
"path": "fixture/db.py",
"copies": "1",
"size": "1379",
"license": "apache-2.0",
"hash": 3260577208104148500,
"line_mean": 31.8333333333,
"line_max": 116,
"alpha_frac": 0.5924583031,
"autogenerated": false,
"ratio": 4.091988130563799,
"config_test": false... |
__author__ = 'Dzmitry'
class SessionHelper:
def __init__(self, app):
self.app = app
def login(self, username, password):
wd = self.app.wd
self.app.open_home_page()
wd.find_element_by_name("user").click()
wd.find_element_by_name("user").clear()
wd.find_element_b... | {
"repo_name": "duskat/python_training",
"path": "fixture/session.py",
"copies": "1",
"size": "1428",
"license": "apache-2.0",
"hash": -4942833420677318000,
"line_mean": 29.3829787234,
"line_max": 73,
"alpha_frac": 0.5651260504,
"autogenerated": false,
"ratio": 3.352112676056338,
"config_test": ... |
__author__ = "E. A. Tacao <e.a.tacao |at| estadao.com.br>"
__date__ = "15 Fev 2006, 22:00 GMT-03:00"
__version__ = "0.02"
__doc__ = """
AnalogClock - an analog clock.
This control creates an analog clock window. Its features include shadowing,
the ability to render numbers as well as any arbitrary polyg... | {
"repo_name": "CarlFK/clocky",
"path": "analogclock/__init__.py",
"copies": "2",
"size": "5794",
"license": "mit",
"hash": -4406898077163867000,
"line_mean": 38.2361111111,
"line_max": 79,
"alpha_frac": 0.5623058336,
"autogenerated": false,
"ratio": 4.195510499637943,
"config_test": false,
"h... |
__author__ = 'ebo'
import socket # for sockets
import sys # for exit
def connect_to_server(stock):
try:
# create an AF_INET, STREAM socket (TCP)
s = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
except socket.error, msg:
print 'Failed to create socket. Error code: ' + str(msg[0]... | {
"repo_name": "PyPoS/PyPoS",
"path": "classes/client.py",
"copies": "1",
"size": "1168",
"license": "mit",
"hash": 6970600880156947000,
"line_mean": 21.4807692308,
"line_max": 100,
"alpha_frac": 0.5933219178,
"autogenerated": false,
"ratio": 3.731629392971246,
"config_test": false,
"has_no_ke... |
__author__ = 'ebo'
def donothing():
filewin = Toplevel(window)
button = Button(filewin, text="Do nothing button")
button.pack()
def about():
filenu = Toplevel(window)
filenu.geometry('300x170+500+250')
filenu.iconbitmap(r'c:\Python34\qnxx.ico')
filenu.resizable(False,False)
label = ttk.Labe... | {
"repo_name": "PyPoS/PyPoS",
"path": "classes/menu_bar.py",
"copies": "1",
"size": "1917",
"license": "mit",
"hash": -5096354117549626000,
"line_mean": 28.953125,
"line_max": 170,
"alpha_frac": 0.7292644757,
"autogenerated": false,
"ratio": 3.028436018957346,
"config_test": false,
"has_no_key... |
import urllib
import urllib2
import cookielib
import sys
import os
filename = 'cookie.txt'
cookie = cookielib.MozillaCookieJar(filename)
handler = urllib2.HTTPCookieProcessor(cookie)
opener = urllib2.build_opener(handler)
post = urllib.urlencode({'login':'fyang@iastate.edu',
'password':sys.a... | {
"repo_name": "fandemonium/code",
"path": "api_web_scraping/getJGIgenomes.py",
"copies": "1",
"size": "2951",
"license": "mit",
"hash": 1847751672487094500,
"line_mean": 41.768115942,
"line_max": 167,
"alpha_frac": 0.6946797696,
"autogenerated": false,
"ratio": 3.1731182795698927,
"config_test"... |
import os
os.environ["CUDA_VISIBLE_DEVICES"] = "0"
import argparse
import base64
import json
import numpy as np
import socketio
import eventlet
import eventlet.wsgi
import time
from PIL import Image
from PIL import ImageOps
from flask import Flask, render_template
from io import BytesIO
import cv2
from keras.models... | {
"repo_name": "jingzhehu/udacity_sdcnd",
"path": "term1/P3_behavior_cloning/drive.py",
"copies": "1",
"size": "3351",
"license": "apache-2.0",
"hash": -4501610393878321000,
"line_mean": 25.808,
"line_max": 104,
"alpha_frac": 0.6681587586,
"autogenerated": false,
"ratio": 3.516264428121721,
"con... |
__author__ = 'edek437'
from .models import Passenger
from .models import Flight
from .models import Reservation
from .models import StartLaneScheduleField
from .models import StartLane
from django.core.exceptions import ValidationError
from django.db import transaction
from django.core.validators import validate_email
... | {
"repo_name": "edek437/Zastosowanie-informatyki-w-gospodarce-projekt",
"path": "lotnisko/helpers.py",
"copies": "1",
"size": "9283",
"license": "mit",
"hash": 1062228528854931500,
"line_mean": 39.3608695652,
"line_max": 308,
"alpha_frac": 0.6300764839,
"autogenerated": false,
"ratio": 3.058649093... |
__author__ = 'Eden Thiago Ferreira'
from collections import defaultdict
import random as rnd
from math import sqrt
class Grafo:
"""Mantem colecoes de pontos, arestas, e seus atributos, como posicoes, pesos, direcao"""
def __init__(self, ident=0):
self.ident = ident
self.pontos = set()
... | {
"repo_name": "edenferreira/Grafo-e-Caminhos-Minimos",
"path": "grafos.py",
"copies": "1",
"size": "3994",
"license": "bsd-2-clause",
"hash": -4643886436136859000,
"line_mean": 38.95,
"line_max": 111,
"alpha_frac": 0.5280420631,
"autogenerated": false,
"ratio": 2.7736111111111112,
"config_test"... |
author = 'Eden Thiago Ferreira'
from random import *
from collections import defaultdict
import math
_mult_ident_ponto = 10000000 #Multiplicador para identificacao unica de cada ponto adicionado
class Digrafo:
def __init__(self,ident=None):
self.ident = ident
self.pontos = set()
self.pos... | {
"repo_name": "edenferreira/estudo_caso",
"path": "grafos.py",
"copies": "1",
"size": "3324",
"license": "mit",
"hash": -8501552085108124000,
"line_mean": 34.3617021277,
"line_max": 131,
"alpha_frac": 0.5493381468,
"autogenerated": false,
"ratio": 2.5200909780136467,
"config_test": false,
"ha... |
author = 'Eden Thiago Ferreira'
#from statistics import *
from random import *
from grafos import *
from caminhos_minimos import *
from banco_dados import *
from pprint import pprint
from time import time
def coletar_dataset(repet):
if repet == 0:
return
criar_se_nao_existe(True)
con = Conexao(True... | {
"repo_name": "edenferreira/estudo_caso",
"path": "coletar_dados.py",
"copies": "1",
"size": "4438",
"license": "mit",
"hash": -4320105078790152700,
"line_mean": 27.6322580645,
"line_max": 124,
"alpha_frac": 0.5401081568,
"autogenerated": false,
"ratio": 2.563835932986713,
"config_test": false,... |
author = 'Eden Thiago Ferreira'
from time import *
from pqdict import *
from grafos import *
class Dijkstra:
def __init__(self, grafo=Digrafo()):
self.grafo = grafo
self.pt_o = None
self.pt_d = None
self.anterior = {}
self.dist_total = 0
self.visitados = set... | {
"repo_name": "edenferreira/estudo_caso",
"path": "caminhos_minimos.py",
"copies": "1",
"size": "3956",
"license": "mit",
"hash": -7377617959661921000,
"line_mean": 31.4262295082,
"line_max": 121,
"alpha_frac": 0.5298281092,
"autogenerated": false,
"ratio": 3.066666666666667,
"config_test": fal... |
__author__ = 'Eden Thiago Ferreira'
import cProfile as cp
import pstats as pst
from collections import OrderedDict
from grafos import *
from banco_dados import *
from caminhos_minimos import *
class Coletor:
def __init__(self,grafo,nome_mapa=None,path_grafos=None):
"""se path_grafo é None ele gera o grafo... | {
"repo_name": "edenferreira/Grafo-e-Caminhos-Minimos",
"path": "coletar_dados.py",
"copies": "1",
"size": "3475",
"license": "bsd-2-clause",
"hash": 6110334556959646000,
"line_mean": 36.3655913978,
"line_max": 101,
"alpha_frac": 0.5613126079,
"autogenerated": false,
"ratio": 3.068904593639576,
... |
__author__ = 'Eden Thiago Ferreira'
import sqlite3 as sql
from collections import OrderedDict
class Conexao:
def __init__(self, nome_banco):
self.banco = nome_banco
def __str__(self):
return self.banco
def criar_tabela_identificacao(self):
print("Criando tabela de identificacao")... | {
"repo_name": "edenferreira/Grafo-e-Caminhos-Minimos",
"path": "banco_dados.py",
"copies": "1",
"size": "12037",
"license": "bsd-2-clause",
"hash": -5150511096949210000,
"line_mean": 41.9928571429,
"line_max": 169,
"alpha_frac": 0.5344354906,
"autogenerated": false,
"ratio": 3.4312998859749144,
... |
author = 'Eden Thiago Ferreira'
import sqlite3 as sql
import os
_nome_banco = 'grafo_db_final'
def criar_banco_dados(dataset=False):
con = Conexao(dataset)
con.criar_table_ident()
con.criar_tabela_grafos()
con.criar_tabela_dijkstra()
con.criar_tabela_astar()
def reiniciar_banco(dataset=False):
... | {
"repo_name": "edenferreira/estudo_caso",
"path": "banco_dados.py",
"copies": "1",
"size": "12231",
"license": "mit",
"hash": -6845063111462442000,
"line_mean": 40.5884353741,
"line_max": 145,
"alpha_frac": 0.5260489082,
"autogenerated": false,
"ratio": 3.206661421452924,
"config_test": false,
... |
__author__ = 'Eden Thiago Ferreira'
class __CaminhosMinimos:
"""Classe base para caminhos minimos ponto a ponto"""
def __init__(self, grafo):
self.grafo = grafo
self.nao_visit = set(self.grafo.pontos)
self.visit = set()
self.dist = {}
self.dist_visit = {}
self.... | {
"repo_name": "edenferreira/Grafo-e-Caminhos-Minimos",
"path": "caminhos_minimos.py",
"copies": "1",
"size": "3127",
"license": "bsd-2-clause",
"hash": -8925454158495007000,
"line_mean": 35.3604651163,
"line_max": 111,
"alpha_frac": 0.5426926767,
"autogenerated": false,
"ratio": 3.030038759689922... |
__author__ = "Eder Santana"
import numpy as np
from .game import Game
class Catch(Game):
def __init__(self, grid_size=10):
self.grid_size = grid_size
self.won = False
self.reset()
def reset(self):
n = np.random.randint(0, self.grid_size - 1, size=1)
m = np.random.rand... | {
"repo_name": "bhillmann/2048-rl",
"path": "qlearning4k/games/catch.py",
"copies": "1",
"size": "1813",
"license": "mit",
"hash": 2807565144059525600,
"line_mean": 25.2753623188,
"line_max": 79,
"alpha_frac": 0.5030336459,
"autogenerated": false,
"ratio": 3.369888475836431,
"config_test": false... |
__author__ = 'edgar'
#import dpkt
from sys import argv
from subprocess import call
from scapy.all import *
import time
import re
import os
import struct
import threading
import binascii
import csv
#script, filename = argv;
class DataContainer:
def __init__(self):
#self.FIRSTSEQNUM = 802159925;
... | {
"repo_name": "elopezga/ErrorRate",
"path": "ErrorRate/LivePCAPReader.py",
"copies": "1",
"size": "17860",
"license": "mit",
"hash": -7885063857497888000,
"line_mean": 28.0895765472,
"line_max": 117,
"alpha_frac": 0.5749720045,
"autogenerated": false,
"ratio": 3.6501124054772123,
"config_test":... |
__author__ = 'edgar'
import pylab
import math
# Packet length
N = 1004;
# Eb/N0 argument that goes in erfc
ratio = [];
# Square root version of ratio; ratio preserved for graphing
sqrtratio = [];
# Hold packet error generated from equation
pe = [];
# Hold bit error
pb = [];
# Custom range function to allow a floa... | {
"repo_name": "elopezga/ErrorRate",
"path": "Gen_Plots/BER.py",
"copies": "1",
"size": "1564",
"license": "mit",
"hash": 5251340334246662000,
"line_mean": 20.7361111111,
"line_max": 85,
"alpha_frac": 0.6470588235,
"autogenerated": false,
"ratio": 2.8436363636363637,
"config_test": false,
"has... |
__author__ = 'Edilio'
import os
def get_font_path():
windows_font = "C:/Windows/Fonts/"
linux_font = "/usr/share/fonts/truetype/"
mac = "/Library/Fonts"
path = windows_font if os.name == 'nt' else linux_font
if os.path.isdir(path):
return path
else:
return mac
font_path = ge... | {
"repo_name": "edilio/toolsprj",
"path": "tools/picture.py",
"copies": "1",
"size": "1985",
"license": "mit",
"hash": -4655982966600397000,
"line_mean": 27.7826086957,
"line_max": 93,
"alpha_frac": 0.6408060453,
"autogenerated": false,
"ratio": 2.9363905325443787,
"config_test": false,
"has_n... |
__author__ = 'edilio'
from django.contrib import admin
from django.utils import timezone
from apps.ideas.models import *
@admin.register(Idea)
class IdeaAdmin(admin.ModelAdmin):
list_display = ('name', 'category', 'status', 'market_population', 'market_percentage', 'max_number_of_sales',
... | {
"repo_name": "edilio/developer",
"path": "apps/ideas/admin.py",
"copies": "1",
"size": "2196",
"license": "mit",
"hash": 8855530045101297000,
"line_mean": 21.8913043478,
"line_max": 114,
"alpha_frac": 0.4499089253,
"autogenerated": false,
"ratio": 4.280701754385965,
"config_test": false,
"ha... |
__author__ = 'edill'
from pyspec.spec import SpecDataFile, FileProcessor
from matplotlib import pyplot
import numpy as np
import sys
# from metadataStore.userapi.commands import create, log
spec_folder_path = "c:\\DATA\\X1A2\\X1Data\\"
# spec_folder_path = "/home/edill/X1Data/"
spec_file_name = spec_folder_path + "L... | {
"repo_name": "ericdill/miniature-hipster",
"path": "miniature-hipster/pyspec_to_python.py",
"copies": "1",
"size": "2019",
"license": "bsd-3-clause",
"hash": -3073305574409466400,
"line_mean": 28.2753623188,
"line_max": 77,
"alpha_frac": 0.656265478,
"autogenerated": false,
"ratio": 2.8801711840... |
__author__ = 'edill'
import os
from pyspec.spec import SpecDataFile, FileProcessor
from matplotlib import pyplot
import numpy as np
import sys
from metadataStore.userapi.commands import create, record
from time import mktime
from datetime import datetime
spec_folder_path = "c:\\DATA\\X1A2\\X1Data\\"
# spec_folder_pa... | {
"repo_name": "ericdill/miniature-hipster",
"path": "miniature-hipster/pyspec_into_broker.py",
"copies": "1",
"size": "4331",
"license": "bsd-3-clause",
"hash": -8741967542383142000,
"line_mean": 34.5081967213,
"line_max": 79,
"alpha_frac": 0.5552990072,
"autogenerated": false,
"ratio": 3.4318541... |
__author__ = "Edimar Manica"
# libraries
import json
import os
import csv
from cProfile import run
from pprint import pprint
def compute_all_metrics(execution_id, path_input, path_output, formula, append):
from metrics import accuracy, precision, recall, f1, specificity
"""
Computes all metrics and persi... | {
"repo_name": "rogersprates/word2vec-financial-sentiment",
"path": "evaluation/__main__.py",
"copies": "1",
"size": "3524",
"license": "mit",
"hash": -1917854081267666200,
"line_mean": 38.595505618,
"line_max": 113,
"alpha_frac": 0.598183882,
"autogenerated": false,
"ratio": 3.454901960784314,
... |
# if __name__ == "__main__":
# main();
#
class CmdArgumentsHelper(object):
args = [];
args_cmd = {};
args_option = {};
args_has_value = {};
def add_argument(self, argument_name, argument_cmd, argument_option, has_value):
self.args.append(argument_name);
self.args_cmd[argument_name] = argument_c... | {
"repo_name": "crmauceri/VisualCommonSense",
"path": "code/database_builder/tools/cmd_arguments_helper.py",
"copies": "1",
"size": "1911",
"license": "mit",
"hash": 3405457089430981600,
"line_mean": 25.5416666667,
"line_max": 87,
"alpha_frac": 0.5907901622,
"autogenerated": false,
"ratio": 3.1903... |
from __future__ import print_function
from builtins import input
import requests
import time
import os
import platform
import re
headers = {'User-agent': "Mozilla/5.0 (Windows NT 10.0; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/54.0.2840.99 Safari/537.36"}
delimiter = "======================================... | {
"repo_name": "RubikX/infoSFU",
"path": "infoSFU.py",
"copies": "1",
"size": "7280",
"license": "mit",
"hash": -317002522351651500,
"line_mean": 32.3990825688,
"line_max": 137,
"alpha_frac": 0.6199175824,
"autogenerated": false,
"ratio": 2.959349593495935,
"config_test": false,
"has_no_keywor... |
__author__ = 'ed'
import os
from flask import Flask, render_template_string
from flask_mail import Mail
from flask_sqlalchemy import SQLAlchemy
from flask_user import login_required, UserManager, UserMixin, SQLAlchemyAdapter
# Use a Class-based config to avoid needing a 2nd file
# os.getenv() enables configuration t... | {
"repo_name": "eddwinn/Flask-User-0.6.1",
"path": "run.py",
"copies": "1",
"size": "3936",
"license": "bsd-2-clause",
"hash": 6741770704089460000,
"line_mean": 38.7676767677,
"line_max": 94,
"alpha_frac": 0.5838414634,
"autogenerated": false,
"ratio": 3.9242273180458622,
"config_test": true,
... |
__author__ = "Eduardo Galeano"
def parse_to_roman(m):
"""gives the roman representation of the given number
:param m: the decimal number to be parsed
:returns: roman representation"""
# lista de tuplas cada una contiene la cifra decimal y su respectiva representación en romanos
numbers = [(10... | {
"repo_name": "Cegard/Exercises",
"path": "Python/Romans.py",
"copies": "1",
"size": "1551",
"license": "bsd-3-clause",
"hash": -5346583093715004000,
"line_mean": 31.2708333333,
"line_max": 98,
"alpha_frac": 0.5594315245,
"autogenerated": false,
"ratio": 3.502262443438914,
"config_test": false,... |
__author__ = 'eduardo'
from nltk.tokenize import word_tokenize, sent_tokenize
import pycrfsuite
from newspaper import Article
import codecs
import re
class CRFCorpus(object):
def __init__(self, documents):
self.documents = documents
@classmethod
def from_urllist(cls, urls):
documents = []... | {
"repo_name": "eqperes/NaturalDisasterInformationExtraction",
"path": "step2_lib.py",
"copies": "1",
"size": "12030",
"license": "mit",
"hash": -6254634848581799000,
"line_mean": 32.700280112,
"line_max": 118,
"alpha_frac": 0.5586034913,
"autogenerated": false,
"ratio": 3.7175525339925835,
"con... |
import optparse
import os
from subprocess import call
from database import *
from strmanipulation import *
#Extracts information about client
#Fields: fullname of client, skypename of client, city and country of client.
brackstring = lambda column: divbrack(str(column))
opentextfile = lambda textfile: open(textf... | {
"repo_name": "Wir3dToast/Simple-Skype-Database-Information-Extractor",
"path": "src/extractor.py",
"copies": "1",
"size": "6398",
"license": "mit",
"hash": 1504223029823272000,
"line_mean": 39.4936708861,
"line_max": 162,
"alpha_frac": 0.6603626133,
"autogenerated": false,
"ratio": 3.98381070983... |
"""
This module defines standard interpreted text role functions, a registry for
interpreted text roles, and an API for adding to and retrieving from the
registry.
The interface for interpreted role functions is as follows::
def role_fn(name, rawtext, text, lineno, inliner,
options={}, content=[]... | {
"repo_name": "santisiri/popego",
"path": "envs/ALPHA-POPEGO/lib/python2.5/site-packages/docutils-0.4-py2.5.egg/docutils/parsers/rst/roles.py",
"copies": "7",
"size": "13019",
"license": "bsd-3-clause",
"hash": -849641218750032400,
"line_mean": 36.5187319885,
"line_max": 79,
"alpha_frac": 0.651432521... |
"""
This module defines standard interpreted text role functions, a registry for
interpreted text roles, and an API for adding to and retrieving from the
registry.
The interface for interpreted role functions is as follows::
def role_fn(name, rawtext, text, lineno, inliner,
options={}, c... | {
"repo_name": "hugs/selenium",
"path": "selenium/src/py/lib/docutils/parsers/rst/roles.py",
"copies": "5",
"size": "13412",
"license": "apache-2.0",
"hash": 2890069706334235000,
"line_mean": 36.5402298851,
"line_max": 79,
"alpha_frac": 0.6344318521,
"autogenerated": false,
"ratio": 4.178193146417... |
__author__ = 'Edward Pie'
import requests
import json
class GCMServer(object):
def __init__(self, server_key):
self.server_key = server_key
self.headers = {"Authorization": "%s=%s" % ("key", self.server_key), "Content-Type": "application/json"}
self.url = "https://android.googleapis.com/gc... | {
"repo_name": "hackstock/gcm_server",
"path": "gcm.py",
"copies": "1",
"size": "1260",
"license": "apache-2.0",
"hash": 3376293222868197000,
"line_mean": 39.6451612903,
"line_max": 112,
"alpha_frac": 0.6007936508,
"autogenerated": false,
"ratio": 3.7724550898203595,
"config_test": false,
"has... |
__author__ = "Egor Gavrilov"
__copyright__ = "Copyright 2015, ITMO University"
__license__ = "MIT"
__version__ = "1.0.0"
__email__ = "egorvlgavr@gmail.com"
import numpy as np
import drawlines as drwlines
# Coordinates of four points
r_a = np.array([0.165, 0.1, 0.04])
r_b = np.array([0.145, 0.25, 0.3])
r_c = np.array(... | {
"repo_name": "egorvlgavr/Python",
"path": "CalculateRobotTrajectory/trajectoryCalculate.py",
"copies": "1",
"size": "5720",
"license": "mit",
"hash": 2118404579629004000,
"line_mean": 42.9846153846,
"line_max": 120,
"alpha_frac": 0.5400489682,
"autogenerated": false,
"ratio": 2.141573033707865,
... |
__author__ = 'ehiller@css.edu'
__author__ = 'ram8647@gmail.com'
import datetime
import logging
import random
import traceback
from models import transforms
from models.models import Student
from models.models import EventEntity
from models import utils as models_utils
from models import jobs
from models import event_... | {
"repo_name": "ram8647/gcb-mobilecsp",
"path": "modules/teacher/student_activites.py",
"copies": "1",
"size": "30481",
"license": "apache-2.0",
"hash": 150691308943670600,
"line_mean": 50.3148148148,
"line_max": 155,
"alpha_frac": 0.5923362094,
"autogenerated": false,
"ratio": 4.126861630111021,
... |
__author__ = 'ehiller@css.edu'
import datetime
from models import transforms
from models.models import Student
from models.models import EventEntity
from models import utils as models_utils
from models import jobs
from models import event_transforms
from models.models import QuestionDAO
from models.models import Qu... | {
"repo_name": "ehiller/mobilecsp-v18",
"path": "modules/teacher_dashboard/teacher_parsers.py",
"copies": "1",
"size": "15317",
"license": "apache-2.0",
"hash": 769650127898539500,
"line_mean": 43.4,
"line_max": 122,
"alpha_frac": 0.5871254162,
"autogenerated": false,
"ratio": 4.36630558722919,
... |
__author__ = 'ehiller@css.edu'
import teacher_entity
from google.appengine.api import users
from common import crypto
from models import transforms
from models.models import Student
from controllers.utils import BaseRESTHandler
from common.resource import AbstractResourceHandler
from common import schema_fields
... | {
"repo_name": "ehiller/mobilecsp-v18",
"path": "modules/teacher_dashboard/teacher_rest_handlers.py",
"copies": "1",
"size": "12639",
"license": "apache-2.0",
"hash": 1225405441386185700,
"line_mean": 34.7033898305,
"line_max": 115,
"alpha_frac": 0.5913442519,
"autogenerated": false,
"ratio": 4.32... |
__author__ = 'ehiller@css.edu'
# Module to support custom teacher views in CourseBuilder dashboard
# Views include:
# Section Roster - list of students in section
# Sections - list of sections for current user
# Student Dashboard - view of a single student's performance in the course
# Teacher... | {
"repo_name": "ehiller/mobilecsp-v18",
"path": "modules/teacher_dashboard/teacher_dashboard.py",
"copies": "1",
"size": "21342",
"license": "apache-2.0",
"hash": 5846482490396610000,
"line_mean": 43.4625,
"line_max": 141,
"alpha_frac": 0.6554212351,
"autogenerated": false,
"ratio": 4.119281991893... |
__author__ = 'ehonlia'
from time import time
from elasticsearch import Elasticsearch
from rdflib import Graph, Literal, BNode, RDF
from rdflib.namespace import FOAF, URIRef, XSD, OWL
from decimal import Decimal
from constants import SSN, DUL, GEO, SAO, CT, PROV, TL, UCUM, ID, METADATA
from util import lucene_escape
... | {
"repo_name": "EricssonResearch/iot-framework-engine",
"path": "semantic-adapter/lib/semantics.py",
"copies": "1",
"size": "11729",
"license": "apache-2.0",
"hash": 2728509853854821400,
"line_mean": 29.7847769029,
"line_max": 101,
"alpha_frac": 0.6386733737,
"autogenerated": false,
"ratio": 3.099... |
__author__ = 'ehonlia'
import json
from flask import Response, request, jsonify, Blueprint
from app.mimetype import JSON, mimetype_map, correct_format
from lib import semantics
semantic_adapter = Blueprint('semantic_adapter', __name__, template_folder='../templates')
@semantic_adapter.route('/streams')
def strea... | {
"repo_name": "EricssonResearch/iot-framework-engine",
"path": "semantic-adapter/app/semantic_adapter.py",
"copies": "1",
"size": "2616",
"license": "apache-2.0",
"hash": 6943004302502217000,
"line_mean": 34.3513513514,
"line_max": 117,
"alpha_frac": 0.6991590214,
"autogenerated": false,
"ratio":... |
__author__ = 'ehonlia'
import pika
import json
import logging
import semantics
from constants import ID, METADATA
HOST = 'honnix-ws'
EXCHANGE_TYPE = 'topic'
STREAM_EXCHANGE = 'topic_stream'
VIRTUAL_STREAM_EXCHANGE = 'topic_virtual_stream'
SEMANTIC_STREAM_EXCHANGE = 'topic_semantic_stream'
SEMANTIC_VIRTUAL_STREAM_EXC... | {
"repo_name": "EricssonResearch/iot-framework-engine",
"path": "semantic-adapter/lib/broker.py",
"copies": "1",
"size": "3025",
"license": "apache-2.0",
"hash": -2209616532548018200,
"line_mean": 35.8902439024,
"line_max": 117,
"alpha_frac": 0.7381818182,
"autogenerated": false,
"ratio": 3.414221... |
__author__ = 'Ehsan'
from mininet.node import CPULimitedHost
from mininet.topo import Topo
from mininet.net import Mininet
from mininet.log import setLogLevel, info
from mininet.node import RemoteController
from mininet.cli import CLI
"""
Instructions to run the topo:
1. Go to directory where this fil is.
2. ru... | {
"repo_name": "kulawczukmarcin/mypox",
"path": "mininet_scripts/simple_net.py",
"copies": "1",
"size": "1695",
"license": "apache-2.0",
"hash": -7149605593062072000,
"line_mean": 26.3387096774,
"line_max": 79,
"alpha_frac": 0.6230088496,
"autogenerated": false,
"ratio": 3.2409177820267687,
"con... |
__author__ = 'eidonfiloi'
import logging
import matplotlib.pyplot as plt
from recurrent_network.Network import *
import config.forecast_network_configuration as base_config
from data_io.audio_data_utils import *
import pickle
import json
from copy import copy
import csv
import math
_LOGGER = logging.getLogger(__name_... | {
"repo_name": "eidonfiloi/SparseRecurrentNetwork",
"path": "forecast_runner.py",
"copies": "1",
"size": "7350",
"license": "mit",
"hash": 1232303145105585000,
"line_mean": 36.8865979381,
"line_max": 104,
"alpha_frac": 0.4819047619,
"autogenerated": false,
"ratio": 3.7423625254582484,
"config_te... |
__author__ = 'eidonfiloi'
import os
import scipy.io.wavfile as wav
import numpy as np
from pipes import quote
def convert_mp3_to_wav(filename, sample_frequency):
ext = filename[-4:]
if ext != '.mp3':
return
files = filename.split('/')
orig_filename = files[-1][0:-4]
orig_path = filename[0... | {
"repo_name": "eidonfiloi/SparseRecurrentNetwork",
"path": "data_io/audio_data_utils.py",
"copies": "1",
"size": "7476",
"license": "mit",
"hash": -3644065350905601500,
"line_mean": 33.9345794393,
"line_max": 123,
"alpha_frac": 0.6177100054,
"autogenerated": false,
"ratio": 3.065190651906519,
"... |
__author__ = 'ekaradon'
"""
Django settings for demihi project.
Generated by 'django-admin startproject' using Django 1.8.
For more information on this file, see
https://docs.djangoproject.com/en/1.8/topics/settings/
For the full list of settings and their values, see
https://docs.djangoproject.com/en/1.8/ref/settin... | {
"repo_name": "ekaradon/demihi",
"path": "demihi/settings/base.py",
"copies": "1",
"size": "3724",
"license": "mit",
"hash": -2145965746472621000,
"line_mean": 23.3464052288,
"line_max": 99,
"alpha_frac": 0.7277121375,
"autogenerated": false,
"ratio": 3.044971381847915,
"config_test": false,
... |
__author__ = 'e.kolpakov'
class BaseMessage:
def __init__(self):
pass
def process(self, student, until=None):
pass
def time_to_send(self, student):
pass
class SynchronousMessageAdapterMixin:
def process(self, student, until=None):
super(SynchronousMessageAdapterMixi... | {
"repo_name": "e-kolpakov/study-model",
"path": "model/agents/student/messages.py",
"copies": "1",
"size": "1559",
"license": "mit",
"hash": -4067024926074802000,
"line_mean": 22.9846153846,
"line_max": 117,
"alpha_frac": 0.6382296344,
"autogenerated": false,
"ratio": 3.8399014778325125,
"confi... |
__author__ = 'e.kolpakov'
class Fact:
def __init__(self, code, dependencies=None, complexity=1.0):
"""
:param code: str
:param dependencies: list[str] | tuple[str] | None
"""
self._code = code
self._complexity = complexity
self._dependencies = frozenset(depe... | {
"repo_name": "e-kolpakov/study-model",
"path": "model/knowledge_representation/fact.py",
"copies": "1",
"size": "2422",
"license": "mit",
"hash": -4478520489726276000,
"line_mean": 23.9793814433,
"line_max": 104,
"alpha_frac": 0.5553261767,
"autogenerated": false,
"ratio": 3.9704918032786884,
... |
__author__ = 'e.kolpakov'
class TypedDescriptor:
def __init__(self, target_type, label):
self._type = target_type
self._lbl = '_'+label
@property
def _label(self):
return self._lbl
def __get__(self, instance, owner):
if instance is None:
return None
... | {
"repo_name": "e-kolpakov/study-model",
"path": "model/infrastructure/descriptors.py",
"copies": "1",
"size": "1224",
"license": "mit",
"hash": 4740784379833445000,
"line_mean": 28.1428571429,
"line_max": 76,
"alpha_frac": 0.591503268,
"autogenerated": false,
"ratio": 4.25,
"config_test": false... |
__author__ = 'Elahe'
import ephem
import numpy as np
from datetime import datetime
import sqlite3 as lite
def set_data_range(lsst, date, tint):
'''Return numpy array of dates between astronomical twilight'''
ss = set_time(ephem.Date(twilightEve(lsst, date)))
sr = set_time(ephem.Date(twilightMorn(lsst, da... | {
"repo_name": "elahesadatnaghib/FB-Scheduler-v2",
"path": "FieldDataGenerator.py",
"copies": "1",
"size": "4824",
"license": "mit",
"hash": 6504696849036162000,
"line_mean": 30.3246753247,
"line_max": 143,
"alpha_frac": 0.5567993367,
"autogenerated": false,
"ratio": 3.266079891672309,
"config_t... |
__author__ = 'Elahe'
import ephem
import numpy as np
import sqlite3 as lite
import os
def creatFBDE():
# Delete previous database
try:
os.remove('FBDE.db')
except:
pass
inf = 1e10
eps = 1e-10
''' Connect to the FBDE data base '''
con = lite.connect('FBDE.db')
cur = c... | {
"repo_name": "elahesadatnaghib/FB-Scheduler-v2",
"path": "CreateDB.py",
"copies": "1",
"size": "6745",
"license": "mit",
"hash": 8272822415821659000,
"line_mean": 32.8944723618,
"line_max": 138,
"alpha_frac": 0.4133432172,
"autogenerated": false,
"ratio": 3.7472222222222222,
"config_test": fal... |
__author__ = 'Elahe'
import numpy as np
import ephem
from operator import attrgetter
def eval_init_state(fields, suggestion, manual = False): # TODO Feasibility of the initial field needs to be checked
if manual:
return suggestion
else:
#build a vector of all altitudes at t start
... | {
"repo_name": "elahesadatnaghib/FB-Scheduler-v2",
"path": "calculations.py",
"copies": "1",
"size": "15004",
"license": "mit",
"hash": -6819181708545975000,
"line_mean": 41.1488764045,
"line_max": 167,
"alpha_frac": 0.464276193,
"autogenerated": false,
"ratio": 3.349107142857143,
"config_test":... |
__author__ = 'Elahe'
import numpy as np
import ephem
import FBDE
import time
import os.path
#my modules
from UpdateDB import update
from Graphics import visualize
Site = ephem.Observer()
Site.lon = -1.2320792
Site.lat = -0.517781017
Site.elevation = 2650
Site.pressure = 0.
Site.horizon ... | {
"repo_name": "elahesadatnaghib/FB-Scheduler-v2",
"path": "run.py",
"copies": "1",
"size": "2013",
"license": "mit",
"hash": 5413825853252328000,
"line_mean": 25.4868421053,
"line_max": 127,
"alpha_frac": 0.6299056135,
"autogenerated": false,
"ratio": 2.9386861313868615,
"config_test": false,
... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.