text stringlengths 0 1.05M | meta dict |
|---|---|
from evdev import InputDevice, ecodes, UInput
from select import select
import threading
from keymap import KeyMap
from device import get_devices, flush_input
from pymouse import PyMouse
class Listener:
def __init__(self, devices):
# threading.Thread.__init__(self)
self.devices = devices
... | {
"repo_name": "andredalton/bcc",
"path": "2014/MAC0242/miniep6/listener.py",
"copies": "1",
"size": "2163",
"license": "apache-2.0",
"hash": -8258248921594555000,
"line_mean": 33.9032258065,
"line_max": 101,
"alpha_frac": 0.4771151179,
"autogenerated": false,
"ratio": 3.9688073394495413,
"confi... |
from evdev import InputDevice, ecodes, UInput
from device import get_devices, flush_input
from select import select
import sys
class KeyMap:
""" Classe que trata as teclas. """
def __init__(self, devices):
self.keys = [
{'func': "save", 'code':ecodes.KEY_F5, 'msg': "Pressione a t... | {
"repo_name": "andredalton/bcc",
"path": "2014/MAC0242/miniep6/keymap.py",
"copies": "1",
"size": "2793",
"license": "apache-2.0",
"hash": 3753060761584386600,
"line_mean": 41.9846153846,
"line_max": 155,
"alpha_frac": 0.4901539563,
"autogenerated": false,
"ratio": 3.301418439716312,
"config_te... |
from evdev import InputDevice, list_devices, ecodes, categorize
from src.operators.readers.reader import Reader
from src.operators.translation.event_ecode_translation import EcodeToEventTranslator
class EvdevReader(Reader):
def __init__(self):
self.__device = self.__find_keyboard_input_device()
s... | {
"repo_name": "GMadorell/panoptes",
"path": "src/operators/readers/evdev_reader.py",
"copies": "1",
"size": "1333",
"license": "mit",
"hash": -3204457073317486000,
"line_mean": 39.4242424242,
"line_max": 134,
"alpha_frac": 0.5888972243,
"autogenerated": false,
"ratio": 4.088957055214724,
"confi... |
from evdev import InputDevice, list_devices
from threading import Thread
import time
class BluetoothHeadsetEvents(object):
def __init__(self, name):
self.name = name
name = "" #evdev name of headset. Usually - MAC address
is_connected = False
dev = None
#events:
#0 - connected... | {
"repo_name": "SL-RU/RaspiBluePlayer",
"path": "bluetooth_headset.py",
"copies": "1",
"size": "2067",
"license": "mit",
"hash": -4191249023911635000,
"line_mean": 30.8,
"line_max": 113,
"alpha_frac": 0.4823415578,
"autogenerated": false,
"ratio": 4.158953722334004,
"config_test": false,
"has_... |
from evdev import InputDevice
from select import select
import os
import mpd
import socket
import alsaaudio
import time
client = mpd.MPDClient(use_unicode=True)
dev = InputDevice('/dev/input/event2')
drop_lb_event = False
drop_rb_event = False
while True:
r,w,x = select([dev], [], [])
try:
... | {
"repo_name": "degifted/mpd_mouse_control",
"path": "mpd_mouse_control.py",
"copies": "1",
"size": "2960",
"license": "mit",
"hash": -5513626278408434000,
"line_mean": 49.1694915254,
"line_max": 96,
"alpha_frac": 0.3131756757,
"autogenerated": false,
"ratio": 6.090534979423868,
"config_test": f... |
from evdev import InputDevice
from threading import Thread
from select import select
import logging
from approxeng.input import Button, CentredAxis, TriggerAxis, BinaryAxis, Controller
LOGGER = logging.getLogger(name='approxeng.input.profiling')
EV_KEY = 1
EV_REL = 2
EV_ABS = 3
BUTTON_NAMES = ['circle', 'cross', 'sq... | {
"repo_name": "ApproxEng/approxeng.input",
"path": "src/python/approxeng/input/profiling.py",
"copies": "1",
"size": "11186",
"license": "apache-2.0",
"hash": -7479733040360980000,
"line_mean": 40.5836431227,
"line_max": 117,
"alpha_frac": 0.5790273556,
"autogenerated": false,
"ratio": 4.06615776... |
from evdev import InputDevice
import time
from pymouse import PyMouse
from threading import Timer
import subprocess
def rightclick():
subprocess.check_call(['xinput', '--disable', 'touchscreen'])
m.press(endx, endy, 2)
m.release(endx, endy, 2)
subprocess.check_call(['xinput', '--enable', 'touchscreen'... | {
"repo_name": "wvffle/tablet-scripts",
"path": "mouse.py",
"copies": "1",
"size": "2003",
"license": "mit",
"hash": 501568828279475500,
"line_mean": 28.0289855072,
"line_max": 83,
"alpha_frac": 0.5521717424,
"autogenerated": false,
"ratio": 3.635208711433757,
"config_test": false,
"has_no_key... |
from evdev import InputDevice
import time
import subprocess
import os
import thread
def brightness():
return open("/sys/class/backlight/panel/actual_brightness", "r").read()
pwrswitch = 0
def back_press():
pass
def back_release():
pass
def apps_press():
pass
def apps_release():
pass
def power_pr... | {
"repo_name": "wvffle/tablet-scripts",
"path": "keys.py",
"copies": "1",
"size": "2797",
"license": "mit",
"hash": 6593296955159139000,
"line_mean": 25.6380952381,
"line_max": 75,
"alpha_frac": 0.5312835181,
"autogenerated": false,
"ratio": 3.7393048128342246,
"config_test": false,
"has_no_ke... |
from evdev import *
def keyboards():
"""Returns a list of likely keyboards. Not infallible."""
def dev_if_allowed(fn):
try:
return InputDevice(fn)
except:
return None
devs = [dev_if_allowed(fn) for fn in list_devices()]
return [dev for dev in d... | {
"repo_name": "JasonFruit/pi-paper",
"path": "key_events.py",
"copies": "1",
"size": "1309",
"license": "mit",
"hash": -4366053896209365000,
"line_mean": 28.75,
"line_max": 69,
"alpha_frac": 0.5699006875,
"autogenerated": false,
"ratio": 3.74,
"config_test": false,
"has_no_keywords": false,
... |
#from evdev import uinput, ecodes as e
import time
import random
from threading import Lock
mutex = Lock()
#ui = uinput.UInput()
ui = None
output = ""
def keypress(ui, key):
global output
global mutex
mutex.acquire()
try:
output += "gm.inputManager.emit(\"move\", {});\n".format(key)+'docume... | {
"repo_name": "josephlewis42/lawson2048",
"path": "keyboard.py",
"copies": "2",
"size": "1527",
"license": "mit",
"hash": -2608240952602838500,
"line_mean": 21.7910447761,
"line_max": 131,
"alpha_frac": 0.6031434185,
"autogenerated": false,
"ratio": 3.3123644251626896,
"config_test": false,
"... |
from EveCommon.EveCentral import EveCentral
from EveCommon.ZKillboard import ZKillboard
from EveCommon.SDEConnector import SDEConnector
from os import environ
from datetime import datetime, timedelta
end_time = datetime.now()
start_time = end_time - timedelta(days=3)
database_url = environ.get('ECL_DATABASE_URL', 'C:... | {
"repo_name": "Marclass/EveCommon",
"path": "example.py",
"copies": "1",
"size": "1337",
"license": "mit",
"hash": 4831182894474904000,
"line_mean": 42.1612903226,
"line_max": 122,
"alpha_frac": 0.7404637248,
"autogenerated": false,
"ratio": 2.84468085106383,
"config_test": false,
"has_no_key... |
from eve import Eve
from eve.auth import TokenAuth
from hashlib import sha1
from datetime import datetime, timezone, timedelta
from flask import request, abort
from pymongo import MongoClient
from bson.objectid import ObjectId
import json, base64, string
import os, random, bcrypt, hmac
import pymysql
import requests
im... | {
"repo_name": "paolostivanin/soasec-proj",
"path": "src/run.py",
"copies": "1",
"size": "6597",
"license": "mit",
"hash": -7591640982759334000,
"line_mean": 31.8208955224,
"line_max": 145,
"alpha_frac": 0.6227072912,
"autogenerated": false,
"ratio": 3.265841584158416,
"config_test": false,
"h... |
from eve import Eve
from flask import Response, request
from pymongo import MongoClient
import requests, json, sys
#####################
# Eve Configuration #
#####################
# Schema
schema = {
"student_id": {
"type": "string",
"minlength": 6,
"maxlength": 6,
"required": Tr... | {
"repo_name": "fantastic4ever/project2",
"path": "project_main/finance/finance_eve.py",
"copies": "1",
"size": "1193",
"license": "apache-2.0",
"hash": -4898520508377757000,
"line_mean": 17.0909090909,
"line_max": 54,
"alpha_frac": 0.5272422464,
"autogenerated": false,
"ratio": 2.854066985645933,... |
from eve import Eve
from radiusauth import RadiusAuth
from dummyauth import DummyAuth
import base64
from flask import g, abort
def pre_get_callback(resource, request):
auth = request.headers['Authorization'].split(" ")[1]
g.username = base64.standard_b64decode(auth).split(":")[0]
#~ session["username"] = base64... | {
"repo_name": "Tethik/eves-ornate-lockbox",
"path": "main.py",
"copies": "1",
"size": "1433",
"license": "mit",
"hash": -2606356534481365000,
"line_mean": 35.7435897436,
"line_max": 188,
"alpha_frac": 0.7117934403,
"autogenerated": false,
"ratio": 3.068522483940043,
"config_test": false,
"has... |
from eve import Eve
from scipy import stats
from flask import jsonify
import json
from bson.objectid import ObjectId
app = Eve()
#get connection to db
#it's probably better to use app.data.driver.db
#but we know the following will work for now
from pymongo import MongoClient
DB = MongoClient('localhost', 29019).apit... | {
"repo_name": "d8w/ministatslab",
"path": "api/run.py",
"copies": "1",
"size": "1279",
"license": "bsd-2-clause",
"hash": -6350314612259429000,
"line_mean": 30.1951219512,
"line_max": 108,
"alpha_frac": 0.680218921,
"autogenerated": false,
"ratio": 3.339425587467363,
"config_test": false,
"ha... |
from eve import Eve
import os
# from utils import populate_dotmark, parse_log, process_attachment
from workers.postworker import populate_dotmark, parse_log, process_attachment
from flask import jsonify, abort, make_response
from crossdomain import cors
def after_insert_dotmark(items):
for item in items:
... | {
"repo_name": "ipedrazas/dotmarks-api",
"path": "src/dotmarks.py",
"copies": "1",
"size": "3917",
"license": "apache-2.0",
"hash": 8069008714335148000,
"line_mean": 26.5845070423,
"line_max": 78,
"alpha_frac": 0.5894817462,
"autogenerated": false,
"ratio": 3.3593481989708405,
"config_test": fal... |
from eve import Eve
from eve.auth import TokenAuth
import jwt
import os
from flask import Flask, request, redirect, url_for
from werkzeug.utils import secure_filename
from cross import crossdomain
import uuid
app = Eve()
ALLOWED_EXTENSIONS = set(['png', 'jpg', 'jpeg', 'gif'])
UPLOAD_FOLDER = 'C:/Bitnami... | {
"repo_name": "jemiaymen/pm",
"path": "restful/run.py",
"copies": "1",
"size": "2598",
"license": "mit",
"hash": 8406338047633713000,
"line_mean": 25.6382978723,
"line_max": 87,
"alpha_frac": 0.6127790608,
"autogenerated": false,
"ratio": 3.3872229465449806,
"config_test": false,
"has_no_keyw... |
from eve import Eve
from utils.MyUUID import UUIDEncoder
from utils.MyUUID import UUIDValidator
from flask import request
from utils.OnceLogging import log, init
from utils.Tools import dumpRequest
from utils.DBEventHandler import inserting
from utils.DBEventHandler import VMInserting
from utils.DBEventHandler ... | {
"repo_name": "Hearen/OnceServer",
"path": "Server/install.py",
"copies": "1",
"size": "2307",
"license": "mit",
"hash": -1648392206289519900,
"line_mean": 28.3552631579,
"line_max": 72,
"alpha_frac": 0.6410923277,
"autogenerated": false,
"ratio": 3.8322259136212624,
"config_test": false,
"ha... |
from eveIntel.evelinkinterface import evelinkinterface
from eveIntel.sqlinterface import sqlConnection
from tabulate import tabulate
from eveIntel.sdeinterface import sdeInterface
from eveIntel.Exceptions import *
from ascii_graph import Pyasciigraph
import time
from datetime import date
import datetime
from ast imp... | {
"repo_name": "Marclass/EveIntel",
"path": "eveIntel/dataprocessinginterface.py",
"copies": "1",
"size": "27565",
"license": "apache-2.0",
"hash": 147635309018494800,
"line_mean": 32.6980440098,
"line_max": 242,
"alpha_frac": 0.5724288046,
"autogenerated": false,
"ratio": 3.6060962846677134,
"c... |
from eveIntel.zkillinterface import zKillInterface
from eveIntel.sqlinterface import sqlConnection
from eveIntel.evelinkinterface import evelinkinterface
from eveIntel.sdeinterface import sdeInterface
import time
from ast import literal_eval
evelink = evelinkinterface()
sql = sqlConnection()
sql.connect()
zkill = zKi... | {
"repo_name": "Marclass/EveIntel",
"path": "eveIntel/dbpopulateCron.py",
"copies": "1",
"size": "9059",
"license": "apache-2.0",
"hash": -133123428137056930,
"line_mean": 31.2384341637,
"line_max": 183,
"alpha_frac": 0.6017220444,
"autogenerated": false,
"ratio": 3.501739466563587,
"config_test... |
from evelink import api, constants
from evelink.parsing.assets import parse_assets
from evelink.parsing.bookmarks import parse_bookmarks
from evelink.parsing.contact_list import parse_contact_list
from evelink.parsing.contract_bids import parse_contract_bids
from evelink.parsing.contract_items import parse_contract_ite... | {
"repo_name": "FashtimeDotCom/evelink",
"path": "evelink/corp.py",
"copies": "1",
"size": "32572",
"license": "mit",
"hash": -149709827644633630,
"line_mean": 39.3618339529,
"line_max": 127,
"alpha_frac": 0.5265565516,
"autogenerated": false,
"ratio": 4.023718344657196,
"config_test": false,
... |
from evelink import api, constants
from evelink.parsing.assets import parse_assets
from evelink.parsing.contact_list import parse_contact_list
from evelink.parsing.contract_bids import parse_contract_bids
from evelink.parsing.contract_items import parse_contract_items
from evelink.parsing.contracts import parse_contrac... | {
"repo_name": "eve-val/evemail-bridge",
"path": "evelink/char.py",
"copies": "1",
"size": "20826",
"license": "mit",
"hash": -6918876321467852000,
"line_mean": 34.6609589041,
"line_max": 99,
"alpha_frac": 0.5334197638,
"autogenerated": false,
"ratio": 4.088339222614841,
"config_test": false,
... |
from evelink import api
from evelink import constants
import time
def parse_contracts(api_result):
rowset = api_result.find('rowset')
if rowset is None:
return
results = {}
for row in rowset.findall('row'):
a = row.attrib
contract = {
'id': int(a['contractID']),
... | {
"repo_name": "eve-val/evelink",
"path": "evelink/parsing/contracts.py",
"copies": "9",
"size": "1347",
"license": "mit",
"hash": 3956072583737835500,
"line_mean": 34.4473684211,
"line_max": 64,
"alpha_frac": 0.5092798812,
"autogenerated": false,
"ratio": 3.731301939058172,
"config_test": false... |
from evelink import api
from evelink import constants
class Account(object):
"""Wrapper around /account/ of the EVE API.
Note that a valid API key is required.
"""
def __init__(self, api):
self.api = api
@api.auto_call('account/AccountStatus')
def status(self, api_result=None):
... | {
"repo_name": "eve-val/evelink",
"path": "evelink/account.py",
"copies": "7",
"size": "3233",
"license": "mit",
"hash": 3528277504026322000,
"line_mean": 35.7386363636,
"line_max": 96,
"alpha_frac": 0.5205691308,
"autogenerated": false,
"ratio": 4.102791878172589,
"config_test": false,
"has_n... |
from evelink import api
from evelink import constants
def parse_industry_jobs(api_result):
rowset = api_result.find('rowset')
result = {}
if rowset is None:
return
for row in rowset.findall('row'):
# shortcut to make the following block less painful
... | {
"repo_name": "bastianh/evelink",
"path": "evelink/parsing/industry_jobs.py",
"copies": "7",
"size": "2176",
"license": "mit",
"hash": -2836900707239548400,
"line_mean": 37.8571428571,
"line_max": 65,
"alpha_frac": 0.421875,
"autogenerated": false,
"ratio": 4.4317718940936865,
"config_test": fa... |
from evelink import api
from evelink import constants
def parse_market_orders(api_result):
rowset = api_result.find('rowset')
rows = rowset.findall('row')
result = {}
for row in rows:
a = row.attrib
id = int(a['orderID'])
result[id] = {
... | {
"repo_name": "eve-val/evelink",
"path": "evelink/parsing/orders.py",
"copies": "9",
"size": "1045",
"license": "mit",
"hash": -8864699941728614000,
"line_mean": 36.3214285714,
"line_max": 80,
"alpha_frac": 0.4507177033,
"autogenerated": false,
"ratio": 3.8992537313432836,
"config_test": false,... |
from evelink import api
class EVE(object):
"""Wrapper around /eve/ of the EVE API."""
@api.auto_api
def __init__(self, api=None):
self.api = api
@api.auto_call('eve/CharacterName', map_params={'id_list': 'IDs'})
def character_names_from_ids(self, id_list, api_result=None):
"""Retr... | {
"repo_name": "zigdon/evelink",
"path": "evelink/eve.py",
"copies": "1",
"size": "17608",
"license": "mit",
"hash": 9149280190318292000,
"line_mean": 37.3616557734,
"line_max": 107,
"alpha_frac": 0.5141412994,
"autogenerated": false,
"ratio": 4.061822376009228,
"config_test": false,
"has_no_k... |
from evelink import api
class EVE(object):
"""Wrapper around /eve/ of the EVE API."""
@api.auto_api
def __init__(self, api=None):
self.api = api
def certificate_tree(self):
"""Returns a list of certificates in eve."""
api_result = self.api.get('eve/CertificateTree')
r... | {
"repo_name": "EricE/evelink",
"path": "evelink/eve.py",
"copies": "2",
"size": "16295",
"license": "mit",
"hash": 7810779981487004000,
"line_mean": 33.9678111588,
"line_max": 96,
"alpha_frac": 0.4737035901,
"autogenerated": false,
"ratio": 4.288157894736842,
"config_test": false,
"has_no_key... |
from evelink import api
class Map(object):
"""Wrapper around /map/ of the EVE API."""
@api.auto_api
def __init__(self, api=None):
self.api = api
@api.auto_call('map/Jumps')
def jumps_by_system(self, api_result=None):
"""Get jump counts for systems in the last hour.
Return... | {
"repo_name": "Morloth1274/EVE-Online-POCO-manager",
"path": "evelink/map.py",
"copies": "7",
"size": "3735",
"license": "mit",
"hash": -4866341315859251000,
"line_mean": 34.9134615385,
"line_max": 92,
"alpha_frac": 0.5536813922,
"autogenerated": false,
"ratio": 3.71272365805169,
"config_test":... |
from evelink import api
class Map(object):
"""Wrapper around /map/ of the EVE API."""
@api.auto_api
def __init__(self, api=None):
self.api = api
def jumps_by_system(self):
"""Get jump counts for systems in the last hour.
Returns a tuple of ({system:jumps...}, timestamp).
... | {
"repo_name": "EricE/evelink",
"path": "evelink/map.py",
"copies": "2",
"size": "3444",
"license": "mit",
"hash": 6692692783330350000,
"line_mean": 30.3090909091,
"line_max": 72,
"alpha_frac": 0.5290360046,
"autogenerated": false,
"ratio": 3.7846153846153845,
"config_test": false,
"has_no_key... |
from evelink import api
def parse_bookmarks(api_results):
result = {}
folders = api_results.find('rowset')
for row in folders.findall('row'):
a = row.attrib
folder_id = int(a['folderID'])
folder = {
'id': folder_id,
'name': a['folderName'], # "" = toplevel
... | {
"repo_name": "FashtimeDotCom/evelink",
"path": "evelink/parsing/bookmarks.py",
"copies": "5",
"size": "1128",
"license": "mit",
"hash": -1077282896487324400,
"line_mean": 32.1764705882,
"line_max": 57,
"alpha_frac": 0.4432624113,
"autogenerated": false,
"ratio": 3.810810810810811,
"config_test... |
from evelink import api
def parse_kills(api_result):
rowset = api_result.find('rowset')
result = {}
for row in rowset.findall('row'):
a = row.attrib
kill_id = int(a['killID'])
result[kill_id] = {
'id': kill_id,
'system_id': int(a['solarSystemID']),
... | {
"repo_name": "bastianh/evelink",
"path": "evelink/parsing/kills.py",
"copies": "5",
"size": "2940",
"license": "mit",
"hash": -9140276579589977000,
"line_mean": 32.0337078652,
"line_max": 63,
"alpha_frac": 0.4156462585,
"autogenerated": false,
"ratio": 4.060773480662983,
"config_test": false,
... |
from evelink import api
def parse_planetary_colonies(api_results):
result = {}
rowset = api_results.find('rowset')
for row in rowset.findall('row'):
# shortcut to make the following block less painful
a = row.attrib
planetID = int(a['planetID'])
result[planetID] = {
... | {
"repo_name": "FashtimeDotCom/evelink",
"path": "evelink/parsing/planetary_interactions.py",
"copies": "5",
"size": "3730",
"license": "mit",
"hash": 1243281387029151500,
"line_mean": 32.6036036036,
"line_max": 72,
"alpha_frac": 0.4713136729,
"autogenerated": false,
"ratio": 4.049945711183496,
... |
from evelink import api
def parse_wallet_journal(api_result):
rowset = api_result.find('rowset')
result = []
for row in rowset.findall('row'):
a = row.attrib
entry = {
'timestamp': api.parse_ts(a['date']),
'id': int(a['refID']),
'type_id': int(a['refType... | {
"repo_name": "eve-val/evemail-bridge",
"path": "evelink/parsing/wallet_journal.py",
"copies": "1",
"size": "1057",
"license": "mit",
"hash": -5277932885342896000,
"line_mean": 26.1025641026,
"line_max": 57,
"alpha_frac": 0.4058656575,
"autogenerated": false,
"ratio": 3.7615658362989324,
"confi... |
from evelink import api
def parse_wallet_transactions(api_result):
rowset = api_result.find('rowset')
rows = rowset.findall('row')
result = []
for row in rows:
a = row.attrib
entry = {
'timestamp': api.parse_ts(a['transactionDateTime']),
'id': int(a['transactionI... | {
"repo_name": "bastianh/evelink",
"path": "evelink/parsing/wallet_transactions.py",
"copies": "8",
"size": "1137",
"license": "mit",
"hash": 5888493254079493000,
"line_mean": 29.7297297297,
"line_max": 64,
"alpha_frac": 0.4318381706,
"autogenerated": false,
"ratio": 4.180147058823529,
"config_t... |
from evelink import *
from evelink.corp import *
from evelink.api import *
from evelink.eve import *
import evelink
class evelinkinterface():
eve =evelink.eve.EVE()
api = evelink.api.API()
corp = evelink.corp.Corp(api)
def getCorpIDFromName(self, name):
#
charid = self.eve.cha... | {
"repo_name": "Marclass/EveIntel",
"path": "eveIntel/evelinkinterface.py",
"copies": "1",
"size": "1493",
"license": "apache-2.0",
"hash": 934905027226541300,
"line_mean": 20.0281690141,
"line_max": 60,
"alpha_frac": 0.6075016745,
"autogenerated": false,
"ratio": 3.3778280542986425,
"config_tes... |
from evennia.commands.default.muxcommand import MuxCommand
from evennia import logger
import time
class CmdEmit(MuxCommand):
"""
emits messages to the room you are in.
Usage:
@emit <message>
This will output a message with no visible prefix or postfix.
If you wish to know who is emitting t... | {
"repo_name": "kkragenbrink/los-angeles",
"path": "commands/character/Comms.py",
"copies": "1",
"size": "5324",
"license": "mit",
"hash": 2222473389262228700,
"line_mean": 33.7973856209,
"line_max": 103,
"alpha_frac": 0.5249812171,
"autogenerated": false,
"ratio": 3.9554234769687966,
"config_te... |
from evennia.commands.default.muxcommand import MuxCommand
class CmdSetFlag(MuxCommand):
"""
sets flags on an object
Usage:
@set <object>=<flag>
"""
key = "@set"
aliases = ["@flag"]
locks = "cmd:all()"
def func(self):
"Run the @set command"
usage = "Usage:"
... | {
"repo_name": "kkragenbrink/los-angeles",
"path": "commands/character/Attributes.py",
"copies": "1",
"size": "1304",
"license": "mit",
"hash": -3814033738911171000,
"line_mean": 21.8771929825,
"line_max": 69,
"alpha_frac": 0.4923312883,
"autogenerated": false,
"ratio": 4.049689440993789,
"confi... |
from evennia.contrib import custom_gametime
from commands.command import Command
class CmdTime(Command):
"""
Display the time.
Syntax:
time
"""
key = "time"
locks = "cmd:all()"
def func(self):
"""Execute the time command."""
# Get the absolut... | {
"repo_name": "whitehorse-io/encarnia",
"path": "Encarnia/commands/gametime.py",
"copies": "1",
"size": "4060",
"license": "mit",
"hash": -5480998717286064000,
"line_mean": 31.85,
"line_max": 136,
"alpha_frac": 0.4837438424,
"autogenerated": false,
"ratio": 3.615316117542297,
"config_test": fal... |
from evennia import Command as BaseCommand
class Command(BaseCommand):
"""
Inherit from this if you want to create your own command styles
from scratch. Note that Evennia's default commands inherits from
MuxCommand instead.
Note that the class's `__doc__` string (this text) is
used by Evennia... | {
"repo_name": "whitehorse-io/encarnia",
"path": "Encarnia/commands/emotes.py",
"copies": "1",
"size": "51233",
"license": "mit",
"hash": -3071276657268056600,
"line_mean": 30.7042079208,
"line_max": 200,
"alpha_frac": 0.5510901177,
"autogenerated": false,
"ratio": 3.9703192808431496,
"config_te... |
from evennia import Command as BaseCommand
from evennia import utils
from evennia.commands.default.muxcommand import MuxCommand
from world import rules
from world import english_utils
import time
from evennia.utils.evmenu import EvMenu
class Command(BaseCommand):
"""
Inherit from this if you want to ... | {
"repo_name": "whitehorse-io/encarnia",
"path": "Encarnia/commands/merchant.py",
"copies": "1",
"size": "4954",
"license": "mit",
"hash": -4617506540952132000,
"line_mean": 34.1605839416,
"line_max": 151,
"alpha_frac": 0.5540976988,
"autogenerated": false,
"ratio": 3.910023677979479,
"config_te... |
from evennia import Command as BaseCommand
from evennia import utils
import time
from random import randint
from world import rules, npc_rules, english_utils
from evennia.server.sessionhandler import SESSIONS
from evennia import TICKER_HANDLER as tickerhandler
from evennia import ChannelDB
class Fae_Magic(Bas... | {
"repo_name": "whitehorse-io/encarnia",
"path": "Encarnia/commands/fae_magic.py",
"copies": "1",
"size": "54131",
"license": "mit",
"hash": -7122860439379977000,
"line_mean": 36.8050179211,
"line_max": 232,
"alpha_frac": 0.5637250374,
"autogenerated": false,
"ratio": 3.5220899212700894,
"config... |
from evennia import Command as BaseCommand
from evennia import utils
import time
from random import randint
from world import rules, npc_rules
from evennia.server.sessionhandler import SESSIONS
from evennia import TICKER_HANDLER as tickerhandler
from evennia import ChannelDB
class MeleeCommand(BaseCommand):
... | {
"repo_name": "whitehorse-io/encarnia",
"path": "Encarnia/commands/melee.py",
"copies": "1",
"size": "28411",
"license": "mit",
"hash": 2443686326080015000,
"line_mean": 34.4736842105,
"line_max": 208,
"alpha_frac": 0.5642180845,
"autogenerated": false,
"ratio": 3.7800691857370943,
"config_test... |
from evennia import create_object, search_object, logger
from random import randint
def roll_hit():
"Roll 1d100"
return randint(1, 10)
def roll_dmg():
"Roll 1d6"
return randint(1, 6)
def check_defeat(character):
"Checks if a character is defeated."
if character.db.HP <= 0:
character.m... | {
"repo_name": "debanjum/ArMUD",
"path": "ArMUD/world/rules.py",
"copies": "1",
"size": "5237",
"license": "mit",
"hash": -3076535777413536300,
"line_mean": 34.6258503401,
"line_max": 113,
"alpha_frac": 0.5957609318,
"autogenerated": false,
"ratio": 3.517125587642713,
"config_test": false,
"ha... |
from evennia import DefaultCharacter
from evennia.commands.cmdset import CmdSet
from base import ClassCommand
from ..objects import Seed, HydroponicBed, Fertilizer, Vegetable
from evennia.utils.spawner import spawn
from Hail.world.prototypes import PRODUCE_LIST
class Horticulturist(DefaultCharacter):
pass
class... | {
"repo_name": "maxsond/Spacebase",
"path": "Hail/typeclasses/characterclasses/horticulturist.py",
"copies": "1",
"size": "6523",
"license": "bsd-3-clause",
"hash": -1794491489117149000,
"line_mean": 31.615,
"line_max": 122,
"alpha_frac": 0.5348765905,
"autogenerated": false,
"ratio": 3.8034985422... |
from evennia import DefaultCharacter
from evennia.commands.cmdset import CmdSet
from evennia import Command as BaseCommand
from evennia.utils.spawner import spawn
from typeclasses.objects import Vegetable
from world import prototypes
class Chef(DefaultCharacter):
pass
class CmdSetChef(CmdSet):
key = "chef_c... | {
"repo_name": "maxsond/Spacebase",
"path": "Hail/typeclasses/characterclasses/chef.py",
"copies": "1",
"size": "3751",
"license": "bsd-3-clause",
"hash": -7597002453507830000,
"line_mean": 24.1744966443,
"line_max": 109,
"alpha_frac": 0.5713143162,
"autogenerated": false,
"ratio": 3.6346899224806... |
from evennia import DefaultCharacter
from evennia.commands.cmdset import CmdSet
from evennia import Command as BaseCommand
class Doctor(DefaultCharacter):
pass
class CmdSetDoctor(CmdSet):
key = "doctor_cmdset"
def at_cmdset_creation(self):
"called at cmdset creation"
self.add(Diagnose())... | {
"repo_name": "maxsond/Spacebase",
"path": "Hail/typeclasses/characterclasses/doctor.py",
"copies": "1",
"size": "2670",
"license": "bsd-3-clause",
"hash": -1589908868967523600,
"line_mean": 27.1052631579,
"line_max": 140,
"alpha_frac": 0.5438202247,
"autogenerated": false,
"ratio": 3.90350877192... |
from evennia import default_cmds
class CmdExitError(default_cmds.MuxCommand):
"Parent class for all exit-errors."
locks = "cmd:all()"
arg_regex = r"\s|$"
auto_help = False
def func(self):
"returns the error"
self.caller.msg("You cannot move %s." % self.key)
class CmdExit... | {
"repo_name": "whitehorse-io/encarnia",
"path": "Encarnia/commands/movecommands.py",
"copies": "1",
"size": "1110",
"license": "mit",
"hash": -2762246775822771000,
"line_mean": 20.7843137255,
"line_max": 60,
"alpha_frac": 0.6405405405,
"autogenerated": false,
"ratio": 3.2361516034985423,
"confi... |
from evennia import DefaultObject
from evennia import default_cmds, CmdSet, utils
from commands.default_cmdsets import ChargenCmdset, ShopCmdset, BankCmdset, MerchantCmdset
from world import english_utils, npc_rules # , npc_rules
from random import randint
import time
from evennia import TICKER_HANDLER as tickerh... | {
"repo_name": "whitehorse-io/encarnia",
"path": "Encarnia/world/npcs.py",
"copies": "1",
"size": "10554",
"license": "mit",
"hash": 5858861048160334000,
"line_mean": 38.4444444444,
"line_max": 164,
"alpha_frac": 0.5859389805,
"autogenerated": false,
"ratio": 3.895902547065338,
"config_test": fa... |
from evennia import utils
from evennia.utils import search
from evennia.utils.spawner import spawn
import time
def weapon_list(caller):
text = \
"""
Welcome! Take a |wlook|n around to see which weapons are for sale today.
Note that you can |wquit|n the shop area at any time or after you'... | {
"repo_name": "whitehorse-io/encarnia",
"path": "Encarnia/world/weapon_shop_menu.py",
"copies": "1",
"size": "9665",
"license": "mit",
"hash": -9165083623882546000,
"line_mean": 51.408839779,
"line_max": 418,
"alpha_frac": 0.5420589757,
"autogenerated": false,
"ratio": 3.7087490406753645,
"conf... |
from evennia import utils
from evennia.utils import search
from evennia.utils.spawner import spawn
import time
def armor_list(caller):
text = \
"""
Welcome! Take a |wlook|n around to see which suits of armor are for sale today.
Unfortunately, supplies and artisans are s... | {
"repo_name": "whitehorse-io/encarnia",
"path": "Encarnia/world/armor_shop_menu.py",
"copies": "1",
"size": "13763",
"license": "mit",
"hash": 1310018722921313800,
"line_mean": 56.8247863248,
"line_max": 289,
"alpha_frac": 0.558017874,
"autogenerated": false,
"ratio": 3.7308213608023855,
"confi... |
from evennia import utils
from evennia.utils import search
from evennia.utils.spawner import spawn
import time
def clothing_list(caller):
text = \
"""
Welcome! Take a |wlook|n around to see which suits of armor are for sale today.
Unfortunately, supplies and artisans are scarce... | {
"repo_name": "whitehorse-io/encarnia",
"path": "Encarnia/world/clothing_shop_menu.py",
"copies": "1",
"size": "19467",
"license": "mit",
"hash": -6731706644134431000,
"line_mean": 49.0997375328,
"line_max": 120,
"alpha_frac": 0.5311552884,
"autogenerated": false,
"ratio": 3.6585228340537492,
"... |
from event_abstractclass import EventAbstractclass
from abc import ABCMeta
import types
class Event(list):
def __init__(self, event_name=None, proxy_name=None, callback=None):
super(Event, self).__init__((event_name, proxy_name, callback))
@property
def event_name(self):
return self[0]
... | {
"repo_name": "cdondrup/naoqi_interfaces",
"path": "src/naoqi_interfaces/events/multi_event_abstractclass.py",
"copies": "1",
"size": "3633",
"license": "mit",
"hash": -6493783702366991000,
"line_mean": 36.0714285714,
"line_max": 130,
"alpha_frac": 0.597853014,
"autogenerated": false,
"ratio": 4.... |
from event_analyse.tree_tagger import TreeTagger
GOKERA_API = 'https://www.gokera.ch/api/1.0/events/all_by_date?currentPage=%s&apiKey=000'
FACEBOOK_APP_ID = '243857849099325'
FACEBOOK_SECRET_KEY = '1e209962c6eadb448a5396e72bfca57b'
FACEBOOK_REDIRECT_URL = 'http://localhost:8000/facebook_login_success'
FRENCH... | {
"repo_name": "Diego999/Social-Recommendation-System",
"path": "app_config.py",
"copies": "1",
"size": "1164",
"license": "mit",
"hash": 301521626010861100,
"line_mean": 29.5135135135,
"line_max": 92,
"alpha_frac": 0.7104810997,
"autogenerated": false,
"ratio": 2.4978540772532187,
"config_test"... |
from eventbus import EventBus
from protocol import LASER_ADDR
from time import sleep
DEBUG_LASER = True
class Laser:
DELTA_LIMIT = 100
def __init__(self):
self.data = 0
self.last_data = 0
self.last_last_data = 0
if DEBUG_LASER:
self.debug_file = open('laser... | {
"repo_name": "SebastianCallh/kartoffel-tsea29",
"path": "pi/laser.py",
"copies": "1",
"size": "1972",
"license": "mit",
"hash": -9104627744866550000,
"line_mean": 30.8064516129,
"line_max": 95,
"alpha_frac": 0.5400608519,
"autogenerated": false,
"ratio": 3.4475524475524475,
"config_test": fals... |
from evented_mixin import EventedMixin
class Message(EventedMixin):
"""
A class representing a message received from ``nsqd``.
If you want to perform asynchronous message processing use the
:meth:`nsq.Message.enable_async` method, pass the message around,
and respond using the appropriate instanc... | {
"repo_name": "dsoprea/pynsq",
"path": "nsq/message.py",
"copies": "1",
"size": "3667",
"license": "mit",
"hash": 6597152891162943000,
"line_mean": 31.1666666667,
"line_max": 94,
"alpha_frac": 0.622852468,
"autogenerated": false,
"ratio": 4.370679380214541,
"config_test": false,
"has_no_keywo... |
from eventFilter import *
from config import config_provider
from notificationDisplayer import notifications_provider
from eventGetter import eventgetter_provider
from messages import messages_provider
messages = messages_provider.get()
notification_system = notifications_provider.get()
event_getter = eventgetter_prov... | {
"repo_name": "iddl/git-events",
"path": "core.py",
"copies": "1",
"size": "1287",
"license": "apache-2.0",
"hash": -2800174774942752300,
"line_mean": 34.75,
"line_max": 74,
"alpha_frac": 0.7000777001,
"autogenerated": false,
"ratio": 4.205882352941177,
"config_test": false,
"has_no_keywords"... |
from eventhook import EventHook
import logging
import RPi.GPIO as GPIO
from time import sleep
class MotorLock():
def __init__(self):
self.locked = True
self.onStatusChange = EventHook()
self.logger = logging.getLogger("motorlock")
GPIO.setwarnings(False)
GPIO.setmode(GPIO.BC... | {
"repo_name": "munichmakerlab/doorlock",
"path": "backend/motorlock.py",
"copies": "1",
"size": "1824",
"license": "mit",
"hash": -9193300256888228000,
"line_mean": 29.9152542373,
"line_max": 99,
"alpha_frac": 0.5904605263,
"autogenerated": false,
"ratio": 3.784232365145228,
"config_test": fals... |
from event import DecisionMaker
from time import sleep
from math import sqrt
from sensors.pixels2coords import get_angle_from_pixels
import Queue
class TableState(DecisionMaker):
def __init__(self, ev, lynx, nxt, irobot):
self.lynx = lynx
self.irobot = irobot
self.nxt = nxt
self.ev... | {
"repo_name": "rolisz/walter_waiter",
"path": "controllers/table_state.py",
"copies": "1",
"size": "3340",
"license": "mit",
"hash": -6035957703787882000,
"line_mean": 30.8095238095,
"line_max": 75,
"alpha_frac": 0.5134730539,
"autogenerated": false,
"ratio": 3.662280701754386,
"config_test": f... |
from event import DecisionMaker
from time import sleep
import Queue
from sensors.pixels2coords import get_angle_from_pixels
class FaceState(DecisionMaker):
def __init__(self, ev, lynx, irobot):
self.irobot = irobot
self.lynx = lynx
self.ev = ev
self.speed = 0
# done
... | {
"repo_name": "rolisz/walter_waiter",
"path": "controllers/face_state.py",
"copies": "1",
"size": "3629",
"license": "mit",
"hash": 2175348878886900700,
"line_mean": 29.7542372881,
"line_max": 70,
"alpha_frac": 0.5103334252,
"autogenerated": false,
"ratio": 3.9360086767895877,
"config_test": fa... |
from Event import EventHandler
from Log import log
from utils import *
class DBLogger(EventHandler):
def pageHandle(self, handler, fn):
# Logged in HTTPHandler
pass
def error(self, handler, description):
log(handler, 'error', description)
def login(self, handler, user, success, text = None):
log(handler, ... | {
"repo_name": "mrozekma/Sprint",
"path": "event_handlers/DBLogger.py",
"copies": "1",
"size": "4597",
"license": "mit",
"hash": 7405365214486823000,
"line_mean": 30.9236111111,
"line_max": 165,
"alpha_frac": 0.6534696541,
"autogenerated": false,
"ratio": 2.784373107207753,
"config_test": false,... |
from Event import Event
from entity.queueEntity.QueueEntity import QueueEntity
from MyQueue import MyQueue
from Process import Process
from Dispose import Dispose
class ServiceCenter(QueueEntity):
def __init__(self, simSystem, Type, id, inputPointer, outputPointer, name, numberOfCore, StatDisCores):
supe... | {
"repo_name": "mrhsce/simPython",
"path": "entity/queueEntity/ServiceCenter.py",
"copies": "1",
"size": "1570",
"license": "apache-2.0",
"hash": 4330289278218320000,
"line_mean": 37.2926829268,
"line_max": 112,
"alpha_frac": 0.6445859873,
"autogenerated": false,
"ratio": 3.792270531400966,
"con... |
from Event import Event
from entity.queueEntity.QueueEntity import QueueEntity
class Process(QueueEntity):
def __init__(self, simSystem, Type, id, inputPointer, outputPointer, name, customerDelayStatDis):
super(Process, self).__init__(simSystem, Type, id, inputPointer, outputPointer, name)
self.c... | {
"repo_name": "mrhsce/simPython",
"path": "entity/queueEntity/Process.py",
"copies": "1",
"size": "1509",
"license": "apache-2.0",
"hash": 7550945367785388000,
"line_mean": 37.6923076923,
"line_max": 101,
"alpha_frac": 0.6713055003,
"autogenerated": false,
"ratio": 4.024,
"config_test": false,
... |
from .event import Event
from . import meta
import random
@meta.apply
class Ghost(Event):
"Disabled character"
__attributes__ = ('direction',)
traversable = False
def __init__(self, **kwargs):
kwargs.setdefault('direction', (0, -1))
super().__init__(**kwargs)
@meta.apply
class Char... | {
"repo_name": "entwanne/NAGM",
"path": "engine/character.py",
"copies": "1",
"size": "3267",
"license": "bsd-3-clause",
"hash": -6347102223876483000,
"line_mean": 26.9230769231,
"line_max": 96,
"alpha_frac": 0.5757575758,
"autogenerated": false,
"ratio": 3.759493670886076,
"config_test": false,... |
from Event import Event
from InventoryEntity import InventoryEntity
class Customer(InventoryEntity):
def __init__(self, simSystem, Type, id, name, inputPointer, outputPointer):
super(Customer, self).__init__(simSystem, Type, id, inputPointer, outputPointer)
self.name = name
self.orderAmoun... | {
"repo_name": "mrhsce/simPython",
"path": "entity/inventoryEntity/Customer.py",
"copies": "1",
"size": "1459",
"license": "apache-2.0",
"hash": -6542313676380553000,
"line_mean": 35.475,
"line_max": 99,
"alpha_frac": 0.6703221385,
"autogenerated": false,
"ratio": 3.9863387978142075,
"config_tes... |
from Event import Event
from InventoryEntity import InventoryEntity
class Storage(InventoryEntity):
def __init__(self, simSystem, Type, id, name, min, max, period, inputPointer, outputPointer):
super(Storage, self).__init__(simSystem, Type, id, inputPointer, outputPointer)
self.name = name
... | {
"repo_name": "mrhsce/simPython",
"path": "entity/inventoryEntity/Storage.py",
"copies": "1",
"size": "2190",
"license": "apache-2.0",
"hash": -3384731413408868400,
"line_mean": 30.7391304348,
"line_max": 97,
"alpha_frac": 0.6118721461,
"autogenerated": false,
"ratio": 4.187380497131931,
"confi... |
from .event import Event
__all__ = ['JITProxy']
class JITProxy(object):
"""
A 'just-in-time' proxying wrapper class. Aids in instanciating classes who's init
takes far longer then you would like for the init of your app to take and offloads
that time to directly when the class if first used
"""
... | {
"repo_name": "rocktavious/pyul",
"path": "pyul/coreUtils/jitproxy.py",
"copies": "1",
"size": "4992",
"license": "mit",
"hash": 7309277096863243000,
"line_mean": 39.2580645161,
"line_max": 88,
"alpha_frac": 0.4967948718,
"autogenerated": false,
"ratio": 4.022562449637389,
"config_test": false,... |
from .event import Event
class InternedCollection(object):
def __init__(self, factory, identity = None):
super(InternedCollection, self).__init__()
if identity is None: identity = lambda x: x
self._itemAdded = Event("itemAdded")
self._itemRemoved = Event("itemRemoved")
self.factory = factory... | {
"repo_name": "squahtx/hal9000",
"path": "base/internedcollection.py",
"copies": "1",
"size": "1912",
"license": "mit",
"hash": -2230019086552116200,
"line_mean": 20.2444444444,
"line_max": 64,
"alpha_frac": 0.6626569038,
"autogenerated": false,
"ratio": 3.0494417862838916,
"config_test": false... |
from event import Event
class RulePartialMatch(object):
"""A potential match of a rule.
Mantains the current status in the rule
associated graph, the current context values and time informations.
"""
def __init__(self, graph):
self.graph = graph
self.rule = graph.rule
... | {
"repo_name": "gmambro/colino",
"path": "colino/engine.py",
"copies": "1",
"size": "1801",
"license": "apache-2.0",
"hash": -7716800415262537000,
"line_mean": 20.9634146341,
"line_max": 94,
"alpha_frac": 0.5496946141,
"autogenerated": false,
"ratio": 4.629820051413882,
"config_test": false,
"... |
from event import EventQueue
from component import ComponentABC
"""
This code is purely a guidline for implementing systems.
Using it as an interface became too much of a hassle.
"""
class SystemABC(object):
"""base class for containers of components
AbstractSystem is used to instantiate a component
... | {
"repo_name": "jrburga/VGEngine",
"path": "cbd/system.py",
"copies": "1",
"size": "3163",
"license": "mit",
"hash": 4395016031795308000,
"line_mean": 28.4326923077,
"line_max": 86,
"alpha_frac": 0.7050268732,
"autogenerated": false,
"ratio": 3.8809815950920243,
"config_test": false,
"has_no_k... |
from .event import Events
from .exception import RunnerAlreadyExistsError
from .stats import RequestStats
from .runners import Runner, LocalRunner, MasterRunner, WorkerRunner
from .web import WebUI
from .user import User
from .user.task import filter_tasks_by_tags
from .shape import LoadTestShape
from typing import Lis... | {
"repo_name": "mbeacom/locust",
"path": "locust/env.py",
"copies": "1",
"size": "6675",
"license": "mit",
"hash": 2333964167104335400,
"line_mean": 34.5053191489,
"line_max": 118,
"alpha_frac": 0.6256179775,
"autogenerated": false,
"ratio": 4.337231968810916,
"config_test": false,
"has_no_key... |
from ..event import Event, Target
_target_name = {
id(Target.Everything): "Everything",
id(Target.Manager): "Manager",
id(Target.AllBridges): "All Bridges",
id(Target.AllChannels): "All Channels",
id(Target.AllUsers): "All Users",
}
class Channel:
__slots__ = ('_id', '_name', '_users')
de... | {
"repo_name": "Hornwitser/YetiBridge",
"path": "yetibridge/bridge/__init__.py",
"copies": "1",
"size": "4900",
"license": "mit",
"hash": 3814901316610688000,
"line_mean": 27,
"line_max": 78,
"alpha_frac": 0.5697959184,
"autogenerated": false,
"ratio": 3.8043478260869565,
"config_test": false,
... |
from .event import EventType
from .broker.fxcm.session import FXCMBroker
from .database.mariadb import Database
from .subprocess_engine import SubprocessEngine
from .signals.time_signals import TimeSignals
from .subscription_handler import SubscriptionHandler
import time
import queue
from datetime import datetime
cla... | {
"repo_name": "JamesKBowler/fxcmminer",
"path": "fx_collect/collect_session.py",
"copies": "1",
"size": "4250",
"license": "mit",
"hash": -8381685686672883000,
"line_mean": 35.3333333333,
"line_max": 78,
"alpha_frac": 0.5548235294,
"autogenerated": false,
"ratio": 4.5995670995671,
"config_test"... |
from Event import *
from Code import *
class Recipient:
def __init__(self, values):
self.id = values[0]
self.event_id = values[1]
self.email = values[2]
self.success = values[3]
self.should_send = values[4]
self.time_sent = values[5]
@staticmethod
def num_re... | {
"repo_name": "seanemoon/skin-distributor",
"path": "models/Recipient.py",
"copies": "1",
"size": "3324",
"license": "mit",
"hash": 6191826049479628000,
"line_mean": 30.0654205607,
"line_max": 82,
"alpha_frac": 0.4849578821,
"autogenerated": false,
"ratio": 4.149812734082397,
"config_test": fal... |
from event import *
from pygame.locals import *
from model import *
import pygame
from pprint import pprint
class CPUTickController:
def __init__(self, evtmgr):
self.evtmgr = evtmgr
self.keep_going = True
self.clock = pygame.time.Clock()
def notify(self, event):
if isinstance(e... | {
"repo_name": "WishCow/gemgem",
"path": "controller.py",
"copies": "1",
"size": "3879",
"license": "mit",
"hash": 1801499044079798500,
"line_mean": 32.1538461538,
"line_max": 95,
"alpha_frac": 0.5001288992,
"autogenerated": false,
"ratio": 4.117834394904459,
"config_test": false,
"has_no_keyw... |
from Event import *
class Code:
def __init__(self, values):
self.id = values[0]
self.event_id = values[1]
self.name = values[2]
self.code = values[3]
@staticmethod
def fetch(event_id, db):
c = db.cursor()
c.execute('\
SELECT * FROM code\
... | {
"repo_name": "seanemoon/skin-distributor",
"path": "models/Code.py",
"copies": "1",
"size": "2193",
"license": "mit",
"hash": 6187565622318793000,
"line_mean": 29.8873239437,
"line_max": 70,
"alpha_frac": 0.4997720018,
"autogenerated": false,
"ratio": 3.867724867724868,
"config_test": false,
... |
from Event import PictureEvent, LightEvent, FeedEvent
import datetime
names = ['Feed','Light','Take picture']
events = []
enabled = True
idcounter = 0
today = datetime.datetime.today().date()
def createEvent(type):
if type == 0:
return FeedEvent()
elif type == 1:
return LightEvent()
elif type == 2:
return ... | {
"repo_name": "marian42/fishtank",
"path": "server/EventList.py",
"copies": "1",
"size": "2227",
"license": "mit",
"hash": -5942984870124392000,
"line_mean": 22.2083333333,
"line_max": 58,
"alpha_frac": 0.6834306242,
"autogenerated": false,
"ratio": 2.989261744966443,
"config_test": false,
"h... |
from eventio import IACTFile
import pandas as pd
import numpy as np
from scipy.spatial import KDTree
from argparse import ArgumentParser
from iceact.plotting import plot_camera
import matplotlib.pyplot as plt
parser = ArgumentParser()
parser.add_argument('input_file')
parser.add_argument('response_file')
def load_r... | {
"repo_name": "IceAct/pyiceact",
"path": "iceact/instrument_response.py",
"copies": "1",
"size": "1803",
"license": "mit",
"hash": -7643728879885776000,
"line_mean": 27.171875,
"line_max": 84,
"alpha_frac": 0.6816417083,
"autogenerated": false,
"ratio": 3.1247833622183707,
"config_test": false,... |
from eventkit_cloud.tasks.models import ExportRun
from datetime import timedelta, datetime
def meters_to_sq_km(meters):
return meters / 1000000
def get_duration(time_tracking_model):
"""
The duration in seconds
:param time_tracking_model: A model that has finished_at and started_at properties.
:... | {
"repo_name": "venicegeo/eventkit-cloud",
"path": "scripts/get_metrics.py",
"copies": "2",
"size": "1702",
"license": "bsd-3-clause",
"hash": 3115700087495895000,
"line_mean": 34.4583333333,
"line_max": 113,
"alpha_frac": 0.5522914219,
"autogenerated": false,
"ratio": 4.352941176470588,
"config... |
from eventkit_cloud.utils.gpkg.sqlite_utils import Table
from eventkit_cloud.utils.gpkg.tables import TableNames, ExtensionEntry
class Extension(object):
@staticmethod
def create_extensions_table(cursor):
"""
Creates the GeoPackage Extensions table
:param cursor: the cursor to the Ge... | {
"repo_name": "venicegeo/eventkit-cloud",
"path": "eventkit_cloud/utils/gpkg/extensions.py",
"copies": "2",
"size": "3663",
"license": "bsd-3-clause",
"hash": 7157699367321620000,
"line_mean": 42.6071428571,
"line_max": 119,
"alpha_frac": 0.6213486213,
"autogenerated": false,
"ratio": 4.684143222... |
from eventkit_cloud.utils.gpkg.sqlite_utils import Table, SQL
from eventkit_cloud.utils.gpkg.tables import TableNames, MetadataEntry, ExtensionEntry, MetadataReferenceEntry
class Metadata(object):
@staticmethod
def extension_template():
return ExtensionEntry(
table_name=TableNames.GPKG_MET... | {
"repo_name": "venicegeo/eventkit-cloud",
"path": "eventkit_cloud/utils/gpkg/metadata.py",
"copies": "2",
"size": "6157",
"license": "bsd-3-clause",
"hash": -3625813816052463000,
"line_mean": 41.1712328767,
"line_max": 120,
"alpha_frac": 0.5749553354,
"autogenerated": false,
"ratio": 4.6928353658... |
from eventlet.green import os
from hashlib import md5
import socket
import struct
from sys import exit
import re
import cPickle as pickle
from time import sleep
from argparse import ArgumentParser
from eventlet import GreenPool, listen
from nvram_parser import read_env
def errdump(zvm_errcode, nexe_validity, nexe_err... | {
"repo_name": "zerovm/zerocloud",
"path": "test/unit/zerovm_mock.py",
"copies": "2",
"size": "10194",
"license": "apache-2.0",
"hash": 2992771462071131600,
"line_mean": 29.8909090909,
"line_max": 77,
"alpha_frac": 0.54649794,
"autogenerated": false,
"ratio": 3.286266924564797,
"config_test": fa... |
from eventlet.hubs import get_hub
from eventlet import spawn, getcurrent
def block_on(deferred):
cur = [getcurrent()]
synchronous = []
def cb(value):
if cur:
if getcurrent() is cur[0]:
synchronous.append((value, None))
else:
cur[0].switch(valu... | {
"repo_name": "2013Commons/HUE-SHARK",
"path": "desktop/core/ext-py/eventlet-0.9.14/eventlet/twistedutil/__init__.py",
"copies": "14",
"size": "2177",
"license": "apache-2.0",
"hash": 5040183014095024000,
"line_mean": 26.9102564103,
"line_max": 79,
"alpha_frac": 0.5847496555,
"autogenerated": false... |
from eventlet.hubs import timer, get_hub, use_hub
import tornado.ioloop
import tornado.web
import eventlet
import time
import sys
import inspect
import functools
def greenify(cls_or_func):
"""Decorate classes or functions with this to make them spawn as
greenlets when initialized or called."""
if inspect... | {
"repo_name": "vishnevskiy/greentornado",
"path": "greentornado.py",
"copies": "1",
"size": "4100",
"license": "mit",
"hash": -8021111767743258000,
"line_mean": 29.5970149254,
"line_max": 109,
"alpha_frac": 0.6143902439,
"autogenerated": false,
"ratio": 3.8899430740037952,
"config_test": false,... |
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.EALREADY, errno.EWOULDBLOCK))
CONNECT_S... | {
"repo_name": "tavisrudd/eventlet",
"path": "eventlet/greenio.py",
"copies": "1",
"size": "15980",
"license": "mit",
"hash": 8856586060171242000,
"line_mean": 30.2720156556,
"line_max": 87,
"alpha_frac": 0.5449937422,
"autogenerated": false,
"ratio": 4.16362688900469,
"config_test": false,
"h... |
from eventlet import coros, proc, api
from eventlet.semaphore import Semaphore
import warnings
warnings.warn("The pool module is deprecated. Please use the "
"eventlet.GreenPool and eventlet.GreenPile classes instead.",
DeprecationWarning, stacklevel=2)
class Pool(object):
def __init__(self, min_... | {
"repo_name": "ioram7/keystone-federado-pgid2013",
"path": "build/eventlet/build/lib.linux-x86_64-2.7/eventlet/pool.py",
"copies": "14",
"size": "12985",
"license": "apache-2.0",
"hash": -2371807684125101000,
"line_mean": 40.0917721519,
"line_max": 82,
"alpha_frac": 0.5862918752,
"autogenerated": f... |
from eventlet import GreenPool
import uuid
import time
# Defines the format of the Snowflake-like UID
# Current implementation is a 64 bit (16 digit) hex string TTTTTTTTTTHHHCCC
# Where:
# - T is time in milliseconds, cut at 40 bits (10 hex digits)
# - H is host id, just unique 12 bit (3 hex digits) identifier
# (... | {
"repo_name": "joyrahman/zerocloud",
"path": "zerocloud/thread_pool.py",
"copies": "2",
"size": "2538",
"license": "apache-2.0",
"hash": -5072616910837039000,
"line_mean": 29.2142857143,
"line_max": 76,
"alpha_frac": 0.6122931442,
"autogenerated": false,
"ratio": 3.406711409395973,
"config_test... |
from eventlet import GreenPool
from cbagent.collectors.collector import Collector
class NSServer(Collector):
def __init__(self, settings):
super(NSServer, self).__init__(settings)
self.pool = GreenPool()
def _get_buckets(self):
"""Yield bucket names and stats metadata"""
buc... | {
"repo_name": "ronniedada/litmus",
"path": "collectors/cbagent/collectors/ns_server.py",
"copies": "1",
"size": "2634",
"license": "apache-2.0",
"hash": -2499937036560451600,
"line_mean": 37.1739130435,
"line_max": 80,
"alpha_frac": 0.5637813212,
"autogenerated": false,
"ratio": 4.3681592039801,
... |
from eventlet import GreenPool
from cbagent.collectors import Collector
class ActiveTasks(Collector):
def __init__(self, settings):
super(ActiveTasks, self).__init__(settings)
self.pool = GreenPool()
self.pointers = list()
self.update_metadata_enabled = settings.update_metadata
... | {
"repo_name": "ronniedada/litmus",
"path": "collectors/cbagent/collectors/active_tasks.py",
"copies": "1",
"size": "3654",
"license": "apache-2.0",
"hash": -7081248815986301000,
"line_mean": 39.1538461538,
"line_max": 80,
"alpha_frac": 0.5580186097,
"autogenerated": false,
"ratio": 4.142857142857... |
from eventlet import greenthread
from eventlet import hubs
class Semaphore(object):
"""An unbounded semaphore.
Optionally initialize with a resource *count*, then :meth:`acquire` and
:meth:`release` resources as needed. Attempting to :meth:`acquire` when
*count* is zero suspends the calling greenthread... | {
"repo_name": "edwardgeorge/eventlet_x",
"path": "eventlet/semaphore.py",
"copies": "10",
"size": "10557",
"license": "mit",
"hash": -3567052477916600000,
"line_mean": 41.0597609562,
"line_max": 82,
"alpha_frac": 0.6382495027,
"autogenerated": false,
"ratio": 4.47141041931385,
"config_test": fa... |
from eventlet import hubs
from eventlet.support import greenlets as greenlet
__all__ = ['Event']
class NOT_USED:
def __repr__(self):
return 'NOT_USED'
NOT_USED = NOT_USED()
class Event(object):
"""An abstraction where an arbitrary number of coroutines
can wait for one event from another.
Ev... | {
"repo_name": "JeremyGrosser/python-eventlet",
"path": "eventlet/event.py",
"copies": "3",
"size": "5664",
"license": "mit",
"hash": -6719304352298542000,
"line_mean": 31.9302325581,
"line_max": 90,
"alpha_frac": 0.5725635593,
"autogenerated": false,
"ratio": 4.086580086580087,
"config_test": f... |
from eventlet import patcher
from eventlet.green import asyncore
from eventlet.green import select
from eventlet.green import socket
from eventlet.green import threading
from eventlet.green import time
patcher.inject("test.test_asyncore", globals())
def new_closeall_check(self, usedefault):
# Check that close_all... | {
"repo_name": "simplegeo/eventlet",
"path": "tests/stdlib/test_asyncore.py",
"copies": "1",
"size": "1543",
"license": "mit",
"hash": -8735344762620062000,
"line_mean": 28.6730769231,
"line_max": 76,
"alpha_frac": 0.6487362281,
"autogenerated": false,
"ratio": 3.8866498740554154,
"config_test":... |
from eventlet import patcher
from eventlet.green import socket
from eventlet.green import time
from eventlet.green import httplib
from eventlet.green import ftplib
from eventlet.support import six
if six.PY2:
to_patch = [('socket', socket), ('httplib', httplib),
('time', time), ('ftplib', ftplib)]
... | {
"repo_name": "quoclieu/codebrew17-starving",
"path": "env/lib/python3.5/site-packages/eventlet/green/urllib/__init__.py",
"copies": "6",
"size": "1423",
"license": "mit",
"hash": 6736198576751334000,
"line_mean": 34.575,
"line_max": 97,
"alpha_frac": 0.6739283204,
"autogenerated": false,
"ratio"... |
from eventlet import patcher
from eventlet.green import socket
from eventlet.green import time
from eventlet.green import httplib
from eventlet.green import ftplib
to_patch = [('socket', socket), ('httplib', httplib),
('time', time), ('ftplib', ftplib)]
try:
from eventlet.green import ssl
to_patch.... | {
"repo_name": "kc4271/batch_downloader",
"path": "eventlet/green/urllib.py",
"copies": "1",
"size": "1177",
"license": "mit",
"hash": -1518996202625497900,
"line_mean": 34.6666666667,
"line_max": 93,
"alpha_frac": 0.7272727273,
"autogenerated": false,
"ratio": 3.5558912386706947,
"config_test":... |
from eventlet import patcher
from eventlet.green import zmq
from eventlet.hubs import poll, _threadlocal
from eventlet.hubs.hub import BaseHub, noop
from eventlet.hubs.poll import READ, WRITE
from eventlet.support import clear_sys_exc_info
import sys
time = patcher.original('time')
select = patcher.original('select')... | {
"repo_name": "edwardgeorge/eventlet_x",
"path": "eventlet/hubs/zeromq.py",
"copies": "1",
"size": "3256",
"license": "mit",
"hash": -1672557588936281300,
"line_mean": 31.898989899,
"line_max": 78,
"alpha_frac": 0.5881449631,
"autogenerated": false,
"ratio": 4.20671834625323,
"config_test": fal... |
from eventlet import patcher
from eventlet.green import zmq
from eventlet.hubs import _threadlocal
from eventlet.hubs.hub import BaseHub, READ, WRITE, noop
from eventlet.support import clear_sys_exc_info
import sys
time = patcher.original('time')
select = patcher.original('select')
sleep = time.sleep
EXC_MASK = zmq.P... | {
"repo_name": "2013Commons/HUE-SHARK",
"path": "desktop/core/ext-py/eventlet-0.9.14/build/lib.linux-i686-2.7/eventlet/hubs/zeromq.py",
"copies": "4",
"size": "3780",
"license": "apache-2.0",
"hash": 6727619204331278000,
"line_mean": 33.3636363636,
"line_max": 78,
"alpha_frac": 0.5944444444,
"autoge... |
from eventlet import patcher
time = patcher.original('time')
select = patcher.original("select")
if hasattr(select, 'epoll'):
epoll = select.epoll
else:
try:
# http://pypi.python.org/pypi/select26/
from select26 import epoll
except ImportError:
try:
import epoll as _epoll... | {
"repo_name": "tavisrudd/eventlet",
"path": "eventlet/hubs/epolls.py",
"copies": "1",
"size": "1929",
"license": "mit",
"hash": -2083886302192940300,
"line_mean": 35.3962264151,
"line_max": 79,
"alpha_frac": 0.5972006221,
"autogenerated": false,
"ratio": 4.139484978540772,
"config_test": false,... |
from eventlet import spawn, sleep, with_timeout
from eventlet.event import Event
import eventlet
from tests import LimitedTestCase
DELAY = 0.01
class TestEvent(LimitedTestCase):
def test_send_exc(self):
log = []
e = Event()
def waiter():
try:
result = e.wait(... | {
"repo_name": "cloudera/hue",
"path": "desktop/core/ext-py/eventlet-0.24.1/tests/test__event.py",
"copies": "5",
"size": "1098",
"license": "apache-2.0",
"hash": -3939850430725364700,
"line_mean": 26.45,
"line_max": 96,
"alpha_frac": 0.5491803279,
"autogenerated": false,
"ratio": 4.0817843866171,... |
from eventlet import spawn, wsgi, listen
import json
import mock
from eventlet.green import os
from tempfile import mkdtemp
from shutil import rmtree
from time import time
import unittest
import swift
from swift.proxy import server as proxy_server
from swift.account import server as account_server
from swift.common.m... | {
"repo_name": "zerovm/zerocloud",
"path": "test/unit/test_queue.py",
"copies": "2",
"size": "13218",
"license": "apache-2.0",
"hash": -370441625365927500,
"line_mean": 40.5660377358,
"line_max": 79,
"alpha_frac": 0.5855651384,
"autogenerated": false,
"ratio": 3.6737076153418564,
"config_test": ... |
from eventlet import Timeout
from time import time
import uuid
from swift.common.exceptions import ListingIterNotFound
from swift.common.exceptions import ListingIterError
from swift.common.http import HTTP_NOT_FOUND
from swift.common.http import is_success
from swift.common.swob import wsgify
from swift.common.swob i... | {
"repo_name": "joyrahman/zerocloud",
"path": "zerocloud/queue.py",
"copies": "2",
"size": "21092",
"license": "apache-2.0",
"hash": -1355513625437698300,
"line_mean": 39.5615384615,
"line_max": 78,
"alpha_frac": 0.5494974398,
"autogenerated": false,
"ratio": 4.1115009746588695,
"config_test": f... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.