content
stringlengths
7
1.05M
fixed_cases
stringlengths
1
1.28M
def runUserScript(func, params, paramTypes): if (len(params) != len(paramTypes)): onParameterError() newParams = [] for i, val in enumerate(params): newParams.append(parseParameter(i, paramTypes[i], val)) func(*newParams) class Node: def __init__(self, val, left, right, next): self.val = val self.left = left self.right = right self.next = next def parseNode(param): first = Node(param[0], None, None, None) arr = [] arr.append([first, 0]) for i, val in enumerate(param): if i is 0: continue top = arr[0] val = None if param[i] is None else Node(param[i], None, None, None) if top[1] is 0: top[0].left = val top[1] = 1 else: top[0].right = val arr.pop(0) if val is not None: arr.append([val, 0]) return first def parseSpecialParameter(index, paramType, param): if paramType == "Node": return parseNode(param) return None
def run_user_script(func, params, paramTypes): if len(params) != len(paramTypes): on_parameter_error() new_params = [] for (i, val) in enumerate(params): newParams.append(parse_parameter(i, paramTypes[i], val)) func(*newParams) class Node: def __init__(self, val, left, right, next): self.val = val self.left = left self.right = right self.next = next def parse_node(param): first = node(param[0], None, None, None) arr = [] arr.append([first, 0]) for (i, val) in enumerate(param): if i is 0: continue top = arr[0] val = None if param[i] is None else node(param[i], None, None, None) if top[1] is 0: top[0].left = val top[1] = 1 else: top[0].right = val arr.pop(0) if val is not None: arr.append([val, 0]) return first def parse_special_parameter(index, paramType, param): if paramType == 'Node': return parse_node(param) return None
def readlines(fname): try: with open(fname, 'r') as fpt: return fpt.readlines() except: return [] def convert(data): for i in range(len(data)): try: data[i] = float(data[i]) except ValueError: continue def csv_lst(fname): l = readlines(fname) if len(l) == 0: raise Exception('Missing file') output = [] for i in l[1:]: data = i.split(',') convert(data) output.append(data) return output dd = csv_lst('titanic.csv') sur = 0 for x in dd: sur += x[0] print(sur)
def readlines(fname): try: with open(fname, 'r') as fpt: return fpt.readlines() except: return [] def convert(data): for i in range(len(data)): try: data[i] = float(data[i]) except ValueError: continue def csv_lst(fname): l = readlines(fname) if len(l) == 0: raise exception('Missing file') output = [] for i in l[1:]: data = i.split(',') convert(data) output.append(data) return output dd = csv_lst('titanic.csv') sur = 0 for x in dd: sur += x[0] print(sur)
def functionA(A: torch.Tensor, B: torch.Tensor) -> torch.Tensor: ## TODO for students output = A.sum(axis = 0) * B.sum() return output def functionB(C: torch.Tensor) -> torch.Tensor: # TODO flatten the tensor C C = C.flatten() # TODO create the idx tensor to be concatenated to C # here we're going to do flatten and unsqueeze, but reshape can also be used idx_tensor = torch.arange(0, len(C)) # TODO concatenate the two tensors output = torch.cat([idx_tensor.unsqueeze(0), C.unsqueeze(0)], axis = 1) return output def functionC(D: torch.Tensor, E: torch.Tensor) -> torch.Tensor: # TODO check we can reshape E into the shape of D if torch.numel(D) == torch.numel(E) : # TODO reshape E into the shape of D E = E.reshape(D.shape) # TODO sum the two tensors output = D + E else: # TODO flatten both tensors # this time we'll use reshape to keep the singleton dimension D = D.reshape(1,-1) E = E.reshape(1,-1) # TODO concatenate the two tensors in the correct dimension output = torch.cat([D,E], axis = 1) return output print(functionA(torch.tensor([[1,1], [1,1]]), torch.tensor([ [1,2,3],[1,2,3] ]) )) print(functionB(torch.tensor([ [2,3],[-1,10] ]))) print(functionC(torch.tensor([[1, -1],[-1,3]]), torch.tensor([[2,3,0,2]]))) print(functionC(torch.tensor([[1, -1],[-1,3]]), torch.tensor([[2,3,0]])))
def function_a(A: torch.Tensor, B: torch.Tensor) -> torch.Tensor: output = A.sum(axis=0) * B.sum() return output def function_b(C: torch.Tensor) -> torch.Tensor: c = C.flatten() idx_tensor = torch.arange(0, len(C)) output = torch.cat([idx_tensor.unsqueeze(0), C.unsqueeze(0)], axis=1) return output def function_c(D: torch.Tensor, E: torch.Tensor) -> torch.Tensor: if torch.numel(D) == torch.numel(E): e = E.reshape(D.shape) output = D + E else: d = D.reshape(1, -1) e = E.reshape(1, -1) output = torch.cat([D, E], axis=1) return output print(function_a(torch.tensor([[1, 1], [1, 1]]), torch.tensor([[1, 2, 3], [1, 2, 3]]))) print(function_b(torch.tensor([[2, 3], [-1, 10]]))) print(function_c(torch.tensor([[1, -1], [-1, 3]]), torch.tensor([[2, 3, 0, 2]]))) print(function_c(torch.tensor([[1, -1], [-1, 3]]), torch.tensor([[2, 3, 0]])))
minimum_points = 100 data_points = 150 if data_points >= minimum_points: print("There are enough data points!") if data_points < minimum_points: print("Keep collecting data.")
minimum_points = 100 data_points = 150 if data_points >= minimum_points: print('There are enough data points!') if data_points < minimum_points: print('Keep collecting data.')
class Hand: def __init__(self): self.cards = [] self.value = 0 def add_card(self, card): self.cards.append(card) def calculate_value(self): self.value = 0 has_ace = False for card in self.cards: if card.value.isnumeric(): self.value += int(card.value) else: if card.value == "A": has_ace = True self.value += 11 else: self.value += 10 if has_ace and self.value > 21: self.value -= 10 def get_value(self): self.calculate_value() return self.value
class Hand: def __init__(self): self.cards = [] self.value = 0 def add_card(self, card): self.cards.append(card) def calculate_value(self): self.value = 0 has_ace = False for card in self.cards: if card.value.isnumeric(): self.value += int(card.value) elif card.value == 'A': has_ace = True self.value += 11 else: self.value += 10 if has_ace and self.value > 21: self.value -= 10 def get_value(self): self.calculate_value() return self.value
# # PySNMP MIB module GSM7312-QOS-ACL-MIB (http://snmplabs.com/pysmi) # ASN.1 source file:///Users/davwang4/Dev/mibs.snmplabs.com/asn1/GSM7312-QOS-ACL-MIB # Produced by pysmi-0.3.4 at Wed May 1 13:20:03 2019 # On host DAVWANG4-M-1475 platform Darwin version 18.5.0 by user davwang4 # Using Python version 3.7.3 (default, Mar 27 2019, 09:23:15) # Integer, OctetString, ObjectIdentifier = mibBuilder.importSymbols("ASN1", "Integer", "OctetString", "ObjectIdentifier") NamedValues, = mibBuilder.importSymbols("ASN1-ENUMERATION", "NamedValues") ValueRangeConstraint, ValueSizeConstraint, ConstraintsUnion, ConstraintsIntersection, SingleValueConstraint = mibBuilder.importSymbols("ASN1-REFINEMENT", "ValueRangeConstraint", "ValueSizeConstraint", "ConstraintsUnion", "ConstraintsIntersection", "SingleValueConstraint") gsm7312QOS, = mibBuilder.importSymbols("GSM7312-QOS-MIB", "gsm7312QOS") ModuleCompliance, NotificationGroup = mibBuilder.importSymbols("SNMPv2-CONF", "ModuleCompliance", "NotificationGroup") TimeTicks, Unsigned32, Counter32, ModuleIdentity, Bits, Gauge32, MibScalar, MibTable, MibTableRow, MibTableColumn, ObjectIdentity, IpAddress, NotificationType, MibIdentifier, Integer32, iso, Counter64 = mibBuilder.importSymbols("SNMPv2-SMI", "TimeTicks", "Unsigned32", "Counter32", "ModuleIdentity", "Bits", "Gauge32", "MibScalar", "MibTable", "MibTableRow", "MibTableColumn", "ObjectIdentity", "IpAddress", "NotificationType", "MibIdentifier", "Integer32", "iso", "Counter64") DisplayString, TextualConvention, RowStatus = mibBuilder.importSymbols("SNMPv2-TC", "DisplayString", "TextualConvention", "RowStatus") gsm7312QOSACL = ModuleIdentity((1, 3, 6, 1, 4, 1, 4526, 1, 6, 3, 2)) gsm7312QOSACL.setRevisions(('2003-05-06 12:00',)) if getattr(mibBuilder, 'version', (0, 0, 0)) > (4, 4, 0): if mibBuilder.loadTexts: gsm7312QOSACL.setRevisionsDescriptions(('Initial revision.',)) if mibBuilder.loadTexts: gsm7312QOSACL.setLastUpdated('200305061200Z') if mibBuilder.loadTexts: gsm7312QOSACL.setOrganization('Netgear') if mibBuilder.loadTexts: gsm7312QOSACL.setContactInfo('') if mibBuilder.loadTexts: gsm7312QOSACL.setDescription('') aclTable = MibTable((1, 3, 6, 1, 4, 1, 4526, 1, 6, 3, 2, 1), ) if mibBuilder.loadTexts: aclTable.setStatus('current') if mibBuilder.loadTexts: aclTable.setDescription('A table of ACL instances.') aclEntry = MibTableRow((1, 3, 6, 1, 4, 1, 4526, 1, 6, 3, 2, 1, 1), ).setIndexNames((0, "GSM7312-QOS-ACL-MIB", "aclIndex")) if mibBuilder.loadTexts: aclEntry.setStatus('current') if mibBuilder.loadTexts: aclEntry.setDescription('') aclStatus = MibTableColumn((1, 3, 6, 1, 4, 1, 4526, 1, 6, 3, 2, 1, 1, 3), RowStatus()).setMaxAccess("readcreate") if mibBuilder.loadTexts: aclStatus.setStatus('current') if mibBuilder.loadTexts: aclStatus.setDescription('Status of this instance. active(1) - this ACL instance is active createAndGo(4) - set to this value to create an instance destroy(6) - set to this value to delete an instance') aclIndex = MibTableColumn((1, 3, 6, 1, 4, 1, 4526, 1, 6, 3, 2, 1, 1, 1), Integer32()) if mibBuilder.loadTexts: aclIndex.setStatus('current') if mibBuilder.loadTexts: aclIndex.setDescription('The ACL index this instance is associated with.') aclIfTable = MibTable((1, 3, 6, 1, 4, 1, 4526, 1, 6, 3, 2, 2), ) if mibBuilder.loadTexts: aclIfTable.setStatus('current') if mibBuilder.loadTexts: aclIfTable.setDescription('A table of ACL interface instances.') aclIfEntry = MibTableRow((1, 3, 6, 1, 4, 1, 4526, 1, 6, 3, 2, 2, 1), ).setIndexNames((0, "GSM7312-QOS-ACL-MIB", "aclIndex"), (0, "GSM7312-QOS-ACL-MIB", "aclIfIndex"), (0, "GSM7312-QOS-ACL-MIB", "aclIfDirection")) if mibBuilder.loadTexts: aclIfEntry.setStatus('current') if mibBuilder.loadTexts: aclIfEntry.setDescription('') aclIfIndex = MibTableColumn((1, 3, 6, 1, 4, 1, 4526, 1, 6, 3, 2, 2, 1, 1), Integer32()) if mibBuilder.loadTexts: aclIfIndex.setStatus('current') if mibBuilder.loadTexts: aclIfIndex.setDescription('The interface this ACL instance is associated with.') aclIfDirection = MibTableColumn((1, 3, 6, 1, 4, 1, 4526, 1, 6, 3, 2, 2, 1, 2), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2))).clone(namedValues=NamedValues(("inbound", 1), ("outbound", 2)))) if mibBuilder.loadTexts: aclIfDirection.setStatus('current') if mibBuilder.loadTexts: aclIfDirection.setDescription('The direction this ACL instance applies.') aclIfStatus = MibTableColumn((1, 3, 6, 1, 4, 1, 4526, 1, 6, 3, 2, 2, 1, 3), RowStatus()).setMaxAccess("readcreate") if mibBuilder.loadTexts: aclIfStatus.setStatus('current') if mibBuilder.loadTexts: aclIfStatus.setDescription('Status of this instance. active(1) - this ACL index instance is active createAndGo(4) - set to this value to assign an interface to an ACL destroy(6) - set to this value to remove an interface to an ACL') aclRuleTable = MibTable((1, 3, 6, 1, 4, 1, 4526, 1, 6, 3, 2, 3), ) if mibBuilder.loadTexts: aclRuleTable.setStatus('current') if mibBuilder.loadTexts: aclRuleTable.setDescription('A table of ACL Rules instances.') aclRuleEntry = MibTableRow((1, 3, 6, 1, 4, 1, 4526, 1, 6, 3, 2, 3, 1), ).setIndexNames((0, "GSM7312-QOS-ACL-MIB", "aclIndex"), (0, "GSM7312-QOS-ACL-MIB", "aclRuleIndex")) if mibBuilder.loadTexts: aclRuleEntry.setStatus('current') if mibBuilder.loadTexts: aclRuleEntry.setDescription('A table of ACL Classification Rules') aclRuleIndex = MibTableColumn((1, 3, 6, 1, 4, 1, 4526, 1, 6, 3, 2, 3, 1, 1), Integer32()) if mibBuilder.loadTexts: aclRuleIndex.setStatus('current') if mibBuilder.loadTexts: aclRuleIndex.setDescription('The index of this instance.') aclRuleAction = MibTableColumn((1, 3, 6, 1, 4, 1, 4526, 1, 6, 3, 2, 3, 1, 2), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2))).clone(namedValues=NamedValues(("permit", 1), ("deny", 2))).clone('deny')).setMaxAccess("readcreate") if mibBuilder.loadTexts: aclRuleAction.setStatus('current') if mibBuilder.loadTexts: aclRuleAction.setDescription('The type of action this rule should perform.') aclRuleProtocol = MibTableColumn((1, 3, 6, 1, 4, 1, 4526, 1, 6, 3, 2, 3, 1, 3), Integer32().subtype(subtypeSpec=ValueRangeConstraint(1, 255))).setMaxAccess("readcreate") if mibBuilder.loadTexts: aclRuleProtocol.setStatus('current') if mibBuilder.loadTexts: aclRuleProtocol.setDescription('icmp - 1 igmp - 2 ip - 4 tcp - 6 udp - 17 All values from 1 to 255 are valid.') aclRuleSrcIpAddress = MibTableColumn((1, 3, 6, 1, 4, 1, 4526, 1, 6, 3, 2, 3, 1, 4), IpAddress()).setMaxAccess("readcreate") if mibBuilder.loadTexts: aclRuleSrcIpAddress.setStatus('current') if mibBuilder.loadTexts: aclRuleSrcIpAddress.setDescription('The Source IP Address used in the ACL Classification.') aclRuleSrcIpMask = MibTableColumn((1, 3, 6, 1, 4, 1, 4526, 1, 6, 3, 2, 3, 1, 5), IpAddress()).setMaxAccess("readcreate") if mibBuilder.loadTexts: aclRuleSrcIpMask.setStatus('current') if mibBuilder.loadTexts: aclRuleSrcIpMask.setDescription('The Source IP Mask used in the ACL Classification.') aclRuleSrcL4Port = MibTableColumn((1, 3, 6, 1, 4, 1, 4526, 1, 6, 3, 2, 3, 1, 6), Integer32()).setMaxAccess("readcreate") if mibBuilder.loadTexts: aclRuleSrcL4Port.setStatus('current') if mibBuilder.loadTexts: aclRuleSrcL4Port.setDescription('The Source Port Number (Layer 4) used in the ACL Classification.') aclRuleSrcL4PortRangeStart = MibTableColumn((1, 3, 6, 1, 4, 1, 4526, 1, 6, 3, 2, 3, 1, 7), Integer32()).setMaxAccess("readcreate") if mibBuilder.loadTexts: aclRuleSrcL4PortRangeStart.setStatus('current') if mibBuilder.loadTexts: aclRuleSrcL4PortRangeStart.setDescription('The Source Port Number(Layer 4) range start.') aclRuleSrcL4PortRangeEnd = MibTableColumn((1, 3, 6, 1, 4, 1, 4526, 1, 6, 3, 2, 3, 1, 8), Integer32()).setMaxAccess("readcreate") if mibBuilder.loadTexts: aclRuleSrcL4PortRangeEnd.setStatus('current') if mibBuilder.loadTexts: aclRuleSrcL4PortRangeEnd.setDescription('The Source Port Number(Layer 4) range end.') aclRuleDestIpAddress = MibTableColumn((1, 3, 6, 1, 4, 1, 4526, 1, 6, 3, 2, 3, 1, 9), IpAddress()).setMaxAccess("readcreate") if mibBuilder.loadTexts: aclRuleDestIpAddress.setStatus('current') if mibBuilder.loadTexts: aclRuleDestIpAddress.setDescription('The Destination IP Address used in the ACL Classification.') aclRuleDestIpMask = MibTableColumn((1, 3, 6, 1, 4, 1, 4526, 1, 6, 3, 2, 3, 1, 10), IpAddress()).setMaxAccess("readcreate") if mibBuilder.loadTexts: aclRuleDestIpMask.setStatus('current') if mibBuilder.loadTexts: aclRuleDestIpMask.setDescription('The Destination IP Mask used in the ACL Classification.') aclRuleDestL4Port = MibTableColumn((1, 3, 6, 1, 4, 1, 4526, 1, 6, 3, 2, 3, 1, 11), Integer32()).setMaxAccess("readcreate") if mibBuilder.loadTexts: aclRuleDestL4Port.setStatus('current') if mibBuilder.loadTexts: aclRuleDestL4Port.setDescription('The Destination Port (Layer 4) used in ACl classification.') aclRuleDestL4PortRangeStart = MibTableColumn((1, 3, 6, 1, 4, 1, 4526, 1, 6, 3, 2, 3, 1, 12), Integer32()).setMaxAccess("readcreate") if mibBuilder.loadTexts: aclRuleDestL4PortRangeStart.setStatus('current') if mibBuilder.loadTexts: aclRuleDestL4PortRangeStart.setDescription('The Destination Port (Layer 4) starting range used in ACL classification.') aclRuleDestL4PortRangeEnd = MibTableColumn((1, 3, 6, 1, 4, 1, 4526, 1, 6, 3, 2, 3, 1, 13), Integer32()).setMaxAccess("readcreate") if mibBuilder.loadTexts: aclRuleDestL4PortRangeEnd.setStatus('current') if mibBuilder.loadTexts: aclRuleDestL4PortRangeEnd.setDescription('The Destination Port (Layer 4) ending range used in ACL classification.') aclRuleIPDSCP = MibTableColumn((1, 3, 6, 1, 4, 1, 4526, 1, 6, 3, 2, 3, 1, 14), Integer32()).setMaxAccess("readcreate") if mibBuilder.loadTexts: aclRuleIPDSCP.setStatus('current') if mibBuilder.loadTexts: aclRuleIPDSCP.setDescription('The Differentiated Services Code Point value.') aclRuleIpPrecedence = MibTableColumn((1, 3, 6, 1, 4, 1, 4526, 1, 6, 3, 2, 3, 1, 15), Integer32()).setMaxAccess("readcreate") if mibBuilder.loadTexts: aclRuleIpPrecedence.setStatus('current') if mibBuilder.loadTexts: aclRuleIpPrecedence.setDescription('The Type of Service (TOS) IP Precedence value.') aclRuleIpTosBits = MibTableColumn((1, 3, 6, 1, 4, 1, 4526, 1, 6, 3, 2, 3, 1, 16), Integer32()).setMaxAccess("readcreate") if mibBuilder.loadTexts: aclRuleIpTosBits.setStatus('current') if mibBuilder.loadTexts: aclRuleIpTosBits.setDescription('The Type of Service (TOS) Bits value.') aclRuleIpTosMask = MibTableColumn((1, 3, 6, 1, 4, 1, 4526, 1, 6, 3, 2, 3, 1, 17), Integer32()).setMaxAccess("readcreate") if mibBuilder.loadTexts: aclRuleIpTosMask.setStatus('current') if mibBuilder.loadTexts: aclRuleIpTosMask.setDescription('The Type of Service (TOS) Mask value.') aclRuleStatus = MibTableColumn((1, 3, 6, 1, 4, 1, 4526, 1, 6, 3, 2, 3, 1, 18), RowStatus()).setMaxAccess("readcreate") if mibBuilder.loadTexts: aclRuleStatus.setStatus('current') if mibBuilder.loadTexts: aclRuleStatus.setDescription('Status of this instance. active(1) - this ACL Rule is active createAndGo(4) - set to this value to create an instance destroy(6) - set to this value to delete an instance') mibBuilder.exportSymbols("GSM7312-QOS-ACL-MIB", gsm7312QOSACL=gsm7312QOSACL, aclIfEntry=aclIfEntry, aclRuleIPDSCP=aclRuleIPDSCP, aclRuleDestIpAddress=aclRuleDestIpAddress, aclRuleDestL4PortRangeStart=aclRuleDestL4PortRangeStart, aclRuleIpPrecedence=aclRuleIpPrecedence, aclIfTable=aclIfTable, aclIndex=aclIndex, aclRuleDestL4PortRangeEnd=aclRuleDestL4PortRangeEnd, aclRuleSrcL4Port=aclRuleSrcL4Port, aclStatus=aclStatus, aclIfIndex=aclIfIndex, aclRuleIpTosMask=aclRuleIpTosMask, aclRuleAction=aclRuleAction, aclRuleSrcL4PortRangeEnd=aclRuleSrcL4PortRangeEnd, aclTable=aclTable, aclIfDirection=aclIfDirection, aclEntry=aclEntry, aclRuleDestL4Port=aclRuleDestL4Port, aclRuleSrcL4PortRangeStart=aclRuleSrcL4PortRangeStart, PYSNMP_MODULE_ID=gsm7312QOSACL, aclIfStatus=aclIfStatus, aclRuleEntry=aclRuleEntry, aclRuleDestIpMask=aclRuleDestIpMask, aclRuleTable=aclRuleTable, aclRuleIndex=aclRuleIndex, aclRuleIpTosBits=aclRuleIpTosBits, aclRuleSrcIpAddress=aclRuleSrcIpAddress, aclRuleStatus=aclRuleStatus, aclRuleProtocol=aclRuleProtocol, aclRuleSrcIpMask=aclRuleSrcIpMask)
(integer, octet_string, object_identifier) = mibBuilder.importSymbols('ASN1', 'Integer', 'OctetString', 'ObjectIdentifier') (named_values,) = mibBuilder.importSymbols('ASN1-ENUMERATION', 'NamedValues') (value_range_constraint, value_size_constraint, constraints_union, constraints_intersection, single_value_constraint) = mibBuilder.importSymbols('ASN1-REFINEMENT', 'ValueRangeConstraint', 'ValueSizeConstraint', 'ConstraintsUnion', 'ConstraintsIntersection', 'SingleValueConstraint') (gsm7312_qos,) = mibBuilder.importSymbols('GSM7312-QOS-MIB', 'gsm7312QOS') (module_compliance, notification_group) = mibBuilder.importSymbols('SNMPv2-CONF', 'ModuleCompliance', 'NotificationGroup') (time_ticks, unsigned32, counter32, module_identity, bits, gauge32, mib_scalar, mib_table, mib_table_row, mib_table_column, object_identity, ip_address, notification_type, mib_identifier, integer32, iso, counter64) = mibBuilder.importSymbols('SNMPv2-SMI', 'TimeTicks', 'Unsigned32', 'Counter32', 'ModuleIdentity', 'Bits', 'Gauge32', 'MibScalar', 'MibTable', 'MibTableRow', 'MibTableColumn', 'ObjectIdentity', 'IpAddress', 'NotificationType', 'MibIdentifier', 'Integer32', 'iso', 'Counter64') (display_string, textual_convention, row_status) = mibBuilder.importSymbols('SNMPv2-TC', 'DisplayString', 'TextualConvention', 'RowStatus') gsm7312_qosacl = module_identity((1, 3, 6, 1, 4, 1, 4526, 1, 6, 3, 2)) gsm7312QOSACL.setRevisions(('2003-05-06 12:00',)) if getattr(mibBuilder, 'version', (0, 0, 0)) > (4, 4, 0): if mibBuilder.loadTexts: gsm7312QOSACL.setRevisionsDescriptions(('Initial revision.',)) if mibBuilder.loadTexts: gsm7312QOSACL.setLastUpdated('200305061200Z') if mibBuilder.loadTexts: gsm7312QOSACL.setOrganization('Netgear') if mibBuilder.loadTexts: gsm7312QOSACL.setContactInfo('') if mibBuilder.loadTexts: gsm7312QOSACL.setDescription('') acl_table = mib_table((1, 3, 6, 1, 4, 1, 4526, 1, 6, 3, 2, 1)) if mibBuilder.loadTexts: aclTable.setStatus('current') if mibBuilder.loadTexts: aclTable.setDescription('A table of ACL instances.') acl_entry = mib_table_row((1, 3, 6, 1, 4, 1, 4526, 1, 6, 3, 2, 1, 1)).setIndexNames((0, 'GSM7312-QOS-ACL-MIB', 'aclIndex')) if mibBuilder.loadTexts: aclEntry.setStatus('current') if mibBuilder.loadTexts: aclEntry.setDescription('') acl_status = mib_table_column((1, 3, 6, 1, 4, 1, 4526, 1, 6, 3, 2, 1, 1, 3), row_status()).setMaxAccess('readcreate') if mibBuilder.loadTexts: aclStatus.setStatus('current') if mibBuilder.loadTexts: aclStatus.setDescription('Status of this instance. active(1) - this ACL instance is active createAndGo(4) - set to this value to create an instance destroy(6) - set to this value to delete an instance') acl_index = mib_table_column((1, 3, 6, 1, 4, 1, 4526, 1, 6, 3, 2, 1, 1, 1), integer32()) if mibBuilder.loadTexts: aclIndex.setStatus('current') if mibBuilder.loadTexts: aclIndex.setDescription('The ACL index this instance is associated with.') acl_if_table = mib_table((1, 3, 6, 1, 4, 1, 4526, 1, 6, 3, 2, 2)) if mibBuilder.loadTexts: aclIfTable.setStatus('current') if mibBuilder.loadTexts: aclIfTable.setDescription('A table of ACL interface instances.') acl_if_entry = mib_table_row((1, 3, 6, 1, 4, 1, 4526, 1, 6, 3, 2, 2, 1)).setIndexNames((0, 'GSM7312-QOS-ACL-MIB', 'aclIndex'), (0, 'GSM7312-QOS-ACL-MIB', 'aclIfIndex'), (0, 'GSM7312-QOS-ACL-MIB', 'aclIfDirection')) if mibBuilder.loadTexts: aclIfEntry.setStatus('current') if mibBuilder.loadTexts: aclIfEntry.setDescription('') acl_if_index = mib_table_column((1, 3, 6, 1, 4, 1, 4526, 1, 6, 3, 2, 2, 1, 1), integer32()) if mibBuilder.loadTexts: aclIfIndex.setStatus('current') if mibBuilder.loadTexts: aclIfIndex.setDescription('The interface this ACL instance is associated with.') acl_if_direction = mib_table_column((1, 3, 6, 1, 4, 1, 4526, 1, 6, 3, 2, 2, 1, 2), integer32().subtype(subtypeSpec=constraints_union(single_value_constraint(1, 2))).clone(namedValues=named_values(('inbound', 1), ('outbound', 2)))) if mibBuilder.loadTexts: aclIfDirection.setStatus('current') if mibBuilder.loadTexts: aclIfDirection.setDescription('The direction this ACL instance applies.') acl_if_status = mib_table_column((1, 3, 6, 1, 4, 1, 4526, 1, 6, 3, 2, 2, 1, 3), row_status()).setMaxAccess('readcreate') if mibBuilder.loadTexts: aclIfStatus.setStatus('current') if mibBuilder.loadTexts: aclIfStatus.setDescription('Status of this instance. active(1) - this ACL index instance is active createAndGo(4) - set to this value to assign an interface to an ACL destroy(6) - set to this value to remove an interface to an ACL') acl_rule_table = mib_table((1, 3, 6, 1, 4, 1, 4526, 1, 6, 3, 2, 3)) if mibBuilder.loadTexts: aclRuleTable.setStatus('current') if mibBuilder.loadTexts: aclRuleTable.setDescription('A table of ACL Rules instances.') acl_rule_entry = mib_table_row((1, 3, 6, 1, 4, 1, 4526, 1, 6, 3, 2, 3, 1)).setIndexNames((0, 'GSM7312-QOS-ACL-MIB', 'aclIndex'), (0, 'GSM7312-QOS-ACL-MIB', 'aclRuleIndex')) if mibBuilder.loadTexts: aclRuleEntry.setStatus('current') if mibBuilder.loadTexts: aclRuleEntry.setDescription('A table of ACL Classification Rules') acl_rule_index = mib_table_column((1, 3, 6, 1, 4, 1, 4526, 1, 6, 3, 2, 3, 1, 1), integer32()) if mibBuilder.loadTexts: aclRuleIndex.setStatus('current') if mibBuilder.loadTexts: aclRuleIndex.setDescription('The index of this instance.') acl_rule_action = mib_table_column((1, 3, 6, 1, 4, 1, 4526, 1, 6, 3, 2, 3, 1, 2), integer32().subtype(subtypeSpec=constraints_union(single_value_constraint(1, 2))).clone(namedValues=named_values(('permit', 1), ('deny', 2))).clone('deny')).setMaxAccess('readcreate') if mibBuilder.loadTexts: aclRuleAction.setStatus('current') if mibBuilder.loadTexts: aclRuleAction.setDescription('The type of action this rule should perform.') acl_rule_protocol = mib_table_column((1, 3, 6, 1, 4, 1, 4526, 1, 6, 3, 2, 3, 1, 3), integer32().subtype(subtypeSpec=value_range_constraint(1, 255))).setMaxAccess('readcreate') if mibBuilder.loadTexts: aclRuleProtocol.setStatus('current') if mibBuilder.loadTexts: aclRuleProtocol.setDescription('icmp - 1 igmp - 2 ip - 4 tcp - 6 udp - 17 All values from 1 to 255 are valid.') acl_rule_src_ip_address = mib_table_column((1, 3, 6, 1, 4, 1, 4526, 1, 6, 3, 2, 3, 1, 4), ip_address()).setMaxAccess('readcreate') if mibBuilder.loadTexts: aclRuleSrcIpAddress.setStatus('current') if mibBuilder.loadTexts: aclRuleSrcIpAddress.setDescription('The Source IP Address used in the ACL Classification.') acl_rule_src_ip_mask = mib_table_column((1, 3, 6, 1, 4, 1, 4526, 1, 6, 3, 2, 3, 1, 5), ip_address()).setMaxAccess('readcreate') if mibBuilder.loadTexts: aclRuleSrcIpMask.setStatus('current') if mibBuilder.loadTexts: aclRuleSrcIpMask.setDescription('The Source IP Mask used in the ACL Classification.') acl_rule_src_l4_port = mib_table_column((1, 3, 6, 1, 4, 1, 4526, 1, 6, 3, 2, 3, 1, 6), integer32()).setMaxAccess('readcreate') if mibBuilder.loadTexts: aclRuleSrcL4Port.setStatus('current') if mibBuilder.loadTexts: aclRuleSrcL4Port.setDescription('The Source Port Number (Layer 4) used in the ACL Classification.') acl_rule_src_l4_port_range_start = mib_table_column((1, 3, 6, 1, 4, 1, 4526, 1, 6, 3, 2, 3, 1, 7), integer32()).setMaxAccess('readcreate') if mibBuilder.loadTexts: aclRuleSrcL4PortRangeStart.setStatus('current') if mibBuilder.loadTexts: aclRuleSrcL4PortRangeStart.setDescription('The Source Port Number(Layer 4) range start.') acl_rule_src_l4_port_range_end = mib_table_column((1, 3, 6, 1, 4, 1, 4526, 1, 6, 3, 2, 3, 1, 8), integer32()).setMaxAccess('readcreate') if mibBuilder.loadTexts: aclRuleSrcL4PortRangeEnd.setStatus('current') if mibBuilder.loadTexts: aclRuleSrcL4PortRangeEnd.setDescription('The Source Port Number(Layer 4) range end.') acl_rule_dest_ip_address = mib_table_column((1, 3, 6, 1, 4, 1, 4526, 1, 6, 3, 2, 3, 1, 9), ip_address()).setMaxAccess('readcreate') if mibBuilder.loadTexts: aclRuleDestIpAddress.setStatus('current') if mibBuilder.loadTexts: aclRuleDestIpAddress.setDescription('The Destination IP Address used in the ACL Classification.') acl_rule_dest_ip_mask = mib_table_column((1, 3, 6, 1, 4, 1, 4526, 1, 6, 3, 2, 3, 1, 10), ip_address()).setMaxAccess('readcreate') if mibBuilder.loadTexts: aclRuleDestIpMask.setStatus('current') if mibBuilder.loadTexts: aclRuleDestIpMask.setDescription('The Destination IP Mask used in the ACL Classification.') acl_rule_dest_l4_port = mib_table_column((1, 3, 6, 1, 4, 1, 4526, 1, 6, 3, 2, 3, 1, 11), integer32()).setMaxAccess('readcreate') if mibBuilder.loadTexts: aclRuleDestL4Port.setStatus('current') if mibBuilder.loadTexts: aclRuleDestL4Port.setDescription('The Destination Port (Layer 4) used in ACl classification.') acl_rule_dest_l4_port_range_start = mib_table_column((1, 3, 6, 1, 4, 1, 4526, 1, 6, 3, 2, 3, 1, 12), integer32()).setMaxAccess('readcreate') if mibBuilder.loadTexts: aclRuleDestL4PortRangeStart.setStatus('current') if mibBuilder.loadTexts: aclRuleDestL4PortRangeStart.setDescription('The Destination Port (Layer 4) starting range used in ACL classification.') acl_rule_dest_l4_port_range_end = mib_table_column((1, 3, 6, 1, 4, 1, 4526, 1, 6, 3, 2, 3, 1, 13), integer32()).setMaxAccess('readcreate') if mibBuilder.loadTexts: aclRuleDestL4PortRangeEnd.setStatus('current') if mibBuilder.loadTexts: aclRuleDestL4PortRangeEnd.setDescription('The Destination Port (Layer 4) ending range used in ACL classification.') acl_rule_ipdscp = mib_table_column((1, 3, 6, 1, 4, 1, 4526, 1, 6, 3, 2, 3, 1, 14), integer32()).setMaxAccess('readcreate') if mibBuilder.loadTexts: aclRuleIPDSCP.setStatus('current') if mibBuilder.loadTexts: aclRuleIPDSCP.setDescription('The Differentiated Services Code Point value.') acl_rule_ip_precedence = mib_table_column((1, 3, 6, 1, 4, 1, 4526, 1, 6, 3, 2, 3, 1, 15), integer32()).setMaxAccess('readcreate') if mibBuilder.loadTexts: aclRuleIpPrecedence.setStatus('current') if mibBuilder.loadTexts: aclRuleIpPrecedence.setDescription('The Type of Service (TOS) IP Precedence value.') acl_rule_ip_tos_bits = mib_table_column((1, 3, 6, 1, 4, 1, 4526, 1, 6, 3, 2, 3, 1, 16), integer32()).setMaxAccess('readcreate') if mibBuilder.loadTexts: aclRuleIpTosBits.setStatus('current') if mibBuilder.loadTexts: aclRuleIpTosBits.setDescription('The Type of Service (TOS) Bits value.') acl_rule_ip_tos_mask = mib_table_column((1, 3, 6, 1, 4, 1, 4526, 1, 6, 3, 2, 3, 1, 17), integer32()).setMaxAccess('readcreate') if mibBuilder.loadTexts: aclRuleIpTosMask.setStatus('current') if mibBuilder.loadTexts: aclRuleIpTosMask.setDescription('The Type of Service (TOS) Mask value.') acl_rule_status = mib_table_column((1, 3, 6, 1, 4, 1, 4526, 1, 6, 3, 2, 3, 1, 18), row_status()).setMaxAccess('readcreate') if mibBuilder.loadTexts: aclRuleStatus.setStatus('current') if mibBuilder.loadTexts: aclRuleStatus.setDescription('Status of this instance. active(1) - this ACL Rule is active createAndGo(4) - set to this value to create an instance destroy(6) - set to this value to delete an instance') mibBuilder.exportSymbols('GSM7312-QOS-ACL-MIB', gsm7312QOSACL=gsm7312QOSACL, aclIfEntry=aclIfEntry, aclRuleIPDSCP=aclRuleIPDSCP, aclRuleDestIpAddress=aclRuleDestIpAddress, aclRuleDestL4PortRangeStart=aclRuleDestL4PortRangeStart, aclRuleIpPrecedence=aclRuleIpPrecedence, aclIfTable=aclIfTable, aclIndex=aclIndex, aclRuleDestL4PortRangeEnd=aclRuleDestL4PortRangeEnd, aclRuleSrcL4Port=aclRuleSrcL4Port, aclStatus=aclStatus, aclIfIndex=aclIfIndex, aclRuleIpTosMask=aclRuleIpTosMask, aclRuleAction=aclRuleAction, aclRuleSrcL4PortRangeEnd=aclRuleSrcL4PortRangeEnd, aclTable=aclTable, aclIfDirection=aclIfDirection, aclEntry=aclEntry, aclRuleDestL4Port=aclRuleDestL4Port, aclRuleSrcL4PortRangeStart=aclRuleSrcL4PortRangeStart, PYSNMP_MODULE_ID=gsm7312QOSACL, aclIfStatus=aclIfStatus, aclRuleEntry=aclRuleEntry, aclRuleDestIpMask=aclRuleDestIpMask, aclRuleTable=aclRuleTable, aclRuleIndex=aclRuleIndex, aclRuleIpTosBits=aclRuleIpTosBits, aclRuleSrcIpAddress=aclRuleSrcIpAddress, aclRuleStatus=aclRuleStatus, aclRuleProtocol=aclRuleProtocol, aclRuleSrcIpMask=aclRuleSrcIpMask)
settings = { "ARCHIVE" : True, "MAX_POSTS" : 5000 }
settings = {'ARCHIVE': True, 'MAX_POSTS': 5000}
def minim(lst): min = 100000 minI = 99999 for i in range(len(lst)): if lst[i]<min: min = lst[i] minI=i return min,minI lst = list(map(int, input().split())) lst2 = len(lst)*[0] min = lst[1] for i in range(len(lst)): x,y = minim(lst) lst2.append(x) # print(minim(lst))
def minim(lst): min = 100000 min_i = 99999 for i in range(len(lst)): if lst[i] < min: min = lst[i] min_i = i return (min, minI) lst = list(map(int, input().split())) lst2 = len(lst) * [0] min = lst[1] for i in range(len(lst)): (x, y) = minim(lst) lst2.append(x)
class CapacityMixin: @staticmethod def get_capacity(capacity, amount): if amount > capacity: return "Capacity reached!" return capacity - amount
class Capacitymixin: @staticmethod def get_capacity(capacity, amount): if amount > capacity: return 'Capacity reached!' return capacity - amount
# Copyright (c) 2009 Google Inc. All rights reserved. # Use of this source code is governed by a BSD-style license that can be # found in the LICENSE file. { 'targets': [ { 'target_name': 'program', 'type': 'executable', 'msvs_cygwin_shell': 0, 'sources': [ 'program.c', ], 'actions': [ { 'action_name': 'make-prog1', 'inputs': [ 'make-prog1.py', ], 'outputs': [ '<(INTERMEDIATE_DIR)/prog1.c', ], 'action': [ 'python', '<(_inputs)', '<@(_outputs)', ], 'process_outputs_as_sources': 1, }, { 'action_name': 'make-prog2', 'inputs': [ 'make-prog2.py', ], 'outputs': [ 'actions-out/prog2.c', ], 'action': [ 'python', '<(_inputs)', '<@(_outputs)', ], 'process_outputs_as_sources': 1, # Allows the test to run without hermetic cygwin on windows. 'msvs_cygwin_shell': 0, }, ], }, { 'target_name': 'counter', 'type': 'none', 'actions': [ { # This action should always run, regardless of whether or not it's # inputs or the command-line change. We do this by creating a dummy # first output, which is always missing, thus causing the build to # always try to recreate it. Actual output files should be listed # after the dummy one, and dependent targets should list the real # output(s) in their inputs # (see '../actions.gyp:depend_on_always_run_action'). 'action_name': 'action_counter', 'inputs': [ 'counter.py', ], 'outputs': [ 'actions-out/action-counter.txt.always', 'actions-out/action-counter.txt', ], 'action': [ 'python', '<(_inputs)', 'actions-out/action-counter.txt', '2', ], # Allows the test to run without hermetic cygwin on windows. 'msvs_cygwin_shell': 0, }, ], }, ], }
{'targets': [{'target_name': 'program', 'type': 'executable', 'msvs_cygwin_shell': 0, 'sources': ['program.c'], 'actions': [{'action_name': 'make-prog1', 'inputs': ['make-prog1.py'], 'outputs': ['<(INTERMEDIATE_DIR)/prog1.c'], 'action': ['python', '<(_inputs)', '<@(_outputs)'], 'process_outputs_as_sources': 1}, {'action_name': 'make-prog2', 'inputs': ['make-prog2.py'], 'outputs': ['actions-out/prog2.c'], 'action': ['python', '<(_inputs)', '<@(_outputs)'], 'process_outputs_as_sources': 1, 'msvs_cygwin_shell': 0}]}, {'target_name': 'counter', 'type': 'none', 'actions': [{'action_name': 'action_counter', 'inputs': ['counter.py'], 'outputs': ['actions-out/action-counter.txt.always', 'actions-out/action-counter.txt'], 'action': ['python', '<(_inputs)', 'actions-out/action-counter.txt', '2'], 'msvs_cygwin_shell': 0}]}]}
print("Enter Num 1 : ") num1 = int(input()) print("Enter Num 2 : ") num2 = int(input()) print("Sum = ", num1+num2) print("This is important")
print('Enter Num 1 : ') num1 = int(input()) print('Enter Num 2 : ') num2 = int(input()) print('Sum = ', num1 + num2) print('This is important')
UI={ 'new_goal':{ 't':'Send me the name of your goal' } }
ui = {'new_goal': {'t': 'Send me the name of your goal'}}
#if customizations are required when doing the update of the code of the jpackage def main(j,jp,force=False): recipe=jp.getCodeMgmtRecipe() recipe.update(force=force)
def main(j, jp, force=False): recipe = jp.getCodeMgmtRecipe() recipe.update(force=force)
def maximo(x, y): if x > y: return x else: return y
def maximo(x, y): if x > y: return x else: return y
######## # PART 1 def get_layers(data, width = 25, height = 6): layers = [] while data: layer = [] for _ in range(width * height): layer.append(data.pop(0)) layers.append(layer) return layers def count_digit_on_layer(layer, digit): return sum([1 for val in layer if val == digit]) def get_layer_with_less_digit(layers, digit): totals = [count_digit_on_layer(layer, digit) for layer in layers] return layers[totals.index(min(totals))] def get_check_digit(layer): return count_digit_on_layer(layer, 1) * count_digit_on_layer(layer, 2) layers = get_layers([int(ch) for ch in "123456789012"], 3, 2) assert get_check_digit(get_layer_with_less_digit(layers, 0)) == 1 layers = get_layers([int(ch) for ch in "123256789012"], 3, 2) assert get_check_digit(get_layer_with_less_digit(layers, 0)) == 2 with open("event2019/day08/input.txt", "r") as input: data = [int(ch) for line in input for ch in line[:-1]] layers = get_layers(data) picked_layer = get_layer_with_less_digit(layers, 0) answer = get_check_digit(get_layer_with_less_digit(layers, 0)) print("Part 1 =", answer) assert answer == 1548 # check with accepted answer ######## # PART 2 def decode_image(layers, width = 25, height = 6): image = layers[0] for layer in layers[1:]: for i in range(width * height): image[i] = layer[i] if image[i] == 2 else image[i] for _ in range(height): for _ in range(width): ch = image.pop(0) print(' ' if ch == 0 else '#', end = "") print() layers = get_layers([int(ch) for ch in "0222112222120000"], 2, 2) #decode_image(layers, 2, 2) with open("event2019/day08/input.txt", "r") as input: data = [int(ch) for line in input for ch in line[:-1]] layers = get_layers(data) print("Part 2 =") decode_image(layers)
def get_layers(data, width=25, height=6): layers = [] while data: layer = [] for _ in range(width * height): layer.append(data.pop(0)) layers.append(layer) return layers def count_digit_on_layer(layer, digit): return sum([1 for val in layer if val == digit]) def get_layer_with_less_digit(layers, digit): totals = [count_digit_on_layer(layer, digit) for layer in layers] return layers[totals.index(min(totals))] def get_check_digit(layer): return count_digit_on_layer(layer, 1) * count_digit_on_layer(layer, 2) layers = get_layers([int(ch) for ch in '123456789012'], 3, 2) assert get_check_digit(get_layer_with_less_digit(layers, 0)) == 1 layers = get_layers([int(ch) for ch in '123256789012'], 3, 2) assert get_check_digit(get_layer_with_less_digit(layers, 0)) == 2 with open('event2019/day08/input.txt', 'r') as input: data = [int(ch) for line in input for ch in line[:-1]] layers = get_layers(data) picked_layer = get_layer_with_less_digit(layers, 0) answer = get_check_digit(get_layer_with_less_digit(layers, 0)) print('Part 1 =', answer) assert answer == 1548 def decode_image(layers, width=25, height=6): image = layers[0] for layer in layers[1:]: for i in range(width * height): image[i] = layer[i] if image[i] == 2 else image[i] for _ in range(height): for _ in range(width): ch = image.pop(0) print(' ' if ch == 0 else '#', end='') print() layers = get_layers([int(ch) for ch in '0222112222120000'], 2, 2) with open('event2019/day08/input.txt', 'r') as input: data = [int(ch) for line in input for ch in line[:-1]] layers = get_layers(data) print('Part 2 =') decode_image(layers)
# System phrases started: str = "Bot {} started" closed: str = "Bot disabled" loaded_cog: str = "Load cog - {}" loading_failed: str = "Failed to load cog - {}\n{}" kill: str = "Bot disabled" # System errors not_owner: str = "You have to be bot's owner to use this command" # LanguageService lang_changed: str = "Language has been changed"
started: str = 'Bot {} started' closed: str = 'Bot disabled' loaded_cog: str = 'Load cog - {}' loading_failed: str = 'Failed to load cog - {}\n{}' kill: str = 'Bot disabled' not_owner: str = "You have to be bot's owner to use this command" lang_changed: str = 'Language has been changed'
wordlist = [ "a's", "able", "about", "above", "according", "accordingly", "across", "actually", "after", "afterwards", "again", "against", "ain't", "all", "allow", "allows", "almost", "alone", "along", "already", "also", "although", "always", "am", "among", "amongst", "an", "and", "another", "any", "anybody", "anyhow", "anyone", "anything", "anyway", "anyways", "anywhere", "apart", "appear", "appreciate", "appropriate", "are", "aren't", "around", "as", "aside", "ask", "asking", "associated", "at", "available", "away", "awfully", "be", "became", "because", "become", "becomes", "becoming", "been", "before", "beforehand", "behind", "being", "believe", "below", "beside", "besides", "best", "better", "between", "beyond", "both", "brief", "but", "by", "c'mon", "c's", "came", "can", "can't", "cannot", "cant", "cause", "causes", "certain", "certainly", "changes", "clearly", "co", "com", "come", "comes", "concerning", "consequently", "consider", "considering", "contain", "containing", "contains", "corresponding", "could", "couldn't", "course", "currently", "definitely", "described", "despite", "did", "didn't", "different", "do", "does", "doesn't", "doing", "don't", "done", "down", "downwards", "during", "each", "edu", "eg", "eight", "either", "else", "elsewhere", "enough", "entirely", "especially", "et", "etc", "even", "ever", "every", "everybody", "everyone", "everything", "everywhere", "ex", "exactly", "example", "except", "far", "few", "fifth", "first", "five", "followed", "following", "follows", "for", "former", "formerly", "forth", "four", "from", "further", "furthermore", "get", "gets", "getting", "given", "gives", "go", "goes", "going", "gone", "got", "gotten", "greetings", "had", "hadn't", "happens", "hardly", "has", "hasn't", "have", "haven't", "having", "he", "he's", "hello", "help", "hence", "her", "here", "here's", "hereafter", "hereby", "herein", "hereupon", "hers", "herself", "hi", "him", "himself", "his", "hither", "hopefully", "how", "howbeit", "however", "i'd", "i'll", "i'm", "i've", "ie", "if", "ignored", "immediate", "in", "inasmuch", "inc", "indeed", "indicate", "indicated", "indicates", "inner", "insofar", "instead", "into", "inward", "is", "isn't", "it", "it'd", "it'll", "it's", "its", "itself", "just", "keep", "keeps", "kept", "know", "known", "knows", "last", "lately", "later", "latter", "latterly", "least", "less", "lest", "let", "let's", "like", "liked", "likely", "little", "look", "looking", "looks", "ltd", "mainly", "many", "may", "maybe", "me", "mean", "meanwhile", "merely", "might", "more", "moreover", "most", "mostly", "much", "must", "my", "myself", "name", "namely", "nd", "near", "nearly", "necessary", "need", "needs", "neither", "never", "nevertheless", "new", "next", "nine", "no", "nobody", "non", "none", "noone", "nor", "normally", "not", "nothing", "novel", "now", "nowhere", "obviously", "of", "off", "often", "oh", "ok", "okay", "old", "on", "once", "one", "ones", "only", "onto", "or", "other", "others", "otherwise", "ought", "our", "ours", "ourselves", "out", "outside", "over", "overall", "own", "particular", "particularly", "per", "perhaps", "placed", "please", "plus", "possible", "presumably", "probably", "provides", "que", "quite", "qv", "rather", "rd", "re", "really", "reasonably", "regarding", "regardless", "regards relatively", "respectively", "right", "said", "same", "saw", "say", "saying", "says", "second", "secondly", "see", "seeing", "seem", "seemed", "seeming", "seems", "seen", "self", "selves", "sensible", "sent", "serious", "seriously", "seven", "several", "shall", "she", "should", "shouldn't", "since", "six", "so", "some", "somebody", "somehow", "someone", "something", "sometime", "sometimes", "somewhat", "somewhere", "soon", "sorry", "specified", "specify", "specifying", "still", "sub", "such", "sup", "sure", "t's", "take", "taken", "tell", "tends", "th", "than", "thank", "thanks", "thanx", "that", "that's", "thats", "the", "their", "theirs", "them", "themselves", "then", "thence", "there", "there's", "thereafter", "thereby", "therefore", "therein", "theres", "thereupon", "these", "they", "they'd", "they'll", "they're", "they've", "think", "third", "this", "thorough", "thoroughly", "those", "though", "three", "through", "throughout", "thru", "thus", "to", "together", "too", "took", "toward", "towards", "tried", "tries", "truly", "try", "trying", "twice", "two", "un", "under", "unfortunately", "unless", "unlikely", "until", "unto", "up", "upon", "us", "use", "used", "useful", "uses", "using", "usually", "value", "various", "very", "via", "viz", "vs", "want", "wants", "was", "wasn't", "way", "we", "we'd", "we'll", "we're", "we've", "welcome", "well", "went", "were", "weren't", "what", "what's", "whatever", "when", "whence", "whenever", "where", "where's", "whereafter", "whereas", "whereby", "wherein", "whereupon", "wherever", "whether", "which", "while", "whither", "who", "who's", "whoever", "whole", "whom", "whose", "why", "will", "willing", "wish", "with", "within", "without", "won't", "wonder", "would", "wouldn't", "yes", "yet", "you", "you'd", "you'll", "you're", "you've", "your", "yours", "yourself", "yourselves", "zero" ] def words(): return wordlist
wordlist = ["a's", 'able', 'about', 'above', 'according', 'accordingly', 'across', 'actually', 'after', 'afterwards', 'again', 'against', "ain't", 'all', 'allow', 'allows', 'almost', 'alone', 'along', 'already', 'also', 'although', 'always', 'am', 'among', 'amongst', 'an', 'and', 'another', 'any', 'anybody', 'anyhow', 'anyone', 'anything', 'anyway', 'anyways', 'anywhere', 'apart', 'appear', 'appreciate', 'appropriate', 'are', "aren't", 'around', 'as', 'aside', 'ask', 'asking', 'associated', 'at', 'available', 'away', 'awfully', 'be', 'became', 'because', 'become', 'becomes', 'becoming', 'been', 'before', 'beforehand', 'behind', 'being', 'believe', 'below', 'beside', 'besides', 'best', 'better', 'between', 'beyond', 'both', 'brief', 'but', 'by', "c'mon", "c's", 'came', 'can', "can't", 'cannot', 'cant', 'cause', 'causes', 'certain', 'certainly', 'changes', 'clearly', 'co', 'com', 'come', 'comes', 'concerning', 'consequently', 'consider', 'considering', 'contain', 'containing', 'contains', 'corresponding', 'could', "couldn't", 'course', 'currently', 'definitely', 'described', 'despite', 'did', "didn't", 'different', 'do', 'does', "doesn't", 'doing', "don't", 'done', 'down', 'downwards', 'during', 'each', 'edu', 'eg', 'eight', 'either', 'else', 'elsewhere', 'enough', 'entirely', 'especially', 'et', 'etc', 'even', 'ever', 'every', 'everybody', 'everyone', 'everything', 'everywhere', 'ex', 'exactly', 'example', 'except', 'far', 'few', 'fifth', 'first', 'five', 'followed', 'following', 'follows', 'for', 'former', 'formerly', 'forth', 'four', 'from', 'further', 'furthermore', 'get', 'gets', 'getting', 'given', 'gives', 'go', 'goes', 'going', 'gone', 'got', 'gotten', 'greetings', 'had', "hadn't", 'happens', 'hardly', 'has', "hasn't", 'have', "haven't", 'having', 'he', "he's", 'hello', 'help', 'hence', 'her', 'here', "here's", 'hereafter', 'hereby', 'herein', 'hereupon', 'hers', 'herself', 'hi', 'him', 'himself', 'his', 'hither', 'hopefully', 'how', 'howbeit', 'however', "i'd", "i'll", "i'm", "i've", 'ie', 'if', 'ignored', 'immediate', 'in', 'inasmuch', 'inc', 'indeed', 'indicate', 'indicated', 'indicates', 'inner', 'insofar', 'instead', 'into', 'inward', 'is', "isn't", 'it', "it'd", "it'll", "it's", 'its', 'itself', 'just', 'keep', 'keeps', 'kept', 'know', 'known', 'knows', 'last', 'lately', 'later', 'latter', 'latterly', 'least', 'less', 'lest', 'let', "let's", 'like', 'liked', 'likely', 'little', 'look', 'looking', 'looks', 'ltd', 'mainly', 'many', 'may', 'maybe', 'me', 'mean', 'meanwhile', 'merely', 'might', 'more', 'moreover', 'most', 'mostly', 'much', 'must', 'my', 'myself', 'name', 'namely', 'nd', 'near', 'nearly', 'necessary', 'need', 'needs', 'neither', 'never', 'nevertheless', 'new', 'next', 'nine', 'no', 'nobody', 'non', 'none', 'noone', 'nor', 'normally', 'not', 'nothing', 'novel', 'now', 'nowhere', 'obviously', 'of', 'off', 'often', 'oh', 'ok', 'okay', 'old', 'on', 'once', 'one', 'ones', 'only', 'onto', 'or', 'other', 'others', 'otherwise', 'ought', 'our', 'ours', 'ourselves', 'out', 'outside', 'over', 'overall', 'own', 'particular', 'particularly', 'per', 'perhaps', 'placed', 'please', 'plus', 'possible', 'presumably', 'probably', 'provides', 'que', 'quite', 'qv', 'rather', 'rd', 're', 'really', 'reasonably', 'regarding', 'regardless', 'regards\trelatively', 'respectively', 'right', 'said', 'same', 'saw', 'say', 'saying', 'says', 'second', 'secondly', 'see', 'seeing', 'seem', 'seemed', 'seeming', 'seems', 'seen', 'self', 'selves', 'sensible', 'sent', 'serious', 'seriously', 'seven', 'several', 'shall', 'she', 'should', "shouldn't", 'since', 'six', 'so', 'some', 'somebody', 'somehow', 'someone', 'something', 'sometime', 'sometimes', 'somewhat', 'somewhere', 'soon', 'sorry', 'specified', 'specify', 'specifying', 'still', 'sub', 'such', 'sup', 'sure', "t's", 'take', 'taken', 'tell', 'tends', 'th', 'than', 'thank', 'thanks', 'thanx', 'that', "that's", 'thats', 'the', 'their', 'theirs', 'them', 'themselves', 'then', 'thence', 'there', "there's", 'thereafter', 'thereby', 'therefore', 'therein', 'theres', 'thereupon', 'these', 'they', "they'd", "they'll", "they're", "they've", 'think', 'third', 'this', 'thorough', 'thoroughly', 'those', 'though', 'three', 'through', 'throughout', 'thru', 'thus', 'to', 'together', 'too', 'took', 'toward', 'towards', 'tried', 'tries', 'truly', 'try', 'trying', 'twice', 'two', 'un', 'under', 'unfortunately', 'unless', 'unlikely', 'until', 'unto', 'up', 'upon', 'us', 'use', 'used', 'useful', 'uses', 'using', 'usually', 'value', 'various', 'very', 'via', 'viz', 'vs', 'want', 'wants', 'was', "wasn't", 'way', 'we', "we'd", "we'll", "we're", "we've", 'welcome', 'well', 'went', 'were', "weren't", 'what', "what's", 'whatever', 'when', 'whence', 'whenever', 'where', "where's", 'whereafter', 'whereas', 'whereby', 'wherein', 'whereupon', 'wherever', 'whether', 'which', 'while', 'whither', 'who', "who's", 'whoever', 'whole', 'whom', 'whose', 'why', 'will', 'willing', 'wish', 'with', 'within', 'without', "won't", 'wonder', 'would', "wouldn't", 'yes', 'yet', 'you', "you'd", "you'll", "you're", "you've", 'your', 'yours', 'yourself', 'yourselves', 'zero'] def words(): return wordlist
sample_trajectory = [[[8.29394929e-01, 2.94382693e-05, 1.24370992e+00], [0.8300607, 0.00321705, 1.24627523], [0.83197002, 0.01345206, 1.25535293], [0.83280536, 0.02711211, 1.26502481], [0.83431212, 0.04126721, 1.27488879], [0.83557291, 0.05575593, 1.28517274], [0.83835516, 0.07094685, 1.29766037], [0.84018236, 0.0848757, 1.30992404], [0.84367176, 0.09899109, 1.32165939], [0.84780989, 0.11275561, 1.332425], [0.85343812, 0.12216536, 1.34048073], [0.85929401, 0.12485794, 1.34398368], [0.86139773, 0.12570567, 1.34577036], [0.86072455, 0.12971565, 1.34570028], [0.86142171, 0.13086022, 1.34607923], [0.86252171, 0.13226137, 1.34576342], [0.86131819, 0.13343436, 1.34602691], [0.86237162, 0.13476304, 1.34625571], [0.86233475, 0.13646685, 1.34643762], [0.86257895, 0.13770382, 1.34626134], [0.86327492, 0.13898366, 1.34679944], [0.86351096, 0.14051317, 1.34688228], [0.86460062, 0.14136772, 1.34739374], [0.86432451, 0.14269744, 1.34746041], [0.86519599, 0.14313221, 1.34789781], [0.86501197, 0.1444806, 1.34814055], [0.86577445, 0.14467521, 1.34821045], [0.86546423, 0.14557526, 1.34840742], [0.86614776, 0.14591165, 1.34892248], [0.86594768, 0.14689357, 1.34916195], [0.86666253, 0.14705808, 1.3493557], [0.86599142, 0.14764966, 1.34944308], [0.86593019, 0.14761498, 1.34965421], [0.86554094, 0.14839651, 1.35002927], [0.86609249, 0.14847811, 1.35004771], [0.86562717, 0.14882716, 1.35021255], [0.86560691, 0.14878882, 1.35066697], [0.86523452, 0.14943953, 1.35077779], [0.86584348, 0.14940555, 1.35102009], [0.86522901, 0.14976554, 1.35107163], [0.86517114, 0.14941758, 1.35133674], [0.86440309, 0.15010623, 1.35173215], [0.86470934, 0.14982907, 1.35153207], [0.86417685, 0.15034566, 1.35204203], [0.86475626, 0.15039388, 1.35211787], [0.86454982, 0.15058402, 1.35209656], [0.86462931, 0.15062848, 1.35254998], [0.86445455, 0.15109283, 1.35246659], [0.86493616, 0.15096502, 1.35264486], [0.86440645, 0.15125336, 1.35257592]] , [[8.29394372e-01, 5.02989856e-06, 1.24369044e+00], [8.28448860e-01, 5.21108705e-04, 1.24412433e+00], [0.82821679, -0.00266306, 1.24340615], [0.82712893, -0.01278852, 1.24238184], [0.8242383, -0.02746302, 1.24138853], [0.82092432, -0.04040762, 1.24021633], [0.81676534, -0.05493966, 1.23709498], [0.81203041, -0.06978358, 1.23090388], [0.81040154, -0.08357767, 1.22607369], [0.80996861, -0.09747925, 1.22250611], [0.80839556, -0.11099092, 1.21861742], [0.80764377, -0.1220292, 1.21606453], [0.80659937, -0.12782397, 1.21509924], [0.80421561, -0.12897047, 1.21389321], [0.80543509, -0.13041502, 1.21218545], [0.80719798, -0.13077158, 1.20977956], [0.80802402, -0.13106103, 1.20923984], [0.80989696, -0.13111801, 1.20648537], [0.81088521, -0.13150426, 1.20611638], [0.81328081, -0.13140379, 1.20439828], [0.81347524, -0.13236595, 1.20291265], [0.81442975, -0.13240708, 1.20165529], [0.81439796, -0.13283523, 1.20113632], [0.8144709, -0.1324097, 1.20073386], [0.81472718, -0.13277184, 1.20014908], [0.81455051, -0.13271349, 1.19998435], [0.81461205, -0.13252529, 1.19982223], [0.81469605, -0.13255599, 1.19956114], [0.8143656, -0.13258219, 1.19952868], [0.81439902, -0.1324634, 1.1993633], [0.81443352, -0.13243586, 1.1992618], [0.81437157, -0.13234246, 1.19916844], [0.81439756, -0.13226621, 1.19910854], [0.81441603, -0.13223594, 1.19907973], [0.81433559, -0.13216323, 1.19904629], [0.81428657, -0.1320852, 1.19900435], [0.8142586, -0.13203865, 1.19895876], [0.8142406, -0.13199832, 1.19892711], [0.81423518, -0.13195133, 1.19891042], [0.81423471, -0.13192349, 1.19890408], [0.81422569, -0.1319086, 1.1988938], [0.81420996, -0.13187683, 1.19887342], [0.81420364, -0.13185729, 1.19886479], [0.81419859, -0.13183793, 1.19885612], [0.81419636, -0.13183512, 1.1988541], [0.81419609, -0.13182733, 1.19885183], [0.81419618, -0.13182156, 1.19885077], [0.81419647, -0.13181636, 1.1988502], [0.81419603, -0.13181478, 1.1988494], [0.81419583, -0.13181186, 1.19884878]] , [[8.29396978e-01, 1.19098267e-06, 1.24374612e+00], [8.29385665e-01, -1.86096731e-05, 1.24374961e+00], [0.83181454, -0.00296723, 1.24262025], [0.83897802, -0.01204637, 1.23870155], [0.84804322, -0.02637806, 1.23229918], [0.85821909, -0.04112286, 1.22443261], [0.86857714, -0.0544144, 1.21659045], [0.88077871, -0.0684697, 1.20824494], [0.89227427, -0.08258709, 1.20086125], [0.902352, -0.09639873, 1.1955734], [0.91087973, -0.11036591, 1.19195383], [0.91774859, -0.12421509, 1.18906245], [0.9213203, -0.133212, 1.18760226], [0.92225532, -0.13533401, 1.18683914], [0.92271873, -0.13441819, 1.18610231], [0.92629903, -0.13659682, 1.18384976], [0.9275226, -0.13732566, 1.18130875], [0.92780813, -0.13798298, 1.18097915], [0.93048265, -0.13851559, 1.17977442], [0.93180621, -0.13885864, 1.17854726], [0.93353268, -0.13944112, 1.17652771], [0.93455178, -0.13987549, 1.17493602], [0.93528591, -0.14017046, 1.17416708], [0.9360892, -0.14048572, 1.17327655], [0.93697368, -0.14082654, 1.17235835], [0.93770095, -0.14103281, 1.17180925], [0.93822995, -0.14154182, 1.17133442], [0.93854101, -0.14166165, 1.17120383], [0.93851431, -0.14218339, 1.170878], [0.93819314, -0.1424812, 1.17085096], [0.93810252, -0.14294232, 1.17071469], [0.93798694, -0.14300315, 1.17063908], [0.93824079, -0.14332302, 1.17040369], [0.93873968, -0.14327306, 1.17039663], [0.93894714, -0.14349533, 1.17027991], [0.93895046, -0.14351914, 1.17031255], [0.93880131, -0.1439269, 1.1702054], [0.93847315, -0.14393894, 1.17033768], [0.93858538, -0.1441697, 1.16997514], [0.93843099, -0.14412295, 1.16999137], [0.93868804, -0.14428903, 1.16989184], [0.93872778, -0.14416847, 1.16993376], [0.93880286, -0.14437759, 1.16981702], [0.93860238, -0.14431987, 1.16976048], [0.93861807, -0.14447591, 1.16969077], [0.93846924, -0.14445969, 1.16964596], [0.93854263, -0.14459339, 1.16963862], [0.93855682, -0.14458076, 1.16964518], [0.93869078, -0.14460289, 1.16967438], [0.93878573, -0.14462207, 1.16959673]] , [[8.29407186e-01, -9.05759077e-06, 1.24368865e+00], [8.29452381e-01, -1.63704649e-04, 1.24357758e+00], [8.25965077e-01, 2.61926546e-04, 1.24626125e+00], [0.81733529, 0.00174526, 1.25507639], [0.80426213, 0.00362642, 1.26770935], [0.79167872, 0.0042421, 1.2788831], [0.77884486, 0.00425323, 1.29066411], [0.76562033, 0.00397443, 1.30224383], [0.75246375, 0.00297646, 1.31192952], [0.73925773, 0.00222876, 1.31881364], [0.72935091, 0.0015718, 1.32334408], [7.24226016e-01, 1.14350341e-03, 1.32602297e+00], [7.22519410e-01, -1.47608797e-04, 1.32901491e+00], [7.23386890e-01, 9.03067432e-04, 1.32840265e+00], [0.72517122, 0.0015991, 1.32902918], [7.27716689e-01, 1.23742022e-03, 1.33002939e+00], [0.72845183, 0.00218048, 1.330628], [0.73016814, 0.00230491, 1.33130849], [0.73068608, 0.00276825, 1.33147273], [0.73058817, 0.0026997, 1.33247778], [0.73087955, 0.00327157, 1.33278831], [0.7311847, 0.00344362, 1.33340541], [0.73196251, 0.00363454, 1.33359357], [0.73037666, 0.00355182, 1.33388385], [0.73017486, 0.00311582, 1.33464425], [0.729715, 0.00375855, 1.33492001], [0.73145033, 0.00389886, 1.33500413], [0.73134099, 0.00342494, 1.33517212], [0.73106361, 0.00342293, 1.33576168], [0.73126924, 0.00411912, 1.33598262], [0.73231772, 0.00415066, 1.33587838], [0.73068793, 0.00380189, 1.33574672], [0.73025543, 0.00317184, 1.33640307], [0.73089559, 0.004183, 1.33681776], [0.73151253, 0.0044662, 1.3363534], [0.73176347, 0.00401998, 1.33673888], [0.7313257, 0.00468158, 1.3370429], [0.73209111, 0.00487611, 1.33683827], [0.73184313, 0.00434979, 1.33684753], [0.73124175, 0.00449397, 1.33768667], [0.73225456, 0.00543768, 1.3373894], [0.73236785, 0.00432575, 1.3374303], [0.73103295, 0.00467082, 1.3380206], [0.73162836, 0.00503268, 1.33785837], [0.73221498, 0.0047949, 1.33773502], [0.73159943, 0.00474566, 1.33783584], [0.73163975, 0.00478752, 1.33809036], [0.73227203, 0.00533049, 1.33800575], [0.73268811, 0.00471999, 1.33770073], [0.731356, 0.00470975, 1.33810571]] , [[8.29462825e-01, -3.02466188e-06, 1.24368449e+00], [8.30306652e-01, 5.36592938e-04, 1.24351743e+00], [0.82627275, 0.00263688, 1.24290417], [0.81688637, 0.01068543, 1.24264759], [0.80534614, 0.02380721, 1.24175146], [0.79290312, 0.03726687, 1.23912056], [0.77948659, 0.05097065, 1.2350255], [0.76523324, 0.06504495, 1.22959431], [0.75226822, 0.07925581, 1.22512592], [0.74237365, 0.09353404, 1.2197175], [0.73913879, 0.10222336, 1.21704451], [0.7394468, 0.10385065, 1.21247085], [0.7333889, 0.10470436, 1.20406516], [0.7259056, 0.10553633, 1.1994055], [0.72469589, 0.10628135, 1.19902167], [0.7263446, 0.10798226, 1.19681979], [0.72525853, 0.10857415, 1.1928742], [0.72563646, 0.10940517, 1.18991156], [0.72578947, 0.10959028, 1.19065591], [0.72531063, 0.11210447, 1.1887599], [0.72605692, 0.11379858, 1.187013], [0.72639765, 0.1122605, 1.18610391], [0.72399292, 0.11456986, 1.18554155], [0.72316012, 0.11516881, 1.18459081], [0.72574085, 0.11555135, 1.18364884], [0.72428049, 0.11549468, 1.18184939], [0.72499676, 0.11608238, 1.18136709], [0.72520263, 0.1170543, 1.1805268], [0.72600627, 0.11705583, 1.17992443], [0.72495808, 0.1178273, 1.17975925], [0.726027, 0.1182533, 1.17909275], [0.7251307, 0.11844033, 1.17929497], [0.72508602, 0.11910898, 1.17888568], [0.72576297, 0.11895758, 1.17872822], [0.72457023, 0.11952085, 1.17893918], [0.72523126, 0.11972244, 1.17814958], [0.72461038, 0.11958309, 1.17865173], [0.72451839, 0.12012874, 1.17848082], [0.7254761, 0.12019711, 1.1782561], [0.72443222, 0.12010784, 1.17859375], [0.72464154, 0.12076384, 1.17830658], [0.72562088, 0.12027699, 1.17823457], [0.72430732, 0.12081787, 1.17862396], [0.72516592, 0.12078771, 1.17773548], [0.72409672, 0.12049726, 1.178552], [0.72442099, 0.12119749, 1.17828582], [0.72558587, 0.12082985, 1.17814712], [0.7243532, 0.12087931, 1.1785126], [0.72489004, 0.12125501, 1.17807636], [0.72473186, 0.12086408, 1.17852156]]]
sample_trajectory = [[[0.829394929, 2.94382693e-05, 1.24370992], [0.8300607, 0.00321705, 1.24627523], [0.83197002, 0.01345206, 1.25535293], [0.83280536, 0.02711211, 1.26502481], [0.83431212, 0.04126721, 1.27488879], [0.83557291, 0.05575593, 1.28517274], [0.83835516, 0.07094685, 1.29766037], [0.84018236, 0.0848757, 1.30992404], [0.84367176, 0.09899109, 1.32165939], [0.84780989, 0.11275561, 1.332425], [0.85343812, 0.12216536, 1.34048073], [0.85929401, 0.12485794, 1.34398368], [0.86139773, 0.12570567, 1.34577036], [0.86072455, 0.12971565, 1.34570028], [0.86142171, 0.13086022, 1.34607923], [0.86252171, 0.13226137, 1.34576342], [0.86131819, 0.13343436, 1.34602691], [0.86237162, 0.13476304, 1.34625571], [0.86233475, 0.13646685, 1.34643762], [0.86257895, 0.13770382, 1.34626134], [0.86327492, 0.13898366, 1.34679944], [0.86351096, 0.14051317, 1.34688228], [0.86460062, 0.14136772, 1.34739374], [0.86432451, 0.14269744, 1.34746041], [0.86519599, 0.14313221, 1.34789781], [0.86501197, 0.1444806, 1.34814055], [0.86577445, 0.14467521, 1.34821045], [0.86546423, 0.14557526, 1.34840742], [0.86614776, 0.14591165, 1.34892248], [0.86594768, 0.14689357, 1.34916195], [0.86666253, 0.14705808, 1.3493557], [0.86599142, 0.14764966, 1.34944308], [0.86593019, 0.14761498, 1.34965421], [0.86554094, 0.14839651, 1.35002927], [0.86609249, 0.14847811, 1.35004771], [0.86562717, 0.14882716, 1.35021255], [0.86560691, 0.14878882, 1.35066697], [0.86523452, 0.14943953, 1.35077779], [0.86584348, 0.14940555, 1.35102009], [0.86522901, 0.14976554, 1.35107163], [0.86517114, 0.14941758, 1.35133674], [0.86440309, 0.15010623, 1.35173215], [0.86470934, 0.14982907, 1.35153207], [0.86417685, 0.15034566, 1.35204203], [0.86475626, 0.15039388, 1.35211787], [0.86454982, 0.15058402, 1.35209656], [0.86462931, 0.15062848, 1.35254998], [0.86445455, 0.15109283, 1.35246659], [0.86493616, 0.15096502, 1.35264486], [0.86440645, 0.15125336, 1.35257592]], [[0.829394372, 5.02989856e-06, 1.24369044], [0.82844886, 0.000521108705, 1.24412433], [0.82821679, -0.00266306, 1.24340615], [0.82712893, -0.01278852, 1.24238184], [0.8242383, -0.02746302, 1.24138853], [0.82092432, -0.04040762, 1.24021633], [0.81676534, -0.05493966, 1.23709498], [0.81203041, -0.06978358, 1.23090388], [0.81040154, -0.08357767, 1.22607369], [0.80996861, -0.09747925, 1.22250611], [0.80839556, -0.11099092, 1.21861742], [0.80764377, -0.1220292, 1.21606453], [0.80659937, -0.12782397, 1.21509924], [0.80421561, -0.12897047, 1.21389321], [0.80543509, -0.13041502, 1.21218545], [0.80719798, -0.13077158, 1.20977956], [0.80802402, -0.13106103, 1.20923984], [0.80989696, -0.13111801, 1.20648537], [0.81088521, -0.13150426, 1.20611638], [0.81328081, -0.13140379, 1.20439828], [0.81347524, -0.13236595, 1.20291265], [0.81442975, -0.13240708, 1.20165529], [0.81439796, -0.13283523, 1.20113632], [0.8144709, -0.1324097, 1.20073386], [0.81472718, -0.13277184, 1.20014908], [0.81455051, -0.13271349, 1.19998435], [0.81461205, -0.13252529, 1.19982223], [0.81469605, -0.13255599, 1.19956114], [0.8143656, -0.13258219, 1.19952868], [0.81439902, -0.1324634, 1.1993633], [0.81443352, -0.13243586, 1.1992618], [0.81437157, -0.13234246, 1.19916844], [0.81439756, -0.13226621, 1.19910854], [0.81441603, -0.13223594, 1.19907973], [0.81433559, -0.13216323, 1.19904629], [0.81428657, -0.1320852, 1.19900435], [0.8142586, -0.13203865, 1.19895876], [0.8142406, -0.13199832, 1.19892711], [0.81423518, -0.13195133, 1.19891042], [0.81423471, -0.13192349, 1.19890408], [0.81422569, -0.1319086, 1.1988938], [0.81420996, -0.13187683, 1.19887342], [0.81420364, -0.13185729, 1.19886479], [0.81419859, -0.13183793, 1.19885612], [0.81419636, -0.13183512, 1.1988541], [0.81419609, -0.13182733, 1.19885183], [0.81419618, -0.13182156, 1.19885077], [0.81419647, -0.13181636, 1.1988502], [0.81419603, -0.13181478, 1.1988494], [0.81419583, -0.13181186, 1.19884878]], [[0.829396978, 1.19098267e-06, 1.24374612], [0.829385665, -1.86096731e-05, 1.24374961], [0.83181454, -0.00296723, 1.24262025], [0.83897802, -0.01204637, 1.23870155], [0.84804322, -0.02637806, 1.23229918], [0.85821909, -0.04112286, 1.22443261], [0.86857714, -0.0544144, 1.21659045], [0.88077871, -0.0684697, 1.20824494], [0.89227427, -0.08258709, 1.20086125], [0.902352, -0.09639873, 1.1955734], [0.91087973, -0.11036591, 1.19195383], [0.91774859, -0.12421509, 1.18906245], [0.9213203, -0.133212, 1.18760226], [0.92225532, -0.13533401, 1.18683914], [0.92271873, -0.13441819, 1.18610231], [0.92629903, -0.13659682, 1.18384976], [0.9275226, -0.13732566, 1.18130875], [0.92780813, -0.13798298, 1.18097915], [0.93048265, -0.13851559, 1.17977442], [0.93180621, -0.13885864, 1.17854726], [0.93353268, -0.13944112, 1.17652771], [0.93455178, -0.13987549, 1.17493602], [0.93528591, -0.14017046, 1.17416708], [0.9360892, -0.14048572, 1.17327655], [0.93697368, -0.14082654, 1.17235835], [0.93770095, -0.14103281, 1.17180925], [0.93822995, -0.14154182, 1.17133442], [0.93854101, -0.14166165, 1.17120383], [0.93851431, -0.14218339, 1.170878], [0.93819314, -0.1424812, 1.17085096], [0.93810252, -0.14294232, 1.17071469], [0.93798694, -0.14300315, 1.17063908], [0.93824079, -0.14332302, 1.17040369], [0.93873968, -0.14327306, 1.17039663], [0.93894714, -0.14349533, 1.17027991], [0.93895046, -0.14351914, 1.17031255], [0.93880131, -0.1439269, 1.1702054], [0.93847315, -0.14393894, 1.17033768], [0.93858538, -0.1441697, 1.16997514], [0.93843099, -0.14412295, 1.16999137], [0.93868804, -0.14428903, 1.16989184], [0.93872778, -0.14416847, 1.16993376], [0.93880286, -0.14437759, 1.16981702], [0.93860238, -0.14431987, 1.16976048], [0.93861807, -0.14447591, 1.16969077], [0.93846924, -0.14445969, 1.16964596], [0.93854263, -0.14459339, 1.16963862], [0.93855682, -0.14458076, 1.16964518], [0.93869078, -0.14460289, 1.16967438], [0.93878573, -0.14462207, 1.16959673]], [[0.829407186, -9.05759077e-06, 1.24368865], [0.829452381, -0.000163704649, 1.24357758], [0.825965077, 0.000261926546, 1.24626125], [0.81733529, 0.00174526, 1.25507639], [0.80426213, 0.00362642, 1.26770935], [0.79167872, 0.0042421, 1.2788831], [0.77884486, 0.00425323, 1.29066411], [0.76562033, 0.00397443, 1.30224383], [0.75246375, 0.00297646, 1.31192952], [0.73925773, 0.00222876, 1.31881364], [0.72935091, 0.0015718, 1.32334408], [0.724226016, 0.00114350341, 1.32602297], [0.72251941, -0.000147608797, 1.32901491], [0.72338689, 0.000903067432, 1.32840265], [0.72517122, 0.0015991, 1.32902918], [0.727716689, 0.00123742022, 1.33002939], [0.72845183, 0.00218048, 1.330628], [0.73016814, 0.00230491, 1.33130849], [0.73068608, 0.00276825, 1.33147273], [0.73058817, 0.0026997, 1.33247778], [0.73087955, 0.00327157, 1.33278831], [0.7311847, 0.00344362, 1.33340541], [0.73196251, 0.00363454, 1.33359357], [0.73037666, 0.00355182, 1.33388385], [0.73017486, 0.00311582, 1.33464425], [0.729715, 0.00375855, 1.33492001], [0.73145033, 0.00389886, 1.33500413], [0.73134099, 0.00342494, 1.33517212], [0.73106361, 0.00342293, 1.33576168], [0.73126924, 0.00411912, 1.33598262], [0.73231772, 0.00415066, 1.33587838], [0.73068793, 0.00380189, 1.33574672], [0.73025543, 0.00317184, 1.33640307], [0.73089559, 0.004183, 1.33681776], [0.73151253, 0.0044662, 1.3363534], [0.73176347, 0.00401998, 1.33673888], [0.7313257, 0.00468158, 1.3370429], [0.73209111, 0.00487611, 1.33683827], [0.73184313, 0.00434979, 1.33684753], [0.73124175, 0.00449397, 1.33768667], [0.73225456, 0.00543768, 1.3373894], [0.73236785, 0.00432575, 1.3374303], [0.73103295, 0.00467082, 1.3380206], [0.73162836, 0.00503268, 1.33785837], [0.73221498, 0.0047949, 1.33773502], [0.73159943, 0.00474566, 1.33783584], [0.73163975, 0.00478752, 1.33809036], [0.73227203, 0.00533049, 1.33800575], [0.73268811, 0.00471999, 1.33770073], [0.731356, 0.00470975, 1.33810571]], [[0.829462825, -3.02466188e-06, 1.24368449], [0.830306652, 0.000536592938, 1.24351743], [0.82627275, 0.00263688, 1.24290417], [0.81688637, 0.01068543, 1.24264759], [0.80534614, 0.02380721, 1.24175146], [0.79290312, 0.03726687, 1.23912056], [0.77948659, 0.05097065, 1.2350255], [0.76523324, 0.06504495, 1.22959431], [0.75226822, 0.07925581, 1.22512592], [0.74237365, 0.09353404, 1.2197175], [0.73913879, 0.10222336, 1.21704451], [0.7394468, 0.10385065, 1.21247085], [0.7333889, 0.10470436, 1.20406516], [0.7259056, 0.10553633, 1.1994055], [0.72469589, 0.10628135, 1.19902167], [0.7263446, 0.10798226, 1.19681979], [0.72525853, 0.10857415, 1.1928742], [0.72563646, 0.10940517, 1.18991156], [0.72578947, 0.10959028, 1.19065591], [0.72531063, 0.11210447, 1.1887599], [0.72605692, 0.11379858, 1.187013], [0.72639765, 0.1122605, 1.18610391], [0.72399292, 0.11456986, 1.18554155], [0.72316012, 0.11516881, 1.18459081], [0.72574085, 0.11555135, 1.18364884], [0.72428049, 0.11549468, 1.18184939], [0.72499676, 0.11608238, 1.18136709], [0.72520263, 0.1170543, 1.1805268], [0.72600627, 0.11705583, 1.17992443], [0.72495808, 0.1178273, 1.17975925], [0.726027, 0.1182533, 1.17909275], [0.7251307, 0.11844033, 1.17929497], [0.72508602, 0.11910898, 1.17888568], [0.72576297, 0.11895758, 1.17872822], [0.72457023, 0.11952085, 1.17893918], [0.72523126, 0.11972244, 1.17814958], [0.72461038, 0.11958309, 1.17865173], [0.72451839, 0.12012874, 1.17848082], [0.7254761, 0.12019711, 1.1782561], [0.72443222, 0.12010784, 1.17859375], [0.72464154, 0.12076384, 1.17830658], [0.72562088, 0.12027699, 1.17823457], [0.72430732, 0.12081787, 1.17862396], [0.72516592, 0.12078771, 1.17773548], [0.72409672, 0.12049726, 1.178552], [0.72442099, 0.12119749, 1.17828582], [0.72558587, 0.12082985, 1.17814712], [0.7243532, 0.12087931, 1.1785126], [0.72489004, 0.12125501, 1.17807636], [0.72473186, 0.12086408, 1.17852156]]]
#-*- coding: utf-8 -*- # https://github.com/Kodi-vStream/venom-xbmc-addons class iHoster: def getDisplayName(self): raise NotImplementedError() def setDisplayName(self, sDisplayName): raise NotImplementedError() def setFileName(self, sFileName): raise NotImplementedError() def getFileName(self): raise NotImplementedError() def getPluginIdentifier(self): raise NotImplementedError() def isDownloadable(self): raise NotImplementedError() def isJDownloaderable(self): raise NotImplementedError() def getPattern(self): raise NotImplementedError() def setUrl(self, sUrl): raise NotImplementedError() def checkUrl(self, sUrl): raise NotImplementedError() def getUrl(self): raise NotImplementedError() def getMediaLink(self): raise NotImplementedError()
class Ihoster: def get_display_name(self): raise not_implemented_error() def set_display_name(self, sDisplayName): raise not_implemented_error() def set_file_name(self, sFileName): raise not_implemented_error() def get_file_name(self): raise not_implemented_error() def get_plugin_identifier(self): raise not_implemented_error() def is_downloadable(self): raise not_implemented_error() def is_j_downloaderable(self): raise not_implemented_error() def get_pattern(self): raise not_implemented_error() def set_url(self, sUrl): raise not_implemented_error() def check_url(self, sUrl): raise not_implemented_error() def get_url(self): raise not_implemented_error() def get_media_link(self): raise not_implemented_error()
expected_output={ "drops":{ "IN_US_CL_V4_PKT_FAILED_POLICY":{ "drop_type":8, "packets":11019, }, "IN_US_V4_PKT_SA_NOT_FOUND_SPI":{ "drop_type":4, "packets":67643, }, "OCT_GEN_NOTIFY_SOFT_EXPIRY":{ "drop_type":66, "packets":159949980, }, "OCT_PKT_HIT_INVALID_SA":{ "drop_type":68, "packets":2797, }, "OUT_OCT_HARD_EXPIRY":{ "drop_type":44, "packets":3223664, }, "OUT_V4_PKT_HIT_IKE_START_SP":{ "drop_type":33, "packets":1763263723, }, "OUT_V4_PKT_HIT_INVALID_SA":{ "drop_type":32, "packets":28583, }, } }
expected_output = {'drops': {'IN_US_CL_V4_PKT_FAILED_POLICY': {'drop_type': 8, 'packets': 11019}, 'IN_US_V4_PKT_SA_NOT_FOUND_SPI': {'drop_type': 4, 'packets': 67643}, 'OCT_GEN_NOTIFY_SOFT_EXPIRY': {'drop_type': 66, 'packets': 159949980}, 'OCT_PKT_HIT_INVALID_SA': {'drop_type': 68, 'packets': 2797}, 'OUT_OCT_HARD_EXPIRY': {'drop_type': 44, 'packets': 3223664}, 'OUT_V4_PKT_HIT_IKE_START_SP': {'drop_type': 33, 'packets': 1763263723}, 'OUT_V4_PKT_HIT_INVALID_SA': {'drop_type': 32, 'packets': 28583}}}
# # PySNMP MIB module FASTPATH-MIB (http://snmplabs.com/pysmi) # ASN.1 source file:///Users/davwang4/Dev/mibs.snmplabs.com/asn1/FASTPATH-MIB # Produced by pysmi-0.3.4 at Wed May 1 13:12:15 2019 # On host DAVWANG4-M-1475 platform Darwin version 18.5.0 by user davwang4 # Using Python version 3.7.3 (default, Mar 27 2019, 09:23:15) # ObjectIdentifier, Integer, OctetString = mibBuilder.importSymbols("ASN1", "ObjectIdentifier", "Integer", "OctetString") NamedValues, = mibBuilder.importSymbols("ASN1-ENUMERATION", "NamedValues") SingleValueConstraint, ConstraintsIntersection, ConstraintsUnion, ValueSizeConstraint, ValueRangeConstraint = mibBuilder.importSymbols("ASN1-REFINEMENT", "SingleValueConstraint", "ConstraintsIntersection", "ConstraintsUnion", "ValueSizeConstraint", "ValueRangeConstraint") NotificationGroup, ModuleCompliance = mibBuilder.importSymbols("SNMPv2-CONF", "NotificationGroup", "ModuleCompliance") IpAddress, MibScalar, MibTable, MibTableRow, MibTableColumn, Counter64, NotificationType, enterprises, iso, Counter32, Integer32, Unsigned32, ObjectIdentity, TimeTicks, Bits, Gauge32, MibIdentifier, ModuleIdentity = mibBuilder.importSymbols("SNMPv2-SMI", "IpAddress", "MibScalar", "MibTable", "MibTableRow", "MibTableColumn", "Counter64", "NotificationType", "enterprises", "iso", "Counter32", "Integer32", "Unsigned32", "ObjectIdentity", "TimeTicks", "Bits", "Gauge32", "MibIdentifier", "ModuleIdentity") TextualConvention, DisplayString = mibBuilder.importSymbols("SNMPv2-TC", "TextualConvention", "DisplayString") excelan = MibIdentifier((1, 3, 6, 1, 4, 1, 23)) genericGroup = MibIdentifier((1, 3, 6, 1, 4, 1, 23, 2)) fastpathMib = MibIdentifier((1, 3, 6, 1, 4, 1, 23, 2, 11)) scc = MibIdentifier((1, 3, 6, 1, 4, 1, 23, 2, 11, 1)) alap = MibIdentifier((1, 3, 6, 1, 4, 1, 23, 2, 11, 2)) ethernet = MibIdentifier((1, 3, 6, 1, 4, 1, 23, 2, 11, 3)) aarp = MibIdentifier((1, 3, 6, 1, 4, 1, 23, 2, 11, 4)) atif = MibIdentifier((1, 3, 6, 1, 4, 1, 23, 2, 11, 5)) ddp = MibIdentifier((1, 3, 6, 1, 4, 1, 23, 2, 11, 6)) rtmp = MibIdentifier((1, 3, 6, 1, 4, 1, 23, 2, 11, 7)) kip = MibIdentifier((1, 3, 6, 1, 4, 1, 23, 2, 11, 8)) zip = MibIdentifier((1, 3, 6, 1, 4, 1, 23, 2, 11, 9)) nbp = MibIdentifier((1, 3, 6, 1, 4, 1, 23, 2, 11, 10)) echo = MibIdentifier((1, 3, 6, 1, 4, 1, 23, 2, 11, 11)) buffer = MibIdentifier((1, 3, 6, 1, 4, 1, 23, 2, 11, 12)) sccInterruptCount = MibScalar((1, 3, 6, 1, 4, 1, 23, 2, 11, 1, 1), Counter32()).setMaxAccess("readonly") if mibBuilder.loadTexts: sccInterruptCount.setStatus('mandatory') sccAbortCount = MibScalar((1, 3, 6, 1, 4, 1, 23, 2, 11, 1, 2), Counter32()).setMaxAccess("readonly") if mibBuilder.loadTexts: sccAbortCount.setStatus('mandatory') sccSpuriousCount = MibScalar((1, 3, 6, 1, 4, 1, 23, 2, 11, 1, 3), Counter32()).setMaxAccess("readonly") if mibBuilder.loadTexts: sccSpuriousCount.setStatus('mandatory') sccCRCCount = MibScalar((1, 3, 6, 1, 4, 1, 23, 2, 11, 1, 4), Counter32()).setMaxAccess("readonly") if mibBuilder.loadTexts: sccCRCCount.setStatus('mandatory') sccOverrunCount = MibScalar((1, 3, 6, 1, 4, 1, 23, 2, 11, 1, 5), Counter32()).setMaxAccess("readonly") if mibBuilder.loadTexts: sccOverrunCount.setStatus('mandatory') sccUnderrunCount = MibScalar((1, 3, 6, 1, 4, 1, 23, 2, 11, 1, 6), Counter32()).setMaxAccess("readonly") if mibBuilder.loadTexts: sccUnderrunCount.setStatus('mandatory') alapReceiveCount = MibScalar((1, 3, 6, 1, 4, 1, 23, 2, 11, 2, 1), Counter32()).setMaxAccess("readonly") if mibBuilder.loadTexts: alapReceiveCount.setStatus('mandatory') alapTransmitCount = MibScalar((1, 3, 6, 1, 4, 1, 23, 2, 11, 2, 2), Counter32()).setMaxAccess("readonly") if mibBuilder.loadTexts: alapTransmitCount.setStatus('mandatory') alapNoHandlerCount = MibScalar((1, 3, 6, 1, 4, 1, 23, 2, 11, 2, 3), Counter32()).setMaxAccess("readonly") if mibBuilder.loadTexts: alapNoHandlerCount.setStatus('mandatory') alapLengthErrorCount = MibScalar((1, 3, 6, 1, 4, 1, 23, 2, 11, 2, 4), Counter32()).setMaxAccess("readonly") if mibBuilder.loadTexts: alapLengthErrorCount.setStatus('mandatory') alapBadCount = MibScalar((1, 3, 6, 1, 4, 1, 23, 2, 11, 2, 5), Counter32()).setMaxAccess("readonly") if mibBuilder.loadTexts: alapBadCount.setStatus('mandatory') alapCollisionCount = MibScalar((1, 3, 6, 1, 4, 1, 23, 2, 11, 2, 6), Counter32()).setMaxAccess("readonly") if mibBuilder.loadTexts: alapCollisionCount.setStatus('mandatory') alapDeferCount = MibScalar((1, 3, 6, 1, 4, 1, 23, 2, 11, 2, 7), Counter32()).setMaxAccess("readonly") if mibBuilder.loadTexts: alapDeferCount.setStatus('mandatory') alapNoDataCount = MibScalar((1, 3, 6, 1, 4, 1, 23, 2, 11, 2, 8), Counter32()).setMaxAccess("readonly") if mibBuilder.loadTexts: alapNoDataCount.setStatus('mandatory') alapRandomCTS = MibScalar((1, 3, 6, 1, 4, 1, 23, 2, 11, 2, 9), Counter32()).setMaxAccess("readonly") if mibBuilder.loadTexts: alapRandomCTS.setStatus('mandatory') etherCRCErrors = MibScalar((1, 3, 6, 1, 4, 1, 23, 2, 11, 3, 1), Counter32()).setMaxAccess("readonly") if mibBuilder.loadTexts: etherCRCErrors.setStatus('mandatory') etherAlignErrors = MibScalar((1, 3, 6, 1, 4, 1, 23, 2, 11, 3, 2), Counter32()).setMaxAccess("readonly") if mibBuilder.loadTexts: etherAlignErrors.setStatus('mandatory') etherResourceErrors = MibScalar((1, 3, 6, 1, 4, 1, 23, 2, 11, 3, 3), Counter32()).setMaxAccess("readonly") if mibBuilder.loadTexts: etherResourceErrors.setStatus('mandatory') etherOverrunErrors = MibScalar((1, 3, 6, 1, 4, 1, 23, 2, 11, 3, 4), Counter32()).setMaxAccess("readonly") if mibBuilder.loadTexts: etherOverrunErrors.setStatus('mandatory') etherInPackets = MibScalar((1, 3, 6, 1, 4, 1, 23, 2, 11, 3, 5), Counter32()).setMaxAccess("readonly") if mibBuilder.loadTexts: etherInPackets.setStatus('mandatory') etherOutPackets = MibScalar((1, 3, 6, 1, 4, 1, 23, 2, 11, 3, 6), Counter32()).setMaxAccess("readonly") if mibBuilder.loadTexts: etherOutPackets.setStatus('mandatory') etherBadTransmits = MibScalar((1, 3, 6, 1, 4, 1, 23, 2, 11, 3, 7), Counter32()).setMaxAccess("readonly") if mibBuilder.loadTexts: etherBadTransmits.setStatus('mandatory') etherOversizeFrames = MibScalar((1, 3, 6, 1, 4, 1, 23, 2, 11, 3, 8), Counter32()).setMaxAccess("readonly") if mibBuilder.loadTexts: etherOversizeFrames.setStatus('mandatory') etherSpurRUReadys = MibScalar((1, 3, 6, 1, 4, 1, 23, 2, 11, 3, 9), Counter32()).setMaxAccess("readonly") if mibBuilder.loadTexts: etherSpurRUReadys.setStatus('mandatory') etherSpurCUActives = MibScalar((1, 3, 6, 1, 4, 1, 23, 2, 11, 3, 10), Counter32()).setMaxAccess("readonly") if mibBuilder.loadTexts: etherSpurCUActives.setStatus('mandatory') etherSpurUnknown = MibScalar((1, 3, 6, 1, 4, 1, 23, 2, 11, 3, 11), Counter32()).setMaxAccess("readonly") if mibBuilder.loadTexts: etherSpurUnknown.setStatus('mandatory') etherBcastDrops = MibScalar((1, 3, 6, 1, 4, 1, 23, 2, 11, 3, 12), Counter32()).setMaxAccess("readonly") if mibBuilder.loadTexts: etherBcastDrops.setStatus('mandatory') etherReceiverRestarts = MibScalar((1, 3, 6, 1, 4, 1, 23, 2, 11, 3, 13), Counter32()).setMaxAccess("readonly") if mibBuilder.loadTexts: etherReceiverRestarts.setStatus('mandatory') etherReinterrupts = MibScalar((1, 3, 6, 1, 4, 1, 23, 2, 11, 3, 14), Counter32()).setMaxAccess("readonly") if mibBuilder.loadTexts: etherReinterrupts.setStatus('mandatory') etherBufferReroutes = MibScalar((1, 3, 6, 1, 4, 1, 23, 2, 11, 3, 15), Counter32()).setMaxAccess("readonly") if mibBuilder.loadTexts: etherBufferReroutes.setStatus('mandatory') etherBufferDrops = MibScalar((1, 3, 6, 1, 4, 1, 23, 2, 11, 3, 16), Counter32()).setMaxAccess("readonly") if mibBuilder.loadTexts: etherBufferDrops.setStatus('mandatory') etherCollisions = MibScalar((1, 3, 6, 1, 4, 1, 23, 2, 11, 3, 17), Counter32()).setMaxAccess("readonly") if mibBuilder.loadTexts: etherCollisions.setStatus('mandatory') etherDefers = MibScalar((1, 3, 6, 1, 4, 1, 23, 2, 11, 3, 18), Counter32()).setMaxAccess("readonly") if mibBuilder.loadTexts: etherDefers.setStatus('mandatory') etherDMAUnderruns = MibScalar((1, 3, 6, 1, 4, 1, 23, 2, 11, 3, 19), Counter32()).setMaxAccess("readonly") if mibBuilder.loadTexts: etherDMAUnderruns.setStatus('mandatory') etherMaxCollisions = MibScalar((1, 3, 6, 1, 4, 1, 23, 2, 11, 3, 20), Counter32()).setMaxAccess("readonly") if mibBuilder.loadTexts: etherMaxCollisions.setStatus('mandatory') etherNoCarriers = MibScalar((1, 3, 6, 1, 4, 1, 23, 2, 11, 3, 21), Counter32()).setMaxAccess("readonly") if mibBuilder.loadTexts: etherNoCarriers.setStatus('mandatory') etherNoCTS = MibScalar((1, 3, 6, 1, 4, 1, 23, 2, 11, 3, 22), Counter32()).setMaxAccess("readonly") if mibBuilder.loadTexts: etherNoCTS.setStatus('mandatory') etherNoSQEs = MibScalar((1, 3, 6, 1, 4, 1, 23, 2, 11, 3, 23), Counter32()).setMaxAccess("readonly") if mibBuilder.loadTexts: etherNoSQEs.setStatus('mandatory') aarpTable = MibTable((1, 3, 6, 1, 4, 1, 23, 2, 11, 4, 1), ).setMaxAccess("readwrite") if mibBuilder.loadTexts: aarpTable.setStatus('mandatory') aarpEntry = MibTableRow((1, 3, 6, 1, 4, 1, 23, 2, 11, 4, 1, 1), ).setMaxAccess("readwrite") if mibBuilder.loadTexts: aarpEntry.setStatus('mandatory') aarpIfIndex = MibTableColumn((1, 3, 6, 1, 4, 1, 23, 2, 11, 4, 1, 1, 1), Integer32()).setMaxAccess("readonly") if mibBuilder.loadTexts: aarpIfIndex.setStatus('mandatory') aarpPhysAddress = MibTableColumn((1, 3, 6, 1, 4, 1, 23, 2, 11, 4, 1, 1, 2), OctetString()).setMaxAccess("readonly") if mibBuilder.loadTexts: aarpPhysAddress.setStatus('mandatory') aarpNetAddress = MibTableColumn((1, 3, 6, 1, 4, 1, 23, 2, 11, 4, 1, 1, 3), OctetString()).setMaxAccess("readonly") if mibBuilder.loadTexts: aarpNetAddress.setStatus('mandatory') atifTable = MibTable((1, 3, 6, 1, 4, 1, 23, 2, 11, 5, 1), ).setMaxAccess("readwrite") if mibBuilder.loadTexts: atifTable.setStatus('mandatory') atifEntry = MibTableRow((1, 3, 6, 1, 4, 1, 23, 2, 11, 5, 1, 1), ).setMaxAccess("readwrite") if mibBuilder.loadTexts: atifEntry.setStatus('mandatory') atifIndex = MibTableColumn((1, 3, 6, 1, 4, 1, 23, 2, 11, 5, 1, 1, 1), Integer32()).setMaxAccess("readonly") if mibBuilder.loadTexts: atifIndex.setStatus('mandatory') atifDescr = MibTableColumn((1, 3, 6, 1, 4, 1, 23, 2, 11, 5, 1, 1, 2), OctetString()).setMaxAccess("readonly") if mibBuilder.loadTexts: atifDescr.setStatus('mandatory') atifType = MibTableColumn((1, 3, 6, 1, 4, 1, 23, 2, 11, 5, 1, 1, 3), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2, 3, 4, 5, 6))).clone(namedValues=NamedValues(("other", 1), ("localtalk", 2), ("ethertalk1", 3), ("ethertalk2", 4), ("tokentalk", 5), ("iptalk", 6)))).setMaxAccess("readonly") if mibBuilder.loadTexts: atifType.setStatus('mandatory') atifNetStart = MibTableColumn((1, 3, 6, 1, 4, 1, 23, 2, 11, 5, 1, 1, 4), OctetString()).setMaxAccess("readwrite") if mibBuilder.loadTexts: atifNetStart.setStatus('mandatory') atifNetEnd = MibTableColumn((1, 3, 6, 1, 4, 1, 23, 2, 11, 5, 1, 1, 5), OctetString()).setMaxAccess("readwrite") if mibBuilder.loadTexts: atifNetEnd.setStatus('mandatory') atifNetAddress = MibTableColumn((1, 3, 6, 1, 4, 1, 23, 2, 11, 5, 1, 1, 6), OctetString()).setMaxAccess("readwrite") if mibBuilder.loadTexts: atifNetAddress.setStatus('mandatory') atifStatus = MibTableColumn((1, 3, 6, 1, 4, 1, 23, 2, 11, 5, 1, 1, 7), Integer32()).setMaxAccess("readonly") if mibBuilder.loadTexts: atifStatus.setStatus('mandatory') atifNetConfig = MibTableColumn((1, 3, 6, 1, 4, 1, 23, 2, 11, 5, 1, 1, 8), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2, 3, 4))).clone(namedValues=NamedValues(("configured", 1), ("garnered", 2), ("guessed", 3), ("unconfigured", 4)))).setMaxAccess("readonly") if mibBuilder.loadTexts: atifNetConfig.setStatus('mandatory') atifZoneConfig = MibTableColumn((1, 3, 6, 1, 4, 1, 23, 2, 11, 5, 1, 1, 9), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2, 3, 4))).clone(namedValues=NamedValues(("configured", 1), ("garnered", 2), ("guessed", 3), ("unconfigured", 4)))).setMaxAccess("readonly") if mibBuilder.loadTexts: atifZoneConfig.setStatus('mandatory') atifZone = MibTableColumn((1, 3, 6, 1, 4, 1, 23, 2, 11, 5, 1, 1, 10), OctetString()).setMaxAccess("readwrite") if mibBuilder.loadTexts: atifZone.setStatus('mandatory') atifIfIndex = MibTableColumn((1, 3, 6, 1, 4, 1, 23, 2, 11, 5, 1, 1, 11), Integer32()).setMaxAccess("readwrite") if mibBuilder.loadTexts: atifIfIndex.setStatus('mandatory') ddpOutRequests = MibScalar((1, 3, 6, 1, 4, 1, 23, 2, 11, 6, 1), Counter32()).setMaxAccess("readonly") if mibBuilder.loadTexts: ddpOutRequests.setStatus('mandatory') ddpOutShort = MibScalar((1, 3, 6, 1, 4, 1, 23, 2, 11, 6, 2), Counter32()).setMaxAccess("readonly") if mibBuilder.loadTexts: ddpOutShort.setStatus('mandatory') ddpOutLong = MibScalar((1, 3, 6, 1, 4, 1, 23, 2, 11, 6, 3), Counter32()).setMaxAccess("readonly") if mibBuilder.loadTexts: ddpOutLong.setStatus('mandatory') ddpReceived = MibScalar((1, 3, 6, 1, 4, 1, 23, 2, 11, 6, 4), Counter32()).setMaxAccess("readonly") if mibBuilder.loadTexts: ddpReceived.setStatus('mandatory') ddpToForward = MibScalar((1, 3, 6, 1, 4, 1, 23, 2, 11, 6, 5), Counter32()).setMaxAccess("readonly") if mibBuilder.loadTexts: ddpToForward.setStatus('mandatory') ddpForwards = MibScalar((1, 3, 6, 1, 4, 1, 23, 2, 11, 6, 6), Counter32()).setMaxAccess("readonly") if mibBuilder.loadTexts: ddpForwards.setStatus('mandatory') ddpForMe = MibScalar((1, 3, 6, 1, 4, 1, 23, 2, 11, 6, 7), Counter32()).setMaxAccess("readonly") if mibBuilder.loadTexts: ddpForMe.setStatus('mandatory') ddpOutNoRoutes = MibScalar((1, 3, 6, 1, 4, 1, 23, 2, 11, 6, 9), Counter32()).setMaxAccess("readonly") if mibBuilder.loadTexts: ddpOutNoRoutes.setStatus('mandatory') ddpTooShortDrops = MibScalar((1, 3, 6, 1, 4, 1, 23, 2, 11, 6, 10), Counter32()).setMaxAccess("readonly") if mibBuilder.loadTexts: ddpTooShortDrops.setStatus('mandatory') ddpTooLongDrops = MibScalar((1, 3, 6, 1, 4, 1, 23, 2, 11, 6, 11), Counter32()).setMaxAccess("readonly") if mibBuilder.loadTexts: ddpTooLongDrops.setStatus('mandatory') ddpBroadcastDrops = MibScalar((1, 3, 6, 1, 4, 1, 23, 2, 11, 6, 12), Counter32()).setMaxAccess("readonly") if mibBuilder.loadTexts: ddpBroadcastDrops.setStatus('mandatory') ddpShortDDPDrops = MibScalar((1, 3, 6, 1, 4, 1, 23, 2, 11, 6, 13), Counter32()).setMaxAccess("readonly") if mibBuilder.loadTexts: ddpShortDDPDrops.setStatus('mandatory') ddpHopCountDrops = MibScalar((1, 3, 6, 1, 4, 1, 23, 2, 11, 6, 14), Counter32()).setMaxAccess("readonly") if mibBuilder.loadTexts: ddpHopCountDrops.setStatus('mandatory') rtmpTable = MibTable((1, 3, 6, 1, 4, 1, 23, 2, 11, 7, 1), ).setMaxAccess("readwrite") if mibBuilder.loadTexts: rtmpTable.setStatus('mandatory') rtmpEntry = MibTableRow((1, 3, 6, 1, 4, 1, 23, 2, 11, 7, 1, 1), ).setMaxAccess("readwrite") if mibBuilder.loadTexts: rtmpEntry.setStatus('mandatory') rtmpRangeStart = MibTableColumn((1, 3, 6, 1, 4, 1, 23, 2, 11, 7, 1, 1, 1), OctetString()).setMaxAccess("readwrite") if mibBuilder.loadTexts: rtmpRangeStart.setStatus('mandatory') rtmpRangeEnd = MibTableColumn((1, 3, 6, 1, 4, 1, 23, 2, 11, 7, 1, 1, 2), OctetString()).setMaxAccess("readwrite") if mibBuilder.loadTexts: rtmpRangeEnd.setStatus('mandatory') rtmpNextHop = MibTableColumn((1, 3, 6, 1, 4, 1, 23, 2, 11, 7, 1, 1, 3), OctetString()).setMaxAccess("readwrite") if mibBuilder.loadTexts: rtmpNextHop.setStatus('mandatory') rtmpInterface = MibTableColumn((1, 3, 6, 1, 4, 1, 23, 2, 11, 7, 1, 1, 4), Integer32()).setMaxAccess("readwrite") if mibBuilder.loadTexts: rtmpInterface.setStatus('mandatory') rtmpHops = MibTableColumn((1, 3, 6, 1, 4, 1, 23, 2, 11, 7, 1, 1, 5), Integer32()).setMaxAccess("readwrite") if mibBuilder.loadTexts: rtmpHops.setStatus('mandatory') rtmpState = MibTableColumn((1, 3, 6, 1, 4, 1, 23, 2, 11, 7, 1, 1, 6), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2, 3))).clone(namedValues=NamedValues(("good", 1), ("suspect", 2), ("bad", 3)))).setMaxAccess("readwrite") if mibBuilder.loadTexts: rtmpState.setStatus('mandatory') kipTable = MibTable((1, 3, 6, 1, 4, 1, 23, 2, 11, 8, 1), ).setMaxAccess("readwrite") if mibBuilder.loadTexts: kipTable.setStatus('mandatory') kipEntry = MibTableRow((1, 3, 6, 1, 4, 1, 23, 2, 11, 8, 1, 1), ).setMaxAccess("readwrite") if mibBuilder.loadTexts: kipEntry.setStatus('mandatory') kipNet = MibTableColumn((1, 3, 6, 1, 4, 1, 23, 2, 11, 8, 1, 1, 1), OctetString()).setMaxAccess("readwrite") if mibBuilder.loadTexts: kipNet.setStatus('mandatory') kipNextHop = MibTableColumn((1, 3, 6, 1, 4, 1, 23, 2, 11, 8, 1, 1, 2), IpAddress()).setMaxAccess("readwrite") if mibBuilder.loadTexts: kipNextHop.setStatus('mandatory') kipHopCount = MibTableColumn((1, 3, 6, 1, 4, 1, 23, 2, 11, 8, 1, 1, 3), Integer32()).setMaxAccess("readwrite") if mibBuilder.loadTexts: kipHopCount.setStatus('mandatory') kipBCastAddr = MibTableColumn((1, 3, 6, 1, 4, 1, 23, 2, 11, 8, 1, 1, 4), IpAddress()).setMaxAccess("readwrite") if mibBuilder.loadTexts: kipBCastAddr.setStatus('mandatory') kipCore = MibTableColumn((1, 3, 6, 1, 4, 1, 23, 2, 11, 8, 1, 1, 5), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2))).clone(namedValues=NamedValues(("core", 1), ("notcore", 2)))).setMaxAccess("readwrite") if mibBuilder.loadTexts: kipCore.setStatus('mandatory') kipKfps = MibTableColumn((1, 3, 6, 1, 4, 1, 23, 2, 11, 8, 1, 1, 6), Integer32()).setMaxAccess("readwrite") if mibBuilder.loadTexts: kipKfps.setStatus('mandatory') zipTable = MibTable((1, 3, 6, 1, 4, 1, 23, 2, 11, 9, 1), ).setMaxAccess("readwrite") if mibBuilder.loadTexts: zipTable.setStatus('mandatory') zipEntry = MibTableRow((1, 3, 6, 1, 4, 1, 23, 2, 11, 9, 1, 1), ).setMaxAccess("readwrite") if mibBuilder.loadTexts: zipEntry.setStatus('mandatory') zipZoneName = MibTableColumn((1, 3, 6, 1, 4, 1, 23, 2, 11, 9, 1, 1, 1), OctetString()).setMaxAccess("readwrite") if mibBuilder.loadTexts: zipZoneName.setStatus('mandatory') zipZoneIndex = MibTableColumn((1, 3, 6, 1, 4, 1, 23, 2, 11, 9, 1, 1, 2), Integer32()).setMaxAccess("readonly") if mibBuilder.loadTexts: zipZoneIndex.setStatus('mandatory') zipZoneNetStart = MibScalar((1, 3, 6, 1, 4, 1, 23, 2, 11, 9, 1, 1, 3), OctetString()).setMaxAccess("readwrite") if mibBuilder.loadTexts: zipZoneNetStart.setStatus('mandatory') zipZoneNetEnd = MibScalar((1, 3, 6, 1, 4, 1, 23, 2, 11, 9, 1, 1, 4), OctetString()).setMaxAccess("readwrite") if mibBuilder.loadTexts: zipZoneNetEnd.setStatus('mandatory') nbpTable = MibTable((1, 3, 6, 1, 4, 1, 23, 2, 11, 10, 1), ).setMaxAccess("readwrite") if mibBuilder.loadTexts: nbpTable.setStatus('mandatory') nbpEntry = MibTableRow((1, 3, 6, 1, 4, 1, 23, 2, 11, 10, 1, 1), ).setMaxAccess("readwrite") if mibBuilder.loadTexts: nbpEntry.setStatus('mandatory') nbpIndex = MibTableColumn((1, 3, 6, 1, 4, 1, 23, 2, 11, 10, 1, 1, 1), Integer32()).setMaxAccess("readonly") if mibBuilder.loadTexts: nbpIndex.setStatus('mandatory') nbpObject = MibTableColumn((1, 3, 6, 1, 4, 1, 23, 2, 11, 10, 1, 1, 2), OctetString()).setMaxAccess("readwrite") if mibBuilder.loadTexts: nbpObject.setStatus('mandatory') nbpType = MibTableColumn((1, 3, 6, 1, 4, 1, 23, 2, 11, 10, 1, 1, 3), OctetString()).setMaxAccess("readwrite") if mibBuilder.loadTexts: nbpType.setStatus('mandatory') nbpZone = MibTableColumn((1, 3, 6, 1, 4, 1, 23, 2, 11, 10, 1, 1, 4), OctetString()).setMaxAccess("readwrite") if mibBuilder.loadTexts: nbpZone.setStatus('mandatory') echoRequests = MibScalar((1, 3, 6, 1, 4, 1, 23, 2, 11, 11, 1), Counter32()).setMaxAccess("readonly") if mibBuilder.loadTexts: echoRequests.setStatus('mandatory') echoReplies = MibScalar((1, 3, 6, 1, 4, 1, 23, 2, 11, 11, 2), Counter32()).setMaxAccess("readonly") if mibBuilder.loadTexts: echoReplies.setStatus('mandatory') bufferSize = MibScalar((1, 3, 6, 1, 4, 1, 23, 2, 11, 12, 1), Integer32()).setMaxAccess("readonly") if mibBuilder.loadTexts: bufferSize.setStatus('mandatory') bufferAvail = MibScalar((1, 3, 6, 1, 4, 1, 23, 2, 11, 12, 2), Integer32()).setMaxAccess("readonly") if mibBuilder.loadTexts: bufferAvail.setStatus('mandatory') bufferDrops = MibScalar((1, 3, 6, 1, 4, 1, 23, 2, 11, 12, 3), Counter32()).setMaxAccess("readonly") if mibBuilder.loadTexts: bufferDrops.setStatus('mandatory') bufferTypeTable = MibTable((1, 3, 6, 1, 4, 1, 23, 2, 11, 12, 4), ).setMaxAccess("readonly") if mibBuilder.loadTexts: bufferTypeTable.setStatus('mandatory') bufferTypeEntry = MibTableRow((1, 3, 6, 1, 4, 1, 23, 2, 11, 12, 4, 1), ).setMaxAccess("readonly") if mibBuilder.loadTexts: bufferTypeEntry.setStatus('mandatory') bufferTypeIndex = MibTableColumn((1, 3, 6, 1, 4, 1, 23, 2, 11, 12, 4, 1, 1), Integer32()).setMaxAccess("readonly") if mibBuilder.loadTexts: bufferTypeIndex.setStatus('mandatory') bufferType = MibTableColumn((1, 3, 6, 1, 4, 1, 23, 2, 11, 12, 4, 1, 2), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11))).clone(namedValues=NamedValues(("other", 1), ("free", 2), ("localtalk", 3), ("ethernet", 4), ("arp", 5), ("data", 6), ("erbf", 7), ("etbf", 8), ("malloc", 9), ("tkbf", 10), ("token", 11)))).setMaxAccess("readonly") if mibBuilder.loadTexts: bufferType.setStatus('mandatory') bufferTypeDescr = MibTableColumn((1, 3, 6, 1, 4, 1, 23, 2, 11, 12, 4, 1, 3), OctetString()).setMaxAccess("readonly") if mibBuilder.loadTexts: bufferTypeDescr.setStatus('mandatory') bufferTypeCount = MibTableColumn((1, 3, 6, 1, 4, 1, 23, 2, 11, 12, 4, 1, 4), Integer32()).setMaxAccess("readonly") if mibBuilder.loadTexts: bufferTypeCount.setStatus('mandatory') mibBuilder.exportSymbols("FASTPATH-MIB", etherAlignErrors=etherAlignErrors, ddpOutNoRoutes=ddpOutNoRoutes, alapCollisionCount=alapCollisionCount, bufferAvail=bufferAvail, kipKfps=kipKfps, etherReceiverRestarts=etherReceiverRestarts, bufferTypeTable=bufferTypeTable, kipCore=kipCore, atifIndex=atifIndex, alapDeferCount=alapDeferCount, rtmpRangeStart=rtmpRangeStart, etherResourceErrors=etherResourceErrors, etherOversizeFrames=etherOversizeFrames, bufferTypeEntry=bufferTypeEntry, ddpOutRequests=ddpOutRequests, ddp=ddp, zipTable=zipTable, etherBadTransmits=etherBadTransmits, nbpTable=nbpTable, alap=alap, bufferDrops=bufferDrops, bufferType=bufferType, sccCRCCount=sccCRCCount, alapReceiveCount=alapReceiveCount, rtmpState=rtmpState, atifEntry=atifEntry, sccAbortCount=sccAbortCount, ddpToForward=ddpToForward, echo=echo, etherOverrunErrors=etherOverrunErrors, atifZoneConfig=atifZoneConfig, atifTable=atifTable, ddpForwards=ddpForwards, bufferTypeIndex=bufferTypeIndex, rtmpNextHop=rtmpNextHop, aarpNetAddress=aarpNetAddress, atif=atif, alapTransmitCount=alapTransmitCount, alapNoHandlerCount=alapNoHandlerCount, etherDMAUnderruns=etherDMAUnderruns, alapBadCount=alapBadCount, etherReinterrupts=etherReinterrupts, ddpTooShortDrops=ddpTooShortDrops, aarpPhysAddress=aarpPhysAddress, aarpIfIndex=aarpIfIndex, rtmpTable=rtmpTable, zipZoneIndex=zipZoneIndex, etherMaxCollisions=etherMaxCollisions, atifStatus=atifStatus, aarpEntry=aarpEntry, etherSpurUnknown=etherSpurUnknown, zipZoneNetStart=zipZoneNetStart, kipEntry=kipEntry, sccOverrunCount=sccOverrunCount, aarpTable=aarpTable, nbpObject=nbpObject, atifZone=atifZone, kipTable=kipTable, ddpForMe=ddpForMe, etherBufferDrops=etherBufferDrops, atifDescr=atifDescr, etherOutPackets=etherOutPackets, zipEntry=zipEntry, bufferSize=bufferSize, nbpEntry=nbpEntry, echoRequests=echoRequests, etherDefers=etherDefers, atifType=atifType, rtmpHops=rtmpHops, atifNetStart=atifNetStart, kipBCastAddr=kipBCastAddr, ethernet=ethernet, fastpathMib=fastpathMib, aarp=aarp, sccUnderrunCount=sccUnderrunCount, ddpBroadcastDrops=ddpBroadcastDrops, rtmpEntry=rtmpEntry, etherInPackets=etherInPackets, etherBcastDrops=etherBcastDrops, etherNoCTS=etherNoCTS, kipNextHop=kipNextHop, ddpOutShort=ddpOutShort, echoReplies=echoReplies, nbp=nbp, etherCollisions=etherCollisions, nbpIndex=nbpIndex, rtmp=rtmp, scc=scc, atifNetEnd=atifNetEnd, alapLengthErrorCount=alapLengthErrorCount, etherBufferReroutes=etherBufferReroutes, zipZoneNetEnd=zipZoneNetEnd, bufferTypeCount=bufferTypeCount, alapRandomCTS=alapRandomCTS, sccInterruptCount=sccInterruptCount, zipZoneName=zipZoneName, etherSpurRUReadys=etherSpurRUReadys, nbpZone=nbpZone, ddpReceived=ddpReceived, ddpShortDDPDrops=ddpShortDDPDrops, buffer=buffer, rtmpRangeEnd=rtmpRangeEnd, alapNoDataCount=alapNoDataCount, zip=zip, nbpType=nbpType, sccSpuriousCount=sccSpuriousCount, etherNoCarriers=etherNoCarriers, ddpTooLongDrops=ddpTooLongDrops, ddpHopCountDrops=ddpHopCountDrops, etherNoSQEs=etherNoSQEs, etherCRCErrors=etherCRCErrors, kipNet=kipNet, rtmpInterface=rtmpInterface, kipHopCount=kipHopCount, ddpOutLong=ddpOutLong, atifIfIndex=atifIfIndex, kip=kip, excelan=excelan, atifNetAddress=atifNetAddress, etherSpurCUActives=etherSpurCUActives, bufferTypeDescr=bufferTypeDescr, genericGroup=genericGroup, atifNetConfig=atifNetConfig)
(object_identifier, integer, octet_string) = mibBuilder.importSymbols('ASN1', 'ObjectIdentifier', 'Integer', 'OctetString') (named_values,) = mibBuilder.importSymbols('ASN1-ENUMERATION', 'NamedValues') (single_value_constraint, constraints_intersection, constraints_union, value_size_constraint, value_range_constraint) = mibBuilder.importSymbols('ASN1-REFINEMENT', 'SingleValueConstraint', 'ConstraintsIntersection', 'ConstraintsUnion', 'ValueSizeConstraint', 'ValueRangeConstraint') (notification_group, module_compliance) = mibBuilder.importSymbols('SNMPv2-CONF', 'NotificationGroup', 'ModuleCompliance') (ip_address, mib_scalar, mib_table, mib_table_row, mib_table_column, counter64, notification_type, enterprises, iso, counter32, integer32, unsigned32, object_identity, time_ticks, bits, gauge32, mib_identifier, module_identity) = mibBuilder.importSymbols('SNMPv2-SMI', 'IpAddress', 'MibScalar', 'MibTable', 'MibTableRow', 'MibTableColumn', 'Counter64', 'NotificationType', 'enterprises', 'iso', 'Counter32', 'Integer32', 'Unsigned32', 'ObjectIdentity', 'TimeTicks', 'Bits', 'Gauge32', 'MibIdentifier', 'ModuleIdentity') (textual_convention, display_string) = mibBuilder.importSymbols('SNMPv2-TC', 'TextualConvention', 'DisplayString') excelan = mib_identifier((1, 3, 6, 1, 4, 1, 23)) generic_group = mib_identifier((1, 3, 6, 1, 4, 1, 23, 2)) fastpath_mib = mib_identifier((1, 3, 6, 1, 4, 1, 23, 2, 11)) scc = mib_identifier((1, 3, 6, 1, 4, 1, 23, 2, 11, 1)) alap = mib_identifier((1, 3, 6, 1, 4, 1, 23, 2, 11, 2)) ethernet = mib_identifier((1, 3, 6, 1, 4, 1, 23, 2, 11, 3)) aarp = mib_identifier((1, 3, 6, 1, 4, 1, 23, 2, 11, 4)) atif = mib_identifier((1, 3, 6, 1, 4, 1, 23, 2, 11, 5)) ddp = mib_identifier((1, 3, 6, 1, 4, 1, 23, 2, 11, 6)) rtmp = mib_identifier((1, 3, 6, 1, 4, 1, 23, 2, 11, 7)) kip = mib_identifier((1, 3, 6, 1, 4, 1, 23, 2, 11, 8)) zip = mib_identifier((1, 3, 6, 1, 4, 1, 23, 2, 11, 9)) nbp = mib_identifier((1, 3, 6, 1, 4, 1, 23, 2, 11, 10)) echo = mib_identifier((1, 3, 6, 1, 4, 1, 23, 2, 11, 11)) buffer = mib_identifier((1, 3, 6, 1, 4, 1, 23, 2, 11, 12)) scc_interrupt_count = mib_scalar((1, 3, 6, 1, 4, 1, 23, 2, 11, 1, 1), counter32()).setMaxAccess('readonly') if mibBuilder.loadTexts: sccInterruptCount.setStatus('mandatory') scc_abort_count = mib_scalar((1, 3, 6, 1, 4, 1, 23, 2, 11, 1, 2), counter32()).setMaxAccess('readonly') if mibBuilder.loadTexts: sccAbortCount.setStatus('mandatory') scc_spurious_count = mib_scalar((1, 3, 6, 1, 4, 1, 23, 2, 11, 1, 3), counter32()).setMaxAccess('readonly') if mibBuilder.loadTexts: sccSpuriousCount.setStatus('mandatory') scc_crc_count = mib_scalar((1, 3, 6, 1, 4, 1, 23, 2, 11, 1, 4), counter32()).setMaxAccess('readonly') if mibBuilder.loadTexts: sccCRCCount.setStatus('mandatory') scc_overrun_count = mib_scalar((1, 3, 6, 1, 4, 1, 23, 2, 11, 1, 5), counter32()).setMaxAccess('readonly') if mibBuilder.loadTexts: sccOverrunCount.setStatus('mandatory') scc_underrun_count = mib_scalar((1, 3, 6, 1, 4, 1, 23, 2, 11, 1, 6), counter32()).setMaxAccess('readonly') if mibBuilder.loadTexts: sccUnderrunCount.setStatus('mandatory') alap_receive_count = mib_scalar((1, 3, 6, 1, 4, 1, 23, 2, 11, 2, 1), counter32()).setMaxAccess('readonly') if mibBuilder.loadTexts: alapReceiveCount.setStatus('mandatory') alap_transmit_count = mib_scalar((1, 3, 6, 1, 4, 1, 23, 2, 11, 2, 2), counter32()).setMaxAccess('readonly') if mibBuilder.loadTexts: alapTransmitCount.setStatus('mandatory') alap_no_handler_count = mib_scalar((1, 3, 6, 1, 4, 1, 23, 2, 11, 2, 3), counter32()).setMaxAccess('readonly') if mibBuilder.loadTexts: alapNoHandlerCount.setStatus('mandatory') alap_length_error_count = mib_scalar((1, 3, 6, 1, 4, 1, 23, 2, 11, 2, 4), counter32()).setMaxAccess('readonly') if mibBuilder.loadTexts: alapLengthErrorCount.setStatus('mandatory') alap_bad_count = mib_scalar((1, 3, 6, 1, 4, 1, 23, 2, 11, 2, 5), counter32()).setMaxAccess('readonly') if mibBuilder.loadTexts: alapBadCount.setStatus('mandatory') alap_collision_count = mib_scalar((1, 3, 6, 1, 4, 1, 23, 2, 11, 2, 6), counter32()).setMaxAccess('readonly') if mibBuilder.loadTexts: alapCollisionCount.setStatus('mandatory') alap_defer_count = mib_scalar((1, 3, 6, 1, 4, 1, 23, 2, 11, 2, 7), counter32()).setMaxAccess('readonly') if mibBuilder.loadTexts: alapDeferCount.setStatus('mandatory') alap_no_data_count = mib_scalar((1, 3, 6, 1, 4, 1, 23, 2, 11, 2, 8), counter32()).setMaxAccess('readonly') if mibBuilder.loadTexts: alapNoDataCount.setStatus('mandatory') alap_random_cts = mib_scalar((1, 3, 6, 1, 4, 1, 23, 2, 11, 2, 9), counter32()).setMaxAccess('readonly') if mibBuilder.loadTexts: alapRandomCTS.setStatus('mandatory') ether_crc_errors = mib_scalar((1, 3, 6, 1, 4, 1, 23, 2, 11, 3, 1), counter32()).setMaxAccess('readonly') if mibBuilder.loadTexts: etherCRCErrors.setStatus('mandatory') ether_align_errors = mib_scalar((1, 3, 6, 1, 4, 1, 23, 2, 11, 3, 2), counter32()).setMaxAccess('readonly') if mibBuilder.loadTexts: etherAlignErrors.setStatus('mandatory') ether_resource_errors = mib_scalar((1, 3, 6, 1, 4, 1, 23, 2, 11, 3, 3), counter32()).setMaxAccess('readonly') if mibBuilder.loadTexts: etherResourceErrors.setStatus('mandatory') ether_overrun_errors = mib_scalar((1, 3, 6, 1, 4, 1, 23, 2, 11, 3, 4), counter32()).setMaxAccess('readonly') if mibBuilder.loadTexts: etherOverrunErrors.setStatus('mandatory') ether_in_packets = mib_scalar((1, 3, 6, 1, 4, 1, 23, 2, 11, 3, 5), counter32()).setMaxAccess('readonly') if mibBuilder.loadTexts: etherInPackets.setStatus('mandatory') ether_out_packets = mib_scalar((1, 3, 6, 1, 4, 1, 23, 2, 11, 3, 6), counter32()).setMaxAccess('readonly') if mibBuilder.loadTexts: etherOutPackets.setStatus('mandatory') ether_bad_transmits = mib_scalar((1, 3, 6, 1, 4, 1, 23, 2, 11, 3, 7), counter32()).setMaxAccess('readonly') if mibBuilder.loadTexts: etherBadTransmits.setStatus('mandatory') ether_oversize_frames = mib_scalar((1, 3, 6, 1, 4, 1, 23, 2, 11, 3, 8), counter32()).setMaxAccess('readonly') if mibBuilder.loadTexts: etherOversizeFrames.setStatus('mandatory') ether_spur_ru_readys = mib_scalar((1, 3, 6, 1, 4, 1, 23, 2, 11, 3, 9), counter32()).setMaxAccess('readonly') if mibBuilder.loadTexts: etherSpurRUReadys.setStatus('mandatory') ether_spur_cu_actives = mib_scalar((1, 3, 6, 1, 4, 1, 23, 2, 11, 3, 10), counter32()).setMaxAccess('readonly') if mibBuilder.loadTexts: etherSpurCUActives.setStatus('mandatory') ether_spur_unknown = mib_scalar((1, 3, 6, 1, 4, 1, 23, 2, 11, 3, 11), counter32()).setMaxAccess('readonly') if mibBuilder.loadTexts: etherSpurUnknown.setStatus('mandatory') ether_bcast_drops = mib_scalar((1, 3, 6, 1, 4, 1, 23, 2, 11, 3, 12), counter32()).setMaxAccess('readonly') if mibBuilder.loadTexts: etherBcastDrops.setStatus('mandatory') ether_receiver_restarts = mib_scalar((1, 3, 6, 1, 4, 1, 23, 2, 11, 3, 13), counter32()).setMaxAccess('readonly') if mibBuilder.loadTexts: etherReceiverRestarts.setStatus('mandatory') ether_reinterrupts = mib_scalar((1, 3, 6, 1, 4, 1, 23, 2, 11, 3, 14), counter32()).setMaxAccess('readonly') if mibBuilder.loadTexts: etherReinterrupts.setStatus('mandatory') ether_buffer_reroutes = mib_scalar((1, 3, 6, 1, 4, 1, 23, 2, 11, 3, 15), counter32()).setMaxAccess('readonly') if mibBuilder.loadTexts: etherBufferReroutes.setStatus('mandatory') ether_buffer_drops = mib_scalar((1, 3, 6, 1, 4, 1, 23, 2, 11, 3, 16), counter32()).setMaxAccess('readonly') if mibBuilder.loadTexts: etherBufferDrops.setStatus('mandatory') ether_collisions = mib_scalar((1, 3, 6, 1, 4, 1, 23, 2, 11, 3, 17), counter32()).setMaxAccess('readonly') if mibBuilder.loadTexts: etherCollisions.setStatus('mandatory') ether_defers = mib_scalar((1, 3, 6, 1, 4, 1, 23, 2, 11, 3, 18), counter32()).setMaxAccess('readonly') if mibBuilder.loadTexts: etherDefers.setStatus('mandatory') ether_dma_underruns = mib_scalar((1, 3, 6, 1, 4, 1, 23, 2, 11, 3, 19), counter32()).setMaxAccess('readonly') if mibBuilder.loadTexts: etherDMAUnderruns.setStatus('mandatory') ether_max_collisions = mib_scalar((1, 3, 6, 1, 4, 1, 23, 2, 11, 3, 20), counter32()).setMaxAccess('readonly') if mibBuilder.loadTexts: etherMaxCollisions.setStatus('mandatory') ether_no_carriers = mib_scalar((1, 3, 6, 1, 4, 1, 23, 2, 11, 3, 21), counter32()).setMaxAccess('readonly') if mibBuilder.loadTexts: etherNoCarriers.setStatus('mandatory') ether_no_cts = mib_scalar((1, 3, 6, 1, 4, 1, 23, 2, 11, 3, 22), counter32()).setMaxAccess('readonly') if mibBuilder.loadTexts: etherNoCTS.setStatus('mandatory') ether_no_sq_es = mib_scalar((1, 3, 6, 1, 4, 1, 23, 2, 11, 3, 23), counter32()).setMaxAccess('readonly') if mibBuilder.loadTexts: etherNoSQEs.setStatus('mandatory') aarp_table = mib_table((1, 3, 6, 1, 4, 1, 23, 2, 11, 4, 1)).setMaxAccess('readwrite') if mibBuilder.loadTexts: aarpTable.setStatus('mandatory') aarp_entry = mib_table_row((1, 3, 6, 1, 4, 1, 23, 2, 11, 4, 1, 1)).setMaxAccess('readwrite') if mibBuilder.loadTexts: aarpEntry.setStatus('mandatory') aarp_if_index = mib_table_column((1, 3, 6, 1, 4, 1, 23, 2, 11, 4, 1, 1, 1), integer32()).setMaxAccess('readonly') if mibBuilder.loadTexts: aarpIfIndex.setStatus('mandatory') aarp_phys_address = mib_table_column((1, 3, 6, 1, 4, 1, 23, 2, 11, 4, 1, 1, 2), octet_string()).setMaxAccess('readonly') if mibBuilder.loadTexts: aarpPhysAddress.setStatus('mandatory') aarp_net_address = mib_table_column((1, 3, 6, 1, 4, 1, 23, 2, 11, 4, 1, 1, 3), octet_string()).setMaxAccess('readonly') if mibBuilder.loadTexts: aarpNetAddress.setStatus('mandatory') atif_table = mib_table((1, 3, 6, 1, 4, 1, 23, 2, 11, 5, 1)).setMaxAccess('readwrite') if mibBuilder.loadTexts: atifTable.setStatus('mandatory') atif_entry = mib_table_row((1, 3, 6, 1, 4, 1, 23, 2, 11, 5, 1, 1)).setMaxAccess('readwrite') if mibBuilder.loadTexts: atifEntry.setStatus('mandatory') atif_index = mib_table_column((1, 3, 6, 1, 4, 1, 23, 2, 11, 5, 1, 1, 1), integer32()).setMaxAccess('readonly') if mibBuilder.loadTexts: atifIndex.setStatus('mandatory') atif_descr = mib_table_column((1, 3, 6, 1, 4, 1, 23, 2, 11, 5, 1, 1, 2), octet_string()).setMaxAccess('readonly') if mibBuilder.loadTexts: atifDescr.setStatus('mandatory') atif_type = mib_table_column((1, 3, 6, 1, 4, 1, 23, 2, 11, 5, 1, 1, 3), integer32().subtype(subtypeSpec=constraints_union(single_value_constraint(1, 2, 3, 4, 5, 6))).clone(namedValues=named_values(('other', 1), ('localtalk', 2), ('ethertalk1', 3), ('ethertalk2', 4), ('tokentalk', 5), ('iptalk', 6)))).setMaxAccess('readonly') if mibBuilder.loadTexts: atifType.setStatus('mandatory') atif_net_start = mib_table_column((1, 3, 6, 1, 4, 1, 23, 2, 11, 5, 1, 1, 4), octet_string()).setMaxAccess('readwrite') if mibBuilder.loadTexts: atifNetStart.setStatus('mandatory') atif_net_end = mib_table_column((1, 3, 6, 1, 4, 1, 23, 2, 11, 5, 1, 1, 5), octet_string()).setMaxAccess('readwrite') if mibBuilder.loadTexts: atifNetEnd.setStatus('mandatory') atif_net_address = mib_table_column((1, 3, 6, 1, 4, 1, 23, 2, 11, 5, 1, 1, 6), octet_string()).setMaxAccess('readwrite') if mibBuilder.loadTexts: atifNetAddress.setStatus('mandatory') atif_status = mib_table_column((1, 3, 6, 1, 4, 1, 23, 2, 11, 5, 1, 1, 7), integer32()).setMaxAccess('readonly') if mibBuilder.loadTexts: atifStatus.setStatus('mandatory') atif_net_config = mib_table_column((1, 3, 6, 1, 4, 1, 23, 2, 11, 5, 1, 1, 8), integer32().subtype(subtypeSpec=constraints_union(single_value_constraint(1, 2, 3, 4))).clone(namedValues=named_values(('configured', 1), ('garnered', 2), ('guessed', 3), ('unconfigured', 4)))).setMaxAccess('readonly') if mibBuilder.loadTexts: atifNetConfig.setStatus('mandatory') atif_zone_config = mib_table_column((1, 3, 6, 1, 4, 1, 23, 2, 11, 5, 1, 1, 9), integer32().subtype(subtypeSpec=constraints_union(single_value_constraint(1, 2, 3, 4))).clone(namedValues=named_values(('configured', 1), ('garnered', 2), ('guessed', 3), ('unconfigured', 4)))).setMaxAccess('readonly') if mibBuilder.loadTexts: atifZoneConfig.setStatus('mandatory') atif_zone = mib_table_column((1, 3, 6, 1, 4, 1, 23, 2, 11, 5, 1, 1, 10), octet_string()).setMaxAccess('readwrite') if mibBuilder.loadTexts: atifZone.setStatus('mandatory') atif_if_index = mib_table_column((1, 3, 6, 1, 4, 1, 23, 2, 11, 5, 1, 1, 11), integer32()).setMaxAccess('readwrite') if mibBuilder.loadTexts: atifIfIndex.setStatus('mandatory') ddp_out_requests = mib_scalar((1, 3, 6, 1, 4, 1, 23, 2, 11, 6, 1), counter32()).setMaxAccess('readonly') if mibBuilder.loadTexts: ddpOutRequests.setStatus('mandatory') ddp_out_short = mib_scalar((1, 3, 6, 1, 4, 1, 23, 2, 11, 6, 2), counter32()).setMaxAccess('readonly') if mibBuilder.loadTexts: ddpOutShort.setStatus('mandatory') ddp_out_long = mib_scalar((1, 3, 6, 1, 4, 1, 23, 2, 11, 6, 3), counter32()).setMaxAccess('readonly') if mibBuilder.loadTexts: ddpOutLong.setStatus('mandatory') ddp_received = mib_scalar((1, 3, 6, 1, 4, 1, 23, 2, 11, 6, 4), counter32()).setMaxAccess('readonly') if mibBuilder.loadTexts: ddpReceived.setStatus('mandatory') ddp_to_forward = mib_scalar((1, 3, 6, 1, 4, 1, 23, 2, 11, 6, 5), counter32()).setMaxAccess('readonly') if mibBuilder.loadTexts: ddpToForward.setStatus('mandatory') ddp_forwards = mib_scalar((1, 3, 6, 1, 4, 1, 23, 2, 11, 6, 6), counter32()).setMaxAccess('readonly') if mibBuilder.loadTexts: ddpForwards.setStatus('mandatory') ddp_for_me = mib_scalar((1, 3, 6, 1, 4, 1, 23, 2, 11, 6, 7), counter32()).setMaxAccess('readonly') if mibBuilder.loadTexts: ddpForMe.setStatus('mandatory') ddp_out_no_routes = mib_scalar((1, 3, 6, 1, 4, 1, 23, 2, 11, 6, 9), counter32()).setMaxAccess('readonly') if mibBuilder.loadTexts: ddpOutNoRoutes.setStatus('mandatory') ddp_too_short_drops = mib_scalar((1, 3, 6, 1, 4, 1, 23, 2, 11, 6, 10), counter32()).setMaxAccess('readonly') if mibBuilder.loadTexts: ddpTooShortDrops.setStatus('mandatory') ddp_too_long_drops = mib_scalar((1, 3, 6, 1, 4, 1, 23, 2, 11, 6, 11), counter32()).setMaxAccess('readonly') if mibBuilder.loadTexts: ddpTooLongDrops.setStatus('mandatory') ddp_broadcast_drops = mib_scalar((1, 3, 6, 1, 4, 1, 23, 2, 11, 6, 12), counter32()).setMaxAccess('readonly') if mibBuilder.loadTexts: ddpBroadcastDrops.setStatus('mandatory') ddp_short_ddp_drops = mib_scalar((1, 3, 6, 1, 4, 1, 23, 2, 11, 6, 13), counter32()).setMaxAccess('readonly') if mibBuilder.loadTexts: ddpShortDDPDrops.setStatus('mandatory') ddp_hop_count_drops = mib_scalar((1, 3, 6, 1, 4, 1, 23, 2, 11, 6, 14), counter32()).setMaxAccess('readonly') if mibBuilder.loadTexts: ddpHopCountDrops.setStatus('mandatory') rtmp_table = mib_table((1, 3, 6, 1, 4, 1, 23, 2, 11, 7, 1)).setMaxAccess('readwrite') if mibBuilder.loadTexts: rtmpTable.setStatus('mandatory') rtmp_entry = mib_table_row((1, 3, 6, 1, 4, 1, 23, 2, 11, 7, 1, 1)).setMaxAccess('readwrite') if mibBuilder.loadTexts: rtmpEntry.setStatus('mandatory') rtmp_range_start = mib_table_column((1, 3, 6, 1, 4, 1, 23, 2, 11, 7, 1, 1, 1), octet_string()).setMaxAccess('readwrite') if mibBuilder.loadTexts: rtmpRangeStart.setStatus('mandatory') rtmp_range_end = mib_table_column((1, 3, 6, 1, 4, 1, 23, 2, 11, 7, 1, 1, 2), octet_string()).setMaxAccess('readwrite') if mibBuilder.loadTexts: rtmpRangeEnd.setStatus('mandatory') rtmp_next_hop = mib_table_column((1, 3, 6, 1, 4, 1, 23, 2, 11, 7, 1, 1, 3), octet_string()).setMaxAccess('readwrite') if mibBuilder.loadTexts: rtmpNextHop.setStatus('mandatory') rtmp_interface = mib_table_column((1, 3, 6, 1, 4, 1, 23, 2, 11, 7, 1, 1, 4), integer32()).setMaxAccess('readwrite') if mibBuilder.loadTexts: rtmpInterface.setStatus('mandatory') rtmp_hops = mib_table_column((1, 3, 6, 1, 4, 1, 23, 2, 11, 7, 1, 1, 5), integer32()).setMaxAccess('readwrite') if mibBuilder.loadTexts: rtmpHops.setStatus('mandatory') rtmp_state = mib_table_column((1, 3, 6, 1, 4, 1, 23, 2, 11, 7, 1, 1, 6), integer32().subtype(subtypeSpec=constraints_union(single_value_constraint(1, 2, 3))).clone(namedValues=named_values(('good', 1), ('suspect', 2), ('bad', 3)))).setMaxAccess('readwrite') if mibBuilder.loadTexts: rtmpState.setStatus('mandatory') kip_table = mib_table((1, 3, 6, 1, 4, 1, 23, 2, 11, 8, 1)).setMaxAccess('readwrite') if mibBuilder.loadTexts: kipTable.setStatus('mandatory') kip_entry = mib_table_row((1, 3, 6, 1, 4, 1, 23, 2, 11, 8, 1, 1)).setMaxAccess('readwrite') if mibBuilder.loadTexts: kipEntry.setStatus('mandatory') kip_net = mib_table_column((1, 3, 6, 1, 4, 1, 23, 2, 11, 8, 1, 1, 1), octet_string()).setMaxAccess('readwrite') if mibBuilder.loadTexts: kipNet.setStatus('mandatory') kip_next_hop = mib_table_column((1, 3, 6, 1, 4, 1, 23, 2, 11, 8, 1, 1, 2), ip_address()).setMaxAccess('readwrite') if mibBuilder.loadTexts: kipNextHop.setStatus('mandatory') kip_hop_count = mib_table_column((1, 3, 6, 1, 4, 1, 23, 2, 11, 8, 1, 1, 3), integer32()).setMaxAccess('readwrite') if mibBuilder.loadTexts: kipHopCount.setStatus('mandatory') kip_b_cast_addr = mib_table_column((1, 3, 6, 1, 4, 1, 23, 2, 11, 8, 1, 1, 4), ip_address()).setMaxAccess('readwrite') if mibBuilder.loadTexts: kipBCastAddr.setStatus('mandatory') kip_core = mib_table_column((1, 3, 6, 1, 4, 1, 23, 2, 11, 8, 1, 1, 5), integer32().subtype(subtypeSpec=constraints_union(single_value_constraint(1, 2))).clone(namedValues=named_values(('core', 1), ('notcore', 2)))).setMaxAccess('readwrite') if mibBuilder.loadTexts: kipCore.setStatus('mandatory') kip_kfps = mib_table_column((1, 3, 6, 1, 4, 1, 23, 2, 11, 8, 1, 1, 6), integer32()).setMaxAccess('readwrite') if mibBuilder.loadTexts: kipKfps.setStatus('mandatory') zip_table = mib_table((1, 3, 6, 1, 4, 1, 23, 2, 11, 9, 1)).setMaxAccess('readwrite') if mibBuilder.loadTexts: zipTable.setStatus('mandatory') zip_entry = mib_table_row((1, 3, 6, 1, 4, 1, 23, 2, 11, 9, 1, 1)).setMaxAccess('readwrite') if mibBuilder.loadTexts: zipEntry.setStatus('mandatory') zip_zone_name = mib_table_column((1, 3, 6, 1, 4, 1, 23, 2, 11, 9, 1, 1, 1), octet_string()).setMaxAccess('readwrite') if mibBuilder.loadTexts: zipZoneName.setStatus('mandatory') zip_zone_index = mib_table_column((1, 3, 6, 1, 4, 1, 23, 2, 11, 9, 1, 1, 2), integer32()).setMaxAccess('readonly') if mibBuilder.loadTexts: zipZoneIndex.setStatus('mandatory') zip_zone_net_start = mib_scalar((1, 3, 6, 1, 4, 1, 23, 2, 11, 9, 1, 1, 3), octet_string()).setMaxAccess('readwrite') if mibBuilder.loadTexts: zipZoneNetStart.setStatus('mandatory') zip_zone_net_end = mib_scalar((1, 3, 6, 1, 4, 1, 23, 2, 11, 9, 1, 1, 4), octet_string()).setMaxAccess('readwrite') if mibBuilder.loadTexts: zipZoneNetEnd.setStatus('mandatory') nbp_table = mib_table((1, 3, 6, 1, 4, 1, 23, 2, 11, 10, 1)).setMaxAccess('readwrite') if mibBuilder.loadTexts: nbpTable.setStatus('mandatory') nbp_entry = mib_table_row((1, 3, 6, 1, 4, 1, 23, 2, 11, 10, 1, 1)).setMaxAccess('readwrite') if mibBuilder.loadTexts: nbpEntry.setStatus('mandatory') nbp_index = mib_table_column((1, 3, 6, 1, 4, 1, 23, 2, 11, 10, 1, 1, 1), integer32()).setMaxAccess('readonly') if mibBuilder.loadTexts: nbpIndex.setStatus('mandatory') nbp_object = mib_table_column((1, 3, 6, 1, 4, 1, 23, 2, 11, 10, 1, 1, 2), octet_string()).setMaxAccess('readwrite') if mibBuilder.loadTexts: nbpObject.setStatus('mandatory') nbp_type = mib_table_column((1, 3, 6, 1, 4, 1, 23, 2, 11, 10, 1, 1, 3), octet_string()).setMaxAccess('readwrite') if mibBuilder.loadTexts: nbpType.setStatus('mandatory') nbp_zone = mib_table_column((1, 3, 6, 1, 4, 1, 23, 2, 11, 10, 1, 1, 4), octet_string()).setMaxAccess('readwrite') if mibBuilder.loadTexts: nbpZone.setStatus('mandatory') echo_requests = mib_scalar((1, 3, 6, 1, 4, 1, 23, 2, 11, 11, 1), counter32()).setMaxAccess('readonly') if mibBuilder.loadTexts: echoRequests.setStatus('mandatory') echo_replies = mib_scalar((1, 3, 6, 1, 4, 1, 23, 2, 11, 11, 2), counter32()).setMaxAccess('readonly') if mibBuilder.loadTexts: echoReplies.setStatus('mandatory') buffer_size = mib_scalar((1, 3, 6, 1, 4, 1, 23, 2, 11, 12, 1), integer32()).setMaxAccess('readonly') if mibBuilder.loadTexts: bufferSize.setStatus('mandatory') buffer_avail = mib_scalar((1, 3, 6, 1, 4, 1, 23, 2, 11, 12, 2), integer32()).setMaxAccess('readonly') if mibBuilder.loadTexts: bufferAvail.setStatus('mandatory') buffer_drops = mib_scalar((1, 3, 6, 1, 4, 1, 23, 2, 11, 12, 3), counter32()).setMaxAccess('readonly') if mibBuilder.loadTexts: bufferDrops.setStatus('mandatory') buffer_type_table = mib_table((1, 3, 6, 1, 4, 1, 23, 2, 11, 12, 4)).setMaxAccess('readonly') if mibBuilder.loadTexts: bufferTypeTable.setStatus('mandatory') buffer_type_entry = mib_table_row((1, 3, 6, 1, 4, 1, 23, 2, 11, 12, 4, 1)).setMaxAccess('readonly') if mibBuilder.loadTexts: bufferTypeEntry.setStatus('mandatory') buffer_type_index = mib_table_column((1, 3, 6, 1, 4, 1, 23, 2, 11, 12, 4, 1, 1), integer32()).setMaxAccess('readonly') if mibBuilder.loadTexts: bufferTypeIndex.setStatus('mandatory') buffer_type = mib_table_column((1, 3, 6, 1, 4, 1, 23, 2, 11, 12, 4, 1, 2), integer32().subtype(subtypeSpec=constraints_union(single_value_constraint(1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11))).clone(namedValues=named_values(('other', 1), ('free', 2), ('localtalk', 3), ('ethernet', 4), ('arp', 5), ('data', 6), ('erbf', 7), ('etbf', 8), ('malloc', 9), ('tkbf', 10), ('token', 11)))).setMaxAccess('readonly') if mibBuilder.loadTexts: bufferType.setStatus('mandatory') buffer_type_descr = mib_table_column((1, 3, 6, 1, 4, 1, 23, 2, 11, 12, 4, 1, 3), octet_string()).setMaxAccess('readonly') if mibBuilder.loadTexts: bufferTypeDescr.setStatus('mandatory') buffer_type_count = mib_table_column((1, 3, 6, 1, 4, 1, 23, 2, 11, 12, 4, 1, 4), integer32()).setMaxAccess('readonly') if mibBuilder.loadTexts: bufferTypeCount.setStatus('mandatory') mibBuilder.exportSymbols('FASTPATH-MIB', etherAlignErrors=etherAlignErrors, ddpOutNoRoutes=ddpOutNoRoutes, alapCollisionCount=alapCollisionCount, bufferAvail=bufferAvail, kipKfps=kipKfps, etherReceiverRestarts=etherReceiverRestarts, bufferTypeTable=bufferTypeTable, kipCore=kipCore, atifIndex=atifIndex, alapDeferCount=alapDeferCount, rtmpRangeStart=rtmpRangeStart, etherResourceErrors=etherResourceErrors, etherOversizeFrames=etherOversizeFrames, bufferTypeEntry=bufferTypeEntry, ddpOutRequests=ddpOutRequests, ddp=ddp, zipTable=zipTable, etherBadTransmits=etherBadTransmits, nbpTable=nbpTable, alap=alap, bufferDrops=bufferDrops, bufferType=bufferType, sccCRCCount=sccCRCCount, alapReceiveCount=alapReceiveCount, rtmpState=rtmpState, atifEntry=atifEntry, sccAbortCount=sccAbortCount, ddpToForward=ddpToForward, echo=echo, etherOverrunErrors=etherOverrunErrors, atifZoneConfig=atifZoneConfig, atifTable=atifTable, ddpForwards=ddpForwards, bufferTypeIndex=bufferTypeIndex, rtmpNextHop=rtmpNextHop, aarpNetAddress=aarpNetAddress, atif=atif, alapTransmitCount=alapTransmitCount, alapNoHandlerCount=alapNoHandlerCount, etherDMAUnderruns=etherDMAUnderruns, alapBadCount=alapBadCount, etherReinterrupts=etherReinterrupts, ddpTooShortDrops=ddpTooShortDrops, aarpPhysAddress=aarpPhysAddress, aarpIfIndex=aarpIfIndex, rtmpTable=rtmpTable, zipZoneIndex=zipZoneIndex, etherMaxCollisions=etherMaxCollisions, atifStatus=atifStatus, aarpEntry=aarpEntry, etherSpurUnknown=etherSpurUnknown, zipZoneNetStart=zipZoneNetStart, kipEntry=kipEntry, sccOverrunCount=sccOverrunCount, aarpTable=aarpTable, nbpObject=nbpObject, atifZone=atifZone, kipTable=kipTable, ddpForMe=ddpForMe, etherBufferDrops=etherBufferDrops, atifDescr=atifDescr, etherOutPackets=etherOutPackets, zipEntry=zipEntry, bufferSize=bufferSize, nbpEntry=nbpEntry, echoRequests=echoRequests, etherDefers=etherDefers, atifType=atifType, rtmpHops=rtmpHops, atifNetStart=atifNetStart, kipBCastAddr=kipBCastAddr, ethernet=ethernet, fastpathMib=fastpathMib, aarp=aarp, sccUnderrunCount=sccUnderrunCount, ddpBroadcastDrops=ddpBroadcastDrops, rtmpEntry=rtmpEntry, etherInPackets=etherInPackets, etherBcastDrops=etherBcastDrops, etherNoCTS=etherNoCTS, kipNextHop=kipNextHop, ddpOutShort=ddpOutShort, echoReplies=echoReplies, nbp=nbp, etherCollisions=etherCollisions, nbpIndex=nbpIndex, rtmp=rtmp, scc=scc, atifNetEnd=atifNetEnd, alapLengthErrorCount=alapLengthErrorCount, etherBufferReroutes=etherBufferReroutes, zipZoneNetEnd=zipZoneNetEnd, bufferTypeCount=bufferTypeCount, alapRandomCTS=alapRandomCTS, sccInterruptCount=sccInterruptCount, zipZoneName=zipZoneName, etherSpurRUReadys=etherSpurRUReadys, nbpZone=nbpZone, ddpReceived=ddpReceived, ddpShortDDPDrops=ddpShortDDPDrops, buffer=buffer, rtmpRangeEnd=rtmpRangeEnd, alapNoDataCount=alapNoDataCount, zip=zip, nbpType=nbpType, sccSpuriousCount=sccSpuriousCount, etherNoCarriers=etherNoCarriers, ddpTooLongDrops=ddpTooLongDrops, ddpHopCountDrops=ddpHopCountDrops, etherNoSQEs=etherNoSQEs, etherCRCErrors=etherCRCErrors, kipNet=kipNet, rtmpInterface=rtmpInterface, kipHopCount=kipHopCount, ddpOutLong=ddpOutLong, atifIfIndex=atifIfIndex, kip=kip, excelan=excelan, atifNetAddress=atifNetAddress, etherSpurCUActives=etherSpurCUActives, bufferTypeDescr=bufferTypeDescr, genericGroup=genericGroup, atifNetConfig=atifNetConfig)
# Time: O(1) # Space: O(1) # # Write a function to delete a node (except the tail) in a singly linked list, # given only access to that node. # # Supposed the linked list is 1 -> 2 -> 3 -> 4 and you are given the third node # with value 3, the linked list should become 1 -> 2 -> 4 after calling your function. # # Definition for singly-linked list. # class ListNode: # def __init__(self, x): # self.val = x # self.next = None class Solution: # @param {ListNode} node # @return {void} Do not return anything, modify node in-place instead. def deleteNode(self, node): if node and node.next: node_to_delete = node.next node.val = node_to_delete.val node.next = node_to_delete.next del node_to_delete
class Solution: def delete_node(self, node): if node and node.next: node_to_delete = node.next node.val = node_to_delete.val node.next = node_to_delete.next del node_to_delete
#sum in python ''' weight = float(input("Weight:")) height = float(input("height")) total = weight + height print(total) ''' #cal monthly salary ''' import math age= 17 pi= 3.14 print(type(age),age) print(type(pi),pi) print(math.pi) salary = float(input('Salary: ')) #float convert text(string) to number with decimal place bonus = float(input('Bouns: ')) Income = salary * 12 + bonus print('Your monthly is $' + str(Income)) #'' or "" is use to define string print('Your monthly is $', Income) #we can use + or , to more than one value but , will auto add a space and auto convert indentifier/var ''' # # is comment ''' is also comment '''
""" weight = float(input("Weight:")) height = float(input("height")) total = weight + height print(total) """ '\nimport math\n\nage= 17\npi= 3.14\nprint(type(age),age)\nprint(type(pi),pi)\n\nprint(math.pi)\n\nsalary = float(input(\'Salary: \')) #float convert text(string) to number with decimal place\nbonus = float(input(\'Bouns: \'))\nIncome = salary * 12 + bonus\nprint(\'Your monthly is $\' + str(Income)) #\'\' or "" is use to define string\nprint(\'Your monthly is $\', Income) #we can use + or , to more than one value but , will auto add a space and auto convert indentifier/var\n' ' is also comment '
nonverified_users = ['calvin klein','ralph lauren','christian dior','donna karran'] verified_users = [] #verifying if there are new users and moving them to a verified list while nonverified_users: current_user = nonverified_users.pop() print(f"\nVerifying user: {current_user}") verified_users.append(current_user) #Printing out the verified users for user in verified_users: print(f"\n\t{user.title()} is now verfied!")
nonverified_users = ['calvin klein', 'ralph lauren', 'christian dior', 'donna karran'] verified_users = [] while nonverified_users: current_user = nonverified_users.pop() print(f'\nVerifying user: {current_user}') verified_users.append(current_user) for user in verified_users: print(f'\n\t{user.title()} is now verfied!')
# from ..interpreter import model # Commented out to make static node recovery be used # @model('map_server', 'map_server') def map_server(c): c.read('~frame_id', 'map') c.read('~negate', 0) c.read('~occupied_thresh', 0.65) c.read('~free_thresh', 0.196) c.provide('static_map', 'nav_msgs/GetMap') c.pub('map_metadata', 'nav_msgs/MapMetaData') c.pub('map', 'nav_msgs/OccupancyGrid')
def map_server(c): c.read('~frame_id', 'map') c.read('~negate', 0) c.read('~occupied_thresh', 0.65) c.read('~free_thresh', 0.196) c.provide('static_map', 'nav_msgs/GetMap') c.pub('map_metadata', 'nav_msgs/MapMetaData') c.pub('map', 'nav_msgs/OccupancyGrid')
def func1(): def func2(): return True return func2() if(func1()): print("Acabou")
def func1(): def func2(): return True return func2() if func1(): print('Acabou')
fname = input('Enter File: ') if len(fname) < 1: fname = 'clown.txt' hand = open(fname) di = dict() for lin in hand: lin = lin.rstrip() wds = lin.split() #print(wds) for w in wds: # if the key is not there the count is zero #print(w) #print('**',w,di.get(w,-99)) #oldcount = di.get(w,0) #print(w,'old',oldcount) #newcount = oldcount + 1 #di[w] = newcount #print(w,'new',newcount) # idiom: retrieve/create/update counter di[w] = di.get(w,0) + 1 # print(w,'new',di[w]) #if w in di: # di[w] = di[w] + 1 #print('**EXISTING**') #else: # di[w] = 1 #print('**NEW**') #print(di[w]) #print(di) #now we want to find the most common bigword largest = -1 theword = None for k,v in di.items(): #print (k, v) if v > largest: largest = v theword = k #capture/ remember the word is largest print('Done', theword, largest)
fname = input('Enter File: ') if len(fname) < 1: fname = 'clown.txt' hand = open(fname) di = dict() for lin in hand: lin = lin.rstrip() wds = lin.split() for w in wds: di[w] = di.get(w, 0) + 1 largest = -1 theword = None for (k, v) in di.items(): if v > largest: largest = v theword = k print('Done', theword, largest)
''' Square Root of Integer Asked in: Facebook Amazon Microsoft Given an integar A. Compute and return the square root of A. If A is not a perfect square, return floor(sqrt(A)). DO NOT USE SQRT FUNCTION FROM STANDARD LIBRARY Input Format The first and only argument given is the integer A. Output Format Return floor(sqrt(A)) Constraints 1 <= A <= 10^9 For Example Input 1: A = 11 Output 1: 3 Input 2: A = 9 Output 2: 3 ''' class Solution: # @param A : integer # @return an integer def sqrt(self, n): lo,hi=1,n ans=n while lo<=hi: mid=(lo+hi)//2 x=mid*mid if x>n: hi=mid-1 elif x<=n: lo=mid+1 ans=mid return ans
""" Square Root of Integer Asked in: Facebook Amazon Microsoft Given an integar A. Compute and return the square root of A. If A is not a perfect square, return floor(sqrt(A)). DO NOT USE SQRT FUNCTION FROM STANDARD LIBRARY Input Format The first and only argument given is the integer A. Output Format Return floor(sqrt(A)) Constraints 1 <= A <= 10^9 For Example Input 1: A = 11 Output 1: 3 Input 2: A = 9 Output 2: 3 """ class Solution: def sqrt(self, n): (lo, hi) = (1, n) ans = n while lo <= hi: mid = (lo + hi) // 2 x = mid * mid if x > n: hi = mid - 1 elif x <= n: lo = mid + 1 ans = mid return ans
# buildifier: disable=module-docstring load("//bazel/platform:transitions.bzl", "risc0_transition") # https://github.com/bazelbuild/bazel/blob/master/src/main/starlark/builtins_bzl/common/cc/cc_library.bzl CC_TOOLCHAIN_TYPE = "@bazel_tools//tools/cpp:toolchain_type" def _get_compilation_contexts_from_deps(deps): compilation_contexts = [] for dep in deps: if CcInfo in dep: compilation_contexts.append(dep[CcInfo].compilation_context) return compilation_contexts def _get_linking_contexts_from_deps(deps): linking_contexts = [] for dep in deps: if CcInfo in dep: linking_contexts.append(dep[CcInfo].linking_context) return linking_contexts def _compile(ctx, cc_toolchain, feature_configuration): compilation_contexts = _get_compilation_contexts_from_deps(ctx.attr.deps) return cc_common.compile( name = ctx.label.name, actions = ctx.actions, cc_toolchain = cc_toolchain, feature_configuration = feature_configuration, srcs = ctx.files.srcs, user_compile_flags = ctx.attr.copts, defines = ctx.attr.defines, local_defines = ctx.attr.local_defines, compilation_contexts = compilation_contexts, public_hdrs = ctx.files.hdrs, additional_inputs = ctx.files.aux_srcs, includes = ctx.attr.includes, include_prefix = ctx.attr.include_prefix, strip_include_prefix = ctx.attr.strip_include_prefix, ) def _risc0_cc_library_impl(ctx): cc_toolchain = ctx.toolchains[CC_TOOLCHAIN_TYPE].cc feature_configuration = cc_common.configure_features( ctx = ctx, cc_toolchain = cc_toolchain, requested_features = ctx.features, unsupported_features = ctx.disabled_features, ) (compile_context, compilation_outputs) = _compile(ctx, cc_toolchain, feature_configuration) linking_contexts = _get_linking_contexts_from_deps(ctx.attr.deps) (linking_context, linking_outputs) = cc_common.create_linking_context_from_compilation_outputs( actions = ctx.actions, name = ctx.label.name, compilation_outputs = compilation_outputs, cc_toolchain = cc_toolchain, feature_configuration = feature_configuration, linking_contexts = linking_contexts, user_link_flags = ctx.attr.linkopts, alwayslink = ctx.attr.alwayslink, disallow_dynamic_library = True, ) files_builder = [] if linking_outputs.library_to_link != None: artifacts_to_build = linking_outputs.library_to_link if artifacts_to_build.static_library != None: files_builder.append(artifacts_to_build.static_library) if artifacts_to_build.pic_static_library != None: files_builder.append(artifacts_to_build.pic_static_library) return [ DefaultInfo(files = depset(files_builder)), CcInfo( compilation_context = compile_context, linking_context = linking_context, ), ] def _risc0_cc_binary_impl(ctx): cc_toolchain = ctx.toolchains[CC_TOOLCHAIN_TYPE].cc feature_configuration = cc_common.configure_features( ctx = ctx, cc_toolchain = cc_toolchain, requested_features = ctx.features, unsupported_features = ctx.disabled_features, ) (compile_context, compilation_outputs) = _compile(ctx, cc_toolchain, feature_configuration) linking_contexts = _get_linking_contexts_from_deps(ctx.attr.deps) linking_outputs = cc_common.link( name = ctx.label.name, actions = ctx.actions, feature_configuration = feature_configuration, cc_toolchain = cc_toolchain, compilation_outputs = compilation_outputs, linking_contexts = linking_contexts, user_link_flags = ["-T", ctx.file._linker_script.path] + ctx.attr.linkopts, output_type = "executable", ) runfiles = ctx.runfiles(files = [linking_outputs.executable]) for data_dep in ctx.attr.data: runfiles = runfiles.merge(ctx.runfiles(transitive_files = data_dep[DefaultInfo].files)) runfiles = runfiles.merge(data_dep[DefaultInfo].data_runfiles) for src in ctx.attr.srcs: runfiles = runfiles.merge(src[DefaultInfo].default_runfiles) for dep in ctx.attr.deps: runfiles = runfiles.merge(dep[DefaultInfo].default_runfiles) return [DefaultInfo( files = depset([linking_outputs.executable]), runfiles = runfiles, )] attrs = { "srcs": attr.label_list(allow_files = True), "hdrs": attr.label_list(allow_files = True), "aux_srcs": attr.label_list(allow_files = True), "includes": attr.string_list(), "defines": attr.string_list(), "copts": attr.string_list(), "linkopts": attr.string_list(), "local_defines": attr.string_list(), "alwayslink": attr.bool(default = False), "strip_include_prefix": attr.string(), "include_prefix": attr.string(), "deps": attr.label_list(providers = [CcInfo]), "data": attr.label_list(allow_files = True), "_linker_script": attr.label( allow_single_file = True, default = Label("//risc0/zkvm/platform:risc0.ld"), ), "_allowlist_function_transition": attr.label( default = "@bazel_tools//tools/allowlists/function_transition_allowlist", ), } risc0_cc_library = rule( implementation = _risc0_cc_library_impl, attrs = attrs, toolchains = [CC_TOOLCHAIN_TYPE], fragments = ["cpp"], incompatible_use_toolchain_transition = True, cfg = risc0_transition, ) risc0_cc_binary = rule( implementation = _risc0_cc_binary_impl, attrs = attrs, toolchains = [CC_TOOLCHAIN_TYPE], fragments = ["cpp"], incompatible_use_toolchain_transition = True, cfg = risc0_transition, )
load('//bazel/platform:transitions.bzl', 'risc0_transition') cc_toolchain_type = '@bazel_tools//tools/cpp:toolchain_type' def _get_compilation_contexts_from_deps(deps): compilation_contexts = [] for dep in deps: if CcInfo in dep: compilation_contexts.append(dep[CcInfo].compilation_context) return compilation_contexts def _get_linking_contexts_from_deps(deps): linking_contexts = [] for dep in deps: if CcInfo in dep: linking_contexts.append(dep[CcInfo].linking_context) return linking_contexts def _compile(ctx, cc_toolchain, feature_configuration): compilation_contexts = _get_compilation_contexts_from_deps(ctx.attr.deps) return cc_common.compile(name=ctx.label.name, actions=ctx.actions, cc_toolchain=cc_toolchain, feature_configuration=feature_configuration, srcs=ctx.files.srcs, user_compile_flags=ctx.attr.copts, defines=ctx.attr.defines, local_defines=ctx.attr.local_defines, compilation_contexts=compilation_contexts, public_hdrs=ctx.files.hdrs, additional_inputs=ctx.files.aux_srcs, includes=ctx.attr.includes, include_prefix=ctx.attr.include_prefix, strip_include_prefix=ctx.attr.strip_include_prefix) def _risc0_cc_library_impl(ctx): cc_toolchain = ctx.toolchains[CC_TOOLCHAIN_TYPE].cc feature_configuration = cc_common.configure_features(ctx=ctx, cc_toolchain=cc_toolchain, requested_features=ctx.features, unsupported_features=ctx.disabled_features) (compile_context, compilation_outputs) = _compile(ctx, cc_toolchain, feature_configuration) linking_contexts = _get_linking_contexts_from_deps(ctx.attr.deps) (linking_context, linking_outputs) = cc_common.create_linking_context_from_compilation_outputs(actions=ctx.actions, name=ctx.label.name, compilation_outputs=compilation_outputs, cc_toolchain=cc_toolchain, feature_configuration=feature_configuration, linking_contexts=linking_contexts, user_link_flags=ctx.attr.linkopts, alwayslink=ctx.attr.alwayslink, disallow_dynamic_library=True) files_builder = [] if linking_outputs.library_to_link != None: artifacts_to_build = linking_outputs.library_to_link if artifacts_to_build.static_library != None: files_builder.append(artifacts_to_build.static_library) if artifacts_to_build.pic_static_library != None: files_builder.append(artifacts_to_build.pic_static_library) return [default_info(files=depset(files_builder)), cc_info(compilation_context=compile_context, linking_context=linking_context)] def _risc0_cc_binary_impl(ctx): cc_toolchain = ctx.toolchains[CC_TOOLCHAIN_TYPE].cc feature_configuration = cc_common.configure_features(ctx=ctx, cc_toolchain=cc_toolchain, requested_features=ctx.features, unsupported_features=ctx.disabled_features) (compile_context, compilation_outputs) = _compile(ctx, cc_toolchain, feature_configuration) linking_contexts = _get_linking_contexts_from_deps(ctx.attr.deps) linking_outputs = cc_common.link(name=ctx.label.name, actions=ctx.actions, feature_configuration=feature_configuration, cc_toolchain=cc_toolchain, compilation_outputs=compilation_outputs, linking_contexts=linking_contexts, user_link_flags=['-T', ctx.file._linker_script.path] + ctx.attr.linkopts, output_type='executable') runfiles = ctx.runfiles(files=[linking_outputs.executable]) for data_dep in ctx.attr.data: runfiles = runfiles.merge(ctx.runfiles(transitive_files=data_dep[DefaultInfo].files)) runfiles = runfiles.merge(data_dep[DefaultInfo].data_runfiles) for src in ctx.attr.srcs: runfiles = runfiles.merge(src[DefaultInfo].default_runfiles) for dep in ctx.attr.deps: runfiles = runfiles.merge(dep[DefaultInfo].default_runfiles) return [default_info(files=depset([linking_outputs.executable]), runfiles=runfiles)] attrs = {'srcs': attr.label_list(allow_files=True), 'hdrs': attr.label_list(allow_files=True), 'aux_srcs': attr.label_list(allow_files=True), 'includes': attr.string_list(), 'defines': attr.string_list(), 'copts': attr.string_list(), 'linkopts': attr.string_list(), 'local_defines': attr.string_list(), 'alwayslink': attr.bool(default=False), 'strip_include_prefix': attr.string(), 'include_prefix': attr.string(), 'deps': attr.label_list(providers=[CcInfo]), 'data': attr.label_list(allow_files=True), '_linker_script': attr.label(allow_single_file=True, default=label('//risc0/zkvm/platform:risc0.ld')), '_allowlist_function_transition': attr.label(default='@bazel_tools//tools/allowlists/function_transition_allowlist')} risc0_cc_library = rule(implementation=_risc0_cc_library_impl, attrs=attrs, toolchains=[CC_TOOLCHAIN_TYPE], fragments=['cpp'], incompatible_use_toolchain_transition=True, cfg=risc0_transition) risc0_cc_binary = rule(implementation=_risc0_cc_binary_impl, attrs=attrs, toolchains=[CC_TOOLCHAIN_TYPE], fragments=['cpp'], incompatible_use_toolchain_transition=True, cfg=risc0_transition)
class Solution: def findLHS(self, nums: List[int]) -> int: d=collections.defaultdict(lambda:0) for i in range(0,len(nums)): d[nums[i]]+=1 maxi=0 for i in d.keys(): if(d.get(i+1,"E")!="E"): maxi=max(maxi,d[i]+d[i+1]) return maxi
class Solution: def find_lhs(self, nums: List[int]) -> int: d = collections.defaultdict(lambda : 0) for i in range(0, len(nums)): d[nums[i]] += 1 maxi = 0 for i in d.keys(): if d.get(i + 1, 'E') != 'E': maxi = max(maxi, d[i] + d[i + 1]) return maxi
model_config = {} # alpha config model_config['alpha_jump_mode'] = "linear" model_config['iter_alpha_jump'] = [] model_config['alpha_jump_vals'] = [] model_config['alpha_n_jumps'] = [0, 600, 600, 600, 600, 600, 600, 600, 600] model_config['alpha_size_jumps'] = [0, 32, 32, 32, 32, 32, 32, 32, 32, 32] # base config model_config['max_iter_at_scale'] = [48000, 96000, 96000, 96000, 96000, 192000, 192000, 192000, 200000] model_config['scaling_layer_channels'] = [512, 512, 512, 512, 256, 128, 64, 32, 16] model_config['mini_batch_size'] = [16, 16, 16, 16, 16, 8, 8, 8, 8] model_config['dim_latent_vector'] = 512 model_config['lambda_gp'] = 10 model_config["epsilon_d"] = 0.001 model_config["learning_rate"] = 0.001
model_config = {} model_config['alpha_jump_mode'] = 'linear' model_config['iter_alpha_jump'] = [] model_config['alpha_jump_vals'] = [] model_config['alpha_n_jumps'] = [0, 600, 600, 600, 600, 600, 600, 600, 600] model_config['alpha_size_jumps'] = [0, 32, 32, 32, 32, 32, 32, 32, 32, 32] model_config['max_iter_at_scale'] = [48000, 96000, 96000, 96000, 96000, 192000, 192000, 192000, 200000] model_config['scaling_layer_channels'] = [512, 512, 512, 512, 256, 128, 64, 32, 16] model_config['mini_batch_size'] = [16, 16, 16, 16, 16, 8, 8, 8, 8] model_config['dim_latent_vector'] = 512 model_config['lambda_gp'] = 10 model_config['epsilon_d'] = 0.001 model_config['learning_rate'] = 0.001
class LineItem(object): def __init__(self, description, weight, price): self.description = description self.set_weight(weight) self.price = price def subtotal(self): return self.get_weight() * self.price def get_weight(self): return self.__weight def set_weight(self, value): if value > 0: self.__weight = value else: raise ValueError('value must be > 0')
class Lineitem(object): def __init__(self, description, weight, price): self.description = description self.set_weight(weight) self.price = price def subtotal(self): return self.get_weight() * self.price def get_weight(self): return self.__weight def set_weight(self, value): if value > 0: self.__weight = value else: raise value_error('value must be > 0')
_out_ = "" _in_ = "" _err_ = "" _root_ = ""
_out_ = '' _in_ = '' _err_ = '' _root_ = ''
class FrontMiddleBackQueue: def __init__(self): self.queue = [] def pushFront(self, val: int): self.queue.insert(0,val) def pushMiddle(self, val: int): self.queue.insert(len(self.queue) // 2,val) def pushBack(self, val: int): self.queue.append(val) def popFront(self): return (self.queue or [-1]).pop(0) def popMiddle(self): return (self.queue or [-1]).pop((len(self.queue)-1)//2) def popBack(self): return (self.queue or [-1]).pop() # Your FrontMiddleBackQueue object will be instantiated and called as such: # obj = FrontMiddleBackQueue() # obj.pushFront(val) # obj.pushMiddle(val) # obj.pushBack(val) # param_4 = obj.popFront() # param_5 = obj.popMiddle() # param_6 = obj.popBack()
class Frontmiddlebackqueue: def __init__(self): self.queue = [] def push_front(self, val: int): self.queue.insert(0, val) def push_middle(self, val: int): self.queue.insert(len(self.queue) // 2, val) def push_back(self, val: int): self.queue.append(val) def pop_front(self): return (self.queue or [-1]).pop(0) def pop_middle(self): return (self.queue or [-1]).pop((len(self.queue) - 1) // 2) def pop_back(self): return (self.queue or [-1]).pop()
# alternative characters T = input() lst = [] results = [] if T >= 1 and T <= 10: for i in range(T): lst.append(raw_input()) lst = filter(lambda x: len(x) >= 1 and len(x) <= 10**5, lst) for cst in lst: delct = 0 for j in range(len(cst)-1): if cst[j] == cst[j+1]: delct += 1 results.append(delct) for v in results: print(v)
t = input() lst = [] results = [] if T >= 1 and T <= 10: for i in range(T): lst.append(raw_input()) lst = filter(lambda x: len(x) >= 1 and len(x) <= 10 ** 5, lst) for cst in lst: delct = 0 for j in range(len(cst) - 1): if cst[j] == cst[j + 1]: delct += 1 results.append(delct) for v in results: print(v)
a = int(input()) c = int(input()) s = True for b in range(a - 1): if int(input()) >= c: s = False if s: print("YES") else: print("NO")
a = int(input()) c = int(input()) s = True for b in range(a - 1): if int(input()) >= c: s = False if s: print('YES') else: print('NO')
n, m = map(int, input().split()) shops = [tuple(map(int, input().split())) for _ in range(n)] shops.sort(key=lambda x: x[0]) ans = 0 for a, b in shops: if m <= b: ans += a * m break else: ans += a * b m -= b print(ans)
(n, m) = map(int, input().split()) shops = [tuple(map(int, input().split())) for _ in range(n)] shops.sort(key=lambda x: x[0]) ans = 0 for (a, b) in shops: if m <= b: ans += a * m break else: ans += a * b m -= b print(ans)
''' Power of Two Solution Given an integer, write a function to determine if it is a power of two. Example 1: Input: 1 Output: true Explanation: 20 = 1 Example 2: Input: 16 Output: true Explanation: 24 = 16 Example 3: Input: 218 Output: false''' n = int(input()) if n <= 0 : print('false') while n%2 == 0: n = n/2 print(n==1)
""" Power of Two Solution Given an integer, write a function to determine if it is a power of two. Example 1: Input: 1 Output: true Explanation: 20 = 1 Example 2: Input: 16 Output: true Explanation: 24 = 16 Example 3: Input: 218 Output: false""" n = int(input()) if n <= 0: print('false') while n % 2 == 0: n = n / 2 print(n == 1)
# Copyright 2017 Lawrence Kesteloot # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software # distributed under the License is distributed on an "AS IS" BASIS, # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. # See the License for the specific language governing permissions and # limitations under the License. # Defines the various low-level model structures. These mirror the database tables. # Represents a photo that was taken. Multiple files on disk (PhotoFile) can represent # this photo. class Photo(object): def __init__(self, id, hash_back, rotation, rating, date, display_date, label): self.id = id # SHA-1 of the last 1 kB of the file. self.hash_back = hash_back # In degrees. self.rotation = rotation # 1 to 5, where 1 means "I'd be okay deleting this file", 2 means "I don't want # to show this on this slide show program", 3 is the default, 4 means "This is # a great photo", and 5 means "On my deathbed I want a photo album with this photo." self.rating = rating # Unix date when the photo was taken. Defaults to the date of the file. self.date = date # Date as displayed to the user. Usually a friendly version of "date" but might # be more vague, like "Summer 1975". self.display_date = display_date # Label to display. Defaults to a cleaned up version of the pathname, but could be # edited by the user. self.label = label # In-memory use only, not stored in database. Refers to the preferred photo file to # show for this photo. self.pathname = None # Represents a photo file on disk. Multiple of these (including minor changes in the header) # might represent the same Photo. class PhotoFile(object): def __init__(self, pathname, hash_all, hash_back): # Pathname relative to the root of the photo tree. self.pathname = pathname # SHA-1 of the entire file. self.hash_all = hash_all # SHA-1 of the last 1 kB of the file. self.hash_back = hash_back # Represents an email that was sent to a person about a photo. class Email(object): def __init__(self, id, pathname, person_id, sent_at, photo_id): self.id = id self.person_id = person_id self.sent_at = sent_at self.photo_id = photo_id
class Photo(object): def __init__(self, id, hash_back, rotation, rating, date, display_date, label): self.id = id self.hash_back = hash_back self.rotation = rotation self.rating = rating self.date = date self.display_date = display_date self.label = label self.pathname = None class Photofile(object): def __init__(self, pathname, hash_all, hash_back): self.pathname = pathname self.hash_all = hash_all self.hash_back = hash_back class Email(object): def __init__(self, id, pathname, person_id, sent_at, photo_id): self.id = id self.person_id = person_id self.sent_at = sent_at self.photo_id = photo_id
# eerste negen cijfers van ISBN-10 code inlezen en omzetten naar integers x1 = int(input()) x2 = int(input()) x3 = int(input()) x4 = int(input()) x5 = int(input()) x6 = int(input()) x7 = int(input()) x8 = int(input()) x9 = int(input()) # controlecijfer berekenen x10 = (x1 + 2 * x2 + 3 * x3 + 4 * x4 + 5 * x5 + 6 * x6 + 7 * x7 + 8 * x8 + 9 * x9) % 11 # controlecijfer uitschrijven print(x10)
x1 = int(input()) x2 = int(input()) x3 = int(input()) x4 = int(input()) x5 = int(input()) x6 = int(input()) x7 = int(input()) x8 = int(input()) x9 = int(input()) x10 = (x1 + 2 * x2 + 3 * x3 + 4 * x4 + 5 * x5 + 6 * x6 + 7 * x7 + 8 * x8 + 9 * x9) % 11 print(x10)
def get_attr_or_callable(obj, name): target = getattr(obj, name) if callable(target): return target() return target
def get_attr_or_callable(obj, name): target = getattr(obj, name) if callable(target): return target() return target
# These are the "Tableau 20" colors as RGB. tableau20 = [(31, 119, 180), (174, 199, 232), (255, 127, 14), (255, 187, 120), (44, 160, 44), (152, 223, 138), (214, 39, 40), (255, 152, 150), (148, 103, 189), (197, 176, 213), (140, 86, 75), (196, 156, 148), (227, 119, 194), (247, 182, 210), (127, 127, 127), (199, 199, 199), (188, 189, 34), (219, 219, 141), (23, 190, 207), (158, 218, 229)] # Scale the RGB values to the [0, 1] range, which is the format matplotlib accepts. for i in range(len(tableau20)): r, g, b = tableau20[i] tableau20[i] = (r / 255., g / 255., b / 255.)
tableau20 = [(31, 119, 180), (174, 199, 232), (255, 127, 14), (255, 187, 120), (44, 160, 44), (152, 223, 138), (214, 39, 40), (255, 152, 150), (148, 103, 189), (197, 176, 213), (140, 86, 75), (196, 156, 148), (227, 119, 194), (247, 182, 210), (127, 127, 127), (199, 199, 199), (188, 189, 34), (219, 219, 141), (23, 190, 207), (158, 218, 229)] for i in range(len(tableau20)): (r, g, b) = tableau20[i] tableau20[i] = (r / 255.0, g / 255.0, b / 255.0)
# -*- coding: utf-8 -*- # Which templates don't you want to generate? (You can use regular expressions here!) # Use strings (with single or double quotes), and separate each template/regex in a line terminated with a comma. IGNORE_JINJA_TEMPLATES = [ '.*base.jinja', '.*tests/.*' ] # Do you have any additional variables to the templates? Put 'em here! (use dictionary ('key': value) format) EXTRA_VARIABLES = { 'test_type': 'Array', 'name': 'float', 'dim': 3, 'type': 'float', 'suffix': 'f', 'extends': '[3]' } OUTPUT_OPTIONS = { 'extension': '3_arr.cpp', # Including leading '.', example '.html' 'remove_double_extension': False }
ignore_jinja_templates = ['.*base.jinja', '.*tests/.*'] extra_variables = {'test_type': 'Array', 'name': 'float', 'dim': 3, 'type': 'float', 'suffix': 'f', 'extends': '[3]'} output_options = {'extension': '3_arr.cpp', 'remove_double_extension': False}
class Solution: def combine(self, n: int, k: int) -> List[List[int]]: results = [] def dfs (elements, start: int, k: int): if k == 0: results.append(elements[:]) for i in range (start, n+1): elements.append(i) dfs (elements, i+1, k-1) elements.pop() dfs ([], 1, k) return results
class Solution: def combine(self, n: int, k: int) -> List[List[int]]: results = [] def dfs(elements, start: int, k: int): if k == 0: results.append(elements[:]) for i in range(start, n + 1): elements.append(i) dfs(elements, i + 1, k - 1) elements.pop() dfs([], 1, k) return results
text = 'Writing to a file which\n' fileis = open('hello.txt', 'w') fileis.write(text) fileis.close()
text = 'Writing to a file which\n' fileis = open('hello.txt', 'w') fileis.write(text) fileis.close()
def gcd(p, q): pTrue = isinstance(p,int) qTrue = isinstance(q,int) if pTrue and qTrue: if q == 0: return p r = p%q return gcd(q,r) else: print("Error!") return 0
def gcd(p, q): p_true = isinstance(p, int) q_true = isinstance(q, int) if pTrue and qTrue: if q == 0: return p r = p % q return gcd(q, r) else: print('Error!') return 0
# -*- coding: utf-8 -*- keywords = { "abbrev", "abs", "abstime", "abstimeeq", "abstimege", "abstimegt", "abstimein", "abstimele", "abstimelt", "abstimene", "abstimeout", "abstimerecv", "abstimesend", "aclcontains", "aclinsert", "aclitemeq", "aclitemin", "aclitemout", "aclremove", "acos", "add_months", "aes128", "aes256", "age", "all", "alloc_rowid", "allowoverwrite", "alt_to_iso", "alt_to_koi8r", "alt_to_mic", "alt_to_win1251", "analyse", "analyze", "and", "any", "any_in", "any_out", "anyarray_in", "anyarray_out", "anyarray_recv", "anyarray_send", "anyelement_in", "anyelement_out", "area", "areajoinsel", "areasel", "array", "array_append", "array_cat", "array_coerce", "array_dims", "array_eq", "array_ge", "array_gt", "array_in", "array_le", "array_length_coerce", "array_lower", "array_lt", "array_ne", "array_out", "array_prepend", "array_recv", "array_send", "array_type_length_coerce", "array_upper", "as", "asc", "ascii", "ascii_to_mic", "asin", "atan", "atan2", "authorization", "avg", "az64", "backup", "between", "big5_to_euc_tw", "big5_to_mic", "binary", "bit", "bit_and", "bit_in", "bit_length", "bit_or", "bit_out", "bit_recv", "bit_send", "bitand", "bitcat", "bitcmp", "biteq", "bitge", "bitgt", "bitle", "bitlt", "bitne", "bitnot", "bitor", "bitxor", "blanksasnull", "bool", "bool_and", "bool_or", "booleq", "boolge", "boolgt", "boolin", "boolle", "boollt", "boolne", "boolout", "boolrecv", "boolsend", "both", "box", "box_above", "box_add", "box_below", "box_center", "box_contain", "box_contained", "box_distance", "box_div", "box_eq", "box_ge", "box_gt", "box_in", "box_intersect", "box_le", "box_lt", "box_mul", "box_out", "box_overlap", "box_recv", "box_same", "box_send", "box_sub", "bpchar", "bpchar_pattern_eq", "bpchar_pattern_ge", "bpchar_pattern_gt", "bpchar_pattern_le", "bpchar_pattern_lt", "bpchar_pattern_ne", "bpcharcmp", "bpchareq", "bpcharge", "bpchargt", "bpcharle", "bpcharlike", "bpcharlt", "bpcharne", "bpcharnlike", "bpcharout", "bpcharrecv", "bpcharregexeq", "bpcharregexne", "bpcharsend", "broadcast", "btabstimecmp", "btarraycmp", "btbeginscan", "btboolcmp", "btbpchar_pattern_cmp", "btbuild", "btbulkdelete", "btcharcmp", "btcostestimate", "btendscan", "btgettuple", "btinsert", "btint24cmp", "btint28cmp", "btint2cmp", "btint42cmp", "btint48cmp", "btint4cmp", "btint82cmp", "btint84cmp", "btint8cmp", "btmarkpos", "btname_pattern_cmp", "btnamecmp", "btoidcmp", "btoidvectorcmp", "btreltimecmp", "btrescan", "btrestrpos", "bttext_pattern_cmp", "bttextcmp", "bttintervalcmp", "btvacuumcleanup", "byteacat", "byteacmp", "byteaeq", "byteage", "byteagt", "byteain", "byteale", "bytealike", "bytealt", "byteane", "byteanlike", "byteaout", "bytearecv", "byteasend", "bytedict", "bzip2", "card_check", "case", "cash_cmp", "cash_div_int2", "cash_div_int4", "cash_eq", "cash_ge", "cash_gt", "cash_in", "cash_le", "cash_lt", "cash_mi", "cash_mul_int2", "cash_mul_int4", "cash_ne", "cash_out", "cash_pl", "cash_recv", "cash_send", "cash_words", "cashlarger", "cashsmaller", "cast", "cbrt", "ceil", "ceiling", "center", "char", "char_length", "character_length", "chareq", "charge", "chargt", "charle", "charlt", "charne", "charout", "charrecv", "charsend", "check", "checksum", "chr", "cideq", "cidin", "cidout", "cidr", "cidr_in", "cidr_out", "cidr_recv", "cidr_send", "cidrecv", "cidsend", "circle", "circle_above", "circle_add_pt", "circle_below", "circle_center", "circle_contain", "circle_contain_pt", "circle_contained", "circle_distance", "circle_div_pt", "circle_eq", "circle_ge", "circle_gt", "circle_in", "circle_le", "circle_lt", "circle_mul_pt", "circle_ne", "circle_out", "circle_overlap", "circle_recv", "circle_same", "circle_send", "circle_sub_pt", "close_lb", "close_ls", "close_lseg", "close_pb", "close_pl", "close_ps", "close_sb", "close_sl", "collate", "column", "concat", "constraint", "contains", "contjoinsel", "contsel", "convert", "convert_timezone", "convert_using", "cos", "cot", "count", "crc32", "create", "credentials", "cross", "cume_dist", "current_database", "current_date", "current_schema", "current_schemas", "current_setting", "current_time", "current_timestamp", "current_user", "current_user_id", "currtid", "currtid2", "currval", "cvtile_sf", "date", "date_add", "date_cmp", "date_cmp_timestamp", "date_cmp_timestamptz", "date_eq", "date_eq_timestamp", "date_eq_timestamptz", "date_ge", "date_ge_timestamp", "date_ge_timestamptz", "date_gt", "date_gt_timestamp", "date_gt_timestamptz", "date_in", "date_larger", "date_le", "date_le_timestamp", "date_le_timestamptz", "date_lt", "date_lt_timestamp", "date_lt_timestamptz", "date_mi", "date_mi_interval", "date_mii", "date_ne", "date_ne_timestamp", "date_ne_timestamptz", "date_out", "date_part", "date_part_year", "date_pl_interval", "date_pli", "date_recv", "date_send", "date_smaller", "date_trunc", "datetime_pl", "datetimetz_pl", "dcbrt", "default", "deferrable", "deflate", "defrag", "degrees", "delete_xid_column", "delta", "delta32k", "dense_rank", "desc", "dexp", "diagonal", "diameter", "disable", "dist_cpoly", "dist_lb", "dist_pb", "dist_pc", "dist_pl", "dist_ppath", "dist_ps", "dist_sb", "dist_sl", "distinct", "dlog1", "dlog10", "do", "dpow", "dround", "dsqrt", "dtrunc", "else", "emptyasnull", "enable", "encode", "encrypt ", "encryption", "end", "eqjoinsel", "eqsel", "erf", "euc_cn_to_mic", "euc_jp_to_mic", "euc_jp_to_sjis", "euc_kr_to_mic", "euc_tw_to_big5", "euc_tw_to_mic", "every", "except", "exp", "explicit", "false", "for", "foreign", "freeze", "from", "full", "geometry_analyze", "geometry_in", "geometry_out", "geometry_recv", "geometry_send", "geometrytype", "get_bit", "get_byte", "getdatabaseencoding", "getdate", "gistbeginscan", "gistbuild", "gistbulkdelete", "gistcostestimate", "gistendscan", "gistgettuple", "gistinsert", "gistmarkpos", "gistrescan", "gistrestrpos", "globaldict256", "globaldict64k", "grant", "group", "gzip", "hash_aclitem", "hashbeginscan", "hashbpchar", "hashbuild", "hashbulkdelete", "hashchar", "hashcostestimate", "hashendscan", "hashgettuple", "hashinet", "hashinsert", "hashint2", "hashint2vector", "hashint4", "hashint8", "hashmacaddr", "hashmarkpos", "hashname", "hashoid", "hashoidvector", "hashrescan", "hashrestrpos", "hashtext", "hashvarlena", "haversine_distance_km", "haversine_distance_km2", "having", "height", "hll_cardinality_16", "hll_cardinality_32", "host", "hostmask", "iclikejoinsel", "iclikesel", "icnlikejoinsel", "icnlikesel", "icregexeqjoinsel", "icregexeqsel", "icregexnejoinsel", "icregexnesel", "identity", "ignore", "ilike", "in", "inet", "inet_client_addr", "inet_client_port", "inet_in", "inet_out", "inet_recv", "inet_send", "inet_server_addr", "inet_server_port", "initcap", "initially", "inner", "int2", "int24div", "int24eq", "int24ge", "int24gt", "int24le", "int24lt", "int24mi", "int24mod", "int24mul", "int24ne", "int24pl", "int28div", "int28eq", "int28ge", "int28gt", "int28le", "int28lt", "int28mi", "int28mul", "int28ne", "int28pl", "int2_accum", "int2_avg_accum", "int2_mul_cash", "int2_sum", "int2abs", "int2and", "int2div", "int2eq", "int2ge", "int2gt", "int2in", "int2larger", "int2le", "int2lt", "int2mi", "int2mod", "int2mul", "int2ne", "int2not", "int2or", "int2out", "int2pl", "int2recv", "int2send", "int2shl", "int2shr", "int2smaller", "int2um", "int2up", "int2vectoreq", "int2vectorout", "int2vectorrecv", "int2vectorsend", "int2xor", "int4", "int42div", "int42eq", "int42ge", "int42gt", "int42le", "int42lt", "int42mi", "int42mod", "int42mul", "int42ne", "int42pl", "int48div", "int48eq", "int48ge", "int48gt", "int48le", "int48lt", "int48mi", "int48mul", "int48ne", "int48pl", "int4_accum", "int4_avg_accum", "int4_mul_cash", "int4_sum", "int4abs", "int4and", "int4div", "int4eq", "int4ge", "int4gt", "int4in", "int4inc", "int4larger", "int4le", "int4lt", "int4mi", "int4mod", "int4mul", "int4ne", "int4not", "int4or", "int4out", "int4pl", "int4recv", "int4send", "int4shl", "int4shr", "int4smaller", "int4um", "int4up", "int4xor", "int8", "int82div", "int82eq", "int82ge", "int82gt", "int82le", "int82lt", "int82mi", "int82mul", "int82ne", "int82pl", "int84div", "int84eq", "int84ge", "int84gt", "int84le", "int84lt", "int84mi", "int84mul", "int84ne", "int84pl", "int8_accum", "int8_avg", "int8_avg_accum", "int8_pl_timestamp", "int8_pl_timestamptz", "int8_sum", "int8abs", "int8and", "int8div", "int8eq", "int8ge", "int8gt", "int8in", "int8inc", "int8larger", "int8le", "int8lt", "int8mi", "int8mod", "int8mul", "int8ne", "int8not", "int8or", "int8out", "int8pl", "int8recv", "int8send", "int8shl", "int8shr", "int8smaller", "int8um", "int8up", "int8xor", "integer_pl_date", "inter_lb", "inter_sb", "inter_sl", "internal_in", "internal_out", "intersect", "interval", "interval_accum", "interval_avg", "interval_cmp", "interval_div", "interval_eq", "interval_ge", "interval_gt", "interval_hash", "interval_in", "interval_larger", "interval_le", "interval_lt", "interval_mi", "interval_mul", "interval_ne", "interval_out", "interval_pl", "interval_pl_date", "interval_pl_time", "interval_pl_timestamp", "interval_pl_timestamptz", "interval_pl_timetz", "interval_recv", "interval_send", "interval_smaller", "interval_um", "intinterval", "into", "ip_aton", "ip_masking", "ip_ntoa", "is", "is_ssl_connection", "is_valid_json", "is_valid_json_array", "isclosed", "isnottrue", "isnull", "iso_to_alt", "iso_to_koi8r", "iso_to_mic", "iso_to_win1251", "isopen", "isparallel", "isperp", "istrue", "isvertical", "join", "json_array_length", "json_extract_array_element_text", "json_extract_path_text", "koi8r_to_alt", "koi8r_to_iso", "koi8r_to_mic", "koi8r_to_win1251", "lag", "language", "language_handler_in", "language_handler_out", "last_day", "last_value", "latin1_to_mic", "latin2_to_mic", "latin2_to_win1250", "latin3_to_mic", "latin4_to_mic", "lead", "leading", "left", "len", "length", "like", "like_escape", "likejoinsel", "likesel", "limit", "line", "line_distance", "line_eq", "line_in", "line_interpt", "line_intersect", "line_out", "line_parallel", "line_perp", "line_recv", "line_send", "line_vertical", "listagg", "listaggdistinct", "ln", "lo_close", "lo_creat", "lo_export", "lo_import", "lo_lseek", "lo_open", "lo_tell", "lo_unlink", "localtime", "localtimestamp", "log", "logistic", "loread", "lower", "lpad", "lseg", "lseg_center", "lseg_distance", "lseg_eq", "lseg_ge", "lseg_gt", "lseg_in", "lseg_interpt", "lseg_intersect", "lseg_le", "lseg_length", "lseg_lt", "lseg_ne", "lseg_out", "lseg_parallel", "lseg_perp", "lseg_recv", "lseg_send", "lseg_vertical", "lun", "luns", "lzo", "lzop", "macaddr", "macaddr_cmp", "macaddr_eq", "macaddr_ge", "macaddr_gt", "macaddr_in", "macaddr_le", "macaddr_lt", "macaddr_ne", "macaddr_out", "macaddr_recv", "macaddr_send", "makeaclitem", "masklen", "max", "md5", "median", "mic_to_alt", "mic_to_ascii", "mic_to_big5", "mic_to_euc_cn", "mic_to_euc_jp", "mic_to_euc_kr", "mic_to_euc_tw", "mic_to_iso", "mic_to_koi8r", "mic_to_latin1", "mic_to_latin2", "mic_to_latin3", "mic_to_latin4", "mic_to_sjis", "mic_to_win1250", "mic_to_win1251", "min", "minus", "mktinterval", "mod", "months_between", "mos_score", "mostly13", "mostly32", "mostly8", "mul_d_interval", "name", "name_pattern_eq", "name_pattern_ge", "name_pattern_gt", "name_pattern_le", "name_pattern_lt", "name_pattern_ne", "nameeq", "namege", "namegt", "nameiclike", "nameicnlike", "nameicregexeq", "nameicregexne", "namein", "namele", "namelike", "namelt", "namene", "namenlike", "nameout", "namerecv", "nameregexeq", "nameregexne", "namesend", "natural", "neqjoinsel", "neqsel", "netmask", "network", "network_cmp", "network_eq", "network_ge", "network_gt", "network_le", "network_lt", "network_ne", "network_sub", "network_subeq", "network_sup", "network_supeq", "new", "next_day", "nextval", "nlikejoinsel", "nlikesel", "node_num", "nonnullvalue", "not", "notlike", "notnull", "now", "npoints", "nth_value", "ntile", "null", "nulls", "nullvalue", "nvl2", "octet_length", "off", "offline", "offset", "oid", "oideq", "oidge", "oidgt", "oidin", "oidlarger", "oidle", "oidlt", "oidne", "oidout", "oidrecv", "oidsend", "oidsmaller", "oidvectoreq", "oidvectorge", "oidvectorgt", "oidvectorle", "oidvectorlt", "oidvectorne", "oidvectorout", "oidvectorrecv", "oidvectorsend", "oidvectortypes", "old", "on", "on_pb", "on_pl", "on_ppath", "on_ps", "on_sb", "on_sl", "only", "opaque_in", "opaque_out", "open", "or", "order", "outer", "overlaps", "parallel", "partition", "path", "path_add", "path_add_pt", "path_center", "path_contain_pt", "path_distance", "path_div_pt", "path_in", "path_inter", "path_length", "path_mul_pt", "path_n_eq", "path_n_ge", "path_n_gt", "path_n_le", "path_n_lt", "path_npoints", "path_out", "path_recv", "path_send", "path_sub_pt", "pclose", "percent", "percent_rank", "percentile_cont", "percentile_disc", "permissions", "pg_backend_pid", "pg_cancel_backend", "pg_char_to_encoding", "pg_client_encoding", "pg_conversion_is_visible", "pg_decode", "pg_encoding_to_char", "pg_get_cols", "pg_get_constraintdef", "pg_get_current_groups", "pg_get_expr", "pg_get_external_columns", "pg_get_external_tables", "pg_get_indexdef", "pg_get_late_binding_view_cols", "pg_get_ruledef", "pg_get_userbyid", "pg_get_viewdef", "pg_last_copy_count", "pg_last_copy_id", "pg_last_query_id", "pg_last_unload_count", "pg_last_unload_id", "pg_lock_status", "pg_opclass_is_visible", "pg_operator_is_visible", "pg_postmaster_start_time", "pg_show_all_settings", "pg_sleep", "pg_start_backup", "pg_stat_get_backend_activity", "pg_stat_get_backend_activity_start", "pg_stat_get_backend_dbid", "pg_stat_get_backend_idset", "pg_stat_get_backend_pid", "pg_stat_get_blocks_hit", "pg_stat_get_db_blocks_hit", "pg_stat_get_db_numbackends", "pg_stat_get_db_xact_commit", "pg_stat_get_db_xact_rollback", "pg_stat_get_numscans", "pg_stat_get_tuples_deleted", "pg_stat_get_tuples_inserted", "pg_stat_get_tuples_returned", "pg_stat_get_tuples_updated", "pg_stat_reset", "pg_stop_backup", "pg_table_is_visible", "pg_tablespace_databases", "pg_terminate_backend", "pg_timezone_abbrevs", "pg_timezone_names", "pg_type_is_visible", "pgdate_part", "pi", "placing", "plpython_call_handler", "plpython_compiler", "point", "point_above", "point_add", "point_below", "point_distance", "point_div", "point_eq", "point_in", "point_mul", "point_ne", "point_out", "point_recv", "point_send", "point_sub", "point_vert", "poly_center", "poly_contain", "poly_contain_pt", "poly_contained", "poly_distance", "poly_in", "poly_npoints", "poly_out", "poly_overlap", "poly_recv", "poly_same", "poly_send", "polygon", "popen", "position", "positionjoinsel", "positionsel", "pow", "power", "primary", "pt_contained_circle", "pt_contained_poly", "qsummary", "quote_ident", "quote_literal", "radians", "radius", "random", "rank", "rankx", "ratio_to_report", "raw", "readratio", "record_in", "record_out", "record_recv", "record_send", "recover", "references", "regclassin", "regclassout", "regclassrecv", "regclasssend", "regexeqjoinsel", "regexeqsel", "regexnejoinsel", "regexnesel", "regexp_count", "regexp_instr", "regexp_replace", "regexp_substr", "regoperatorout", "regoperatorrecv", "regoperatorsend", "regoperout", "regoperrecv", "regopersend", "regprocedurein", "regprocedureout", "regprocedurerecv", "regproceduresend", "regprocin", "regprocout", "regprocrecv", "regprocsend", "regtypein", "regtypeout", "regtyperecv", "regtypesend", "rejectlog", "reltime", "reltimeeq", "reltimege", "reltimegt", "reltimein", "reltimele", "reltimelt", "reltimene", "reltimeout", "reltimerecv", "reltimesend", "relu", "remaining_vacrows", "repeat", "replace", "replicate", "resort", "respect", "restore", "return_approx_percentile", "reverse", "right", "round", "row_number", "rownumber", "rpad", "rt_box_inter", "rt_box_size", "rt_box_union", "rt_poly_inter", "rt_poly_size", "rt_poly_union", "rtbeginscan", "rtbuild", "rtbulkdelete", "rtcostestimate", "rtendscan", "rtgettuple", "rtinsert", "rtmarkpos", "rtrescan", "rtrestrpos", "scalargtjoinsel", "scalargtsel", "scalarltjoinsel", "scalarltsel", "select", "session_user", "set_bit", "set_byte", "set_masklen", "setval", "sig_bucket_3g", "sig_bucket_lte", "sig_score_3g", "sig_score_lte", "sigmoid", "sign", "similar", "similar_escape", "sin", "sjis_to_euc_jp", "sjis_to_mic", "slice_num", "slope", "smgreq", "smgrne", "smgrout", "snapshot ", "some", "sort_avail_mem", "sortbytes", "split_part", "sqrt", "ssl_version", "st_asbinary", "st_asewkb", "st_asewkt", "st_astext", "st_azimuth", "st_contains", "st_dimension", "st_disjoint", "st_distance", "st_dwithin", "st_equals", "st_geometrytype", "st_intersects", "st_isclosed", "st_iscollection", "st_isempty", "st_makeline", "st_makepoint", "st_makepolygon", "st_npoints", "st_numpoints", "st_point", "st_polygon", "st_within", "st_x", "st_xmax", "st_xmin", "st_y", "st_ymax", "st_ymin", "stddev", "stddev_pop", "strpos", "strtol", "substr", "sum", "sysdate", "system", "table", "tablebytes", "tag", "tan", "tdes", "text", "text255", "text32k", "text_ge", "text_gt", "text_larger", "text_le", "text_lt", "text_pattern_eq", "text_pattern_ge", "text_pattern_gt", "text_pattern_le", "text_pattern_lt", "text_pattern_ne", "text_smaller", "textcat", "texteq", "texticlike", "texticnlike", "texticregexeq", "texticregexne", "textin", "textlen", "textlike", "textne", "textnlike", "textout", "textrecv", "textregexeq", "textregexne", "textsend", "then", "tideq", "tidin", "tidout", "tidrecv", "tidsend", "time", "time_cmp", "time_eq", "time_ge", "time_gt", "time_in", "time_larger", "time_le", "time_lt", "time_mi_interval", "time_mi_time", "time_ne", "time_out", "time_pl_interval", "time_recv", "time_send", "time_smaller", "timedate_pl", "timemi", "timenow", "timepl", "timestamp", "timestamp_cmp", "timestamp_cmp_date", "timestamp_cmp_timestamptz", "timestamp_eq", "timestamp_eq_date", "timestamp_eq_timestamptz", "timestamp_ge", "timestamp_ge_date", "timestamp_ge_timestamptz", "timestamp_gt", "timestamp_gt_date", "timestamp_gt_timestamptz", "timestamp_in", "timestamp_larger", "timestamp_le", "timestamp_le_date", "timestamp_le_timestamptz", "timestamp_lt", "timestamp_lt_date", "timestamp_lt_timestamptz", "timestamp_mi", "timestamp_mi_int8", "timestamp_mi_interval", "timestamp_ne", "timestamp_ne_date", "timestamp_ne_timestamptz", "timestamp_out", "timestamp_pl_int8", "timestamp_pl_interval", "timestamp_recv", "timestamp_send", "timestamp_smaller", "timestamptz", "timestamptz_cmp", "timestamptz_cmp_date", "timestamptz_cmp_timestamp", "timestamptz_eq", "timestamptz_eq_date", "timestamptz_eq_timestamp", "timestamptz_ge", "timestamptz_ge_date", "timestamptz_ge_timestamp", "timestamptz_gt", "timestamptz_gt_date", "timestamptz_gt_timestamp", "timestamptz_in", "timestamptz_larger", "timestamptz_le", "timestamptz_le_date", "timestamptz_le_timestamp", "timestamptz_lt", "timestamptz_lt_date", "timestamptz_lt_timestamp", "timestamptz_mi", "timestamptz_mi_int8", "timestamptz_mi_interval", "timestamptz_ne", "timestamptz_ne_date", "timestamptz_ne_timestamp", "timestamptz_out", "timestamptz_pl_int8", "timestamptz_pl_interval", "timestamptz_recv", "timestamptz_send", "timestamptz_smaller", "timetz", "timetz_cmp", "timetz_eq", "timetz_ge", "timetz_gt", "timetz_hash", "timetz_in", "timetz_larger", "timetz_le", "timetz_lt", "timetz_mi_interval", "timetz_ne", "timetz_out", "timetz_pl_interval", "timetz_recv", "timetz_send", "timetz_smaller", "timetzdate_pl", "timezone", "tinterval", "tintervalct", "tintervalend", "tintervaleq", "tintervalge", "tintervalgt", "tintervalin", "tintervalle", "tintervalleneq", "tintervallenge", "tintervallengt", "tintervallenle", "tintervallenlt", "tintervallenne", "tintervallt", "tintervalne", "tintervalout", "tintervalov", "tintervalrecv", "tintervalrel", "tintervalsame", "tintervalsend", "tintervalstart", "to", "to_ascii", "to_char", "to_date", "to_hex", "to_number", "to_timestamp", "tobpchar", "top", "total_num_deleted_vacrows", "total_num_deleted_vacrows_reclaimed", "trailing", "translate", "true", "trunc", "truncatecolumns", "union", "unique", "unknownin", "unknownout", "unknownrecv", "unknownsend", "upper", "user", "using", "vacstate_endrow", "vacstate_last_inserted_row", "var_pop", "varbit", "varbit_in", "varbit_out", "varbit_recv", "varbit_send", "varbitcmp", "varbiteq", "varbitge", "varbitgt", "varbitle", "varbitlt", "varbitne", "varchar", "varcharout", "varcharrecv", "varcharsend", "verbose", "version", "void_in", "void_out", "wallet", "when", "where", "width", "width_bucket", "win1250_to_latin2", "win1250_to_mic", "win1250_to_utf", "win1251_to_alt", "win1251_to_iso", "win1251_to_koi8r", "win1251_to_mic", "win1256_to_utf", "win874_to_utf", "with", "without", "xideq", "xideqint4", "xidin", "xidout", "xidrecv", "xidsend", }
keywords = {'abbrev', 'abs', 'abstime', 'abstimeeq', 'abstimege', 'abstimegt', 'abstimein', 'abstimele', 'abstimelt', 'abstimene', 'abstimeout', 'abstimerecv', 'abstimesend', 'aclcontains', 'aclinsert', 'aclitemeq', 'aclitemin', 'aclitemout', 'aclremove', 'acos', 'add_months', 'aes128', 'aes256', 'age', 'all', 'alloc_rowid', 'allowoverwrite', 'alt_to_iso', 'alt_to_koi8r', 'alt_to_mic', 'alt_to_win1251', 'analyse', 'analyze', 'and', 'any', 'any_in', 'any_out', 'anyarray_in', 'anyarray_out', 'anyarray_recv', 'anyarray_send', 'anyelement_in', 'anyelement_out', 'area', 'areajoinsel', 'areasel', 'array', 'array_append', 'array_cat', 'array_coerce', 'array_dims', 'array_eq', 'array_ge', 'array_gt', 'array_in', 'array_le', 'array_length_coerce', 'array_lower', 'array_lt', 'array_ne', 'array_out', 'array_prepend', 'array_recv', 'array_send', 'array_type_length_coerce', 'array_upper', 'as', 'asc', 'ascii', 'ascii_to_mic', 'asin', 'atan', 'atan2', 'authorization', 'avg', 'az64', 'backup', 'between', 'big5_to_euc_tw', 'big5_to_mic', 'binary', 'bit', 'bit_and', 'bit_in', 'bit_length', 'bit_or', 'bit_out', 'bit_recv', 'bit_send', 'bitand', 'bitcat', 'bitcmp', 'biteq', 'bitge', 'bitgt', 'bitle', 'bitlt', 'bitne', 'bitnot', 'bitor', 'bitxor', 'blanksasnull', 'bool', 'bool_and', 'bool_or', 'booleq', 'boolge', 'boolgt', 'boolin', 'boolle', 'boollt', 'boolne', 'boolout', 'boolrecv', 'boolsend', 'both', 'box', 'box_above', 'box_add', 'box_below', 'box_center', 'box_contain', 'box_contained', 'box_distance', 'box_div', 'box_eq', 'box_ge', 'box_gt', 'box_in', 'box_intersect', 'box_le', 'box_lt', 'box_mul', 'box_out', 'box_overlap', 'box_recv', 'box_same', 'box_send', 'box_sub', 'bpchar', 'bpchar_pattern_eq', 'bpchar_pattern_ge', 'bpchar_pattern_gt', 'bpchar_pattern_le', 'bpchar_pattern_lt', 'bpchar_pattern_ne', 'bpcharcmp', 'bpchareq', 'bpcharge', 'bpchargt', 'bpcharle', 'bpcharlike', 'bpcharlt', 'bpcharne', 'bpcharnlike', 'bpcharout', 'bpcharrecv', 'bpcharregexeq', 'bpcharregexne', 'bpcharsend', 'broadcast', 'btabstimecmp', 'btarraycmp', 'btbeginscan', 'btboolcmp', 'btbpchar_pattern_cmp', 'btbuild', 'btbulkdelete', 'btcharcmp', 'btcostestimate', 'btendscan', 'btgettuple', 'btinsert', 'btint24cmp', 'btint28cmp', 'btint2cmp', 'btint42cmp', 'btint48cmp', 'btint4cmp', 'btint82cmp', 'btint84cmp', 'btint8cmp', 'btmarkpos', 'btname_pattern_cmp', 'btnamecmp', 'btoidcmp', 'btoidvectorcmp', 'btreltimecmp', 'btrescan', 'btrestrpos', 'bttext_pattern_cmp', 'bttextcmp', 'bttintervalcmp', 'btvacuumcleanup', 'byteacat', 'byteacmp', 'byteaeq', 'byteage', 'byteagt', 'byteain', 'byteale', 'bytealike', 'bytealt', 'byteane', 'byteanlike', 'byteaout', 'bytearecv', 'byteasend', 'bytedict', 'bzip2', 'card_check', 'case', 'cash_cmp', 'cash_div_int2', 'cash_div_int4', 'cash_eq', 'cash_ge', 'cash_gt', 'cash_in', 'cash_le', 'cash_lt', 'cash_mi', 'cash_mul_int2', 'cash_mul_int4', 'cash_ne', 'cash_out', 'cash_pl', 'cash_recv', 'cash_send', 'cash_words', 'cashlarger', 'cashsmaller', 'cast', 'cbrt', 'ceil', 'ceiling', 'center', 'char', 'char_length', 'character_length', 'chareq', 'charge', 'chargt', 'charle', 'charlt', 'charne', 'charout', 'charrecv', 'charsend', 'check', 'checksum', 'chr', 'cideq', 'cidin', 'cidout', 'cidr', 'cidr_in', 'cidr_out', 'cidr_recv', 'cidr_send', 'cidrecv', 'cidsend', 'circle', 'circle_above', 'circle_add_pt', 'circle_below', 'circle_center', 'circle_contain', 'circle_contain_pt', 'circle_contained', 'circle_distance', 'circle_div_pt', 'circle_eq', 'circle_ge', 'circle_gt', 'circle_in', 'circle_le', 'circle_lt', 'circle_mul_pt', 'circle_ne', 'circle_out', 'circle_overlap', 'circle_recv', 'circle_same', 'circle_send', 'circle_sub_pt', 'close_lb', 'close_ls', 'close_lseg', 'close_pb', 'close_pl', 'close_ps', 'close_sb', 'close_sl', 'collate', 'column', 'concat', 'constraint', 'contains', 'contjoinsel', 'contsel', 'convert', 'convert_timezone', 'convert_using', 'cos', 'cot', 'count', 'crc32', 'create', 'credentials', 'cross', 'cume_dist', 'current_database', 'current_date', 'current_schema', 'current_schemas', 'current_setting', 'current_time', 'current_timestamp', 'current_user', 'current_user_id', 'currtid', 'currtid2', 'currval', 'cvtile_sf', 'date', 'date_add', 'date_cmp', 'date_cmp_timestamp', 'date_cmp_timestamptz', 'date_eq', 'date_eq_timestamp', 'date_eq_timestamptz', 'date_ge', 'date_ge_timestamp', 'date_ge_timestamptz', 'date_gt', 'date_gt_timestamp', 'date_gt_timestamptz', 'date_in', 'date_larger', 'date_le', 'date_le_timestamp', 'date_le_timestamptz', 'date_lt', 'date_lt_timestamp', 'date_lt_timestamptz', 'date_mi', 'date_mi_interval', 'date_mii', 'date_ne', 'date_ne_timestamp', 'date_ne_timestamptz', 'date_out', 'date_part', 'date_part_year', 'date_pl_interval', 'date_pli', 'date_recv', 'date_send', 'date_smaller', 'date_trunc', 'datetime_pl', 'datetimetz_pl', 'dcbrt', 'default', 'deferrable', 'deflate', 'defrag', 'degrees', 'delete_xid_column', 'delta', 'delta32k', 'dense_rank', 'desc', 'dexp', 'diagonal', 'diameter', 'disable', 'dist_cpoly', 'dist_lb', 'dist_pb', 'dist_pc', 'dist_pl', 'dist_ppath', 'dist_ps', 'dist_sb', 'dist_sl', 'distinct', 'dlog1', 'dlog10', 'do', 'dpow', 'dround', 'dsqrt', 'dtrunc', 'else', 'emptyasnull', 'enable', 'encode', 'encrypt ', 'encryption', 'end', 'eqjoinsel', 'eqsel', 'erf', 'euc_cn_to_mic', 'euc_jp_to_mic', 'euc_jp_to_sjis', 'euc_kr_to_mic', 'euc_tw_to_big5', 'euc_tw_to_mic', 'every', 'except', 'exp', 'explicit', 'false', 'for', 'foreign', 'freeze', 'from', 'full', 'geometry_analyze', 'geometry_in', 'geometry_out', 'geometry_recv', 'geometry_send', 'geometrytype', 'get_bit', 'get_byte', 'getdatabaseencoding', 'getdate', 'gistbeginscan', 'gistbuild', 'gistbulkdelete', 'gistcostestimate', 'gistendscan', 'gistgettuple', 'gistinsert', 'gistmarkpos', 'gistrescan', 'gistrestrpos', 'globaldict256', 'globaldict64k', 'grant', 'group', 'gzip', 'hash_aclitem', 'hashbeginscan', 'hashbpchar', 'hashbuild', 'hashbulkdelete', 'hashchar', 'hashcostestimate', 'hashendscan', 'hashgettuple', 'hashinet', 'hashinsert', 'hashint2', 'hashint2vector', 'hashint4', 'hashint8', 'hashmacaddr', 'hashmarkpos', 'hashname', 'hashoid', 'hashoidvector', 'hashrescan', 'hashrestrpos', 'hashtext', 'hashvarlena', 'haversine_distance_km', 'haversine_distance_km2', 'having', 'height', 'hll_cardinality_16', 'hll_cardinality_32', 'host', 'hostmask', 'iclikejoinsel', 'iclikesel', 'icnlikejoinsel', 'icnlikesel', 'icregexeqjoinsel', 'icregexeqsel', 'icregexnejoinsel', 'icregexnesel', 'identity', 'ignore', 'ilike', 'in', 'inet', 'inet_client_addr', 'inet_client_port', 'inet_in', 'inet_out', 'inet_recv', 'inet_send', 'inet_server_addr', 'inet_server_port', 'initcap', 'initially', 'inner', 'int2', 'int24div', 'int24eq', 'int24ge', 'int24gt', 'int24le', 'int24lt', 'int24mi', 'int24mod', 'int24mul', 'int24ne', 'int24pl', 'int28div', 'int28eq', 'int28ge', 'int28gt', 'int28le', 'int28lt', 'int28mi', 'int28mul', 'int28ne', 'int28pl', 'int2_accum', 'int2_avg_accum', 'int2_mul_cash', 'int2_sum', 'int2abs', 'int2and', 'int2div', 'int2eq', 'int2ge', 'int2gt', 'int2in', 'int2larger', 'int2le', 'int2lt', 'int2mi', 'int2mod', 'int2mul', 'int2ne', 'int2not', 'int2or', 'int2out', 'int2pl', 'int2recv', 'int2send', 'int2shl', 'int2shr', 'int2smaller', 'int2um', 'int2up', 'int2vectoreq', 'int2vectorout', 'int2vectorrecv', 'int2vectorsend', 'int2xor', 'int4', 'int42div', 'int42eq', 'int42ge', 'int42gt', 'int42le', 'int42lt', 'int42mi', 'int42mod', 'int42mul', 'int42ne', 'int42pl', 'int48div', 'int48eq', 'int48ge', 'int48gt', 'int48le', 'int48lt', 'int48mi', 'int48mul', 'int48ne', 'int48pl', 'int4_accum', 'int4_avg_accum', 'int4_mul_cash', 'int4_sum', 'int4abs', 'int4and', 'int4div', 'int4eq', 'int4ge', 'int4gt', 'int4in', 'int4inc', 'int4larger', 'int4le', 'int4lt', 'int4mi', 'int4mod', 'int4mul', 'int4ne', 'int4not', 'int4or', 'int4out', 'int4pl', 'int4recv', 'int4send', 'int4shl', 'int4shr', 'int4smaller', 'int4um', 'int4up', 'int4xor', 'int8', 'int82div', 'int82eq', 'int82ge', 'int82gt', 'int82le', 'int82lt', 'int82mi', 'int82mul', 'int82ne', 'int82pl', 'int84div', 'int84eq', 'int84ge', 'int84gt', 'int84le', 'int84lt', 'int84mi', 'int84mul', 'int84ne', 'int84pl', 'int8_accum', 'int8_avg', 'int8_avg_accum', 'int8_pl_timestamp', 'int8_pl_timestamptz', 'int8_sum', 'int8abs', 'int8and', 'int8div', 'int8eq', 'int8ge', 'int8gt', 'int8in', 'int8inc', 'int8larger', 'int8le', 'int8lt', 'int8mi', 'int8mod', 'int8mul', 'int8ne', 'int8not', 'int8or', 'int8out', 'int8pl', 'int8recv', 'int8send', 'int8shl', 'int8shr', 'int8smaller', 'int8um', 'int8up', 'int8xor', 'integer_pl_date', 'inter_lb', 'inter_sb', 'inter_sl', 'internal_in', 'internal_out', 'intersect', 'interval', 'interval_accum', 'interval_avg', 'interval_cmp', 'interval_div', 'interval_eq', 'interval_ge', 'interval_gt', 'interval_hash', 'interval_in', 'interval_larger', 'interval_le', 'interval_lt', 'interval_mi', 'interval_mul', 'interval_ne', 'interval_out', 'interval_pl', 'interval_pl_date', 'interval_pl_time', 'interval_pl_timestamp', 'interval_pl_timestamptz', 'interval_pl_timetz', 'interval_recv', 'interval_send', 'interval_smaller', 'interval_um', 'intinterval', 'into', 'ip_aton', 'ip_masking', 'ip_ntoa', 'is', 'is_ssl_connection', 'is_valid_json', 'is_valid_json_array', 'isclosed', 'isnottrue', 'isnull', 'iso_to_alt', 'iso_to_koi8r', 'iso_to_mic', 'iso_to_win1251', 'isopen', 'isparallel', 'isperp', 'istrue', 'isvertical', 'join', 'json_array_length', 'json_extract_array_element_text', 'json_extract_path_text', 'koi8r_to_alt', 'koi8r_to_iso', 'koi8r_to_mic', 'koi8r_to_win1251', 'lag', 'language', 'language_handler_in', 'language_handler_out', 'last_day', 'last_value', 'latin1_to_mic', 'latin2_to_mic', 'latin2_to_win1250', 'latin3_to_mic', 'latin4_to_mic', 'lead', 'leading', 'left', 'len', 'length', 'like', 'like_escape', 'likejoinsel', 'likesel', 'limit', 'line', 'line_distance', 'line_eq', 'line_in', 'line_interpt', 'line_intersect', 'line_out', 'line_parallel', 'line_perp', 'line_recv', 'line_send', 'line_vertical', 'listagg', 'listaggdistinct', 'ln', 'lo_close', 'lo_creat', 'lo_export', 'lo_import', 'lo_lseek', 'lo_open', 'lo_tell', 'lo_unlink', 'localtime', 'localtimestamp', 'log', 'logistic', 'loread', 'lower', 'lpad', 'lseg', 'lseg_center', 'lseg_distance', 'lseg_eq', 'lseg_ge', 'lseg_gt', 'lseg_in', 'lseg_interpt', 'lseg_intersect', 'lseg_le', 'lseg_length', 'lseg_lt', 'lseg_ne', 'lseg_out', 'lseg_parallel', 'lseg_perp', 'lseg_recv', 'lseg_send', 'lseg_vertical', 'lun', 'luns', 'lzo', 'lzop', 'macaddr', 'macaddr_cmp', 'macaddr_eq', 'macaddr_ge', 'macaddr_gt', 'macaddr_in', 'macaddr_le', 'macaddr_lt', 'macaddr_ne', 'macaddr_out', 'macaddr_recv', 'macaddr_send', 'makeaclitem', 'masklen', 'max', 'md5', 'median', 'mic_to_alt', 'mic_to_ascii', 'mic_to_big5', 'mic_to_euc_cn', 'mic_to_euc_jp', 'mic_to_euc_kr', 'mic_to_euc_tw', 'mic_to_iso', 'mic_to_koi8r', 'mic_to_latin1', 'mic_to_latin2', 'mic_to_latin3', 'mic_to_latin4', 'mic_to_sjis', 'mic_to_win1250', 'mic_to_win1251', 'min', 'minus', 'mktinterval', 'mod', 'months_between', 'mos_score', 'mostly13', 'mostly32', 'mostly8', 'mul_d_interval', 'name', 'name_pattern_eq', 'name_pattern_ge', 'name_pattern_gt', 'name_pattern_le', 'name_pattern_lt', 'name_pattern_ne', 'nameeq', 'namege', 'namegt', 'nameiclike', 'nameicnlike', 'nameicregexeq', 'nameicregexne', 'namein', 'namele', 'namelike', 'namelt', 'namene', 'namenlike', 'nameout', 'namerecv', 'nameregexeq', 'nameregexne', 'namesend', 'natural', 'neqjoinsel', 'neqsel', 'netmask', 'network', 'network_cmp', 'network_eq', 'network_ge', 'network_gt', 'network_le', 'network_lt', 'network_ne', 'network_sub', 'network_subeq', 'network_sup', 'network_supeq', 'new', 'next_day', 'nextval', 'nlikejoinsel', 'nlikesel', 'node_num', 'nonnullvalue', 'not', 'notlike', 'notnull', 'now', 'npoints', 'nth_value', 'ntile', 'null', 'nulls', 'nullvalue', 'nvl2', 'octet_length', 'off', 'offline', 'offset', 'oid', 'oideq', 'oidge', 'oidgt', 'oidin', 'oidlarger', 'oidle', 'oidlt', 'oidne', 'oidout', 'oidrecv', 'oidsend', 'oidsmaller', 'oidvectoreq', 'oidvectorge', 'oidvectorgt', 'oidvectorle', 'oidvectorlt', 'oidvectorne', 'oidvectorout', 'oidvectorrecv', 'oidvectorsend', 'oidvectortypes', 'old', 'on', 'on_pb', 'on_pl', 'on_ppath', 'on_ps', 'on_sb', 'on_sl', 'only', 'opaque_in', 'opaque_out', 'open', 'or', 'order', 'outer', 'overlaps', 'parallel', 'partition', 'path', 'path_add', 'path_add_pt', 'path_center', 'path_contain_pt', 'path_distance', 'path_div_pt', 'path_in', 'path_inter', 'path_length', 'path_mul_pt', 'path_n_eq', 'path_n_ge', 'path_n_gt', 'path_n_le', 'path_n_lt', 'path_npoints', 'path_out', 'path_recv', 'path_send', 'path_sub_pt', 'pclose', 'percent', 'percent_rank', 'percentile_cont', 'percentile_disc', 'permissions', 'pg_backend_pid', 'pg_cancel_backend', 'pg_char_to_encoding', 'pg_client_encoding', 'pg_conversion_is_visible', 'pg_decode', 'pg_encoding_to_char', 'pg_get_cols', 'pg_get_constraintdef', 'pg_get_current_groups', 'pg_get_expr', 'pg_get_external_columns', 'pg_get_external_tables', 'pg_get_indexdef', 'pg_get_late_binding_view_cols', 'pg_get_ruledef', 'pg_get_userbyid', 'pg_get_viewdef', 'pg_last_copy_count', 'pg_last_copy_id', 'pg_last_query_id', 'pg_last_unload_count', 'pg_last_unload_id', 'pg_lock_status', 'pg_opclass_is_visible', 'pg_operator_is_visible', 'pg_postmaster_start_time', 'pg_show_all_settings', 'pg_sleep', 'pg_start_backup', 'pg_stat_get_backend_activity', 'pg_stat_get_backend_activity_start', 'pg_stat_get_backend_dbid', 'pg_stat_get_backend_idset', 'pg_stat_get_backend_pid', 'pg_stat_get_blocks_hit', 'pg_stat_get_db_blocks_hit', 'pg_stat_get_db_numbackends', 'pg_stat_get_db_xact_commit', 'pg_stat_get_db_xact_rollback', 'pg_stat_get_numscans', 'pg_stat_get_tuples_deleted', 'pg_stat_get_tuples_inserted', 'pg_stat_get_tuples_returned', 'pg_stat_get_tuples_updated', 'pg_stat_reset', 'pg_stop_backup', 'pg_table_is_visible', 'pg_tablespace_databases', 'pg_terminate_backend', 'pg_timezone_abbrevs', 'pg_timezone_names', 'pg_type_is_visible', 'pgdate_part', 'pi', 'placing', 'plpython_call_handler', 'plpython_compiler', 'point', 'point_above', 'point_add', 'point_below', 'point_distance', 'point_div', 'point_eq', 'point_in', 'point_mul', 'point_ne', 'point_out', 'point_recv', 'point_send', 'point_sub', 'point_vert', 'poly_center', 'poly_contain', 'poly_contain_pt', 'poly_contained', 'poly_distance', 'poly_in', 'poly_npoints', 'poly_out', 'poly_overlap', 'poly_recv', 'poly_same', 'poly_send', 'polygon', 'popen', 'position', 'positionjoinsel', 'positionsel', 'pow', 'power', 'primary', 'pt_contained_circle', 'pt_contained_poly', 'qsummary', 'quote_ident', 'quote_literal', 'radians', 'radius', 'random', 'rank', 'rankx', 'ratio_to_report', 'raw', 'readratio', 'record_in', 'record_out', 'record_recv', 'record_send', 'recover', 'references', 'regclassin', 'regclassout', 'regclassrecv', 'regclasssend', 'regexeqjoinsel', 'regexeqsel', 'regexnejoinsel', 'regexnesel', 'regexp_count', 'regexp_instr', 'regexp_replace', 'regexp_substr', 'regoperatorout', 'regoperatorrecv', 'regoperatorsend', 'regoperout', 'regoperrecv', 'regopersend', 'regprocedurein', 'regprocedureout', 'regprocedurerecv', 'regproceduresend', 'regprocin', 'regprocout', 'regprocrecv', 'regprocsend', 'regtypein', 'regtypeout', 'regtyperecv', 'regtypesend', 'rejectlog', 'reltime', 'reltimeeq', 'reltimege', 'reltimegt', 'reltimein', 'reltimele', 'reltimelt', 'reltimene', 'reltimeout', 'reltimerecv', 'reltimesend', 'relu', 'remaining_vacrows', 'repeat', 'replace', 'replicate', 'resort', 'respect', 'restore', 'return_approx_percentile', 'reverse', 'right', 'round', 'row_number', 'rownumber', 'rpad', 'rt_box_inter', 'rt_box_size', 'rt_box_union', 'rt_poly_inter', 'rt_poly_size', 'rt_poly_union', 'rtbeginscan', 'rtbuild', 'rtbulkdelete', 'rtcostestimate', 'rtendscan', 'rtgettuple', 'rtinsert', 'rtmarkpos', 'rtrescan', 'rtrestrpos', 'scalargtjoinsel', 'scalargtsel', 'scalarltjoinsel', 'scalarltsel', 'select', 'session_user', 'set_bit', 'set_byte', 'set_masklen', 'setval', 'sig_bucket_3g', 'sig_bucket_lte', 'sig_score_3g', 'sig_score_lte', 'sigmoid', 'sign', 'similar', 'similar_escape', 'sin', 'sjis_to_euc_jp', 'sjis_to_mic', 'slice_num', 'slope', 'smgreq', 'smgrne', 'smgrout', 'snapshot ', 'some', 'sort_avail_mem', 'sortbytes', 'split_part', 'sqrt', 'ssl_version', 'st_asbinary', 'st_asewkb', 'st_asewkt', 'st_astext', 'st_azimuth', 'st_contains', 'st_dimension', 'st_disjoint', 'st_distance', 'st_dwithin', 'st_equals', 'st_geometrytype', 'st_intersects', 'st_isclosed', 'st_iscollection', 'st_isempty', 'st_makeline', 'st_makepoint', 'st_makepolygon', 'st_npoints', 'st_numpoints', 'st_point', 'st_polygon', 'st_within', 'st_x', 'st_xmax', 'st_xmin', 'st_y', 'st_ymax', 'st_ymin', 'stddev', 'stddev_pop', 'strpos', 'strtol', 'substr', 'sum', 'sysdate', 'system', 'table', 'tablebytes', 'tag', 'tan', 'tdes', 'text', 'text255', 'text32k', 'text_ge', 'text_gt', 'text_larger', 'text_le', 'text_lt', 'text_pattern_eq', 'text_pattern_ge', 'text_pattern_gt', 'text_pattern_le', 'text_pattern_lt', 'text_pattern_ne', 'text_smaller', 'textcat', 'texteq', 'texticlike', 'texticnlike', 'texticregexeq', 'texticregexne', 'textin', 'textlen', 'textlike', 'textne', 'textnlike', 'textout', 'textrecv', 'textregexeq', 'textregexne', 'textsend', 'then', 'tideq', 'tidin', 'tidout', 'tidrecv', 'tidsend', 'time', 'time_cmp', 'time_eq', 'time_ge', 'time_gt', 'time_in', 'time_larger', 'time_le', 'time_lt', 'time_mi_interval', 'time_mi_time', 'time_ne', 'time_out', 'time_pl_interval', 'time_recv', 'time_send', 'time_smaller', 'timedate_pl', 'timemi', 'timenow', 'timepl', 'timestamp', 'timestamp_cmp', 'timestamp_cmp_date', 'timestamp_cmp_timestamptz', 'timestamp_eq', 'timestamp_eq_date', 'timestamp_eq_timestamptz', 'timestamp_ge', 'timestamp_ge_date', 'timestamp_ge_timestamptz', 'timestamp_gt', 'timestamp_gt_date', 'timestamp_gt_timestamptz', 'timestamp_in', 'timestamp_larger', 'timestamp_le', 'timestamp_le_date', 'timestamp_le_timestamptz', 'timestamp_lt', 'timestamp_lt_date', 'timestamp_lt_timestamptz', 'timestamp_mi', 'timestamp_mi_int8', 'timestamp_mi_interval', 'timestamp_ne', 'timestamp_ne_date', 'timestamp_ne_timestamptz', 'timestamp_out', 'timestamp_pl_int8', 'timestamp_pl_interval', 'timestamp_recv', 'timestamp_send', 'timestamp_smaller', 'timestamptz', 'timestamptz_cmp', 'timestamptz_cmp_date', 'timestamptz_cmp_timestamp', 'timestamptz_eq', 'timestamptz_eq_date', 'timestamptz_eq_timestamp', 'timestamptz_ge', 'timestamptz_ge_date', 'timestamptz_ge_timestamp', 'timestamptz_gt', 'timestamptz_gt_date', 'timestamptz_gt_timestamp', 'timestamptz_in', 'timestamptz_larger', 'timestamptz_le', 'timestamptz_le_date', 'timestamptz_le_timestamp', 'timestamptz_lt', 'timestamptz_lt_date', 'timestamptz_lt_timestamp', 'timestamptz_mi', 'timestamptz_mi_int8', 'timestamptz_mi_interval', 'timestamptz_ne', 'timestamptz_ne_date', 'timestamptz_ne_timestamp', 'timestamptz_out', 'timestamptz_pl_int8', 'timestamptz_pl_interval', 'timestamptz_recv', 'timestamptz_send', 'timestamptz_smaller', 'timetz', 'timetz_cmp', 'timetz_eq', 'timetz_ge', 'timetz_gt', 'timetz_hash', 'timetz_in', 'timetz_larger', 'timetz_le', 'timetz_lt', 'timetz_mi_interval', 'timetz_ne', 'timetz_out', 'timetz_pl_interval', 'timetz_recv', 'timetz_send', 'timetz_smaller', 'timetzdate_pl', 'timezone', 'tinterval', 'tintervalct', 'tintervalend', 'tintervaleq', 'tintervalge', 'tintervalgt', 'tintervalin', 'tintervalle', 'tintervalleneq', 'tintervallenge', 'tintervallengt', 'tintervallenle', 'tintervallenlt', 'tintervallenne', 'tintervallt', 'tintervalne', 'tintervalout', 'tintervalov', 'tintervalrecv', 'tintervalrel', 'tintervalsame', 'tintervalsend', 'tintervalstart', 'to', 'to_ascii', 'to_char', 'to_date', 'to_hex', 'to_number', 'to_timestamp', 'tobpchar', 'top', 'total_num_deleted_vacrows', 'total_num_deleted_vacrows_reclaimed', 'trailing', 'translate', 'true', 'trunc', 'truncatecolumns', 'union', 'unique', 'unknownin', 'unknownout', 'unknownrecv', 'unknownsend', 'upper', 'user', 'using', 'vacstate_endrow', 'vacstate_last_inserted_row', 'var_pop', 'varbit', 'varbit_in', 'varbit_out', 'varbit_recv', 'varbit_send', 'varbitcmp', 'varbiteq', 'varbitge', 'varbitgt', 'varbitle', 'varbitlt', 'varbitne', 'varchar', 'varcharout', 'varcharrecv', 'varcharsend', 'verbose', 'version', 'void_in', 'void_out', 'wallet', 'when', 'where', 'width', 'width_bucket', 'win1250_to_latin2', 'win1250_to_mic', 'win1250_to_utf', 'win1251_to_alt', 'win1251_to_iso', 'win1251_to_koi8r', 'win1251_to_mic', 'win1256_to_utf', 'win874_to_utf', 'with', 'without', 'xideq', 'xideqint4', 'xidin', 'xidout', 'xidrecv', 'xidsend'}
# 231A - Team # http://codeforces.com/problemset/problem/231/A n = int(input()) c = 0 for i in range(n): arr = [x for x in input().split() if int(x) == 1] if len(arr) >= 2: c += 1 print(c)
n = int(input()) c = 0 for i in range(n): arr = [x for x in input().split() if int(x) == 1] if len(arr) >= 2: c += 1 print(c)
description = 'XCCM' group = 'basic' includes = [ # 'source', # 'table', # 'detector', 'virtual_sample_motors', 'virtual_detector_motors', 'virtual_optic_motors', 'virtual_IOcard', 'optic_tool_switch', 'virtual_capillary_motors', 'capillary_selector' ]
description = 'XCCM' group = 'basic' includes = ['virtual_sample_motors', 'virtual_detector_motors', 'virtual_optic_motors', 'virtual_IOcard', 'optic_tool_switch', 'virtual_capillary_motors', 'capillary_selector']
def triplewise(it): try: a, b = next(it), next(it) except StopIteration: return for c in it: yield a, b, c a, b = b, c def inc_count(values): last = None count = 0 for v in values: if last is not None and v > last: count += 1 last = v return count def main(): nums = [int(line) for line in open("input.txt").readlines()] sums = [sum(triple) for triple in triplewise(iter(nums))] print(inc_count(nums)) # part 1 print(inc_count(sums)) # part 2 if __name__ == "__main__": main()
def triplewise(it): try: (a, b) = (next(it), next(it)) except StopIteration: return for c in it: yield (a, b, c) (a, b) = (b, c) def inc_count(values): last = None count = 0 for v in values: if last is not None and v > last: count += 1 last = v return count def main(): nums = [int(line) for line in open('input.txt').readlines()] sums = [sum(triple) for triple in triplewise(iter(nums))] print(inc_count(nums)) print(inc_count(sums)) if __name__ == '__main__': main()
definitions = { "StringArray": { "type": "array", "items": { "type": "string", } }, "AudioEncoding": { "type": "string", "enum": ["LINEAR16", "ALAW", "MULAW", "LINEAR32F", "RAW_OPUS", "MPEG_AUDIO"] }, "VoiceActivityDetectionConfig": { "type": "object", "properties": { "min_speech_duration": {"type": "number"}, "max_speech_duration": {"type": "number"}, "silence_duration_threshold": {"type": "number"}, "silence_prob_threshold": {"type": "number"}, "aggressiveness": {"type": "number"}, } }, "SpeechContext": { "type": "object", "properties": { "phrases": {"$ref": "#definitions/StringArray"}, "words": {"$ref": "#definitions/StringArray"} } }, "InterimResultsConfig": { "type": "object", "properties": { "enable_interim_results": {"type": "boolean"}, "interval": {"type": "number"} } } } recognition_config_schema = { "type": "object", "definitions": definitions, "properties": { "encoding": {"$ref": "#/definitions/AudioEncoding"}, "sample_rate_hertz": {"type": "number"}, "language_code": {"type": "string"}, "max_alternatives": {"type": "number"}, "speech_contexts": { "type": "array", "items": { "$ref": "#/definitions/SpeechContext" } }, "enable_automatic_punctuation": {"type": "boolean"}, "enable_denormalization": {"type": "boolean"}, "enable_rescoring": {"type": "boolean"}, "model": {"type": "string"}, "num_channels": {"type": "number"}, "do_not_perform_vad": {"type": "boolean"}, "vad_config": {"$ref": "#/definitions/VoiceActivityDetectionConfig"}, "profanity_filter": {"type": "boolean"} }, "required": [ "sample_rate_hertz", "num_channels", "encoding", ], "additionalProperties": False } streaming_recognition_config_schema = { "type": "object", "definitions": definitions, "properties": { "config": recognition_config_schema, "single_utterance": {"type": "boolean"}, "interim_results_config": {"$ref": "#/definitions/InterimResultsConfig"} }, "additionalProperties": False } long_running_recognition_config_schema = { "type": "object", "definitions": definitions, "properties": { "config": recognition_config_schema, "group": {"type": "string"} }, "additionalProperties": False }
definitions = {'StringArray': {'type': 'array', 'items': {'type': 'string'}}, 'AudioEncoding': {'type': 'string', 'enum': ['LINEAR16', 'ALAW', 'MULAW', 'LINEAR32F', 'RAW_OPUS', 'MPEG_AUDIO']}, 'VoiceActivityDetectionConfig': {'type': 'object', 'properties': {'min_speech_duration': {'type': 'number'}, 'max_speech_duration': {'type': 'number'}, 'silence_duration_threshold': {'type': 'number'}, 'silence_prob_threshold': {'type': 'number'}, 'aggressiveness': {'type': 'number'}}}, 'SpeechContext': {'type': 'object', 'properties': {'phrases': {'$ref': '#definitions/StringArray'}, 'words': {'$ref': '#definitions/StringArray'}}}, 'InterimResultsConfig': {'type': 'object', 'properties': {'enable_interim_results': {'type': 'boolean'}, 'interval': {'type': 'number'}}}} recognition_config_schema = {'type': 'object', 'definitions': definitions, 'properties': {'encoding': {'$ref': '#/definitions/AudioEncoding'}, 'sample_rate_hertz': {'type': 'number'}, 'language_code': {'type': 'string'}, 'max_alternatives': {'type': 'number'}, 'speech_contexts': {'type': 'array', 'items': {'$ref': '#/definitions/SpeechContext'}}, 'enable_automatic_punctuation': {'type': 'boolean'}, 'enable_denormalization': {'type': 'boolean'}, 'enable_rescoring': {'type': 'boolean'}, 'model': {'type': 'string'}, 'num_channels': {'type': 'number'}, 'do_not_perform_vad': {'type': 'boolean'}, 'vad_config': {'$ref': '#/definitions/VoiceActivityDetectionConfig'}, 'profanity_filter': {'type': 'boolean'}}, 'required': ['sample_rate_hertz', 'num_channels', 'encoding'], 'additionalProperties': False} streaming_recognition_config_schema = {'type': 'object', 'definitions': definitions, 'properties': {'config': recognition_config_schema, 'single_utterance': {'type': 'boolean'}, 'interim_results_config': {'$ref': '#/definitions/InterimResultsConfig'}}, 'additionalProperties': False} long_running_recognition_config_schema = {'type': 'object', 'definitions': definitions, 'properties': {'config': recognition_config_schema, 'group': {'type': 'string'}}, 'additionalProperties': False}
def isEscapePossible(self, blocked, source, target): blocked = set(map(tuple, blocked)) def dfs(x, y, target, seen): if ( not (0 <= x < 10 ** 6 and 0 <= y < 10 ** 6) or (x, y) in blocked or (x, y) in seen ): return False seen.add((x, y)) if len(seen) > 20000 or [x, y] == target: return True return ( dfs(x + 1, y, target, seen) or dfs(x - 1, y, target, seen) or dfs(x, y + 1, target, seen) or dfs(x, y - 1, target, seen) ) return dfs(source[0], source[1], target, set()) and dfs( target[0], target[1], source, set() )
def is_escape_possible(self, blocked, source, target): blocked = set(map(tuple, blocked)) def dfs(x, y, target, seen): if not (0 <= x < 10 ** 6 and 0 <= y < 10 ** 6) or (x, y) in blocked or (x, y) in seen: return False seen.add((x, y)) if len(seen) > 20000 or [x, y] == target: return True return dfs(x + 1, y, target, seen) or dfs(x - 1, y, target, seen) or dfs(x, y + 1, target, seen) or dfs(x, y - 1, target, seen) return dfs(source[0], source[1], target, set()) and dfs(target[0], target[1], source, set())
def compute(dna_string1: str, dna_string2: str) -> int: hamming_distance = 0 for index in range(0, len(dna_string1)): if dna_string1[index] is not dna_string2[index]: hamming_distance += 1 return hamming_distance
def compute(dna_string1: str, dna_string2: str) -> int: hamming_distance = 0 for index in range(0, len(dna_string1)): if dna_string1[index] is not dna_string2[index]: hamming_distance += 1 return hamming_distance
class Graph(): def __init__(self): self.numberOfNodes = 0 self.adjacentList = {} def __str__(self): return str(self.__dict__) def addVertex(self, node): self.adjacentList[node] = [] self.numberOfNodes += 1 def addEdge(self, nodeA, nodeB): self.adjacentList[nodeA].append(nodeB) self.adjacentList[nodeB].append(nodeA) def showConnections(self): for x in self.adjacentList: print(x, end='-->') for i in self.adjacentList[x]: print(i, end=' ') print() myGraph = Graph() myGraph.addVertex('0') myGraph.addVertex('1') myGraph.addVertex('2') myGraph.addVertex('3') myGraph.addEdge('1', '2') myGraph.addEdge('1', '3') myGraph.addEdge('2', '3') myGraph.addEdge('2', '0') print(myGraph) myGraph.showConnections()
class Graph: def __init__(self): self.numberOfNodes = 0 self.adjacentList = {} def __str__(self): return str(self.__dict__) def add_vertex(self, node): self.adjacentList[node] = [] self.numberOfNodes += 1 def add_edge(self, nodeA, nodeB): self.adjacentList[nodeA].append(nodeB) self.adjacentList[nodeB].append(nodeA) def show_connections(self): for x in self.adjacentList: print(x, end='-->') for i in self.adjacentList[x]: print(i, end=' ') print() my_graph = graph() myGraph.addVertex('0') myGraph.addVertex('1') myGraph.addVertex('2') myGraph.addVertex('3') myGraph.addEdge('1', '2') myGraph.addEdge('1', '3') myGraph.addEdge('2', '3') myGraph.addEdge('2', '0') print(myGraph) myGraph.showConnections()
message = "zulkepretest make simpletes cpplest" translate = '' i = len(message) - 1 while i >= 0: translate = translate + message[i] i = i - 1 print("enc message is :"+ translate) print("message :"+ message)
message = 'zulkepretest make simpletes cpplest' translate = '' i = len(message) - 1 while i >= 0: translate = translate + message[i] i = i - 1 print('enc message is :' + translate) print('message :' + message)
def whats_up_world(): print("What's up world?") if __name__ == "__main__": whats_up_world()
def whats_up_world(): print("What's up world?") if __name__ == '__main__': whats_up_world()
# -*- coding: utf-8 -*- featureInfo = dict() featureInfo['m21']=[ ['P22','Quality','Set to 0 if the key signature indicates that a recording is major, set to 1 if it indicates that it is minor and set to 0 if key signature is unknown. Music21 addition: if no key mode is found in the piece, analyze the piece to discover what mode it is most likely in.','1'], ['QL1','Unique Note Quarter Lengths','The number of unique note quarter lengths.','1'], ['QL2','Most Common Note Quarter Length','The value of the most common quarter length.','1'], ['QL3','Most Common Note Quarter Length Prevalence','Fraction of notes that have the most common quarter length.','1'], ['QL4','Range of Note Quarter Lengths','Difference between the longest and shortest quarter lengths.','1'], ['CS1','Unique Pitch Class Set Simultaneities','Number of unique pitch class simultaneities.','1'], ['CS2','Unique Set Class Simultaneities','Number of unique set class simultaneities.','1'], ['CS3','Most Common Pitch Class Set Simultaneity Prevalence','Fraction of all pitch class simultaneities that are the most common simultaneity.','1'], ['CS4','Most Common Set Class Simultaneity Prevalence','Fraction of all set class simultaneities that are the most common simultaneity.','1'], ['CS5','Major Triad Simultaneity Prevalence','Percentage of all simultaneities that are major triads.','1'], ['CS6','Minor Triad Simultaneity Prevalence','Percentage of all simultaneities that are minor triads.','1'], ['CS7','Dominant Seventh Simultaneity Prevalence','Percentage of all simultaneities that are dominant seventh.','1'], ['CS8','Diminished Triad Simultaneity Prevalence','Percentage of all simultaneities that are diminished triads.','1'], ['CS9','Triad Simultaneity Prevalence','Proportion of all simultaneities that form triads.','1'], ['CS10','Diminished Seventh Simultaneity Prevalence','Percentage of all simultaneities that are diminished seventh chords.','1'], ['CS11','Incorrectly Spelled Triad Prevalence','Percentage of all triads that are spelled incorrectly.','1'], ['MD1','Composer Popularity','Composer popularity today, as measured by the number of Google search results (log-10).','1'], ['MC1','Ends With Landini Melodic Contour','Boolean that indicates the presence of a Landini-like cadential figure in one or more parts.','1'], ['TX1','Language Feature','Languge of the lyrics of the piece given as a numeric value from text.LanguageDetector.mostLikelyLanguageNumeric().','1']] featureInfo['P']=[ ['P1','Most Common Pitch Prevalence','Fraction of Note Ons corresponding to the most common pitch.','1'], ['P2','Most Common Pitch Class Prevalence','Fraction of Note Ons corresponding to the most common pitch class.','1'], ['P3','Relative Strength of Top Pitches','The frequency of the 2nd most common pitch divided by the frequency of the most common pitch.','1'], ['P4','Relative Strength of Top Pitch Classes','The frequency of the 2nd most common pitch class divided by the frequency of the most common pitch class.','1'], ['P5','Interval Between Strongest Pitches','Absolute value of the difference between the pitches of the two most common MIDI pitches.','1'], ['P6','Interval Between Strongest Pitch Classes','Absolute value of the difference between the pitch classes of the two most common MIDI pitch classes.','1'], ['P7','Number of Common Pitches','Number of pitches that account individually for at least 9% of all notes.','1'], ['P8','Pitch Variety','Number of pitches used at least once.','1'], ['P9','Pitch Class Variety','Number of pitch classes used at least once.','1'], ['P10','Range','Difference between highest and lowest pitches.','1'], ['P11','Most Common Pitch','Bin label of the most common pitch divided by the number of possible pitches.','1'], ['P12','Primary Register','Average MIDI pitch.','1'], ['P13','Importance of Bass Register','Fraction of Note Ons between MIDI pitches 0 and 54.','1'], ['P14','Importance of Middle Register','Fraction of Note Ons between MIDI pitches 55 and 72.','1'], ['P15','Importance of High Register','Fraction of Note Ons between MIDI pitches 73 and 127.','1'], ['P16','Most Common Pitch Class','Bin label of the most common pitch class.','1'], ['P17','Dominant Spread','Largest number of consecutive pitch classes separated by perfect 5ths that accounted for at least 9% each of the notes.','1'], ['P18','Strong Tonal Centres','Number of peaks in the fifths pitch histogram that each account for at least 9% of all Note Ons.','1'], ['P19','Basic Pitch Histogram','A features array with bins corresponding to the values of the basic pitch histogram.','128'], ['P20','Pitch Class Distribution','A feature array with 12 entries where the first holds the frequency of the bin of the pitch class histogram with the highest frequency, and the following entries holding the successive bins of the histogram, wrapping around if necessary.','12'], ['P21','Fifths Pitch Histogram','A feature array with bins corresponding to the values of the 5ths pitch class histogram.','12'], ['P22','Quality','Set to 0 if the key signature indicates that a recording is major, set to 1 if it indicates that it is minor and set to 0 if key signature is unknown.','1'], ['P23','Glissando Prevalence','Number of Note Ons that have at least one MIDI Pitch Bend associated with them divided by total number of pitched Note Ons.','1'], ['P24','Average Range Of Glissandos','Average range of MIDI Pitch Bends, where "range" is defined as the greatest value of the absolute difference between 64 and the second data byte of all MIDI Pitch Bend messages falling between the Note On and Note Off messages of any note.','1'], ['P25','Vibrato Prevalence','Number of notes for which Pitch Bend messages change direction at least twice divided by total number of notes that have Pitch Bend messages associated with them.','1']] featureInfo['R']=[ ['R1','Strongest Rhythmic Pulse','Bin label of the beat bin with the highest frequency.','1'], ['R2','Second Strongest Rhythmic Pulse','Bin label of the beat bin of the peak with the second highest frequency.','1'], ['R3','Harmonicity of Two Strongest Rhythmic Pulses','The bin label of the higher (in terms of bin label) of the two beat bins of the peaks with the highest frequency divided by the bin label of the lower.','1'], ['R4','Strength of Strongest Rhythmic Pulse','Frequency of the beat bin with the highest frequency.','1'], ['R5','Strength of Second Strongest Rhythmic Pulse','Frequency of the beat bin of the peak with the second highest frequency.','1'], ['R6','Strength Ratio of Two Strongest Rhythmic Pulses','The frequency of the higher (in terms of frequency) of the two beat bins corresponding to the peaks with the highest frequency divided by the frequency of the lower.','1'], ['R7','Combined Strength of Two Strongest Rhythmic Pulses','The sum of the frequencies of the two beat bins of the peaks with the highest frequencies.','1'], ['R8','Number of Strong Pulses','Number of beat peaks with normalized frequencies over 0.1.','1'], ['R9','Number of Moderate Pulses','Number of beat peaks with normalized frequencies over 0.01.','1'], ['R10','Number of Relatively Strong Pulses','Number of beat peaks with frequencies at least 30% as high as the frequency of the bin with the highest frequency.','1'], ['R11','Rhythmic Looseness','Average width of beat histogram peaks (in beats per minute). Width is measured for all peaks with frequencies at least 30% as high as the highest peak, and is defined by the distance between the points on the peak in question that are 30% of the height of the peak.','1'], ['R12','Polyrhythms','Number of beat peaks with frequencies at least 30% of the highest frequency whose bin labels are not integer multiples or factors (using only multipliers of 1, 2, 3, 4, 6 and 8) (with an accepted error of +/- 3 bins) of the bin label of the peak with the highest frequency. This number is then divided by the total number of beat bins with frequencies over 30% of the highest frequency.','1'], ['R13','Rhythmic Variability','Standard deviation of the bin values (except the first 40 empty ones).','1'], ['R14','Beat Histogram','A feature array with entries corresponding to the frequency values of each of the bins of the beat histogram (except the first 40 empty ones).','161'], ['R15','Note Density','Average number of notes per second.','1'], ['R17','Average Note Duration','Average duration of notes in seconds.','1'], ['R18','Variability of Note Duration','Standard deviation of note durations in seconds.','1'], ['R19','Maximum Note Duration','Duration of the longest note (in seconds).','1'], ['R20','Minimum Note Duration','Duration of the shortest note (in seconds).','1'], ['R21','Staccato Incidence','Number of notes with durations of less than a 10th of a second divided by the total number of notes in the recording.','1'], ['R22','Average Time Between Attacks','Average time in seconds between Note On events (regardless of channel).','1'], ['R23','Variability of Time Between Attacks','Standard deviation of the times, in seconds, between Note On events (regardless of channel).','1'], ['R24','Average Time Between Attacks For Each Voice','Average of average times in seconds between Note On events on individual channels that contain at least one note.','1'], ['R25','Average Variability of Time Between Attacks For Each Voice','Average standard deviation, in seconds, of time between Note On events on individual channels that contain at least one note.','1'], ['R30','Initial Tempo','Tempo in beats per minute at the start of the recording.','1'], ['R31','Initial Time Signature','A feature array with two elements. The first is the numerator of the first occurring time signature and the second is the denominator of the first occurring time signature. Both are set to 0 if no time signature is present.','2'], ['R32','Compound Or Simple Meter','Set to 1 if the initial meter is compound (numerator of time signature is greater than or equal to 6 and is evenly divisible by 3) and to 0 if it is simple (if the above condition is not fulfilled).','1'], ['R33','Triple Meter','Set to 1 if numerator of initial time signature is 3, set to 0 otherwise.','1'], ['R34','Quintuple Meter','Set to 1 if numerator of initial time signature is 5, set to 0 otherwise.','1'], ['R35','Changes of Meter','Set to 1 if the time signature is changed one or more times during the recording','1']] featureInfo['M']=[ ['M1','Melodic Interval Histogram','A features array with bins corresponding to the values of the melodic interval histogram.','128'], ['M2','Average Melodic Interval','Average melodic interval (in semi-tones).','1'], ['M3','Most Common Melodic Interval','Melodic interval with the highest frequency.','1'], ['M4','Distance Between Most Common Melodic Intervals','Absolute value of the difference between the most common melodic interval and the second most common melodic interval.','1'], ['M5','Most Common Melodic Interval Prevalence','Fraction of melodic intervals that belong to the most common interval.','1'], ['M6','Relative Strength of Most Common Intervals','Fraction of melodic intervals that belong to the second most common interval divided by the fraction of melodic intervals belonging to the most common interval.','1'], ['M7','Number of Common Melodic Intervals','Number of melodic intervals that represent at least 9% of all melodic intervals.','1'], ['M8','Amount of Arpeggiation','Fraction of horizontal intervals that are repeated notes, minor thirds, major thirds, perfect fifths, minor sevenths, major sevenths, octaves, minor tenths or major tenths.','1'], ['M9','Repeated Notes','Fraction of notes that are repeated melodically.','1'], ['m10','Chromatic Motion','Fraction of melodic intervals corresponding to a semi-tone.','1'], ['M11','Stepwise Motion','Fraction of melodic intervals that corresponded to a minor or major second.','1'], ['M12','Melodic Thirds','Fraction of melodic intervals that are major or minor thirds.','1'], ['M13','Melodic Fifths','Fraction of melodic intervals that are perfect fifths.','1'], ['M14','Melodic Tritones','Fraction of melodic intervals that are tritones.','1'], ['M15','Melodic Octaves','Fraction of melodic intervals that are octaves.','1'], ['m17','Direction of Motion','Fraction of melodic intervals that are rising rather than falling.','1'], ['M18','Duration of Melodic Arcs','Average number of notes that separate melodic peaks and troughs in any channel.','1'], ['M19','Size of Melodic Arcs','Average melodic interval separating the top note of melodic peaks and the bottom note of melodic troughs.','1']] featureInfo['D']=[ ['D1','Overall Dynamic Range','The maximum loudness minus the minimum loudness value.','1'], ['D2','Variation of Dynamics','Standard deviation of loudness levels of all notes.','1'], ['D3','Variation of Dynamics In Each Voice','The average of the standard deviations of loudness levels within each channel that contains at least one note.','1'], ['D4','Average Note To Note Dynamics Change','Average change of loudness from one note to the next note in the same channel (in MIDI velocity units).','1']] featureInfo['T']=[ ['T1','Maximum Number of Independent Voices','Maximum number of different channels in which notes have sounded simultaneously. Here, Parts are treated as channels.','1'], ['T2','Average Number of Independent Voices','Average number of different channels in which notes have sounded simultaneously. Rests are not included in this calculation. Here, Parts are treated as voices','1'], ['T3','Variability of Number of Independent Voices','Standard deviation of number of different channels in which notes have sounded simultaneously. Rests are not included in this calculation.','1'], ['T4','Voice Equality - Number of Notes','Standard deviation of the total number of Note Ons in each channel that contains at least one note.','1'], ['T5','Voice Equality - Note Duration','Standard deviation of the total duration of notes in seconds in each channel that contains at least one note.','1'], ['T6','Voice Equality - Dynamics','Standard deviation of the average volume of notes in each channel that contains at least one note.','1'], ['T7','Voice Equality - Melodic Leaps','Standard deviation of the average melodic leap in MIDI pitches for each channel that contains at least one note.','1'], ['T8','Voice Equality - Range','Standard deviation of the differences between the highest and lowest pitches in each channel that contains at least one note.','1'], ['T9','Importance of Loudest Voice','Difference between the average loudness of the loudest channel and the average loudness of the other channels that contain at least one note.','1'], ['T10','Relative Range of Loudest Voice','Difference between the highest note and the lowest note played in the channel with the highest average loudness divided by the difference between the highest note and the lowest note overall in the piece.','1'], ['T12','Range of Highest Line','Difference between the highest note and the lowest note played in the channel with the highest average pitch divided by the difference between the highest note and the lowest note in the piece.','1'], ['T13','Relative Note Density of Highest Line','Number of Note Ons in the channel with the highest average pitch divided by the average number of Note Ons in all channels that contain at least one note.','1'], ['T15','Melodic Intervals in Lowest Line','Average melodic interval in semitones of the channel with the lowest average pitch divided by the average melodic interval of all channels that contain at least two notes.','1'], ['T20','Voice Separation','Average separation in semi-tones between the average pitches of consecutive channels (after sorting based/non average pitch) that contain at least one note.','1']]
feature_info = dict() featureInfo['m21'] = [['P22', 'Quality', 'Set to 0 if the key signature indicates that a recording is major, set to 1 if it indicates that it is minor and set to 0 if key signature is unknown. Music21 addition: if no key mode is found in the piece, analyze the piece to discover what mode it is most likely in.', '1'], ['QL1', 'Unique Note Quarter Lengths', 'The number of unique note quarter lengths.', '1'], ['QL2', 'Most Common Note Quarter Length', 'The value of the most common quarter length.', '1'], ['QL3', 'Most Common Note Quarter Length Prevalence', 'Fraction of notes that have the most common quarter length.', '1'], ['QL4', 'Range of Note Quarter Lengths', 'Difference between the longest and shortest quarter lengths.', '1'], ['CS1', 'Unique Pitch Class Set Simultaneities', 'Number of unique pitch class simultaneities.', '1'], ['CS2', 'Unique Set Class Simultaneities', 'Number of unique set class simultaneities.', '1'], ['CS3', 'Most Common Pitch Class Set Simultaneity Prevalence', 'Fraction of all pitch class simultaneities that are the most common simultaneity.', '1'], ['CS4', 'Most Common Set Class Simultaneity Prevalence', 'Fraction of all set class simultaneities that are the most common simultaneity.', '1'], ['CS5', 'Major Triad Simultaneity Prevalence', 'Percentage of all simultaneities that are major triads.', '1'], ['CS6', 'Minor Triad Simultaneity Prevalence', 'Percentage of all simultaneities that are minor triads.', '1'], ['CS7', 'Dominant Seventh Simultaneity Prevalence', 'Percentage of all simultaneities that are dominant seventh.', '1'], ['CS8', 'Diminished Triad Simultaneity Prevalence', 'Percentage of all simultaneities that are diminished triads.', '1'], ['CS9', 'Triad Simultaneity Prevalence', 'Proportion of all simultaneities that form triads.', '1'], ['CS10', 'Diminished Seventh Simultaneity Prevalence', 'Percentage of all simultaneities that are diminished seventh chords.', '1'], ['CS11', 'Incorrectly Spelled Triad Prevalence', 'Percentage of all triads that are spelled incorrectly.', '1'], ['MD1', 'Composer Popularity', 'Composer popularity today, as measured by the number of Google search results (log-10).', '1'], ['MC1', 'Ends With Landini Melodic Contour', 'Boolean that indicates the presence of a Landini-like cadential figure in one or more parts.', '1'], ['TX1', 'Language Feature', 'Languge of the lyrics of the piece given as a numeric value from text.LanguageDetector.mostLikelyLanguageNumeric().', '1']] featureInfo['P'] = [['P1', 'Most Common Pitch Prevalence', 'Fraction of Note Ons corresponding to the most common pitch.', '1'], ['P2', 'Most Common Pitch Class Prevalence', 'Fraction of Note Ons corresponding to the most common pitch class.', '1'], ['P3', 'Relative Strength of Top Pitches', 'The frequency of the 2nd most common pitch divided by the frequency of the most common pitch.', '1'], ['P4', 'Relative Strength of Top Pitch Classes', 'The frequency of the 2nd most common pitch class divided by the frequency of the most common pitch class.', '1'], ['P5', 'Interval Between Strongest Pitches', 'Absolute value of the difference between the pitches of the two most common MIDI pitches.', '1'], ['P6', 'Interval Between Strongest Pitch Classes', 'Absolute value of the difference between the pitch classes of the two most common MIDI pitch classes.', '1'], ['P7', 'Number of Common Pitches', 'Number of pitches that account individually for at least 9% of all notes.', '1'], ['P8', 'Pitch Variety', 'Number of pitches used at least once.', '1'], ['P9', 'Pitch Class Variety', 'Number of pitch classes used at least once.', '1'], ['P10', 'Range', 'Difference between highest and lowest pitches.', '1'], ['P11', 'Most Common Pitch', 'Bin label of the most common pitch divided by the number of possible pitches.', '1'], ['P12', 'Primary Register', 'Average MIDI pitch.', '1'], ['P13', 'Importance of Bass Register', 'Fraction of Note Ons between MIDI pitches 0 and 54.', '1'], ['P14', 'Importance of Middle Register', 'Fraction of Note Ons between MIDI pitches 55 and 72.', '1'], ['P15', 'Importance of High Register', 'Fraction of Note Ons between MIDI pitches 73 and 127.', '1'], ['P16', 'Most Common Pitch Class', 'Bin label of the most common pitch class.', '1'], ['P17', 'Dominant Spread', 'Largest number of consecutive pitch classes separated by perfect 5ths that accounted for at least 9% each of the notes.', '1'], ['P18', 'Strong Tonal Centres', 'Number of peaks in the fifths pitch histogram that each account for at least 9% of all Note Ons.', '1'], ['P19', 'Basic Pitch Histogram', 'A features array with bins corresponding to the values of the basic pitch histogram.', '128'], ['P20', 'Pitch Class Distribution', 'A feature array with 12 entries where the first holds the frequency of the bin of the pitch class histogram with the highest frequency, and the following entries holding the successive bins of the histogram, wrapping around if necessary.', '12'], ['P21', 'Fifths Pitch Histogram', 'A feature array with bins corresponding to the values of the 5ths pitch class histogram.', '12'], ['P22', 'Quality', 'Set to 0 if the key signature indicates that a recording is major, set to 1 if it indicates that it is minor and set to 0 if key signature is unknown.', '1'], ['P23', 'Glissando Prevalence', 'Number of Note Ons that have at least one MIDI Pitch Bend associated with them divided by total number of pitched Note Ons.', '1'], ['P24', 'Average Range Of Glissandos', 'Average range of MIDI Pitch Bends, where "range" is defined as the greatest value of the absolute difference between 64 and the second data byte of all MIDI Pitch Bend messages falling between the Note On and Note Off messages of any note.', '1'], ['P25', 'Vibrato Prevalence', 'Number of notes for which Pitch Bend messages change direction at least twice divided by total number of notes that have Pitch Bend messages associated with them.', '1']] featureInfo['R'] = [['R1', 'Strongest Rhythmic Pulse', 'Bin label of the beat bin with the highest frequency.', '1'], ['R2', 'Second Strongest Rhythmic Pulse', 'Bin label of the beat bin of the peak with the second highest frequency.', '1'], ['R3', 'Harmonicity of Two Strongest Rhythmic Pulses', 'The bin label of the higher (in terms of bin label) of the two beat bins of the peaks with the highest frequency divided by the bin label of the lower.', '1'], ['R4', 'Strength of Strongest Rhythmic Pulse', 'Frequency of the beat bin with the highest frequency.', '1'], ['R5', 'Strength of Second Strongest Rhythmic Pulse', 'Frequency of the beat bin of the peak with the second highest frequency.', '1'], ['R6', 'Strength Ratio of Two Strongest Rhythmic Pulses', 'The frequency of the higher (in terms of frequency) of the two beat bins corresponding to the peaks with the highest frequency divided by the frequency of the lower.', '1'], ['R7', 'Combined Strength of Two Strongest Rhythmic Pulses', 'The sum of the frequencies of the two beat bins of the peaks with the highest frequencies.', '1'], ['R8', 'Number of Strong Pulses', 'Number of beat peaks with normalized frequencies over 0.1.', '1'], ['R9', 'Number of Moderate Pulses', 'Number of beat peaks with normalized frequencies over 0.01.', '1'], ['R10', 'Number of Relatively Strong Pulses', 'Number of beat peaks with frequencies at least 30% as high as the frequency of the bin with the highest frequency.', '1'], ['R11', 'Rhythmic Looseness', 'Average width of beat histogram peaks (in beats per minute). Width is measured for all peaks with frequencies at least 30% as high as the highest peak, and is defined by the distance between the points on the peak in question that are 30% of the height of the peak.', '1'], ['R12', 'Polyrhythms', 'Number of beat peaks with frequencies at least 30% of the highest frequency whose bin labels are not integer multiples or factors (using only multipliers of 1, 2, 3, 4, 6 and 8) (with an accepted error of +/- 3 bins) of the bin label of the peak with the highest frequency. This number is then divided by the total number of beat bins with frequencies over 30% of the highest frequency.', '1'], ['R13', 'Rhythmic Variability', 'Standard deviation of the bin values (except the first 40 empty ones).', '1'], ['R14', 'Beat Histogram', 'A feature array with entries corresponding to the frequency values of each of the bins of the beat histogram (except the first 40 empty ones).', '161'], ['R15', 'Note Density', 'Average number of notes per second.', '1'], ['R17', 'Average Note Duration', 'Average duration of notes in seconds.', '1'], ['R18', 'Variability of Note Duration', 'Standard deviation of note durations in seconds.', '1'], ['R19', 'Maximum Note Duration', 'Duration of the longest note (in seconds).', '1'], ['R20', 'Minimum Note Duration', 'Duration of the shortest note (in seconds).', '1'], ['R21', 'Staccato Incidence', 'Number of notes with durations of less than a 10th of a second divided by the total number of notes in the recording.', '1'], ['R22', 'Average Time Between Attacks', 'Average time in seconds between Note On events (regardless of channel).', '1'], ['R23', 'Variability of Time Between Attacks', 'Standard deviation of the times, in seconds, between Note On events (regardless of channel).', '1'], ['R24', 'Average Time Between Attacks For Each Voice', 'Average of average times in seconds between Note On events on individual channels that contain at least one note.', '1'], ['R25', 'Average Variability of Time Between Attacks For Each Voice', 'Average standard deviation, in seconds, of time between Note On events on individual channels that contain at least one note.', '1'], ['R30', 'Initial Tempo', 'Tempo in beats per minute at the start of the recording.', '1'], ['R31', 'Initial Time Signature', 'A feature array with two elements. The first is the numerator of the first occurring time signature and the second is the denominator of the first occurring time signature. Both are set to 0 if no time signature is present.', '2'], ['R32', 'Compound Or Simple Meter', 'Set to 1 if the initial meter is compound (numerator of time signature is greater than or equal to 6 and is evenly divisible by 3) and to 0 if it is simple (if the above condition is not fulfilled).', '1'], ['R33', 'Triple Meter', 'Set to 1 if numerator of initial time signature is 3, set to 0 otherwise.', '1'], ['R34', 'Quintuple Meter', 'Set to 1 if numerator of initial time signature is 5, set to 0 otherwise.', '1'], ['R35', 'Changes of Meter', 'Set to 1 if the time signature is changed one or more times during the recording', '1']] featureInfo['M'] = [['M1', 'Melodic Interval Histogram', 'A features array with bins corresponding to the values of the melodic interval histogram.', '128'], ['M2', 'Average Melodic Interval', 'Average melodic interval (in semi-tones).', '1'], ['M3', 'Most Common Melodic Interval', 'Melodic interval with the highest frequency.', '1'], ['M4', 'Distance Between Most Common Melodic Intervals', 'Absolute value of the difference between the most common melodic interval and the second most common melodic interval.', '1'], ['M5', 'Most Common Melodic Interval Prevalence', 'Fraction of melodic intervals that belong to the most common interval.', '1'], ['M6', 'Relative Strength of Most Common Intervals', 'Fraction of melodic intervals that belong to the second most common interval divided by the fraction of melodic intervals belonging to the most common interval.', '1'], ['M7', 'Number of Common Melodic Intervals', 'Number of melodic intervals that represent at least 9% of all melodic intervals.', '1'], ['M8', 'Amount of Arpeggiation', 'Fraction of horizontal intervals that are repeated notes, minor thirds, major thirds, perfect fifths, minor sevenths, major sevenths, octaves, minor tenths or major tenths.', '1'], ['M9', 'Repeated Notes', 'Fraction of notes that are repeated melodically.', '1'], ['m10', 'Chromatic Motion', 'Fraction of melodic intervals corresponding to a semi-tone.', '1'], ['M11', 'Stepwise Motion', 'Fraction of melodic intervals that corresponded to a minor or major second.', '1'], ['M12', 'Melodic Thirds', 'Fraction of melodic intervals that are major or minor thirds.', '1'], ['M13', 'Melodic Fifths', 'Fraction of melodic intervals that are perfect fifths.', '1'], ['M14', 'Melodic Tritones', 'Fraction of melodic intervals that are tritones.', '1'], ['M15', 'Melodic Octaves', 'Fraction of melodic intervals that are octaves.', '1'], ['m17', 'Direction of Motion', 'Fraction of melodic intervals that are rising rather than falling.', '1'], ['M18', 'Duration of Melodic Arcs', 'Average number of notes that separate melodic peaks and troughs in any channel.', '1'], ['M19', 'Size of Melodic Arcs', 'Average melodic interval separating the top note of melodic peaks and the bottom note of melodic troughs.', '1']] featureInfo['D'] = [['D1', 'Overall Dynamic Range', 'The maximum loudness minus the minimum loudness value.', '1'], ['D2', 'Variation of Dynamics', 'Standard deviation of loudness levels of all notes.', '1'], ['D3', 'Variation of Dynamics In Each Voice', 'The average of the standard deviations of loudness levels within each channel that contains at least one note.', '1'], ['D4', 'Average Note To Note Dynamics Change', 'Average change of loudness from one note to the next note in the same channel (in MIDI velocity units).', '1']] featureInfo['T'] = [['T1', 'Maximum Number of Independent Voices', 'Maximum number of different channels in which notes have sounded simultaneously. Here, Parts are treated as channels.', '1'], ['T2', 'Average Number of Independent Voices', 'Average number of different channels in which notes have sounded simultaneously. Rests are not included in this calculation. Here, Parts are treated as voices', '1'], ['T3', 'Variability of Number of Independent Voices', 'Standard deviation of number of different channels in which notes have sounded simultaneously. Rests are not included in this calculation.', '1'], ['T4', 'Voice Equality - Number of Notes', 'Standard deviation of the total number of Note Ons in each channel that contains at least one note.', '1'], ['T5', 'Voice Equality - Note Duration', 'Standard deviation of the total duration of notes in seconds in each channel that contains at least one note.', '1'], ['T6', 'Voice Equality - Dynamics', 'Standard deviation of the average volume of notes in each channel that contains at least one note.', '1'], ['T7', 'Voice Equality - Melodic Leaps', 'Standard deviation of the average melodic leap in MIDI pitches for each channel that contains at least one note.', '1'], ['T8', 'Voice Equality - Range', 'Standard deviation of the differences between the highest and lowest pitches in each channel that contains at least one note.', '1'], ['T9', 'Importance of Loudest Voice', 'Difference between the average loudness of the loudest channel and the average loudness of the other channels that contain at least one note.', '1'], ['T10', 'Relative Range of Loudest Voice', 'Difference between the highest note and the lowest note played in the channel with the highest average loudness divided by the difference between the highest note and the lowest note overall in the piece.', '1'], ['T12', 'Range of Highest Line', 'Difference between the highest note and the lowest note played in the channel with the highest average pitch divided by the difference between the highest note and the lowest note in the piece.', '1'], ['T13', 'Relative Note Density of Highest Line', 'Number of Note Ons in the channel with the highest average pitch divided by the average number of Note Ons in all channels that contain at least one note.', '1'], ['T15', 'Melodic Intervals in Lowest Line', 'Average melodic interval in semitones of the channel with the lowest average pitch divided by the average melodic interval of all channels that contain at least two notes.', '1'], ['T20', 'Voice Separation', 'Average separation in semi-tones between the average pitches of consecutive channels (after sorting based/non average pitch) that contain at least one note.', '1']]
class Animal: def __init__(self, age, name): self.age = age # public attribute self.name = name # public attribute def saluda(self, saludo='Hola', receptor = 'nuevo amigo'): print(saludo + " " + receptor) @staticmethod def add(a, b): if isinstance(a, int) and isinstance(b, int): return a + b elif isinstance(a, str) and isinstance(b, str): return " ".join((a, b)) else: raise TypeError def mostrarNombre(self): print(self.nombre) def mostrarEdad(self): print(self.edad)
class Animal: def __init__(self, age, name): self.age = age self.name = name def saluda(self, saludo='Hola', receptor='nuevo amigo'): print(saludo + ' ' + receptor) @staticmethod def add(a, b): if isinstance(a, int) and isinstance(b, int): return a + b elif isinstance(a, str) and isinstance(b, str): return ' '.join((a, b)) else: raise TypeError def mostrar_nombre(self): print(self.nombre) def mostrar_edad(self): print(self.edad)
class Filenames: class models: base = './res/models/player/' player = base + 'bicycle.obj' base = './res/models/oponents/' player = base + 'bicycle.obj' class textures: base = './res/textures/' floor_tile = base + 'floor.png' wall_tile = base + 'rim_wall_a.png' sky = base + 'sky.png'
class Filenames: class Models: base = './res/models/player/' player = base + 'bicycle.obj' base = './res/models/oponents/' player = base + 'bicycle.obj' class Textures: base = './res/textures/' floor_tile = base + 'floor.png' wall_tile = base + 'rim_wall_a.png' sky = base + 'sky.png'
class Recursion: def PalindromeCheck(self, strVal, i, j): if i>j: return True return self.PalindromeCheck(strVal, i + 1, j - 1) if strVal[i] == strVal[j] else False strVal = "q2eeeq" obj = Recursion() print(obj.PalindromeCheck(strVal, 0, len(strVal)-1))
class Recursion: def palindrome_check(self, strVal, i, j): if i > j: return True return self.PalindromeCheck(strVal, i + 1, j - 1) if strVal[i] == strVal[j] else False str_val = 'q2eeeq' obj = recursion() print(obj.PalindromeCheck(strVal, 0, len(strVal) - 1))
# Identity vs. Equality # - is vs. == # - working with literals # - isinstance() a = 1 b = 1.0 c = "1" print(a == b) print(a is b) print(c == "1") print(c is "1") print(b == 1) print(b is 1) print(b == 1 and isinstance(b, int)) print(a == 1 and isinstance(a, int)) # d = 100000000000000000000000000000000 d = float(10) e = float(10) print(id(d)) print(id(e)) print(d == e) print(d is e) b = int(b) print(b) print(b == 1 and isinstance(b, int)) print(a) print(float(a)) print(str(a)) print(str(a) is c) print(str(a) == c)
a = 1 b = 1.0 c = '1' print(a == b) print(a is b) print(c == '1') print(c is '1') print(b == 1) print(b is 1) print(b == 1 and isinstance(b, int)) print(a == 1 and isinstance(a, int)) d = float(10) e = float(10) print(id(d)) print(id(e)) print(d == e) print(d is e) b = int(b) print(b) print(b == 1 and isinstance(b, int)) print(a) print(float(a)) print(str(a)) print(str(a) is c) print(str(a) == c)
age=input("How old ara you?") height=input("How tall are you?") weight=input("How much do you weigth?") print("So ,you're %r old , %r tall and %r heavy ." %(age,height,weight))
age = input('How old ara you?') height = input('How tall are you?') weight = input('How much do you weigth?') print("So ,you're %r old , %r tall and %r heavy ." % (age, height, weight))
def compute_bag_of_words(dataset,lang,domain_stopwords=[]): d = [] for index,row in dataset.iterrows(): text = row['title'] #texto do evento text2 = remove_stopwords(text, lang,domain_stopwords) text3 = stemming(text2, lang) d.append(text3) matrix = CountVectorizer(max_features=1000) X = matrix.fit_transform(d) count_vect_df = pd.DataFrame(X.todense(), columns=matrix.get_feature_names()) return count_vect_df bow = compute_bag_of_words(dataset,'portuguese') bow
def compute_bag_of_words(dataset, lang, domain_stopwords=[]): d = [] for (index, row) in dataset.iterrows(): text = row['title'] text2 = remove_stopwords(text, lang, domain_stopwords) text3 = stemming(text2, lang) d.append(text3) matrix = count_vectorizer(max_features=1000) x = matrix.fit_transform(d) count_vect_df = pd.DataFrame(X.todense(), columns=matrix.get_feature_names()) return count_vect_df bow = compute_bag_of_words(dataset, 'portuguese') bow
def generator(): try: yield except RuntimeError as e: print(e) yield 'hello after first yield' g = generator() next(g) result = g.throw(RuntimeError, 'Broken') assert result == 'hello after first yield'
def generator(): try: yield except RuntimeError as e: print(e) yield 'hello after first yield' g = generator() next(g) result = g.throw(RuntimeError, 'Broken') assert result == 'hello after first yield'
# Copyright 2019 Google LLC # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # https://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software # distributed under the License is distributed on an "AS IS" BASIS, # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. # See the License for the specific language governing permissions and # limitations under the License. # Inception v3 stem, 7 x 7 is replaced by a stack of 3 x 3 convolutions. x = layers.Conv2D(32, (3, 3), strides=(2, 2), padding='same')(input) x = layers.Conv2D(32, (3, 3), strides=(1, 1), padding='same')(x) x = layers.Conv2D(64, (3, 3), strides=(1, 1), padding='same')(x) # max pooling layer x = layers.MaxPooling2D((3, 3), strides=(2, 2), padding='same')(x) # bottleneck convolution x = layers.Conv2D(80, (1, 1), strides=(1, 1), padding='same')(x) # next convolution layer x = layers.Conv2D(192, (3, 3), strides=(1, 1), padding='same')(x) # strided convolution - feature map reduction x = layers.Conv2D(256, (3, 3), strides=(2, 2), padding='same')(x)
x = layers.Conv2D(32, (3, 3), strides=(2, 2), padding='same')(input) x = layers.Conv2D(32, (3, 3), strides=(1, 1), padding='same')(x) x = layers.Conv2D(64, (3, 3), strides=(1, 1), padding='same')(x) x = layers.MaxPooling2D((3, 3), strides=(2, 2), padding='same')(x) x = layers.Conv2D(80, (1, 1), strides=(1, 1), padding='same')(x) x = layers.Conv2D(192, (3, 3), strides=(1, 1), padding='same')(x) x = layers.Conv2D(256, (3, 3), strides=(2, 2), padding='same')(x)
favorite_fruits = ['apple', 'orange', 'pineapple'] if 'apple' in favorite_fruits: print("You really like apples!") if 'grapefruit' in favorite_fruits: print("You really like grapefruits!") else: print("Why don't you like grapefruits?") if 'orange' not in favorite_fruits: print("Why don't you like oranges?") if 'pineapple' in favorite_fruits: print("You really like pineapples!") if 'potato' in favorite_fruits: print("Do you really think potato is a fruit?")
favorite_fruits = ['apple', 'orange', 'pineapple'] if 'apple' in favorite_fruits: print('You really like apples!') if 'grapefruit' in favorite_fruits: print('You really like grapefruits!') else: print("Why don't you like grapefruits?") if 'orange' not in favorite_fruits: print("Why don't you like oranges?") if 'pineapple' in favorite_fruits: print('You really like pineapples!') if 'potato' in favorite_fruits: print('Do you really think potato is a fruit?')
expected_output = { "vrf": { "default": { "local_label": { 24: { "outgoing_label_or_vc": { "No Label": { "prefix_or_tunnel_id": { "10.23.120.0/24": { "outgoing_interface": { "GigabitEthernet2.120": { "next_hop": "10.12.120.2", "bytes_label_switched": 0, }, "GigabitEthernet3.120": { "next_hop": "10.13.120.3", "bytes_label_switched": 0, }, } } } } } }, 25: { "outgoing_label_or_vc": { "No Label": { "prefix_or_tunnel_id": { "10.23.120.0/24[V]": { "outgoing_interface": { "GigabitEthernet2.420": { "next_hop": "10.12.120.2", "bytes_label_switched": 0, }, "GigabitEthernet3.420": { "next_hop": "10.13.120.3", "bytes_label_switched": 0, }, } } } } } }, } } } }
expected_output = {'vrf': {'default': {'local_label': {24: {'outgoing_label_or_vc': {'No Label': {'prefix_or_tunnel_id': {'10.23.120.0/24': {'outgoing_interface': {'GigabitEthernet2.120': {'next_hop': '10.12.120.2', 'bytes_label_switched': 0}, 'GigabitEthernet3.120': {'next_hop': '10.13.120.3', 'bytes_label_switched': 0}}}}}}}, 25: {'outgoing_label_or_vc': {'No Label': {'prefix_or_tunnel_id': {'10.23.120.0/24[V]': {'outgoing_interface': {'GigabitEthernet2.420': {'next_hop': '10.12.120.2', 'bytes_label_switched': 0}, 'GigabitEthernet3.420': {'next_hop': '10.13.120.3', 'bytes_label_switched': 0}}}}}}}}}}}
#============================================================= # modules for HSPICE sim #============================================================= #============================================================= # varmap definition #------------------------------------------------------------- # This class is to make combinations of given variables # mostly used for testbench generation #------------------------------------------------------------- # Example: # varmap1=HSPICE_varmap.varmap(4) %%num of var=4 # varmap1.get_var('vdd',1.5,1.8,0.2) %%vdd=1.5:0.2:1.8 # varmap1.get_var('abc', ........ %%do this for 4 var # varmap1.cal_nbigcy() %%end of var input # varmap1.combinate %%returns variable comb 1 by 1 #============================================================= class varmap: def __init__(self): self.n_smlcycle=1 self.last=0 #self.smlcy=1 self.smlcy=0 self.vv=0 self.vf=1 self.nvar=0 def get_var(self,name,start,end,step): if self.nvar==0: self.map=[None] self.comblist=[None] self.flag=[None] else: self.map.append(None) self.comblist.append(None) self.flag.append(None) self.map[self.nvar]=list([name]) self.flag[self.nvar]=(name) self.comblist[self.nvar]=list([name]) self.nswp=int((end-start)//step+1) for i in range(1,self.nswp+1): self.map[self.nvar].append(start+step*(i-1)) self.nvar+=1 def add_val(self,flag,start,end,step): varidx=self.flag.index(flag) if start!=None: nval=int((end-start+step/10)//step+1) for i in range(1,nval+1): self.map[varidx].append(start+step*(i-1)) else: for i in range(1,step+1): self.map[varidx].append(end) def cal_nbigcy(self): self.bias=[1]*(len(self.map)) for j in range(1,len(self.map)+1): self.n_smlcycle=self.n_smlcycle*(len(self.map[j-1])-1) self.n_smlcycle=self.n_smlcycle*len(self.map) def increm(self,inc): #increment bias self.bias[inc]+=1 if self.bias[inc]>len(self.map[inc])-1: self.bias[inc]%len(self.map[inc])-1 def check_end(self,vf): #When this is called, it's already last stage of self.map[vf] self.bias[vf]=1 # if vf==0 and self.bias[0]==len(self.map[0])-1: # return 0 if self.bias[vf-1]==len(self.map[vf-1])-1: #if previous column is last element self.check_end(vf-1) else: self.bias[vf-1]+=1 return 1 def combinate(self): # print self.map[self.vv][self.bias[self.vv]] self.smlcy+=1 if self.vv==len(self.map)-1: #last variable for vprint in range(0,len(self.map)): #fill in the current pointer values self.comblist[vprint].append(self.map[vprint][self.bias[vprint]]) #print self.map[vprint][self.bias[vprint]] if self.bias[self.vv]==len(self.map[self.vv])-1: #last element if self.smlcy<self.n_smlcycle: self.check_end(self.vv) self.vv=(self.vv+1)%len(self.map) self.combinate() else: pass else: self.bias[self.vv]+=1 self.vv=(self.vv+1)%len(self.map) self.combinate() else: self.vv=(self.vv+1)%len(self.map) self.combinate() def find_comb(self,targetComb): #function that returns the index of certain combination if len(self.comblist)!=len(targetComb): print('the length of the list doesnt match') else: for i in range(1,len(self.comblist[0])): match=1 for j in range(len(self.comblist)): match=match*(self.comblist[j][i]==targetComb[j]) if match==1: return i #============================================================= # netmap #------------------------------------------------------------- # This class is used for replacing lines # detects @@ for line and @ for nets #------------------------------------------------------------- # Example: # netmap1.get_net('ab','NN',1,4,1) %flag MUST be 2 char # netmap2.get_net('bc','DD',2,5,1) %length of var must match # netmap2.get_net('bc','DD',None,5,9) repeat DD5 x9 # netmap2.get_net('bc','DD',None,None,None) write only DD # netmap2.get_net('bc','DD',None,5,None) write only DD for 5 times # !!caution: do get_var in order, except for lateral prints # which is using @W => varibales here, do get_var at last # for line in r_file.readlines(): # netmap1.printline(line,w_file) # printline string added #============================================================= class netmap: def __init__(self): self.nn=0 self.pvar=1 self.cnta=0 self.line_nvar=0 # index of last variable for this line self.nxtl_var=0 # index of variable of next line self.ci_at=-5 self.ci_and=-50 #try has been added to reduce unnecessary "add_val" usage: but it might produce a problem when the user didn't know this(thought that every get_net kicks old value out) def get_net(self,flag,netname,start,end,step): #if start==None: want to repeat without incrementation(usually for tab) (end)x(step) is the num of repetition try: #incase it's already in the netmap => same as add_val varidx=self.flag.index(flag) if start!=None: try: nval=abs(int((end-start+step/10)//step+1)) for i in range(1,nval+1): self.map[varidx].append(start+step*(i-1)) except: self.map[varidx].append(start) else: for i in range(1,step+1): self.map[varidx].append(end) except: #registering new net if self.nn==0: self.map=[None] self.flag=[None] self.name=[None] self.nnet=[None] self.stringOnly=[None] else: self.map.append(None) self.name.append(None) self.flag.append(None) self.nnet.append(None) self.stringOnly.append(None) if netname==None: self.name[self.nn]=0 else: self.name[self.nn]=1 self.map[self.nn]=list([netname]) self.flag[self.nn]=(flag) if start!=None and start!='d2o' and start!='d2oi': #normal n1 n2 n3 ... try: self.nnet[self.nn]=int((end-start+step/10)//step+1) for i in range(1,self.nnet[self.nn]+1): self.map[self.nn].append(start+step*(i-1)) except: self.map[self.nn].append(start) elif start=='d2o': #decimal to binary for i in range(0,end): if step-i>0: self.map[self.nn].append(1) else: self.map[self.nn].append(0) i+=1 elif start=='d2oi': #decimal to thermal inversed for i in range(0,end): if step-i>0: self.map[self.nn].append(0) else: self.map[self.nn].append(1) i+=1 elif start==None and end==None and step==None: #write only string self.stringOnly[self.nn]=1 self.map[self.nn].append(netname) #this is just to make len(self.map[])=2 to make it operate elif self.name[self.nn]!=None and start==None and end!=None and step==None: #repeatedely printing string (write name x end) for i in range(1,end+1): self.map[self.nn].append(netname) else: # start==None : repeat 'end' for 'step' times for i in range(1,step+1): self.map[self.nn].append(end) # self.map[self.nn]=[None]*step # for i in range(1,self.nnet[self.nn]+1): # self.map[self.nn][i]=None self.nn+=1 #print self.map def add_val(self,flag,netname,start,end,step): varidx=self.flag.index(flag) if start!=None: nval=int((end-start+step/10)//step+1) for i in range(1,nval+1): self.map[varidx].append(start+step*(i-1)) else: for i in range(1,step+1): self.map[varidx].append(end) def printline(self,line,wrfile): if line[0:2]=='@@': #print('self.ci_at=%d'%(self.ci_at)) self.nline=line[3:len(line)] self.clist=list(self.nline) #character list for iv in range (1,len(self.map[self.nxtl_var])): for ci in range(0,len(self.clist)): if (ci==self.ci_at+1 or ci==self.ci_at+2) and ci!=len(self.clist)-1: pass elif self.clist[ci]=='@': try: varidx=self.flag.index(self.clist[ci+1]+self.clist[ci+2]) #print self.cnta self.cnta+=1 self.line_nvar+=1 if self.stringOnly[varidx]==1: wrfile.write(self.map[varidx][0]) self.ci_at=ci else: #print ('flag=') #print (self.clist[ci+1]+self.clist[ci+2]) #print (self.map[varidx]) #print (self.pvar) if self.name[varidx]: wrfile.write(self.map[varidx][0]) if type(self.map[varidx][self.pvar])==str: wrfile.write('%s'%(self.map[varidx][self.pvar])) #modify here!!!! if type(self.map[varidx][self.pvar])==float: wrfile.write('%e'%(self.map[varidx][self.pvar])) #modify here!!!! #wrfile.write('%.2f'%(self.map[varidx][self.pvar])) #modify here!!!! elif type(self.map[varidx][self.pvar])==int: wrfile.write('%d'%(self.map[varidx][self.pvar])) #elif type(self.map[varidx][self.pvar])==str: # wrfile.write('%s'%(self.map[varidx][self.pvar])) self.ci_at=ci except: print("%s not in netmap!"%(self.clist[ci+1]+self.clist[ci+2])) wrfile.write(self.clist[ci]) elif ci==len(self.clist)-1: #end of the line if self.pvar==len(self.map[self.nxtl_var+self.line_nvar-1])-1: #last element self.pvar=1 self.nxtl_var=self.nxtl_var+self.line_nvar self.line_nvar=0 self.cnta=0 self.ci_at=-6 #print('printed all var for this line, %d'%(ci)) else: self.pvar+=1 self.line_nvar=self.cnta self.line_nvar=0 #print ('line_nvar= %d'%(self.line_nvar)) self.cnta=0 wrfile.write(self.clist[ci]) else: wrfile.write(self.clist[ci]) elif line[0:2]=='@W': #lateral writing #print('found word line') self.nline=line[3:len(line)] self.clist=list(self.nline) for ci in range(0,len(self.clist)): if (ci==self.ci_at+1 or ci==self.ci_at+2): pass elif self.clist[ci]=='@': varidx=self.flag.index(self.clist[ci+1]+self.clist[ci+2]) for iv in range(1,len(self.map[varidx])): if self.name[varidx]: wrfile.write(self.map[varidx][0]) if type(self.map[varidx][iv])==int: wrfile.write('%d '%(self.map[varidx][iv])) #this is added for edit pin elif type(self.map[varidx][iv])==float: wrfile.write('%.1f '%(self.map[varidx][iv])) self.ci_at=ci else: wrfile.write(self.clist[ci]) self.ci_at=-5 elif line[0:2]=='@E': #lateral writing for edit pin #print('found word line') self.nline=line[3:len(line)] self.clist=list(self.nline) for ci in range(0,len(self.clist)): if (ci==self.ci_at+1 or ci==self.ci_at+2): pass elif self.clist[ci]=='@': varidx=self.flag.index(self.clist[ci+1]+self.clist[ci+2]) for iv in range(1,len(self.map[varidx])): if self.name[varidx]: wrfile.write(self.map[varidx][0]) if type(self.map[varidx][iv])==int: wrfile.write('%d] '%(self.map[varidx][iv])) #this is added for edit pin elif type(self.map[varidx][iv])==float: wrfile.write('%.1f '%(self.map[varidx][iv])) self.ci_at=ci else: wrfile.write(self.clist[ci]) self.ci_at=-5 elif line[0:2]=='@C': # cross lateral writing #print('found word line') self.nline=line[3:len(line)] self.clist=list(self.nline) for ci in range(0,len(self.clist)): if (ci==self.ci_at+1 or ci==self.ci_at+2 or ci==self.ci_and+1 or ci==self.ci_and+2 or ci==self.ci_and+3 or ci==self.ci_and+4): pass elif self.clist[ci]=='@': varidx=self.flag.index(self.clist[ci+1]+self.clist[ci+2]) for iv in range(1,len(self.map[varidx])): if self.name[varidx]: wrfile.write(self.map[varidx][0]) if type(self.map[varidx][iv])==int: wrfile.write('%d '%(self.map[varidx][iv])) #this is added for edit pin elif type(self.map[varidx][iv])==float: wrfile.write('%.1f '%(self.map[varidx][iv])) self.ci_at=ci elif self.clist[ci]=='&': varidx1=self.flag.index(self.clist[ci+1]+self.clist[ci+2]) varidx2=self.flag.index(self.clist[ci+3]+self.clist[ci+4]) for iv in range(1,len(self.map[varidx1])): if type(self.map[varidx1][iv])==int: wrfile.write('%d '%(self.map[varidx1][iv])) #this is added for edit pin elif type(self.map[varidx1][iv])==float: wrfile.write('%e '%(self.map[varidx1][iv])) if type(self.map[varidx2][iv])==int: wrfile.write('%d '%(self.map[varidx2][iv])) #this is added for edit pin elif type(self.map[varidx2][iv])==float: wrfile.write('%e '%(self.map[varidx2][iv])) self.ci_and=ci else: wrfile.write(self.clist[ci]) self.ci_at=-5 elif line[0:2]=='@S': self.nline=line[3:len(line)] self.clist=list(self.nline) for ci in range(0,len(self.clist)): if (ci==self.ci_at+1 or ci==self.ci_at+2): pass elif self.clist[ci]=='@': varidx=self.flag.index(self.clist[ci+1]+self.clist[ci+2]) wrfile.write(self.map[varidx][0]) self.ci_at=ci else: wrfile.write(self.clist[ci]) self.ci_at=-5 else: wrfile.write(line) #============================================================= # resmap #------------------------------------------------------------- # This class is used to deal with results # detects @@ for line and @ for nets #------------------------------------------------------------- # EXAMPLE: # netmap1=netmap(2) %input num_var # netmap1.get_var('ab','NN',1,4,1) %flag MUST be 2 char # netmap2.get_var('bc','DD',2,5,1) %length of var must match # for line in r_file.readlines(): # netmap1.printline(line,w_file) # self.tb[x][y][env[]] #============================================================= class resmap: def __init__(self,num_tb,num_words,index): #num_words includes index self.tb=[None]*num_tb self.tbi=[None]*num_tb self.vl=[None]*num_tb self.vlinit=[None]*num_tb self.svar=[None]*num_tb self.index=index self.nenv=0 self.num_words=num_words self.vr=[None]*(num_words+index) #one set of variables per plot self.vidx=[None]*(num_words+index) self.env=[None]*(num_words+index) # self.vl=[None]*(num_words+index) #one set of variables per plot for itb in range(0,len(self.tb)): # self.tb[itb].vr=[None]*(num_words+index) self.tbi[itb]=0 #index for counting vars within tb self.vl[itb]=[None]*(num_words+index) self.vlinit[itb]=[0]*(num_words+index) def get_var(self,ntb,var): self.vr[self.tbi[ntb]]=(var) # variable # self.vl[ntb][self.tbi[ntb]]=list([None]) self.tbi[ntb]+=1 if self.tbi[ntb]==len(self.vr): #???????? self.tbi[ntb]=0 def add(self,ntb,value): if self.vlinit[ntb][self.tbi[ntb]]==0: #initialization self.vl[ntb][self.tbi[ntb]]=[value] # value self.vlinit[ntb][self.tbi[ntb]]+=1 else: self.vl[ntb][self.tbi[ntb]].append(value) # value self.tbi[ntb]=(self.tbi[ntb]+1)%len(self.vr) def plot_env(self,ntb,start,step,xvar,xval): #setting plot environment: if ntb=='all': x axis is in terms of testbench if ntb=='all': self.nenv+=1 self.xaxis=[None]*len(self.tb) for i in range(0,len(self.tb)): self.xaxis[i]=start+i*step self.vidx[self.nenv]=self.vr.index(xvar) #print self.vl[0][self.vidx[self.nenv]] self.env[self.nenv]=[i for (i,x) in enumerate(self.vl[0][self.vidx[self.nenv]]) if x=='%s'%(xval)] else: self.nenv+=1 self.xaxis=[None] #one output self.xaxis=[start] self.vidx[self.nenv]=self.vr.index(xvar) self.env[self.nenv]=[i for (i,x) in enumerate(self.vl[0][self.vidx[self.nenv]]) if x=='%s'%(xval)] def rst_env(self): self.vidx[self.nenv]=None self.env[self.nenv]=0 self.nenv=0 #print self.vl[0][self.vidx[self.nenv]] def plot_y(self,yvar): self.yidx=self.vr.index(yvar) #print ('yidx=%d'%(self.yidx)) #print self.vl[0][self.yidx][self.env[self.nenv][0]] self.yaxis=[None]*len(self.xaxis) for xx in range(0,len(self.xaxis)): self.yaxis[xx]=self.vl[xx][self.yidx][self.env[self.nenv][0]] #plt.plot(self.xaxis,self.yaxis) #plt.ylabel(self.vr[self.yidx]) def sort(self,var): varidx=self.vr.index(var) for k in range(len(self.vl)): #all testbenches self.svar[k]={} #define dict for i in range(len(self.vl[0][0])): #all values self.svar[k][self.vl[k][varidx][i]]=[] for j in range(len(self.vr)): #all variables if j!=varidx: self.svar[k][self.vl[k][varidx][i]].append(self.vl[k][j][i]) #============================================================= # sort #------------------------------------------------------------- # This function sorts 2D-list according to given index value # outputs the sorted 2D-list #------------------------------------------------------------- # EXAMPLE: #============================================================= def sort_via(list_ind,list_vic,index,i): index=int(index) i=int(i) if len(list_ind)!=len(list_vic): print('lengths of two lists dont match') else: #print('%d th'%(i)) t_ind=0 t_vic=0 if i<len(list_ind)-1 and i>=0: if list_ind[i][index]>list_ind[i+1][index]: #print list_ind #print list_vic #print('switch %d from %d and %d'%(i,len(list_ind),len(list_vic))) t_ind=list_ind[i] t_vic=list_vic[i] list_ind[i]=list_ind[i+1] list_vic[i]=list_vic[i+1] list_ind[i+1]=t_ind list_vic[i+1]=t_vic i=i-1 sort_via(list_ind,list_vic,index,i) else: #print('pass %d'%(i)) i+=1 sort_via(list_ind,list_vic,index,i) elif i<0: i+=1 sort_via(list_ind,list_vic,index,i) elif i==len(list_ind)-1: #print('came to last') #print list_ind #print list_vic return list_ind, list_vic #============================================================= # sort 1D #------------------------------------------------------------- # This function sorts 1D-list according to given index value # outputs the sorted 1D-list #------------------------------------------------------------- # EXAMPLE: # a=[3,2,1], b=[1,2,3] # a,b=sort_via_1d(a,b,0) # print a => [1,2,3] # print b => [3,2,1] #============================================================= def sort_via_1d(list_ind,list_vic,i): i=int(i) if len(list_ind)!=len(list_vic): print('lengths of two lists dont match') else: #print('%d th'%(i)) t_ind=0 t_vic=0 if i<len(list_ind)-1 and i>=0: if list_ind[i]>list_ind[i+1]: #print list_ind #print list_vic #print('switch %d from %d and %d'%(i,len(list_ind),len(list_vic))) t_ind=list_ind[i] t_vic=list_vic[i] list_ind[i]=list_ind[i+1] list_vic[i]=list_vic[i+1] list_ind[i+1]=t_ind list_vic[i+1]=t_vic i=i-1 sort_via_1d(list_ind,list_vic,i) else: #print('pass %d'%(i)) i+=1 sort_via_1d(list_ind,list_vic,i) elif i<0: i+=1 sort_via_1d(list_ind,list_vic,i) elif i==len(list_ind)-1: #print('came to last') #print list_ind #print list_vic return list_ind, list_vic def sort_via_1d_mult(list_ind,*list_vics): i=int(0) for list_vic in list_vics: list_ind_temp=list(list_ind) sort_via_1d(list_ind_temp,list_vic,0) sort_via_1d(list_ind,list_ind,0) #============================================================= # mM #------------------------------------------------------------- # This function picks min, Max, of 1-D list # outputs min, Max, step #------------------------------------------------------------- # EXAMPLE: #============================================================= def mM(inp_list): min_item=0 max_item=0 step_item=0 reg_item=0 err_step=0 cnt=0 for item in inp_list: if cnt==0: min_item=item max_item=item else: if min_item>item: min_item=item if max_item<item: max_item=item #if cnt>1 and step_item!=abs(item-reg_item): # print('step is not uniform') # err_step=1 # print reg_item-item #else: # step_item=abs(item-reg_item) reg_item=item cnt+=1 if err_step==0: return min_item,max_item # else: # print('step error')
class Varmap: def __init__(self): self.n_smlcycle = 1 self.last = 0 self.smlcy = 0 self.vv = 0 self.vf = 1 self.nvar = 0 def get_var(self, name, start, end, step): if self.nvar == 0: self.map = [None] self.comblist = [None] self.flag = [None] else: self.map.append(None) self.comblist.append(None) self.flag.append(None) self.map[self.nvar] = list([name]) self.flag[self.nvar] = name self.comblist[self.nvar] = list([name]) self.nswp = int((end - start) // step + 1) for i in range(1, self.nswp + 1): self.map[self.nvar].append(start + step * (i - 1)) self.nvar += 1 def add_val(self, flag, start, end, step): varidx = self.flag.index(flag) if start != None: nval = int((end - start + step / 10) // step + 1) for i in range(1, nval + 1): self.map[varidx].append(start + step * (i - 1)) else: for i in range(1, step + 1): self.map[varidx].append(end) def cal_nbigcy(self): self.bias = [1] * len(self.map) for j in range(1, len(self.map) + 1): self.n_smlcycle = self.n_smlcycle * (len(self.map[j - 1]) - 1) self.n_smlcycle = self.n_smlcycle * len(self.map) def increm(self, inc): self.bias[inc] += 1 if self.bias[inc] > len(self.map[inc]) - 1: self.bias[inc] % len(self.map[inc]) - 1 def check_end(self, vf): self.bias[vf] = 1 if self.bias[vf - 1] == len(self.map[vf - 1]) - 1: self.check_end(vf - 1) else: self.bias[vf - 1] += 1 return 1 def combinate(self): self.smlcy += 1 if self.vv == len(self.map) - 1: for vprint in range(0, len(self.map)): self.comblist[vprint].append(self.map[vprint][self.bias[vprint]]) if self.bias[self.vv] == len(self.map[self.vv]) - 1: if self.smlcy < self.n_smlcycle: self.check_end(self.vv) self.vv = (self.vv + 1) % len(self.map) self.combinate() else: pass else: self.bias[self.vv] += 1 self.vv = (self.vv + 1) % len(self.map) self.combinate() else: self.vv = (self.vv + 1) % len(self.map) self.combinate() def find_comb(self, targetComb): if len(self.comblist) != len(targetComb): print('the length of the list doesnt match') else: for i in range(1, len(self.comblist[0])): match = 1 for j in range(len(self.comblist)): match = match * (self.comblist[j][i] == targetComb[j]) if match == 1: return i class Netmap: def __init__(self): self.nn = 0 self.pvar = 1 self.cnta = 0 self.line_nvar = 0 self.nxtl_var = 0 self.ci_at = -5 self.ci_and = -50 def get_net(self, flag, netname, start, end, step): try: varidx = self.flag.index(flag) if start != None: try: nval = abs(int((end - start + step / 10) // step + 1)) for i in range(1, nval + 1): self.map[varidx].append(start + step * (i - 1)) except: self.map[varidx].append(start) else: for i in range(1, step + 1): self.map[varidx].append(end) except: if self.nn == 0: self.map = [None] self.flag = [None] self.name = [None] self.nnet = [None] self.stringOnly = [None] else: self.map.append(None) self.name.append(None) self.flag.append(None) self.nnet.append(None) self.stringOnly.append(None) if netname == None: self.name[self.nn] = 0 else: self.name[self.nn] = 1 self.map[self.nn] = list([netname]) self.flag[self.nn] = flag if start != None and start != 'd2o' and (start != 'd2oi'): try: self.nnet[self.nn] = int((end - start + step / 10) // step + 1) for i in range(1, self.nnet[self.nn] + 1): self.map[self.nn].append(start + step * (i - 1)) except: self.map[self.nn].append(start) elif start == 'd2o': for i in range(0, end): if step - i > 0: self.map[self.nn].append(1) else: self.map[self.nn].append(0) i += 1 elif start == 'd2oi': for i in range(0, end): if step - i > 0: self.map[self.nn].append(0) else: self.map[self.nn].append(1) i += 1 elif start == None and end == None and (step == None): self.stringOnly[self.nn] = 1 self.map[self.nn].append(netname) elif self.name[self.nn] != None and start == None and (end != None) and (step == None): for i in range(1, end + 1): self.map[self.nn].append(netname) else: for i in range(1, step + 1): self.map[self.nn].append(end) self.nn += 1 def add_val(self, flag, netname, start, end, step): varidx = self.flag.index(flag) if start != None: nval = int((end - start + step / 10) // step + 1) for i in range(1, nval + 1): self.map[varidx].append(start + step * (i - 1)) else: for i in range(1, step + 1): self.map[varidx].append(end) def printline(self, line, wrfile): if line[0:2] == '@@': self.nline = line[3:len(line)] self.clist = list(self.nline) for iv in range(1, len(self.map[self.nxtl_var])): for ci in range(0, len(self.clist)): if (ci == self.ci_at + 1 or ci == self.ci_at + 2) and ci != len(self.clist) - 1: pass elif self.clist[ci] == '@': try: varidx = self.flag.index(self.clist[ci + 1] + self.clist[ci + 2]) self.cnta += 1 self.line_nvar += 1 if self.stringOnly[varidx] == 1: wrfile.write(self.map[varidx][0]) self.ci_at = ci else: if self.name[varidx]: wrfile.write(self.map[varidx][0]) if type(self.map[varidx][self.pvar]) == str: wrfile.write('%s' % self.map[varidx][self.pvar]) if type(self.map[varidx][self.pvar]) == float: wrfile.write('%e' % self.map[varidx][self.pvar]) elif type(self.map[varidx][self.pvar]) == int: wrfile.write('%d' % self.map[varidx][self.pvar]) self.ci_at = ci except: print('%s not in netmap!' % (self.clist[ci + 1] + self.clist[ci + 2])) wrfile.write(self.clist[ci]) elif ci == len(self.clist) - 1: if self.pvar == len(self.map[self.nxtl_var + self.line_nvar - 1]) - 1: self.pvar = 1 self.nxtl_var = self.nxtl_var + self.line_nvar self.line_nvar = 0 self.cnta = 0 self.ci_at = -6 else: self.pvar += 1 self.line_nvar = self.cnta self.line_nvar = 0 self.cnta = 0 wrfile.write(self.clist[ci]) else: wrfile.write(self.clist[ci]) elif line[0:2] == '@W': self.nline = line[3:len(line)] self.clist = list(self.nline) for ci in range(0, len(self.clist)): if ci == self.ci_at + 1 or ci == self.ci_at + 2: pass elif self.clist[ci] == '@': varidx = self.flag.index(self.clist[ci + 1] + self.clist[ci + 2]) for iv in range(1, len(self.map[varidx])): if self.name[varidx]: wrfile.write(self.map[varidx][0]) if type(self.map[varidx][iv]) == int: wrfile.write('%d\t' % self.map[varidx][iv]) elif type(self.map[varidx][iv]) == float: wrfile.write('%.1f\t' % self.map[varidx][iv]) self.ci_at = ci else: wrfile.write(self.clist[ci]) self.ci_at = -5 elif line[0:2] == '@E': self.nline = line[3:len(line)] self.clist = list(self.nline) for ci in range(0, len(self.clist)): if ci == self.ci_at + 1 or ci == self.ci_at + 2: pass elif self.clist[ci] == '@': varidx = self.flag.index(self.clist[ci + 1] + self.clist[ci + 2]) for iv in range(1, len(self.map[varidx])): if self.name[varidx]: wrfile.write(self.map[varidx][0]) if type(self.map[varidx][iv]) == int: wrfile.write('%d] ' % self.map[varidx][iv]) elif type(self.map[varidx][iv]) == float: wrfile.write('%.1f\t' % self.map[varidx][iv]) self.ci_at = ci else: wrfile.write(self.clist[ci]) self.ci_at = -5 elif line[0:2] == '@C': self.nline = line[3:len(line)] self.clist = list(self.nline) for ci in range(0, len(self.clist)): if ci == self.ci_at + 1 or ci == self.ci_at + 2 or ci == self.ci_and + 1 or (ci == self.ci_and + 2) or (ci == self.ci_and + 3) or (ci == self.ci_and + 4): pass elif self.clist[ci] == '@': varidx = self.flag.index(self.clist[ci + 1] + self.clist[ci + 2]) for iv in range(1, len(self.map[varidx])): if self.name[varidx]: wrfile.write(self.map[varidx][0]) if type(self.map[varidx][iv]) == int: wrfile.write('%d ' % self.map[varidx][iv]) elif type(self.map[varidx][iv]) == float: wrfile.write('%.1f\t' % self.map[varidx][iv]) self.ci_at = ci elif self.clist[ci] == '&': varidx1 = self.flag.index(self.clist[ci + 1] + self.clist[ci + 2]) varidx2 = self.flag.index(self.clist[ci + 3] + self.clist[ci + 4]) for iv in range(1, len(self.map[varidx1])): if type(self.map[varidx1][iv]) == int: wrfile.write('%d ' % self.map[varidx1][iv]) elif type(self.map[varidx1][iv]) == float: wrfile.write('%e ' % self.map[varidx1][iv]) if type(self.map[varidx2][iv]) == int: wrfile.write('%d ' % self.map[varidx2][iv]) elif type(self.map[varidx2][iv]) == float: wrfile.write('%e ' % self.map[varidx2][iv]) self.ci_and = ci else: wrfile.write(self.clist[ci]) self.ci_at = -5 elif line[0:2] == '@S': self.nline = line[3:len(line)] self.clist = list(self.nline) for ci in range(0, len(self.clist)): if ci == self.ci_at + 1 or ci == self.ci_at + 2: pass elif self.clist[ci] == '@': varidx = self.flag.index(self.clist[ci + 1] + self.clist[ci + 2]) wrfile.write(self.map[varidx][0]) self.ci_at = ci else: wrfile.write(self.clist[ci]) self.ci_at = -5 else: wrfile.write(line) class Resmap: def __init__(self, num_tb, num_words, index): self.tb = [None] * num_tb self.tbi = [None] * num_tb self.vl = [None] * num_tb self.vlinit = [None] * num_tb self.svar = [None] * num_tb self.index = index self.nenv = 0 self.num_words = num_words self.vr = [None] * (num_words + index) self.vidx = [None] * (num_words + index) self.env = [None] * (num_words + index) for itb in range(0, len(self.tb)): self.tbi[itb] = 0 self.vl[itb] = [None] * (num_words + index) self.vlinit[itb] = [0] * (num_words + index) def get_var(self, ntb, var): self.vr[self.tbi[ntb]] = var self.tbi[ntb] += 1 if self.tbi[ntb] == len(self.vr): self.tbi[ntb] = 0 def add(self, ntb, value): if self.vlinit[ntb][self.tbi[ntb]] == 0: self.vl[ntb][self.tbi[ntb]] = [value] self.vlinit[ntb][self.tbi[ntb]] += 1 else: self.vl[ntb][self.tbi[ntb]].append(value) self.tbi[ntb] = (self.tbi[ntb] + 1) % len(self.vr) def plot_env(self, ntb, start, step, xvar, xval): if ntb == 'all': self.nenv += 1 self.xaxis = [None] * len(self.tb) for i in range(0, len(self.tb)): self.xaxis[i] = start + i * step self.vidx[self.nenv] = self.vr.index(xvar) self.env[self.nenv] = [i for (i, x) in enumerate(self.vl[0][self.vidx[self.nenv]]) if x == '%s' % xval] else: self.nenv += 1 self.xaxis = [None] self.xaxis = [start] self.vidx[self.nenv] = self.vr.index(xvar) self.env[self.nenv] = [i for (i, x) in enumerate(self.vl[0][self.vidx[self.nenv]]) if x == '%s' % xval] def rst_env(self): self.vidx[self.nenv] = None self.env[self.nenv] = 0 self.nenv = 0 def plot_y(self, yvar): self.yidx = self.vr.index(yvar) self.yaxis = [None] * len(self.xaxis) for xx in range(0, len(self.xaxis)): self.yaxis[xx] = self.vl[xx][self.yidx][self.env[self.nenv][0]] def sort(self, var): varidx = self.vr.index(var) for k in range(len(self.vl)): self.svar[k] = {} for i in range(len(self.vl[0][0])): self.svar[k][self.vl[k][varidx][i]] = [] for j in range(len(self.vr)): if j != varidx: self.svar[k][self.vl[k][varidx][i]].append(self.vl[k][j][i]) def sort_via(list_ind, list_vic, index, i): index = int(index) i = int(i) if len(list_ind) != len(list_vic): print('lengths of two lists dont match') else: t_ind = 0 t_vic = 0 if i < len(list_ind) - 1 and i >= 0: if list_ind[i][index] > list_ind[i + 1][index]: t_ind = list_ind[i] t_vic = list_vic[i] list_ind[i] = list_ind[i + 1] list_vic[i] = list_vic[i + 1] list_ind[i + 1] = t_ind list_vic[i + 1] = t_vic i = i - 1 sort_via(list_ind, list_vic, index, i) else: i += 1 sort_via(list_ind, list_vic, index, i) elif i < 0: i += 1 sort_via(list_ind, list_vic, index, i) elif i == len(list_ind) - 1: return (list_ind, list_vic) def sort_via_1d(list_ind, list_vic, i): i = int(i) if len(list_ind) != len(list_vic): print('lengths of two lists dont match') else: t_ind = 0 t_vic = 0 if i < len(list_ind) - 1 and i >= 0: if list_ind[i] > list_ind[i + 1]: t_ind = list_ind[i] t_vic = list_vic[i] list_ind[i] = list_ind[i + 1] list_vic[i] = list_vic[i + 1] list_ind[i + 1] = t_ind list_vic[i + 1] = t_vic i = i - 1 sort_via_1d(list_ind, list_vic, i) else: i += 1 sort_via_1d(list_ind, list_vic, i) elif i < 0: i += 1 sort_via_1d(list_ind, list_vic, i) elif i == len(list_ind) - 1: return (list_ind, list_vic) def sort_via_1d_mult(list_ind, *list_vics): i = int(0) for list_vic in list_vics: list_ind_temp = list(list_ind) sort_via_1d(list_ind_temp, list_vic, 0) sort_via_1d(list_ind, list_ind, 0) def m_m(inp_list): min_item = 0 max_item = 0 step_item = 0 reg_item = 0 err_step = 0 cnt = 0 for item in inp_list: if cnt == 0: min_item = item max_item = item else: if min_item > item: min_item = item if max_item < item: max_item = item reg_item = item cnt += 1 if err_step == 0: return (min_item, max_item)
print("Programa que imprime a tabuada") numero = 5 while numero <= 255: print("\n\n\n") for n in range(1, 11): resultado = numero * n print(numero, "X", n, "=", resultado) numero = numero + 1 print("Fim do programa")
print('Programa que imprime a tabuada') numero = 5 while numero <= 255: print('\n\n\n') for n in range(1, 11): resultado = numero * n print(numero, 'X', n, '=', resultado) numero = numero + 1 print('Fim do programa')
# This sample tests the special-case handle of the multi-parameter # form of the built-in "type" call. # pyright: strict X1 = type("X1", (object,), {}) X2 = type("X2", (object,), {}) class A(X1): ... class B(X2, A): ... # This should generate an error because the first arg is not a string. X3 = type(34, (object,)) # This should generate an error because the second arg is not a tuple of class types. X4 = type("X4", 34) # This should generate an error because the second arg is not a tuple of class types. X5 = type("X5", (3,))
x1 = type('X1', (object,), {}) x2 = type('X2', (object,), {}) class A(X1): ... class B(X2, A): ... x3 = type(34, (object,)) x4 = type('X4', 34) x5 = type('X5', (3,))
#!/usr/bin/env python3 # Python 3.5.3 (default, Jan 19 2017, 14:11:04) # [GCC 6.3.0 20170118] on linux def fibo(n): W = [1, 1] for i in range(n): W.append(W[i] + W[i+1]) return(W) def inpt(): n = int(input("steps: ")) print(fibo(n)) inpt()
def fibo(n): w = [1, 1] for i in range(n): W.append(W[i] + W[i + 1]) return W def inpt(): n = int(input('steps: ')) print(fibo(n)) inpt()
'''Find the area of the largest rectangle inside histogram''' def pop_stack(current_max, pos, stack): '''Remove item from stack and return area and start position''' start, height = stack.pop() return max(current_max, height * (pos - start)), start def largest_rectangle(hist): '''Find area of largest rectangle inside histogram''' current_max = 0 stack = [] i = -1 for i, height in enumerate(hist): if not stack or height > stack[-1][1]: stack.append((i, height)) elif height < stack[-1][1]: while stack and height < stack[-1][1]: current_max, start = pop_stack(current_max, i, stack) stack.append((start, height)) while stack: current_max = pop_stack(current_max, i+1, stack)[0] return current_max def main(): '''Main function for testing''' print(largest_rectangle([1, 3, 5, 3, 0, 2, 3, 3, 1, 0, 3, 6])) print(largest_rectangle([1, 3, 5, 3, 2, 2, 3, 3, 1, 0, 3, 6])) print(largest_rectangle([1, 2, 3, 1, 1])) if __name__ == '__main__': main()
"""Find the area of the largest rectangle inside histogram""" def pop_stack(current_max, pos, stack): """Remove item from stack and return area and start position""" (start, height) = stack.pop() return (max(current_max, height * (pos - start)), start) def largest_rectangle(hist): """Find area of largest rectangle inside histogram""" current_max = 0 stack = [] i = -1 for (i, height) in enumerate(hist): if not stack or height > stack[-1][1]: stack.append((i, height)) elif height < stack[-1][1]: while stack and height < stack[-1][1]: (current_max, start) = pop_stack(current_max, i, stack) stack.append((start, height)) while stack: current_max = pop_stack(current_max, i + 1, stack)[0] return current_max def main(): """Main function for testing""" print(largest_rectangle([1, 3, 5, 3, 0, 2, 3, 3, 1, 0, 3, 6])) print(largest_rectangle([1, 3, 5, 3, 2, 2, 3, 3, 1, 0, 3, 6])) print(largest_rectangle([1, 2, 3, 1, 1])) if __name__ == '__main__': main()
# MIT License # ----------- # Copyright (c) 2021 Sorn Zupanic Maksumic (https://www.usn.no) # Permission is hereby granted, free of charge, to any person # obtaining a copy of this software and associated documentation # files (the "Software"), to deal in the Software without # restriction, including without limitation the rights to use, # copy, modify, merge, publish, distribute, sublicense, and/or sell # copies of the Software, and to permit persons to whom the # Software is furnished to do so, subject to the following # conditions: # The above copyright notice and this permission notice shall be # included in all copies or substantial portions of the Software. # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, # EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES # OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND # NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT # HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, # WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING # FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR # OTHER DEALINGS IN THE SOFTWARE. class Vector2: def __init__(self, x, y): self.x = x self.y = y def magnitude(self): return pow(self.x * self.x + self.y * self.y, 0.5) def __sub__(self, other): return Vector2(self.x - other.x, self.y - other.y) def dot(self, other): return self.x * other.x + self.y * other.y
class Vector2: def __init__(self, x, y): self.x = x self.y = y def magnitude(self): return pow(self.x * self.x + self.y * self.y, 0.5) def __sub__(self, other): return vector2(self.x - other.x, self.y - other.y) def dot(self, other): return self.x * other.x + self.y * other.y
pd = int(input()) num = pd while True : rev = 0 temp = num + 1 while temp>0 : rem = temp%10; rev = rev*10 + rem temp = temp//10 if rev == num+1 : print(num+1) break num += 1
pd = int(input()) num = pd while True: rev = 0 temp = num + 1 while temp > 0: rem = temp % 10 rev = rev * 10 + rem temp = temp // 10 if rev == num + 1: print(num + 1) break num += 1
n=int(input()) count=n sumnum=0 if n==0: print("No Data") else: while count>0: num=float(input()) sumnum+=num count-=1 print(sumnum/n)
n = int(input()) count = n sumnum = 0 if n == 0: print('No Data') else: while count > 0: num = float(input()) sumnum += num count -= 1 print(sumnum / n)
__config_version__ = 1 GLOBALS = { 'serializer': '{{major}}.{{minor}}.{{patch}}{{status if status}}', } FILES = [{ 'path': 'README.rst', 'serializer': '{{major}}.{{minor}}.{{patch}}'}, 'docs/conf.py', 'setup.py', 'src/oemof/tabular/__init__.py'] VERSION = ['major', 'minor', 'patch', {'name': 'status', 'type': 'value_list', 'allowed_values': ['', 'dev']}]
__config_version__ = 1 globals = {'serializer': '{{major}}.{{minor}}.{{patch}}{{status if status}}'} files = [{'path': 'README.rst', 'serializer': '{{major}}.{{minor}}.{{patch}}'}, 'docs/conf.py', 'setup.py', 'src/oemof/tabular/__init__.py'] version = ['major', 'minor', 'patch', {'name': 'status', 'type': 'value_list', 'allowed_values': ['', 'dev']}]
__version__ = '0.1.2' NAME = 'atlasreader' MAINTAINER = 'Michael Notter' EMAIL = 'michaelnotter@hotmail.com' VERSION = __version__ LICENSE = 'MIT' DESCRIPTION = ('A toolbox for generating cluster reports from statistical ' 'maps') LONG_DESCRIPTION = ('') URL = 'http://github.com/miykael/{name}'.format(name=NAME) DOWNLOAD_URL = ('https://github.com/miykael/{name}/archive/{ver}.tar.gz' .format(name=NAME, ver=__version__)) INSTALL_REQUIRES = [ 'matplotlib', 'nibabel', 'nilearn', 'numpy', 'pandas', 'scipy', 'scikit-image', 'scikit-learn' ] TESTS_REQUIRE = [ 'pytest', 'pytest-cov' ] PACKAGE_DATA = { 'atlasreader': [ 'data/*', 'data/atlases/*', 'data/templates/*' ], 'atlasreader.tests': [ 'data/*' ] }
__version__ = '0.1.2' name = 'atlasreader' maintainer = 'Michael Notter' email = 'michaelnotter@hotmail.com' version = __version__ license = 'MIT' description = 'A toolbox for generating cluster reports from statistical maps' long_description = '' url = 'http://github.com/miykael/{name}'.format(name=NAME) download_url = 'https://github.com/miykael/{name}/archive/{ver}.tar.gz'.format(name=NAME, ver=__version__) install_requires = ['matplotlib', 'nibabel', 'nilearn', 'numpy', 'pandas', 'scipy', 'scikit-image', 'scikit-learn'] tests_require = ['pytest', 'pytest-cov'] package_data = {'atlasreader': ['data/*', 'data/atlases/*', 'data/templates/*'], 'atlasreader.tests': ['data/*']}
def apply_mode(module, mode): if mode == 'initialize' and 'reset_parameters' in dir(module): module.reset_parameters() for param in module.parameters(): if mode == 'freeze': param.requires_grad = False elif mode in ['fine-tune', 'initialize']: param.requires_grad = True
def apply_mode(module, mode): if mode == 'initialize' and 'reset_parameters' in dir(module): module.reset_parameters() for param in module.parameters(): if mode == 'freeze': param.requires_grad = False elif mode in ['fine-tune', 'initialize']: param.requires_grad = True
reactions_irreversible = [ # FIXME Automatic irreversible for: Cl- {"CaCl2": -1, "Ca++": 1, "Cl-": 2, "type": "irrev", "id_db": -1}, {"NaCl": -1, "Na+": 1, "Cl-": 1, "type": "irrev", "id_db": -1}, {"KCl": -1, "K+": 1, "Cl-": 1, "type": "irrev", "id_db": -1}, {"KOH": -1, "K+": 1, "OH-": 1, "type": "irrev", "id_db": -1}, {"MgCl2": -1, "Mg++": 1, "Cl-": 2, "type": "irrev", "id_db": -1}, {"K2SO4": -1, "K+": 2, "SO4--": 1, "type": "irrev", "id_db": -1}, {"BaCl2": -1, "Ba++": 1, "Cl-": 2, "type": "irrev", "id_db": -1}, {"NaHSO4": -1, "Na+": 1, "HSO4-": 1, "type": "irrev", "id_db": -1}, {"Na2SO4": -1, "Na+": 2, "HSO4-": 1, "type": "irrev", "id_db": -1}, {"H2SO4": -1, "H+": 2, "SO4-": 1, "type": "irrev", "id_db": -1}, {"Al2(SO4)3": -1, "Al+++": 2, "SO4--": 3, "type": "irrev", "id_db": -1}, ]
reactions_irreversible = [{'CaCl2': -1, 'Ca++': 1, 'Cl-': 2, 'type': 'irrev', 'id_db': -1}, {'NaCl': -1, 'Na+': 1, 'Cl-': 1, 'type': 'irrev', 'id_db': -1}, {'KCl': -1, 'K+': 1, 'Cl-': 1, 'type': 'irrev', 'id_db': -1}, {'KOH': -1, 'K+': 1, 'OH-': 1, 'type': 'irrev', 'id_db': -1}, {'MgCl2': -1, 'Mg++': 1, 'Cl-': 2, 'type': 'irrev', 'id_db': -1}, {'K2SO4': -1, 'K+': 2, 'SO4--': 1, 'type': 'irrev', 'id_db': -1}, {'BaCl2': -1, 'Ba++': 1, 'Cl-': 2, 'type': 'irrev', 'id_db': -1}, {'NaHSO4': -1, 'Na+': 1, 'HSO4-': 1, 'type': 'irrev', 'id_db': -1}, {'Na2SO4': -1, 'Na+': 2, 'HSO4-': 1, 'type': 'irrev', 'id_db': -1}, {'H2SO4': -1, 'H+': 2, 'SO4-': 1, 'type': 'irrev', 'id_db': -1}, {'Al2(SO4)3': -1, 'Al+++': 2, 'SO4--': 3, 'type': 'irrev', 'id_db': -1}]
class FirstOrderFilter: # first order filter def __init__(self, x0, rc, dt, initialized=True): self.x = x0 self.dt = dt self.update_alpha(rc) self.initialized = initialized def update_alpha(self, rc): self.alpha = self.dt / (rc + self.dt) def update(self, x): if self.initialized: self.x = (1. - self.alpha) * self.x + self.alpha * x else: self.initialized = True self.x = x return self.x
class Firstorderfilter: def __init__(self, x0, rc, dt, initialized=True): self.x = x0 self.dt = dt self.update_alpha(rc) self.initialized = initialized def update_alpha(self, rc): self.alpha = self.dt / (rc + self.dt) def update(self, x): if self.initialized: self.x = (1.0 - self.alpha) * self.x + self.alpha * x else: self.initialized = True self.x = x return self.x
# Move to the treasure room and defeat all the ogres. while True: hero.moveUp(4) hero.moveRight(4) hero.moveDown(3) hero.moveLeft() enemy = hero.findNearestEnemy() hero.attack(enemy) hero.attack(enemy) enemy2 = hero.findNearestEnemy() hero.attack(enemy2) hero.attack(enemy2) enemy3 = hero.findNearestEnemy() hero.attack(enemy3) hero.attack(enemy3) hero.moveLeft() enemy4 = hero.findNearestEnemy() hero.attack(enemy4) hero.attack(enemy4)
while True: hero.moveUp(4) hero.moveRight(4) hero.moveDown(3) hero.moveLeft() enemy = hero.findNearestEnemy() hero.attack(enemy) hero.attack(enemy) enemy2 = hero.findNearestEnemy() hero.attack(enemy2) hero.attack(enemy2) enemy3 = hero.findNearestEnemy() hero.attack(enemy3) hero.attack(enemy3) hero.moveLeft() enemy4 = hero.findNearestEnemy() hero.attack(enemy4) hero.attack(enemy4)
# SPDX-FileCopyrightText: 2021 Carter Nelson for Adafruit Industries # # SPDX-License-Identifier: MIT # This file is where you keep secret settings, passwords, and tokens! # If you put them in the code you risk committing that info or sharing it secrets = { # tuples of name, sekret key, color 'totp_keys' : [("Github", "JBSWY3DPEHPK3PXP", 0x8732A8), ("Discord", "JBSWY3DPEHPK3PXQ", 0x32A89E), ("Slack", "JBSWY5DZEHPK3PXR", 0xFC861E), ("Basecamp", "JBSWY6DZEHPK3PXS", 0x55C24C), ("Gmail", "JBSWY7DZEHPK3PXT", 0x3029FF), None, None, # must have 12 entires None, # set None for unused keys None, ("Hello Kitty", "JBSWY7DZEHPK3PXU", 0xED164F), None, None, ] }
secrets = {'totp_keys': [('Github', 'JBSWY3DPEHPK3PXP', 8860328), ('Discord', 'JBSWY3DPEHPK3PXQ', 3319966), ('Slack', 'JBSWY5DZEHPK3PXR', 16549406), ('Basecamp', 'JBSWY6DZEHPK3PXS', 5620300), ('Gmail', 'JBSWY7DZEHPK3PXT', 3156479), None, None, None, None, ('Hello Kitty', 'JBSWY7DZEHPK3PXU', 15537743), None, None]}
# Do not edit this file directly. # It was auto-generated by: code/programs/reflexivity/reflexive_refresh load("@bazel_tools//tools/build_defs/repo:http.bzl", "http_archive") load("@bazel_tools//tools/build_defs/repo:http.bzl", "http_file") def python3(): http_archive( name = "python3", build_file = "//bazel/deps/python3:build.BUILD", sha256 = "36592ee2910b399c68bf0ddad1625f2c6a359ab9a8253d676d44531500e475d4", strip_prefix = "python3-7f755fe87d217177603a27d9dcc2fedc979f0f1a", urls = [ "https://github.com/Unilang/python3/archive/7f755fe87d217177603a27d9dcc2fedc979f0f1a.tar.gz", ], patch_cmds = [ "sed -i '/HAVE_CRYPT_H/d' usr/include/x86_64-linux-gnu/python3.6m/pyconfig.h", ], )
load('@bazel_tools//tools/build_defs/repo:http.bzl', 'http_archive') load('@bazel_tools//tools/build_defs/repo:http.bzl', 'http_file') def python3(): http_archive(name='python3', build_file='//bazel/deps/python3:build.BUILD', sha256='36592ee2910b399c68bf0ddad1625f2c6a359ab9a8253d676d44531500e475d4', strip_prefix='python3-7f755fe87d217177603a27d9dcc2fedc979f0f1a', urls=['https://github.com/Unilang/python3/archive/7f755fe87d217177603a27d9dcc2fedc979f0f1a.tar.gz'], patch_cmds=["sed -i '/HAVE_CRYPT_H/d' usr/include/x86_64-linux-gnu/python3.6m/pyconfig.h"])
# Python program that uses classes and objects to represent realworld entities class Book(): # A class is a custom datatype template or blueprint title="" # Attribute author="" pages=0 book1 = Book() # An object is an instance of a class book2 = Book() book1.title = "Harry Potter" # The objects attribute values can be directly modified book1.author = "JK Rowling" book1.pages = 500 book2.title = "Lord of the Rings" book2.author = "Tolkien" book2.pages = 700 print("\nTitle:\t", book1.title,"\nAuthor:\t",book1.author,"\nPages:\t",book1.pages) # Prints the attribute values of the first book object print("\nTitle:\t", book2.title,"\nAuthor:\t",book2.author,"\nPages:\t",book2.pages) # Prints the attribute values of the second book object
class Book: title = '' author = '' pages = 0 book1 = book() book2 = book() book1.title = 'Harry Potter' book1.author = 'JK Rowling' book1.pages = 500 book2.title = 'Lord of the Rings' book2.author = 'Tolkien' book2.pages = 700 print('\nTitle:\t', book1.title, '\nAuthor:\t', book1.author, '\nPages:\t', book1.pages) print('\nTitle:\t', book2.title, '\nAuthor:\t', book2.author, '\nPages:\t', book2.pages)
# INSERTION OF NODE AT END , BEGGINING AND AT GIVEN POS VALUE class linkedListNode: def __init__(self, value, nextNode=None): self.value = value self.nextNode = nextNode class linkedList: def __init__(self, head=None): self.head = head def printList(self): currentNode = self.head while currentNode is not None: print(currentNode.value, "->", end="") currentNode = currentNode.nextNode print("None") def insertAtEnd(self, value): node = linkedListNode(value) if(self.head is None): self.head = node return currentNode = self.head while True: if(currentNode.nextNode is None): currentNode.nextNode = node break currentNode = currentNode.nextNode def insertAtBeginning(self, value): node = linkedListNode(value) if(self.head is None): self.head = node return node.nextNode = self.head self.head = node def insertAtPos(self, value, prev_value): node = linkedListNode(value) if(self.head is None): self.head = node return currentNode = self.head prevNode = self.head while currentNode.value is not prev_value: if(currentNode.nextNode is None): print("Node not found") break prevNode = currentNode currentNode = currentNode.nextNode prevNode.nextNode = node node.nextNode = currentNode if __name__ == '__main__': nodeCreation = linkedList() nodeCreation.insertAtEnd("3") nodeCreation.printList() nodeCreation.insertAtEnd("5") nodeCreation.printList() nodeCreation.insertAtEnd("9") nodeCreation.printList() nodeCreation.insertAtBeginning("1") nodeCreation.printList() nodeCreation.insertAtPos("7", "9") nodeCreation.printList() nodeCreation.insertAtPos("7", "8") nodeCreation.printList()
class Linkedlistnode: def __init__(self, value, nextNode=None): self.value = value self.nextNode = nextNode class Linkedlist: def __init__(self, head=None): self.head = head def print_list(self): current_node = self.head while currentNode is not None: print(currentNode.value, '->', end='') current_node = currentNode.nextNode print('None') def insert_at_end(self, value): node = linked_list_node(value) if self.head is None: self.head = node return current_node = self.head while True: if currentNode.nextNode is None: currentNode.nextNode = node break current_node = currentNode.nextNode def insert_at_beginning(self, value): node = linked_list_node(value) if self.head is None: self.head = node return node.nextNode = self.head self.head = node def insert_at_pos(self, value, prev_value): node = linked_list_node(value) if self.head is None: self.head = node return current_node = self.head prev_node = self.head while currentNode.value is not prev_value: if currentNode.nextNode is None: print('Node not found') break prev_node = currentNode current_node = currentNode.nextNode prevNode.nextNode = node node.nextNode = currentNode if __name__ == '__main__': node_creation = linked_list() nodeCreation.insertAtEnd('3') nodeCreation.printList() nodeCreation.insertAtEnd('5') nodeCreation.printList() nodeCreation.insertAtEnd('9') nodeCreation.printList() nodeCreation.insertAtBeginning('1') nodeCreation.printList() nodeCreation.insertAtPos('7', '9') nodeCreation.printList() nodeCreation.insertAtPos('7', '8') nodeCreation.printList()
# -*- coding: utf-8 -*- # This file is generated from NI-FAKE API metadata version 1.2.0d9 functions = { 'Abort': { 'codegen_method': 'public', 'documentation': { 'description': 'Aborts a previously initiated thingie.' }, 'parameters': [ { 'direction': 'in', 'documentation': { 'description': 'Identifies a particular instrument session.' }, 'name': 'vi', 'type': 'ViSession' } ], 'returns': 'ViStatus' }, 'AcceptListOfDurationsInSeconds': { 'codegen_method': 'public', 'documentation': { 'description': 'Accepts list of floats or hightime.timedelta instances representing time delays.' }, 'parameters': [ { 'direction': 'in', 'documentation': { 'description': 'Identifies a particular instrument session.' }, 'name': 'vi', 'type': 'ViSession' }, { 'direction': 'in', 'documentation': { 'description': 'Count of input values.' }, 'name': 'count', 'type': 'ViInt32' }, { 'direction': 'in', 'documentation': { 'description': 'A collection of time delay values.' }, 'name': 'delays', 'python_api_converter_name': 'convert_timedeltas_to_seconds_real64', 'size': { 'mechanism': 'len', 'value': 'count' }, 'type': 'ViReal64[]', 'type_in_documentation': 'hightime.timedelta, datetime.timedelta, or float in seconds' } ], 'returns': 'ViStatus' }, 'AcceptViSessionArray': { 'codegen_method': 'public', 'parameters': [ { 'direction': 'in', 'name': 'sessionCount', 'type': 'ViUInt32' }, { 'direction': 'in', 'name': 'sessionArray', 'type': 'ViSession[]', 'size': { 'mechanism': 'passed-in', 'value': 'sessionCount' } } ], 'returns': 'ViStatus' }, 'AcceptViUInt32Array': { 'parameters': [ { 'direction': 'in', 'name': 'vi', 'type': 'ViSession' }, { 'direction': 'in', 'name': 'arrayLen', 'type': 'ViInt32' }, { 'direction': 'in', 'name': 'uInt32Array', 'type': 'ViUInt32[]', 'size': { 'mechanism': 'len', 'value': 'arrayLen' } } ], 'returns': 'ViStatus' }, 'BoolArrayOutputFunction': { 'codegen_method': 'public', 'documentation': { 'description': 'This function returns an array of booleans.' }, 'parameters': [ { 'direction': 'in', 'documentation': { 'description': 'Identifies a particular instrument session. You obtain the **vi** parameter from niFake_InitWithOptions.' }, 'name': 'vi', 'type': 'ViSession' }, { 'direction': 'in', 'documentation': { 'description': 'Number of elements in the array.' }, 'name': 'numberOfElements', 'type': 'ViInt32' }, { 'direction': 'out', 'documentation': { 'description': 'Contains an array of booleans' }, 'name': 'anArray', 'size': { 'mechanism': 'passed-in', 'value': 'numberOfElements' }, 'type': 'ViBoolean[]' } ], 'returns': 'ViStatus' }, 'BoolArrayInputFunction': { 'codegen_method': 'public', 'documentation': { 'description': 'This function accepts an array of booleans.' }, 'parameters': [ { 'direction': 'in', 'documentation': { 'description': 'Identifies a particular instrument session. You obtain the **vi** parameter from niFake_InitWithOptions.' }, 'name': 'vi', 'type': 'ViSession' }, { 'direction': 'in', 'documentation': { 'description': 'Number of elements in the array.' }, 'name': 'numberOfElements', 'type': 'ViInt32' }, { 'direction': 'in', 'documentation': { 'description': 'Input boolean array' }, 'name': 'anArray', 'size': { 'mechanism': 'passed-in', 'value': 'numberOfElements' }, 'type': 'ViBoolean[]' } ], 'returns': 'ViStatus' }, 'CommandWithReservedParam': { 'parameters': [ { 'direction': 'in', 'name': 'vi', 'type': 'ViSession' }, { 'direction': 'in', 'include_in_proto': False, 'name': 'reserved', 'pointer': True, 'hardcoded_value': "nullptr", 'type': 'ViBoolean' } ], 'returns': 'ViStatus' }, 'CreateConfigurationList': { 'parameters': [ { 'direction': 'in', 'name': 'numberOfListAttributes', 'type': 'ViInt32' }, { 'direction': 'in', 'name': 'listAttributeIds', 'size': { 'mechanism': 'len', 'value': 'numberOfListAttributes' }, 'type': 'ViAttr[]' } ], 'returns': 'ViStatus' }, 'DoubleAllTheNums': { 'documentation': { 'description': 'Test for buffer with converter' }, 'parameters': [ { 'direction': 'in', 'documentation': { 'description': 'Identifies a particular instrument session. You obtain the **vi** parameter from niFake_InitWithOptions.' }, 'name': 'vi', 'type': 'ViSession' }, { 'direction': 'in', 'documentation': { 'description': 'Number of elements in the number array' }, 'name': 'numberCount', 'type': 'ViInt32' }, { 'direction': 'in', 'documentation': { 'description': 'numbers is an array of numbers we want to double.' }, 'name': 'numbers', 'python_api_converter_name': 'convert_double_each_element', 'size': { 'mechanism': 'len', 'value': 'numberCount' }, 'type': 'ViReal64[]' } ], 'returns': 'ViStatus' }, 'EnumArrayOutputFunction': { 'codegen_method': 'public', 'documentation': { 'description': 'This function returns an array of enums, stored as 16 bit integers under the hood.' }, 'parameters': [ { 'direction': 'in', 'documentation': { 'description': 'Identifies a particular instrument session. You obtain the **vi** parameter from niFake_InitWithOptions.' }, 'name': 'vi', 'type': 'ViSession' }, { 'direction': 'in', 'documentation': { 'description': 'Number of elements in the array.' }, 'name': 'numberOfElements', 'type': 'ViInt32' }, { 'direction': 'out', 'documentation': { 'description': 'Contains an array of enums, stored as 16 bit integers under the hood ' }, 'enum': 'Turtle', 'name': 'anArray', 'size': { 'mechanism': 'passed-in', 'value': 'numberOfElements' }, 'type': 'ViInt16[]' } ], 'returns': 'ViStatus' }, 'EnumInputFunctionWithDefaults': { 'codegen_method': 'public', 'documentation': { 'description': 'This function takes one parameter other than the session, which happens to be an enum and has a default value.' }, 'parameters': [ { 'direction': 'in', 'documentation': { 'description': 'Identifies a particular instrument session. You obtain the **vi** parameter from niFake_InitWithOptions.' }, 'name': 'vi', 'type': 'ViSession' }, { 'default_value': 'Turtle.LEONARDO', 'direction': 'in', 'documentation': { 'description': 'Indicates a ninja turtle', 'table_body': [ [ '0', 'Leonardo' ], [ '1', 'Donatello' ], [ '2', 'Raphael' ], [ '3', 'Mich elangelo' ] ] }, 'enum': 'Turtle', 'name': 'aTurtle', 'type': 'ViInt16' } ], 'returns': 'ViStatus' }, 'ExportAttributeConfigurationBuffer': { 'documentation': { 'description': 'Export configuration buffer.' }, 'parameters': [ { 'direction': 'in', 'name': 'vi', 'type': 'ViSession' }, { 'direction': 'in', 'name': 'sizeInBytes', 'type': 'ViInt32' }, { 'direction': 'out', 'name': 'configuration', 'python_api_converter_name': 'convert_to_bytes', 'size': { 'mechanism': 'ivi-dance', 'value': 'sizeInBytes' }, 'type': 'ViInt8[]', 'type_in_documentation': 'bytes', 'use_array': True } ], 'returns': 'ViStatus' }, 'FetchWaveform': { 'codegen_method': 'public', 'documentation': { 'description': 'Returns waveform data.' }, 'method_templates': [ { 'documentation_filename': 'default_method', 'method_python_name_suffix': '', 'session_filename': 'default_method' }, { 'documentation_filename': 'numpy_method', 'method_python_name_suffix': '_into', 'session_filename': 'numpy_read_method' } ], 'parameters': [ { 'direction': 'in', 'documentation': { 'description': 'Identifies a particular instrument session.' }, 'name': 'vi', 'type': 'ViSession' }, { 'direction': 'in', 'documentation': { 'description': 'Number of samples to return' }, 'name': 'numberOfSamples', 'type': 'ViInt32' }, { 'direction': 'out', 'documentation': { 'description': 'Samples fetched from the device. Array should be numberOfSamples big.' }, 'name': 'waveformData', 'numpy': True, 'size': { 'mechanism': 'passed-in', 'value': 'numberOfSamples' }, 'type': 'ViReal64[]', 'use_array': True }, { 'direction': 'out', 'documentation': { 'description': 'Number of samples actually fetched.' }, 'name': 'actualNumberOfSamples', 'type': 'ViInt32', 'use_in_python_api': False } ], 'returns': 'ViStatus' }, 'GetABoolean': { 'codegen_method': 'public', 'documentation': { 'description': 'Returns a boolean.', 'note': 'This function rules!' }, 'parameters': [ { 'direction': 'in', 'documentation': { 'description': 'Identifies a particular instrument session.' }, 'name': 'vi', 'type': 'ViSession' }, { 'direction': 'out', 'documentation': { 'description': 'Contains a boolean.' }, 'name': 'aBoolean', 'type': 'ViBoolean' } ], 'returns': 'ViStatus' }, 'GetANumber': { 'codegen_method': 'public', 'documentation': { 'description': 'Returns a number.', 'note': 'This function rules!' }, 'parameters': [ { 'direction': 'in', 'documentation': { 'description': 'Identifies a particular instrument session.' }, 'name': 'vi', 'type': 'ViSession' }, { 'direction': 'out', 'documentation': { 'description': 'Contains a number.' }, 'name': 'aNumber', 'type': 'ViInt16' } ], 'returns': 'ViStatus' }, 'GetAStringOfFixedMaximumSize': { 'codegen_method': 'public', 'documentation': { 'description': 'Illustrates returning a string of fixed size.' }, 'parameters': [ { 'direction': 'in', 'documentation': { 'description': 'Identifies a particular instrument session.' }, 'name': 'vi', 'type': 'ViSession' }, { 'direction': 'out', 'documentation': { 'description': 'String comes back here. Buffer must be 256 big.' }, 'name': 'aString', 'size': { 'mechanism': 'fixed', 'value': 256 }, 'type': 'ViChar[]' } ], 'returns': 'ViStatus' }, 'GetAStringUsingCustomCode': { 'codegen_method': 'no', 'documentation': { 'description': 'Returns a number and a string.', 'note': 'This function rules!' }, 'parameters': [ { 'direction': 'in', 'documentation': { 'description': 'Identifies a particular instrument session.' }, 'name': 'vi', 'type': 'ViSession' }, { 'direction': 'in', 'documentation': { 'description': 'Contains a number.' }, 'name': 'aNumber', 'type': 'ViInt16' }, { 'direction': 'out', 'documentation': { 'description': 'Contains a string of length aNumber.' }, 'name': 'aString', 'size': { 'mechanism': 'custom-code', 'value': 'a_number' }, 'type': 'ViChar[]' } ], 'returns': 'ViStatus' }, 'GetBitfieldAsEnumArray': { 'parameters': [ { 'bitfield_as_enum_array': 'Bitfield', 'direction': 'out', 'name': 'flags', 'type': 'ViInt64', } ], 'returns': 'ViStatus' }, 'GetAnIviDanceString': { 'codegen_method': 'public', 'documentation': { 'description': 'Returns a string using the IVI dance.' }, 'parameters': [ { 'direction': 'in', 'documentation': { 'description': 'Identifies a particular instrument session.' }, 'name': 'vi', 'type': 'ViSession' }, { 'direction': 'in', 'documentation': { 'description': 'Number of bytes in aString You can IVI-dance with this.' }, 'name': 'bufferSize', 'type': 'ViInt32' }, { 'direction': 'out', 'documentation': { 'description': 'Returns the string.' }, 'name': 'aString', 'size': { 'mechanism': 'ivi-dance', 'value': 'bufferSize' }, 'type': 'ViChar[]' } ], 'returns': 'ViStatus' }, 'GetAnIviDanceWithATwistArray': { 'parameters': [ { 'name': 'vi', 'direction': 'in', 'type': 'ViSession' }, { 'name': 'aString', 'direction': 'in', 'type': 'ViConstString' }, { 'name': 'bufferSize', 'direction': 'in', 'type': 'ViInt32' }, { 'name': 'arrayOut', 'direction': 'out', 'type': 'ViInt32[]', 'size': { 'mechanism': 'ivi-dance-with-a-twist', 'value': 'bufferSize', 'value_twist': 'actualSize' } }, { 'name': 'actualSize', 'direction': 'out', 'type': 'ViInt32' } ], 'returns': 'ViStatus' }, 'GetAnIviDanceWithATwistArrayOfCustomType': { 'parameters': [ { 'name': 'vi', 'direction': 'in', 'type': 'ViSession' }, { 'name': 'bufferSize', 'direction': 'in', 'type': 'ViInt32' }, { 'name': 'arrayOut', 'direction': 'out', 'type': 'struct CustomStruct[]', 'grpc_type': 'repeated FakeCustomStruct', 'size': { 'mechanism': 'ivi-dance-with-a-twist', 'value': 'bufferSize', 'value_twist': 'actualSize' } }, { 'name': 'actualSize', 'direction': 'out', 'type': 'ViInt32' } ], 'returns': 'ViStatus' }, 'GetAnIviDanceWithATwistArrayWithInputArray': { 'parameters': [ { 'direction': 'in', 'name': 'dataIn', 'size': { 'mechanism': 'len', 'value': 'arraySizeIn' }, 'type': 'ViInt32[]' }, { 'direction': 'in', 'name': 'arraySizeIn', 'type': 'ViInt32' }, { 'name': 'bufferSize', 'direction': 'in', 'type': 'ViInt32' }, { 'name': 'arrayOut', 'direction': 'out', 'type': 'ViInt32[]', 'size': { 'mechanism': 'ivi-dance-with-a-twist', 'value': 'bufferSize', 'value_twist': 'actualSize' } }, { 'name': 'actualSize', 'direction': 'out', 'type': 'ViInt32' } ], 'returns': 'ViStatus' }, 'GetAnIviDanceWithATwistByteArray': { 'parameters': [ { 'name': 'bufferSize', 'direction': 'in', 'type': 'ViInt32' }, { 'name': 'arrayOut', 'direction': 'out', 'size': { 'mechanism': 'ivi-dance-with-a-twist', 'value': 'bufferSize', 'value_twist': 'actualSize' }, 'type': 'ViInt8[]' }, { 'name': 'actualSize', 'direction': 'out', 'type': 'ViInt32' } ], 'returns': 'ViStatus' }, 'GetAnIviDanceWithATwistString': { 'parameters': [ { 'name': 'bufferSize', 'direction': 'in', 'type': 'ViInt32' }, { 'name': 'arrayOut', 'direction': 'out', 'size': { 'mechanism': 'ivi-dance-with-a-twist', 'value': 'bufferSize', 'value_twist': 'actualSize' }, 'type': 'ViChar[]' }, { 'name': 'actualSize', 'direction': 'out', 'type': 'ViInt32' } ], 'returns': 'ViStatus' }, 'GetAnIviDanceWithATwistStringStrlenBug': { 'parameters': [ { 'name': 'bufferSize', 'direction': 'in', 'type': 'ViInt32' }, { 'name': 'stringOut', 'direction': 'out', 'size': { 'mechanism': 'ivi-dance-with-a-twist', 'value': 'bufferSize', 'value_twist': 'actualSize', 'tags': ['strlen-bug'] }, 'type': 'ViChar[]' }, { 'name': 'actualSize', 'direction': 'out', 'type': 'ViInt32' } ], 'returns': 'ViStatus' }, 'GetArrayForCustomCodeCustomType': { 'codegen_method': 'no', 'documentation': { 'description': 'This function returns an array for use in custom-code size mechanism.' }, 'parameters': [ { 'direction': 'in', 'documentation': { 'description': 'Identifies a particular instrument session.' }, 'name': 'vi', 'type': 'ViSession' }, { 'include_in_proto': False, 'direction': 'in', 'documentation': { 'description': 'Number of elements in the array.' }, 'name': 'numberOfElements', 'size': { 'mechanism': 'custom-code', 'value': '', }, 'type': 'ViInt32' }, { 'direction': 'out', 'documentation': { 'description': 'Array of custom type using custom-code size mechanism' }, 'name': 'arrayOut', 'size': { 'mechanism': 'custom-code', 'value': '' }, 'type': 'struct CustomStruct[]', 'grpc_type': 'repeated FakeCustomStruct' } ], 'returns': 'ViStatus' }, 'GetArrayForCustomCodeDouble': { 'codegen_method': 'no', 'documentation': { 'description': 'This function returns an array for use in custom-code size mechanism.' }, 'parameters': [ { 'direction': 'in', 'documentation': { 'description': 'Identifies a particular instrument session.' }, 'name': 'vi', 'type': 'ViSession' }, { 'include_in_proto': False, 'direction': 'in', 'documentation': { 'description': 'Number of elements in the array.' }, 'name': 'numberOfElements', 'size': { 'mechanism': 'custom-code', 'value': '', }, 'type': 'ViInt32' }, { 'direction': 'out', 'documentation': { 'description': 'Array of double using custom-code size mechanism' }, 'name': 'arrayOut', 'size': { 'mechanism': 'custom-code', 'value': 'number_of_elements' }, 'type': 'ViReal64[]' } ], 'returns': 'ViStatus' }, 'GetArraySizeForCustomCode': { 'codegen_method': 'public', 'documentation': { 'description': 'This function returns the size of the array for use in custom-code size mechanism.' }, 'parameters': [ { 'direction': 'in', 'documentation': { 'description': 'Identifies a particular instrument session.' }, 'name': 'vi', 'type': 'ViSession' }, { 'direction': 'out', 'documentation': { 'description': 'Size of array' }, 'name': 'sizeOut', 'type': 'ViInt32' } ], 'returns': 'ViStatus' }, 'GetArrayUsingIviDance': { 'codegen_method': 'public', 'documentation': { 'description': 'This function returns an array of float whose size is determined with the IVI dance.' }, 'parameters': [ { 'direction': 'in', 'documentation': { 'description': 'Identifies a particular instrument session.' }, 'name': 'vi', 'type': 'ViSession' }, { 'direction': 'in', 'documentation': { 'description': 'Specifies the size of the buffer for copyint arrayOut onto.' }, 'name': 'arraySize', 'type': 'ViInt32' }, { 'direction': 'out', 'documentation': { 'description': 'The array returned by this function' }, 'name': 'arrayOut', 'size': { 'mechanism': 'ivi-dance', 'value': 'arraySize' }, 'type': 'ViReal64[]' } ], 'returns': 'ViStatus' }, 'GetArrayViUInt8WithEnum': { 'parameters': [ { 'direction': 'in', 'name': 'vi', 'type': 'ViSession' }, { 'direction': 'in', 'name': 'arrayLen', 'type': 'ViInt32' }, { 'direction': 'out', 'name': 'uInt8EnumArray', 'enum': 'Color', 'type': 'ViUInt8[]', 'size': { 'mechanism': 'passed-in', 'value': 'arrayLen' } } ], 'returns': 'ViStatus' }, 'GetAttributeViBoolean': { 'codegen_method': 'public', 'documentation': { 'description': 'Queries the value of a ViBoolean attribute.' }, 'parameters': [ { 'direction': 'in', 'documentation': { 'description': 'Identifies a particular instrument session.' }, 'name': 'vi', 'type': 'ViSession' }, { 'direction': 'in', 'documentation': { 'description': 'This is the channel(s) that this function will apply to.' }, 'name': 'channelName', 'type': 'ViConstString' }, { 'direction': 'in', 'documentation': { 'description': 'Pass the ID of an attribute.' }, 'name': 'attributeId', 'type': 'ViAttr' }, { 'direction': 'out', 'documentation': { 'description': 'Returns the value of the attribute.' }, 'name': 'attributeValue', 'type': 'ViBoolean' } ], 'returns': 'ViStatus' }, 'GetAttributeViInt32': { 'codegen_method': 'public', 'documentation': { 'description': 'Queries the value of a ViInt32 attribute.' }, 'parameters': [ { 'direction': 'in', 'documentation': { 'description': 'Identifies a particular instrument session.' }, 'name': 'vi', 'type': 'ViSession' }, { 'direction': 'in', 'documentation': { 'description': 'This is the channel(s) that this function will apply to.' }, 'name': 'channelName', 'type': 'ViConstString' }, { 'direction': 'in', 'documentation': { 'description': 'Pass the ID of an attribute.' }, 'name': 'attributeId', 'type': 'ViAttr' }, { 'direction': 'out', 'documentation': { 'description': 'Returns the value of the attribute.' }, 'name': 'attributeValue', 'type': 'ViInt32' } ], 'returns': 'ViStatus' }, 'GetAttributeViInt64': { 'codegen_method': 'public', 'documentation': { 'description': 'Queries the value of a ViInt64 attribute.' }, 'parameters': [ { 'direction': 'in', 'documentation': { 'description': 'Identifies a particular instrument session.' }, 'name': 'vi', 'type': 'ViSession' }, { 'direction': 'in', 'documentation': { 'description': 'This is the channel(s) that this function will apply to.' }, 'name': 'channelName', 'type': 'ViConstString' }, { 'direction': 'in', 'documentation': { 'description': 'Pass the ID of an attribute.' }, 'name': 'attributeId', 'type': 'ViAttr' }, { 'direction': 'out', 'documentation': { 'description': 'Returns the value of the attribute.' }, 'name': 'attributeValue', 'type': 'ViInt64' } ], 'returns': 'ViStatus' }, 'GetAttributeViReal64': { 'codegen_method': 'public', 'documentation': { 'description': 'Queries the value of a ViReal attribute.' }, 'parameters': [ { 'direction': 'in', 'documentation': { 'description': 'Identifies a particular instrument session.' }, 'name': 'vi', 'type': 'ViSession' }, { 'direction': 'in', 'documentation': { 'description': 'This is the channel(s) that this function will apply to.' }, 'name': 'channelName', 'type': 'ViConstString' }, { 'direction': 'in', 'documentation': { 'description': 'Pass the ID of an attribute.' }, 'name': 'attributeId', 'type': 'ViAttr' }, { 'direction': 'out', 'documentation': { 'description': 'Returns the value of the attribute.' }, 'name': 'attributeValue', 'type': 'ViReal64' } ], 'returns': 'ViStatus' }, 'GetAttributeViSession': { 'parameters': [ { 'direction': 'in', 'name': 'vi', 'type': 'ViSession' }, { 'direction': 'in', 'name': 'attributeId', 'type': 'ViInt32' }, { 'direction': 'out', 'name': 'sessionOut', 'type': 'ViSession' } ], 'returns': 'ViStatus' }, 'GetAttributeViString': { 'codegen_method': 'public', 'documentation': { 'description': 'Queries the value of a ViBoolean attribute.' }, 'parameters': [ { 'direction': 'in', 'documentation': { 'description': 'Identifies a particular instrument session.' }, 'name': 'vi', 'type': 'ViSession' }, { 'direction': 'in', 'documentation': { 'description': 'This is the channel(s) that this function will apply to.' }, 'name': 'channelName', 'type': 'ViConstString' }, { 'direction': 'in', 'documentation': { 'description': 'Pass the ID of an attribute.' }, 'name': 'attributeId', 'type': 'ViAttr' }, { 'direction': 'in', 'documentation': { 'description': 'Number of bytes in attributeValue. You can IVI-dance with this.' }, 'name': 'bufferSize', 'type': 'ViInt32' }, { 'direction': 'out', 'documentation': { 'description': 'Returns the value of the attribute.' }, 'name': 'attributeValue', 'size': { 'mechanism': 'ivi-dance', 'value': 'bufferSize' }, 'type': 'ViChar[]' } ], 'returns': 'ViStatus' }, 'GetCalDateAndTime': { 'codegen_method': 'public', 'documentation': { 'description': 'Returns the date and time of the last calibration performed.' }, 'parameters': [ { 'direction': 'in', 'documentation': { 'description': 'Identifies a particular instrument session.' }, 'name': 'vi', 'type': 'ViSession' }, { 'direction': 'in', 'documentation': { 'description': 'Specifies the type of calibration performed (external or self-calibration).' }, 'name': 'calType', 'type': 'ViInt32' }, { 'direction': 'out', 'documentation': { 'description': 'Indicates the **month** of the last calibration.' }, 'name': 'month', 'type': 'ViInt32' }, { 'direction': 'out', 'documentation': { 'description': 'Indicates the **day** of the last calibration.' }, 'name': 'day', 'type': 'ViInt32' }, { 'direction': 'out', 'documentation': { 'description': 'Indicates the **year** of the last calibration.' }, 'name': 'year', 'type': 'ViInt32' }, { 'direction': 'out', 'documentation': { 'description': 'Indicates the **hour** of the last calibration.' }, 'name': 'hour', 'type': 'ViInt32' }, { 'direction': 'out', 'documentation': { 'description': 'Indicates the **minute** of the last calibration.' }, 'name': 'minute', 'type': 'ViInt32' } ], 'returns': 'ViStatus' }, 'GetCalInterval': { 'documentation': { 'description': 'Returns the recommended maximum interval, in **months**, between external calibrations.' }, 'parameters': [ { 'direction': 'in', 'documentation': { 'description': 'Identifies a particular instrument session.' }, 'name': 'vi', 'type': 'ViSession' }, { 'direction': 'out', 'documentation': { 'description': 'Specifies the recommended maximum interval, in **months**, between external calibrations.' }, 'name': 'months', 'python_api_converter_name': 'convert_month_to_timedelta', 'type': 'ViInt32', 'type_in_documentation': 'hightime.timedelta' } ], 'returns': 'ViStatus' }, 'GetCustomType': { 'documentation': { 'description': 'This function returns a custom type.' }, 'parameters': [ { 'direction': 'in', 'documentation': { 'description': 'Identifies a particular instrument session.' }, 'name': 'vi', 'type': 'ViSession' }, { 'direction': 'out', 'documentation': { 'description': 'Set using custom type' }, 'name': 'cs', 'type': 'struct CustomStruct', 'grpc_type': 'FakeCustomStruct' } ], 'returns': 'ViStatus' }, 'GetCustomTypeArray': { 'codegen_method': 'public', 'documentation': { 'description': 'This function returns a custom type.' }, 'parameters': [ { 'direction': 'in', 'documentation': { 'description': 'Identifies a particular instrument session.' }, 'name': 'vi', 'type': 'ViSession' }, { 'direction': 'in', 'documentation': { 'description': 'Number of elements in the array.' }, 'name': 'numberOfElements', 'type': 'ViInt32' }, { 'direction': 'out', 'documentation': { 'description': 'Get using custom type' }, 'name': 'cs', 'size': { 'mechanism': 'passed-in', 'value': 'numberOfElements' }, 'type': 'struct CustomStruct[]', 'grpc_type': 'repeated FakeCustomStruct' } ], 'returns': 'ViStatus' }, 'GetEnumValue': { 'codegen_method': 'public', 'documentation': { 'description': 'Returns an enum value', 'note': 'Splinter is not supported.' }, 'parameters': [ { 'direction': 'in', 'documentation': { 'description': 'Identifies a particular instrument session.' }, 'name': 'vi', 'type': 'ViSession' }, { 'direction': 'out', 'documentation': { 'description': 'This is an amount.', 'note': 'The amount will be between -2^31 and (2^31-1)' }, 'name': 'aQuantity', 'type': 'ViInt32' }, { 'direction': 'out', 'documentation': { 'description': 'Indicates a ninja turtle', 'table_body': [ [ '0', 'Leonardo' ], [ '1', 'Donatello' ], [ '2', 'Raphael' ], [ '3', 'Mich elangelo' ] ] }, 'enum': 'Turtle', 'name': 'aTurtle', 'type': 'ViInt16' } ], 'returns': 'ViStatus' }, 'GetError': { 'codegen_method': 'private', 'documentation': { 'description': 'Returns the error information associated with the session.' }, 'is_error_handling': True, 'parameters': [ { 'direction': 'in', 'documentation': { 'description': 'Identifies a particular instrument session.' }, 'name': 'vi', 'type': 'ViSession' }, { 'direction': 'out', 'documentation': { 'description': 'Returns errorCode for the session. If you pass 0 for bufferSize, you can pass VI_NULL for this.' }, 'name': 'errorCode', 'type': 'ViStatus' }, { 'direction': 'in', 'documentation': { 'description': 'Number of bytes in description buffer.' }, 'name': 'bufferSize', 'type': 'ViInt32' }, { 'direction': 'out', 'documentation': { 'description': 'At least bufferSize big, string comes out here.' }, 'name': 'description', 'size': { 'mechanism': 'ivi-dance', 'value': 'bufferSize' }, 'type': 'ViChar[]' } ], 'returns': 'ViStatus', 'use_session_lock': False }, 'GetViUInt8': { 'codegen_method': 'public', 'parameters': [ { 'direction': 'in', 'name': 'vi', 'type': 'ViSession' }, { 'direction': 'out', 'name': 'aUint8Number', 'type': 'ViUInt8' } ], 'returns': 'ViStatus' }, 'GetViInt32Array': { 'parameters': [ { 'direction': 'in', 'name': 'vi', 'type': 'ViSession' }, { 'direction': 'in', 'name': 'arrayLen', 'type': 'ViInt32' }, { 'direction': 'out', 'name': 'int32Array', 'type': 'ViInt32[]', 'size': { 'mechanism': 'passed-in', 'value': 'arrayLen' } } ], 'returns': 'ViStatus' }, 'GetViUInt32Array': { 'parameters': [ { 'direction': 'in', 'name': 'vi', 'type': 'ViSession' }, { 'direction': 'in', 'name': 'arrayLen', 'type': 'ViInt32' }, { 'direction': 'out', 'name': 'uInt32Array', 'type': 'ViUInt32[]', 'size': { 'mechanism': 'passed-in', 'value': 'arrayLen' } } ], 'returns': 'ViStatus' }, 'ImportAttributeConfigurationBuffer': { 'documentation': { 'description': 'Import configuration buffer.' }, 'parameters': [ { 'direction': 'in', 'name': 'vi', 'type': 'ViSession' }, { 'direction': 'in', 'name': 'sizeInBytes', 'type': 'ViInt32' }, { 'direction': 'in', 'name': 'configuration', 'python_api_converter_name': 'convert_to_bytes', 'size': { 'mechanism': 'len', 'value': 'sizeInBytes' }, 'type': 'ViInt8[]', 'type_in_documentation': 'bytes' } ], 'returns': 'ViStatus' }, 'InitWithOptions': { 'codegen_method': 'public', 'init_method': True, 'documentation': { 'description': 'Creates a new IVI instrument driver session.' }, 'parameters': [ { 'direction': 'in', 'documentation': { 'caution': 'This is just some string.', 'description': 'Contains the **resource_name** of the device to initialize.' }, 'name': 'resourceName', 'type': 'ViString' }, { 'default_value': False, 'direction': 'in', 'documentation': { 'description': 'NI-FAKE is probably not needed.', 'table_body': [ [ 'VI_TRUE (default)', '1', 'Perform ID Query' ], [ 'VI_FALSE', '0', 'Skip ID Query' ] ] }, 'name': 'idQuery', 'type': 'ViBoolean', 'use_in_python_api': False }, { 'default_value': False, 'direction': 'in', 'documentation': { 'description': 'Specifies whether to reset', 'table_body': [ [ 'VI_TRUE (default)', '1', 'Reset Device' ], [ 'VI_FALSE', '0', "Don't Reset" ] ] }, 'name': 'resetDevice', 'type': 'ViBoolean' }, { 'direction': 'in', 'documentation': { 'description': 'Some options' }, 'name': 'optionString', 'python_api_converter_name': 'convert_init_with_options_dictionary', 'type': 'ViConstString', 'type_in_documentation': 'dict' }, { 'direction': 'out', 'documentation': { 'description': 'Returns a ViSession handle that you use.' }, 'name': 'vi', 'type': 'ViSession' } ], 'returns': 'ViStatus', 'use_session_lock': False }, 'Initiate': { 'codegen_method': 'private', 'documentation': { 'description': 'Initiates a thingie.' }, 'parameters': [ { 'direction': 'in', 'documentation': { 'description': 'Identifies a particular instrument session.' }, 'name': 'vi', 'type': 'ViSession' } ], 'returns': 'ViStatus' }, 'InitExtCal': { 'codegen_method': 'public', 'init_method' : True, 'custom_close' : 'CloseExtCal(id, 0)', 'parameters': [ { 'name': 'resourceName', 'direction': 'in', 'type': 'ViRsrc' }, { 'name': 'calibrationPassword', 'direction': 'in', 'type': 'ViString' }, { 'name': 'vi', 'direction': 'out', 'type': 'ViSession' } ], 'returns': 'ViStatus' }, 'InitWithVarArgs': { 'codegen_method': 'public', 'init_method': True, 'parameters': [ { 'name': 'resourceName', 'direction': 'in', 'type': 'ViRsrc' }, { 'name': 'vi', 'direction': 'out', 'type': 'ViSession' }, { 'direction': 'in', 'name': 'stringArg', 'type': 'ViConstString', 'include_in_proto': False, 'repeating_argument': True, }, { 'direction': 'in', 'include_in_proto': False, 'enum': 'Turtle', 'name': 'turtle', 'repeating_argument': True, 'type': 'ViInt16' }, { 'direction': 'in', 'grpc_type': 'repeated StringAndTurtle', 'is_compound_type': True, 'max_length': 3, 'name': 'nameAndTurtle', 'repeated_var_args': True }, ], 'returns': 'ViStatus', }, 'LockSession': { 'codegen_method': 'no', 'documentation': { 'description': 'Lock.' }, 'method_templates': [ { 'documentation_filename': 'lock', 'method_python_name_suffix': '', 'session_filename': 'lock' } ], 'parameters': [ { 'direction': 'in', 'documentation': { 'description': 'Identifies a particular instrument session.' }, 'name': 'vi', 'type': 'ViSession' }, { 'direction': 'out', 'documentation': { 'description': 'Optional' }, 'name': 'callerHasLock', 'type': 'ViBoolean' } ], 'python_name': 'lock', 'render_in_session_base': True, 'returns': 'ViStatus', 'use_session_lock': False }, 'MultipleArrayTypes': { 'codegen_method': 'public', 'documentation': { 'description': 'Receives and returns multiple types of arrays.' }, 'parameters': [ { 'direction': 'in', 'documentation': { 'description': 'Identifies a particular instrument session.' }, 'name': 'vi', 'type': 'ViSession' }, { 'direction': 'in', 'documentation': { 'description': 'Size of the array that will be returned.' }, 'name': 'outputArraySize', 'type': 'ViInt32' }, { 'direction': 'out', 'documentation': { 'description': 'Array that will be returned.', 'note': 'The size must be at least outputArraySize.' }, 'name': 'outputArray', 'size': { 'mechanism': 'passed-in', 'value': 'outputArraySize' }, 'type': 'ViReal64[]' }, { 'direction': 'out', 'documentation': { 'description': 'An array of doubles with fixed size.' }, 'name': 'outputArrayOfFixedLength', 'size': { 'mechanism': 'fixed', 'value': 3 }, 'type': 'ViReal64[]' }, { 'direction': 'in', 'documentation': { 'description': 'Size of inputArrayOfFloats and inputArrayOfIntegers' }, 'name': 'inputArraySizes', 'type': 'ViInt32' }, { 'direction': 'in', 'documentation': { 'description': 'Array of floats' }, 'name': 'inputArrayOfFloats', 'size': { 'mechanism': 'len', 'value': 'inputArraySizes' }, 'type': 'ViReal64[]' }, { 'default_value': None, 'direction': 'in', 'documentation': { 'description': 'Array of integers. Optional. If passed in then size must match that of inputArrayOfFloats.' }, 'name': 'inputArrayOfIntegers', 'size': { 'mechanism': 'len', 'value': 'inputArraySizes' }, 'type': 'ViInt16[]' } ], 'returns': 'ViStatus' }, 'MultipleArraysSameSize': { 'documentation': { 'description': 'Function to test multiple arrays that use the same size' }, 'parameters': [ { 'direction': 'in', 'documentation': { 'description': 'Identifies a particular instrument session.' }, 'name': 'vi', 'type': 'ViSession' }, { 'direction': 'in', 'documentation': { 'description': 'Array 1 of same size.' }, 'name': 'values1', 'size': { 'mechanism': 'len', 'value': 'size' }, 'type': 'ViReal64[]' }, { 'direction': 'in', 'documentation': { 'description': 'Array 2 of same size.' }, 'name': 'values2', 'size': { 'mechanism': 'len', 'value': 'size' }, 'type': 'ViReal64[]' }, { 'direction': 'in', 'documentation': { 'description': 'Array 3 of same size.' }, 'name': 'values3', 'size': { 'mechanism': 'len', 'value': 'size' }, 'type': 'ViReal64[]' }, { 'direction': 'in', 'documentation': { 'description': 'Array 4 of same size.' }, 'name': 'values4', 'size': { 'mechanism': 'len', 'value': 'size' }, 'type': 'ViReal64[]' }, { 'direction': 'in', 'documentation': { 'description': 'Size for all arrays' }, 'name': 'size', 'type': 'ViInt32' } ], 'returns': 'ViStatus' }, 'MultipleArraysSameSizeWithOptional': { 'documentation': { 'description': 'Function to test multiple arrays that use the same size' }, 'parameters': [ { 'direction': 'in', 'documentation': { 'description': 'Identifies a particular instrument session.' }, 'name': 'vi', 'type': 'ViSession' }, { 'direction': 'in', 'documentation': { 'description': 'Array 1 of same size.' }, 'name': 'values1', 'size': { 'mechanism': 'len', 'tags': [ 'optional' ], 'value': 'size' }, 'type': 'ViReal64[]' }, { 'direction': 'in', 'documentation': { 'description': 'Array 2 of same size.' }, 'name': 'values2', 'size': { 'mechanism': 'len', 'tags': [ 'optional' ], 'value': 'size' }, 'type': 'ViReal64[]' }, { 'direction': 'in', 'documentation': { 'description': 'Array 3 of same size.' }, 'name': 'values3', 'size': { 'mechanism': 'len', 'tags': [ 'optional' ], 'value': 'size' }, 'type': 'ViReal64[]' }, { 'direction': 'in', 'documentation': { 'description': 'Array 4 of same size.' }, 'name': 'values4', 'size': { 'mechanism': 'len', 'tags': [ 'optional' ], 'value': 'size' }, 'type': 'ViReal64[]' }, { 'direction': 'in', 'documentation': { 'description': 'Size for all arrays' }, 'name': 'size', 'type': 'ViInt32' } ], 'returns': 'ViStatus' }, 'OneInputFunction': { 'codegen_method': 'public', 'documentation': { 'description': 'This function takes one parameter other than the session.' }, 'parameters': [ { 'direction': 'in', 'documentation': { 'description': 'Identifies a particular instrument session. You obtain the **vi** parameter from niFake_InitWithOptions.' }, 'name': 'vi', 'type': 'ViSession' }, { 'direction': 'in', 'documentation': { 'description': 'Contains a number' }, 'name': 'aNumber', 'type': 'ViInt32' } ], 'returns': 'ViStatus' }, 'ParametersAreMultipleTypes': { 'codegen_method': 'public', 'documentation': { 'description': 'Has parameters of multiple types.' }, 'parameters': [ { 'direction': 'in', 'documentation': { 'description': 'Identifies a particular instrument session.' }, 'name': 'vi', 'type': 'ViSession' }, { 'direction': 'in', 'documentation': { 'description': 'Contains a boolean.' }, 'name': 'aBoolean', 'type': 'ViBoolean' }, { 'direction': 'in', 'documentation': { 'description': 'Contains a 32-bit integer.' }, 'name': 'anInt32', 'type': 'ViInt32' }, { 'direction': 'in', 'documentation': { 'description': 'Contains a 64-bit integer.' }, 'name': 'anInt64', 'type': 'ViInt64' }, { 'direction': 'in', 'documentation': { 'description': 'Indicates a ninja turtle', 'table_body': [ [ '0', 'Leonardo' ], [ '1', 'Donatello' ], [ '2', 'Raphael' ], [ '3', 'Mich elangelo' ] ] }, 'enum': 'Turtle', 'name': 'anIntEnum', 'type': 'ViInt16' }, { 'direction': 'in', 'documentation': { 'description': 'The measured value.' }, 'name': 'aFloat', 'type': 'ViReal64' }, { 'direction': 'in', 'documentation': { 'description': 'A float enum.' }, 'enum': 'FloatEnum', 'name': 'aFloatEnum', 'type': 'ViReal64' }, { 'direction': 'in', 'documentation': { 'description': 'Number of bytes allocated for aString' }, 'name': 'stringSize', 'type': 'ViInt32' }, { 'direction': 'in', 'documentation': { 'description': 'An IVI dance string.' }, 'name': 'aString', 'size': { 'mechanism': 'len', 'value': 'stringSize' }, 'type': 'ViConstString' } ], 'returns': 'ViStatus' }, 'PoorlyNamedSimpleFunction': { 'codegen_method': 'public', 'documentation': { 'description': 'This function takes no parameters other than the session.' }, 'parameters': [ { 'direction': 'in', 'documentation': { 'description': 'Identifies a particular instrument session. You obtain the **vi** parameter from niFake_InitWithOptions.' }, 'name': 'vi', 'type': 'ViSession' } ], 'python_name': 'simple_function', 'returns': 'ViStatus' }, 'Read': { 'codegen_method': 'public', 'documentation': { 'description': 'Acquires a single measurement and returns the measured value.' }, 'parameters': [ { 'direction': 'in', 'documentation': { 'description': 'Identifies a particular instrument session.' }, 'name': 'vi', 'type': 'ViSession' }, { 'direction': 'in', 'documentation': { 'description': 'Specifies the **maximum_time** allowed in seconds.' }, 'name': 'maximumTime', 'python_api_converter_name': 'convert_timedelta_to_seconds_real64', 'type': 'ViReal64', 'type_in_documentation': 'hightime.timedelta' }, { 'direction': 'out', 'documentation': { 'description': 'The measured value.' }, 'name': 'reading', 'type': 'ViReal64' } ], 'returns': 'ViStatus' }, 'ReadDataWithInOutIviTwist': { 'parameters': [ { 'direction': 'out', 'name': 'data', 'size': { 'mechanism': 'ivi-dance-with-a-twist', 'value': 'bufferSize', 'value_twist': 'bufferSize' }, 'type': 'ViInt32[]' }, { 'name': 'bufferSize', 'direction': 'out', 'type': 'ViInt32' } ], 'returns': 'ViStatus' }, 'ReadFromChannel': { 'codegen_method': 'public', 'documentation': { 'description': 'Acquires a single measurement and returns the measured value.' }, 'parameters': [ { 'direction': 'in', 'documentation': { 'description': 'Identifies a particular instrument session.' }, 'name': 'vi', 'type': 'ViSession' }, { 'direction': 'in', 'documentation': { 'description': 'This is the channel(s) that this function will apply to.' }, 'name': 'channelName', 'type': 'ViConstString' }, { 'direction': 'in', 'documentation': { 'description': 'Specifies the **maximum_time** allowed in milliseconds.' }, 'name': 'maximumTime', 'python_api_converter_name': 'convert_timedelta_to_milliseconds_int32', 'type': 'ViInt32', 'type_in_documentation': 'hightime.timedelta' }, { 'direction': 'out', 'documentation': { 'description': 'The measured value.' }, 'name': 'reading', 'type': 'ViReal64' } ], 'returns': 'ViStatus' }, 'ReturnANumberAndAString': { 'codegen_method': 'public', 'documentation': { 'description': 'Returns a number and a string.', 'note': 'This function rules!' }, 'parameters': [ { 'direction': 'in', 'documentation': { 'description': 'Identifies a particular instrument session.' }, 'name': 'vi', 'type': 'ViSession' }, { 'direction': 'out', 'documentation': { 'description': 'Contains a number.' }, 'name': 'aNumber', 'type': 'ViInt16' }, { 'direction': 'out', 'documentation': { 'description': 'Contains a string. Buffer must be 256 bytes or larger.' }, 'name': 'aString', 'size': { 'mechanism': 'fixed', 'value': 256 }, 'type': 'ViChar[]' } ], 'returns': 'ViStatus' }, 'ReturnDurationInSeconds': { 'codegen_method': 'public', 'documentation': { 'description': 'Returns a hightime.timedelta instance.' }, 'parameters': [ { 'direction': 'in', 'documentation': { 'description': 'Identifies a particular instrument session.' }, 'name': 'vi', 'type': 'ViSession' }, { 'direction': 'out', 'documentation': { 'description': 'Duration in seconds.' }, 'name': 'timedelta', 'python_api_converter_name': 'convert_seconds_real64_to_timedelta', 'type': 'ViReal64', 'type_in_documentation': 'hightime.timedelta' } ], 'returns': 'ViStatus' }, 'ReturnListOfDurationsInSeconds': { 'codegen_method': 'public', 'documentation': { 'description': 'Returns a list of hightime.timedelta instances.' }, 'parameters': [ { 'direction': 'in', 'documentation': { 'description': 'Identifies a particular instrument session.' }, 'name': 'vi', 'type': 'ViSession' }, { 'direction': 'in', 'documentation': { 'description': 'Number of elements in output.' }, 'name': 'numberOfElements', 'type': 'ViInt32' }, { 'direction': 'out', 'documentation': { 'description': 'Contains a list of hightime.timedelta instances.' }, 'name': 'timedeltas', 'python_api_converter_name': 'convert_seconds_real64_to_timedeltas', 'size': { 'mechanism': 'passed-in', 'value': 'numberOfElements' }, 'type': 'ViReal64[]', 'type_in_documentation': 'hightime.timedelta' } ], 'returns': 'ViStatus' }, 'ReturnMultipleTypes': { 'codegen_method': 'public', 'documentation': { 'description': 'Returns multiple types.' }, 'parameters': [ { 'direction': 'in', 'documentation': { 'description': 'Identifies a particular instrument session.' }, 'name': 'vi', 'type': 'ViSession' }, { 'direction': 'out', 'documentation': { 'description': 'Contains a boolean.' }, 'name': 'aBoolean', 'type': 'ViBoolean' }, { 'direction': 'out', 'documentation': { 'description': 'Contains a 32-bit integer.' }, 'name': 'anInt32', 'type': 'ViInt32' }, { 'direction': 'out', 'documentation': { 'description': 'Contains a 64-bit integer.' }, 'name': 'anInt64', 'type': 'ViInt64' }, { 'direction': 'out', 'documentation': { 'description': 'Indicates a ninja turtle', 'table_body': [ [ '0', 'Leonardo' ], [ '1', 'Donatello' ], [ '2', 'Raphael' ], [ '3', 'Mich elangelo' ] ] }, 'enum': 'Turtle', 'name': 'anIntEnum', 'type': 'ViInt16' }, { 'direction': 'out', 'documentation': { 'description': 'The measured value.' }, 'name': 'aFloat', 'type': 'ViReal64' }, { 'direction': 'out', 'documentation': { 'description': 'A float enum.' }, 'enum': 'FloatEnum', 'name': 'aFloatEnum', 'type': 'ViReal64' }, { 'direction': 'in', 'documentation': { 'description': 'Number of measurements to acquire.' }, 'name': 'arraySize', 'type': 'ViInt32' }, { 'direction': 'out', 'documentation': { 'description': 'An array of measurement values.', 'note': 'The size must be at least arraySize.' }, 'name': 'anArray', 'size': { 'mechanism': 'passed-in', 'value': 'arraySize' }, 'type': 'ViReal64[]' }, { 'direction': 'in', 'documentation': { 'description': 'Number of bytes allocated for aString' }, 'name': 'stringSize', 'type': 'ViInt32' }, { 'direction': 'out', 'documentation': { 'description': 'An IVI dance string.' }, 'name': 'aString', 'size': { 'mechanism': 'ivi-dance', 'value': 'stringSize' }, 'type': 'ViChar[]' } ], 'returns': 'ViStatus' }, 'SetAttributeViBoolean': { 'codegen_method': 'private', 'documentation': { 'description': 'This function sets the value of a ViBoolean attribute.' }, 'parameters': [ { 'direction': 'in', 'documentation': { 'description': 'Identifies a particular instrument session.' }, 'name': 'vi', 'type': 'ViSession' }, { 'direction': 'in', 'documentation': { 'description': 'This is the channel(s) that this function will apply to.' }, 'name': 'channelName', 'type': 'ViConstString' }, { 'direction': 'in', 'documentation': { 'description': 'Pass the ID of an attribute.' }, 'name': 'attributeId', 'type': 'ViAttr' }, { 'direction': 'in', 'documentation': { 'description': 'Pass the value that you want to set the attribute to.' }, 'name': 'attributeValue', 'type': 'ViBoolean' } ], 'returns': 'ViStatus' }, 'SetAttributeViInt32': { 'codegen_method': 'private', 'documentation': { 'description': 'This function sets the value of a ViInt32 attribute.' }, 'parameters': [ { 'direction': 'in', 'documentation': { 'description': 'Identifies a particular instrument session.' }, 'name': 'vi', 'type': 'ViSession' }, { 'direction': 'in', 'documentation': { 'description': 'This is the channel(s) that this function will apply to.' }, 'name': 'channelName', 'type': 'ViConstString' }, { 'direction': 'in', 'documentation': { 'description': 'Pass the ID of an attribute.' }, 'name': 'attributeId', 'type': 'ViAttr' }, { 'direction': 'in', 'documentation': { 'description': 'Pass the value that you want to set the attribute to.' }, 'name': 'attributeValue', 'type': 'ViInt32' } ], 'returns': 'ViStatus' }, 'SetAttributeViInt64': { 'codegen_method': 'private', 'documentation': { 'description': 'This function sets the value of a ViInt64 attribute.' }, 'parameters': [ { 'direction': 'in', 'documentation': { 'description': 'Identifies a particular instrument session.' }, 'name': 'vi', 'type': 'ViSession' }, { 'direction': 'in', 'documentation': { 'description': 'This is the channel(s) that this function will apply to.' }, 'name': 'channelName', 'type': 'ViConstString' }, { 'direction': 'in', 'documentation': { 'description': 'Pass the ID of an attribute.' }, 'name': 'attributeId', 'type': 'ViAttr' }, { 'direction': 'in', 'documentation': { 'description': 'Pass the value that you want to set the attribute to.' }, 'name': 'attributeValue', 'type': 'ViInt64' } ], 'returns': 'ViStatus' }, 'SetAttributeViReal64': { 'codegen_method': 'private', 'documentation': { 'description': 'This function sets the value of a ViReal64 attribute.' }, 'parameters': [ { 'direction': 'in', 'documentation': { 'description': 'Identifies a particular instrument session.' }, 'name': 'vi', 'type': 'ViSession' }, { 'direction': 'in', 'documentation': { 'description': 'This is the channel(s) that this function will apply to.' }, 'name': 'channelName', 'type': 'ViConstString' }, { 'direction': 'in', 'documentation': { 'description': 'Pass the ID of an attribute.' }, 'name': 'attributeId', 'type': 'ViAttr' }, { 'direction': 'in', 'documentation': { 'description': 'Pass the value that you want to set the attribute to.' }, 'name': 'attributeValue', 'type': 'ViReal64' } ], 'returns': 'ViStatus' }, 'SetAttributeViString': { 'codegen_method': 'private', 'documentation': { 'description': 'This function sets the value of a ViString attribute.' }, 'parameters': [ { 'direction': 'in', 'documentation': { 'description': 'Identifies a particular instrument session.' }, 'name': 'vi', 'type': 'ViSession' }, { 'direction': 'in', 'documentation': { 'description': 'This is the channel(s) that this function will apply to.' }, 'name': 'channelName', 'type': 'ViConstString' }, { 'direction': 'in', 'documentation': { 'description': 'Pass the ID of an attribute.' }, 'name': 'attributeId', 'type': 'ViAttr' }, { 'direction': 'in', 'documentation': { 'description': 'Pass the value that you want to set the attribute to.' }, 'name': 'attributeValue', 'type': 'ViConstString' } ], 'returns': 'ViStatus' }, 'SetCustomType': { 'documentation': { 'description': 'This function takes a custom type.' }, 'parameters': [ { 'direction': 'in', 'documentation': { 'description': 'Identifies a particular instrument session.' }, 'name': 'vi', 'type': 'ViSession' }, { 'direction': 'in', 'documentation': { 'description': 'Set using custom type' }, 'name': 'cs', 'type': 'struct CustomStruct', 'grpc_type': 'FakeCustomStruct' } ], 'returns': 'ViStatus' }, 'SetCustomTypeArray': { 'documentation': { 'description': 'This function takes an array of custom types.' }, 'parameters': [ { 'direction': 'in', 'documentation': { 'description': 'Identifies a particular instrument session.' }, 'name': 'vi', 'type': 'ViSession' }, { 'direction': 'in', 'documentation': { 'description': 'Number of elements in the array.' }, 'name': 'numberOfElements', 'type': 'ViInt32' }, { 'direction': 'in', 'documentation': { 'description': 'Set using custom type' }, 'name': 'cs', 'size': { 'mechanism': 'len', 'value': 'numberOfElements' }, 'type': 'struct CustomStruct[]', 'grpc_type': 'repeated FakeCustomStruct' } ], 'returns': 'ViStatus' }, 'StringValuedEnumInputFunctionWithDefaults': { 'codegen_method': 'public', 'documentation': { 'description': 'This function takes one parameter other than the session, which happens to be a string-valued enum and has a default value.' }, 'parameters': [ { 'direction': 'in', 'documentation': { 'description': 'Identifies a particular instrument session. You obtain the **vi**' }, 'name': 'vi', 'type': 'ViSession' }, { 'default_value': 'MobileOSNames.ANDROID', 'direction': 'in', 'documentation': { 'description': 'Indicates a Mobile OS', 'table_body': [ [ 'ANDROID', 'Android' ], [ 'IOS', 'iOS' ], [ 'NONE', 'None' ] ] }, 'enum': 'MobileOSNames', 'name': 'aMobileOSName', 'type': 'ViConstString' } ], 'returns': 'ViStatus' }, 'TwoInputFunction': { 'codegen_method': 'public', 'documentation': { 'description': 'This function takes two parameters other than the session.' }, 'parameters': [ { 'direction': 'in', 'documentation': { 'description': 'Identifies a particular instrument session. You obtain the **vi** parameter from niFake_InitWithOptions.' }, 'name': 'vi', 'type': 'ViSession' }, { 'direction': 'in', 'documentation': { 'description': 'Contains a number' }, 'name': 'aNumber', 'type': 'ViReal64' }, { 'direction': 'in', 'documentation': { 'description': 'Contains a string' }, 'name': 'aString', 'type': 'ViString' } ], 'returns': 'ViStatus' }, 'UnlockSession': { 'codegen_method': 'no', 'documentation': { 'description': 'Unlock' }, 'method_templates': [ { 'documentation_filename': 'unlock', 'method_python_name_suffix': '', 'session_filename': 'unlock' } ], 'parameters': [ { 'direction': 'in', 'documentation': { 'description': 'Identifies a particular instrument session.' }, 'name': 'vi', 'type': 'ViSession' }, { 'direction': 'out', 'documentation': { 'description': 'Optional' }, 'name': 'callerHasLock', 'type': 'ViBoolean' } ], 'python_name': 'unlock', 'render_in_session_base': True, 'returns': 'ViStatus', 'use_session_lock': False }, 'Use64BitNumber': { 'codegen_method': 'public', 'documentation': { 'description': 'Returns a number and a string.', 'note': 'This function rules!' }, 'parameters': [ { 'direction': 'in', 'documentation': { 'description': 'Identifies a particular instrument session.' }, 'name': 'vi', 'type': 'ViSession' }, { 'direction': 'in', 'documentation': { 'description': 'A big number on its way in.' }, 'name': 'input', 'type': 'ViInt64' }, { 'direction': 'out', 'documentation': { 'description': 'A big number on its way out.' }, 'name': 'output', 'type': 'ViInt64' } ], 'returns': 'ViStatus' }, 'WriteWaveform': { 'codegen_method': 'public', 'documentation': { 'description': 'Writes waveform to the driver' }, 'method_templates': [ { 'documentation_filename': 'default_method', 'method_python_name_suffix': '', 'session_filename': 'default_method' }, { 'documentation_filename': 'numpy_method', 'method_python_name_suffix': '_numpy', 'session_filename': 'numpy_write_method' } ], 'parameters': [ { 'direction': 'in', 'documentation': { 'description': 'Identifies a particular instrument session.' }, 'name': 'vi', 'type': 'ViSession' }, { 'direction': 'in', 'documentation': { 'description': 'How many samples the waveform contains.' }, 'name': 'numberOfSamples', 'type': 'ViInt32' }, { 'direction': 'in', 'documentation': { 'description': 'Waveform data.' }, 'name': 'waveform', 'numpy': True, 'size': { 'mechanism': 'len', 'value': 'numberOfSamples' }, 'type': 'ViReal64[]', 'use_array': True } ], 'returns': 'ViStatus' }, 'close': { 'codegen_method': 'public', 'documentation': { 'description': 'Closes the specified session and deallocates resources that it reserved.' }, 'parameters': [ { 'direction': 'in', 'documentation': { 'description': 'Identifies a particular instrument session.' }, 'name': 'vi', 'type': 'ViSession' } ], 'python_name': '_close', 'returns': 'ViStatus', 'use_session_lock': False }, 'CloseExtCal': { 'codegen_method': 'public', 'custom_close_method': True, 'parameters': [ { 'name': 'vi', 'direction': 'in', 'type': 'ViSession' }, { 'name': 'action', 'direction': 'in', 'type': 'ViInt32' } ], 'returns': 'ViStatus' }, 'error_message': { 'codegen_method': 'private', 'documentation': { 'description': 'Takes the errorCode returned by a functiona and returns it as a user-readable string.' }, 'is_error_handling': True, 'parameters': [ { 'direction': 'in', 'documentation': { 'description': 'Identifies a particular instrument session.' }, 'name': 'vi', 'type': 'ViSession' }, { 'direction': 'in', 'documentation': { 'description': 'The errorCode returned from the instrument.' }, 'name': 'errorCode', 'type': 'ViStatus' }, { 'direction': 'out', 'documentation': { 'description': 'The error information formatted into a string.' }, 'name': 'errorMessage', 'size': { 'mechanism': 'fixed', 'value': 256 }, 'type': 'ViChar[]' } ], 'returns': 'ViStatus', 'use_session_lock': False }, 'self_test': { 'codegen_method': 'private', 'documentation': { 'description': 'Performs a self-test.' }, 'parameters': [ { 'direction': 'in', 'documentation': { 'description': 'Identifies a particular instrument session. You obtain the **vi** parameter from niFake_InitWithOptions.' }, 'name': 'vi', 'type': 'ViSession' }, { 'direction': 'out', 'documentation': { 'description': 'Contains the value returned from the instrument self-test. Zero indicates success.' }, 'name': 'selfTestResult', 'type': 'ViInt16' }, { 'direction': 'out', 'documentation': { 'description': 'This parameter contains the string returned from the instrument self-test. The array must contain at least 256 elements.' }, 'name': 'selfTestMessage', 'size': { 'mechanism': 'fixed', 'value': 256 }, 'type': 'ViChar[]' } ], 'returns': 'ViStatus' }, 'ViUInt8ArrayInputFunction': { 'codegen_method': 'public', 'parameters': [ { 'direction': 'in', 'name': 'vi', 'type': 'ViSession' }, { 'direction': 'in', 'name': 'numberOfElements', 'type': 'ViInt32' }, { 'direction': 'in', 'name': 'anArray', 'size': { 'mechanism': 'passed-in', 'value': 'numberOfElements' }, 'type': 'ViUInt8[]' } ], 'returns': 'ViStatus' }, 'ViUInt8ArrayOutputFunction': { 'codegen_method': 'public', 'parameters': [ { 'direction': 'in', 'name': 'vi', 'type': 'ViSession' }, { 'direction': 'in', 'name': 'numberOfElements', 'type': 'ViInt32' }, { 'direction': 'out', 'name': 'anArray', 'size': { 'mechanism': 'passed-in', 'value': 'numberOfElements' }, 'type': 'ViUInt8[]' } ], 'returns': 'ViStatus' }, 'ViInt16ArrayInputFunction': { 'codegen_method': 'public', 'parameters': [ { 'direction': 'in', 'name': 'vi', 'type': 'ViSession' }, { 'direction': 'in', 'name': 'numberOfElements', 'type': 'ViInt32' }, { 'direction': 'in', 'name': 'anArray', 'size': { 'mechanism': 'len', 'value': 'numberOfElements' }, 'type': 'ViInt16[]' } ], 'returns': 'ViStatus' } }
functions = {'Abort': {'codegen_method': 'public', 'documentation': {'description': 'Aborts a previously initiated thingie.'}, 'parameters': [{'direction': 'in', 'documentation': {'description': 'Identifies a particular instrument session.'}, 'name': 'vi', 'type': 'ViSession'}], 'returns': 'ViStatus'}, 'AcceptListOfDurationsInSeconds': {'codegen_method': 'public', 'documentation': {'description': 'Accepts list of floats or hightime.timedelta instances representing time delays.'}, 'parameters': [{'direction': 'in', 'documentation': {'description': 'Identifies a particular instrument session.'}, 'name': 'vi', 'type': 'ViSession'}, {'direction': 'in', 'documentation': {'description': 'Count of input values.'}, 'name': 'count', 'type': 'ViInt32'}, {'direction': 'in', 'documentation': {'description': 'A collection of time delay values.'}, 'name': 'delays', 'python_api_converter_name': 'convert_timedeltas_to_seconds_real64', 'size': {'mechanism': 'len', 'value': 'count'}, 'type': 'ViReal64[]', 'type_in_documentation': 'hightime.timedelta, datetime.timedelta, or float in seconds'}], 'returns': 'ViStatus'}, 'AcceptViSessionArray': {'codegen_method': 'public', 'parameters': [{'direction': 'in', 'name': 'sessionCount', 'type': 'ViUInt32'}, {'direction': 'in', 'name': 'sessionArray', 'type': 'ViSession[]', 'size': {'mechanism': 'passed-in', 'value': 'sessionCount'}}], 'returns': 'ViStatus'}, 'AcceptViUInt32Array': {'parameters': [{'direction': 'in', 'name': 'vi', 'type': 'ViSession'}, {'direction': 'in', 'name': 'arrayLen', 'type': 'ViInt32'}, {'direction': 'in', 'name': 'uInt32Array', 'type': 'ViUInt32[]', 'size': {'mechanism': 'len', 'value': 'arrayLen'}}], 'returns': 'ViStatus'}, 'BoolArrayOutputFunction': {'codegen_method': 'public', 'documentation': {'description': 'This function returns an array of booleans.'}, 'parameters': [{'direction': 'in', 'documentation': {'description': 'Identifies a particular instrument session. You obtain the **vi** parameter from niFake_InitWithOptions.'}, 'name': 'vi', 'type': 'ViSession'}, {'direction': 'in', 'documentation': {'description': 'Number of elements in the array.'}, 'name': 'numberOfElements', 'type': 'ViInt32'}, {'direction': 'out', 'documentation': {'description': 'Contains an array of booleans'}, 'name': 'anArray', 'size': {'mechanism': 'passed-in', 'value': 'numberOfElements'}, 'type': 'ViBoolean[]'}], 'returns': 'ViStatus'}, 'BoolArrayInputFunction': {'codegen_method': 'public', 'documentation': {'description': 'This function accepts an array of booleans.'}, 'parameters': [{'direction': 'in', 'documentation': {'description': 'Identifies a particular instrument session. You obtain the **vi** parameter from niFake_InitWithOptions.'}, 'name': 'vi', 'type': 'ViSession'}, {'direction': 'in', 'documentation': {'description': 'Number of elements in the array.'}, 'name': 'numberOfElements', 'type': 'ViInt32'}, {'direction': 'in', 'documentation': {'description': 'Input boolean array'}, 'name': 'anArray', 'size': {'mechanism': 'passed-in', 'value': 'numberOfElements'}, 'type': 'ViBoolean[]'}], 'returns': 'ViStatus'}, 'CommandWithReservedParam': {'parameters': [{'direction': 'in', 'name': 'vi', 'type': 'ViSession'}, {'direction': 'in', 'include_in_proto': False, 'name': 'reserved', 'pointer': True, 'hardcoded_value': 'nullptr', 'type': 'ViBoolean'}], 'returns': 'ViStatus'}, 'CreateConfigurationList': {'parameters': [{'direction': 'in', 'name': 'numberOfListAttributes', 'type': 'ViInt32'}, {'direction': 'in', 'name': 'listAttributeIds', 'size': {'mechanism': 'len', 'value': 'numberOfListAttributes'}, 'type': 'ViAttr[]'}], 'returns': 'ViStatus'}, 'DoubleAllTheNums': {'documentation': {'description': 'Test for buffer with converter'}, 'parameters': [{'direction': 'in', 'documentation': {'description': 'Identifies a particular instrument session. You obtain the **vi** parameter from niFake_InitWithOptions.'}, 'name': 'vi', 'type': 'ViSession'}, {'direction': 'in', 'documentation': {'description': 'Number of elements in the number array'}, 'name': 'numberCount', 'type': 'ViInt32'}, {'direction': 'in', 'documentation': {'description': 'numbers is an array of numbers we want to double.'}, 'name': 'numbers', 'python_api_converter_name': 'convert_double_each_element', 'size': {'mechanism': 'len', 'value': 'numberCount'}, 'type': 'ViReal64[]'}], 'returns': 'ViStatus'}, 'EnumArrayOutputFunction': {'codegen_method': 'public', 'documentation': {'description': 'This function returns an array of enums, stored as 16 bit integers under the hood.'}, 'parameters': [{'direction': 'in', 'documentation': {'description': 'Identifies a particular instrument session. You obtain the **vi** parameter from niFake_InitWithOptions.'}, 'name': 'vi', 'type': 'ViSession'}, {'direction': 'in', 'documentation': {'description': 'Number of elements in the array.'}, 'name': 'numberOfElements', 'type': 'ViInt32'}, {'direction': 'out', 'documentation': {'description': 'Contains an array of enums, stored as 16 bit integers under the hood '}, 'enum': 'Turtle', 'name': 'anArray', 'size': {'mechanism': 'passed-in', 'value': 'numberOfElements'}, 'type': 'ViInt16[]'}], 'returns': 'ViStatus'}, 'EnumInputFunctionWithDefaults': {'codegen_method': 'public', 'documentation': {'description': 'This function takes one parameter other than the session, which happens to be an enum and has a default value.'}, 'parameters': [{'direction': 'in', 'documentation': {'description': 'Identifies a particular instrument session. You obtain the **vi** parameter from niFake_InitWithOptions.'}, 'name': 'vi', 'type': 'ViSession'}, {'default_value': 'Turtle.LEONARDO', 'direction': 'in', 'documentation': {'description': 'Indicates a ninja turtle', 'table_body': [['0', 'Leonardo'], ['1', 'Donatello'], ['2', 'Raphael'], ['3', 'Mich elangelo']]}, 'enum': 'Turtle', 'name': 'aTurtle', 'type': 'ViInt16'}], 'returns': 'ViStatus'}, 'ExportAttributeConfigurationBuffer': {'documentation': {'description': 'Export configuration buffer.'}, 'parameters': [{'direction': 'in', 'name': 'vi', 'type': 'ViSession'}, {'direction': 'in', 'name': 'sizeInBytes', 'type': 'ViInt32'}, {'direction': 'out', 'name': 'configuration', 'python_api_converter_name': 'convert_to_bytes', 'size': {'mechanism': 'ivi-dance', 'value': 'sizeInBytes'}, 'type': 'ViInt8[]', 'type_in_documentation': 'bytes', 'use_array': True}], 'returns': 'ViStatus'}, 'FetchWaveform': {'codegen_method': 'public', 'documentation': {'description': 'Returns waveform data.'}, 'method_templates': [{'documentation_filename': 'default_method', 'method_python_name_suffix': '', 'session_filename': 'default_method'}, {'documentation_filename': 'numpy_method', 'method_python_name_suffix': '_into', 'session_filename': 'numpy_read_method'}], 'parameters': [{'direction': 'in', 'documentation': {'description': 'Identifies a particular instrument session.'}, 'name': 'vi', 'type': 'ViSession'}, {'direction': 'in', 'documentation': {'description': 'Number of samples to return'}, 'name': 'numberOfSamples', 'type': 'ViInt32'}, {'direction': 'out', 'documentation': {'description': 'Samples fetched from the device. Array should be numberOfSamples big.'}, 'name': 'waveformData', 'numpy': True, 'size': {'mechanism': 'passed-in', 'value': 'numberOfSamples'}, 'type': 'ViReal64[]', 'use_array': True}, {'direction': 'out', 'documentation': {'description': 'Number of samples actually fetched.'}, 'name': 'actualNumberOfSamples', 'type': 'ViInt32', 'use_in_python_api': False}], 'returns': 'ViStatus'}, 'GetABoolean': {'codegen_method': 'public', 'documentation': {'description': 'Returns a boolean.', 'note': 'This function rules!'}, 'parameters': [{'direction': 'in', 'documentation': {'description': 'Identifies a particular instrument session.'}, 'name': 'vi', 'type': 'ViSession'}, {'direction': 'out', 'documentation': {'description': 'Contains a boolean.'}, 'name': 'aBoolean', 'type': 'ViBoolean'}], 'returns': 'ViStatus'}, 'GetANumber': {'codegen_method': 'public', 'documentation': {'description': 'Returns a number.', 'note': 'This function rules!'}, 'parameters': [{'direction': 'in', 'documentation': {'description': 'Identifies a particular instrument session.'}, 'name': 'vi', 'type': 'ViSession'}, {'direction': 'out', 'documentation': {'description': 'Contains a number.'}, 'name': 'aNumber', 'type': 'ViInt16'}], 'returns': 'ViStatus'}, 'GetAStringOfFixedMaximumSize': {'codegen_method': 'public', 'documentation': {'description': 'Illustrates returning a string of fixed size.'}, 'parameters': [{'direction': 'in', 'documentation': {'description': 'Identifies a particular instrument session.'}, 'name': 'vi', 'type': 'ViSession'}, {'direction': 'out', 'documentation': {'description': 'String comes back here. Buffer must be 256 big.'}, 'name': 'aString', 'size': {'mechanism': 'fixed', 'value': 256}, 'type': 'ViChar[]'}], 'returns': 'ViStatus'}, 'GetAStringUsingCustomCode': {'codegen_method': 'no', 'documentation': {'description': 'Returns a number and a string.', 'note': 'This function rules!'}, 'parameters': [{'direction': 'in', 'documentation': {'description': 'Identifies a particular instrument session.'}, 'name': 'vi', 'type': 'ViSession'}, {'direction': 'in', 'documentation': {'description': 'Contains a number.'}, 'name': 'aNumber', 'type': 'ViInt16'}, {'direction': 'out', 'documentation': {'description': 'Contains a string of length aNumber.'}, 'name': 'aString', 'size': {'mechanism': 'custom-code', 'value': 'a_number'}, 'type': 'ViChar[]'}], 'returns': 'ViStatus'}, 'GetBitfieldAsEnumArray': {'parameters': [{'bitfield_as_enum_array': 'Bitfield', 'direction': 'out', 'name': 'flags', 'type': 'ViInt64'}], 'returns': 'ViStatus'}, 'GetAnIviDanceString': {'codegen_method': 'public', 'documentation': {'description': 'Returns a string using the IVI dance.'}, 'parameters': [{'direction': 'in', 'documentation': {'description': 'Identifies a particular instrument session.'}, 'name': 'vi', 'type': 'ViSession'}, {'direction': 'in', 'documentation': {'description': 'Number of bytes in aString You can IVI-dance with this.'}, 'name': 'bufferSize', 'type': 'ViInt32'}, {'direction': 'out', 'documentation': {'description': 'Returns the string.'}, 'name': 'aString', 'size': {'mechanism': 'ivi-dance', 'value': 'bufferSize'}, 'type': 'ViChar[]'}], 'returns': 'ViStatus'}, 'GetAnIviDanceWithATwistArray': {'parameters': [{'name': 'vi', 'direction': 'in', 'type': 'ViSession'}, {'name': 'aString', 'direction': 'in', 'type': 'ViConstString'}, {'name': 'bufferSize', 'direction': 'in', 'type': 'ViInt32'}, {'name': 'arrayOut', 'direction': 'out', 'type': 'ViInt32[]', 'size': {'mechanism': 'ivi-dance-with-a-twist', 'value': 'bufferSize', 'value_twist': 'actualSize'}}, {'name': 'actualSize', 'direction': 'out', 'type': 'ViInt32'}], 'returns': 'ViStatus'}, 'GetAnIviDanceWithATwistArrayOfCustomType': {'parameters': [{'name': 'vi', 'direction': 'in', 'type': 'ViSession'}, {'name': 'bufferSize', 'direction': 'in', 'type': 'ViInt32'}, {'name': 'arrayOut', 'direction': 'out', 'type': 'struct CustomStruct[]', 'grpc_type': 'repeated FakeCustomStruct', 'size': {'mechanism': 'ivi-dance-with-a-twist', 'value': 'bufferSize', 'value_twist': 'actualSize'}}, {'name': 'actualSize', 'direction': 'out', 'type': 'ViInt32'}], 'returns': 'ViStatus'}, 'GetAnIviDanceWithATwistArrayWithInputArray': {'parameters': [{'direction': 'in', 'name': 'dataIn', 'size': {'mechanism': 'len', 'value': 'arraySizeIn'}, 'type': 'ViInt32[]'}, {'direction': 'in', 'name': 'arraySizeIn', 'type': 'ViInt32'}, {'name': 'bufferSize', 'direction': 'in', 'type': 'ViInt32'}, {'name': 'arrayOut', 'direction': 'out', 'type': 'ViInt32[]', 'size': {'mechanism': 'ivi-dance-with-a-twist', 'value': 'bufferSize', 'value_twist': 'actualSize'}}, {'name': 'actualSize', 'direction': 'out', 'type': 'ViInt32'}], 'returns': 'ViStatus'}, 'GetAnIviDanceWithATwistByteArray': {'parameters': [{'name': 'bufferSize', 'direction': 'in', 'type': 'ViInt32'}, {'name': 'arrayOut', 'direction': 'out', 'size': {'mechanism': 'ivi-dance-with-a-twist', 'value': 'bufferSize', 'value_twist': 'actualSize'}, 'type': 'ViInt8[]'}, {'name': 'actualSize', 'direction': 'out', 'type': 'ViInt32'}], 'returns': 'ViStatus'}, 'GetAnIviDanceWithATwistString': {'parameters': [{'name': 'bufferSize', 'direction': 'in', 'type': 'ViInt32'}, {'name': 'arrayOut', 'direction': 'out', 'size': {'mechanism': 'ivi-dance-with-a-twist', 'value': 'bufferSize', 'value_twist': 'actualSize'}, 'type': 'ViChar[]'}, {'name': 'actualSize', 'direction': 'out', 'type': 'ViInt32'}], 'returns': 'ViStatus'}, 'GetAnIviDanceWithATwistStringStrlenBug': {'parameters': [{'name': 'bufferSize', 'direction': 'in', 'type': 'ViInt32'}, {'name': 'stringOut', 'direction': 'out', 'size': {'mechanism': 'ivi-dance-with-a-twist', 'value': 'bufferSize', 'value_twist': 'actualSize', 'tags': ['strlen-bug']}, 'type': 'ViChar[]'}, {'name': 'actualSize', 'direction': 'out', 'type': 'ViInt32'}], 'returns': 'ViStatus'}, 'GetArrayForCustomCodeCustomType': {'codegen_method': 'no', 'documentation': {'description': 'This function returns an array for use in custom-code size mechanism.'}, 'parameters': [{'direction': 'in', 'documentation': {'description': 'Identifies a particular instrument session.'}, 'name': 'vi', 'type': 'ViSession'}, {'include_in_proto': False, 'direction': 'in', 'documentation': {'description': 'Number of elements in the array.'}, 'name': 'numberOfElements', 'size': {'mechanism': 'custom-code', 'value': ''}, 'type': 'ViInt32'}, {'direction': 'out', 'documentation': {'description': 'Array of custom type using custom-code size mechanism'}, 'name': 'arrayOut', 'size': {'mechanism': 'custom-code', 'value': ''}, 'type': 'struct CustomStruct[]', 'grpc_type': 'repeated FakeCustomStruct'}], 'returns': 'ViStatus'}, 'GetArrayForCustomCodeDouble': {'codegen_method': 'no', 'documentation': {'description': 'This function returns an array for use in custom-code size mechanism.'}, 'parameters': [{'direction': 'in', 'documentation': {'description': 'Identifies a particular instrument session.'}, 'name': 'vi', 'type': 'ViSession'}, {'include_in_proto': False, 'direction': 'in', 'documentation': {'description': 'Number of elements in the array.'}, 'name': 'numberOfElements', 'size': {'mechanism': 'custom-code', 'value': ''}, 'type': 'ViInt32'}, {'direction': 'out', 'documentation': {'description': 'Array of double using custom-code size mechanism'}, 'name': 'arrayOut', 'size': {'mechanism': 'custom-code', 'value': 'number_of_elements'}, 'type': 'ViReal64[]'}], 'returns': 'ViStatus'}, 'GetArraySizeForCustomCode': {'codegen_method': 'public', 'documentation': {'description': 'This function returns the size of the array for use in custom-code size mechanism.'}, 'parameters': [{'direction': 'in', 'documentation': {'description': 'Identifies a particular instrument session.'}, 'name': 'vi', 'type': 'ViSession'}, {'direction': 'out', 'documentation': {'description': 'Size of array'}, 'name': 'sizeOut', 'type': 'ViInt32'}], 'returns': 'ViStatus'}, 'GetArrayUsingIviDance': {'codegen_method': 'public', 'documentation': {'description': 'This function returns an array of float whose size is determined with the IVI dance.'}, 'parameters': [{'direction': 'in', 'documentation': {'description': 'Identifies a particular instrument session.'}, 'name': 'vi', 'type': 'ViSession'}, {'direction': 'in', 'documentation': {'description': 'Specifies the size of the buffer for copyint arrayOut onto.'}, 'name': 'arraySize', 'type': 'ViInt32'}, {'direction': 'out', 'documentation': {'description': 'The array returned by this function'}, 'name': 'arrayOut', 'size': {'mechanism': 'ivi-dance', 'value': 'arraySize'}, 'type': 'ViReal64[]'}], 'returns': 'ViStatus'}, 'GetArrayViUInt8WithEnum': {'parameters': [{'direction': 'in', 'name': 'vi', 'type': 'ViSession'}, {'direction': 'in', 'name': 'arrayLen', 'type': 'ViInt32'}, {'direction': 'out', 'name': 'uInt8EnumArray', 'enum': 'Color', 'type': 'ViUInt8[]', 'size': {'mechanism': 'passed-in', 'value': 'arrayLen'}}], 'returns': 'ViStatus'}, 'GetAttributeViBoolean': {'codegen_method': 'public', 'documentation': {'description': 'Queries the value of a ViBoolean attribute.'}, 'parameters': [{'direction': 'in', 'documentation': {'description': 'Identifies a particular instrument session.'}, 'name': 'vi', 'type': 'ViSession'}, {'direction': 'in', 'documentation': {'description': 'This is the channel(s) that this function will apply to.'}, 'name': 'channelName', 'type': 'ViConstString'}, {'direction': 'in', 'documentation': {'description': 'Pass the ID of an attribute.'}, 'name': 'attributeId', 'type': 'ViAttr'}, {'direction': 'out', 'documentation': {'description': 'Returns the value of the attribute.'}, 'name': 'attributeValue', 'type': 'ViBoolean'}], 'returns': 'ViStatus'}, 'GetAttributeViInt32': {'codegen_method': 'public', 'documentation': {'description': 'Queries the value of a ViInt32 attribute.'}, 'parameters': [{'direction': 'in', 'documentation': {'description': 'Identifies a particular instrument session.'}, 'name': 'vi', 'type': 'ViSession'}, {'direction': 'in', 'documentation': {'description': 'This is the channel(s) that this function will apply to.'}, 'name': 'channelName', 'type': 'ViConstString'}, {'direction': 'in', 'documentation': {'description': 'Pass the ID of an attribute.'}, 'name': 'attributeId', 'type': 'ViAttr'}, {'direction': 'out', 'documentation': {'description': 'Returns the value of the attribute.'}, 'name': 'attributeValue', 'type': 'ViInt32'}], 'returns': 'ViStatus'}, 'GetAttributeViInt64': {'codegen_method': 'public', 'documentation': {'description': 'Queries the value of a ViInt64 attribute.'}, 'parameters': [{'direction': 'in', 'documentation': {'description': 'Identifies a particular instrument session.'}, 'name': 'vi', 'type': 'ViSession'}, {'direction': 'in', 'documentation': {'description': 'This is the channel(s) that this function will apply to.'}, 'name': 'channelName', 'type': 'ViConstString'}, {'direction': 'in', 'documentation': {'description': 'Pass the ID of an attribute.'}, 'name': 'attributeId', 'type': 'ViAttr'}, {'direction': 'out', 'documentation': {'description': 'Returns the value of the attribute.'}, 'name': 'attributeValue', 'type': 'ViInt64'}], 'returns': 'ViStatus'}, 'GetAttributeViReal64': {'codegen_method': 'public', 'documentation': {'description': 'Queries the value of a ViReal attribute.'}, 'parameters': [{'direction': 'in', 'documentation': {'description': 'Identifies a particular instrument session.'}, 'name': 'vi', 'type': 'ViSession'}, {'direction': 'in', 'documentation': {'description': 'This is the channel(s) that this function will apply to.'}, 'name': 'channelName', 'type': 'ViConstString'}, {'direction': 'in', 'documentation': {'description': 'Pass the ID of an attribute.'}, 'name': 'attributeId', 'type': 'ViAttr'}, {'direction': 'out', 'documentation': {'description': 'Returns the value of the attribute.'}, 'name': 'attributeValue', 'type': 'ViReal64'}], 'returns': 'ViStatus'}, 'GetAttributeViSession': {'parameters': [{'direction': 'in', 'name': 'vi', 'type': 'ViSession'}, {'direction': 'in', 'name': 'attributeId', 'type': 'ViInt32'}, {'direction': 'out', 'name': 'sessionOut', 'type': 'ViSession'}], 'returns': 'ViStatus'}, 'GetAttributeViString': {'codegen_method': 'public', 'documentation': {'description': 'Queries the value of a ViBoolean attribute.'}, 'parameters': [{'direction': 'in', 'documentation': {'description': 'Identifies a particular instrument session.'}, 'name': 'vi', 'type': 'ViSession'}, {'direction': 'in', 'documentation': {'description': 'This is the channel(s) that this function will apply to.'}, 'name': 'channelName', 'type': 'ViConstString'}, {'direction': 'in', 'documentation': {'description': 'Pass the ID of an attribute.'}, 'name': 'attributeId', 'type': 'ViAttr'}, {'direction': 'in', 'documentation': {'description': 'Number of bytes in attributeValue. You can IVI-dance with this.'}, 'name': 'bufferSize', 'type': 'ViInt32'}, {'direction': 'out', 'documentation': {'description': 'Returns the value of the attribute.'}, 'name': 'attributeValue', 'size': {'mechanism': 'ivi-dance', 'value': 'bufferSize'}, 'type': 'ViChar[]'}], 'returns': 'ViStatus'}, 'GetCalDateAndTime': {'codegen_method': 'public', 'documentation': {'description': 'Returns the date and time of the last calibration performed.'}, 'parameters': [{'direction': 'in', 'documentation': {'description': 'Identifies a particular instrument session.'}, 'name': 'vi', 'type': 'ViSession'}, {'direction': 'in', 'documentation': {'description': 'Specifies the type of calibration performed (external or self-calibration).'}, 'name': 'calType', 'type': 'ViInt32'}, {'direction': 'out', 'documentation': {'description': 'Indicates the **month** of the last calibration.'}, 'name': 'month', 'type': 'ViInt32'}, {'direction': 'out', 'documentation': {'description': 'Indicates the **day** of the last calibration.'}, 'name': 'day', 'type': 'ViInt32'}, {'direction': 'out', 'documentation': {'description': 'Indicates the **year** of the last calibration.'}, 'name': 'year', 'type': 'ViInt32'}, {'direction': 'out', 'documentation': {'description': 'Indicates the **hour** of the last calibration.'}, 'name': 'hour', 'type': 'ViInt32'}, {'direction': 'out', 'documentation': {'description': 'Indicates the **minute** of the last calibration.'}, 'name': 'minute', 'type': 'ViInt32'}], 'returns': 'ViStatus'}, 'GetCalInterval': {'documentation': {'description': 'Returns the recommended maximum interval, in **months**, between external calibrations.'}, 'parameters': [{'direction': 'in', 'documentation': {'description': 'Identifies a particular instrument session.'}, 'name': 'vi', 'type': 'ViSession'}, {'direction': 'out', 'documentation': {'description': 'Specifies the recommended maximum interval, in **months**, between external calibrations.'}, 'name': 'months', 'python_api_converter_name': 'convert_month_to_timedelta', 'type': 'ViInt32', 'type_in_documentation': 'hightime.timedelta'}], 'returns': 'ViStatus'}, 'GetCustomType': {'documentation': {'description': 'This function returns a custom type.'}, 'parameters': [{'direction': 'in', 'documentation': {'description': 'Identifies a particular instrument session.'}, 'name': 'vi', 'type': 'ViSession'}, {'direction': 'out', 'documentation': {'description': 'Set using custom type'}, 'name': 'cs', 'type': 'struct CustomStruct', 'grpc_type': 'FakeCustomStruct'}], 'returns': 'ViStatus'}, 'GetCustomTypeArray': {'codegen_method': 'public', 'documentation': {'description': 'This function returns a custom type.'}, 'parameters': [{'direction': 'in', 'documentation': {'description': 'Identifies a particular instrument session.'}, 'name': 'vi', 'type': 'ViSession'}, {'direction': 'in', 'documentation': {'description': 'Number of elements in the array.'}, 'name': 'numberOfElements', 'type': 'ViInt32'}, {'direction': 'out', 'documentation': {'description': 'Get using custom type'}, 'name': 'cs', 'size': {'mechanism': 'passed-in', 'value': 'numberOfElements'}, 'type': 'struct CustomStruct[]', 'grpc_type': 'repeated FakeCustomStruct'}], 'returns': 'ViStatus'}, 'GetEnumValue': {'codegen_method': 'public', 'documentation': {'description': 'Returns an enum value', 'note': 'Splinter is not supported.'}, 'parameters': [{'direction': 'in', 'documentation': {'description': 'Identifies a particular instrument session.'}, 'name': 'vi', 'type': 'ViSession'}, {'direction': 'out', 'documentation': {'description': 'This is an amount.', 'note': 'The amount will be between -2^31 and (2^31-1)'}, 'name': 'aQuantity', 'type': 'ViInt32'}, {'direction': 'out', 'documentation': {'description': 'Indicates a ninja turtle', 'table_body': [['0', 'Leonardo'], ['1', 'Donatello'], ['2', 'Raphael'], ['3', 'Mich elangelo']]}, 'enum': 'Turtle', 'name': 'aTurtle', 'type': 'ViInt16'}], 'returns': 'ViStatus'}, 'GetError': {'codegen_method': 'private', 'documentation': {'description': 'Returns the error information associated with the session.'}, 'is_error_handling': True, 'parameters': [{'direction': 'in', 'documentation': {'description': 'Identifies a particular instrument session.'}, 'name': 'vi', 'type': 'ViSession'}, {'direction': 'out', 'documentation': {'description': 'Returns errorCode for the session. If you pass 0 for bufferSize, you can pass VI_NULL for this.'}, 'name': 'errorCode', 'type': 'ViStatus'}, {'direction': 'in', 'documentation': {'description': 'Number of bytes in description buffer.'}, 'name': 'bufferSize', 'type': 'ViInt32'}, {'direction': 'out', 'documentation': {'description': 'At least bufferSize big, string comes out here.'}, 'name': 'description', 'size': {'mechanism': 'ivi-dance', 'value': 'bufferSize'}, 'type': 'ViChar[]'}], 'returns': 'ViStatus', 'use_session_lock': False}, 'GetViUInt8': {'codegen_method': 'public', 'parameters': [{'direction': 'in', 'name': 'vi', 'type': 'ViSession'}, {'direction': 'out', 'name': 'aUint8Number', 'type': 'ViUInt8'}], 'returns': 'ViStatus'}, 'GetViInt32Array': {'parameters': [{'direction': 'in', 'name': 'vi', 'type': 'ViSession'}, {'direction': 'in', 'name': 'arrayLen', 'type': 'ViInt32'}, {'direction': 'out', 'name': 'int32Array', 'type': 'ViInt32[]', 'size': {'mechanism': 'passed-in', 'value': 'arrayLen'}}], 'returns': 'ViStatus'}, 'GetViUInt32Array': {'parameters': [{'direction': 'in', 'name': 'vi', 'type': 'ViSession'}, {'direction': 'in', 'name': 'arrayLen', 'type': 'ViInt32'}, {'direction': 'out', 'name': 'uInt32Array', 'type': 'ViUInt32[]', 'size': {'mechanism': 'passed-in', 'value': 'arrayLen'}}], 'returns': 'ViStatus'}, 'ImportAttributeConfigurationBuffer': {'documentation': {'description': 'Import configuration buffer.'}, 'parameters': [{'direction': 'in', 'name': 'vi', 'type': 'ViSession'}, {'direction': 'in', 'name': 'sizeInBytes', 'type': 'ViInt32'}, {'direction': 'in', 'name': 'configuration', 'python_api_converter_name': 'convert_to_bytes', 'size': {'mechanism': 'len', 'value': 'sizeInBytes'}, 'type': 'ViInt8[]', 'type_in_documentation': 'bytes'}], 'returns': 'ViStatus'}, 'InitWithOptions': {'codegen_method': 'public', 'init_method': True, 'documentation': {'description': 'Creates a new IVI instrument driver session.'}, 'parameters': [{'direction': 'in', 'documentation': {'caution': 'This is just some string.', 'description': 'Contains the **resource_name** of the device to initialize.'}, 'name': 'resourceName', 'type': 'ViString'}, {'default_value': False, 'direction': 'in', 'documentation': {'description': 'NI-FAKE is probably not needed.', 'table_body': [['VI_TRUE (default)', '1', 'Perform ID Query'], ['VI_FALSE', '0', 'Skip ID Query']]}, 'name': 'idQuery', 'type': 'ViBoolean', 'use_in_python_api': False}, {'default_value': False, 'direction': 'in', 'documentation': {'description': 'Specifies whether to reset', 'table_body': [['VI_TRUE (default)', '1', 'Reset Device'], ['VI_FALSE', '0', "Don't Reset"]]}, 'name': 'resetDevice', 'type': 'ViBoolean'}, {'direction': 'in', 'documentation': {'description': 'Some options'}, 'name': 'optionString', 'python_api_converter_name': 'convert_init_with_options_dictionary', 'type': 'ViConstString', 'type_in_documentation': 'dict'}, {'direction': 'out', 'documentation': {'description': 'Returns a ViSession handle that you use.'}, 'name': 'vi', 'type': 'ViSession'}], 'returns': 'ViStatus', 'use_session_lock': False}, 'Initiate': {'codegen_method': 'private', 'documentation': {'description': 'Initiates a thingie.'}, 'parameters': [{'direction': 'in', 'documentation': {'description': 'Identifies a particular instrument session.'}, 'name': 'vi', 'type': 'ViSession'}], 'returns': 'ViStatus'}, 'InitExtCal': {'codegen_method': 'public', 'init_method': True, 'custom_close': 'CloseExtCal(id, 0)', 'parameters': [{'name': 'resourceName', 'direction': 'in', 'type': 'ViRsrc'}, {'name': 'calibrationPassword', 'direction': 'in', 'type': 'ViString'}, {'name': 'vi', 'direction': 'out', 'type': 'ViSession'}], 'returns': 'ViStatus'}, 'InitWithVarArgs': {'codegen_method': 'public', 'init_method': True, 'parameters': [{'name': 'resourceName', 'direction': 'in', 'type': 'ViRsrc'}, {'name': 'vi', 'direction': 'out', 'type': 'ViSession'}, {'direction': 'in', 'name': 'stringArg', 'type': 'ViConstString', 'include_in_proto': False, 'repeating_argument': True}, {'direction': 'in', 'include_in_proto': False, 'enum': 'Turtle', 'name': 'turtle', 'repeating_argument': True, 'type': 'ViInt16'}, {'direction': 'in', 'grpc_type': 'repeated StringAndTurtle', 'is_compound_type': True, 'max_length': 3, 'name': 'nameAndTurtle', 'repeated_var_args': True}], 'returns': 'ViStatus'}, 'LockSession': {'codegen_method': 'no', 'documentation': {'description': 'Lock.'}, 'method_templates': [{'documentation_filename': 'lock', 'method_python_name_suffix': '', 'session_filename': 'lock'}], 'parameters': [{'direction': 'in', 'documentation': {'description': 'Identifies a particular instrument session.'}, 'name': 'vi', 'type': 'ViSession'}, {'direction': 'out', 'documentation': {'description': 'Optional'}, 'name': 'callerHasLock', 'type': 'ViBoolean'}], 'python_name': 'lock', 'render_in_session_base': True, 'returns': 'ViStatus', 'use_session_lock': False}, 'MultipleArrayTypes': {'codegen_method': 'public', 'documentation': {'description': 'Receives and returns multiple types of arrays.'}, 'parameters': [{'direction': 'in', 'documentation': {'description': 'Identifies a particular instrument session.'}, 'name': 'vi', 'type': 'ViSession'}, {'direction': 'in', 'documentation': {'description': 'Size of the array that will be returned.'}, 'name': 'outputArraySize', 'type': 'ViInt32'}, {'direction': 'out', 'documentation': {'description': 'Array that will be returned.', 'note': 'The size must be at least outputArraySize.'}, 'name': 'outputArray', 'size': {'mechanism': 'passed-in', 'value': 'outputArraySize'}, 'type': 'ViReal64[]'}, {'direction': 'out', 'documentation': {'description': 'An array of doubles with fixed size.'}, 'name': 'outputArrayOfFixedLength', 'size': {'mechanism': 'fixed', 'value': 3}, 'type': 'ViReal64[]'}, {'direction': 'in', 'documentation': {'description': 'Size of inputArrayOfFloats and inputArrayOfIntegers'}, 'name': 'inputArraySizes', 'type': 'ViInt32'}, {'direction': 'in', 'documentation': {'description': 'Array of floats'}, 'name': 'inputArrayOfFloats', 'size': {'mechanism': 'len', 'value': 'inputArraySizes'}, 'type': 'ViReal64[]'}, {'default_value': None, 'direction': 'in', 'documentation': {'description': 'Array of integers. Optional. If passed in then size must match that of inputArrayOfFloats.'}, 'name': 'inputArrayOfIntegers', 'size': {'mechanism': 'len', 'value': 'inputArraySizes'}, 'type': 'ViInt16[]'}], 'returns': 'ViStatus'}, 'MultipleArraysSameSize': {'documentation': {'description': 'Function to test multiple arrays that use the same size'}, 'parameters': [{'direction': 'in', 'documentation': {'description': 'Identifies a particular instrument session.'}, 'name': 'vi', 'type': 'ViSession'}, {'direction': 'in', 'documentation': {'description': 'Array 1 of same size.'}, 'name': 'values1', 'size': {'mechanism': 'len', 'value': 'size'}, 'type': 'ViReal64[]'}, {'direction': 'in', 'documentation': {'description': 'Array 2 of same size.'}, 'name': 'values2', 'size': {'mechanism': 'len', 'value': 'size'}, 'type': 'ViReal64[]'}, {'direction': 'in', 'documentation': {'description': 'Array 3 of same size.'}, 'name': 'values3', 'size': {'mechanism': 'len', 'value': 'size'}, 'type': 'ViReal64[]'}, {'direction': 'in', 'documentation': {'description': 'Array 4 of same size.'}, 'name': 'values4', 'size': {'mechanism': 'len', 'value': 'size'}, 'type': 'ViReal64[]'}, {'direction': 'in', 'documentation': {'description': 'Size for all arrays'}, 'name': 'size', 'type': 'ViInt32'}], 'returns': 'ViStatus'}, 'MultipleArraysSameSizeWithOptional': {'documentation': {'description': 'Function to test multiple arrays that use the same size'}, 'parameters': [{'direction': 'in', 'documentation': {'description': 'Identifies a particular instrument session.'}, 'name': 'vi', 'type': 'ViSession'}, {'direction': 'in', 'documentation': {'description': 'Array 1 of same size.'}, 'name': 'values1', 'size': {'mechanism': 'len', 'tags': ['optional'], 'value': 'size'}, 'type': 'ViReal64[]'}, {'direction': 'in', 'documentation': {'description': 'Array 2 of same size.'}, 'name': 'values2', 'size': {'mechanism': 'len', 'tags': ['optional'], 'value': 'size'}, 'type': 'ViReal64[]'}, {'direction': 'in', 'documentation': {'description': 'Array 3 of same size.'}, 'name': 'values3', 'size': {'mechanism': 'len', 'tags': ['optional'], 'value': 'size'}, 'type': 'ViReal64[]'}, {'direction': 'in', 'documentation': {'description': 'Array 4 of same size.'}, 'name': 'values4', 'size': {'mechanism': 'len', 'tags': ['optional'], 'value': 'size'}, 'type': 'ViReal64[]'}, {'direction': 'in', 'documentation': {'description': 'Size for all arrays'}, 'name': 'size', 'type': 'ViInt32'}], 'returns': 'ViStatus'}, 'OneInputFunction': {'codegen_method': 'public', 'documentation': {'description': 'This function takes one parameter other than the session.'}, 'parameters': [{'direction': 'in', 'documentation': {'description': 'Identifies a particular instrument session. You obtain the **vi** parameter from niFake_InitWithOptions.'}, 'name': 'vi', 'type': 'ViSession'}, {'direction': 'in', 'documentation': {'description': 'Contains a number'}, 'name': 'aNumber', 'type': 'ViInt32'}], 'returns': 'ViStatus'}, 'ParametersAreMultipleTypes': {'codegen_method': 'public', 'documentation': {'description': 'Has parameters of multiple types.'}, 'parameters': [{'direction': 'in', 'documentation': {'description': 'Identifies a particular instrument session.'}, 'name': 'vi', 'type': 'ViSession'}, {'direction': 'in', 'documentation': {'description': 'Contains a boolean.'}, 'name': 'aBoolean', 'type': 'ViBoolean'}, {'direction': 'in', 'documentation': {'description': 'Contains a 32-bit integer.'}, 'name': 'anInt32', 'type': 'ViInt32'}, {'direction': 'in', 'documentation': {'description': 'Contains a 64-bit integer.'}, 'name': 'anInt64', 'type': 'ViInt64'}, {'direction': 'in', 'documentation': {'description': 'Indicates a ninja turtle', 'table_body': [['0', 'Leonardo'], ['1', 'Donatello'], ['2', 'Raphael'], ['3', 'Mich elangelo']]}, 'enum': 'Turtle', 'name': 'anIntEnum', 'type': 'ViInt16'}, {'direction': 'in', 'documentation': {'description': 'The measured value.'}, 'name': 'aFloat', 'type': 'ViReal64'}, {'direction': 'in', 'documentation': {'description': 'A float enum.'}, 'enum': 'FloatEnum', 'name': 'aFloatEnum', 'type': 'ViReal64'}, {'direction': 'in', 'documentation': {'description': 'Number of bytes allocated for aString'}, 'name': 'stringSize', 'type': 'ViInt32'}, {'direction': 'in', 'documentation': {'description': 'An IVI dance string.'}, 'name': 'aString', 'size': {'mechanism': 'len', 'value': 'stringSize'}, 'type': 'ViConstString'}], 'returns': 'ViStatus'}, 'PoorlyNamedSimpleFunction': {'codegen_method': 'public', 'documentation': {'description': 'This function takes no parameters other than the session.'}, 'parameters': [{'direction': 'in', 'documentation': {'description': 'Identifies a particular instrument session. You obtain the **vi** parameter from niFake_InitWithOptions.'}, 'name': 'vi', 'type': 'ViSession'}], 'python_name': 'simple_function', 'returns': 'ViStatus'}, 'Read': {'codegen_method': 'public', 'documentation': {'description': 'Acquires a single measurement and returns the measured value.'}, 'parameters': [{'direction': 'in', 'documentation': {'description': 'Identifies a particular instrument session.'}, 'name': 'vi', 'type': 'ViSession'}, {'direction': 'in', 'documentation': {'description': 'Specifies the **maximum_time** allowed in seconds.'}, 'name': 'maximumTime', 'python_api_converter_name': 'convert_timedelta_to_seconds_real64', 'type': 'ViReal64', 'type_in_documentation': 'hightime.timedelta'}, {'direction': 'out', 'documentation': {'description': 'The measured value.'}, 'name': 'reading', 'type': 'ViReal64'}], 'returns': 'ViStatus'}, 'ReadDataWithInOutIviTwist': {'parameters': [{'direction': 'out', 'name': 'data', 'size': {'mechanism': 'ivi-dance-with-a-twist', 'value': 'bufferSize', 'value_twist': 'bufferSize'}, 'type': 'ViInt32[]'}, {'name': 'bufferSize', 'direction': 'out', 'type': 'ViInt32'}], 'returns': 'ViStatus'}, 'ReadFromChannel': {'codegen_method': 'public', 'documentation': {'description': 'Acquires a single measurement and returns the measured value.'}, 'parameters': [{'direction': 'in', 'documentation': {'description': 'Identifies a particular instrument session.'}, 'name': 'vi', 'type': 'ViSession'}, {'direction': 'in', 'documentation': {'description': 'This is the channel(s) that this function will apply to.'}, 'name': 'channelName', 'type': 'ViConstString'}, {'direction': 'in', 'documentation': {'description': 'Specifies the **maximum_time** allowed in milliseconds.'}, 'name': 'maximumTime', 'python_api_converter_name': 'convert_timedelta_to_milliseconds_int32', 'type': 'ViInt32', 'type_in_documentation': 'hightime.timedelta'}, {'direction': 'out', 'documentation': {'description': 'The measured value.'}, 'name': 'reading', 'type': 'ViReal64'}], 'returns': 'ViStatus'}, 'ReturnANumberAndAString': {'codegen_method': 'public', 'documentation': {'description': 'Returns a number and a string.', 'note': 'This function rules!'}, 'parameters': [{'direction': 'in', 'documentation': {'description': 'Identifies a particular instrument session.'}, 'name': 'vi', 'type': 'ViSession'}, {'direction': 'out', 'documentation': {'description': 'Contains a number.'}, 'name': 'aNumber', 'type': 'ViInt16'}, {'direction': 'out', 'documentation': {'description': 'Contains a string. Buffer must be 256 bytes or larger.'}, 'name': 'aString', 'size': {'mechanism': 'fixed', 'value': 256}, 'type': 'ViChar[]'}], 'returns': 'ViStatus'}, 'ReturnDurationInSeconds': {'codegen_method': 'public', 'documentation': {'description': 'Returns a hightime.timedelta instance.'}, 'parameters': [{'direction': 'in', 'documentation': {'description': 'Identifies a particular instrument session.'}, 'name': 'vi', 'type': 'ViSession'}, {'direction': 'out', 'documentation': {'description': 'Duration in seconds.'}, 'name': 'timedelta', 'python_api_converter_name': 'convert_seconds_real64_to_timedelta', 'type': 'ViReal64', 'type_in_documentation': 'hightime.timedelta'}], 'returns': 'ViStatus'}, 'ReturnListOfDurationsInSeconds': {'codegen_method': 'public', 'documentation': {'description': 'Returns a list of hightime.timedelta instances.'}, 'parameters': [{'direction': 'in', 'documentation': {'description': 'Identifies a particular instrument session.'}, 'name': 'vi', 'type': 'ViSession'}, {'direction': 'in', 'documentation': {'description': 'Number of elements in output.'}, 'name': 'numberOfElements', 'type': 'ViInt32'}, {'direction': 'out', 'documentation': {'description': 'Contains a list of hightime.timedelta instances.'}, 'name': 'timedeltas', 'python_api_converter_name': 'convert_seconds_real64_to_timedeltas', 'size': {'mechanism': 'passed-in', 'value': 'numberOfElements'}, 'type': 'ViReal64[]', 'type_in_documentation': 'hightime.timedelta'}], 'returns': 'ViStatus'}, 'ReturnMultipleTypes': {'codegen_method': 'public', 'documentation': {'description': 'Returns multiple types.'}, 'parameters': [{'direction': 'in', 'documentation': {'description': 'Identifies a particular instrument session.'}, 'name': 'vi', 'type': 'ViSession'}, {'direction': 'out', 'documentation': {'description': 'Contains a boolean.'}, 'name': 'aBoolean', 'type': 'ViBoolean'}, {'direction': 'out', 'documentation': {'description': 'Contains a 32-bit integer.'}, 'name': 'anInt32', 'type': 'ViInt32'}, {'direction': 'out', 'documentation': {'description': 'Contains a 64-bit integer.'}, 'name': 'anInt64', 'type': 'ViInt64'}, {'direction': 'out', 'documentation': {'description': 'Indicates a ninja turtle', 'table_body': [['0', 'Leonardo'], ['1', 'Donatello'], ['2', 'Raphael'], ['3', 'Mich elangelo']]}, 'enum': 'Turtle', 'name': 'anIntEnum', 'type': 'ViInt16'}, {'direction': 'out', 'documentation': {'description': 'The measured value.'}, 'name': 'aFloat', 'type': 'ViReal64'}, {'direction': 'out', 'documentation': {'description': 'A float enum.'}, 'enum': 'FloatEnum', 'name': 'aFloatEnum', 'type': 'ViReal64'}, {'direction': 'in', 'documentation': {'description': 'Number of measurements to acquire.'}, 'name': 'arraySize', 'type': 'ViInt32'}, {'direction': 'out', 'documentation': {'description': 'An array of measurement values.', 'note': 'The size must be at least arraySize.'}, 'name': 'anArray', 'size': {'mechanism': 'passed-in', 'value': 'arraySize'}, 'type': 'ViReal64[]'}, {'direction': 'in', 'documentation': {'description': 'Number of bytes allocated for aString'}, 'name': 'stringSize', 'type': 'ViInt32'}, {'direction': 'out', 'documentation': {'description': 'An IVI dance string.'}, 'name': 'aString', 'size': {'mechanism': 'ivi-dance', 'value': 'stringSize'}, 'type': 'ViChar[]'}], 'returns': 'ViStatus'}, 'SetAttributeViBoolean': {'codegen_method': 'private', 'documentation': {'description': 'This function sets the value of a ViBoolean attribute.'}, 'parameters': [{'direction': 'in', 'documentation': {'description': 'Identifies a particular instrument session.'}, 'name': 'vi', 'type': 'ViSession'}, {'direction': 'in', 'documentation': {'description': 'This is the channel(s) that this function will apply to.'}, 'name': 'channelName', 'type': 'ViConstString'}, {'direction': 'in', 'documentation': {'description': 'Pass the ID of an attribute.'}, 'name': 'attributeId', 'type': 'ViAttr'}, {'direction': 'in', 'documentation': {'description': 'Pass the value that you want to set the attribute to.'}, 'name': 'attributeValue', 'type': 'ViBoolean'}], 'returns': 'ViStatus'}, 'SetAttributeViInt32': {'codegen_method': 'private', 'documentation': {'description': 'This function sets the value of a ViInt32 attribute.'}, 'parameters': [{'direction': 'in', 'documentation': {'description': 'Identifies a particular instrument session.'}, 'name': 'vi', 'type': 'ViSession'}, {'direction': 'in', 'documentation': {'description': 'This is the channel(s) that this function will apply to.'}, 'name': 'channelName', 'type': 'ViConstString'}, {'direction': 'in', 'documentation': {'description': 'Pass the ID of an attribute.'}, 'name': 'attributeId', 'type': 'ViAttr'}, {'direction': 'in', 'documentation': {'description': 'Pass the value that you want to set the attribute to.'}, 'name': 'attributeValue', 'type': 'ViInt32'}], 'returns': 'ViStatus'}, 'SetAttributeViInt64': {'codegen_method': 'private', 'documentation': {'description': 'This function sets the value of a ViInt64 attribute.'}, 'parameters': [{'direction': 'in', 'documentation': {'description': 'Identifies a particular instrument session.'}, 'name': 'vi', 'type': 'ViSession'}, {'direction': 'in', 'documentation': {'description': 'This is the channel(s) that this function will apply to.'}, 'name': 'channelName', 'type': 'ViConstString'}, {'direction': 'in', 'documentation': {'description': 'Pass the ID of an attribute.'}, 'name': 'attributeId', 'type': 'ViAttr'}, {'direction': 'in', 'documentation': {'description': 'Pass the value that you want to set the attribute to.'}, 'name': 'attributeValue', 'type': 'ViInt64'}], 'returns': 'ViStatus'}, 'SetAttributeViReal64': {'codegen_method': 'private', 'documentation': {'description': 'This function sets the value of a ViReal64 attribute.'}, 'parameters': [{'direction': 'in', 'documentation': {'description': 'Identifies a particular instrument session.'}, 'name': 'vi', 'type': 'ViSession'}, {'direction': 'in', 'documentation': {'description': 'This is the channel(s) that this function will apply to.'}, 'name': 'channelName', 'type': 'ViConstString'}, {'direction': 'in', 'documentation': {'description': 'Pass the ID of an attribute.'}, 'name': 'attributeId', 'type': 'ViAttr'}, {'direction': 'in', 'documentation': {'description': 'Pass the value that you want to set the attribute to.'}, 'name': 'attributeValue', 'type': 'ViReal64'}], 'returns': 'ViStatus'}, 'SetAttributeViString': {'codegen_method': 'private', 'documentation': {'description': 'This function sets the value of a ViString attribute.'}, 'parameters': [{'direction': 'in', 'documentation': {'description': 'Identifies a particular instrument session.'}, 'name': 'vi', 'type': 'ViSession'}, {'direction': 'in', 'documentation': {'description': 'This is the channel(s) that this function will apply to.'}, 'name': 'channelName', 'type': 'ViConstString'}, {'direction': 'in', 'documentation': {'description': 'Pass the ID of an attribute.'}, 'name': 'attributeId', 'type': 'ViAttr'}, {'direction': 'in', 'documentation': {'description': 'Pass the value that you want to set the attribute to.'}, 'name': 'attributeValue', 'type': 'ViConstString'}], 'returns': 'ViStatus'}, 'SetCustomType': {'documentation': {'description': 'This function takes a custom type.'}, 'parameters': [{'direction': 'in', 'documentation': {'description': 'Identifies a particular instrument session.'}, 'name': 'vi', 'type': 'ViSession'}, {'direction': 'in', 'documentation': {'description': 'Set using custom type'}, 'name': 'cs', 'type': 'struct CustomStruct', 'grpc_type': 'FakeCustomStruct'}], 'returns': 'ViStatus'}, 'SetCustomTypeArray': {'documentation': {'description': 'This function takes an array of custom types.'}, 'parameters': [{'direction': 'in', 'documentation': {'description': 'Identifies a particular instrument session.'}, 'name': 'vi', 'type': 'ViSession'}, {'direction': 'in', 'documentation': {'description': 'Number of elements in the array.'}, 'name': 'numberOfElements', 'type': 'ViInt32'}, {'direction': 'in', 'documentation': {'description': 'Set using custom type'}, 'name': 'cs', 'size': {'mechanism': 'len', 'value': 'numberOfElements'}, 'type': 'struct CustomStruct[]', 'grpc_type': 'repeated FakeCustomStruct'}], 'returns': 'ViStatus'}, 'StringValuedEnumInputFunctionWithDefaults': {'codegen_method': 'public', 'documentation': {'description': 'This function takes one parameter other than the session, which happens to be a string-valued enum and has a default value.'}, 'parameters': [{'direction': 'in', 'documentation': {'description': 'Identifies a particular instrument session. You obtain the **vi**'}, 'name': 'vi', 'type': 'ViSession'}, {'default_value': 'MobileOSNames.ANDROID', 'direction': 'in', 'documentation': {'description': 'Indicates a Mobile OS', 'table_body': [['ANDROID', 'Android'], ['IOS', 'iOS'], ['NONE', 'None']]}, 'enum': 'MobileOSNames', 'name': 'aMobileOSName', 'type': 'ViConstString'}], 'returns': 'ViStatus'}, 'TwoInputFunction': {'codegen_method': 'public', 'documentation': {'description': 'This function takes two parameters other than the session.'}, 'parameters': [{'direction': 'in', 'documentation': {'description': 'Identifies a particular instrument session. You obtain the **vi** parameter from niFake_InitWithOptions.'}, 'name': 'vi', 'type': 'ViSession'}, {'direction': 'in', 'documentation': {'description': 'Contains a number'}, 'name': 'aNumber', 'type': 'ViReal64'}, {'direction': 'in', 'documentation': {'description': 'Contains a string'}, 'name': 'aString', 'type': 'ViString'}], 'returns': 'ViStatus'}, 'UnlockSession': {'codegen_method': 'no', 'documentation': {'description': 'Unlock'}, 'method_templates': [{'documentation_filename': 'unlock', 'method_python_name_suffix': '', 'session_filename': 'unlock'}], 'parameters': [{'direction': 'in', 'documentation': {'description': 'Identifies a particular instrument session.'}, 'name': 'vi', 'type': 'ViSession'}, {'direction': 'out', 'documentation': {'description': 'Optional'}, 'name': 'callerHasLock', 'type': 'ViBoolean'}], 'python_name': 'unlock', 'render_in_session_base': True, 'returns': 'ViStatus', 'use_session_lock': False}, 'Use64BitNumber': {'codegen_method': 'public', 'documentation': {'description': 'Returns a number and a string.', 'note': 'This function rules!'}, 'parameters': [{'direction': 'in', 'documentation': {'description': 'Identifies a particular instrument session.'}, 'name': 'vi', 'type': 'ViSession'}, {'direction': 'in', 'documentation': {'description': 'A big number on its way in.'}, 'name': 'input', 'type': 'ViInt64'}, {'direction': 'out', 'documentation': {'description': 'A big number on its way out.'}, 'name': 'output', 'type': 'ViInt64'}], 'returns': 'ViStatus'}, 'WriteWaveform': {'codegen_method': 'public', 'documentation': {'description': 'Writes waveform to the driver'}, 'method_templates': [{'documentation_filename': 'default_method', 'method_python_name_suffix': '', 'session_filename': 'default_method'}, {'documentation_filename': 'numpy_method', 'method_python_name_suffix': '_numpy', 'session_filename': 'numpy_write_method'}], 'parameters': [{'direction': 'in', 'documentation': {'description': 'Identifies a particular instrument session.'}, 'name': 'vi', 'type': 'ViSession'}, {'direction': 'in', 'documentation': {'description': 'How many samples the waveform contains.'}, 'name': 'numberOfSamples', 'type': 'ViInt32'}, {'direction': 'in', 'documentation': {'description': 'Waveform data.'}, 'name': 'waveform', 'numpy': True, 'size': {'mechanism': 'len', 'value': 'numberOfSamples'}, 'type': 'ViReal64[]', 'use_array': True}], 'returns': 'ViStatus'}, 'close': {'codegen_method': 'public', 'documentation': {'description': 'Closes the specified session and deallocates resources that it reserved.'}, 'parameters': [{'direction': 'in', 'documentation': {'description': 'Identifies a particular instrument session.'}, 'name': 'vi', 'type': 'ViSession'}], 'python_name': '_close', 'returns': 'ViStatus', 'use_session_lock': False}, 'CloseExtCal': {'codegen_method': 'public', 'custom_close_method': True, 'parameters': [{'name': 'vi', 'direction': 'in', 'type': 'ViSession'}, {'name': 'action', 'direction': 'in', 'type': 'ViInt32'}], 'returns': 'ViStatus'}, 'error_message': {'codegen_method': 'private', 'documentation': {'description': 'Takes the errorCode returned by a functiona and returns it as a user-readable string.'}, 'is_error_handling': True, 'parameters': [{'direction': 'in', 'documentation': {'description': 'Identifies a particular instrument session.'}, 'name': 'vi', 'type': 'ViSession'}, {'direction': 'in', 'documentation': {'description': 'The errorCode returned from the instrument.'}, 'name': 'errorCode', 'type': 'ViStatus'}, {'direction': 'out', 'documentation': {'description': 'The error information formatted into a string.'}, 'name': 'errorMessage', 'size': {'mechanism': 'fixed', 'value': 256}, 'type': 'ViChar[]'}], 'returns': 'ViStatus', 'use_session_lock': False}, 'self_test': {'codegen_method': 'private', 'documentation': {'description': 'Performs a self-test.'}, 'parameters': [{'direction': 'in', 'documentation': {'description': 'Identifies a particular instrument session. You obtain the **vi** parameter from niFake_InitWithOptions.'}, 'name': 'vi', 'type': 'ViSession'}, {'direction': 'out', 'documentation': {'description': 'Contains the value returned from the instrument self-test. Zero indicates success.'}, 'name': 'selfTestResult', 'type': 'ViInt16'}, {'direction': 'out', 'documentation': {'description': 'This parameter contains the string returned from the instrument self-test. The array must contain at least 256 elements.'}, 'name': 'selfTestMessage', 'size': {'mechanism': 'fixed', 'value': 256}, 'type': 'ViChar[]'}], 'returns': 'ViStatus'}, 'ViUInt8ArrayInputFunction': {'codegen_method': 'public', 'parameters': [{'direction': 'in', 'name': 'vi', 'type': 'ViSession'}, {'direction': 'in', 'name': 'numberOfElements', 'type': 'ViInt32'}, {'direction': 'in', 'name': 'anArray', 'size': {'mechanism': 'passed-in', 'value': 'numberOfElements'}, 'type': 'ViUInt8[]'}], 'returns': 'ViStatus'}, 'ViUInt8ArrayOutputFunction': {'codegen_method': 'public', 'parameters': [{'direction': 'in', 'name': 'vi', 'type': 'ViSession'}, {'direction': 'in', 'name': 'numberOfElements', 'type': 'ViInt32'}, {'direction': 'out', 'name': 'anArray', 'size': {'mechanism': 'passed-in', 'value': 'numberOfElements'}, 'type': 'ViUInt8[]'}], 'returns': 'ViStatus'}, 'ViInt16ArrayInputFunction': {'codegen_method': 'public', 'parameters': [{'direction': 'in', 'name': 'vi', 'type': 'ViSession'}, {'direction': 'in', 'name': 'numberOfElements', 'type': 'ViInt32'}, {'direction': 'in', 'name': 'anArray', 'size': {'mechanism': 'len', 'value': 'numberOfElements'}, 'type': 'ViInt16[]'}], 'returns': 'ViStatus'}}
word = "Python" assert "Python" == word[:2] + word[2:] assert "Python" == word[:4] + word[4:] assert "Py" == word[:2] assert "on" == word[4:] assert "on" == word[-2:] assert "Py" == word[:-4] # assert "Py" == word[::2] assert "Pto" == word[::2] assert "yhn" == word[1::2] assert "Pt" == word[:4:2] assert "yh" == word[1:4:2]
word = 'Python' assert 'Python' == word[:2] + word[2:] assert 'Python' == word[:4] + word[4:] assert 'Py' == word[:2] assert 'on' == word[4:] assert 'on' == word[-2:] assert 'Py' == word[:-4] assert 'Pto' == word[::2] assert 'yhn' == word[1::2] assert 'Pt' == word[:4:2] assert 'yh' == word[1:4:2]
a=input() a=a.lower() if(a==a[::-1]): print("String is a PALINDROME") else: print("String NOT a PALINDROME")
a = input() a = a.lower() if a == a[::-1]: print('String is a PALINDROME') else: print('String NOT a PALINDROME')
# GIS4WRF (https://doi.org/10.5281/zenodo.1288569) # Copyright (c) 2018 D. Meyer and M. Riechert. Licensed under MIT. geo_datasets = { "topo_10m": ("USGS GTOPO DEM", 0.16666667), "topo_5m": ("USGS GTOPO DEM", 0.08333333), "topo_2m": ("USGS GTOPO DEM", 0.03333333), "topo_30s": ("USGS GTOPO DEM", 0.00833333), "topo_gmted2010_30s": ("USGS GMTED2010 DEM", 0.03333333), "lake_depth": ("Lake Depth", 0.03333333), "landuse_10m": ("24-category USGS land use", 0.16666667), "landuse_5m": ("24-category USGS land use", 0.08333333), "landuse_2m": ("24-category USGS land use", 0.03333333), "landuse_30s": ("24-category USGS land use", 0.00833333), "landuse_30s_with_lakes": ("25-category USGS landuse", 0.00833333), "modis_landuse_20class_30s": ("Noah-modified 20-category IGBP-MODIS landuse", 0.00833333), "modis_landuse_20class_30s_with_lakes": ("New Noah-modified 21-category IGBP-MODIS landuse", 0.00833333), "modis_landuse_20class_15s": ("Noah-modified 20-category IGBP-MODIS landuse", 0.004166667), "modis_landuse_21class_30s": ("Noah-modified 21-category IGBP-MODIS landuse", 0.00833333), "nlcd2006_ll_30s": ("National Land Cover Database 2006", 0.00833333), "nlcd2006_ll_9s": ("National Land Cover Database 2006", 0.0025), "nlcd2011_imp_ll_9s": ("National Land Cover Database 2011 -- imperviousness percent", 0.0025), "nlcd2011_can_ll_9s": ("National Land Cover Database 2011 -- canopy percent", 0.0025), "nlcd2011_ll_9s": ("National Land Cover Database 2011", 0.0025), "ssib_landuse_10m": ("12-category Simplified Simple Biosphere Model (SSiB) land use", 0.1666667), "ssib_landuse_5m": ("12-category Simplified Simple Biosphere Model (SSiB) land use", 0.08333333), "NUDAPT44_1km": ("National Urban Database (NUDAPT) for 44 US cities", 0.0025), "crop": ("Monthly green fraction", 'various'), "greenfrac": ("Monthly green fraction", 0.144), "greenfrac_fpar_modis": ("MODIS Monthly Leaf Area Index/FPAR", 0.00833333), "sandfrac_5m": ("Sand fraction", 0.08333333), "soiltemp_1deg": ("Soil temperature", 1.0), "lai_modis_10m": ("MODIS Leaf Area Index", 0.16666667), "lai_modis_30s": ("MODIS Leaf Area Index", 0.00833333), "bnu_soiltype_bot": ("16-category bottom-layer soil type", 0.00833333), "bnu_soiltype_top": ("16-category top-layer soil type", 0.00833333), "clayfrac_5m": ("Clay Fraction", 0.08333333), "soiltype_bot_10m": ("Bottom-layer soil type", 0.16666667), "soiltype_bot_5m": ("Bottom-layer soil type", 0.08333333), "soiltype_bot_2m": ("Bottom-layer soil type", 0.03333333), "soiltype_bot_30s": ("Bottom-layer soil type", 0.00833333), "soiltype_top_10m": ("Top-layer soil type", 0.16666667), "soiltype_top_5m": ("Top-layer soil type", 0.08333333), "soiltype_top_2m": ("Top-layer soil type", 0.03333333), "soiltype_top_30s": ("Top-layer soil type", 0.00833333), "albedo_ncep": ("NCEP Monthly surface albedo", 0.144), "maxsnowalb": ("Maximum snow albedo", 1.0), "groundwater": ("Groundwater data", 0.00833333), "islope": ("14-category slope index", 1.0), "orogwd_2deg": ("Subgrid orography information for gravity wave drag option", 2.0), "orogwd_1deg": ("Subgrid orography information for gravity wave drag option", 1.0), "orogwd_30m": ("Subgrid orography information for gravity wave drag option", 0.5), "orogwd_20m": ("Subgrid orography information for gravity wave drag option", 0.3333333), "orogwd_10m": ("Subgrid orography information for gravity wave drag option", 0.16666667), "varsso_10m": ("Variance of subgrid-scale orography", 0.16666667), "varsso_5m": ("Variance of subgrid-scale orography", 0.08333333), "varsso_2m": ("Variance of subgrid-scale orography", 0.03333333), "varsso": ("Variance of subgrid-scale orography", 0.00833333), "albedo_modis": ("Monthly MODIS surface albedo", 0.05), "greenfrac_fpar_modis_5m": ("MODIS FPAR, subsampled by NCAR/MMM 2018-05-23 from 30-arc-second", 0.00833333), "maxsnowalb_modis": ("MODIS maximum snow albedo", 0.05), "modis_landuse_20class_5m_with_lakes": ("Noah-modified 21-category IGBP-MODIS landuse, subsampled by NCAR/MMM 2018-05-23 from 30-arc-second", 0.00833333), "topo_gmted2010_5m": ("GMTED2010 5-arc-minute topography height, subsampled by NCAR/MMM 2018-05-23 from 30-arc-second", 0.0833333), "erod": ("EROD", 0.25), "soilgrids": ("soilgrids", 0.00833333), "urbfrac_nlcd2011": ("Urban fraction derived from 30 m NLCD 2011 (22 = 50%, 23 = 90%, 24 = 95%)", 30.0), # FIXME: this is in Albers proj with unit metres # TODO: add `updated_Iceland_LU.tar.gz`` } # Lowest resolution of each mandatory field (WRF 4.0). # See http://www2.mmm.ucar.edu/wrf/users/download/get_sources_wps_geog.html. geo_datasets_mandatory_lores = [ "albedo_modis", "greenfrac_fpar_modis", "greenfrac_fpar_modis_5m", "lai_modis_10m", "maxsnowalb_modis", "modis_landuse_20class_5m_with_lakes", "orogwd_1deg", "soiltemp_1deg", "soiltype_bot_5m", "soiltype_top_5m", "topo_gmted2010_5m" ] # Highest resolution of each mandatory field (WRF 4.0). # See http://www2.mmm.ucar.edu/wrf/users/download/get_sources_wps_geog.html. geo_datasets_mandatory_hires = [ "albedo_modis", "greenfrac_fpar_modis", "lai_modis_10m", "lai_modis_30s", "maxsnowalb_modis", "modis_landuse_20class_30s_with_lakes", "orogwd_2deg", "orogwd_1deg", "orogwd_30m", "orogwd_20m", "orogwd_10m", "soiltemp_1deg", "soiltype_bot_30s", "soiltype_top_30s", "topo_gmted2010_30s", "varsso", "varsso_10m", "varsso_5m", "varsso_2m" ] met_datasets = { "ds083.0" : "NCEP FNL Operational Model Global Tropospheric Analyses, April 1997 through June 2007", "ds083.2" : "NCEP FNL Operational Model Global Tropospheric Analyses, continuing from July 1999", "ds083.3" : "NCEP GDAS/FNL 0.25 Degree Global Tropospheric Analyses and Forecast Grids", "ds084.1" : "NCEP GFS 0.25 Degree Global Forecast Grids Historical Archive" } met_datasets_vtables = { "ds083.0" : "Vtable.GFS", "ds083.2" : "Vtable.GFS", "ds083.3" : "Vtable.GFS", "ds084.1" : "Vtable.GFS" }
geo_datasets = {'topo_10m': ('USGS GTOPO DEM', 0.16666667), 'topo_5m': ('USGS GTOPO DEM', 0.08333333), 'topo_2m': ('USGS GTOPO DEM', 0.03333333), 'topo_30s': ('USGS GTOPO DEM', 0.00833333), 'topo_gmted2010_30s': ('USGS GMTED2010 DEM', 0.03333333), 'lake_depth': ('Lake Depth', 0.03333333), 'landuse_10m': ('24-category USGS land use', 0.16666667), 'landuse_5m': ('24-category USGS land use', 0.08333333), 'landuse_2m': ('24-category USGS land use', 0.03333333), 'landuse_30s': ('24-category USGS land use', 0.00833333), 'landuse_30s_with_lakes': ('25-category USGS landuse', 0.00833333), 'modis_landuse_20class_30s': ('Noah-modified 20-category IGBP-MODIS landuse', 0.00833333), 'modis_landuse_20class_30s_with_lakes': ('New Noah-modified 21-category IGBP-MODIS landuse', 0.00833333), 'modis_landuse_20class_15s': ('Noah-modified 20-category IGBP-MODIS landuse', 0.004166667), 'modis_landuse_21class_30s': ('Noah-modified 21-category IGBP-MODIS landuse', 0.00833333), 'nlcd2006_ll_30s': ('National Land Cover Database 2006', 0.00833333), 'nlcd2006_ll_9s': ('National Land Cover Database 2006', 0.0025), 'nlcd2011_imp_ll_9s': ('National Land Cover Database 2011 -- imperviousness percent', 0.0025), 'nlcd2011_can_ll_9s': ('National Land Cover Database 2011 -- canopy percent', 0.0025), 'nlcd2011_ll_9s': ('National Land Cover Database 2011', 0.0025), 'ssib_landuse_10m': ('12-category Simplified Simple Biosphere Model (SSiB) land use', 0.1666667), 'ssib_landuse_5m': ('12-category Simplified Simple Biosphere Model (SSiB) land use', 0.08333333), 'NUDAPT44_1km': ('National Urban Database (NUDAPT) for 44 US cities', 0.0025), 'crop': ('Monthly green fraction', 'various'), 'greenfrac': ('Monthly green fraction', 0.144), 'greenfrac_fpar_modis': ('MODIS Monthly Leaf Area Index/FPAR', 0.00833333), 'sandfrac_5m': ('Sand fraction', 0.08333333), 'soiltemp_1deg': ('Soil temperature', 1.0), 'lai_modis_10m': ('MODIS Leaf Area Index', 0.16666667), 'lai_modis_30s': ('MODIS Leaf Area Index', 0.00833333), 'bnu_soiltype_bot': ('16-category bottom-layer soil type', 0.00833333), 'bnu_soiltype_top': ('16-category top-layer soil type', 0.00833333), 'clayfrac_5m': ('Clay Fraction', 0.08333333), 'soiltype_bot_10m': ('Bottom-layer soil type', 0.16666667), 'soiltype_bot_5m': ('Bottom-layer soil type', 0.08333333), 'soiltype_bot_2m': ('Bottom-layer soil type', 0.03333333), 'soiltype_bot_30s': ('Bottom-layer soil type', 0.00833333), 'soiltype_top_10m': ('Top-layer soil type', 0.16666667), 'soiltype_top_5m': ('Top-layer soil type', 0.08333333), 'soiltype_top_2m': ('Top-layer soil type', 0.03333333), 'soiltype_top_30s': ('Top-layer soil type', 0.00833333), 'albedo_ncep': ('NCEP Monthly surface albedo', 0.144), 'maxsnowalb': ('Maximum snow albedo', 1.0), 'groundwater': ('Groundwater data', 0.00833333), 'islope': ('14-category slope index', 1.0), 'orogwd_2deg': ('Subgrid orography information for gravity wave drag option', 2.0), 'orogwd_1deg': ('Subgrid orography information for gravity wave drag option', 1.0), 'orogwd_30m': ('Subgrid orography information for gravity wave drag option', 0.5), 'orogwd_20m': ('Subgrid orography information for gravity wave drag option', 0.3333333), 'orogwd_10m': ('Subgrid orography information for gravity wave drag option', 0.16666667), 'varsso_10m': ('Variance of subgrid-scale orography', 0.16666667), 'varsso_5m': ('Variance of subgrid-scale orography', 0.08333333), 'varsso_2m': ('Variance of subgrid-scale orography', 0.03333333), 'varsso': ('Variance of subgrid-scale orography', 0.00833333), 'albedo_modis': ('Monthly MODIS surface albedo', 0.05), 'greenfrac_fpar_modis_5m': ('MODIS FPAR, subsampled by NCAR/MMM 2018-05-23 from 30-arc-second', 0.00833333), 'maxsnowalb_modis': ('MODIS maximum snow albedo', 0.05), 'modis_landuse_20class_5m_with_lakes': ('Noah-modified 21-category IGBP-MODIS landuse, subsampled by NCAR/MMM 2018-05-23 from 30-arc-second', 0.00833333), 'topo_gmted2010_5m': ('GMTED2010 5-arc-minute topography height, subsampled by NCAR/MMM 2018-05-23 from 30-arc-second', 0.0833333), 'erod': ('EROD', 0.25), 'soilgrids': ('soilgrids', 0.00833333), 'urbfrac_nlcd2011': ('Urban fraction derived from 30 m NLCD 2011 (22 = 50%, 23 = 90%, 24 = 95%)', 30.0)} geo_datasets_mandatory_lores = ['albedo_modis', 'greenfrac_fpar_modis', 'greenfrac_fpar_modis_5m', 'lai_modis_10m', 'maxsnowalb_modis', 'modis_landuse_20class_5m_with_lakes', 'orogwd_1deg', 'soiltemp_1deg', 'soiltype_bot_5m', 'soiltype_top_5m', 'topo_gmted2010_5m'] geo_datasets_mandatory_hires = ['albedo_modis', 'greenfrac_fpar_modis', 'lai_modis_10m', 'lai_modis_30s', 'maxsnowalb_modis', 'modis_landuse_20class_30s_with_lakes', 'orogwd_2deg', 'orogwd_1deg', 'orogwd_30m', 'orogwd_20m', 'orogwd_10m', 'soiltemp_1deg', 'soiltype_bot_30s', 'soiltype_top_30s', 'topo_gmted2010_30s', 'varsso', 'varsso_10m', 'varsso_5m', 'varsso_2m'] met_datasets = {'ds083.0': 'NCEP FNL Operational Model Global Tropospheric Analyses, April 1997 through June 2007', 'ds083.2': 'NCEP FNL Operational Model Global Tropospheric Analyses, continuing from July 1999', 'ds083.3': 'NCEP GDAS/FNL 0.25 Degree Global Tropospheric Analyses and Forecast Grids', 'ds084.1': 'NCEP GFS 0.25 Degree Global Forecast Grids Historical Archive'} met_datasets_vtables = {'ds083.0': 'Vtable.GFS', 'ds083.2': 'Vtable.GFS', 'ds083.3': 'Vtable.GFS', 'ds084.1': 'Vtable.GFS'}
class Solution: def minRemoveToMakeValid(self, s: str) -> str: # step 1: 1st pass, traverse the string from left to right lcounter = 0 rcounter = 0 marker = 0 toremove1 = [] for i,char in enumerate(s): if char == '(': lcounter += 1 elif char == ')': rcounter += 1 if rcounter > lcounter: toremove1.append(i) lcounter = 0 rcounter = 0 marker = i + 1 # print(lcounter, rcounter, toremove1) # step 2: toremove2 = [] if lcounter > rcounter: # 2nd pass, traverse the string from right to left lcounter = 0 rcounter = 0 for j in range(len(s)-1, marker-1, -1): if s[j] == '(': lcounter += 1 elif s[j] == ')': rcounter += 1 if rcounter < lcounter: toremove2.append(j) lcounter = 0 rcounter = 0 # print(lcounter, rcounter, toremove1, toremove2) # step 3: remove the redundant parentheses s2 = [char for char in s] # print(s2) # print(len(s2)) # print(toremove1) # print(toremove2) if toremove2!=[]: for idx in toremove2: s2.pop(idx) if toremove1!=[]: toremove1.reverse() for idx in toremove1: s2.pop(idx) return ''.join(s2)
class Solution: def min_remove_to_make_valid(self, s: str) -> str: lcounter = 0 rcounter = 0 marker = 0 toremove1 = [] for (i, char) in enumerate(s): if char == '(': lcounter += 1 elif char == ')': rcounter += 1 if rcounter > lcounter: toremove1.append(i) lcounter = 0 rcounter = 0 marker = i + 1 toremove2 = [] if lcounter > rcounter: lcounter = 0 rcounter = 0 for j in range(len(s) - 1, marker - 1, -1): if s[j] == '(': lcounter += 1 elif s[j] == ')': rcounter += 1 if rcounter < lcounter: toremove2.append(j) lcounter = 0 rcounter = 0 s2 = [char for char in s] if toremove2 != []: for idx in toremove2: s2.pop(idx) if toremove1 != []: toremove1.reverse() for idx in toremove1: s2.pop(idx) return ''.join(s2)
a = int(input()) b = int(input()) r = a * b while True: if b == 0: break print(a * (b % 10)) b //= 10 print(r)
a = int(input()) b = int(input()) r = a * b while True: if b == 0: break print(a * (b % 10)) b //= 10 print(r)
# Interface for the data source used in queries. # Currently only includes query capabilities. class Source: def __init__(self): None def isQueryable(self): return False # Check if the source will support the execution of an expression, # given that clauses have already been pushed into it. def supports(self,clauses,expr,visible_vars): return False # Database source for all relational database sources. Currently there is # no common functionality across different RDBMS sources class RDBMSTable(Source): def isQueryable(self): return True
class Source: def __init__(self): None def is_queryable(self): return False def supports(self, clauses, expr, visible_vars): return False class Rdbmstable(Source): def is_queryable(self): return True
# me - this DAT # par - the Par object that has changed # val - the current value # prev - the previous value # # Make sure the corresponding toggle is enabled in the Parameter Execute DAT. def onValueChange(par, prev): if par.name == 'Heartbeatrole': parent().Role_setup(par) else: pass return def onPulse(par): return def onExpressionChange(par, val, prev): return def onExportChange(par, val, prev): return def onEnableChange(par, val, prev): return def onModeChange(par, val, prev): return
def on_value_change(par, prev): if par.name == 'Heartbeatrole': parent().Role_setup(par) else: pass return def on_pulse(par): return def on_expression_change(par, val, prev): return def on_export_change(par, val, prev): return def on_enable_change(par, val, prev): return def on_mode_change(par, val, prev): return
def fibonacci(n): if n == 0: return 0 elif n == 1: return 1 fn1 = 0 fn2 = 1 for i in range(1, n): tmp = fn2 fn2 = fn1 + fn2 fn1 = tmp return fn2 if __name__ == '__main__': print(fibonacci(100))
def fibonacci(n): if n == 0: return 0 elif n == 1: return 1 fn1 = 0 fn2 = 1 for i in range(1, n): tmp = fn2 fn2 = fn1 + fn2 fn1 = tmp return fn2 if __name__ == '__main__': print(fibonacci(100))
# -*- coding: utf-8 -*- # Settings_Export: control which project settings are exposed to templates # See: https://github.com/jakubroztocil/django-settings-export SETTINGS_EXPORT = [ "SITE_NAME", "DEBUG", "ENV" ] # Settings can be accessed in templates via `{{ '{{' }} settings.<KEY> {{ '}}' }}`.
settings_export = ['SITE_NAME', 'DEBUG', 'ENV']
# Dataset information LABELS = [ 'Atelectasis', 'Cardiomegaly', 'Effusion', 'Infiltration', 'Mass', 'Nodule', 'Pneumonia', 'Pneumothorax', 'Consolidation', 'Edema', 'Emphysema', 'Fibrosis', 'Pleural_Thickening', 'Hernia' ] USE_COLUMNS = ['Image Index', 'Finding Labels', 'Patient ID'] N_CLASSES = len(LABELS) # Preprocessing # - default arguments RANDOM_SEED = 42 DATASET_IMAGE_SIZE = 256 TRAIN_VAL_TEST_RATIO = (.7, .1, .2) # - input filenames and directories IMAGE_DIR = './data/original_data/images/' META_DATA_DIR = './data/original_data/meta_data/' META_FILENAME = 'Data_Entry_2017_v2020.csv' # - output filenames and directories LABELS_DIR = './data/labels/' DATASET_DIR = './data/datasets/' TRAIN_LABELS = 'train_labels.csv' VAL_LABELS = 'val_labels.csv' TEST_LABELS = 'test_labels.csv' # Training, validation and testing # - filenames and directories SAVE_DIR = './data/saved_models/' # - default arguments BATCH_SIZE = 8 NUM_WORKERS = 1 NUM_EPOCHS = 8 LEARNING_RATE = 0.001 SCHEDULER_FACTOR = 0.1 SCHEDULER_PATIENCE = 0 DATA_AUGMENTATION = False CENTER_CROP = DATA_AUGMENTATION DEBUG = False # Testing and debugging DEBUG_SIZES = {'train': 1280, 'val': 1280, 'test':1280}
labels = ['Atelectasis', 'Cardiomegaly', 'Effusion', 'Infiltration', 'Mass', 'Nodule', 'Pneumonia', 'Pneumothorax', 'Consolidation', 'Edema', 'Emphysema', 'Fibrosis', 'Pleural_Thickening', 'Hernia'] use_columns = ['Image Index', 'Finding Labels', 'Patient ID'] n_classes = len(LABELS) random_seed = 42 dataset_image_size = 256 train_val_test_ratio = (0.7, 0.1, 0.2) image_dir = './data/original_data/images/' meta_data_dir = './data/original_data/meta_data/' meta_filename = 'Data_Entry_2017_v2020.csv' labels_dir = './data/labels/' dataset_dir = './data/datasets/' train_labels = 'train_labels.csv' val_labels = 'val_labels.csv' test_labels = 'test_labels.csv' save_dir = './data/saved_models/' batch_size = 8 num_workers = 1 num_epochs = 8 learning_rate = 0.001 scheduler_factor = 0.1 scheduler_patience = 0 data_augmentation = False center_crop = DATA_AUGMENTATION debug = False debug_sizes = {'train': 1280, 'val': 1280, 'test': 1280}
#!/bin/python3 DISK_SIZE = 272 INIT_STATE = '00111101111101000' def fill_disk(state, max_size): if len(state) > max_size: return state[:max_size] temp_state = state state += '0' for i in range(1, len(temp_state)+1): state += str(abs(int(temp_state[-i])-1)) return fill_disk(state, max_size) def acquire_check_sum(state): if len(state) % 2 != 0: return state checkdict = {'11': '1', '00': '1', '10': '0', '01': '0'} i = 0 checksum = '' while i < len(state): checksum += checkdict[state[i:i+2]] i += 2 return acquire_check_sum(checksum) def day16(): disk = fill_disk(INIT_STATE, DISK_SIZE) checksum = acquire_check_sum(disk) print('Part 1: {}'.format(checksum)) disk = fill_disk(INIT_STATE, 35651584) checksum = acquire_check_sum(disk) print('Part 2: {}'.format(checksum)) if __name__ == '__main__': day16()
disk_size = 272 init_state = '00111101111101000' def fill_disk(state, max_size): if len(state) > max_size: return state[:max_size] temp_state = state state += '0' for i in range(1, len(temp_state) + 1): state += str(abs(int(temp_state[-i]) - 1)) return fill_disk(state, max_size) def acquire_check_sum(state): if len(state) % 2 != 0: return state checkdict = {'11': '1', '00': '1', '10': '0', '01': '0'} i = 0 checksum = '' while i < len(state): checksum += checkdict[state[i:i + 2]] i += 2 return acquire_check_sum(checksum) def day16(): disk = fill_disk(INIT_STATE, DISK_SIZE) checksum = acquire_check_sum(disk) print('Part 1: {}'.format(checksum)) disk = fill_disk(INIT_STATE, 35651584) checksum = acquire_check_sum(disk) print('Part 2: {}'.format(checksum)) if __name__ == '__main__': day16()
## Valid Phone Number Checker def num_only(): ''' returns the user inputed phone number in the form of only ten digits, and prints the string 'Thanks!' if the number is inputted in a correct format or prints the string 'Invalid number.' if the input is not in correct form num_only: None -> Str examples: >>> num_only() Enter a phone number:(519)888-4567 Thanks! '5198884567' >>> num_only() Enter a phone number:90512345678 Invalid number. ''' s = input("Enter a phone number:") if str.isdigit(s) == True and len(s) == 10: print('Thanks!') return(s) elif str.isdigit(s[:3]) == True and s[3:4] == "-" and \ str.isdigit(s[4:7]) == True and s[7:8] == "-" and \ str.isdigit(s[8:12]) == True and len(s) == 12: print('Thanks!') return(s[:3] + s[4:7] + s[8:12]) elif s[:1] == "(": if len(s) == 12 and str.isdigit(s[1:4]) == True and \ s[4:5] == ")" and str.isdigit(s[5:12]) == True: print('Thanks!') return(s[1:4] + s[5:12]) if len(s) == 13 and str.isdigit(s[1:4]) == True and \ s[4:5] == ")" and str.isdigit(s[5:8]) == True and \ s[8:9] == "-" and str.isdigit(s[9:13]) == True: print('Thanks!') return(s[1:4] + s[5:8] + s[9:13]) else: print('Invalid number.') else: print('Invalid number.')
def num_only(): """ returns the user inputed phone number in the form of only ten digits, and prints the string 'Thanks!' if the number is inputted in a correct format or prints the string 'Invalid number.' if the input is not in correct form num_only: None -> Str examples: >>> num_only() Enter a phone number:(519)888-4567 Thanks! '5198884567' >>> num_only() Enter a phone number:90512345678 Invalid number. """ s = input('Enter a phone number:') if str.isdigit(s) == True and len(s) == 10: print('Thanks!') return s elif str.isdigit(s[:3]) == True and s[3:4] == '-' and (str.isdigit(s[4:7]) == True) and (s[7:8] == '-') and (str.isdigit(s[8:12]) == True) and (len(s) == 12): print('Thanks!') return s[:3] + s[4:7] + s[8:12] elif s[:1] == '(': if len(s) == 12 and str.isdigit(s[1:4]) == True and (s[4:5] == ')') and (str.isdigit(s[5:12]) == True): print('Thanks!') return s[1:4] + s[5:12] if len(s) == 13 and str.isdigit(s[1:4]) == True and (s[4:5] == ')') and (str.isdigit(s[5:8]) == True) and (s[8:9] == '-') and (str.isdigit(s[9:13]) == True): print('Thanks!') return s[1:4] + s[5:8] + s[9:13] else: print('Invalid number.') else: print('Invalid number.')
envs_dict = { # "Standard" Mujoco Envs "halfcheetah": "gym.envs.mujoco.half_cheetah:HalfCheetahEnv", "ant": "gym.envs.mujoco.ant:AntEnv", "hopper": "gym.envs.mujoco.hopper:HopperEnv", "walker": "gym.envs.mujoco.walker2d:Walker2dEnv", "humanoid": "gym.envs.mujoco.humanoid:HumanoidEnv", "swimmer": "gym.envs.mujoco.swimmer:SwimmerEnv", "inverteddoublependulum": "gym.envs.mujoco.inverted_double_pendulum:InvertedDoublePendulum2dEnv", "invertedpendulum": "gym.envs.mujoco.inverted_pendulum:InvertedPendulum", # normal envs "lunarlandercont": "gym.envs.box2d.lunar_lander:LunarLanderContinuous", }
envs_dict = {'halfcheetah': 'gym.envs.mujoco.half_cheetah:HalfCheetahEnv', 'ant': 'gym.envs.mujoco.ant:AntEnv', 'hopper': 'gym.envs.mujoco.hopper:HopperEnv', 'walker': 'gym.envs.mujoco.walker2d:Walker2dEnv', 'humanoid': 'gym.envs.mujoco.humanoid:HumanoidEnv', 'swimmer': 'gym.envs.mujoco.swimmer:SwimmerEnv', 'inverteddoublependulum': 'gym.envs.mujoco.inverted_double_pendulum:InvertedDoublePendulum2dEnv', 'invertedpendulum': 'gym.envs.mujoco.inverted_pendulum:InvertedPendulum', 'lunarlandercont': 'gym.envs.box2d.lunar_lander:LunarLanderContinuous'}
# This file MUST be configured in order for the code to run properly # Make sure you put all your input images into an 'assets' folder. # Each layer (or category) of images must be put in a folder of its own. # CONFIG is an array of objects where each object represents a layer # THESE LAYERS MUST BE ORDERED. # Each layer needs to specify the following # 1. id: A number representing a particular layer # 2. name: The name of the layer. Does not necessarily have to be the same as the directory name containing the layer images. # 3. directory: The folder inside assets that contain traits for the particular layer # 4. required: If the particular layer is required (True) or optional (False). The first layer must always be set to true. # 5. rarity_weights: Denotes the rarity distribution of traits. It can take on three types of values. # - None: This makes all the traits defined in the layer equally rare (or common) # - "random": Assigns rarity weights at random. # - array: An array of numbers where each number represents a weight. # If required is True, this array must be equal to the number of images in the layer directory. The first number is the weight of the first image (in alphabetical order) and so on... # If required is False, this array must be equal to one plus the number of images in the layer directory. The first number is the weight of having no image at all for this layer. The second number is the weight of the first image and so on... # Be sure to check out the tutorial in the README for more details. CONFIG = [ { 'id': 1, 'name': 'asset1', 'directory': 'asset1', 'required': True, 'rarity_weights': [20, 16, 17, 8, 18, 15, 9, 6], }, { 'id': 2, 'name': 'asset2', 'directory': 'asset2', 'required': True, 'rarity_weights': [8, 24, 16, 20, 13, 19, 6], }, { 'id': 3, 'name': 'asset3', 'directory': 'asset3', 'required': True, 'rarity_weights': [6, 25, 15, 12, 20, 9, 16, 7, 15, 19, 5], }, { 'id': 4, 'name': 'asset4', 'directory': 'asset4', 'required': False, 'rarity_weights': [100, 9, 30, 20, 19, 25, 22, 33, 19, 12, 14, 18, 7, 3, 10, 24], }, { 'id': 5, 'name': 'asset5', 'directory': 'asset5', 'required': True, 'rarity_weights': [19, 12, 6, 12, 20, 24, 9, 8], }, { 'id': 5, 'name': 'asset6', 'directory': 'asset6', 'required': False, 'rarity_weights': [100, 24, 19, 6, 14, 20, 24, 12, 16], }, ]
config = [{'id': 1, 'name': 'asset1', 'directory': 'asset1', 'required': True, 'rarity_weights': [20, 16, 17, 8, 18, 15, 9, 6]}, {'id': 2, 'name': 'asset2', 'directory': 'asset2', 'required': True, 'rarity_weights': [8, 24, 16, 20, 13, 19, 6]}, {'id': 3, 'name': 'asset3', 'directory': 'asset3', 'required': True, 'rarity_weights': [6, 25, 15, 12, 20, 9, 16, 7, 15, 19, 5]}, {'id': 4, 'name': 'asset4', 'directory': 'asset4', 'required': False, 'rarity_weights': [100, 9, 30, 20, 19, 25, 22, 33, 19, 12, 14, 18, 7, 3, 10, 24]}, {'id': 5, 'name': 'asset5', 'directory': 'asset5', 'required': True, 'rarity_weights': [19, 12, 6, 12, 20, 24, 9, 8]}, {'id': 5, 'name': 'asset6', 'directory': 'asset6', 'required': False, 'rarity_weights': [100, 24, 19, 6, 14, 20, 24, 12, 16]}]