text
stringlengths
0
1.05M
meta
dict
import os, psutil import threading import time class MonitorThread(threading.Thread): """ Monitors the CPU status """ def __init__(self, cpu_core, interval): self.sampling_interval = interval; # sample time interval self.sample = 0.5; # cpu load measurement sample self.cpu =...
{ "repo_name": "GaetanoCarlucci/CPULoadGenerator", "path": "utils/Monitor.py", "copies": "1", "size": "2142", "license": "mit", "hash": 640730489466187100, "line_mean": 34.7, "line_max": 123, "alpha_frac": 0.6031746032, "autogenerated": false, "ratio": 3.8945454545454545, "config_test": false, ...
import threading import time class ControllerThread(threading.Thread): """ Controls the CPU status """ def __init__(self, interval, ki = None, kp = None): self.running = 1; # thread status self.sampling_interval = interval self.period = 0.1 # actuation period in seconds ...
{ "repo_name": "GaetanoCarlucci/CPULoadGenerator", "path": "utils/Controller.py", "copies": "1", "size": "2417", "license": "mit", "hash": -398276627672449900, "line_mean": 35.6212121212, "line_max": 119, "alpha_frac": 0.6036408771, "autogenerated": false, "ratio": 3.800314465408805, "config_tes...
import time import matplotlib.pyplot as plt class realTimePlot(): """ Plots the CPU load """ def __init__(self, duration, cpu, target): plt.figure() plt.axis([0, duration, 0, 100]) plt.ion() plt.show() plt.xlabel('Time(sec)') plt.ylabel('%') ...
{ "repo_name": "GaetanoCarlucci/CPULoadGenerator", "path": "utils/Plot.py", "copies": "1", "size": "1520", "license": "mit", "hash": 5595475576460012000, "line_mean": 30.0408163265, "line_max": 107, "alpha_frac": 0.5256578947, "autogenerated": false, "ratio": 3.2, "config_test": false, "has_no...
import time from Plot import realTimePlot class openLoopActuator(): """ Generates CPU load by tuning the sleep time """ def __init__(self, monitor, duration, cpu_core, plot): self.sleep_time = 0.03 self.monitor = monitor self.duration = duration self.plot = plot ...
{ "repo_name": "GaetanoCarlucci/CPULoadGenerator", "path": "utils/openLoopActuator.py", "copies": "1", "size": "1893", "license": "mit", "hash": 6156356760533625000, "line_mean": 29.5483870968, "line_max": 72, "alpha_frac": 0.586899102, "autogenerated": false, "ratio": 3.9273858921161824, "confi...
import time from Plot import realTimePlot class closedLoopActuator(): """ Generates CPU load by tuning the sleep time """ def __init__(self, controller, monitor, duration, cpu_core, target, plot): self.controller = controller self.monitor = monitor self.duration = durati...
{ "repo_name": "GaetanoCarlucci/CPULoadGenerator", "path": "utils/closedLoopActuator.py", "copies": "1", "size": "2552", "license": "mit", "hash": 2659002868662310400, "line_mean": 33.5, "line_max": 101, "alpha_frac": 0.5885579937, "autogenerated": false, "ratio": 4, "config_test": false, "has...
import numpy as np import numbers from .base import SelectorMixin from ..base import BaseEstimator, clone, MetaEstimatorMixin from ..externals import six from ..exceptions import NotFittedError from ..utils.metaestimators import if_delegate_has_method def _get_feature_importances(estimator, norm_order=1): """R...
{ "repo_name": "vortex-ape/scikit-learn", "path": "sklearn/feature_selection/from_model.py", "copies": "9", "size": "8658", "license": "bsd-3-clause", "hash": 5436660436275882000, "line_mean": 36.6434782609, "line_max": 79, "alpha_frac": 0.6029106029, "autogenerated": false, "ratio": 4.60042507970...
import numpy as np import numbers from .base import SelectorMixin from ..base import BaseEstimator, clone, MetaEstimatorMixin from ..exceptions import NotFittedError from ..utils.metaestimators import if_delegate_has_method def _get_feature_importances(estimator, norm_order=1): """Retrieve or aggregate feature...
{ "repo_name": "chrsrds/scikit-learn", "path": "sklearn/feature_selection/from_model.py", "copies": "11", "size": "8617", "license": "bsd-3-clause", "hash": 5676329657540969000, "line_mean": 36.6288209607, "line_max": 79, "alpha_frac": 0.6019496344, "autogenerated": false, "ratio": 4.6030982905982...
import numpy as np import numbers from ._base import SelectorMixin from ._base import _get_feature_importances from ..base import BaseEstimator, clone, MetaEstimatorMixin from ..utils._tags import _safe_tags from ..utils.validation import check_is_fitted from ..exceptions import NotFittedError from ..utils.metaestim...
{ "repo_name": "anntzer/scikit-learn", "path": "sklearn/feature_selection/_from_model.py", "copies": "2", "size": "11063", "license": "bsd-3-clause", "hash": 7235529517795028000, "line_mean": 37.1482758621, "line_max": 79, "alpha_frac": 0.6017355148, "autogenerated": false, "ratio": 4.475323624595...
import numpy as np import numbers from ._base import SelectorMixin from ._base import _get_feature_importances from ..base import BaseEstimator, clone, MetaEstimatorMixin from ..utils.validation import check_is_fitted from ..exceptions import NotFittedError from ..utils.metaestimators import if_delegate_has_method f...
{ "repo_name": "bnaul/scikit-learn", "path": "sklearn/feature_selection/_from_model.py", "copies": "2", "size": "10636", "license": "bsd-3-clause", "hash": -5605500444734318000, "line_mean": 37.1218637993, "line_max": 79, "alpha_frac": 0.5980631816, "autogenerated": false, "ratio": 4.4651553316540...
import numpy as np from .base import SelectorMixin from ..base import BaseEstimator, clone, MetaEstimatorMixin from ..externals import six from ..exceptions import NotFittedError from ..utils.fixes import norm from ..utils.metaestimators import if_delegate_has_method def _get_feature_importances(estimator, norm_or...
{ "repo_name": "Vimos/scikit-learn", "path": "sklearn/feature_selection/from_model.py", "copies": "2", "size": "7239", "license": "bsd-3-clause", "hash": 6123710103426010000, "line_mean": 34.8366336634, "line_max": 79, "alpha_frac": 0.6190081503, "autogenerated": false, "ratio": 4.596190476190476,...
import numpy as np from .base import SelectorMixin from ..base import BaseEstimator, clone, MetaEstimatorMixin from ..externals import six from ..exceptions import NotFittedError from ..utils.metaestimators import if_delegate_has_method def _get_feature_importances(estimator, norm_order=1): """Retrieve or aggr...
{ "repo_name": "ldirer/scikit-learn", "path": "sklearn/feature_selection/from_model.py", "copies": "8", "size": "7259", "license": "bsd-3-clause", "hash": -3989877826609810000, "line_mean": 34.9356435644, "line_max": 79, "alpha_frac": 0.6150984984, "autogenerated": false, "ratio": 4.61768447837150...
import numpy as np from .base import SelectorMixin from ..base import BaseEstimator, clone from ..externals import six from ..exceptions import NotFittedError from ..utils.fixes import norm def _get_feature_importances(estimator, norm_order=1): """Retrieve or aggregate feature importances from estimator""" ...
{ "repo_name": "mikebenfield/scikit-learn", "path": "sklearn/feature_selection/from_model.py", "copies": "18", "size": "6968", "license": "bsd-3-clause", "hash": 2252715953452257000, "line_mean": 34.3705583756, "line_max": 79, "alpha_frac": 0.6090700344, "autogenerated": false, "ratio": 4.64843228...
import numpy as np from .base import SelectorMixin from ..base import TransformerMixin, BaseEstimator, clone from ..exceptions import NotFittedError from ..externals import six from ..utils import safe_mask, check_array, deprecated from ..utils.validation import check_is_fitted def _get_feature_importances(estimato...
{ "repo_name": "DailyActie/Surrogate-Model", "path": "01-codes/scikit-learn-master/sklearn/feature_selection/from_model.py", "copies": "1", "size": "9549", "license": "mit", "hash": -1177055967163521500, "line_mean": 35.8687258687, "line_max": 79, "alpha_frac": 0.6093831815, "autogenerated": false, ...
import numpy as np from .base import SelectorMixin from ..base import TransformerMixin, BaseEstimator, clone from ..externals import six from ..utils import safe_mask, check_array, deprecated from ..utils.validation import check_is_fitted from ..exceptions import NotFittedError from ..utils.fixes import norm def _...
{ "repo_name": "waterponey/scikit-learn", "path": "sklearn/feature_selection/from_model.py", "copies": "2", "size": "9854", "license": "bsd-3-clause", "hash": 5407109031427295000, "line_mean": 36.3257575758, "line_max": 79, "alpha_frac": 0.6131520195, "autogenerated": false, "ratio": 4.65910165484...
import numpy as np from ..base import TransformerMixin from ..externals import six from ..utils import safe_mask, atleast2d_or_csc class _LearntSelectorMixin(TransformerMixin): # Note because of the extra threshold parameter in transform, this does # not naturally extend from SelectorMixin """Transforme...
{ "repo_name": "B3AU/waveTree", "path": "sklearn/feature_selection/from_model.py", "copies": "11", "size": "4255", "license": "bsd-3-clause", "hash": 6907214902364467000, "line_mean": 37.6818181818, "line_max": 78, "alpha_frac": 0.5696827262, "autogenerated": false, "ratio": 4.890804597701149, "...
import numpy as np from ..base import TransformerMixin from ..externals import six from ..utils import safe_mask, check_array from ..utils.validation import NotFittedError, check_is_fitted class _LearntSelectorMixin(TransformerMixin): # Note because of the extra threshold parameter in transform, this does #...
{ "repo_name": "Jimmy-Morzaria/scikit-learn", "path": "sklearn/feature_selection/from_model.py", "copies": "224", "size": "4316", "license": "bsd-3-clause", "hash": -2550997177283025000, "line_mean": 37.1946902655, "line_max": 78, "alpha_frac": 0.5817886932, "autogenerated": false, "ratio": 4.7169...
import numpy as np from ..base import TransformerMixin from ..externals import six from ..utils import safe_mask, check_array class _LearntSelectorMixin(TransformerMixin): # Note because of the extra threshold parameter in transform, this does # not naturally extend from SelectorMixin """Transformer mix...
{ "repo_name": "eickenberg/scikit-learn", "path": "sklearn/feature_selection/from_model.py", "copies": "1", "size": "4252", "license": "bsd-3-clause", "hash": 5229897829378882000, "line_mean": 37.6545454545, "line_max": 78, "alpha_frac": 0.5689087488, "autogenerated": false, "ratio": 4.92699884125...
import numpy as np from ..base import TransformerMixin from ..externals import six from ..utils import safe_mask, atleast2d_or_csr class SelectorMixin(TransformerMixin): """Transformer mixin selecting features based on importance weights. This implementation can be mixin on any estimator that exposes a ...
{ "repo_name": "kmike/scikit-learn", "path": "sklearn/feature_selection/selector_mixin.py", "copies": "2", "size": "4117", "license": "bsd-3-clause", "hash": 359951900457448450, "line_mean": 37.1203703704, "line_max": 78, "alpha_frac": 0.5630313335, "autogenerated": false, "ratio": 4.9011904761904...
import numpy as np from ..base import TransformerMixin from ..utils import safe_mask, atleast2d_or_csr class SelectorMixin(TransformerMixin): """Transformer mixin selecting features based on importance weights. This implementation can be mixin on any estimator that exposes a ``feature_importances_`` or...
{ "repo_name": "seckcoder/lang-learn", "path": "python/sklearn/sklearn/feature_selection/selector_mixin.py", "copies": "1", "size": "3809", "license": "unlicense", "hash": -3123959474871177700, "line_mean": 36.7128712871, "line_max": 78, "alpha_frac": 0.569178262, "autogenerated": false, "ratio": ...
import itertools from copy import copy from twisted.web import client, _newclient, http_headers from twisted.web._newclient import RequestNotSent, RequestGenerationFailed from twisted.web._newclient import TransportProxyProducer, STATUS from twisted.internet import reactor from twisted.internet.defer import Deferred,...
{ "repo_name": "juga0/ooni-probe", "path": "ooni/utils/trueheaders.py", "copies": "1", "size": "5890", "license": "bsd-2-clause", "hash": -6684001071561271000, "line_mean": 31.5414364641, "line_max": 77, "alpha_frac": 0.621901528, "autogenerated": false, "ratio": 4.359733530717986, "config_test"...
import itertools from copy import copy from twisted.web import client, _newclient, http_headers from twisted.web._newclient import RequestNotSent, RequestGenerationFailed, TransportProxyProducer, STATUS from twisted.internet import reactor from twisted.internet.defer import Deferred, fail, maybeDeferred, failure fro...
{ "repo_name": "lordappsec/ooni-probe", "path": "ooni/utils/trueheaders.py", "copies": "3", "size": "5405", "license": "bsd-2-clause", "hash": 8102901203983018000, "line_mean": 31.7575757576, "line_max": 106, "alpha_frac": 0.6212765957, "autogenerated": false, "ratio": 4.362389023405973, "config...
"""A package for dealing with geometry.""" __version__ = '0.0.a' #__all__ = [ # 'matrix', # 'vector', # 'point', # 'affinematrix', # 'line', # 'polyline', # 'circle', # 'arc' # ] EPS = 1.0e-6 from matrix import Matrix from vector import Vector from point import Point from affinematrix im...
{ "repo_name": "gfsmith/gears", "path": "gears/geometry/__init__.py", "copies": "1", "size": "1799", "license": "mit", "hash": 8739113731544709000, "line_mean": 25.8507462687, "line_max": 120, "alpha_frac": 0.5780989439, "autogenerated": false, "ratio": 2.495145631067961, "config_test": false, ...
from skmultilearn.base import MLClassifierBase import numpy as np import scipy.sparse as sp from scipy.linalg import norm from scipy.sparse.linalg import inv as inv_sparse from scipy.linalg import inv as inv_dense class MLTSVM(MLClassifierBase): """Twin multi-Label Support Vector Machines Parameters ---...
{ "repo_name": "scikit-multilearn/scikit-multilearn", "path": "skmultilearn/adapt/mltsvm.py", "copies": "1", "size": "6351", "license": "bsd-2-clause", "hash": 1284250646828732400, "line_mean": 32.9625668449, "line_max": 105, "alpha_frac": 0.5836876083, "autogenerated": false, "ratio": 3.372809346...
__authors__ = "Guillaume Desjardin, Xavier Muller" __copyright__ = "(c) 2010, Universite de Montreal" __license__ = "3-clause BSD License" __contact__ = "Xavier Muller <xav.muller@gmail.com>" import os from optparse import OptionParser from jobman.parse import filemerge from jobman.parse import standard as jparse fr...
{ "repo_name": "crmne/jobman", "path": "jobman/findjob.py", "copies": "1", "size": "7652", "license": "bsd-3-clause", "hash": -3862384921149217300, "line_mean": 33.1607142857, "line_max": 122, "alpha_frac": 0.5582854156, "autogenerated": false, "ratio": 3.9220912352639674, "config_test": false, ...
from ..backends._notebook \ import _NotebookInteractor as _PyVistaNotebookInteractor class _NotebookInteractor(_PyVistaNotebookInteractor): def __init__(self, brain): self.brain = brain super().__init__(self.brain._renderer) def configure_controllers(self): from ipywidgets import...
{ "repo_name": "larsoner/mne-python", "path": "mne/viz/_brain/_notebook.py", "copies": "4", "size": "2301", "license": "bsd-3-clause", "hash": 8113060611981110000, "line_mean": 33.3432835821, "line_max": 67, "alpha_frac": 0.5367231638, "autogenerated": false, "ratio": 4.094306049822064, "config_...
from ..backends._notebook \ import _NotebookInteractor as _PyVistaNotebookInteractor class _NotebookInteractor(_PyVistaNotebookInteractor): def __init__(self, time_viewer): self.time_viewer = time_viewer self.brain = self.time_viewer.brain super().__init__(self.brain._renderer) d...
{ "repo_name": "cjayb/mne-python", "path": "mne/viz/_brain/_notebook.py", "copies": "2", "size": "2381", "license": "bsd-3-clause", "hash": -6191399142872381000, "line_mean": 34.0147058824, "line_max": 67, "alpha_frac": 0.543049139, "autogenerated": false, "ratio": 4.0770547945205475, "config_te...
import matplotlib.pyplot as plt from contextlib import contextmanager from ...fixes import nullcontext from ._pyvista import _Renderer as _PyVistaRenderer from ._pyvista import \ _close_all, _set_3d_view, _set_3d_title # noqa: F401 analysis:ignore class _Renderer(_PyVistaRenderer): def __init__(self, *args,...
{ "repo_name": "olafhauk/mne-python", "path": "mne/viz/backends/_notebook.py", "copies": "2", "size": "5496", "license": "bsd-3-clause", "hash": 3001935578690518500, "line_mean": 31.9101796407, "line_max": 73, "alpha_frac": 0.5669577875, "autogenerated": false, "ratio": 4.208269525267994, "confi...
import matplotlib.pyplot as plt from contextlib import contextmanager from ...fixes import nullcontext from ._pyvista import _Renderer as _PyVistaRenderer class _Renderer(_PyVistaRenderer): def __init__(self, *args, **kwargs): from IPython import get_ipython ipython = get_ipython() ipytho...
{ "repo_name": "cjayb/mne-python", "path": "mne/viz/backends/_notebook.py", "copies": "2", "size": "5398", "license": "bsd-3-clause", "hash": 9137818348036910000, "line_mean": 31.7151515152, "line_max": 70, "alpha_frac": 0.565024083, "autogenerated": false, "ratio": 4.257097791798107, "config_te...
__author__ = 'sh84.ahn@gmail.com' __version__ = '0.1' import logging from logging import handlers import inspect import functools import datetime import os from flask import request """ LogLevel """ @property def CRITICAL(): return logging.CRITICAL @property def FATAL(): return logging.FATAL @property ...
{ "repo_name": "AhnSeongHyun/logis", "path": "logis.py", "copies": "1", "size": "5988", "license": "mit", "hash": 3542163170834566000, "line_mean": 22.8605577689, "line_max": 106, "alpha_frac": 0.5768203073, "autogenerated": false, "ratio": 4.109814687714482, "config_test": false, "has_no_keyw...
# Desc : This file is the SQL generation core. from .adapters import Adapter def spacecat(*args): return ' '.join(list(args)) _surround = lambda x, start, end: ''.join([start,x,end]) class Child: def __init__(self, name, value, relation): self.sub_tree = False if value.__class__.__name__ ...
{ "repo_name": "shabinesh/Tabject", "path": "tabject/tree.py", "copies": "1", "size": "2972", "license": "bsd-3-clause", "hash": -5855122166389519000, "line_mean": 31.6593406593, "line_max": 120, "alpha_frac": 0.5349932705, "autogenerated": false, "ratio": 3.85473411154345, "config_test": false,...
__author__ = 'shabou' import logging import argparse import os import importlib logging.basicConfig(level=logging.INFO) parser = argparse.ArgumentParser(description='Make a submission.') parser.add_argument('--c', type=str, help='competition name') parser.add_argument('--a', type=str, help='author name') args = par...
{ "repo_name": "aymen82/kaggler-competitions-scripts", "path": "kaggler/scripts/run-submission.py", "copies": "1", "size": "1111", "license": "bsd-3-clause", "hash": 7553706089404071000, "line_mean": 26.0975609756, "line_max": 93, "alpha_frac": 0.703870387, "autogenerated": false, "ratio": 3.25806...
__author__ = 'shadoobie' from socket import AF_INET, SOCK_STREAM, socket from threading import Thread, Event from Queue import Queue from DistributedStorageBenchmarkTool.CountdownTask import CountdownTask from DistributedStorageBenchmarkTool.LaunchAndMeasureDataTask import LaunchAndMeasureDataTask from DistributedStora...
{ "repo_name": "shadoobie/dbench", "path": "DistributedStorageBenchmarkTool/DiskPerformanceClient.py", "copies": "1", "size": "2963", "license": "mit", "hash": 4521584734919761400, "line_mean": 39.602739726, "line_max": 162, "alpha_frac": 0.6888288896, "autogenerated": false, "ratio": 3.8281653746...
__author__ = 'shadoobie' import getopt, sys import logging import os.path sys.path.append(os.path.join(os.path.dirname(__file__), '..')) from DistributedStorageBenchmarkTool.DiskPerformanceClient import DiskPerformanceClient from DistributedStorageBenchmarkTool.StampyMcGetTheLog import StampyMcGetTheLog def main(argv)...
{ "repo_name": "shadoobie/dbench", "path": "DistributedStorageBenchmarkTool/TestDiskPerformance.py", "copies": "1", "size": "3763", "license": "mit", "hash": 239806508945842940, "line_mean": 41.7613636364, "line_max": 139, "alpha_frac": 0.6183895828, "autogenerated": false, "ratio": 3.990455991516...
__author__ = 'shadoobie' import getopt, sys import os.path sys.path.append(os.path.join(os.path.dirname(__file__), '..')) from DistributedStorageBenchmarkTool.EchoHandler import EchoHandler from DistributedStorageBenchmarkTool.DistributedStorageBenchmarkServer import DistributedStorageBenchmarkServer from DistributedSt...
{ "repo_name": "shadoobie/dbench", "path": "DistributedStorageBenchmarkTool/StartBenchmarkTestServer.py", "copies": "1", "size": "3100", "license": "mit", "hash": -8282254927026824000, "line_mean": 39.2727272727, "line_max": 151, "alpha_frac": 0.654516129, "autogenerated": false, "ratio": 4.105960...
__author__ = 'shadoobie' import time class CountdownTask: def __init__(self, log, sock, clientName): self.log = log self.sock = sock self.flood("CountdownTask for heartbeat has been instantiated but not yet started.") self.clientName = clientName self._running = True ...
{ "repo_name": "shadoobie/dbench", "path": "DistributedStorageBenchmarkTool/CountdownTask.py", "copies": "1", "size": "1100", "license": "mit", "hash": 9129258994812740000, "line_mean": 33.40625, "line_max": 135, "alpha_frac": 0.5945454545, "autogenerated": false, "ratio": 3.678929765886288, "co...
__author__ = 'shadoobie' import os from DistributedStorageBenchmarkTool.StampyMcGetTheLog import StampyMcGetTheLog from DistributedStorageBenchmarkTool.Timer import Timer class DataTask: def __init__(self, log, sock, clientName, chunkSize, maxFileSize, stopCountdownEvent): self._running = True sel...
{ "repo_name": "shadoobie/dbench", "path": "DistributedStorageBenchmarkTool/DataTask.py", "copies": "1", "size": "2994", "license": "mit", "hash": 7983512047005656000, "line_mean": 36.4375, "line_max": 130, "alpha_frac": 0.6022044088, "autogenerated": false, "ratio": 3.770780856423174, "config_t...
__author__ = 'SHADOWxCODEX' #pip install requests #or easy_install requests #found under python_path\Scripts\pip #if you get an python egg related error, try 'pip install --upgrade setuptools' import requests import itertools print('Author: SHADOWxCODEX') print('Date Created: 7-24-2015') print('Source: https://github...
{ "repo_name": "PhantomBALR/pydomainfinder", "path": "pydomainfinder.py", "copies": "1", "size": "5183", "license": "mit", "hash": 739841397947608300, "line_mean": 34.2585034014, "line_max": 156, "alpha_frac": 0.5998456492, "autogenerated": false, "ratio": 3.6244755244755247, "config_test": fals...
__author__ = 'shafi' import logging import json,os import socket from json2html import * from flask import Flask, url_for, request,render_template from flask import Response from flask import jsonify from functools import wraps app = Flask(__name__) def check_auth(username, password): return username == 'admin...
{ "repo_name": "shafi-codez/FlaskDemo", "path": "run.py", "copies": "1", "size": "3470", "license": "apache-2.0", "hash": -5796967829035028000, "line_mean": 25.0902255639, "line_max": 141, "alpha_frac": 0.6227665706, "autogenerated": false, "ratio": 3.497983870967742, "config_test": false, "ha...
__author__ = 'shailesh' import numpy as np import csv class UtilMethods(object): @staticmethod def LoadWordsSetFromFile(filePath): words = set() file = open(filePath,'r') for word in file: words.add(word.strip()) return words @staticmethod def LoadWordsListF...
{ "repo_name": "shaileshahuja/SentimentBlade", "path": "src/Utils.py", "copies": "1", "size": "3905", "license": "apache-2.0", "hash": -609724267294153700, "line_mean": 31.0081967213, "line_max": 81, "alpha_frac": 0.5513444302, "autogenerated": false, "ratio": 4.221621621621622, "config_test": f...
__author__ = 'Shailesh' __author__ = 'Shailesh' from sklearn.ensemble import RandomForestClassifier import utils from sklearn import cross_validation from collections import defaultdict import operator import numpy as np import math import logging import datetime def preprocess(data): processedData = [[] for _ i...
{ "repo_name": "shaileshahuja/MineRush", "path": "Eye Movement Tracking/src/feature_extraction.py", "copies": "1", "size": "3420", "license": "unlicense", "hash": -3163962782088920000, "line_mean": 35, "line_max": 108, "alpha_frac": 0.5926900585, "autogenerated": false, "ratio": 3.152073732718894,...
__author__ = 'Shailesh' from collections import defaultdict import numpy import csv from Sentiment import Sentiment from Angel import Angel from Utils import UtilMethods as util from PerformanceTest import PerformanceTest def ImpactTraining(docPath, lexPath, lexiconID): """ Final score of the review is calcu...
{ "repo_name": "shaileshahuja/SentimentBlade", "path": "src/ImpactTraining.py", "copies": "1", "size": "3681", "license": "apache-2.0", "hash": 1882574923696889600, "line_mean": 45.025, "line_max": 122, "alpha_frac": 0.6528117359, "autogenerated": false, "ratio": 4.108258928571429, "config_test"...
__author__ = 'Shailesh' from sklearn import svm, cross_validation import utils import numpy as np def main(): X, Y = utils.read_data("../files/train_10.csv") Y = map(int, Y) folds = 5 stf = cross_validation.StratifiedKFold(Y, folds) loss = [] svc = svm.SVC(probability=True) accs = [] c...
{ "repo_name": "shaileshahuja/MineRush", "path": "Eye Movement Tracking/src/svmBenchmark.py", "copies": "1", "size": "1136", "license": "unlicense", "hash": 1624419493377083600, "line_mean": 33.4545454545, "line_max": 79, "alpha_frac": 0.5704225352, "autogenerated": false, "ratio": 2.9053708439897...
__author__ = 'shailesh' from xml.etree import ElementTree as ET from xml.dom import minidom from YelpReview import Review def Prettify(elem): """Return a pretty-printed XML string for the Element. """ rough_string = ET.tostring(elem, 'utf-8') reparsed = minidom.parseString(rough_string) return re...
{ "repo_name": "shaileshahuja/SentimentBlade", "path": "src/XMLHandler.py", "copies": "1", "size": "3560", "license": "apache-2.0", "hash": -8631215972868792000, "line_mean": 32.9047619048, "line_max": 104, "alpha_frac": 0.5904494382, "autogenerated": false, "ratio": 3.7355718782791185, "config_...
__author__ = 'Shailesh' import math def read_data(file_name): f = open(file_name) #ignore header f.readline() samples = [] target = [] for line in f: line = line.strip().split(",") sample = [float(x) for x in line[1:]] samples.append(sample) target.append(line[0...
{ "repo_name": "shaileshahuja/MineRush", "path": "Eye Movement Tracking/src/utils.py", "copies": "1", "size": "2377", "license": "unlicense", "hash": 6107408170576256000, "line_mean": 27.6506024096, "line_max": 75, "alpha_frac": 0.6066470341, "autogenerated": false, "ratio": 3.537202380952381, "...
__author__ = 'shailesh' import os import json from Utils import UtilMethods as util from YelpCrawler import YelpCrawler from XMLHandler import LoadCrawledXMLFile,DumpSortedReviews from Angel import Angel from Sentiment import Sentiment class SentimentBlade: def __init__(self, url): self.url = url d...
{ "repo_name": "shaileshahuja/SentimentBlade", "path": "src/SentimentBlade.py", "copies": "1", "size": "2877", "license": "apache-2.0", "hash": -7451752824779601000, "line_mean": 34.975, "line_max": 108, "alpha_frac": 0.6478971151, "autogenerated": false, "ratio": 3.836, "config_test": false, ...
__author__ = 'shailesh' import os import json posRoot = "/home/shailesh/nltk_data/corpora/movie_reviews/pos" negRoot = "/home/shailesh/nltk_data/corpora/movie_reviews/neg" outputPath = "/home/shailesh/webservice/src/classifier_v3.0/movie_reviews.txt" def PrepareTextFile(): with open(outputPath, 'w') as outHand...
{ "repo_name": "shaileshahuja/SentimentBlade", "path": "src/movie_reviews_test_prep.py", "copies": "1", "size": "2002", "license": "apache-2.0", "hash": 6186734174309490000, "line_mean": 37.5192307692, "line_max": 121, "alpha_frac": 0.6178821179, "autogenerated": false, "ratio": 3.686924493554328,...
__author__ = 'Shailesh' class PredictionFunctions: NegativeModifiers = {"not", "n't", "no", "nothing", "at"} PositiveModifiers = {"very", "so", "really", "super", "extremely"} NeutralModifiers = {"neither", "nor"} TooExceptionList = {"good", "awesome", "brilliant", "kind", "great", "tempting", "big",...
{ "repo_name": "shaileshahuja/SentimentBlade", "path": "src/PredictionFunctions.py", "copies": "1", "size": "4397", "license": "apache-2.0", "hash": 6696549591885527000, "line_mean": 47.8666666667, "line_max": 237, "alpha_frac": 0.5774391631, "autogenerated": false, "ratio": 3.836823734729494, "...
__author__ = 'shako' import os import copy import json import time import logging import psutil import commands import datetime import tempfile from minions import Minion class MtbfToRaptorMinion(Minion): def update(self, **kwargs): Minion.update(self, **kwargs) self.conf = {} if 'job_in...
{ "repo_name": "Mozilla-TWQA/mozMinions", "path": "moz_minions/kevin.py", "copies": "1", "size": "9218", "license": "mpl-2.0", "hash": -503075646487018000, "line_mean": 43.9658536585, "line_max": 119, "alpha_frac": 0.4798220872, "autogenerated": false, "ratio": 4.317564402810304, "config_test": ...
__author__ = 'Shane' from unittest.mock import Mock import ClassInteractor import MethodInteractor import MockeryInteractor class DynamicMock(Mock): def __init__(self, *args, **kwargs): super().__init__(*args, **kwargs) if 'spec' in kwargs: self.mockedClass = kwargs['spec'] # def ...
{ "repo_name": "smckee6192/MockyThingy", "path": "DynamicMock.py", "copies": "1", "size": "2097", "license": "mit", "hash": -5003684980323817000, "line_mean": 40.137254902, "line_max": 109, "alpha_frac": 0.6342393896, "autogenerated": false, "ratio": 3.8905380333951762, "config_test": false, "...
__author__ = 'Shane' from ClassToPass import ClassToPass class ImportantClass: def __init__(self): pass def doTheThing(self, number1=int(), number2=int(), classToPass=ClassToPass()) -> int: print("TheThing") added = classToPass.gimmeTheSum(number1, number2) return added ...
{ "repo_name": "smckee6192/MockyThingy", "path": "ImportantFile.py", "copies": "1", "size": "1064", "license": "mit", "hash": 8819676050588695000, "line_mean": 27.7837837838, "line_max": 89, "alpha_frac": 0.6062030075, "autogenerated": false, "ratio": 3.4885245901639346, "config_test": false, ...
__author__ = 'Shane' from DynamicMock import DynamicMock import ClassInteractor import MethodInteractor from MockedTypes import MockedTypes def createMockClassOfType(type_): mockObject = DynamicMock(spec=type_) class_ = type_() for each in ClassInteractor.getAllMethodNames(class_): method = Class...
{ "repo_name": "smckee6192/MockyThingy", "path": "MockeryInteractor.py", "copies": "1", "size": "1969", "license": "mit", "hash": -5145854614057866000, "line_mean": 35.462962963, "line_max": 99, "alpha_frac": 0.7110208228, "autogenerated": false, "ratio": 4.068181818181818, "config_test": false,...
__author__ = 'Shane' import inspect import MethodInteractor def callUnboundMethodWithRandomValues(class_, methodName): instantiatedClass = class_() unboundMethod = getattr(instantiatedClass, methodName) generatedParameters = MethodInteractor.getParameterInputs(unboundMethod) unboundMethod(*generatedPa...
{ "repo_name": "smckee6192/MockyThingy", "path": "ClassInteractor.py", "copies": "1", "size": "1044", "license": "mit", "hash": 5416961886091284000, "line_mean": 29.7352941176, "line_max": 76, "alpha_frac": 0.7212643678, "autogenerated": false, "ratio": 4.078125, "config_test": false, "has_no_...
__author__ = 'Shane' import inspect import ValueGenerator import MockeryInteractor def getParameterInputs(method): methodInfo = inspect.getfullargspec(method) defaultArgs = methodInfo[3] argInputs = [] print("Testing", method.__name__) if not (len(methodInfo[0]) == 1 and methodInfo[0][0] == 'sel...
{ "repo_name": "smckee6192/MockyThingy", "path": "MethodInteractor.py", "copies": "1", "size": "2334", "license": "mit", "hash": -4611838771111313000, "line_mean": 31.4305555556, "line_max": 122, "alpha_frac": 0.646101114, "autogenerated": false, "ratio": 4.26691042047532, "config_test": false, ...
__author__ = 'Shane' import random import string import sys def getRandomStrOfLen(length): charList = [random.choice(string.printable) for _ in range(length)] return ''.join(charList) def createRandomListOfType(type_): randList = [] listSize = random.randint(0, 1000) for _ in range(listSize): ...
{ "repo_name": "smckee6192/MockyThingy", "path": "ValueGenerator.py", "copies": "1", "size": "2050", "license": "mit", "hash": -9198534350607506000, "line_mean": 30.5538461538, "line_max": 94, "alpha_frac": 0.6546341463, "autogenerated": false, "ratio": 3.9272030651340994, "config_test": false, ...
__author__ = 'Shaoteng Liu' # Copyright 2015 SICS Swedish ICT AB # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by ...
{ "repo_name": "nigsics/perf-kvm", "path": "server/sub.py", "copies": "1", "size": "3747", "license": "apache-2.0", "hash": -5000985328862769000, "line_mean": 22.8662420382, "line_max": 95, "alpha_frac": 0.5866026154, "autogenerated": false, "ratio": 4.046436285097192, "config_test": false, "h...
import direct.directbase.DirectStart from panda3d.core import Texture from direct.interval.LerpInterval import LerpFunc from direct.gui.OnscreenText import OnscreenText from direct.showbase.DirectObject import DirectObject from direct.task.Task import Task import sys #Our specialized function to load texture movies a...
{ "repo_name": "toontownfunserver/Panda3D-1.9.0", "path": "samples/Texture-Swapping/Tut-Texture-Swapping-II.py", "copies": "3", "size": "3258", "license": "bsd-3-clause", "hash": 2933382628222414000, "line_mean": 39.2222222222, "line_max": 85, "alpha_frac": 0.718538981, "autogenerated": false, "ra...
# The duck animation was created by Shane Liesegang and William Houng # for the Entertainment Technology Center class Building Virtual Worlds import direct.directbase.DirectStart from panda3d.core import Texture from panda3d.core import BillboardEffect from panda3d.core import Camera from panda3d.core import TextNode...
{ "repo_name": "ToonTownInfiniteRepo/ToontownInfinite", "path": "Panda3D-1.9.0/samples/Texture-Swapping/Tut-Texture-Swapping.py", "copies": "3", "size": "8401", "license": "mit", "hash": -9088254001244020000, "line_mean": 47.2816091954, "line_max": 79, "alpha_frac": 0.6928937031, "autogenerated": fa...
import direct.directbase.DirectStart from panda3d.core import Fog from panda3d.core import TextNode from direct.gui.OnscreenText import OnscreenText from direct.showbase.DirectObject import DirectObject from direct.interval.MetaInterval import Sequence from direct.interval.LerpInterval import LerpFunc from direct.int...
{ "repo_name": "francholi/PandaExamples", "path": "Infinite-Tunnel/Tut-Infinite-Tunnel.py", "copies": "3", "size": "8881", "license": "mit", "hash": 6179420144460110000, "line_mean": 43.6281407035, "line_max": 85, "alpha_frac": 0.6935029839, "autogenerated": false, "ratio": 3.4489320388349514, "...
import direct.directbase.DirectStart #Initialize Panda and create a window from panda3d.core import * #Contains most of Panda's modules from direct.gui.DirectGui import * #Imports Gui objects we use for putting #text on the screen import sys class World: ...
{ "repo_name": "toontownfunserver/Panda3D-1.9.0", "path": "samples/Solar-System/Tut-Step-2-Basic-Setup.py", "copies": "3", "size": "2281", "license": "bsd-3-clause", "hash": 2022906311628869000, "line_mean": 40.4727272727, "line_max": 79, "alpha_frac": 0.6773345024, "autogenerated": false, "ratio"...
import direct.directbase.DirectStart from panda3d.core import NodePath from direct.gui.DirectGui import * import sys class World: def __init__(self): #This is the initialization we had before self.title = OnscreenText( #Create the title text="Panda3D: Tutorial 1 - Solar System", style=1...
{ "repo_name": "toontownfunserver/Panda3D-1.9.0", "path": "samples/Solar-System/Tut-Step-3-Load-Model.py", "copies": "3", "size": "4500", "license": "bsd-3-clause", "hash": -6542556713858582000, "line_mean": 42.2692307692, "line_max": 79, "alpha_frac": 0.6906666667, "autogenerated": false, "ratio"...
import direct.directbase.DirectStart from direct.gui.DirectGui import * from panda3d.core import Vec3, Vec4 import sys class World: def __init__(self): #This is the initialization we had before self.title = OnscreenText( #Create the title text="Panda3D: Tutorial 1 - Solar System", style...
{ "repo_name": "francholi/PandaExamples", "path": "Solar-System/Tut-Step-5-Complete-Solar-System.py", "copies": "3", "size": "6726", "license": "mit", "hash": -4797329678987051000, "line_mean": 38.798816568, "line_max": 79, "alpha_frac": 0.6775200714, "autogenerated": false, "ratio": 3.08673703533...
import direct.directbase.DirectStart from panda3d.physics import BaseParticleEmitter,BaseParticleRenderer from panda3d.physics import PointParticleFactory,SpriteParticleRenderer from panda3d.physics import LinearNoiseForce,DiscEmitter from panda3d.core import TextNode from panda3d.core import AmbientLight,DirectionalL...
{ "repo_name": "ToonTownInfiniteRepo/ToontownInfinite", "path": "Panda3D-1.9.0/samples/Particles/Tut-Steam-Example.py", "copies": "3", "size": "3273", "license": "mit", "hash": -5893618172378569000, "line_mean": 34.5760869565, "line_max": 82, "alpha_frac": 0.670944088, "autogenerated": false, "rat...
import direct.directbase.DirectStart from direct.showbase import DirectObject from panda3d.core import * from direct.interval.IntervalGlobal import * from direct.gui.DirectGui import * from direct.showbase.DirectObject import DirectObject import sys # We start this tutorial with the standard class. However, the clas...
{ "repo_name": "mweinberger-tgm/VenusAndMars", "path": "prototyp/VenusAndMars.py", "copies": "1", "size": "11014", "license": "apache-2.0", "hash": -3591132263427912700, "line_mean": 42.02734375, "line_max": 100, "alpha_frac": 0.633103323, "autogenerated": false, "ratio": 3.3910098522167487, "co...
import direct.directbase.DirectStart from direct.showbase import DirectObject from panda3d.core import TextNode, Vec3, Vec4 from direct.interval.IntervalGlobal import * from direct.gui.DirectGui import * from direct.showbase.DirectObject import DirectObject import sys #We start this tutorial with the standard class. ...
{ "repo_name": "toontownfunserver/Panda3D-1.9.0", "path": "samples/Solar-System/Tut-Step-6-Controllable-System.py", "copies": "3", "size": "14595", "license": "bsd-3-clause", "hash": 7613119265882371000, "line_mean": 42.4375, "line_max": 82, "alpha_frac": 0.6642685851, "autogenerated": false, "rat...
import direct.directbase.DirectStart from panda3d.core import AmbientLight,DirectionalLight from panda3d.core import TextNode,NodePath,LightAttrib from panda3d.core import Vec3,Vec4 from direct.actor.Actor import Actor from direct.task.Task import Task from direct.gui.OnscreenText import OnscreenText from direct.showb...
{ "repo_name": "ToonTownInfiniteRepo/ToontownInfinite", "path": "Panda3D-1.9.0/samples/Looking-and-Gripping/Tut-Looking-and-Gripping.py", "copies": "3", "size": "6366", "license": "mit", "hash": 6224943812424821000, "line_mean": 47.5954198473, "line_max": 81, "alpha_frac": 0.6577128495, "autogenerat...
import direct.directbase.DirectStart from panda3d.core import CollisionTraverser,CollisionNode from panda3d.core import CollisionHandlerQueue,CollisionRay from panda3d.core import AmbientLight,DirectionalLight,LightAttrib from panda3d.core import TextNode from panda3d.core import Point3,Vec3,Vec4,BitMask32 from direct...
{ "repo_name": "francholi/PandaExamples", "path": "Chessboard/Tut-Chessboard.py", "copies": "3", "size": "10673", "license": "mit", "hash": 2793052011834429000, "line_mean": 40.8549019608, "line_max": 81, "alpha_frac": 0.6891220838, "autogenerated": false, "ratio": 3.5062417871222076, "config_te...
import direct.directbase.DirectStart from panda3d.core import AmbientLight,DirectionalLight from panda3d.core import TextNode from panda3d.core import Vec3,Vec4 from direct.showbase.DirectObject import DirectObject from direct.gui.OnscreenText import OnscreenText from direct.interval.MetaInterval import Sequence from ...
{ "repo_name": "ToonTownInfiniteRepo/ToontownInfinite", "path": "Panda3D-1.9.0/samples/Boxing-Robots/Tut-Boxing-Robots.py", "copies": "3", "size": "8045", "license": "mit", "hash": -5991664514312413000, "line_mean": 42.9617486339, "line_max": 81, "alpha_frac": 0.687383468, "autogenerated": false, ...
import direct.directbase.DirectStart from panda3d.core import AmbientLight, DirectionalLight, LightAttrib from panda3d.core import NodePath from panda3d.core import Vec3, Vec4 from direct.interval.IntervalGlobal import * #Needed to use Intervals from direct.gui.DirectGui import * #Importing math constants and funct...
{ "repo_name": "francholi/PandaExamples", "path": "Carousel/Tut-Carousel.py", "copies": "3", "size": "8840", "license": "mit", "hash": -5899880585902285000, "line_mean": 45.7724867725, "line_max": 79, "alpha_frac": 0.6824660633, "autogenerated": false, "ratio": 3.7457627118644066, "config_test":...
import direct.directbase.DirectStart from panda3d.core import NodePath,TextNode from panda3d.core import Vec3,Vec4 from direct.gui.OnscreenText import OnscreenText from direct.showbase.DirectObject import DirectObject from direct.interval.SoundInterval import SoundInterval from direct.gui.DirectSlider import DirectSli...
{ "repo_name": "francholi/PandaExamples", "path": "Music-Box/Tut-Music-Box.py", "copies": "3", "size": "6551", "license": "mit", "hash": 376989899608509300, "line_mean": 42.6733333333, "line_max": 82, "alpha_frac": 0.6647840024, "autogenerated": false, "ratio": 3.692784667418264, "config_test": ...
import direct.directbase.DirectStart from panda3d.core import TextNode from panda3d.core import Point2,Point3,Vec3,Vec4 from direct.gui.OnscreenText import OnscreenText from direct.showbase.DirectObject import DirectObject from direct.task.Task import Task from math import sin, cos, pi from random import randint, choi...
{ "repo_name": "francholi/PandaExamples", "path": "Asteroids/Tut-Asteroids.py", "copies": "3", "size": "17665", "license": "mit", "hash": -7775464810289108000, "line_mean": 45.0026041667, "line_max": 80, "alpha_frac": 0.650608548, "autogenerated": false, "ratio": 3.666459111664591, "config_test"...
import direct.directbase.DirectStart from panda3d.core import CollisionTraverser,CollisionNode from panda3d.core import CollisionHandlerQueue,CollisionRay from panda3d.core import Material,LRotationf,NodePath from panda3d.core import AmbientLight,DirectionalLight from panda3d.core import TextNode from panda3d.core imp...
{ "repo_name": "toontownfunserver/Panda3D-1.9.0", "path": "samples/Ball-in-Maze/Tut-Ball-in-Maze.py", "copies": "3", "size": "15789", "license": "bsd-3-clause", "hash": 3988090727896132000, "line_mean": 48.6509433962, "line_max": 80, "alpha_frac": 0.6988409652, "autogenerated": false, "ratio": 3.7...
import numpy as np from . import Differentiable import matrix_ops class Elementwise(Differentiable): __slots__ = ['X'] def __init__(self, X): super(Elementwise, self).__init__(X) self.X = X def _compute_shape(self, inputs=None): return self.X.shape # Just an alias for matrix addi...
{ "repo_name": "HIPS/Kayak", "path": "kayak/elem_ops.py", "copies": "3", "size": "3194", "license": "mit", "hash": -1103919681223018400, "line_mean": 29.1320754717, "line_max": 79, "alpha_frac": 0.6008140263, "autogenerated": false, "ratio": 3.3550420168067228, "config_test": false, "has_no_ke...
import itertools import numpy as np import numpy.random as npr class Fold(object): def __init__(self, cv, train, valid): self._cv = cv self._train = train self._valid = valid def train(self): if self._cv.targets is None: return self._cv.inputs[self._...
{ "repo_name": "davek44/Kayak", "path": "kayak/crossval.py", "copies": "3", "size": "2585", "license": "mit", "hash": -643063766234482400, "line_mean": 33.9324324324, "line_max": 161, "alpha_frac": 0.5528046422, "autogenerated": false, "ratio": 3.7903225806451615, "config_test": false, "has_no...
import numpy as np from . import Differentiable class DataNode(Differentiable): __slots__ = ['_batcher', '_data','_children', '_value', '_grad', '_loss', '_parents'] def __init__(self, data, batcher=None): if batcher is None: super(DataNode, self).__init__([]) else: sup...
{ "repo_name": "HIPS/Kayak", "path": "kayak/root_nodes.py", "copies": "2", "size": "1734", "license": "mit", "hash": -5647018632082680000, "line_mean": 28.8965517241, "line_max": 89, "alpha_frac": 0.6136101499, "autogenerated": false, "ratio": 3.5101214574898787, "config_test": false, "has_no_...
import numpy as np from numpy import exp import util from . import Differentiable from kayak import EPSILON class Nonlinearity(Differentiable): __slots__ = ['X'] def __init__(self, X): super(Nonlinearity, self).__init__((X,)) self.X = X class SoftReLU(Nonlinearity): __slots__ = ['scale'...
{ "repo_name": "HIPS/Kayak", "path": "kayak/nonlinearities.py", "copies": "2", "size": "5492", "license": "mit", "hash": 5598647180222029000, "line_mean": 32.6932515337, "line_max": 121, "alpha_frac": 0.5635469774, "autogenerated": false, "ratio": 2.9321943406300055, "config_test": false, "has...
import numpy as np from scipy.sparse import issparse from . import Differentiable class DataNode(Differentiable): __slots__ = ['_batcher', '_data','_children', '_value', '_grad', '_loss', '_parents'] def __init__(self, data, batcher=None): if batcher is None: super(DataNode, self).__init__...
{ "repo_name": "davek44/Kayak", "path": "kayak/root_nodes.py", "copies": "1", "size": "2032", "license": "mit", "hash": 2915009973305335000, "line_mean": 30.2615384615, "line_max": 89, "alpha_frac": 0.6067913386, "autogenerated": false, "ratio": 3.6350626118067977, "config_test": false, "has_n...
import numpy as np import numpy.random as npr import itertools as it from . import EPSILON from root_nodes import Parameter def checkgrad(variable, output, epsilon=1e-4, verbose=False): if not isinstance(variable, Parameter): raise Exception("Cannot evaluate gradient in terms of non-Parameter ...
{ "repo_name": "davek44/Kayak", "path": "kayak/util.py", "copies": "3", "size": "2292", "license": "mit", "hash": 7682779644727092000, "line_mean": 36.5737704918, "line_max": 126, "alpha_frac": 0.6492146597, "autogenerated": false, "ratio": 3.1483516483516483, "config_test": false, "has_no_key...
import numpy as np import numpy.random as npr from . import Differentiable, EPSILON class Dropout(Differentiable): __slots__ = ['X', 'drop_prob', '_rng', '_enhancement', '_mask'] def __init__(self, X, drop_prob=0.5, rng=None, batcher=None): if batcher is not None: super(Dropout, s...
{ "repo_name": "davek44/Kayak", "path": "kayak/dropout.py", "copies": "1", "size": "2568", "license": "mit", "hash": -9064371998065624000, "line_mean": 29.2117647059, "line_max": 74, "alpha_frac": 0.5638629283, "autogenerated": false, "ratio": 3.3612565445026177, "config_test": false, "has_no_...
import numpy as np import numpy.random as npr from . import Differentiable class Batcher(Differentiable): """Kayak class for managing batches of data. This class is intended to provide a simple interface for managing mini-batches of data, both on the input side and on the output side. It...
{ "repo_name": "HIPS/Kayak", "path": "kayak/batcher.py", "copies": "3", "size": "5008", "license": "mit", "hash": 9135207350775039000, "line_mean": 33.0680272109, "line_max": 79, "alpha_frac": 0.6230031949, "autogenerated": false, "ratio": 4.055060728744939, "config_test": false, "has_no_keywo...
import numpy as np import numpy.random as npr from . import Differentiable class Take(Differentiable): __slots__ = ['X', '_inds', '_axis'] def __init__(self, X, inds, axis=1): super(Take, self).__init__([X]) self.X = X self._inds = inds self._axis = ax...
{ "repo_name": "HIPS/Kayak", "path": "kayak/indexing.py", "copies": "3", "size": "1084", "license": "mit", "hash": -576241683916252600, "line_mean": 31.8484848485, "line_max": 65, "alpha_frac": 0.6060885609, "autogenerated": false, "ratio": 3.2261904761904763, "config_test": false, "has_no_key...
import numpy as np import scipy.linalg as spla from . import Differentiable class MatMult(Differentiable): __slots__ = ['A', 'B'] def __init__(self, A, B, *args): # Recurse to handle lists of arguments. if len(args) > 0: B = MatMult(B, *args) super(MatMult, self).__i...
{ "repo_name": "xebitstudios/Kayak", "path": "kayak/matrix_ops.py", "copies": "2", "size": "10507", "license": "mit", "hash": -5447895233136876000, "line_mean": 35.8666666667, "line_max": 101, "alpha_frac": 0.5860854668, "autogenerated": false, "ratio": 3.2752493765586035, "config_test": false, ...
import numpy as np import weakref class Differentiable(object): __slots__ = ['_value', '_grad', '_loss', '_parents', '_children','__weakref__','_parent_indices'] def __init__(self, parents=()): self._value = None # Cached value self._grad = None # Cached grad self._loss = None # Loss...
{ "repo_name": "davek44/Kayak", "path": "kayak/differentiable.py", "copies": "3", "size": "6602", "license": "mit", "hash": 5500025730991600000, "line_mean": 34.3048128342, "line_max": 101, "alpha_frac": 0.5958800364, "autogenerated": false, "ratio": 4.090458488228005, "config_test": false, "h...
import numpy as np from . import Differentiable class Regularizer(Differentiable): __slots__ = ['X', 'weight'] def __init__(self, X, weight): super(Regularizer, self).__init__([X]) self.X = X self.weight = weight class L2Norm(Regularizer): __slots__ = [] def __init__(sel...
{ "repo_name": "xebitstudios/Kayak", "path": "kayak/regularizers.py", "copies": "3", "size": "2109", "license": "mit", "hash": -9223203991666046000, "line_mean": 33.0161290323, "line_max": 97, "alpha_frac": 0.5926979611, "autogenerated": false, "ratio": 2.9049586776859506, "config_test": false, ...
import numpy as np from input_checking import check_equal_ndims_for_broadcasting from . import Differentiable class Loss(Differentiable): __slots__ = ['preds', 'targs'] def __init__(self, predictions, targets): super(Loss, self).__init__((predictions, targets)) self.preds = predictions ...
{ "repo_name": "davek44/Kayak", "path": "kayak/losses.py", "copies": "1", "size": "2672", "license": "mit", "hash": 8149545822819431000, "line_mean": 37.7246376812, "line_max": 82, "alpha_frac": 0.625748503, "autogenerated": false, "ratio": 3.34, "config_test": false, "has_no_keywords": false,...
import numpy as np import util from . import Differentiable import sys class Convolve1d(Differentiable): __slots__ = ['A', 'B', 'ncolors', 'stride'] def __init__(self, A, B, ncolors=1, stride=1): super(Convolve1d, self).__init__([A,B]) self.A = A self.B = B self....
{ "repo_name": "xebitstudios/Kayak", "path": "kayak/convolution.py", "copies": "3", "size": "7191", "license": "mit", "hash": 7327948249443548000, "line_mean": 36.453125, "line_max": 121, "alpha_frac": 0.5462383535, "autogenerated": false, "ratio": 3.3555762949136723, "config_test": false, "ha...
__author__ = 'sharvey' from classifiers import Classifier from corpus.mysql.reddit import RedditMySQLCorpus from ppm import Trie class RedditPPM(Classifier): trie = None def train(self, document, order=5): if (self.trie is not None): del self.trie self.trie = Trie(order) ...
{ "repo_name": "worldwise001/stylometry", "path": "classifiers/ppmc.py", "copies": "1", "size": "1106", "license": "mit", "hash": -6691101659347129000, "line_mean": 28.1315789474, "line_max": 81, "alpha_frac": 0.5415913201, "autogenerated": false, "ratio": 3.8536585365853657, "config_test": fals...
__author__ = 'sharvey' from parallel.thread import DataGetThread from parallel.thread import DataPutThread from parallel.thread import TaskThread from parallel.thread import tprint import feature.simple import time import multiprocessing from corpus.mysql.reddit import RedditMySQLCorpus from main import cred def ...
{ "repo_name": "worldwise001/stylometry", "path": "parallel/thread/__main__.py", "copies": "1", "size": "1885", "license": "mit", "hash": -3113085661225405400, "line_mean": 24.4864864865, "line_max": 95, "alpha_frac": 0.576127321, "autogenerated": false, "ratio": 3.244406196213425, "config_test"...
__author__ = 'sharvey' from threading import Thread import threading import traceback import sys import time queue = [] queue_lock = threading.Lock() queue_event = threading.Event() result = [] result_lock = threading.Lock() result_event = threading.Event() exit_event = threading.Event() end_event = threading.Even...
{ "repo_name": "worldwise001/stylometry", "path": "parallel/thread/__init__.py", "copies": "1", "size": "4856", "license": "mit", "hash": 5291994031405490000, "line_mean": 31.1589403974, "line_max": 78, "alpha_frac": 0.5045304778, "autogenerated": false, "ratio": 4.136286201022147, "config_test"...
__author__ = 'sharvey' import json import os, os.path import requests import shutil import socket import sys import tarfile import tempfile import threading import time import SocketServer import parser from store import Store import creds from reddit import Reddit datestart = '20131201' dateend = '20131231' tmpdir...
{ "repo_name": "aleboz/reddit-crawler", "path": "py/crawler.py", "copies": "1", "size": "15020", "license": "mit", "hash": 4714313281090383000, "line_mean": 32.8288288288, "line_max": 139, "alpha_frac": 0.5051930759, "autogenerated": false, "ratio": 4.061654948620876, "config_test": false, "ha...
__author__ = 'sharvey' import multiprocessing import mysql.connector import sys import time import traceback from corpus import Corpus class MySQLCorpus(Corpus): cnx = None def __init__(self, cpu_count=None): super(MySQLCorpus, self).__init__(cpu_count) def __del__(self): if self.cnx i...
{ "repo_name": "worldwise001/stylometry", "path": "corpus/mysql/__init__.py", "copies": "1", "size": "16496", "license": "mit", "hash": 7822352653279101000, "line_mean": 42.875, "line_max": 107, "alpha_frac": 0.5497090204, "autogenerated": false, "ratio": 3.7237020316027087, "config_test": false...
__author__ = 'sharvey' import multiprocessing from corpus.mysql.reddit import RedditMySQLCorpus from feature import ngram from feature import lexical import cred from operator import itemgetter import pprint import re def feature_to_numeric(features): corpus = RedditMySQLCorpus() corpus.setup(**(cred.kwargs...
{ "repo_name": "worldwise001/stylometry", "path": "main/gen_feature_sparse1.py", "copies": "1", "size": "3599", "license": "mit", "hash": 3526522064027245000, "line_mean": 38.1195652174, "line_max": 115, "alpha_frac": 0.5068074465, "autogenerated": false, "ratio": 3.430886558627264, "config_test...
__author__ = 'sharvey' import multiprocessing from corpus.mysql.reddit import RedditMySQLCorpus from feature import ngram from feature import lexical import cred import pprint import re def gen_feature(atuple): text = re.sub(r'https?://([a-zA-Z0-9\.\-_]+)[\w\-\._~:/\?#@!\$&\'\*\+,;=%%]*', '\\1...
{ "repo_name": "worldwise001/stylometry", "path": "main/gen_features.py", "copies": "1", "size": "3363", "license": "mit", "hash": -1281558242600140800, "line_mean": 37.6666666667, "line_max": 139, "alpha_frac": 0.4894439489, "autogenerated": false, "ratio": 3.4670103092783506, "config_test": fa...
__author__ = 'sharvey' import random from corpus.mysql import MySQLCorpus from corpus.mysql import util class RedditMySQLCorpus(MySQLCorpus): def __init__(self, cpu_count=None): super(RedditMySQLCorpus, self).__init__(cpu_count) def __del__(self): super(RedditMySQLCorpus, self).__del__() ...
{ "repo_name": "worldwise001/stylometry", "path": "corpus/mysql/reddit.py", "copies": "1", "size": "19791", "license": "mit", "hash": -7756102918097358000, "line_mean": 48.7286432161, "line_max": 120, "alpha_frac": 0.5024506089, "autogenerated": false, "ratio": 3.958991798359672, "config_test": ...
__author__ = 'Shashank' import requests import json import os import pandas as pd zips = [94102, 94103, 94104, 94105, 94107, 94108, 94109, 94110, 94111, 94112, 94114, 94115, 94116, 94117, 94118, 94121, 94122, 94123, 94124, 94127, 94129, 94130, 94131, 94132, 94133, 94134, 94158] coupon_data = [] for i in zips: url =...
{ "repo_name": "vjadon/Front-End-workspace", "path": "LHB - ETL Module/8Coupons.py", "copies": "1", "size": "3012", "license": "mit", "hash": -6217582585175369000, "line_mean": 60.4897959184, "line_max": 216, "alpha_frac": 0.7104913679, "autogenerated": false, "ratio": 2.997014925373134, "config...
__author__ = 'shaunjl' """ Tastypie REST API tests for ResolveDOI(View) """ from tastypie.test import ResourceTestCase, TestApiClient from django.contrib.auth.models import User from hs_core import hydroshare from tastypie.serializers import Serializer class TestResolveDOIView(ResourceTestCase): serializer = Se...
{ "repo_name": "hydroshare/hydroshare_temp", "path": "hs_core/tests/api/http/test_resolve_doi_view.py", "copies": "1", "size": "1281", "license": "bsd-3-clause", "hash": 687444208259104900, "line_mean": 25.6875, "line_max": 79, "alpha_frac": 0.6479313037, "autogenerated": false, "ratio": 3.5, "c...
__author__ = 'shaunjl' """ Tastypie API tests for update_account comments- IMPORTANT- update_account(user, **kwargs) contains a 'blacklist,' that chucks the username,password, and groups, if given. I only fixed it to work, but kept the blacklist as a relic to hopefully jog the developers memory as to what he intended...
{ "repo_name": "hydroshare/hydroshare_temp", "path": "hs_core/tests/api/native/test_update_account.py", "copies": "1", "size": "1577", "license": "bsd-3-clause", "hash": -6860299110180775000, "line_mean": 36.5476190476, "line_max": 92, "alpha_frac": 0.6360177552, "autogenerated": false, "ratio": 3...
__author__ = 'shaunjl' """ Tastypie REST API tests for CreateOrListAccounts.as_view() modeled after: https://github.com/hydroshare/hs_core/blob/master/tests/api/http/test_resource.py comments- post returns TypeError, put returns HttpResponseForbidden (403) get expects a json query in a dictionary like data={'query': s...
{ "repo_name": "hydroshare/hydroshare_temp", "path": "hs_core/tests/api/http/test_create_or_list_accounts.py", "copies": "1", "size": "4697", "license": "bsd-3-clause", "hash": 8867131220237410000, "line_mean": 37.1869918699, "line_max": 155, "alpha_frac": 0.6242282308, "autogenerated": false, "ra...
__author__ = 'shaunjl' """ Tastypie REST API tests for publish_resource(view) comments- """ from tastypie.test import ResourceTestCase, TestApiClient from django.contrib.auth.models import User from hs_core import hydroshare from tastypie.serializers import Serializer class TestResolveDOIView(ResourceTestCase): ...
{ "repo_name": "hydroshare/hydroshare_temp", "path": "hs_core/tests/api/http/test_publish_resource_view.py", "copies": "1", "size": "1078", "license": "bsd-3-clause", "hash": 2446350227678872000, "line_mean": 24.0697674419, "line_max": 79, "alpha_frac": 0.6586270872, "autogenerated": false, "ratio...
__author__ = 'shaunjl' """ Tastypie REST API tests for SetAccessRules.as_view() comments- getting 404s for both """ from tastypie.test import ResourceTestCase, TestApiClient from tastypie.serializers import Serializer from django.contrib.auth.models import User, Group from hs_core import hydroshare from hs_core.view...
{ "repo_name": "hydroshare/hydroshare_temp", "path": "hs_core/tests/api/http/test_set_access_rules_as_view.py", "copies": "1", "size": "1708", "license": "bsd-3-clause", "hash": -1845660646659926000, "line_mean": 27.4666666667, "line_max": 63, "alpha_frac": 0.5884074941, "autogenerated": false, "r...
__author__ = 'shaunjl' """ Tastypie REST API tests for SetResourceOwner.as_view comments- set owner test gives 403 """ from django.contrib.auth.models import User from hs_core import hydroshare from tastypie.test import ResourceTestCase, TestApiClient from tastypie.serializers import Serializer from hs_core.models im...
{ "repo_name": "hydroshare/hydroshare_temp", "path": "hs_core/tests/api/http/test_set_resource_owner.py", "copies": "1", "size": "1567", "license": "bsd-3-clause", "hash": -7133582311801893000, "line_mean": 30.9795918367, "line_max": 94, "alpha_frac": 0.6375239311, "autogenerated": false, "ratio":...