text
stringlengths
0
1.05M
meta
dict
__author__ = 'Maxim Dutkin (max@dutkin.ru)' from unittest.mock import MagicMock from tornado.httputil import HTTPServerRequest class OldUserRightsFactory: admin_permissions = ['admin', 'authenticated', ] authenticated_permissions = ['authenticated', ] def __init__(self): self.default_obj = { ...
{ "repo_name": "mdutkin/m2core", "path": "example/tests/helpers.py", "copies": "1", "size": "1451", "license": "mit", "hash": -4059949983086005000, "line_mean": 23.593220339, "line_max": 71, "alpha_frac": 0.5768435562, "autogenerated": false, "ratio": 4.169540229885057, "config_test": false, "...
__author__ = 'Maxim Dutkin (max@dutkin.ru)' import re from m2core.utils.decorators import classproperty class BasePermissionRule(list): operator_char = '' def __new__(cls, *args, **kwargs): return super(BasePermissionRule, cls).__new__(cls, args) def __init__(self, *args): super(BasePe...
{ "repo_name": "mdutkin/m2core", "path": "m2core/common/permissions.py", "copies": "1", "size": "6402", "license": "mit", "hash": 6551209190956901000, "line_mean": 30.8507462687, "line_max": 116, "alpha_frac": 0.5724773508, "autogenerated": false, "ratio": 4.151750972762646, "config_test": false...
__author__ = 'Maxim Dutkin (max@dutkin.ru)' import unittest from m2core import M2Core from m2core.utils.url_parser import UrlParser from m2core.utils.tests import RESTTest from voluptuous import Schema, Error class UrlParserTest(unittest.TestCase, RESTTest): def setUp(self): m2core = M2Core() m...
{ "repo_name": "mdutkin/m2core", "path": "example/tests/core/url_parser_tests.py", "copies": "1", "size": "3712", "license": "mit", "hash": 2145736461602513400, "line_mean": 34.3523809524, "line_max": 88, "alpha_frac": 0.3760775862, "autogenerated": false, "ratio": 3.80327868852459, "config_test...
__author__ = 'Maxime Le Coz' import soundfile as sf from math import sqrt def load_sound(filepath): data, samplerate = sf.read(filepath) if len(data.shape) == 2: data = data[:, 1] print len(data) return data, float(samplerate) def cut(serie, threshold, minlen, minlensil): segments = [] ...
{ "repo_name": "LeCoz/Tiare", "path": "analysers/__init__.py", "copies": "1", "size": "1470", "license": "mit", "hash": -7061765174248223000, "line_mean": 22.3333333333, "line_max": 80, "alpha_frac": 0.5612244898, "autogenerated": false, "ratio": 3.442622950819672, "config_test": false, "has_n...
__author__ = 'Maximilian Kurscheidt @MadMax93' from datetime import datetime import numpy as np class ImportCsv(object): """ Imports 3D acceleration files in .csv format and saves it into a numpy array File format: Timestamp, X-Value, Y-Value, Z-Value """ def __init__(self, path): self....
{ "repo_name": "MadMax93/acc_sensor_rr-python", "path": "Code/ImportCsv.py", "copies": "1", "size": "1708", "license": "mit", "hash": -4196182147905796600, "line_mean": 38.7209302326, "line_max": 124, "alpha_frac": 0.6586651054, "autogenerated": false, "ratio": 3.855530474040632, "config_test": ...
__author__ = 'Maximilian Kurscheidt @MadMax93' import matplotlib.dates as mdates import matplotlib.pyplot as plt import numpy as np import scipy.signal as signal import peakutils import matplotlib.gridspec as gridspec from peakutils.plot import plot as pplot from matplotlib.offsetbox import AnchoredText class Visual...
{ "repo_name": "MadMax93/acc_sensor_rr-python", "path": "Code/Visualization.py", "copies": "1", "size": "9091", "license": "mit", "hash": -5294966991838290000, "line_mean": 39.0528634361, "line_max": 167, "alpha_frac": 0.5749642504, "autogenerated": false, "ratio": 2.946839546191248, "config_tes...
__author__ = 'Maximilian Kurscheidt @MadMax93' import numpy as np import peakutils import scipy.signal as signal from scipy.fftpack import fft class Signalprocessing(object): def butter_bandpass_design(self, low_cut, high_cut, sample_rate, order=4): """ Defines the Butterworth bandpass filter-des...
{ "repo_name": "MadMax93/acc_sensor_rr-python", "path": "Code/Signalprocessing.py", "copies": "1", "size": "4806", "license": "mit", "hash": 2761122691648790000, "line_mean": 36.2558139535, "line_max": 137, "alpha_frac": 0.6190178943, "autogenerated": false, "ratio": 3.8142857142857145, "config_...
__author__ = 'Maximilian Kurscheidt @MadMax93' import os import matplotlib.pyplot as plt from Code import ImportCsv from Code import Signalprocessing from Code import Visualization SAMPLE_RATE = 50 LOW_CUT = 0.2 HIGH_CUT = 0.45 class Main(object): import_csv = None visualization = Visualization.Visualiza...
{ "repo_name": "MadMax93/acc_sensor_rr-python", "path": "Code/Main.py", "copies": "1", "size": "4179", "license": "mit", "hash": 485017140834940900, "line_mean": 43.4680851064, "line_max": 197, "alpha_frac": 0.661641541, "autogenerated": false, "ratio": 3.314036478984933, "config_test": false, ...
__author__ = 'maximmillen' import numpy as np from sfsimodels import models def add_inputs_to_object(obj, values): """ A generic function to load object parameters based on a dictionary list. Parameters ---------- obj: object values: dict """ for item in obj.inputs: if hasatt...
{ "repo_name": "eng-tools/sfsimodels", "path": "sfsimodels/loader.py", "copies": "1", "size": "3671", "license": "mit", "hash": 8032523411958261000, "line_mean": 22.9934640523, "line_max": 76, "alpha_frac": 0.5802233724, "autogenerated": false, "ratio": 2.8837391987431267, "config_test": false, ...
__author__ = 'Maxim.Rumyantsev' # -*- coding: utf-8 -*- from sys import maxsize import string class Group: def __init__(self, name=None, header=None, footer=None, id=None): self.name=name self.header=header ...
{ "repo_name": "maximencia/python_traning", "path": "model/group.py", "copies": "1", "size": "1480", "license": "apache-2.0", "hash": 6456056408678093000, "line_mean": 32, "line_max": 121, "alpha_frac": 0.57996633, "autogenerated": false, "ratio": 2.2247191011235956, "config_test": false, "has...
__author__ = 'Maxim.Rumyantsev' # -*- coding: utf-8 -*- from sys import maxsize class Contact: def __init__(self,firstname=None, middlename=None, lastname=None, nickname=None, title=None, company=None, address=None, home=None,mobile=None,work=None,fax=None,email1=None,email2=None,email3=...
{ "repo_name": "maximencia/python_traning", "path": "model/contact.py", "copies": "1", "size": "2342", "license": "apache-2.0", "hash": -788438851333814900, "line_mean": 32.8813559322, "line_max": 153, "alpha_frac": 0.6224489796, "autogenerated": false, "ratio": 2.6796875, "config_test": false, ...
__author__ = 'max' __author__ = 'Sebastian' class State(object): """ Generic cell state objects. These can be used and produced by processes during simulation. """ def __init__(self, id, name): """ @param id: state id @param name: state name """ self.__id = id...
{ "repo_name": "fugufisch/wholecell", "path": "state/state.py", "copies": "1", "size": "1399", "license": "mit", "hash": -400588486031600260, "line_mean": 21.2222222222, "line_max": 115, "alpha_frac": 0.5875625447, "autogenerated": false, "ratio": 4.39937106918239, "config_test": false, "has_n...
__author__ = 'Max' class SessionHelper: def __init__(self,app): self.app = app def login(self,user_name, password): wd = self.app.wd wd.get("http://localhost/addressbook/") wd.find_element_by_id("LoginForm").click() wd.find_element_by_name("user").click() wd.fi...
{ "repo_name": "mihushynmaksym/Python_Training", "path": "fixture/sesion.py", "copies": "1", "size": "1508", "license": "apache-2.0", "hash": -8247999910435664000, "line_mean": 30.4166666667, "line_max": 91, "alpha_frac": 0.5603448276, "autogenerated": false, "ratio": 3.343680709534368, "config_...
__author__ = 'max' from datetime import datetime def solr_now(): """ Get the current time in UTC and format it in a way that Solr can digest. :return: A Solr-digestible time format :rtype: str """ return datetime.utcnow().isoformat() + 'Z' class ModelField(object): pass class AutoDat...
{ "repo_name": "Sendhub/drow", "path": "drow/fields.py", "copies": "1", "size": "2263", "license": "mit", "hash": -4788299127103738000, "line_mean": 30, "line_max": 76, "alpha_frac": 0.6239505082, "autogenerated": false, "ratio": 4.294117647058823, "config_test": false, "has_no_keywords": fals...
__author__ = 'max' from mock import MagicMock from time import time def create_mock_riak_object(key=None, update_time=None): riak_object = MagicMock() riak_object.key = key riak_object.exists = True riak_object.data = None riak_object.encoded_data = None riak_object.content_type = 'applicatio...
{ "repo_name": "Sendhub/drow", "path": "drow/tests/mockriak.py", "copies": "1", "size": "1948", "license": "mit", "hash": -5606370837211962000, "line_mean": 26.8285714286, "line_max": 64, "alpha_frac": 0.6483572895, "autogenerated": false, "ratio": 3.3644214162348876, "config_test": false, "ha...
__author__ = 'max' from riak import RiakError from errors import InvalidPatch from errors import DoesNotExist from errors import SearchError class QuerySet(object): """ Queries the database and returns instances of the associated Model """ def search(self, query, start=0, rows=20): """ ...
{ "repo_name": "Sendhub/drow", "path": "drow/queryset.py", "copies": "1", "size": "10065", "license": "mit", "hash": -2920983283093804500, "line_mean": 32, "line_max": 79, "alpha_frac": 0.5725782414, "autogenerated": false, "ratio": 4.408672798948752, "config_test": false, "has_no_keywords": f...
__author__ = 'max' from state import State import sys from data.knowledgebase import Knowledgebase class SingleGene(State, object): """ Storing the information related to each single gene of the database """ def __init__(self, gene_by_row): super(SingleGene, self).__init__(gene_by_row["WholeCe...
{ "repo_name": "fugufisch/wholecell", "path": "state/gene.py", "copies": "1", "size": "3407", "license": "mit", "hash": -1697510587462190600, "line_mean": 27.8813559322, "line_max": 118, "alpha_frac": 0.5978867038, "autogenerated": false, "ratio": 3.8804100227790435, "config_test": false, "has...
__author__ = 'max' from tensorflow.python.platform import gfile from instance import DependencyInstance import data_utils class Reader(object): def __init__(self, file_path, word_alphabet, pos_alphabet, type_alphabet): self.__source_file = gfile.GFile(file_path, mode='r') self.__word_alphabet = ...
{ "repo_name": "XuezheMax/ReLiefParser", "path": "reliefparser/io/reader.py", "copies": "1", "size": "2037", "license": "mit", "hash": -6123795162561714000, "line_mean": 31.8548387097, "line_max": 94, "alpha_frac": 0.5773195876, "autogenerated": false, "ratio": 3.7171532846715327, "config_test":...
__author__ = 'max' from unittest import TestCase from mock import patch from mock import MagicMock import jsonpatch from mockriak import create_mock_riak_client from drow import models from drow.fields import AutoDateField from drow.fields import DefaultFalseField class FakeModelContext(object): def __enter__(se...
{ "repo_name": "Sendhub/drow", "path": "drow/tests/test_fields.py", "copies": "1", "size": "3326", "license": "mit", "hash": 1589615088749440300, "line_mean": 33.2886597938, "line_max": 74, "alpha_frac": 0.5886951293, "autogenerated": false, "ratio": 4.302716688227684, "config_test": true, "ha...
__author__ = 'max' """ Implementation of Bi-directional LSTM-CNNs-CRF model for sequence labeling. """ import time import sys import argparse import numpy as np import lasagne import theano import theano.tensor as T from lasagne.layers import Gate from lasagne import nonlinearities from lasagne.updates import nestero...
{ "repo_name": "adapt-sjtu/novelner", "path": "NeuroNLP/parsing.py", "copies": "2", "size": "28031", "license": "apache-2.0", "hash": 4322829126468821000, "line_mean": 53.0096339114, "line_max": 120, "alpha_frac": 0.601013164, "autogenerated": false, "ratio": 3.5073823823823824, "config_test": t...
__author__ = 'max' import gpxpy import pandas as pd def parse_gpx(gpx_file_name): return gpxpy.parse(gpx_file_name) def data_frame_for_track_segment(segment): seg_dict = {} for point in segment.points: seg_dict[point.time] = [point.latitude, point.longitude, poi...
{ "repo_name": "komax/gpx-pandas", "path": "gpxpandas/gpxreader.py", "copies": "1", "size": "1174", "license": "mit", "hash": -7749736606362709000, "line_mean": 29.1025641026, "line_max": 76, "alpha_frac": 0.6669505963, "autogenerated": false, "ratio": 3.4127906976744184, "config_test": false, ...
__author__ = 'max' import lasagne import lasagne.nonlinearities as nonlinearities from lasagne.layers import Gate from lasagne_nlp.networks.crf import CRFLayer from lasagne_nlp.networks.highway import HighwayDenseLayer def build_BiRNN(incoming, num_units, mask=None, grad_clipping=0, nonlinearity=nonlinearities.tanh,...
{ "repo_name": "XuezheMax/LasagneNLP", "path": "lasagne_nlp/networks/networks.py", "copies": "1", "size": "16251", "license": "apache-2.0", "hash": -1740599288784127500, "line_mean": 56.8327402135, "line_max": 132, "alpha_frac": 0.6474678481, "autogenerated": false, "ratio": 3.616959715112397, "...
__author__ = 'max' import logging import sys import numpy as np import lasagne from gensim.models.word2vec import Word2Vec import gzip import theano def get_logger(name, level=logging.INFO, handler=sys.stdout, formatter='%(asctime)s - %(name)s - %(levelname)s - %(message)s'): logger = logging.getL...
{ "repo_name": "XuezheMax/LasagneNLP", "path": "lasagne_nlp/utils/utils.py", "copies": "1", "size": "6567", "license": "apache-2.0", "hash": 5266217821923569000, "line_mean": 38.5602409639, "line_max": 117, "alpha_frac": 0.6078879245, "autogenerated": false, "ratio": 3.8880994671403197, "config_...
__author__ = 'max' import logging import sys import pickle import numpy as np from gensim.models.word2vec import Word2Vec import gzip import theano from .io import data_utils def load_word_embedding_dict(embedding, embedding_path, normalize_digits=True): """ load word embeddings from file :param embeddi...
{ "repo_name": "XuezheMax/NeuroNLP", "path": "neuronlp/utils.py", "copies": "1", "size": "3902", "license": "mit", "hash": 383571695536377860, "line_mean": 36.8834951456, "line_max": 98, "alpha_frac": 0.5310097386, "autogenerated": false, "ratio": 3.8481262327416172, "config_test": false, "has...
__author__ = 'max' import logging import sys def get_logger(name, level=logging.INFO, handler=sys.stdout, formatter='%(asctime)s - %(name)s - %(levelname)s - %(message)s'): logger = logging.getLogger(name) logger.setLevel(logging.INFO) formatter = logging.Formatter(formatter) stream_ha...
{ "repo_name": "XuezheMax/ReLiefParser", "path": "reliefparser/utils.py", "copies": "1", "size": "1329", "license": "mit", "hash": -8531297318052652000, "line_mean": 30.6666666667, "line_max": 98, "alpha_frac": 0.6072234763, "autogenerated": false, "ratio": 3.434108527131783, "config_test": fals...
__author__ = 'max' import numpy as np import theano import theano.tensor as T from .nlinalg import theano_logsumexp, logabsdet __all__ = [ "chain_crf_loss", "chain_crf_accuracy", "tree_crf_loss", ] def chain_crf_loss(energies, targets, masks): """ compute minus log likelihood of chain crf as cha...
{ "repo_name": "adapt-sjtu/novelner", "path": "NeuroNLP/neuronlp/objectives.py", "copies": "2", "size": "8135", "license": "apache-2.0", "hash": 5041068956902048000, "line_mean": 39.2722772277, "line_max": 116, "alpha_frac": 0.6264290104, "autogenerated": false, "ratio": 3.265756724207146, "conf...
__author__ = 'max' import numpy as np import theano from alphabet import Alphabet from lasagne_nlp.utils import utils as utils root_symbol = "##ROOT##" root_label = "<ROOT>" word_end = "##WE##" MAX_LENGTH = 130 MAX_CHAR_LENGTH = 45 logger = utils.get_logger("LoadData") def read_conll_sequence_labeling(path, word_a...
{ "repo_name": "XuezheMax/LasagneNLP", "path": "lasagne_nlp/utils/data_processor.py", "copies": "1", "size": "27450", "license": "apache-2.0", "hash": -7501625748277732000, "line_mean": 43.1318327974, "line_max": 136, "alpha_frac": 0.5679417122, "autogenerated": false, "ratio": 3.7680164722031573,...
__author__ = 'max' import numpy as np NEGTIVE_REWARD = -1 class Environment(object): def __init__(self, heads, marks): assert heads.ndim == 2 assert marks.ndim == 2 self.__batch_size = heads.shape[0] self.__length = heads.shape[1] self.__sizes = marks.sum(axis=1) ...
{ "repo_name": "XuezheMax/ReLiefParser", "path": "reliefparser/environment/environment.py", "copies": "1", "size": "5171", "license": "mit", "hash": -2877240056459081000, "line_mean": 37.0220588235, "line_max": 105, "alpha_frac": 0.4732160124, "autogenerated": false, "ratio": 3.571132596685083, ...
__author__ = 'max' import numpy class BioMolecule: """ A generic molecule that has basic attributes like name and mass. @type name: str @type mass: float """ def __init__(self, mid, name, mass=0): self.mid = mid #id ? self.name = name self.mas...
{ "repo_name": "tbphu/fachkurs_2016_project", "path": "molecules.py", "copies": "1", "size": "14472", "license": "mit", "hash": 6145018905535259000, "line_mean": 29.9871520343, "line_max": 143, "alpha_frac": 0.5868979338, "autogenerated": false, "ratio": 3.936615886833515, "config_test": false, ...
__author__ = 'max' import numpy import theano import theano.tensor as T from theano.tensor import as_tensor_variable from theano.gof import Op, Apply from theano.tensor.nlinalg import matrix_inverse, matrix_dot __all__ = [ "LogAbsDet", "logabsdet", "theano_logsumexp", ] class LogAbsDet(Op): """ ...
{ "repo_name": "adapt-sjtu/novelner", "path": "NeuroNLP/neuronlp/nlinalg/nlinalg.py", "copies": "2", "size": "1921", "license": "apache-2.0", "hash": -3459330184842843000, "line_mean": 24.6133333333, "line_max": 75, "alpha_frac": 0.5892764185, "autogenerated": false, "ratio": 3.486388384754991, ...
__author__ = 'max' import os.path import re import random import numpy as np from .reader import CoNLLReader from .alphabet import Alphabet from .logger import get_logger # Special vocabulary symbols - we always put them at the start. ROOT = b"_ROOT" ROOT_POS = b"_ROOT_POS" ROOT_TYPE = b"_<ROOT>" ROOT_CHAR = b"_ROOT_...
{ "repo_name": "adapt-sjtu/novelner", "path": "NeuroNLP/neuronlp/io/data_utils.py", "copies": "1", "size": "8775", "license": "apache-2.0", "hash": 4055397493566305300, "line_mean": 36.3404255319, "line_max": 115, "alpha_frac": 0.5914529915, "autogenerated": false, "ratio": 3.407766990291262, "c...
__author__ = 'max' import re import numpy as np def is_uni_punctuation(word): match = re.match("^[^\w\s]+$]", word, flags=re.UNICODE) return match is not None def is_punctuation(word, pos, punct_set=None): if punct_set is None: return is_uni_punctuation(word) else: return pos in punc...
{ "repo_name": "XuezheMax/NeuroNLP", "path": "neuronlp/tasks/parser.py", "copies": "1", "size": "8277", "license": "mit", "hash": 5286137575626390000, "line_mean": 30.4714828897, "line_max": 118, "alpha_frac": 0.4714268455, "autogenerated": false, "ratio": 3.550836550836551, "config_test": false...
__author__ = 'max' import re import numpy as np from hanlp.metrics.metric import Metric def is_uni_punctuation(word): match = re.match("^[^\w\s]+$]", word, flags=re.UNICODE) return match is not None def is_punctuation(word, pos, punct_set=None): if punct_set is None: # Maybe use ispunct ...
{ "repo_name": "hankcs/HanLP", "path": "hanlp/components/parsers/hpsg/dep_eval.py", "copies": "1", "size": "2872", "license": "apache-2.0", "hash": 2488065963378083300, "line_mean": 26.0943396226, "line_max": 104, "alpha_frac": 0.5045264624, "autogenerated": false, "ratio": 3.451923076923077, "c...
__author__ = 'max' import re import random import numpy as np from tensorflow.python.platform import gfile from reader import Reader from alphabet import Alphabet from .. import utils # Special vocabulary symbols - we always put them at the start. ROOT = b"_ROOT" ROOT_POS = b"_ROOT_POS" ROOT_TYPE = b"_<ROOT>" PAD = b...
{ "repo_name": "XuezheMax/ReLiefParser", "path": "reliefparser/io/data_utils.py", "copies": "1", "size": "7413", "license": "mit", "hash": -573655958545914940, "line_mean": 35.1609756098, "line_max": 116, "alpha_frac": 0.5936867665, "autogenerated": false, "ratio": 3.470505617977528, "config_tes...
__author__ = 'max' import socket import sys import threading import time from conn_manager import ConnManager class Server(threading.Thread): HOST = '0.0.0.0' PORT = 8888 def __init__(self, host=HOST, port=PORT, max_conn=100): super(Server, self).__init__() self.host = host self....
{ "repo_name": "sk91/simplentp", "path": "simplentp/server/server.py", "copies": "1", "size": "1467", "license": "mit", "hash": 3160655534268335000, "line_mean": 24.7368421053, "line_max": 87, "alpha_frac": 0.5739604635, "autogenerated": false, "ratio": 3.870712401055409, "config_test": false, ...
__author__ = 'max' import sys import time from server import server import signal from client import client def run_server(host, port): host = host if host else server.Server.HOST port = port if port else server.Server.PORT serv = server.Server(host, port) serv.start() return serv def run_clie...
{ "repo_name": "sk91/simplentp", "path": "simplentp/__main__.py", "copies": "1", "size": "2229", "license": "mit", "hash": -8590055385439655000, "line_mean": 22.4631578947, "line_max": 77, "alpha_frac": 0.5697622252, "autogenerated": false, "ratio": 3.836488812392427, "config_test": false, "ha...
__author__ = 'max' import theano from lasagne.random import get_rng from theano.sandbox.rng_mrg import MRG_RandomStreams as RandomStreams from lasagne.layers import Layer __all__ = [ "GaussianDropoutLayer", ] class GaussianDropoutLayer(Layer): """Gaussian Dropout layer Multiply values by gaussian varia...
{ "repo_name": "XuezheMax/NeuroNLP", "path": "neuronlp/layers/dropout.py", "copies": "2", "size": "1636", "license": "mit", "hash": 7150071743729556000, "line_mean": 30.4615384615, "line_max": 116, "alpha_frac": 0.6393643032, "autogenerated": false, "ratio": 4.397849462365591, "config_test": fal...
__author__ = 'max' import theano.tensor as T import numpy as np from lasagne import init from lasagne.layers import Layer import lasagne.nonlinearities as nonlinearities __all__ = [ "HighwayDenseLayer", ] class HighwayDenseLayer(Layer): """ lasagne_nlp.networks.highway.HighwayDenseLayer(incoming, W_h=in...
{ "repo_name": "XuezheMax/LasagneNLP", "path": "lasagne_nlp/networks/highway.py", "copies": "3", "size": "3869", "license": "apache-2.0", "hash": 6020527581726232000, "line_mean": 40.1595744681, "line_max": 109, "alpha_frac": 0.6391832515, "autogenerated": false, "ratio": 3.782013685239492, "con...
__author__ = 'max' import theano.tensor as T from lasagne import init from lasagne.layers import MergeLayer __all__ = [ "ChainCRFLayer", "TreeAffineCRFLayer", "TreeBiAffineCRFLayer", ] class ChainCRFLayer(MergeLayer): """ ChainCRFLayer(incoming, num_labels, mask_input=None, W=init.GlorotUniform...
{ "repo_name": "adapt-sjtu/novelner", "path": "NeuroNLP/neuronlp/layers/crf.py", "copies": "2", "size": "12592", "license": "apache-2.0", "hash": -5162687243154103000, "line_mean": 42.1232876712, "line_max": 117, "alpha_frac": 0.5901365947, "autogenerated": false, "ratio": 3.579306424104605, "co...
__author__ = 'max' import theano.tensor as T from lasagne import init from lasagne.layers import MergeLayer class CRFLayer(MergeLayer): """ lasagne_nlp.networks.crf.CRFLayer(incoming, num_labels, mask_input=None, W=init.GlorotUniform(), b=init.Constant(0.), **kwargs) Parameters ---------- i...
{ "repo_name": "XuezheMax/LasagneNLP", "path": "lasagne_nlp/networks/crf.py", "copies": "1", "size": "4409", "license": "apache-2.0", "hash": 388503183180726500, "line_mean": 42.6534653465, "line_max": 117, "alpha_frac": 0.6169199365, "autogenerated": false, "ratio": 3.870939420544337, "config_t...
__author__ = 'max' import theano.tensor as T from lasagne import init from lasagne.theano_extensions import conv from lasagne.layers import Conv1DLayer, Layer, InputLayer, helper from lasagne import nonlinearities __all__ = [ "ConvTimeStep1DLayer", ] class ConvTimeStep1DLayer(Layer): """ CNN with time ...
{ "repo_name": "XuezheMax/NeuroNLP", "path": "neuronlp/layers/conv.py", "copies": "2", "size": "7382", "license": "mit", "hash": -7373496228209257000, "line_mean": 43.2035928144, "line_max": 120, "alpha_frac": 0.6490111081, "autogenerated": false, "ratio": 4.196702671972711, "config_test": false...
__author__ = 'max' import theano.tensor as T from lasagne.layers import MergeLayer from lasagne import init import lasagne.nonlinearities as nonlinearities from theano.tensor.sort import argsort __all__ = [ "GraphConvLayer", ] class GraphConvLayer(MergeLayer): """ lasagne_nlp.networks.graph.GraphConvLa...
{ "repo_name": "XuezheMax/LasagneNLP", "path": "lasagne_nlp/networks/graph.py", "copies": "3", "size": "6385", "license": "apache-2.0", "hash": 3264664757309947000, "line_mean": 43.9647887324, "line_max": 124, "alpha_frac": 0.6366483947, "autogenerated": false, "ratio": 3.834834834834835, "confi...
__author__ = 'max' import theano.tensor as T from lasagne.layers import MergeLayer from lasagne import init __all__ = [ "DepParserLayer", ] class DepParserLayer(MergeLayer): """ """ def __init__(self, incoming, num_labels, mask_input=None, W_h=init.GlorotUniform(), W_c=init.GlorotUniform(), ...
{ "repo_name": "XuezheMax/LasagneNLP", "path": "lasagne_nlp/networks/parser.py", "copies": "1", "size": "3727", "license": "apache-2.0", "hash": -8466787519520523000, "line_mean": 37.0306122449, "line_max": 113, "alpha_frac": 0.5744566676, "autogenerated": false, "ratio": 3.492970946579194, "con...
__author__ = 'max' import theano.tensor as T from lasagne.utils import as_tuple from lasagne.layers import Pool1DLayer __all__ = [ "PoolTimeStep1DLayer", ] class PoolTimeStep1DLayer(Pool1DLayer): """ Pool with time step at axis=1. The input shape should be [batch_size, n-step, num_input_channels, input...
{ "repo_name": "adapt-sjtu/novelner", "path": "NeuroNLP/neuronlp/layers/pool.py", "copies": "2", "size": "2848", "license": "apache-2.0", "hash": -3793149256560490000, "line_mean": 35.987012987, "line_max": 116, "alpha_frac": 0.6155196629, "autogenerated": false, "ratio": 3.838274932614555, "con...
__author__ = 'max' import time import socket import select import sys import threading from time_sender import TimeSender from master_time import MasterTimeRecv class Client(threading.Thread): def __init__(self, host="127.0.0.1", port=8888): super(Client, self).__init__() self.timeSender = TimeS...
{ "repo_name": "sk91/simplentp", "path": "simplentp/client/client.py", "copies": "1", "size": "2107", "license": "mit", "hash": 4650471931920953000, "line_mean": 27.0933333333, "line_max": 106, "alpha_frac": 0.5885144756, "autogenerated": false, "ratio": 3.967984934086629, "config_test": false, ...
__author__ = 'max' import time import sys import argparse from lasagne_nlp.utils import utils from lasagne_nlp.utils.regularization import dima import lasagne_nlp.utils.data_processor as data_processor import theano.tensor as T import theano import lasagne from lasagne_nlp.networks.networks import build_BiRNN import l...
{ "repo_name": "XuezheMax/LasagneNLP", "path": "bi_rnn.py", "copies": "1", "size": "13596", "license": "apache-2.0", "hash": -8837931107029125000, "line_mean": 47.9064748201, "line_max": 138, "alpha_frac": 0.6008384819, "autogenerated": false, "ratio": 3.6905537459283386, "config_test": true, ...
__author__ = 'max' import time import sys import argparse from lasagne_nlp.utils import utils import lasagne_nlp.utils.data_processor as data_processor import theano.tensor as T import theano import lasagne from lasagne_nlp.networks.networks import build_BiLSTM_CNN import lasagne.nonlinearities as nonlinearities def...
{ "repo_name": "XuezheMax/LasagneNLP", "path": "bi_lstm_cnn.py", "copies": "1", "size": "15385", "license": "apache-2.0", "hash": -2835265882632765400, "line_mean": 50.1129568106, "line_max": 153, "alpha_frac": 0.5944751381, "autogenerated": false, "ratio": 3.717081420633003, "config_test": true...
__author__ = 'max' """ Layers to construct recurrent networks. Recurrent layers can be used similarly to feed-forward layers except that the input shape is expected to be ``(batch_size, sequence_length, num_inputs)``. The implementation """ import numpy as np import theano import theano.tensor as T from lasagne import...
{ "repo_name": "adapt-sjtu/novelner", "path": "NeuroNLP/neuronlp/layers/recurrent.py", "copies": "1", "size": "58653", "license": "apache-2.0", "hash": -9006245905739404000, "line_mean": 44.5734265734, "line_max": 109, "alpha_frac": 0.5874720816, "autogenerated": false, "ratio": 4.0350165107319755...
__author__ = 'max' """ Alphabet maps objects to integer ids. It provides two way mapping from the index to the objects. """ import json import os from .. import utils class Alphabet(object): def __init__(self, name, keep_growing=True): self.__name = name self.instance2index = {} self.ins...
{ "repo_name": "XuezheMax/ReLiefParser", "path": "reliefparser/io/alphabet.py", "copies": "1", "size": "3378", "license": "mit", "hash": -6658582945475870000, "line_mean": 31.7961165049, "line_max": 116, "alpha_frac": 0.5959147425, "autogenerated": false, "ratio": 4.165228113440198, "config_test...
__author__ = 'max' """ Alphabet maps objects to integer ids. It provides two way mapping from the index to the objects. """ import json import os from .logger import get_logger class Alphabet(object): def __init__(self, name, keep_growing=True): self.__name = name self.instance2index = {} ...
{ "repo_name": "XuezheMax/NeuroNLP", "path": "neuronlp/io/alphabet.py", "copies": "2", "size": "3381", "license": "mit", "hash": -2499104638090653700, "line_mean": 32.1470588235, "line_max": 116, "alpha_frac": 0.5968648329, "autogenerated": false, "ratio": 4.163793103448276, "config_test": false...
__author__ = 'max' """ Alphabet maps objects to integer ids. It provides two way mapping from the index to the objects. """ import json import os from lasagne_nlp.utils import utils as utils class Alphabet: def __init__(self, name, keep_growing=True): self.__name = name self.instance2index = {}...
{ "repo_name": "XuezheMax/LasagneNLP", "path": "lasagne_nlp/utils/alphabet.py", "copies": "1", "size": "3173", "license": "apache-2.0", "hash": -2768395283755374600, "line_mean": 31.3775510204, "line_max": 116, "alpha_frac": 0.6032146234, "autogenerated": false, "ratio": 4.153141361256544, "conf...
__author__ = 'max' """ Alphabet maps objects to integer ids. It provides two way mapping from the index to the objects. """ import json import os import utils as utils class Alphabet: def __init__(self, name, keep_growing=True): self.__name = name self.instance2index = {} self.instances...
{ "repo_name": "adapt-sjtu/novelner", "path": "NN_NER_tensorFlow/alphabet.py", "copies": "1", "size": "3221", "license": "apache-2.0", "hash": -82853601847652020, "line_mean": 31.5353535354, "line_max": 116, "alpha_frac": 0.6047811239, "autogenerated": false, "ratio": 4.150773195876289, "config_...
__author__ = 'max' class BioMolecule(object): """ A generic molecule that has basic attributes like id, name and mass. @type mid: int @type name: str @type mass: float """ def __init__(self, mid, name, mass=0): self.__mid = mid self.name = name self.mass = mass...
{ "repo_name": "WeirdCircumstances/hu_bp_python_course", "path": "Project/molecules.py", "copies": "1", "size": "4461", "license": "mit", "hash": -5511422685301097000, "line_mean": 25.0935672515, "line_max": 102, "alpha_frac": 0.5886572517, "autogenerated": false, "ratio": 3.5098347757671124, "c...
__author__ = 'max' from instance import DependencyInstance import data_utils class CoNLLReader(object): def __init__(self, file_path, word_alphabet, char_alphabet, pos_alphabet, type_alphabet): self.__source_file = open(file_path, 'r') self.__word_alphabet = word_alphabet self.__char_alp...
{ "repo_name": "XuezheMax/NeuroNLP", "path": "neuronlp/io/reader.py", "copies": "1", "size": "2709", "license": "mit", "hash": -734667486544699400, "line_mean": 32.8625, "line_max": 117, "alpha_frac": 0.5622000738, "autogenerated": false, "ratio": 3.675712347354138, "config_test": false, "has_...
import numpy as np from random import choice import networkx as nx def within_community_degree(weighted_partition, edgeless = np.nan, catch_edgeless_node=True): ''' Computes "within-module degree" (z-score) for each node (Guimera 2005, Nature) ------ Parameters ------ weighted_partition: Louvain ...
{ "repo_name": "nipy/brainx", "path": "brainx/nodal_roles.py", "copies": "1", "size": "3566", "license": "bsd-3-clause", "hash": 7920551927316949000, "line_mean": 39.0674157303, "line_max": 94, "alpha_frac": 0.6374088615, "autogenerated": false, "ratio": 4.103567318757192, "config_test": false, ...
import numpy as np from random import choice import networkx as nx def within_community_degree(weighted_partition, nan = 0.0, catch_edgeless_node=True): ''' Computes "within-module degree" (z-score) for each node (Guimera 2007, J Stat Mech) ------ Parameters ------ weighted_partition: Louvain Wei...
{ "repo_name": "jrcohen02/brainx_archive2", "path": "brainx/nodal_roles.py", "copies": "1", "size": "3465", "license": "bsd-3-clause", "hash": -4180689747965515300, "line_mean": 37.5, "line_max": 91, "alpha_frac": 0.6268398268, "autogenerated": false, "ratio": 4.038461538461538, "config_test": f...
__author__ = 'm.bashari' import numpy as np from sklearn import datasets, linear_model import matplotlib.pyplot as plt # Generate a dataset and plot it def generate_data(): np.random.seed(0) X, y = datasets.make_moons(200, noise=0.20) plt.scatter(X[:,0], X[:,1], s=40, c=y, cmap=plt.cm.Spectral) # Train th...
{ "repo_name": "matthijsvk/multimodalSR", "path": "code/Experiments/Tutorials/nn-from-scratch/linReg_classification.py", "copies": "1", "size": "1570", "license": "mit", "hash": 2686959025002732000, "line_mean": 29.1923076923, "line_max": 80, "alpha_frac": 0.621656051, "autogenerated": false, "rat...
__author__ = 'm.bashari' import numpy as np from sklearn import datasets, linear_model import matplotlib.pyplot as plt def generate_data(): # np.random.seed(0) # X, y = datasets.make_moons(200, noise=0.20) N = 100 # number of points per class D = 2 # dimensionality K = 3 # number of classes ...
{ "repo_name": "matthijsvk/multimodalSR", "path": "code/Experiments/Tutorials/nn-from-scratch/simple_classification.py", "copies": "1", "size": "1855", "license": "mit", "hash": -8905488869856734000, "line_mean": 29.4262295082, "line_max": 82, "alpha_frac": 0.5676549865, "autogenerated": false, "r...
__author__ = 'm.bashari' import numpy as np from sklearn import datasets, linear_model import matplotlib.pyplot as plt def generate_data(): np.random.seed(0) X, y = datasets.make_moons(200, noise=0.20) return X, y def visualize(X, y, clf): # plt.scatter(X[:, 0], X[:, 1], s=40, c=y, cmap=plt.cm.Spect...
{ "repo_name": "gittyRavi/NNChess", "path": "NN_example_new/simple_classification.py", "copies": "1", "size": "1363", "license": "mit", "hash": -7852556297469426000, "line_mean": 26.26, "line_max": 80, "alpha_frac": 0.5972120323, "autogenerated": false, "ratio": 2.839583333333333, "config_test":...
__author__ = 'MBlaauw' if __name__ == "__main__": reload(sys) sys.setdefaultencoding("utf-8") import pandas as pd from pandas import concat import numpy as np from bs4 import BeautifulSoup from urllib2 import urlopen # Reviews # https://boekenliefde.nl/edition_reviews_get.api?key=47L0ss6cDInejrV8SpJmPk4AgxEZT...
{ "repo_name": "mblaauw/CollectDutchBookFeatures", "path": "scrapeBoekenLiefde.py", "copies": "1", "size": "3888", "license": "mit", "hash": 7061392752499528000, "line_mean": 32.5172413793, "line_max": 212, "alpha_frac": 0.6723251029, "autogenerated": false, "ratio": 3.452930728241563, "config_t...
__author__ = 'MBlaauw' if __name__ == "__main__": reload(sys) sys.setdefaultencoding("utf-8") import re import pandas as pd from bs4 import BeautifulSoup from urllib2 import urlopen # http://www.crimezone.nl/web/Titels/Verschenen.htm?pagenr=1&queryElement=592958&sorton=rating%20desc # http://www.crimezone.nl/w...
{ "repo_name": "mblaauw/CollectDutchBookFeatures", "path": "scrapeCrimeZoneNL.py", "copies": "1", "size": "3070", "license": "mit", "hash": -5205651569743251000, "line_mean": 31.670212766, "line_max": 132, "alpha_frac": 0.619218241, "autogenerated": false, "ratio": 3.2079414838035527, "config_te...
__author__ = 'MBlaauw' #import libraries import os import cv2 import numpy as np from scipy.sparse import lil_matrix from scipy.stats import expon from sklearn.decomposition import RandomizedPCA from sklearn import cross_validation from sklearn import svm from sklearn import metrics from sklearn import preprocessing ...
{ "repo_name": "mblaauw/Kaggle_CatsVsDogs", "path": "wacax/CatsDogsBernoulli.py", "copies": "1", "size": "7601", "license": "mit", "hash": -8582476184963308000, "line_mean": 33.2432432432, "line_max": 160, "alpha_frac": 0.7300355216, "autogenerated": false, "ratio": 3.0823195458231956, "config_t...
__author__ = 'MBlaauw' print(__doc__) # Author: Gael Varoquaux gael.varoquaux@normalesup.org # License: BSD 3 clause import datetime import numpy as np import pylab as pl from matplotlib import finance from matplotlib.collections import LineCollection from sklearn import cluster, covariance, manifold ############...
{ "repo_name": "mblaauw/CollectDutchBookFeatures", "path": "test.py", "copies": "1", "size": "6100", "license": "mit", "hash": -6280553559905134000, "line_mean": 29.8080808081, "line_max": 79, "alpha_frac": 0.5759016393, "autogenerated": false, "ratio": 3.131416837782341, "config_test": false, ...
__author__ = 'MBlaauw' #!/usr/bin/env python # coding: utf-8 """ prediction code without batches see http://fastml.com/how-to-get-predictions-from-pylearn2/ author: Zygmunt Zając """ import sys import os import numpy as np import cPickle as pickle from pylearn2.utils import serial from theano import tensor as T from...
{ "repo_name": "mblaauw/Kaggle_CatsVsDogs", "path": "kastnerkyle/predict_no_batches.py", "copies": "1", "size": "1206", "license": "mit", "hash": -5020480294041311000, "line_mean": 19.0833333333, "line_max": 99, "alpha_frac": 0.6871369295, "autogenerated": false, "ratio": 2.7829099307159355, "co...
__author__ = 'MBlaauw' #!/usr/bin/env python from decaf.util import transform from decaf.scripts import imagenet import logging import numpy as np from glob import glob import matplotlib.image as mpimg from random import shuffle import pickle def load_and_preprocess(net, imagepath, center_only=False, ...
{ "repo_name": "mblaauw/Kaggle_CatsVsDogs", "path": "kastnerkyle/kaggle_dataset_decaf.py", "copies": "1", "size": "2569", "license": "mit", "hash": -1843340842178393000, "line_mean": 34.2054794521, "line_max": 79, "alpha_frac": 0.6290385364, "autogenerated": false, "ratio": 3.3802631578947366, "...
__author__ = 'MBlaauw' #!/usr/bin/env python from pylearn2.datasets import DenseDesignMatrix from pylearn2.utils import serial from theano import tensor as T from theano import function import pickle import numpy as np import csv def process(mdl, ds, batch_size=100): # This batch size must be evenly divisible int...
{ "repo_name": "mblaauw/Kaggle_CatsVsDogs", "path": "kastnerkyle/kaggle_test.py", "copies": "1", "size": "1308", "license": "mit", "hash": 9045009301930906000, "line_mean": 30.9268292683, "line_max": 76, "alpha_frac": 0.630733945, "autogenerated": false, "ratio": 2.9261744966442955, "config_test...
__author__ = 'MBlaauw' #!/usr/bin/env python from pylearn2.models import mlp from pylearn2.costs.mlp.dropout import Dropout from pylearn2.training_algorithms import sgd, learning_rule from pylearn2.termination_criteria import EpochCounter from pylearn2.datasets import DenseDesignMatrix from pylearn2.train import Train ...
{ "repo_name": "mblaauw/Kaggle_CatsVsDogs", "path": "kastnerkyle/kaggle_train_full.py", "copies": "1", "size": "2688", "license": "mit", "hash": -6075973658846753000, "line_mean": 31.0119047619, "line_max": 62, "alpha_frac": 0.5319940476, "autogenerated": false, "ratio": 3.682191780821918, "conf...
__author__ = 'mbott' # this hack is to deal with ssl errors seen on Mac OSX import ssl if ssl.OPENSSL_VERSION.split(" ")[1] == '0.9.8zh': ssl._create_default_https_context = ssl._create_unverified_context import os import logging import datetime import dateutil.parser import pytz import stat from tempfile import ...
{ "repo_name": "Qumulo/qftpd", "path": "qftpd.py", "copies": "1", "size": "19684", "license": "apache-2.0", "hash": 5999150052728550000, "line_mean": 37.0735009671, "line_max": 82, "alpha_frac": 0.5938325544, "autogenerated": false, "ratio": 3.7436287561810575, "config_test": false, "has_no_ke...
__author__ = 'mcanuto, jsubirat' __date__ ="$May 15, 2014 13:54:34 AM$" import subprocess import re import gmetric import threading from logging import handlers import logging from time import sleep logger = logging.getLogger(__name__) logger.setLevel(logging.INFO) # create a file handler handler = handlers.Rotating...
{ "repo_name": "bsc-renewit/d2.2", "path": "monitoringFramework/odroidXUE.py", "copies": "1", "size": "5261", "license": "apache-2.0", "hash": -4344087891269433000, "line_mean": 43.218487395, "line_max": 261, "alpha_frac": 0.6215548375, "autogenerated": false, "ratio": 3.109338061465721, "config...
__author__="mcanuto" __date__ ="$Feb 13, 2014 6:11:42 PM$" #from subprocess import call, Popen import subprocess import re import gmetric import threading from gmetric import GmetricConf from time import sleep from logging import handlers import logging import os logger = logging.getLogger(__name__) logger.setLevel(l...
{ "repo_name": "bsc-renewit/d2.2", "path": "monitoringFramework/countersMetrics.py", "copies": "1", "size": "5799", "license": "apache-2.0", "hash": 3693280385253232600, "line_mean": 31.3966480447, "line_max": 201, "alpha_frac": 0.5845835489, "autogenerated": false, "ratio": 3.4954792043399636, ...
__author__ = 'mcgyver5' import sys import time import datetime import pygame import os import globals pygame.init() import surround_menu from pygame.locals import * import random fade = 100 BLOCKSIZE=15 x = 100 y = 20 os.environ['SDL_VIDEO_WINDOW_POS'] = "%d,%d" % (x,y) pygame.mixer.pre_init(44100, -16, 2, 2048) # setu...
{ "repo_name": "mcgyver5/surroundGame", "path": "first_animation.py", "copies": "1", "size": "7615", "license": "apache-2.0", "hash": -3798230341988164600, "line_mean": 33.7716894977, "line_max": 175, "alpha_frac": 0.6076165463, "autogenerated": false, "ratio": 3.354625550660793, "config_test": ...
__author__ = 'mcgyver5' import sys import time import pygame import os from pygame.locals import * import globals def menu_render(winSurf,textList,startPos,sepDist,fontSize=40,h_offset=0): print("MENU RENDER") basicFont = pygame.font.SysFont(None, fontSize) for str in textList: tt = basicFont.render...
{ "repo_name": "mcgyver5/surroundGame", "path": "surround_menu.py", "copies": "1", "size": "2431", "license": "apache-2.0", "hash": -2645105112749150700, "line_mean": 31, "line_max": 76, "alpha_frac": 0.6104483752, "autogenerated": false, "ratio": 3.3670360110803323, "config_test": false, "has...
__author__ = 'mckinney' import win32service import win32serviceutil import win32api import win32con import win32event import win32evtlogutil import os, sys, platform, string, time import servicemanager class aservice(win32serviceutil.ServiceFramework): _svc_name_ = "aiDaemonService" _svc_display_name_ = "AI ...
{ "repo_name": "weihuali0509/appinventor-sources", "path": "appinventor/misc/emulator-support/aiWinDaemonService.py", "copies": "86", "size": "1932", "license": "apache-2.0", "hash": -2443413117483490000, "line_mean": 32.3275862069, "line_max": 128, "alpha_frac": 0.6413043478, "autogenerated": false...
__author__ = 'mckinney' import win32service import win32serviceutil import win32api import win32con import win32event import win32evtlogutil import os, sys, platform, string, time import servicemanager class aservice(win32serviceutil.ServiceFramework): _svc_name_ = "aiDaemonService" _svc_displa...
{ "repo_name": "yflou520/appinventor-sources", "path": "appinventor/misc/emulator-support/aiWinDaemonService.py", "copies": "4", "size": "1989", "license": "apache-2.0", "hash": -402446796115875800, "line_mean": 32.3275862069, "line_max": 128, "alpha_frac": 0.6229260935, "autogenerated": false, "r...
__author__ = 'mcornelio' import socket import sys import math from paramsdict import * # Create a TCP/IP socket sock = socket.socket(socket.AF_INET, socket.SOCK_STREAM) # Connect the socket to the port on the server given by the caller server_address = (sys.argv[1], 10000) print >>sys.stderr, 'connecting to %s port ...
{ "repo_name": "mcornelio/synapse", "path": "tests/tcp_client.py", "copies": "1", "size": "1059", "license": "mit", "hash": 7696742424800923000, "line_mean": 23.0681818182, "line_max": 70, "alpha_frac": 0.6185080264, "autogenerated": false, "ratio": 2.6408977556109727, "config_test": false, "h...
__author__ = 'mcornelio' import socket import sys import threading from paramsdict import paramsdict class synapse_tcp_server: sock = None def __init__(self, port): def start_server(): def handle_client(connection): print >>sys.stderr, 'client.open(%s)' % connection try: msg = '' while True:...
{ "repo_name": "mcornelio/synapse", "path": "tests/tcp_server.py", "copies": "1", "size": "1780", "license": "mit", "hash": -8624386965703239000, "line_mean": 26.4, "line_max": 72, "alpha_frac": 0.6286516854, "autogenerated": false, "ratio": 3.2541133455210236, "config_test": false, "has_no_ke...
__author__ = 'mcornelio' import sys import SocketServer from paramsdict import * class MyTCPHandler(SocketServer.StreamRequestHandler): """ The request handler class for our server. It is instantiated once per connection to the server, and must override the handle() method to implement communication to the clie...
{ "repo_name": "mcornelio/synapse", "path": "tests/tcpSocketServer.py", "copies": "1", "size": "1307", "license": "mit", "hash": -7628510425452826000, "line_mean": 25.14, "line_max": 69, "alpha_frac": 0.6710022953, "autogenerated": false, "ratio": 3.3256997455470736, "config_test": false, "has...
__author__ = 'mcornelio' from setuptools import setup from datetime import datetime def version_string(): return "1.1.26" readme = open('README.md', 'r') README_TEXT = readme.read() readme.close() setup(name='synapse', version=version_string(), description='Cell-based device adapter'...
{ "repo_name": "mcornelio/synapse", "path": "setup.py", "copies": "1", "size": "1302", "license": "mit", "hash": -4973783786143934000, "line_mean": 28.2790697674, "line_max": 55, "alpha_frac": 0.5430107527, "autogenerated": false, "ratio": 4.383838383838384, "config_test": false, "has_no_keywo...
__author__ = 'mcowger' import logging from pprint import pformat, pprint class CloudFoundryDomain(object): @classmethod def get_class_name(cls): return cls.__name__ def __str__(self): # to show include all variables in sorted order return "<{}>@0x{}:\n".format(self.get_class_name...
{ "repo_name": "mcowger/python-cloudfoundry", "path": "cloudfoundry/domains.py", "copies": "2", "size": "1180", "license": "mit", "hash": -654760444862553600, "line_mean": 24.6739130435, "line_max": 170, "alpha_frac": 0.5966101695, "autogenerated": false, "ratio": 3.806451612903226, "config_test...
__author__ = 'mcowger' import logging from pprint import pformat, pprint class CloudFoundryOrg(object): @classmethod def get_class_name(cls): return cls.__name__ def __str__(self): # to show include all variables in sorted order return "<{}>@0x{}:\n".format(self.get_class_name(),...
{ "repo_name": "ipaoTAT/python-cloudfoundry", "path": "cloudfoundry/organizations.py", "copies": "2", "size": "1857", "license": "mit", "hash": 7215038287934154000, "line_mean": 27.5692307692, "line_max": 170, "alpha_frac": 0.605277329, "autogenerated": false, "ratio": 3.7364185110663986, "confi...
__author__ = 'mcowger' import logging from pprint import pformat, pprint class CloudFoundryRoute(object): @classmethod def get_class_name(cls): return cls.__name__ def __str__(self): # to show include all variables in sorted order return "<{}>@0x{}:\n".format(self.get_class_name(...
{ "repo_name": "mcowger/python-cloudfoundry", "path": "cloudfoundry/routes.py", "copies": "2", "size": "1172", "license": "mit", "hash": -2862294025494392000, "line_mean": 23.4166666667, "line_max": 170, "alpha_frac": 0.5656996587, "autogenerated": false, "ratio": 3.617283950617284, "config_test...
__author__ = 'mcowger' import logging from pprint import pformat, pprint class CloudFoundrySpace(object): @classmethod def get_class_name(cls): return cls.__name__ def __str__(self): # to show include all variables in sorted order return "<{}>@0x{}:\n".format(self.get_class_name(...
{ "repo_name": "mcowger/python-cloudfoundry", "path": "cloudfoundry/spaces.py", "copies": "2", "size": "1841", "license": "mit", "hash": 1191856691629405200, "line_mean": 27.3230769231, "line_max": 170, "alpha_frac": 0.6045627376, "autogenerated": false, "ratio": 3.74949083503055, "config_test":...
__author__ = "mcsquaredjr" __date__ = "12-Aug-2014" __ver__ = "0.1" """Set of functions and classes to read profiling logs from a directory and to manipulate the data. """ import os import time import re import json START_MARKER = "START " END_MARKER = "END " ARGS_MARKER = "args" SYNC_MARKER = "SYNCHRONIZATION " c...
{ "repo_name": "SKA-ScienceDataProcessor/RC", "path": "MS1/visualize/SKA/readlog.py", "copies": "1", "size": "8466", "license": "apache-2.0", "hash": -3360429804353321000, "line_mean": 29.4532374101, "line_max": 136, "alpha_frac": 0.5356721002, "autogenerated": false, "ratio": 3.718050065876153, ...
__author__ = 'mcsquaredjr' import os import sys import socket CAD_FILE = os.environ["CAD"] NODE_FILE = os.environ["NODE_FILE"] PROCS_PER_NODE = os.environ["PROCS_PER_NODE"] ITEMCOUNT = os.environ["ITEMCOUNT"] DDP = os.environ["DDP"] GHC_EVENTS = os.environ["GHC_EVENTS"] DDP_OPTS = os.environ["DDP_OPTS"] MIN_PORT = os...
{ "repo_name": "SKA-ScienceDataProcessor/RC", "path": "MS1/ddp-erlang-style/dna_lib.py", "copies": "1", "size": "1705", "license": "apache-2.0", "hash": 2721369736416662000, "line_mean": 21.1428571429, "line_max": 93, "alpha_frac": 0.5278592375, "autogenerated": false, "ratio": 3.1227106227106227,...
__author__ = "mcsquaredjr" import sys import matplotlib matplotlib.use('pdf') matplotlib.rcParams['axes.linewidth'] = 0.5 import matplotlib.pyplot as plt import readlog RED = [0.77, 0.16, 0.31] BLUE = [0.33, 0.63, 0.82] GREEN = [0.1, 0.66, 0.53] YELLOW = [0.93, 0.67, 0.34] DARKBLUE = [0.27, 0.55, 0.78] REDDISH = [0...
{ "repo_name": "SKA-ScienceDataProcessor/RC", "path": "MS1/visualize/SKA/logs2plot.py", "copies": "1", "size": "11513", "license": "apache-2.0", "hash": 9548247426008538, "line_mean": 30.9833333333, "line_max": 152, "alpha_frac": 0.5450360462, "autogenerated": false, "ratio": 3.247672778561354, ...
__author__ = "mcsquaredjr" import matplotlib matplotlib.use('pdf') matplotlib.rcParams['axes.linewidth'] = 0.5 import matplotlib.pyplot as plt import readlog RED = [0.77, 0.16, 0.31] BLUE = [0.33, 0.63, 0.82] GREEN = [0.1, 0.66, 0.53] YELLOW = [0.93, 0.67, 0.34] DARKBLUE = [0.27, 0.55, 0.78] SEABLUE = [0.38, 0.75, ...
{ "repo_name": "SKA-ScienceDataProcessor/RC", "path": "MS1/visualize/SKA/logs2plot_b.py", "copies": "1", "size": "4264", "license": "apache-2.0", "hash": 872358706655358100, "line_mean": 31.8076923077, "line_max": 140, "alpha_frac": 0.5037523452, "autogenerated": false, "ratio": 3.144542772861357,...
__author__ = 'mcsquaredjr' import xlwt TITLE = xlwt.easyxf('font: bold True, height 320;') HEADER = xlwt.easyxf('font: bold True, height 240;') HEADER_C = xlwt.easyxf('font: bold True, height 240; alignment: horizontal center;') WRAPPED = xlwt.easyxf('alignment: wrap True;') class XLS_Writer(object): def __...
{ "repo_name": "SKA-ScienceDataProcessor/RC", "path": "MS1/visualize/SKA/writexls.py", "copies": "1", "size": "3358", "license": "apache-2.0", "hash": -39330175177877680, "line_mean": 31.6019417476, "line_max": 104, "alpha_frac": 0.5512209649, "autogenerated": false, "ratio": 3.3850806451612905, ...
__author__ = 'mdavid' from BaseResolver import BaseResolver from addressimo.data import IdObject from addressimo.util import LogUtil from uuid import uuid4 log = LogUtil.setup_logging() class LocalResolver(BaseResolver): local_ir = { "id": "b17330349ca44abb9c086e81987045b6", "requester_pubkey":...
{ "repo_name": "netkicorp/addressimo", "path": "addressimo/resolvers/LocalResolver.py", "copies": "1", "size": "6709", "license": "bsd-3-clause", "hash": -3352124557810540500, "line_mean": 37.3371428571, "line_max": 147, "alpha_frac": 0.7625577582, "autogenerated": false, "ratio": 2.10842237586423...
__author__ = 'mdavid' from bcresolver import * if __name__ == '__main__': nc_resolver = NamecoinResolver( host='127.0.0.1', user='rpcuser', password='rpcpassword', port=8336, temp_dir='/tmp' ) try: txt_result = nc_resolver.resolve('_wallet.wallet.mattdavid...
{ "repo_name": "netkicorp/blockchain-resolver", "path": "examples/resolve_namecoin_name.py", "copies": "1", "size": "2219", "license": "bsd-3-clause", "hash": -8623268470211466000, "line_mean": 35.393442623, "line_max": 96, "alpha_frac": 0.6538981523, "autogenerated": false, "ratio": 3.56179775280...
__author__ = 'mdavid' from flask import request, Response from redis import Redis from addressimo.blockchain import cache_up_to_date from addressimo.config import config from addressimo.crypto import generate_bip32_address_from_extended_pubkey, generate_payment_request, get_unused_presigned_payment_request, derive_br...
{ "repo_name": "netkicorp/addressimo", "path": "addressimo/resolvers/__init__.py", "copies": "1", "size": "9135", "license": "bsd-3-clause", "hash": 7947193102148449000, "line_mean": 45.8461538462, "line_max": 180, "alpha_frac": 0.6553913519, "autogenerated": false, "ratio": 3.6467065868263475, ...
__author__ = 'mdavid' from wnsresolver import * if __name__ == '__main__': wallet_name = 'wallet.franksisf.bit' currency = 'btc' retries = 3 resolved_address = None resolver = WalletNameResolver( resolv_conf='/etc/resolv.conf', dnssec_root_key='/usr/local/etc/unbound/root.key' ...
{ "repo_name": "netkicorp/wns-resolver", "path": "examples/resolve_namecoin_walletname.py", "copies": "1", "size": "1826", "license": "bsd-3-clause", "hash": 6665933314547674000, "line_mean": 34.1346153846, "line_max": 176, "alpha_frac": 0.6462212486, "autogenerated": false, "ratio": 3.99562363238...
__author__ = 'mdavid' from wnsresolver import * if __name__ == '__main__': wallet_name = 'wallet.justinnewton.me' currency = 'btc' retries = 3 resolved_address = None resolver = WalletNameResolver( resolv_conf='/etc/resolv.conf', dnssec_root_key='/usr/local/etc/unbound/root.key' ...
{ "repo_name": "netkicorp/wns-resolver", "path": "examples/resolve_icann_walletname.py", "copies": "1", "size": "1547", "license": "bsd-3-clause", "hash": 58493280401784856, "line_mean": 35.8333333333, "line_max": 176, "alpha_frac": 0.6535229476, "autogenerated": false, "ratio": 4.049738219895288,...
__author__ = 'mdavid' import base64 import json import requests class NamecoinException(Exception): def __init__(self, message=None, code=0): self.message = message self.code = code def __str__(self): return 'NamecoinException [Code: %d | Message: %s]' % (self.code, self.message) cl...
{ "repo_name": "netkicorp/blockchain-resolver", "path": "bcresolver/namecoin.py", "copies": "1", "size": "2082", "license": "bsd-3-clause", "hash": -3546690829653018000, "line_mean": 30.5606060606, "line_max": 144, "alpha_frac": 0.5384245917, "autogenerated": false, "ratio": 4.0984251968503935, ...
__author__ = 'mdavid' import hashlib import iptools import os import re import requests import socket from base64 import b64decode from dns import rdatatype from flask import request from unbound import ub_ctx, RR_CLASS_IN from urlparse import urlparse class WalletNameLookupError(Exception): pass class WalletNa...
{ "repo_name": "netkicorp/wns-resolver", "path": "wnsresolver/__init__.py", "copies": "1", "size": "7723", "license": "bsd-3-clause", "hash": 4551310697143017500, "line_mean": 33.0220264317, "line_max": 188, "alpha_frac": 0.5897967111, "autogenerated": false, "ratio": 4.1655879180151025, "config...
__author__ = 'mdavid' import json from mock import * from unittest import TestCase from bcresolver.namecoin import NamecoinClient, NamecoinException class TestNamecoinException(TestCase): def test_go_right(self): ex = NamecoinException(message='test_message', code=42) msg = str(ex) self....
{ "repo_name": "netkicorp/blockchain-resolver", "path": "tests/test_namecoin_client.py", "copies": "1", "size": "7363", "license": "bsd-3-clause", "hash": -7127519601273204000, "line_mean": 43.0898203593, "line_max": 299, "alpha_frac": 0.647562135, "autogenerated": false, "ratio": 3.22797018851381...
__author__ = 'mdavid' import json from urlparse import urlparse from flask import Response, request, current_app from netki.util.logutil import LogUtil log = LogUtil.setup_logging('util_api') def create_json_response(success=True, message='', status=200, data={}): allowed_origins = ['localhost', '127.0.0....
{ "repo_name": "netkicorp/wns-api-server", "path": "netki/api/util.py", "copies": "1", "size": "1698", "license": "bsd-3-clause", "hash": -8097464138963220000, "line_mean": 29.8909090909, "line_max": 107, "alpha_frac": 0.6219081272, "autogenerated": false, "ratio": 3.8503401360544216, "config_te...
__author__ = 'mdavid' import json import logging import logging.handlers import os import sys import urllib from datetime import datetime from ecdsa import curves from ecdsa.der import UnexpectedDER from ecdsa.keys import VerifyingKey, BadDigestError, BadSignatureError from ecdsa.util import sigdecode_der from flask ...
{ "repo_name": "netkicorp/addressimo", "path": "addressimo/util.py", "copies": "1", "size": "7020", "license": "bsd-3-clause", "hash": 3728025890262776000, "line_mean": 31.9577464789, "line_max": 145, "alpha_frac": 0.6276353276, "autogenerated": false, "ratio": 3.7782561894510227, "config_test":...
__author__ = 'mdavid' import logging import logging.handlers import os import sys class LogUtil: loggers = {} @classmethod def setup_logging(cls, app_name='app', log_to_file=False): if LogUtil.loggers.get(app_name): return cls.loggers.get(app_name) logdir = os.path.abspath(...
{ "repo_name": "netkicorp/wns-api-server", "path": "netki/util/logutil.py", "copies": "1", "size": "1044", "license": "bsd-3-clause", "hash": -8333012083890823000, "line_mean": 28, "line_max": 126, "alpha_frac": 0.6111111111, "autogenerated": false, "ratio": 3.5876288659793816, "config_test": fa...
__author__ = 'mdavid' import string import re class InputValidation: @staticmethod def is_valid_domain(text): if not text: return False if '.' not in text: return False allowed = set(string.ascii_letters + string.digits + '-.') if set(text) - allowed:...
{ "repo_name": "netkicorp/wns-api-server", "path": "netki/util/validation.py", "copies": "1", "size": "1225", "license": "bsd-3-clause", "hash": 211966335809604600, "line_mean": 21.6851851852, "line_max": 75, "alpha_frac": 0.5534693878, "autogenerated": false, "ratio": 4.375, "config_test": fals...
__author__ = 'mdavid' # System Imports import binascii from datetime import datetime import multiprocessing from multiprocessing.queues import Empty import os import pybitcointools from redis import Redis import resource import simpleflock import socket import struct import sys import time # Addressimo Imports from a...
{ "repo_name": "netkicorp/addressimo", "path": "jobs/build_address_cache.py", "copies": "1", "size": "9041", "license": "bsd-3-clause", "hash": 5718433925829167000, "line_mean": 31.642599278, "line_max": 309, "alpha_frac": 0.6167459352, "autogenerated": false, "ratio": 3.6677484787018257, "confi...