text stringlengths 0 1.05M | meta dict |
|---|---|
from engine.positional_board_values import *
from engine.constants import sq120
from engine import board_hash
def evaluate_state(state):
board = state[0]
# hash_val = board + str(state[1])
hash_val = board
if hash_val in board_hash:
return board_hash[hash_val]
pos_values = {'K': 0.0, 'Q':... | {
"repo_name": "ElliotVilhelm/IZII",
"path": "engine/evaluate_state.py",
"copies": "1",
"size": "1814",
"license": "mit",
"hash": -1657587268979689500,
"line_mean": 36.0204081633,
"line_max": 70,
"alpha_frac": 0.4570011025,
"autogenerated": false,
"ratio": 3.1168384879725086,
"config_test": fals... |
from engine.query import search
from test_data import util
from math import log
import pickle
import json
def store_res(k, search_type, incorporate_pr):
queries = ['Computer Science','Computer','Computer Room','Computer Science Department','Jun Wang',
'Emine Yilmaz','Machine Learning', 'Web Science... | {
"repo_name": "tanguy-s/ucl-search-engine",
"path": "evaluation_stored.py",
"copies": "1",
"size": "9405",
"license": "mit",
"hash": -190900054247734700,
"line_mean": 40.4317180617,
"line_max": 178,
"alpha_frac": 0.6176501861,
"autogenerated": false,
"ratio": 3.7440286624203822,
"config_test": ... |
from engine.render.image import Image;
from engine import Render;
from engine import Global;
class Cinematic():
def __init__(self):
self.backgroundElement = None;
self.dynamicElements = [];
screenSize = Global.getScreenSize();
self.fade = {
"direction" : None,
"interval" : None,
"running" : False,... | {
"repo_name": "WilliamDASILVA/TheMysteryOfSchweitzer",
"path": "engine/Cinematic.py",
"copies": "1",
"size": "4525",
"license": "mit",
"hash": -6387753403780739000,
"line_mean": 27.28125,
"line_max": 113,
"alpha_frac": 0.6733701657,
"autogenerated": false,
"ratio": 3.127159640635798,
"config_te... |
from engine.render.image import Image;
from engine import Render;
from engine import Global;
# --------------------------------------------------- *\
# [class] Interface()
#
# * Interface element *
#
# --------------------------------------------------- */
class Interface():
def __init__(self):
self.entries = {};
... | {
"repo_name": "WilliamDASILVA/TheMysteryOfSchweitzer",
"path": "engine/Interface.py",
"copies": "1",
"size": "2841",
"license": "mit",
"hash": 5613006241617158000,
"line_mean": 29.2234042553,
"line_max": 72,
"alpha_frac": 0.4709609293,
"autogenerated": false,
"ratio": 3.7088772845953004,
"confi... |
from engine.render.image import Image;
class Item():
def __init__(self, name = None, description = None, iconPath = None):
self.setName(name);
self.setDescription(description);
self.functionsToCallWhenAction = [];
self.icon = None;
# icon
if iconPath != None:
drawable = Image(iconPath);
self.ico... | {
"repo_name": "WilliamDASILVA/TheMysteryOfSchweitzer",
"path": "gameplay/Item.py",
"copies": "1",
"size": "2234",
"license": "mit",
"hash": -5830808506676419000,
"line_mean": 27.2911392405,
"line_max": 70,
"alpha_frac": 0.4306177261,
"autogenerated": false,
"ratio": 3.8253424657534247,
"config_... |
from engine.render.text import Text;
from engine import Render;
from engine.Input import Keyboard;
isActive = False;
currentLine = 0;
lines = [];
# --------------------------------------------------- *\
# [function] setActive(value)
#
# * Set active the debug mode *
# Return : nil
# -------------------------------... | {
"repo_name": "WilliamDASILVA/TheMysteryOfSchweitzer",
"path": "engine/Debug.py",
"copies": "1",
"size": "1396",
"license": "mit",
"hash": -5059120015340498000,
"line_mean": 22.2666666667,
"line_max": 56,
"alpha_frac": 0.4613180516,
"autogenerated": false,
"ratio": 3.7127659574468086,
"config_t... |
from engine.service import (
AbstractService, GraphicsService,
ServiceManager
)
import pyglet
import kytten
class GuiService(AbstractService):
""" Service to manage GUI screens """
def __init__(self, window, group_index = 1):
self.guis = {}
self.window = window
self.batch = Ser... | {
"repo_name": "constantinius/YaaGame",
"path": "engine/gui.py",
"copies": "1",
"size": "1804",
"license": "mit",
"hash": 2763050527148521500,
"line_mean": 27.6507936508,
"line_max": 67,
"alpha_frac": 0.5476718404,
"autogenerated": false,
"ratio": 4.0088888888888885,
"config_test": false,
"has... |
from engines import Engine
from copy import deepcopy
class OneplyEngine(Engine):
"""
Game engine which implements a simple fitness function maximizing the
difference in # of pieces in the given color's favor.
"""
def get_move(self, board, color, move_num=None,
time_remaining=None, ... | {
"repo_name": "JaimieMurdock/othello",
"path": "othello/engines/oneply.py",
"copies": "1",
"size": "1465",
"license": "mit",
"hash": -9061149264336156000,
"line_mean": 36.5641025641,
"line_max": 79,
"alpha_frac": 0.6300341297,
"autogenerated": false,
"ratio": 4.209770114942529,
"config_test": f... |
from engines.PolicyEngine import PolicyEngine
import chess
import numpy as np
import os
import random
FOLDER_TO_SAVE = "saved/policy_rl/"
BATCH_SIZE = 32
SAMPLES_PER_EPOCH = 1*BATCH_SIZE
NUMBER_EPOCHS = 10
VERBOSE_LEVEL = 2
NUM_PARALLELL_GAMES = 128
MAX_TURNS_PER_GAME = 100
SIZE_MODEL_POOL ... | {
"repo_name": "rajpurkar/chess-deep-rl",
"path": "policy_rl.py",
"copies": "1",
"size": "9763",
"license": "mit",
"hash": -3859645559682034000,
"line_mean": 40.3686440678,
"line_max": 119,
"alpha_frac": 0.5607907406,
"autogenerated": false,
"ratio": 3.667543200601052,
"config_test": false,
"h... |
from engine.utils.timeutils import milliseconds
from engine.utils.mathutils import Median
class PerformanceInfo(object):
__slots__ = ('_process_id', 'time', 'requests', 'fetch_time', 'run_commands_time', 'game_server_id')
def __init__(self, game_server_id):
self.time = milliseconds()
self.req... | {
"repo_name": "kollad/turbo-ninja",
"path": "apps/game/performance.py",
"copies": "1",
"size": "1519",
"license": "mit",
"hash": -5834254187109755000,
"line_mean": 39,
"line_max": 104,
"alpha_frac": 0.5404871626,
"autogenerated": false,
"ratio": 3.894871794871795,
"config_test": false,
"has_n... |
from english2039 import word_dict, word_inv_dict
from hashlib import sha256
def mnemonic_to_bits(mnemonic):
"""Convert a mnemonic to a bitstring"""
return ''.join(['{0:011b}'.format(word_inv_dict[w] - 1) for w in mnemonic])
def bits_to_mnemonic(bitstring):
"""Convert a bitstring to a mnemonic"""
n... | {
"repo_name": "klingebj/shamir_bip39_2039",
"path": "shamir_bip39_2039/checksum.py",
"copies": "1",
"size": "1654",
"license": "apache-2.0",
"hash": -492639030228599400,
"line_mean": 24.84375,
"line_max": 79,
"alpha_frac": 0.6269649335,
"autogenerated": false,
"ratio": 3.224171539961014,
"confi... |
from .english_corpus import EnglishCorpus
class CLTKCorpus(EnglishCorpus):
def lemmatize(self, return_string=True, return_raw=False): # pragma: no cover
new_docs = []
counter = 0
for doc in self.data:
counter += 1
self.update('Lemmatizing', counter)
ne... | {
"repo_name": "thePortus/arakhne",
"path": "build/lib/arakhne/corpus/cltk_corpus.py",
"copies": "2",
"size": "1144",
"license": "mit",
"hash": -2416208328983289000,
"line_mean": 29.1052631579,
"line_max": 82,
"alpha_frac": 0.541958042,
"autogenerated": false,
"ratio": 4.028169014084507,
"config... |
from english_portugese_cognates import cogs
# from convert_eng_to_port import *
# Iterate over each item from cogs and develop its Portugese transtlation
# by replacing word endings.
eng_port = {}
def fn_tion(tion):
cao = []
for i in cogs:
if i[-4::] == 'tion':
cao.append(i.replace('tio... | {
"repo_name": "herschel-rey/py_snippets",
"path": "convert_eng_to_port.py",
"copies": "1",
"size": "8784",
"license": "mit",
"hash": 9106338898086998000,
"line_mean": 22.0551181102,
"line_max": 84,
"alpha_frac": 0.4641393443,
"autogenerated": false,
"ratio": 3.139385275196569,
"config_test": fa... |
from EngScript import syntaxRules
from EngScript import outputString
from EngScript import grammar
import speakingCountdownTimer
timerScript = grammar + [
[["say <<x>>"], "speakingCountdownTimer.say{<<x>>}"],
[["do this <<foo>> times(| ): <<bar>>", "<<bar>> <<foo>> times"], "for _ in range{<<foo>>} (<<bar>>)"]... | {
"repo_name": "jarble/Polyglot-code-generator",
"path": "examples/CountDownTimerExample.py",
"copies": "1",
"size": "1740",
"license": "mit",
"hash": -8701002016691001000,
"line_mean": 57.0333333333,
"line_max": 289,
"alpha_frac": 0.6735632184,
"autogenerated": false,
"ratio": 3.438735177865613,
... |
from enhatts._fields import Fields, InstanceFields
class FieldDescriptor(object):
__slots__ = {'_name'}
def __init__(self, cls, name):
# Requires the FIELDS attribute of `cls` to be `fields_descriptor`.
self._name = name
setattr(cls, name, self)
def __get__(self, obj, cls):
... | {
"repo_name": "IvIePhisto/EnhAtts",
"path": "enhatts/_descriptors.py",
"copies": "1",
"size": "1969",
"license": "mit",
"hash": 529518534217891140,
"line_mean": 28.8484848485,
"line_max": 75,
"alpha_frac": 0.5657694261,
"autogenerated": false,
"ratio": 4.0597938144329895,
"config_test": false,
... |
from enigma import eConsoleAppContainer, iServiceInformation, fbClass, eRCInput, eDBoxLCD, getDesktop
from Screens.Screen import Screen
from Plugins.Plugin import PluginDescriptor
from os import symlink, mkdir, remove, rmdir, path
class ShellStarter(Screen):
skin = """
<screen position="1,1" size="1,1" title="TuxTX... | {
"repo_name": "YtvwlD/od-oe",
"path": "recipes/tuxbox/tuxbox-tuxtxt-32bpp/plugin.py",
"copies": "3",
"size": "1748",
"license": "mit",
"hash": -1841201003846567200,
"line_mean": 28.1333333333,
"line_max": 115,
"alpha_frac": 0.6979405034,
"autogenerated": false,
"ratio": 3.0189982728842835,
"con... |
from enigma import eConsoleAppContainer, iServiceInformation, fbClass, eRCInput, eDBoxLCD
from Screens.Screen import Screen
from Plugins.Plugin import PluginDescriptor
from os import symlink, mkdir, remove, rmdir, path
class ShellStarter(Screen):
skin = """
<screen position="1,1" size="1,1" title="TuxTXT" >
... | {
"repo_name": "kakunbsc/openembedded",
"path": "recipes/tuxbox/tuxbox-tuxtxt-32bpp/plugin.py",
"copies": "2",
"size": "1672",
"license": "mit",
"hash": 1689170789790912500,
"line_mean": 28.8571428571,
"line_max": 115,
"alpha_frac": 0.6991626794,
"autogenerated": false,
"ratio": 3.051094890510949,... |
from enigma import enigma_exception
class Plugboard:
"""This is a the plugboard component of an Enigma Machine"""
def __init__(self, max_plugs):
self.__maxPlugs = max_plugs
self.__plugs = []
@property
def plugs(self):
"""Returns list of currently used plugs"""
return ... | {
"repo_name": "cjengdahl/Enigma",
"path": "enigma/plugboard.py",
"copies": "1",
"size": "2750",
"license": "mit",
"hash": 6148415456438912000,
"line_mean": 29.2197802198,
"line_max": 74,
"alpha_frac": 0.5749090909,
"autogenerated": false,
"ratio": 3.767123287671233,
"config_test": false,
"has... |
from enigma import iPlayableService
from Components.Converter.Converter import Converter
from Components.Element import cached
from Poll import Poll
class ArcticAudioInfo(Poll, Converter, object):
GET_AUDIO_ICON = 0
GET_AUDIO_CODEC = 1
def __init__(self, type):
Converter.__init__(self, type)
Poll.__... | {
"repo_name": "sbeatz/enigma2arcticskin",
"path": "install/usr/lib/enigma2/python/Components/Converter/ArcticAudioInfo.py",
"copies": "1",
"size": "3312",
"license": "apache-2.0",
"hash": 5799375287998106000,
"line_mean": 29.875,
"line_max": 91,
"alpha_frac": 0.6298309179,
"autogenerated": false,
... |
from ..en import Provider as AddressProvider
class Provider(AddressProvider):
city_prefixes = (
'North',
'East',
'West',
'South',
'New',
'Lake',
'Port',
'Upper',
'Lower',
'High',
'Mount',
)
city_suffixes = (
... | {
"repo_name": "joke2k/faker",
"path": "faker/providers/address/en_NZ/__init__.py",
"copies": "1",
"size": "6347",
"license": "mit",
"hash": -443202760350335700,
"line_mean": 24.5846774194,
"line_max": 79,
"alpha_frac": 0.4332545311,
"autogenerated": false,
"ratio": 3.219178082191781,
"config_te... |
from ..en import Provider as AddressProvider
class Provider(AddressProvider):
city_prefixes = ('North', 'East', 'West', 'South', 'New', 'Lake', 'Port',
'St.')
city_suffixes = ('town', 'ton', 'land', 'ville', 'berg', 'burgh',
'borough', 'bury', 'view', 'port', 'mouth... | {
"repo_name": "joke2k/faker",
"path": "faker/providers/address/en_AU/__init__.py",
"copies": "1",
"size": "5082",
"license": "mit",
"hash": -2478316533784083500,
"line_mean": 35.3,
"line_max": 79,
"alpha_frac": 0.4698937426,
"autogenerated": false,
"ratio": 3.123540258143823,
"config_test": fal... |
from enlib import bench,enmap
import orphics.tools.catalogs as cats
import astropy.io.fits as fits
import orphics.tools.io as io
import os,sys
import numpy as np
import healpy as hp
cache_dir = "/gpfs01/astro/workarea/msyriac/data/depot/cache/"
# deep56 = "/gpfs01/astro/workarea/msyriac/data/act/maps/c7v5/s15/deep56/... | {
"repo_name": "msyriac/orphics",
"path": "tests/legacy/test_healpix_galmap.py",
"copies": "1",
"size": "3339",
"license": "bsd-2-clause",
"hash": -7284205062690834000,
"line_mean": 34.1473684211,
"line_max": 312,
"alpha_frac": 0.7478286912,
"autogenerated": false,
"ratio": 2.330076762037683,
"c... |
from enlib import enmap
from szar.counts import ClusterCosmology
from orphics.analysis import flatMaps as fmaps
import orphics.tools.io as io
import orphics.tools.cmb as cmb
import orphics.tools.stats as stats
import os, sys
import numpy as np
out_dir = ""
lmax = 2000
cc = ClusterCosmology(lmax=lmax,pickling=True)
T... | {
"repo_name": "msyriac/orphics",
"path": "tests/legacy/testEnlibPower.py",
"copies": "1",
"size": "1591",
"license": "bsd-2-clause",
"hash": 562567226026114600,
"line_mean": 26.4310344828,
"line_max": 93,
"alpha_frac": 0.7265870522,
"autogenerated": false,
"ratio": 2.2728571428571427,
"config_t... |
from enlib import enmap
import numpy as np
import orphics.tools.io as io
import os,sys
from orphics.tools.catalogs import CatMapper
out_dir = os.environ['WWW']+"plots/"
degX = 5.
degY = 20.
px = 1.0
shape, wcs = enmap.rect_geometry(degX*60.,px,height_arcmin=degY*60.)
gal_map = enmap.zeros(shape,wcs)
#y0,x0,y1,... | {
"repo_name": "msyriac/orphics",
"path": "tests/legacy/simple_mapping.py",
"copies": "1",
"size": "1433",
"license": "bsd-2-clause",
"hash": -2741646414938140000,
"line_mean": 23.7068965517,
"line_max": 89,
"alpha_frac": 0.6775994417,
"autogenerated": false,
"ratio": 2.218266253869969,
"config_... |
from enlib import enmap
#import orphics.m as fmaps
import orphics.maps as maps
import orphics.io as io
import orphics.stats as stats
from orphics import cosmology
import numpy as np
import os, sys
out_dir = os.environ['WWW']+"plots/pureTest_"
#cc = Cosmology(lmax=6000,pickling=True,dimensionless=False)
theory = cosmol... | {
"repo_name": "msyriac/orphics",
"path": "tests/legacy/test_pure.py",
"copies": "1",
"size": "2969",
"license": "bsd-2-clause",
"hash": -271943068029745120,
"line_mean": 35.6543209877,
"line_max": 134,
"alpha_frac": 0.6938363085,
"autogenerated": false,
"ratio": 2.294435857805255,
"config_test"... |
from enot.compiler.abstract import AbstractCompiler
from enot.compiler.bootstrap import BootstrapCompiler
from enot.compiler.compiler_type import Compiler
from enot.compiler.enot import EnotCompiler
from enot.compiler.erlang_mk import ErlangMKCompiler
from enot.compiler.makefile import MakefileCompiler
from enot.compil... | {
"repo_name": "comtihon/coon",
"path": "enot/compiler/compiler_factory.py",
"copies": "2",
"size": "1344",
"license": "apache-2.0",
"hash": -534400443220555900,
"line_mean": 43.8,
"line_max": 101,
"alpha_frac": 0.7641369048,
"autogenerated": false,
"ratio": 4.1609907120743035,
"config_test": fa... |
from enqueteru import db
from utils import MealChecker
from flask_mongoalchemy import BaseQuery
from calendar import monthrange
import datetime
class Resposta(db.Document):
card = db.IntField(required=False)
like_level = db.IntField(max_value=4, min_value=0)
comment = db.StringField()
def to_json(se... | {
"repo_name": "m4nolo/enquete-ru",
"path": "enqueteru/models.py",
"copies": "1",
"size": "1959",
"license": "mit",
"hash": -5405494853849829000,
"line_mean": 28.6818181818,
"line_max": 97,
"alpha_frac": 0.5977539561,
"autogenerated": false,
"ratio": 3.46113074204947,
"config_test": false,
"ha... |
from enrichmentmanager.models import EnrichmentSignup, EnrichmentOption
from enrichmentmanager.lib import canEditSignup
from io import StringIO
from datetime import date
from django import template
register = template.Library()
@register.assignment_tag(takes_context=True)
def select_for(context, slot, student):
... | {
"repo_name": "rectory-school/rectory-apps",
"path": "enrichmentmanager/templatetags/enrichment_extra.py",
"copies": "1",
"size": "3934",
"license": "mit",
"hash": -5023038542584867000,
"line_mean": 39.1530612245,
"line_max": 169,
"alpha_frac": 0.6154041688,
"autogenerated": false,
"ratio": 4.149... |
from .enrichment_service import EnrichmentService, AGGREGATION_DEFAULT
GEOM_TYPE_POINTS = 'points'
GEOM_TYPE_POLYGONS = 'polygons'
class Enrichment(EnrichmentService):
"""This is the main class to enrich your own data with data from the
`Data Observatory <https://carto.com/platform/location-data-streams/>`__... | {
"repo_name": "CartoDB/cartoframes",
"path": "cartoframes/data/observatory/enrichment/enrichment.py",
"copies": "1",
"size": "14317",
"license": "bsd-3-clause",
"hash": 1628877342169063200,
"line_mean": 57.4367346939,
"line_max": 119,
"alpha_frac": 0.6200321296,
"autogenerated": false,
"ratio": 4... |
from enrichments import study_enrichments
class Study(object):
def __init__(self, wikitext):
self._init_from_wikitext(wikitext)
def _init_from_wikitext(self, wikitext):
lines = wikitext.split("|")
lines = filter(lambda l: "=" in l, lines)
lines = filter(lambda l: "={{" not in... | {
"repo_name": "CREAT-e/copyright-evidence-api",
"path": "src/models.py",
"copies": "1",
"size": "1634",
"license": "mit",
"hash": 6080393658806543000,
"line_mean": 33.0416666667,
"line_max": 77,
"alpha_frac": 0.582619339,
"autogenerated": false,
"ratio": 3.844705882352941,
"config_test": false,... |
from ensemble.ctf.api import PiecewiseFunction, OpacityNode
NODES = [OpacityNode(center=0.0, opacity=0.0),
OpacityNode(center=0.5, opacity=0.5),
OpacityNode(center=0.9, opacity=1.0)]
def _basic_piecewise():
pf = PiecewiseFunction()
for n in NODES:
pf.insert(n)
return pf
def _... | {
"repo_name": "dmsurti/ensemble",
"path": "ensemble/ctf/tests/test_piecewise.py",
"copies": "2",
"size": "1467",
"license": "bsd-3-clause",
"hash": 5417505232845604000,
"line_mean": 21.921875,
"line_max": 73,
"alpha_frac": 0.6346284935,
"autogenerated": false,
"ratio": 3.069037656903766,
"confi... |
from Ensemble.Ensemble import Ensemble
from log import logger
import pandas as pd
class Correlation:
"""
Correlation DataSet.
[Bin x Beam] data.
"""
def __init__(self, num_elements, element_multiplier):
self.ds_type = 10
self.num_elements = num_elements
self.element_multipl... | {
"repo_name": "ricorx7/rti_python",
"path": "Ensemble/Correlation.py",
"copies": "2",
"size": "1334",
"license": "bsd-3-clause",
"hash": 292693513002369200,
"line_mean": 30.7619047619,
"line_max": 114,
"alpha_frac": 0.6086956522,
"autogenerated": false,
"ratio": 4.117283950617284,
"config_test"... |
from Ensemble.Ensemble import Ensemble
from log import logger
class Amplitude:
"""
Amplitude DataSet.
[Bin x Beam] data.
"""
def __init__(self, num_elements, element_multiplier):
self.ds_type = 10
self.num_elements = num_elements
self.element_multiplier = element_multiplie... | {
"repo_name": "ricorx7/rti_python",
"path": "Ensemble/Amplitude.py",
"copies": "2",
"size": "1429",
"license": "bsd-3-clause",
"hash": 6221999662746628000,
"line_mean": 30.0652173913,
"line_max": 112,
"alpha_frac": 0.6046186144,
"autogenerated": false,
"ratio": 4.071225071225071,
"config_test":... |
from Ensemble.Ensemble import Ensemble
from log import logger
class AncillaryData:
"""
Ancillary Data DataSet.
Float values that give details about the ensemble.
"""
def __init__(self, num_elements, element_multiplier):
self.ds_type = 10
self.num_elements = num_elements
se... | {
"repo_name": "ricorx7/rti-python",
"path": "Ensemble/AncillaryData.py",
"copies": "2",
"size": "4346",
"license": "bsd-3-clause",
"hash": 5840133368376527000,
"line_mean": 57.7297297297,
"line_max": 136,
"alpha_frac": 0.6617579383,
"autogenerated": false,
"ratio": 3.6459731543624163,
"config_t... |
from Ensemble.Ensemble import Ensemble
from log import logger
class BeamVelocity:
"""
Beam Velocity DataSet.
[Bin x Beam] data.
"""
def __init__(self, num_elements, element_multiplier):
self.ds_type = 10
self.num_elements = num_elements
self.element_multiplier = element_mu... | {
"repo_name": "ricorx7/rti-python",
"path": "Ensemble/BeamVelocity.py",
"copies": "2",
"size": "1314",
"license": "bsd-3-clause",
"hash": 1834422128289649200,
"line_mean": 30.2857142857,
"line_max": 113,
"alpha_frac": 0.604261796,
"autogenerated": false,
"ratio": 4.0430769230769235,
"config_tes... |
from Ensemble.Ensemble import Ensemble
from log import logger
class BottomTrack:
"""
Ensemble Data DataSet.
Integer values that give details about the ensemble.
"""
def __init__(self, num_elements, element_multiplier):
self.ds_type = 10
self.num_elements = num_elements
sel... | {
"repo_name": "ricorx7/rti-python",
"path": "Ensemble/BottomTrack.py",
"copies": "2",
"size": "7883",
"license": "bsd-3-clause",
"hash": 5709503779972184000,
"line_mean": 43.7897727273,
"line_max": 147,
"alpha_frac": 0.6322466066,
"autogenerated": false,
"ratio": 3.699202252463632,
"config_test... |
from Ensemble.Ensemble import Ensemble
from log import logger
class EarthVelocity:
"""
Earth Velocity DataSet.
[Bin x Beam] data.
"""
def __init__(self, num_elements, element_multiplier):
self.ds_type = 10
self.num_elements = num_elements
self.element_multiplier = element_... | {
"repo_name": "ricorx7/rti_python",
"path": "Ensemble/EarthVelocity.py",
"copies": "2",
"size": "1316",
"license": "bsd-3-clause",
"hash": 117387850413665220,
"line_mean": 30.3333333333,
"line_max": 113,
"alpha_frac": 0.6048632219,
"autogenerated": false,
"ratio": 4.03680981595092,
"config_test... |
from Ensemble.Ensemble import Ensemble
from log import logger
class GoodBeam:
"""
Good Beam DataSet.
Indicate if the beam data is good.
[Bin x Beam] data.
"""
def __init__(self, num_elements, element_multiplier):
self.ds_type = 10
self.num_elements = num_elements
self.... | {
"repo_name": "ricorx7/rti-python",
"path": "Ensemble/GoodBeam.py",
"copies": "2",
"size": "1316",
"license": "bsd-3-clause",
"hash": 976037759426266000,
"line_mean": 29.6046511628,
"line_max": 111,
"alpha_frac": 0.5980243161,
"autogenerated": false,
"ratio": 3.940119760479042,
"config_test": f... |
from Ensemble.Ensemble import Ensemble
from log import logger
class GoodEarth:
"""
Good Earth DataSet.
Indicate if the beam data is good.
[Bin x Beam] data.
"""
def __init__(self, num_elements, element_multiplier):
self.ds_type = 10
self.num_elements = num_elements
sel... | {
"repo_name": "ricorx7/rti-python",
"path": "Ensemble/GoodEarth.py",
"copies": "2",
"size": "1322",
"license": "bsd-3-clause",
"hash": 5153125712509575000,
"line_mean": 29.7441860465,
"line_max": 112,
"alpha_frac": 0.5998487141,
"autogenerated": false,
"ratio": 3.9580838323353293,
"config_test"... |
from Ensemble.Ensemble import Ensemble
from log import logger
class InstrumentVelocity:
"""
Instrument Velocity DataSet.
[Bin x Beam] data.
"""
def __init__(self, num_elements, element_multiplier):
self.ds_type = 10
self.num_elements = num_elements
self.element_multiplier ... | {
"repo_name": "ricorx7/rti_python",
"path": "Ensemble/InstrumentVelocity.py",
"copies": "2",
"size": "1322",
"license": "bsd-3-clause",
"hash": 6383181943361239000,
"line_mean": 31.243902439,
"line_max": 112,
"alpha_frac": 0.6096822995,
"autogenerated": false,
"ratio": 4.118380062305296,
"confi... |
from Ensemble.Ensemble import Ensemble
from log import logger
class RangeTracking:
"""
Range Tracking DataSet.
Values that give details about the wave heights.
"""
def __init__(self, num_elements, element_multiplier):
self.ds_type = 10
self.num_elements = num_elements
self... | {
"repo_name": "ricorx7/rti-python",
"path": "Ensemble/RangeTracking.py",
"copies": "2",
"size": "12378",
"license": "bsd-3-clause",
"hash": 7491120241413723000,
"line_mean": 74.4756097561,
"line_max": 143,
"alpha_frac": 0.6863790596,
"autogenerated": false,
"ratio": 3.710431654676259,
"config_t... |
from Ensemble.Ensemble import Ensemble
from log import logger
class SystemSetup:
"""
System Setup DataSet.
Float values that give details about the system setup.
"""
def __init__(self, num_elements, element_multiplier):
self.ds_type = 10
self.num_elements = num_elements
se... | {
"repo_name": "ricorx7/rti_python",
"path": "Ensemble/SystemSetup.py",
"copies": "2",
"size": "5849",
"license": "bsd-3-clause",
"hash": -3957171350581364000,
"line_mean": 59.9270833333,
"line_max": 134,
"alpha_frac": 0.6457514105,
"autogenerated": false,
"ratio": 3.6171923314780456,
"config_te... |
from ensemble import Ensemble
from model import Model
import ML_algorithms as ml
import low_rank_models as lrm
import util
import time
import pandas as pd
import numpy as np
import multiprocessing as mp
from pathos.multiprocessing import ProcessingPool
from scipy.linalg import qr
import util
class ErrorMatrix:
... | {
"repo_name": "yujiakimoto/lowrankautoml",
"path": "automl/error_matrix.py",
"copies": "1",
"size": "5597",
"license": "mit",
"hash": -2447741526643291600,
"line_mean": 44.8770491803,
"line_max": 242,
"alpha_frac": 0.6364123638,
"autogenerated": false,
"ratio": 4.0854014598540145,
"config_test"... |
from ensure_path import ensure_path
import numpy as np
from fitstools import combine
from astropy.io import fits
from flat import find_fibers, make_fiber_profile_map, make_throughput_map
from thar import wvlsol, wvlsolver
from extract import fibers, optimal_extraction, robust_mean_extraction
from spectra import spectru... | {
"repo_name": "richardseifert/Hydra_pipeline",
"path": "libs/process.py",
"copies": "1",
"size": "34126",
"license": "mit",
"hash": -8758714027345050000,
"line_mean": 43.667539267,
"line_max": 173,
"alpha_frac": 0.5911035574,
"autogenerated": false,
"ratio": 3.5254132231404958,
"config_test": f... |
from .entailment.decomposable_attention import DecomposableAttention
from .memory_networks.differentiable_search import DifferentiableSearchMemoryNetwork
from .memory_networks.memory_network import MemoryNetwork
from .memory_networks.softmax_memory_network import SoftmaxMemoryNetwork
from .multiple_choice_qa.decomposab... | {
"repo_name": "RTHMaK/RPGOne",
"path": "deep_qa-master/deep_qa/models/__init__.py",
"copies": "1",
"size": "3009",
"license": "apache-2.0",
"hash": 7014145776011484000,
"line_mean": 63.0212765957,
"line_max": 106,
"alpha_frac": 0.8398138917,
"autogenerated": false,
"ratio": 3.99601593625498,
"c... |
from .entailment import concrete_models as entailment_models
from .multiple_choice_qa import concrete_models as multiple_choice_qa_models
from .sentence_selection import concrete_models as sentence_selection_models
from .sequence_tagging import concrete_models as sequence_tagging_models
from .reading_comprehension impo... | {
"repo_name": "matt-gardner/deep_qa",
"path": "deep_qa/models/__init__.py",
"copies": "1",
"size": "1052",
"license": "apache-2.0",
"hash": 4317968642943219000,
"line_mean": 49.0952380952,
"line_max": 82,
"alpha_frac": 0.7442965779,
"autogenerated": false,
"ratio": 4.093385214007782,
"config_te... |
from enthought.enable.api import BaseTool
from enthought.enable.tools.traits_tool import Fifo, get_nested_components
class ElementTool(BaseTool):
""" Tool to edit the traits of a HasTraits element referenced an Enable
component when double clicked. Handles containers and canvases so that they
get edited o... | {
"repo_name": "rwl/godot",
"path": "godot/tool/element_tool.py",
"copies": "1",
"size": "2231",
"license": "mit",
"hash": 946170852447709700,
"line_mean": 37.4655172414,
"line_max": 79,
"alpha_frac": 0.6127297176,
"autogenerated": false,
"ratio": 4.6968421052631575,
"config_test": false,
"has... |
from enthought.envisage.api import Plugin
from enthought.traits.api import List
from enthought.pyface.timer.api import do_after
from action_set import open_file
class HermesPlugin(Plugin):
ACTION_SETS = 'enthought.envisage.ui.workbench.action_sets'
PERSPECTIVES = 'enthought.envisage.ui.workbench.pe... | {
"repo_name": "certik/hermes-gui",
"path": "hermesgui/core/core_plugin.py",
"copies": "1",
"size": "1679",
"license": "bsd-3-clause",
"hash": 7669522627298776000,
"line_mean": 30.679245283,
"line_max": 76,
"alpha_frac": 0.6736152472,
"autogenerated": false,
"ratio": 3.665938864628821,
"config_t... |
from enthought.etsconfig.api import ETSConfig
from enthought.traits.api import (HasTraits, Instance, Range, Array,
on_trait_change, Property, cached_property, Bool, Tuple, Enum)
from enthought.traits.ui.api import View, Item, Group
from matplotlib.figure import Figure
from matplotlib.axes import Axes
from entho... | {
"repo_name": "certik/hermes-gui",
"path": "hermesgui/core/views/mpl_editor.py",
"copies": "1",
"size": "4233",
"license": "bsd-3-clause",
"hash": -7387822012516389000,
"line_mean": 31.3129770992,
"line_max": 103,
"alpha_frac": 0.5905976849,
"autogenerated": false,
"ratio": 4.027592768791627,
"... |
from enthought.mayavi.mlab import orientation_axes, plot3d, quiver3d, show
from numpy import array, cross, linspace, meshgrid
from scipy.constants.constants import mu_0, pi
def bfield():
x = linspace(0, 2*np.pi, 15)
rho = linspace(1, 2.5, 3)
rhogrid, phigrid = meshgrid(rho, phi)
x = rhogrid * np.cos(p... | {
"repo_name": "danielsjensen1/electrodynamics",
"path": "src/bfield/biotsavart.py",
"copies": "1",
"size": "1494",
"license": "bsd-3-clause",
"hash": 3469813874169696000,
"line_mean": 30.8085106383,
"line_max": 78,
"alpha_frac": 0.5696117805,
"autogenerated": false,
"ratio": 2.378980891719745,
... |
from enthought.mayavi.scripts import mayavi2
from enthought.tvtk.tools import mlab
from enthought.tvtk.api import tvtk
import scipy
import numpy
import thread
from enthought.mayavi.sources.vtk_data_source import VTKDataSource
from enthought.mayavi.filters.warp_scalar import WarpScalar
from enthought.mayavi.filters.filt... | {
"repo_name": "fabrice-lecuyer/QuantLib-SWIG",
"path": "Python/examples/visualization/plotspace.py",
"copies": "1",
"size": "2969",
"license": "bsd-3-clause",
"hash": 6480404994951126000,
"line_mean": 34.3452380952,
"line_max": 78,
"alpha_frac": 0.5823509599,
"autogenerated": false,
"ratio": 3.47... |
from enthought.traits.api import HasTraits, Interface, implements, Instance
from enthought.enable.api import BaseTool
from enthought.enable.tools.traits_tool import Fifo, get_nested_components
class IMenuItemTool(Interface):
menu_item = Instance(HasTraits)
class ContextMenuTool(BaseTool):
""" Takes all tool... | {
"repo_name": "rwl/godot",
"path": "godot/tool/context_menu_tool.py",
"copies": "1",
"size": "2036",
"license": "mit",
"hash": 729853803538544900,
"line_mean": 33.5084745763,
"line_max": 79,
"alpha_frac": 0.6178781925,
"autogenerated": false,
"ratio": 4.606334841628959,
"config_test": false,
... |
from enthought.traits.api import (HasTraits, Str, List, Int, Instance, BaseInt,
BaseFloat)
from enthought.traits.ui.api import View, Item
from utils import get_data_dir
import xml.etree.cElementTree as etree
class MyInt(BaseInt):
def validate(self, object, name, value):
if isinstance(value, str):
... | {
"repo_name": "certik/hermes-gui",
"path": "hermesgui/core/handle_agros.py",
"copies": "1",
"size": "2635",
"license": "bsd-3-clause",
"hash": -6708690512043464000,
"line_mean": 23.858490566,
"line_max": 79,
"alpha_frac": 0.5965844402,
"autogenerated": false,
"ratio": 3.7750716332378222,
"confi... |
from enthought.traits.api import *
from enthought.pyface.api import SplitApplicationWindow, GUI
from enthought.traits.ui.api import View, Item, ButtonEditor
class TextDisplay( HasTraits ):
string = String()
view= View( Item('string',show_label=False, springy=True, style='custom' ))
class Camera( HasTraits):... | {
"repo_name": "HPCGISLab/STDataViz",
"path": "WorkingVersion/LibTry/Traits/traits_tutorial/code_block2.py",
"copies": "1",
"size": "1086",
"license": "bsd-3-clause",
"hash": 5309944219390967000,
"line_mean": 28.3513513514,
"line_max": 79,
"alpha_frac": 0.6473296501,
"autogenerated": false,
"ratio... |
from enthought.traits.api import *
from enthought.traits.ui.api import View, Handler, Item
from threading import Thread
import wx
from time import sleep
class MyThread(Thread):
wants_abort = False
def run(self):
self.display('Started')
while not self.wants_abort:
self.display('Runn... | {
"repo_name": "HPCGISLab/STDataViz",
"path": "WorkingVersion/LibTry/Traits/traits_tutorial/crasher.py",
"copies": "1",
"size": "1430",
"license": "bsd-3-clause",
"hash": -2046081527287051000,
"line_mean": 27.6,
"line_max": 75,
"alpha_frac": 0.5902097902,
"autogenerated": false,
"ratio": 3.9612188... |
from entities.atom import Atom
from entities.hetatm import Hetatm
from entities.aminoacids import aminoacids
from numpy import matrix, dot, sqrt
from libraries.rotationMatrices import *
class PDB:
"""Please, take care of working with different models, I haven't checked it properly
For each entity in the PDB, t... | {
"repo_name": "julianah/cathAnalysis",
"path": "entities/pdb.py",
"copies": "1",
"size": "13534",
"license": "apache-2.0",
"hash": 5748955699768445000,
"line_mean": 43.3770491803,
"line_max": 166,
"alpha_frac": 0.5645780996,
"autogenerated": false,
"ratio": 4.237319974953037,
"config_test": fal... |
from entities.carrier import Carrier
from entities.drawable_entity import DrawableEntity
from entities.explorer import Explorer
from entities.mars_base import MarsBase
from entities.obstacle import Obstacle
from entities.rock import Rock
class World(DrawableEntity):
COLOR = '#804C1A'
def __init__(self, width... | {
"repo_name": "mihneadb/mars-explorer",
"path": "entities/world.py",
"copies": "1",
"size": "2346",
"license": "mit",
"hash": 1838099212335707000,
"line_mean": 29.0769230769,
"line_max": 56,
"alpha_frac": 0.6248934356,
"autogenerated": false,
"ratio": 3.890547263681592,
"config_test": false,
... |
from entities.entities import Device, User
from helper.device_helper import DeviceHelper
from my_stats_messages.my_stats_messages import *
import logging
class UserHelper():
def __init__(self):
logging.info("constructor calling.")
def link_device(self, user, device):
user.devices.append(devic... | {
"repo_name": "vinaymavi/my-stats-appengine-api",
"path": "helper/user_helper.py",
"copies": "1",
"size": "1804",
"license": "mit",
"hash": -1805295508085894000,
"line_mean": 33.0377358491,
"line_max": 87,
"alpha_frac": 0.5881374723,
"autogenerated": false,
"ratio": 3.5652173913043477,
"config_... |
from .entities import (DataClassDefaultListStr, DataClassDefaultOptionalList, DataClassList, DataClassOptional,
DataClassWithNestedOptional, DataClassWithNestedOptionalAny, DataClassWithNestedAny)
from .test_letter_case import CamelCasePerson, KebabCasePerson, SnakeCasePerson, FieldNamePerson
te... | {
"repo_name": "lidatong/dataclasses-json",
"path": "tests/test_schema.py",
"copies": "1",
"size": "1618",
"license": "mit",
"hash": 3457467574819069400,
"line_mean": 37.5238095238,
"line_max": 111,
"alpha_frac": 0.6705809642,
"autogenerated": false,
"ratio": 3.7627906976744185,
"config_test": t... |
from Entities import Entity, Bomb, iround
import pygame
from Img import img2, imgstrip
from random import randint
class Player(Entity):
orect = pygame.Rect(10, 2, 12, 28)
enemy = False
bombs = 1
rng = 2
pen = False
dy = 1
iconv = {(0, -1): img2("Men/Man2u"), (0, 1): img2("Men/Man2"), (1, 0... | {
"repo_name": "NoNotCar/BombAdventures",
"path": "BattlePlayers.py",
"copies": "1",
"size": "3173",
"license": "mit",
"hash": -5408890574456640000,
"line_mean": 28.1100917431,
"line_max": 108,
"alpha_frac": 0.48881185,
"autogenerated": false,
"ratio": 2.996222851746931,
"config_test": false,
... |
from entities import *
from components import featureBroker
from components.properties import property
from sqlalchemy import inspect
import app
class CommandInterface(object):
def __init__(self, *args, **kwargs):
if 'entity' in kwargs:
self._entity = kwargs['entity']
if self._entit... | {
"repo_name": "JaronrH/RF",
"path": "RF/components/entityInterfaces.py",
"copies": "1",
"size": "11904",
"license": "mit",
"hash": 4862283841705341000,
"line_mean": 35.0757575758,
"line_max": 128,
"alpha_frac": 0.5290658602,
"autogenerated": false,
"ratio": 4.536585365853658,
"config_test": fal... |
from .entities import *
from .formats import *
class FormatSparseNVMV3(FormatSparsePro):
def __init__(self, path_to_nvm_file):
self.file_path_nvm = path_to_nvm_file
self.length_meta_data_camera = 0
self.length_max_file_path = 0x26
self.length_meta_data_spoints = 0
self.init... | {
"repo_name": "vrsys/lamure",
"path": "pypro/pypro/formats_bridge.py",
"copies": "2",
"size": "7124",
"license": "bsd-3-clause",
"hash": 7163151979885554000,
"line_mean": 39.4772727273,
"line_max": 129,
"alpha_frac": 0.5189500281,
"autogenerated": false,
"ratio": 3.9185918591859186,
"config_tes... |
from Entities import *
import FX
import Img
import Object
missile=Img.sndget("Expmiss")
laugh=Img.sndget("bosslaugh")
tp=Img.sndget("teleport")
def bombattack(world,ssize):
while True:
tx=randint(9-ssize,9+ssize)
ty=randint(9-ssize,9+ssize)
if world.is_clear(tx,ty):
bomb=Bomb(tx,... | {
"repo_name": "NoNotCar/BombAdventures",
"path": "Bosses.py",
"copies": "1",
"size": "13658",
"license": "mit",
"hash": -4644071056650174000,
"line_mean": 33.7557251908,
"line_max": 121,
"alpha_frac": 0.4685166203,
"autogenerated": false,
"ratio": 3.3166585721223893,
"config_test": false,
"ha... |
from entities import *
class Account(Entity):
id = IntegerField(group=PRIMARY) # this field is in primary key group
iban = IntegerField(group=SECONDARY) # this is in secondary key group
balance = FloatField(default=0.0)
class Name(Entity):
first_name = StringField(group=SECONDARY)
last_name = ... | {
"repo_name": "eseraygun/python-entities",
"path": "examples/basicusage.py",
"copies": "1",
"size": "1373",
"license": "bsd-3-clause",
"hash": -6825300575284950000,
"line_mean": 27.0204081633,
"line_max": 75,
"alpha_frac": 0.7057538237,
"autogenerated": false,
"ratio": 3.3734643734643734,
"conf... |
from .entities import Scene
class GetScenesFromExperienceInteractor:
def __init__(self, scene_repo, permissions_validator):
self.scene_repo = scene_repo
self.permissions_validator = permissions_validator
def set_params(self, experience_id, logged_person_id):
self.experience_id = expe... | {
"repo_name": "jordifierro/abidria-api",
"path": "scenes/interactors.py",
"copies": "1",
"size": "4108",
"license": "mit",
"hash": 174877943648564260,
"line_mean": 41.7916666667,
"line_max": 112,
"alpha_frac": 0.6718597858,
"autogenerated": false,
"ratio": 4.108,
"config_test": false,
"has_no... |
from entities import UserDirector, UIDirector, TrackingDirector, ColorTrackingDirector
from entities import StabilityDirector
from iomanager import IOManager
from representation.controllers import GenericMotionController, GENERIC_TYPES
from representation.custom_controllers import LocalVideoController, KinectController... | {
"repo_name": "asmateus/flight-stone",
"path": "test/general_testbed.py",
"copies": "1",
"size": "11470",
"license": "mit",
"hash": 4360858390394405000,
"line_mean": 30.3387978142,
"line_max": 98,
"alpha_frac": 0.7264167393,
"autogenerated": false,
"ratio": 4.4909945184025055,
"config_test": tr... |
from entities.models import Entity, EntityNote
from auth.models import YankUser
from django.http import HttpResponse
from django.views.decorators.csrf import csrf_exempt
from django.views.generic import View
from django.core.exceptions import ObjectDoesNotExist
from yank_server.helpers import screen_methods, screen... | {
"repo_name": "yank-team/yank-server",
"path": "entities/views.py",
"copies": "1",
"size": "5547",
"license": "apache-2.0",
"hash": 6401043063866519000,
"line_mean": 31.063583815,
"line_max": 83,
"alpha_frac": 0.583738958,
"autogenerated": false,
"ratio": 4.227896341463414,
"config_test": false... |
from entities.pdb import PDB
from masks.MMULT import MMULT
import libraries.OScommands
import os
def getResidues(minimumPercentage, resultsFileName, alnFileName, workingDirectory='.', onlyBackBone=False, onlyAlphaCarbon=False, writeComments = False):
"""for each pdb in the multiple structure alignment file
... | {
"repo_name": "julianah/cathAnalysis",
"path": "masks/generateMultipleAlignment.py",
"copies": "1",
"size": "7879",
"license": "apache-2.0",
"hash": 7863503067408982000,
"line_mean": 40.4736842105,
"line_max": 159,
"alpha_frac": 0.6048990989,
"autogenerated": false,
"ratio": 4.17762460233298,
"... |
from ..entity.bullet import Bullet
from ..ellipse import Ellipse
class Shootable:
def __init__(self, interval):
self.bullets = []
self.interval = interval
self._shoot_timer = 0
def shoot(self, pos, direction, canvas):
"""
Shoots a bullet
:param pos: Initial posi... | {
"repo_name": "RSteyn/Potatoes",
"path": "potatoes/attributes/shootable.py",
"copies": "1",
"size": "1561",
"license": "mit",
"hash": -866233241052842500,
"line_mean": 32.9347826087,
"line_max": 63,
"alpha_frac": 0.5419602819,
"autogenerated": false,
"ratio": 3.883084577114428,
"config_test": f... |
from entity_gen.outputter import *
class AndroidGenerator(object):
head = []
buf = []
tail = []
gson = []
name = None
def __init__(self, package, dest_dir):
self.package = package
self.dest_dir = dest_dir
def startEntity(self, name):
self.name = name
self.h... | {
"repo_name": "kaoru2010/android-startup-project",
"path": "tools/entity_gen/generator.py",
"copies": "1",
"size": "4146",
"license": "apache-2.0",
"hash": -6299988368121630000,
"line_mean": 29.0434782609,
"line_max": 103,
"alpha_frac": 0.4141341052,
"autogenerated": false,
"ratio": 3.84244670991... |
from entity import being
from entity import entity
class Line(entity):
def __init__(self):
self.parent=False
self.children=[]
self.feats={}
self.featpaths={}
self.finished = False
self.__parses={}
self.__bestparse={}
def parse(self,meter=None):
if not meter:
from Meter import Meter,genDefault
... | {
"repo_name": "quadrismegistus/litlab-poetry",
"path": "prosodic/lib/Line.py",
"copies": "1",
"size": "3277",
"license": "mit",
"hash": -301892679303725760,
"line_mean": 20.8533333333,
"line_max": 194,
"alpha_frac": 0.6307598413,
"autogenerated": false,
"ratio": 2.822566752799311,
"config_test"... |
from .entity import CatalogEntity
from .repository.constants import CATEGORY_FILTER
from .repository.category_repo import get_category_repo
from .repository.dataset_repo import get_dataset_repo
from .repository.geography_repo import get_geography_repo
class Category(CatalogEntity):
"""This class represents a :py:... | {
"repo_name": "CartoDB/cartoframes",
"path": "cartoframes/data/observatory/catalog/category.py",
"copies": "1",
"size": "4237",
"license": "bsd-3-clause",
"hash": -8624645178091663000,
"line_mean": 39.7403846154,
"line_max": 114,
"alpha_frac": 0.6436157659,
"autogenerated": false,
"ratio": 4.3680... |
from .entity import CatalogEntity
from .repository.dataset_repo import get_dataset_repo
from .repository.geography_repo import get_geography_repo, GEOGRAPHY_TYPE
from .repository.constants import GEOGRAPHY_FILTER
from . import subscription_info
from . import subscriptions
from . import utils
from ....utils.utils import... | {
"repo_name": "CartoDB/cartoframes",
"path": "cartoframes/data/observatory/catalog/geography.py",
"copies": "1",
"size": "13799",
"license": "bsd-3-clause",
"hash": -4411826728759079000,
"line_mean": 42.393081761,
"line_max": 120,
"alpha_frac": 0.665410537,
"autogenerated": false,
"ratio": 4.4398... |
from .entity import CatalogEntity
from .repository.geography_repo import get_geography_repo
from .repository.country_repo import get_country_repo
from .repository.dataset_repo import get_dataset_repo
from .repository.category_repo import get_category_repo
from .repository.constants import COUNTRY_FILTER
class Country... | {
"repo_name": "CartoDB/cartoframes",
"path": "cartoframes/data/observatory/catalog/country.py",
"copies": "1",
"size": "5268",
"license": "bsd-3-clause",
"hash": 2881856594801918000,
"line_mean": 40.15625,
"line_max": 114,
"alpha_frac": 0.6383826879,
"autogenerated": false,
"ratio": 4.22453889334... |
from .entity import CatalogEntity
from .repository.provider_repo import get_provider_repo
from .repository.dataset_repo import get_dataset_repo
from .repository.constants import PROVIDER_FILTER
class Provider(CatalogEntity):
"""This class represents a :py:class:`Provider <cartoframes.data.observatory.Provider>`
... | {
"repo_name": "CartoDB/cartoframes",
"path": "cartoframes/data/observatory/catalog/provider.py",
"copies": "1",
"size": "1759",
"license": "bsd-3-clause",
"hash": 1605263286683373300,
"line_mean": 33.4901960784,
"line_max": 112,
"alpha_frac": 0.6571915861,
"autogenerated": false,
"ratio": 4.31127... |
from entity import Entity, EntityFactory
from unique_id import UniqueId
from value import Value
class DireccionValueObject(Value):
def __init__(self, value):
super().__init__(value)
self._direccion = value
def __str__(self):
return str(self._direccion)
@property
def direccio... | {
"repo_name": "devgranaja/DDD",
"path": "main.py",
"copies": "1",
"size": "2003",
"license": "mit",
"hash": -6268217966963322000,
"line_mean": 23.7283950617,
"line_max": 83,
"alpha_frac": 0.6105841238,
"autogenerated": false,
"ratio": 3.5831842576028623,
"config_test": false,
"has_no_keywords... |
from .entity import Entity
from ..attributes import Movable, Renderable, Shootable, Killable
from ..attributes.collidable import Collidable
from ..vector import Vector
from ..values import GAME_WIDTH, GAME_HEIGHT
import math
class Player(Entity, Movable, Renderable, Shootable, Killable, Collidable):
MOVE_VELOCITY... | {
"repo_name": "RSteyn/Potatoes",
"path": "potatoes/entity/player.py",
"copies": "1",
"size": "4496",
"license": "mit",
"hash": 528159905986663600,
"line_mean": 37.4358974359,
"line_max": 79,
"alpha_frac": 0.5489323843,
"autogenerated": false,
"ratio": 3.5767700875099444,
"config_test": false,
... |
from Entity import Entity
from Component import *
from Missile import Missile
from ClientAPI import writable
@writable('name')
class Ship(Entity):
def __init__(self, config, universe):
super().__init__(config, universe)
self.__dict__.update(config)
self.energy = self.maxEnergy
# How much power Engin... | {
"repo_name": "cnlohr/bridgesim",
"path": "src/server/Ship.py",
"copies": "1",
"size": "1965",
"license": "mit",
"hash": -4673880389979774000,
"line_mean": 29.2307692308,
"line_max": 134,
"alpha_frac": 0.648346056,
"autogenerated": false,
"ratio": 3.6524163568773234,
"config_test": false,
"ha... |
from .entity import Entity
from .enemy_type import EnemyType
from .vector import Vector
from .event import Event, EventType
from .util import *
import random
class Enemy(Entity):
def __init__(self, game, enemy_type=EnemyType.DEFAULT):
super().__init__()
self.game = game
self.pos = Vector(0... | {
"repo_name": "SuddenDevs/SuddenDev",
"path": "suddendev/game/enemy.py",
"copies": "1",
"size": "3215",
"license": "mit",
"hash": 3902397239124561400,
"line_mean": 31.4747474747,
"line_max": 77,
"alpha_frac": 0.6052877138,
"autogenerated": false,
"ratio": 3.540748898678414,
"config_test": false... |
from .entity import Entity
from .vector import Vector
from .pickup import PickupType
from .sandbox import builtins
from .color import Color3
from .event import Event, EventType
from .util import *
from .path import Path
from .game_config import GameConfig as gc
from .enemy_type import EnemyType
from functools import p... | {
"repo_name": "SuddenDevs/SuddenDev",
"path": "suddendev/game/player.py",
"copies": "1",
"size": "7516",
"license": "mit",
"hash": 9077972358153690000,
"line_mean": 33.9581395349,
"line_max": 85,
"alpha_frac": 0.5928685471,
"autogenerated": false,
"ratio": 3.7997977755308394,
"config_test": fal... |
from Entity import Entity
import physics
class Missile(Entity):
def __init__(self, config, universe):
super().__init__(config, universe)
self.__dict__.update(config)
print("New Missile")
def fire(self, tube):
print("Starting to fire missile")
self.location = tube.ship.location + ((tube.pos... | {
"repo_name": "cnlohr/bridgesim",
"path": "src/server/Missile.py",
"copies": "1",
"size": "1215",
"license": "mit",
"hash": -8399511377228152000,
"line_mean": 30.9736842105,
"line_max": 121,
"alpha_frac": 0.6641975309,
"autogenerated": false,
"ratio": 3.4615384615384617,
"config_test": false,
... |
from entity import Entity
import pygame
PLAYER_W = 64
PLAYER_H = 64
PLAYER_IMG = pygame.image.load("../assets/circle_sheet.png")
PLAYER_SEQ = (4, 2, 0, 0, PLAYER_W, PLAYER_H)
PLAYER_INERTIA = 0.95
SPEED_APPLICATION = 0.1
PLAYER_MIN_X = 0.0
PLAYER_MIN_Y = 0.0
PLAYER_MAX_X = float(500.0 - PLAYER_W)
PLAYER_MAX_Y = float... | {
"repo_name": "Ohjel/wood-process",
"path": "jump/player.py",
"copies": "1",
"size": "1570",
"license": "mit",
"hash": 8625309172811987000,
"line_mean": 28.0740740741,
"line_max": 60,
"alpha_frac": 0.5617834395,
"autogenerated": false,
"ratio": 2.8186714542190305,
"config_test": false,
"has_n... |
from entity import Entity
import task
class Section(task.Task):
_matchon = None
@classmethod
def _filter_result_item(cls, entity, query):
return Entity._filter_result_item(entity, query)
@classmethod
def _get_api_endpoint(cls):
"""Point to tasks"""
return task.Task._get_api_endpoint()
@classmethod
def ... | {
"repo_name": "mburgs/asanorm",
"path": "asana/entities/section.py",
"copies": "1",
"size": "1264",
"license": "apache-2.0",
"hash": 8792410484375566000,
"line_mean": 23.3269230769,
"line_max": 94,
"alpha_frac": 0.6867088608,
"autogenerated": false,
"ratio": 3.407008086253369,
"config_test": fa... |
from entity import Entity
class RelativeEntity(Entity):
def __init__(self, width, height):
Entity.__init__(self, width, height)
self.margin = [0, 0, 0, 0]
def below(self, entity):
self.y = entity.y + entity.height + self.margin[1]
def above(self, entity):
self.y = entity.y - self.height - self... | {
"repo_name": "m4nolo/steering-all",
"path": "src/entities/relativeentity.py",
"copies": "2",
"size": "1279",
"license": "mit",
"hash": -8583138722605353000,
"line_mean": 22.2545454545,
"line_max": 63,
"alpha_frac": 0.6356528538,
"autogenerated": false,
"ratio": 3.1502463054187193,
"config_test... |
from entity import Entity
class Contact(Entity):
"""
Represents a contact object.
"""
email = None
attributes = None
first_name = None
last_name = None
lists = None
url = None
active = None
updated = None
created = None
@staticmethod
def hash_in_contacts_lists(... | {
"repo_name": "getanewsletter/api-python",
"path": "ganapi/contact.py",
"copies": "1",
"size": "1941",
"license": "mit",
"hash": -872128744324108700,
"line_mean": 26.338028169,
"line_max": 85,
"alpha_frac": 0.5754765585,
"autogenerated": false,
"ratio": 4.165236051502146,
"config_test": false,
... |
from entity import Entity
def normalize_rect(rect):
x1, y1, x2, y2 = rect
if x1 > x2:
x1, x2 = x2, x1
if y1 > y2:
y1, y2 = y2, y1
return (x1, y1, x2, y2)
class Node(Entity):
def __init__(self, entity, rect):
self.entity = entity
self.rect = rect
class QuadTr... | {
"repo_name": "benjamincongdon/adept",
"path": "quadtree.py",
"copies": "1",
"size": "5198",
"license": "mit",
"hash": 89821174681927140,
"line_mean": 39.937007874,
"line_max": 93,
"alpha_frac": 0.4744132359,
"autogenerated": false,
"ratio": 4.165064102564102,
"config_test": false,
"has_no_ke... |
from .entity import is_slug_value
from .country import Country
from .category import Category
from .provider import Provider
from .dataset import Dataset
from .geography import Geography
from .subscriptions import Subscriptions
from .repository.constants import (COUNTRY_FILTER, CATEGORY_FILTER, GEOGRAPHY_FILTER, GLOBAL... | {
"repo_name": "CartoDB/cartoframes",
"path": "cartoframes/data/observatory/catalog/catalog.py",
"copies": "1",
"size": "11865",
"license": "bsd-3-clause",
"hash": -2940945038050752000,
"line_mean": 38.0296052632,
"line_max": 120,
"alpha_frac": 0.6601769912,
"autogenerated": false,
"ratio": 4.3493... |
from .entity import *
class EntityTypes(dict):
'''all Entity classes'''
def __init__(self):
for cls in IN.register.get_sub_classes_yield(Entity):
self[cls.__type__] = cls
super().__init__()
def __missing__(self, type):
cls = IN.register.get_class(type, 'Entity')
if cls is None:
cls = Entit... | {
"repo_name": "vinoth3v/In",
"path": "In/entity/entitier.py",
"copies": "1",
"size": "12324",
"license": "apache-2.0",
"hash": 3520222623437956600,
"line_mean": 23.0703125,
"line_max": 101,
"alpha_frac": 0.6435410581,
"autogenerated": false,
"ratio": 3.2655007949125596,
"config_test": true,
"... |
from entity import *
class Artist(Entity):
"""
wraps the artist entity type as described at http://developer.musicmetric.com/timeseries.html
all timeseries are attributes of the form self.<type>_<source>, which sets a dict if there's data
"""
summary_attrs = ("name", "id", "description", "previous... | {
"repo_name": "musicmetric/mmpy",
"path": "src/artist.py",
"copies": "1",
"size": "2350",
"license": "isc",
"hash": 2646211928176691000,
"line_mean": 38.8305084746,
"line_max": 101,
"alpha_frac": 0.570212766,
"autogenerated": false,
"ratio": 4.536679536679537,
"config_test": false,
"has_no_ke... |
from .entity import Position, Entity
def intersect_segment_circle(start, end, circle, *, fudge=0.5):
"""
Test whether a line segment and circle intersect.
:param Entity start: The start of the line segment. (Needs x, y attributes)
:param Entity end: The end of the line segment. (Needs x, y attributes)... | {
"repo_name": "HaliteChallenge/Halite-II",
"path": "airesources/ML-StarterBot-Python/hlt/collision.py",
"copies": "2",
"size": "1566",
"license": "mit",
"hash": 5309332150306978000,
"line_mean": 38.15,
"line_max": 88,
"alpha_frac": 0.6353767561,
"autogenerated": false,
"ratio": 3.4192139737991267... |
from .entity import WikidataEntity
from .search import WikidataSearch
from .query import WikidataQuery
from .linkshere import WikidataLinkshere
Q_METHODS = ["entity", "search", "query", "labels", "linkshere"]
methods = Q_METHODS + ["random"]
arguments = {
"q" : {
"required" : Q_METHODS,
"type" : st... | {
"repo_name": "hay/chantek",
"path": "commands/wikidata/command.py",
"copies": "1",
"size": "1257",
"license": "mit",
"hash": 4373548359766103600,
"line_mean": 28.9523809524,
"line_max": 101,
"alpha_frac": 0.6117740652,
"autogenerated": false,
"ratio": 3.5811965811965814,
"config_test": false,
... |
from .entity import WikidataEntity
import util, json
API_ENDPOINT = "https://www.wikidata.org/w/api.php";
class WikidataLinkshere:
def __init__(self, params):
self.params = params
def _linkshere(self, q):
r = util.apirequest(API_ENDPOINT, {
"action" : "query",
"pr... | {
"repo_name": "hay/chantek",
"path": "commands/wikidata/linkshere.py",
"copies": "1",
"size": "1225",
"license": "mit",
"hash": -4454948634613280300,
"line_mean": 25.652173913,
"line_max": 80,
"alpha_frac": 0.4865306122,
"autogenerated": false,
"ratio": 4.016393442622951,
"config_test": false,
... |
from entity_matching_tool.models import User, Job, Entity, MatchedEntities
from entity_matching_tool import db
if __name__ == "__main__":
db.create_all()
admin = User('admin')
admin.save()
job = Job(name='job1',
source1='entity_matching_tool/csv_files/company_info.csv',
sour... | {
"repo_name": "testlnord/entity_matching_tool",
"path": "add_mock_data.py",
"copies": "1",
"size": "2365",
"license": "mit",
"hash": 3274943415585667000,
"line_mean": 39.775862069,
"line_max": 118,
"alpha_frac": 0.5133192389,
"autogenerated": false,
"ratio": 3.4576023391812867,
"config_test": f... |
from entity.queueEntity.Decide import Decide
from entity.queueEntity.Process import Process
from entity.queueEntity.Dispose import Dispose
from entity.queueEntity.ServiceCenter import ServiceCenter
from entity.queueEntity.MyQueue import MyQueue
from PriorityQueue import PriorityQueue
#from chartDrawing import *
from en... | {
"repo_name": "mrhsce/simPython",
"path": "SimSystem.py",
"copies": "1",
"size": "4527",
"license": "apache-2.0",
"hash": 3261290324081256400,
"line_mean": 36.1147540984,
"line_max": 124,
"alpha_frac": 0.6615860393,
"autogenerated": false,
"ratio": 4.085740072202166,
"config_test": false,
"ha... |
from EntityTypeDesc import EntityTypeDesc
from toontown.coghq.SpecImports import *
class Entity(EntityTypeDesc):
abstract = 1
type = 'entity'
attribs = (('type', None, 'const'),
('name', '<unnamed>', 'string'),
('comment', '', 'string'),
('parentEntId', 0, 'entId'))
class LevelMgr(Entity):... | {
"repo_name": "ksmit799/Toontown-Source",
"path": "otp/level/EntityTypes.py",
"copies": "6",
"size": "4092",
"license": "mit",
"hash": 1217048827912684500,
"line_mean": 22.25,
"line_max": 109,
"alpha_frac": 0.4987781036,
"autogenerated": false,
"ratio": 3.40432612312812,
"config_test": false,
... |
from .EntityUtil import Cleaner, ALL
from .Rule import Rule
class RuleSet():
def __init__(self, selector, values, comment, styleSheet):
self.extra = False
self.roughSelector = selector
self.roughValue = values
self.roughComment = comment
self.selector = Cleaner.clearSelecto... | {
"repo_name": "wangjeaf/CSSCheckStyle",
"path": "ckstyle/entity/RuleSet.py",
"copies": "1",
"size": "5877",
"license": "bsd-3-clause",
"hash": -7839918093308182000,
"line_mean": 31.1147540984,
"line_max": 92,
"alpha_frac": 0.5346265101,
"autogenerated": false,
"ratio": 4.395661929693343,
"confi... |
from .EntityUtil import Cleaner, ALL
from .RuleSet import RuleSet
class ExtraStatement(RuleSet):
def __init__(self, operator, statement, comment, styleSheet = None):
self.extra = True
self.nested = False
self.selector = self.operator = operator.strip()
self.comment = comment
... | {
"repo_name": "wangjeaf/CSSCheckStyle",
"path": "ckstyle/entity/ExtraStatement.py",
"copies": "1",
"size": "1320",
"license": "bsd-3-clause",
"hash": 5999269905349240000,
"line_mean": 28.3333333333,
"line_max": 113,
"alpha_frac": 0.5818181818,
"autogenerated": false,
"ratio": 4.16403785488959,
... |
from .EntityUtil import Cleaner, ALL
class NestedStatement():
def __init__(self, selector, statement, comments, styleSheet = None):
self.extra = True
self.nested = True
self.selector = selector.strip()
self.statement = statement.strip()
self.roughStatement = statement
... | {
"repo_name": "wangjeaf/CSSCheckStyle",
"path": "ckstyle/entity/NestedStatement.py",
"copies": "1",
"size": "1068",
"license": "bsd-3-clause",
"hash": 1901737554548309500,
"line_mean": 29.5142857143,
"line_max": 103,
"alpha_frac": 0.5880149813,
"autogenerated": false,
"ratio": 4.254980079681275,
... |
from .EntityUtil import Cleaner, ALL
class Rule():
def __init__(self, selector, name, value, ruleSet):
self.roughName = name
self.roughValue = value
self.roughSelector = selector
self.name = Cleaner.clearName(name)
self.value = Cleaner.clearValue(value)
self.selecto... | {
"repo_name": "wangjeaf/CSSCheckStyle",
"path": "ckstyle/entity/Rule.py",
"copies": "1",
"size": "1785",
"license": "bsd-3-clause",
"hash": -4957169199154234000,
"line_mean": 34.7,
"line_max": 132,
"alpha_frac": 0.6140056022,
"autogenerated": false,
"ratio": 3.822269807280514,
"config_test": fa... |
from ..entityxml.JournalXml import JournalXml
class Journal:
def __init__(self, operation, journal_items=None):
self.operation = operation
self.journal_xml = JournalXml(self.operation)
self.uid = ""
self.last_update_uid = ""
self.date = ""
self.tags = ""
s... | {
"repo_name": "bkawan/journal-automation",
"path": "saasuweb/journalprocess/entity/Journal.py",
"copies": "1",
"size": "1925",
"license": "mit",
"hash": 3307741502872503000,
"line_mean": 27.3088235294,
"line_max": 68,
"alpha_frac": 0.5745454545,
"autogenerated": false,
"ratio": 3.827037773359841,... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.