text stringlengths 0 1.05M | meta dict |
|---|---|
from EXOSIMS.Prototypes.SurveySimulation import SurveySimulation
from EXOSIMS.util.deltaMag import deltaMag
import numpy as np
import astropy.units as u
class KnownRVSurvey(SurveySimulation):
"""KnownRVSurvey
Survey Simulation module based on Know RV planets
This class uses estimates of delta magnitu... | {
"repo_name": "dsavransky/EXOSIMS",
"path": "EXOSIMS/SurveySimulation/KnownRVSurvey.py",
"copies": "1",
"size": "1502",
"license": "bsd-3-clause",
"hash": -767907656097522000,
"line_mean": 33.9302325581,
"line_max": 88,
"alpha_frac": 0.6304926764,
"autogenerated": false,
"ratio": 3.57619047619047... |
from EXOSIMS.Prototypes.SurveySimulation import SurveySimulation
import astropy.units as u
import numpy as np
from ortools.linear_solver import pywraplp
from scipy.optimize import minimize,minimize_scalar
import os
try:
import cPickle as pickle
except:
import pickle
from astropy.time import Time
class SLSQPSched... | {
"repo_name": "dsavransky/EXOSIMS",
"path": "EXOSIMS/SurveySimulation/SLSQPScheduler.py",
"copies": "1",
"size": "31114",
"license": "bsd-3-clause",
"hash": 8878222632053734000,
"line_mean": 53.4921190893,
"line_max": 201,
"alpha_frac": 0.6156714019,
"autogenerated": false,
"ratio": 3.48889885624... |
from EXOSIMS.Prototypes.SurveySimulation import SurveySimulation
import astropy.units as u
import numpy as np
import astropy.constants as const
import time
from EXOSIMS.util.deltaMag import deltaMag
import pdb
class linearJScheduler_orbitChar(SurveySimulation):
"""linearJScheduler_orbitChar
This class imp... | {
"repo_name": "dsavransky/EXOSIMS",
"path": "EXOSIMS/SurveySimulation/linearJScheduler_orbitChar.py",
"copies": "1",
"size": "55753",
"license": "bsd-3-clause",
"hash": 4420858490192733700,
"line_mean": 51.997148289,
"line_max": 254,
"alpha_frac": 0.5563288074,
"autogenerated": false,
"ratio": 3.... |
from EXOSIMS.Prototypes.SurveySimulation import SurveySimulation
import astropy.units as u
import numpy as np
import astropy.constants as const
class linearJScheduler_sotoSS(SurveySimulation):
"""linearJScheduler
This class implements the linear cost function scheduler described
in Savransky et al. (... | {
"repo_name": "dsavransky/EXOSIMS",
"path": "EXOSIMS/SurveySimulation/linearJScheduler_sotoSS.py",
"copies": "1",
"size": "9358",
"license": "bsd-3-clause",
"hash": -8954745827421535000,
"line_mean": 42.3240740741,
"line_max": 157,
"alpha_frac": 0.5949989314,
"autogenerated": false,
"ratio": 3.57... |
from EXOSIMS.Prototypes.SurveySimulation import SurveySimulation
import astropy.units as u
import numpy as np
import astropy.constants as const
class linearJScheduler(SurveySimulation):
"""linearJScheduler
This class implements the linear cost function scheduler described
in Savransky et al. (2010).
... | {
"repo_name": "dsavransky/EXOSIMS",
"path": "EXOSIMS/SurveySimulation/linearJScheduler.py",
"copies": "1",
"size": "29043",
"license": "bsd-3-clause",
"hash": -3253104633487853600,
"line_mean": 46.3013029316,
"line_max": 157,
"alpha_frac": 0.5820679682,
"autogenerated": false,
"ratio": 3.68005575... |
from EXOSIMS.Prototypes.SurveySimulation import SurveySimulation
import astropy.units as u
import numpy as np
import itertools
import astropy.constants as const
import time
from EXOSIMS.util.get_module import get_module
import sys, logging
import numpy as np
import astropy.units as u
import astropy.constants as const
i... | {
"repo_name": "dsavransky/EXOSIMS",
"path": "EXOSIMS/SurveySimulation/linearJScheduler_det_only_sotoSS.py",
"copies": "1",
"size": "16226",
"license": "bsd-3-clause",
"hash": 7047220970567359000,
"line_mean": 46.306122449,
"line_max": 254,
"alpha_frac": 0.5816590657,
"autogenerated": false,
"rati... |
from EXOSIMS.Prototypes.SurveySimulation import SurveySimulation
import astropy.units as u
import numpy as np
import scipy
import os.path
try:
import cPickle as pickle
except:
import pickle
import sys
# Python 3 compatibility:
if sys.version_info[0] > 2:
xrange = range
class starkAYO_staticSchedule(Survey... | {
"repo_name": "dsavransky/EXOSIMS",
"path": "EXOSIMS/SurveySimulation/starkAYO_staticSchedule.py",
"copies": "1",
"size": "20421",
"license": "bsd-3-clause",
"hash": 6389204189418495000,
"line_mean": 52.0415584416,
"line_max": 290,
"alpha_frac": 0.5999706185,
"autogenerated": false,
"ratio": 3.31... |
from EXOSIMS.Prototypes.SurveySimulation import SurveySimulation
import EXOSIMS, os
import astropy.units as u
import astropy.constants as const
import numpy as np
import itertools
from scipy import interpolate
try:
import cPickle as pickle
except:
import pickle
import time
from EXOSIMS.util.deltaMag import delt... | {
"repo_name": "dsavransky/EXOSIMS",
"path": "EXOSIMS/SurveySimulation/tieredScheduler_sotoSS.py",
"copies": "1",
"size": "68839",
"license": "bsd-3-clause",
"hash": 4801295033421614000,
"line_mean": 49.9548482605,
"line_max": 254,
"alpha_frac": 0.5604526504,
"autogenerated": false,
"ratio": 3.492... |
from EXOSIMS.Prototypes.SurveySimulation import SurveySimulation
import EXOSIMS, os
import numpy as np
class randomWalkScheduler2(SurveySimulation):
"""randomWalkScheduler2
This class implements a random walk scheduler that selects the
next target at random from the pool of currently available target... | {
"repo_name": "dsavransky/EXOSIMS",
"path": "EXOSIMS/SurveySimulation/randomWalkScheduler2.py",
"copies": "1",
"size": "2447",
"license": "bsd-3-clause",
"hash": -3166609854125665300,
"line_mean": 33.4647887324,
"line_max": 81,
"alpha_frac": 0.5876583572,
"autogenerated": false,
"ratio": 3.799689... |
from EXOSIMS.Prototypes.SurveySimulation import SurveySimulation
import numpy as np
class cbytScheduler(SurveySimulation):
"""cbytScheduler - Completeness-by-time Scheduler
This class implements a Scheduler that selects the current highest
Completeness/Integration Time.
Args:
\*\*specs:... | {
"repo_name": "dsavransky/EXOSIMS",
"path": "EXOSIMS/SurveySimulation/cbytScheduler.py",
"copies": "1",
"size": "1978",
"license": "bsd-3-clause",
"hash": 7167556682025345000,
"line_mean": 32.5254237288,
"line_max": 79,
"alpha_frac": 0.5940343782,
"autogenerated": false,
"ratio": 4.53669724770642... |
from EXOSIMS.Prototypes.SurveySimulation import SurveySimulation
import os
import astropy.units as u
import numpy as np
import time
import sys
# Python 3 compatibility:
if sys.version_info[0] > 2:
xrange = range
class SS_det_only(SurveySimulation):
"""
SS_det_only is a variant of survey sched... | {
"repo_name": "dsavransky/EXOSIMS",
"path": "EXOSIMS/SurveySimulation/SS_det_only.py",
"copies": "1",
"size": "23601",
"license": "bsd-3-clause",
"hash": -7035106799220514000,
"line_mean": 39.920071048,
"line_max": 105,
"alpha_frac": 0.5250624974,
"autogenerated": false,
"ratio": 3.90034705007436... |
from EXOSIMS.SimulatedUniverse.KnownRVPlanetsUniverse import KnownRVPlanetsUniverse
import numpy as np
import astropy.units as u
import astropy.constants as const
from astropy.time import Time
class KnownRVPlanetsUniverseDeterministic(KnownRVPlanetsUniverse):
"""
Deterministic simulated universe implementation... | {
"repo_name": "dsavransky/EXOSIMS",
"path": "tests/TestModules/SimulatedUniverse/KnownRVPlanetsUniverseDeterministic.py",
"copies": "1",
"size": "8931",
"license": "bsd-3-clause",
"hash": -8371418241463563000,
"line_mean": 47.0161290323,
"line_max": 99,
"alpha_frac": 0.5979173665,
"autogenerated": ... |
from EXOSIMS.SurveySimulation.linearJScheduler import linearJScheduler
import astropy.units as u
import numpy as np
import time
import sys
import astropy.constants as const
import os.path, copy, re
class linearJScheduler_det_only(linearJScheduler):
"""linearJScheduler_det_only - linearJScheduler Detections Only
... | {
"repo_name": "dsavransky/EXOSIMS",
"path": "EXOSIMS/SurveySimulation/linearJScheduler_det_only.py",
"copies": "1",
"size": "21560",
"license": "bsd-3-clause",
"hash": 5782193846478804000,
"line_mean": 47.6681715576,
"line_max": 254,
"alpha_frac": 0.5893320965,
"autogenerated": false,
"ratio": 3.... |
from EXOSIMS.SurveySimulation.linearJScheduler import linearJScheduler
import astropy.units as u
import numpy as np
class occulterJScheduler(linearJScheduler):
"""occulterJScheduler
This class inherits linearJScheduler and works best when paired with the
SotoStarshade Observatory class.
Ar... | {
"repo_name": "dsavransky/EXOSIMS",
"path": "EXOSIMS/SurveySimulation/occulterJScheduler.py",
"copies": "1",
"size": "5874",
"license": "bsd-3-clause",
"hash": -3701616861998337000,
"line_mean": 38.9659863946,
"line_max": 124,
"alpha_frac": 0.5255362615,
"autogenerated": false,
"ratio": 3.8367080... |
from EXOSIMS.SurveySimulation.SLSQPScheduler import SLSQPScheduler
import EXOSIMS, os
import astropy.units as u
import astropy.constants as const
import numpy as np
import itertools
from scipy import interpolate
try:
import cPickle as pickle
except:
import pickle
import time
from EXOSIMS.util.deltaMag import de... | {
"repo_name": "dsavransky/EXOSIMS",
"path": "EXOSIMS/SurveySimulation/tieredScheduler_SLSQP.py",
"copies": "1",
"size": "74095",
"license": "bsd-3-clause",
"hash": 2764807005301556000,
"line_mean": 49.99449415,
"line_max": 254,
"alpha_frac": 0.562467103,
"autogenerated": false,
"ratio": 3.5076216... |
from EXOSIMS.SurveySimulation.tieredScheduler import tieredScheduler
import EXOSIMS, os
import astropy.units as u
import astropy.constants as const
import numpy as np
import itertools
from scipy import interpolate
try:
import cPickle as pickle
except:
import pickle
import time
import copy
from EXOSIMS.util.delt... | {
"repo_name": "dsavransky/EXOSIMS",
"path": "EXOSIMS/SurveySimulation/tieredScheduler_DD.py",
"copies": "1",
"size": "33993",
"license": "bsd-3-clause",
"hash": -5088425673603275000,
"line_mean": 53.8274193548,
"line_max": 254,
"alpha_frac": 0.5477009973,
"autogenerated": false,
"ratio": 3.555381... |
from EXOSIMS.SurveySimulation.tieredScheduler_SLSQP import tieredScheduler_SLSQP
import EXOSIMS, os
import astropy.units as u
import astropy.constants as const
import numpy as np
import itertools
from scipy import interpolate
try:
import cPickle as pickle
except:
import pickle
import time
import copy
from EXOSI... | {
"repo_name": "dsavransky/EXOSIMS",
"path": "EXOSIMS/SurveySimulation/tieredScheduler_DD_SLSQP.py",
"copies": "1",
"size": "33369",
"license": "bsd-3-clause",
"hash": 1407316340802517800,
"line_mean": 53.6153846154,
"line_max": 254,
"alpha_frac": 0.5495220114,
"autogenerated": false,
"ratio": 3.5... |
from EXOSIMS.SurveySimulation.tieredScheduler_sotoSS import tieredScheduler_sotoSS
import EXOSIMS, os
import astropy.units as u
import astropy.constants as const
import numpy as np
import itertools
from scipy import interpolate
try:
import cPickle as pickle
except:
import pickle
import time
import copy
from EXO... | {
"repo_name": "dsavransky/EXOSIMS",
"path": "EXOSIMS/SurveySimulation/tieredScheduler_DD_sotoSS.py",
"copies": "1",
"size": "30202",
"license": "bsd-3-clause",
"hash": -1108674017851924700,
"line_mean": 54.0127504554,
"line_max": 254,
"alpha_frac": 0.5492682604,
"autogenerated": false,
"ratio": 3... |
from EXOSIMS.util.vprint import vprint
from EXOSIMS.util.get_dirs import get_cache_dir
import time
class SurveyEnsemble(object):
"""Survey Ensemble prototype
Args:
specs:
user specified values
Attributes:
cachedir (str):
Path to cache directory
... | {
"repo_name": "dsavransky/EXOSIMS",
"path": "EXOSIMS/Prototypes/SurveyEnsemble.py",
"copies": "1",
"size": "2843",
"license": "bsd-3-clause",
"hash": 8249428826867582000,
"line_mean": 32.8452380952,
"line_max": 122,
"alpha_frac": 0.5694688709,
"autogenerated": false,
"ratio": 4.268768768768769,
... |
from EXOSIMS.util.vprint import vprint
from EXOSIMS.util.get_module import get_module
from EXOSIMS.util.waypoint import waypoint
from EXOSIMS.util.CheckScript import CheckScript
import sys, logging, json, os.path
import tempfile
import random as py_random
import numpy as np
import astropy.units as u
import copy, re, in... | {
"repo_name": "dsavransky/EXOSIMS",
"path": "EXOSIMS/MissionSim.py",
"copies": "1",
"size": "20072",
"license": "bsd-3-clause",
"hash": -6903744369058487000,
"line_mean": 40.9916317992,
"line_max": 96,
"alpha_frac": 0.5805101634,
"autogenerated": false,
"ratio": 4.373937677053824,
"config_test"... |
from EXOSIMS.util.vprint import vprint
from EXOSIMS.util.get_dirs import get_cache_dir
import numpy as np
import astropy.units as u
from astropy.time import Time
import os
import csv
class TimeKeeping(object):
"""TimeKeeping class template.
This class keeps track of the current mission elapsed ... | {
"repo_name": "dsavransky/EXOSIMS",
"path": "EXOSIMS/Prototypes/TimeKeeping.py",
"copies": "1",
"size": "25355",
"license": "bsd-3-clause",
"hash": 3431231991751369700,
"line_mean": 57.2406542056,
"line_max": 246,
"alpha_frac": 0.6274502071,
"autogenerated": false,
"ratio": 4.035492599076874,
"... |
from EXOSIMS.util.vprint import vprint
from EXOSIMS.util.get_dirs import get_cache_dir
import numpy as np
import astropy.units as u
import astropy.constants as const
from scipy.interpolate import PchipInterpolator
class PlanetPhysicalModel(object):
"""Planet Physical Model class template
This ... | {
"repo_name": "dsavransky/EXOSIMS",
"path": "EXOSIMS/Prototypes/PlanetPhysicalModel.py",
"copies": "1",
"size": "6943",
"license": "bsd-3-clause",
"hash": -8462626192077723000,
"line_mean": 34.7354497354,
"line_max": 113,
"alpha_frac": 0.5885064093,
"autogenerated": false,
"ratio": 4.377679697351... |
from EXOSIMS.util.vprint import vprint
from EXOSIMS.util.get_module import get_module
from EXOSIMS.util.get_dirs import get_cache_dir
import astropy.units as u
import numpy as np
import copy
import numbers
class PlanetPopulation(object):
"""Planet Population Description class template
This clas... | {
"repo_name": "dsavransky/EXOSIMS",
"path": "EXOSIMS/Prototypes/PlanetPopulation.py",
"copies": "1",
"size": "16299",
"license": "bsd-3-clause",
"hash": 6203989348660801000,
"line_mean": 36.4410377358,
"line_max": 112,
"alpha_frac": 0.5495429167,
"autogenerated": false,
"ratio": 4.038404360753221... |
from EXOSIMS.util.vprint import vprint
from EXOSIMS.util.keplerSTM import planSys
from EXOSIMS.util.get_module import get_module
from EXOSIMS.util.eccanom import eccanom
from EXOSIMS.util.deltaMag import deltaMag
from EXOSIMS.util.get_dirs import get_cache_dir
import numpy as np
import astropy.units as u
import... | {
"repo_name": "dsavransky/EXOSIMS",
"path": "EXOSIMS/Prototypes/SimulatedUniverse.py",
"copies": "1",
"size": "28723",
"license": "bsd-3-clause",
"hash": -7620810970311959000,
"line_mean": 43.3044164038,
"line_max": 124,
"alpha_frac": 0.5591686105,
"autogenerated": false,
"ratio": 3.5627635822376... |
from exotel import Exotel
from flask import (
Flask,
flash,
redirect,
render_template,
request,
url_for,
)
import os
import sys
import requests
app = Flask(__name__)
app.config['DEBUG'] = True
app.config['SECRET_KEY'] = '6d4c14c8e3d89221cb470b0b2f03e044'
app.config['STORMPATH_API_KEY_FILE'] =... | {
"repo_name": "manojpandey/hackinout",
"path": "main.py",
"copies": "1",
"size": "3123",
"license": "mit",
"hash": 2867155489779486000,
"line_mean": 27.1351351351,
"line_max": 116,
"alpha_frac": 0.6359269933,
"autogenerated": false,
"ratio": 2.9268978444236176,
"config_test": false,
"has_no_k... |
from expand.exceptions import ImproperExpandException
def split_expands(expand):
"""
Convert ['a', 'a.b', 'a.d', 'c']
into first_level_expands - ['a', 'c'] and
next_level_expands {'a': ['b', 'd']}
"""
first_level_expands = []
next_level_expands = {}
if not isinstance(expan... | {
"repo_name": "pombredanne/DRFInlineExpansion",
"path": "expand/utils.py",
"copies": "2",
"size": "1862",
"license": "mit",
"hash": 3655485732587952600,
"line_mean": 34.8076923077,
"line_max": 83,
"alpha_frac": 0.6310418904,
"autogenerated": false,
"ratio": 3.7389558232931726,
"config_test": fa... |
from expand_syn import getSynonyms
from pubbrain_app.models import *
def compareNames(ontName, pklDict):
# compares an ont region with all the pkl sets in the pklDict. returns a list of relative pkl paths of matching atlas regions
ontName = filter(lambda x: str.isalnum(x) or str.isspace(x), ontName)
ontReg... | {
"repo_name": "jbwexler/PubBrain",
"path": "scripts/update_or_add_region.py",
"copies": "1",
"size": "2243",
"license": "mit",
"hash": 7291241844137001000,
"line_mean": 30.1666666667,
"line_max": 129,
"alpha_frac": 0.6161390994,
"autogenerated": false,
"ratio": 3.3678678678678677,
"config_test"... |
from expanduino.classes.meta import MetaSubdevice
from expanduino.classes.leds import LedsSubdevice
from expanduino.classes.lcd import LcdSubdevice
from expanduino.classes.linuxinput import LinuxInputSubdevice
from expanduino.classes.serial import SerialSubdevice
from expanduino.subdevice import Subdevice
from expandui... | {
"repo_name": "Expanduino/Expanduino-Python",
"path": "expanduino/expanduino.py",
"copies": "1",
"size": "2432",
"license": "unlicense",
"hash": 6324741768145404000,
"line_mean": 26.6363636364,
"line_max": 99,
"alpha_frac": 0.6986019737,
"autogenerated": false,
"ratio": 3.657142857142857,
"conf... |
from expanduino.expanduino import Expanduino
from expanduino.classes.meta import MetaSubdevice
from smbus2 import SMBus, i2c_msg, I2cFunc
import os
import time
from retry import retry
import asyncio
import threading
from time import sleep
#import RPi.GPIO as GPIO
class ExpanduinoI2C(Expanduino):
def __init__(self, b... | {
"repo_name": "Expanduino/Expanduino-Python",
"path": "expanduino/transport/i2c.py",
"copies": "1",
"size": "3171",
"license": "unlicense",
"hash": 8863434956024005000,
"line_mean": 31.0303030303,
"line_max": 100,
"alpha_frac": 0.6177861873,
"autogenerated": false,
"ratio": 3.2724458204334366,
... |
from ExpanseParseRawIncident import parse_raw
import json
def test_parse_raw():
readable_output, parsed, raw = parse_raw(json.dumps(MOCK_RAW_JSON))
raw_json = MOCK_RAW_JSON
assert parsed['expanse_raw_json_event']['eventType'] == raw_json['eventType']
MOCK_RAW_JSON = {
"eventType": "ON_PREM_EXPOSURE... | {
"repo_name": "demisto/content",
"path": "Packs/Expanse/Scripts/ExpanseParseRawIncident/ExpanseParseRawIncident_test.py",
"copies": "1",
"size": "1595",
"license": "mit",
"hash": 1761167099393530600,
"line_mean": 32.9361702128,
"line_max": 81,
"alpha_frac": 0.5592476489,
"autogenerated": false,
"... |
from expansion_print import ExpansionPrint
class Card(object):
"""
A Magic the Gathering Card
"""
def __init__(self, id, name, mana_cost, converted_mana_cost, types, texts, flavors, power, toughness, watermark, set, rarity, all_sets, number, artist, rating, votes):
"""
Creates a new Car... | {
"repo_name": "RealTimeWeb/MagicTheGatheringService",
"path": "python/magicthegatheringservice/card.py",
"copies": "1",
"size": "3693",
"license": "mit",
"hash": 8127896430054500000,
"line_mean": 39.152173913,
"line_max": 206,
"alpha_frac": 0.56024912,
"autogenerated": false,
"ratio": 4.076158940... |
from exp_description import *
import sqlite3
import os
def init_db():
global conn
c = conn.cursor()
c.execute("SELECT name FROM sqlite_master WHERE type='table' AND name='measurements'")
if c.fetchone()==None:
# Create table
c.execute('''CREATE TABLE "measurements" (
"runID" T... | {
"repo_name": "adittrich/excovery",
"path": "master/export.py",
"copies": "1",
"size": "4176",
"license": "mit",
"hash": -4010967054987511000,
"line_mean": 33.5123966942,
"line_max": 118,
"alpha_frac": 0.567289272,
"autogenerated": false,
"ratio": 3.7757685352622063,
"config_test": false,
"ha... |
from expDomain import *
from general_function import *
from Queue import Queue
from spider_class import *
import threading
PROJECT_NAME = 'VAC'
HOMEPAGE = 'http://www.veterans.gc.ca/eng'
DOMAIN_NAME = getDomainName(HOMEPAGE)
QUEUED_FILE = PROJECT_NAME + '/queue.txt'
CRAWLED_FILE = PROJECT_NAME + '/crawled.txt'
NUMBER... | {
"repo_name": "benevolentprof/fb-notification-mail",
"path": "execute_program.py",
"copies": "1",
"size": "1286",
"license": "mit",
"hash": 1566144599439103500,
"line_mean": 25.7916666667,
"line_max": 79,
"alpha_frac": 0.6811819596,
"autogenerated": false,
"ratio": 3.289002557544757,
"config_te... |
from expecter import expect
from pipeye.utils.urls import url, url_lazy
from pipeye.utils.testing import ViewTestCase
from pipeye.packages.tests.factories import PackageFactory
from .factories import WatchFactory
from ..models import Watch
class WatchesListViewTest(ViewTestCase):
url = url_lazy('watches_list')
... | {
"repo_name": "oinopion/pipeye",
"path": "pipeye/watches/tests/test_views.py",
"copies": "1",
"size": "2014",
"license": "bsd-2-clause",
"hash": -8936239819167046000,
"line_mean": 27.7714285714,
"line_max": 66,
"alpha_frac": 0.6469712016,
"autogenerated": false,
"ratio": 3.8656429942418424,
"co... |
from expectorant import *
@describe('expectorant') # what is being specified in this file?
def _(): # this line is a bit ugly but not too bad.
scope = None
@before # The setup ... | {
"repo_name": "winstonwolff/expectorant",
"path": "examples/simple_spec.py",
"copies": "1",
"size": "1195",
"license": "mit",
"hash": 9056894952629220000,
"line_mean": 50.9565217391,
"line_max": 110,
"alpha_frac": 0.4845188285,
"autogenerated": false,
"ratio": 4.526515151515151,
"config_test": ... |
from expects import expect, be_an, equal
from linkstore import factory
with description('Handles'):
with it('can be computed for any url'):
handles = factory.create_handles()
an_url = 'an url'
handle = handles.compute_for(an_url)
expect(handle).to(be_an(int))
with it('does ... | {
"repo_name": "angelsanz/linkstore",
"path": "spec/integration/handles_spec.py",
"copies": "1",
"size": "1157",
"license": "mit",
"hash": -5923184047999783000,
"line_mean": 27.2195121951,
"line_max": 72,
"alpha_frac": 0.6197061366,
"autogenerated": false,
"ratio": 3.720257234726688,
"config_tes... |
from expects import expect, be, have_key
from pysellus.stock_integrations import slack, integration_classes
with description('the slack integration module'):
with it('should be in the integration classes dictionary'):
expect(integration_classes).to(have_key('slack'))
expect(integration_classes['... | {
"repo_name": "cgvarela/pysellus",
"path": "spec/slack_spec.py",
"copies": "1",
"size": "2887",
"license": "mit",
"hash": 1184158915671272200,
"line_mean": 34.6419753086,
"line_max": 100,
"alpha_frac": 0.59577416,
"autogenerated": false,
"ratio": 4.190130624092888,
"config_test": true,
"has_n... |
from expects import expect, be, have_key
from pysellus.stock_integrations import slack, stock_integration_classes
with description('the slack integration module'):
with it('should be in the integration classes dictionary'):
expect(stock_integration_classes).to(have_key('slack'))
expect(stock_int... | {
"repo_name": "Pysellus/pysellus",
"path": "spec/slack_spec.py",
"copies": "3",
"size": "2905",
"license": "mit",
"hash": -1391175351685206800,
"line_mean": 34.8641975309,
"line_max": 100,
"alpha_frac": 0.5972461274,
"autogenerated": false,
"ratio": 4.179856115107913,
"config_test": true,
"ha... |
from expects import expect, contain
from linkstore import factory
from ..fixtures import some_links_with_at_lesat_the_tags
with description('changing tags'):
with before.each:
self.an_url = 'an_url'
self.a_tag_to_change = 'a tag to change'
self.some_tags = (self.a_tag_to_change, 'another... | {
"repo_name": "angelsanz/linkstore",
"path": "spec/unit/changing_tags_spec.py",
"copies": "1",
"size": "2484",
"license": "mit",
"hash": -7036706642448412000,
"line_mean": 37.8125,
"line_max": 111,
"alpha_frac": 0.615136876,
"autogenerated": false,
"ratio": 3.347708894878706,
"config_test": fal... |
from expects import expect, contain_only, equal
from mamba import description, it, before
from typing import Iterable
from unittest.mock import MagicMock
from crowd_anki.anki.adapters.anki_deck import AnkiDeck
from crowd_anki.anki.adapters.deck_manager import AnkiStaticDeckManager
dynamic_deck = AnkiDeck({'dyn': True... | {
"repo_name": "Stvad/CrowdAnki",
"path": "test/anki/adapters/deck_manager_spec.py",
"copies": "1",
"size": "2584",
"license": "mit",
"hash": -1037428674831742600,
"line_mean": 38.1515151515,
"line_max": 93,
"alpha_frac": 0.6965944272,
"autogenerated": false,
"ratio": 3.234042553191489,
"config_... |
from expects import expect, equal, have_length
from linkstore import factory
from ..fixtures import some_links_with_tags, some_links
with description('retrieving links'):
with before.each:
self.links_service = factory.create_links_service()
with context('by one tag'):
with it('returns links... | {
"repo_name": "angelsanz/linkstore",
"path": "spec/unit/retrieving_links_spec.py",
"copies": "1",
"size": "1889",
"license": "mit",
"hash": -5927930575244780000,
"line_mean": 40.9777777778,
"line_max": 115,
"alpha_frac": 0.622022234,
"autogenerated": false,
"ratio": 3.696673189823875,
"config_t... |
from expects import expect, equal
from doublex import Spy, Stub, Mock
from doublex_expects import have_been_called_with, have_been_satisfied
from mamba.example_collector import ExampleCollector
from mamba_xrays.xrays import MambaXrays
from mamba_xrays.xrays import CollectorOfTransformedAstOfSpecFiles
from mamba_xrays... | {
"repo_name": "angelsanz/mamba_xrays",
"path": "spec/xrays_spec.py",
"copies": "1",
"size": "4081",
"license": "mit",
"hash": -5406221675012938000,
"line_mean": 46.4534883721,
"line_max": 128,
"alpha_frac": 0.7140406763,
"autogenerated": false,
"ratio": 3.611504424778761,
"config_test": false,
... |
from expects import expect
from doublex import Spy
from spec.object_mother import *
from mamba import reporter, formatters, example_group
with description(reporter.Reporter) :
with before.each:
self.example = an_example()
self.formatter = Spy(formatters.Formatter)
self.reporter = report... | {
"repo_name": "jaimegildesagredo/expects_docs_mamba_formatter",
"path": "spec/reporter_spec.py",
"copies": "1",
"size": "3538",
"license": "mit",
"hash": -5034703592958069000,
"line_mean": 36.2421052632,
"line_max": 107,
"alpha_frac": 0.6667608819,
"autogenerated": false,
"ratio": 4.0996523754345... |
from expects import *
from doublex_expects import have_been_called_with
from doublex import Spy
from spec.object_mother import *
from mamba import reporter, formatters, example_group
with description(reporter.Reporter):
with before.each:
self.example = an_example()
self.formatter = Spy(formatte... | {
"repo_name": "markng/mamba",
"path": "spec/reporter_spec.py",
"copies": "5",
"size": "3544",
"license": "mit",
"hash": -1061323002387321500,
"line_mean": 35.9166666667,
"line_max": 103,
"alpha_frac": 0.664785553,
"autogenerated": false,
"ratio": 4.149882903981265,
"config_test": false,
"has_... |
from expects import *
from doublex import *
from mamba import reporter
from spec.object_mother import *
with description('Errors in hooks'):
with before.each:
self.reporter = Spy(reporter.Reporter)
self.example_group = an_example_group()
with context('when an error was raised in a before.all... | {
"repo_name": "markng/mamba",
"path": "spec/errors_in_hooks_spec.py",
"copies": "5",
"size": "4541",
"license": "mit",
"hash": 2017904109456100000,
"line_mean": 36.5289256198,
"line_max": 101,
"alpha_frac": 0.6082360713,
"autogenerated": false,
"ratio": 4.333015267175573,
"config_test": false,
... |
from expects import *
from spec.helper import *
from leadreader.composition import Composition
with description('Composition'):
with before.each:
setup(self)
with context('a valid leadsheet file'):
with before.each:
self.composition = Composition('spec/fixtures/test-1-in-c-major.xm... | {
"repo_name": "raindrift/leadreader",
"path": "spec/composition_spec.py",
"copies": "1",
"size": "2949",
"license": "mit",
"hash": -3241312908033831400,
"line_mean": 45.078125,
"line_max": 105,
"alpha_frac": 0.6191929468,
"autogenerated": false,
"ratio": 4.434586466165413,
"config_test": false,... |
from expects import *
from unittest.mock import MagicMock
from unittest.mock import patch
import requests
from requests import Response
from lib.sample_class import *
with describe('SampleClass'):
# before.each のブロック内は、同じ階層以下のテスト実行前に毎回実行されます
with before.each:
self.target = SampleClass(10)
with d... | {
"repo_name": "iwanaga/python-unit-test",
"path": "spec/sample_class.spec.py",
"copies": "1",
"size": "2946",
"license": "mit",
"hash": 8907887110058327000,
"line_mean": 35.3636363636,
"line_max": 88,
"alpha_frac": 0.5704166667,
"autogenerated": false,
"ratio": 2.6548672566371683,
"config_test"... |
from expects import *
class Roman(object):
def translate(self, number):
if number <= 5:
roman_number = (5-number) * "I" + "V"
if number < 4:
roman_number = number * "I"
dictionary = {
6: "VI",
7: "VII",
9: "IX",
10: "X"... | {
"repo_name": "alejandrodob/dojo",
"path": "katas/roman-numerals/python-15-09/spec/roman_spec.py",
"copies": "1",
"size": "1391",
"license": "mit",
"hash": -501685773751904500,
"line_mean": 26.2745098039,
"line_max": 57,
"alpha_frac": 0.5132997843,
"autogenerated": false,
"ratio": 3.7392473118279... |
from expects.testing import failure
from enerdata.metering.meter import *
from enerdata.metering.measure import *
from datetime import date
def generate_random_date():
from random import randint
from calendar import monthrange
year = randint(2000, 2014)
month = randint(1, 12)
last_day = monthrang... | {
"repo_name": "gisce/enerdata",
"path": "spec/metering/meter_spec.py",
"copies": "2",
"size": "3487",
"license": "mit",
"hash": -1036387614279291400,
"line_mean": 41.5243902439,
"line_max": 81,
"alpha_frac": 0.5830226556,
"autogenerated": false,
"ratio": 3.605997931747673,
"config_test": false,... |
from expects.testing import failure
from expects import *
from enerdata.contracts.tariff import *
from datetime import datetime
with description('Create a period'):
with it('accepts "te"'):
TariffPeriod('P1', 'te')
with it('accepts "tp"'):
TariffPeriod('P1', 'tp')
with it('fails when is not... | {
"repo_name": "Som-Energia/enerdata",
"path": "spec/contracts/tariff_spec.py",
"copies": "1",
"size": "6518",
"license": "mit",
"hash": -7965310187291273000,
"line_mean": 48.7557251908,
"line_max": 150,
"alpha_frac": 0.5684258975,
"autogenerated": false,
"ratio": 3.2315319781854237,
"config_tes... |
from expects.testing import failure
from expects import *
from enerdata.contracts.tariff import *
from datetime import datetime, timedelta
from enerdata.datetime.timezone import TIMEZONE
from mamba import before, context, description, it
with description('Create a period'):
with it('accepts "te"'):
Tariff... | {
"repo_name": "gisce/enerdata",
"path": "spec/contracts/tariff_spec.py",
"copies": "1",
"size": "225740",
"license": "mit",
"hash": -3155459996412596000,
"line_mean": 75.6779891304,
"line_max": 150,
"alpha_frac": 0.6150039869,
"autogenerated": false,
"ratio": 3.130364844064177,
"config_test": f... |
from expects.testing import failure
from expects import *
from datetime import datetime, timedelta
from dateutil import relativedelta
import calendar
import zipfile
from io import BytesIO
import json
import os
from esios import Esios
from esios.archives import Liquicomun, A1_liquicomun, A2_liquicomun, C2_liquicomun
f... | {
"repo_name": "gisce/esios",
"path": "spec/archives_spec.py",
"copies": "1",
"size": "12358",
"license": "mit",
"hash": 8870954520020643000,
"line_mean": 39.9205298013,
"line_max": 149,
"alpha_frac": 0.6149053245,
"autogenerated": false,
"ratio": 3.6475796930342383,
"config_test": true,
"has_... |
from expects.testing import failure
from enerdata.contracts.contract import *
with description('Creating a contract'):
with it('should be in draft state'):
c = Contract()
assert c.state == 'draft'
with it('should have a list for modifications empty'):
c = Contract()
assert le... | {
"repo_name": "Som-Energia/enerdata",
"path": "spec/contracts/contract_spec.py",
"copies": "2",
"size": "8407",
"license": "mit",
"hash": -2804125827170558500,
"line_mean": 36.53125,
"line_max": 103,
"alpha_frac": 0.5349113834,
"autogenerated": false,
"ratio": 3.70679012345679,
"config_test": f... |
from expect.util import falsey_object
class ShouldReceiveExpectation(object):
def __init__(self, stub, call_args):
self._stub = stub
self._call_args = call_args
def verify(self):
for args in self._stub.was_called_with:
if self._call_args.matches_args(args):
... | {
"repo_name": "sumeet/expect",
"path": "expect/core/expectation.py",
"copies": "1",
"size": "1743",
"license": "mit",
"hash": 8099183012346412000,
"line_mean": 32.5192307692,
"line_max": 80,
"alpha_frac": 0.5806081469,
"autogenerated": false,
"ratio": 3.9794520547945207,
"config_test": false,
... |
from expedient.clearinghouse.aggregate.models import Aggregate
from expedient.clearinghouse.monitoring.AggregateMonitoringThread import AggregateMonitoringThread
from expedient.clearinghouse.monitoring.SessionMonitoringThread import SessionMonitoringThread
from expedient.clearinghouse.settings import MONITORING_INTERVA... | {
"repo_name": "dana-i2cat/felix",
"path": "expedient/src/python/expedient/clearinghouse/monitoring/BackgroundMonitor.py",
"copies": "2",
"size": "2830",
"license": "apache-2.0",
"hash": 3817148849527991300,
"line_mean": 36.7333333333,
"line_max": 98,
"alpha_frac": 0.5858657244,
"autogenerated": fal... |
from expedient.clearinghouse.aggregate.models import *
import uuid
from expedient.clearinghouse.monitoring.AggregateMonitoringThread import AggregateMonitoringThread
from expedient.clearinghouse.monitoring.SessionMonitoringThread import SessionMonitoringThread
import time
import threading
from expedient.clearinghouse.s... | {
"repo_name": "avlach/univbris-ocf",
"path": "expedient/src/python/expedient/clearinghouse/monitoring/BackgroundMonitor.py",
"copies": "2",
"size": "1526",
"license": "bsd-3-clause",
"hash": 4317193192317442000,
"line_mean": 28.9215686275,
"line_max": 98,
"alpha_frac": 0.6815203145,
"autogenerated"... |
from expedient.common.tests.manager import SettingsTestCase
from openflow.optin_manager.flowspace.models import FlowSpace
from openflow.optin_manager.flowspace.helper import single_fs_intersect,\
multi_fs_intersect, singlefs_is_subset_of, multifs_is_subset_of
from openflow.optin_manager.opts.models import OptsFlowSpace... | {
"repo_name": "ict-felix/stack",
"path": "optin_manager/src/python/openflow/optin_manager/flowspace/tests.py",
"copies": "2",
"size": "6557",
"license": "apache-2.0",
"hash": 7190256417802153000,
"line_mean": 48.6742424242,
"line_max": 81,
"alpha_frac": 0.5642824462,
"autogenerated": false,
"rati... |
from expedition import Expedition
from fleet import Fleet
from quests import Quests
from config import Config
from fight_runner import FightRunner
from expedition_runner import ExpeditionRunner
from return_fleet_checker import ReturnFleetChecker
from resupply_runner import ResupplyRunner
from fight_checker import Figh... | {
"repo_name": "tantinevincent/Onegai-ooyodosan",
"path": "main.sikuli/main.py",
"copies": "1",
"size": "5098",
"license": "mit",
"hash": 8068870519702450000,
"line_mean": 32.761589404,
"line_max": 140,
"alpha_frac": 0.7087092978,
"autogenerated": false,
"ratio": 3.365016501650165,
"config_test"... |
from expenses.models import Expense, ExpenseType, ExpensesGroup, Bill
from expenses.templatetags.moneyformats import money
from django.contrib.admin.views.main import ChangeList
from django.contrib import admin
from django.contrib.admin.util import unquote
from django.http import HttpResponse
from django.utils.translat... | {
"repo_name": "samluescher/django-expenses",
"path": "expenses/admin.py",
"copies": "1",
"size": "5604",
"license": "bsd-3-clause",
"hash": -8874753932232365000,
"line_mean": 39.0285714286,
"line_max": 123,
"alpha_frac": 0.6450749465,
"autogenerated": false,
"ratio": 3.814840027229408,
"config_... |
# from expenses.models import *
from expenses.serializers import *
from rest_framework import generics
from rest_framework import viewsets
from rest_framework.permissions import IsAdminUser, IsAuthenticated
from rest_framework.authentication import TokenAuthentication, BasicAuthentication, SessionAuthentication
from dj... | {
"repo_name": "eladelad/new-money",
"path": "expenses/views/category.py",
"copies": "1",
"size": "1252",
"license": "apache-2.0",
"hash": 600481847662342000,
"line_mean": 43.75,
"line_max": 138,
"alpha_frac": 0.7691693291,
"autogenerated": false,
"ratio": 4.362369337979094,
"config_test": false... |
from expenses.models import *
from expenses.serializers import *
from rest_framework import generics
from rest_framework import viewsets
from rest_framework.permissions import IsAdminUser, IsAuthenticated
from rest_framework.authentication import TokenAuthentication, BasicAuthentication, SessionAuthentication
import lo... | {
"repo_name": "eladelad/new-money",
"path": "expenses/views/transaction.py",
"copies": "1",
"size": "2700",
"license": "apache-2.0",
"hash": -2368165846326999000,
"line_mean": 44.0166666667,
"line_max": 105,
"alpha_frac": 0.6374074074,
"autogenerated": false,
"ratio": 4.368932038834951,
"config... |
from expenses.models import *
from rest_framework import serializers
class CategorySerializer(serializers.ModelSerializer):
icon_class = serializers.ReadOnlyField(source='icon_class.icon')
class Meta:
model = Category
fields = ('id', 'name', 'icon_class', 'user')
read_only_fields = ('u... | {
"repo_name": "eladelad/new-money",
"path": "expenses/serializers.py",
"copies": "1",
"size": "1729",
"license": "apache-2.0",
"hash": -1886244272604319500,
"line_mean": 29.8928571429,
"line_max": 116,
"alpha_frac": 0.6570271833,
"autogenerated": false,
"ratio": 4.097156398104265,
"config_test"... |
from expenses.random_id import random_id
from expenses.templatetags.moneyformats import money
from time_tracking.middleware import CurrentUserMiddleware
from django.db import models
from django.utils.formats import get_format
from django.utils.translation import ugettext_lazy as _
from django.template.defaultfilters im... | {
"repo_name": "samluescher/django-expenses",
"path": "expenses/models.py",
"copies": "1",
"size": "6561",
"license": "bsd-3-clause",
"hash": -7610753611789171000,
"line_mean": 38.0595238095,
"line_max": 213,
"alpha_frac": 0.6015851242,
"autogenerated": false,
"ratio": 3.873081463990555,
"config... |
from experiences.factories import create_experience_repo, create_experience_permissions_validator
from .repositories import SceneRepo
from .interactors import GetScenesFromExperienceInteractor, CreateNewSceneInteractor, ModifySceneInteractor, \
UploadScenePictureInteractor
from .validators import SceneValidator... | {
"repo_name": "jordifierro/abidria-api",
"path": "scenes/factories.py",
"copies": "1",
"size": "2265",
"license": "mit",
"hash": 5712392837532123000,
"line_mean": 42.5576923077,
"line_max": 112,
"alpha_frac": 0.73598234,
"autogenerated": false,
"ratio": 4.081081081081081,
"config_test": false,
... |
from experimental.vertex_edge import Vertex, EDGE
import unittest
class EdgeVertexTestCase(unittest.TestCase):
def test_vertex(self):
c = (100, 100) # center
tl = (0, 0) # top_left
bl = (50, 150) # bottom_left
br = (150, 150) # bottom_right
tr = (150, 50) # top_right
... | {
"repo_name": "suhelhammoud/omr",
"path": "src/experimental/test_edge_vertex.py",
"copies": "1",
"size": "1950",
"license": "apache-2.0",
"hash": -7457435907409219000,
"line_mean": 40.4893617021,
"line_max": 86,
"alpha_frac": 0.5856410256,
"autogenerated": false,
"ratio": 2.742616033755274,
"co... |
from experiment.api import dispatcher
import json
import logging
from nose.tools import assert_not_equal, assert_equal
logging.basicConfig()
class TestIntegration(object):
EXPERIMENT_NAME = 'somename'
DRAFT_WITH_ONE_VARIANT = json.dumps(dict(
name=EXPERIMENT_NAME,
variants = [... | {
"repo_name": "barakschiller/experiment",
"path": "tests/integration/test_integration.py",
"copies": "1",
"size": "1255",
"license": "bsd-3-clause",
"hash": -3061239530930086400,
"line_mean": 33.8888888889,
"line_max": 101,
"alpha_frac": 0.6589641434,
"autogenerated": false,
"ratio": 3.6271676300... |
from ExperimentBase import *
class ExperimentSingle(ExperimentBase): #one set to be divided
def __init__(self, name, histogramType, dataset):
ExperimentBase.__init__(self, name, histogramType)
self.dataset = dataset
self.sim = None
def run(self, maxk):
self.sim... | {
"repo_name": "maeotaku/leaf_recognition_sdk",
"path": "src/Experiments/ExperimentSingle.py",
"copies": "1",
"size": "2440",
"license": "mit",
"hash": -1556570775204820200,
"line_mean": 45.9230769231,
"line_max": 131,
"alpha_frac": 0.6045081967,
"autogenerated": false,
"ratio": 3.824451410658307,... |
from experiment_construction.evaluator_construction.evaluation import Evaluation
import numpy as np
class Evaluator:
gold_reader = None
logger = None
method = None
def __init__(self, gold_reader, cutoff, logger, method="macro"):
self.gold_reader = gold_reader
self.logger = logger
... | {
"repo_name": "MichSchli/QuestionAnsweringGCN",
"path": "old_version/experiment_construction/evaluator_construction/evaluator.py",
"copies": "1",
"size": "3041",
"license": "mit",
"hash": -2671664347031805000,
"line_mean": 38.5064935065,
"line_max": 149,
"alpha_frac": 0.6349884906,
"autogenerated":... |
from experiment_construction.example_processor_construction.abstract_example_processor import AbstractExampleProcessor
import numpy as np
class GoldByF1FilterExampleProcessor(AbstractExampleProcessor):
def process_example(self, example, mode="train"):
if mode != "train":
return True
t... | {
"repo_name": "MichSchli/QuestionAnsweringGCN",
"path": "old_version/experiment_construction/example_processor_construction/gold_by_f1_filter_example_processor.py",
"copies": "1",
"size": "1903",
"license": "mit",
"hash": 4815725382684545000,
"line_mean": 35.6153846154,
"line_max": 118,
"alpha_frac":... |
from experiment_construction.example_processor_construction.abstract_example_processor import AbstractExampleProcessor
import numpy as np
class AddWordVertexGraphExtender(AbstractExampleProcessor):
"""
Adds vertices corresponding to words to the graph, and adds edges to either mentions or dummy span vertices... | {
"repo_name": "MichSchli/QuestionAnsweringGCN",
"path": "old_version/experiment_construction/example_processor_construction/graph_extenders/add_word_vertex_graph_extender.py",
"copies": "1",
"size": "2357",
"license": "mit",
"hash": 656509092122004200,
"line_mean": 43.4905660377,
"line_max": 177,
"al... |
from experiment_construction.example_processor_construction.gold_by_f1_filter_example_processor import \
GoldByF1FilterExampleProcessor
from experiment_construction.example_processor_construction.gold_to_index_example_processor import \
GoldToIndexExampleProcessor
from experiment_construction.example_processor_... | {
"repo_name": "MichSchli/QuestionAnsweringGCN",
"path": "old_version/experiment_construction/example_processor_construction/example_processor_factory.py",
"copies": "1",
"size": "3145",
"license": "mit",
"hash": -4573879608023999500,
"line_mean": 40.9333333333,
"line_max": 115,
"alpha_frac": 0.721144... |
from experiment_construction.experiment_runner_construction.experiment_runner import ExperimentRunner
class ExperimentRunnerFactory:
def __init__(self, evaluator_factory, learner_factory):
self.evaluator_factory = evaluator_factory
self.learner_factory = learner_factory
def construct_experim... | {
"repo_name": "MichSchli/QuestionAnsweringGCN",
"path": "old_version/experiment_construction/experiment_runner_construction/experiment_runner_factory.py",
"copies": "1",
"size": "1436",
"license": "mit",
"hash": 562072469957592100,
"line_mean": 50.3214285714,
"line_max": 113,
"alpha_frac": 0.73189415... |
from experiment_construction.index_construction.indexes.lazy_indexer import LazyIndexer
import numpy as np
class FreebaseRelationPartIndexer:
inner_indexer = None
def __init__(self, vocabulary_shape, cutoff_count):
self.inner_indexer = LazyIndexer(vocabulary_shape)
self.load_file(cutoff_count... | {
"repo_name": "MichSchli/QuestionAnsweringGCN",
"path": "old_version/experiment_construction/index_construction/indexes/freebase_relation_part_indexer.py",
"copies": "1",
"size": "1410",
"license": "mit",
"hash": 1528698656849890800,
"line_mean": 31.7906976744,
"line_max": 87,
"alpha_frac": 0.6262411... |
from experiment_construction.index_construction.indexes.lazy_indexer import LazyIndexer
class FreebaseRelationIndexer:
inner_indexer = None
def __init__(self, vocabulary_shape, cutoff_count):
self.inner_indexer = LazyIndexer(vocabulary_shape)
self.load_file(cutoff_count)
def load_file(s... | {
"repo_name": "MichSchli/QuestionAnsweringGCN",
"path": "old_version/experiment_construction/index_construction/indexes/freebase_relation_indexer.py",
"copies": "1",
"size": "1218",
"license": "mit",
"hash": -133747528831078780,
"line_mean": 29.45,
"line_max": 87,
"alpha_frac": 0.6346469622,
"autog... |
from experiment_construction.index_construction.index_holder import IndexHolder
from experiment_construction.index_construction.indexes.freebase_indexer import FreebaseIndexer
from experiment_construction.index_construction.indexes.freebase_relation_indexer import FreebaseRelationIndexer
from experiment_construction.in... | {
"repo_name": "MichSchli/QuestionAnsweringGCN",
"path": "old_version/experiment_construction/index_construction/index_holder_factory.py",
"copies": "1",
"size": "5431",
"license": "mit",
"hash": -1077822225866494100,
"line_mean": 48.8256880734,
"line_max": 125,
"alpha_frac": 0.6521819186,
"autogene... |
from experiment_construction.preprocessor_construction.preprocessor import Preprocessor
from input_models.hypergraph.hypergraph_preprocessor import HypergraphPreprocessor
from input_models.mask.mask_preprocessor import LookupMaskPreprocessor
from input_models.padded_map.sentence_to_graph_map_preprocessor import Sentenc... | {
"repo_name": "MichSchli/QuestionAnsweringGCN",
"path": "old_version/experiment_construction/preprocessor_construction/preprocessor_factory.py",
"copies": "1",
"size": "2761",
"license": "mit",
"hash": 8360524063737765000,
"line_mean": 59.0434782609,
"line_max": 136,
"alpha_frac": 0.6823614632,
"au... |
from experiment_handler.imu_data_reader import get_imu_data
from experiment_handler.finder import find_all_imu_files
import os
import matplotlib.pyplot as plt
def plot_imu_signals_for_experiment(exp_root, figsize=(10, 10), reference_time="video"):
imu_files = find_all_imu_files(exp_root)
for imu_file_path in... | {
"repo_name": "phev8/dataset_tools",
"path": "experiment_handler/check_signal_availabilities.py",
"copies": "1",
"size": "1790",
"license": "mit",
"hash": 6925414424276741000,
"line_mean": 34.1176470588,
"line_max": 117,
"alpha_frac": 0.5670391061,
"autogenerated": false,
"ratio": 3.0915371329879... |
from experiment import Experiment
from latex import latex_corpora, latex_performance
import math
###########################################################################
#
# Experiments
#
###########################################################################
experiment_windows_273_64_127 = Experiment(
# ... | {
"repo_name": "BitFunnel/sigir2017-bitfunnel",
"path": "scripts/everything.py",
"copies": "1",
"size": "5962",
"license": "mit",
"hash": 4886301412532234000,
"line_mean": 25.735426009,
"line_max": 75,
"alpha_frac": 0.6447500839,
"autogenerated": false,
"ratio": 3.312222222222222,
"config_test":... |
from experiment import experiment
from directed_graph import DirectedGraph
from directed_graph import topk
import sys
import psutil
import gc
#import matplotlib.pyplot as plt
import random
from datetime import datetime
import concurrent.futures
import time
import atexit
import dill
#from process_affinity_p... | {
"repo_name": "VenturaDelMonte/socialnetworks",
"path": "preferential_attachment.py",
"copies": "1",
"size": "4080",
"license": "mit",
"hash": -7110030992432388000,
"line_mean": 29.4,
"line_max": 134,
"alpha_frac": 0.6615196078,
"autogenerated": false,
"ratio": 2.8732394366197185,
"config_test"... |
from experiment import *
import argparse
import numpy as np
import os
def main():
parser = argparse.ArgumentParser()
parser.add_argument('--variable',type = str,default = 'p')
parser.add_argument('--pi1',type = float,default = 0.3)
parser.add_argument('--n_samples',type = int,default = 1000)
parser.add_argument('-... | {
"repo_name": "Jianbo-Lab/QuTE",
"path": "simulations/main.py",
"copies": "1",
"size": "3455",
"license": "mit",
"hash": 168781728049911360,
"line_mean": 29.5840707965,
"line_max": 89,
"alpha_frac": 0.6535455861,
"autogenerated": false,
"ratio": 2.8158109209453954,
"config_test": false,
"has_... |
from experiment_setup import *
import numpy as np
from expr.kernelpca_ski import KPCA
from util.commons_util.decorators.general import print_func_name
__author__ = 'Danyang'
class Plotter(object):
def __init__(self):
pass
def _plot(self, models, dist_metric=EuclideanDistance()):
expr = Exper... | {
"repo_name": "idf/FaceReader",
"path": "expr/experiment_plotting.py",
"copies": "1",
"size": "11458",
"license": "mit",
"hash": -5283308306082336000,
"line_mean": 29.0734908136,
"line_max": 118,
"alpha_frac": 0.5733984989,
"autogenerated": false,
"ratio": 3.366039952996475,
"config_test": fals... |
from experiments.experiment_counters import ExperimentCounter
from experiments.significance import chi_square_p_value, mann_whitney
from experiments.utils import participant
from experiments import conf
import json
MIN_ACTIONS_TO_SHOW = 3
def rate(a, b):
if not b or a == None:
return None
return 10... | {
"repo_name": "bjarnoldus/django-experiments",
"path": "experiments/admin_utils.py",
"copies": "5",
"size": "8020",
"license": "mit",
"hash": -8610974315181539000,
"line_mean": 40.9895287958,
"line_max": 176,
"alpha_frac": 0.6587281796,
"autogenerated": false,
"ratio": 4.125514403292181,
"confi... |
from experiments import counters, conf
import logging
import json
PARTICIPANT_KEY = '%s:%s:participant'
GOAL_KEY = '%s:%s:%s:goal'
logger = logging.getLogger('experiments')
class ExperimentCounter(object):
def __init__(self):
self.counters = counters.Counters()
def increment_participant_count(self, ... | {
"repo_name": "bjarnoldus/django-experiments",
"path": "experiments/experiment_counters.py",
"copies": "5",
"size": "2557",
"license": "mit",
"hash": -6446090563208810000,
"line_mean": 52.2708333333,
"line_max": 195,
"alpha_frac": 0.7176378569,
"autogenerated": false,
"ratio": 3.952086553323029,
... |
from experiments import Experiment
from parameters import ParameterUtils
class GrappaExperiment(Experiment):
_required = ["ppn", "nnode"]
def __init__(self, params, grappa_params={}, srun_settings={}, setup=None, teardown=None):
# grappa_params are command line arguments
self.grappa_param_na... | {
"repo_name": "bmyerz/log2sqlite",
"path": "grappa.py",
"copies": "1",
"size": "3319",
"license": "mit",
"hash": 3533492305123287000,
"line_mean": 35.4725274725,
"line_max": 109,
"alpha_frac": 0.5272672492,
"autogenerated": false,
"ratio": 4.057457212713937,
"config_test": false,
"has_no_keyw... |
from experiments import *
import pprint
def plot_all():
return 0
def ppr_ycsb_scaling_plot(summary,summary_cl):
from experiments import ycsb_scaling
from helper import plot_prep
from plot_helper import tput,time_breakdown,latency,abort_rate,latency_breakdown,time_breakdown_line
nfmt,nexp = ycsb_sc... | {
"repo_name": "rharding6373/ddbms",
"path": "scripts/paper_plots.py",
"copies": "1",
"size": "16307",
"license": "apache-2.0",
"hash": 2367771581173978000,
"line_mean": 68.9871244635,
"line_max": 196,
"alpha_frac": 0.7061384681,
"autogenerated": false,
"ratio": 2.399852832965416,
"config_test":... |
from experiments_manager.consumers import send_message
from experiments_manager.helper import MessageStatus
from git_manager.helpers.helper import get_exp_or_package_from_repo_name
from helpers.helper import get_package_or_experiment_without_request
from MOOCworkbench.celery import app
@app.task
def task_write_requir... | {
"repo_name": "MOOCworkbench/MOOCworkbench",
"path": "requirements_manager/tasks.py",
"copies": "1",
"size": "1067",
"license": "mit",
"hash": 7852825974120729000,
"line_mean": 43.4583333333,
"line_max": 86,
"alpha_frac": 0.7778819119,
"autogenerated": false,
"ratio": 3.8659420289855073,
"confi... |
from experiments_manager.helper import verify_and_get_experiment
from quality_manager.models import ExperimentMeasure, ExperimentMeasureResult
class MeasurementMixin(object):
def get_context_data(self, **kwargs):
context = super(MeasurementMixin, self).get_context_data(**kwargs)
experiment = veri... | {
"repo_name": "MOOCworkbench/MOOCworkbench",
"path": "quality_manager/mixins.py",
"copies": "1",
"size": "1915",
"license": "mit",
"hash": 4176871150189024000,
"line_mean": 42.5227272727,
"line_max": 105,
"alpha_frac": 0.661618799,
"autogenerated": false,
"ratio": 4.3522727272727275,
"config_te... |
from experiments.models import noop
from experiments.utils import path_finder
from .training import main, DefaultOptions
import torch as th
from torch.nn import functional as F
class Options(DefaultOptions):
NAME = "test"
LOGGING_ROOT = path_finder('../../data/lshtc-logs')
PATH = path_f... | {
"repo_name": "walkowiak/mips",
"path": "python/experiments/runner.py",
"copies": "1",
"size": "1678",
"license": "mit",
"hash": 4018781725820121600,
"line_mean": 23.6764705882,
"line_max": 97,
"alpha_frac": 0.4457687723,
"autogenerated": false,
"ratio": 3.804988662131519,
"config_test": false,... |
from experiments.stats import zprob, chisqprob
def mann_whitney(a_distribution, b_distribution, use_continuity=True):
"""Returns (u, p_value)"""
MINIMUM_VALUES = 20
all_values = sorted(set(a_distribution.keys() + b_distribution.keys()))
count_so_far = 0
a_rank_sum = 0
b_rank_sum = 0
a_co... | {
"repo_name": "squamous/django-experiments",
"path": "experiments/significance.py",
"copies": "3",
"size": "4487",
"license": "mit",
"hash": -6935166564625775000,
"line_mean": 31.7518248175,
"line_max": 130,
"alpha_frac": 0.6144417205,
"autogenerated": false,
"ratio": 3.4173648134044172,
"confi... |
from experiment.storage import json_ser
from api.services import escape_name
class ExperimentService(object):
ADMIN_KEY = 'admin:all_experiments'
def __init__(self, storage):
self.storage = storage
def list(self):
result = self.storage.get(self.ADMIN_KEY)
if result is None:
... | {
"repo_name": "barakschiller/experiment",
"path": "experiment/api/services/experiment_service.py",
"copies": "1",
"size": "1595",
"license": "bsd-3-clause",
"hash": 9080579152323510000,
"line_mean": 32.9574468085,
"line_max": 107,
"alpha_frac": 0.6482758621,
"autogenerated": false,
"ratio": 4.068... |
from expfactory.battery import *
from expfactory.utils import copy_directory
from expfactory.vm import download_repo
import argparse
from glob import glob
import os
import sys
import shutil
import tempfile
# Get CLI parameters
parser = argparse.ArgumentParser()
parser.add_argument('--output', dest="output", help='Bat... | {
"repo_name": "psiturk/psiturk-python",
"path": "server/mysql/setup_battery_for_webserver.py",
"copies": "4",
"size": "3435",
"license": "bsd-3-clause",
"hash": 3540573269503982600,
"line_mean": 32.6764705882,
"line_max": 170,
"alpha_frac": 0.6649199418,
"autogenerated": false,
"ratio": 3.7459105... |
from expfactory.vm import custom_battery_download, add_custom_logo, generate_database_url, \
prepare_vm, specify_experiments
from expfactory.experiment import validate, load_experiment, get_experiments, make_lookup
from expfactory.utils import copy_directory, get_installdir, sub_template
from expfactory.battery im... | {
"repo_name": "vsoch/expfactory-python",
"path": "expfactory/interface.py",
"copies": "2",
"size": "7164",
"license": "mit",
"hash": 4783156462237851000,
"line_mean": 36.5078534031,
"line_max": 101,
"alpha_frac": 0.5798436628,
"autogenerated": false,
"ratio": 4.29754049190162,
"config_test": tr... |
from .._explainer import Explainer
import numpy as np
try:
import lime
import lime.lime_tabular
except ImportError:
pass
class LimeTabular(Explainer):
""" Simply wrap of lime.lime_tabular.LimeTabularExplainer into the common shap interface.
Parameters
----------
model : function or iml... | {
"repo_name": "slundberg/shap",
"path": "shap/explainers/other/_lime.py",
"copies": "1",
"size": "2523",
"license": "mit",
"hash": -7592082209597466000,
"line_mean": 36.1029411765,
"line_max": 122,
"alpha_frac": 0.573523583,
"autogenerated": false,
"ratio": 3.93603744149766,
"config_test": fals... |
from ..exploit import Exploit
import logging
from ..payload import Payload
import os
l = logging.getLogger("aegg.exploits.rop")
SCRIPT = '''
from pwn import *
import sys
binary = '$binary$'
leak_symbol = '$leak_symbol$'
symbol = '$symbol$'
payload = $payload$
libc_path = '$libc$'
leak_off = $leak_off$
cmd = sys.argv... | {
"repo_name": "YSc21/aegg",
"path": "exploits/rop.py",
"copies": "1",
"size": "4044",
"license": "mit",
"hash": 1582373646834862000,
"line_mean": 29.8702290076,
"line_max": 79,
"alpha_frac": 0.5825914936,
"autogenerated": false,
"ratio": 3.298531810766721,
"config_test": false,
"has_no_keywor... |
from ..exploit import Exploit
import logging
from ..payload import Payload
l = logging.getLogger('aegg.exploits.ret2stack')
class Ret2Stack(Exploit):
SHELLCODES = [
'jhh///sh/bin\x89\xe31\xc9j\x0bX\x99\xcd\x80', # 22 bytes: shellcraft i386.linux.sh
'1\xc9\xf7\xe1Qh//shh/bin\x89\xe3\xb0\x0b\xcd\x... | {
"repo_name": "YSc21/aegg",
"path": "exploits/ret2stack.py",
"copies": "1",
"size": "2925",
"license": "mit",
"hash": 4357840667147668500,
"line_mean": 37.4868421053,
"line_max": 122,
"alpha_frac": 0.5764102564,
"autogenerated": false,
"ratio": 3.3620689655172415,
"config_test": false,
"has_n... |
from .explore import Explore
from binreconfiguration.storageunit import StorageException
from .explote import Explore
import random
import abc
class GradientDescent(Explore):
@staticmethod
@abc.abstractmethod
def cmp_fitness(fitness, best_fitness):
pass
def step(self):
best_move_so_far = None
best_fitne... | {
"repo_name": "vialette/binreconfiguration",
"path": "binreconfiguration/explore/gradientdescent.py",
"copies": "1",
"size": "1545",
"license": "mit",
"hash": -5812479616672804000,
"line_mean": 27.6111111111,
"line_max": 86,
"alpha_frac": 0.6893203883,
"autogenerated": false,
"ratio": 3.071570576... |
from explorer import app_settings
from explorer.models import Query
from django.core.mail import send_mail
from explorer.utils import csv_report
from datetime import date
import random
import string
if app_settings.ENABLE_TASKS:
from celery import task
from celery.utils.log import get_task_logger
import t... | {
"repo_name": "guilhermemaba/django-sql-explorer",
"path": "explorer/tasks.py",
"copies": "1",
"size": "1927",
"license": "mit",
"hash": 1579225306633898800,
"line_mean": 31.6610169492,
"line_max": 99,
"alpha_frac": 0.6585365854,
"autogenerated": false,
"ratio": 3.316695352839931,
"config_test"... |
from explorer import app_settings
from explorer.models import Query
from django.core.mail import send_mail
from utils import csv_report
from datetime import date
import random
import string
if app_settings.ENABLE_TASKS:
from celery import task
from celery.utils.log import get_task_logger
import tinys3
... | {
"repo_name": "pombredanne/django-sql-explorer",
"path": "explorer/tasks.py",
"copies": "1",
"size": "1908",
"license": "mit",
"hash": 9004578459686254000,
"line_mean": 31.3559322034,
"line_max": 99,
"alpha_frac": 0.6567085954,
"autogenerated": false,
"ratio": 3.3240418118466897,
"config_test":... |
from explorer import app_settings
from explorer.models import Query, QueryLog
from django.core.mail import send_mail
from explorer.utils import csv_report
from datetime import date, datetime, timedelta
import random
import string
if app_settings.ENABLE_TASKS:
from celery import task
from celery.utils.log impo... | {
"repo_name": "grantmcconnaughey/django-sql-explorer",
"path": "explorer/tasks.py",
"copies": "2",
"size": "2233",
"license": "mit",
"hash": -3581591842404310500,
"line_mean": 32.328358209,
"line_max": 99,
"alpha_frac": 0.6645768025,
"autogenerated": false,
"ratio": 3.3378176382660687,
"config_... |
from .explorer import Explorer
from ..calling_conventions import DEFAULT_CC
class Caller(Explorer):
"""
Caller is a surveyor that executes functions to see what they do.
"""
def __init__(self, project, addr, args=(), start=None, num_find=None, concrete_only=False, **kwargs):
"""
:para... | {
"repo_name": "Ruide/angr-dev",
"path": "angr/angr/surveyors/caller.py",
"copies": "5",
"size": "4554",
"license": "bsd-2-clause",
"hash": 1591177162727139600,
"line_mean": 41.9622641509,
"line_max": 154,
"alpha_frac": 0.6166007905,
"autogenerated": false,
"ratio": 4.037234042553192,
"config_te... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.