text
stringlengths
0
1.05M
meta
dict
from ..encoding.hexbytes import bytes_as_hex from ..intbytes import indexbytes, int2byte def make_const_handler(data): """ Create a handler for a data opcode that returns a constant. """ data = bytes_as_hex(data) def constant_data_opcode_handler(script, pc, verify_minimal_data=False): ret...
{ "repo_name": "richardkiss/pycoin", "path": "pycoin/vm/ScriptStreamer.py", "copies": "1", "size": "6641", "license": "mit", "hash": 9205494576116234000, "line_mean": 39.7423312883, "line_max": 104, "alpha_frac": 0.6368016865, "autogenerated": false, "ratio": 3.9203069657615113, "config_test": f...
from .encoding import decode as unpack from .enumerations import * def unscramble_elites(field): return {ability for ability in EliteAbility if ability.value & field} def decode_obj_update_packet(packet): entries = [] while packet: update_type = packet[0] obj = {} if ...
{ "repo_name": "prophile/libdiana", "path": "diana/object_update.py", "copies": "1", "size": "22384", "license": "mit", "hash": -2433039928046309400, "line_mean": 41.5551330798, "line_max": 118, "alpha_frac": 0.4404932094, "autogenerated": false, "ratio": 3.931155602388479, "config_test": false,...
from .encoding import Instruction from . import effects class VirtualInstruction(Instruction): """ Virtual instruction. Virtual instructions are instructions used during code generation and can never be encoded into a stream. """ def encode(self): # pragma: no cover raise RuntimeError("...
{ "repo_name": "windelbouwman/ppci-mirror", "path": "ppci/arch/generic_instructions.py", "copies": "1", "size": "4851", "license": "bsd-2-clause", "hash": 1153243998200950300, "line_mean": 23.0148514851, "line_max": 78, "alpha_frac": 0.602556174, "autogenerated": false, "ratio": 4.296722763507529,...
from ..encoding import Register from ..registers import RegisterClass from ... import ir class Stm8Register(Register): pass class Stm88BitRegister(Stm8Register): bitsize = 8 class Stm816BitRegister(Stm8Register): bitsize = 16 class Stm824BitRegister(Stm8Register): bitsize = 24 class Stm8Accumu...
{ "repo_name": "windelbouwman/ppci-mirror", "path": "ppci/arch/stm8/registers.py", "copies": "1", "size": "3924", "license": "bsd-2-clause", "hash": 6707546129091604000, "line_mean": 19.7619047619, "line_max": 79, "alpha_frac": 0.7240061162, "autogenerated": false, "ratio": 2.6125166444740344, "...
from ..encoding import wif_to_secret_exponent from ..convention import tx_fee from .Spendable import Spendable from .Tx import Tx from .TxOut import TxOut, standard_tx_out_script from .pay_to import build_hash160_lookup from ..networks import wif_prefix_for_netcode class SecretExponentMissing(Exception): pass c...
{ "repo_name": "Magicking/pycoin", "path": "pycoin/tx/tx_utils.py", "copies": "1", "size": "8219", "license": "mit", "hash": 2898619789784698400, "line_mean": 38.7053140097, "line_max": 118, "alpha_frac": 0.6725879061, "autogenerated": false, "ratio": 3.5184075342465753, "config_test": false, ...
from ..encoding.sec import is_sec, public_pair_to_hash160_sec, sec_to_public_pair, EncodingError from pycoin.coins.SolutionChecker import ScriptError from pycoin.satoshi.checksigops import parse_signature_blob from pycoin.satoshi.der import UnexpectedDER class WhoSigned(object): def __init__(self, script_tools, ...
{ "repo_name": "richardkiss/pycoin", "path": "pycoin/contrib/who_signed.py", "copies": "1", "size": "4458", "license": "mit", "hash": 4683479858960939000, "line_mean": 43.58, "line_max": 107, "alpha_frac": 0.620906236, "autogenerated": false, "ratio": 3.73993288590604, "config_test": false, "h...
from ..encoding.sec import sec_to_public_pair, EncodingError from ..intbytes import byte2int, indexbytes, iterbytes from . import der from . import errno from .flags import ( SIGHASH_ALL, SIGHASH_SINGLE, SIGHASH_ANYONECANPAY, VERIFY_NULLDUMMY, VERIFY_NULLFAIL, VERIFY_STRICTENC, VERIFY_DERSIG, VERIFY_LOW_S...
{ "repo_name": "richardkiss/pycoin", "path": "pycoin/satoshi/checksigops.py", "copies": "1", "size": "8546", "license": "mit", "hash": 534652684841143550, "line_mean": 35.5213675214, "line_max": 107, "alpha_frac": 0.6625321788, "autogenerated": false, "ratio": 3.4418042690294, "config_test": fal...
from encodings import codecs import io import os import re from setuptools import setup here = os.path.dirname(__file__) def read(*names, **kwargs): with io.open(os.path.join(here, *names), encoding=kwargs.get("encoding", "utf8")) as f: return f.read() def find_version(*file_paths): ...
{ "repo_name": "gaujin/tornado-crontab", "path": "setup.py", "copies": "1", "size": "1658", "license": "mit", "hash": 7543956136896492000, "line_mean": 29.7037037037, "line_max": 73, "alpha_frac": 0.6121833534, "autogenerated": false, "ratio": 3.8648018648018647, "config_test": false, "has_no_...
from encodings import idna from prer import PreR class IdnQname(PreR): """Shows the count of the internationalized domain name queries received in a window. - Result A dict that has two entries: 'normal' (which has the count of normal domain names) and 'idn' (which has the count of international...
{ "repo_name": "niclabs/ratadns-filters", "path": "prers/idn_qname.py", "copies": "1", "size": "1182", "license": "mit", "hash": 5404831797892348000, "line_mean": 22.1764705882, "line_max": 76, "alpha_frac": 0.5507614213, "autogenerated": false, "ratio": 3.7523809523809524, "config_test": false,...
from encodings import idna import re import socket import struct import hashlib import synapse.compat as s_compat import synapse.lib.socket as s_socket import synapse.lib.urlhelp as s_urlhelp from synapse.lib.types import DataType def getDataModel(): return { 'prefix':'inet', 'version':2016112510...
{ "repo_name": "williballenthin/synapse", "path": "synapse/models/inet.py", "copies": "1", "size": "16802", "license": "apache-2.0", "hash": 1278688951371432700, "line_mean": 35.6855895197, "line_max": 188, "alpha_frac": 0.500654684, "autogenerated": false, "ratio": 3.3185858186845745, "config_t...
from encodings.utf_8 import decode from select import select from http import server client_list = [] messages = [] nicknames = {"TWILIGHT", "ADMIN", "ADMINISTRATOR", "АДМИН", "АДМИНИСТРАТОР", "АDMIN", "АDMINISТRAТОR", "AДМИН", "AДМИНИСТРATOP"} black_list = set() connected = set() mess_count = 0 log_file = o...
{ "repo_name": "FeDaniil/SIChat", "path": "Version 2.0 (Stable)/server.py", "copies": "2", "size": "8855", "license": "mit", "hash": -3807136477786038000, "line_mean": 46.6464088398, "line_max": 192, "alpha_frac": 0.4549687677, "autogenerated": false, "ratio": 3.7183277027027026, "config_test": ...
from EncryptionAES import encryption_oracle_ecb2 import base64 import string import random LETTERS = string.printable BASE_64 = 'Um9sbGluJyBpbiBteSA1LjAKV2l0aCBteSByYWctdG9wIGRvd24gc28gbXkgaGFpciBjYW4gYmxvdwpUaGUgZ2lybGllcyBvbiBzdGFuZGJ5IHdhdmluZyBqdXN0IHRvIHNheSBoaQpEaWQgeW91IHN0b3A/IE5vLCBJIGp1c3QgZHJvdmUgYnkK' PRE...
{ "repo_name": "arunKumarNOP/Cryptopals-Solutions", "path": "set2/AesEcbDecHarder.py", "copies": "1", "size": "1611", "license": "mit", "hash": 3892579854417031000, "line_mean": 34.8222222222, "line_max": 196, "alpha_frac": 0.6455617629, "autogenerated": false, "ratio": 2.897482014388489, "confi...
from EncryptionAES import encryption_oracle_ecb import base64 import string BASE_64 = 'Um9sbGluJyBpbiBteSA1LjAKV2l0aCBteSByYWctdG9wIGRvd24gc28gbXkgaGFpciBjYW4gYmxvdwpUaGUgZ2lybGllcyBvbiBzdGFuZGJ5IHdhdmluZyBqdXN0IHRvIHNheSBoaQpEaWQgeW91IHN0b3A/IE5vLCBJIGp1c3QgZHJvdmUgYnkK' LETTERS = string.printable def crack_ecb():...
{ "repo_name": "arunKumarNOP/Cryptopals-Solutions", "path": "set2/AesEcbDec.py", "copies": "1", "size": "1028", "license": "mit", "hash": 2960459615242955300, "line_mean": 31.15625, "line_max": 196, "alpha_frac": 0.6391050584, "autogenerated": false, "ratio": 2.7560321715817695, "config_test": f...
from encryption_algorithm import encryption_algorithm as sage def test_storing_and_retrieving_private_key(): ''' store key ''' private_key = sage.PrivateKey() private_key.new_private_key_pair() private_key.store_private_key('tests/test_private_key.txt') stored = [private_key.p, private_key.q] ...
{ "repo_name": "dblarons/encryption_algorithm", "path": "tests/test_encryption_algorithm.py", "copies": "1", "size": "1850", "license": "mit", "hash": -6118220048523004000, "line_mean": 37.5416666667, "line_max": 114, "alpha_frac": 0.6994594595, "autogenerated": false, "ratio": 3.2118055555555554,...
from encryption import decrypt def GetKeys(twitter_keys_path): consumer_key = '' consumer_secret = '' access_token = '' access_secret = '' PATH = 'twitter_keys/' l_files = ['consumer_key', 'consumer_secret', 'access_token', 'access_secret'] for k in l_files: f = open(PATH + k, 'rb...
{ "repo_name": "botchaos/Chaos", "path": "twitter_api/misc.py", "copies": "4", "size": "1525", "license": "mit", "hash": -900598478975785700, "line_mean": 35.3095238095, "line_max": 82, "alpha_frac": 0.513442623, "autogenerated": false, "ratio": 3.802992518703242, "config_test": false, "has_no...
from encryption import encrypt from decryption import decrypt #input user_str=input("Please enter a string:") code_choice=input("Do you want to Encode or Decode?") while code_choice not in ("encode", "Encode", "Encrypt", "encrypt", "decode", "Decode", "Decrypt", "decrypt"): print("Please tell me if you want to Enc...
{ "repo_name": "vbuchade/Spycraft", "path": "starter.py", "copies": "1", "size": "1269", "license": "mit", "hash": -7769790496278105000, "line_mean": 38.65625, "line_max": 110, "alpha_frac": 0.6729708432, "autogenerated": false, "ratio": 3.7767857142857144, "config_test": false, "has_no_keywor...
from endive.event import Event import datetime def test_same_event(): this = Event([1,2,3,4], datetime.datetime(2015, 3, 5, 0, 0)) same = Event([1,2,3,4], datetime.datetime(2015, 3, 5, 0, 0)) different_data = Event([5,6,7,8], datetime.datetime(2015, 3, 5, 0, 0)) different_date = Event([1,2,3,4], dateti...
{ "repo_name": "captainsafia/endive", "path": "tests/test_event.py", "copies": "1", "size": "1223", "license": "mit", "hash": -3463834969969335000, "line_mean": 44.2962962963, "line_max": 74, "alpha_frac": 0.6328699918, "autogenerated": false, "ratio": 2.785876993166287, "config_test": false, ...
from endless_pagination.settings import DEFAULT_CALLABLE_EXTREMES, DEFAULT_CALLABLE_AROUNDS from endless_pagination import exceptions def get_page_number_from_request(request, querystring_key, default=1): """ Get page number from *GET* or *POST* data. If the page does not exists in *request*, or is not a n...
{ "repo_name": "soad241/django-endless-pagination", "path": "endless_pagination/utils.py", "copies": "1", "size": "2706", "license": "mit", "hash": 3243418307012882400, "line_mean": 30.8352941176, "line_max": 91, "alpha_frac": 0.6400591279, "autogenerated": false, "ratio": 3.651821862348178, "co...
from endless_pagination.settings import (DEFAULT_CALLABLE_EXTREMES, DEFAULT_CALLABLE_AROUNDS, PAGE_LABEL) from endless_pagination import exceptions def get_page_number_from_request(request, querystring_key=PAGE_LABEL, default=1): """ Get page number from *GET* or *POST* data. If the page does not exis...
{ "repo_name": "inactivist/django-endless-pagination", "path": "endless_pagination/utils.py", "copies": "5", "size": "2814", "license": "mit", "hash": -7375637851618782000, "line_mean": 30.9772727273, "line_max": 81, "alpha_frac": 0.6289978678, "autogenerated": false, "ratio": 3.6784313725490194, ...
from endless_pagination.settings import PAGE_LABEL, TEMPLATE_VARNAME def page_template(template, key=PAGE_LABEL): """ Decorate a view that takes a *template* and *extra_context* keyword arguments (like generic views). The template is switched to *page_template* if request is ajax and if *querystrin...
{ "repo_name": "soad241/django-endless-pagination", "path": "endless_pagination/decorators.py", "copies": "1", "size": "2514", "license": "mit", "hash": -1925812052865543400, "line_mean": 43.1052631579, "line_max": 85, "alpha_frac": 0.6388225935, "autogenerated": false, "ratio": 4.395104895104895,...
from endless_pagination.views import AjaxListView from django.views.generic import ListView, DetailView from django.utils import timezone from .models import Post, Poem, Letter class PostListView(AjaxListView): model = Post queryset = Post.objects.all() context_object_name = "posts" def get_context_...
{ "repo_name": "stahlnow/paulhaller", "path": "website/apps/website/views.py", "copies": "1", "size": "1752", "license": "mit", "hash": 2533832351559921000, "line_mean": 26.375, "line_max": 74, "alpha_frac": 0.6678082192, "autogenerated": false, "ratio": 3.8761061946902653, "config_test": false,...
from .endpoint_configuration import EndpointConfiguration from ingenico.connect.sdk.defaultimpl.authorization_type import \ AuthorizationType # pylint: disable=too-many-instance-attributes # Necessary to load information from config class CommunicatorConfiguration(EndpointConfiguration): """ Configuration...
{ "repo_name": "Ingenico-ePayments/connect-sdk-python3", "path": "ingenico/connect/sdk/communicator_configuration.py", "copies": "1", "size": "3892", "license": "mit", "hash": 4665792077865222000, "line_mean": 38.7142857143, "line_max": 87, "alpha_frac": 0.6423432682, "autogenerated": false, "rati...
from .endpoint import EndpointBase, Endpoint class AuthenticatedMixin(object): token = None @staticmethod def set_token(token): AuthenticatedMixin.token = token def _get(self, path, **kwargs): token = kwargs.pop("token") if "token" in kwargs else self.token if token: ...
{ "repo_name": "hackedd/gw2api", "path": "gw2api/v2/account.py", "copies": "1", "size": "6201", "license": "mit", "hash": 8375621307747857000, "line_mean": 30.8, "line_max": 79, "alpha_frac": 0.6132881793, "autogenerated": false, "ratio": 3.3285024154589373, "config_test": false, "has_no_keywo...
from .endpoint import EndpointMixin, endpoint_setup from .gerrit_entity import GerritEntity, Timestamp, Self from .accounts import Account # gerrit-documentation.googlecode.com/svn/Documentation/2.7/rest-api-changes.html class Approval(Account): value = int class GitPerson(GerritEntity): name = unicode ...
{ "repo_name": "lann/gerritrestclient", "path": "gerritrestclient/changes.py", "copies": "1", "size": "2718", "license": "mit", "hash": 9202470055382615000, "line_mean": 19.5909090909, "line_max": 81, "alpha_frac": 0.6460632818, "autogenerated": false, "ratio": 3.9853372434017595, "config_test":...
from .endpoint import Endpoint from .exceptions import MissingRequiredFieldError from .fileuploads_endpoint import Fileuploads from .. import RequestFactory, DatasourceItem, PaginationItem, ConnectionItem import os import logging import copy import cgi from contextlib import closing # The maximum size of a file that c...
{ "repo_name": "Talvalin/server-client-python", "path": "tableauserverclient/server/endpoint/datasources_endpoint.py", "copies": "1", "size": "6780", "license": "mit", "hash": 8355018779099427000, "line_mean": 48.4890510949, "line_max": 112, "alpha_frac": 0.6317109145, "autogenerated": false, "rat...
from .endpoint import Endpoint from .exceptions import MissingRequiredFieldError from .fileuploads_endpoint import Fileuploads from .. import RequestFactory, WorkbookItem, ConnectionItem, ViewItem, PaginationItem from ...models.tag_item import TagItem import os import logging import copy import cgi from contextlib impo...
{ "repo_name": "Talvalin/server-client-python", "path": "tableauserverclient/server/endpoint/workbooks_endpoint.py", "copies": "1", "size": "9130", "license": "mit", "hash": -2560120484209998000, "line_mean": 48.0860215054, "line_max": 111, "alpha_frac": 0.6325301205, "autogenerated": false, "rati...
from .endpoint import Endpoint from .exceptions import MissingRequiredFieldError from .. import RequestFactory, PaginationItem, ScheduleItem import logging import copy logger = logging.getLogger('tableau.endpoint.schedules') class Schedules(Endpoint): @property def baseurl(self): return "{0}/schedule...
{ "repo_name": "Talvalin/server-client-python", "path": "tableauserverclient/server/endpoint/schedules_endpoint.py", "copies": "1", "size": "2308", "license": "mit", "hash": -7455994063809921000, "line_mean": 40.2142857143, "line_max": 80, "alpha_frac": 0.6724436742, "autogenerated": false, "ratio...
from .endpoint import Endpoint from .exceptions import MissingRequiredFieldError from .. import RequestFactory, ProjectItem, PaginationItem import logging import copy logger = logging.getLogger('tableau.endpoint.projects') class Projects(Endpoint): @property def baseurl(self): return "{0}/sites/{1}/p...
{ "repo_name": "Talvalin/server-client-python", "path": "tableauserverclient/server/endpoint/projects_endpoint.py", "copies": "1", "size": "2016", "license": "mit", "hash": 2895002425501100000, "line_mean": 40.1428571429, "line_max": 96, "alpha_frac": 0.6736111111, "autogenerated": false, "ratio":...
from .endpoint import Endpoint from .exceptions import MissingRequiredFieldError from .. import RequestFactory, SiteItem, PaginationItem import logging import copy logger = logging.getLogger('tableau.endpoint.sites') class Sites(Endpoint): @property def baseurl(self): return "{0}/sites".format(self.p...
{ "repo_name": "Talvalin/server-client-python", "path": "tableauserverclient/server/endpoint/sites_endpoint.py", "copies": "1", "size": "3168", "license": "mit", "hash": -9121048794280310000, "line_mean": 40.1428571429, "line_max": 95, "alpha_frac": 0.6385732323, "autogenerated": false, "ratio": 3...
from .endpoint import Endpoint from .exceptions import MissingRequiredFieldError from .. import RequestFactory, UserItem, WorkbookItem, PaginationItem import logging import copy logger = logging.getLogger('tableau.endpoint.users') class Users(Endpoint): @property def baseurl(self): return "{0}/sites/...
{ "repo_name": "Talvalin/server-client-python", "path": "tableauserverclient/server/endpoint/users_endpoint.py", "copies": "1", "size": "3216", "license": "mit", "hash": 7800529253849460000, "line_mean": 40.2307692308, "line_max": 103, "alpha_frac": 0.6529850746, "autogenerated": false, "ratio": 3...
from .endpoint import Endpoint from .exceptions import MissingRequiredFieldError from .. import ViewItem, PaginationItem import logging logger = logging.getLogger('tableau.endpoint.views') class Views(Endpoint): @property def baseurl(self): return "{0}/sites/{1}".format(self.parent_srv.baseurl, self....
{ "repo_name": "Talvalin/server-client-python", "path": "tableauserverclient/server/endpoint/views_endpoint.py", "copies": "1", "size": "1391", "license": "mit", "hash": 4189093779696369700, "line_mean": 43.8709677419, "line_max": 87, "alpha_frac": 0.6276060388, "autogenerated": false, "ratio": 4....
from .endpoint import Endpoint from .exceptions import MissingRequiredFieldError from ...models.exceptions import UnpopulatedPropertyError from .. import RequestFactory, GroupItem, UserItem, PaginationItem import logging logger = logging.getLogger('tableau.endpoint.groups') class Groups(Endpoint): @property ...
{ "repo_name": "Talvalin/server-client-python", "path": "tableauserverclient/server/endpoint/groups_endpoint.py", "copies": "1", "size": "4023", "license": "mit", "hash": 5115716167885692000, "line_mean": 40.4742268041, "line_max": 97, "alpha_frac": 0.626646781, "autogenerated": false, "ratio": 3....
from .endpoint import Endpoint from .. import RequestFactory, NAMESPACE import xml.etree.ElementTree as ET import logging logger = logging.getLogger('tableau.endpoint.auth') class Auth(Endpoint): class contextmgr(object): def __init__(self, callback): self._callback = callback def __...
{ "repo_name": "Talvalin/server-client-python", "path": "tableauserverclient/server/endpoint/auth_endpoint.py", "copies": "1", "size": "1787", "license": "mit", "hash": 3977413898388592000, "line_mean": 38.7111111111, "line_max": 103, "alpha_frac": 0.6155567991, "autogenerated": false, "ratio": 3....
from .endpoint import Endpoint class ModuleService(object): def __init__(self, request, module): self.request = request self.module = module def __getitem__(self, key): try: function = getattr(self.module, key) except AttributeError: raise KeyError ...
{ "repo_name": "bitesofcode/pyramid_restful", "path": "pyramid_restful/services.py", "copies": "1", "size": "1718", "license": "mit", "hash": -8739629205016476000, "line_mean": 31.4339622642, "line_max": 102, "alpha_frac": 0.5570430733, "autogenerated": false, "ratio": 4.485639686684073, "config...
from .endpoint import Endpoint class WvwMatchesEndpoint(Endpoint): def world(self, world_id): params = {"world": world_id} cache_name = "wvw_matches_world_%(world)s.json" % params return self.get_cached(self.name, cache_name, params=params) class WvwMatchStatsEndpoint(WvwMatchesEndpoint)...
{ "repo_name": "hackedd/gw2api", "path": "gw2api/v2/wvw.py", "copies": "1", "size": "1054", "license": "mit", "hash": 5505763566132506000, "line_mean": 41.16, "line_max": 78, "alpha_frac": 0.6271347249, "autogenerated": false, "ratio": 2.8333333333333335, "config_test": false, "has_no_keywords...
from endpoints import build_call from follow import followAPI from stargazers import starAPI from events import eventsAPI from notifs import notifAPI from search import searchAPI class octopy(object): def __init__(self, username, authstring, token = False): self.authstring = authstring self.istoke...
{ "repo_name": "mbad0la/octoAPy", "path": "octopy/driver.py", "copies": "1", "size": "3223", "license": "mit", "hash": -8030290926035803000, "line_mean": 37.369047619, "line_max": 154, "alpha_frac": 0.6053366429, "autogenerated": false, "ratio": 3.887816646562123, "config_test": false, "has_no...
from .endpoints import ( api, auth, bots, channels, chat, dnd, emoji, files, groups, im, mpim, oauth, pins, reactions, reminders, rtm, search, stars, team, usergroups, users, ) class SlackAPI(object): """The API object""" api...
{ "repo_name": "huntcsg/slackly", "path": "src/slackly/api/__init__.py", "copies": "1", "size": "1230", "license": "mit", "hash": -8034837604472920000, "line_mean": 18.21875, "line_max": 69, "alpha_frac": 0.5406504065, "autogenerated": false, "ratio": 3.3884297520661155, "config_test": false, ...
from endpoints_proto_datastore.ndb import EndpointsModel from google.appengine.ext import ndb class Aparelho(EndpointsModel): nome = ndb.StringProperty(indexed=True) token = ndb.StringProperty(indexed=True) last_sampling = ndb.DateProperty() @classmethod def validate_login(cls, name, token): ...
{ "repo_name": "cirocosta/avisenchente", "path": "src/models/usuario.py", "copies": "1", "size": "1089", "license": "mit", "hash": 963297657583324300, "line_mean": 32.0303030303, "line_max": 64, "alpha_frac": 0.6354453627, "autogenerated": false, "ratio": 3.4571428571428573, "config_test": false...
from endpoints_proto_datastore.ndb.model import EndpointsModel from google.appengine.ext import ndb class Car(EndpointsModel): _message_fields_schema = ("entityKey", "create_date_time", "car_id", "icon", "make", "model", "shared", "year", "user_id") create_date_time = ndb.DateTimeProperty(auto_now=True) ca...
{ "repo_name": "hazzargm/CSSE-290-iOSDev", "path": "GasStats/rh-csse290-gas-stats/models.py", "copies": "1", "size": "2084", "license": "mit", "hash": 8466137476433508000, "line_mean": 39.8823529412, "line_max": 126, "alpha_frac": 0.6703454894, "autogenerated": false, "ratio": 3.3941368078175898, ...
from end_to_end_test import EndToEndTest import test_config as config #============================================================= # This test checks that an admin can give a user management # permissions. # # Precondition: Requires test_create_farm to have passed # Requires test_create_test_users t...
{ "repo_name": "elec-otago/agbase", "path": "testing/selenium-tests/test_change_user_permission.py", "copies": "1", "size": "1257", "license": "mpl-2.0", "hash": -8547668248918640000, "line_mean": 39.5806451613, "line_max": 86, "alpha_frac": 0.5807478123, "autogenerated": false, "ratio": 4.3195876...
from end_to_end_test import EndToEndTest import test_config as config #============================================================= # This test creates two test users: a farmer and a farm manager #============================================================= class CreateTestUsersTest(EndToEndTest): de...
{ "repo_name": "elec-otago/agbase", "path": "testing/selenium-tests/test_create_test_users.py", "copies": "1", "size": "1523", "license": "mpl-2.0", "hash": -3912133205979356700, "line_mean": 40.1621621622, "line_max": 89, "alpha_frac": 0.5226526592, "autogenerated": false, "ratio": 4.629179331306...
from end_to_end_test import EndToEndTest import test_config as config #============================================================= # This tests that an account with permission to manage a farm # can add condition scores using the condition scorer app. # # Precondition: Requires test_create_herd to have passed # ...
{ "repo_name": "elec-otago/agbase", "path": "testing/selenium-tests/test_condition_scorer_app.py", "copies": "1", "size": "1315", "license": "mpl-2.0", "hash": 8334109195391183000, "line_mean": 36.6, "line_max": 79, "alpha_frac": 0.5977186312, "autogenerated": false, "ratio": 4.518900343642612, ...
from enemies import * from items import * from interactives import * village = [ [Fletcher(0,0),Road(0,1),Blacksmith(0,2)], ['',Road(1,1),''], ['',Road(2,1),''], ['',Road(3,1),''], [Road(4,0),Road(4,1),Road(4,2),Road(4,3)], [Level1(5,0),Level2(5,1),Level3(5,2),Level4(5,3)] ] grid1 = [ [bspace(0,0),Goblin(0,1),b...
{ "repo_name": "calthecoder/zealous-fibula", "path": "world.py", "copies": "1", "size": "3243", "license": "mit", "hash": -1870067633713355500, "line_mean": 36.2873563218, "line_max": 79, "alpha_frac": 0.6450817145, "autogenerated": false, "ratio": 2.2458448753462603, "config_test": false, "ha...
from Enemy import Enemy from bge import logic import nilutils as nl import random as rand class Attack(nl.Component): def __init__(self, gobj): super().__init__(gobj) self.max_health = 1 self.health = self.max_health self.states = ['spin_attack', 'wave_attack'] self.current_rotation = 1 self.sta...
{ "repo_name": "Lucrecious/Aphtar-Yu", "path": "Goat.py", "copies": "1", "size": "2070", "license": "mit", "hash": 1829951891377696800, "line_mean": 17.3274336283, "line_max": 66, "alpha_frac": 0.6352657005, "autogenerated": false, "ratio": 2.7129750982961993, "config_test": false, "has_no_key...
# from enemy import Enemy from entity import * # from player import Player class Collisions: @staticmethod def check_right_wall(entity: Entity, SURFACE_WIDTH: int): if (entity.position.x + entity.width) >= SURFACE_WIDTH: return True @staticmethod def check_left_wall(entity: Entity): if (entity.position.x ...
{ "repo_name": "fedeLarregle/python-game-practice", "path": "collision.py", "copies": "1", "size": "1091", "license": "apache-2.0", "hash": -7597718601069203000, "line_mean": 26.9743589744, "line_max": 99, "alpha_frac": 0.7158570119, "autogenerated": false, "ratio": 2.940700808625337, "config_te...
from Enemy import Enemy from pylash.display import Sprite, BitmapData, Animation, AnimationSet, AnimationEvent, AnimationPlayMode class AttackCharacter(Sprite): def __init__(self, name, mov, atk, xInMap, yInMap, atkValue): super(AttackCharacter, self).__init__() self.xInMap = xInMap self.yInMap = yInMap sel...
{ "repo_name": "yuehaowang/pylash_engine", "path": "examples/tower_defense/AttackCharacter.py", "copies": "1", "size": "3691", "license": "mit", "hash": -2319124375867690000, "line_mean": 22.8193548387, "line_max": 105, "alpha_frac": 0.6523977242, "autogenerated": false, "ratio": 2.552558782849239...
from enemy import * class EnemyGenerator(object): def __init__(self, game, enemies, players, things): self.game = game self.spawn_counter = 0 self.spawn_period = 100 self.max_enemies = 3 self.enemies = enemies self.players = players self.thing_keys = load_th...
{ "repo_name": "cxong/Slappa", "path": "enemy_generator.py", "copies": "1", "size": "1611", "license": "mit", "hash": -1596446504512598800, "line_mean": 35.6363636364, "line_max": 92, "alpha_frac": 0.4636871508, "autogenerated": false, "ratio": 4.217277486910994, "config_test": false, "has_no_...
from enerdata.contracts import TariffPeriod class Measure(object): def __init__(self, date, period, measure): self.date = date assert isinstance(period, TariffPeriod) self.period = period self.measure = measure def __lt__(self, other): return self.date < other.date ...
{ "repo_name": "Som-Energia/enerdata", "path": "enerdata/metering/measure.py", "copies": "1", "size": "1171", "license": "mit", "hash": 2977512319110801400, "line_mean": 26.2558139535, "line_max": 72, "alpha_frac": 0.5781383433, "autogenerated": false, "ratio": 3.877483443708609, "config_test": ...
from enerdata.contracts import TariffPeriod class Measure(object): __slots__ = ('date', 'period', 'measure') def __init__(self, date, period, measure): self.date = date assert isinstance(period, TariffPeriod) self.period = period self.measure = measure def __lt__(self, o...
{ "repo_name": "gisce/enerdata", "path": "enerdata/metering/measure.py", "copies": "1", "size": "1648", "license": "mit", "hash": 5378786956178427000, "line_mean": 25.1746031746, "line_max": 72, "alpha_frac": 0.5709951456, "autogenerated": false, "ratio": 3.9806763285024154, "config_test": false...
from enerdata.datetime import datetime from enerdata.datetime.station import get_station from enerdata.datetime.solar_hour import convert_to_solar_hour from enerdata.datetime.timezone import TIMEZONE from dateutil.relativedelta import relativedelta from expects import expect, equal, raise_error DIFFERENCE_HOURS = {'su...
{ "repo_name": "gisce/enerdata", "path": "spec/datetime/solar_hour_spec.py", "copies": "1", "size": "2412", "license": "mit", "hash": -1008008208855749900, "line_mean": 44.5094339623, "line_max": 79, "alpha_frac": 0.6065505804, "autogenerated": false, "ratio": 3.616191904047976, "config_test": f...
from enerdata.profiles.profile import * from enerdata.contracts.tariff import * from expects import * import vcr from decimal import Decimal with description('A profile with gaps'): with before.all: import random measures = [] start = TIMEZONE.localize(datetime(2015, 3, 1, 1)) end =...
{ "repo_name": "gisce/enerdata", "path": "spec/profiles/gaps_spec.py", "copies": "1", "size": "11707", "license": "mit", "hash": 7423470133787212000, "line_mean": 39.2302405498, "line_max": 230, "alpha_frac": 0.5781156573, "autogenerated": false, "ratio": 3.945736434108527, "config_test": false,...
from enerdata.profiles.profile import * from enerdata.contracts.tariff import * from expects import * import vcr class TGProfileHour(namedtuple('TGProfileHour', ProfileHour._fields + ('meta', ))): __slots__ = () def __lt__(self, other): return self.date < other.date ...
{ "repo_name": "gisce/enerdata", "path": "spec/profiles/integration_spec.py", "copies": "1", "size": "7200", "license": "mit", "hash": -8112299599815689000, "line_mean": 36.1134020619, "line_max": 80, "alpha_frac": 0.5077777778, "autogenerated": false, "ratio": 4.031354983202688, "config_test": ...
from enerdata.profiles.profile import * from enerdata.contracts.tariff import (T20A, T20DHA, T20DHS, T21A, T21DHA, T21DHS, T30A, T31A, T30A_one_period, T31A_one_period, TRE, T20TD) from enerdata.datetime.holidays import get_holidays from ener...
{ "repo_name": "gisce/enerdata", "path": "spec/profiles/profile_spec.py", "copies": "1", "size": "39700", "license": "mit", "hash": -3421032253679108600, "line_mean": 37.76953125, "line_max": 208, "alpha_frac": 0.4950881612, "autogenerated": false, "ratio": 3.8849202465994717, "config_test": fal...
from enerdata.profiles.profile import * from enerdata.contracts.tariff import T20DHA, T30A from enerdata.metering.measure import * with description("A coeficient"): with before.all: start = TIMEZONE.localize(datetime(2014, 1, 1)) end = TIMEZONE.localize(datetime(2015, 1, 1)) cofs = [] ...
{ "repo_name": "Som-Energia/enerdata", "path": "spec/profiles/profile_spec.py", "copies": "1", "size": "6239", "license": "mit", "hash": -7444010382414023000, "line_mean": 34.6514285714, "line_max": 98, "alpha_frac": 0.5020035262, "autogenerated": false, "ratio": 3.503088152723189, "config_test"...
from enerdata.profiles.profile import * from enerdata.datetime.station import * from enerdata.contracts.tariff import T20A ONE_MONTH_DATE_SET = ['1/2018'] DATE_SET = ['3/2018', '4/2018', '5/2018'] class FakeClass(object): @classmethod def get_range(cls, start, end): cofs = [] start = datetime...
{ "repo_name": "gisce/enerdata", "path": "spec/coefficients/coefficients_spec.py", "copies": "1", "size": "6895", "license": "mit", "hash": -5949702173606100000, "line_mean": 34.725388601, "line_max": 78, "alpha_frac": 0.5472081218, "autogenerated": false, "ratio": 3.854108440469536, "config_tes...
from energy_demand.read_write.narrative_related import crit_dim_var from collections import OrderedDict class TestCritDimensionsVar: def test_crit_in_list(self): crit_in_list = [ {'sig_midpoint': 0, 'value_by': 5, 'diffusion_choice': 'linear', 'fueltype_replace': 0, 'regional_spec...
{ "repo_name": "nismod/energy_demand", "path": "tests/read_write/test_narrative_related.py", "copies": "1", "size": "3498", "license": "mit", "hash": 2737258833728051000, "line_mean": 32.3142857143, "line_max": 83, "alpha_frac": 0.4937106918, "autogenerated": false, "ratio": 3.5913757700205338, ...
from engage import settings from datetime import datetime, timedelta import logging import requests import os import bcrypt import base64 import pytz import boto3 from email.mime.multipart import MIMEMultipart from email.mime.text import MIMEText from email.mime.application import MIMEApplication log = logging.Logger(_...
{ "repo_name": "hackla-engage/CouncilTag-Django", "path": "engage/api/utils.py", "copies": "1", "size": "4555", "license": "apache-2.0", "hash": 8539037231338582000, "line_mean": 33.2481203008, "line_max": 117, "alpha_frac": 0.5758507135, "autogenerated": false, "ratio": 3.9677700348432055, "con...
from engage.lists import * from django import template from django.template.defaultfilters import stringfilter import ast register = template.Library() @register.filter def nice_name(user): return user.get_full_name() or user.username @register.filter def country(country_code): return dict(COUNTRIES)[country_co...
{ "repo_name": "Suite5/DataColibri", "path": "engage/templatetags/list_tags.py", "copies": "1", "size": "4223", "license": "mit", "hash": 1489712717031957500, "line_mean": 26.7828947368, "line_max": 105, "alpha_frac": 0.6414870945, "autogenerated": false, "ratio": 2.537860576923077, "config_test...
from engine.action import Action, Stats from engine.player import Player def processInput(): userText = input("Enter command [Add player] [Team player] [Spot] [Web spot] [Flee jail] [Print] [teamChat]: \n") if 'f' in userText: jailCode = input("enter jail code: ") Action.fleePlayerWithCode(jail...
{ "repo_name": "mahfiaz/spotter_irl", "path": "engine/cli.py", "copies": "1", "size": "1578", "license": "bsd-2-clause", "hash": 1401668220969171000, "line_mean": 35.7209302326, "line_max": 117, "alpha_frac": 0.6020278834, "autogenerated": false, "ratio": 3.6527777777777777, "config_test": false...
from engine.api import API from engine.utils.printing_utils import progressBar from setup.utils.datastore_utils import repair_corrupt_reference, link_references_to_paper def remove_duplicates_from_cited_by(): print("\nRemove Duplicates") api = API() papers = api.get_all_paper() for i, paper in enumer...
{ "repo_name": "thomasmauerhofer/search-engine", "path": "src/setup/check_for_currupt_references.py", "copies": "1", "size": "2124", "license": "mit", "hash": 1449730741921184300, "line_mean": 29.7826086957, "line_max": 107, "alpha_frac": 0.5965160075, "autogenerated": false, "ratio": 3.5757575757...
from engine.application import Application from engine.service import ( ServiceManager, GameObjectService, PhysicsService, GraphicsService, InputService, ResourceService, MessageService, AbstractService ) from engine.gui import ( GuiService, AbstractGui ) from engine.object import ( ...
{ "repo_name": "constantinius/YaaGame", "path": "main.py", "copies": "1", "size": "23005", "license": "mit", "hash": -1121352204077427200, "line_mean": 34.6321656051, "line_max": 109, "alpha_frac": 0.5193653554, "autogenerated": false, "ratio": 4.136102121539015, "config_test": false, "has_no_...
from engine.auth import Authorizer from engine.runner import Runner import flask app = flask.Flask(__name__) app.config['DEBUG'] = True auth = Authorizer() runner = Runner() # Decorator to be used in the future for authorizing web requests def authorized(f): def wrapper(*args, **kwargs): if auth.is_auth...
{ "repo_name": "wpkita/automation-station", "path": "web/server.py", "copies": "1", "size": "1949", "license": "mit", "hash": -4764669085639557000, "line_mean": 20.4175824176, "line_max": 68, "alpha_frac": 0.6157003592, "autogenerated": false, "ratio": 3.5053956834532376, "config_test": false, ...
from engine.check_castle import check_wc_k, check_wc_q, check_bc_k, check_bc_q from engine.check_detection import white_in_check, black_in_check from engine.constants import BOARD_INDEX, WK_SQ_INDEX, BK_SQ_INDEX, EN_PAS_INDEX, NORTH, SOUTH, \ RANK2, RANK7, A1, A8, E1, E8, C1, C8, G1, G8, H1, H8, WHITE, BLACK, TURN_...
{ "repo_name": "ElliotVilhelm/IZII", "path": "engine/gen_moves.py", "copies": "1", "size": "7569", "license": "mit", "hash": 4191522385376975000, "line_mean": 36.6567164179, "line_max": 115, "alpha_frac": 0.5222618576, "autogenerated": false, "ratio": 3.016739736946991, "config_test": false, "...
from engine.check_detection import white_in_check, black_in_check from engine.constants import CASTLED, CASTLE_VOIDED, BOARD_INDEX, C_PERM_INDEX, WQC_INDEX, WKC_INDEX, BKC_INDEX, \ BQC_INDEX def can_castle(state, castle_index): castle_perm = state[C_PERM_INDEX][castle_index] board = state[BOARD_INDEX] ...
{ "repo_name": "ElliotVilhelm/IZII", "path": "engine/check_castle.py", "copies": "1", "size": "3322", "license": "mit", "hash": 9059361428910177000, "line_mean": 30.046728972, "line_max": 114, "alpha_frac": 0.6011438892, "autogenerated": false, "ratio": 3.1911623439000962, "config_test": false, ...
from engine.common.data import DataObjectAbstract class GameData(DataObjectAbstract): """ This is game data object """ def __init__(self, settings): self._data = 'Store game data into this variable' @property def data(self): return self._data def reload_cache(self, key):...
{ "repo_name": "kollad/turbo-ninja", "path": "app_template/game_logic/content_manager.py", "copies": "1", "size": "1137", "license": "mit", "hash": -5345603190208719000, "line_mean": 18.6206896552, "line_max": 67, "alpha_frac": 0.6077396658, "autogenerated": false, "ratio": 4.226765799256506, "c...
from engine.constants import BOARD_INDEX, C_PERM_INDEX, WK_SQ_INDEX, BK_SQ_INDEX, EN_PAS_INDEX, NORTH, SOUTH, \ RANK2, RANK7, WKC_INDEX, WQC_INDEX, BKC_INDEX, BQC_INDEX, CASTLE_VOIDED, CASTLED, A1, A8, E1, E8, C1, C8, G1, \ G8, H1, H8, WHITE, BLACK, HALF_MOVE_INDEX, FULL_MOVE_INDEX, TURN_INDEX, B8, B1, D1, D8, ...
{ "repo_name": "ElliotVilhelm/IZII", "path": "engine/move.py", "copies": "1", "size": "5236", "license": "mit", "hash": -565581364873011400, "line_mean": 46.1711711712, "line_max": 127, "alpha_frac": 0.5784950344, "autogenerated": false, "ratio": 2.732776617954071, "config_test": false, "has_n...
from engine.constants import init_state from engine.check_castle import check_wc_k, check_wc_q, check_bc_k, check_bc_q from engine.constants import CASTLE_OPEN, CASTLE_VOIDED, CASTLE_NEW, CASTLED, WKC_INDEX, WQC_INDEX, C_PERM_INDEX, WHITE from engine.move import move_at_state from engine.utils import RF_sq120, print_bo...
{ "repo_name": "ElliotVilhelm/IZII", "path": "test/test_castling.py", "copies": "1", "size": "2756", "license": "mit", "hash": -8993072475260839000, "line_mean": 28.9565217391, "line_max": 119, "alpha_frac": 0.5301161103, "autogenerated": false, "ratio": 2.919491525423729, "config_test": false, ...
from engine.constants import * from engine.utils import in_range def white_in_check(board, tile_n): if check_black_knights(board, tile_n) is True: return True if check_black_king(board, tile_n) is True: return True if check_black_pawns(board, tile_n) is True: return True if che...
{ "repo_name": "ElliotVilhelm/IZII", "path": "engine/check_detection.py", "copies": "1", "size": "5983", "license": "mit", "hash": 7100813004361970000, "line_mean": 22.462745098, "line_max": 77, "alpha_frac": 0.4952365034, "autogenerated": false, "ratio": 3.4325874928284565, "config_test": false...
from engine.database import LS_IDLE, LS_BLOCK, LS_PMODE, LS_HALT import time, sys class StateMachine: def __init__(self, db, modem, fax_timeout, redial_window): self.db = db self.modem = modem self.fax_timeout = fax_timeout self.redial_window = redial_window self.db.log("SM ...
{ "repo_name": "benjaveri/phonescreen", "path": "v2/engine/sm.py", "copies": "1", "size": "4439", "license": "bsd-3-clause", "hash": 607613102234240900, "line_mean": 36.6186440678, "line_max": 118, "alpha_frac": 0.4976346024, "autogenerated": false, "ratio": 4.083716651333947, "config_test": fal...
from engine.datastore.ranking.mode import Mode from engine.utils.printing_utils import progressBar from evaluation.utils.evaluation_base import EvaluationBase class MltEvaluation(EvaluationBase): def calculate_ranking(self, settings): print(" & # queries & MAP") papers = self.api.get_all_paper() ...
{ "repo_name": "thomasmauerhofer/search-engine", "path": "src/evaluation/utils/mlt_evaluation.py", "copies": "1", "size": "1823", "license": "mit", "hash": 6978774357204585000, "line_mean": 38.6304347826, "line_max": 114, "alpha_frac": 0.6423477784, "autogenerated": false, "ratio": 3.5398058252427...
from engine.Element import Element; from engine import Global; # --------------------------------------------------- *\ # [class] ActionDispatcher() # # * Create an action dispatcher * # # --------------------------------------------------- */ class ActionDispatcher(Element): # --------------------------------------...
{ "repo_name": "WilliamDASILVA/TheMysteryOfSchweitzer", "path": "gameplay/ActionDispatcher.py", "copies": "1", "size": "2134", "license": "mit", "hash": 675780415565892500, "line_mean": 28.6527777778, "line_max": 67, "alpha_frac": 0.4170571696, "autogenerated": false, "ratio": 3.763668430335097, ...
from engine.Element import Element; from engine import Render; from engine.render.image import Image; from engine.render.sprite import Sprite; # --------------------------------------------------- *\ # [class] Player() # # * Player element * # # --------------------------------------------------- */ class Player(Elem...
{ "repo_name": "WilliamDASILVA/TheMysteryOfSchweitzer", "path": "gameplay/Player.py", "copies": "1", "size": "2229", "license": "mit", "hash": -7845988373884020000, "line_mean": 27.9480519481, "line_max": 63, "alpha_frac": 0.465679677, "autogenerated": false, "ratio": 3.6302931596091206, "config...
from engine.Element import Element; # --------------------------------------------------- *\ # [class] Drawable() # # * A drawable element * # # --------------------------------------------------- */ class Drawable(Element): # --------------------------------------------------- *\ # [function] __init__(): # # *...
{ "repo_name": "WilliamDASILVA/TheMysteryOfSchweitzer", "path": "engine/render/drawable.py", "copies": "1", "size": "4519", "license": "mit", "hash": -4375090037438653400, "line_mean": 28.9271523179, "line_max": 68, "alpha_frac": 0.3916795751, "autogenerated": false, "ratio": 3.781589958158996, ...
from engine.gen_moves import get_all_moves_at_state from engine.move import move_at_state from engine.constants import EN_PAS_INDEX def test_black_en_passant(): one_from_mate_board = \ "x" * 20 + \ "xoooooooox" + \ "xopoooooox" + \ "xoooooooox" + \ "xooPooooox" + \ ...
{ "repo_name": "ElliotVilhelm/IZII", "path": "test/test_en_passant.py", "copies": "1", "size": "1479", "license": "mit", "hash": -8058993668563327000, "line_mean": 27.4423076923, "line_max": 60, "alpha_frac": 0.5246788371, "autogenerated": false, "ratio": 2.806451612903226, "config_test": false,...
from .engine import Box2DEngine, Vec2 from .engine.body_def import BodyDef from .transform import BodyTransform from nytram.engine import EngineAttr from ctypes import byref class Body: """ Represents a Box2D Body """ entity = EngineAttr("applyTransform") def __init__(self, fixtures, wra...
{ "repo_name": "cloew/NytramBox2D", "path": "nytram_box2d/body.py", "copies": "1", "size": "2203", "license": "mit", "hash": -535410711262625660, "line_mean": 32.453125, "line_max": 72, "alpha_frac": 0.6091693146, "autogenerated": false, "ratio": 4.353754940711463, "config_test": false, "has_n...
from ..engine import Box2DEngine, Vec2 from nytram.engine import EngineAttr from ctypes import byref from kao_decorators import proxy_for @proxy_for("graphicalPosition", ["z", "__repr__"]) class BodyPosition: """ Represents a body position """ body = EngineAttr("setPhysicsPosition") def __...
{ "repo_name": "cloew/NytramBox2D", "path": "nytram_box2d/transform/body_position.py", "copies": "1", "size": "1607", "license": "mit", "hash": 871749589896244900, "line_mean": 27.7962962963, "line_max": 67, "alpha_frac": 0.5718730554, "autogenerated": false, "ratio": 4.240105540897098, "config_...
from engine import cilipig as cilipig from engine import cilibar as cilibar from engine import clpig as clpig from index import DiskIndex from index import SysConst from index import MovieDAO from index import WrongMagnetDAO from util import Log def getMagnet(avNumber, skipMagnet): engine = clpig ma...
{ "repo_name": "pythonlittleboy/python_gentleman_crawler", "path": "index/MagnetIO.py", "copies": "1", "size": "2992", "license": "apache-2.0", "hash": 6521630958722557000, "line_mean": 25.9813084112, "line_max": 157, "alpha_frac": 0.5798796791, "autogenerated": false, "ratio": 3.9213630406290956,...
from .engine import Engine, _EngineHelper, logger from .config import Config import os import cv2 import time import numpy as np import tensorflow as tf from network import Network class _TensorflowHelper(_EngineHelper): """ The TensorflowHelper is an implementation of an activation maximization engine ...
{ "repo_name": "Petr-By/qtpyvis", "path": "tools/am/tensorflow.py", "copies": "1", "size": "22428", "license": "mit", "hash": 7357327788840754000, "line_mean": 40.0769230769, "line_max": 100, "alpha_frac": 0.5595683966, "autogenerated": false, "ratio": 4.062307552979533, "config_test": true, "...
from engine import Global; from engine import Update; from engine.Input import Keyboard; from gameplay.behaviours import playerBehaviour; usedPlayer = None; isActive = False; # --------------------------------------------------- *\ # [function] assignPlayer(player) # # * Assign a player for actions * # Return : n...
{ "repo_name": "WilliamDASILVA/TheMysteryOfSchweitzer", "path": "gameplay/behaviours/actiondispatcherBehaviour.py", "copies": "1", "size": "1922", "license": "mit", "hash": -4501807809649116000, "line_mean": 27.6865671642, "line_max": 96, "alpha_frac": 0.5504682622, "autogenerated": false, "ratio"...
from engine import Global; from engine.Input import Keyboard; from gameplay.behaviours import playerBehaviour; isActive = None; isDialogStarted = False; currentDialog = None; currentIndex = 1; nextIndex = None; # --------------------------------------------------- *\ # [function] setActive(value) # # * Set if the d...
{ "repo_name": "WilliamDASILVA/TheMysteryOfSchweitzer", "path": "gameplay/behaviours/dialogBehaviour.py", "copies": "1", "size": "3157", "license": "mit", "hash": -4761810312835662000, "line_mean": 25.3166666667, "line_max": 77, "alpha_frac": 0.5742793792, "autogenerated": false, "ratio": 3.864137...
from engine import Global; from engine.Interface import Interface; from gameplay.behaviours import achievementBehaviour; from engine.render.image import Image; from engine.render.text import Text; # --------------------------------------------------- *\ # [class] PauseInterface() # # * The pause interface * # # ---...
{ "repo_name": "WilliamDASILVA/TheMysteryOfSchweitzer", "path": "interfaces/PauseInterface.py", "copies": "1", "size": "3707", "license": "mit", "hash": 8936634725557623000, "line_mean": 36.8367346939, "line_max": 77, "alpha_frac": 0.6690045859, "autogenerated": false, "ratio": 3.1415254237288135,...
from engine import Global; from engine.Interface import Interface; from engine.render.image import Image; from engine.render.text import Text; from engine.render.sprite import Sprite; # --------------------------------------------------- *\ # [class] InventoryInterface() # # * The inventory interface * # # --------...
{ "repo_name": "WilliamDASILVA/TheMysteryOfSchweitzer", "path": "interfaces/InventoryInterface.py", "copies": "1", "size": "3578", "license": "mit", "hash": -8787342359820114000, "line_mean": 33.3846153846, "line_max": 117, "alpha_frac": 0.6263982103, "autogenerated": false, "ratio": 2.91205211726...
from engine import Global; from engine.Interface import Interface; from engine.render.image import Image; from engine.render.text import Text; from random import randint; thunderInterval = None; # --------------------------------------------------- *\ # [class] MenuInterface() # # * The pause interface * # # -----...
{ "repo_name": "WilliamDASILVA/TheMysteryOfSchweitzer", "path": "interfaces/MenuInterface.py", "copies": "1", "size": "9783", "license": "mit", "hash": -1967499653808868600, "line_mean": 37.8174603175, "line_max": 142, "alpha_frac": 0.6714037419, "autogenerated": false, "ratio": 3.1060654175928866...
from engine import Global; from engine.Interface import Interface; from engine.render.image import Image; from engine.render.text import Text; # --------------------------------------------------- *\ # [class] TransitionInterface() # # * Scene transition interface * # # ---------------------------------------------...
{ "repo_name": "WilliamDASILVA/TheMysteryOfSchweitzer", "path": "interfaces/TransitionInterface.py", "copies": "1", "size": "2625", "license": "mit", "hash": -6758635597389515000, "line_mean": 27.5326086957, "line_max": 63, "alpha_frac": 0.6293333333, "autogenerated": false, "ratio": 3.18955042527...
from engine import Global; from random import randint; from engine import Update; # --------------------------------------------------- *\ # Camera behaviour # --------------------------------------------------- */ cameraToUse = None; shakeIntensity = 0; isCameraShaking = False; isCameraFixed = False; fixeTarget = Non...
{ "repo_name": "WilliamDASILVA/TheMysteryOfSchweitzer", "path": "gameplay/behaviours/cameraBehaviour.py", "copies": "1", "size": "3987", "license": "mit", "hash": -7439098072143680000, "line_mean": 29.4427480916, "line_max": 128, "alpha_frac": 0.5432656132, "autogenerated": false, "ratio": 3.69851...
from engine import Global; # --------------------------------------------------- *\ # [class] Element() # # * Element class * # # --------------------------------------------------- */ class Element(): # --------------------------------------------------- *\ # [function] __init__(): # # * Constructor * # -----...
{ "repo_name": "WilliamDASILVA/TheMysteryOfSchweitzer", "path": "engine/Element.py", "copies": "1", "size": "4474", "license": "mit", "hash": 6672381930309835000, "line_mean": 27.8709677419, "line_max": 57, "alpha_frac": 0.3781850693, "autogenerated": false, "ratio": 3.694467382328654, "config_t...
from ..engine import Layer, InputSpec from .. import backend as K class Wrapper(Layer): def __init__(self, layer, **kwargs): self.layer = layer self.uses_learning_phase = layer.uses_learning_phase super(Wrapper, self).__init__(**kwargs) def build(self, input_shape=None): '''A...
{ "repo_name": "kemaswill/keras", "path": "keras/layers/wrappers.py", "copies": "2", "size": "10422", "license": "mit", "hash": 6583460779785914000, "line_mean": 38.7786259542, "line_max": 214, "alpha_frac": 0.5896181155, "autogenerated": false, "ratio": 4.016184971098266, "config_test": true, ...
from ..engine import Layer, InputSpec from .. import initializations from .. import backend as K class BatchNormalization(Layer): '''Normalize the activations of the previous layer at each batch, i.e. applies a transformation that maintains the mean activation close to 0 and the activation standard deviat...
{ "repo_name": "GUR9000/KerasNeuralFingerprint", "path": "keras/layers/normalization.py", "copies": "2", "size": "7902", "license": "mit", "hash": -8275622388476919000, "line_mean": 48.3875, "line_max": 157, "alpha_frac": 0.5701088332, "autogenerated": false, "ratio": 4.494880546075085, "config_...
from ..engine import Layer, InputSpec from .. import initializations, regularizers from .. import backend as K class BatchNormalization(Layer): '''Normalize the activations of the previous layer at each batch, i.e. applies a transformation that maintains the mean activation close to 0 and the activation s...
{ "repo_name": "marcsans/cnn-physics-perception", "path": "phy/lib/python2.7/site-packages/keras/layers/normalization.py", "copies": "1", "size": "8253", "license": "mit", "hash": 7018575621988581000, "line_mean": 48.7168674699, "line_max": 156, "alpha_frac": 0.5992972253, "autogenerated": false, ...
from engine import PolicyEngine from parser import Parser from pypelib.persistence.backends.rawfile.RAWFile import RAWFile from pypelib.RuleTable import RuleTable from pypelib.utils.Logger import Logger import os class PolicyManager: @staticmethod def read_rules(): rules = [] policies_folder ...
{ "repo_name": "ict-felix/stack", "path": "modules/resource/orchestrator/src/policies/manager.py", "copies": "1", "size": "3124", "license": "apache-2.0", "hash": -6547406457428154000, "line_mean": 37.0975609756, "line_max": 100, "alpha_frac": 0.5560179257, "autogenerated": false, "ratio": 4.52753...
from .engine import SimEngine import logging l = logging.getLogger("angr.engines.failure") class SimEngineFailure(SimEngine): #pylint:disable=abstract-method def _check(self, state, *args, **kwargs): jumpkind = state.history.jumpkind if jumpkind in ('Ijk_EmFail', 'Ijk_MapFail') or jumpkind.starts...
{ "repo_name": "tyb0807/angr", "path": "angr/engines/failure.py", "copies": "1", "size": "1186", "license": "bsd-2-clause", "hash": -182565120288425540, "line_mean": 36.0625, "line_max": 106, "alpha_frac": 0.6686340641, "autogenerated": false, "ratio": 3.7413249211356465, "config_test": false, ...
from .engine import SimEngine import logging l = logging.getLogger("angr.engines.failure") class SimEngineFailure(SimEngine): #pylint:disable=abstract-method def __init__(self, project): super(SimEngineFailure, self).__init__() self.project = project def _check(self, state, *args, **kwargs): ...
{ "repo_name": "f-prettyland/angr", "path": "angr/engines/failure.py", "copies": "1", "size": "1602", "license": "bsd-2-clause", "hash": 7667723125354075000, "line_mean": 31.04, "line_max": 106, "alpha_frac": 0.6379525593, "autogenerated": false, "ratio": 3.869565217391304, "config_test": false,...
from .engine import SimEngine import logging l = logging.getLogger(name=__name__) class SimEngineFailure(SimEngine): #pylint:disable=abstract-method def _check(self, state, *args, **kwargs): jumpkind = state.history.jumpkind if jumpkind in ('Ijk_EmFail', 'Ijk_MapFail') or (jumpkind is not None an...
{ "repo_name": "iamahuman/angr", "path": "angr/engines/failure.py", "copies": "1", "size": "1204", "license": "bsd-2-clause", "hash": -4807716672026833000, "line_mean": 36.625, "line_max": 114, "alpha_frac": 0.6669435216, "autogenerated": false, "ratio": 3.750778816199377, "config_test": false, ...
from engine import State, Achievement, Transition def achievements_msg(state): msg = '\n' for achievement in state.achievements: msg += '[%s] ' % 'X' if achievement.title in state.unlocked_achievements else '' msg += achievement.title msg += ' - ' msg += achievement.msg ...
{ "repo_name": "farragar/game-engine", "path": "src/example_game.py", "copies": "1", "size": "1406", "license": "mit", "hash": -1657052354092466400, "line_mean": 23.2413793103, "line_max": 91, "alpha_frac": 0.5021337127, "autogenerated": false, "ratio": 3.7795698924731185, "config_test": false, ...
from engine import Update; # --------------------------------------------------- *\ # Background Behaviour # --------------------------------------------------- */ currentPlayer = None; currentBackground = None; # --------------------------------------------------- *\ # [function] setActive() # # * Active the bac...
{ "repo_name": "WilliamDASILVA/TheMysteryOfSchweitzer", "path": "gameplay/behaviours/backgroundBehaviour.py", "copies": "1", "size": "1410", "license": "mit", "hash": -3568599493681175600, "line_mean": 27.22, "line_max": 56, "alpha_frac": 0.4304964539, "autogenerated": false, "ratio": 4.3925233644...
from ..engine import Vec2 class Direction: """ Represents a direction an entity can move in """ NO_MOVEMENT = Vec2(0,0) def __init__(self, direction): """ Initialize with the direction vector to use """ self.direction = Vec2(direction).unitVector self.moving = False ...
{ "repo_name": "cloew/NytramBox2D", "path": "nytram_box2d/movement/direction.py", "copies": "1", "size": "1206", "license": "mit", "hash": 469791177865634940, "line_mean": 31.5555555556, "line_max": 118, "alpha_frac": 0.5613598673, "autogenerated": false, "ratio": 4.748031496062992, "config_test...
from engine.Input import Keyboard; from engine import Update; from engine import Global; # --------------------------------------------------- *\ # Player behaviour # --------------------------------------------------- */ player = None; controlsEnabled = False; scale = Global.scale; # ------------------------------...
{ "repo_name": "WilliamDASILVA/TheMysteryOfSchweitzer", "path": "gameplay/behaviours/playerBehaviour.py", "copies": "1", "size": "4453", "license": "mit", "hash": -4551045715095725600, "line_mean": 25.8253012048, "line_max": 63, "alpha_frac": 0.5106669661, "autogenerated": false, "ratio": 3.704658...
from engineio_client.emitter import Emitter from engineio_client.client import Client as EngineIOClient from engineio_client.utils import format_long from .parser import Parser, ParserException, PacketException from .socket import Socket import gevent import logging logger = logging.getLogger(__name__) class Manager(...
{ "repo_name": "veo-labs/python-socketio-client", "path": "socketio_client/manager.py", "copies": "1", "size": "5955", "license": "mit", "hash": 8440475848276664000, "line_mean": 30.3421052632, "line_max": 97, "alpha_frac": 0.5884130982, "autogenerated": false, "ratio": 4.337217771303714, "confi...
from engineio_client.emitter import Emitter from engineio_client.utils import format_long from .parser import Packet import logging logger = logging.getLogger(__name__) class Socket(object): def __init__(self, namespace, manager): self.namespace = namespace self.manager = manager self.sta...
{ "repo_name": "veo-labs/python-socketio-client", "path": "socketio_client/socket.py", "copies": "1", "size": "5777", "license": "mit", "hash": -2780885874350316500, "line_mean": 30.5683060109, "line_max": 74, "alpha_frac": 0.5992729791, "autogenerated": false, "ratio": 4.045518207282913, "confi...
from engine.move import move_at_state from react.react_chess_to_IZII_state import react_chess_board_to_IZII_board from engine.search import best_move from engine.utils import print_board from engine.utils import int_sq120_sq64, sq64_to_RF, RF_sq64, sq64_to_sq120 from engine.gen_moves import get_all_moves_at_state impor...
{ "repo_name": "ElliotVilhelm/IZII", "path": "react/validate_move.py", "copies": "1", "size": "1418", "license": "mit", "hash": 8452871457048793000, "line_mean": 29.8260869565, "line_max": 114, "alpha_frac": 0.6114245416, "autogenerated": false, "ratio": 2.601834862385321, "config_test": false, ...