text stringlengths 0 1.05M | meta dict |
|---|---|
from eventlet.support import get_errno
from eventlet.hubs import trampoline
BUFFER_SIZE = 4096
import array
import errno
import os
import socket
from socket import socket as _original_socket
import sys
import time
import warnings
__all__ = ['GreenSocket', 'GreenPipe', 'shutdown_safe']
CONNECT_ERR = set((errno.EINPRO... | {
"repo_name": "neumerance/cloudloon2",
"path": ".venv/lib/python2.7/site-packages/eventlet/greenio.py",
"copies": "2",
"size": "19317",
"license": "apache-2.0",
"hash": -7584076895347514000,
"line_mean": 32.3626943005,
"line_max": 119,
"alpha_frac": 0.5698089765,
"autogenerated": false,
"ratio": ... |
from eventlet.support import get_errno
from eventlet.hubs import trampoline
BUFFER_SIZE = 4096
import errno
import os
import socket
from socket import socket as _original_socket
import sys
import time
import warnings
__all__ = ['GreenSocket', 'GreenPipe', 'shutdown_safe']
CONNECT_ERR = set((errno.EINPROGRESS, errno.... | {
"repo_name": "hortonworks/hortonworks-sandbox",
"path": "desktop/core/ext-py/eventlet-0.9.14/eventlet/greenio.py",
"copies": "4",
"size": "18055",
"license": "apache-2.0",
"hash": -3923469516336628000,
"line_mean": 32.6219739292,
"line_max": 119,
"alpha_frac": 0.5687621158,
"autogenerated": false,... |
from eventlet.support import greenlets as greenlet
from eventlet.hubs import get_hub
""" If true, captures a stack trace for each timer when constructed. This is
useful for debugging leaking timers, to find out where the timer was set up. """
_g_debug = False
class Timer(object):
def __init__(self, seconds, cb, ... | {
"repo_name": "2013Commons/HUE-SHARK",
"path": "desktop/core/ext-py/eventlet-0.9.14/eventlet/hubs/timer.py",
"copies": "13",
"size": "3196",
"license": "apache-2.0",
"hash": 2800307696273582600,
"line_mean": 30.0291262136,
"line_max": 80,
"alpha_frac": 0.5506883605,
"autogenerated": false,
"ratio... |
from eventlet.timeout import Timeout
from vertigo_middleware.gateways.docker.bus import Bus
from vertigo_middleware.gateways.docker.datagram import Datagram
import select
import json
import os
import subprocess
import time
import cmd
SBUS_FD_INPUT_OBJECT = 0
SBUS_FD_OUTPUT_OBJECT = 1
SBUS_FD_OUTPUT_OBJECT_METADATA = 2... | {
"repo_name": "iostackproject/Swift-Microcontroller",
"path": "Engine/swift/vertigo_middleware/gateways/docker/runtime.py",
"copies": "1",
"size": "9973",
"license": "apache-2.0",
"hash": -4443691495717176000,
"line_mean": 31.3798701299,
"line_max": 89,
"alpha_frac": 0.5489822521,
"autogenerated": ... |
from eventlet.zipkin import http
from eventlet.zipkin import wsgi
from eventlet.zipkin import greenthread
from eventlet.zipkin import log
from eventlet.zipkin import api
from eventlet.zipkin.client import ZipkinClient
def enable_trace_patch(host='127.0.0.1', port=9410,
trace_app_log=False, samp... | {
"repo_name": "thekingofkings/focusread",
"path": "libs/eventlet/zipkin/patcher.py",
"copies": "7",
"size": "1388",
"license": "mit",
"hash": -6054747667557607000,
"line_mean": 32.8536585366,
"line_max": 73,
"alpha_frac": 0.689481268,
"autogenerated": false,
"ratio": 3.802739726027397,
"config_... |
from eventregistry import *
# er = EventRegistry(host = "http://eventregistry.org", logging = True)
er = EventRegistry(host = "http://babaji.ijs.si:8090", logging = True)
def createTopicPage1():
"""
create a topic page directly
"""
topic = TopicPage(er)
topic.addKeyword("renewable energy", 30)
... | {
"repo_name": "EventRegistry/event-registry-python",
"path": "eventregistry/examples/TopicPagesExamples.py",
"copies": "1",
"size": "3662",
"license": "mit",
"hash": -8205185080339362000,
"line_mean": 30.5775862069,
"line_max": 108,
"alpha_frac": 0.7113599126,
"autogenerated": false,
"ratio": 3.6... |
from Events.activityEvent import *
from Events.tick import *
from Events.quit import *
from Events.touch import *
import pygame
from pygame.constants import *
class TouchController:
def __init__(self, evManager, viewController):
self.evManager = evManager
self.evManager.RegisterListener(self)
... | {
"repo_name": "ismaelgaudioso/pihome",
"path": "Controllers/touch.py",
"copies": "1",
"size": "1110",
"license": "mit",
"hash": 1080627247734955800,
"line_mean": 31.6470588235,
"line_max": 75,
"alpha_frac": 0.5144144144,
"autogenerated": false,
"ratio": 4.847161572052402,
"config_test": false,
... |
from events.event import EventBase
from events.models import EnrollmentLog
from events.exceptions import EventException, UnhandledActionCodeException
from restclients.models.sws import Term, Section
from restclients.models.canvas import CanvasEnrollment
from dateutil.parser import parse as date_parse
log_prefix = 'EN... | {
"repo_name": "uw-it-aca/canvas-event-consumer",
"path": "events/enrollment.py",
"copies": "1",
"size": "4175",
"license": "apache-2.0",
"hash": 4099156163178516000,
"line_mean": 37.6574074074,
"line_max": 81,
"alpha_frac": 0.565508982,
"autogenerated": false,
"ratio": 4.494079655543596,
"confi... |
from events.event import EventBase
from events.models import PersonLog
from restclients.models.sws import Person as PersonModel
from sis_provisioner.models import User, PRIORITY_HIGH
from events.exceptions import EventException
log_prefix = 'PERSON:'
class Person(EventBase):
"""
Collects Person Change Event... | {
"repo_name": "uw-it-aca/canvas-event-consumer",
"path": "events/person.py",
"copies": "1",
"size": "1835",
"license": "apache-2.0",
"hash": 5601149172935633000,
"line_mean": 32.3636363636,
"line_max": 71,
"alpha_frac": 0.6185286104,
"autogenerated": false,
"ratio": 4.0153172866520785,
"config_... |
from events.game import Event, UserEvent
import hlib.api
# pylint: disable-msg=F0401
import hruntime # @UnresolvedImport
#
# Base classes
#
class ThiefEvent(Event):
def __init__(self, thief = None, victim = None, **kwargs):
Event.__init__(self, **kwargs)
self.thief = thief
self.victim = victim
d... | {
"repo_name": "happz/settlers",
"path": "src/events/game/settlers/__init__.py",
"copies": "1",
"size": "3564",
"license": "mit",
"hash": 7031859343547298000,
"line_mean": 20.0887573964,
"line_max": 77,
"alpha_frac": 0.6523569024,
"autogenerated": false,
"ratio": 3.025466893039049,
"config_test"... |
from events.gateways import PlacesGateway, settings
from events.models import City, Location
class PlacesService:
def get_city_predictions(self, description, language):
response = PlacesGateway().get_cities_by_description(description, language)
return response.json()['predictions']
def get_p... | {
"repo_name": "thiagoferreiraw/mixapp",
"path": "events/services.py",
"copies": "1",
"size": "3974",
"license": "mit",
"hash": 8694812537808356000,
"line_mean": 42.6813186813,
"line_max": 126,
"alpha_frac": 0.5407649723,
"autogenerated": false,
"ratio": 4.3101952277657265,
"config_test": false,... |
from events import AstroEvent
from events import AstroTime
from objects import AstroObject
from networks import AstroNetwork
from fields import AstroField
from locations import Distance
"""
Case study: The impacts of Supernova 2011fe
Sources:
http://cdsarc.u-strasbg.fr/viz-bin/Cat?J/other/NewA/20.30
https://arxiv.org/... | {
"repo_name": "spatial-ucsb/ConceptsOfSpatialInformation",
"path": "CoreConceptsPy/Astronomic_Spaces/case_examples/events/events_cases.py",
"copies": "2",
"size": "2681",
"license": "apache-2.0",
"hash": 461549939539780740,
"line_mean": 39.6212121212,
"line_max": 119,
"alpha_frac": 0.6482655725,
"a... |
from .events import BlazeEventsLoader
from zipline.pipeline.common import SID_FIELD_NAME, TS_FIELD_NAME
from zipline.pipeline.data import ConsensusEstimates
from zipline.pipeline.loaders import ConsensusEstimatesLoader
from zipline.pipeline.loaders.consensus_estimates import (
ACTUAL_VALUE_FIELD_NAME,
COUNT_FIE... | {
"repo_name": "wilsonkichoi/zipline",
"path": "zipline/pipeline/loaders/blaze/consensus_estimates.py",
"copies": "2",
"size": "3252",
"license": "apache-2.0",
"hash": -1362232213374553900,
"line_mean": 33.5957446809,
"line_max": 77,
"alpha_frac": 0.6608241082,
"autogenerated": false,
"ratio": 3.6... |
from events import Events
class Subroutine(object):
def __init__(self,
readObj,
trackID, uniqueTrackID,
offset, eventParser,
customSubroutineHandler = None):
self.bmsHandle = readObj.hdlr
self.read = readObj
... | {
"repo_name": "RenolY2/py-playBMS",
"path": "bmsmodules/Subroutine.py",
"copies": "1",
"size": "5464",
"license": "bsd-3-clause",
"hash": 1919703960395434200,
"line_mean": 31.5238095238,
"line_max": 88,
"alpha_frac": 0.5975475842,
"autogenerated": false,
"ratio": 4.105184072126221,
"config_test... |
from .._events import *
from .._state import *
from .._connection import *
def get_all_events(conn):
got_events = []
while True:
event = conn.next_event()
if event in (NEED_DATA, PAUSED):
break
got_events.append(event)
if type(event) is ConnectionClosed:
... | {
"repo_name": "njsmith/h11",
"path": "h11/tests/helpers.py",
"copies": "1",
"size": "2524",
"license": "mit",
"hash": -8407817134410264000,
"line_mean": 33.5753424658,
"line_max": 78,
"alpha_frac": 0.6030110935,
"autogenerated": false,
"ratio": 3.9623233908948197,
"config_test": false,
"has_n... |
# from events.models import Event, EventType
#
# def validate_entrants(person, partner, event_type):
# """
# Check that gender is right for the competition.
# Return None if OK else return an error message
# """
# err_male = 'Person must be male'
# err_female = 'Person must be female'
# err_... | {
"repo_name": "ianastewart/cwltc-admin",
"path": "events/utils.py",
"copies": "1",
"size": "1802",
"license": "mit",
"hash": -4217315988905781000,
"line_mean": 33.6538461538,
"line_max": 56,
"alpha_frac": 0.5321864595,
"autogenerated": false,
"ratio": 3.4323809523809525,
"config_test": false,
... |
from events.models import Event, Feature, User, Rating, EventFeature, FeatureUser
from app_config import *
from matrix_2d import Matrix2D
from matrix_1d import Matrix1D
from numpy import log10, sqrt
class Recommendation:
"""
Class allows every necessary operations to compute a recommendation
"""... | {
"repo_name": "Diego999/Social-Recommendation-System",
"path": "recommendation/recommendation.py",
"copies": "1",
"size": "8355",
"license": "mit",
"hash": -848002403569593700,
"line_mean": 33.5617021277,
"line_max": 190,
"alpha_frac": 0.5151406344,
"autogenerated": false,
"ratio": 3.716637010676... |
from events.models import UserActivity
from supplements.models import Ingredient, Measurement, IngredientComposition, Supplement, UserSupplementStack, \
UserSupplementStackComposition
DEFAULT_ACTIVITIES = [
'Meditated',
'Went to Gym'
]
SPECIAL_ACTIVITIES = [
'Started New Job',
]
class DefaultEventsB... | {
"repo_name": "jeffshek/betterself",
"path": "events/utils/default_events_builder.py",
"copies": "1",
"size": "2596",
"license": "mit",
"hash": 2055597843730633700,
"line_mean": 32.7142857143,
"line_max": 113,
"alpha_frac": 0.6452234206,
"autogenerated": false,
"ratio": 3.8176470588235296,
"con... |
from Events.screenSaver import *
from Events.switchView import SwitchViewEvent
from Events.tick import *
from Events.quit import *
from Events.activityEvent import *
import pygame
class TickController:
"""
Controller that generates subsecond scheduled events
"""
def __init__(self, evManager):
se... | {
"repo_name": "ismaelgaudioso/pihome",
"path": "Controllers/tick.py",
"copies": "1",
"size": "1127",
"license": "mit",
"hash": 3830961961308724700,
"line_mean": 25.8333333333,
"line_max": 59,
"alpha_frac": 0.5838509317,
"autogenerated": false,
"ratio": 4.544354838709677,
"config_test": false,
... |
from Events.screenSaver import ScreenSaverEvent
from Views.Sections.Subsections.AutomationScenesView import AutomationScenesView
from Views.mainview import *
from Views.screenSaverView import ScreenSaverView
from Views.weatherView import *
from Views.Sections.automationView import *
from Views.Sections.mediaView import... | {
"repo_name": "ismaelgaudioso/pihome",
"path": "Controllers/view.py",
"copies": "1",
"size": "3493",
"license": "mit",
"hash": 585662516760686600,
"line_mean": 43.7948717949,
"line_max": 222,
"alpha_frac": 0.6180933295,
"autogenerated": false,
"ratio": 4.17822966507177,
"config_test": false,
... |
from Events.touch import *
from Events.viewSection import *
import pygame
class MenuOption:
CENTER_TOP = 0
MIDDLE = 1
CENTER_BOTTOM = 2
LEFT_MIDDLE = 3
RIGHT_MIDDLE = 4
LEFT_TOP = 5
RIGHT_TOP = 6
LEFT_BOTTOM = 7
RIGHT_BOTTOM = 8
def __init__(self, evManager, name, viewContain... | {
"repo_name": "ismaelgaudioso/pihome",
"path": "Libraries/MenuOption.py",
"copies": "1",
"size": "2531",
"license": "mit",
"hash": -4422803138812362000,
"line_mean": 31.0506329114,
"line_max": 99,
"alpha_frac": 0.597392335,
"autogenerated": false,
"ratio": 3.694890510948905,
"config_test": fals... |
from Events.touch import *
from Events.switchView import *
import pygame
from Events.viewSection import ViewSectionEvent
class Button:
CENTER_TOP = 0
MIDDLE = 1
CENTER_BOTTOM = 2
LEFT_MIDDLE = 3
RIGHT_MIDDLE = 4
LEFT_TOP = 5
RIGHT_TOP = 6
LEFT_BOTTOM = 7
RIGHT_BO... | {
"repo_name": "ismaelgaudioso/pihome",
"path": "Libraries/Buttons.py",
"copies": "1",
"size": "2790",
"license": "mit",
"hash": -4954712457684865000,
"line_mean": 30.4651162791,
"line_max": 99,
"alpha_frac": 0.5831541219,
"autogenerated": false,
"ratio": 3.8114754098360657,
"config_test": false... |
from everest.entities.utils import slug_from_string
from everest.repositories.rdb.testing import check_attributes
from everest.repositories.rdb.testing import persist
from thelma.tests.entity.conftest import TestEntityBase
class TestTagEntity(TestEntityBase):
def test_init(self, tag_fac):
tag = tag_fac()... | {
"repo_name": "helixyte/TheLMA",
"path": "thelma/tests/entity/test_tagging.py",
"copies": "1",
"size": "2217",
"license": "mit",
"hash": -5346650546901657000,
"line_mean": 34.1904761905,
"line_max": 74,
"alpha_frac": 0.6170500677,
"autogenerated": false,
"ratio": 3.5246422893481717,
"config_tes... |
from everest.repositories.rdb import Session
from sqlalchemy.engine import create_engine
from sqlalchemy.orm import joinedload
from thelma.repositories.rdb import create_metadata
from thelma.entities.moleculedesign import MoleculeDesignPool
import os
import sys
COMMIT = False
WARNINGS = []
db_server = 'raven'
db_por... | {
"repo_name": "helixyte/TheLMA",
"path": "thelma/repositories/rdb/sql/migrate_script_209_0002.py",
"copies": "1",
"size": "1809",
"license": "mit",
"hash": -6625851410150182000,
"line_mean": 29.15,
"line_max": 67,
"alpha_frac": 0.6832504146,
"autogenerated": false,
"ratio": 3.23613595706619,
"c... |
from everest.repositories.rdb import Session
from sqlalchemy.engine import create_engine
from thelma.repositories.rdb import create_metadata
from thelma.entities.rack import RackPosition
from thelma.entities.utils import label_from_number
# If this is set to True, the changes will be committed when the script
# compl... | {
"repo_name": "helixyte/TheLMA",
"path": "thelma/repositories/rdb/sql/migrate_script_209_0011.py",
"copies": "1",
"size": "1220",
"license": "mit",
"hash": -493631262618570700,
"line_mean": 25.5217391304,
"line_max": 73,
"alpha_frac": 0.6893442623,
"autogenerated": false,
"ratio": 3.0423940149625... |
from everest.repositories.rdb.testing import check_attributes
from everest.repositories.rdb.testing import persist
from thelma.tests.entity.conftest import TestEntityBase
class TestMoleculeDesignLibraryEntity(TestEntityBase):
def test_init(self, molecule_design_library_fac):
mdl = molecule_design_library... | {
"repo_name": "helixyte/TheLMA",
"path": "thelma/tests/entity/test_library.py",
"copies": "1",
"size": "1276",
"license": "mit",
"hash": -2366316803520310300,
"line_mean": 36.5294117647,
"line_max": 73,
"alpha_frac": 0.6763322884,
"autogenerated": false,
"ratio": 3.574229691876751,
"config_test... |
from everett.manager import ConfigManager, ConfigurationMissingError
from mock import patch
from bedrock.base import waffle_config
from bedrock.mozorg.tests import TestCase
GOOD_CONFIG = {
'THE_DUDE': 'abides',
'BOWLING': 'true',
}
@patch.object(waffle_config, 'get_config_dict',
return_value=... | {
"repo_name": "mozilla/bedrock",
"path": "bedrock/base/tests/test_waffle_config.py",
"copies": "4",
"size": "2532",
"license": "mpl-2.0",
"hash": 94618522448107980,
"line_mean": 31.0506329114,
"line_max": 72,
"alpha_frac": 0.5900473934,
"autogenerated": false,
"ratio": 3.2050632911392407,
"conf... |
from evergreen.channel import Channel
from functools import wraps
from functools import partial
import logging
logger = logging.getLogger(__name__)
def coro(func):
@wraps(func)
def start(*args,**kwargs):
cr = func(*args,**kwargs)
cr.next()
return cr
return start
def message_exe... | {
"repo_name": "whitmo/lifeboat",
"path": "lifeboat/actor.py",
"copies": "1",
"size": "3120",
"license": "mit",
"hash": 5609663828940114000,
"line_mean": 27.623853211,
"line_max": 92,
"alpha_frac": 0.6150641026,
"autogenerated": false,
"ratio": 3.9543726235741445,
"config_test": false,
"has_no... |
from evernote.api.client import EvernoteClient
from evernote.edam.type.ttypes import Note
from evernote.edam.error.ttypes import EDAMUserException,EDAMSystemException,EDAMNotFoundException
def saveToEvernote(history):
EN_URL = 'https://sandbox.evernote.com'
dev_token = "S=s1:U=8d5df:E=14a1ce2575a:C=142c5312b5c... | {
"repo_name": "shellyan/cs-339-chatapp",
"path": "src/server/saveToEvernote.py",
"copies": "1",
"size": "1872",
"license": "mit",
"hash": -1782416045238082800,
"line_mean": 29.1935483871,
"line_max": 124,
"alpha_frac": 0.7126068376,
"autogenerated": false,
"ratio": 3.04885993485342,
"config_tes... |
from evernote.api.client import EvernoteClient
from django.core.urlresolvers import reverse
from django.shortcuts import render_to_response
from django.shortcuts import redirect
EN_CONSUMER_KEY = 'your consumer key'
EN_CONSUMER_SECRET = 'your consumer secret'
def get_evernote_client(token=None):
if token:
... | {
"repo_name": "gelisam/evercal",
"path": "sample/django/oauth/views.py",
"copies": "2",
"size": "1659",
"license": "bsd-2-clause",
"hash": 8078418563368631000,
"line_mean": 27.6034482759,
"line_max": 79,
"alpha_frac": 0.673297167,
"autogenerated": false,
"ratio": 3.858139534883721,
"config_test... |
from evernote.api.client import EvernoteClient
from django.core.urlresolvers import reverse
from django.shortcuts import render_to_response
from django.shortcuts import redirect
# rename config.py.template to config.py and paste your credentials.
from config import EN_CONSUMER_KEY, EN_CONSUMER_SECRET
def get_evernot... | {
"repo_name": "rdhyee/evernote-sdk-python",
"path": "sample/django/oauth/views.py",
"copies": "2",
"size": "1700",
"license": "bsd-2-clause",
"hash": 1283916499303848000,
"line_mean": 29.3571428571,
"line_max": 79,
"alpha_frac": 0.6794117647,
"autogenerated": false,
"ratio": 3.8812785388127855,
... |
from evernote import *
NOTE1 = """<note>
<guid>6BA8DC47-EB38-40D9-BE32-5D5DD82E9EC7</guid>
<created>2013-07-12T19:22:13Z</created>
<tag>poetry</tag>
<tag>whitman</tag>
<content>
Gliding o'er all, through all,
Through Nature, Time, and Space,
As a ship on the waters advancing,
The voyage of th... | {
"repo_name": "py-in-the-sky/challenges",
"path": "evernote_test.py",
"copies": "1",
"size": "3476",
"license": "mit",
"hash": 1023513549743184900,
"line_mean": 36.376344086,
"line_max": 84,
"alpha_frac": 0.6616800921,
"autogenerated": false,
"ratio": 2.6676899462778203,
"config_test": false,
... |
from evesrp.killmail import CRESTMail, ZKillmail
from flask import Markup, current_app
from decimal import Decimal
class ZeroValueZKillboard(ZKillmail):
@property
def value(self):
return 0
class ZeroValueSubmittedCRESTZKillmail(CRESTMail):
"""Accepts and validates CREST killmail links, but subm... | {
"repo_name": "eskwire/evesrp",
"path": "example/custom_killmails.py",
"copies": "1",
"size": "1069",
"license": "bsd-2-clause",
"hash": 8968944965724530000,
"line_mean": 34.6333333333,
"line_max": 73,
"alpha_frac": 0.6398503274,
"autogenerated": false,
"ratio": 3.9014598540145986,
"config_test... |
from evesrp.killmail import ESIMail, ZKillmail
from flask import Markup, current_app
from decimal import Decimal
class ZeroValueZKillboard(ZKillmail):
@property
def value(self):
return 0
class ZeroValueSubmittedESIZKillmail(ESIMail):
"""Accepts and validates ESI killmail links, but submits them... | {
"repo_name": "paxswill/evesrp",
"path": "example/custom_killmails.py",
"copies": "1",
"size": "1054",
"license": "bsd-2-clause",
"hash": -5569699980010193000,
"line_mean": 34.1333333333,
"line_max": 73,
"alpha_frac": 0.6347248577,
"autogenerated": false,
"ratio": 3.860805860805861,
"config_tes... |
from eve.tests import TestBase
from eve.tests.utils import DummyEvent
from eve.tests.test_settings import MONGO_DBNAME
from eve import ETAG
from bson import ObjectId
from eve.utils import ParsedRequest
import simplejson as json
import copy
from eve.methods.delete import deleteitem_internal
class TestDelete(TestBase)... | {
"repo_name": "kalbasit/eve",
"path": "eve/tests/methods/delete.py",
"copies": "3",
"size": "29732",
"license": "bsd-3-clause",
"hash": -2722363034636253700,
"line_mean": 39.6730506156,
"line_max": 86,
"alpha_frac": 0.6181891565,
"autogenerated": false,
"ratio": 3.84035133040558,
"config_test":... |
from eve.tests import TestBase
from eve.tests.utils import DummyEvent
from eve.tests.test_settings import MONGO_DBNAME
from eve import ETAG
from bson import ObjectId
class TestDelete(TestBase):
def setUp(self):
super(TestDelete, self).setUp()
# Etag used to delete an item (a contact)
self.... | {
"repo_name": "Jumpscale/web",
"path": "pythonlib/eve/tests/methods/delete.py",
"copies": "1",
"size": "11635",
"license": "apache-2.0",
"hash": 8904751481179684000,
"line_mean": 37.9130434783,
"line_max": 79,
"alpha_frac": 0.6238074774,
"autogenerated": false,
"ratio": 3.6866286438529783,
"con... |
from eve.tests import TestBase
from pymongo import MongoClient
from pymongo.errors import OperationFailure
from eve.tests.test_settings import MONGO1_DBNAME, MONGO1_USERNAME, \
MONGO1_PASSWORD, MONGO_HOST, MONGO_PORT
from eve.io.mongo.flask_pymongo import PyMongo
class TestPyMongo(TestBase):
def setUp(self, u... | {
"repo_name": "Martin456/eve",
"path": "eve/tests/io/flask_pymongo.py",
"copies": "1",
"size": "2602",
"license": "bsd-3-clause",
"hash": -3367553307828297000,
"line_mean": 36.7101449275,
"line_max": 76,
"alpha_frac": 0.6118370484,
"autogenerated": false,
"ratio": 3.5939226519337018,
"config_te... |
from eve.tests import TestBase
import time
class TestRateLimit(TestBase):
def setUp(self):
super(TestRateLimit, self).setUp()
try:
from redis import Redis, ConnectionError
self.app.redis = Redis()
try:
self.app.redis.flushdb()
except ... | {
"repo_name": "Martin456/eve",
"path": "eve/tests/methods/ratelimit.py",
"copies": "9",
"size": "2392",
"license": "bsd-3-clause",
"hash": 8733430880022425000,
"line_mean": 34.1764705882,
"line_max": 75,
"alpha_frac": 0.5706521739,
"autogenerated": false,
"ratio": 3.749216300940439,
"config_tes... |
from eve.utils import config
import jwt
def verify_token(token, secret, issuer, method=None, audiences=None, allowed_roles=None):
# Try to decode token with each allowed audience
def decode(audience=None):
return jwt.decode(token, key=secret, issuer=issuer, audience=audience)
if not audiences:
... | {
"repo_name": "rs/eve-auth-jwt",
"path": "eve_auth_jwt/verify_token.py",
"copies": "1",
"size": "1687",
"license": "mit",
"hash": 7507044450524165000,
"line_mean": 34.1458333333,
"line_max": 89,
"alpha_frac": 0.6058091286,
"autogenerated": false,
"ratio": 3.9324009324009324,
"config_test": true... |
from evilsheep.catalog.models import Movie, SubCategory
from evilsheep.utils.utils import slugify
from django.core.files import File
import xml.dom.minidom
import urllib
import os
def get_a_document(name="/tmp/doc.xml"):
return xml.dom.minidom.parse(name)
dom = get_a_document(os.path.join(os.path.dirname(os.pat... | {
"repo_name": "bmac/evilsheep",
"path": "catalog/parser.py",
"copies": "1",
"size": "2020",
"license": "bsd-2-clause",
"hash": 3573702551998504000,
"line_mean": 23.6341463415,
"line_max": 101,
"alpha_frac": 0.6544554455,
"autogenerated": false,
"ratio": 3.556338028169014,
"config_test": false,
... |
from ev import CmdSet
from CmdCombat import CmdFlee, CmdCombatRescue, CmdCombatStrike, CmdCombatMove
from CmdCombat import CmdStopCombat, CmdLongswordCombo, CmdAxeCombo, CmdMaceCombo
from CmdCombat import CmdGreatswordCombo, CmdStaveCombo, CmdDaggerCombo, CmdSpearCombo
from CmdCombat import CmdShieldCombo
"""
Command s... | {
"repo_name": "cluebyte/Fantasy-Combat",
"path": "combat/commands/CmdSetCombat.py",
"copies": "1",
"size": "1998",
"license": "bsd-2-clause",
"hash": 5375073683349851000,
"line_mean": 28.8358208955,
"line_max": 86,
"alpha_frac": 0.6906906907,
"autogenerated": false,
"ratio": 3.050381679389313,
... |
from ev import Command, CmdSet
from src.commands.default.muxcommand import MuxCommand
class CmdAttack(Command):
"""
Begin to fight a target, typically an npc enemy.
Usage:
attack target-name
"""
key = 'attack'
aliases = ['kill']
help_category = "Combat"
locks = "cmd:all()"
... | {
"repo_name": "GhostshipSoftware/avaloria",
"path": "game/gamesrc/commands/world/character_commands.py",
"copies": "1",
"size": "7180",
"license": "bsd-3-clause",
"hash": -3607109170414803000,
"line_mean": 27.9516129032,
"line_max": 116,
"alpha_frac": 0.5498607242,
"autogenerated": false,
"ratio"... |
from ev import Command, CmdSet
class ShipCommandSet(CmdSet):
"""
This command set gets attached to all ships via the ship computer. They are accessible to anyone in the cockpit.
"""
def at_cmdset_creation(self):
self.add(TakeOffCmd)
self.add(LandShipCmd)
pass
class BoardShip... | {
"repo_name": "Pathel/deuterium",
"path": "game/gamesrc/commands/deuterium/ships/ship_commands.py",
"copies": "1",
"size": "3273",
"license": "bsd-3-clause",
"hash": 5252222902039379000,
"line_mean": 21.4246575342,
"line_max": 117,
"alpha_frac": 0.5817293003,
"autogenerated": false,
"ratio": 3.79... |
from ev import create_script
from ev import search_script
from ev import Script
from ev import logger
from game.gamesrc.combat import move
from game.gamesrc.combat import resolve_combat
from game.gamesrc.combat import combo
import random
COMBAT_ROUND_TIMEOUT = 40
ROOM_DEPTH = 3
STATUS_STORAGE = search_script("StatusSt... | {
"repo_name": "cluebyte/Fantasy-Combat",
"path": "combat/scripts/combat_handler.py",
"copies": "1",
"size": "27865",
"license": "bsd-2-clause",
"hash": 3517926882154670600,
"line_mean": 41.4786585366,
"line_max": 79,
"alpha_frac": 0.5709312758,
"autogenerated": false,
"ratio": 4.097794117647059,
... |
from ev import logger
from game.gamesrc.combat.objects import armor
import random
from game.gamesrc.combat.objects import weapons
from game.gamesrc.combat import combo
from game.gamesrc.combat import move
from ev import search_script
# constants
WEAP_MAX_QUALITY = 4
WEAP_MIN_QUALITY = 1
ARMOR_MAX_QUALITY = 4
ARMOR_MIN... | {
"repo_name": "cluebyte/Fantasy-Combat",
"path": "combat/resolve_combat.py",
"copies": "1",
"size": "51571",
"license": "bsd-2-clause",
"hash": 7944784903899547000,
"line_mean": 41.7628524046,
"line_max": 105,
"alpha_frac": 0.5698551512,
"autogenerated": false,
"ratio": 3.2783039857606,
"config... |
from ev import logger
# This is the module that contains all of the combat move objects in the game.
# There should only need to be one move set in existence that the game uses
# which is reflected in the variable CLASSIC_MATRIX. But perhaps later with
# magic and archery, we'll have more moves players can do.
clas... | {
"repo_name": "cluebyte/Fantasy-Combat",
"path": "combat/move.py",
"copies": "1",
"size": "11371",
"license": "bsd-2-clause",
"hash": 4850373417775226000,
"line_mean": 38.2137931034,
"line_max": 112,
"alpha_frac": 0.6339811802,
"autogenerated": false,
"ratio": 3.1463752075262867,
"config_test":... |
from ev import Object, Character, utils, create_object, create_channel, search_object_tag
from game.gamesrc.commands.world.character_commands import CharacterCmdSet
import random
from prettytable import PrettyTable
class Hero(Character):
"""
Main player character class
This class will be a very large pa... | {
"repo_name": "GhostshipSoftware/avaloria",
"path": "game/gamesrc/objects/world/character.py",
"copies": "1",
"size": "20353",
"license": "bsd-3-clause",
"hash": -4583746374266116600,
"line_mean": 41.0516528926,
"line_max": 172,
"alpha_frac": 0.5184985014,
"autogenerated": false,
"ratio": 4.00255... |
from ev import Object, create_object
import random
class ItemFactory(Object):
"""
Main Item generator. generates items based on list seeds.
This factory pumps out all the loot found on creatures and bosses
alike in the game world. Currently in avaloria everything is player made,
so this is what ... | {
"repo_name": "GhostshipSoftware/avaloria",
"path": "game/gamesrc/objects/world/factories.py",
"copies": "1",
"size": "4278",
"license": "bsd-3-clause",
"hash": 7296473250978767000,
"line_mean": 37.5405405405,
"line_max": 149,
"alpha_frac": 0.5535296868,
"autogenerated": false,
"ratio": 3.5209876... |
from ev import Object
from prettytable import PrettyTable
import random
class Item(Object):
"""
base item class used for attributes and methods
global to all items regardless of type.
"""
def at_object_creation(self):
self.db.item_type = None
self.db.attributes = { 'weight': 1.0, '... | {
"repo_name": "GhostshipSoftware/avaloria",
"path": "game/gamesrc/objects/world/item.py",
"copies": "1",
"size": "2382",
"license": "bsd-3-clause",
"hash": 4712900419507643000,
"line_mean": 38.7,
"line_max": 124,
"alpha_frac": 0.516372796,
"autogenerated": false,
"ratio": 3.6422018348623855,
"c... |
from ev import Object
class CombatManager(Object):
"""
Main Combat management object.
"""
def at_object_creation(self):
self.db.pc_combatant = None
self.db.npc_combatant = None
self.db.round = 0
def do_round(self):
pc_initiative = self.db.pc_combatant.get_initiativ... | {
"repo_name": "GhostshipSoftware/avaloria",
"path": "game/gamesrc/objects/world/combat.py",
"copies": "1",
"size": "1878",
"license": "bsd-3-clause",
"hash": -8125752669203919000,
"line_mean": 36.56,
"line_max": 91,
"alpha_frac": 0.5383386581,
"autogenerated": false,
"ratio": 3.402173913043478,
... |
from ev import Object, search_object
import ev
from contrib.menusystem import *
import random
class Npc(Object):
"""
Main npc class that is used for hostiles and friendlies alike.
this controls any NON character entity that is a living being.
TODO:
cleanup the combat code and make it rele... | {
"repo_name": "GhostshipSoftware/avaloria",
"path": "game/gamesrc/objects/world/npc.py",
"copies": "1",
"size": "11151",
"license": "bsd-3-clause",
"hash": 2657849328554175000,
"line_mean": 40.6082089552,
"line_max": 364,
"alpha_frac": 0.5461393597,
"autogenerated": false,
"ratio": 3.719479653102... |
from ev import Script, create_object
class CombatController(Script):
"""
Main battle arbitration script
"""
def at_script_creation(self):
self.key = 'battle_arbiter'
self.interval = 5
self.persistent = False
self.desc = "Combat Management Script"
self.db.pc = s... | {
"repo_name": "GhostshipSoftware/avaloria",
"path": "game/gamesrc/scripts/world_scripts/combat.py",
"copies": "1",
"size": "1191",
"license": "bsd-3-clause",
"hash": 8104858190144685000,
"line_mean": 25.4666666667,
"line_max": 118,
"alpha_frac": 0.5675902603,
"autogenerated": false,
"ratio": 3.44... |
from ev import Script, search_object_tag
from src.utils import search
class MobRunner(Script):
"""
Controls the firing of the update function on the mob objects in the entire world.
"""
def at_script_creation(self):
self.key = 'mob_runner'
self.interval = 15
self.persistent = Tr... | {
"repo_name": "GhostshipSoftware/avaloria",
"path": "game/gamesrc/scripts/world_scripts/global.py",
"copies": "1",
"size": "2793",
"license": "bsd-3-clause",
"hash": 3784455403012680700,
"line_mean": 36.24,
"line_max": 89,
"alpha_frac": 0.6326530612,
"autogenerated": false,
"ratio": 3.43965517241... |
from evoflow.engine import EvoFlow
from evoflow.ops import Input, RandomMutations1D, UniformCrossover1D
from evoflow.ops import RandomMutations2D, UniformCrossover2D
from evoflow.selection import SelectFittest
from evoflow.fitness import Sum
from evoflow.population import randint_population
def solve_onmax_1d(args):
... | {
"repo_name": "google-research/evoflow",
"path": "benchmark/benchmark/problems/maxone.py",
"copies": "1",
"size": "1379",
"license": "apache-2.0",
"hash": 7095815016518854000,
"line_mean": 36.2702702703,
"line_max": 68,
"alpha_frac": 0.7447425671,
"autogenerated": false,
"ratio": 3.40493827160493... |
from evohomeclient2 import EvohomeClient
class HeatingControlClient(object):
def set_zone_temperature(self, zone_id, temperature, until=None):
print 'set {} to {} until {}'.format(zone_id, temperature, until)
def set_hotwater_on(self, until=None):
print 'set hotwater on until {}'.format(until)... | {
"repo_name": "kbhaines/evocli",
"path": "evocli/clients.py",
"copies": "1",
"size": "2227",
"license": "mit",
"hash": 7419216953632502000,
"line_mean": 31.2753623188,
"line_max": 115,
"alpha_frac": 0.6255051639,
"autogenerated": false,
"ratio": 3.5461783439490446,
"config_test": false,
"has_... |
from evolacc.userdata.simulations.genalg.factory import Initializer
from evolacc.userdata.simulations.genalg.watcher import PopViewer
from evolacc.userdata.simulations.genalg.genome import FunctionSolution
from evolacc.userdata.globals.alterators.genetic_algorithm import GeneticAlgori... | {
"repo_name": "Aluriak/EvolAcc",
"path": "evolacc/userdata/simulations/genalg/__init__.py",
"copies": "1",
"size": "1074",
"license": "mit",
"hash": 4898782468784761000,
"line_mean": 32.5625,
"line_max": 83,
"alpha_frac": 0.6378026071,
"autogenerated": false,
"ratio": 3.934065934065934,
"config... |
from evolution.crossovers import *
from evolution.fitness_functions import *
from evolution.parent_selections import *
from evolution.populations import *
class Evolution(object):
def __init__(self,conf):
#here goes all the "direct settings" like:
self.population_size = conf.population_size
... | {
"repo_name": "sindresf/The-Playground",
"path": "Python/Artificial Intelligence/Evolutionary Algorithm/G.E-A images/G.E-A generic/evolution/Evolution.py",
"copies": "1",
"size": "1753",
"license": "mit",
"hash": -6592857111749120000,
"line_mean": 38.8636363636,
"line_max": 101,
"alpha_frac": 0.67655... |
from evolution.evolution import Evolution
from deap import tools, creator, base, cma
import time
import numpy as np
import concurrent.futures
class EvolutionStrategy(Evolution):
def __init__(self, game, evolution_params, model, max_workers=2, logs_every=50):
super(EvolutionStrategy, self).__init__(game, e... | {
"repo_name": "Honkl/general-ai",
"path": "Controller/evolution/evolution_strategy.py",
"copies": "1",
"size": "3307",
"license": "mit",
"hash": 2956530110426077700,
"line_mean": 39.8395061728,
"line_max": 106,
"alpha_frac": 0.6062896885,
"autogenerated": false,
"ratio": 3.876905041031653,
"con... |
from evolution.evolution import Evolution
import time
import numpy as np
from deap import tools, creator, base
import concurrent.futures
class DifferentialEvolution(Evolution):
"""
Provides a differential evolution functions.
"""
def __init__(self, game, evolution_params, model, max_workers, logs_eve... | {
"repo_name": "Honkl/general-ai",
"path": "Controller/evolution/differential_evolution.py",
"copies": "1",
"size": "4644",
"license": "mit",
"hash": -2665696426982170600,
"line_mean": 39.7368421053,
"line_max": 113,
"alpha_frac": 0.6184323859,
"autogenerated": false,
"ratio": 3.7910204081632655,
... |
from evolution.evolution import Evolution
import time
import numpy as np
from deap import tools
class EvolutionaryAlgorithm(Evolution):
def __init__(self, game, evolution_params, model, max_workers=2, logs_every=50):
super(EvolutionaryAlgorithm, self).__init__(game, evolution_params, model, max_workers, l... | {
"repo_name": "Honkl/general-ai",
"path": "Controller/evolution/evolutionary_algorithm.py",
"copies": "1",
"size": "4120",
"license": "mit",
"hash": 1109130934760614100,
"line_mean": 41.0408163265,
"line_max": 107,
"alpha_frac": 0.6169902913,
"autogenerated": false,
"ratio": 3.755697356426618,
... |
from evoplotter import plotter
from evoplotter.dims import *
# Data
props = [
{"dimX": "A", "dimY": "C", "trainSet": "9,9,7,6,6,3,3,2,2,1", "validSet": "10,10,7,6,6,3,6,6,7,9"},
{"dimX": "A", "dimY": "C", "trainSet": "8,8,7,5,5,3,3,2,2,1", "validSet": "9,9,7,6,6,3,5,5,7,8"},
{"dimX": "A", "dimY": "C", "tr... | {
"repo_name": "iwob/evoplotter",
"path": "examples/plot_progression_grid.py",
"copies": "1",
"size": "2350",
"license": "mit",
"hash": 1710770995428661800,
"line_mean": 60.8684210526,
"line_max": 115,
"alpha_frac": 0.4961702128,
"autogenerated": false,
"ratio": 2.048823016564952,
"config_test":... |
from evoplotter import printer
from evoplotter import reporting
from evoplotter.dims import *
tableBody = r"""
P0 (3) & 0.70 & 0.54 & 0.34 & 0.42 & 0.88 & 0.94 & 1.00 & 1.00 & 0.58 & 0.66 & 0.40 & 0.58 & 0.72 & 0.82 & 1.00 & 1.00 & 0.00 & 0.00 & 0.72 \\
P1 (3) & 0.18 & ... | {
"repo_name": "iwob/evoplotter",
"path": "examples/table_variants.py",
"copies": "1",
"size": "7592",
"license": "mit",
"hash": 6096113352023296000,
"line_mean": 57.8604651163,
"line_max": 179,
"alpha_frac": 0.518967334,
"autogenerated": false,
"ratio": 2.456957928802589,
"config_test": false,
... |
from evoplotter import printer
text = r"""
& & & \multicolumn{3}{c}{EPS-L} & \multicolumn{3}{c}{EPS-B} \\
& $GP$ & $GP_{T}$ & $C$ & $V$ & $CV$ & $C$ & $V$ & $CV$\\
\texttt{Keijzer12} & 15 & 11331 & 772 & 488 & 1579 & 15440 & 21173 & 28354\\
\texttt{Koza1} & 5 & 291 & 670 & - & 801 & 652 & - & 696\\
\texttt{Koza1-... | {
"repo_name": "iwob/evoplotter",
"path": "examples/latex_tables1.py",
"copies": "1",
"size": "1935",
"license": "mit",
"hash": -2573419296799230000,
"line_mean": 27.0579710145,
"line_max": 99,
"alpha_frac": 0.5891472868,
"autogenerated": false,
"ratio": 2.2578763127187864,
"config_test": false,... |
from evoplotter import utils
from evoplotter import plotter
from evoplotter import printer
from evoplotter import reporting
from evoplotter.dims import *
from gecco19_utils import *
def simplify_benchmark_name(name):
"""Shortens or modifies the path of the benchmark in order to make the table more readable."""
... | {
"repo_name": "iwob/evoplotter",
"path": "app/gecco19_regr/gecco19_processor_exp3.py",
"copies": "1",
"size": "36165",
"license": "mit",
"hash": -4241360420045616600,
"line_mean": 48.9516574586,
"line_max": 163,
"alpha_frac": 0.5792340661,
"autogenerated": false,
"ratio": 3.720679012345679,
"co... |
from evoplotter import utils
from evoplotter import printer
from evoplotter import reporting
from evoplotter.dims import *
import numpy
def load_correct_props(folders, name = ""):
props0 = utils.load_properties_dirs(folders, exts=[".txt.cdgp"])
all_logs = utils.load_properties_dirs(folders, exts=[".txt.cdgp",... | {
"repo_name": "iwob/evoplotter",
"path": "app/cdgp2/cdgp_processor.py",
"copies": "1",
"size": "20853",
"license": "mit",
"hash": -6435384559823376000,
"line_mean": 42.4458333333,
"line_max": 188,
"alpha_frac": 0.6266724212,
"autogenerated": false,
"ratio": 3.254721398470423,
"config_test": tru... |
from evoplotter.templates import *
from evoplotter.utils import *
import app.phd.cdgp.phd_processor as phd_processor
import app.phd.cdgp.phd_utils as phd_utils
def cleanLIA():
folders_in = ["LIA_ORIG"]
folder_out = "LIA/"
ensure_clear_dir(folder_out)
props = phd_utils.load_correct_props_simple(folde... | {
"repo_name": "iwob/evoplotter",
"path": "app/phd/cdgp/clean_experiment_logs.py",
"copies": "1",
"size": "1352",
"license": "mit",
"hash": 5869132443407750000,
"line_mean": 34.5789473684,
"line_max": 119,
"alpha_frac": 0.724852071,
"autogenerated": false,
"ratio": 2.9911504424778763,
"config_te... |
from evopy.neat import *
class ANDDomain(abstract.Domain):
def __init__(self):
pass
def run_phenome(self,phenome):
test_patterns = [ ([0.0,0.0,1.0],[0.0]),
([0.0,1.0,1.0],[0.0]),
([1.0,0.0,1.0],[0.0]),
([1.0,1.0,1.0],... | {
"repo_name": "jal278/evobotgame",
"path": "neat_test.py",
"copies": "1",
"size": "1157",
"license": "mit",
"hash": 8829810441544902000,
"line_mean": 24.152173913,
"line_max": 72,
"alpha_frac": 0.6050129646,
"autogenerated": false,
"ratio": 2.774580335731415,
"config_test": false,
"has_no_key... |
from evosnap import constants
from evosnap.transactions.enum import CVDataProvided
class CardSecurityData:
def __init__(self, international_a_v_s_data=None, c_v_data=None, c_v_data_provided=None, identification_information=None,
key_serial_number=None, p_i_n=None, international_a_v_s_override= No... | {
"repo_name": "Zertifica/evosnap",
"path": "evosnap/transactions/bankcard/card_security_data.py",
"copies": "1",
"size": "1375",
"license": "mit",
"hash": -8695923735336108000,
"line_mean": 51.8846153846,
"line_max": 130,
"alpha_frac": 0.6821818182,
"autogenerated": false,
"ratio": 3.489847715736... |
from evosnap import constants
from evosnap.transactions.enum import TransactionType
class Transaction:
def __init__(self, transaction_type, tender_data, transaction_data, addendum=None, customer_data=None, reporting_data=None,
application_configuration_data=None):
"""
Contains all... | {
"repo_name": "Zertifica/evosnap",
"path": "evosnap/transactions/base/transaction.py",
"copies": "1",
"size": "1202",
"license": "mit",
"hash": -258932832924987230,
"line_mean": 47.08,
"line_max": 127,
"alpha_frac": 0.6988352745,
"autogenerated": false,
"ratio": 4.570342205323194,
"config_test"... |
from evosnap import constants
from evosnap.transactions.enum import UndoReason, PINDebitUndoReason
class Undo:
def __init__(self, transaction_id, addendum=None, p_i_n_debit_reason=None, tender_data=None,
transaction_code=None, undo_reason=None, force_void=False):
"""
Contains info... | {
"repo_name": "Zertifica/evosnap",
"path": "evosnap/transactions/base/undo.py",
"copies": "1",
"size": "1164",
"license": "mit",
"hash": -7196274135605258000,
"line_mean": 51.9090909091,
"line_max": 104,
"alpha_frac": 0.6881443299,
"autogenerated": false,
"ratio": 3.5815384615384613,
"config_te... |
from evosnap import constants
class POSDeploymentLocation:
def __init__(self,**kwargs):
self.__order = [
'posDLTradeName', 'posDLContactFirstName', 'posDLContactLastName', 'posDLAddress',
'posDLEmail', 'posDLCity', 'posDLCounty', 'posDLPostalCode',
'posDLCountry', 'posD... | {
"repo_name": "Zertifica/evosnap",
"path": "evosnap/merchant_applications/pos_deployment_location.py",
"copies": "1",
"size": "2013",
"license": "mit",
"hash": -8063763302437540000,
"line_mean": 49.35,
"line_max": 111,
"alpha_frac": 0.609538003,
"autogenerated": false,
"ratio": 2.7575342465753425... |
from evosnap import constants
class PrimaryOwner:
def __init__(self,**kwargs):
self.__order = [
'PrimaryOwnerPercentage', 'PrimaryOwnershipType', 'PrimaryOwnerFirstName', 'PrimaryOwnerLastName',
'PrimaryOwnerAddress', 'PrimaryOwnerCity', 'PrimaryOwnerCounty', 'PrimaryOwnerPostalCod... | {
"repo_name": "Zertifica/evosnap",
"path": "evosnap/merchant_applications/primary_owner.py",
"copies": "1",
"size": "3116",
"license": "mit",
"hash": 3483447257487000600,
"line_mean": 66.7608695652,
"line_max": 120,
"alpha_frac": 0.6919127086,
"autogenerated": false,
"ratio": 3.6572769953051645,
... |
from evosnap import constants
class TransactionTenderData:
def __init__(self, encryption_key_id=None, payment_account_data_token=None, secure_payment_account_data=None,
swipe_status=None, card_data=None, card_security_data=None, ecommerce_security_data=None):
"""
Base class object... | {
"repo_name": "Zertifica/evosnap",
"path": "evosnap/transactions/base/transaction_tender_data.py",
"copies": "1",
"size": "1148",
"license": "mit",
"hash": -4389618010621347000,
"line_mean": 53.6666666667,
"line_max": 113,
"alpha_frac": 0.7029616725,
"autogenerated": false,
"ratio": 4.07092198581... |
from Evtx.Evtx import Evtx
from Evtx.Nodes import RootNode
from Evtx.Nodes import BXmlTypeNode
from Evtx.Nodes import TemplateInstanceNode
from Evtx.Nodes import VariantTypeNode
from Evtx.BinaryParser import hex_dump
from Evtx.Views import evtx_record_xml_view
def describe_root(record, root, indent=0, suppress_values... | {
"repo_name": "ohio813/python-evtx",
"path": "scripts/record_structure.py",
"copies": "1",
"size": "3413",
"license": "apache-2.0",
"hash": 7238946307795356000,
"line_mean": 34.9263157895,
"line_max": 139,
"alpha_frac": 0.5379431585,
"autogenerated": false,
"ratio": 3.8219484882418815,
"config_... |
from ewatercycle.analysis import hydrograph
from matplotlib.testing.decorators import image_comparison
import pandas as pd
import numpy as np
@image_comparison(
baseline_images=['hydrograph'],
remove_text=True,
extensions=['png'],
savefig_kwarg={'bbox_inches':'tight'},
)
def test_hydrograph():
nti... | {
"repo_name": "eWaterCycle/ewatercycle",
"path": "tests/test_analysis.py",
"copies": "1",
"size": "1062",
"license": "apache-2.0",
"hash": 8561236331359072000,
"line_mean": 28.5,
"line_max": 76,
"alpha_frac": 0.6610169492,
"autogenerated": false,
"ratio": 3.04297994269341,
"config_test": false,... |
from ..ewctrl import EWalletController
from ..protocol_objects import MyEOffer, EOffer
from ..agent import EAgent
from ..comm import CommBase
from coloredcoinlib import (SimpleColorValue,
OBColorDefinition, UNCOLORED_MARKER)
import unittest
class MockAddressRecord(object):
def __init... | {
"repo_name": "elkingtowa/alphacoin",
"path": "Bitcoin/ngcccbase-master/ngcccbase/p2ptrade/tests/test_basic.py",
"copies": "1",
"size": "3613",
"license": "mit",
"hash": -2577001380863442400,
"line_mean": 30.4173913043,
"line_max": 74,
"alpha_frac": 0.6083587047,
"autogenerated": false,
"ratio": ... |
from ..ewctrl import EWalletController
from ..protocol_objects import MyEOffer, EOffer
from ..agent import EAgent
import unittest
class MockAddressRecord(object):
def __init__(self, address):
self.address = address
def get_address(self):
return self.address
class MockWAM(object):
def get_... | {
"repo_name": "kazcw/NGCCCBase",
"path": "ngcccbase/p2ptrade/tests/test_basic.py",
"copies": "1",
"size": "2228",
"license": "mit",
"hash": -6458593469586652000,
"line_mean": 27.2025316456,
"line_max": 70,
"alpha_frac": 0.5695691203,
"autogenerated": false,
"ratio": 3.776271186440678,
"config_t... |
from ..ewctrl import EWalletController
from ..protocol_objects import MyEOffer, EOffer
from ..agent import EAgent
import unittest
class MockComm(object):
def __init__(self):
self.agents = []
self.peers = []
def add_agent(self, agent):
self.agents.append(agent)
def add_peer(self, pe... | {
"repo_name": "kazcw/NGCCCBase",
"path": "ngcccbase/p2ptrade/tests/test_real.py",
"copies": "1",
"size": "2001",
"license": "mit",
"hash": 1088962753658524200,
"line_mean": 31.2741935484,
"line_max": 107,
"alpha_frac": 0.6126936532,
"autogenerated": false,
"ratio": 3.3857868020304567,
"config_t... |
from ewh import ElectricWaterHeater, make_heater
from states import OnState, PowerUsage
import logging
import pprint
import random
import uuid
import csv
class Controller(object):
def __init__(self, heater, cid=None, randomize=False):
self._usage_state_changes = 0
self._commands_received = 0
... | {
"repo_name": "ryanordille/ewh-simulation",
"path": "ewh/ewh/controller.py",
"copies": "1",
"size": "2543",
"license": "mit",
"hash": -401427784379737600,
"line_mean": 32.025974026,
"line_max": 102,
"alpha_frac": 0.6240660637,
"autogenerated": false,
"ratio": 3.648493543758967,
"config_test": f... |
from eWUDAPT_analysis.utils import *
from pylab import *
from netCDF4 import Dataset, num2date
import datetime
import matplotlib.pyplot as plt
import matplotlib.dates as mdates
class analysis_multiple:
def __init__(self, args, json):
self.outputdir = args.outputdir
self.usecase = args.usecase
self.stage ... | {
"repo_name": "eWUDAPT/eWUDAPT-analysis",
"path": "eWUDAPT_analysis/analysis_multiple.py",
"copies": "1",
"size": "8892",
"license": "apache-2.0",
"hash": 4308110603662198000,
"line_mean": 41.75,
"line_max": 116,
"alpha_frac": 0.5450967161,
"autogenerated": false,
"ratio": 3.715837860426243,
"c... |
from eWUDAPT_analysis.utils import *
from pylab import *
from netCDF4 import Dataset, num2date
import datetime
import matplotlib.pyplot as plt
import matplotlib.dates as mdates
class analysis_single:
def __init__(self, args, json):
self.filename = args.filename
self.outputdir = args.outputdir
self.ncdf_... | {
"repo_name": "eWUDAPT/eWUDAPT-analysis",
"path": "eWUDAPT_analysis/analysis_single.py",
"copies": "1",
"size": "5899",
"license": "apache-2.0",
"hash": -6479029185608678000,
"line_mean": 37.3051948052,
"line_max": 88,
"alpha_frac": 0.5597558908,
"autogenerated": false,
"ratio": 3.796010296010296... |
from .ex25 import *
def break_words(stuff):
"""This function will break up words for us."""
words = stuff.split(' ')
return words
def sort_words(words):
"""Sorts the words."""
return sorted(words)
def print_first_word(words):
"""Prints the first word after popping it off."""
word = words... | {
"repo_name": "SaileshPatel/Python-Exercises",
"path": "ex26.py",
"copies": "1",
"size": "2336",
"license": "mit",
"hash": 389208988518191200,
"line_mean": 24.1182795699,
"line_max": 85,
"alpha_frac": 0.6840753425,
"autogenerated": false,
"ratio": 3.156756756756757,
"config_test": false,
"has... |
from ex25 import *
print "Let's practice everything."
print 'You\'d need to know \'bout escapes with \\ that do \n newlines and \t tabs.'
poem = """
The lovely world
with logic so firmly planted
cannot discern \nthe needs of love
nor comprehend passion from intuition
and requires an explanation
where there is none.
... | {
"repo_name": "cromambo/pythonIntro",
"path": "thehardway/exercise26.py",
"copies": "1",
"size": "1238",
"license": "apache-2.0",
"hash": -8807547474605085000,
"line_mean": 21.9259259259,
"line_max": 83,
"alpha_frac": 0.6922455574,
"autogenerated": false,
"ratio": 3.0492610837438425,
"config_te... |
from ex25 import *
print "Let's practice everything."
print 'You\'d need to know \'bout escapes with \\ that do \n newlines and \t tabs.'
poem = """
\tThe lovely world
with logic so firmly planted
cannot discern \n the needs of love
nor comprehend passion from intuition
and requires an explantion
\n\t\twhere there is... | {
"repo_name": "1uk/LPTHW",
"path": "ex26.py",
"copies": "1",
"size": "1313",
"license": "bsd-3-clause",
"hash": 2003584158054423800,
"line_mean": 23.3148148148,
"line_max": 83,
"alpha_frac": 0.6976389947,
"autogenerated": false,
"ratio": 2.9773242630385486,
"config_test": false,
"has_no_keywo... |
from exabgp.bgp.message.update.nlri.bgpls.tlvs.ipreach import IpReach
from exabgp.bgp.message.update.attribute.bgpls.prefix.igptags import IgpTags
from exabgp.bgp.message.update.attribute.bgpls.prefix.prefixmetric import PrefixMetric
from exabgp.bgp.message.update.nlri.bgpls.tlvs.ospfroute import OspfRoute
from exabgp.... | {
"repo_name": "borjam/exabgp",
"path": "tests/bgpls_test.py",
"copies": "3",
"size": "2120",
"license": "bsd-3-clause",
"hash": -4499942009385298400,
"line_mean": 39,
"line_max": 112,
"alpha_frac": 0.6518867925,
"autogenerated": false,
"ratio": 2.916093535075653,
"config_test": true,
"has_no_... |
from exabgp.protocol.family import AFI
from .connection import Connection
from .tcp import create,bind
from .tcp import connect
from .tcp import MD5
from .tcp import nagle
from .tcp import TTL
from .tcp import TTLv6
from .tcp import async
from .tcp import ready
from .error import NetworkError
class Outgoing (Connecti... | {
"repo_name": "benagricola/exabgp",
"path": "lib/exabgp/reactor/network/outgoing.py",
"copies": "1",
"size": "1528",
"license": "bsd-3-clause",
"hash": 5657731374198652000,
"line_mean": 22.5076923077,
"line_max": 83,
"alpha_frac": 0.6819371728,
"autogenerated": false,
"ratio": 2.9104761904761904,... |
from exabgp.protocol.ip import IP
from exabgp.protocol.family import AFI
from exabgp.bgp.message.open.asn import ASN
# from exabgp.bgp.message.update.nlri.flow import Flow
from exabgp.bgp.message.update.nlri.flow import BinaryOperator
from exabgp.bgp.message.update.nlri.flow import NumericOperator
from exabgp.bgp.mes... | {
"repo_name": "benagricola/exabgp",
"path": "lib/exabgp/configuration/flow/parser.py",
"copies": "1",
"size": "8639",
"license": "bsd-3-clause",
"hash": -8225267125509728000,
"line_mean": 27.6059602649,
"line_max": 121,
"alpha_frac": 0.730292858,
"autogenerated": false,
"ratio": 3.197261287934863... |
from exabgp.protocol.ip import IP
from exabgp.protocol.ip import NoNextHop
from exabgp.protocol.family import AFI
from exabgp.bgp.message.open.asn import ASN
# from exabgp.bgp.message.update.nlri.flow import Flow
from exabgp.bgp.message.update.nlri.flow import BinaryOperator
from exabgp.bgp.message.update.nlri.flow i... | {
"repo_name": "borjam/exabgp",
"path": "src/exabgp/configuration/flow/parser.py",
"copies": "2",
"size": "13542",
"license": "bsd-3-clause",
"hash": -5497967058809817000,
"line_mean": 32.6865671642,
"line_max": 116,
"alpha_frac": 0.6473194506,
"autogenerated": false,
"ratio": 3.8211060948081266,
... |
from exabgp.util import coroutine
class UnexpectedData (Exception):
def __init__(self, line, position, token):
super(UnexpectedData, self).__init__('Unexpected data at line %d position %d : "%s"' % (line,position,token))
@coroutine.join
def unescape(s):
start = 0
while start < len(s):
pos = s.find('\\', start)... | {
"repo_name": "dwcarder/sdn-ix-demo",
"path": "exabgp-3.4.3/lib/exabgp/configuration/engine/tokeniser.py",
"copies": "2",
"size": "2722",
"license": "bsd-2-clause",
"hash": -5042175958419934000,
"line_mean": 18.8686131387,
"line_max": 111,
"alpha_frac": 0.5547391624,
"autogenerated": false,
"rati... |
from exact_mdp.la.piecewise import *
from math import sqrt, log
LN2 = log(2) # ln(2)
def norm_pdf_linear_approximation(mu, sigma, timespan):
assert sigma > 0, 'sigma must be positive'
delta = sqrt(2*sigma*sigma*LN2)
h = 0.5/delta
k = h/2/delta
bound_left = -delta*2 + mu
bound_right = delta*2... | {
"repo_name": "vshallc/MDPLA",
"path": "utils/math_tools.py",
"copies": "2",
"size": "1160",
"license": "apache-2.0",
"hash": 1445227006687201800,
"line_mean": 34.1818181818,
"line_max": 64,
"alpha_frac": 0.6189655172,
"autogenerated": false,
"ratio": 3.076923076923077,
"config_test": false,
... |
from exam import fixture
from django.core.urlresolvers import reverse
from sentry.models import Activity, Group
from sentry.testutils import APITestCase
class GroupNotesDetailsTest(APITestCase):
@fixture
def url(self):
return reverse('sentry-api-0-group-notes-details', kwargs={
'group_id':... | {
"repo_name": "korealerts1/sentry",
"path": "tests/sentry/api/endpoints/test_group_notes_details.py",
"copies": "5",
"size": "1392",
"license": "bsd-3-clause",
"hash": 7111662450954652000,
"line_mean": 30.6363636364,
"line_max": 72,
"alpha_frac": 0.6364942529,
"autogenerated": false,
"ratio": 3.8... |
from exam import fixture
from paste.fixture import TestApp
from raven.base import Client
from raven.contrib.webpy import SentryApplication
from raven.utils.testutils import TestCase
class TempStoreClient(Client):
def __init__(self, **kwargs):
self.events = []
super(TempStoreClient, self).__init__... | {
"repo_name": "ronaldevers/raven-python",
"path": "tests/contrib/webpy/tests.py",
"copies": "14",
"size": "2697",
"license": "bsd-3-clause",
"hash": -7903126834129713000,
"line_mean": 30.7294117647,
"line_max": 95,
"alpha_frac": 0.638487208,
"autogenerated": false,
"ratio": 3.8861671469740635,
... |
from exam import fixture
from django.core.urlresolvers import reverse
from sentry.models import ProjectOption
from sentry.testutils import TestCase
class ManageProjectPluginsTest(TestCase):
@fixture
def path(self):
return reverse('sentry-manage-project-plugins', args=[
self.organization.... | {
"repo_name": "ngonzalvez/sentry",
"path": "tests/sentry/web/frontend/plugins/tests.py",
"copies": "24",
"size": "1410",
"license": "bsd-3-clause",
"hash": -6401050901782329000,
"line_mean": 29.652173913,
"line_max": 84,
"alpha_frac": 0.6035460993,
"autogenerated": false,
"ratio": 4.1348973607038... |
from exam import fixture
from webtest import TestApp as WebtestApp # prevent pytest-warning
import bottle
from raven.base import Client
from raven.contrib.bottle import Sentry
from raven.utils.testutils import TestCase
class TempStoreClient(Client):
def __init__(self, **kwargs):
self.events = []
... | {
"repo_name": "johansteffner/raven-python",
"path": "tests/contrib/bottle/tests.py",
"copies": "1",
"size": "2377",
"license": "bsd-3-clause",
"hash": 8559740678460749000,
"line_mean": 25.1208791209,
"line_max": 73,
"alpha_frac": 0.6281026504,
"autogenerated": false,
"ratio": 3.785031847133758,
... |
from example.ct_pygame import *
##
## Global variables
##
TILES = None
TILE_MAP = None
OFF = 100
GAP = 0
WID = 20
HEI = 14
SIZE = 32
TIME = None
HORIZONTAL = 0
VERTICAL = 1
ORIENTATION = HORIZONTAL
SMALL_BOAT = 0
LARGE_BOAT = 1
SELECTED_BOAT_TYPE = 0
PLACED_BOATS = None
ID_GENERATOR = 0
SELECTED_TILES = None
GAME_MOD... | {
"repo_name": "introprogramming/exercises",
"path": "exercises/battleship/example/battleship.py",
"copies": "1",
"size": "14021",
"license": "mit",
"hash": 1536618170709395000,
"line_mean": 28.8955223881,
"line_max": 120,
"alpha_frac": 0.5642964125,
"autogenerated": false,
"ratio": 3.223218390804... |
from example_extractor import SourceCodeExtractor
from example_exporter import ExampleExporter
from preview import ExamplePreview
from amp_component_versions import get_component
from constants import ATTRIBUTE_EXAMPLE_TEMPLATES, ATTRIBUTE_EXAMPLE_IMPORTS, ATTRIBUTE_HAS_INLINE_PREVIEW
EXAMPLE_TRIGGER = '[example'
de... | {
"repo_name": "zhouyx/docs",
"path": "pages/extensions/amp_example_preview/util/markdown_processor.py",
"copies": "1",
"size": "2544",
"license": "apache-2.0",
"hash": 7479004355398431000,
"line_mean": 30.0243902439,
"line_max": 106,
"alpha_frac": 0.6992924528,
"autogenerated": false,
"ratio": 4.... |
from .example_group import ExampleGroup
try:
# Python 3k
from functools import reduce
except ImportError:
# Built in function in Python 2
pass
class ExampleSuite(object):
@classmethod
def get_suite(cls):
if hasattr(cls, 'example_suite'): return cls.example_suite
cls.example_sui... | {
"repo_name": "fidothe/rgf",
"path": "rgf/core/examples/example_suite.py",
"copies": "1",
"size": "1441",
"license": "mit",
"hash": 1364948203537794800,
"line_mean": 29.0208333333,
"line_max": 88,
"alpha_frac": 0.6627342124,
"autogenerated": false,
"ratio": 3.9916897506925206,
"config_test": fa... |
from .example import DrawingPad
from ipywidgets import HBox, VBox, Button, Text
from IPython import display
import numpy as np
class CustomBox(HBox):
def __init__(self):
drawing_pad = DrawingPad()
button = Button(description="Clear", tooltip="Click me")
save_button = Button(description="Sa... | {
"repo_name": "ocoudray/jupyter-drawing-pad",
"path": "jupyter-drawing-pad/jupyter_drawing_pad/widget.py",
"copies": "1",
"size": "3810",
"license": "mit",
"hash": 1500862291948200200,
"line_mean": 39.1052631579,
"line_max": 163,
"alpha_frac": 0.5711286089,
"autogenerated": false,
"ratio": 3.175,... |
from Example import GRIP
from PySide import QtCore, QtGui
import logging
LOG = logging.getLogger(__name__)
from GCore import *
from UI import T_SKELETON, T_CAMERAS, T_MOTION, K_NAME
# the individual component of the path this represents. eg like, a, file, path
PATH_ROLE = QtCore.Qt.UserRole + 1
# the complete path t... | {
"repo_name": "davidsoncolin/IMS",
"path": "UI/QOutliner.py",
"copies": "1",
"size": "12954",
"license": "mit",
"hash": 2065241816656014300,
"line_mean": 28.3764172336,
"line_max": 212,
"alpha_frac": 0.6959240389,
"autogenerated": false,
"ratio": 3.0872259294566256,
"config_test": false,
"has... |
from example import list_compare
from example import social_analysis
def demo_social( filename ):
tree = social_analysis.csv_to_tree( filename )
rootNodes = [node for postId, node in tree.items() if node.repostId == '-1']
for node in rootNodes:
print str( node.postId ) + ": " + str( social_analy... | {
"repo_name": "TalosThoren/python-demo",
"path": "main.py",
"copies": "1",
"size": "1269",
"license": "mit",
"hash": -3913419803959761400,
"line_mean": 30.725,
"line_max": 100,
"alpha_frac": 0.6115051221,
"autogenerated": false,
"ratio": 3.448369565217391,
"config_test": false,
"has_no_keywor... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.