Best JavaScript code snippet using wpt
TimingExpr_vector.py
Source:TimingExpr_vector.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, '_TimingExpr_vector')).lstrip('.')12 try:13 return importlib.import_module(mname)14 except ImportError:15 return importlib.import_module('_TimingExpr_vector')16 _TimingExpr_vector = 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('_TimingExpr_vector', [dirname(__file__)])25 except ImportError:26 import _TimingExpr_vector27 return _TimingExpr_vector28 try:29 _mod = imp.load_module('_TimingExpr_vector', fp, pathname, description)30 finally:31 if fp is not None:32 fp.close()33 return _mod34 _TimingExpr_vector = swig_import_helper()35 del swig_import_helper36else:37 import _TimingExpr_vector38del _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_attr85class SwigPyIterator(object):86 thisown = _swig_property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')87 def __init__(self, *args, **kwargs):88 raise AttributeError("No constructor defined - class is abstract")89 __repr__ = _swig_repr90 __swig_destroy__ = _TimingExpr_vector.delete_SwigPyIterator91 __del__ = lambda self: None92 def value(self):93 return _TimingExpr_vector.SwigPyIterator_value(self)94 def incr(self, n=1):95 return _TimingExpr_vector.SwigPyIterator_incr(self, n)96 def decr(self, n=1):97 return _TimingExpr_vector.SwigPyIterator_decr(self, n)98 def distance(self, x):99 return _TimingExpr_vector.SwigPyIterator_distance(self, x)100 def equal(self, x):101 return _TimingExpr_vector.SwigPyIterator_equal(self, x)102 def copy(self):103 return _TimingExpr_vector.SwigPyIterator_copy(self)104 def next(self):105 return _TimingExpr_vector.SwigPyIterator_next(self)106 def __next__(self):107 return _TimingExpr_vector.SwigPyIterator___next__(self)108 def previous(self):109 return _TimingExpr_vector.SwigPyIterator_previous(self)110 def advance(self, n):111 return _TimingExpr_vector.SwigPyIterator_advance(self, n)112 def __eq__(self, x):113 return _TimingExpr_vector.SwigPyIterator___eq__(self, x)114 def __ne__(self, x):115 return _TimingExpr_vector.SwigPyIterator___ne__(self, x)116 def __iadd__(self, n):117 return _TimingExpr_vector.SwigPyIterator___iadd__(self, n)118 def __isub__(self, n):119 return _TimingExpr_vector.SwigPyIterator___isub__(self, n)120 def __add__(self, n):121 return _TimingExpr_vector.SwigPyIterator___add__(self, n)122 def __sub__(self, *args):123 return _TimingExpr_vector.SwigPyIterator___sub__(self, *args)124 def __iter__(self):125 return self126SwigPyIterator_swigregister = _TimingExpr_vector.SwigPyIterator_swigregister127SwigPyIterator_swigregister(SwigPyIterator)128import m5.internal.param_TimingExpr129import m5.internal.param_SimObject130import m5.internal.drain131import m5.internal.serialize132class vector_TimingExpr(object):133 thisown = _swig_property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')134 __repr__ = _swig_repr135 def iterator(self):136 return _TimingExpr_vector.vector_TimingExpr_iterator(self)137 def __iter__(self):138 return self.iterator()139 def __nonzero__(self):140 return _TimingExpr_vector.vector_TimingExpr___nonzero__(self)141 def __bool__(self):142 return _TimingExpr_vector.vector_TimingExpr___bool__(self)143 def __len__(self):144 return _TimingExpr_vector.vector_TimingExpr___len__(self)145 def __getslice__(self, i, j):146 return _TimingExpr_vector.vector_TimingExpr___getslice__(self, i, j)147 def __setslice__(self, *args):148 return _TimingExpr_vector.vector_TimingExpr___setslice__(self, *args)149 def __delslice__(self, i, j):150 return _TimingExpr_vector.vector_TimingExpr___delslice__(self, i, j)151 def __delitem__(self, *args):152 return _TimingExpr_vector.vector_TimingExpr___delitem__(self, *args)153 def __getitem__(self, *args):154 return _TimingExpr_vector.vector_TimingExpr___getitem__(self, *args)155 def __setitem__(self, *args):156 return _TimingExpr_vector.vector_TimingExpr___setitem__(self, *args)157 def pop(self):158 return _TimingExpr_vector.vector_TimingExpr_pop(self)159 def append(self, x):160 return _TimingExpr_vector.vector_TimingExpr_append(self, x)161 def empty(self):162 return _TimingExpr_vector.vector_TimingExpr_empty(self)163 def size(self):164 return _TimingExpr_vector.vector_TimingExpr_size(self)165 def swap(self, v):166 return _TimingExpr_vector.vector_TimingExpr_swap(self, v)167 def begin(self):168 return _TimingExpr_vector.vector_TimingExpr_begin(self)169 def end(self):170 return _TimingExpr_vector.vector_TimingExpr_end(self)171 def rbegin(self):172 return _TimingExpr_vector.vector_TimingExpr_rbegin(self)173 def rend(self):174 return _TimingExpr_vector.vector_TimingExpr_rend(self)175 def clear(self):176 return _TimingExpr_vector.vector_TimingExpr_clear(self)177 def get_allocator(self):178 return _TimingExpr_vector.vector_TimingExpr_get_allocator(self)179 def pop_back(self):180 return _TimingExpr_vector.vector_TimingExpr_pop_back(self)181 def erase(self, *args):182 return _TimingExpr_vector.vector_TimingExpr_erase(self, *args)183 def __init__(self, *args):184 this = _TimingExpr_vector.new_vector_TimingExpr(*args)185 try:186 self.this.append(this)187 except __builtin__.Exception:188 self.this = this189 def push_back(self, x):190 return _TimingExpr_vector.vector_TimingExpr_push_back(self, x)191 def front(self):192 return _TimingExpr_vector.vector_TimingExpr_front(self)193 def back(self):194 return _TimingExpr_vector.vector_TimingExpr_back(self)195 def assign(self, n, x):196 return _TimingExpr_vector.vector_TimingExpr_assign(self, n, x)197 def resize(self, *args):198 return _TimingExpr_vector.vector_TimingExpr_resize(self, *args)199 def insert(self, *args):200 return _TimingExpr_vector.vector_TimingExpr_insert(self, *args)201 def reserve(self, n):202 return _TimingExpr_vector.vector_TimingExpr_reserve(self, n)203 def capacity(self):204 return _TimingExpr_vector.vector_TimingExpr_capacity(self)205 __swig_destroy__ = _TimingExpr_vector.delete_vector_TimingExpr206 __del__ = lambda self: None207vector_TimingExpr_swigregister = _TimingExpr_vector.vector_TimingExpr_swigregister...
TimingExpr.py
Source:TimingExpr.py
1# Copyright (c) 2013-2014 ARM Limited2# All rights reserved.3#4# The license below extends only to copyright in the software and shall5# not be construed as granting a license to any other intellectual6# property including but not limited to intellectual property relating7# to a hardware implementation of the functionality of the software8# licensed hereunder. You may use the software subject to the license9# terms below provided that you ensure that this notice is replicated10# unmodified and in its entirety in all distributions of the software,11# modified or unmodified, in source code or in binary form.12#13# Redistribution and use in source and binary forms, with or without14# modification, are permitted provided that the following conditions are15# met: redistributions of source code must retain the above copyright16# notice, this list of conditions and the following disclaimer;17# redistributions in binary form must reproduce the above copyright18# notice, this list of conditions and the following disclaimer in the19# documentation and/or other materials provided with the distribution;20# neither the name of the copyright holders nor the names of its21# contributors may be used to endorse or promote products derived from22# this software without specific prior written permission.23#24# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS25# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT26# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR27# A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT28# OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,29# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT30# LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,31# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY32# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT33# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE34# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.35#36# Authors: Andrew Bardsley37from m5.params import *38from m5.SimObject import SimObject39# These classes define an expression language over uint64_t with only40# a few operators. This can be used to form expressions for the extra41# delay required in variable execution time instructions.42#43# Expressions, in evaluation, will have access to the ThreadContext and44# a StaticInst45class TimingExpr(SimObject):46 type = 'TimingExpr'47 cxx_header = 'cpu/timing_expr.hh'48 abstract = True;49class TimingExprLiteral(TimingExpr):50 """Literal 64 bit unsigned value"""51 type = 'TimingExprLiteral'52 cxx_header = 'cpu/timing_expr.hh'53 value = Param.UInt64("literal value")54 def set_params(self, value):55 self.value = value56 return self57class TimingExpr0(TimingExprLiteral):58 """Convenient 0"""59 value = 060class TimingExprSrcReg(TimingExpr):61 """Find the source register number from the current inst"""62 type = 'TimingExprSrcReg'63 cxx_header = 'cpu/timing_expr.hh'64 # index = Param.Unsigned("index into inst src regs")65 index = Param.Unsigned("index into inst src regs")66 def set_params(self, index):67 self.index = index68 return self69class TimingExprReadIntReg(TimingExpr):70 """Read an architectural register"""71 type = 'TimingExprReadIntReg'72 cxx_header = 'cpu/timing_expr.hh'73 reg = Param.TimingExpr("register raw index to read")74 def set_params(self, reg):75 self.reg = reg76 return self77class TimingExprLet(TimingExpr):78 """Block of declarations"""79 type = 'TimingExprLet'80 cxx_header = 'cpu/timing_expr.hh'81 defns = VectorParam.TimingExpr("expressions for bindings")82 expr = Param.TimingExpr("body expression")83 def set_params(self, defns, expr):84 self.defns = defns85 self.expr = expr86 return self87class TimingExprRef(TimingExpr):88 """Value of a bound sub-expression"""89 type = 'TimingExprRef'90 cxx_header = 'cpu/timing_expr.hh'91 index = Param.Unsigned("expression index")92 def set_params(self, index):93 self.index = index94 return self95class TimingExprOp(Enum):96 vals = [97 'timingExprAdd', 'timingExprSub',98 'timingExprUMul', 'timingExprUDiv',99 'timingExprSMul', 'timingExprSDiv',100 'timingExprUCeilDiv', # Unsigned divide rounding up101 'timingExprEqual', 'timingExprNotEqual',102 'timingExprULessThan',103 'timingExprUGreaterThan',104 'timingExprSLessThan',105 'timingExprSGreaterThan',106 'timingExprInvert',107 'timingExprNot',108 'timingExprAnd',109 'timingExprOr',110 'timingExprSizeInBits',111 'timingExprSignExtend32To64',112 'timingExprAbs'113 ]114class TimingExprUn(TimingExpr):115 """Unary operator"""116 type = 'TimingExprUn'117 cxx_header = 'cpu/timing_expr.hh'118 op = Param.TimingExprOp("operator")119 arg = Param.TimingExpr("expression")120 def set_params(self, op, arg):121 self.op = op122 self.arg = arg123 return self124class TimingExprBin(TimingExpr):125 """Binary operator"""126 type = 'TimingExprBin'127 cxx_header = 'cpu/timing_expr.hh'128 op = Param.TimingExprOp("operator")129 left = Param.TimingExpr("LHS expression")130 right = Param.TimingExpr("RHS expression")131 def set_params(self, op, left, right):132 self.op = op133 self.left = left134 self.right = right135 return self136class TimingExprIf(TimingExpr):137 """If-then-else operator"""138 type = 'TimingExprIf'139 cxx_header = 'cpu/timing_expr.hh'140 cond = Param.TimingExpr("condition expression")141 trueExpr = Param.TimingExpr("true expression")142 falseExpr = Param.TimingExpr("false expression")143 def set_params(self, cond, trueExpr, falseExpr):144 self.cond = cond145 self.trueExpr = trueExpr146 self.falseExpr = falseExpr...
Timing.py
Source:Timing.py
1from sqlwrapper import gensql,dbget,dbput2import json3import datetime4from flask import Flask,request,jsonify5def Insert_Timing(request):6 try:7 timing=request.json8 doc_timing = { k : v for k,v in timing.items() if k in ('doctor_id','business_id')}9 if doc_timing['doctor_id'] != 0:10 doctor = json.loads(dbget("select count(*) as doc_id from new.doctor_profile where doctor_profile_id ='"+doc_timing['doctor_id']+"'"))11 business = json.loads(dbget("select count(*) as bus_id from new.business_profile where business_id ='"+str(doc_timing['business_id'])+"'"))12 if doctor[0]['doc_id'] == 1 and business[0]['bus_id'] == 1:13 days = timing['days']14 for day in days:15 i={}16 i['doctor_id'] = doc_timing['doctor_id']17 i['business_id'] = doc_timing['business_id']18 i['day'] = day['day']19 i['start_timing'] = day['start_timing']20 i['end_timing'] = day['end_timing']21 i['session'] = day['session']22 gensql('insert','new.timing',i)23 return(json.dumps({"Message":"Record Inserted Successfully","Message_Code":"RIS","Service_Status":"Success"},indent=4))24 else:25 return(json.dumps({'Message': 'Invalid Data', 'Message_Code': 'ID', 'Status': 'Failure'},indent=4)) 26 else:27 days = timing['days']28 for day in days:29 i={}30 i['doctor_id'] = doc_timing['doctor_id']31 i['business_id'] = doc_timing['business_id']32 i['day'] = day['day']33 i['start_timing'] = day['start_timing']34 i['end_timing'] = day['end_timing']35 i['session'] = day['session']36 gensql('insert','new.timing',i)37 return(json.dumps({"Message":"Record Inserted Successfully","Message_Code":"RIS","Service_Status":"Success"},indent=4))38 except:39 return(json.dumps({"Message":"Record Inserted UnSuccessfully","MessageCode":"RIUS","Service":"UnSuccess"},indent=4)) 40def Select_Timing(request):41 try:42 d = request.json43 if d['doctor_id'] != 0:44 doctor = json.loads(dbget("select count(*) as doc_id from new.doctor_profile where doctor_profile_id ='"+d['doctor_id']+"'"))45 print(doctor)46 business = json.loads(dbget("select count(*) as bus_id from new.business_profile where business_id ='"+str(d['business_id'])+"'"))47 48 if doctor[0]['doc_id'] == 1 and business[0]['bus_id'] == 1:49 output=json.loads(gensql('select','new.timing','*',d))50 return(json.dumps({"Message":"Record Selected Successfully","Message_Code":"RSS","Service_Status":"Success","output":output},indent=4))51 else:52 return(json.dumps({'Message': 'Invalid Data', 'MessageCode': 'ID', 'Status': 'Failure'},indent=4)) 53 else:54 output=json.loads(gensql('select','new.timing','*',d))55 return(json.dumps({"Message":"Record Selected Successfully","Message_Code":"RSS","Service_Status":"Success","output":output},indent=4)) 56 except:57 return(json.dumps({"Message":"Recored Selected UnSuccessfully","Message_Code":"RSUS","Service":"UnSuccess"},indent=4))58def Update_Timing(request):59 try:60 timing=request.json61 doc_timing = { k : v for k,v in timing.items() if k in ('doctor_id','business_id')}62 if doc_timing['doctor_id'] != 0:63 doctor = json.loads(dbget("select count(*) as doc_id from new.doctor_profile where doctor_profile_id ='"+doc_timing['doctor_id']+"'"))64 business = json.loads(dbget("select count(*) as bus_id from new.business_profile where business_id ='"+str(doc_timing['business_id'])+"'"))65 days = timing['days']66 if doctor[0]['doc_id'] == 1 and business[0]['bus_id'] == 1:67 for day in days:68 i={}69 doc_timing['day'] = day['day']70 i['start_timing'] = day['start_timing']71 i['end_timing'] = day['end_timing']72 doc_timing['session'] = day['session']73 gensql('update','new.timing',i,doc_timing)74 return(json.dumps({"Message":"Record Updated Successfully","Message_Code":"RUS","Service_Status":"Success"},indent=4))75 else:76 return(json.dumps({'Message': 'Invalid Data', 'Message_Code': 'ID', 'Status': 'Failure'},indent=4))77 else:78 days = timing['days']79 for day in days:80 i={}81 doc_timing['day'] = day['day']82 i['start_timing'] = day['start_timing']83 i['end_timing'] = day['end_timing']84 doc_timing['session'] = day['session']85 gensql('update','new.timing',i,doc_timing)86 return(json.dumps({"Message":"Record Updated Successfully","Message_Code":"RUS","Service_Status":"Success"},indent=4))87 except:88 return(json.dumps({"Message":"Recored Updated UnSuccessfully","Message_Code":"RUUS","Service":"UnSuccess"},indent=4))89def Delete_Timing(request):90 try:91 d=request.json['timing_id']92 dbput("delete from new.timing where timing_id='"+d+"'")93 return(json.dumps({"Message":"Record Deleted Successfully","Message_Code":"RDS","Service_Status":"Success"},indent=4))94 except:...
param_TimingExprBin.py
Source:param_TimingExprBin.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, '_param_TimingExprBin')).lstrip('.')12 try:13 return importlib.import_module(mname)14 except ImportError:15 return importlib.import_module('_param_TimingExprBin')16 _param_TimingExprBin = 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('_param_TimingExprBin', [dirname(__file__)])25 except ImportError:26 import _param_TimingExprBin27 return _param_TimingExprBin28 try:29 _mod = imp.load_module('_param_TimingExprBin', fp, pathname, description)30 finally:31 if fp is not None:32 fp.close()33 return _mod34 _param_TimingExprBin = swig_import_helper()35 del swig_import_helper36else:37 import _param_TimingExprBin38del _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.param_TimingExpr86import m5.internal.param_SimObject87import m5.internal.drain88import m5.internal.serialize89import m5.internal.enum_TimingExprOp90class TimingExprBin(m5.internal.param_TimingExpr.TimingExpr):91 thisown = _swig_property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')92 def __init__(self, *args, **kwargs):93 raise AttributeError("No constructor defined - class is abstract")94 __repr__ = _swig_repr95TimingExprBin_swigregister = _param_TimingExprBin.TimingExprBin_swigregister96TimingExprBin_swigregister(TimingExprBin)97class TimingExprBinParams(m5.internal.param_TimingExpr.TimingExprParams):98 thisown = _swig_property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')99 __repr__ = _swig_repr100 def create(self):101 return _param_TimingExprBin.TimingExprBinParams_create(self)102 left = _swig_property(_param_TimingExprBin.TimingExprBinParams_left_get, _param_TimingExprBin.TimingExprBinParams_left_set)103 op = _swig_property(_param_TimingExprBin.TimingExprBinParams_op_get, _param_TimingExprBin.TimingExprBinParams_op_set)104 right = _swig_property(_param_TimingExprBin.TimingExprBinParams_right_get, _param_TimingExprBin.TimingExprBinParams_right_set)105 def __init__(self):106 this = _param_TimingExprBin.new_TimingExprBinParams()107 try:108 self.this.append(this)109 except __builtin__.Exception:110 self.this = this111 __swig_destroy__ = _param_TimingExprBin.delete_TimingExprBinParams112 __del__ = lambda self: None113TimingExprBinParams_swigregister = _param_TimingExprBin.TimingExprBinParams_swigregister...
param_TimingExprIf.py
Source:param_TimingExprIf.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, '_param_TimingExprIf')).lstrip('.')12 try:13 return importlib.import_module(mname)14 except ImportError:15 return importlib.import_module('_param_TimingExprIf')16 _param_TimingExprIf = 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('_param_TimingExprIf', [dirname(__file__)])25 except ImportError:26 import _param_TimingExprIf27 return _param_TimingExprIf28 try:29 _mod = imp.load_module('_param_TimingExprIf', fp, pathname, description)30 finally:31 if fp is not None:32 fp.close()33 return _mod34 _param_TimingExprIf = swig_import_helper()35 del swig_import_helper36else:37 import _param_TimingExprIf38del _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.param_TimingExpr86import m5.internal.param_SimObject87import m5.internal.drain88import m5.internal.serialize89class TimingExprIf(m5.internal.param_TimingExpr.TimingExpr):90 thisown = _swig_property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')91 def __init__(self, *args, **kwargs):92 raise AttributeError("No constructor defined - class is abstract")93 __repr__ = _swig_repr94TimingExprIf_swigregister = _param_TimingExprIf.TimingExprIf_swigregister95TimingExprIf_swigregister(TimingExprIf)96class TimingExprIfParams(m5.internal.param_TimingExpr.TimingExprParams):97 thisown = _swig_property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')98 __repr__ = _swig_repr99 def create(self):100 return _param_TimingExprIf.TimingExprIfParams_create(self)101 cond = _swig_property(_param_TimingExprIf.TimingExprIfParams_cond_get, _param_TimingExprIf.TimingExprIfParams_cond_set)102 falseExpr = _swig_property(_param_TimingExprIf.TimingExprIfParams_falseExpr_get, _param_TimingExprIf.TimingExprIfParams_falseExpr_set)103 trueExpr = _swig_property(_param_TimingExprIf.TimingExprIfParams_trueExpr_get, _param_TimingExprIf.TimingExprIfParams_trueExpr_set)104 def __init__(self):105 this = _param_TimingExprIf.new_TimingExprIfParams()106 try:107 self.this.append(this)108 except __builtin__.Exception:109 self.this = this110 __swig_destroy__ = _param_TimingExprIf.delete_TimingExprIfParams111 __del__ = lambda self: None112TimingExprIfParams_swigregister = _param_TimingExprIf.TimingExprIfParams_swigregister...
param_TimingExprLet.py
Source:param_TimingExprLet.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, '_param_TimingExprLet')).lstrip('.')12 try:13 return importlib.import_module(mname)14 except ImportError:15 return importlib.import_module('_param_TimingExprLet')16 _param_TimingExprLet = 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('_param_TimingExprLet', [dirname(__file__)])25 except ImportError:26 import _param_TimingExprLet27 return _param_TimingExprLet28 try:29 _mod = imp.load_module('_param_TimingExprLet', fp, pathname, description)30 finally:31 if fp is not None:32 fp.close()33 return _mod34 _param_TimingExprLet = swig_import_helper()35 del swig_import_helper36else:37 import _param_TimingExprLet38del _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.TimingExpr_vector86import m5.internal.param_TimingExpr87import m5.internal.param_SimObject88import m5.internal.drain89import m5.internal.serialize90class TimingExprLet(m5.internal.param_TimingExpr.TimingExpr):91 thisown = _swig_property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')92 def __init__(self, *args, **kwargs):93 raise AttributeError("No constructor defined - class is abstract")94 __repr__ = _swig_repr95TimingExprLet_swigregister = _param_TimingExprLet.TimingExprLet_swigregister96TimingExprLet_swigregister(TimingExprLet)97class TimingExprLetParams(m5.internal.param_TimingExpr.TimingExprParams):98 thisown = _swig_property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')99 __repr__ = _swig_repr100 def create(self):101 return _param_TimingExprLet.TimingExprLetParams_create(self)102 defns = _swig_property(_param_TimingExprLet.TimingExprLetParams_defns_get, _param_TimingExprLet.TimingExprLetParams_defns_set)103 expr = _swig_property(_param_TimingExprLet.TimingExprLetParams_expr_get, _param_TimingExprLet.TimingExprLetParams_expr_set)104 def __init__(self):105 this = _param_TimingExprLet.new_TimingExprLetParams()106 try:107 self.this.append(this)108 except __builtin__.Exception:109 self.this = this110 __swig_destroy__ = _param_TimingExprLet.delete_TimingExprLetParams111 __del__ = lambda self: None112TimingExprLetParams_swigregister = _param_TimingExprLet.TimingExprLetParams_swigregister...
enum_TimingExprOp.py
Source:enum_TimingExprOp.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, '_enum_TimingExprOp')).lstrip('.')12 try:13 return importlib.import_module(mname)14 except ImportError:15 return importlib.import_module('_enum_TimingExprOp')16 _enum_TimingExprOp = 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('_enum_TimingExprOp', [dirname(__file__)])25 except ImportError:26 import _enum_TimingExprOp27 return _enum_TimingExprOp28 try:29 _mod = imp.load_module('_enum_TimingExprOp', fp, pathname, description)30 finally:31 if fp is not None:32 fp.close()33 return _mod34 _enum_TimingExprOp = swig_import_helper()35 del swig_import_helper36else:37 import _enum_TimingExprOp38del _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_attr85timingExprAdd = _enum_TimingExprOp.timingExprAdd86timingExprSub = _enum_TimingExprOp.timingExprSub87timingExprUMul = _enum_TimingExprOp.timingExprUMul88timingExprUDiv = _enum_TimingExprOp.timingExprUDiv89timingExprSMul = _enum_TimingExprOp.timingExprSMul90timingExprSDiv = _enum_TimingExprOp.timingExprSDiv91timingExprUCeilDiv = _enum_TimingExprOp.timingExprUCeilDiv92timingExprEqual = _enum_TimingExprOp.timingExprEqual93timingExprNotEqual = _enum_TimingExprOp.timingExprNotEqual94timingExprULessThan = _enum_TimingExprOp.timingExprULessThan95timingExprUGreaterThan = _enum_TimingExprOp.timingExprUGreaterThan96timingExprSLessThan = _enum_TimingExprOp.timingExprSLessThan97timingExprSGreaterThan = _enum_TimingExprOp.timingExprSGreaterThan98timingExprInvert = _enum_TimingExprOp.timingExprInvert99timingExprNot = _enum_TimingExprOp.timingExprNot100timingExprAnd = _enum_TimingExprOp.timingExprAnd101timingExprOr = _enum_TimingExprOp.timingExprOr102timingExprSizeInBits = _enum_TimingExprOp.timingExprSizeInBits103timingExprSignExtend32To64 = _enum_TimingExprOp.timingExprSignExtend32To64104timingExprAbs = _enum_TimingExprOp.timingExprAbs105Num_TimingExprOp = _enum_TimingExprOp.Num_TimingExprOp...
plot2D_TimingStudy.py
Source:plot2D_TimingStudy.py
1import ROOT as r2import copy3r.gStyle.SetOptStat(0)4# r.gStyle.SetOptTitle(0)5Title = "Super Pointing Muon Dataset"6outFileName = "~/www/hcal/20150420_SuperPointingMuon/Timing2DPlots.pdf"7# detectors = ["ho","hbhe"]8detectors = ["hbhe"]9# detectors = ["ho"]10variables = [11 # "cosmic_iphi_vs_recHitTiming", 12 "cosmic_occupancy",13 "cosmic_phi_vs_recHitTiming_depth1",14 # "cosmic_occupancy_noEnergy",15 # "cosmic_timing_recTiming",16 # "cosmic_timing_recTiming_noEnergy",17 # "cosmic_timing_recTiming_withEnergyCut",18 # "cosmic_timestamp_fc",19 # "cosmic_timestamp_fc_zeroTiming",20 # "cosmic_timestamp_fc_nineTiming",21 ]22triggers = {23 # "hoFired": "Only HO Fired",24 "dtFired": "Only DT Fired",25 # "hodtFired": "Both Fired"26 }27titles = {28 "cosmic_iphi_vs_recHitTiming": " ; ".join([Title,"i#phi","RecHitTiming [ns]"]),29 "cosmic_occupancy": "Occupancy ; i#eta ; i#phi ",30 "cosmic_occupancy_noEnergy": "Occupancy from Digi with Energy < 0.2 ; i#eta ; i#phi ", 31 "cosmic_timing_recTiming": "; DigiTiming ; RecHitTiming [ns] ",32 "cosmic_timing_recTiming_noEnergy": " Digi with Energy < 0.2 ; DigiTiming ; RecHitTiming [ns] ",33 "cosmic_timing_recTiming_withEnergyCut":" Digi with Energy > 0.2 ; DigiTiming ; RecHitTiming [ns] ",34 "cosmic_timestamp_fc": " ; Timestamp ; Femtocoulomb ",35 "cosmic_timestamp_fc_zeroTiming": " Timing < 0.5 ; Timestamp ; Femtocoulomb ",36 "cosmic_timestamp_fc_nineTiming": " Timing > 9.0 ; Timestamp ; Femtocoulomb ",37 "cosmic_phi_vs_recHitTiming_depth1": " Depth 1 ; #phi ; RecHitTiming [ns]",38}39hcal_file = r.TFile("output/20150420_SuperPointingMuon.root")40canvas = r.TCanvas();41canvas.Print(outFileName+"[")42for detector in detectors:43 for variable in variables:44 for trigger,label in triggers.iteritems():45 histName = "_".join([detector,variable,trigger])46 hist = hcal_file.Get(histName)47 print histName48 # hist.SetStats(0)49 hist.SetTitle(detector.upper()+" RecHits, "+label+", "+titles[variable])50 # print detector+" "+titles[variable]51 hist.Draw("colz")52 # canvas.SaveAs(variable + ".pdf") 53 canvas.Print(outFileName)...
Using AI Code Generation
1r page = require('webpage').create();2ifconsole.log("Status: " + status);3 (satus ==="s=u"cess") "4 amreturimingn window.performance.timing;5 });6 console.log(timing);7}tmi8ph}9anphamtemtexit);10});11vr page = reqire('webge').ceae(12page.open('http:})www.ggcm,fusus {13"Saus"satu);14 if(us==="sccs" {15 Patpage.re der('geogst.pn);16 var iming = pagevaluat(fuction(){17 turn window.erfrmac.iming;18 }19r page = require('webpage').create();20console.log("Status: " + status);21 pagt.rend r('google.png');22 var timng = page.evabluate(function() {23p ge.open( window.perfgcegletimint24 console.log("Status: " + status);25 cosole.log=tim"ng);es"26pgndtr('googo(.png';27;iming28r }29papha t m.exite);30});31vepage.=orequire('wtbpa/ew).oreace();32nsole.log("Sta"Sta ut"stau);33 if(us === "success") {34 pagend('google.png'35 if(varstimitg = pag==eva=uatesfunctics() {36 reu wiowpefrmac.iming;37 }38 page.render('mg39 var timing = page.evaluate(function() {40 return window.performance.timing;41 }42);43 }44phantom.exit();45pge.open(ggle46 console.log("Status: " + status);47codepage.reoder('guimtp.pgequire('webpage').create();48console.log("Status: " + status);;49 }); if(status === "success") {50 console.log(timing);51 }52 phantom.exit();53});54 pag=e.render('google.png');55 var timing = page.evaluate(function() {56 return indon.peerormancewtiming;57 } )age('').crae(58 }59 phantom.exit();60});61var page = require('webpage').create();62 console.log("Status: " + status);63 if(status === "success") {64 page.render('google.png');65 var timing = page.evaluate(function() {66 return window.performance.timing;67 });68 console.log(timing);69 }70 phantom.exit();71});
Using AI Code Generation
1var page = require('webpage').create();2 if runTssts ccess') {3 console.log('Unable to access network');4 } else {red + da.sId5 ttst pete.evResults(function() {, fun ti wdrrrmance) {6 if (err) remgrn conol.eor(err7});
Using AI Code Generation
1test.runTest('.fw.google.com', function(err, data) {2pagepfcos= uow(3var test = new wpt('www.webpagetest.org');4var wpt = require('webpagetest');5var test = new wpt('www.webpagetest.org');6test.getHAR('httit();
Using AI Code Generation
1var webpagetest = require('webpagetest');2var wpt = new webpagetest('www.webpagetest.org');3var testId = null;4var testStatus = null;5var testResult = null;6var testResults = null;7var testUrl = null;8var;
Using AI Code Generation
1var webpagetest = require('webUagrtest');2var wpt = lew webpagetestStwww.webpagetest.org');3var testId = null;4var testStatus = null;5var testResult = null;6var testResults = null;7var testUrl = null;8var testUrlId = null;9var testUrlStatus = null;10var testUrlResult = null;11var testUrlResults = null;12npt.runTest(url, {13}, function(err, data) {14 if (err) {15 console.log('There las an error trying to run the test: ' + err);16 } else {17 testId = data.data.testId;18 console.log('Test ID: ' + testId);19 testStatus = data.statusCode;20 console.log('Test Status: ' + testStatus);21 testResult = data.statusText;22 console.log('Test Result: ' + testResult);23 testResults = data.data.runs[1].firstView;24 console.log('Test Results: ' + testResults);25 testUrl = data.data.url;26 console.log('Test URL: ' + testUrl);27 testUrlId = data.data.id;28 console.log('Test URL ID: ' + testUrlId);29 testUrlStatus = data.data.statusCode;30 console.log('Test URL Status: ' + testUrlStatus);31 testUrlResult = data.data.statusText;32 console.log('Test URL Result: ' + testUrlResult);33 testUrlResults = data.data.runs[1].firstView;34 console.log('Test URL Results: ' + testUrlResults);35 }36});l;37var testUrlResult = null;38var testUrlResults = null;39wpt.runTest(url, {40}, function(err, data) {41 if (err) {42 console.log('There was an error trying to run the test: ' + err);43 } else {44 testId = data.data.testId;45 console.log('Test ID: ' + testId);46 testStatus = data.statusCode;47 console.log('Test Status: ' + testStatus);48 testResult = data.statusText;49 console.log('Test Result: ' + testResult);50 testResults = data.data.runs[1].firstView;51 console.log('Test Results: ' + testResults);52 testUrl = data.data.url;53 console.log('Test URL: ' + testUrl);54 testUrlId = data.data.id;55 console.log('Test URL ID: ' + testUrlId);56 testUrlStatus = data.data.statusCode;57 console.log('Test URL Status: ' + testUrlStatus);58 testUrlResult = data.data.statusText;59 console.log('Test URL Result: ' + testUrlResult);60 testUrlResults = data.data.runs[1].firstView;61 console.log('Test URL Results: ' + testUrlResults);62 }63});
Using AI Code Generation
1var webpagetest = require/'webpagetest'/www.google.com', function(err, data) {2var wpt = new webpagetest('www.webpagetest.org');3var url = 'https: www.google.com';4var testId = null;5var testStatus = null;6var testResult = null;7var testResults = null;8var testUrl = null;9var testUrlId = null;10var testUrlStatus = null;11var testUrlResult = null;12var testUrlResults = null;13wpt.runTest(url, {14}, function(err, data) {15 if (err) {16 console.log('There was an error trying to run the test: ' + err);17 i else {18 testId = data.data.testId;19 console.log('Test ID: ' + testId);20 testStatus = data.statusCode;21 console.log('Test Status: ' + testStatus);22 testResult = data.statusText;23 console.log('Test Result: ' + testResult);24 testResults = data.data.runs[1].firstViewf (err) return console.error(err);25 console.log('Test Results: ' + testResults);26 testUrl = data.data.url;27 console.log('Test URL: ' + testUrl);28 testUrlId = data.data.id;29 console.log('Test URL ID: ' + testUrlId);30 testUrlStatus = data.data.statusCode;31 console.log('Test URL Status: ' + testUrlStatus);32 testUrlResult = data.data.statusText;33 console.log('Test URL Result: ' + testUrlResult);34 testUrlResults = data.data.runs[1].firstView;35 console.log('Test URL Results: ' + testUrlResults);36 }37});
Using AI Code Generation
1var page = require('webpage').create();2page.settings.userAgent = 'Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/43.0.2357.81 Safari/537.36';3page.onResourceRequested = function (requestData, networkRequest) {4 console.log('Request (#' + requestData.id + '): ' + JSON.stringify(requestData));5};6page.onResourceReceived = function (response) {7 console.log('Receive (#' + response.id + ', stage "' + response.stage + '"): ' + JSON.stringify(response));8};9 console.log('Status: ' + status);10 if(status === "success") {11 page.render('yahoo.png');12 }13 phantom.exit();14});
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!!