text stringlengths 0 1.05M | meta dict |
|---|---|
__author__ = 'alexs'
import cPickle
import random
import theano.tensor as T
import theano
import numpy as np
def getReferenceLabels():
referenceLabels = dict()
for i in range(0, 10):
reference_out = [0.1 for x in range(0, 10)]
reference_out[i] = 0.88
referenceLabels[i] = reference_ou... | {
"repo_name": "big-data-research/neuralnetworks_workshop_bucharest_2015",
"path": "nn_demo/01back_propagation.py",
"copies": "2",
"size": "8645",
"license": "apache-2.0",
"hash": 7315893204890876000,
"line_mean": 32.1264367816,
"line_max": 112,
"alpha_frac": 0.5539618276,
"autogenerated": false,
... |
__author__ = 'alex styler'
import math
import pandas as pd
import numpy as np
import fiona as fio
from matplotlib.figure import Figure
from matplotlib.collections import PathCollection
from mpl_toolkits.basemap import Basemap
from matplotlib.patches import Path
from matplotlib.transforms import Bbox
# haversine fu... | {
"repo_name": "astyler/osmapping",
"path": "osmapping.py",
"copies": "1",
"size": "7871",
"license": "mit",
"hash": 800463625213887500,
"line_mean": 37.2087378641,
"line_max": 112,
"alpha_frac": 0.6065303011,
"autogenerated": false,
"ratio": 3.8659135559921416,
"config_test": false,
"has_no_k... |
__author__ = 'alexvanboxel'
from datetime import date
from datetime import timedelta
def month(current):
return date(current.year, current.month, 15)
def month_first_day(current):
return date(current.year, current.month, 1)
def month_last_day(current):
d = next_month(current)
return date(d.year, d... | {
"repo_name": "alexvanboxel/demo-devoxx15-luigi",
"path": "dateutils.py",
"copies": "1",
"size": "4043",
"license": "apache-2.0",
"hash": 2151641734213315600,
"line_mean": 24.9166666667,
"line_max": 83,
"alpha_frac": 0.6297303982,
"autogenerated": false,
"ratio": 3.3413223140495867,
"config_tes... |
"""Simulate Data
Simulate stochastic dynamic systems to model gene expression dynamics and
cause-effect data.
TODO
----
Beta Version. The code will be reorganized soon.
"""
import itertools
import shutil
import sys
from pathlib import Path
from types import MappingProxyType
from typing import Optional, Union, List, ... | {
"repo_name": "theislab/scanpy",
"path": "scanpy/tools/_sim.py",
"copies": "1",
"size": "46870",
"license": "bsd-3-clause",
"hash": 673725933018243300,
"line_mean": 35.2467130704,
"line_max": 100,
"alpha_frac": 0.5042353895,
"autogenerated": false,
"ratio": 3.7814264966919477,
"config_test": fa... |
__author__ = 'Alfi'
import threading
import time
class pBuffer():
def __init__(self,nom):
self.n = nom
def addProc(self,proc):
self.bfr.append(proc)
if proc.p > self.p:
self.p = proc.p
proc.run()
class MyThread(threading.Thread):
def __init__(self,name,prior... | {
"repo_name": "sebid/se-irq-dev",
"path": "alf/test.py",
"copies": "1",
"size": "1244",
"license": "mit",
"hash": 2114954989293728000,
"line_mean": 19.393442623,
"line_max": 49,
"alpha_frac": 0.5618971061,
"autogenerated": false,
"ratio": 3.4175824175824174,
"config_test": false,
"has_no_keyw... |
__author__ = 'Alfi'
import threading
import time
class ThreadQueue():
def __init__(self):
self.list = []
self.event = threading.Event()
self.t
def addThread(self,t):
self.list.append(t)
self.list.sort()
def getWaitingThreadPriority(self):
return self.list[0... | {
"repo_name": "sebid/se-irq-dev",
"path": "alf/test5.py",
"copies": "1",
"size": "2269",
"license": "mit",
"hash": -7550489502275334000,
"line_mean": 21.2450980392,
"line_max": 81,
"alpha_frac": 0.6024680476,
"autogenerated": false,
"ratio": 3.2694524495677233,
"config_test": false,
"has_no_k... |
__author__ = 'Alfi'
import threading
import time
<<<<<<< HEAD
class ThreadQueue():
=======
class ThreadController():
>>>>>>> f89e10fff1e145a8723f0a8a708903dd8cf6d27e
def __init__(self):
self.list = []
self.event = threading.Event()
self.t
def addThread(self,t):
self.list.appen... | {
"repo_name": "sebid/se-irq-dev",
"path": "alf/test4.py",
"copies": "1",
"size": "2728",
"license": "mit",
"hash": -2028933883674224000,
"line_mean": 21.5454545455,
"line_max": 81,
"alpha_frac": 0.6158357771,
"autogenerated": false,
"ratio": 3.004405286343612,
"config_test": false,
"has_no_ke... |
__author__ = 'Alfredo Saglimbeni'
import re
import uuid
from django.forms.widgets import MultiWidget , to_current_timezone, DateTimeInput
from django.utils.translation import ugettext as _
from datetime import datetime
from django.utils import translation
I18N = """
$.fn.datetimepicker.dates['en'] = {
days: %s,... | {
"repo_name": "jimr/django-datetime-widget",
"path": "datetimewidget/widgets.py",
"copies": "1",
"size": "4699",
"license": "bsd-3-clause",
"hash": 8229695850117963000,
"line_mean": 33.0579710145,
"line_max": 175,
"alpha_frac": 0.5201106618,
"autogenerated": false,
"ratio": 3.2906162464985993,
... |
__author__ = 'Alfredo Saglimbeni'
from distutils.core import setup
from setuptools import setup, find_packages
setup(name = "clean-image-crop-uploader",
version = "0.2.2",
description = "Clean Image Crop Uploader (CICU) provides AJAX file upload and image CROP functionalities for ImageFields with a simple wid... | {
"repo_name": "hobarrera/clean-image-crop-uploader",
"path": "setup.py",
"copies": "2",
"size": "1026",
"license": "bsd-3-clause",
"hash": 3553599284615874000,
"line_mean": 37,
"line_max": 209,
"alpha_frac": 0.6403508772,
"autogenerated": false,
"ratio": 3.857142857142857,
"config_test": false,... |
__author__ = 'Alfredo Saglimbeni'
from distutils.core import setup
from setuptools import setup, find_packages
setup(name = "django-datetime-widget",
version = "0.9.3",
description = "Django-datetime-widget is a simple and clean widget for DateField, Timefiled and DateTimeField in Django framework. It is bas... | {
"repo_name": "NoodleEducation/django-datetime-widget",
"path": "setup.py",
"copies": "2",
"size": "1093",
"license": "bsd-3-clause",
"hash": 8061587981970782000,
"line_mean": 38.0357142857,
"line_max": 221,
"alpha_frac": 0.6523330284,
"autogenerated": false,
"ratio": 4.109022556390977,
"config... |
__author__ = 'Alfredo Saglimbeni'
from distutils.core import setup
from setuptools import setup, find_packages
setup(name = "django-datetime-widget",
version = "0.9.5",
description = "Django-datetime-widget is a simple and clean widget for DateField, Timefiled and DateTimeField in Django framework. It is bas... | {
"repo_name": "michaeljones/django-datetime-widget",
"path": "setup.py",
"copies": "1",
"size": "1093",
"license": "bsd-3-clause",
"hash": -5797884592076391000,
"line_mean": 38.0357142857,
"line_max": 221,
"alpha_frac": 0.6523330284,
"autogenerated": false,
"ratio": 4.109022556390977,
"config_t... |
__author__ = 'alicia.williams'
# CIS-125 FA 2015
# Week 4: piggetty.py
# File: piggetty.py
# Code to create the way to completely translate all words into the correct Pig
# Latin Terms
# Define a function called piggy(string) that returns a string
vowels = "aeiouAEIOU"
# Loop through word, one letter at a time
#... | {
"repo_name": "ajanaew24/Week-Four-Assignment",
"path": "piggetty.py",
"copies": "1",
"size": "1629",
"license": "mit",
"hash": 7007290378076359000,
"line_mean": 21.9577464789,
"line_max": 79,
"alpha_frac": 0.6617556783,
"autogenerated": false,
"ratio": 2.828125,
"config_test": false,
"has_no... |
__author__ = 'Ali Hamdan'
__version__ = '0.1.0'
__license__ = 'MIT'
import csv
import json
class jsontocsvify():
def __init__(self, json_data, delimeter='.'):
self.delimeter = delimeter
self.json_data = json_data if isinstance(json_data, dict) else json.loads(json_data)
self.parsed_data = {}
def normaliz... | {
"repo_name": "yxorP/jsontocsvify",
"path": "jsontocsvify.py",
"copies": "1",
"size": "2288",
"license": "mit",
"hash": -4005138739428953600,
"line_mean": 25.3103448276,
"line_max": 86,
"alpha_frac": 0.6341783217,
"autogenerated": false,
"ratio": 2.9408740359897174,
"config_test": false,
"has... |
__author__ = 'alimanfoo@googlemail.com'
__version__ = '0.9-SNAPSHOT'
from itertools import cycle
import numpy as np
import matplotlib.pyplot as plt
plt.rcParams['ytick.direction'] = 'out'
plt.rcParams['xtick.direction'] = 'out'
def allele_balance_plot(G, AD, coverage=None, colors='bgrcmyk', legend=True, ax=None, ... | {
"repo_name": "alimanfoo/vcfplt",
"path": "vcfplt.py",
"copies": "1",
"size": "17760",
"license": "mit",
"hash": -4500869078521965000,
"line_mean": 24.8515283843,
"line_max": 104,
"alpha_frac": 0.5914977477,
"autogenerated": false,
"ratio": 3.4451988360814743,
"config_test": false,
"has_no_ke... |
__author__ = 'Alireza Omidi <alireza530@gmail.com>'
__license__ = 'MIT'
class Go:
def __init__(self):
self.timebank = 0
self.time_per_move = 0
self.player_names = []
self.my_bot = ''
self.my_botid = 0
self.opponent_bot = ''
self.opponent_botid = 0
se... | {
"repo_name": "alirezaomidi/theaigames-go-starterbot",
"path": "Go.py",
"copies": "1",
"size": "3113",
"license": "mit",
"hash": -6993731610382133000,
"line_mean": 33.2197802198,
"line_max": 91,
"alpha_frac": 0.4863475747,
"autogenerated": false,
"ratio": 3.3011664899257687,
"config_test": fals... |
__author__ = 'Alireza Omidi <alireza530@gmail.com>'
__license__ = 'MIT'
import sys
from random import choice
class AI:
# Just change the do_turn function to write your own bot
# You can define your own functions inside this class
# This is a random bot and have little chance to win the game :)
# So ... | {
"repo_name": "alirezaomidi/theaigames-go-starterbot",
"path": "AI.py",
"copies": "1",
"size": "1146",
"license": "mit",
"hash": -4974555110446316000,
"line_mean": 31.7714285714,
"line_max": 68,
"alpha_frac": 0.5636998255,
"autogenerated": false,
"ratio": 3.673076923076923,
"config_test": false... |
__author__ = 'alisonbento'
import abstractdao
import src.entities.hsfullgroup as hsfullgroup
import fullappliancedao as hsappliancedao
import groupdao as hsgroupdao
class FullGroupDAO(abstractdao.AbstractDAO):
def __init__(self, connection):
abstractdao.AbstractDAO.__init__(self, connection)
def li... | {
"repo_name": "m4nolo/home-shell",
"path": "src/dao/fullgroupdao.py",
"copies": "3",
"size": "1712",
"license": "apache-2.0",
"hash": 7980896032941098000,
"line_mean": 33.9387755102,
"line_max": 106,
"alpha_frac": 0.6775700935,
"autogenerated": false,
"ratio": 3.890909090909091,
"config_test": ... |
__author__ = 'alisonbento'
import abstractdao
import appliancedao as hsappliancedao
import fullservicedao as hsservicedao
import statusdao as hsstatusdao
import src.entities.hsfullappliance as hsfullappliance
class FullApplianceDAO(abstractdao.AbstractDAO):
def list(self, criteria=None, arguments=()):
... | {
"repo_name": "m4nolo/home-shell",
"path": "src/dao/fullappliancedao.py",
"copies": "3",
"size": "1742",
"license": "apache-2.0",
"hash": 8062805042379620000,
"line_mean": 34.5714285714,
"line_max": 89,
"alpha_frac": 0.7003444317,
"autogenerated": false,
"ratio": 3.8201754385964914,
"config_tes... |
__author__ = 'alisonbento'
import abstractdao
import servicedao as hsservicedao
import paramdao as hsparamdao
import src.entities.hsfullservice as hsfullservice
class FullServiceDAO(abstractdao.AbstractDAO):
def list(self, criteria=None, arguments=()):
servicedao = hsservicedao.ServiceDAO(self.connecti... | {
"repo_name": "m4nolo/home-shell",
"path": "src/dao/fullservicedao.py",
"copies": "3",
"size": "1306",
"license": "apache-2.0",
"hash": -9050709362974765000,
"line_mean": 29.3720930233,
"line_max": 79,
"alpha_frac": 0.6761102603,
"autogenerated": false,
"ratio": 4.08125,
"config_test": false,
... |
__author__ = 'alisonbento'
import abstractdao
class BaseDAO(abstractdao.AbstractDAO):
def __init__(self, connection, table, primary_key):
abstractdao.AbstractDAO.__init__(self, connection)
self.table = table
self.primary_key = primary_key
def list(self, criteria=None, arguments=()):... | {
"repo_name": "alisonbnt/home-shell",
"path": "src/dao/basedao.py",
"copies": "3",
"size": "2357",
"license": "apache-2.0",
"hash": 5908555568561122000,
"line_mean": 27.0595238095,
"line_max": 109,
"alpha_frac": 0.5638523547,
"autogenerated": false,
"ratio": 3.9087893864013266,
"config_test": f... |
__author__ = 'alisonbento'
import basedao
from src.entities.hsappliance import HomeShellAppliance
import datetime
import configs
class ApplianceDAO(basedao.BaseDAO):
def __init__(self, connection):
basedao.BaseDAO.__init__(self, connection, 'hs_appliances', 'appliance_id')
def convert_row_to_object(... | {
"repo_name": "alisonbnt/home-shell",
"path": "src/dao/appliancedao.py",
"copies": "2",
"size": "1109",
"license": "apache-2.0",
"hash": -7074807794030177000,
"line_mean": 33.65625,
"line_max": 114,
"alpha_frac": 0.6681695221,
"autogenerated": false,
"ratio": 4.018115942028985,
"config_test": f... |
__author__ = 'alisonbento'
import basedao
from src.entities.hsextra import HomeShellExtra
class ExtraDAO(basedao.BaseDAO):
def __init__(self, connection):
basedao.BaseDAO.__init__(self, connection, 'hs_appliance_extras', 'extra_id')
def convert_row_to_object(self, entity_row):
extra = HomeS... | {
"repo_name": "m4nolo/home-shell",
"path": "src/dao/extradao.py",
"copies": "3",
"size": "1297",
"license": "apache-2.0",
"hash": -8946659913087954000,
"line_mean": 29.9047619048,
"line_max": 113,
"alpha_frac": 0.6037008481,
"autogenerated": false,
"ratio": 3.684659090909091,
"config_test": fal... |
__author__ = 'alisonbento'
import basedao
from src.entities.hsstatus import HomeShellStatus
class StatusDAO(basedao.BaseDAO):
def __init__(self, connection):
basedao.BaseDAO.__init__(self, connection, 'hs_appliance_status', 'status_id')
def convert_row_to_object(self, entity_row):
status = ... | {
"repo_name": "alisonbnt/home-shell",
"path": "src/dao/statusdao.py",
"copies": "3",
"size": "1548",
"license": "apache-2.0",
"hash": 447007764764173950,
"line_mean": 30.5918367347,
"line_max": 108,
"alpha_frac": 0.5878552972,
"autogenerated": false,
"ratio": 3.812807881773399,
"config_test": f... |
__author__ = 'alisonbento'
import basedao
from src.entities.token.hstoken import HomeShellToken
class TokenDAO(basedao.BaseDAO):
def __init__(self, connection):
basedao.BaseDAO.__init__(self, connection, 'hs_tokens', 'token_id')
def insert(self, entity):
cursor = self.connection.cursor()
... | {
"repo_name": "alisonbnt/home-shell",
"path": "src/dao/tokendao.py",
"copies": "3",
"size": "1362",
"license": "apache-2.0",
"hash": 7668540877616938000,
"line_mean": 26.24,
"line_max": 99,
"alpha_frac": 0.5609397944,
"autogenerated": false,
"ratio": 3.721311475409836,
"config_test": false,
"... |
__author__ = 'alisonbento'
import flask_restful
from flask_restful import reqparse
import hsres
from src.dao.appliancedao import ApplianceDAO
import src.resstatus as _status
from src.scheme_loader import SchemeLoader
from src.lib.service_caller import call_service
class EventResource(hsres.HomeShellResource):
... | {
"repo_name": "m4nolo/home-shell",
"path": "src/resources/event.py",
"copies": "3",
"size": "2066",
"license": "apache-2.0",
"hash": 2730533936341178400,
"line_mean": 34.0169491525,
"line_max": 80,
"alpha_frac": 0.6161665053,
"autogenerated": false,
"ratio": 3.988416988416988,
"config_test": fa... |
__author__ = 'alisonbento'
import flask_restful
import hsres
import src.resstatus as _status
from src.dao.servicedao import ServiceDAO
from src.lib.service_caller import call_service
class ListServicesResource(hsres.HomeShellResource):
def get(self, appliance_id):
dao = ServiceDAO(self.get_dbc())
... | {
"repo_name": "alisonbnt/home-shell",
"path": "src/resources/services.py",
"copies": "3",
"size": "4034",
"license": "apache-2.0",
"hash": -8570981666471979000,
"line_mean": 34.6991150442,
"line_max": 114,
"alpha_frac": 0.5292513634,
"autogenerated": false,
"ratio": 3.8164616840113528,
"config_... |
__author__ = 'alisonbento'
import nmap
import src.resources.hsres as hsres
import src.dao.fullappliancedao as fullappliancedao
import src.dao.appliancedao as appliancedao
import src.resstatus as _status
import requests
import datetime
import configs
from src.appliances.statusupdater import StatusUpdater
class Appl... | {
"repo_name": "m4nolo/home-shell",
"path": "src/resources/appliances.py",
"copies": "3",
"size": "3383",
"license": "apache-2.0",
"hash": 3274162276158458000,
"line_mean": 30.9150943396,
"line_max": 89,
"alpha_frac": 0.631687851,
"autogenerated": false,
"ratio": 3.8885057471264366,
"config_test... |
__author__ = 'alisonbento'
import requests
import hsres
import src.resstatus as _status
import src.base.connector
from src.dao.appliancedao import ApplianceDAO
from src.dao.statusdao import StatusDAO
from src.answer.answer import Answer
class ListStatusResource(hsres.HomeShellResource):
def get(self, appliance... | {
"repo_name": "m4nolo/home-shell",
"path": "src/resources/status.py",
"copies": "3",
"size": "2023",
"license": "apache-2.0",
"hash": -559714627989351040,
"line_mean": 26.7260273973,
"line_max": 83,
"alpha_frac": 0.6178942165,
"autogenerated": false,
"ratio": 3.8169811320754716,
"config_test": ... |
__author__ = 'alisonbento'
import time
import hsres
import src.resstatus as _status
from src.entities.hsextra import HomeShellExtra
from src.dao.appliancedao import ApplianceDAO
from src.dao.extradao import ExtraDAO
from flask import request
class ExtraResource(hsres.HomeShellResource):
def get(self, applia... | {
"repo_name": "alisonbnt/home-shell",
"path": "src/resources/extras.py",
"copies": "3",
"size": "2653",
"license": "apache-2.0",
"hash": -1213405456083694000,
"line_mean": 27.5376344086,
"line_max": 99,
"alpha_frac": 0.6181681116,
"autogenerated": false,
"ratio": 3.731364275668073,
"config_test... |
__author__ = 'alisonbnt'
# -*- coding: utf-8 -*-
import os
import locale
import gettext
# Change this variable to your app name!
# The translation files will be under
# @LOCALE_DIR@/@LANGUAGE@/LC_MESSAGES/@APP_NAME@.mo
APP_NAME = "SteeringAll"
# This is ok for maemo. Not sure in a regular desktop:
# APP_DIR = os.... | {
"repo_name": "alisonbnt/steering-all",
"path": "i18n.py",
"copies": "2",
"size": "1505",
"license": "mit",
"hash": -4029411310620458000,
"line_mean": 27.4150943396,
"line_max": 124,
"alpha_frac": 0.7249169435,
"autogenerated": false,
"ratio": 3.1818181818181817,
"config_test": false,
"has_no... |
__author__ = 'alisonbnt'
from flask import g, jsonify
from flask_restful import Resource
from app import db
from conf.auth import auth
from app.resources import parser
from app.models.UserModel import User
class UsersResource(Resource):
@staticmethod
@auth.login_required
def get():
return jsonif... | {
"repo_name": "processos-2015-1/api",
"path": "app/resources/user_resource.py",
"copies": "1",
"size": "2417",
"license": "mit",
"hash": -2329411449736494000,
"line_mean": 30,
"line_max": 113,
"alpha_frac": 0.5891601158,
"autogenerated": false,
"ratio": 3.8983870967741936,
"config_test": false,... |
__author__ = 'alisonbnt'
import os
import urllib
import ConfigParser
def setup():
print('-- GCM REPOSITORY SETUP --')
print('Checking setup')
already_installed_hook = False
git_hook_path = '.git/hooks/commit-msg'
cfg_file_path = '.git/hooks/gcm.cfg'
if os.path.isfile(git_hook_path):
a... | {
"repo_name": "alisonbnt/imagequiz",
"path": "gcm.py",
"copies": "2",
"size": "3420",
"license": "mit",
"hash": 1061123586989678100,
"line_mean": 30.9626168224,
"line_max": 118,
"alpha_frac": 0.5631578947,
"autogenerated": false,
"ratio": 4.430051813471502,
"config_test": true,
"has_no_keywor... |
__author__ = 'alisonbnt'
import requests
import src.resstatus as _status
from src.appliances.statusupdater import StatusUpdater
from src.dao.appliancedao import ApplianceDAO
from src.dao.servicedao import ServiceDAO
from src.dao.paramdao import ParamDAO
def call_service(resource, appliance_id, service_id, form, me... | {
"repo_name": "souzabrizolara/py-home-shell",
"path": "src/lib/service_caller.py",
"copies": "3",
"size": "2430",
"license": "apache-2.0",
"hash": -4079729213727053300,
"line_mean": 34.2173913043,
"line_max": 108,
"alpha_frac": 0.5917695473,
"autogenerated": false,
"ratio": 3.9384116693679094,
... |
__author__ = 'allan'
from model.contacts import Contacts
from random import randrange
def test_modify_contact_name(app):
if app.contacts.count() == 0:
app.contacts.create(Contacts(lastname="Test"))
old_contacts = app.contacts.get_contact_list()
index = randrange(len(old_contacts))
contact = Co... | {
"repo_name": "Latypov/Py_start",
"path": "test/test_modify_contact.py",
"copies": "1",
"size": "1067",
"license": "apache-2.0",
"hash": 1414970927399914500,
"line_mean": 38.5185185185,
"line_max": 103,
"alpha_frac": 0.6963448922,
"autogenerated": false,
"ratio": 3.213855421686747,
"config_test... |
__author__ = 'allan'
from model.contacts import Contacts
class ContactHelper:
def __init__(self, app):
self.app = app
def add_new_contact(self):
wd = self.app.wd
wd.find_element_by_link_text("add new").click()
def create(self, contacts):
wd = self.app.wd
self.add... | {
"repo_name": "Latypov/Py_start",
"path": "fixture/contacts.py",
"copies": "1",
"size": "3290",
"license": "apache-2.0",
"hash": -7315586617608673000,
"line_mean": 33.2708333333,
"line_max": 98,
"alpha_frac": 0.5981762918,
"autogenerated": false,
"ratio": 3.5224839400428265,
"config_test": fals... |
__author__ = 'allan'
from model.group import Group
class GroupHelper:
def __init__(self, app):
self.app = app
def open_groups_page(self):
wd = self.app.wd
if not(wd.current_url.endswith("/group.php") and len(wd.find_elements_by_name("new")) > 0):
wd.find_element_by_link_te... | {
"repo_name": "Latypov/Py_start",
"path": "fixture/group.py",
"copies": "1",
"size": "3127",
"license": "apache-2.0",
"hash": -4617765198687584000,
"line_mean": 31.5833333333,
"line_max": 99,
"alpha_frac": 0.592260953,
"autogenerated": false,
"ratio": 3.478309232480534,
"config_test": false,
... |
__author__ = 'allan'
class SessionHelper:
def __init__(self, app):
self.app = app
def login(self, username, password):
wd = self.app.wd
self.app.open_home_page()
wd.find_element_by_name("user").click()
wd.find_element_by_name("user").clear()
wd.find_element_by... | {
"repo_name": "Latypov/Py_start",
"path": "fixture/session.py",
"copies": "1",
"size": "1339",
"license": "apache-2.0",
"hash": 5086349193003641000,
"line_mean": 27.4893617021,
"line_max": 87,
"alpha_frac": 0.5593726662,
"autogenerated": false,
"ratio": 3.3813131313131315,
"config_test": false,... |
_absent = object()
_not_found = object()
_BITS = 5
_SIZE = 2 ** _BITS
_MASK = _SIZE - 1
class _TrieNode(object):
kind = None
def iteritems(self):
"""
Iterate over all of the items in this node and all sub-nodes.
Yields (key, value) pairs.
"""
raise NotImplementedE... | {
"repo_name": "jml/perfidy",
"path": "perfidy/_hamt.py",
"copies": "1",
"size": "11368",
"license": "mit",
"hash": 5228302401206069000,
"line_mean": 30.4903047091,
"line_max": 112,
"alpha_frac": 0.505981703,
"autogenerated": false,
"ratio": 3.974825174825175,
"config_test": false,
"has_no_key... |
__author__ = 'allentran'
import json
import os
import multiprocessing
import numpy as np
def _update_min_dict(candidate_node, depth, min_set):
if candidate_node in min_set:
if min_set[candidate_node] <= depth:
return
else:
min_set[candidate_node] = depth
else:
... | {
"repo_name": "allentran/graph2vec",
"path": "graph2vec/parser.py",
"copies": "1",
"size": "3985",
"license": "apache-2.0",
"hash": 8196103958095603000,
"line_mean": 37.3173076923,
"line_max": 125,
"alpha_frac": 0.5849435383,
"autogenerated": false,
"ratio": 3.5172109443954103,
"config_test": f... |
__author__ = 'allentran'
import json
import os
import re
import datetime
import unidecode
from spacy.en import English
import requests
import pandas as pd
import numpy as np
import allen_utils
logger = allen_utils.get_logger(__name__)
class Interval(object):
def __init__(self, start, end):
assert isin... | {
"repo_name": "allentran/fed-rates-bot",
"path": "fed_bot/model/data.py",
"copies": "1",
"size": "8747",
"license": "mit",
"hash": 5731184400335391000,
"line_mean": 32.3854961832,
"line_max": 131,
"alpha_frac": 0.5311535384,
"autogenerated": false,
"ratio": 3.817983413356613,
"config_test": fal... |
__author__ = 'allentran'
import models
class TestNetwork(object):
def setUp(self):
self.n_minibatch = 32
self.n_assets = 2
self.n_actions = 2 * self.n_assets
self.k_info = 16
self.preprocessed_size = 10
self.lstm_size = 5
self.merge_size = 5
self... | {
"repo_name": "allentran/rl-l2t",
"path": "model/tests.py",
"copies": "1",
"size": "1040",
"license": "apache-2.0",
"hash": 6738674117378407000,
"line_mean": 20.2244897959,
"line_max": 50,
"alpha_frac": 0.5134615385,
"autogenerated": false,
"ratio": 3.6363636363636362,
"config_test": false,
"... |
__author__ = 'allentran'
import numpy as np
import lasagne
import theano
import theano.tensor as TT
from lasagne.regularization import regularize_network_params, l2
class LastTimeStepLayer(lasagne.layers.Layer):
def __init__(self, incoming, batch_size, last_indexes, **kwargs):
super(LastTimeStepLayer, se... | {
"repo_name": "allentran/fed-rates-bot",
"path": "fed_bot/model/lstm_lasagne.py",
"copies": "1",
"size": "8422",
"license": "mit",
"hash": -1079157643151095800,
"line_mean": 40.6930693069,
"line_max": 158,
"alpha_frac": 0.611137497,
"autogenerated": false,
"ratio": 3.528278173439464,
"config_te... |
__author__ = 'allentran'
import numpy as np
import theano
import theano.tensor as TT
from theano_layers import layers
class FedLSTM(object):
def __init__(
self,
input_size=300,
output_size=3,
hidden_size=None,
lstm_size=None,
truncate=10,
... | {
"repo_name": "allentran/fed-rates-bot",
"path": "fed_bot/model/lstm.py",
"copies": "1",
"size": "5799",
"license": "mit",
"hash": -5154686223776002000,
"line_mean": 32.1371428571,
"line_max": 107,
"alpha_frac": 0.5594067943,
"autogenerated": false,
"ratio": 3.677235256816741,
"config_test": fa... |
__author__ = 'allentran'
import numpy as np
from ..scraper import Scraper
from ..model import lstm, lstm_lasagne
def model_test():
n_sentences = 6
T = 21
n_batch = 7
vocab_size=55
word_vector_size=111
test_ob = dict(
word_vectors=np.random.randint(0, vocab_size, size=(T, n_sentences... | {
"repo_name": "allentran/fed-rates-bot",
"path": "fed_bot/tests/tests.py",
"copies": "1",
"size": "2767",
"license": "mit",
"hash": 6238550930257943000,
"line_mean": 26.67,
"line_max": 160,
"alpha_frac": 0.5724611493,
"autogenerated": false,
"ratio": 3.176808266360505,
"config_test": true,
"h... |
__author__ = 'allentran'
import re
import urlparse
import os
import requests
from bs4 import BeautifulSoup
class Scraper(object):
def __init__(self, start_year=2008, end_year=2009):
self.date_regex = re.compile(r'(?P<year>\d{4})(?P<month>\d{2})(?P<day>\d{2})')
self.recent_url = 'http://www.fed... | {
"repo_name": "allentran/fed-rates-bot",
"path": "fed_bot/scraper/frb.py",
"copies": "1",
"size": "2663",
"license": "mit",
"hash": 1992766341370717200,
"line_mean": 34.0526315789,
"line_max": 123,
"alpha_frac": 0.5884340969,
"autogenerated": false,
"ratio": 3.550666666666667,
"config_test": fa... |
__author__ = 'allentran'
import theano
from theano_layers import layers
import numpy as np
import theano.tensor as TT
class DeepDPGModel(object):
def __init__(self, n_minibatch, n_assets, n_actions, k_info, preprocessed_size, lstm_size, merge_size, dense_sizes):
self.policy_model = DeepPolicyNetwork(
... | {
"repo_name": "allentran/rl-l2t",
"path": "model/models.py",
"copies": "1",
"size": "6536",
"license": "apache-2.0",
"hash": 166040880560209660,
"line_mean": 24.8339920949,
"line_max": 131,
"alpha_frac": 0.5035189718,
"autogenerated": false,
"ratio": 4.012277470841007,
"config_test": false,
"... |
__author__ = 'Allison MacLeay'
import numpy as np
import pandas as pd
import sys
#import CS6140_A_MacLeay.utils as utils
from CS6140_A_MacLeay import utils
from numpy.linalg import det, pinv, inv
from sklearn.cross_validation import KFold
def compute_accuracy(tp, tn, fp, fn):
return float(tp+tn)/(tn+tp+fp+fn)
de... | {
"repo_name": "alliemacleay/MachineLearning_CS6140",
"path": "utils/Stats.py",
"copies": "1",
"size": "9293",
"license": "mit",
"hash": 807885298913479300,
"line_mean": 24.6005509642,
"line_max": 90,
"alpha_frac": 0.5583772732,
"autogenerated": false,
"ratio": 3.126850605652759,
"config_test": ... |
__author__ = 'Allison MacLeay'
from copy import deepcopy
import numpy as np
import CS6140_A_MacLeay.utils.NNet_5 as N5
"""
Neural Network
t - target - vector[k]
z - output - vector[k]
y - hidden - vector[j]
x - input - vector[i]
wji - weight between x and y - matrix[i, j]
wji[ 11 12 13 14 1j
... | {
"repo_name": "alliemacleay/MachineLearning_CS6140",
"path": "utils/NNet.py",
"copies": "1",
"size": "7156",
"license": "mit",
"hash": -8088037296961689000,
"line_mean": 25.2124542125,
"line_max": 106,
"alpha_frac": 0.503353829,
"autogenerated": false,
"ratio": 3.2205220522052205,
"config_test"... |
__author__ = 'Allison MacLeay'
from CS6140_A_MacLeay import utils
import numpy as np
import pandas as pd
import CS6140_A_MacLeay.utils.Stats as mystats
class mockStump(object):
def __init__(self, feature, threshold):
self.feature = [feature, -2, -2]
self.threshold = [threshold, -2, -2]
class Tre... | {
"repo_name": "alliemacleay/MachineLearning_CS6140",
"path": "Homeworks/HW4/__init__.py",
"copies": "1",
"size": "14623",
"license": "mit",
"hash": -8056152829399094000,
"line_mean": 32.4622425629,
"line_max": 159,
"alpha_frac": 0.5651371128,
"autogenerated": false,
"ratio": 3.4189852700490997,
... |
__author__ = 'Allison MacLeay'
from sklearn.tree import DecisionTreeClassifier
import CS6140_A_MacLeay.Homeworks.HW4.data_load as dl
import numpy as np
class Bagging(object):
def __init__(self, max_rounds=10, sample_size=10, learner=DecisionTreeClassifier):
self.max_rounds = max_rounds
self.sample... | {
"repo_name": "alliemacleay/MachineLearning_CS6140",
"path": "Homeworks/HW4/bagging.py",
"copies": "1",
"size": "2071",
"license": "mit",
"hash": -2617123278695067000,
"line_mean": 34.7068965517,
"line_max": 109,
"alpha_frac": 0.5697730565,
"autogenerated": false,
"ratio": 3.308306709265176,
"c... |
__author__ = 'Allison MacLeay'
from sklearn.tree import DecisionTreeRegressor
import CS6140_A_MacLeay.Homeworks.HW4 as hw4
import numpy as np
class GradientBoostRegressor(object):
def __init__(self, n_estimators=10, learning_rate=0.1, max_depth=1, learner=DecisionTreeRegressor):
self.train_score = 0
... | {
"repo_name": "alliemacleay/MachineLearning_CS6140",
"path": "utils/GradientBoost.py",
"copies": "1",
"size": "1921",
"license": "mit",
"hash": 5105505519243310000,
"line_mean": 32.701754386,
"line_max": 103,
"alpha_frac": 0.5991671005,
"autogenerated": false,
"ratio": 3.4120781527531086,
"conf... |
__author__ = 'Allison MacLeay'
import CS6140_A_MacLeay.Homeworks.HW3 as hw3
import CS6140_A_MacLeay.utils as utils
import numpy as np
from copy import deepcopy
class NaiveBayes():
def __init__(self, model_type, alpha=1, ignore_cols = []):
self.model_type = model_type
self.train_acc = 0
... | {
"repo_name": "alliemacleay/MachineLearning_CS6140",
"path": "utils/NaiveBayes.py",
"copies": "1",
"size": "13733",
"license": "mit",
"hash": 6571886659857699000,
"line_mean": 38.8057971014,
"line_max": 138,
"alpha_frac": 0.5212262434,
"autogenerated": false,
"ratio": 3.230533992001882,
"config... |
__author__ = 'Allison MacLeay'
import CS6140_A_MacLeay.utils as utils
import numpy as np
import os
uci_folder = 'data/UCI'
def data_q2():
pass
def data_q3_crx():
path = os.path.join(uci_folder, 'crx')
data = read_file(os.path.join(path, 'crx.data'))
data = clean_data(data)
data = normalize_data(... | {
"repo_name": "alliemacleay/MachineLearning_CS6140",
"path": "Homeworks/HW4/data_load.py",
"copies": "1",
"size": "6767",
"license": "mit",
"hash": 5152413463089065000,
"line_mean": 25.537254902,
"line_max": 69,
"alpha_frac": 0.5220925078,
"autogenerated": false,
"ratio": 3.400502512562814,
"co... |
__author__ = 'Allison MacLeay'
import CS6140_A_MacLeay.utils as utils
import pandas as pd
import CS6140_A_MacLeay.utils.Stats as mystats
import numpy as np
from CS6140_A_MacLeay.utils.Stats import multivariate_normal
#from scipy.stats import multivariate_normal # for checking
def load_and_normalize_spambase():
re... | {
"repo_name": "alliemacleay/MachineLearning_CS6140",
"path": "Homeworks/HW3/__init__.py",
"copies": "1",
"size": "9832",
"license": "mit",
"hash": 2794959578143385600,
"line_mean": 29.9182389937,
"line_max": 88,
"alpha_frac": 0.5482099268,
"autogenerated": false,
"ratio": 3.2567075190460417,
"c... |
__author__ = 'Allison MacLeay'
import CS6140_A_MacLeay.utils.Tree as tree
import CS6140_A_MacLeay.utils.GradientDescent as gd
import CS6140_A_MacLeay.utils as utils
import CS6140_A_MacLeay.utils.plots as plot
import CS6140_A_MacLeay.Homeworks.hw2_new as hw2
import CS6140_A_MacLeay.utils.Stats as mystats
import numpy a... | {
"repo_name": "alliemacleay/MachineLearning_CS6140",
"path": "Tests/testTree.py",
"copies": "1",
"size": "7595",
"license": "mit",
"hash": 6298505101809626000,
"line_mean": 32.0217391304,
"line_max": 99,
"alpha_frac": 0.6069782752,
"autogenerated": false,
"ratio": 2.781032588795313,
"config_tes... |
__author__ = 'Allison MacLeay'
import numpy as np
import CS6140_A_MacLeay.utils.Stats as mystats
from CS6140_A_MacLeay.utils import check_binary
from CS6140_A_MacLeay.utils.Stats import get_error
import pandas as pd
class Perceptron:
def __init__(self, data, predict_col, learning_rate, max_iterations=1000):
... | {
"repo_name": "alliemacleay/MachineLearning_CS6140",
"path": "utils/Perceptron.py",
"copies": "1",
"size": "4177",
"license": "mit",
"hash": -7878808161132714000,
"line_mean": 28.6241134752,
"line_max": 112,
"alpha_frac": 0.5566195834,
"autogenerated": false,
"ratio": 3.213076923076923,
"config... |
__author__ = 'Allison MacLeay'
import numpy as np
import pandas as pd
from CS6140_A_MacLeay.utils import average, sigmoid, add_col, get_hw
import CS6140_A_MacLeay.utils.Stats as mystats
import sys
#import CS6140_A_MacLeay.Homeworks.HW3 as hw3u
def to_col_vec(x):
return x.reshape((len(x), 1))
def gradient(X, Y, ... | {
"repo_name": "alliemacleay/MachineLearning_CS6140",
"path": "utils/GradientDescent.py",
"copies": "1",
"size": "3957",
"license": "mit",
"hash": -7000099899518504000,
"line_mean": 29.2061068702,
"line_max": 101,
"alpha_frac": 0.539802881,
"autogenerated": false,
"ratio": 3.283817427385892,
"co... |
__author__ = 'Allison MacLeay'
import numpy as np
import pandas as pd
import CS6140_A_MacLeay.Homeworks.hw2_new as hw2
import CS6140_A_MacLeay.utils.Stats as mystats
import matplotlib.pyplot as plt
import matplotlib.patches as patches
def count_black(arr):
#print len(arr)
black = np.zeros(shape=(len(arr), le... | {
"repo_name": "alliemacleay/MachineLearning_CS6140",
"path": "Homeworks/HW5/__init__.py",
"copies": "1",
"size": "6755",
"license": "mit",
"hash": -3105942176935273000,
"line_mean": 31.6328502415,
"line_max": 142,
"alpha_frac": 0.5576609919,
"autogenerated": false,
"ratio": 3.225883476599809,
"... |
__author__ = 'Allison MacLeay'
import sys
import os
import argparse
import time
from glob import glob
from tempfile import mkdtemp
"""
Run a command on every file in a directory
"""
def get_cmd(fname, cmd, params):
""" return command """
out_name = os.path.join(params['out'], params['name'] + fname)
cmd... | {
"repo_name": "alliemacleay/misc",
"path": "batch_command.py",
"copies": "1",
"size": "5201",
"license": "mit",
"hash": 3344739154065286000,
"line_mean": 38.4015151515,
"line_max": 135,
"alpha_frac": 0.5566237262,
"autogenerated": false,
"ratio": 3.907588279489106,
"config_test": false,
"has_... |
__author__ = 'Allison MacLeay'
from sklearn.tree import DecisionTreeClassifier
import CS6140_A_MacLeay.Homeworks.HW4 as decTree
import CS6140_A_MacLeay.Homeworks.HW4 as hw4
import numpy as np
class BoostRound():
def __init__(self, adaboost, round_number):
self.learner = adaboost.learner
self.erro... | {
"repo_name": "alliemacleay/MachineLearning_CS6140",
"path": "utils/AdaboostRound.py",
"copies": "1",
"size": "4485",
"license": "mit",
"hash": -434915011835039000,
"line_mean": 32.7218045113,
"line_max": 101,
"alpha_frac": 0.6028985507,
"autogenerated": false,
"ratio": 3.685291700903862,
"conf... |
__author__ = 'allyjweir'
import os
import errno
import pdb
import textract
from django.core.files.storage import default_storage
from django.core.files.base import ContentFile
from django.conf import settings
import magic
def make_sure_path_exists(path):
try:
os.makedirs(path)
except OSError as except... | {
"repo_name": "allyjweir/lackawanna",
"path": "lackawanna/datapoint/file_import.py",
"copies": "1",
"size": "2600",
"license": "bsd-3-clause",
"hash": -1077739569369585800,
"line_mean": 32.3333333333,
"line_max": 242,
"alpha_frac": 0.7169230769,
"autogenerated": false,
"ratio": 4,
"config_test"... |
"""
This file can be used to denoise single channel images using approximate
MAX-SUM inference on a Markov Random Field.
"""
import numpy as np
from scipy import sparse
from scipy.misc.pilutil import imread, imsave
import pylab
import models
import cliques
import inference
import potentials
from general imp... | {
"repo_name": "bhrzslm/uncertainty-reasoning",
"path": "my_engine/others/GrMPy/lib/GrMPy/Examples/Non-trivial/batch_mrf_image_denoising.py",
"copies": "1",
"size": "11529",
"license": "mit",
"hash": -4410897609154473000,
"line_mean": 35.5537459283,
"line_max": 81,
"alpha_frac": 0.5510451904,
"autog... |
"""
This is a tutorial on how to create a Bayesian network, and perform
approximate MAX-SUM inference on it.
"""
"""Import the required numerical modules"""
import numpy as np
"""Import the GrMPy modules"""
import models
import inference
import cpds
if __name__ == '__main__':
"""
This example is... | {
"repo_name": "bhrzslm/uncertainty-reasoning",
"path": "my_engine/others/GrMPy/lib/GrMPy/Examples/Discrete/BNET/Inference/Approximate/Tut_BNET_sumproduct.py",
"copies": "1",
"size": "3253",
"license": "mit",
"hash": 5684060546605169000,
"line_mean": 29.5825242718,
"line_max": 75,
"alpha_frac": 0.5351... |
"""
This is a tutorial on how to create a Bayesian network, and perform
exact MAX-SUM inference on it.
"""
"""Import the required numerical modules"""
import numpy as np
from sprinkler_data import sprinkler_evidence, sprinkler_mpe
"""Import the GrMPy modules"""
import models
import inference
import cpds
... | {
"repo_name": "bhrzslm/uncertainty-reasoning",
"path": "my_engine/others/GrMPy/lib/GrMPy/Tests/test_BNET_maxsum.py",
"copies": "1",
"size": "3128",
"license": "mit",
"hash": -5845971085484897000,
"line_mean": 27.7904761905,
"line_max": 75,
"alpha_frac": 0.5246163683,
"autogenerated": false,
"rati... |
"""
This is a tutorial on how to create a Bayesian network, and perform
exact MAX-SUM inference on it.
"""
"""Import the required numerical modules"""
import numpy as np
"""Import the GrMPy modules"""
import models
import inference
import cpds
if __name__ == '__main__':
"""
This example is based... | {
"repo_name": "bhrzslm/uncertainty-reasoning",
"path": "my_engine/others/GrMPy/lib/GrMPy/Examples/Discrete/BNET/Inference/Exact/Tut_BNET_sumproduct.py",
"copies": "1",
"size": "3279",
"license": "mit",
"hash": -3842371830754611700,
"line_mean": 29.5288461538,
"line_max": 75,
"alpha_frac": 0.535834095... |
"""
This is a tutorial on how to create a Bayesian network, learn its parameters
from fully observed data via MLE, and perform exact MAX-SUM inference on it.
"""
"""Import the required numerical modules"""
import numpy as np
"""Import the GrMPy modules"""
import models
import inference
import cpds
if __na... | {
"repo_name": "bhrzslm/uncertainty-reasoning",
"path": "my_engine/others/GrMPy/lib/GrMPy/Examples/Discrete/BNET/Learning/MLE/Tut_BNET_MLE.py",
"copies": "1",
"size": "3886",
"license": "mit",
"hash": -2616775477888170000,
"line_mean": 27.8923076923,
"line_max": 77,
"alpha_frac": 0.4065877509,
"auto... |
"""
This is a tutorial on how to create a Bayesian network, learn its parameters
from partially observed data via EM, and perform exact MAX-SUM inference on it.
"""
"""Import the required numerical modules"""
import numpy as np
"""Import the GrMPy modules"""
import models
import inference
import cpds
if _... | {
"repo_name": "bhrzslm/uncertainty-reasoning",
"path": "my_engine/others/GrMPy/lib/GrMPy/Examples/Discrete/BNET/Learning/EM/Tut_BNET_EM.py",
"copies": "1",
"size": "3997",
"license": "mit",
"hash": -2153821050079191300,
"line_mean": 28.2803030303,
"line_max": 79,
"alpha_frac": 0.4158118589,
"autoge... |
"""
This is a tutorial on how to create a Markov random field, and perform
approximate MAX-SUM inference on it.
"""
"""Import the required numerical modules"""
import numpy as np
"""Import the GrMPy modules"""
import models
import inference
import cliques
if __name__ == '__main__':
"""
This exam... | {
"repo_name": "bhrzslm/uncertainty-reasoning",
"path": "my_engine/others/GrMPy/lib/GrMPy/Examples/Discrete/MRF/Inference/Approximate/Tut_MRF_maxsum.py",
"copies": "1",
"size": "3178",
"license": "mit",
"hash": 8291124756713509000,
"line_mean": 31.1041666667,
"line_max": 76,
"alpha_frac": 0.5298930145... |
"""
This is a tutorial on how to create a Markov random field, and perform
approximate SUM-PRODUCT inference on it.
"""
"""Import the required numerical modules"""
import numpy as np
"""Import the GrMPy modules"""
import models
import inference
import cliques
if __name__ == '__main__':
"""
This ... | {
"repo_name": "bhrzslm/uncertainty-reasoning",
"path": "my_engine/others/GrMPy/lib/GrMPy/Examples/Discrete/MRF/Inference/Approximate/Tut_MRF_sumproduct.py",
"copies": "1",
"size": "3377",
"license": "mit",
"hash": 2474598772053122000,
"line_mean": 32.1111111111,
"line_max": 76,
"alpha_frac": 0.536867... |
"""
This is a tutorial on how to create a Markov random field, and perform
exact MAX-SUM inference on it.
"""
"""Import the required numerical modules"""
import numpy as np
from sprinkler_data import sprinkler_evidence, sprinkler_mpe
"""Import the GrMPy modules"""
import models
import inference
import cliqu... | {
"repo_name": "bhrzslm/uncertainty-reasoning",
"path": "my_engine/others/GrMPy/lib/GrMPy/Tests/test_MRF_maxsum.py",
"copies": "1",
"size": "3193",
"license": "mit",
"hash": 6573256029279029000,
"line_mean": 29.6138613861,
"line_max": 76,
"alpha_frac": 0.5299091763,
"autogenerated": false,
"ratio"... |
"""
This is a tutorial on how to create a Markov random field, and perform
exact MAX-SUM inference on it.
"""
"""Import the required numerical modules"""
import numpy as np
"""Import the GrMPy modules"""
import models
import inference
import cliques
if __name__ == '__main__':
"""
This example is... | {
"repo_name": "bhrzslm/uncertainty-reasoning",
"path": "my_engine/others/GrMPy/lib/GrMPy/Examples/Discrete/MRF/Inference/Exact/Tut_MRF_maxsum.py",
"copies": "1",
"size": "3180",
"license": "mit",
"hash": -691828130919156900,
"line_mean": 30.4489795918,
"line_max": 76,
"alpha_frac": 0.5251572327,
"a... |
"""
This is a tutorial on how to create a Markov random field, and perform
exact SUM-PRODUCT inference on it.
"""
"""Import the required numerical modules"""
import numpy as np
from sprinkler_data import sprinkler_evidence, sprinkler_probs
"""Import the GrMPy modules"""
import models
import inference
import c... | {
"repo_name": "bhrzslm/uncertainty-reasoning",
"path": "my_engine/others/GrMPy/lib/GrMPy/Tests/test_MRF_sumproduct.py",
"copies": "1",
"size": "3744",
"license": "mit",
"hash": -6938001118818341000,
"line_mean": 30.275862069,
"line_max": 79,
"alpha_frac": 0.5192307692,
"autogenerated": false,
"ra... |
"""
This is a tutorial on how to create a Markov random field, and perform
exact SUM-PRODUCT inference on it.
"""
"""Import the required numerical modules"""
import numpy as np
"""Import the GrMPy modules"""
import models
import inference
import cliques
if __name__ == '__main__':
"""
This exampl... | {
"repo_name": "bhrzslm/uncertainty-reasoning",
"path": "my_engine/others/GrMPy/lib/GrMPy/Examples/Discrete/MRF/Inference/Exact/Tut_MRF_sumproduct.py",
"copies": "1",
"size": "3363",
"license": "mit",
"hash": 4591044741365252600,
"line_mean": 31.9696969697,
"line_max": 76,
"alpha_frac": 0.5349390425,
... |
"""
This is a tutorial on how to create a Markov random field, learn its
parameters from fully observed data via MLE, and perform exact MAX-SUM
inference on it.
"""
"""Import the required numerical modules"""
import numpy as np
"""Import the GrMPy modules"""
import models
import inference
import cliques
... | {
"repo_name": "bhrzslm/uncertainty-reasoning",
"path": "my_engine/others/GrMPy/lib/GrMPy/Examples/Discrete/MRF/Learning/EM/Tut_MRF_MLE.py",
"copies": "1",
"size": "4602",
"license": "mit",
"hash": 3292670312574869000,
"line_mean": 29.7379310345,
"line_max": 77,
"alpha_frac": 0.4387222947,
"autogene... |
"""
This is a tutorial on how to create a Markov random field, learn its
parameters from partially observed data via EM, and perform exact MAX-SUM
inference on it.
"""
"""Import the required numerical modules"""
import numpy as np
"""Import the GrMPy modules"""
import models
import inference
import cliques
... | {
"repo_name": "bhrzslm/uncertainty-reasoning",
"path": "my_engine/others/GrMPy/lib/GrMPy/Examples/Discrete/MRF/Learning/EM/Tut_MRF_EM.py",
"copies": "1",
"size": "4609",
"license": "mit",
"hash": 8728251330566328000,
"line_mean": 29.5684931507,
"line_max": 77,
"alpha_frac": 0.4391408115,
"autogener... |
"""
This module contains functions that are used in testing the PyBNT toolbox.
Functions contained in this module are:
'are_equal': Tests whether two Numpy ndarray's are equivalent.
'read_example': Reads test data from a text file.
"""
import numpy as np
from os import path
def read_samples(fname, n... | {
"repo_name": "bhrzslm/uncertainty-reasoning",
"path": "my_engine/others/GrMPy/lib/GrMPy/Tests/Old unit tests/utilities.py",
"copies": "1",
"size": "1797",
"license": "mit",
"hash": 3425775255974178000,
"line_mean": 25.2272727273,
"line_max": 76,
"alpha_frac": 0.510851419,
"autogenerated": false,
... |
"""
This module contains the classes used to perform inference on various
graphical models.
"""
__docformat__ = 'restructuredtext'
import numpy as np
from numpy.testing import assert_array_almost_equal, assert_array_equal
from scipy import sparse
import general
import graph
import cliques
import potentials... | {
"repo_name": "bhrzslm/uncertainty-reasoning",
"path": "my_engine/others/GrMPy/lib/GrMPy/Tests/Old unit tests/test_learning.py",
"copies": "1",
"size": "6257",
"license": "mit",
"hash": -7903659463712798000,
"line_mean": 28.8226600985,
"line_max": 77,
"alpha_frac": 0.5830270097,
"autogenerated": fa... |
from airflow import DAG
from airflow.operators.bash_operator import BashOperator
from airflow.contrib.operators import SSHExecuteOperator
from airflow.contrib.hooks import SSHHook
from datetime import datetime, timedelta
default_args = {
'owner': 'alo-alt',
'depends_on_past': False,
'start_date': datetim... | {
"repo_name": "alo-alt/airflow",
"path": "DAG/process_restart.py",
"copies": "1",
"size": "1384",
"license": "apache-2.0",
"hash": -1602024860584322300,
"line_mean": 25.6153846154,
"line_max": 87,
"alpha_frac": 0.6625722543,
"autogenerated": false,
"ratio": 3.351089588377724,
"config_test": fal... |
__author__ = "Alok Kumar"
import click
import datetime
import dateutil.tz
import dateutil.parser
import colorama
import humanize
import requests
import json
FUTURE = "future"
NOW = "now"
PAST = "past"
SCREEN_WIDTH = 68
def prettify(match):
diff = (datetime.datetime.now(tz=dateutil.tz.tzlocal()) - dateutil.parse... | {
"repo_name": "rajalokan/wc14",
"path": "wc14/today.py",
"copies": "1",
"size": "2836",
"license": "mit",
"hash": -2804748512971033000,
"line_mean": 25.7641509434,
"line_max": 135,
"alpha_frac": 0.5849788434,
"autogenerated": false,
"ratio": 3.645244215938303,
"config_test": false,
"has_no_ke... |
__author__ = 'alphabuddha'
from dss.forms import *
from cropper.models import *
from django.shortcuts import render_to_response, HttpResponseRedirect, render
from django.template.context import RequestContext
from django.contrib.auth.decorators import login_required
from django.core.urlresolvers import reverse
from re... | {
"repo_name": "wanjohikibui/agrismart",
"path": "cropper/views.py",
"copies": "1",
"size": "2810",
"license": "mit",
"hash": 9181279310221629000,
"line_mean": 37.4931506849,
"line_max": 146,
"alpha_frac": 0.7832740214,
"autogenerated": false,
"ratio": 3.6876640419947506,
"config_test": false,
... |
__author__ = 'alphabuddha'
from dss.forms import *
from dss.models import *
from django.shortcuts import render_to_response, HttpResponseRedirect, render
from django.template.context import RequestContext
from django.contrib.auth.decorators import login_required
from django.core.urlresolvers import reverse
from report... | {
"repo_name": "wanjohikibui/agrismart",
"path": "dss/views.py",
"copies": "1",
"size": "12344",
"license": "mit",
"hash": 7835541510754744000,
"line_mean": 34.9883381924,
"line_max": 176,
"alpha_frac": 0.6193292288,
"autogenerated": false,
"ratio": 4.210095497953615,
"config_test": false,
"ha... |
__author__ = 'Alpha'
from visual import *
# Simple program where projectile follows path determined by forces applied to it
# Velocity is vector(number, number, number)
# Force is vector(number, number, number)
# Momentum is vector(number, number, number)
# Mass is number
# Position is vector(number, number, nu... | {
"repo_name": "dilynfullerton/vpython",
"path": "projectile.py",
"copies": "1",
"size": "4065",
"license": "cc0-1.0",
"hash": -4995567611350809000,
"line_mean": 22.1022727273,
"line_max": 81,
"alpha_frac": 0.5259532595,
"autogenerated": false,
"ratio": 3.1907378335949765,
"config_test": false,
... |
import math
from math import sin, cos, acos, tan, atan2, sqrt, radians, degrees, asin, floor, log, pi
R = 6371 #km
def convertHMStoDecimal( hms):
h = hms[0]
m = hms[1]
s = hms[2]
if h < 0:
sign = -1
else:
sign = 1
dec = (h + (m/60.0) + (s/3600.0) ) * sign#/1000000.0;
retur... | {
"repo_name": "alpsayin/python-gps",
"path": "gps.py",
"copies": "1",
"size": "6607",
"license": "mit",
"hash": -4079641733830758400,
"line_mean": 37.6374269006,
"line_max": 129,
"alpha_frac": 0.6092023611,
"autogenerated": false,
"ratio": 2.893999123959702,
"config_test": false,
"has_no_keyw... |
__author__ = 'alvaro'
import sys
import os
import networkx as nx
import pylab as p
def main():
graphs = {}
if os.path.isdir(sys.argv[1]):
for file in os.listdir(sys.argv[1]):
graphs[file] = nx.read_gml(sys.argv[1] + '/' + file)
elif os.path.isfile(sys.argv[1]):
graphs[sys.arg... | {
"repo_name": "servioticy/servioticy-vagrant",
"path": "puppet/files/other/topology_generator/topology_generator/benchmark/visualization.py",
"copies": "2",
"size": "1644",
"license": "apache-2.0",
"hash": -4770169965303069000,
"line_mean": 30.6346153846,
"line_max": 87,
"alpha_frac": 0.496350365,
... |
""" @author: Alvaro Velasco Date: 10 Mayo 2016 """
import gtk
from random import randint
# DEFINITIONS
def apretado_undo(boton):
if undo == 1:
but_undo.set_label("Puedes deshacer %s vez mas" % undo)
else:
but_undo.set_label("Puedes deshacer %s veces mas" % undo)
def change_color():
for x in range(0, TAM):
... | {
"repo_name": "velastroll/First-Python-Game",
"path": "game.py",
"copies": "1",
"size": "15286",
"license": "artistic-2.0",
"hash": -4470701385233971700,
"line_mean": 28.0608365019,
"line_max": 120,
"alpha_frac": 0.6407169959,
"autogenerated": false,
"ratio": 2.2542397876419407,
"config_test": ... |
__author__ = 'alvertisjo'
import urllib2,urllib
import apiURLs
import json
import requests
from requests.exceptions import ConnectionError,Timeout
from random import randrange
import json
from django.utils.dateformat import format as timeformat
class RecommenderSECall(object):
def __init__(self,token, education=... | {
"repo_name": "OPENi-ict/ntua_demo",
"path": "openiPrototype/appUI/queryHandlers.py",
"copies": "1",
"size": "20464",
"license": "apache-2.0",
"hash": 227421526402075100,
"line_mean": 40.8507157464,
"line_max": 312,
"alpha_frac": 0.5726153245,
"autogenerated": false,
"ratio": 3.7833240894804954,
... |
__author__ = 'alvertisjo'
from django.core.serializers import json
import requests
from requests.packages.urllib3 import Timeout
from requests.packages.urllib3.exceptions import ConnectionError
class OpenProductData(object):
def getData(self):
# rowStep=100
# currentPage=0
# #####document... | {
"repo_name": "OPENi-ict/ntua_demo",
"path": "openiPrototype/appUI/importProductData.py",
"copies": "1",
"size": "1614",
"license": "apache-2.0",
"hash": 3468585145048355000,
"line_mean": 37.4523809524,
"line_max": 231,
"alpha_frac": 0.5978934325,
"autogenerated": false,
"ratio": 3.46351931330472... |
__author__ = 'am6puk'
import smtplib
from email.mime.multipart import MIMEMultipart
from email.mime.base import MIMEBase
from email.mime.text import MIMEText
from email import Encoders
import os
import ConfigParser
name = 'simple_backup.conf'
conf_path = '/etc/simple_backup/'
config = ConfigParser.ConfigParser()
confi... | {
"repo_name": "Am6puk/Simple_Mysql_Backup",
"path": "src/simple_backup/modules/mail.py",
"copies": "1",
"size": "1338",
"license": "mit",
"hash": 4046335615415301000,
"line_mean": 28.0869565217,
"line_max": 100,
"alpha_frac": 0.6943198804,
"autogenerated": false,
"ratio": 3.170616113744076,
"co... |
__author__ = 'Am6puk'
#!/usr/bin/env python
"""
simple_backup setup file
"""
from distutils.core import setup
import glob
install_requires = [
'mysql-python>=1.2.3',
'argparse',
'ConfigParser'
]
setup(
name='simple_backup',
version='0.1.4',
description='Simple Mysql Backup',
aut... | {
"repo_name": "Am6puk/Simple_Mysql_Backup",
"path": "setup.py",
"copies": "1",
"size": "1310",
"license": "mit",
"hash": 3454326659753379000,
"line_mean": 26.2916666667,
"line_max": 79,
"alpha_frac": 0.5664122137,
"autogenerated": false,
"ratio": 3.9696969696969697,
"config_test": false,
"has... |
__author__ = 'amancevice'
import pline
from nose.tools import assert_equal, assert_dict_equal, assert_true, assert_in
def test_activity_shape():
my_activity = pline.activities.ShellCommandActivity(name='MyActivity', id='Activity_adbc1234')
my_activity.command = "echo $1 $2"
my_activity.scriptArgument = ... | {
"repo_name": "amancevice/pline",
"path": "tests/__init__.py",
"copies": "1",
"size": "8552",
"license": "mit",
"hash": 7757091248981622000,
"line_mean": 41.1280788177,
"line_max": 126,
"alpha_frac": 0.5647801684,
"autogenerated": false,
"ratio": 3.8714350384789498,
"config_test": true,
"has_... |
__author__ = 'amandeep'
import re
from datetime import datetime, timedelta
from time import mktime, gmtime
import calendar
class DM(object):
def __init__(self):
self.name = "Date Manipulation"
@staticmethod
def iso8601date(date, date_format=None):
"""Convert a date to ISO8601 date format... | {
"repo_name": "darkshadows123/dig-alignment",
"path": "versions/3.0/karma/python/date_manipulation.py",
"copies": "2",
"size": "3984",
"license": "apache-2.0",
"hash": -2942264588346968600,
"line_mean": 28.2941176471,
"line_max": 92,
"alpha_frac": 0.5022590361,
"autogenerated": false,
"ratio": 4.... |
__author__ = 'amandeep'
import json
from flask import request
from flask import Response
from flask import make_response
from functools import wraps
from flask import Flask
from elasticsearch_manager import ElasticSearchManager
from dig_bulk_folders import BulkFolders
import ConfigParser
application = Flask(__name__)... | {
"repo_name": "usc-isi-i2/dig-export-csv",
"path": "application.py",
"copies": "1",
"size": "7963",
"license": "apache-2.0",
"hash": 8918503335890991000,
"line_mean": 29.5095785441,
"line_max": 124,
"alpha_frac": 0.5800577672,
"autogenerated": false,
"ratio": 4.0298582995951415,
"config_test": ... |
__author__ = 'amandeep'
import re
import hashlib
from urlparse import urlparse
DOLLAR_PRICE_REGEXPS = [re.compile(r'''\$\s*(?:\d{1,3},\s?)*\d{1,3}(?:(?:\.\d+)|[KkMm])?''', re.IGNORECASE),
re.compile(r'''USD\s*\d{1,7}(?:\.\d+)?''', re.IGNORECASE),
re.compile(r'''\d{1,7}(... | {
"repo_name": "usc-isi-i2/dig-alignment",
"path": "versions/3.0/karma/python/string_manipulation.py",
"copies": "2",
"size": "11969",
"license": "apache-2.0",
"hash": -275451079328352540,
"line_mean": 29.7686375321,
"line_max": 111,
"alpha_frac": 0.48441808,
"autogenerated": false,
"ratio": 4.001... |
__author__ = 'amandeep'
import re
country_codes_2 = [
"AF", "AL", "DZ", "AS", "AD", "AO", "AI", "AQ", "AG", "AR", "AM", "AW", "AU", "AT", "AZ", "BS", "BH", "BD", "BB",
"BY", "BE", "BZ", "BJ", "BM", "BT", "BO", "BA", "BA", "BA", "BW", "BV", "BV", "BR", "IO", "BN", "BG", "BF", "BI",
"KH", "CM", "CA", "CV", ... | {
"repo_name": "darkshadows123/dig-alignment",
"path": "versions/3.0/karma/python/location_manipulation.py",
"copies": "2",
"size": "18663",
"license": "apache-2.0",
"hash": -3154156346501291500,
"line_mean": 53.2529069767,
"line_max": 120,
"alpha_frac": 0.5446605583,
"autogenerated": false,
"rati... |
__author__ = 'amandeep'
import time
class HbaseManager(object):
def __init__(self, sc, conf, hbase_hostname, hbase_tablename, **kwargs):
self.name = "ES2HBase"
self.sc = sc
self.conf = conf
self.hbase_conf = {"hbase.zookeeper.quorum": hbase_hostname}
self.hbase_table = hbas... | {
"repo_name": "svebk/DeepSentiBank_memex",
"path": "workflows/packages/python-lib/hbase_manager.py",
"copies": "1",
"size": "4696",
"license": "bsd-2-clause",
"hash": 5313052693085453000,
"line_mean": 56.2682926829,
"line_max": 236,
"alpha_frac": 0.6352214651,
"autogenerated": false,
"ratio": 3.6... |
__author__ = 'amandeep'
class HbaseManager(object):
def __init__(self, sc, conf, hbase_hostname, hbase_tablename):
self.name = "ES2HBase"
self.sc = sc
self.conf = conf
self.hbase_conf = {"hbase.zookeeper.quorum": hbase_hostname}
self.hbase_table = hbase_tablename
def r... | {
"repo_name": "usc-isi-i2/WEDC",
"path": "spark_dependencies/python_lib/digSparkUtil/hbase_manager.py",
"copies": "2",
"size": "2096",
"license": "apache-2.0",
"hash": -1097130780771201500,
"line_mean": 50.1219512195,
"line_max": 111,
"alpha_frac": 0.6312022901,
"autogenerated": false,
"ratio": 3... |
__author__ = 'amandeep'
"""
USE THESE FOR HBASE
self.hbase_host = 'zk04.xdata.data-tactics-corp.com:2181'
self.hbase_table = 'test_ht_aman'
"""
"""
EXECUTE AS
spark-submit --master local[*] --executor-memory=4g --driver-memory=4g \
--jars jars/elasticsearch-hadoop-2.2.0-m1.jar,jars/spark-examples_2.10-2.... | {
"repo_name": "svebk/DeepSentiBank_memex",
"path": "workflows/packages/python-lib/elastic_manager.py",
"copies": "1",
"size": "3827",
"license": "bsd-2-clause",
"hash": 3703418965140165600,
"line_mean": 44.5595238095,
"line_max": 133,
"alpha_frac": 0.6064802718,
"autogenerated": false,
"ratio": 3... |
__author__ = "Amaral LAN"
__copyright__ = "Copyright 2017-2018, Amaral LAN"
__credits__ = ["Amaral LAN"]
__license__ = "GPL"
__version__ = "1.0"
__maintainer__ = "Amaral LAN"
__email__ = "amaral@northwestern.edu"
__status__ = "Development"
import pystache
import pymongo
from copy import copy
from my_settings import SE... | {
"repo_name": "lamaral1968/maintaining_latex_cv",
"path": "make_tex_files1.0.py",
"copies": "1",
"size": "4326",
"license": "mit",
"hash": -6343429728497818000,
"line_mean": 40.2,
"line_max": 117,
"alpha_frac": 0.4889042996,
"autogenerated": false,
"ratio": 4.204081632653061,
"config_test": fal... |
__author__ = "Amaral LAN"
__copyright__ = "Copyright 2017-2018, Amaral LAN"
__credits__ = ["Amaral LAN"]
__license__ = "GPL"
__version__ = "1.1"
__maintainer__ = "Amaral LAN"
__email__ = "amaral@northwestern.edu"
__status__ = "Production"
import pymongo
from bs4 import BeautifulSoup
from splinter import Browser
from t... | {
"repo_name": "lamaral1968/maintaining_latex_cv",
"path": "scrape_google_scholar_citations.py",
"copies": "1",
"size": "5688",
"license": "mit",
"hash": 7935431556485854000,
"line_mean": 42.4198473282,
"line_max": 116,
"alpha_frac": 0.4474331927,
"autogenerated": false,
"ratio": 4.74395329441201,... |
__author__ = 'amarchaudhari'
import config
import requests
from will.plugin import WillPlugin
from will.decorators import respond_to, periodic, hear, randomly, route, rendered_template, require_settings
class GetSwitchPortStatus(WillPlugin):
@respond_to("switchport status (?P<server_id>.*)")
def say_switchpo... | {
"repo_name": "Amar-Chaudhari/lswhipchatbot",
"path": "lswbot.py",
"copies": "1",
"size": "5560",
"license": "mit",
"hash": -4216513200885038000,
"line_mean": 47.7719298246,
"line_max": 135,
"alpha_frac": 0.5145683453,
"autogenerated": false,
"ratio": 4.234577303884235,
"config_test": false,
... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.