text stringlengths 0 1.05M | meta dict |
|---|---|
__author__ = 'hayden'
# measure the distances between fc 4096 vectors to find nearest neighbours
import json
import numpy as np
import cv2
import cv2.cv as cv
#features_path = PATH+DATASET+'/FEATURES/%s/%s/%s_SF%d_%s_feats.json' % (MODEL, ACCUMTYPE, SETTYPE, FRAMES, LAYER)
features_path = '/media/hayden/Storage/DATA... | {
"repo_name": "HaydenFaulkner/phd",
"path": "evaluation/fc_nn.py",
"copies": "1",
"size": "3331",
"license": "mit",
"hash": 3486626320461804500,
"line_mean": 34.8279569892,
"line_max": 178,
"alpha_frac": 0.5971179826,
"autogenerated": false,
"ratio": 2.7827903091060984,
"config_test": false,
... |
__author__ = 'hayden'
print(__doc__)
import numpy as np
import pickle
import matplotlib.pyplot as plt
from mpl_toolkits.mplot3d import Axes3D
from sklearn import datasets
from sklearn.decomposition import PCA
layer = 'fc6'
with open('/media/hayden/Storage/DATASETS/SPORT/TENNIS01/MODEL_TRAINING/tennis01_ground_test_p... | {
"repo_name": "HaydenFaulkner/phd",
"path": "pca/tennis_features_pca.py",
"copies": "1",
"size": "1886",
"license": "mit",
"hash": 2298092955779821800,
"line_mean": 25.2083333333,
"line_max": 130,
"alpha_frac": 0.690349947,
"autogenerated": false,
"ratio": 2.717579250720461,
"config_test": fals... |
__author__ = 'Haythem Sahbani'
# http://aimotion.blogspot.de/2011/10/machine-learning-with-python-linear.html
import numpy as np
class LinearLeastSquares:
"""
Linear least squares classifier
"""
def __init__(self, feature, learning_rate=0.01, number_iteration=5000, feature_normalizer=False):
... | {
"repo_name": "HaythemSahbani/Machine-learnig",
"path": "src/LinearLeastSquares.py",
"copies": "1",
"size": "3591",
"license": "mit",
"hash": 3015527772467155000,
"line_mean": 32.5607476636,
"line_max": 101,
"alpha_frac": 0.5605680869,
"autogenerated": false,
"ratio": 4.146651270207852,
"config... |
__author__ = 'Haythem Sahbani'
######################################
#
# This file contains
# the feature extraction classes
#
#
#######################################
import nltk
from sklearn.feature_extraction.text import TfidfVectorizer
from nltk import bigrams, FreqDist
class FeatureExtraction():
def __in... | {
"repo_name": "HaythemSahbani/Text-Mining",
"path": "src/feature_extraction.py",
"copies": "1",
"size": "5663",
"license": "mit",
"hash": -4693081231546931000,
"line_mean": 33.962962963,
"line_max": 182,
"alpha_frac": 0.594208017,
"autogenerated": false,
"ratio": 3.777851901267512,
"config_test... |
__author__ = 'Haythem Sahbani'
######################################
#
# This file contains the evaluation
# methods for the classification models.
# This process takes several hours.
#
#######################################
import preprocess
from feature_extraction import FeatureExtraction, PatternsFeatures
from n... | {
"repo_name": "HaythemSahbani/Text-Mining",
"path": "src/evaluation.py",
"copies": "1",
"size": "21750",
"license": "mit",
"hash": -3341017807930903600,
"line_mean": 49.5813953488,
"line_max": 163,
"alpha_frac": 0.5849195402,
"autogenerated": false,
"ratio": 3.3312911625057438,
"config_test": t... |
__author__ = 'Haythem Sahbani'
######################################
#
# This file contains the preprocess
# methods
#
#
#######################################
from nltk import RegexpTokenizer
import contractions
import stop_words
import re
from nltk.stem.porter import PorterStemmer
class Preprocess:
def __i... | {
"repo_name": "HaythemSahbani/Text-Mining",
"path": "src/preprocess.py",
"copies": "1",
"size": "4370",
"license": "mit",
"hash": -8857948279138387000,
"line_mean": 30.6739130435,
"line_max": 101,
"alpha_frac": 0.5359267735,
"autogenerated": false,
"ratio": 4.009174311926605,
"config_test": fal... |
__author__ = 'hcchen'
import peforth
from ipykernel.kernelbase import Kernel
class peforthKernel(Kernel):
implementation = 'peforth'
implementation_version = '1.0'
language = 'peforth'
language_version = '0.1'
language_info = {'mimetype': 'text/plain', 'name': 'peforth'}
banner = "Ipeforth Ker... | {
"repo_name": "hcchengithub/peforth",
"path": "peforth/peforthkernel.py",
"copies": "1",
"size": "1332",
"license": "mit",
"hash": -710402728842952000,
"line_mean": 37.0857142857,
"line_max": 81,
"alpha_frac": 0.6201201201,
"autogenerated": false,
"ratio": 3.6897506925207755,
"config_test": fal... |
from BaseHTTPServer import HTTPServer, BaseHTTPRequestHandler
import os, time
import multiprocessing as mp
import logging
import logging.config
import Queue
from Queue import Empty
import json
import cgi # for parsing form-data
# ---------------------------------------------------------------------... | {
"repo_name": "hdj666/maaps",
"path": "EPHttpListener/EPHttpListener.py",
"copies": "1",
"size": "7125",
"license": "apache-2.0",
"hash": 2510971196733895000,
"line_mean": 37.5135135135,
"line_max": 129,
"alpha_frac": 0.5664561404,
"autogenerated": false,
"ratio": 4.1520979020979025,
"config_te... |
import os
import threading, Queue
import logging, logging.config
import traceback
from pycode import PyCode
# -----------------------------------------------------------------------------
# import global shared definitions
parentdir = os.path.dirname(os.path.dirname(os.path.abspath(__file__)))
if parentdir not in os.s... | {
"repo_name": "hdj666/maaps",
"path": "ModPython/ModPython.py",
"copies": "1",
"size": "2496",
"license": "apache-2.0",
"hash": 1546398492709534500,
"line_mean": 34.6571428571,
"line_max": 87,
"alpha_frac": 0.5336538462,
"autogenerated": false,
"ratio": 4.091803278688524,
"config_test": false,
... |
import os
import sys
import time
import multiprocessing as mp
import logging, logging.config
from Queue import Empty
# -----------------------------------------------------------------------------
# import global shared definitions
parentdir = os.path.dirname(os.path.dirname(os.path.abspath(__file__)))
if parentdir no... | {
"repo_name": "hdj666/maaps",
"path": "EPLoop/EPLoop.py",
"copies": "1",
"size": "4036",
"license": "apache-2.0",
"hash": 6214751245762218000,
"line_mean": 35.6909090909,
"line_max": 109,
"alpha_frac": 0.5604558969,
"autogenerated": false,
"ratio": 4.031968031968032,
"config_test": false,
"ha... |
import os, re, sys
import logging, logging.config
# -----------------------------------------------------------------------------
# import global shared definitions
parentdir = os.path.dirname(os.path.dirname(os.path.abspath(__file__)))
if parentdir not in os.sys.path:
os.sys.path.insert(0,parentdir)
from shared im... | {
"repo_name": "hdj666/maaps",
"path": "ModPython/pycode.py",
"copies": "1",
"size": "3881",
"license": "apache-2.0",
"hash": -4563196933759778300,
"line_mean": 36.3173076923,
"line_max": 103,
"alpha_frac": 0.542385983,
"autogenerated": false,
"ratio": 4.013443640124095,
"config_test": false,
... |
__author__ = 'heddevanderheide'
# Django specific
from django.conf import settings
from django.db import models
from django.utils.translation import ugettext as _
# App specific
from networth.managers import NetworthManager
from networth.mixins import NetworthMixin
class NetworthModel(NetworthMixin, models.Model):
... | {
"repo_name": "Hedde/django-networth",
"path": "networth/models.py",
"copies": "1",
"size": "1881",
"license": "mit",
"hash": 8936496673371420000,
"line_mean": 28.40625,
"line_max": 85,
"alpha_frac": 0.6012759171,
"autogenerated": false,
"ratio": 4.002127659574468,
"config_test": false,
"has_... |
__author__ = 'heddevanderheide'
# Django specific
from django.contrib.auth.decorators import user_passes_test
from django.core.exceptions import PermissionDenied
from django.http import Http404
from django.utils.decorators import method_decorator
from django.utils.translation import ugettext_lazy as _
# App specific
... | {
"repo_name": "Hedde/fabric_interface",
"path": "src/fabric_interface/mixins.py",
"copies": "1",
"size": "2585",
"license": "mit",
"hash": -5650674693275625000,
"line_mean": 29.0697674419,
"line_max": 81,
"alpha_frac": 0.6560928433,
"autogenerated": false,
"ratio": 4.0390625,
"config_test": fal... |
__author__ = 'heddevanderheide'
# Django specific
from django.contrib import messages
from django.contrib.auth.views import login
from django.core.urlresolvers import reverse_lazy, reverse
from django.http import HttpResponseRedirect
from django.views.generic import TemplateView, RedirectView
from django.utils.transla... | {
"repo_name": "Hedde/fabric_interface",
"path": "src/fabric_interface/views.py",
"copies": "1",
"size": "5012",
"license": "mit",
"hash": 591264878042957300,
"line_mean": 31.1346153846,
"line_max": 117,
"alpha_frac": 0.6360734238,
"autogenerated": false,
"ratio": 3.971473851030111,
"config_test... |
__author__ = 'heddevanderheide'
# Django specific
from django.contrib import messages
from django.core.urlresolvers import reverse_lazy, reverse
from django.http import HttpResponseRedirect
from django.utils.datastructures import SortedDict
from django.utils.translation import ugettext_lazy as _
from django.views.gene... | {
"repo_name": "Hedde/fabric_interface",
"path": "src/fabric_interface/hosts/views.py",
"copies": "1",
"size": "3789",
"license": "mit",
"hash": 1713901632390464500,
"line_mean": 33.4545454545,
"line_max": 95,
"alpha_frac": 0.6513591977,
"autogenerated": false,
"ratio": 3.9926238145416226,
"conf... |
__author__ = 'heddevanderheide'
# Django specific
from django.contrib import messages
from django.core.urlresolvers import reverse
from django.http import HttpResponseRedirect
from django.utils.translation import ugettext_lazy as _
from django.views.generic import (
DetailView, CreateView, UpdateView, DeleteView
)... | {
"repo_name": "Hedde/fabric_interface",
"path": "src/fabric_interface/configurations/views.py",
"copies": "1",
"size": "4990",
"license": "mit",
"hash": 8621413153038712000,
"line_mean": 36.5263157895,
"line_max": 107,
"alpha_frac": 0.6827655311,
"autogenerated": false,
"ratio": 4.218089602704987... |
__author__ = 'heddevanderheide'
# Django specific
from django.core.mail import EmailMultiAlternatives
from django.db import models
from django.contrib.auth.models import (
AbstractBaseUser, PermissionsMixin
)
from django.contrib.contenttypes.models import ContentType
from django.template.defaultfilters import stri... | {
"repo_name": "Hedde/fabric_interface",
"path": "src/fabric_interface/models.py",
"copies": "1",
"size": "3273",
"license": "mit",
"hash": 6766620157108580000,
"line_mean": 32.7525773196,
"line_max": 119,
"alpha_frac": 0.6461961503,
"autogenerated": false,
"ratio": 3.948130277442702,
"config_te... |
__author__ = 'heddevanderheide'
# Django specific
from django.db import models
from django.utils.safestring import mark_safe
from django.utils.translation import ugettext_lazy as _
# App specific
from django_extensions.db.fields import AutoSlugField
from django_extensions.db.models import TimeStampedModel
from mptt.f... | {
"repo_name": "Hedde/fabric_interface",
"path": "src/fabric_interface/formulae/models.py",
"copies": "1",
"size": "1561",
"license": "mit",
"hash": -823041238230849000,
"line_mean": 30.24,
"line_max": 83,
"alpha_frac": 0.6912235746,
"autogenerated": false,
"ratio": 3.8734491315136474,
"config_t... |
__author__ = 'heddevanderheide'
# Django specific
from django.db import models
from django.utils.translation import ugettext_lazy as _
# App specific
from django_extensions.db.fields import AutoSlugField
from django_extensions.db.models import TimeStampedModel
from fabric_interface.projects.models import Configuratio... | {
"repo_name": "Hedde/fabric_interface",
"path": "src/fabric_interface/stages/models.py",
"copies": "1",
"size": "1112",
"license": "mit",
"hash": -3829474808547944000,
"line_mean": 30.8,
"line_max": 97,
"alpha_frac": 0.6717625899,
"autogenerated": false,
"ratio": 4.180451127819549,
"config_test... |
__author__ = 'heddevanderheide'
# Django specific
from django.db import models
from django.utils.translation import ugettext_lazy as _
# App specific
from django_extensions.db.models import TimeStampedModel
from fabric_interface.projects import constants
class Configuration(TimeStampedModel):
project = models.F... | {
"repo_name": "Hedde/fabric_interface",
"path": "src/fabric_interface/configurations/models.py",
"copies": "1",
"size": "1622",
"license": "mit",
"hash": 297545295269525700,
"line_mean": 32.8125,
"line_max": 115,
"alpha_frac": 0.6806411837,
"autogenerated": false,
"ratio": 3.9754901960784315,
"... |
__author__ = 'heddevanderheide'
# Django specific
from django import forms
from django.contrib.auth import get_user_model
from django.contrib.auth.models import Permission
from django.db.models import Q
from django.utils.translation import ugettext_lazy as _
# App specific
from fabric_interface.models import User
c... | {
"repo_name": "Hedde/fabric_interface",
"path": "src/fabric_interface/forms.py",
"copies": "1",
"size": "3853",
"license": "mit",
"hash": 4457437726311175000,
"line_mean": 36.7843137255,
"line_max": 99,
"alpha_frac": 0.6337918505,
"autogenerated": false,
"ratio": 4.16991341991342,
"config_test"... |
__author__ = 'heddevanderheide'
# Django specific
from django import forms
from django.core.exceptions import ObjectDoesNotExist
# App specific
from fabric_interface.projects.models import Project, Configuration
from fabric_interface.stages.models import Stage
class ConfigurationForm(forms.ModelForm):
project_q... | {
"repo_name": "Hedde/fabric_interface",
"path": "src/fabric_interface/configurations/forms.py",
"copies": "1",
"size": "1092",
"license": "mit",
"hash": 5898922464730066000,
"line_mean": 29.3611111111,
"line_max": 93,
"alpha_frac": 0.6575091575,
"autogenerated": false,
"ratio": 4.403225806451613,... |
__author__ = 'heddevanderheide'
# Django specific
from django import forms
from django.utils.translation import ugettext_lazy as _
# App specific
from codemirror.widgets import CodeMirrorTextarea
from fabric_interface.formulae.models import (
Formula, Fabfile
)
class FormulaForm(forms.ModelForm):
code = for... | {
"repo_name": "Hedde/fabric_interface",
"path": "src/fabric_interface/formulae/forms.py",
"copies": "1",
"size": "1293",
"license": "mit",
"hash": 5464512050664623000,
"line_mean": 23.8846153846,
"line_max": 112,
"alpha_frac": 0.6295436968,
"autogenerated": false,
"ratio": 3.906344410876133,
"c... |
__author__ = 'heddevanderheide'
import re
# Django specific
from django.http import HttpResponseRedirect
from django.conf import settings
class LoginRequiredMiddleware(object):
def __init__(self):
self.login_url = getattr(settings, 'LOGIN_URL', '/accounts/login/')
if hasattr(settings, 'PUBLIC_UR... | {
"repo_name": "Hedde/fabric_interface",
"path": "src/fabric_interface/middleware.py",
"copies": "1",
"size": "1478",
"license": "mit",
"hash": -3386616854902290000,
"line_mean": 36.9230769231,
"line_max": 96,
"alpha_frac": 0.5676589986,
"autogenerated": false,
"ratio": 4.296511627906977,
"confi... |
__author__ = 'heddevanderheide'
import unittest
# App specific
from networth.mixins import NetworthMixin
class TestObject(NetworthMixin):
first_name = ''
last_name = ''
tags = None
class Networth:
fields = (
('first_name', (True, 1)),
('last_name', (lambda f: f.star... | {
"repo_name": "Hedde/django-networth",
"path": "networth/unittests.py",
"copies": "1",
"size": "1434",
"license": "mit",
"hash": 4209273522948263400,
"line_mean": 22.9166666667,
"line_max": 67,
"alpha_frac": 0.5285913529,
"autogenerated": false,
"ratio": 3.3741176470588234,
"config_test": true,... |
__author__ = 'heddevanderheide'
class NetworthMixin(object):
def get_default_networth(self):
return 1
def networth(self, realtime=True, commit=False):
return self.__networth(commit=commit)
def __networth(self, commit=False):
n = self.get_default_networth()
for field in s... | {
"repo_name": "Hedde/django-networth",
"path": "networth/mixins.py",
"copies": "1",
"size": "1419",
"license": "mit",
"hash": 7823630985183202000,
"line_mean": 23.9122807018,
"line_max": 91,
"alpha_frac": 0.4538407329,
"autogenerated": false,
"ratio": 4.420560747663552,
"config_test": false,
... |
__author__ = 'Helder C. R. de Oliveira'
__email__ = 'heldercro@gmail.com'
__url__ = 'http://helderc.net'
"""
This is an improved implementation of SSIM, based on version of:
Antoine Vacavant, ISIT lab, antoine.vacavant@iut.u-clermont1.fr,
http://isit.u-clermont1.fr/~anvacava
References:
[1] Z.... | {
"repo_name": "paulu/deepmanifold",
"path": "SSIM_Index.py",
"copies": "2",
"size": "3099",
"license": "mit",
"hash": -195886912282796700,
"line_mean": 29.0873786408,
"line_max": 125,
"alpha_frac": 0.5940626008,
"autogenerated": false,
"ratio": 2.740053050397878,
"config_test": false,
"has_no... |
import socket
import binascii
from lib.common import save_script_result
ports_to_check = 445
def get_tree_connect_request(ip, tree_id):
ipc = "005c5c" + binascii.hexlify(ip) + "5c49504324003f3f3f3f3f00"
ipc_len_hex = hex(len(ipc) / 2).replace("0x", "")
smb = "ff534d42750000000018012800000000000000000000... | {
"repo_name": "lijiejie/BBScan",
"path": "scripts/disabled/smb_ms17010.py",
"copies": "1",
"size": "3733",
"license": "apache-2.0",
"hash": 2087810314614282000,
"line_mean": 49.4459459459,
"line_max": 119,
"alpha_frac": 0.7109563354,
"autogenerated": false,
"ratio": 3.1449031171019377,
"config_... |
import re
import os
import random
import json
import string
import ctypes
from myexception import *
PATH = './img/'
dm2 = ctypes.WinDLL('./CrackCaptchaAPI.dll')
if not os.path.exists('./img'):
os.mkdir('./img')
def str_tr(content):
instr = "0123456789"
outstr ="QAEDTGUJOL"
trantab = string.maketran... | {
"repo_name": "dading/iphone_order",
"path": "util.py",
"copies": "2",
"size": "3365",
"license": "apache-2.0",
"hash": -6485677168773171000,
"line_mean": 25.92,
"line_max": 139,
"alpha_frac": 0.6059435364,
"autogenerated": false,
"ratio": 3.0507706255666363,
"config_test": false,
"has_no_key... |
import hashlib
from PyQt4 import QtGui
import util
class LoginDialog(QtGui.QDialog):
m = hashlib.md5()
def __init__(self, parent=None):
QtGui.QDialog.__init__(self,parent)
self.setWindowTitle(u'登录')
self.resize(300,150)
self.font=QtGui.QFont("Times", 10, QtGui.QFont.Bold)
... | {
"repo_name": "dading/iphone_order",
"path": "dialog.py",
"copies": "2",
"size": "3010",
"license": "apache-2.0",
"hash": -8209902373437478000,
"line_mean": 34.6024096386,
"line_max": 106,
"alpha_frac": 0.6364251862,
"autogenerated": false,
"ratio": 3.2390350877192984,
"config_test": false,
"... |
__author__ = 'helloworld'
from Authenticator import authenticator, InvalidUsername, AuthException
class PermissionError(Exception):
pass
class Authorizor:
def __init__(self, authenticator):
self.authenticator = authenticator
self.permissions = {}
def add_permission(self, perm_name):
... | {
"repo_name": "fmdallas/myTornadoWebApp",
"path": "auth/Authorizor.py",
"copies": "1",
"size": "1636",
"license": "mit",
"hash": 1388880729880667000,
"line_mean": 24.9682539683,
"line_max": 71,
"alpha_frac": 0.6051344743,
"autogenerated": false,
"ratio": 4.582633053221288,
"config_test": false,... |
import os, serial, time, praw
class led_controller:
def __init__(self, port=None):
if os.name == 'nt':
self.port = 'COM4'
elif os.name == 'posix':
self.port = '/dev/ttyACM0'
if port is not None:
self.port = port
try:
self.board = se... | {
"repo_name": "hemanth42/Arduino-Reddit",
"path": "old_src/reddit_arduino.py",
"copies": "1",
"size": "1739",
"license": "mit",
"hash": -6069042875628620000,
"line_mean": 23.8428571429,
"line_max": 88,
"alpha_frac": 0.5221391604,
"autogenerated": false,
"ratio": 3.8388520971302427,
"config_test... |
import os, serial, time, praw
class led_controller:
def __init__(self, port=None):
if os.name == 'nt':
self.port = 'COM4'
elif os.name == 'posix':
self.port = '/dev/ttyACM0'
if port is not None:
self.port = port
try:
self.board = s... | {
"repo_name": "hemanth42/Arduino-Reddit",
"path": "arduino_reddit/__init__.py",
"copies": "1",
"size": "2066",
"license": "mit",
"hash": -3078300437167546000,
"line_mean": 26.1842105263,
"line_max": 88,
"alpha_frac": 0.5469506292,
"autogenerated": false,
"ratio": 3.8544776119402986,
"config_tes... |
import getpass, random, sha, string
#The character set used in the password
#!!!CAUTION!!!:
#Do not change this string. Else, you may not get back the same password again
# In every row from top to bottom, move from left to right
# Then in the same order all shifted characters are taken
ALPHABETS = r'''`1234567890-=... | {
"repo_name": "ActiveState/code",
"path": "recipes/Python/440564_easy_password_generator_using_standard/recipe-440564.py",
"copies": "1",
"size": "5128",
"license": "mit",
"hash": -8391560902076978000,
"line_mean": 43.2068965517,
"line_max": 113,
"alpha_frac": 0.7008580343,
"autogenerated": false,
... |
__author__ = 'heni'
import nltk
import collections
def _get_pos_index(pos,pos_ind_dict):
ind=
def get_dataset_pos_tags(dataset_path):
dataset_file=open(dataset_path,'r')
dataset_lines=dataset_file.readlines()
sentences_pos_tags=[]
for i in range(0,len(dataset_lines)):
sentence=dataset_li... | {
"repo_name": "hbenarab/mt-iebkg",
"path": "ollie_comparison/utils/ollie_dataset_stats.py",
"copies": "1",
"size": "2717",
"license": "mit",
"hash": -3895446372171433500,
"line_mean": 28.2150537634,
"line_max": 106,
"alpha_frac": 0.5800515274,
"autogenerated": false,
"ratio": 3.1158256880733943,
... |
__author__ = 'heni'
import numpy
import os
from preprocess.wordemb import WordEmbeddings
from preprocess.labeledText import LabeledText
from rnn.elman_model import Elman
def get_data_from_iob(iob_dataset_path):
iob_dataset_file=open(iob_dataset_path,'r')
lines = iob_dataset_file.readlines()
data_to_add ... | {
"repo_name": "hbenarab/mt-iebkg",
"path": "ollie_comparison/utils/training_tools.py",
"copies": "1",
"size": "2953",
"license": "mit",
"hash": -2962330676846422000,
"line_mean": 32.1797752809,
"line_max": 92,
"alpha_frac": 0.6109041653,
"autogenerated": false,
"ratio": 3.1924324324324322,
"con... |
__author__ = 'heni'
import os
import ollie_comparison.utils.preprocess_tools
def _ollie_output_to_log(ollie_groundtruth_file,log_file_name):
# ollie_groundtruth=open(ollie_groundtruth_file,'r')
# ollie_sentences=open('data/ollie_trainset.txt','r')
# groundtruth_lines=ollie_groundtruth.readlines()
# ... | {
"repo_name": "hbenarab/mt-iebkg",
"path": "ollie_comparison/ollieOutput_to_iob.py",
"copies": "1",
"size": "4804",
"license": "mit",
"hash": 2373733541981129700,
"line_mean": 34.0729927007,
"line_max": 128,
"alpha_frac": 0.5314321399,
"autogenerated": false,
"ratio": 3.22632639355272,
"config_... |
__author__ = 'heni'
import os
# This function aims to find the specific label of a phrase in the sentence
def find_label(element, labels):
c = 0
found = False
while c < len(labels) and not found:
if labels[c] in element:
found = True
else:
c += 1
return labels[... | {
"repo_name": "hbenarab/mt-iebkg",
"path": "preprocess/openie2iob_format.py",
"copies": "1",
"size": "4633",
"license": "mit",
"hash": 7035814728081548000,
"line_mean": 35.203125,
"line_max": 118,
"alpha_frac": 0.5970213684,
"autogenerated": false,
"ratio": 3.676984126984127,
"config_test": fal... |
__author__ = 'heni'
import sklearn.metrics
import numpy
def get_ollie_iob_performance(ollie_output_file_path,ollie_groundtruth_file_path):
ollie_output_file=open(ollie_output_file_path,'r')
print('Ollie output file loaded: "%s"' % ollie_output_file_path)
ollie_groundtruth_file=open(ollie_groundtruth_file_... | {
"repo_name": "hbenarab/mt-iebkg",
"path": "ollie_comparison/get_ollie_iob_results.py",
"copies": "1",
"size": "3045",
"license": "mit",
"hash": 8299185803092113000,
"line_mean": 44.447761194,
"line_max": 119,
"alpha_frac": 0.6683087028,
"autogenerated": false,
"ratio": 3.2018927444794953,
"con... |
__author__ = 'heni'
def write_best_extraction(sentence_extractions, best_extractions_file):
scores = []
for element in sentence_extractions:
scores.append(element.split('\t')[1])
assert len(scores) == len(sentence_extractions)
best_ext_ind = scores.index(max(scores))
best_ext = sentence_e... | {
"repo_name": "hbenarab/mt-iebkg",
"path": "ollie_comparison/utils/preprocess_tools.py",
"copies": "1",
"size": "5073",
"license": "mit",
"hash": 3809014601694051000,
"line_mean": 31.3121019108,
"line_max": 107,
"alpha_frac": 0.563374729,
"autogenerated": false,
"ratio": 3.4184636118598384,
"co... |
__author__ = 'heni'
# this class allows to manage word-to-index dictionaries
class WordEmbeddings(object):
def __init__(self):
self.words = []
self.words2index = {}
self.index2words = {}
self.changed = False
def setDictionary(self,dict):
self.words2index=dict
r... | {
"repo_name": "hbenarab/mt-iebkg",
"path": "preprocess/wordemb.py",
"copies": "1",
"size": "3004",
"license": "mit",
"hash": 8662490597014508000,
"line_mean": 29.04,
"line_max": 73,
"alpha_frac": 0.6098535286,
"autogenerated": false,
"ratio": 4.092643051771117,
"config_test": false,
"has_no_k... |
__author__ = 'henningo'
from ..tiremodelbase import TireModelBase
from ..solvermode import SolverMode
import math
import numpy as np
from PAC2002_Core import PAC2002_Core
class PAC2002(TireModelBase):
def createmodel(self):
self.ModelInfo = dict()
self.Coefficients = dict()
s... | {
"repo_name": "OpenTire/OpenTire",
"path": "code/opentire/TireModel/PAC2002/PAC2002.py",
"copies": "1",
"size": "22099",
"license": "mit",
"hash": -791919069326977000,
"line_mean": 36.5,
"line_max": 199,
"alpha_frac": 0.5629213992,
"autogenerated": false,
"ratio": 2.8492779783393503,
"config_te... |
__author__ = 'henningo'
from opentire import OpenTire
import os
class TIRFile():
def __init__(self, *args, **kwargs):
self.template_file = 'TIR'
self.tire_model = None
self.Coefficients = dict()
self.Descriptions = dict()
self.Comments = ""
def load(self... | {
"repo_name": "OpenTire/OpenTire",
"path": "code/opentire/Core/TIRFile.py",
"copies": "1",
"size": "4360",
"license": "mit",
"hash": -5812567741559906000,
"line_mean": 34.9661016949,
"line_max": 110,
"alpha_frac": 0.5630733945,
"autogenerated": false,
"ratio": 4.270323212536729,
"config_test": ... |
__author__ = 'henningo'
import math
import numpy as np
# TODO: Use underscore to make it indicate "private" methods
class PAC2002_Core():
#Region "Pure Fy"
def calculate_gamma_y(self, p, gamma_star):
# 32
gamma_y = gamma_star * p['LGAY'] # Lambda Gamma Y
return gam... | {
"repo_name": "OpenTire/OpenTire",
"path": "code/opentire/TireModel/PAC2002/PAC2002_Core.py",
"copies": "1",
"size": "8525",
"license": "mit",
"hash": -1042720125465350000,
"line_mean": 23.5239520958,
"line_max": 168,
"alpha_frac": 0.4581818182,
"autogenerated": false,
"ratio": 2.6508084577114426... |
__author__ = 'Henri Bunting'
try:
import brian2
from brian2 import pF, mV, defaultclock, ms, NeuronGroup, linspace, SpikeMonitor, \
PopulationRateMonitor, StateMonitor, run, msecond, nS, nA
except ImportError:
brian2 = None
def run_network():
monitor_dict={}
defaultclock.dt= 0.01*ms
... | {
"repo_name": "nigroup/pypet",
"path": "pypet/tests/unittests/brian2tests/run_a_brian2_network.py",
"copies": "1",
"size": "1351",
"license": "bsd-3-clause",
"hash": 2097037158023188700,
"line_mean": 20.8064516129,
"line_max": 87,
"alpha_frac": 0.6306439674,
"autogenerated": false,
"ratio": 2.762... |
__author__ = ['Henri Bunting', 'Robert Meyer']
import numpy as np
import time
import os
try:
import brian2
from brian2 import NeuronGroup, Synapses, SpikeMonitor, StateMonitor, mV, ms, Network, second, \
PopulationRateMonitor
from pypet.brian2.parameter import Brian2Parameter, Brian2MonitorResult... | {
"repo_name": "SmokinCaterpillar/pypet",
"path": "pypet/tests/integration/brian2tests/another_network_test.py",
"copies": "2",
"size": "3719",
"license": "bsd-3-clause",
"hash": -7561106605032065000,
"line_mean": 33.7663551402,
"line_max": 100,
"alpha_frac": 0.5611723582,
"autogenerated": false,
... |
__author__ = 'Henry Senyondo'
import os
import platform
import sys
current_platform = platform.system().lower()
if current_platform != 'windows':
pass
current_platform = platform.system().lower()
if current_platform != 'windows':
import pwd
VERSION = 'v0.1'
MASTER = False
COPYRIGHT = "Copyright (C) 2015 the D... | {
"repo_name": "henrykironde/weaverhenry",
"path": "__init__.py",
"copies": "1",
"size": "2343",
"license": "mit",
"hash": -4846376036960454000,
"line_mean": 31.095890411,
"line_max": 98,
"alpha_frac": 0.6218523261,
"autogenerated": false,
"ratio": 3.304654442877292,
"config_test": false,
"has... |
__author__ = 'hensh'
from django.contrib.auth.models import Group
from permissions import *
def __getGroupOrNone(groupName):
try:
return Group.objects.get(name = groupName)
except Group.DoesNotExist:
return None
def get_group_admin():
group_name = "Admins"
group = __getGroupOrNone(gr... | {
"repo_name": "IlyaSergeev/taxi_service",
"path": "TaxiService/user_groups.py",
"copies": "1",
"size": "1685",
"license": "mit",
"hash": 4537682394284338700,
"line_mean": 29.6545454545,
"line_max": 59,
"alpha_frac": 0.6059347181,
"autogenerated": false,
"ratio": 3.9647058823529413,
"config_test... |
__author__ = 'hensh'
from django.contrib.auth.models import Permission
from django.contrib.contenttypes.models import ContentType
from TaxiService.models import Car, Ride, User
#TODO refactoring. Extract all permission creators to disctionary + factory method
def __get_permission_or_none(codename):
try:
... | {
"repo_name": "IlyaSergeev/taxi_service",
"path": "TaxiService/permissions.py",
"copies": "1",
"size": "1994",
"license": "mit",
"hash": 8079865156584669000,
"line_mean": 34,
"line_max": 82,
"alpha_frac": 0.6685055165,
"autogenerated": false,
"ratio": 4.260683760683761,
"config_test": false,
... |
__author__ = 'hensh'
from django.shortcuts import render_to_response
from django.template import RequestContext
from TaxiService.models import Car, Ride, Driver
from django.http import Http404
from dateutil import parser
from django.shortcuts import redirect
from TaxiService.required_group_test import group_required
... | {
"repo_name": "IlyaSergeev/taxi_service",
"path": "TaxiService/views/ride_views.py",
"copies": "1",
"size": "2989",
"license": "mit",
"hash": -26347225773268960,
"line_mean": 26.6851851852,
"line_max": 143,
"alpha_frac": 0.6306457009,
"autogenerated": false,
"ratio": 3.416,
"config_test": false... |
__author__ = 'hensh'
from django.shortcuts import render_to_response
from django.template import RequestContext
from TaxiService.models import Driver, User, Car
from TaxiService.required_group_test import group_required
from TaxiService.user_groups import get_group_driver
from django.http import Http404
from django.sh... | {
"repo_name": "IlyaSergeev/taxi_service",
"path": "TaxiService/views/driver_views.py",
"copies": "1",
"size": "2225",
"license": "mit",
"hash": 4446696820561191000,
"line_mean": 26.825,
"line_max": 85,
"alpha_frac": 0.6071910112,
"autogenerated": false,
"ratio": 3.869565217391304,
"config_test"... |
__author__ = 'hensh'
from django.shortcuts import render_to_response
from TaxiService.required_group_test import group_required
from django.template import RequestContext
from django.http import Http404
from django.shortcuts import redirect
from TaxiService.models import Car, Driver
# TODO add permitions
@group_requ... | {
"repo_name": "IlyaSergeev/taxi_service",
"path": "TaxiService/views/car_views.py",
"copies": "1",
"size": "3197",
"license": "mit",
"hash": 1454631387311212300,
"line_mean": 25.6416666667,
"line_max": 73,
"alpha_frac": 0.5899280576,
"autogenerated": false,
"ratio": 3.856453558504222,
"config_t... |
__author__ = 'hensh'
from TaxiService.required_group_test import group_required
from TaxiService.user_groups import *
from TaxiService.models import Driver
from django.shortcuts import render_to_response
from django.http import Http404
from django.template import RequestContext
from django.shortcuts import redirect
d... | {
"repo_name": "IlyaSergeev/taxi_service",
"path": "TaxiService/views/account_views.py",
"copies": "1",
"size": "4095",
"license": "mit",
"hash": 2330976093812118000,
"line_mean": 27.6433566434,
"line_max": 88,
"alpha_frac": 0.600976801,
"autogenerated": false,
"ratio": 3.8925855513307983,
"conf... |
__author__ = 'herald olivares'
from django import template
from django.template import TemplateSyntaxError, Node
from django.utils.datastructures import SortedDict
from django.utils.http import urlencode
from django.utils.html import escape
import re
register = template.Library()
kwarg_re = re.compile(r"(?:(.+)=)?(.... | {
"repo_name": "heraldmatias/enssec",
"path": "src/inei/enssec/templatetags/querytags.py",
"copies": "2",
"size": "2515",
"license": "apache-2.0",
"hash": -4049903299028126700,
"line_mean": 30.0617283951,
"line_max": 78,
"alpha_frac": 0.6258449304,
"autogenerated": false,
"ratio": 3.87519260400616... |
__author__ = 'hernan'
import csv
import psycopg2
from datetime import date
HOST = 'ec2-107-22-234-129.compute-1.amazonaws.com'
DATABASE = 'de5svld1vf8lt4'
USER = 'mpgnghxzhorpdj'
PASSWORD = 'HtZFVvyVLfXh4Qk2wemNHLHvnu'
def cargar_alumnos():
conn_string = 'host=%s dbname=%s user=%s password=%s' % (HOST, DATABA... | {
"repo_name": "jsatch/creamas-enrollment",
"path": "data/carga_alumnos.py",
"copies": "1",
"size": "1288",
"license": "apache-2.0",
"hash": 3781322262050717000,
"line_mean": 32.0256410256,
"line_max": 125,
"alpha_frac": 0.5628881988,
"autogenerated": false,
"ratio": 2.7818574514038876,
"config_... |
__author__ = 'heroico'
#trimmed from PredictDBAnalysis/gencode_input
import csv
import gzip
import pandas
K_NOT_GENES = ["transcript","exon","CDS","UTR","start_codon","stop_codon","Selenocysteine"];
# look at gencode http://www.gencodegenes.org/data_format.html
class GFTF:
"""gencode file table format"""
CHR... | {
"repo_name": "hakyimlab/MetaXcan-Postprocess",
"path": "source/Gencode.py",
"copies": "1",
"size": "2470",
"license": "mit",
"hash": 169699788725399740,
"line_mean": 27.7325581395,
"line_max": 95,
"alpha_frac": 0.5967611336,
"autogenerated": false,
"ratio": 3.0683229813664594,
"config_test": f... |
from scipy import *
# Cartan Matrix for the given rep
C = array([[2., -1.], [-1., 2.]]) #SU(3)
#C = array([[2., -1., 0.], [-1., 2., -2.], [0., -1., 2.]]) #B3
N = len(C)
# Dynkin Coeffs for the hightest weight
d_highest = array([1, 0])
#d_highest = array([1, 1]) #SU(3) Adjoint rep
#d_highest = array([0, 0, 1]) #B3
#... | {
"repo_name": "hershsingh/thesis-iitm-code",
"path": "cartan_wvecs.py",
"copies": "1",
"size": "2524",
"license": "mit",
"hash": 8829426216918971000,
"line_mean": 28.0114942529,
"line_max": 121,
"alpha_frac": 0.5614104596,
"autogenerated": false,
"ratio": 3.0191387559808613,
"config_test": fals... |
__author__ = 'hfriedrich'
import numpy as np
from tools.tensor_utils import SparseTensor
from math import log10
from scipy.sparse import csr_matrix
# see http://en.wikipedia.org/wiki/Okapi_BM25
# parameters:
# tensor: SparseTensor object
# indices: indices pointing to (need, need) combinations to compute the connecti... | {
"repo_name": "researchstudio-sat/wonpreprocessing",
"path": "python-processing/tools/bm25.py",
"copies": "1",
"size": "2555",
"license": "apache-2.0",
"hash": -8738371858494878000,
"line_mean": 40.2096774194,
"line_max": 115,
"alpha_frac": 0.6583170254,
"autogenerated": false,
"ratio": 3.5048010... |
__author__ = 'hfriedrich'
import os
from gexf import Gexf
from time import strftime
from tensor_utils import SparseTensor
from evaluation_utils import NeedEvaluationDetailDict, NeedEvaluationDetails
# create a gexf graph from the tensor for visualization in gephi
# add the following data:
# - needs (nodes)
# - connec... | {
"repo_name": "researchstudio-sat/wonpreprocessing",
"path": "python-processing/tools/graph_utils.py",
"copies": "1",
"size": "3649",
"license": "apache-2.0",
"hash": 4210423090562764000,
"line_mean": 44.6125,
"line_max": 82,
"alpha_frac": 0.6626473006,
"autogenerated": false,
"ratio": 3.63808574... |
__author__ = 'hfriedrich'
import os
import luigi
import subprocess
def run_python(python_path, module_path, *args):
"""Helper for running python scripts.
:param python_path: Path to python interpreter.
:param module_path: Path to python module.
:param args: Arguments for python module.
:return: ... | {
"repo_name": "researchstudio-sat/wonpreprocessing",
"path": "python-processing/scripts/luigi_evaluation_workflow.py",
"copies": "1",
"size": "13551",
"license": "apache-2.0",
"hash": -1390023995083276000,
"line_mean": 39.2106824926,
"line_max": 120,
"alpha_frac": 0.6206921998,
"autogenerated": fal... |
__author__ = 'hfriedrich'
import os
import sys
import codecs
# simple script that takes a text file of needs that are categorized and creates output text files for each category
# in which the needs that belong to a certain category are listed. This can be used to easier create connections
# between needs manually th... | {
"repo_name": "researchstudio-sat/wonpreprocessing",
"path": "python-processing/scripts/create_categories.py",
"copies": "1",
"size": "2295",
"license": "apache-2.0",
"hash": -6000683979835881000,
"line_mean": 46.8333333333,
"line_max": 157,
"alpha_frac": 0.6901960784,
"autogenerated": false,
"ra... |
__author__ = 'hfriedrich'
import os
import sys
import string
import shutil
import re
import logging
logging.basicConfig(level=logging.INFO)
_log = logging.getLogger()
# Simple script to normalize filenames before processing them in different environments (python 2, python 3,
# win/unix, java/gate) which can lead to ... | {
"repo_name": "researchstudio-sat/wonpreprocessing",
"path": "python-processing/scripts/normalize_file_names.py",
"copies": "1",
"size": "1458",
"license": "apache-2.0",
"hash": 7858283966156663000,
"line_mean": 32.9069767442,
"line_max": 108,
"alpha_frac": 0.6748971193,
"autogenerated": false,
"... |
__author__ = 'hgf'
# -*- coding:utf-8 -*-
# !/usr/bin/python
import datetime
import gzip
import cStringIO
import os
import sys
#return Expires
def get_http_expiry(_Expirestype,_num):
"""
Adds the given number of days on to the current date and returns the future
date as a string, in the format: "Mon, 18 ... | {
"repo_name": "hgfgood/note",
"path": "python/code/webservice/hgfserver/src/pubutil.py",
"copies": "1",
"size": "1975",
"license": "apache-2.0",
"hash": 8826779653936080000,
"line_mean": 25,
"line_max": 111,
"alpha_frac": 0.6373220875,
"autogenerated": false,
"ratio": 3.06957928802589,
"config_... |
__author__ = 'hgq'
from heat.engine.resources.hwcloud.hws_service.ecs_service import ECSService
from heat.engine.resources.hwcloud.hws_service.evs_service import EVSService
from heat.engine.resources.hwcloud.hws_service.ims_service import IMSService
from heat.engine.resources.hwcloud.hws_service.vpc_service import VPC... | {
"repo_name": "hgqislub/hybird-orchard",
"path": "code/hwcloud/hws_service/hws_client.py",
"copies": "1",
"size": "2405",
"license": "apache-2.0",
"hash": 7635678101135383000,
"line_mean": 41.9642857143,
"line_max": 112,
"alpha_frac": 0.6769230769,
"autogenerated": false,
"ratio": 2.6428571428571... |
__author__ = 'hhauer'
import datetime
from django.conf import settings
from django.core.management.base import BaseCommand
import cx_Oracle
class Command(BaseCommand):
def handle(self, *args, **options):
# For making the logs easier to interpret later, log out when we started.
self.stdout.write... | {
"repo_name": "hhauer/myinfo",
"path": "MyInfo/management/commands/nightly_force_aggregation.py",
"copies": "1",
"size": "1386",
"license": "mit",
"hash": 597858436183832600,
"line_mean": 35.5,
"line_max": 102,
"alpha_frac": 0.6673881674,
"autogenerated": false,
"ratio": 3.904225352112676,
"con... |
__author__ = 'hhauer'
import requests
from django.conf import settings
from django.core.management.base import BaseCommand
import cx_Oracle
from MyInfo.models import ContactInformation
class Command(BaseCommand):
def get_iiq_url(self, udc_id):
url = "https://{}/identityiq/rest/custom/getUUID/{}".format(... | {
"repo_name": "hhauer/myinfo",
"path": "MyInfo/management/commands/import_password_reset.py",
"copies": "1",
"size": "2167",
"license": "mit",
"hash": -3511508345412316700,
"line_mean": 35.7288135593,
"line_max": 106,
"alpha_frac": 0.544993078,
"autogenerated": false,
"ratio": 4.088679245283019,
... |
__author__ = 'hibou'
class Node(object):
def __init__(self, val, parent=None):
self.parent = parent
self.val = val
self.childs = []
def find_node(self, node_val):
found = None
if node_val == self.val:
found = self
else:
for child in self... | {
"repo_name": "hibou107/algocpp",
"path": "dwarfs.py",
"copies": "1",
"size": "1851",
"license": "mit",
"hash": -3228459944049928700,
"line_mean": 22.1375,
"line_max": 69,
"alpha_frac": 0.52728255,
"autogenerated": false,
"ratio": 3.446927374301676,
"config_test": false,
"has_no_keywords": fa... |
__author__ = 'hiking'
__email__ = 'hikingko1@gmail.com'
from threading import Timer
class KitchenTimer:
def __init__(self, time):
self.unit_time = 60
self.lapse_time = 0
self.threads = []
self.time = time
def on_time_up(self): pass
def on_each_minutes(self): pass
def s... | {
"repo_name": "Hi-king/pomodorocl",
"path": "timer/KitchenTimer.py",
"copies": "1",
"size": "1194",
"license": "apache-2.0",
"hash": -819292838110957600,
"line_mean": 31.2972972973,
"line_max": 69,
"alpha_frac": 0.5335008375,
"autogenerated": false,
"ratio": 3.5748502994011977,
"config_test": f... |
__author__ = 'himanshu'
from decorator import decorator
from tests.fixtures.mock_httpretty_responses.common import Session
from tests.fixtures.mock_httpretty_responses.models import User, Node, File
session = Session()
def save(item=None):
if item is not None:
session.add(item)
session.commit()
def ... | {
"repo_name": "chennan47/OSF-Offline",
"path": "tests/fixtures/mock_httpretty_responses/utils.py",
"copies": "1",
"size": "1130",
"license": "apache-2.0",
"hash": 5048195236959510000,
"line_mean": 24.6818181818,
"line_max": 90,
"alpha_frac": 0.6805309735,
"autogenerated": false,
"ratio": 3.294460... |
__author__ = 'himanshu'
from factory.alchemy import SQLAlchemyModelFactory
from factory import Sequence
from osfoffline.database_manager.models import User, Node, File
from tests.fixtures.factories.common import Session
# class User(Base):
# """ A SQLAlchemy simple model class who represents a user """
# _... | {
"repo_name": "chennan47/OSF-Offline",
"path": "tests/fixtures/factories/factories.py",
"copies": "1",
"size": "1623",
"license": "apache-2.0",
"hash": 9050617190270450000,
"line_mean": 26.05,
"line_max": 78,
"alpha_frac": 0.6561922366,
"autogenerated": false,
"ratio": 3.3883089770354906,
"conf... |
__author__ = 'himanshu'
from models import Product
"""
class Product(models.Model):
title = models.CharField(null=False, max_length=100)
description = models.CharField(null=False)
picture = models.ImageField(null=False)
rating = models.IntegerField(null=False)
price = models.DecimalField(null=False... | {
"repo_name": "himanshuo/cs-4753-project",
"path": "shopsmart/home/add_default_products.py",
"copies": "1",
"size": "1517",
"license": "mit",
"hash": -4220563364629934000,
"line_mean": 19.472972973,
"line_max": 85,
"alpha_frac": 0.6528052805,
"autogenerated": false,
"ratio": 3.21656050955414,
"... |
__author__ = 'himanshu'
from tests.utils.url_builder import *
import httpretty
import re
from tests.fixtures.mock_httpretty_responses.osf_api import (
create_user,
get_user,
create_node,
get_user_nodes,
get_node_children,
get_all_nodes,
create_folder,
get_children_for_folder,
)
REG... | {
"repo_name": "chennan47/OSF-Offline",
"path": "tests/fixtures/mock_httpretty_responses/setup_fake_osf.py",
"copies": "1",
"size": "2833",
"license": "apache-2.0",
"hash": 8975005202920969000,
"line_mean": 21.8467741935,
"line_max": 93,
"alpha_frac": 0.6314860572,
"autogenerated": false,
"ratio":... |
__author__ = 'himanshu'
import hashlib
import datetime
import os
from sqlalchemy import create_engine, ForeignKey, Enum
from sqlalchemy.orm import sessionmaker, relationship, backref, scoped_session, validates
from sqlalchemy import Column, Integer, Boolean, String, DateTime
from sqlalchemy.ext.declarative import decla... | {
"repo_name": "chennan47/OSF-Offline",
"path": "tests/fixtures/mock_osf_api_server/models.py",
"copies": "1",
"size": "10520",
"license": "apache-2.0",
"hash": -9107286577545914000,
"line_mean": 30.8787878788,
"line_max": 185,
"alpha_frac": 0.4671102662,
"autogenerated": false,
"ratio": 4.3150123... |
__author__ = 'himanshu'
import hashlib
import datetime
import os
from tests.utils.url_builder import api_user_nodes, api_user_url, api_file_children, api_node_children, api_node_files, api_file_self
from sqlalchemy import create_engine, ForeignKey, Enum
from sqlalchemy.orm import sessionmaker, relationship, backref, sc... | {
"repo_name": "chennan47/OSF-Offline",
"path": "tests/fixtures/mock_httpretty_responses/models.py",
"copies": "1",
"size": "8168",
"license": "apache-2.0",
"hash": 3850668635293444600,
"line_mean": 29.1402214022,
"line_max": 134,
"alpha_frac": 0.5149363369,
"autogenerated": false,
"ratio": 4.1231... |
# __author__ = 'himanshu'
# import json
# from osfoffline.polling_osf_manager.api_url_builder import api_user_nodes, api_file_children, wb_file_url
# import furl
# from osfoffline.settings import API_BASE, WB_BASE
#
# ############################ User #####################
# GENERIC_USER={
# "data": {
# "i... | {
"repo_name": "chennan47/OSF-Offline",
"path": "tests/fixtures/mock_httpretty_responses/template_DELETE.py",
"copies": "1",
"size": "8869",
"license": "apache-2.0",
"hash": 8144479993017258000,
"line_mean": 33.9212598425,
"line_max": 176,
"alpha_frac": 0.4557447288,
"autogenerated": false,
"ratio... |
__author__ = 'himanshu'
import json
import requests
def _setup_request_data(filename):
file= open(filename, 'rb')
data = {}
lineno = 0
lines = file.readlines()
for l in lines:
lineno+=1
if l=="\n" or l=="":
break
parts = l.spl... | {
"repo_name": "himanshuo/spamassassin",
"path": "demo/demo.py",
"copies": "1",
"size": "1292",
"license": "mit",
"hash": 3334625521147688400,
"line_mean": 24.84,
"line_max": 78,
"alpha_frac": 0.5216718266,
"autogenerated": false,
"ratio": 3.6600566572237963,
"config_test": false,
"has_no_keyw... |
__author__ = 'himanshu'
import json
from unittest import TestCase
import requests
from tests.fixtures.mock_httpretty_responses.setup_fake_osf import setup_mock_osf_api
import httpretty
from osfoffline.polling_osf_manager.remote_objects import *
class TestRemoteObjects(TestCase):
@httpretty.activate
def setUp... | {
"repo_name": "chennan47/OSF-Offline",
"path": "tests/test_remote_objects_with_mock_osf.py",
"copies": "1",
"size": "2803",
"license": "apache-2.0",
"hash": 8899898421724134000,
"line_mean": 37.9444444444,
"line_max": 147,
"alpha_frac": 0.6368176953,
"autogenerated": false,
"ratio": 3.54810126582... |
__author__ = 'Hinsteny'
class A(object):
""""""
#----------------------------------------------------------------------
def __init__(self, *args, **kwargs):
print("init_for:",self.__class__)
def __new__(cls, *args, **kwargs):
print("new_for:",cls)
return object.__new__(cls)
a ... | {
"repo_name": "InverseLina/python-practice",
"path": "Category/NewInit.py",
"copies": "1",
"size": "2790",
"license": "apache-2.0",
"hash": -609707536928274000,
"line_mean": 23.4824561404,
"line_max": 75,
"alpha_frac": 0.3770609319,
"autogenerated": false,
"ratio": 4.096916299559472,
"config_te... |
__author__ = 'hira'
import tweepy
import json
class TwitterClient(object):
_CONSUMER_KEY = ''
_CONSUMER_SECRET = ''
_ACCESS_TOKEN = ''
_ACCESS_TOKEN_SECRET = ''
_api = None
def __init__(self):
with open('twitter_keys.json', 'r') as keys_file:
keys = json.load(keys_file)
... | {
"repo_name": "almichest/hue_app",
"path": "src/twitter/twitter_client.py",
"copies": "1",
"size": "1208",
"license": "mit",
"hash": -2803856540122097700,
"line_mean": 29.2,
"line_max": 81,
"alpha_frac": 0.5753311258,
"autogenerated": false,
"ratio": 3.5014492753623188,
"config_test": false,
... |
__author__ = 'hiroki'
from collections import defaultdict
import re
import random
import gzip
import cPickle
import numpy as np
import theano
random.seed(0)
PAD = u'<PAD>'
EOS = u'<EOS>'
UNK = u'<UNK>'
RE_NUM = re.compile(ur'[0-9]')
class Vocab(object):
"""Mapping between words and IDs."""
def __init__(... | {
"repo_name": "hshindo/POS-Tagging-benchmark",
"path": "Theano/util.py",
"copies": "1",
"size": "12203",
"license": "mit",
"hash": 3658381052738259500,
"line_mean": 27.313225058,
"line_max": 106,
"alpha_frac": 0.5197082685,
"autogenerated": false,
"ratio": 3.3214480130647797,
"config_test": fal... |
__author__ = 'hiroki'
from collections import OrderedDict
import numpy as np
import theano
import theano.tensor as T
from nn_utils import build_shared_zeros
def grad_clipping(g, t=100):
return T.switch(g ** 2 >= t, t / g ** 2, g)
def sgd(cost, params, emb, x, lr=0.1):
updates = OrderedDict()
grads = ... | {
"repo_name": "hshindo/POS-Tagging-benchmark",
"path": "Theano/optimizers.py",
"copies": "1",
"size": "4192",
"license": "mit",
"hash": 3114197451868534300,
"line_mean": 27.9103448276,
"line_max": 67,
"alpha_frac": 0.5295801527,
"autogenerated": false,
"ratio": 2.398169336384439,
"config_test":... |
__author__ = 'hiroki'
import numpy as np
import theano
import theano.tensor as T
def relu(x):
return T.switch(x < 0., 0., x)
def sigmoid(x):
return T.nnet.sigmoid(x)
def tanh(x):
return T.tanh(x)
def build_shared_zeros(shape):
return theano.shared(
value=np.zeros(shape, dtype=theano.con... | {
"repo_name": "hshindo/POS-Tagging-benchmark",
"path": "Theano/nn_utils.py",
"copies": "1",
"size": "1705",
"license": "mit",
"hash": 8619412038843247000,
"line_mean": 27.4166666667,
"line_max": 89,
"alpha_frac": 0.4903225806,
"autogenerated": false,
"ratio": 3.1691449814126393,
"config_test": ... |
__author__ = 'hiroki'
import sys
import time
import math
from collections import defaultdict
from util import load_init_emb, PAD, UNK, RE_NUM, Vocab
import numpy as np
import theano
import theano.tensor as T
from theano.tensor.nnet.conv import conv2d
from nn_utils import build_shared_zeros, sample_weights, sample_n... | {
"repo_name": "hshindo/POS-Tagging-benchmark",
"path": "Theano/nn_char_zeropad.py",
"copies": "1",
"size": "12757",
"license": "mit",
"hash": 1707151139549998300,
"line_mean": 34.1432506887,
"line_max": 171,
"alpha_frac": 0.5558516893,
"autogenerated": false,
"ratio": 3.1274822260357933,
"confi... |
__author__ = 'hiroki'
import theano
import theano.tensor as T
import numpy as np
from nn_utils import sigmoid
class Layer(object):
def __init__(self, rand, input=None, n_input=784, n_output=10, activation=None, W=None, b=None):
self.input = input
if W is None:
W_values = np.asarray(... | {
"repo_name": "hshindo/POS-Tagging-benchmark",
"path": "Theano/layer.py",
"copies": "1",
"size": "1138",
"license": "mit",
"hash": 7231351012797396000,
"line_mean": 28.9736842105,
"line_max": 100,
"alpha_frac": 0.5316344464,
"autogenerated": false,
"ratio": 3.5673981191222572,
"config_test": fa... |
__author__ = 'hiroki'
import theano
import theano.tensor as T
from nn_utils import sample_weights, relu, tanh
from optimizers import sgd, ada_grad
class NnTagger(object):
def __init__(self, x, y, opt, lr, init_emb, vocab_size=10000, emb_dim=100, window=5, hidden_dim=100, tag_num=45, reg=0.0001):
"""
... | {
"repo_name": "hshindo/POS-Tagging-benchmark",
"path": "Theano/nn.py",
"copies": "1",
"size": "1896",
"license": "mit",
"hash": 5447303240964428000,
"line_mean": 33.4727272727,
"line_max": 129,
"alpha_frac": 0.5812236287,
"autogenerated": false,
"ratio": 2.8990825688073394,
"config_test": false... |
global mysql_options
mysql_options = os.getenv('DSTAT_MYSQL') or ''
global target_status
global _basic_status
global _extra_status
_basic_status = (
('Queries' , 'qps'),
('Com_select' , 'sel/s'),
('Com_insert' , 'ins/s'),
('Com_update' ... | {
"repo_name": "SpamapS/dstat-plugins",
"path": "dstat_plugins/plugins/dstat_mysql5_innodb.py",
"copies": "1",
"size": "6527",
"license": "apache-2.0",
"hash": 7439276862443768000,
"line_mean": 33.3526315789,
"line_max": 129,
"alpha_frac": 0.4485981308,
"autogenerated": false,
"ratio": 4.167943805... |
__author__ = 'Hiruma'
LANG = "fr"
import os
import urllib
import urllib2
def sample():
""" Function to sample some pre-recorded answers."""
text_to_sample = raw_input("Text to sample:")
# TODO Check limit 100 characters
url = "http://translate.google.com/translate_tts?tl="+LANG+"&q="
#values = url... | {
"repo_name": "Hiruma31/ADA",
"path": "test/sampler.py",
"copies": "1",
"size": "1100",
"license": "apache-2.0",
"hash": -2289689646687027500,
"line_mean": 29.5833333333,
"line_max": 128,
"alpha_frac": 0.6145454545,
"autogenerated": false,
"ratio": 3.142857142857143,
"config_test": false,
"ha... |
__author__ = 'Hiruma'
LANG = "fr"
import os
import urllib
import urllib2
def sample(text_to_sample):
""" Function to sample some pre-recorded answers."""
#text_to_sample = raw_input("Text to sample:")
# TODO Check limit 100 characters
url = "http://translate.google.com/translate_tts?tl="+LANG+"&q="
... | {
"repo_name": "Hiruma31/ADA",
"path": "samples/sampler.py",
"copies": "1",
"size": "1253",
"license": "apache-2.0",
"hash": 7381760780999041000,
"line_mean": 28.8333333333,
"line_max": 128,
"alpha_frac": 0.6169193935,
"autogenerated": false,
"ratio": 3.20460358056266,
"config_test": false,
"h... |
__author__ = 'Hitesh,Aakash'
import boto
import time
from datetime import date, timedelta,datetime
from dateutil.parser import parse
from boto import ec2
retentionTag = 'RetentionCount' ## Retention Count is in Days
searchTag='instance_id'
region = '<region>'
accountId = '<accountID>'
backupTag="AutomaticBackup"
defa... | {
"repo_name": "hiteshBhatia/aws-boto-scripts",
"path": "backup-manager/deleteBackupsBasedOnTags-backupManager.py",
"copies": "1",
"size": "2354",
"license": "apache-2.0",
"hash": -7130967423221498000,
"line_mean": 37.5901639344,
"line_max": 140,
"alpha_frac": 0.5951571793,
"autogenerated": false,
... |
__author__ = 'hjcamero'
import os
import pprint
import random
import wx
import matplotlib
from matplotlib.figure import Figure
from matplotlib.backends.backend_wxagg import FigureCanvasWxAgg as FigCanvas, \
NavigationToolbar2WxAgg as NavigationToolbar
matplotlib.use('WXAgg') # change the matplotlib backend
c... | {
"repo_name": "hunter-cameron/Bioinformatics",
"path": "python/lucidBLAST/wxArtist.py",
"copies": "1",
"size": "6099",
"license": "mit",
"hash": -1399431346995190500,
"line_mean": 30.2769230769,
"line_max": 92,
"alpha_frac": 0.5751762584,
"autogenerated": false,
"ratio": 3.469283276450512,
"con... |
__author__ = 'hkalra'
from django.conf import settings
from django.db.models.signals import post_save
from django.dispatch import receiver
from rest_framework.authtoken.models import Token
#from rest_framework import authentication
#from rest_framework import exceptions
#from saleor.userprofile.models import User
... | {
"repo_name": "arth-co/saleor",
"path": "saleor/api/auth.py",
"copies": "1",
"size": "1493",
"license": "bsd-3-clause",
"hash": -6156862922588162000,
"line_mean": 23.4754098361,
"line_max": 77,
"alpha_frac": 0.6376423309,
"autogenerated": false,
"ratio": 4.327536231884058,
"config_test": false,... |
__author__ = 'hkalra'
from rest_framework import serializers
from django_prices.models import PriceField
from saleor.product.models.base import Product, Category, ProductVariant
from rest_framework import permissions
class CategorySerializer(serializers.ModelSerializer):
class Meta:
model = Category
... | {
"repo_name": "arth-co/saleor",
"path": "saleor/api/serializers.py",
"copies": "1",
"size": "1289",
"license": "bsd-3-clause",
"hash": -8321081783032707000,
"line_mean": 38.0909090909,
"line_max": 120,
"alpha_frac": 0.7377812258,
"autogenerated": false,
"ratio": 4.311036789297659,
"config_test"... |
__author__ = 'hmizumoto'
from flask import session
from app.models.base import BaseModel
from app.utils import render_md
from logging import getLogger, StreamHandler, DEBUG
logger = getLogger(__name__)
handler = StreamHandler()
handler.setLevel(DEBUG)
logger.setLevel(DEBUG)
logger.addHandler(handler)
class ItemsMode... | {
"repo_name": "motomizuki/Qlone",
"path": "app/models/items.py",
"copies": "1",
"size": "2191",
"license": "mit",
"hash": 8797670684786796000,
"line_mean": 28.8194444444,
"line_max": 102,
"alpha_frac": 0.5034932464,
"autogenerated": false,
"ratio": 3.7469458987783595,
"config_test": false,
"h... |
__author__ = 'H'
bl_info = {
'name': 'Caffe-Gui-Tool',
'author': 'Hugh Tomkins',
'location': 'Node view - Properties panel',
'category': 'Node View'
}
# To support reload properly, try to access a package var,
# # if it's there, reload everything
if "bpy" in locals():
import imp
imp.reload(IOwr... | {
"repo_name": "Chasvortex/caffe-gui-tool",
"path": "__init__.py",
"copies": "1",
"size": "5980",
"license": "unlicense",
"hash": 7756089098321866000,
"line_mean": 29.824742268,
"line_max": 95,
"alpha_frac": 0.6324414716,
"autogenerated": false,
"ratio": 3.7704918032786887,
"config_test": false,... |
__author__ = 'hnng'
import math
def fibonancci(n):
if n in [0, 1]:
return n
else:
return fibonancci(n - 1) + fibonancci(n - 2)
def combinations_recursive(iterable):
if not iterable:
return [tuple()]
first = (iterable[0],)
subset = combinations_recursive(iterable[1:])
r... | {
"repo_name": "hibou107/algocpp",
"path": "recursion.py",
"copies": "1",
"size": "5012",
"license": "mit",
"hash": -5562971050076679000,
"line_mean": 23.568627451,
"line_max": 104,
"alpha_frac": 0.518754988,
"autogenerated": false,
"ratio": 3.1862682771773683,
"config_test": false,
"has_no_ke... |
__author__ = 'hnng'
def merge_sort(l):
if len(l) <= 1:
return l
else:
mid = len(l) / 2
return merge(merge_sort(l[:mid]), merge_sort(l[mid:]))
def merge(ll, lr):
"""
:param ll: sorted list
:param lr: sorted list
:return: sorted list
"""
result = []
i = 0
... | {
"repo_name": "hibou107/algocpp",
"path": "sort.py",
"copies": "1",
"size": "1420",
"license": "mit",
"hash": 7012424247556946,
"line_mean": 18.7361111111,
"line_max": 63,
"alpha_frac": 0.4267605634,
"autogenerated": false,
"ratio": 3.279445727482679,
"config_test": false,
"has_no_keywords": ... |
__author__ = 'hnng'
print "test"
import itertools
class Tree(object):
def __init__(self, val, distance=0, left=None, right=None, parent=None):
self.parent = parent
self.distance = distance
self.left = left
self.right = right
self.val = val
def show(self, ord=''):
... | {
"repo_name": "hibou107/algocpp",
"path": "tree.py",
"copies": "1",
"size": "4494",
"license": "mit",
"hash": 8859794587429171000,
"line_mean": 26.0722891566,
"line_max": 90,
"alpha_frac": 0.5591900312,
"autogenerated": false,
"ratio": 3.6271186440677967,
"config_test": false,
"has_no_keyword... |
__author__ = 'H'
import os
import pickle
from .IOloadprototxt import LoadFunction
import bpy
from .CGTArrangeHelper import ArrangeFunction
class anyclass(object):
pass
def getactivefcurve():
ncurves = 0
for object in bpy.context.selected_objects:
if object.animation_data:
if object... | {
"repo_name": "Chasvortex/caffe-gui-tool",
"path": "IOcexp.py",
"copies": "1",
"size": "4096",
"license": "unlicense",
"hash": 7579266208211788000,
"line_mean": 35.2477876106,
"line_max": 123,
"alpha_frac": 0.6298828125,
"autogenerated": false,
"ratio": 3.696750902527076,
"config_test": false,
... |
__author__ = 'hoangnn'
from flask.ext.wtf import Form
from flask.ext.wtf.html5 import URLField, EmailField, TelField
from wtforms import (ValidationError, HiddenField, TextField, HiddenField,
PasswordField, SubmitField, TextAreaField, IntegerField, RadioField,
FileField, DecimalField)
from wtforms.valid... | {
"repo_name": "hoang89/fmbone",
"path": "fbone/manage/forms.py",
"copies": "1",
"size": "1667",
"license": "bsd-3-clause",
"hash": 8438244688056200000,
"line_mean": 49.5151515152,
"line_max": 145,
"alpha_frac": 0.6982603479,
"autogenerated": false,
"ratio": 3.415983606557377,
"config_test": fal... |
__author__ = 'hoangnn'
from flask import Markup
from flask.ext.wtf import Form
from wtforms import (ValidationError, HiddenField, BooleanField, TextField,
PasswordField, SubmitField)
from wtforms.validators import Required, Length, EqualTo, Email
from flask.ext.wtf.html5 import EmailField
from ..muser.models ... | {
"repo_name": "hoang89/fmbone",
"path": "fbone/top/forms.py",
"copies": "1",
"size": "1689",
"license": "bsd-3-clause",
"hash": -3146783496050559000,
"line_mean": 41.225,
"line_max": 107,
"alpha_frac": 0.684428656,
"autogenerated": false,
"ratio": 3.745011086474501,
"config_test": false,
"has... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.