Best Python code snippet using molotov_python
event.py
Source:event.py
1# This file was automatically generated by SWIG (http://www.swig.org).2# Version 3.0.123#4# Do not make changes to this file unless you know what you are doing--modify5# the SWIG interface file instead.6from sys import version_info as _swig_python_version_info7if _swig_python_version_info >= (2, 7, 0):8 def swig_import_helper():9 import importlib10 pkg = __name__.rpartition('.')[0]11 mname = '.'.join((pkg, '_event')).lstrip('.')12 try:13 return importlib.import_module(mname)14 except ImportError:15 return importlib.import_module('_event')16 _event = swig_import_helper()17 del swig_import_helper18elif _swig_python_version_info >= (2, 6, 0):19 def swig_import_helper():20 from os.path import dirname21 import imp22 fp = None23 try:24 fp, pathname, description = imp.find_module('_event', [dirname(__file__)])25 except ImportError:26 import _event27 return _event28 try:29 _mod = imp.load_module('_event', fp, pathname, description)30 finally:31 if fp is not None:32 fp.close()33 return _mod34 _event = swig_import_helper()35 del swig_import_helper36else:37 import _event38del _swig_python_version_info39try:40 _swig_property = property41except NameError:42 pass # Python < 2.2 doesn't have 'property'.43try:44 import builtins as __builtin__45except ImportError:46 import __builtin__47def _swig_setattr_nondynamic(self, class_type, name, value, static=1):48 if (name == "thisown"):49 return self.this.own(value)50 if (name == "this"):51 if type(value).__name__ == 'SwigPyObject':52 self.__dict__[name] = value53 return54 method = class_type.__swig_setmethods__.get(name, None)55 if method:56 return method(self, value)57 if (not static):58 object.__setattr__(self, name, value)59 else:60 raise AttributeError("You cannot add attributes to %s" % self)61def _swig_setattr(self, class_type, name, value):62 return _swig_setattr_nondynamic(self, class_type, name, value, 0)63def _swig_getattr(self, class_type, name):64 if (name == "thisown"):65 return self.this.own()66 method = class_type.__swig_getmethods__.get(name, None)67 if method:68 return method(self)69 raise AttributeError("'%s' object has no attribute '%s'" % (class_type.__name__, name))70def _swig_repr(self):71 try:72 strthis = "proxy of " + self.this.__repr__()73 except __builtin__.Exception:74 strthis = ""75 return "<%s.%s; %s >" % (self.__class__.__module__, self.__class__.__name__, strthis,)76def _swig_setattr_nondynamic_method(set):77 def set_attr(self, name, value):78 if (name == "thisown"):79 return self.this.own(value)80 if hasattr(self, name) or (name == "this"):81 set(self, name, value)82 else:83 raise AttributeError("You cannot add attributes to %s" % self)84 return set_attr85import m5.internal.serialize86class Cycles(object):87 thisown = _swig_property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')88 __repr__ = _swig_repr89 def __init__(self, *args):90 this = _event.new_Cycles(*args)91 try:92 self.this.append(this)93 except __builtin__.Exception:94 self.this = this95 __swig_destroy__ = _event.delete_Cycles96 __del__ = lambda self: None97Cycles_swigregister = _event.Cycles_swigregister98Cycles_swigregister(Cycles)99cvar = _event.cvar100MaxTick = cvar.MaxTick101def romMicroPC(upc):102 return _event.romMicroPC(upc)103romMicroPC = _event.romMicroPC104def normalMicroPC(upc):105 return _event.normalMicroPC(upc)106normalMicroPC = _event.normalMicroPC107def isRomMicroPC(upc):108 return _event.isRomMicroPC(upc)109isRomMicroPC = _event.isRomMicroPC110class AtomicOpFunctor(object):111 thisown = _swig_property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')112 def __init__(self, *args, **kwargs):113 raise AttributeError("No constructor defined - class is abstract")114 __repr__ = _swig_repr115 def __call__(self, p):116 return _event.AtomicOpFunctor___call__(self, p)117 __swig_destroy__ = _event.delete_AtomicOpFunctor118 __del__ = lambda self: None119AtomicOpFunctor_swigregister = _event.AtomicOpFunctor_swigregister120AtomicOpFunctor_swigregister(AtomicOpFunctor)121MicroPCRomBit = cvar.MicroPCRomBit122MaxAddr = cvar.MaxAddr123InvalidThreadID = cvar.InvalidThreadID124InvalidContextID = cvar.InvalidContextID125InvalidPortID = cvar.InvalidPortID126BigEndianByteOrder = _event.BigEndianByteOrder127LittleEndianByteOrder = _event.LittleEndianByteOrder128def getEventQueue(index):129 return _event.getEventQueue(index)130getEventQueue = _event.getEventQueue131def curEventQueue(*args):132 return _event.curEventQueue(*args)133curEventQueue = _event.curEventQueue134class EventBase(object):135 thisown = _swig_property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')136 __repr__ = _swig_repr137 Minimum_Pri = _event.EventBase_Minimum_Pri138 Debug_Enable_Pri = _event.EventBase_Debug_Enable_Pri139 Debug_Break_Pri = _event.EventBase_Debug_Break_Pri140 CPU_Switch_Pri = _event.EventBase_CPU_Switch_Pri141 Delayed_Writeback_Pri = _event.EventBase_Delayed_Writeback_Pri142 Default_Pri = _event.EventBase_Default_Pri143 DVFS_Update_Pri = _event.EventBase_DVFS_Update_Pri144 Serialize_Pri = _event.EventBase_Serialize_Pri145 CPU_Tick_Pri = _event.EventBase_CPU_Tick_Pri146 Stat_Event_Pri = _event.EventBase_Stat_Event_Pri147 Progress_Event_Pri = _event.EventBase_Progress_Event_Pri148 Sim_Exit_Pri = _event.EventBase_Sim_Exit_Pri149 Maximum_Pri = _event.EventBase_Maximum_Pri150 def __init__(self):151 this = _event.new_EventBase()152 try:153 self.this.append(this)154 except __builtin__.Exception:155 self.this = this156 __swig_destroy__ = _event.delete_EventBase157 __del__ = lambda self: None158EventBase_swigregister = _event.EventBase_swigregister159EventBase_swigregister(EventBase)160class Event(EventBase, m5.internal.serialize.Serializable):161 thisown = _swig_property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')162 def __init__(self, *args, **kwargs):163 raise AttributeError("No constructor defined - class is abstract")164 __repr__ = _swig_repr165 __swig_destroy__ = _event.delete_Event166 __del__ = lambda self: None167 def name(self):168 return _event.Event_name(self)169 def description(self):170 return _event.Event_description(self)171 def dump(self):172 return _event.Event_dump(self)173 def process(self):174 return _event.Event_process(self)175 def scheduled(self):176 return _event.Event_scheduled(self)177 def squash(self):178 return _event.Event_squash(self)179 def squashed(self):180 return _event.Event_squashed(self)181 def isExitEvent(self):182 return _event.Event_isExitEvent(self)183 def isAutoDelete(self):184 return _event.Event_isAutoDelete(self)185 def when(self):186 return _event.Event_when(self)187 def priority(self):188 return _event.Event_priority(self)189 def globalEvent(self):190 return _event.Event_globalEvent(self)191Event_swigregister = _event.Event_swigregister192Event_swigregister(Event)193class EventQueue(object):194 thisown = _swig_property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')195 __repr__ = _swig_repr196 def __init__(self, n):197 this = _event.new_EventQueue(n)198 try:199 self.this.append(this)200 except __builtin__.Exception:201 self.this = this202 def name(self, *args):203 return _event.EventQueue_name(self, *args)204 def reschedule(self, event, when, always=False):205 return _event.EventQueue_reschedule(self, event, when, always)206 def nextTick(self):207 return _event.EventQueue_nextTick(self)208 def setCurTick(self, newVal):209 return _event.EventQueue_setCurTick(self, newVal)210 def getCurTick(self):211 return _event.EventQueue_getCurTick(self)212 def getHead(self):213 return _event.EventQueue_getHead(self)214 def serviceOne(self):215 return _event.EventQueue_serviceOne(self)216 def serviceEvents(self, when):217 return _event.EventQueue_serviceEvents(self, when)218 def empty(self):219 return _event.EventQueue_empty(self)220 def dump(self):221 return _event.EventQueue_dump(self)222 def debugVerify(self):223 return _event.EventQueue_debugVerify(self)224 def handleAsyncInsertions(self):225 return _event.EventQueue_handleAsyncInsertions(self)226 def wakeup(self, *args):227 return _event.EventQueue_wakeup(self, *args)228 def replaceHead(self, s):229 return _event.EventQueue_replaceHead(self, s)230 def lock(self):231 return _event.EventQueue_lock(self)232 def unlock(self):233 return _event.EventQueue_unlock(self)234 def checkpointReschedule(self, event):235 return _event.EventQueue_checkpointReschedule(self, event)236 __swig_destroy__ = _event.delete_EventQueue237 __del__ = lambda self: None238 def schedule(self, event, when):239 return _event.EventQueue_schedule(self, event, when)240 def deschedule(self, event):241 return _event.EventQueue_deschedule(self, event)242EventQueue_swigregister = _event.EventQueue_swigregister243EventQueue_swigregister(EventQueue)244def dumpMainQueue():245 return _event.dumpMainQueue()246dumpMainQueue = _event.dumpMainQueue247class PythonEvent(Event):248 thisown = _swig_property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')249 __repr__ = _swig_repr250 object = _swig_property(_event.PythonEvent_object_get, _event.PythonEvent_object_set)251 def __init__(self, obj, priority):252 this = _event.new_PythonEvent(obj, priority)253 try:254 self.this.append(this)255 except __builtin__.Exception:256 self.this = this257 __swig_destroy__ = _event.delete_PythonEvent258 __del__ = lambda self: None259 def incref(self):260 return _event.PythonEvent_incref(self)261 def decref(self):262 return _event.PythonEvent_decref(self)263 def process(self):264 return _event.PythonEvent_process(self)265PythonEvent_swigregister = _event.PythonEvent_swigregister266PythonEvent_swigregister(PythonEvent)267class GlobalSimLoopExitEvent(object):268 thisown = _swig_property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')269 __repr__ = _swig_repr270 def getCause(self):271 return _event.GlobalSimLoopExitEvent_getCause(self)272 def getCode(self):273 return _event.GlobalSimLoopExitEvent_getCode(self)274 def __init__(self, when, _cause, c, _repeat=0):275 this = _event.new_GlobalSimLoopExitEvent(when, _cause, c, _repeat)276 try:277 self.this.append(this)278 except __builtin__.Exception:279 self.this = this280 __swig_destroy__ = _event.delete_GlobalSimLoopExitEvent281 __del__ = lambda self: None282GlobalSimLoopExitEvent_swigregister = _event.GlobalSimLoopExitEvent_swigregister283GlobalSimLoopExitEvent_swigregister(GlobalSimLoopExitEvent)284def simulate(*args):285 return _event.simulate(*args)286simulate = _event.simulate287def exitSimLoop(message, exit_code):288 return _event.exitSimLoop(message, exit_code)...
event.ts
Source:event.ts
1/*---------------------------------------------------------------------------------------------2 * Copyright (c) Microsoft Corporation. All rights reserved.3 * Licensed under the MIT License. See License.txt in the project root for license information.4 *--------------------------------------------------------------------------------------------*/5'use strict';6import _Event, { Emitter } from 'vs/base/common/event';7export type EventHandler = HTMLElement | HTMLDocument | Window;8export interface IDomEvent {9 (element: EventHandler, type: "MSContentZoom", useCapture?: boolean): _Event<UIEvent>;10 (element: EventHandler, type: "MSGestureChange", useCapture?: boolean): _Event<MSGestureEvent>;11 (element: EventHandler, type: "MSGestureDoubleTap", useCapture?: boolean): _Event<MSGestureEvent>;12 (element: EventHandler, type: "MSGestureEnd", useCapture?: boolean): _Event<MSGestureEvent>;13 (element: EventHandler, type: "MSGestureHold", useCapture?: boolean): _Event<MSGestureEvent>;14 (element: EventHandler, type: "MSGestureStart", useCapture?: boolean): _Event<MSGestureEvent>;15 (element: EventHandler, type: "MSGestureTap", useCapture?: boolean): _Event<MSGestureEvent>;16 (element: EventHandler, type: "MSGotPointerCapture", useCapture?: boolean): _Event<MSPointerEvent>;17 (element: EventHandler, type: "MSInertiaStart", useCapture?: boolean): _Event<MSGestureEvent>;18 (element: EventHandler, type: "MSLostPointerCapture", useCapture?: boolean): _Event<MSPointerEvent>;19 (element: EventHandler, type: "MSManipulationStateChanged", useCapture?: boolean): _Event<MSManipulationEvent>;20 (element: EventHandler, type: "MSPointerCancel", useCapture?: boolean): _Event<MSPointerEvent>;21 (element: EventHandler, type: "MSPointerDown", useCapture?: boolean): _Event<MSPointerEvent>;22 (element: EventHandler, type: "MSPointerEnter", useCapture?: boolean): _Event<MSPointerEvent>;23 (element: EventHandler, type: "MSPointerLeave", useCapture?: boolean): _Event<MSPointerEvent>;24 (element: EventHandler, type: "MSPointerMove", useCapture?: boolean): _Event<MSPointerEvent>;25 (element: EventHandler, type: "MSPointerOut", useCapture?: boolean): _Event<MSPointerEvent>;26 (element: EventHandler, type: "MSPointerOver", useCapture?: boolean): _Event<MSPointerEvent>;27 (element: EventHandler, type: "MSPointerUp", useCapture?: boolean): _Event<MSPointerEvent>;28 (element: EventHandler, type: "abort", useCapture?: boolean): _Event<UIEvent>;29 (element: EventHandler, type: "activate", useCapture?: boolean): _Event<UIEvent>;30 (element: EventHandler, type: "ariarequest", useCapture?: boolean): _Event<AriaRequestEvent>;31 (element: EventHandler, type: "beforeactivate", useCapture?: boolean): _Event<UIEvent>;32 (element: EventHandler, type: "beforecopy", useCapture?: boolean): _Event<DragEvent>;33 (element: EventHandler, type: "beforecut", useCapture?: boolean): _Event<DragEvent>;34 (element: EventHandler, type: "beforedeactivate", useCapture?: boolean): _Event<UIEvent>;35 (element: EventHandler, type: "beforepaste", useCapture?: boolean): _Event<DragEvent>;36 (element: EventHandler, type: "blur", useCapture?: boolean): _Event<FocusEvent>;37 (element: EventHandler, type: "canplay", useCapture?: boolean): _Event<Event>;38 (element: EventHandler, type: "canplaythrough", useCapture?: boolean): _Event<Event>;39 (element: EventHandler, type: "change", useCapture?: boolean): _Event<Event>;40 (element: EventHandler, type: "click", useCapture?: boolean): _Event<MouseEvent>;41 (element: EventHandler, type: "command", useCapture?: boolean): _Event<CommandEvent>;42 (element: EventHandler, type: "contextmenu", useCapture?: boolean): _Event<PointerEvent>;43 (element: EventHandler, type: "copy", useCapture?: boolean): _Event<DragEvent>;44 (element: EventHandler, type: "cuechange", useCapture?: boolean): _Event<Event>;45 (element: EventHandler, type: "cut", useCapture?: boolean): _Event<DragEvent>;46 (element: EventHandler, type: "dblclick", useCapture?: boolean): _Event<MouseEvent>;47 (element: EventHandler, type: "deactivate", useCapture?: boolean): _Event<UIEvent>;48 (element: EventHandler, type: "drag", useCapture?: boolean): _Event<DragEvent>;49 (element: EventHandler, type: "dragend", useCapture?: boolean): _Event<DragEvent>;50 (element: EventHandler, type: "dragenter", useCapture?: boolean): _Event<DragEvent>;51 (element: EventHandler, type: "dragleave", useCapture?: boolean): _Event<DragEvent>;52 (element: EventHandler, type: "dragover", useCapture?: boolean): _Event<DragEvent>;53 (element: EventHandler, type: "dragstart", useCapture?: boolean): _Event<DragEvent>;54 (element: EventHandler, type: "drop", useCapture?: boolean): _Event<DragEvent>;55 (element: EventHandler, type: "durationchange", useCapture?: boolean): _Event<Event>;56 (element: EventHandler, type: "emptied", useCapture?: boolean): _Event<Event>;57 (element: EventHandler, type: "ended", useCapture?: boolean): _Event<Event>;58 (element: EventHandler, type: "error", useCapture?: boolean): _Event<ErrorEvent>;59 (element: EventHandler, type: "focus", useCapture?: boolean): _Event<FocusEvent>;60 (element: EventHandler, type: "gotpointercapture", useCapture?: boolean): _Event<PointerEvent>;61 (element: EventHandler, type: "input", useCapture?: boolean): _Event<Event>;62 (element: EventHandler, type: "keydown", useCapture?: boolean): _Event<KeyboardEvent>;63 (element: EventHandler, type: "keypress", useCapture?: boolean): _Event<KeyboardEvent>;64 (element: EventHandler, type: "keyup", useCapture?: boolean): _Event<KeyboardEvent>;65 (element: EventHandler, type: "load", useCapture?: boolean): _Event<Event>;66 (element: EventHandler, type: "loadeddata", useCapture?: boolean): _Event<Event>;67 (element: EventHandler, type: "loadedmetadata", useCapture?: boolean): _Event<Event>;68 (element: EventHandler, type: "loadstart", useCapture?: boolean): _Event<Event>;69 (element: EventHandler, type: "lostpointercapture", useCapture?: boolean): _Event<PointerEvent>;70 (element: EventHandler, type: "mousedown", useCapture?: boolean): _Event<MouseEvent>;71 (element: EventHandler, type: "mouseenter", useCapture?: boolean): _Event<MouseEvent>;72 (element: EventHandler, type: "mouseleave", useCapture?: boolean): _Event<MouseEvent>;73 (element: EventHandler, type: "mousemove", useCapture?: boolean): _Event<MouseEvent>;74 (element: EventHandler, type: "mouseout", useCapture?: boolean): _Event<MouseEvent>;75 (element: EventHandler, type: "mouseover", useCapture?: boolean): _Event<MouseEvent>;76 (element: EventHandler, type: "mouseup", useCapture?: boolean): _Event<MouseEvent>;77 (element: EventHandler, type: "mousewheel", useCapture?: boolean): _Event<MouseWheelEvent>;78 (element: EventHandler, type: "paste", useCapture?: boolean): _Event<DragEvent>;79 (element: EventHandler, type: "pause", useCapture?: boolean): _Event<Event>;80 (element: EventHandler, type: "play", useCapture?: boolean): _Event<Event>;81 (element: EventHandler, type: "playing", useCapture?: boolean): _Event<Event>;82 (element: EventHandler, type: "pointercancel", useCapture?: boolean): _Event<PointerEvent>;83 (element: EventHandler, type: "pointerdown", useCapture?: boolean): _Event<PointerEvent>;84 (element: EventHandler, type: "pointerenter", useCapture?: boolean): _Event<PointerEvent>;85 (element: EventHandler, type: "pointerleave", useCapture?: boolean): _Event<PointerEvent>;86 (element: EventHandler, type: "pointermove", useCapture?: boolean): _Event<PointerEvent>;87 (element: EventHandler, type: "pointerout", useCapture?: boolean): _Event<PointerEvent>;88 (element: EventHandler, type: "pointerover", useCapture?: boolean): _Event<PointerEvent>;89 (element: EventHandler, type: "pointerup", useCapture?: boolean): _Event<PointerEvent>;90 (element: EventHandler, type: "progress", useCapture?: boolean): _Event<ProgressEvent>;91 (element: EventHandler, type: "ratechange", useCapture?: boolean): _Event<Event>;92 (element: EventHandler, type: "reset", useCapture?: boolean): _Event<Event>;93 (element: EventHandler, type: "scroll", useCapture?: boolean): _Event<UIEvent>;94 (element: EventHandler, type: "seeked", useCapture?: boolean): _Event<Event>;95 (element: EventHandler, type: "seeking", useCapture?: boolean): _Event<Event>;96 (element: EventHandler, type: "select", useCapture?: boolean): _Event<UIEvent>;97 (element: EventHandler, type: "selectstart", useCapture?: boolean): _Event<Event>;98 (element: EventHandler, type: "stalled", useCapture?: boolean): _Event<Event>;99 (element: EventHandler, type: "submit", useCapture?: boolean): _Event<Event>;100 (element: EventHandler, type: "suspend", useCapture?: boolean): _Event<Event>;101 (element: EventHandler, type: "timeupdate", useCapture?: boolean): _Event<Event>;102 (element: EventHandler, type: "touchcancel", useCapture?: boolean): _Event<TouchEvent>;103 (element: EventHandler, type: "touchend", useCapture?: boolean): _Event<TouchEvent>;104 (element: EventHandler, type: "touchmove", useCapture?: boolean): _Event<TouchEvent>;105 (element: EventHandler, type: "touchstart", useCapture?: boolean): _Event<TouchEvent>;106 (element: EventHandler, type: "volumechange", useCapture?: boolean): _Event<Event>;107 (element: EventHandler, type: "waiting", useCapture?: boolean): _Event<Event>;108 (element: EventHandler, type: "webkitfullscreenchange", useCapture?: boolean): _Event<Event>;109 (element: EventHandler, type: "webkitfullscreenerror", useCapture?: boolean): _Event<Event>;110 (element: EventHandler, type: "wheel", useCapture?: boolean): _Event<WheelEvent>;111 (element: EventHandler, type: string, useCapture?: boolean): _Event<any>;112}113export const domEvent: IDomEvent = (element: EventHandler, type: string, useCapture?) => {114 const fn = e => emitter.fire(e);115 const emitter = new Emitter<any>({116 onFirstListenerAdd: () => {117 element.addEventListener(type, fn);118 },119 onLastListenerRemove: () => {120 element.removeEventListener(type, fn);121 }122 });123 return emitter.event;...
Learn to execute automation testing from scratch with LambdaTest Learning Hub. Right from setting up the prerequisites to run your first automation test, to following best practices and diving deeper into advanced test scenarios. LambdaTest Learning Hubs compile a list of step-by-step guides to help you be proficient with different test automation frameworks i.e. Selenium, Cypress, TestNG etc.
You could also refer to video tutorials over LambdaTest YouTube channel to get step by step demonstration from industry experts.
Get 100 minutes of automation test minutes FREE!!