content
stringlengths
7
1.05M
fixed_cases
stringlengths
1
1.28M
# coding=utf-8 class NodeType: select = 'SELECT' insert = 'INSERT' delete = 'DELETE' update = 'UPDATE' train = 'TRAIN' register = 'REGISTER' load = 'LOAD' save = 'SAVE' connect = 'CONNECT' set = 'SET' alert = 'ALERT' create_table = 'CREATETABLE' drop_table = 'DROPTABLE' create_index = 'CREATEINDEX' drop_index = 'DROPINDEX' create_user = 'CREATEUSER' exit = 'EXIT' print_table = 'PRINT' show_tables = 'SHOW' value = 'VALUE' condition = 'CONDITION' relation_attr = 'RELATTR' grant_user = 'GRANTUSER' revoke_user = 'REVOKEUSER' attr_type = "ATTRTYPE" class QueryNode: def __init__(self, select_list, from_list, where_list, limit_num, as_table): self.type = NodeType.select self.select_list = select_list self.from_list = from_list self.where_list = where_list self.limit_num = limit_num self.as_table = as_table class LoadNode: def __init__(self, where_list, table_id): self.type = NodeType.load self.where_list = where_list self.table_id = table_id class SaveNode: def __init__(self, table_id): self.type = NodeType.save self.table_id = table_id class ConnectNode: def __init__(self, table_id): self.type = NodeType.connect self.table_id = table_id class SetNode: def __init__(self, where_list, table_id): self.type = NodeType.set self.where_list = where_list self.table_id = table_id class InsertNode: def __init__(self, table_name, value_list): self.type = NodeType.insert self.table_name = table_name self.value_list = value_list class DeleteNode: def __init__(self, table_name, where_list): self.type = NodeType.delete self.table_name = table_name self.where_list = where_list class UpdateNode: def __init__(self, table_name, set_list, where_list): self.type = NodeType.update self.table_name = table_name self.set_list = set_list self.where_list = where_list class TrainNode: def __init__(self, set_list, where_list): self.type = NodeType.train self.set_list = set_list self.where_list = where_list class RegisterNode: def __init__(self, set_list, where_list): self.type = NodeType.register self.set_list = set_list self.where_list = where_list class AlertNode: def __init__(self, table_name, op, attr_list): self.type = NodeType.alert self.table_name = table_name self.op = op self.attr_list = attr_list class CreateTableNode: def __init__(self, table_name, attr_list): self.type = NodeType.create_table self.table_name = table_name self.attr_list = attr_list class DropTableNode: def __init__(self, table_name): self.type = NodeType.drop_table self.table_name = table_name class CreateIndexNode: def __init__(self, table_name, attr_name): self.type = NodeType.create_index self.table_name = table_name self.attr_name = attr_name class DropIndexNode: def __init__(self, table_name, attr_name): self.type = NodeType.drop_index self.table_name = table_name self.attr_name = attr_name class CreateUserNode: def __init__(self, user_id, password): self.type = NodeType.create_user self.user_id = user_id self.password = password class GrantUserNode: def __init__(self, power_list, table_list, user_list): self.type = NodeType.grant_user self.power_list = power_list self.table_list = table_list self.user_list = user_list class RevokeUserNode: def __init__(self, power_list, table_list, user_list): self.type = NodeType.revoke_user self.power_list = power_list self.table_list = table_list self.user_list = user_list class Exit: def __init__(self): self.type = NodeType.exit class PrintTable: def __init__(self, table_name): self.type = NodeType.print_table self.table_name = table_name class ShowTables: def __init__(self): self.type = NodeType.show_tables class Value: def __init__(self, value_type, value): self.type = NodeType.value self.value_type = value_type self.value = value def __str__(self): return str(self.value) + '[' + self.value_type + ']' class RelAttr: def __init__(self, attr_name, table_name=None): self.type = NodeType.relation_attr self.table_name = table_name self.attr_name = attr_name def __str__(self): if self.table_name: return self.table_name + '.' + self.attr_name else: return self.attr_name class Cond: def __init__(self, left, op, right): self.type = NodeType.condition self.op = op.upper() self.left = left self.right = right def __str__(self): return '(' + str(self.left) + ', ' + str( self.right) + ', ' + self.op + ')' class AttrType: def __init__(self, attr_name, attr_type, type_len=1): self.type = NodeType.attr_type self.attr_type = attr_type self.type_len = type_len self.attr_name = attr_name def __str__(self): return self.attr_name + " " + self.attr_type + " " + str(self.type_len) if __name__ == '__main__': pass
class Nodetype: select = 'SELECT' insert = 'INSERT' delete = 'DELETE' update = 'UPDATE' train = 'TRAIN' register = 'REGISTER' load = 'LOAD' save = 'SAVE' connect = 'CONNECT' set = 'SET' alert = 'ALERT' create_table = 'CREATETABLE' drop_table = 'DROPTABLE' create_index = 'CREATEINDEX' drop_index = 'DROPINDEX' create_user = 'CREATEUSER' exit = 'EXIT' print_table = 'PRINT' show_tables = 'SHOW' value = 'VALUE' condition = 'CONDITION' relation_attr = 'RELATTR' grant_user = 'GRANTUSER' revoke_user = 'REVOKEUSER' attr_type = 'ATTRTYPE' class Querynode: def __init__(self, select_list, from_list, where_list, limit_num, as_table): self.type = NodeType.select self.select_list = select_list self.from_list = from_list self.where_list = where_list self.limit_num = limit_num self.as_table = as_table class Loadnode: def __init__(self, where_list, table_id): self.type = NodeType.load self.where_list = where_list self.table_id = table_id class Savenode: def __init__(self, table_id): self.type = NodeType.save self.table_id = table_id class Connectnode: def __init__(self, table_id): self.type = NodeType.connect self.table_id = table_id class Setnode: def __init__(self, where_list, table_id): self.type = NodeType.set self.where_list = where_list self.table_id = table_id class Insertnode: def __init__(self, table_name, value_list): self.type = NodeType.insert self.table_name = table_name self.value_list = value_list class Deletenode: def __init__(self, table_name, where_list): self.type = NodeType.delete self.table_name = table_name self.where_list = where_list class Updatenode: def __init__(self, table_name, set_list, where_list): self.type = NodeType.update self.table_name = table_name self.set_list = set_list self.where_list = where_list class Trainnode: def __init__(self, set_list, where_list): self.type = NodeType.train self.set_list = set_list self.where_list = where_list class Registernode: def __init__(self, set_list, where_list): self.type = NodeType.register self.set_list = set_list self.where_list = where_list class Alertnode: def __init__(self, table_name, op, attr_list): self.type = NodeType.alert self.table_name = table_name self.op = op self.attr_list = attr_list class Createtablenode: def __init__(self, table_name, attr_list): self.type = NodeType.create_table self.table_name = table_name self.attr_list = attr_list class Droptablenode: def __init__(self, table_name): self.type = NodeType.drop_table self.table_name = table_name class Createindexnode: def __init__(self, table_name, attr_name): self.type = NodeType.create_index self.table_name = table_name self.attr_name = attr_name class Dropindexnode: def __init__(self, table_name, attr_name): self.type = NodeType.drop_index self.table_name = table_name self.attr_name = attr_name class Createusernode: def __init__(self, user_id, password): self.type = NodeType.create_user self.user_id = user_id self.password = password class Grantusernode: def __init__(self, power_list, table_list, user_list): self.type = NodeType.grant_user self.power_list = power_list self.table_list = table_list self.user_list = user_list class Revokeusernode: def __init__(self, power_list, table_list, user_list): self.type = NodeType.revoke_user self.power_list = power_list self.table_list = table_list self.user_list = user_list class Exit: def __init__(self): self.type = NodeType.exit class Printtable: def __init__(self, table_name): self.type = NodeType.print_table self.table_name = table_name class Showtables: def __init__(self): self.type = NodeType.show_tables class Value: def __init__(self, value_type, value): self.type = NodeType.value self.value_type = value_type self.value = value def __str__(self): return str(self.value) + '[' + self.value_type + ']' class Relattr: def __init__(self, attr_name, table_name=None): self.type = NodeType.relation_attr self.table_name = table_name self.attr_name = attr_name def __str__(self): if self.table_name: return self.table_name + '.' + self.attr_name else: return self.attr_name class Cond: def __init__(self, left, op, right): self.type = NodeType.condition self.op = op.upper() self.left = left self.right = right def __str__(self): return '(' + str(self.left) + ', ' + str(self.right) + ', ' + self.op + ')' class Attrtype: def __init__(self, attr_name, attr_type, type_len=1): self.type = NodeType.attr_type self.attr_type = attr_type self.type_len = type_len self.attr_name = attr_name def __str__(self): return self.attr_name + ' ' + self.attr_type + ' ' + str(self.type_len) if __name__ == '__main__': pass
# Name: # Date: # proj02: sum # Write a program that prompts the user to enter numbers, one per line, # ending with a line containing 0, and keep a running sum of the numbers. # Only print out the sum after all the numbers are entered # (at least in your final version). Each time you read in a number, # you can immediately use it for your sum, # and then be done with the number just entered. #Example: # Enter a number to sum, or 0 to indicate you are finished: 4 # Enter a number to sum, or 0 to indicate you are finished: 5 # Enter a number to sum, or 0 to indicate you are finished: 2 # Enter a number to sum, or 0 to indicate you are finished: 10 # Enter a number to sum, or 0 to indicate you are finished: 0 #The sum of your numbers is: 21 #Number adding thing num = int(input("Enter a number to sum, or 0 to indicate you are finished:")) sum = 0 summ = 0 while num > 0: sum = sum + num num = int(input("Enter a number to sum, or 0 to indicate you are finished:")) summ = summ + 1 average = sum/summ print("Your average is " + str(average)) """"#R/P/S answer = input("Would you like to play?") while answer == "Yes": p1_input = input("Rock, paper, scissors") p2_input = input("Rock, paper, scissors") if p1_input == "rock" and p2_input == "paper": print("Player 2 wins") elif p1_input == "rock" and p2_input == "scissors": print("Player 1 wins") elif p1_input == "paper" and p2_input == "rock": print("Player 1 wins") elif p1_input == "paper" and p2_input == "scissors": print("Player 2 wins") elif p1_input == "scissors" and p2_input == "rock": print("Player 2 wins") elif p1_input == "scissors" and p2_input == "Paper": print("Player 1 wins") else: print("It is a tie") answer = input("Would you like to play again?")"""
num = int(input('Enter a number to sum, or 0 to indicate you are finished:')) sum = 0 summ = 0 while num > 0: sum = sum + num num = int(input('Enter a number to sum, or 0 to indicate you are finished:')) summ = summ + 1 average = sum / summ print('Your average is ' + str(average)) '"#R/P/S\nanswer = input("Would you like to play?")\n\nwhile answer == "Yes":\n p1_input = input("Rock, paper, scissors")\n p2_input = input("Rock, paper, scissors")\n\n if p1_input == "rock" and p2_input == "paper":\n print("Player 2 wins")\n elif p1_input == "rock" and p2_input == "scissors":\n print("Player 1 wins")\n elif p1_input == "paper" and p2_input == "rock":\n print("Player 1 wins")\n elif p1_input == "paper" and p2_input == "scissors":\n print("Player 2 wins")\n elif p1_input == "scissors" and p2_input == "rock":\n print("Player 2 wins")\n elif p1_input == "scissors" and p2_input == "Paper":\n print("Player 1 wins")\n else:\n print("It is a tie")\n answer = input("Would you like to play again?")'
sentence='I am interested in {num}' pi=3.14 print(sentence.format(num=pi)) e=2.712 print(sentence.format(num=e))
sentence = 'I am interested in {num}' pi = 3.14 print(sentence.format(num=pi)) e = 2.712 print(sentence.format(num=e))
""" File: rocket.py Name:Claire Lin ----------------------- This program should implement a console program that draws ASCII art - a rocket. The size of rocket is determined by a constant defined as SIZE at top of the file. Output format should match what is shown in the sample run in the Assignment 2 Handout. """ # This constant determines rocket size. SIZE = 3 def main(): """ :return: str, the rocket will be build in any size. """ head() belt() upper() lower() belt() head() def head(): for i in range(SIZE): print(' ', end='') for j in range(-i+(SIZE-1)): print(' ', end='') for k in range(i+1): print('/', end='') for l in range(i+1): print('\\', end='') print("") def belt(): print('+', end='') for k in range(SIZE*2): print('=', end='') print('+') def upper(): for m in range(SIZE): print('|', end='') for n in range(-m+(SIZE-1)): print('.', end='') for u in range(m+1): print('/\\', end='') for s in range(-m+(SIZE - 1)): print('.', end='') print('|') def lower(): for o in range(SIZE): print('|', end='') for p in range(o): print('.', end='') for r in range(-o+SIZE): print('\\/', end='') for q in range(o): print('.', end='') print('|') ###### DO NOT EDIT CODE BELOW THIS LINE ###### if __name__ == "__main__": main()
""" File: rocket.py Name:Claire Lin ----------------------- This program should implement a console program that draws ASCII art - a rocket. The size of rocket is determined by a constant defined as SIZE at top of the file. Output format should match what is shown in the sample run in the Assignment 2 Handout. """ size = 3 def main(): """ :return: str, the rocket will be build in any size. """ head() belt() upper() lower() belt() head() def head(): for i in range(SIZE): print(' ', end='') for j in range(-i + (SIZE - 1)): print(' ', end='') for k in range(i + 1): print('/', end='') for l in range(i + 1): print('\\', end='') print('') def belt(): print('+', end='') for k in range(SIZE * 2): print('=', end='') print('+') def upper(): for m in range(SIZE): print('|', end='') for n in range(-m + (SIZE - 1)): print('.', end='') for u in range(m + 1): print('/\\', end='') for s in range(-m + (SIZE - 1)): print('.', end='') print('|') def lower(): for o in range(SIZE): print('|', end='') for p in range(o): print('.', end='') for r in range(-o + SIZE): print('\\/', end='') for q in range(o): print('.', end='') print('|') if __name__ == '__main__': main()
l = [int(i) for i in input().split()] print("largest - ", max(l)) print('smallest - ', min(l)) print('2nd largest - ', sorted(l)[-2]) print('2nd smallest - ', sorted(l)[1])
l = [int(i) for i in input().split()] print('largest - ', max(l)) print('smallest - ', min(l)) print('2nd largest - ', sorted(l)[-2]) print('2nd smallest - ', sorted(l)[1])
"""Tier of ecosystem membership.""" # pylint: disable=too-few-public-methods class Tier: """Tiers of ecosystem membership.""" MAIN: str = "MAIN" MEMBER: str = "MEMBER" CANDIDATE: str = "CANDIDATE" COMMUNITY: str = "COMMUNITY" PROTOTYPES: str = "PROTOTYPES"
"""Tier of ecosystem membership.""" class Tier: """Tiers of ecosystem membership.""" main: str = 'MAIN' member: str = 'MEMBER' candidate: str = 'CANDIDATE' community: str = 'COMMUNITY' prototypes: str = 'PROTOTYPES'
N, M = list(map(int, input().split())) # N, M = (2, 3) def simple_add(n, m): if m == 0: return n elif m > 0: return simple_add(n + m, 0) else: return simple_add(n + m, 0) print(simple_add(N, M))
(n, m) = list(map(int, input().split())) def simple_add(n, m): if m == 0: return n elif m > 0: return simple_add(n + m, 0) else: return simple_add(n + m, 0) print(simple_add(N, M))
qtd=int(input()) if qtd>=0 and qtd<=1000: lista=[] for a in range(0,qtd): A=int(input()) while A<0 or A>10**6: A=int(input()) lista.append(A) acessos=0 dias=0 for a in lista: acessos+=a print(a, acessos) if acessos+a<10**6: dias+=1 print(dias+1)
qtd = int(input()) if qtd >= 0 and qtd <= 1000: lista = [] for a in range(0, qtd): a = int(input()) while A < 0 or A > 10 ** 6: a = int(input()) lista.append(A) acessos = 0 dias = 0 for a in lista: acessos += a print(a, acessos) if acessos + a < 10 ** 6: dias += 1 print(dias + 1)
class person: count=0 #class attribute def __init__(self,name="bol",age=23): #constructor self.__name=name #instance attribute self.__age=age #instance attribute person.count=person.count+1 def setname(self,name): self.__name=name def getname(self): return self.__name def displayInfo(self): #method print(self.name, self.age) name=property(getname,setname) def display(str): print(str) def displaydecorator(fn): def display_wrapper(str): print('Output:', end=" ") fn(str) return display_wrapper
class Person: count = 0 def __init__(self, name='bol', age=23): self.__name = name self.__age = age person.count = person.count + 1 def setname(self, name): self.__name = name def getname(self): return self.__name def display_info(self): print(self.name, self.age) name = property(getname, setname) def display(str): print(str) def displaydecorator(fn): def display_wrapper(str): print('Output:', end=' ') fn(str) return display_wrapper
# # PySNMP MIB module ELTEX-IP-OSPF-IF-MIB (http://snmplabs.com/pysmi) # ASN.1 source file:///Users/davwang4/Dev/mibs.snmplabs.com/asn1/ELTEX-IP-OSPF-IF-MIB # Produced by pysmi-0.3.4 at Mon Apr 29 18:45:50 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, OctetString, Integer = mibBuilder.importSymbols("ASN1", "ObjectIdentifier", "OctetString", "Integer") NamedValues, = mibBuilder.importSymbols("ASN1-ENUMERATION", "NamedValues") SingleValueConstraint, ConstraintsUnion, ConstraintsIntersection, ValueRangeConstraint, ValueSizeConstraint = mibBuilder.importSymbols("ASN1-REFINEMENT", "SingleValueConstraint", "ConstraintsUnion", "ConstraintsIntersection", "ValueRangeConstraint", "ValueSizeConstraint") eltMes, = mibBuilder.importSymbols("ELTEX-MES", "eltMes") eltMesOspf, = mibBuilder.importSymbols("ELTEX-MES-IP", "eltMesOspf") PortList, = mibBuilder.importSymbols("Q-BRIDGE-MIB", "PortList") NotificationGroup, ModuleCompliance = mibBuilder.importSymbols("SNMPv2-CONF", "NotificationGroup", "ModuleCompliance") TimeTicks, Gauge32, ObjectIdentity, Counter32, Unsigned32, MibIdentifier, Counter64, NotificationType, ModuleIdentity, Integer32, MibScalar, MibTable, MibTableRow, MibTableColumn, Bits, iso, IpAddress = mibBuilder.importSymbols("SNMPv2-SMI", "TimeTicks", "Gauge32", "ObjectIdentity", "Counter32", "Unsigned32", "MibIdentifier", "Counter64", "NotificationType", "ModuleIdentity", "Integer32", "MibScalar", "MibTable", "MibTableRow", "MibTableColumn", "Bits", "iso", "IpAddress") TextualConvention, DisplayString, RowStatus, TruthValue = mibBuilder.importSymbols("SNMPv2-TC", "TextualConvention", "DisplayString", "RowStatus", "TruthValue") eltIpOspfIfTable = MibTable((1, 3, 6, 1, 4, 1, 35265, 1, 23, 91, 1, 2), ) if mibBuilder.loadTexts: eltIpOspfIfTable.setStatus('current') eltIpOspfIfEntry = MibTableRow((1, 3, 6, 1, 4, 1, 35265, 1, 23, 91, 1, 2, 1), ).setIndexNames((0, "ELTEX-IP-OSPF-IF-MIB", "eltOspfIfAddress")) if mibBuilder.loadTexts: eltIpOspfIfEntry.setStatus('current') eltOspfIfAddress = MibTableColumn((1, 3, 6, 1, 4, 1, 35265, 1, 23, 91, 1, 2, 1, 1), IpAddress()).setMaxAccess("readwrite") if mibBuilder.loadTexts: eltOspfIfAddress.setStatus('current') eltOspfIfPassiveDefault = MibTableColumn((1, 3, 6, 1, 4, 1, 35265, 1, 23, 91, 1, 2, 1, 2), TruthValue().clone('false')).setMaxAccess("readwrite") if mibBuilder.loadTexts: eltOspfIfPassiveDefault.setStatus('current') eltOspfIfPassiveList = MibTableColumn((1, 3, 6, 1, 4, 1, 35265, 1, 23, 91, 1, 2, 1, 3), PortList()).setMaxAccess("readwrite") if mibBuilder.loadTexts: eltOspfIfPassiveList.setStatus('current') eltOspfIfStatus = MibTableColumn((1, 3, 6, 1, 4, 1, 35265, 1, 23, 91, 1, 2, 1, 4), RowStatus()).setMaxAccess("readcreate") if mibBuilder.loadTexts: eltOspfIfStatus.setStatus('current') mibBuilder.exportSymbols("ELTEX-IP-OSPF-IF-MIB", eltOspfIfAddress=eltOspfIfAddress, eltOspfIfPassiveDefault=eltOspfIfPassiveDefault, eltIpOspfIfTable=eltIpOspfIfTable, eltOspfIfStatus=eltOspfIfStatus, eltIpOspfIfEntry=eltIpOspfIfEntry, eltOspfIfPassiveList=eltOspfIfPassiveList)
(object_identifier, octet_string, integer) = mibBuilder.importSymbols('ASN1', 'ObjectIdentifier', 'OctetString', 'Integer') (named_values,) = mibBuilder.importSymbols('ASN1-ENUMERATION', 'NamedValues') (single_value_constraint, constraints_union, constraints_intersection, value_range_constraint, value_size_constraint) = mibBuilder.importSymbols('ASN1-REFINEMENT', 'SingleValueConstraint', 'ConstraintsUnion', 'ConstraintsIntersection', 'ValueRangeConstraint', 'ValueSizeConstraint') (elt_mes,) = mibBuilder.importSymbols('ELTEX-MES', 'eltMes') (elt_mes_ospf,) = mibBuilder.importSymbols('ELTEX-MES-IP', 'eltMesOspf') (port_list,) = mibBuilder.importSymbols('Q-BRIDGE-MIB', 'PortList') (notification_group, module_compliance) = mibBuilder.importSymbols('SNMPv2-CONF', 'NotificationGroup', 'ModuleCompliance') (time_ticks, gauge32, object_identity, counter32, unsigned32, mib_identifier, counter64, notification_type, module_identity, integer32, mib_scalar, mib_table, mib_table_row, mib_table_column, bits, iso, ip_address) = mibBuilder.importSymbols('SNMPv2-SMI', 'TimeTicks', 'Gauge32', 'ObjectIdentity', 'Counter32', 'Unsigned32', 'MibIdentifier', 'Counter64', 'NotificationType', 'ModuleIdentity', 'Integer32', 'MibScalar', 'MibTable', 'MibTableRow', 'MibTableColumn', 'Bits', 'iso', 'IpAddress') (textual_convention, display_string, row_status, truth_value) = mibBuilder.importSymbols('SNMPv2-TC', 'TextualConvention', 'DisplayString', 'RowStatus', 'TruthValue') elt_ip_ospf_if_table = mib_table((1, 3, 6, 1, 4, 1, 35265, 1, 23, 91, 1, 2)) if mibBuilder.loadTexts: eltIpOspfIfTable.setStatus('current') elt_ip_ospf_if_entry = mib_table_row((1, 3, 6, 1, 4, 1, 35265, 1, 23, 91, 1, 2, 1)).setIndexNames((0, 'ELTEX-IP-OSPF-IF-MIB', 'eltOspfIfAddress')) if mibBuilder.loadTexts: eltIpOspfIfEntry.setStatus('current') elt_ospf_if_address = mib_table_column((1, 3, 6, 1, 4, 1, 35265, 1, 23, 91, 1, 2, 1, 1), ip_address()).setMaxAccess('readwrite') if mibBuilder.loadTexts: eltOspfIfAddress.setStatus('current') elt_ospf_if_passive_default = mib_table_column((1, 3, 6, 1, 4, 1, 35265, 1, 23, 91, 1, 2, 1, 2), truth_value().clone('false')).setMaxAccess('readwrite') if mibBuilder.loadTexts: eltOspfIfPassiveDefault.setStatus('current') elt_ospf_if_passive_list = mib_table_column((1, 3, 6, 1, 4, 1, 35265, 1, 23, 91, 1, 2, 1, 3), port_list()).setMaxAccess('readwrite') if mibBuilder.loadTexts: eltOspfIfPassiveList.setStatus('current') elt_ospf_if_status = mib_table_column((1, 3, 6, 1, 4, 1, 35265, 1, 23, 91, 1, 2, 1, 4), row_status()).setMaxAccess('readcreate') if mibBuilder.loadTexts: eltOspfIfStatus.setStatus('current') mibBuilder.exportSymbols('ELTEX-IP-OSPF-IF-MIB', eltOspfIfAddress=eltOspfIfAddress, eltOspfIfPassiveDefault=eltOspfIfPassiveDefault, eltIpOspfIfTable=eltIpOspfIfTable, eltOspfIfStatus=eltOspfIfStatus, eltIpOspfIfEntry=eltIpOspfIfEntry, eltOspfIfPassiveList=eltOspfIfPassiveList)
# -*- coding: utf-8 -*- def main(): s = input().split() ans = list() for si in s: if '@' in si: is_at = False string = '' for sii in si: if sii == '@': if string != '': ans.append(string) string = '' is_at = True elif is_at and sii != '@': string += sii if string != '': ans.append(string) print('\n'.join(map(str, sorted(set(ans))))) if __name__ == '__main__': main()
def main(): s = input().split() ans = list() for si in s: if '@' in si: is_at = False string = '' for sii in si: if sii == '@': if string != '': ans.append(string) string = '' is_at = True elif is_at and sii != '@': string += sii if string != '': ans.append(string) print('\n'.join(map(str, sorted(set(ans))))) if __name__ == '__main__': main()
# move.py # handles movement in the world def toRoom(server, player, command): ''' moves player from their currentRoom to newRoom ''' newRoom = None #print "cmd:" + str(command) #print "cmd0:" + str(command[0]) #print str(player.currentRoom.orderedExits) # args = <some int> if int(command[0]) <= len(player.currentRoom.orderedExits): #print player.currentRoom.orderedExits #print player.currentRoom.orderedExits[int(command[0])-1] targetRoom = player.currentRoom.orderedExits[int(command[0])-1][0] #print "tg:" + str(targetRoom) for room in server.structureManager.masterRooms: #print room.name, room.exits if room.ID == targetRoom: #print room.ID, room.exits newRoom = room #print 'nr:' + str(newRoom) + str(newRoom.exits) elif int(command[0]) > len(player.currentRoom.orderedExits): player.connection.send_cc("^! There are only " + str(len(player.currentRoom.orderedExits)) + " exits!^~\n") return # args = <exit description text> cmdStr = " ".join(command) #print "cmdStr:" + cmdStr for exit in player.currentRoom.orderedExits: if cmdStr == exit[1]: newRoom = exit[0] if newRoom != None: #print player.currentRoom.players player.currentRoom.players.remove(player) #print player.currentRoom.players #print player for plyr in player.currentRoom.players: plyr.connection.send_cc(player.name + " left.\n") for room in server.structureManager.masterRooms: if room.ID == newRoom: newRoom = room player.currentRoom = newRoom server.Renderer.roomDisplay(player.connection, player.currentRoom) for plyr in player.currentRoom.players: plyr.connection.send_cc(player.name + " entered.\n") player.currentRoom.players.append(player) else: # args does not point to an exit player.connection.send_cc("^!I am not sure where I want to go!^~\n")
def to_room(server, player, command): """ moves player from their currentRoom to newRoom """ new_room = None if int(command[0]) <= len(player.currentRoom.orderedExits): target_room = player.currentRoom.orderedExits[int(command[0]) - 1][0] for room in server.structureManager.masterRooms: if room.ID == targetRoom: new_room = room elif int(command[0]) > len(player.currentRoom.orderedExits): player.connection.send_cc('^! There are only ' + str(len(player.currentRoom.orderedExits)) + ' exits!^~\n') return cmd_str = ' '.join(command) for exit in player.currentRoom.orderedExits: if cmdStr == exit[1]: new_room = exit[0] if newRoom != None: player.currentRoom.players.remove(player) for plyr in player.currentRoom.players: plyr.connection.send_cc(player.name + ' left.\n') for room in server.structureManager.masterRooms: if room.ID == newRoom: new_room = room player.currentRoom = newRoom server.Renderer.roomDisplay(player.connection, player.currentRoom) for plyr in player.currentRoom.players: plyr.connection.send_cc(player.name + ' entered.\n') player.currentRoom.players.append(player) else: player.connection.send_cc('^!I am not sure where I want to go!^~\n')
#!/usr/bin/env python3 # Testing apostraphes' in single quotes # if I were to: print('he's done') # error: compiler thinks the statement # is ended at the apostraphe after 'he'. # In order to print apostraphes and other # characters like it, escape them: print('he\'s done')
print("he's done")
# Given: A protein string P of length at most 1000 aa. # # Return: The total weight of P. Consult the monoisotopic mass table. table = {} tableFile = open("mass table.txt","r") for line in tableFile: table[line[0]]=float(line[4::].strip()) aaFile = open("input.txt","r") total = float(0) for aa in aaFile.read().replace("\n",""): total += table[aa] print("%.3f"%total)
table = {} table_file = open('mass table.txt', 'r') for line in tableFile: table[line[0]] = float(line[4:].strip()) aa_file = open('input.txt', 'r') total = float(0) for aa in aaFile.read().replace('\n', ''): total += table[aa] print('%.3f' % total)
__author__ = "xTrinch" __email__ = "mojca.rojko@gmail.com" __version__ = "0.2.21" class NotificationError(Exception): pass default_app_config = 'fcm_django.apps.FcmDjangoConfig'
__author__ = 'xTrinch' __email__ = 'mojca.rojko@gmail.com' __version__ = '0.2.21' class Notificationerror(Exception): pass default_app_config = 'fcm_django.apps.FcmDjangoConfig'
''' Intuition Imagine you are writing a small compiler for your college project and one of the tasks (or say sub-tasks) for the compiler would be to detect if the parenthesis are in place or not. The algorithm we will look at in this article can be then used to process all the parenthesis in the program your compiler is compiling and checking if all the parenthesis are in place. This makes checking if a given string of parenthesis is valid or not, an important programming problem. The expressions that we will deal with in this problem can consist of three different type of parenthesis: (), {} and [] Before looking at how we can check if a given expression consisting of these parenthesis is valid or not, let us look at a simpler version of the problem that consists of just one type of parenthesis. So, the expressions we can encounter in this simplified version of the problem are e.g. https://leetcode.com/problems/valid-parentheses/solution/ ''' class Solution: def __init__(self): self.stack = [] def isValid(self, s): for i, el in enumerate(s): if el == "(" or el == "{" or el == "[": self.stack.append(el) elif el == ")" or el == "}" or el == "]": if len(self.stack) == 0: return False lastEl = self.stack[-1] if el == ")" and lastEl != "(": return False if el == "}" and lastEl != "{": return False if el == "]" and lastEl != "[": return False self.stack.pop() return len(self.stack) == 0 class Solution2(object): def isValid(self, s): while "()" in s or "{}" in s or '[]' in s: s = s.replace("()", "").replace('{}', "").replace('[]', "") return s == ''
""" Intuition Imagine you are writing a small compiler for your college project and one of the tasks (or say sub-tasks) for the compiler would be to detect if the parenthesis are in place or not. The algorithm we will look at in this article can be then used to process all the parenthesis in the program your compiler is compiling and checking if all the parenthesis are in place. This makes checking if a given string of parenthesis is valid or not, an important programming problem. The expressions that we will deal with in this problem can consist of three different type of parenthesis: (), {} and [] Before looking at how we can check if a given expression consisting of these parenthesis is valid or not, let us look at a simpler version of the problem that consists of just one type of parenthesis. So, the expressions we can encounter in this simplified version of the problem are e.g. https://leetcode.com/problems/valid-parentheses/solution/ """ class Solution: def __init__(self): self.stack = [] def is_valid(self, s): for (i, el) in enumerate(s): if el == '(' or el == '{' or el == '[': self.stack.append(el) elif el == ')' or el == '}' or el == ']': if len(self.stack) == 0: return False last_el = self.stack[-1] if el == ')' and lastEl != '(': return False if el == '}' and lastEl != '{': return False if el == ']' and lastEl != '[': return False self.stack.pop() return len(self.stack) == 0 class Solution2(object): def is_valid(self, s): while '()' in s or '{}' in s or '[]' in s: s = s.replace('()', '').replace('{}', '').replace('[]', '') return s == ''
kDragAttributeFromAE = [] kIncompatibleAttribute = [] kInvalidAttribute = [] kLayer = []
k_drag_attribute_from_ae = [] k_incompatible_attribute = [] k_invalid_attribute = [] k_layer = []
DOTNETIMPL = { "mono": None, "core": None, "net": None, } DOTNETOS = { "darwin": "@bazel_tools//platforms:osx", "linux": "@bazel_tools//platforms:linux", "windows": "@bazel_tools//platforms:windows", } DOTNETARCH = { "amd64": "@bazel_tools//platforms:x86_64", } DOTNETIMPL_OS_ARCH = ( ("mono", "darwin", "amd64"), ("mono", "linux", "amd64"), ("mono", "windows", "amd64"), ("core", "darwin", "amd64"), ("core", "linux", "amd64"), ("core", "windows", "amd64"), ("net", "windows", "amd64"), ) def declare_config_settings(): for impl in DOTNETIMPL: native.config_setting( name = impl, #constraint_values = ["//dotnet/toolchain:" + impl], values = { "compilation_mode": impl } ) for os in DOTNETOS: native.config_setting( name = os, constraint_values = ["//dotnet/toolchain:" + os], ) for arch in DOTNETARCH: native.config_setting( name = arch, constraint_values = ["//dotnet/toolchain:" + arch], ) for impl, os, arch in DOTNETIMPL_OS_ARCH: native.config_setting( name = impl + "_" + os + "_" + arch, constraint_values = [ "//dotnet/toolchain:" + os, "//dotnet/toolchain:" + arch, "//dotnet/toolchain:" + impl, ], )
dotnetimpl = {'mono': None, 'core': None, 'net': None} dotnetos = {'darwin': '@bazel_tools//platforms:osx', 'linux': '@bazel_tools//platforms:linux', 'windows': '@bazel_tools//platforms:windows'} dotnetarch = {'amd64': '@bazel_tools//platforms:x86_64'} dotnetimpl_os_arch = (('mono', 'darwin', 'amd64'), ('mono', 'linux', 'amd64'), ('mono', 'windows', 'amd64'), ('core', 'darwin', 'amd64'), ('core', 'linux', 'amd64'), ('core', 'windows', 'amd64'), ('net', 'windows', 'amd64')) def declare_config_settings(): for impl in DOTNETIMPL: native.config_setting(name=impl, values={'compilation_mode': impl}) for os in DOTNETOS: native.config_setting(name=os, constraint_values=['//dotnet/toolchain:' + os]) for arch in DOTNETARCH: native.config_setting(name=arch, constraint_values=['//dotnet/toolchain:' + arch]) for (impl, os, arch) in DOTNETIMPL_OS_ARCH: native.config_setting(name=impl + '_' + os + '_' + arch, constraint_values=['//dotnet/toolchain:' + os, '//dotnet/toolchain:' + arch, '//dotnet/toolchain:' + impl])
def cheese_and_crackers(cheese_count, boxes_of_crackers): print("You have ", cheese_count, "cheese!") print("you have ", boxes_of_crackers," boxes of crackers!") print("Man that's enough for a party!") print("Get a blamnket.\n") print("We can just give the function numbers directly:") cheese_and_crackers(20,30) print("Or we can use variables from our script :") amount_of_cheese = 10 amount_of_crackers = 50 cheese_and_crackers(amount_of_cheese, amount_of_crackers) print("we can even do match inside too:") cheese_and_crackers(10 + 20 , 5 + 6) print("And we can combine the two ,variables and match:") cheese_and_crackers(amount_of_cheese + 100 , amount_of_crackers - 1000)
def cheese_and_crackers(cheese_count, boxes_of_crackers): print('You have ', cheese_count, 'cheese!') print('you have ', boxes_of_crackers, ' boxes of crackers!') print("Man that's enough for a party!") print('Get a blamnket.\n') print('We can just give the function numbers directly:') cheese_and_crackers(20, 30) print('Or we can use variables from our script :') amount_of_cheese = 10 amount_of_crackers = 50 cheese_and_crackers(amount_of_cheese, amount_of_crackers) print('we can even do match inside too:') cheese_and_crackers(10 + 20, 5 + 6) print('And we can combine the two ,variables and match:') cheese_and_crackers(amount_of_cheese + 100, amount_of_crackers - 1000)
x=100 text="python tutorial" print(x) print(text) # Assign values to multiple variables x,y,z=10,20,30 print(x) print(y) print(z)
x = 100 text = 'python tutorial' print(x) print(text) (x, y, z) = (10, 20, 30) print(x) print(y) print(z)
p = [0, 4, 8, 6, 2, 10, 100000000] s=[] d = {} rem=10 for i in p: if i in d: d[i] += 1 else: d[i] = 1 for i in range(0,rem/2+1): if i in d: pair = [i, rem-i] if pair[0]==pair[1] and d[i]>=2: s.append(pair) elif pair[1] in d: s.append(pair) print(s) ####################################################################################### ####################################################################################### rem55 = set() golden_val = 10 # The diff we want result = set() for ele in p: if ele in rem55: result.add((ele, golden_val-ele)) rem55.add(golden_val-ele) print(result)
p = [0, 4, 8, 6, 2, 10, 100000000] s = [] d = {} rem = 10 for i in p: if i in d: d[i] += 1 else: d[i] = 1 for i in range(0, rem / 2 + 1): if i in d: pair = [i, rem - i] if pair[0] == pair[1] and d[i] >= 2: s.append(pair) elif pair[1] in d: s.append(pair) print(s) rem55 = set() golden_val = 10 result = set() for ele in p: if ele in rem55: result.add((ele, golden_val - ele)) rem55.add(golden_val - ele) print(result)
class Solution(object): def wordPattern(self, pattern, str): dic = {} dic2 = {} words = str.split(" ") if len(pattern) != len(words): return False i = 0 for cha in pattern: if cha in dic.keys(): if dic[cha] != words[i]: return False else: dic[cha] = words[i] i += 1 i = 0 for word in words: if word in dic2.keys(): if dic2[word] != pattern[i]: return False else: dic2[word] = pattern[i] i += 1 return True solution = Solution() print(solution.wordPattern("abba", "dog cat cat dog")) print(solution.wordPattern("abba", "dog cat cat fish")) print(solution.wordPattern("aaaa", "dog cat cat dog")) print(solution.wordPattern("abba", "dog dog dog dog"))
class Solution(object): def word_pattern(self, pattern, str): dic = {} dic2 = {} words = str.split(' ') if len(pattern) != len(words): return False i = 0 for cha in pattern: if cha in dic.keys(): if dic[cha] != words[i]: return False else: dic[cha] = words[i] i += 1 i = 0 for word in words: if word in dic2.keys(): if dic2[word] != pattern[i]: return False else: dic2[word] = pattern[i] i += 1 return True solution = solution() print(solution.wordPattern('abba', 'dog cat cat dog')) print(solution.wordPattern('abba', 'dog cat cat fish')) print(solution.wordPattern('aaaa', 'dog cat cat dog')) print(solution.wordPattern('abba', 'dog dog dog dog'))
class Solution: def lastStoneWeight(self, stones: List[int]) -> int: while len(stones) > 1: stones.sort() a = stones.pop() b = stones.pop() last = a - b if last: stones.append(last) return stones[0] if stones else 0
class Solution: def last_stone_weight(self, stones: List[int]) -> int: while len(stones) > 1: stones.sort() a = stones.pop() b = stones.pop() last = a - b if last: stones.append(last) return stones[0] if stones else 0
class MyHashSet: def __init__(self): self.buckets = [] def hash(self, key: int) -> str: return chr(key) def add(self, key: int) -> None: val = self.hash(key) if val not in self.buckets: self.buckets.append(val) def remove(self, key: int) -> None: val = self.hash(key) if val in self.buckets: self.buckets.remove(val) def contains(self, key: int) -> bool: return self.hash(key) in self.buckets class MyHashMap: def __init__(self): self.buckets = [] @property def keys(self) -> list: return [x[0] for x in self.buckets] def put(self, key: int, value: int) -> None: if key in self.keys: index = 0 for bucket in self.buckets: if bucket[0] == key: self.buckets[index] = (key, value) break index += 1 else: self.buckets.append((key, value)) def get(self, key: int) -> int: if key in self.keys: for bucket in self.buckets: if bucket[0] == key: return bucket[1] else: return -1 def remove(self, key: int) -> None: if key in self.keys: for bucket in self.buckets: if bucket[0] == key: val = (bucket[0], bucket[1]) break self.buckets.remove(val)
class Myhashset: def __init__(self): self.buckets = [] def hash(self, key: int) -> str: return chr(key) def add(self, key: int) -> None: val = self.hash(key) if val not in self.buckets: self.buckets.append(val) def remove(self, key: int) -> None: val = self.hash(key) if val in self.buckets: self.buckets.remove(val) def contains(self, key: int) -> bool: return self.hash(key) in self.buckets class Myhashmap: def __init__(self): self.buckets = [] @property def keys(self) -> list: return [x[0] for x in self.buckets] def put(self, key: int, value: int) -> None: if key in self.keys: index = 0 for bucket in self.buckets: if bucket[0] == key: self.buckets[index] = (key, value) break index += 1 else: self.buckets.append((key, value)) def get(self, key: int) -> int: if key in self.keys: for bucket in self.buckets: if bucket[0] == key: return bucket[1] else: return -1 def remove(self, key: int) -> None: if key in self.keys: for bucket in self.buckets: if bucket[0] == key: val = (bucket[0], bucket[1]) break self.buckets.remove(val)
def min_number(num_list): min_num = None for num in num_list: if min_num is None or min_num > num: min_num = num return min_num
def min_number(num_list): min_num = None for num in num_list: if min_num is None or min_num > num: min_num = num return min_num
def pytest_addoption(parser): group = parser.getgroup("pypyjit options") group.addoption("--pypy", action="store", default=None, dest="pypy_c", help="the location of the JIT enabled pypy-c")
def pytest_addoption(parser): group = parser.getgroup('pypyjit options') group.addoption('--pypy', action='store', default=None, dest='pypy_c', help='the location of the JIT enabled pypy-c')
# @Time : 2019/6/1 23:01 # @Author : shakespere # @FileName: Sort Colors.py ''' 75. Sort Colors Medium 1623 156 Favorite Share Given an array with n objects colored red, white or blue, sort them in-place so that objects of the same color are adjacent, with the colors in the order red, white and blue. Here, we will use the integers 0, 1, and 2 to represent the color red, white, and blue respectively. Note: You are not suppose to use the library's sort function for this problem. Example: Input: [2,0,2,1,1,0] Output: [0,0,1,1,2,2] Follow up: A rather straight forward solution is a two-pass algorithm using counting sort. First, iterate the array counting number of 0's, 1's, and 2's, then overwrite array with total number of 0's, then 1's and followed by 2's. Could you come up with a one-pass algorithm using only constant space? ''' class Solution(object): def sortColors(self, nums): """ :type nums: List[int] :rtype: None Do not return anything, modify nums in-place instead. """ i, p0, p2 = 0, 0, len(nums) - 1 while i <= p2: if nums[i] == 0: nums[p0], nums[i] = nums[i], nums[p0] p0 += 1 i += 1 elif nums[i] == 2: nums[p2], nums[i] = nums[i], nums[p2] p2 -= 1 else: i += 1 return nums
""" 75. Sort Colors Medium 1623 156 Favorite Share Given an array with n objects colored red, white or blue, sort them in-place so that objects of the same color are adjacent, with the colors in the order red, white and blue. Here, we will use the integers 0, 1, and 2 to represent the color red, white, and blue respectively. Note: You are not suppose to use the library's sort function for this problem. Example: Input: [2,0,2,1,1,0] Output: [0,0,1,1,2,2] Follow up: A rather straight forward solution is a two-pass algorithm using counting sort. First, iterate the array counting number of 0's, 1's, and 2's, then overwrite array with total number of 0's, then 1's and followed by 2's. Could you come up with a one-pass algorithm using only constant space? """ class Solution(object): def sort_colors(self, nums): """ :type nums: List[int] :rtype: None Do not return anything, modify nums in-place instead. """ (i, p0, p2) = (0, 0, len(nums) - 1) while i <= p2: if nums[i] == 0: (nums[p0], nums[i]) = (nums[i], nums[p0]) p0 += 1 i += 1 elif nums[i] == 2: (nums[p2], nums[i]) = (nums[i], nums[p2]) p2 -= 1 else: i += 1 return nums
expected_output = { "interfaces": { "Port-channel20": { "description": "distacc Te1/1/1, Te2/1/1", "switchport_trunk_vlans": "9,51", "switchport_mode": "trunk", "ip_arp_inspection_trust": True, "ip_dhcp_snooping_trust": True, }, "GigabitEthernet0/0": { "vrf": "Mgmt-vrf", "shutdown": True, "negotiation_auto": True, }, "GigabitEthernet1/0/1": { "description": "unknown DA", "switchport_access_vlan": "51", "switchport_mode": "access", "spanning_tree_portfast": True, "ip_dhcp_snooping_limit_rate": "10", }, "GigabitEthernet1/0/2": { "description": "DA1202B_21_13 ap-100", "switchport_access_vlan": "51", "switchport_mode": "access", "spanning_tree_portfast": True, "ip_dhcp_snooping_limit_rate": "10", }, } }
expected_output = {'interfaces': {'Port-channel20': {'description': 'distacc Te1/1/1, Te2/1/1', 'switchport_trunk_vlans': '9,51', 'switchport_mode': 'trunk', 'ip_arp_inspection_trust': True, 'ip_dhcp_snooping_trust': True}, 'GigabitEthernet0/0': {'vrf': 'Mgmt-vrf', 'shutdown': True, 'negotiation_auto': True}, 'GigabitEthernet1/0/1': {'description': 'unknown DA', 'switchport_access_vlan': '51', 'switchport_mode': 'access', 'spanning_tree_portfast': True, 'ip_dhcp_snooping_limit_rate': '10'}, 'GigabitEthernet1/0/2': {'description': 'DA1202B_21_13 ap-100', 'switchport_access_vlan': '51', 'switchport_mode': 'access', 'spanning_tree_portfast': True, 'ip_dhcp_snooping_limit_rate': '10'}}}
# -*- coding: utf-8 -*- """ Solve a given equation and return the value of x in the form of string "x=#value". The equation contains only '+', '-' operation, the variable x and its coefficient. If there is no solution for the equation, return "No solution". If there are infinite solutions for the equation, return "Infinite solutions". If there is exactly one solution for the equation, we ensure that the value of x is an integer. Example 1: Input: "x+5-3+x=6+x-2" Output: "x=2" Example 2: Input: "x=x" Output: "Infinite solutions" Example 3: Input: "2x=x" Output: "x=0" Example 4: Input: "2x+3x-6x=x+2" Output: "x=-1" Example 5: Input: "x=x+2" Output: "No solution" """ class Solution(object): def solveEquation(self, equation): """ :type equation: str :rtype: str """ def parse(exp): if not exp: return None, None a, b = 0, 0 # ax+b expLen = len(exp) l = 0 add = True for r, ch in enumerate(exp): if ch in {'-', '+'}: if r > 0 and exp[r - 1] == 'x': if add: a += int(exp[l:r - 1]) if l < r - 1 else 1 else: a -= int(exp[l:r - 1]) if l < r - 1 else 1 else: if add: b += int(exp[l:r]) if l < r else 0 else: b -= int(exp[l:r]) if l < r else 0 if ch == '-': add = False l = r + 1 elif ch == '+': add = True l = r + 1 if exp[-1] == 'x': if add: a += int(exp[l:expLen - 1]) if l < expLen - 1 else 1 else: a -= int(exp[l:expLen - 1]) if l < expLen - 1 else 1 else: if add: b += int(exp[l:]) if l < expLen else 0 else: b -= int(exp[l:]) if l < expLen else 0 return a, b left, right = equation.split('=') a, b = parse(left) c, d = parse(right) if a == c: if b != d: return "No solution" else: return "Infinite solutions" return 'x=%d' % ((d - b) // (a - c)) s = Solution() print(s.solveEquation("-x=-1")) print(s.solveEquation("x+5-3+x=6+x-2")) print(s.solveEquation("x=x")) print(s.solveEquation("2x=x")) print(s.solveEquation("2x+3x-6x=x+2")) print(s.solveEquation("x=x+2"))
""" Solve a given equation and return the value of x in the form of string "x=#value". The equation contains only '+', '-' operation, the variable x and its coefficient. If there is no solution for the equation, return "No solution". If there are infinite solutions for the equation, return "Infinite solutions". If there is exactly one solution for the equation, we ensure that the value of x is an integer. Example 1: Input: "x+5-3+x=6+x-2" Output: "x=2" Example 2: Input: "x=x" Output: "Infinite solutions" Example 3: Input: "2x=x" Output: "x=0" Example 4: Input: "2x+3x-6x=x+2" Output: "x=-1" Example 5: Input: "x=x+2" Output: "No solution" """ class Solution(object): def solve_equation(self, equation): """ :type equation: str :rtype: str """ def parse(exp): if not exp: return (None, None) (a, b) = (0, 0) exp_len = len(exp) l = 0 add = True for (r, ch) in enumerate(exp): if ch in {'-', '+'}: if r > 0 and exp[r - 1] == 'x': if add: a += int(exp[l:r - 1]) if l < r - 1 else 1 else: a -= int(exp[l:r - 1]) if l < r - 1 else 1 elif add: b += int(exp[l:r]) if l < r else 0 else: b -= int(exp[l:r]) if l < r else 0 if ch == '-': add = False l = r + 1 elif ch == '+': add = True l = r + 1 if exp[-1] == 'x': if add: a += int(exp[l:expLen - 1]) if l < expLen - 1 else 1 else: a -= int(exp[l:expLen - 1]) if l < expLen - 1 else 1 elif add: b += int(exp[l:]) if l < expLen else 0 else: b -= int(exp[l:]) if l < expLen else 0 return (a, b) (left, right) = equation.split('=') (a, b) = parse(left) (c, d) = parse(right) if a == c: if b != d: return 'No solution' else: return 'Infinite solutions' return 'x=%d' % ((d - b) // (a - c)) s = solution() print(s.solveEquation('-x=-1')) print(s.solveEquation('x+5-3+x=6+x-2')) print(s.solveEquation('x=x')) print(s.solveEquation('2x=x')) print(s.solveEquation('2x+3x-6x=x+2')) print(s.solveEquation('x=x+2'))
#SKill : array iteration #A UTF-8 character encoding is a variable width character encoding # that can vary from 1 to 4 bytes depending on the character. The structure of the encoding is as follows: #1 byte: 0xxxxxxx #2 bytes: 110xxxxx 10xxxxxx #3 bytes: 1110xxxx 10xxxxxx 10xxxxxx #4 bytes: 11110xxx 10xxxxxx 10xxxxxx 10xxxxxx #For more information, you can read up on the Wikipedia Page. #Given a list of integers where each integer represents 1 byte, return whether or not the list of integers is a valid UTF-8 encoding. #Analysis # State machine # check pattern in sequence # from 4 byte to 1 byte pattern # For first byte, XOR(first byte, 4 byte mask) = value.... # if value <= 1<<3, match, otherwise, not match and try 3 byte to 1 byte mask # if it is N byte, check consecutive N-1 byte , if match XOR (byte, b10000000), if value < 1<<6, match... otherwise not match BYTE_MASKS = [ None, 0b10000000, 0b11100000, 0b11110000, 0b11111000, ] BYTE_EQUAL = [ None, 0b00000000, 0b11000000, 0b11100000, 0b11110000, ] def utf8_validator(bytes): numOfBytes = 4 cnt=0 while cnt < len(bytes): while numOfBytes>0: value = bytes[cnt] & BYTE_MASKS[numOfBytes] if value == BYTE_EQUAL[numOfBytes]: break else: numOfBytes -= 1 i = 0 if numOfBytes < 1: return False if numOfBytes + cnt > len(bytes): return False cnt += 1 while i < numOfBytes-1: value = bytes[cnt + i] ^ 0b10000000 if value < 1<<6: i +=1 else: return False cnt += (numOfBytes-1) numOfBytes = 4 return True if __name__ == "__main__": print(utf8_validator([0b11000000, 0b10000000, 0b00000000])) # True print(utf8_validator([0b11000000, 0b00000000])) # False print (utf8_validator([0b11000000, 0b10000000])) # True print (utf8_validator([0b00000000])) # True print (utf8_validator([0b00000000, 0b10000000])) # False
byte_masks = [None, 128, 224, 240, 248] byte_equal = [None, 0, 192, 224, 240] def utf8_validator(bytes): num_of_bytes = 4 cnt = 0 while cnt < len(bytes): while numOfBytes > 0: value = bytes[cnt] & BYTE_MASKS[numOfBytes] if value == BYTE_EQUAL[numOfBytes]: break else: num_of_bytes -= 1 i = 0 if numOfBytes < 1: return False if numOfBytes + cnt > len(bytes): return False cnt += 1 while i < numOfBytes - 1: value = bytes[cnt + i] ^ 128 if value < 1 << 6: i += 1 else: return False cnt += numOfBytes - 1 num_of_bytes = 4 return True if __name__ == '__main__': print(utf8_validator([192, 128, 0])) print(utf8_validator([192, 0])) print(utf8_validator([192, 128])) print(utf8_validator([0])) print(utf8_validator([0, 128]))
ES_HOST = 'localhost' ES_PORT = 9200 BULK_MAX_OPS_CNT = 1000 INDEX_NAME = 'cosc488' INDEX_SETTINGS_FP = 'properties/index_settings.json' DATA_DIR = 'data/docs' QUERIES_FP = 'data/queryfile.txt' QRELS_FP = 'data/qrel.txt' TRECEVAL_FP = 'bin/trec_eval'
es_host = 'localhost' es_port = 9200 bulk_max_ops_cnt = 1000 index_name = 'cosc488' index_settings_fp = 'properties/index_settings.json' data_dir = 'data/docs' queries_fp = 'data/queryfile.txt' qrels_fp = 'data/qrel.txt' treceval_fp = 'bin/trec_eval'
prev = None def check_bst(root): if not root: return True ans = check_bst(root.left) if ans == False: return False if prev and root.value < prev: return False global prev prev = root return check_bst(root.right)
prev = None def check_bst(root): if not root: return True ans = check_bst(root.left) if ans == False: return False if prev and root.value < prev: return False global prev prev = root return check_bst(root.right)
#!/usr/bin/python3.5 class MyClass: "This is a class" a = 10; def func(self): print('Hello World'); return 3; def my_function(a: MyClass): return a.func(); def other_function(b: my_function): a = MyClass(); return my_function(a); def object_function(obj: object): return 3;
class Myclass: """This is a class""" a = 10 def func(self): print('Hello World') return 3 def my_function(a: MyClass): return a.func() def other_function(b: my_function): a = my_class() return my_function(a) def object_function(obj: object): return 3
### PROBLEM 1 def main(): print("Name: Shaymae Senhaji") print("Favorite Food: Brie Cheese") print("Favorite Color: Red") print("Favorite Hobby: Traveling") if __name__ == "__main__": main() #Name: Shaymae Senhaji #Favorite Food: Brie Cheese #Favorite Color: Red #Favorite Hobby: Traveling
def main(): print('Name: Shaymae Senhaji') print('Favorite Food: Brie Cheese') print('Favorite Color: Red') print('Favorite Hobby: Traveling') if __name__ == '__main__': main()
def getProgress(current, length): """This function formats a progress bar string for print out during a for loop execution. Currently, this uses 2% increments. Adjusting the inc variable to N will change increments to 1/N.""" inc = 50 n_bars = int(round(current*inc/length,1)) rem = inc - n_bars progress = '[' + '#'*n_bars + rem * ' ' + ']' + ' {}% Done'.format(round(current*100/length)) print(progress, end = '\r') create_table1 = """CREATE TABLE WHERE_SESSIONID_ITEM ( session_id int, item_in_session int, artist_name text, song_name text, song_length float, PRIMARY KEY (session_id, item_in_session,artist_name,song_name) );""" table1_message = "SUCCESS: Created table to retrieve the artist, song title and song's length in the music app history queried by sessionId and itemInSession." drop_table1 = "DROP TABLE IF EXISTS WHERE_SESSIONID_ITEM;" def query_table1(session_id, item_in_session): """ This function returns the SQL neccessary to get the artists, songs, and lengths of the songs with the specified session id passed as an argumemt and specified item in session passed as an argumemt. """ query = """select artist_name, song_name, song_length from WHERE_SESSIONID_ITEM where session_id = {} and item_in_session = {};""".format(session_id,item_in_session) return query def table1_populate(driver, data): """ This iterates through specified columns of the total dataset and inserts rows into Table 1. """ table_df = data[['sessionId','itemInSession','artist','song','length']] insert = "INSERT INTO CASS1.WHERE_SESSIONID_ITEM " insert += "(session_id,item_in_session,artist_name,song_name,song_length) " insert += "VALUES ( %s, %s, %s, %s, %s)" n_row = 0 print("Inserting {} Rows to Table 1.".format(table_df.shape[0])) for index,row in table_df.iterrows(): values = tuple(row.values.tolist()) driver.execute(insert,values) n_row += 1 #Print out Progress getProgress(n_row,table_df.shape[0]) print("\r") print(n_row, " Rows Added to Table 1: WHERE_SESSIONID_ITEM")
def get_progress(current, length): """This function formats a progress bar string for print out during a for loop execution. Currently, this uses 2% increments. Adjusting the inc variable to N will change increments to 1/N.""" inc = 50 n_bars = int(round(current * inc / length, 1)) rem = inc - n_bars progress = '[' + '#' * n_bars + rem * ' ' + ']' + ' {}% Done'.format(round(current * 100 / length)) print(progress, end='\r') create_table1 = 'CREATE TABLE WHERE_SESSIONID_ITEM (\n session_id int,\n item_in_session int,\n artist_name text,\n song_name text,\n song_length float,\n PRIMARY KEY (session_id, item_in_session,artist_name,song_name)\n);' table1_message = "SUCCESS: Created table to retrieve the artist, song title and song's length in the music app history queried by sessionId and itemInSession." drop_table1 = 'DROP TABLE IF EXISTS WHERE_SESSIONID_ITEM;' def query_table1(session_id, item_in_session): """ This function returns the SQL neccessary to get the artists, songs, and lengths of the songs with the specified session id passed as an argumemt and specified item in session passed as an argumemt. """ query = 'select artist_name, song_name, song_length \n from WHERE_SESSIONID_ITEM \n where session_id = {} and item_in_session = {};'.format(session_id, item_in_session) return query def table1_populate(driver, data): """ This iterates through specified columns of the total dataset and inserts rows into Table 1. """ table_df = data[['sessionId', 'itemInSession', 'artist', 'song', 'length']] insert = 'INSERT INTO CASS1.WHERE_SESSIONID_ITEM ' insert += '(session_id,item_in_session,artist_name,song_name,song_length) ' insert += 'VALUES ( %s, %s, %s, %s, %s)' n_row = 0 print('Inserting {} Rows to Table 1.'.format(table_df.shape[0])) for (index, row) in table_df.iterrows(): values = tuple(row.values.tolist()) driver.execute(insert, values) n_row += 1 get_progress(n_row, table_df.shape[0]) print('\r') print(n_row, ' Rows Added to Table 1: WHERE_SESSIONID_ITEM')
## Does my number look big in this? ## 6 kyu ## https://www.codewars.com/kata/5287e858c6b5a9678200083c def narcissistic(value): total = 0 for digit in str(value): total += int(digit) ** len(str(value)) return value == total
def narcissistic(value): total = 0 for digit in str(value): total += int(digit) ** len(str(value)) return value == total
# This is the ball class that handles everything related to Balls class Ball: # The __init__ method is used to initialize class variables def __init__(self, position, velocity, acceleration): # Each ball has a position, velocity and acceleration self.position = position self.velocity = velocity self.acceleration = acceleration # The display method handles drawing the ball def display(self): noStroke() fill(255, 0, 0) ellipse(self.position.x, self.position.y, 50, 50) # The move method handles moving the Ball def move(self): # Velocity changes according to acceleration self.velocity.add(self.acceleration) # Position changes according to velocity self.position.add(self.velocity) # Reset acceleration self.acceleration.mult(0) # The add_force method adds a force to the acceleration of the Ball def add_force(self, force): self.acceleration.add(force) # check_ground checks if the ball falls off the bottom of the screen. # if it is off the screen, the ball bounces up def check_ground(self): if self.position.y > height: self.velocity.y *= -1 self.position.y = height gravity = PVector(0, 1) # creating a new ball at position 250, 250 with velocity and acceleration 0 b = Ball(PVector(250, 250), PVector(0, 0), PVector(0, 0)) def setup(): size(500, 500) def draw(): background(0) b.display() b.move() b.add_force(gravity) b.check_ground()
class Ball: def __init__(self, position, velocity, acceleration): self.position = position self.velocity = velocity self.acceleration = acceleration def display(self): no_stroke() fill(255, 0, 0) ellipse(self.position.x, self.position.y, 50, 50) def move(self): self.velocity.add(self.acceleration) self.position.add(self.velocity) self.acceleration.mult(0) def add_force(self, force): self.acceleration.add(force) def check_ground(self): if self.position.y > height: self.velocity.y *= -1 self.position.y = height gravity = p_vector(0, 1) b = ball(p_vector(250, 250), p_vector(0, 0), p_vector(0, 0)) def setup(): size(500, 500) def draw(): background(0) b.display() b.move() b.add_force(gravity) b.check_ground()
# # @lc app=leetcode id=75 lang=python3 # # [75] Sort Colors # class Solution: def sortColors(self, nums: List[int]) -> None: """ Do not return anything, modify nums in-place instead. """ a, i, b = 0, 0, len(nums) - 1 while i <= b: n_i = nums[i] if n_i == 1: i += 1 elif n_i == 0: if i > a: nums[a], nums[i] = n_i, nums[a] a += 1 i += 1 elif n_i == 2: nums[b], nums[i] = n_i, nums[b] b -= 1 else: raise RuntimeError('should not reach here')
class Solution: def sort_colors(self, nums: List[int]) -> None: """ Do not return anything, modify nums in-place instead. """ (a, i, b) = (0, 0, len(nums) - 1) while i <= b: n_i = nums[i] if n_i == 1: i += 1 elif n_i == 0: if i > a: (nums[a], nums[i]) = (n_i, nums[a]) a += 1 i += 1 elif n_i == 2: (nums[b], nums[i]) = (n_i, nums[b]) b -= 1 else: raise runtime_error('should not reach here')
"""All files in this module are automatically generated by hassfest. To update, run python3 -m script.hassfest """
"""All files in this module are automatically generated by hassfest. To update, run python3 -m script.hassfest """
def hashfunction(key): sum=0 for i in key: sum+=ord(i) return sum%100 hashtable=[] def insertkey(key,value): hashkey=hashfunction(key) return hashtable[hashkey].append(value)
def hashfunction(key): sum = 0 for i in key: sum += ord(i) return sum % 100 hashtable = [] def insertkey(key, value): hashkey = hashfunction(key) return hashtable[hashkey].append(value)
t = int(input()) while(t!=0): count=0 n=int(input()) if n==1: print('no') else: for i in range(2,n//2): if(n%i == 0): count+=1 if(count>=1): print('no') else: print('yes') t-=1
t = int(input()) while t != 0: count = 0 n = int(input()) if n == 1: print('no') else: for i in range(2, n // 2): if n % i == 0: count += 1 if count >= 1: print('no') else: print('yes') t -= 1
class Solution: def romanToInt(self, s): """ :type s: str :rtype: int """ roman_int = {'I':1, 'V':5, 'X':10, 'L':50, 'C':100, 'D':500, 'M':1000} s = [roman_int[x] for x in s] ans = 0 for n in range(len(s)-1): if s[n] >= s[n+1]: ans += s[n] else: ans -= s[n] ans += s[-1] return (ans)
class Solution: def roman_to_int(self, s): """ :type s: str :rtype: int """ roman_int = {'I': 1, 'V': 5, 'X': 10, 'L': 50, 'C': 100, 'D': 500, 'M': 1000} s = [roman_int[x] for x in s] ans = 0 for n in range(len(s) - 1): if s[n] >= s[n + 1]: ans += s[n] else: ans -= s[n] ans += s[-1] return ans
class OrderDamageConfirmation: def __init__(self, content): self.system_seat_ids = content['systemSeatIds'] self.msg_id = content['msgId'] self.game_state_id = content['gameStateId'] self.result = content['orderDamageConfirmation']['result'] self.order_damage_type = content['orderDamageConfirmation'][ 'orderDamageType']
class Orderdamageconfirmation: def __init__(self, content): self.system_seat_ids = content['systemSeatIds'] self.msg_id = content['msgId'] self.game_state_id = content['gameStateId'] self.result = content['orderDamageConfirmation']['result'] self.order_damage_type = content['orderDamageConfirmation']['orderDamageType']
"""Python implementation of a Graph Data structure.""" class Graph(object): """ Graph implementation. Graph data structure supports following methods: nodes(): return a list of all nodes in the graph. edges(): return a list of all edges in the graph. add_node(n): adds a new node 'n' to the graph. add_edge(n1, n2): adds a new edge to the graph connecting 'n1' and 'n2', if either n1 or n2 are not already present in the graph, they should be added. del_node(n): deletes the node 'n' from the graph, raises an error if no such node exists. del_edge(n1, n2): deletes the edge connecting 'n1' and 'n2' from the graph, raises an error if no such edge exists. has_node(n): True if node 'n' is contained in the graph, False if not. neighbors(n): returns the list of all nodes connected to 'n' by edges, raises an error if n is not in g. adjacent(n1, n2): returns True if there is an edge connecting n1 and n2, False if not, raises an error if either of the supplied nodes are not in g. """ def __init__(self, data=None): """Initialize graph.""" self.graph = {} if data: for i in data: self.add_node(i) def nodes(self): """Return a list of all nodes in the graph.""" return list(self.graph.keys()) def edges(self): """Return a list of all edges in the graph.""" return [edge for edges in self.graph.values() for edge in edges] def add_node(self, n): """Add a new node to the graph.""" self.graph.setdefault(n, set()) def add_edge(self, n1, n2): """Add new edge to the graph.""" self.graph.setdefault(n1, set([n2])) self.graph.setdefault(n2, set()) self.graph[n1].add(n2) def del_node(self, n): """Delete the node 'n' from the graph.""" del self.graph[n] for k in self.graph: self.graph[k].discard(n) def del_edge(self, n1, n2): """Delete the edge connecting n1 and n2.""" self.graph[n1].remove(n2) def has_node(self, n): """Return boolean if 'n' is in the graph.""" return n in self.graph def neighbors(self, n): """Return the list of all nodes connected to n by edges.""" return self.graph[n] def adjacent(self, n1, n2): """Return boolean if there is an edge connecting n1 and n2.""" return n2 in self.neighbors(n1)
"""Python implementation of a Graph Data structure.""" class Graph(object): """ Graph implementation. Graph data structure supports following methods: nodes(): return a list of all nodes in the graph. edges(): return a list of all edges in the graph. add_node(n): adds a new node 'n' to the graph. add_edge(n1, n2): adds a new edge to the graph connecting 'n1' and 'n2', if either n1 or n2 are not already present in the graph, they should be added. del_node(n): deletes the node 'n' from the graph, raises an error if no such node exists. del_edge(n1, n2): deletes the edge connecting 'n1' and 'n2' from the graph, raises an error if no such edge exists. has_node(n): True if node 'n' is contained in the graph, False if not. neighbors(n): returns the list of all nodes connected to 'n' by edges, raises an error if n is not in g. adjacent(n1, n2): returns True if there is an edge connecting n1 and n2, False if not, raises an error if either of the supplied nodes are not in g. """ def __init__(self, data=None): """Initialize graph.""" self.graph = {} if data: for i in data: self.add_node(i) def nodes(self): """Return a list of all nodes in the graph.""" return list(self.graph.keys()) def edges(self): """Return a list of all edges in the graph.""" return [edge for edges in self.graph.values() for edge in edges] def add_node(self, n): """Add a new node to the graph.""" self.graph.setdefault(n, set()) def add_edge(self, n1, n2): """Add new edge to the graph.""" self.graph.setdefault(n1, set([n2])) self.graph.setdefault(n2, set()) self.graph[n1].add(n2) def del_node(self, n): """Delete the node 'n' from the graph.""" del self.graph[n] for k in self.graph: self.graph[k].discard(n) def del_edge(self, n1, n2): """Delete the edge connecting n1 and n2.""" self.graph[n1].remove(n2) def has_node(self, n): """Return boolean if 'n' is in the graph.""" return n in self.graph def neighbors(self, n): """Return the list of all nodes connected to n by edges.""" return self.graph[n] def adjacent(self, n1, n2): """Return boolean if there is an edge connecting n1 and n2.""" return n2 in self.neighbors(n1)
def test(): # if an assertion fails, the message will be displayed # --> must have the output in a comment assert "Mean: 5.0" in __solution__, "Did you record the correct program output as a comment?" # --> must have the correct arithmetic mean assert mean == 5.0, "Are you calculating the arithmetic mean?" # --> must not have a TODO marker in the solution assert "TODO" not in __solution__, "Did you remove the TODO marker when finished?" # display a congratulations for a correct solution __msg__.good("Well done!")
def test(): assert 'Mean: 5.0' in __solution__, 'Did you record the correct program output as a comment?' assert mean == 5.0, 'Are you calculating the arithmetic mean?' assert 'TODO' not in __solution__, 'Did you remove the TODO marker when finished?' __msg__.good('Well done!')
# Definition for a binary tree node. # class TreeNode: # def __init__(self, x): # self.val = x # self.left = None # self.right = None class Solution: def buildTree(self, inorder, postorder): """ :type inorder: List[int] :type postorder: List[int] :rtype: TreeNode """ assert len(inorder) == len(postorder) in_indices = {val: index for index, val in enumerate(inorder)} def dfs(in_start, post_start, size): if size == 0: return None assert size > 0 val = postorder[post_start + size - 1] in_index = in_indices[val] assert in_start <= in_index < in_start + size delta = in_index - in_start root = TreeNode(val) root.left = dfs(in_start, post_start, delta) root.right = dfs(in_index + 1, post_start + delta, size - delta - 1) return root return dfs(0, 0, len(inorder))
class Solution: def build_tree(self, inorder, postorder): """ :type inorder: List[int] :type postorder: List[int] :rtype: TreeNode """ assert len(inorder) == len(postorder) in_indices = {val: index for (index, val) in enumerate(inorder)} def dfs(in_start, post_start, size): if size == 0: return None assert size > 0 val = postorder[post_start + size - 1] in_index = in_indices[val] assert in_start <= in_index < in_start + size delta = in_index - in_start root = tree_node(val) root.left = dfs(in_start, post_start, delta) root.right = dfs(in_index + 1, post_start + delta, size - delta - 1) return root return dfs(0, 0, len(inorder))
MASTER_NAME = 'localhost:9090' MASTER_AUTH = ('admin', 'password') TEST_MONITOR_SVC_URLS = dict( base='http://{0}/nitestmonitor', base_sans_protocol='{0}://{1}/nitestmonitor', can_write='/v2/can-write', query_results='/v1/query-results', query_results_skip_take='/v1/query-results?skip={0}&take={1}', create_results='/v2/results', update_results='/v2/results', delete_result='/v2/results/{0}', query_steps='/v1/query-steps', query_steps_skip_take='/v1/query-steps?skip={0}&take={1}', create_steps='/v2/steps', delete_step='/v2/steps/{0}', delete_steps='/v2/delete-steps', delete_results='/v2/delete-results', list_report_files='/v2/reports', upload_report_for_result='/v2/results/{0}/upload', attach_report_to_result='/v2/results/{0}/attach', download_report='/v2/reports/{0}', delete_report='/v2/reports/{0}' )
master_name = 'localhost:9090' master_auth = ('admin', 'password') test_monitor_svc_urls = dict(base='http://{0}/nitestmonitor', base_sans_protocol='{0}://{1}/nitestmonitor', can_write='/v2/can-write', query_results='/v1/query-results', query_results_skip_take='/v1/query-results?skip={0}&take={1}', create_results='/v2/results', update_results='/v2/results', delete_result='/v2/results/{0}', query_steps='/v1/query-steps', query_steps_skip_take='/v1/query-steps?skip={0}&take={1}', create_steps='/v2/steps', delete_step='/v2/steps/{0}', delete_steps='/v2/delete-steps', delete_results='/v2/delete-results', list_report_files='/v2/reports', upload_report_for_result='/v2/results/{0}/upload', attach_report_to_result='/v2/results/{0}/attach', download_report='/v2/reports/{0}', delete_report='/v2/reports/{0}')
requested_toppings = ['mushrooms', 'extra cheese'] if 'mushrooms' in requested_toppings: print("Adding mushrooms") if 'pepperoni' in requested_toppings: print("Adding pepperoni.") if 'extra cheese' in requested_toppings: print("Adding extra cheese.") print("\nFinished making your pizza!") """TRY IT YOURSELFS""" alien_color = 'green' if alien_color is 'red': print("The alien is shot down! You get 5 points!") elif alien_color is 'yellow': print("He's weak! Keep shooting!") elif alien_color is 'green': print("The alien is flying high!") age = 3 if age <= 2: print("You are a baby") elif age <= 4: print("You are a toddler") elif age <= 13: print("You are a kid") elif age <= 20: print("You are a teenager.") elif age <= 65: print("You are an adult") else: print("You are an elder") faves = ['kiwi', 'apple', 'orange'] if 'apple' in faves: print("mmm apple" ) if 'kiwi' in faves: print("mmm kiwi") if 'banana' in faves: print("ok i get it")
requested_toppings = ['mushrooms', 'extra cheese'] if 'mushrooms' in requested_toppings: print('Adding mushrooms') if 'pepperoni' in requested_toppings: print('Adding pepperoni.') if 'extra cheese' in requested_toppings: print('Adding extra cheese.') print('\nFinished making your pizza!') 'TRY IT YOURSELFS' alien_color = 'green' if alien_color is 'red': print('The alien is shot down! You get 5 points!') elif alien_color is 'yellow': print("He's weak! Keep shooting!") elif alien_color is 'green': print('The alien is flying high!') age = 3 if age <= 2: print('You are a baby') elif age <= 4: print('You are a toddler') elif age <= 13: print('You are a kid') elif age <= 20: print('You are a teenager.') elif age <= 65: print('You are an adult') else: print('You are an elder') faves = ['kiwi', 'apple', 'orange'] if 'apple' in faves: print('mmm apple') if 'kiwi' in faves: print('mmm kiwi') if 'banana' in faves: print('ok i get it')
extensions = ["sphinx-favicon"] master_doc = "index" exclude_patterns = ["_build"] html_theme = "basic" html_static_path = ["gfx"] favicons = [ { "sizes": "32x32", "static-file": "square.svg", }, { "sizes": "128x128", "static-file": "nested/triangle.svg", }, ]
extensions = ['sphinx-favicon'] master_doc = 'index' exclude_patterns = ['_build'] html_theme = 'basic' html_static_path = ['gfx'] favicons = [{'sizes': '32x32', 'static-file': 'square.svg'}, {'sizes': '128x128', 'static-file': 'nested/triangle.svg'}]
acceptall = [ "Accept: text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8\r\nAccept-Language: en-US,en;q=0.5\r\nAccept-Encoding: gzip, deflate\r\n", "Accept-Encoding: gzip, deflate\r\n", "Accept-Language: en-US,en;q=0.5\r\nAccept-Encoding: gzip, deflate\r\n", "Accept: text/html, application/xhtml+xml, application/xml;q=0.9, */*;q=0.8\r\nAccept-Language: en-US,en;q=0.5\r\nAccept-Charset: iso-8859-1\r\nAccept-Encoding: gzip\r\n", "Accept: application/xml,application/xhtml+xml,text/html;q=0.9, text/plain;q=0.8,image/png,*/*;q=0.5\r\nAccept-Charset: iso-8859-1\r\n", "Accept: text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8\r\nAccept-Encoding: br;q=1.0, gzip;q=0.8, *;q=0.1\r\nAccept-Language: utf-8, iso-8859-1;q=0.5, *;q=0.1\r\nAccept-Charset: utf-8, iso-8859-1;q=0.5\r\n", "Accept: image/jpeg, application/x-ms-application, image/gif, application/xaml+xml, image/pjpeg, application/x-ms-xbap, application/x-shockwave-flash, application/msword, */*\r\nAccept-Language: en-US,en;q=0.5\r\n", "Accept: text/html, application/xhtml+xml, image/jxr, */*\r\nAccept-Encoding: gzip\r\nAccept-Charset: utf-8, iso-8859-1;q=0.5\r\nAccept-Language: utf-8, iso-8859-1;q=0.5, *;q=0.1\r\n", "Accept: text/html, application/xml;q=0.9, application/xhtml+xml, image/png, image/webp, image/jpeg, image/gif, image/x-xbitmap, */*;q=0.1\r\nAccept-Encoding: gzip\r\nAccept-Language: en-US,en;q=0.5\r\nAccept-Charset: utf-8, iso-8859-1;q=0.5\r\n," "Accept: text/html, application/xhtml+xml, application/xml;q=0.9, */*;q=0.8\r\nAccept-Language: en-US,en;q=0.5\r\n", "Accept-Charset: utf-8, iso-8859-1;q=0.5\r\nAccept-Language: utf-8, iso-8859-1;q=0.5, *;q=0.1\r\n", "Accept: text/html, application/xhtml+xml", "Accept-Language: en-US,en;q=0.5\r\n", "Accept: text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8\r\nAccept-Encoding: br;q=1.0, gzip;q=0.8, *;q=0.1\r\n", "Accept: text/plain;q=0.8,image/png,*/*;q=0.5\r\nAccept-Charset: iso-8859-1\r\n", ] referers = [ "https://www.google.com/search?q=", "https://check-host.net/", "https://www.facebook.com/", "https://www.youtube.com/", "https://www.fbi.com/", "https://www.bing.com/search?q=", "https://r.search.yahoo.com/", "https://www.cia.gov/index.html", "https://vk.com/profile.php?redirect=", "https://www.usatoday.com/search/results?q=", "https://help.baidu.com/searchResult?keywords=", "https://steamcommunity.com/market/search?q=", "https://www.ted.com/search?q=", "https://play.google.com/store/search?q=", "https://www.qwant.com/search?q=", "https://soda.demo.socrata.com/resource/4tka-6guv.json?$q=", "https://www.google.ad/search?q=", "https://www.google.ae/search?q=", "https://www.google.com.af/search?q=", "https://www.google.com.ag/search?q=", "https://www.google.com.ai/search?q=", "https://www.google.al/search?q=", "https://www.google.am/search?q=", "https://www.google.co.ao/search?q=", ] post_data = "" cookies = ""
acceptall = ['Accept: text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8\r\nAccept-Language: en-US,en;q=0.5\r\nAccept-Encoding: gzip, deflate\r\n', 'Accept-Encoding: gzip, deflate\r\n', 'Accept-Language: en-US,en;q=0.5\r\nAccept-Encoding: gzip, deflate\r\n', 'Accept: text/html, application/xhtml+xml, application/xml;q=0.9, */*;q=0.8\r\nAccept-Language: en-US,en;q=0.5\r\nAccept-Charset: iso-8859-1\r\nAccept-Encoding: gzip\r\n', 'Accept: application/xml,application/xhtml+xml,text/html;q=0.9, text/plain;q=0.8,image/png,*/*;q=0.5\r\nAccept-Charset: iso-8859-1\r\n', 'Accept: text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8\r\nAccept-Encoding: br;q=1.0, gzip;q=0.8, *;q=0.1\r\nAccept-Language: utf-8, iso-8859-1;q=0.5, *;q=0.1\r\nAccept-Charset: utf-8, iso-8859-1;q=0.5\r\n', 'Accept: image/jpeg, application/x-ms-application, image/gif, application/xaml+xml, image/pjpeg, application/x-ms-xbap, application/x-shockwave-flash, application/msword, */*\r\nAccept-Language: en-US,en;q=0.5\r\n', 'Accept: text/html, application/xhtml+xml, image/jxr, */*\r\nAccept-Encoding: gzip\r\nAccept-Charset: utf-8, iso-8859-1;q=0.5\r\nAccept-Language: utf-8, iso-8859-1;q=0.5, *;q=0.1\r\n', 'Accept: text/html, application/xml;q=0.9, application/xhtml+xml, image/png, image/webp, image/jpeg, image/gif, image/x-xbitmap, */*;q=0.1\r\nAccept-Encoding: gzip\r\nAccept-Language: en-US,en;q=0.5\r\nAccept-Charset: utf-8, iso-8859-1;q=0.5\r\n,Accept: text/html, application/xhtml+xml, application/xml;q=0.9, */*;q=0.8\r\nAccept-Language: en-US,en;q=0.5\r\n', 'Accept-Charset: utf-8, iso-8859-1;q=0.5\r\nAccept-Language: utf-8, iso-8859-1;q=0.5, *;q=0.1\r\n', 'Accept: text/html, application/xhtml+xml', 'Accept-Language: en-US,en;q=0.5\r\n', 'Accept: text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8\r\nAccept-Encoding: br;q=1.0, gzip;q=0.8, *;q=0.1\r\n', 'Accept: text/plain;q=0.8,image/png,*/*;q=0.5\r\nAccept-Charset: iso-8859-1\r\n'] referers = ['https://www.google.com/search?q=', 'https://check-host.net/', 'https://www.facebook.com/', 'https://www.youtube.com/', 'https://www.fbi.com/', 'https://www.bing.com/search?q=', 'https://r.search.yahoo.com/', 'https://www.cia.gov/index.html', 'https://vk.com/profile.php?redirect=', 'https://www.usatoday.com/search/results?q=', 'https://help.baidu.com/searchResult?keywords=', 'https://steamcommunity.com/market/search?q=', 'https://www.ted.com/search?q=', 'https://play.google.com/store/search?q=', 'https://www.qwant.com/search?q=', 'https://soda.demo.socrata.com/resource/4tka-6guv.json?$q=', 'https://www.google.ad/search?q=', 'https://www.google.ae/search?q=', 'https://www.google.com.af/search?q=', 'https://www.google.com.ag/search?q=', 'https://www.google.com.ai/search?q=', 'https://www.google.al/search?q=', 'https://www.google.am/search?q=', 'https://www.google.co.ao/search?q='] post_data = '' cookies = ''
# -*- coding: utf-8 -*- """Top-level package for Make Notebooks.""" __author__ = """Martin Skarzynski""" __version__ = '0.0.1'
"""Top-level package for Make Notebooks.""" __author__ = 'Martin Skarzynski' __version__ = '0.0.1'
# region headers # escript-template v20190605 / stephane.bourdeaud@nutanix.com # * author: Geluykens, Andy <Andy.Geluykens@pfizer.com> # * version: 2019/06/05 # task_name: RubrikGetSlaDomainId # description: This script gets the id of the specified Rubrik SLA domain. # endregion # region capture Calm macros username = '@@{rubrik.username}@@' username_secret = "@@{rubrik.secret}@@" api_server = "@@{rubrik_ip}@@" sla_domain = "@@{sla_domain}@@" # endregion # region Get Rubrik SLA domain ID api_server_port = "443" api_server_endpoint = "/api/v1/sla_domain?name={}".format(sla_domain) url = "https://{}:{}{}".format( api_server, api_server_port, api_server_endpoint ) method = "GET" headers = { 'Content-Type': 'application/json', 'Accept': 'application/json' } print("Making a {} API call to {}".format(method, url)) resp = urlreq( url, verb=method, auth='BASIC', user=username, passwd=username_secret, headers=headers, verify=False ) if resp.ok: json_resp = json.loads(resp.content) sla_domain_id = json_resp['data'][0]['id'] print("rubrik_sla_domain_id={}".format(sla_domain_id)) exit(0) else: print("Request failed") print("Headers: {}".format(headers)) print('Status code: {}'.format(resp.status_code)) print('Response: {}'.format(json.dumps(json.loads(resp.content), indent=4))) exit(1) # endregion
username = '@@{rubrik.username}@@' username_secret = '@@{rubrik.secret}@@' api_server = '@@{rubrik_ip}@@' sla_domain = '@@{sla_domain}@@' api_server_port = '443' api_server_endpoint = '/api/v1/sla_domain?name={}'.format(sla_domain) url = 'https://{}:{}{}'.format(api_server, api_server_port, api_server_endpoint) method = 'GET' headers = {'Content-Type': 'application/json', 'Accept': 'application/json'} print('Making a {} API call to {}'.format(method, url)) resp = urlreq(url, verb=method, auth='BASIC', user=username, passwd=username_secret, headers=headers, verify=False) if resp.ok: json_resp = json.loads(resp.content) sla_domain_id = json_resp['data'][0]['id'] print('rubrik_sla_domain_id={}'.format(sla_domain_id)) exit(0) else: print('Request failed') print('Headers: {}'.format(headers)) print('Status code: {}'.format(resp.status_code)) print('Response: {}'.format(json.dumps(json.loads(resp.content), indent=4))) exit(1)
class Animal: def __init__(self, name): # Constructor of the class self.name = name def speak(self): # Abstract method, defined by convention only raise NotImplementedError("Subclass must implement abstract method") class Dog(Animal): def speak(self): return self.name+' says Woof!' class Cat(Animal): def speak(self): return self.name+' says Meow!' fido = Dog('Fido') isis = Cat('Isis') print(fido.speak()) print(isis.speak()) # In this example, the derived classes did not need their own __init__ methods # because the base class __init__ gets called automatically # if you do define an __init__ in the derived class, this will override the base #* Multiple inheritance class Computer: def __init__(self,battery): self.battery = battery class Mac(Computer): def __init__(self, OS="MacOS", HW="proprietary",battery="LiIon"): self.OS = OS self.HW = HW self.battery = battery def run_mac_os(self): print("MacOS is running now") def mac_charge(self): print("Chargig via USB C") class PC(Computer): def __init__(self, OS="Windows", HW="assembled", battery="LiAmber"): self.OS = OS self.HW = HW self.battery = battery def run_windows_os(self): print("Windows is running now") def pc_charge(self): print("Chargig via brick charger") class hackintosh(Mac,PC): def __init__(self,OS = "Linux", HW="Assembled and modified", battery="Combined"): Mac.__init__(self, OS, HW, battery="LiIon") PC.__init__(self,OS,HW,battery="LiAmber") hck1 = hackintosh() print(hck1.HW) print(hck1.OS) print(hck1.battery) hck1.mac_charge() hck1.run_mac_os() hck1.pc_charge() hck1.run_windows_os() #* Super keyword #* super() function provides a shortcut for calling base classes #* it automatically follows Method Resolution Order. class MyBaseClass: def __init__(self,x,y): self.x = x self.y = y class MyDerivedClass(MyBaseClass): def __init__(self,x,y,z): super().__init__(x,y) self.z = z
class Animal: def __init__(self, name): self.name = name def speak(self): raise not_implemented_error('Subclass must implement abstract method') class Dog(Animal): def speak(self): return self.name + ' says Woof!' class Cat(Animal): def speak(self): return self.name + ' says Meow!' fido = dog('Fido') isis = cat('Isis') print(fido.speak()) print(isis.speak()) class Computer: def __init__(self, battery): self.battery = battery class Mac(Computer): def __init__(self, OS='MacOS', HW='proprietary', battery='LiIon'): self.OS = OS self.HW = HW self.battery = battery def run_mac_os(self): print('MacOS is running now') def mac_charge(self): print('Chargig via USB C') class Pc(Computer): def __init__(self, OS='Windows', HW='assembled', battery='LiAmber'): self.OS = OS self.HW = HW self.battery = battery def run_windows_os(self): print('Windows is running now') def pc_charge(self): print('Chargig via brick charger') class Hackintosh(Mac, PC): def __init__(self, OS='Linux', HW='Assembled and modified', battery='Combined'): Mac.__init__(self, OS, HW, battery='LiIon') PC.__init__(self, OS, HW, battery='LiAmber') hck1 = hackintosh() print(hck1.HW) print(hck1.OS) print(hck1.battery) hck1.mac_charge() hck1.run_mac_os() hck1.pc_charge() hck1.run_windows_os() class Mybaseclass: def __init__(self, x, y): self.x = x self.y = y class Myderivedclass(MyBaseClass): def __init__(self, x, y, z): super().__init__(x, y) self.z = z
''' You are given a spreadsheet that contains a list of N athletes and their details (such as age, height, weight and so on). You are required to sort the data based on the Kth attribute and print the final resulting table. Follow the example given below for better understanding. image Note that K is indexed from 0 to M-1, where M is the number of attributes. Note: If two attributes are the same for different rows, for example, if two atheletes are of the same age, print the row that appeared first in the input. Input Format The first line contains N and M separated by a space. The next lines each contain M elements. The last line contains K. Output Format Print the lines of the sorted table. Each line should contain the space separated elements. Check the sample below for clarity. Sample Input 0 5 3 10 2 5 7 1 0 9 9 9 1 23 12 6 5 9 1 Sample Output 0 7 1 0 10 2 5 6 5 9 9 9 9 1 23 12 Explanation 0 The details are sorted based on the second attribute, since K is zero-indexed. ''' #!/bin/python3 def sortingCriteria(arr): return arr[k] def athleteSort(athleteList): # global? athleteList.sort(key=sortingCriteria) return athleteList if __name__ == '__main__': nm = input().rstrip().split() n = int(nm[0]) m = int(nm[1]) arr = [] for x in range(n): arr.append(list(map(int, input().rstrip().split()))) k = int(input().rstrip()) result = athleteSort(arr) for athlete in result: print(' '.join(map(str, athlete)))
""" You are given a spreadsheet that contains a list of N athletes and their details (such as age, height, weight and so on). You are required to sort the data based on the Kth attribute and print the final resulting table. Follow the example given below for better understanding. image Note that K is indexed from 0 to M-1, where M is the number of attributes. Note: If two attributes are the same for different rows, for example, if two atheletes are of the same age, print the row that appeared first in the input. Input Format The first line contains N and M separated by a space. The next lines each contain M elements. The last line contains K. Output Format Print the lines of the sorted table. Each line should contain the space separated elements. Check the sample below for clarity. Sample Input 0 5 3 10 2 5 7 1 0 9 9 9 1 23 12 6 5 9 1 Sample Output 0 7 1 0 10 2 5 6 5 9 9 9 9 1 23 12 Explanation 0 The details are sorted based on the second attribute, since K is zero-indexed. """ def sorting_criteria(arr): return arr[k] def athlete_sort(athleteList): athleteList.sort(key=sortingCriteria) return athleteList if __name__ == '__main__': nm = input().rstrip().split() n = int(nm[0]) m = int(nm[1]) arr = [] for x in range(n): arr.append(list(map(int, input().rstrip().split()))) k = int(input().rstrip()) result = athlete_sort(arr) for athlete in result: print(' '.join(map(str, athlete)))
# Copyright 2019 BlueCat Networks. All rights reserved. # -*- coding: utf-8 -*- type = 'ui' sub_pages = [ { 'name' : 'cmdb_routers_page', 'title' : u'CMDB Routers', 'endpoint' : 'cmdb_routers/cmdb_routers_endpoint', 'description' : u'cmdb_routers' }, ]
type = 'ui' sub_pages = [{'name': 'cmdb_routers_page', 'title': u'CMDB Routers', 'endpoint': 'cmdb_routers/cmdb_routers_endpoint', 'description': u'cmdb_routers'}]
input = """ #maxint=100. g(1,X):- #int(X). s(1). f(X) :- s(Y), g(Y,X), T=1+2. """ output = """ {f(0), f(1), f(10), f(100), f(11), f(12), f(13), f(14), f(15), f(16), f(17), f(18), f(19), f(2), f(20), f(21), f(22), f(23), f(24), f(25), f(26), f(27), f(28), f(29), f(3), f(30), f(31), f(32), f(33), f(34), f(35), f(36), f(37), f(38), f(39), f(4), f(40), f(41), f(42), f(43), f(44), f(45), f(46), f(47), f(48), f(49), f(5), f(50), f(51), f(52), f(53), f(54), f(55), f(56), f(57), f(58), f(59), f(6), f(60), f(61), f(62), f(63), f(64), f(65), f(66), f(67), f(68), f(69), f(7), f(70), f(71), f(72), f(73), f(74), f(75), f(76), f(77), f(78), f(79), f(8), f(80), f(81), f(82), f(83), f(84), f(85), f(86), f(87), f(88), f(89), f(9), f(90), f(91), f(92), f(93), f(94), f(95), f(96), f(97), f(98), f(99), g(1,0), g(1,1), g(1,10), g(1,100), g(1,11), g(1,12), g(1,13), g(1,14), g(1,15), g(1,16), g(1,17), g(1,18), g(1,19), g(1,2), g(1,20), g(1,21), g(1,22), g(1,23), g(1,24), g(1,25), g(1,26), g(1,27), g(1,28), g(1,29), g(1,3), g(1,30), g(1,31), g(1,32), g(1,33), g(1,34), g(1,35), g(1,36), g(1,37), g(1,38), g(1,39), g(1,4), g(1,40), g(1,41), g(1,42), g(1,43), g(1,44), g(1,45), g(1,46), g(1,47), g(1,48), g(1,49), g(1,5), g(1,50), g(1,51), g(1,52), g(1,53), g(1,54), g(1,55), g(1,56), g(1,57), g(1,58), g(1,59), g(1,6), g(1,60), g(1,61), g(1,62), g(1,63), g(1,64), g(1,65), g(1,66), g(1,67), g(1,68), g(1,69), g(1,7), g(1,70), g(1,71), g(1,72), g(1,73), g(1,74), g(1,75), g(1,76), g(1,77), g(1,78), g(1,79), g(1,8), g(1,80), g(1,81), g(1,82), g(1,83), g(1,84), g(1,85), g(1,86), g(1,87), g(1,88), g(1,89), g(1,9), g(1,90), g(1,91), g(1,92), g(1,93), g(1,94), g(1,95), g(1,96), g(1,97), g(1,98), g(1,99), s(1)} """
input = '\n#maxint=100.\ng(1,X):- #int(X).\ns(1).\nf(X) :- s(Y), g(Y,X), T=1+2. \n' output = '\n{f(0), f(1), f(10), f(100), f(11), f(12), f(13), f(14), f(15), f(16), f(17), f(18), f(19), f(2), f(20), f(21), f(22), f(23), f(24), f(25), f(26), f(27), f(28), f(29), f(3), f(30), f(31), f(32), f(33), f(34), f(35), f(36), f(37), f(38), f(39), f(4), f(40), f(41), f(42), f(43), f(44), f(45), f(46), f(47), f(48), f(49), f(5), f(50), f(51), f(52), f(53), f(54), f(55), f(56), f(57), f(58), f(59), f(6), f(60), f(61), f(62), f(63), f(64), f(65), f(66), f(67), f(68), f(69), f(7), f(70), f(71), f(72), f(73), f(74), f(75), f(76), f(77), f(78), f(79), f(8), f(80), f(81), f(82), f(83), f(84), f(85), f(86), f(87), f(88), f(89), f(9), f(90), f(91), f(92), f(93), f(94), f(95), f(96), f(97), f(98), f(99), g(1,0), g(1,1), g(1,10), g(1,100), g(1,11), g(1,12), g(1,13), g(1,14), g(1,15), g(1,16), g(1,17), g(1,18), g(1,19), g(1,2), g(1,20), g(1,21), g(1,22), g(1,23), g(1,24), g(1,25), g(1,26), g(1,27), g(1,28), g(1,29), g(1,3), g(1,30), g(1,31), g(1,32), g(1,33), g(1,34), g(1,35), g(1,36), g(1,37), g(1,38), g(1,39), g(1,4), g(1,40), g(1,41), g(1,42), g(1,43), g(1,44), g(1,45), g(1,46), g(1,47), g(1,48), g(1,49), g(1,5), g(1,50), g(1,51), g(1,52), g(1,53), g(1,54), g(1,55), g(1,56), g(1,57), g(1,58), g(1,59), g(1,6), g(1,60), g(1,61), g(1,62), g(1,63), g(1,64), g(1,65), g(1,66), g(1,67), g(1,68), g(1,69), g(1,7), g(1,70), g(1,71), g(1,72), g(1,73), g(1,74), g(1,75), g(1,76), g(1,77), g(1,78), g(1,79), g(1,8), g(1,80), g(1,81), g(1,82), g(1,83), g(1,84), g(1,85), g(1,86), g(1,87), g(1,88), g(1,89), g(1,9), g(1,90), g(1,91), g(1,92), g(1,93), g(1,94), g(1,95), g(1,96), g(1,97), g(1,98), g(1,99), s(1)}\n'
# coding=utf-8 # Copyright 2021 The Google Research Authors. # # 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. """MNIST Constants. These constants, specific to the MNIST dataset, are used across multiple places in this project. """ NUM_OUTPUTS = 10 # Using 80% of the train data for training and 20% for validation TRAIN_DATA_PERCENT = 80 TRAIN_VAL_SPLIT = (4, 1) NUM_TRAIN_EXAMPLES = 48000 IMAGE_EDGE_LENGTH = 28 NUM_FLATTEN_FEATURES = IMAGE_EDGE_LENGTH * IMAGE_EDGE_LENGTH
"""MNIST Constants. These constants, specific to the MNIST dataset, are used across multiple places in this project. """ num_outputs = 10 train_data_percent = 80 train_val_split = (4, 1) num_train_examples = 48000 image_edge_length = 28 num_flatten_features = IMAGE_EDGE_LENGTH * IMAGE_EDGE_LENGTH
__title__ = "mathy_core" __version__ = "0.8.4" __summary__ = "Computer Algebra System for working with math expressions" __uri__ = "https://mathy.ai" __author__ = "Justin DuJardin" __email__ = "justin@dujardinconsulting.com" __license__ = "All rights reserved"
__title__ = 'mathy_core' __version__ = '0.8.4' __summary__ = 'Computer Algebra System for working with math expressions' __uri__ = 'https://mathy.ai' __author__ = 'Justin DuJardin' __email__ = 'justin@dujardinconsulting.com' __license__ = 'All rights reserved'
#!/usr/bin/env python3 theInput = """785 516 744 272 511 358 801 791 693 572 150 74 644 534 138 191 396 196 860 92 399 233 321 823 720 333 570 308 427 572 246 206 66 156 261 595 336 810 505 810 210 938 615 987 820 117 22 519 412 990 256 405 996 423 55 366 418 290 402 810 313 608 755 740 421 321 255 322 582 990 174 658 609 818 360 565 831 87 146 94 313 895 439 866 673 3 211 517 439 733 281 651 582 601 711 257 467 262 375 33 52 584 281 418 395 278 438 917 397 413 991 495 306 757 232 542 800 686 574 729 101 642 506 785 898 932 975 924 106 889 792 114 287 901 144 586 399 529 619 307 456 287 508 88 159 175 190 195 261 148 348 195 270 905 600 686 847 396 680 59 421 879 969 343 600 969 361 585 95 115 209 512 831 395 172 774 662 372 396 290 957 281 445 745 525 297 489 630 225 81 138 18 694 114 404 764 196 383 607 861 94 896 92 140 786 862 123 389 449 298 795 339 780 863 507 892 589 850 759 273 645 371 368 884 486 637 553 423 391 630 950 442 950 581 383 650 712 538 844 405 353 261 544 682 60 336 750 308 698 177 369 643 479 919 137 482 598 184 275 726 55 139 874 850 456 195 839 385 766 205 561 751 249 397 764 714 508 856 876 478 410 12 686 230 267 876 247 272 160 436 673 466 798 278 487 839 773 754 780 900 45 983 801 800 595 188 523 408 239 269 609 216 745 692 237 15 588 840 702 583 298 707 150 859 835 750 375 211 754 368 892 434 152 521 659 592 683 573 904 902 544 412 718 218 502 379 227 292 482 87 780 903 433 382 223 196 369 824 588 734 342 396 279 164 561 918 409 841 918 893 409 204 33 435 169 858 423 74 134 797 255 517 881 109 466 373 193 379 180 973 620 467 941 260 512 298 993 461 89 111 986 990 946 668 987 26 65 110 223 55 372 235 103 473 288 244 964 343 199 25 62 213 984 602 117 311 624 142 356 65 130 248 709 95 376 316 897 723 420 840 349 159 460 208 385 445 929 408 13 791 149 92 682 791 253 440 870 196 395 651 347 49 738 362 536 392 226 485 683 642 938 332 890 393 954 394 971 279 217 309 610 429 747 588 219 959 840 565 791 671 624 380 384 426 485 407 323 226 780 290 428 539 41 571 455 267 306 48 607 250 432 567 400 851 507 477 853 456 923 615 416 838 245 496 353 253 325 926 159 716 989 488 216 473 808 222 742 395 178 798 514 383 732 478 845 728 508 486 4 230 643 35 151 298 584 123 906 576 583 682 294 580 605 784 624 517 984 911 778 745 9 897 325 913 357 501 27 221 249 798 669 614 824 777 397 749 461 304 734 769 1 447 543 306 454 200 19 551 134 674 562 329 665 352 188 281 808 151 622 834 255 648 352 199 340 429 182 121 585 223 382 524 977 225 520 156 532 827 929 419 429 175 759 284 376 877 312 548 751 571 507 529 390 503 483 710 1 146 938 421 582 975 981 186 118 771 531 328 490 638 452 743 750 511 772 242 957 850 177 669 750 665 975 296 664 228 35 159 763 347 650 752 315 557 366 530 294 828 154 645 730 388 763 744 298 774 459 508 375 449 485 748 537 819 907 526 259 551 773 890 650 523 839 473 645 928 485 333 109 115 403 952 399 229 50 606 377 900 212 693 731 399 682 103 579 441 764 471 481 114 267 196 567 591 353 495 798 436 348 30 794 88 526 926 411 524 1 862 754 839 440 848 839 458 109 961 799 930 944 692 853 168 520 788 579 920 687 32 930 283 575 759 747 857 705 926 842 674 925 233 163 29 544 409 719 266 643 767 315 323 56 754 135 658 99 757 569 818 832 207 296 602 519 316 371 301 409 879 747 765 696 151 960 836 689 526 564 790 33 954 343 548 203 379 545 797 622 550 122 105 606 538 12 686 434 102 595 820 249 642 215 221 120 703 124 972 440 214 444 544 447 963 225 373 904 628 271 733 109 374 193 673 588 446 724 945 246 771 901 389 900 339 331 323 756 245 428 969 565 457 539 977 743 742 26 199 543 960 804 405 795 914 721 454 695 816 984 422 849 437 495 803 237 106 58 221 442 834 638 278 21 697 880 830 818 953 849 276 335 944 152 650 953 232 972 23 675 991 179 741 579 408 164 741 285 682 156 113 71 607 759 740 692 644 284 229 308 681 114 133 961 232 394 214 653 533 240 863 332 115 651 664 396 356 477 308 220 134 283 505 569 286 400 234 413 830 734 534 877 619 293 562 171 862 216 186 819 427 63 491 121 321 139 108 142 438 39 219 345 120 486 367 91 482 400 61 605 780 858 434 854 188 478 141 726 62 600 904 292 312 328 103 648 896 200 304 299 382 372 325 229 625 114 513 95 742 875 432 99 818 510 731 863 353 520 495 501 335 400 411 187 358 612 274 381 658 586 774 908 858 876 162 722 881 604 277 772 677 484 369 964 772 239 973 618 388 463 799 264 262 49 691 800 816 875 827 820 394 828 682 576 571 670 724 322 910 202 12 72 856 529 771 829 520 830 38 796 154 681 662 160 750 193 314 633 772 925 453 769 769 427 318 182 338 552 366 505 82 205 468 486 218 352 542 633 640 612 625 879 69 715 867 233 571 479 818 703 639 866 989 856 285 504 265 981 758 773 920 716 904 698 390 977 336 1 838 563 391 169 692 87 692 17 75 754 691 100 143 605 754 711 844 724 864 261 457 167 640 655 371 554 294 874 777 541 528 902 595 406 774 309 254 322 721 257 638 883 617 278 793 525 779 669 120 144 539 722 106 533 242 187 925 743 221 863 490 284 899 481 186 82 103 102 143 562 306 494 540 352 574 239 885 218 247 551 750 123 859 634 206 391 513 363 361 608 410 390 303 93 353 111 592 472 450 724 395 507 621 494 19 266 184 416 881 330 402 821 999 82 370 613 165 722 572 141 978 361 202 671 975 376 474 878 445 216 925 529 713 499 522 338 891 315 749 712 539 290 382 388 479 806 394 342 273 56 594 213 3 226 359 52 693 637 612 601 792 336 253 223 380 699 189 101 265 812 297 699 635 255 739 885 653 957 165 873 646 883 444 400 982 789 89 6 922 192 990 310 109 159 595 656 884 640 514 876 44 671 288 569 864 108 255 977 237 819 178 417 923 144 231 444 375 452 951 241 947 724 475 569 243 481 646 678 7 282 474 921 830 520 36 961 461 957 333 955 876 359 778 909 128 276 70 914 961 185 606 942 453 373 323 614 270 170 447 745 480 454 499 649 95 468 127 922 436 722 121 202 773 971 307 127 21 11 122 90 305 54 93 266 543 113 931 735 706 931 480 683 306 433 158 155 35 379 343 401 321 880 477 516 226 996 282 778 531 528 722 313 162 975 489 594 406 312 635 106 191 147 180 731 20 249 869 140 336 359 426 266 580 403 569 702 587 740 913 549 197 372 292 585 964 683 340 532 249 592 588 910 280 78 824 675 892 101 642 718 222 393 359 157 714 442 999 851 425 954 487 545 408 504 759 191 509 179 626 774 859 455 335 476 523 573 622 288 518 561 504 812 100 602 433 455 676 565 453 112 282 266 523 642 508 440 558 512 102 109 685 128 291 903 221 254 370 275 300 398 431 341 809 383 622 948 79 813 961 308 972 451 601 390 877 719 988 448 275 184 229 542 902 307 761 587 575 909 442 648 331 424 98 620 512 106 578 411 219 614 577 294 104 81 916 468 84 842 287 96 261 678 34 323 226 943 321 29 906 619 258 924 503 215 929 149 431 56 505 511 876 769 999 994 714 980 416 495 355 79 265 420 37 917 286 53 782 558 868 327 59 926 27 398 704 348 370 773 909 356 969 799 551 282 138 448 808 51 437 417 277 372 806 291 537 818 510 460 945 372 38 127 191 422 100 287 753 341 510 391 317 252 884 629 201 567 164 10 560 632 205 370 353 891 990 609 391 12 889 564 990 74 820 241 356 636 389 309 232 292 654 294 199 45 226 362 645 308 329 955 891 186 180 78 115 842 938 141 141 179 159 401 227 573 372 73 681 562 216 682 184 526 998 530 450 357 296 812 233 398 287 530 613 539 372 523 719 554 377 735 429 854 319 362 445 828 221 506 485 402 519 603 250 490 421 819 638 204 983 664 585 407 434 503 124 512 551 153 135 449 30 673 10 513 682 45 265 32 44 498 168 415 698 151 821 711 179 682 145 800 471 326 376 893 698 885 523 390 992 49 159 949 8 59 83 47 107 871 46 660 610 954 892 352 956 637 12 139 444 517 748 733 502 731 354 368 754 687 197 759 584 292 25 928 197 319 514 359 824 99 458 827 546 681 543 197 160 492 603 634 82 455 456 96 53 399 94 836 702 2 814 614 422 467 161 290 252 506 605 591 8 454 407 46 544 489 42 491 477 772 602 767 359 465 769 970 360 114 959 552 83 945 581 284 26 314 286 153 708 707 444 681 830 400 65 430 22 993 185 327 525 125 321 665 106 538 632 959 552 220 966 17 787 5 561 309 865 997 652 785 678 924 297 772 290 460 322 347 473 811 393 92 283 398 625 349 50 528 385 403 544 404 671 204 430 214 286 798 480 219 430 440 811 240 249 442 223 510 411 590 18 592 468 166 556 542 165 708 93 12 480 893 355 601 822 348 850 431 606 256 367 819 690 188 247 644 766 199 514 384 469 416 412 520 459 261 326 646 746 533 31 972 788 664 465 548 470 257 371 412 633 703 817 525 26 466 6 667 539 532 692 356 891 468 602 709 24 599 275 449 2 674 471 289 683 549 57 177 917 270 954 311 715 991 921 707 115 946 6 745 615 446 646 288 148 725 333 588 933 915 326 828 947 286 350 59 117 598 98 286 436 127 91 461 223 198 334 167 679 506 86 803 254 237 989 878 248 371 416 757 398 721 841 757 761 303 973 24 76 928 749 280 886 194 695 42 134 261 752 134 557 727 345 367 861 380 87 425 685 424 723 17 738 451 902 886 569 920 272 125 239 222 797 361 951 767 273 835 197 696 235 427 247 212 922 706 389 739 480 893 290 877 177 494 450 864 281 392 164 313 799 233 293 416 168 35 860 290 4 989 284 124 710 88 120 431 307 526 515 417 528 442 400 566 108 858 371 47 472 519 147 627 386 644 481 315 168 838 337 675 409 29 130 117 449 959 401 512 963 416 667 729 166 375 843 452 322 749 325 88 978 850 511 91 789 818 993 552 510 741 512 45 836 644 865 136 851 903 711 818 984 933 760 333 461 66 945 285 198 321 726 577 317 952 421 2 278 961 835 995 134 148 805 999 760 542 731 575 657 754 721 135 43 343 755 179 318 372 24 646 577 194 595 277 7 440 530 48 416 257 54 634 772 302 492 789 397 21 532 270 499 145 511 583 600 286 402 628 449 621 577 588 199 485 965 239 765 760 422 709 284 676 962 672 786 760 716 362 511 254 53 626 96 383 488 316 340 19 256 733 680 798 260 693 578 908 810 216 783 485 703 650 965 741 152 44 544 334 880 702 451 887 581 132 476 77 741 661 24 435 858 68 607 943 416 836 936 334 662 5 397 348 452 838 182 801 89 369 781 853 284 969 23 717 482 493 611 560 483 394 221 642 492 641 393 428 491 752 98 710 791 437 615 198 656 146 646 943 218 385 132 934 209 589 863 299 513 941 624 167 648 514 553 724 157 441 389 733 241 236 109 421 607 816 536 363 877 317 508 493 332 782 929 79 535 607 463 877 32 399 637 626 172 511 865 972 560 916 928 599 325 80 809 477 224 724 60 279 524 454 262 960 517 994 216 42 880 969 487 190 977 329 652 916 539 696 271 581 76 660 74 681 768 761 323 108 821 440 224 478 560 373 567 614 417 716 566 178 155 529 994 670 562 987 621 375 161 498 922 527 843 478 495 975 788 528 11 567 713 744 575 268 746 35 802 53 869 789 717 381 437 703 871 177 220 104 638 684 79 807 535 71 525 978 321 576 696 351 928 572 83 414 437 25 75 371 320 338 89 327 376 90 239 363 330 126 12 260 210 284 21 356 403 54 748 551 49 530 530 461 249 640 450 399 153 754 393 548 774 958 602 773 906 417 11 377 188 879 740 486 105 649 426 929 107 848 677 563 913 728 646 700 116 390 148 425 782 564 335 839 584 652 155 707 887 518 489 250 857 979 726 399 113 305 420 402 396 742 479 99 950 753 425 677 88 533 246 804 138 554 76 734 294 472 550 372 415 621 525 76 617 903 821 145 901 876 539 35 91 745 637 871 604 106 811 466 729 694 153 573 100 735 306 660 640 817 927 55 814 852 30 289 741 33 898 193 57 636 260 208 711 172 215 152 790 262 520 92 511 437 726 622 89 709 848 318 269 960 557 940 814 793 286 59 993 529 6 870 415 58 850 578 13 524 261 258 423 695 247 290 512 229 270 485 271 272 118 461 3 757 679 808 830 886 324 913 315 870 414 229 764 386 567 738 32 657 59 336 169 14 821 494 667 815 606 674 20 654 529 482 674 49 476 321 512 661 466 229 869 974 565 205 686 438 466 218 494 567 519 761 257 658 648 546 491 467 102 526 542 542 949 126 608 999 976 867 666 798 421 801 941 825 589 335 871 93 179 491 670 303 464 256 249 318 650 322 168 807 391 513 5 179 770 8 127 960 9 82 561 661 885 176 670 865 468 382 20 811 732 457 709 856 356 713 378 649 306 510 409 963 269 649 988 749 782 208 173 181 679 734 178 884 870 45 763 290 80 228 495 689 736 653 771 325 948 972 985 132 914 770 859 360 382 859 755 781 866 681 922 20 119 628 584 547 584 262 320 62 407 277 831 531 304 979 31 842 194 538 646 77 61 758 245 247 620 175 298 876 315 121 893 185 404 558 222 359 367 901 873 23 109 560 553 819 848 567 509 184 809 188 194 46 405 255 773 333 734 547 283 750 154 115 220 406 551 373 358 851 505 478 961 847 160 661 295 417 489 136 814 192 307 866 976 763 437 255 964 24 786 900 454 727 560 520 814 169 504 882 573 524 550 409 236 567 647 258 155 576 474 508 455 921 718 197 9 331 356 917 344 78 748 204 6 937 187 83 648 138 81 913 314 972 914 286 971 4 677 344 702 326 452 163 407 131 576 560 351 137 701 839 354 475 503 263 606 504 651 919 601 112 709 224 732 714 184 103 261 554 192 766 381 290 388 784 853 447 869 923 504 124 571 923 643 251 323 679 152 847 477 171 796 368 649 80 716 799 771 677 294 270 364 957 253 591 959 17 756 22 121 466 617 401 838 752 350 604 913 393 811 828 646 949 940 328 230 516 794 443 695 136 429 579 657 140 613 803 177 821 829 564 440 560 469 853 961 693 979 382 661 84 630 180 995 626 353 575 616 502 687 264 223 764 64 507 569 575 427 662 619 807 506 663 203 959 978 775 783 317 749 481 3 581 875 320 828 793 317 838 107 671 603 282 524 581 326 619 728 57 91 937 198 182 353 260 226 759 244 140 153 149 387 732 239 427 761 138 339 447 421 278 439 647 82 135 839 824 513 865 117 310 825 838 670 58 183 82 130 212 209 749 118 151 861 978 275 262 273 747 689 916 739 878 689 270 339 358 268 750 966 97 753 161 685 813 174 396 866 70 861 132 866 117 790 737 201 723 209 85 468 821 948 557 182 374 327 912 671 412 444 592 746 567 613 415 561 75 393 631 428 740 976 362 326 504 171 911 753 886 430 738 680 494 839 371 481 979 537 330 333 886 216 669 357 476 107 186 484 302 327 78 400 231 541 159 873 75 744 684 46 592 363 80 944 670 496 811 292 699 545 959 949 299 552 632 683 94 14 418 603 646 370 781 758 364 236 619 107 837 860 106 409 344 492 713 36 398 460 375 730 569 497 733 409 499 577 349 19 652 182 824 768 822 363 207 862 535 911 344 372 868 814 640 68 792 781 674 787 205 182 852 241 725 665 43 187 852 838 615 856 418 632 277 593 654 386 27 805 801 218 328 416 226 76 206 209 81 209 660 31 231 523 569 910 110 815 106 675 739 830 604 534 724 869 379 460 782 549 270 934 324 105 218 841 218 205 739 259 232 572 504 356 66 459 486 504 66 344 873 117 119 261 245 916 621 157 915 220 648 409 630 192 549 440 773 415 816 468 543 475 374 845 446 219 487 999 434 835 304 444 775 698 203 348 715 544 424 206 628 403 760 782 86 651 599 486 973 404 562 614 229 172 396 460 782 434 339 349 88 790 818 925 685 952 922 381 967 723 870 704 94 145 400 308 686 530 288 716 629 867 678 982 554 414 584 942 429 931 608 828 977 599 663 620 867 330 419 200 740 588 225 213 673 146 675 372 302 792 589 299 948 809 16 942 797 262 796 418 591 828 555 532 403 619 694 289 960 801 532 203 918 746 870 127 617 829 350 179 938 326 510 128 432 714 226 948 786 102 866 664 162 302 115 584 714 623 211 829 582 543 173 321 260 47 284 919 133 35 880 614 25 827 768 490 998 825 502 252 275 750 219 716 140 453 758 864 541 563 352 768 197 800 911 670 540 302 307 237 726 76 667 665 322 617 207 118 298 820 283 548 228 381 502 797 990 491 579 250 474 670 784 55 283 729 933 464 255 765 347 807 818 198 594 601 446 374 725 121 591 760 424 480 456 809 974 408 234 876 153 811 540 263 238 535 68 556 21 293 527 613 39 765 761 255 406 596 279 414 772 451 527 258 554 169 958 697 445 127 9 107 607 445 305 695 435 396 487 224 873 671 199 792 739 37 85 859 744 284 947 299 230 755 817 226 827 207 658 882 709 567 303 509 790 73 262 270 917 112 21 949 277 281 559 557 918 668 875 906 308 669 543 479 563 879 311 317 834 534 751 50 275 774 278 200 642 690 293 196 466 780 804 135 866 162 122 916 783 58 631 477 70 878 375 67 425 621 4 826 161 926 147 884 139 717 936 799 140 703 405 284 168 89 144 738 315 418 417 564 439 357 820 73 113 702 163 550 647 144 780 984 34 592 770 696 167 452 666 541 973 314 622 567 986 92 636 301 171 1 812 146 637 673 395 895 583 283 510 380 482 907 953 189 148 513 372 455 923 505 387 525 45 877 630 816 797 119 776 276 540 139 396 560 62 596 502 97 876 431 977 533 867 782 484 844 409 190 46 63 700 102 972 421 110 987 312 58 543 365 657 248 64 613 658 340 605 875 408 746 653 401 898 980 5 449 371 108 496 690 91 672 657 184 816 48 744 121 109 689 849 88 201 982 268 418 569 193 589 630 267 676 690 453 47 496 369 792 677 412 833 95 316 802 957 774 647 966 842 861 233 737 194 260 605 424 266 274 310 874 365 762 411 87 704 477 356 739 554 598 454 107 540 64 641 631 470 444 387 133 277 704 401 226 869 475 299 986 127 831 706 60 899 442 111 414 281 804 579 702 597 587 807 932 755 649 537 844 439 295 979 235 417 821 852 719 546 59 716 607 889 8 851 534 334 926 234 50 184 710 286 152 872 638 132 517 712 21 970 152 801 701 104 438 845 30 966 454 106 37 894 741 276 896 923 274 6 535 339 346 129 141 566 488 386 418 551 160 69 822 586 589 634 443 633 319 466 944 856 704 6 944 438 937 229 47 201 738 283 102 389 305 168 844 760 854 880 827 903 750 612 138 163 658 57 491 622 91 900 233 144 773 113 85 645 399 129 190 497 49 481 85 698 906 604 146 968 653 767 92 130 260 706 288 396 267 268 625 621 6 283 805 992 917 363 985 716 887 900 677 593 892 668 406 40 259 733 572 860 510 154 225 479 575 750 809 938 312 243 36 294 461 973 150 452 226 270 159 66 81 520 247 346 496 58 864 207 395 140 524 438 901 717 491 838 807 85 203 859 541 931 704 764 26 272 912 250 107 512 278 182 910 89 345 242 826 85 687 889 267 112 610 93 445 882 337 532 746 381 689 526 854 696 858 351 778 798 801 255 8 362 200 45 44 203 50 342 520 236 135 228 35 196 421 236 120 689 653 418 692 773 233 898 438 334 32 821 511 419 55 31 449 776 496 617 857 815 691 530 996 105 959 469 403 371 317 309 394 366 207 449 84 902 419 633 361 480 733 987 318 213 722 531 649 600 600 12 954 968 654 436 429 111 169 205 606 331 227 610 943 543 304 146 666 412 998 544 402 459 475 58 269 455 55 388 98 38 243 675 858 172 732 707 188 120 313 959 887 640 719 968 101 752 83 547 477 517 337 908 620 289 869 878 321 738 33 20 817 227 913 469 260 898 138 329 593 23 459 967 159 339 524 681 669 674 216 619 673 740 360 420 302 875 950 539 759 635 430 548 612 239 841 169 323 702 113 374 615 255 457 851 958 721 40 270 495 842 808 745 939 343 484 408 610 554 739 576 539 695 49 535 745 493 117 88 444 554 939 3 665 470 581 133 876 580 268 430 703 436 883 249 448 823 862 3 218 505 85 944 264 81 994 367 673 488 484 506 901 694 847 914 612 426 423 29 971 214 741 589 221 732 20 853 541 995 783 448 983 854 858 446 523 27 418 52 118 73 566 122 438 74 361 354 136 981 399 183 794 888 816 366 863 586 878 388 254 979 430 735 19 922 536 47 750 686 60 545 836 683 828 748 301 678 297 546 493 567 351 514 643 523 58 191 768 418 778 387 273 925 613 651 160 330 859 215 624 750 876 36 138 836 637 906 550 568 46 520 876 928 79 632 400 610 906 380 471 22 163 624 931 822 507 661 49 89 414 874 593 476 958 895 660 910 783 691 341 147 325 751 767 297 194 81 335 633 808 345 726 290 602 550 102 207 345 194 542 217 68 103 290 441 451 239 464 407 987 401 195 300 341 313 797 409 430 471 607 441 82 153 439 511 578 399 634 593 414 630 113 776 448 679 413 346 784 577 320 851 645 584 584 73 603 742 196 165 758 361 624 23 262 626 90 435 943 647 702 446 598 392 993 579 904 41 608 924 979 209 371 654 642 136 776 518 520 787 369 444 518 543 529 824 974 110 415 582 629 651 356 869 903 347 977 345 269 581 549 840 613 433 209 891 407 630 900 509 95 409 510 103 362 194 69 754""" theInput = theInput.split('\n') theInput2 = [i.split(' ') for i in theInput] totalPossible = 0 for triangle in theInput2: triangle.sort() print(triangle) if len(triangle) == 3: side1, side2, side3 = triangle else: nullStr, side1, side2, side3 = triangle if int(side1)+int(side2) > int(side3) and \ int(side1)+int(side3) > int(side2) and \ int(side2)+int(side3) > int(side1): totalPossible += 1 print(totalPossible)
the_input = '785 516 744\n272 511 358\n801 791 693\n572 150 74\n644 534 138\n191 396 196\n860 92 399\n233 321 823\n720 333 570\n308 427 572\n246 206 66\n156 261 595\n336 810 505\n810 210 938\n615 987 820\n117 22 519\n412 990 256\n405 996 423\n 55 366 418\n290 402 810\n313 608 755\n740 421 321\n255 322 582\n990 174 658\n609 818 360\n565 831 87\n146 94 313\n895 439 866\n673 3 211\n517 439 733\n281 651 582\n601 711 257\n467 262 375\n 33 52 584\n281 418 395\n278 438 917\n397 413 991\n495 306 757\n232 542 800\n686 574 729\n101 642 506\n785 898 932\n975 924 106\n889 792 114\n287 901 144\n586 399 529\n619 307 456\n287 508 88\n159 175 190\n195 261 148\n348 195 270\n905 600 686\n847 396 680\n 59 421 879\n969 343 600\n969 361 585\n 95 115 209\n512 831 395\n172 774 662\n372 396 290\n957 281 445\n745 525 297\n489 630 225\n 81 138 18\n694 114 404\n764 196 383\n607 861 94\n896 92 140\n786 862 123\n389 449 298\n795 339 780\n863 507 892\n589 850 759\n273 645 371\n368 884 486\n637 553 423\n391 630 950\n442 950 581\n383 650 712\n538 844 405\n353 261 544\n682 60 336\n750 308 698\n177 369 643\n479 919 137\n482 598 184\n275 726 55\n139 874 850\n456 195 839\n385 766 205\n561 751 249\n397 764 714\n508 856 876\n478 410 12\n686 230 267\n876 247 272\n160 436 673\n466 798 278\n487 839 773\n754 780 900\n 45 983 801\n800 595 188\n523 408 239\n269 609 216\n745 692 237\n 15 588 840\n702 583 298\n707 150 859\n835 750 375\n211 754 368\n892 434 152\n521 659 592\n683 573 904\n902 544 412\n718 218 502\n379 227 292\n482 87 780\n903 433 382\n223 196 369\n824 588 734\n342 396 279\n164 561 918\n409 841 918\n893 409 204\n 33 435 169\n858 423 74\n134 797 255\n517 881 109\n466 373 193\n379 180 973\n620 467 941\n260 512 298\n993 461 89\n111 986 990\n946 668 987\n 26 65 110\n223 55 372\n235 103 473\n288 244 964\n343 199 25\n 62 213 984\n602 117 311\n624 142 356\n 65 130 248\n709 95 376\n316 897 723\n420 840 349\n159 460 208\n385 445 929\n408 13 791\n149 92 682\n791 253 440\n870 196 395\n651 347 49\n738 362 536\n392 226 485\n683 642 938\n332 890 393\n954 394 971\n279 217 309\n610 429 747\n588 219 959\n840 565 791\n671 624 380\n384 426 485\n407 323 226\n780 290 428\n539 41 571\n455 267 306\n 48 607 250\n432 567 400\n851 507 477\n853 456 923\n615 416 838\n245 496 353\n253 325 926\n159 716 989\n488 216 473\n808 222 742\n395 178 798\n514 383 732\n478 845 728\n508 486 4\n230 643 35\n151 298 584\n123 906 576\n583 682 294\n580 605 784\n624 517 984\n911 778 745\n 9 897 325\n913 357 501\n 27 221 249\n798 669 614\n824 777 397\n749 461 304\n734 769 1\n447 543 306\n454 200 19\n551 134 674\n562 329 665\n352 188 281\n808 151 622\n834 255 648\n352 199 340\n429 182 121\n585 223 382\n524 977 225\n520 156 532\n827 929 419\n429 175 759\n284 376 877\n312 548 751\n571 507 529\n390 503 483\n710 1 146\n938 421 582\n975 981 186\n118 771 531\n328 490 638\n452 743 750\n511 772 242\n957 850 177\n669 750 665\n975 296 664\n228 35 159\n763 347 650\n752 315 557\n366 530 294\n828 154 645\n730 388 763\n744 298 774\n459 508 375\n449 485 748\n537 819 907\n526 259 551\n773 890 650\n523 839 473\n645 928 485\n333 109 115\n403 952 399\n229 50 606\n377 900 212\n693 731 399\n682 103 579\n441 764 471\n481 114 267\n196 567 591\n353 495 798\n436 348 30\n794 88 526\n926 411 524\n 1 862 754\n839 440 848\n839 458 109\n961 799 930\n944 692 853\n168 520 788\n579 920 687\n 32 930 283\n575 759 747\n857 705 926\n842 674 925\n233 163 29\n544 409 719\n266 643 767\n315 323 56\n754 135 658\n 99 757 569\n818 832 207\n296 602 519\n316 371 301\n409 879 747\n765 696 151\n960 836 689\n526 564 790\n 33 954 343\n548 203 379\n545 797 622\n550 122 105\n606 538 12\n686 434 102\n595 820 249\n642 215 221\n120 703 124\n972 440 214\n444 544 447\n963 225 373\n904 628 271\n733 109 374\n193 673 588\n446 724 945\n246 771 901\n389 900 339\n331 323 756\n245 428 969\n565 457 539\n977 743 742\n 26 199 543\n960 804 405\n795 914 721\n454 695 816\n984 422 849\n437 495 803\n237 106 58\n221 442 834\n638 278 21\n697 880 830\n818 953 849\n276 335 944\n152 650 953\n232 972 23\n675 991 179\n741 579 408\n164 741 285\n682 156 113\n 71 607 759\n740 692 644\n284 229 308\n681 114 133\n961 232 394\n214 653 533\n240 863 332\n115 651 664\n396 356 477\n308 220 134\n283 505 569\n286 400 234\n413 830 734\n534 877 619\n293 562 171\n862 216 186\n819 427 63\n491 121 321\n139 108 142\n438 39 219\n345 120 486\n367 91 482\n400 61 605\n780 858 434\n854 188 478\n141 726 62\n600 904 292\n312 328 103\n648 896 200\n304 299 382\n372 325 229\n625 114 513\n 95 742 875\n432 99 818\n510 731 863\n353 520 495\n501 335 400\n411 187 358\n612 274 381\n658 586 774\n908 858 876\n162 722 881\n604 277 772\n677 484 369\n964 772 239\n973 618 388\n463 799 264\n262 49 691\n800 816 875\n827 820 394\n828 682 576\n571 670 724\n322 910 202\n 12 72 856\n529 771 829\n520 830 38\n796 154 681\n662 160 750\n193 314 633\n772 925 453\n769 769 427\n318 182 338\n552 366 505\n 82 205 468\n486 218 352\n542 633 640\n612 625 879\n 69 715 867\n233 571 479\n818 703 639\n866 989 856\n285 504 265\n981 758 773\n920 716 904\n698 390 977\n336 1 838\n563 391 169\n692 87 692\n 17 75 754\n691 100 143\n605 754 711\n844 724 864\n261 457 167\n640 655 371\n554 294 874\n777 541 528\n902 595 406\n774 309 254\n322 721 257\n638 883 617\n278 793 525\n779 669 120\n144 539 722\n106 533 242\n187 925 743\n221 863 490\n284 899 481\n186 82 103\n102 143 562\n306 494 540\n352 574 239\n885 218 247\n551 750 123\n859 634 206\n391 513 363\n361 608 410\n390 303 93\n353 111 592\n472 450 724\n395 507 621\n494 19 266\n184 416 881\n330 402 821\n999 82 370\n613 165 722\n572 141 978\n361 202 671\n975 376 474\n878 445 216\n925 529 713\n499 522 338\n891 315 749\n712 539 290\n382 388 479\n806 394 342\n273 56 594\n213 3 226\n359 52 693\n637 612 601\n792 336 253\n223 380 699\n189 101 265\n812 297 699\n635 255 739\n885 653 957\n165 873 646\n883 444 400\n982 789 89\n 6 922 192\n990 310 109\n159 595 656\n884 640 514\n876 44 671\n288 569 864\n108 255 977\n237 819 178\n417 923 144\n231 444 375\n452 951 241\n947 724 475\n569 243 481\n646 678 7\n282 474 921\n830 520 36\n961 461 957\n333 955 876\n359 778 909\n128 276 70\n914 961 185\n606 942 453\n373 323 614\n270 170 447\n745 480 454\n499 649 95\n468 127 922\n436 722 121\n202 773 971\n307 127 21\n 11 122 90\n305 54 93\n266 543 113\n931 735 706\n931 480 683\n306 433 158\n155 35 379\n343 401 321\n880 477 516\n226 996 282\n778 531 528\n722 313 162\n975 489 594\n406 312 635\n106 191 147\n180 731 20\n249 869 140\n336 359 426\n266 580 403\n569 702 587\n740 913 549\n197 372 292\n585 964 683\n340 532 249\n592 588 910\n280 78 824\n675 892 101\n642 718 222\n393 359 157\n714 442 999\n851 425 954\n487 545 408\n504 759 191\n509 179 626\n774 859 455\n335 476 523\n573 622 288\n518 561 504\n812 100 602\n433 455 676\n565 453 112\n282 266 523\n642 508 440\n558 512 102\n109 685 128\n291 903 221\n254 370 275\n300 398 431\n341 809 383\n622 948 79\n813 961 308\n972 451 601\n390 877 719\n988 448 275\n184 229 542\n902 307 761\n587 575 909\n442 648 331\n424 98 620\n512 106 578\n411 219 614\n577 294 104\n 81 916 468\n 84 842 287\n 96 261 678\n 34 323 226\n943 321 29\n906 619 258\n924 503 215\n929 149 431\n 56 505 511\n876 769 999\n994 714 980\n416 495 355\n 79 265 420\n 37 917 286\n 53 782 558\n868 327 59\n926 27 398\n704 348 370\n773 909 356\n969 799 551\n282 138 448\n808 51 437\n417 277 372\n806 291 537\n818 510 460\n945 372 38\n127 191 422\n100 287 753\n341 510 391\n317 252 884\n629 201 567\n164 10 560\n632 205 370\n353 891 990\n609 391 12\n889 564 990\n 74 820 241\n356 636 389\n309 232 292\n654 294 199\n 45 226 362\n645 308 329\n955 891 186\n180 78 115\n842 938 141\n141 179 159\n401 227 573\n372 73 681\n562 216 682\n184 526 998\n530 450 357\n296 812 233\n398 287 530\n613 539 372\n523 719 554\n377 735 429\n854 319 362\n445 828 221\n506 485 402\n519 603 250\n490 421 819\n638 204 983\n664 585 407\n434 503 124\n512 551 153\n135 449 30\n673 10 513\n682 45 265\n 32 44 498\n168 415 698\n151 821 711\n179 682 145\n800 471 326\n376 893 698\n885 523 390\n992 49 159\n949 8 59\n 83 47 107\n871 46 660\n610 954 892\n352 956 637\n 12 139 444\n517 748 733\n502 731 354\n368 754 687\n197 759 584\n292 25 928\n197 319 514\n359 824 99\n458 827 546\n681 543 197\n160 492 603\n634 82 455\n456 96 53\n399 94 836\n702 2 814\n614 422 467\n161 290 252\n506 605 591\n 8 454 407\n 46 544 489\n 42 491 477\n772 602 767\n359 465 769\n970 360 114\n959 552 83\n945 581 284\n 26 314 286\n153 708 707\n444 681 830\n400 65 430\n 22 993 185\n327 525 125\n321 665 106\n538 632 959\n552 220 966\n 17 787 5\n561 309 865\n997 652 785\n678 924 297\n772 290 460\n322 347 473\n811 393 92\n283 398 625\n349 50 528\n385 403 544\n404 671 204\n430 214 286\n798 480 219\n430 440 811\n240 249 442\n223 510 411\n590 18 592\n468 166 556\n542 165 708\n 93 12 480\n893 355 601\n822 348 850\n431 606 256\n367 819 690\n188 247 644\n766 199 514\n384 469 416\n412 520 459\n261 326 646\n746 533 31\n972 788 664\n465 548 470\n257 371 412\n633 703 817\n525 26 466\n 6 667 539\n532 692 356\n891 468 602\n709 24 599\n275 449 2\n674 471 289\n683 549 57\n177 917 270\n954 311 715\n991 921 707\n115 946 6\n745 615 446\n646 288 148\n725 333 588\n933 915 326\n828 947 286\n350 59 117\n598 98 286\n436 127 91\n461 223 198\n334 167 679\n506 86 803\n254 237 989\n878 248 371\n416 757 398\n721 841 757\n761 303 973\n 24 76 928\n749 280 886\n194 695 42\n134 261 752\n134 557 727\n345 367 861\n380 87 425\n685 424 723\n 17 738 451\n902 886 569\n920 272 125\n239 222 797\n361 951 767\n273 835 197\n696 235 427\n247 212 922\n706 389 739\n480 893 290\n877 177 494\n450 864 281\n392 164 313\n799 233 293\n416 168 35\n860 290 4\n989 284 124\n710 88 120\n431 307 526\n515 417 528\n442 400 566\n108 858 371\n 47 472 519\n147 627 386\n644 481 315\n168 838 337\n675 409 29\n130 117 449\n959 401 512\n963 416 667\n729 166 375\n843 452 322\n749 325 88\n978 850 511\n 91 789 818\n993 552 510\n741 512 45\n836 644 865\n136 851 903\n711 818 984\n933 760 333\n461 66 945\n285 198 321\n726 577 317\n952 421 2\n278 961 835\n995 134 148\n805 999 760\n542 731 575\n657 754 721\n135 43 343\n755 179 318\n372 24 646\n577 194 595\n277 7 440\n530 48 416\n257 54 634\n772 302 492\n789 397 21\n532 270 499\n145 511 583\n600 286 402\n628 449 621\n577 588 199\n485 965 239\n765 760 422\n709 284 676\n962 672 786\n760 716 362\n511 254 53\n626 96 383\n488 316 340\n 19 256 733\n680 798 260\n693 578 908\n810 216 783\n485 703 650\n965 741 152\n 44 544 334\n880 702 451\n887 581 132\n476 77 741\n661 24 435\n858 68 607\n943 416 836\n936 334 662\n 5 397 348\n452 838 182\n801 89 369\n781 853 284\n969 23 717\n482 493 611\n560 483 394\n221 642 492\n641 393 428\n491 752 98\n710 791 437\n615 198 656\n146 646 943\n218 385 132\n934 209 589\n863 299 513\n941 624 167\n648 514 553\n724 157 441\n389 733 241\n236 109 421\n607 816 536\n363 877 317\n508 493 332\n782 929 79\n535 607 463\n877 32 399\n637 626 172\n511 865 972\n560 916 928\n599 325 80\n809 477 224\n724 60 279\n524 454 262\n960 517 994\n216 42 880\n969 487 190\n977 329 652\n916 539 696\n271 581 76\n660 74 681\n768 761 323\n108 821 440\n224 478 560\n373 567 614\n417 716 566\n178 155 529\n994 670 562\n987 621 375\n161 498 922\n527 843 478\n495 975 788\n528 11 567\n713 744 575\n268 746 35\n802 53 869\n789 717 381\n437 703 871\n177 220 104\n638 684 79\n807 535 71\n525 978 321\n576 696 351\n928 572 83\n414 437 25\n 75 371 320\n338 89 327\n376 90 239\n363 330 126\n 12 260 210\n284 21 356\n403 54 748\n551 49 530\n530 461 249\n640 450 399\n153 754 393\n548 774 958\n602 773 906\n417 11 377\n188 879 740\n486 105 649\n426 929 107\n848 677 563\n913 728 646\n700 116 390\n148 425 782\n564 335 839\n584 652 155\n707 887 518\n489 250 857\n979 726 399\n113 305 420\n402 396 742\n479 99 950\n753 425 677\n 88 533 246\n804 138 554\n 76 734 294\n472 550 372\n415 621 525\n 76 617 903\n821 145 901\n876 539 35\n 91 745 637\n871 604 106\n811 466 729\n694 153 573\n100 735 306\n660 640 817\n927 55 814\n852 30 289\n741 33 898\n193 57 636\n260 208 711\n172 215 152\n790 262 520\n 92 511 437\n726 622 89\n709 848 318\n269 960 557\n940 814 793\n286 59 993\n529 6 870\n415 58 850\n578 13 524\n261 258 423\n695 247 290\n512 229 270\n485 271 272\n118 461 3\n757 679 808\n830 886 324\n913 315 870\n414 229 764\n386 567 738\n 32 657 59\n336 169 14\n821 494 667\n815 606 674\n 20 654 529\n482 674 49\n476 321 512\n661 466 229\n869 974 565\n205 686 438\n466 218 494\n567 519 761\n257 658 648\n546 491 467\n102 526 542\n542 949 126\n608 999 976\n867 666 798\n421 801 941\n825 589 335\n871 93 179\n491 670 303\n464 256 249\n318 650 322\n168 807 391\n513 5 179\n770 8 127\n960 9 82\n561 661 885\n176 670 865\n468 382 20\n811 732 457\n709 856 356\n713 378 649\n306 510 409\n963 269 649\n988 749 782\n208 173 181\n679 734 178\n884 870 45\n763 290 80\n228 495 689\n736 653 771\n325 948 972\n985 132 914\n770 859 360\n382 859 755\n781 866 681\n922 20 119\n628 584 547\n584 262 320\n 62 407 277\n831 531 304\n979 31 842\n194 538 646\n 77 61 758\n245 247 620\n175 298 876\n315 121 893\n185 404 558\n222 359 367\n901 873 23\n109 560 553\n819 848 567\n509 184 809\n188 194 46\n405 255 773\n333 734 547\n283 750 154\n115 220 406\n551 373 358\n851 505 478\n961 847 160\n661 295 417\n489 136 814\n192 307 866\n976 763 437\n255 964 24\n786 900 454\n727 560 520\n814 169 504\n882 573 524\n550 409 236\n567 647 258\n155 576 474\n508 455 921\n718 197 9\n331 356 917\n344 78 748\n204 6 937\n187 83 648\n138 81 913\n314 972 914\n286 971 4\n677 344 702\n326 452 163\n407 131 576\n560 351 137\n701 839 354\n475 503 263\n606 504 651\n919 601 112\n709 224 732\n714 184 103\n261 554 192\n766 381 290\n388 784 853\n447 869 923\n504 124 571\n923 643 251\n323 679 152\n847 477 171\n796 368 649\n 80 716 799\n771 677 294\n270 364 957\n253 591 959\n 17 756 22\n121 466 617\n401 838 752\n350 604 913\n393 811 828\n646 949 940\n328 230 516\n794 443 695\n136 429 579\n657 140 613\n803 177 821\n829 564 440\n560 469 853\n961 693 979\n382 661 84\n630 180 995\n626 353 575\n616 502 687\n264 223 764\n 64 507 569\n575 427 662\n619 807 506\n663 203 959\n978 775 783\n317 749 481\n 3 581 875\n320 828 793\n317 838 107\n671 603 282\n524 581 326\n619 728 57\n 91 937 198\n182 353 260\n226 759 244\n140 153 149\n387 732 239\n427 761 138\n339 447 421\n278 439 647\n 82 135 839\n824 513 865\n117 310 825\n838 670 58\n183 82 130\n212 209 749\n118 151 861\n978 275 262\n273 747 689\n916 739 878\n689 270 339\n358 268 750\n966 97 753\n161 685 813\n174 396 866\n 70 861 132\n866 117 790\n737 201 723\n209 85 468\n821 948 557\n182 374 327\n912 671 412\n444 592 746\n567 613 415\n561 75 393\n631 428 740\n976 362 326\n504 171 911\n753 886 430\n738 680 494\n839 371 481\n979 537 330\n333 886 216\n669 357 476\n107 186 484\n302 327 78\n400 231 541\n159 873 75\n744 684 46\n592 363 80\n944 670 496\n811 292 699\n545 959 949\n299 552 632\n683 94 14\n418 603 646\n370 781 758\n364 236 619\n107 837 860\n106 409 344\n492 713 36\n398 460 375\n730 569 497\n733 409 499\n577 349 19\n652 182 824\n768 822 363\n207 862 535\n911 344 372\n868 814 640\n 68 792 781\n674 787 205\n182 852 241\n725 665 43\n187 852 838\n615 856 418\n632 277 593\n654 386 27\n805 801 218\n328 416 226\n 76 206 209\n 81 209 660\n 31 231 523\n569 910 110\n815 106 675\n739 830 604\n534 724 869\n379 460 782\n549 270 934\n324 105 218\n841 218 205\n739 259 232\n572 504 356\n 66 459 486\n504 66 344\n873 117 119\n261 245 916\n621 157 915\n220 648 409\n630 192 549\n440 773 415\n816 468 543\n475 374 845\n446 219 487\n999 434 835\n304 444 775\n698 203 348\n715 544 424\n206 628 403\n760 782 86\n651 599 486\n973 404 562\n614 229 172\n396 460 782\n434 339 349\n 88 790 818\n925 685 952\n922 381 967\n723 870 704\n 94 145 400\n308 686 530\n288 716 629\n867 678 982\n554 414 584\n942 429 931\n608 828 977\n599 663 620\n867 330 419\n200 740 588\n225 213 673\n146 675 372\n302 792 589\n299 948 809\n 16 942 797\n262 796 418\n591 828 555\n532 403 619\n694 289 960\n801 532 203\n918 746 870\n127 617 829\n350 179 938\n326 510 128\n432 714 226\n948 786 102\n866 664 162\n302 115 584\n714 623 211\n829 582 543\n173 321 260\n 47 284 919\n133 35 880\n614 25 827\n768 490 998\n825 502 252\n275 750 219\n716 140 453\n758 864 541\n563 352 768\n197 800 911\n670 540 302\n307 237 726\n 76 667 665\n322 617 207\n118 298 820\n283 548 228\n381 502 797\n990 491 579\n250 474 670\n784 55 283\n729 933 464\n255 765 347\n807 818 198\n594 601 446\n374 725 121\n591 760 424\n480 456 809\n974 408 234\n876 153 811\n540 263 238\n535 68 556\n 21 293 527\n613 39 765\n761 255 406\n596 279 414\n772 451 527\n258 554 169\n958 697 445\n127 9 107\n607 445 305\n695 435 396\n487 224 873\n671 199 792\n739 37 85\n859 744 284\n947 299 230\n755 817 226\n827 207 658\n882 709 567\n303 509 790\n 73 262 270\n917 112 21\n949 277 281\n559 557 918\n668 875 906\n308 669 543\n479 563 879\n311 317 834\n534 751 50\n275 774 278\n200 642 690\n293 196 466\n780 804 135\n866 162 122\n916 783 58\n631 477 70\n878 375 67\n425 621 4\n826 161 926\n147 884 139\n717 936 799\n140 703 405\n284 168 89\n144 738 315\n418 417 564\n439 357 820\n 73 113 702\n163 550 647\n144 780 984\n 34 592 770\n696 167 452\n666 541 973\n314 622 567\n986 92 636\n301 171 1\n812 146 637\n673 395 895\n583 283 510\n380 482 907\n953 189 148\n513 372 455\n923 505 387\n525 45 877\n630 816 797\n119 776 276\n540 139 396\n560 62 596\n502 97 876\n431 977 533\n867 782 484\n844 409 190\n 46 63 700\n102 972 421\n110 987 312\n 58 543 365\n657 248 64\n613 658 340\n605 875 408\n746 653 401\n898 980 5\n449 371 108\n496 690 91\n672 657 184\n816 48 744\n121 109 689\n849 88 201\n982 268 418\n569 193 589\n630 267 676\n690 453 47\n496 369 792\n677 412 833\n 95 316 802\n957 774 647\n966 842 861\n233 737 194\n260 605 424\n266 274 310\n874 365 762\n411 87 704\n477 356 739\n554 598 454\n107 540 64\n641 631 470\n444 387 133\n277 704 401\n226 869 475\n299 986 127\n831 706 60\n899 442 111\n414 281 804\n579 702 597\n587 807 932\n755 649 537\n844 439 295\n979 235 417\n821 852 719\n546 59 716\n607 889 8\n851 534 334\n926 234 50\n184 710 286\n152 872 638\n132 517 712\n 21 970 152\n801 701 104\n438 845 30\n966 454 106\n 37 894 741\n276 896 923\n274 6 535\n339 346 129\n141 566 488\n386 418 551\n160 69 822\n586 589 634\n443 633 319\n466 944 856\n704 6 944\n438 937 229\n 47 201 738\n283 102 389\n305 168 844\n760 854 880\n827 903 750\n612 138 163\n658 57 491\n622 91 900\n233 144 773\n113 85 645\n399 129 190\n497 49 481\n 85 698 906\n604 146 968\n653 767 92\n130 260 706\n288 396 267\n268 625 621\n 6 283 805\n992 917 363\n985 716 887\n900 677 593\n892 668 406\n 40 259 733\n572 860 510\n154 225 479\n575 750 809\n938 312 243\n 36 294 461\n973 150 452\n226 270 159\n 66 81 520\n247 346 496\n 58 864 207\n395 140 524\n438 901 717\n491 838 807\n 85 203 859\n541 931 704\n764 26 272\n912 250 107\n512 278 182\n910 89 345\n242 826 85\n687 889 267\n112 610 93\n445 882 337\n532 746 381\n689 526 854\n696 858 351\n778 798 801\n255 8 362\n200 45 44\n203 50 342\n520 236 135\n228 35 196\n421 236 120\n689 653 418\n692 773 233\n898 438 334\n 32 821 511\n419 55 31\n449 776 496\n617 857 815\n691 530 996\n105 959 469\n403 371 317\n309 394 366\n207 449 84\n902 419 633\n361 480 733\n987 318 213\n722 531 649\n600 600 12\n954 968 654\n436 429 111\n169 205 606\n331 227 610\n943 543 304\n146 666 412\n998 544 402\n459 475 58\n269 455 55\n388 98 38\n243 675 858\n172 732 707\n188 120 313\n959 887 640\n719 968 101\n752 83 547\n477 517 337\n908 620 289\n869 878 321\n738 33 20\n817 227 913\n469 260 898\n138 329 593\n 23 459 967\n159 339 524\n681 669 674\n216 619 673\n740 360 420\n302 875 950\n539 759 635\n430 548 612\n239 841 169\n323 702 113\n374 615 255\n457 851 958\n721 40 270\n495 842 808\n745 939 343\n484 408 610\n554 739 576\n539 695 49\n535 745 493\n117 88 444\n554 939 3\n665 470 581\n133 876 580\n268 430 703\n436 883 249\n448 823 862\n 3 218 505\n 85 944 264\n 81 994 367\n673 488 484\n506 901 694\n847 914 612\n426 423 29\n971 214 741\n589 221 732\n 20 853 541\n995 783 448\n983 854 858\n446 523 27\n418 52 118\n 73 566 122\n438 74 361\n354 136 981\n399 183 794\n888 816 366\n863 586 878\n388 254 979\n430 735 19\n922 536 47\n750 686 60\n545 836 683\n828 748 301\n678 297 546\n493 567 351\n514 643 523\n 58 191 768\n418 778 387\n273 925 613\n651 160 330\n859 215 624\n750 876 36\n138 836 637\n906 550 568\n 46 520 876\n928 79 632\n400 610 906\n380 471 22\n163 624 931\n822 507 661\n 49 89 414\n874 593 476\n958 895 660\n910 783 691\n341 147 325\n751 767 297\n194 81 335\n633 808 345\n726 290 602\n550 102 207\n345 194 542\n217 68 103\n290 441 451\n239 464 407\n987 401 195\n300 341 313\n797 409 430\n471 607 441\n 82 153 439\n511 578 399\n634 593 414\n630 113 776\n448 679 413\n346 784 577\n320 851 645\n584 584 73\n603 742 196\n165 758 361\n624 23 262\n626 90 435\n943 647 702\n446 598 392\n993 579 904\n 41 608 924\n979 209 371\n654 642 136\n776 518 520\n787 369 444\n518 543 529\n824 974 110\n415 582 629\n651 356 869\n903 347 977\n345 269 581\n549 840 613\n433 209 891\n407 630 900\n509 95 409\n510 103 362\n194 69 754' the_input = theInput.split('\n') the_input2 = [i.split(' ') for i in theInput] total_possible = 0 for triangle in theInput2: triangle.sort() print(triangle) if len(triangle) == 3: (side1, side2, side3) = triangle else: (null_str, side1, side2, side3) = triangle if int(side1) + int(side2) > int(side3) and int(side1) + int(side3) > int(side2) and (int(side2) + int(side3) > int(side1)): total_possible += 1 print(totalPossible)
# -*- coding: utf-8 -*- """Holder for shared Configuration""" def init(): """Holder for shared Configuration""" global config try: config except NameError: config = {}
"""Holder for shared Configuration""" def init(): """Holder for shared Configuration""" global config try: config except NameError: config = {}
#!/usr/bin/env python3 def validate_script(script): """ Validate compiled script """ assert type(script) == bytes # TODO - more validation
def validate_script(script): """ Validate compiled script """ assert type(script) == bytes
class ContactHelper: def __init__(self, app): self.app = app def open_contacts_page(self): wd = self.app.wd if not (wd.current_url.endswith("/group.php") and len (wd.find_elements_by_name("new"))) > 0: wd.find_element_by_link_text("home").click() def create(self, contact): wd = self.app.wd self.open_contacts_page() # init contact_add wd.find_element_by_link_text("add new").click() self.fill_contact_form(contact) wd.find_element_by_xpath("//div[@id='content']/form/input[21]").click() def change_field_value(self, field_name, text): wd = self.app.wd if text is not None: wd.find_element_by_name(field_name).click() wd.find_element_by_name(field_name).clear() wd.find_element_by_name(field_name).send_keys(text) def fill_contact_form(self, contact): wd = self.app.wd self.change_field_value("firstname", contact.name) self.change_field_value("middlename", contact.midname) self.change_field_value("lastname", contact.lastname) self.change_field_value("nickname", contact.nickname) self.change_field_value("company", contact.company) def test_select_first_contact(self): wd = self.app.wd self.open_contacts_page() # choose check box wd.find_element_by_name("selected[]").click() def test_del_first_contact(self): wd = self.app.wd self.open_contacts_page() # choose check box self.test_select_first_contact() wd.find_element_by_xpath("//div[@id='content']/form[2]/div[2]/input").click() wd.switch_to_alert().accept() def test_modify_first_contact(self, contact): wd = self.app.wd self.open_contacts_page() # choose first contact wd.find_element_by_xpath("//table[@id='maintable']/tbody/tr[2]/td[8]/a/img").click() # fill contact self.fill_contact_form(contact) # click submit wd.find_element_by_xpath("//div[@id='content']/form[1]/input[22]").click() def count(self): wd = self.app.wd self.open_contacts_page() return len(wd.find_elements_by_name("selected[]"))
class Contacthelper: def __init__(self, app): self.app = app def open_contacts_page(self): wd = self.app.wd if not (wd.current_url.endswith('/group.php') and len(wd.find_elements_by_name('new'))) > 0: wd.find_element_by_link_text('home').click() def create(self, contact): wd = self.app.wd self.open_contacts_page() wd.find_element_by_link_text('add new').click() self.fill_contact_form(contact) wd.find_element_by_xpath("//div[@id='content']/form/input[21]").click() def change_field_value(self, field_name, text): wd = self.app.wd if text is not None: wd.find_element_by_name(field_name).click() wd.find_element_by_name(field_name).clear() wd.find_element_by_name(field_name).send_keys(text) def fill_contact_form(self, contact): wd = self.app.wd self.change_field_value('firstname', contact.name) self.change_field_value('middlename', contact.midname) self.change_field_value('lastname', contact.lastname) self.change_field_value('nickname', contact.nickname) self.change_field_value('company', contact.company) def test_select_first_contact(self): wd = self.app.wd self.open_contacts_page() wd.find_element_by_name('selected[]').click() def test_del_first_contact(self): wd = self.app.wd self.open_contacts_page() self.test_select_first_contact() wd.find_element_by_xpath("//div[@id='content']/form[2]/div[2]/input").click() wd.switch_to_alert().accept() def test_modify_first_contact(self, contact): wd = self.app.wd self.open_contacts_page() wd.find_element_by_xpath("//table[@id='maintable']/tbody/tr[2]/td[8]/a/img").click() self.fill_contact_form(contact) wd.find_element_by_xpath("//div[@id='content']/form[1]/input[22]").click() def count(self): wd = self.app.wd self.open_contacts_page() return len(wd.find_elements_by_name('selected[]'))
# some sample PROJECT_NAME = "My Application" APPLICATION_SENTENCE = "Hello Django" # add apps into project read after settings.py # append application into lists # INSTALLED_APPS.append('my_application') # MIDDLEWARE.append('my_application.middleware.MyApplicationMiddleware') # add an application INSTALLED_APPS.append("myapplication.apps.MyapplicationConfig")
project_name = 'My Application' application_sentence = 'Hello Django' INSTALLED_APPS.append('myapplication.apps.MyapplicationConfig')
""" AAn isogram is a word that has no repeating letters, consecutive or non-consecutive. For example "something" and "brother" are isograms, where as "nothing" and "sister" are not. Below method compares the length of the string with the length (or size) of the set of the same string. The set of the string removes all duplicates, therefore if it is equal to the original string, then its an isogram """ # Function to check if string is an isogram def check_isogram(string_to_be_evaluated): if len(string_to_be_evaluated) == len(set(string_to_be_evaluated.lower())): return True return False if __name__ == '__main__': string_one = input("Enter string to check if it's an isogram:") is_isogram = check_isogram(string_one) if check_isogram: print("The string has no repeated letters and is therefore an Isogram.") else: print("The string is not an Isogram.")
""" AAn isogram is a word that has no repeating letters, consecutive or non-consecutive. For example "something" and "brother" are isograms, where as "nothing" and "sister" are not. Below method compares the length of the string with the length (or size) of the set of the same string. The set of the string removes all duplicates, therefore if it is equal to the original string, then its an isogram """ def check_isogram(string_to_be_evaluated): if len(string_to_be_evaluated) == len(set(string_to_be_evaluated.lower())): return True return False if __name__ == '__main__': string_one = input("Enter string to check if it's an isogram:") is_isogram = check_isogram(string_one) if check_isogram: print('The string has no repeated letters and is therefore an Isogram.') else: print('The string is not an Isogram.')
__source__ = 'https://leetcode.com/problems/next-greater-element-i/' # Time: O(m + n) # Space: O(m + n) # # Description: 496. Next Greater Element I # # You are given two arrays (without duplicates) nums1 and nums2 where nums1's elements are subset of nums2. # Find all the next greater numbers for nums1's elements in the corresponding places of nums2. # # The Next Greater Number of a number x in nums1 is the first greater number to its right in nums2. # If it does not exist, output -1 for this number. # # Example 1: # Input: nums1 = [4,1,2], nums2 = [1,3,4,2]. # Output: [-1,3,-1] # Explanation: # For number 4 in the first array, you cannot find the next greater number for it in the second array, # so output -1. # For number 1 in the first array, the next greater number for it in the second array is 3. # For number 2 in the first array, there is no next greater number for it in the second array, # so output -1. # # Example 2: # Input: nums1 = [2,4], nums2 = [1,2,3,4]. # Output: [3,-1] # Explanation: # For number 2 in the first array, the next greater number for it in the second array is 3. # For number 4 in the first array, there is no next greater number for it in the second array, so output -1. # # Note: # All elements in nums1 and nums2 are unique. # The length of both nums1 and nums2 would not exceed 1000. # Related Topics # Stack # Similar Questions # Next Greater Element II Next Greater Element III # # 48ms 42.75% class Solution(object): def nextGreaterElement(self, findNums, nums): """ :type findNums: List[int] :type nums: List[int] :rtype: List[int] """ dict = {} st = [] res = [] for n in nums: while len(st) and st[-1] < n: dict[st.pop()] = n st.append(n) for x in findNums: res.append(dict.get(x, -1)) return res # 52ms 34.84% class Solution(object): def nextGreaterElement2(self, findNums, nums): return [next((y for y in nums[nums.index(x):] if y > x), -1) for x in findNums] Java = ''' Thought: https://leetcode.com/problems/next-greater-element-i/solution/ Key observation: Suppose we have a decreasing sequence followed by a greater number For example [5, 4, 3, 2, 1, 6] then the greater number 6 is the next greater element for all previous numbers in the sequence We use a stack to keep a decreasing sub-sequence, whenever we see a number x greater than stack.peek() we pop all elements less than x and for all the popped ones, their next greater element is x For example [9, 8, 7, 3, 2, 1, 6] The stack will first contain [9, 8, 7, 3, 2, 1] and then we see 6 which is greater than 1 so we pop 1 2 3 whose next greater element should be 6 # 5ms 84.38% class Solution { public int[] nextGreaterElement(int[] findNums, int[] nums) { Map<Integer, Integer> map = new HashMap<>(); Stack<Integer> stack = new Stack<>(); for ( int num : nums) { while(!stack.isEmpty() && stack.peek() < num) { map.put(stack.pop(), num); } stack.push(num); } for (int i = 0; i < findNums.length; i++) { findNums[i] = map.getOrDefault(findNums[i], -1); } return findNums; } } # 5ms 84.38% class Solution { public int[] nextGreaterElement(int[] findNums, int[] nums) { Stack < Integer > stack = new Stack < > (); HashMap < Integer, Integer > map = new HashMap < > (); int[] res = new int[findNums.length]; for (int i = 0; i < nums.length; i++) { while (!stack.empty() && nums[i] > stack.peek()) map.put(stack.pop(), nums[i]); stack.push(nums[i]); } while (!stack.empty()) map.put(stack.pop(), -1); for (int i = 0; i < findNums.length; i++) { res[i] = map.get(findNums[i]); } return res; } } # 4ms 91.96% class Solution { public int[] nextGreaterElement(int[] findNums, int[] nums) { if(findNums == null || nums == null || findNums.length > nums.length) return new int[0]; int[] res = new int[findNums.length]; Arrays.fill(res, -1); // key : nums[i], value : position / index Map<Integer, Integer> map = new HashMap<>(); for(int i = 0; i < nums.length; i++){ map.put(nums[i], i); } for(int i = 0; i < res.length; i++){ int startIndex = map.get(findNums[i]); for(int j = startIndex + 1; j < nums.length; j++){ if(nums[j] > findNums[i]){ res[i] = nums[j]; break; } } } return res; } } '''
__source__ = 'https://leetcode.com/problems/next-greater-element-i/' class Solution(object): def next_greater_element(self, findNums, nums): """ :type findNums: List[int] :type nums: List[int] :rtype: List[int] """ dict = {} st = [] res = [] for n in nums: while len(st) and st[-1] < n: dict[st.pop()] = n st.append(n) for x in findNums: res.append(dict.get(x, -1)) return res class Solution(object): def next_greater_element2(self, findNums, nums): return [next((y for y in nums[nums.index(x):] if y > x), -1) for x in findNums] java = '\nThought: https://leetcode.com/problems/next-greater-element-i/solution/\n\nKey observation:\nSuppose we have a decreasing sequence followed by a greater number\nFor example [5, 4, 3, 2, 1, 6] then the greater number 6 is\nthe next greater element for all previous numbers in the sequence\n\nWe use a stack to keep a decreasing sub-sequence, whenever we see a number x greater than stack.peek()\nwe pop all elements less than x and for all the popped ones, their next greater element is x\nFor example [9, 8, 7, 3, 2, 1, 6]\nThe stack will first contain [9, 8, 7, 3, 2, 1] and then we see 6 which is greater than 1\nso we pop 1 2 3 whose next greater element should be 6\n\n# 5ms 84.38%\nclass Solution {\n public int[] nextGreaterElement(int[] findNums, int[] nums) {\n Map<Integer, Integer> map = new HashMap<>();\n Stack<Integer> stack = new Stack<>();\n for ( int num : nums) {\n while(!stack.isEmpty() && stack.peek() < num) {\n map.put(stack.pop(), num);\n }\n stack.push(num);\n }\n\n for (int i = 0; i < findNums.length; i++) {\n findNums[i] = map.getOrDefault(findNums[i], -1);\n }\n return findNums;\n }\n}\n\n# 5ms 84.38%\nclass Solution {\n public int[] nextGreaterElement(int[] findNums, int[] nums) {\n Stack < Integer > stack = new Stack < > ();\n HashMap < Integer, Integer > map = new HashMap < > ();\n int[] res = new int[findNums.length];\n for (int i = 0; i < nums.length; i++) {\n while (!stack.empty() && nums[i] > stack.peek())\n map.put(stack.pop(), nums[i]);\n stack.push(nums[i]);\n }\n while (!stack.empty())\n map.put(stack.pop(), -1);\n for (int i = 0; i < findNums.length; i++) {\n res[i] = map.get(findNums[i]);\n }\n return res;\n }\n}\n\n# 4ms 91.96%\nclass Solution {\n public int[] nextGreaterElement(int[] findNums, int[] nums) {\n if(findNums == null || nums == null || findNums.length > nums.length)\n return new int[0];\n int[] res = new int[findNums.length];\n Arrays.fill(res, -1);\n // key : nums[i], value : position / index\n Map<Integer, Integer> map = new HashMap<>();\n for(int i = 0; i < nums.length; i++){\n map.put(nums[i], i);\n }\n\n for(int i = 0; i < res.length; i++){\n int startIndex = map.get(findNums[i]);\n\n for(int j = startIndex + 1; j < nums.length; j++){\n if(nums[j] > findNums[i]){\n res[i] = nums[j];\n break;\n }\n }\n }\n return res;\n }\n}\n'
__all__=["declare_reproducible"] def declare_reproducible(SEED = 123): ''' https://github.com/NVIDIA/framework-determinism/blob/master/pytorch.md ''' # or whatever you choose try : random.seed(SEED) # if you're using random except : pass try : np.random.seed(SEED) # if you're using numpy except : pass try : torch.manual_seed(SEED) # torch.cuda.manual_seed_all(SEED) is not required torch.backends.cudnn.deterministic = True torch.backends.cudnn.benchmark = False except : pass try : tf.set_random_seed(1234) except : pass declare_reproducible()
__all__ = ['declare_reproducible'] def declare_reproducible(SEED=123): """ https://github.com/NVIDIA/framework-determinism/blob/master/pytorch.md """ try: random.seed(SEED) except: pass try: np.random.seed(SEED) except: pass try: torch.manual_seed(SEED) torch.backends.cudnn.deterministic = True torch.backends.cudnn.benchmark = False except: pass try: tf.set_random_seed(1234) except: pass declare_reproducible()
DATABASES = { 'default': { 'ENGINE': 'django.db.backends.sqlite3', 'NAME': ':memory:' } } SECRET_KEY = 'supersecret' INSTALLED_APPS = [ 'django.contrib.admin', 'django.contrib.auth', 'django.contrib.contenttypes', 'django.contrib.sessions', 'django.contrib.sites', 'nonrelated_inlines.tests.testapp' ] ROOT_URLCONF = 'nonrelated_inlines.tests.urls' MIDDLEWARE = [ 'django.contrib.sessions.middleware.SessionMiddleware', 'django.contrib.auth.middleware.AuthenticationMiddleware', 'django.contrib.messages.middleware.MessageMiddleware' ] TEMPLATES = [{ 'BACKEND': 'django.template.backends.django.DjangoTemplates', 'APP_DIRS': True, }]
databases = {'default': {'ENGINE': 'django.db.backends.sqlite3', 'NAME': ':memory:'}} secret_key = 'supersecret' installed_apps = ['django.contrib.admin', 'django.contrib.auth', 'django.contrib.contenttypes', 'django.contrib.sessions', 'django.contrib.sites', 'nonrelated_inlines.tests.testapp'] root_urlconf = 'nonrelated_inlines.tests.urls' middleware = ['django.contrib.sessions.middleware.SessionMiddleware', 'django.contrib.auth.middleware.AuthenticationMiddleware', 'django.contrib.messages.middleware.MessageMiddleware'] templates = [{'BACKEND': 'django.template.backends.django.DjangoTemplates', 'APP_DIRS': True}]
class Solution: def buildTree(self, preorder, inorder): if not inorder: return None root_val = preorder[0] index = inorder.index(root_val) left_tree = self.buildTree(preorder[1:index + 1], inorder[:index]) right_tree = self.buildTree(preorder[index + 1:], inorder[index + 1:]) root = TreeNode(root_val) root.left = left_tree root.right = right_tree return root
class Solution: def build_tree(self, preorder, inorder): if not inorder: return None root_val = preorder[0] index = inorder.index(root_val) left_tree = self.buildTree(preorder[1:index + 1], inorder[:index]) right_tree = self.buildTree(preorder[index + 1:], inorder[index + 1:]) root = tree_node(root_val) root.left = left_tree root.right = right_tree return root
num1 = int(input()) num2 = int(input()) print(f'X = {num1 + num2}')
num1 = int(input()) num2 = int(input()) print(f'X = {num1 + num2}')
def PeptideMasses(PeptideMassesSummaryFileName, PeptidesListFileLocation): # 'amino acid', monoisotopic residue mass, average residue mass AAResidueMassData = {'A':('Ala', 71.037114, 71.0779), 'C':('Cys', 103.009185, 103.1429), 'D':('Asp', 115.026943, 115.0874), 'E':('Glu', 129.042593, 129.114), 'F':('Phe', 147.068414, 147.1739), 'G':('Gly', 57.021464, 57.0513), 'H':('His', 137.058912, 137.1393), 'I':('Ile', 113.084064, 113.1576), 'K':('Lys', 128.094963, 128.1723), 'L':('Leu', 113.084064, 113.1576), 'M':('Met', 131.040485, 131.1961), 'N':('Asn', 114.042927, 114.1026), 'P':('Pro', 97.052764, 97.1152), 'Q':('Gln', 128.058578, 128.1292), 'R':('Arg', 156.101111, 156.1857), 'S':('Ser', 87.032028, 87.0773), 'T':('Thr', 101.047679, 101.1039), 'V':('Val', 99.068414, 99.1311), 'W':('Trp', 186.079313, 186.2099), 'Y':('Tyr', 163.06332, 163.1733), 'y':('D-Tyr', 163.06332, 163.1733), 'X':('HONH-Glu',144.05349, 144.1300), 'Z':('HONH-ASub',186.10044, 186.2110) } PeptidesListFile = open(PeptidesListFileLocation, 'r') Lines = PeptidesListFile.readlines() PeptidesListFile.close # print Lines PeptideMassesFile = open(PeptideMassesSummaryFileName, 'w') PeptideMassesFile.write('#' + ',' + 'peptide' + ',' + 'MI linear (Da)' + ',' + 'A linear (Da)' + ',' + 'MI cyclic (Da)' + ',' + 'A cyclic (Da)' + ',' + 'Ext 280nm (1/M*cm)''\n') PeptideNumber = 0 for Line in Lines: Peptide = Line.strip('\n') PeptideNumber += 1 LinearPeptideMIM = 17.02655 LinearPeptideAM = 17.0310 CysExt = 110.0 TrpExt = 5630.0 TyrExt = 1215.0 #uses the data from this paper http://www.ncbi.nlm.nih.gov/pmc/articles/PMC2143013/pdf/8563639.pdf #alternatively these data can be used http://www.rpgroup.caltech.edu/courses/aph162/2007/pdf/articles/Gill1989.pdf CysCount = 0 TrpCount = 0 TyrCount = 0 for i in range(len(Peptide)): LinearPeptideMIM += AAResidueMassData[Peptide[i]][1] LinearPeptideAM += AAResidueMassData[Peptide[i]][2] if Peptide[i] == 'C': CysCount += 1 elif Peptide[i] == 'W': TrpCount += 1 elif Peptide[i] == 'Y' or Peptide[i] == 'y': TyrCount += 1 CyclicPeptideMIM = LinearPeptideMIM + 42.01056 #print MICyclic CyclicPeptideAM = LinearPeptideAM + 42.0370 #print ACyclic PeptideExt = CysCount * CysExt + TrpCount *TrpExt + TyrCount * TyrExt # PeptideMassesFile.write(str(PeptideNumber) + ',' + Peptide + ',' + '{:.2f}'.format(LinearPeptideMIM) + ',' + '{:.2f}'.format(LinearPeptideAM) + ',' + '{:.2f}'.format(CyclicPeptideMIM) + ',' + '{:.2f}'.format(CyclicPeptideAM) + ',' + '{:.0f}'.format(PeptideExt) + '\n') PeptideMassesFile.close #_____________________________RUNNING THE FUNCTION_____________________________# #___PeptideMassesSummaryFileName, PeptidesListFileLocation___ PeptideMasses('CloneMasses Result Test.csv', '/Users/NikitaLoik/CloneSynthesis.txt')
def peptide_masses(PeptideMassesSummaryFileName, PeptidesListFileLocation): aa_residue_mass_data = {'A': ('Ala', 71.037114, 71.0779), 'C': ('Cys', 103.009185, 103.1429), 'D': ('Asp', 115.026943, 115.0874), 'E': ('Glu', 129.042593, 129.114), 'F': ('Phe', 147.068414, 147.1739), 'G': ('Gly', 57.021464, 57.0513), 'H': ('His', 137.058912, 137.1393), 'I': ('Ile', 113.084064, 113.1576), 'K': ('Lys', 128.094963, 128.1723), 'L': ('Leu', 113.084064, 113.1576), 'M': ('Met', 131.040485, 131.1961), 'N': ('Asn', 114.042927, 114.1026), 'P': ('Pro', 97.052764, 97.1152), 'Q': ('Gln', 128.058578, 128.1292), 'R': ('Arg', 156.101111, 156.1857), 'S': ('Ser', 87.032028, 87.0773), 'T': ('Thr', 101.047679, 101.1039), 'V': ('Val', 99.068414, 99.1311), 'W': ('Trp', 186.079313, 186.2099), 'Y': ('Tyr', 163.06332, 163.1733), 'y': ('D-Tyr', 163.06332, 163.1733), 'X': ('HONH-Glu', 144.05349, 144.13), 'Z': ('HONH-ASub', 186.10044, 186.211)} peptides_list_file = open(PeptidesListFileLocation, 'r') lines = PeptidesListFile.readlines() PeptidesListFile.close peptide_masses_file = open(PeptideMassesSummaryFileName, 'w') PeptideMassesFile.write('#' + ',' + 'peptide' + ',' + 'MI linear (Da)' + ',' + 'A linear (Da)' + ',' + 'MI cyclic (Da)' + ',' + 'A cyclic (Da)' + ',' + 'Ext 280nm (1/M*cm)\n') peptide_number = 0 for line in Lines: peptide = Line.strip('\n') peptide_number += 1 linear_peptide_mim = 17.02655 linear_peptide_am = 17.031 cys_ext = 110.0 trp_ext = 5630.0 tyr_ext = 1215.0 cys_count = 0 trp_count = 0 tyr_count = 0 for i in range(len(Peptide)): linear_peptide_mim += AAResidueMassData[Peptide[i]][1] linear_peptide_am += AAResidueMassData[Peptide[i]][2] if Peptide[i] == 'C': cys_count += 1 elif Peptide[i] == 'W': trp_count += 1 elif Peptide[i] == 'Y' or Peptide[i] == 'y': tyr_count += 1 cyclic_peptide_mim = LinearPeptideMIM + 42.01056 cyclic_peptide_am = LinearPeptideAM + 42.037 peptide_ext = CysCount * CysExt + TrpCount * TrpExt + TyrCount * TyrExt PeptideMassesFile.write(str(PeptideNumber) + ',' + Peptide + ',' + '{:.2f}'.format(LinearPeptideMIM) + ',' + '{:.2f}'.format(LinearPeptideAM) + ',' + '{:.2f}'.format(CyclicPeptideMIM) + ',' + '{:.2f}'.format(CyclicPeptideAM) + ',' + '{:.0f}'.format(PeptideExt) + '\n') PeptideMassesFile.close peptide_masses('CloneMasses Result Test.csv', '/Users/NikitaLoik/CloneSynthesis.txt')
# Multiplying strings and accessing characters within them # You can print a string multiple times by... multiplying it! print("-" * 10) # Since strings are basically a list, you can also access characters # or ranges of characters by indexing into them name = "Phil Hinton" print(f"Name: {name}") # First character print(name[0])
print('-' * 10) name = 'Phil Hinton' print(f'Name: {name}') print(name[0])
# TWITTER ACCESS_KEY = (" ") ACCESS_SECRET = (" ") CONSUMER_KEY = (" ") CONSUMER_SECRET = (" ") BEARER_TOKEN = (" ") # TELEGRAM API_KEY = (" ") BOT_CHAT_ID = (" ") # DISCORD APPLICATION_ID = (" ") PUBLIC_KEY = (" ") CLIENT_ID = (" ") CLIENT_SECRET = (" ") TOKEN = (" ") invite_url = (" ") # tweets baixados tweets = [] # numero de tweets baixados number = 0
access_key = ' ' access_secret = ' ' consumer_key = ' ' consumer_secret = ' ' bearer_token = ' ' api_key = ' ' bot_chat_id = ' ' application_id = ' ' public_key = ' ' client_id = ' ' client_secret = ' ' token = ' ' invite_url = ' ' tweets = [] number = 0
SESSION_EXPIRED = "Session expired. Please log in again." NETWORK_ERROR_MESSAGE = ( "Network error. Please check your connection and try again." ) AUTH_SERVER_ERROR = ( "A problem occured while trying to authenticate with divio.com. " "Please try again later" ) SERVER_ERROR = ( "A problem occured while trying to communicate with divio.com. " "Please try again later" ) AUTH_INVALID_TOKEN = "Login failed. Invalid token specified" RESOURCE_NOT_FOUND_ANONYMOUS = "Resource not found" RESOURCE_NOT_FOUND = "Resource not found. You are logged in as '{login}', please check if you have permissions to access the ressource" LOGIN_SUCCESSFUL = ( u"Welcome to Divio Cloud. You are now logged in as {greeting}" ) CONFIG_FILE_NOT_FOUND = u"Config file could not be not found at location: {}" FILE_NOT_FOUND = u"File could not be found: {}" INVALID_DB_SUBMITTED = ( "The database dump you have uploaded contains an error. " "Please check the file 'db_upload.log' for errors and try again" ) LOGIN_CHECK_SUCCESSFUL = ( "Authentication with server successful. You are logged in." ) LOGIN_CHECK_ERROR = ( "You are currently not logged in, " "please log in using `divio login`." ) PUSH_DB_WARNING = "\n".join( ( "WARNING", "=======", "\nYou are about to push your local database to the {stage} server on ", "the Divio Cloud. This will replace ALL data on the Divio Cloud {stage} ", "server with the data you are about to push, including (but not limited to):", " - User accounts", " - CMS Pages & Plugins", "\nYou will also lose any changes that have been made on the {stage} ", "server since you pulled its database to your local environment. ", "\nIt is recommended to go the project settings on control.divio.com", "and take a backup before restoring the database. You can find this ", 'action in the "Manage Project" section.', "\nPlease proceed with caution!", ) ) PUSH_MEDIA_WARNING = "\n".join( ( "WARNING", "=======", "\nYou are about to push your local media files to the {stage} server on ", "the Divio Cloud. This will replace ALL existing media files with the ", "ones you are about to push.", "\nYou will also lose any changes that have been made on the {stage} ", "server since you pulled its files to your local environment. ", "\nIt is recommended to go the project settings on control.divio.com", "and take a backup before restoring media files. You can find this ", 'action in the "Manage Project" section.', "\nPlease proceed with caution!", ) )
session_expired = 'Session expired. Please log in again.' network_error_message = 'Network error. Please check your connection and try again.' auth_server_error = 'A problem occured while trying to authenticate with divio.com. Please try again later' server_error = 'A problem occured while trying to communicate with divio.com. Please try again later' auth_invalid_token = 'Login failed. Invalid token specified' resource_not_found_anonymous = 'Resource not found' resource_not_found = "Resource not found. You are logged in as '{login}', please check if you have permissions to access the ressource" login_successful = u'Welcome to Divio Cloud. You are now logged in as {greeting}' config_file_not_found = u'Config file could not be not found at location: {}' file_not_found = u'File could not be found: {}' invalid_db_submitted = "The database dump you have uploaded contains an error. Please check the file 'db_upload.log' for errors and try again" login_check_successful = 'Authentication with server successful. You are logged in.' login_check_error = 'You are currently not logged in, please log in using `divio login`.' push_db_warning = '\n'.join(('WARNING', '=======', '\nYou are about to push your local database to the {stage} server on ', 'the Divio Cloud. This will replace ALL data on the Divio Cloud {stage} ', 'server with the data you are about to push, including (but not limited to):', ' - User accounts', ' - CMS Pages & Plugins', '\nYou will also lose any changes that have been made on the {stage} ', 'server since you pulled its database to your local environment. ', '\nIt is recommended to go the project settings on control.divio.com', 'and take a backup before restoring the database. You can find this ', 'action in the "Manage Project" section.', '\nPlease proceed with caution!')) push_media_warning = '\n'.join(('WARNING', '=======', '\nYou are about to push your local media files to the {stage} server on ', 'the Divio Cloud. This will replace ALL existing media files with the ', 'ones you are about to push.', '\nYou will also lose any changes that have been made on the {stage} ', 'server since you pulled its files to your local environment. ', '\nIt is recommended to go the project settings on control.divio.com', 'and take a backup before restoring media files. You can find this ', 'action in the "Manage Project" section.', '\nPlease proceed with caution!'))
class FileType: CSV = 'csv' XLSX = 'xlsx' JSON = 'json' XML = 'xml'
class Filetype: csv = 'csv' xlsx = 'xlsx' json = 'json' xml = 'xml'
def test_eval_mode(wdriver): assert wdriver.execute_script("return window.rp.pyEval('1+1')") == 2 def test_exec_mode(wdriver): assert wdriver.execute_script("return window.rp.pyExec('1+1')") is None def test_exec_single_mode(wdriver): assert wdriver.execute_script("return window.rp.pyExecSingle('1+1')") == 2 stdout = wdriver.execute_script( """ let output = ""; save_output = function(text) {{ output += text }}; window.rp.pyExecSingle('1+1\\n2+2',{stdout: save_output}); return output; """ ) assert stdout == "2\n4\n"
def test_eval_mode(wdriver): assert wdriver.execute_script("return window.rp.pyEval('1+1')") == 2 def test_exec_mode(wdriver): assert wdriver.execute_script("return window.rp.pyExec('1+1')") is None def test_exec_single_mode(wdriver): assert wdriver.execute_script("return window.rp.pyExecSingle('1+1')") == 2 stdout = wdriver.execute_script('\n let output = "";\n save_output = function(text) {{\n output += text\n }};\n window.rp.pyExecSingle(\'1+1\\n2+2\',{stdout: save_output});\n return output;\n ') assert stdout == '2\n4\n'
# encoding: UTF-8 def remove_chinese(str): s = "" for w in str: if w >= u'\u4e00' and w <= u'\u9fa5': continue s += w return s def remove_non_numerical(s): f = '' for i in range(len(s)): try: f = float(s[:i+1]) except: return f return str(f)
def remove_chinese(str): s = '' for w in str: if w >= u'一' and w <= u'龥': continue s += w return s def remove_non_numerical(s): f = '' for i in range(len(s)): try: f = float(s[:i + 1]) except: return f return str(f)
# Link: https://leetcode.com/problems/search-in-rotated-sorted-array/ # Time: O(LogN) # Space: O(1) # As the given array is rotated sorted, binary search cannot be applied directly. def search(nums, target): start, end = 0, len(nums) - 1 while start <= end: mid = (start + end) // 2 if target == nums[mid]: return mid if nums[start] <= nums[mid]: # the array is sorted from start to mid. if nums[start] <= target < nums[mid]: # as the target lies between start and mid, reduce the search window. end = mid - 1 else: # if target does not lie between start and mid, search from (mid + 1) - end. start = mid + 1 else: # here the array is sorted from mid to end. if nums[mid] < target <= nums[end]: # as the target lies between mid and end, reduce the search window. start = mid + 1 else: # the target does not lie between mid and end, search from start - (mid - 1) end = mid - 1 return -1 def main(): nums = [3, 5, 1] target = 3 print(search(nums, target)) if __name__ == "__main__": main()
def search(nums, target): (start, end) = (0, len(nums) - 1) while start <= end: mid = (start + end) // 2 if target == nums[mid]: return mid if nums[start] <= nums[mid]: if nums[start] <= target < nums[mid]: end = mid - 1 else: start = mid + 1 elif nums[mid] < target <= nums[end]: start = mid + 1 else: end = mid - 1 return -1 def main(): nums = [3, 5, 1] target = 3 print(search(nums, target)) if __name__ == '__main__': main()
class Sequence: transcription_table = {'A':'U', 'T':'A', 'C':'G' , 'G':'C'} enz_dict = {'EcoRI':'GAATTC', 'EcoRV':'GATATC'} def __init__(self, seqstring): self.seqstring = seqstring.upper() def restriction(self, enz): try: enz_target = Sequence.enz_dict[enz] return self.seqstring.count(enz_target) except KeyError: return 0 def transcription(self): tt = "" for letter in self.seqstring: if letter in 'ATCG': tt += self.transcription_table[letter] return tt
class Sequence: transcription_table = {'A': 'U', 'T': 'A', 'C': 'G', 'G': 'C'} enz_dict = {'EcoRI': 'GAATTC', 'EcoRV': 'GATATC'} def __init__(self, seqstring): self.seqstring = seqstring.upper() def restriction(self, enz): try: enz_target = Sequence.enz_dict[enz] return self.seqstring.count(enz_target) except KeyError: return 0 def transcription(self): tt = '' for letter in self.seqstring: if letter in 'ATCG': tt += self.transcription_table[letter] return tt
''' URL: https://leetcode.com/problems/delete-node-in-a-linked-list/ Difficulty: Easy Description: Delete Node in a Linked List Write a function to delete a node in a singly-linked list. You will not be given access to the head of the list, instead you will be given access to the node to be deleted directly. It is guaranteed that the node to be deleted is not a tail node in the list. Example 1: Input: head = [4,5,1,9], node = 5 Output: [4,1,9] Explanation: You are given the second node with value 5, the linked list should become 4 -> 1 -> 9 after calling your function. Example 2: Input: head = [4,5,1,9], node = 1 Output: [4,5,9] Explanation: You are given the third node with value 1, the linked list should become 4 -> 5 -> 9 after calling your function. Example 3: Input: head = [1,2,3,4], node = 3 Output: [1,2,4] Example 4: Input: head = [0,1], node = 0 Output: [1] Example 5: Input: head = [-3,5,-99], node = -3 Output: [5,-99] Constraints: The number of the nodes in the given list is in the range [2, 1000]. -1000 <= Node.val <= 1000 The value of each node in the list is unique. The node to be deleted is in the list and is not a tail node ''' # Definition for singly-linked list. # class ListNode: # def __init__(self, x): # self.val = x # self.next = None class Solution: def deleteNode(self, node): """ :type node: ListNode :rtype: void Do not return anything, modify node in-place instead. """ node.val = node.next.val node.next = node.next.next
""" URL: https://leetcode.com/problems/delete-node-in-a-linked-list/ Difficulty: Easy Description: Delete Node in a Linked List Write a function to delete a node in a singly-linked list. You will not be given access to the head of the list, instead you will be given access to the node to be deleted directly. It is guaranteed that the node to be deleted is not a tail node in the list. Example 1: Input: head = [4,5,1,9], node = 5 Output: [4,1,9] Explanation: You are given the second node with value 5, the linked list should become 4 -> 1 -> 9 after calling your function. Example 2: Input: head = [4,5,1,9], node = 1 Output: [4,5,9] Explanation: You are given the third node with value 1, the linked list should become 4 -> 5 -> 9 after calling your function. Example 3: Input: head = [1,2,3,4], node = 3 Output: [1,2,4] Example 4: Input: head = [0,1], node = 0 Output: [1] Example 5: Input: head = [-3,5,-99], node = -3 Output: [5,-99] Constraints: The number of the nodes in the given list is in the range [2, 1000]. -1000 <= Node.val <= 1000 The value of each node in the list is unique. The node to be deleted is in the list and is not a tail node """ class Solution: def delete_node(self, node): """ :type node: ListNode :rtype: void Do not return anything, modify node in-place instead. """ node.val = node.next.val node.next = node.next.next
class Messages: USERS_1 = 'Username already exists.' USERS_2 = 'Email already exists.' USERS_3 = 'Password and Confirm Password must be same.' USERS_4 = 'Username or Password is incorrect.' USERS_5 = 'Your email address is not verified.' TOKENS_1 = 'Token does not exist.' TOKENS_2 = 'User does not exist.' TOKENS_3 = 'Your email has been verified.'
class Messages: users_1 = 'Username already exists.' users_2 = 'Email already exists.' users_3 = 'Password and Confirm Password must be same.' users_4 = 'Username or Password is incorrect.' users_5 = 'Your email address is not verified.' tokens_1 = 'Token does not exist.' tokens_2 = 'User does not exist.' tokens_3 = 'Your email has been verified.'
class PageEffectiveImageMixin(object): def get_effective_image(self): if self.image: return self.image page = self.get_main_language_page() if page.specific.image: return page.specific.get_effective_image() return ''
class Pageeffectiveimagemixin(object): def get_effective_image(self): if self.image: return self.image page = self.get_main_language_page() if page.specific.image: return page.specific.get_effective_image() return ''
# /home/bruce/python/workareas/pyke-hg/r1_working/pyke/krb_compiler/krbparser_tables.py # This file is automatically generated. Do not edit. _tabversion = '3.2' _lr_method = 'LALR' _lr_signature = '`\xa3O\x17\xd6C\xd4E2\xb5\xf60wIM\xd9' _lr_action_items = {'TAKING_TOK':([142,161,187,216,],[-66,188,-66,240,]),'LP_TOK':([18,32,43,65,73,85,88,95,111,112,124,125,128,132,144,150,158,162,165,170,171,179,180,181,182,183,184,185,189,192,193,196,197,199,204,205,206,207,210,212,214,218,219,220,224,225,226,231,233,234,235,236,238,239,244,245,251,253,254,255,257,258,260,266,268,269,272,273,275,276,278,279,283,284,289,292,295,296,300,301,304,307,308,310,312,],[32,43,65,65,43,65,43,111,43,43,-94,43,-79,43,-111,-32,43,43,192,43,43,-91,-51,-76,-50,-11,212,43,43,43,-38,43,43,226,231,43,-51,-50,43,43,-57,-33,-37,-36,-31,-21,43,43,-59,43,-108,255,43,43,-40,-34,266,43,-11,43,-11,-11,-30,43,-11,-60,-52,-25,-56,-16,-39,43,-53,-58,-61,43,-54,-63,-35,-55,43,-11,-65,-62,-64,]),'FOREACH_TOK':([61,],[79,]),'AS_TOK':([256,267,285,294,],[271,271,271,271,]),'ANONYMOUS_VAR_TOK':([32,43,65,66,73,85,88,100,106,111,112,124,125,128,132,144,150,158,162,170,171,179,181,183,185,189,192,193,196,197,205,210,212,214,218,219,220,224,225,226,231,233,234,235,238,239,244,245,253,254,255,257,258,260,266,268,269,272,273,275,276,278,279,283,284,289,292,295,296,300,301,304,307,308,310,312,],[46,46,46,46,46,46,46,46,46,46,46,-94,46,-79,46,-111,-32,46,46,46,46,-91,-76,-11,46,46,46,-38,46,46,46,46,46,-57,-33,-37,-36,-31,-21,46,46,-59,46,-108,46,46,-40,-34,46,-11,46,-11,-11,-30,46,-11,-60,-52,-25,-56,-16,-39,46,-53,-58,-61,46,-54,-63,-35,-55,46,-11,-65,-62,-64,]),'NUMBER_TOK':([32,43,65,73,85,88,111,112,124,125,128,132,144,150,158,162,170,171,179,181,183,185,189,192,193,196,197,205,210,212,214,218,219,220,224,225,226,231,233,234,235,238,239,244,245,253,254,255,257,258,260,266,268,269,272,273,274,275,276,278,279,283,284,289,292,295,296,300,301,304,307,308,310,312,],[44,44,44,44,44,44,44,44,-94,44,-79,44,-111,-32,44,44,44,44,-91,-76,-11,44,44,44,-38,44,44,44,44,44,-57,-33,-37,-36,-31,-21,44,44,-59,44,-108,44,44,-40,-34,44,-11,44,-11,-11,-30,44,-11,-60,-52,-25,288,-56,-16,-39,44,-53,-58,-61,44,-54,-63,-35,-55,44,-11,-65,-62,-64,]),'DEINDENT_TOK':([94,107,109,114,119,121,124,125,128,144,150,153,154,159,160,172,173,179,181,183,189,193,196,197,209,214,218,219,220,224,225,229,233,235,241,244,245,250,254,257,258,260,261,265,268,269,272,273,275,276,277,278,280,281,283,284,289,291,292,293,295,296,300,301,305,307,308,310,311,312,],[-104,118,-106,135,138,140,-94,143,-79,-111,-32,-90,173,-49,-48,-107,198,-91,-76,209,218,-38,224,225,-9,-57,-33,-37,-36,-31,-21,250,-59,-108,-85,-40,-34,-15,269,275,276,-30,278,-43,284,-60,-52,-25,-56,-16,291,-39,-41,293,-53,-58,-61,-86,300,-42,-54,-63,-35,-55,308,310,-65,-62,312,-64,]),'STEP_TOK':([256,267,285,294,],[274,274,274,274,]),'EXTENDING_TOK':([0,3,6,],[-22,-23,9,]),'ASSERT_TOK':([61,80,143,],[-101,97,-29,]),'INDENT_TOK':([33,37,39,58,59,60,62,77,96,113,122,139,141,145,151,152,157,160,168,194,200,208,213,215,227,232,262,273,287,298,299,303,],[-69,61,-69,75,76,-69,81,93,112,134,-10,-68,158,162,170,171,176,187,-70,222,-70,234,238,239,248,253,279,-67,297,-67,304,306,]),'.':([7,129,155,180,182,184,204,206,207,],[10,147,174,-51,-50,211,230,-51,-50,]),'!':([158,179,181,183,185,193,205,210,214,219,220,233,234,235,238,239,244,253,254,257,258,268,269,272,273,275,276,278,283,284,289,295,296,301,304,307,308,310,312,],[177,-91,-76,-11,177,-38,177,177,-57,-37,-36,-59,177,-108,177,177,-40,177,-11,-11,-11,-11,-60,-52,-25,-56,-16,-39,-53,-58,-61,-54,-63,-55,177,-11,-65,-62,-64,]),'IN_TOK':([44,46,48,49,50,52,53,54,55,56,67,99,103,104,127,129,136,137,146,180,182,],[-78,-75,-74,-89,-80,-88,-81,-116,-20,-84,-100,-117,-121,-120,-66,-87,-118,-119,163,-74,-87,]),'NOTANY_TOK':([112,124,125,128,132,144,150,158,162,170,171,179,181,183,185,189,193,196,197,205,210,214,218,219,220,224,225,233,234,235,238,239,244,245,253,254,257,258,260,268,269,272,273,275,276,278,279,283,284,289,292,295,296,300,301,304,307,308,310,312,],[126,-94,126,-79,126,-111,-32,178,126,126,126,-91,-76,-11,178,126,-38,126,126,178,178,-57,-33,-37,-36,-31,-21,-59,178,-108,178,178,-40,-34,178,-11,-11,-11,-30,-11,-60,-52,-25,-56,-16,-39,126,-53,-58,-61,126,-54,-63,-35,-55,178,-11,-65,-62,-64,]),'WITHOUT_TOK':([17,],[30,]),'*':([43,65,85,88,],[66,66,100,106,]),',':([40,41,44,45,46,47,48,49,50,52,53,54,55,56,57,67,68,69,70,71,82,83,90,99,101,102,103,104,105,136,137,],[-98,63,-78,-87,-75,-96,-74,-89,-80,-88,-81,-116,-20,-84,73,-100,85,-97,-93,88,-115,85,-113,-117,-110,88,-121,-120,-114,-118,-119,]),'BC_EXTRAS_TOK':([11,16,21,140,],[19,-92,-109,-45,]),'CODE_TOK':([75,81,93,148,163,164,176,188,195,222,228,240,248,297,306,],[91,91,91,166,166,166,202,166,166,166,166,166,166,202,202,]),'REQUIRE_TOK':([225,276,],[246,290,]),'PATTERN_VAR_TOK':([32,43,65,66,73,85,88,100,106,111,112,124,125,128,132,144,150,158,162,170,171,177,179,181,183,185,189,192,193,196,197,205,210,211,212,214,218,219,220,224,225,226,230,231,233,234,235,238,239,244,245,253,254,255,257,258,260,266,268,269,271,272,273,275,276,278,279,283,284,289,292,295,296,300,301,304,307,308,310,312,],[48,48,48,48,48,48,48,48,48,48,48,-94,48,-79,48,-111,-32,180,48,48,48,206,-91,-76,-11,180,48,48,-38,48,48,180,180,206,48,-57,-33,-37,-36,-31,-21,48,206,48,-59,180,-108,180,180,-40,-34,180,-11,48,-11,-11,-30,48,-11,-60,286,-52,-25,-56,-16,-39,48,-53,-58,-61,48,-54,-63,-35,-55,180,-11,-65,-62,-64,]),'TRUE_TOK':([32,43,65,73,85,88,111,112,124,125,128,132,144,150,158,162,170,171,179,181,183,185,189,192,193,196,197,205,210,212,214,218,219,220,224,225,226,231,233,234,235,238,239,244,245,253,254,255,257,258,260,266,268,269,272,273,275,276,278,279,283,284,289,292,295,296,300,301,304,307,308,310,312,],[49,49,49,49,49,49,49,49,-94,49,-79,49,-111,-32,49,49,49,49,-91,-76,-11,49,49,49,-38,49,49,49,49,49,-57,-33,-37,-36,-31,-21,49,49,-59,49,-108,49,49,-40,-34,49,-11,49,-11,-11,-30,49,-11,-60,-52,-25,-56,-16,-39,49,-53,-58,-61,49,-54,-63,-35,-55,49,-11,-65,-62,-64,]),'PLAN_EXTRAS_TOK':([11,16,21,22,118,140,],[-99,-92,-109,36,-12,-45,]),':':([12,20,],[23,23,]),'=':([44,46,48,49,50,52,53,54,55,56,67,99,103,104,127,129,136,137,146,180,182,],[-78,-75,-74,-89,-80,-88,-81,-116,-20,-84,-100,-117,-121,-120,-66,-87,-118,-119,164,-74,-87,]),'NOT_NL_TOK':([149,169,175,201,],[-66,195,-66,228,]),'$end':([2,4,5,11,13,14,15,16,21,22,25,26,27,29,35,38,72,118,135,138,140,198,],[0,-1,-2,-99,-95,-46,-6,-92,-109,-103,-4,-46,-112,-77,-47,-5,-3,-12,-13,-14,-45,-28,]),'PYTHON_TOK':([112,124,125,128,131,132,134,144,150,153,154,156,158,162,170,171,172,179,181,183,185,189,193,196,197,205,210,214,218,219,220,224,225,233,234,235,238,239,244,245,253,254,257,258,260,265,268,269,272,273,275,276,278,279,280,283,284,289,292,293,295,296,300,301,304,307,308,310,312,],[-44,-94,-44,-79,149,-44,-44,-111,-32,-90,-44,175,-44,-44,-44,-44,-107,-91,-76,-11,-44,-44,-38,-44,-44,-44,-44,-57,-33,-37,-36,-31,-21,-59,-44,-108,-44,-44,-40,-34,-44,-11,-11,-11,-30,-43,-11,-60,-52,-25,-56,-16,-39,-44,-41,-53,-58,-61,-44,-42,-54,-63,-35,-55,-44,-11,-65,-62,-64,]),'USE_TOK':([61,76,],[78,78,]),'WITH_TOK':([94,109,159,160,209,241,291,],[-104,120,-49,-48,-9,-85,-86,]),'FALSE_TOK':([32,43,65,73,85,88,111,112,124,125,128,132,144,150,158,162,170,171,179,181,183,185,189,192,193,196,197,205,210,212,214,218,219,220,224,225,226,231,233,234,235,238,239,244,245,253,254,255,257,258,260,266,268,269,272,273,275,276,278,279,283,284,289,292,295,296,300,301,304,307,308,310,312,],[52,52,52,52,52,52,52,52,-94,52,-79,52,-111,-32,52,52,52,52,-91,-76,-11,52,52,52,-38,52,52,52,52,52,-57,-33,-37,-36,-31,-21,52,52,-59,52,-108,52,52,-40,-34,52,-11,52,-11,-11,-30,52,-11,-60,-52,-25,-56,-16,-39,52,-53,-58,-61,52,-54,-63,-35,-55,52,-11,-65,-62,-64,]),'CHECK_TOK':([0,112,124,125,128,130,132,144,150,158,162,170,171,179,181,183,185,189,193,196,197,205,210,214,218,219,220,224,225,233,234,235,238,239,244,245,253,254,257,258,260,268,269,272,273,275,276,278,279,283,284,289,292,295,296,300,301,304,307,308,310,312,],[1,-66,-94,-66,-79,148,-66,-111,-32,-66,-66,-66,-66,-91,-76,-11,-66,-66,-38,-66,-66,-66,-66,-57,-33,-37,-36,-31,-21,-59,-66,-108,-66,-66,-40,-34,-66,-11,-11,-11,-30,-11,-60,-52,-25,-56,-16,-39,-66,-53,-58,-61,-66,-54,-63,-35,-55,-66,-11,-65,-62,-64,]),'IDENTIFIER_TOK':([0,1,3,6,8,9,10,11,13,14,16,21,26,27,30,32,42,43,63,65,73,78,85,88,111,112,124,125,128,132,134,135,140,144,147,150,153,154,158,162,170,171,172,174,177,179,181,183,185,189,192,193,196,197,198,205,210,211,212,214,218,219,220,224,225,226,230,231,233,234,235,238,239,244,245,253,254,255,257,258,260,265,266,268,269,272,273,275,276,278,279,280,283,284,289,292,293,295,296,300,301,304,307,308,310,312,],[-22,7,-23,-24,12,17,18,20,-95,12,-92,-109,20,-112,40,45,-7,45,82,45,45,95,45,45,45,129,-94,129,-79,129,155,-13,-45,-111,165,-32,-90,155,182,129,129,129,-107,199,207,-91,-76,-11,182,129,45,-38,129,129,-28,182,182,207,45,-57,-33,-37,-36,-31,-21,45,207,45,-59,182,-108,182,182,-40,-34,182,-11,45,-11,-11,-30,-43,45,-11,-60,-52,-25,-56,-16,-39,129,-41,-53,-58,-61,129,-42,-54,-63,-35,-55,182,-11,-65,-62,-64,]),'NONE_TOK':([32,43,65,73,85,88,111,112,124,125,128,132,144,150,158,162,170,171,179,181,183,185,189,192,193,196,197,205,210,212,214,218,219,220,224,225,226,231,233,234,235,238,239,244,245,253,254,255,257,258,260,266,268,269,272,273,275,276,278,279,283,284,289,292,295,296,300,301,304,307,308,310,312,],[55,55,55,55,55,55,55,55,-94,55,-79,55,-111,-32,55,55,55,55,-91,-76,-11,55,55,55,-38,55,55,55,55,55,-57,-33,-37,-36,-31,-21,55,55,-59,55,-108,55,55,-40,-34,55,-11,55,-11,-11,-30,55,-11,-60,-52,-25,-56,-16,-39,55,-53,-58,-61,55,-54,-63,-35,-55,55,-11,-65,-62,-64,]),'FORALL_TOK':([112,124,125,128,132,144,150,158,162,170,171,179,181,183,185,189,193,196,197,205,210,214,218,219,220,224,225,233,234,235,238,239,244,245,253,254,257,258,260,268,269,272,273,275,276,278,279,283,284,289,292,295,296,300,301,304,307,308,310,312,],[133,-94,133,-79,133,-111,-32,186,133,133,133,-91,-76,-11,186,133,-38,133,133,186,186,-57,-33,-37,-36,-31,-21,-59,186,-108,186,186,-40,-34,186,-11,-11,-11,-30,-11,-60,-52,-25,-56,-16,-39,133,-53,-58,-61,133,-54,-63,-35,-55,186,-11,-65,-62,-64,]),'STRING_TOK':([32,43,65,73,85,88,111,112,124,125,128,132,144,150,158,162,170,171,179,181,183,185,189,192,193,196,197,205,210,212,214,218,219,220,224,225,226,231,233,234,235,238,239,244,245,253,254,255,257,258,260,266,268,269,272,273,275,276,278,279,283,284,289,292,295,296,300,301,304,307,308,310,312,],[56,56,56,56,56,56,56,56,-94,56,-79,56,-111,-32,56,56,56,56,-91,-76,-11,56,56,56,-38,56,56,56,56,56,-57,-33,-37,-36,-31,-21,56,56,-59,56,-108,56,56,-40,-34,56,-11,56,-11,-11,-30,56,-11,-60,-52,-25,-56,-16,-39,56,-53,-58,-61,56,-54,-63,-35,-55,56,-11,-65,-62,-64,]),'WHEN_TOK':([94,159,160,241,291,],[110,-49,-48,-85,-86,]),'FIRST_TOK':([112,124,125,128,132,144,150,158,162,170,171,177,179,181,183,185,189,193,196,197,205,210,214,218,219,220,224,225,233,234,235,238,239,244,245,253,254,257,258,260,268,269,272,273,275,276,278,279,283,284,289,292,295,296,300,301,304,307,308,310,312,],[132,-94,132,-79,132,-111,-32,185,132,132,132,205,-91,-76,-11,185,132,-38,132,132,185,185,-57,-33,-37,-36,-31,-21,-59,185,-108,185,185,-40,-34,185,-11,-11,-11,-30,-11,-60,-52,-25,-56,-16,-39,132,-53,-58,-61,132,-54,-63,-35,-55,185,-11,-65,-62,-64,]),'RP_TOK':([32,43,44,45,46,47,48,49,50,51,52,53,54,55,56,57,65,67,68,69,70,71,73,74,83,84,85,86,87,88,89,90,99,101,102,103,104,105,111,115,116,117,123,136,137,192,212,221,226,231,237,247,252,255,266,270,282,],[-102,67,-78,-87,-75,-96,-74,-89,-80,72,-88,-81,-116,-20,-84,-17,67,-100,-17,-97,-93,-17,-18,-82,-17,99,-18,103,104,-18,-26,-113,-117,-110,-17,-121,-120,-114,-102,136,137,-83,142,-118,-119,-102,-102,242,-102,-102,256,263,267,-102,-102,285,294,]),'FC_EXTRAS_TOK':([13,14,27,198,],[-95,28,-112,-28,]),'NL_TOK':([0,12,17,19,20,23,24,28,31,34,36,40,41,63,64,79,82,91,92,97,98,108,110,120,126,132,133,142,149,166,167,175,178,185,186,190,191,202,203,205,217,223,242,243,246,249,256,259,263,264,267,285,286,288,290,294,302,309,],[3,-19,-105,33,-19,-27,37,39,42,59,60,-98,-17,-18,-8,96,-115,-73,107,113,114,119,122,139,145,151,152,160,168,-71,193,200,208,213,215,219,220,-72,229,232,241,244,260,261,262,265,273,277,280,281,273,273,296,298,299,273,305,311,]),} _lr_action = { } for _k, _v in list(_lr_action_items.items()): for _x,_y in zip(_v[0],_v[1]): if not _x in _lr_action: _lr_action[_x] = { } _lr_action[_x][_k] = _y del _lr_action_items _lr_goto_items = {'inc_plan_vars':([183,254,257,258,268,307,],[210,210,210,210,210,210,]),'when_opt':([94,],[109,]),'bc_rules_opt':([14,26,],[25,38,]),'parent_opt':([6,],[8,]),'fc_extras':([14,],[26,]),'start_extra_statements':([33,39,60,],[58,62,77,]),'bc_rules':([8,14,26,],[11,11,11,]),'file':([0,],[4,]),'fc_premise':([112,125,132,162,170,171,189,196,197,279,292,],[124,144,150,124,124,124,144,144,144,124,144,]),'python_plan_code':([176,297,306,],[203,302,309,]),'bc_require_opt':([276,],[289,]),'plan_spec':([256,267,285,294,],[272,283,295,301,]),'goal':([78,],[94,]),'plan_extras_opt':([22,],[35,]),'pattern':([32,73,88,111,112,125,132,158,162,170,171,185,189,192,196,197,205,210,212,226,231,234,238,239,253,255,266,279,292,304,],[47,90,105,47,127,127,127,127,127,127,127,127,127,47,127,127,127,127,47,47,47,127,127,127,127,47,47,127,127,127,]),'top':([0,],[2,]),'bc_premise':([158,185,205,210,234,238,239,253,304,],[179,214,233,235,179,179,179,179,179,]),'assertion':([134,154,],[153,172,]),'name':([158,177,185,205,210,211,230,234,238,239,253,304,],[184,204,184,184,184,236,251,184,184,184,184,184,]),'data_list':([43,65,],[68,83,]),'start_python_plan_call':([273,298,],[287,303,]),'pattern_proper':([32,43,65,73,85,88,111,112,125,132,158,162,170,171,185,189,192,196,197,205,210,212,226,231,234,238,239,253,255,266,279,292,304,],[50,69,69,50,69,50,50,50,50,50,50,50,50,50,50,50,50,50,50,50,50,50,50,50,50,50,50,50,50,50,50,50,50,]),'python_goal':([0,],[5,]),'without_names':([30,],[41,]),'bc_extras_opt':([11,],[22,]),'start_python_statements':([139,],[157,]),'patterns_opt':([32,111,192,212,226,231,255,266,],[51,123,221,237,247,252,270,282,]),'fc_require_opt':([225,],[245,]),'python_premise':([112,125,132,158,162,170,171,185,189,196,197,205,210,234,238,239,253,279,292,304,],[128,128,128,181,128,128,128,181,128,128,128,181,181,181,181,181,181,128,128,181,]),'with_opt':([109,],[121,]),'variable':([32,43,65,66,73,85,88,100,106,111,112,125,132,158,162,170,171,185,189,192,196,197,205,210,212,226,231,234,238,239,253,255,266,279,292,304,],[53,53,53,84,53,53,53,115,117,53,53,53,53,53,53,53,53,53,53,53,53,53,53,53,53,53,53,53,53,53,53,53,53,53,53,53,]),'fc_rule':([8,14,],[13,27,]),'start_python_code':([112,125,127,132,142,149,158,162,170,171,175,185,187,189,196,197,205,210,234,238,239,253,279,292,304,],[130,130,146,130,161,169,130,130,130,130,201,130,216,130,130,130,130,130,130,130,130,130,130,130,130,]),'bc_premises':([158,234,238,239,253,304,],[183,254,257,258,268,307,]),'data':([32,43,65,73,85,88,111,112,125,132,158,162,170,171,185,189,192,196,197,205,210,212,226,231,234,238,239,253,255,266,279,292,304,],[54,70,70,54,101,54,54,54,54,54,54,54,54,54,54,54,54,54,54,54,54,54,54,54,54,54,54,54,54,54,54,54,54,]),'patterns_proper':([43,65,85,],[71,71,102,]),'check_nl':([112,125,132,134,154,158,162,170,171,185,189,196,197,205,210,234,238,239,253,279,292,304,],[131,131,131,156,156,131,131,131,131,131,131,131,131,131,131,131,131,131,131,131,131,131,]),'rest_opt':([71,102,],[87,116,]),'fc_rules':([8,],[14,]),'bc_rules_section':([8,14,26,],[15,29,29,]),'python_extras_code':([75,81,93,],[92,98,108,]),'nl_opt':([0,],[6,]),'python_rule_code':([148,163,164,188,195,222,228,240,248,],[167,190,191,217,223,243,249,259,264,]),'colon_opt':([12,20,],[24,34,]),'fc_premises':([112,162,170,171,279,],[125,189,196,197,292,]),'patterns':([32,111,192,212,226,231,255,266,],[57,57,57,57,57,57,57,57,]),'comma_opt':([41,57,68,71,83,102,],[64,74,86,89,86,89,]),'reset_plan_vars':([122,],[141,]),'taking':([142,],[159,]),'without_opt':([17,],[31,]),'foreach_opt':([61,],[80,]),'bc_rule':([8,11,14,26,],[16,21,16,16,]),'start_python_assertion':([168,200,],[194,227,]),'assertions':([134,],[154,]),} _lr_goto = { } for _k, _v in list(_lr_goto_items.items()): for _x,_y in zip(_v[0],_v[1]): if not _x in _lr_goto: _lr_goto[_x] = { } _lr_goto[_x][_k] = _y del _lr_goto_items _lr_productions = [ ("S' -> top","S'",1,None,None,None), ('top -> file','top',1,'p_top','/home/bruce/python/workareas/pyke-hg/r1_working/pyke/krb_compiler/krbparser.py',40), ('top -> python_goal','top',1,'p_top','/home/bruce/python/workareas/pyke-hg/r1_working/pyke/krb_compiler/krbparser.py',41), ('python_goal -> CHECK_TOK IDENTIFIER_TOK . IDENTIFIER_TOK LP_TOK patterns_opt RP_TOK','python_goal',7,'p_goal','/home/bruce/python/workareas/pyke-hg/r1_working/pyke/krb_compiler/krbparser.py',46), ('file -> nl_opt parent_opt fc_rules bc_rules_opt','file',4,'p_file','/home/bruce/python/workareas/pyke-hg/r1_working/pyke/krb_compiler/krbparser.py',51), ('file -> nl_opt parent_opt fc_rules fc_extras bc_rules_opt','file',5,'p_file_fc_extras','/home/bruce/python/workareas/pyke-hg/r1_working/pyke/krb_compiler/krbparser.py',56), ('file -> nl_opt parent_opt bc_rules_section','file',3,'p_file_bc','/home/bruce/python/workareas/pyke-hg/r1_working/pyke/krb_compiler/krbparser.py',61), ('parent_opt -> EXTENDING_TOK IDENTIFIER_TOK without_opt NL_TOK','parent_opt',4,'p_parent','/home/bruce/python/workareas/pyke-hg/r1_working/pyke/krb_compiler/krbparser.py',72), ('without_opt -> WITHOUT_TOK without_names comma_opt','without_opt',3,'p_second','/home/bruce/python/workareas/pyke-hg/r1_working/pyke/krb_compiler/krbparser.py',77), ('when_opt -> WHEN_TOK NL_TOK reset_plan_vars INDENT_TOK bc_premises DEINDENT_TOK','when_opt',6,'p_fourth','/home/bruce/python/workareas/pyke-hg/r1_working/pyke/krb_compiler/krbparser.py',82), ('reset_plan_vars -> <empty>','reset_plan_vars',0,'p_reset_plan_vars','/home/bruce/python/workareas/pyke-hg/r1_working/pyke/krb_compiler/krbparser.py',87), ('inc_plan_vars -> <empty>','inc_plan_vars',0,'p_inc_plan_vars','/home/bruce/python/workareas/pyke-hg/r1_working/pyke/krb_compiler/krbparser.py',95), ('bc_extras_opt -> BC_EXTRAS_TOK NL_TOK start_extra_statements INDENT_TOK python_extras_code NL_TOK DEINDENT_TOK','bc_extras_opt',7,'p_fifth','/home/bruce/python/workareas/pyke-hg/r1_working/pyke/krb_compiler/krbparser.py',103), ('fc_extras -> FC_EXTRAS_TOK NL_TOK start_extra_statements INDENT_TOK python_extras_code NL_TOK DEINDENT_TOK','fc_extras',7,'p_fifth','/home/bruce/python/workareas/pyke-hg/r1_working/pyke/krb_compiler/krbparser.py',104), ('plan_extras_opt -> PLAN_EXTRAS_TOK NL_TOK start_extra_statements INDENT_TOK python_extras_code NL_TOK DEINDENT_TOK','plan_extras_opt',7,'p_fifth','/home/bruce/python/workareas/pyke-hg/r1_working/pyke/krb_compiler/krbparser.py',105), ('with_opt -> WITH_TOK NL_TOK start_python_statements INDENT_TOK python_plan_code NL_TOK DEINDENT_TOK','with_opt',7,'p_fifth','/home/bruce/python/workareas/pyke-hg/r1_working/pyke/krb_compiler/krbparser.py',106), ('bc_require_opt -> <empty>','bc_require_opt',0,'p_none','/home/bruce/python/workareas/pyke-hg/r1_working/pyke/krb_compiler/krbparser.py',111), ('comma_opt -> <empty>','comma_opt',0,'p_none','/home/bruce/python/workareas/pyke-hg/r1_working/pyke/krb_compiler/krbparser.py',112), ('comma_opt -> ,','comma_opt',1,'p_none','/home/bruce/python/workareas/pyke-hg/r1_working/pyke/krb_compiler/krbparser.py',113), ('colon_opt -> <empty>','colon_opt',0,'p_none','/home/bruce/python/workareas/pyke-hg/r1_working/pyke/krb_compiler/krbparser.py',114), ('data -> NONE_TOK','data',1,'p_none','/home/bruce/python/workareas/pyke-hg/r1_working/pyke/krb_compiler/krbparser.py',115), ('fc_require_opt -> <empty>','fc_require_opt',0,'p_none','/home/bruce/python/workareas/pyke-hg/r1_working/pyke/krb_compiler/krbparser.py',116), ('nl_opt -> <empty>','nl_opt',0,'p_none','/home/bruce/python/workareas/pyke-hg/r1_working/pyke/krb_compiler/krbparser.py',117), ('nl_opt -> NL_TOK','nl_opt',1,'p_none','/home/bruce/python/workareas/pyke-hg/r1_working/pyke/krb_compiler/krbparser.py',118), ('parent_opt -> <empty>','parent_opt',0,'p_none','/home/bruce/python/workareas/pyke-hg/r1_working/pyke/krb_compiler/krbparser.py',119), ('plan_spec -> NL_TOK','plan_spec',1,'p_none','/home/bruce/python/workareas/pyke-hg/r1_working/pyke/krb_compiler/krbparser.py',120), ('rest_opt -> comma_opt','rest_opt',1,'p_none','/home/bruce/python/workareas/pyke-hg/r1_working/pyke/krb_compiler/krbparser.py',121), ('colon_opt -> :','colon_opt',1,'p_colon_deprication','/home/bruce/python/workareas/pyke-hg/r1_working/pyke/krb_compiler/krbparser.py',126), ('fc_rule -> IDENTIFIER_TOK colon_opt NL_TOK INDENT_TOK foreach_opt ASSERT_TOK NL_TOK INDENT_TOK assertions DEINDENT_TOK DEINDENT_TOK','fc_rule',11,'p_fc_rule','/home/bruce/python/workareas/pyke-hg/r1_working/pyke/krb_compiler/krbparser.py',134), ('foreach_opt -> FOREACH_TOK NL_TOK INDENT_TOK fc_premises DEINDENT_TOK','foreach_opt',5,'p_foreach','/home/bruce/python/workareas/pyke-hg/r1_working/pyke/krb_compiler/krbparser.py',139), ('fc_premise -> IDENTIFIER_TOK . IDENTIFIER_TOK LP_TOK patterns_opt RP_TOK NL_TOK','fc_premise',7,'p_fc_premise','/home/bruce/python/workareas/pyke-hg/r1_working/pyke/krb_compiler/krbparser.py',144), ('fc_premise -> FIRST_TOK NL_TOK INDENT_TOK fc_premises DEINDENT_TOK','fc_premise',5,'p_fc_first_1','/home/bruce/python/workareas/pyke-hg/r1_working/pyke/krb_compiler/krbparser.py',149), ('fc_premise -> FIRST_TOK fc_premise','fc_premise',2,'p_fc_first_n','/home/bruce/python/workareas/pyke-hg/r1_working/pyke/krb_compiler/krbparser.py',154), ('fc_premise -> NOTANY_TOK NL_TOK INDENT_TOK fc_premises DEINDENT_TOK','fc_premise',5,'p_fc_notany','/home/bruce/python/workareas/pyke-hg/r1_working/pyke/krb_compiler/krbparser.py',159), ('fc_premise -> FORALL_TOK NL_TOK INDENT_TOK fc_premises DEINDENT_TOK fc_require_opt','fc_premise',6,'p_fc_forall','/home/bruce/python/workareas/pyke-hg/r1_working/pyke/krb_compiler/krbparser.py',164), ('fc_require_opt -> REQUIRE_TOK NL_TOK INDENT_TOK fc_premises DEINDENT_TOK','fc_require_opt',5,'p_fc_require_opt','/home/bruce/python/workareas/pyke-hg/r1_working/pyke/krb_compiler/krbparser.py',169), ('python_premise -> pattern start_python_code = python_rule_code NL_TOK','python_premise',5,'p_python_eq','/home/bruce/python/workareas/pyke-hg/r1_working/pyke/krb_compiler/krbparser.py',174), ('python_premise -> pattern start_python_code IN_TOK python_rule_code NL_TOK','python_premise',5,'p_python_in','/home/bruce/python/workareas/pyke-hg/r1_working/pyke/krb_compiler/krbparser.py',179), ('python_premise -> start_python_code CHECK_TOK python_rule_code NL_TOK','python_premise',4,'p_python_check','/home/bruce/python/workareas/pyke-hg/r1_working/pyke/krb_compiler/krbparser.py',184), ('python_premise -> check_nl PYTHON_TOK NL_TOK start_python_assertion INDENT_TOK python_rule_code NL_TOK DEINDENT_TOK','python_premise',8,'p_python_block_n','/home/bruce/python/workareas/pyke-hg/r1_working/pyke/krb_compiler/krbparser.py',189), ('python_premise -> check_nl PYTHON_TOK start_python_code NOT_NL_TOK python_rule_code NL_TOK','python_premise',6,'p_python_block_1','/home/bruce/python/workareas/pyke-hg/r1_working/pyke/krb_compiler/krbparser.py',194), ('assertion -> IDENTIFIER_TOK . IDENTIFIER_TOK LP_TOK patterns_opt RP_TOK NL_TOK','assertion',7,'p_assertion','/home/bruce/python/workareas/pyke-hg/r1_working/pyke/krb_compiler/krbparser.py',199), ('assertion -> check_nl PYTHON_TOK NL_TOK start_python_assertion INDENT_TOK python_rule_code NL_TOK DEINDENT_TOK','assertion',8,'p_python_assertion_n','/home/bruce/python/workareas/pyke-hg/r1_working/pyke/krb_compiler/krbparser.py',204), ('assertion -> check_nl PYTHON_TOK start_python_code NOT_NL_TOK python_rule_code NL_TOK','assertion',6,'p_python_assertion_1','/home/bruce/python/workareas/pyke-hg/r1_working/pyke/krb_compiler/krbparser.py',209), ('check_nl -> <empty>','check_nl',0,'p_check_nl','/home/bruce/python/workareas/pyke-hg/r1_working/pyke/krb_compiler/krbparser.py',214), ('bc_rule -> IDENTIFIER_TOK colon_opt NL_TOK INDENT_TOK USE_TOK goal when_opt with_opt DEINDENT_TOK','bc_rule',9,'p_bc_rule','/home/bruce/python/workareas/pyke-hg/r1_working/pyke/krb_compiler/krbparser.py',220), ('bc_rules_opt -> <empty>','bc_rules_opt',0,'p_empty_bc_rules_opt','/home/bruce/python/workareas/pyke-hg/r1_working/pyke/krb_compiler/krbparser.py',225), ('bc_rules_section -> bc_rules bc_extras_opt plan_extras_opt','bc_rules_section',3,'p_bc_rules_section','/home/bruce/python/workareas/pyke-hg/r1_working/pyke/krb_compiler/krbparser.py',230), ('goal -> IDENTIFIER_TOK LP_TOK patterns_opt RP_TOK NL_TOK','goal',5,'p_goal_no_taking','/home/bruce/python/workareas/pyke-hg/r1_working/pyke/krb_compiler/krbparser.py',235), ('goal -> IDENTIFIER_TOK LP_TOK patterns_opt RP_TOK taking','goal',5,'p_goal_taking','/home/bruce/python/workareas/pyke-hg/r1_working/pyke/krb_compiler/krbparser.py',240), ('name -> IDENTIFIER_TOK','name',1,'p_name_sym','/home/bruce/python/workareas/pyke-hg/r1_working/pyke/krb_compiler/krbparser.py',245), ('name -> PATTERN_VAR_TOK','name',1,'p_name_pat_var','/home/bruce/python/workareas/pyke-hg/r1_working/pyke/krb_compiler/krbparser.py',250), ('bc_premise -> name LP_TOK patterns_opt RP_TOK plan_spec','bc_premise',5,'p_bc_premise1','/home/bruce/python/workareas/pyke-hg/r1_working/pyke/krb_compiler/krbparser.py',255), ('bc_premise -> ! name LP_TOK patterns_opt RP_TOK plan_spec','bc_premise',6,'p_bc_premise2','/home/bruce/python/workareas/pyke-hg/r1_working/pyke/krb_compiler/krbparser.py',261), ('bc_premise -> name . name LP_TOK patterns_opt RP_TOK plan_spec','bc_premise',7,'p_bc_premise3','/home/bruce/python/workareas/pyke-hg/r1_working/pyke/krb_compiler/krbparser.py',267), ('bc_premise -> ! name . name LP_TOK patterns_opt RP_TOK plan_spec','bc_premise',8,'p_bc_premise4','/home/bruce/python/workareas/pyke-hg/r1_working/pyke/krb_compiler/krbparser.py',273), ('bc_premise -> FIRST_TOK NL_TOK INDENT_TOK bc_premises DEINDENT_TOK','bc_premise',5,'p_bc_first_1f','/home/bruce/python/workareas/pyke-hg/r1_working/pyke/krb_compiler/krbparser.py',279), ('bc_premise -> FIRST_TOK bc_premise','bc_premise',2,'p_bc_first_nf','/home/bruce/python/workareas/pyke-hg/r1_working/pyke/krb_compiler/krbparser.py',284), ('bc_premise -> ! FIRST_TOK NL_TOK INDENT_TOK bc_premises DEINDENT_TOK','bc_premise',6,'p_bc_first_1t','/home/bruce/python/workareas/pyke-hg/r1_working/pyke/krb_compiler/krbparser.py',289), ('bc_premise -> ! FIRST_TOK bc_premise','bc_premise',3,'p_bc_first_nt','/home/bruce/python/workareas/pyke-hg/r1_working/pyke/krb_compiler/krbparser.py',294), ('bc_premise -> NOTANY_TOK NL_TOK INDENT_TOK bc_premises DEINDENT_TOK','bc_premise',5,'p_bc_notany','/home/bruce/python/workareas/pyke-hg/r1_working/pyke/krb_compiler/krbparser.py',299), ('bc_premise -> FORALL_TOK NL_TOK INDENT_TOK bc_premises DEINDENT_TOK bc_require_opt','bc_premise',6,'p_bc_forall','/home/bruce/python/workareas/pyke-hg/r1_working/pyke/krb_compiler/krbparser.py',304), ('bc_require_opt -> REQUIRE_TOK NL_TOK INDENT_TOK bc_premises DEINDENT_TOK','bc_require_opt',5,'p_bc_require_opt','/home/bruce/python/workareas/pyke-hg/r1_working/pyke/krb_compiler/krbparser.py',309), ('plan_spec -> AS_TOK PATTERN_VAR_TOK NL_TOK','plan_spec',3,'p_as','/home/bruce/python/workareas/pyke-hg/r1_working/pyke/krb_compiler/krbparser.py',314), ('plan_spec -> STEP_TOK NUMBER_TOK NL_TOK start_python_plan_call INDENT_TOK python_plan_code NL_TOK DEINDENT_TOK','plan_spec',8,'p_step_code','/home/bruce/python/workareas/pyke-hg/r1_working/pyke/krb_compiler/krbparser.py',319), ('plan_spec -> NL_TOK start_python_plan_call INDENT_TOK python_plan_code NL_TOK DEINDENT_TOK','plan_spec',6,'p_code','/home/bruce/python/workareas/pyke-hg/r1_working/pyke/krb_compiler/krbparser.py',325), ('start_python_code -> <empty>','start_python_code',0,'p_start_python_code','/home/bruce/python/workareas/pyke-hg/r1_working/pyke/krb_compiler/krbparser.py',330), ('start_python_plan_call -> <empty>','start_python_plan_call',0,'p_start_python_plan_call','/home/bruce/python/workareas/pyke-hg/r1_working/pyke/krb_compiler/krbparser.py',336), ('start_python_statements -> <empty>','start_python_statements',0,'p_start_python_statements','/home/bruce/python/workareas/pyke-hg/r1_working/pyke/krb_compiler/krbparser.py',342), ('start_extra_statements -> <empty>','start_extra_statements',0,'p_start_extra_statements','/home/bruce/python/workareas/pyke-hg/r1_working/pyke/krb_compiler/krbparser.py',348), ('start_python_assertion -> <empty>','start_python_assertion',0,'p_start_python_assertion','/home/bruce/python/workareas/pyke-hg/r1_working/pyke/krb_compiler/krbparser.py',354), ('python_rule_code -> CODE_TOK','python_rule_code',1,'p_python_rule_code','/home/bruce/python/workareas/pyke-hg/r1_working/pyke/krb_compiler/krbparser.py',361), ('python_plan_code -> CODE_TOK','python_plan_code',1,'p_python_plan_code','/home/bruce/python/workareas/pyke-hg/r1_working/pyke/krb_compiler/krbparser.py',366), ('python_extras_code -> CODE_TOK','python_extras_code',1,'p_python_extras_code','/home/bruce/python/workareas/pyke-hg/r1_working/pyke/krb_compiler/krbparser.py',371), ('variable -> PATTERN_VAR_TOK','variable',1,'p_pattern_var','/home/bruce/python/workareas/pyke-hg/r1_working/pyke/krb_compiler/krbparser.py',376), ('variable -> ANONYMOUS_VAR_TOK','variable',1,'p_anonymous_var','/home/bruce/python/workareas/pyke-hg/r1_working/pyke/krb_compiler/krbparser.py',386), ('bc_premise -> python_premise','bc_premise',1,'p_first','/home/bruce/python/workareas/pyke-hg/r1_working/pyke/krb_compiler/krbparser.py',394), ('bc_rules_opt -> bc_rules_section','bc_rules_opt',1,'p_first','/home/bruce/python/workareas/pyke-hg/r1_working/pyke/krb_compiler/krbparser.py',395), ('data -> NUMBER_TOK','data',1,'p_first','/home/bruce/python/workareas/pyke-hg/r1_working/pyke/krb_compiler/krbparser.py',396), ('fc_premise -> python_premise','fc_premise',1,'p_first','/home/bruce/python/workareas/pyke-hg/r1_working/pyke/krb_compiler/krbparser.py',397), ('pattern -> pattern_proper','pattern',1,'p_first','/home/bruce/python/workareas/pyke-hg/r1_working/pyke/krb_compiler/krbparser.py',398), ('pattern_proper -> variable','pattern_proper',1,'p_first','/home/bruce/python/workareas/pyke-hg/r1_working/pyke/krb_compiler/krbparser.py',399), ('patterns_opt -> patterns comma_opt','patterns_opt',2,'p_first','/home/bruce/python/workareas/pyke-hg/r1_working/pyke/krb_compiler/krbparser.py',400), ('rest_opt -> , * variable','rest_opt',3,'p_last','/home/bruce/python/workareas/pyke-hg/r1_working/pyke/krb_compiler/krbparser.py',405), ('data -> STRING_TOK','data',1,'p_data_string','/home/bruce/python/workareas/pyke-hg/r1_working/pyke/krb_compiler/krbparser.py',410), ('taking -> start_python_code TAKING_TOK python_rule_code NL_TOK','taking',4,'p_taking','/home/bruce/python/workareas/pyke-hg/r1_working/pyke/krb_compiler/krbparser.py',421), ('taking -> NL_TOK INDENT_TOK start_python_code TAKING_TOK python_rule_code NL_TOK DEINDENT_TOK','taking',7,'p_taking2','/home/bruce/python/workareas/pyke-hg/r1_working/pyke/krb_compiler/krbparser.py',426), ('data -> IDENTIFIER_TOK','data',1,'p_quoted_last','/home/bruce/python/workareas/pyke-hg/r1_working/pyke/krb_compiler/krbparser.py',431), ('data -> FALSE_TOK','data',1,'p_false','/home/bruce/python/workareas/pyke-hg/r1_working/pyke/krb_compiler/krbparser.py',439), ('data -> TRUE_TOK','data',1,'p_true','/home/bruce/python/workareas/pyke-hg/r1_working/pyke/krb_compiler/krbparser.py',444), ('assertions -> assertion','assertions',1,'p_start_list','/home/bruce/python/workareas/pyke-hg/r1_working/pyke/krb_compiler/krbparser.py',449), ('bc_premises -> bc_premise','bc_premises',1,'p_start_list','/home/bruce/python/workareas/pyke-hg/r1_working/pyke/krb_compiler/krbparser.py',450), ('bc_rules -> bc_rule','bc_rules',1,'p_start_list','/home/bruce/python/workareas/pyke-hg/r1_working/pyke/krb_compiler/krbparser.py',451), ('data_list -> data','data_list',1,'p_start_list','/home/bruce/python/workareas/pyke-hg/r1_working/pyke/krb_compiler/krbparser.py',452), ('fc_premises -> fc_premise','fc_premises',1,'p_start_list','/home/bruce/python/workareas/pyke-hg/r1_working/pyke/krb_compiler/krbparser.py',453), ('fc_rules -> fc_rule','fc_rules',1,'p_start_list','/home/bruce/python/workareas/pyke-hg/r1_working/pyke/krb_compiler/krbparser.py',454), ('patterns -> pattern','patterns',1,'p_start_list','/home/bruce/python/workareas/pyke-hg/r1_working/pyke/krb_compiler/krbparser.py',455), ('patterns_proper -> pattern_proper','patterns_proper',1,'p_start_list','/home/bruce/python/workareas/pyke-hg/r1_working/pyke/krb_compiler/krbparser.py',456), ('without_names -> IDENTIFIER_TOK','without_names',1,'p_start_list','/home/bruce/python/workareas/pyke-hg/r1_working/pyke/krb_compiler/krbparser.py',457), ('bc_extras_opt -> <empty>','bc_extras_opt',0,'p_empty_tuple','/home/bruce/python/workareas/pyke-hg/r1_working/pyke/krb_compiler/krbparser.py',462), ('data -> LP_TOK RP_TOK','data',2,'p_empty_tuple','/home/bruce/python/workareas/pyke-hg/r1_working/pyke/krb_compiler/krbparser.py',463), ('foreach_opt -> <empty>','foreach_opt',0,'p_empty_tuple','/home/bruce/python/workareas/pyke-hg/r1_working/pyke/krb_compiler/krbparser.py',464), ('patterns_opt -> <empty>','patterns_opt',0,'p_empty_tuple','/home/bruce/python/workareas/pyke-hg/r1_working/pyke/krb_compiler/krbparser.py',465), ('plan_extras_opt -> <empty>','plan_extras_opt',0,'p_empty_tuple','/home/bruce/python/workareas/pyke-hg/r1_working/pyke/krb_compiler/krbparser.py',466), ('when_opt -> <empty>','when_opt',0,'p_empty_tuple','/home/bruce/python/workareas/pyke-hg/r1_working/pyke/krb_compiler/krbparser.py',467), ('without_opt -> <empty>','without_opt',0,'p_empty_tuple','/home/bruce/python/workareas/pyke-hg/r1_working/pyke/krb_compiler/krbparser.py',468), ('with_opt -> <empty>','with_opt',0,'p_double_empty_tuple','/home/bruce/python/workareas/pyke-hg/r1_working/pyke/krb_compiler/krbparser.py',473), ('assertions -> assertions assertion','assertions',2,'p_append_list','/home/bruce/python/workareas/pyke-hg/r1_working/pyke/krb_compiler/krbparser.py',478), ('bc_premises -> bc_premises inc_plan_vars bc_premise','bc_premises',3,'p_append_list','/home/bruce/python/workareas/pyke-hg/r1_working/pyke/krb_compiler/krbparser.py',479), ('bc_rules -> bc_rules bc_rule','bc_rules',2,'p_append_list','/home/bruce/python/workareas/pyke-hg/r1_working/pyke/krb_compiler/krbparser.py',480), ('data_list -> data_list , data','data_list',3,'p_append_list','/home/bruce/python/workareas/pyke-hg/r1_working/pyke/krb_compiler/krbparser.py',481), ('fc_premises -> fc_premises fc_premise','fc_premises',2,'p_append_list','/home/bruce/python/workareas/pyke-hg/r1_working/pyke/krb_compiler/krbparser.py',482), ('fc_rules -> fc_rules fc_rule','fc_rules',2,'p_append_list','/home/bruce/python/workareas/pyke-hg/r1_working/pyke/krb_compiler/krbparser.py',483), ('patterns -> patterns , pattern','patterns',3,'p_append_list','/home/bruce/python/workareas/pyke-hg/r1_working/pyke/krb_compiler/krbparser.py',484), ('patterns_proper -> patterns_proper , pattern','patterns_proper',3,'p_append_list','/home/bruce/python/workareas/pyke-hg/r1_working/pyke/krb_compiler/krbparser.py',485), ('without_names -> without_names , IDENTIFIER_TOK','without_names',3,'p_append_list','/home/bruce/python/workareas/pyke-hg/r1_working/pyke/krb_compiler/krbparser.py',486), ('pattern -> data','pattern',1,'p_pattern','/home/bruce/python/workareas/pyke-hg/r1_working/pyke/krb_compiler/krbparser.py',492), ('pattern_proper -> LP_TOK * variable RP_TOK','pattern_proper',4,'p_pattern_tuple1','/home/bruce/python/workareas/pyke-hg/r1_working/pyke/krb_compiler/krbparser.py',499), ('pattern_proper -> LP_TOK data_list , * variable RP_TOK','pattern_proper',6,'p_pattern_tuple2','/home/bruce/python/workareas/pyke-hg/r1_working/pyke/krb_compiler/krbparser.py',506), ('pattern_proper -> LP_TOK data_list , patterns_proper rest_opt RP_TOK','pattern_proper',6,'p_pattern_tuple3','/home/bruce/python/workareas/pyke-hg/r1_working/pyke/krb_compiler/krbparser.py',518), ('pattern_proper -> LP_TOK patterns_proper rest_opt RP_TOK','pattern_proper',4,'p_pattern_tuple4','/home/bruce/python/workareas/pyke-hg/r1_working/pyke/krb_compiler/krbparser.py',534), ('data -> LP_TOK data_list comma_opt RP_TOK','data',4,'p_tuple','/home/bruce/python/workareas/pyke-hg/r1_working/pyke/krb_compiler/krbparser.py',543), ]
_tabversion = '3.2' _lr_method = 'LALR' _lr_signature = '`£O\x17ÖCÔE2µö0wIMÙ' _lr_action_items = {'TAKING_TOK': ([142, 161, 187, 216], [-66, 188, -66, 240]), 'LP_TOK': ([18, 32, 43, 65, 73, 85, 88, 95, 111, 112, 124, 125, 128, 132, 144, 150, 158, 162, 165, 170, 171, 179, 180, 181, 182, 183, 184, 185, 189, 192, 193, 196, 197, 199, 204, 205, 206, 207, 210, 212, 214, 218, 219, 220, 224, 225, 226, 231, 233, 234, 235, 236, 238, 239, 244, 245, 251, 253, 254, 255, 257, 258, 260, 266, 268, 269, 272, 273, 275, 276, 278, 279, 283, 284, 289, 292, 295, 296, 300, 301, 304, 307, 308, 310, 312], [32, 43, 65, 65, 43, 65, 43, 111, 43, 43, -94, 43, -79, 43, -111, -32, 43, 43, 192, 43, 43, -91, -51, -76, -50, -11, 212, 43, 43, 43, -38, 43, 43, 226, 231, 43, -51, -50, 43, 43, -57, -33, -37, -36, -31, -21, 43, 43, -59, 43, -108, 255, 43, 43, -40, -34, 266, 43, -11, 43, -11, -11, -30, 43, -11, -60, -52, -25, -56, -16, -39, 43, -53, -58, -61, 43, -54, -63, -35, -55, 43, -11, -65, -62, -64]), 'FOREACH_TOK': ([61], [79]), 'AS_TOK': ([256, 267, 285, 294], [271, 271, 271, 271]), 'ANONYMOUS_VAR_TOK': ([32, 43, 65, 66, 73, 85, 88, 100, 106, 111, 112, 124, 125, 128, 132, 144, 150, 158, 162, 170, 171, 179, 181, 183, 185, 189, 192, 193, 196, 197, 205, 210, 212, 214, 218, 219, 220, 224, 225, 226, 231, 233, 234, 235, 238, 239, 244, 245, 253, 254, 255, 257, 258, 260, 266, 268, 269, 272, 273, 275, 276, 278, 279, 283, 284, 289, 292, 295, 296, 300, 301, 304, 307, 308, 310, 312], [46, 46, 46, 46, 46, 46, 46, 46, 46, 46, 46, -94, 46, -79, 46, -111, -32, 46, 46, 46, 46, -91, -76, -11, 46, 46, 46, -38, 46, 46, 46, 46, 46, -57, -33, -37, -36, -31, -21, 46, 46, -59, 46, -108, 46, 46, -40, -34, 46, -11, 46, -11, -11, -30, 46, -11, -60, -52, -25, -56, -16, -39, 46, -53, -58, -61, 46, -54, -63, -35, -55, 46, -11, -65, -62, -64]), 'NUMBER_TOK': ([32, 43, 65, 73, 85, 88, 111, 112, 124, 125, 128, 132, 144, 150, 158, 162, 170, 171, 179, 181, 183, 185, 189, 192, 193, 196, 197, 205, 210, 212, 214, 218, 219, 220, 224, 225, 226, 231, 233, 234, 235, 238, 239, 244, 245, 253, 254, 255, 257, 258, 260, 266, 268, 269, 272, 273, 274, 275, 276, 278, 279, 283, 284, 289, 292, 295, 296, 300, 301, 304, 307, 308, 310, 312], [44, 44, 44, 44, 44, 44, 44, 44, -94, 44, -79, 44, -111, -32, 44, 44, 44, 44, -91, -76, -11, 44, 44, 44, -38, 44, 44, 44, 44, 44, -57, -33, -37, -36, -31, -21, 44, 44, -59, 44, -108, 44, 44, -40, -34, 44, -11, 44, -11, -11, -30, 44, -11, -60, -52, -25, 288, -56, -16, -39, 44, -53, -58, -61, 44, -54, -63, -35, -55, 44, -11, -65, -62, -64]), 'DEINDENT_TOK': ([94, 107, 109, 114, 119, 121, 124, 125, 128, 144, 150, 153, 154, 159, 160, 172, 173, 179, 181, 183, 189, 193, 196, 197, 209, 214, 218, 219, 220, 224, 225, 229, 233, 235, 241, 244, 245, 250, 254, 257, 258, 260, 261, 265, 268, 269, 272, 273, 275, 276, 277, 278, 280, 281, 283, 284, 289, 291, 292, 293, 295, 296, 300, 301, 305, 307, 308, 310, 311, 312], [-104, 118, -106, 135, 138, 140, -94, 143, -79, -111, -32, -90, 173, -49, -48, -107, 198, -91, -76, 209, 218, -38, 224, 225, -9, -57, -33, -37, -36, -31, -21, 250, -59, -108, -85, -40, -34, -15, 269, 275, 276, -30, 278, -43, 284, -60, -52, -25, -56, -16, 291, -39, -41, 293, -53, -58, -61, -86, 300, -42, -54, -63, -35, -55, 308, 310, -65, -62, 312, -64]), 'STEP_TOK': ([256, 267, 285, 294], [274, 274, 274, 274]), 'EXTENDING_TOK': ([0, 3, 6], [-22, -23, 9]), 'ASSERT_TOK': ([61, 80, 143], [-101, 97, -29]), 'INDENT_TOK': ([33, 37, 39, 58, 59, 60, 62, 77, 96, 113, 122, 139, 141, 145, 151, 152, 157, 160, 168, 194, 200, 208, 213, 215, 227, 232, 262, 273, 287, 298, 299, 303], [-69, 61, -69, 75, 76, -69, 81, 93, 112, 134, -10, -68, 158, 162, 170, 171, 176, 187, -70, 222, -70, 234, 238, 239, 248, 253, 279, -67, 297, -67, 304, 306]), '.': ([7, 129, 155, 180, 182, 184, 204, 206, 207], [10, 147, 174, -51, -50, 211, 230, -51, -50]), '!': ([158, 179, 181, 183, 185, 193, 205, 210, 214, 219, 220, 233, 234, 235, 238, 239, 244, 253, 254, 257, 258, 268, 269, 272, 273, 275, 276, 278, 283, 284, 289, 295, 296, 301, 304, 307, 308, 310, 312], [177, -91, -76, -11, 177, -38, 177, 177, -57, -37, -36, -59, 177, -108, 177, 177, -40, 177, -11, -11, -11, -11, -60, -52, -25, -56, -16, -39, -53, -58, -61, -54, -63, -55, 177, -11, -65, -62, -64]), 'IN_TOK': ([44, 46, 48, 49, 50, 52, 53, 54, 55, 56, 67, 99, 103, 104, 127, 129, 136, 137, 146, 180, 182], [-78, -75, -74, -89, -80, -88, -81, -116, -20, -84, -100, -117, -121, -120, -66, -87, -118, -119, 163, -74, -87]), 'NOTANY_TOK': ([112, 124, 125, 128, 132, 144, 150, 158, 162, 170, 171, 179, 181, 183, 185, 189, 193, 196, 197, 205, 210, 214, 218, 219, 220, 224, 225, 233, 234, 235, 238, 239, 244, 245, 253, 254, 257, 258, 260, 268, 269, 272, 273, 275, 276, 278, 279, 283, 284, 289, 292, 295, 296, 300, 301, 304, 307, 308, 310, 312], [126, -94, 126, -79, 126, -111, -32, 178, 126, 126, 126, -91, -76, -11, 178, 126, -38, 126, 126, 178, 178, -57, -33, -37, -36, -31, -21, -59, 178, -108, 178, 178, -40, -34, 178, -11, -11, -11, -30, -11, -60, -52, -25, -56, -16, -39, 126, -53, -58, -61, 126, -54, -63, -35, -55, 178, -11, -65, -62, -64]), 'WITHOUT_TOK': ([17], [30]), '*': ([43, 65, 85, 88], [66, 66, 100, 106]), ',': ([40, 41, 44, 45, 46, 47, 48, 49, 50, 52, 53, 54, 55, 56, 57, 67, 68, 69, 70, 71, 82, 83, 90, 99, 101, 102, 103, 104, 105, 136, 137], [-98, 63, -78, -87, -75, -96, -74, -89, -80, -88, -81, -116, -20, -84, 73, -100, 85, -97, -93, 88, -115, 85, -113, -117, -110, 88, -121, -120, -114, -118, -119]), 'BC_EXTRAS_TOK': ([11, 16, 21, 140], [19, -92, -109, -45]), 'CODE_TOK': ([75, 81, 93, 148, 163, 164, 176, 188, 195, 222, 228, 240, 248, 297, 306], [91, 91, 91, 166, 166, 166, 202, 166, 166, 166, 166, 166, 166, 202, 202]), 'REQUIRE_TOK': ([225, 276], [246, 290]), 'PATTERN_VAR_TOK': ([32, 43, 65, 66, 73, 85, 88, 100, 106, 111, 112, 124, 125, 128, 132, 144, 150, 158, 162, 170, 171, 177, 179, 181, 183, 185, 189, 192, 193, 196, 197, 205, 210, 211, 212, 214, 218, 219, 220, 224, 225, 226, 230, 231, 233, 234, 235, 238, 239, 244, 245, 253, 254, 255, 257, 258, 260, 266, 268, 269, 271, 272, 273, 275, 276, 278, 279, 283, 284, 289, 292, 295, 296, 300, 301, 304, 307, 308, 310, 312], [48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, -94, 48, -79, 48, -111, -32, 180, 48, 48, 48, 206, -91, -76, -11, 180, 48, 48, -38, 48, 48, 180, 180, 206, 48, -57, -33, -37, -36, -31, -21, 48, 206, 48, -59, 180, -108, 180, 180, -40, -34, 180, -11, 48, -11, -11, -30, 48, -11, -60, 286, -52, -25, -56, -16, -39, 48, -53, -58, -61, 48, -54, -63, -35, -55, 180, -11, -65, -62, -64]), 'TRUE_TOK': ([32, 43, 65, 73, 85, 88, 111, 112, 124, 125, 128, 132, 144, 150, 158, 162, 170, 171, 179, 181, 183, 185, 189, 192, 193, 196, 197, 205, 210, 212, 214, 218, 219, 220, 224, 225, 226, 231, 233, 234, 235, 238, 239, 244, 245, 253, 254, 255, 257, 258, 260, 266, 268, 269, 272, 273, 275, 276, 278, 279, 283, 284, 289, 292, 295, 296, 300, 301, 304, 307, 308, 310, 312], [49, 49, 49, 49, 49, 49, 49, 49, -94, 49, -79, 49, -111, -32, 49, 49, 49, 49, -91, -76, -11, 49, 49, 49, -38, 49, 49, 49, 49, 49, -57, -33, -37, -36, -31, -21, 49, 49, -59, 49, -108, 49, 49, -40, -34, 49, -11, 49, -11, -11, -30, 49, -11, -60, -52, -25, -56, -16, -39, 49, -53, -58, -61, 49, -54, -63, -35, -55, 49, -11, -65, -62, -64]), 'PLAN_EXTRAS_TOK': ([11, 16, 21, 22, 118, 140], [-99, -92, -109, 36, -12, -45]), ':': ([12, 20], [23, 23]), '=': ([44, 46, 48, 49, 50, 52, 53, 54, 55, 56, 67, 99, 103, 104, 127, 129, 136, 137, 146, 180, 182], [-78, -75, -74, -89, -80, -88, -81, -116, -20, -84, -100, -117, -121, -120, -66, -87, -118, -119, 164, -74, -87]), 'NOT_NL_TOK': ([149, 169, 175, 201], [-66, 195, -66, 228]), '$end': ([2, 4, 5, 11, 13, 14, 15, 16, 21, 22, 25, 26, 27, 29, 35, 38, 72, 118, 135, 138, 140, 198], [0, -1, -2, -99, -95, -46, -6, -92, -109, -103, -4, -46, -112, -77, -47, -5, -3, -12, -13, -14, -45, -28]), 'PYTHON_TOK': ([112, 124, 125, 128, 131, 132, 134, 144, 150, 153, 154, 156, 158, 162, 170, 171, 172, 179, 181, 183, 185, 189, 193, 196, 197, 205, 210, 214, 218, 219, 220, 224, 225, 233, 234, 235, 238, 239, 244, 245, 253, 254, 257, 258, 260, 265, 268, 269, 272, 273, 275, 276, 278, 279, 280, 283, 284, 289, 292, 293, 295, 296, 300, 301, 304, 307, 308, 310, 312], [-44, -94, -44, -79, 149, -44, -44, -111, -32, -90, -44, 175, -44, -44, -44, -44, -107, -91, -76, -11, -44, -44, -38, -44, -44, -44, -44, -57, -33, -37, -36, -31, -21, -59, -44, -108, -44, -44, -40, -34, -44, -11, -11, -11, -30, -43, -11, -60, -52, -25, -56, -16, -39, -44, -41, -53, -58, -61, -44, -42, -54, -63, -35, -55, -44, -11, -65, -62, -64]), 'USE_TOK': ([61, 76], [78, 78]), 'WITH_TOK': ([94, 109, 159, 160, 209, 241, 291], [-104, 120, -49, -48, -9, -85, -86]), 'FALSE_TOK': ([32, 43, 65, 73, 85, 88, 111, 112, 124, 125, 128, 132, 144, 150, 158, 162, 170, 171, 179, 181, 183, 185, 189, 192, 193, 196, 197, 205, 210, 212, 214, 218, 219, 220, 224, 225, 226, 231, 233, 234, 235, 238, 239, 244, 245, 253, 254, 255, 257, 258, 260, 266, 268, 269, 272, 273, 275, 276, 278, 279, 283, 284, 289, 292, 295, 296, 300, 301, 304, 307, 308, 310, 312], [52, 52, 52, 52, 52, 52, 52, 52, -94, 52, -79, 52, -111, -32, 52, 52, 52, 52, -91, -76, -11, 52, 52, 52, -38, 52, 52, 52, 52, 52, -57, -33, -37, -36, -31, -21, 52, 52, -59, 52, -108, 52, 52, -40, -34, 52, -11, 52, -11, -11, -30, 52, -11, -60, -52, -25, -56, -16, -39, 52, -53, -58, -61, 52, -54, -63, -35, -55, 52, -11, -65, -62, -64]), 'CHECK_TOK': ([0, 112, 124, 125, 128, 130, 132, 144, 150, 158, 162, 170, 171, 179, 181, 183, 185, 189, 193, 196, 197, 205, 210, 214, 218, 219, 220, 224, 225, 233, 234, 235, 238, 239, 244, 245, 253, 254, 257, 258, 260, 268, 269, 272, 273, 275, 276, 278, 279, 283, 284, 289, 292, 295, 296, 300, 301, 304, 307, 308, 310, 312], [1, -66, -94, -66, -79, 148, -66, -111, -32, -66, -66, -66, -66, -91, -76, -11, -66, -66, -38, -66, -66, -66, -66, -57, -33, -37, -36, -31, -21, -59, -66, -108, -66, -66, -40, -34, -66, -11, -11, -11, -30, -11, -60, -52, -25, -56, -16, -39, -66, -53, -58, -61, -66, -54, -63, -35, -55, -66, -11, -65, -62, -64]), 'IDENTIFIER_TOK': ([0, 1, 3, 6, 8, 9, 10, 11, 13, 14, 16, 21, 26, 27, 30, 32, 42, 43, 63, 65, 73, 78, 85, 88, 111, 112, 124, 125, 128, 132, 134, 135, 140, 144, 147, 150, 153, 154, 158, 162, 170, 171, 172, 174, 177, 179, 181, 183, 185, 189, 192, 193, 196, 197, 198, 205, 210, 211, 212, 214, 218, 219, 220, 224, 225, 226, 230, 231, 233, 234, 235, 238, 239, 244, 245, 253, 254, 255, 257, 258, 260, 265, 266, 268, 269, 272, 273, 275, 276, 278, 279, 280, 283, 284, 289, 292, 293, 295, 296, 300, 301, 304, 307, 308, 310, 312], [-22, 7, -23, -24, 12, 17, 18, 20, -95, 12, -92, -109, 20, -112, 40, 45, -7, 45, 82, 45, 45, 95, 45, 45, 45, 129, -94, 129, -79, 129, 155, -13, -45, -111, 165, -32, -90, 155, 182, 129, 129, 129, -107, 199, 207, -91, -76, -11, 182, 129, 45, -38, 129, 129, -28, 182, 182, 207, 45, -57, -33, -37, -36, -31, -21, 45, 207, 45, -59, 182, -108, 182, 182, -40, -34, 182, -11, 45, -11, -11, -30, -43, 45, -11, -60, -52, -25, -56, -16, -39, 129, -41, -53, -58, -61, 129, -42, -54, -63, -35, -55, 182, -11, -65, -62, -64]), 'NONE_TOK': ([32, 43, 65, 73, 85, 88, 111, 112, 124, 125, 128, 132, 144, 150, 158, 162, 170, 171, 179, 181, 183, 185, 189, 192, 193, 196, 197, 205, 210, 212, 214, 218, 219, 220, 224, 225, 226, 231, 233, 234, 235, 238, 239, 244, 245, 253, 254, 255, 257, 258, 260, 266, 268, 269, 272, 273, 275, 276, 278, 279, 283, 284, 289, 292, 295, 296, 300, 301, 304, 307, 308, 310, 312], [55, 55, 55, 55, 55, 55, 55, 55, -94, 55, -79, 55, -111, -32, 55, 55, 55, 55, -91, -76, -11, 55, 55, 55, -38, 55, 55, 55, 55, 55, -57, -33, -37, -36, -31, -21, 55, 55, -59, 55, -108, 55, 55, -40, -34, 55, -11, 55, -11, -11, -30, 55, -11, -60, -52, -25, -56, -16, -39, 55, -53, -58, -61, 55, -54, -63, -35, -55, 55, -11, -65, -62, -64]), 'FORALL_TOK': ([112, 124, 125, 128, 132, 144, 150, 158, 162, 170, 171, 179, 181, 183, 185, 189, 193, 196, 197, 205, 210, 214, 218, 219, 220, 224, 225, 233, 234, 235, 238, 239, 244, 245, 253, 254, 257, 258, 260, 268, 269, 272, 273, 275, 276, 278, 279, 283, 284, 289, 292, 295, 296, 300, 301, 304, 307, 308, 310, 312], [133, -94, 133, -79, 133, -111, -32, 186, 133, 133, 133, -91, -76, -11, 186, 133, -38, 133, 133, 186, 186, -57, -33, -37, -36, -31, -21, -59, 186, -108, 186, 186, -40, -34, 186, -11, -11, -11, -30, -11, -60, -52, -25, -56, -16, -39, 133, -53, -58, -61, 133, -54, -63, -35, -55, 186, -11, -65, -62, -64]), 'STRING_TOK': ([32, 43, 65, 73, 85, 88, 111, 112, 124, 125, 128, 132, 144, 150, 158, 162, 170, 171, 179, 181, 183, 185, 189, 192, 193, 196, 197, 205, 210, 212, 214, 218, 219, 220, 224, 225, 226, 231, 233, 234, 235, 238, 239, 244, 245, 253, 254, 255, 257, 258, 260, 266, 268, 269, 272, 273, 275, 276, 278, 279, 283, 284, 289, 292, 295, 296, 300, 301, 304, 307, 308, 310, 312], [56, 56, 56, 56, 56, 56, 56, 56, -94, 56, -79, 56, -111, -32, 56, 56, 56, 56, -91, -76, -11, 56, 56, 56, -38, 56, 56, 56, 56, 56, -57, -33, -37, -36, -31, -21, 56, 56, -59, 56, -108, 56, 56, -40, -34, 56, -11, 56, -11, -11, -30, 56, -11, -60, -52, -25, -56, -16, -39, 56, -53, -58, -61, 56, -54, -63, -35, -55, 56, -11, -65, -62, -64]), 'WHEN_TOK': ([94, 159, 160, 241, 291], [110, -49, -48, -85, -86]), 'FIRST_TOK': ([112, 124, 125, 128, 132, 144, 150, 158, 162, 170, 171, 177, 179, 181, 183, 185, 189, 193, 196, 197, 205, 210, 214, 218, 219, 220, 224, 225, 233, 234, 235, 238, 239, 244, 245, 253, 254, 257, 258, 260, 268, 269, 272, 273, 275, 276, 278, 279, 283, 284, 289, 292, 295, 296, 300, 301, 304, 307, 308, 310, 312], [132, -94, 132, -79, 132, -111, -32, 185, 132, 132, 132, 205, -91, -76, -11, 185, 132, -38, 132, 132, 185, 185, -57, -33, -37, -36, -31, -21, -59, 185, -108, 185, 185, -40, -34, 185, -11, -11, -11, -30, -11, -60, -52, -25, -56, -16, -39, 132, -53, -58, -61, 132, -54, -63, -35, -55, 185, -11, -65, -62, -64]), 'RP_TOK': ([32, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 65, 67, 68, 69, 70, 71, 73, 74, 83, 84, 85, 86, 87, 88, 89, 90, 99, 101, 102, 103, 104, 105, 111, 115, 116, 117, 123, 136, 137, 192, 212, 221, 226, 231, 237, 247, 252, 255, 266, 270, 282], [-102, 67, -78, -87, -75, -96, -74, -89, -80, 72, -88, -81, -116, -20, -84, -17, 67, -100, -17, -97, -93, -17, -18, -82, -17, 99, -18, 103, 104, -18, -26, -113, -117, -110, -17, -121, -120, -114, -102, 136, 137, -83, 142, -118, -119, -102, -102, 242, -102, -102, 256, 263, 267, -102, -102, 285, 294]), 'FC_EXTRAS_TOK': ([13, 14, 27, 198], [-95, 28, -112, -28]), 'NL_TOK': ([0, 12, 17, 19, 20, 23, 24, 28, 31, 34, 36, 40, 41, 63, 64, 79, 82, 91, 92, 97, 98, 108, 110, 120, 126, 132, 133, 142, 149, 166, 167, 175, 178, 185, 186, 190, 191, 202, 203, 205, 217, 223, 242, 243, 246, 249, 256, 259, 263, 264, 267, 285, 286, 288, 290, 294, 302, 309], [3, -19, -105, 33, -19, -27, 37, 39, 42, 59, 60, -98, -17, -18, -8, 96, -115, -73, 107, 113, 114, 119, 122, 139, 145, 151, 152, 160, 168, -71, 193, 200, 208, 213, 215, 219, 220, -72, 229, 232, 241, 244, 260, 261, 262, 265, 273, 277, 280, 281, 273, 273, 296, 298, 299, 273, 305, 311])} _lr_action = {} for (_k, _v) in list(_lr_action_items.items()): for (_x, _y) in zip(_v[0], _v[1]): if not _x in _lr_action: _lr_action[_x] = {} _lr_action[_x][_k] = _y del _lr_action_items _lr_goto_items = {'inc_plan_vars': ([183, 254, 257, 258, 268, 307], [210, 210, 210, 210, 210, 210]), 'when_opt': ([94], [109]), 'bc_rules_opt': ([14, 26], [25, 38]), 'parent_opt': ([6], [8]), 'fc_extras': ([14], [26]), 'start_extra_statements': ([33, 39, 60], [58, 62, 77]), 'bc_rules': ([8, 14, 26], [11, 11, 11]), 'file': ([0], [4]), 'fc_premise': ([112, 125, 132, 162, 170, 171, 189, 196, 197, 279, 292], [124, 144, 150, 124, 124, 124, 144, 144, 144, 124, 144]), 'python_plan_code': ([176, 297, 306], [203, 302, 309]), 'bc_require_opt': ([276], [289]), 'plan_spec': ([256, 267, 285, 294], [272, 283, 295, 301]), 'goal': ([78], [94]), 'plan_extras_opt': ([22], [35]), 'pattern': ([32, 73, 88, 111, 112, 125, 132, 158, 162, 170, 171, 185, 189, 192, 196, 197, 205, 210, 212, 226, 231, 234, 238, 239, 253, 255, 266, 279, 292, 304], [47, 90, 105, 47, 127, 127, 127, 127, 127, 127, 127, 127, 127, 47, 127, 127, 127, 127, 47, 47, 47, 127, 127, 127, 127, 47, 47, 127, 127, 127]), 'top': ([0], [2]), 'bc_premise': ([158, 185, 205, 210, 234, 238, 239, 253, 304], [179, 214, 233, 235, 179, 179, 179, 179, 179]), 'assertion': ([134, 154], [153, 172]), 'name': ([158, 177, 185, 205, 210, 211, 230, 234, 238, 239, 253, 304], [184, 204, 184, 184, 184, 236, 251, 184, 184, 184, 184, 184]), 'data_list': ([43, 65], [68, 83]), 'start_python_plan_call': ([273, 298], [287, 303]), 'pattern_proper': ([32, 43, 65, 73, 85, 88, 111, 112, 125, 132, 158, 162, 170, 171, 185, 189, 192, 196, 197, 205, 210, 212, 226, 231, 234, 238, 239, 253, 255, 266, 279, 292, 304], [50, 69, 69, 50, 69, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50]), 'python_goal': ([0], [5]), 'without_names': ([30], [41]), 'bc_extras_opt': ([11], [22]), 'start_python_statements': ([139], [157]), 'patterns_opt': ([32, 111, 192, 212, 226, 231, 255, 266], [51, 123, 221, 237, 247, 252, 270, 282]), 'fc_require_opt': ([225], [245]), 'python_premise': ([112, 125, 132, 158, 162, 170, 171, 185, 189, 196, 197, 205, 210, 234, 238, 239, 253, 279, 292, 304], [128, 128, 128, 181, 128, 128, 128, 181, 128, 128, 128, 181, 181, 181, 181, 181, 181, 128, 128, 181]), 'with_opt': ([109], [121]), 'variable': ([32, 43, 65, 66, 73, 85, 88, 100, 106, 111, 112, 125, 132, 158, 162, 170, 171, 185, 189, 192, 196, 197, 205, 210, 212, 226, 231, 234, 238, 239, 253, 255, 266, 279, 292, 304], [53, 53, 53, 84, 53, 53, 53, 115, 117, 53, 53, 53, 53, 53, 53, 53, 53, 53, 53, 53, 53, 53, 53, 53, 53, 53, 53, 53, 53, 53, 53, 53, 53, 53, 53, 53]), 'fc_rule': ([8, 14], [13, 27]), 'start_python_code': ([112, 125, 127, 132, 142, 149, 158, 162, 170, 171, 175, 185, 187, 189, 196, 197, 205, 210, 234, 238, 239, 253, 279, 292, 304], [130, 130, 146, 130, 161, 169, 130, 130, 130, 130, 201, 130, 216, 130, 130, 130, 130, 130, 130, 130, 130, 130, 130, 130, 130]), 'bc_premises': ([158, 234, 238, 239, 253, 304], [183, 254, 257, 258, 268, 307]), 'data': ([32, 43, 65, 73, 85, 88, 111, 112, 125, 132, 158, 162, 170, 171, 185, 189, 192, 196, 197, 205, 210, 212, 226, 231, 234, 238, 239, 253, 255, 266, 279, 292, 304], [54, 70, 70, 54, 101, 54, 54, 54, 54, 54, 54, 54, 54, 54, 54, 54, 54, 54, 54, 54, 54, 54, 54, 54, 54, 54, 54, 54, 54, 54, 54, 54, 54]), 'patterns_proper': ([43, 65, 85], [71, 71, 102]), 'check_nl': ([112, 125, 132, 134, 154, 158, 162, 170, 171, 185, 189, 196, 197, 205, 210, 234, 238, 239, 253, 279, 292, 304], [131, 131, 131, 156, 156, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131]), 'rest_opt': ([71, 102], [87, 116]), 'fc_rules': ([8], [14]), 'bc_rules_section': ([8, 14, 26], [15, 29, 29]), 'python_extras_code': ([75, 81, 93], [92, 98, 108]), 'nl_opt': ([0], [6]), 'python_rule_code': ([148, 163, 164, 188, 195, 222, 228, 240, 248], [167, 190, 191, 217, 223, 243, 249, 259, 264]), 'colon_opt': ([12, 20], [24, 34]), 'fc_premises': ([112, 162, 170, 171, 279], [125, 189, 196, 197, 292]), 'patterns': ([32, 111, 192, 212, 226, 231, 255, 266], [57, 57, 57, 57, 57, 57, 57, 57]), 'comma_opt': ([41, 57, 68, 71, 83, 102], [64, 74, 86, 89, 86, 89]), 'reset_plan_vars': ([122], [141]), 'taking': ([142], [159]), 'without_opt': ([17], [31]), 'foreach_opt': ([61], [80]), 'bc_rule': ([8, 11, 14, 26], [16, 21, 16, 16]), 'start_python_assertion': ([168, 200], [194, 227]), 'assertions': ([134], [154])} _lr_goto = {} for (_k, _v) in list(_lr_goto_items.items()): for (_x, _y) in zip(_v[0], _v[1]): if not _x in _lr_goto: _lr_goto[_x] = {} _lr_goto[_x][_k] = _y del _lr_goto_items _lr_productions = [("S' -> top", "S'", 1, None, None, None), ('top -> file', 'top', 1, 'p_top', '/home/bruce/python/workareas/pyke-hg/r1_working/pyke/krb_compiler/krbparser.py', 40), ('top -> python_goal', 'top', 1, 'p_top', '/home/bruce/python/workareas/pyke-hg/r1_working/pyke/krb_compiler/krbparser.py', 41), ('python_goal -> CHECK_TOK IDENTIFIER_TOK . IDENTIFIER_TOK LP_TOK patterns_opt RP_TOK', 'python_goal', 7, 'p_goal', '/home/bruce/python/workareas/pyke-hg/r1_working/pyke/krb_compiler/krbparser.py', 46), ('file -> nl_opt parent_opt fc_rules bc_rules_opt', 'file', 4, 'p_file', '/home/bruce/python/workareas/pyke-hg/r1_working/pyke/krb_compiler/krbparser.py', 51), ('file -> nl_opt parent_opt fc_rules fc_extras bc_rules_opt', 'file', 5, 'p_file_fc_extras', '/home/bruce/python/workareas/pyke-hg/r1_working/pyke/krb_compiler/krbparser.py', 56), ('file -> nl_opt parent_opt bc_rules_section', 'file', 3, 'p_file_bc', '/home/bruce/python/workareas/pyke-hg/r1_working/pyke/krb_compiler/krbparser.py', 61), ('parent_opt -> EXTENDING_TOK IDENTIFIER_TOK without_opt NL_TOK', 'parent_opt', 4, 'p_parent', '/home/bruce/python/workareas/pyke-hg/r1_working/pyke/krb_compiler/krbparser.py', 72), ('without_opt -> WITHOUT_TOK without_names comma_opt', 'without_opt', 3, 'p_second', '/home/bruce/python/workareas/pyke-hg/r1_working/pyke/krb_compiler/krbparser.py', 77), ('when_opt -> WHEN_TOK NL_TOK reset_plan_vars INDENT_TOK bc_premises DEINDENT_TOK', 'when_opt', 6, 'p_fourth', '/home/bruce/python/workareas/pyke-hg/r1_working/pyke/krb_compiler/krbparser.py', 82), ('reset_plan_vars -> <empty>', 'reset_plan_vars', 0, 'p_reset_plan_vars', '/home/bruce/python/workareas/pyke-hg/r1_working/pyke/krb_compiler/krbparser.py', 87), ('inc_plan_vars -> <empty>', 'inc_plan_vars', 0, 'p_inc_plan_vars', '/home/bruce/python/workareas/pyke-hg/r1_working/pyke/krb_compiler/krbparser.py', 95), ('bc_extras_opt -> BC_EXTRAS_TOK NL_TOK start_extra_statements INDENT_TOK python_extras_code NL_TOK DEINDENT_TOK', 'bc_extras_opt', 7, 'p_fifth', '/home/bruce/python/workareas/pyke-hg/r1_working/pyke/krb_compiler/krbparser.py', 103), ('fc_extras -> FC_EXTRAS_TOK NL_TOK start_extra_statements INDENT_TOK python_extras_code NL_TOK DEINDENT_TOK', 'fc_extras', 7, 'p_fifth', '/home/bruce/python/workareas/pyke-hg/r1_working/pyke/krb_compiler/krbparser.py', 104), ('plan_extras_opt -> PLAN_EXTRAS_TOK NL_TOK start_extra_statements INDENT_TOK python_extras_code NL_TOK DEINDENT_TOK', 'plan_extras_opt', 7, 'p_fifth', '/home/bruce/python/workareas/pyke-hg/r1_working/pyke/krb_compiler/krbparser.py', 105), ('with_opt -> WITH_TOK NL_TOK start_python_statements INDENT_TOK python_plan_code NL_TOK DEINDENT_TOK', 'with_opt', 7, 'p_fifth', '/home/bruce/python/workareas/pyke-hg/r1_working/pyke/krb_compiler/krbparser.py', 106), ('bc_require_opt -> <empty>', 'bc_require_opt', 0, 'p_none', '/home/bruce/python/workareas/pyke-hg/r1_working/pyke/krb_compiler/krbparser.py', 111), ('comma_opt -> <empty>', 'comma_opt', 0, 'p_none', '/home/bruce/python/workareas/pyke-hg/r1_working/pyke/krb_compiler/krbparser.py', 112), ('comma_opt -> ,', 'comma_opt', 1, 'p_none', '/home/bruce/python/workareas/pyke-hg/r1_working/pyke/krb_compiler/krbparser.py', 113), ('colon_opt -> <empty>', 'colon_opt', 0, 'p_none', '/home/bruce/python/workareas/pyke-hg/r1_working/pyke/krb_compiler/krbparser.py', 114), ('data -> NONE_TOK', 'data', 1, 'p_none', '/home/bruce/python/workareas/pyke-hg/r1_working/pyke/krb_compiler/krbparser.py', 115), ('fc_require_opt -> <empty>', 'fc_require_opt', 0, 'p_none', '/home/bruce/python/workareas/pyke-hg/r1_working/pyke/krb_compiler/krbparser.py', 116), ('nl_opt -> <empty>', 'nl_opt', 0, 'p_none', '/home/bruce/python/workareas/pyke-hg/r1_working/pyke/krb_compiler/krbparser.py', 117), ('nl_opt -> NL_TOK', 'nl_opt', 1, 'p_none', '/home/bruce/python/workareas/pyke-hg/r1_working/pyke/krb_compiler/krbparser.py', 118), ('parent_opt -> <empty>', 'parent_opt', 0, 'p_none', '/home/bruce/python/workareas/pyke-hg/r1_working/pyke/krb_compiler/krbparser.py', 119), ('plan_spec -> NL_TOK', 'plan_spec', 1, 'p_none', '/home/bruce/python/workareas/pyke-hg/r1_working/pyke/krb_compiler/krbparser.py', 120), ('rest_opt -> comma_opt', 'rest_opt', 1, 'p_none', '/home/bruce/python/workareas/pyke-hg/r1_working/pyke/krb_compiler/krbparser.py', 121), ('colon_opt -> :', 'colon_opt', 1, 'p_colon_deprication', '/home/bruce/python/workareas/pyke-hg/r1_working/pyke/krb_compiler/krbparser.py', 126), ('fc_rule -> IDENTIFIER_TOK colon_opt NL_TOK INDENT_TOK foreach_opt ASSERT_TOK NL_TOK INDENT_TOK assertions DEINDENT_TOK DEINDENT_TOK', 'fc_rule', 11, 'p_fc_rule', '/home/bruce/python/workareas/pyke-hg/r1_working/pyke/krb_compiler/krbparser.py', 134), ('foreach_opt -> FOREACH_TOK NL_TOK INDENT_TOK fc_premises DEINDENT_TOK', 'foreach_opt', 5, 'p_foreach', '/home/bruce/python/workareas/pyke-hg/r1_working/pyke/krb_compiler/krbparser.py', 139), ('fc_premise -> IDENTIFIER_TOK . IDENTIFIER_TOK LP_TOK patterns_opt RP_TOK NL_TOK', 'fc_premise', 7, 'p_fc_premise', '/home/bruce/python/workareas/pyke-hg/r1_working/pyke/krb_compiler/krbparser.py', 144), ('fc_premise -> FIRST_TOK NL_TOK INDENT_TOK fc_premises DEINDENT_TOK', 'fc_premise', 5, 'p_fc_first_1', '/home/bruce/python/workareas/pyke-hg/r1_working/pyke/krb_compiler/krbparser.py', 149), ('fc_premise -> FIRST_TOK fc_premise', 'fc_premise', 2, 'p_fc_first_n', '/home/bruce/python/workareas/pyke-hg/r1_working/pyke/krb_compiler/krbparser.py', 154), ('fc_premise -> NOTANY_TOK NL_TOK INDENT_TOK fc_premises DEINDENT_TOK', 'fc_premise', 5, 'p_fc_notany', '/home/bruce/python/workareas/pyke-hg/r1_working/pyke/krb_compiler/krbparser.py', 159), ('fc_premise -> FORALL_TOK NL_TOK INDENT_TOK fc_premises DEINDENT_TOK fc_require_opt', 'fc_premise', 6, 'p_fc_forall', '/home/bruce/python/workareas/pyke-hg/r1_working/pyke/krb_compiler/krbparser.py', 164), ('fc_require_opt -> REQUIRE_TOK NL_TOK INDENT_TOK fc_premises DEINDENT_TOK', 'fc_require_opt', 5, 'p_fc_require_opt', '/home/bruce/python/workareas/pyke-hg/r1_working/pyke/krb_compiler/krbparser.py', 169), ('python_premise -> pattern start_python_code = python_rule_code NL_TOK', 'python_premise', 5, 'p_python_eq', '/home/bruce/python/workareas/pyke-hg/r1_working/pyke/krb_compiler/krbparser.py', 174), ('python_premise -> pattern start_python_code IN_TOK python_rule_code NL_TOK', 'python_premise', 5, 'p_python_in', '/home/bruce/python/workareas/pyke-hg/r1_working/pyke/krb_compiler/krbparser.py', 179), ('python_premise -> start_python_code CHECK_TOK python_rule_code NL_TOK', 'python_premise', 4, 'p_python_check', '/home/bruce/python/workareas/pyke-hg/r1_working/pyke/krb_compiler/krbparser.py', 184), ('python_premise -> check_nl PYTHON_TOK NL_TOK start_python_assertion INDENT_TOK python_rule_code NL_TOK DEINDENT_TOK', 'python_premise', 8, 'p_python_block_n', '/home/bruce/python/workareas/pyke-hg/r1_working/pyke/krb_compiler/krbparser.py', 189), ('python_premise -> check_nl PYTHON_TOK start_python_code NOT_NL_TOK python_rule_code NL_TOK', 'python_premise', 6, 'p_python_block_1', '/home/bruce/python/workareas/pyke-hg/r1_working/pyke/krb_compiler/krbparser.py', 194), ('assertion -> IDENTIFIER_TOK . IDENTIFIER_TOK LP_TOK patterns_opt RP_TOK NL_TOK', 'assertion', 7, 'p_assertion', '/home/bruce/python/workareas/pyke-hg/r1_working/pyke/krb_compiler/krbparser.py', 199), ('assertion -> check_nl PYTHON_TOK NL_TOK start_python_assertion INDENT_TOK python_rule_code NL_TOK DEINDENT_TOK', 'assertion', 8, 'p_python_assertion_n', '/home/bruce/python/workareas/pyke-hg/r1_working/pyke/krb_compiler/krbparser.py', 204), ('assertion -> check_nl PYTHON_TOK start_python_code NOT_NL_TOK python_rule_code NL_TOK', 'assertion', 6, 'p_python_assertion_1', '/home/bruce/python/workareas/pyke-hg/r1_working/pyke/krb_compiler/krbparser.py', 209), ('check_nl -> <empty>', 'check_nl', 0, 'p_check_nl', '/home/bruce/python/workareas/pyke-hg/r1_working/pyke/krb_compiler/krbparser.py', 214), ('bc_rule -> IDENTIFIER_TOK colon_opt NL_TOK INDENT_TOK USE_TOK goal when_opt with_opt DEINDENT_TOK', 'bc_rule', 9, 'p_bc_rule', '/home/bruce/python/workareas/pyke-hg/r1_working/pyke/krb_compiler/krbparser.py', 220), ('bc_rules_opt -> <empty>', 'bc_rules_opt', 0, 'p_empty_bc_rules_opt', '/home/bruce/python/workareas/pyke-hg/r1_working/pyke/krb_compiler/krbparser.py', 225), ('bc_rules_section -> bc_rules bc_extras_opt plan_extras_opt', 'bc_rules_section', 3, 'p_bc_rules_section', '/home/bruce/python/workareas/pyke-hg/r1_working/pyke/krb_compiler/krbparser.py', 230), ('goal -> IDENTIFIER_TOK LP_TOK patterns_opt RP_TOK NL_TOK', 'goal', 5, 'p_goal_no_taking', '/home/bruce/python/workareas/pyke-hg/r1_working/pyke/krb_compiler/krbparser.py', 235), ('goal -> IDENTIFIER_TOK LP_TOK patterns_opt RP_TOK taking', 'goal', 5, 'p_goal_taking', '/home/bruce/python/workareas/pyke-hg/r1_working/pyke/krb_compiler/krbparser.py', 240), ('name -> IDENTIFIER_TOK', 'name', 1, 'p_name_sym', '/home/bruce/python/workareas/pyke-hg/r1_working/pyke/krb_compiler/krbparser.py', 245), ('name -> PATTERN_VAR_TOK', 'name', 1, 'p_name_pat_var', '/home/bruce/python/workareas/pyke-hg/r1_working/pyke/krb_compiler/krbparser.py', 250), ('bc_premise -> name LP_TOK patterns_opt RP_TOK plan_spec', 'bc_premise', 5, 'p_bc_premise1', '/home/bruce/python/workareas/pyke-hg/r1_working/pyke/krb_compiler/krbparser.py', 255), ('bc_premise -> ! name LP_TOK patterns_opt RP_TOK plan_spec', 'bc_premise', 6, 'p_bc_premise2', '/home/bruce/python/workareas/pyke-hg/r1_working/pyke/krb_compiler/krbparser.py', 261), ('bc_premise -> name . name LP_TOK patterns_opt RP_TOK plan_spec', 'bc_premise', 7, 'p_bc_premise3', '/home/bruce/python/workareas/pyke-hg/r1_working/pyke/krb_compiler/krbparser.py', 267), ('bc_premise -> ! name . name LP_TOK patterns_opt RP_TOK plan_spec', 'bc_premise', 8, 'p_bc_premise4', '/home/bruce/python/workareas/pyke-hg/r1_working/pyke/krb_compiler/krbparser.py', 273), ('bc_premise -> FIRST_TOK NL_TOK INDENT_TOK bc_premises DEINDENT_TOK', 'bc_premise', 5, 'p_bc_first_1f', '/home/bruce/python/workareas/pyke-hg/r1_working/pyke/krb_compiler/krbparser.py', 279), ('bc_premise -> FIRST_TOK bc_premise', 'bc_premise', 2, 'p_bc_first_nf', '/home/bruce/python/workareas/pyke-hg/r1_working/pyke/krb_compiler/krbparser.py', 284), ('bc_premise -> ! FIRST_TOK NL_TOK INDENT_TOK bc_premises DEINDENT_TOK', 'bc_premise', 6, 'p_bc_first_1t', '/home/bruce/python/workareas/pyke-hg/r1_working/pyke/krb_compiler/krbparser.py', 289), ('bc_premise -> ! FIRST_TOK bc_premise', 'bc_premise', 3, 'p_bc_first_nt', '/home/bruce/python/workareas/pyke-hg/r1_working/pyke/krb_compiler/krbparser.py', 294), ('bc_premise -> NOTANY_TOK NL_TOK INDENT_TOK bc_premises DEINDENT_TOK', 'bc_premise', 5, 'p_bc_notany', '/home/bruce/python/workareas/pyke-hg/r1_working/pyke/krb_compiler/krbparser.py', 299), ('bc_premise -> FORALL_TOK NL_TOK INDENT_TOK bc_premises DEINDENT_TOK bc_require_opt', 'bc_premise', 6, 'p_bc_forall', '/home/bruce/python/workareas/pyke-hg/r1_working/pyke/krb_compiler/krbparser.py', 304), ('bc_require_opt -> REQUIRE_TOK NL_TOK INDENT_TOK bc_premises DEINDENT_TOK', 'bc_require_opt', 5, 'p_bc_require_opt', '/home/bruce/python/workareas/pyke-hg/r1_working/pyke/krb_compiler/krbparser.py', 309), ('plan_spec -> AS_TOK PATTERN_VAR_TOK NL_TOK', 'plan_spec', 3, 'p_as', '/home/bruce/python/workareas/pyke-hg/r1_working/pyke/krb_compiler/krbparser.py', 314), ('plan_spec -> STEP_TOK NUMBER_TOK NL_TOK start_python_plan_call INDENT_TOK python_plan_code NL_TOK DEINDENT_TOK', 'plan_spec', 8, 'p_step_code', '/home/bruce/python/workareas/pyke-hg/r1_working/pyke/krb_compiler/krbparser.py', 319), ('plan_spec -> NL_TOK start_python_plan_call INDENT_TOK python_plan_code NL_TOK DEINDENT_TOK', 'plan_spec', 6, 'p_code', '/home/bruce/python/workareas/pyke-hg/r1_working/pyke/krb_compiler/krbparser.py', 325), ('start_python_code -> <empty>', 'start_python_code', 0, 'p_start_python_code', '/home/bruce/python/workareas/pyke-hg/r1_working/pyke/krb_compiler/krbparser.py', 330), ('start_python_plan_call -> <empty>', 'start_python_plan_call', 0, 'p_start_python_plan_call', '/home/bruce/python/workareas/pyke-hg/r1_working/pyke/krb_compiler/krbparser.py', 336), ('start_python_statements -> <empty>', 'start_python_statements', 0, 'p_start_python_statements', '/home/bruce/python/workareas/pyke-hg/r1_working/pyke/krb_compiler/krbparser.py', 342), ('start_extra_statements -> <empty>', 'start_extra_statements', 0, 'p_start_extra_statements', '/home/bruce/python/workareas/pyke-hg/r1_working/pyke/krb_compiler/krbparser.py', 348), ('start_python_assertion -> <empty>', 'start_python_assertion', 0, 'p_start_python_assertion', '/home/bruce/python/workareas/pyke-hg/r1_working/pyke/krb_compiler/krbparser.py', 354), ('python_rule_code -> CODE_TOK', 'python_rule_code', 1, 'p_python_rule_code', '/home/bruce/python/workareas/pyke-hg/r1_working/pyke/krb_compiler/krbparser.py', 361), ('python_plan_code -> CODE_TOK', 'python_plan_code', 1, 'p_python_plan_code', '/home/bruce/python/workareas/pyke-hg/r1_working/pyke/krb_compiler/krbparser.py', 366), ('python_extras_code -> CODE_TOK', 'python_extras_code', 1, 'p_python_extras_code', '/home/bruce/python/workareas/pyke-hg/r1_working/pyke/krb_compiler/krbparser.py', 371), ('variable -> PATTERN_VAR_TOK', 'variable', 1, 'p_pattern_var', '/home/bruce/python/workareas/pyke-hg/r1_working/pyke/krb_compiler/krbparser.py', 376), ('variable -> ANONYMOUS_VAR_TOK', 'variable', 1, 'p_anonymous_var', '/home/bruce/python/workareas/pyke-hg/r1_working/pyke/krb_compiler/krbparser.py', 386), ('bc_premise -> python_premise', 'bc_premise', 1, 'p_first', '/home/bruce/python/workareas/pyke-hg/r1_working/pyke/krb_compiler/krbparser.py', 394), ('bc_rules_opt -> bc_rules_section', 'bc_rules_opt', 1, 'p_first', '/home/bruce/python/workareas/pyke-hg/r1_working/pyke/krb_compiler/krbparser.py', 395), ('data -> NUMBER_TOK', 'data', 1, 'p_first', '/home/bruce/python/workareas/pyke-hg/r1_working/pyke/krb_compiler/krbparser.py', 396), ('fc_premise -> python_premise', 'fc_premise', 1, 'p_first', '/home/bruce/python/workareas/pyke-hg/r1_working/pyke/krb_compiler/krbparser.py', 397), ('pattern -> pattern_proper', 'pattern', 1, 'p_first', '/home/bruce/python/workareas/pyke-hg/r1_working/pyke/krb_compiler/krbparser.py', 398), ('pattern_proper -> variable', 'pattern_proper', 1, 'p_first', '/home/bruce/python/workareas/pyke-hg/r1_working/pyke/krb_compiler/krbparser.py', 399), ('patterns_opt -> patterns comma_opt', 'patterns_opt', 2, 'p_first', '/home/bruce/python/workareas/pyke-hg/r1_working/pyke/krb_compiler/krbparser.py', 400), ('rest_opt -> , * variable', 'rest_opt', 3, 'p_last', '/home/bruce/python/workareas/pyke-hg/r1_working/pyke/krb_compiler/krbparser.py', 405), ('data -> STRING_TOK', 'data', 1, 'p_data_string', '/home/bruce/python/workareas/pyke-hg/r1_working/pyke/krb_compiler/krbparser.py', 410), ('taking -> start_python_code TAKING_TOK python_rule_code NL_TOK', 'taking', 4, 'p_taking', '/home/bruce/python/workareas/pyke-hg/r1_working/pyke/krb_compiler/krbparser.py', 421), ('taking -> NL_TOK INDENT_TOK start_python_code TAKING_TOK python_rule_code NL_TOK DEINDENT_TOK', 'taking', 7, 'p_taking2', '/home/bruce/python/workareas/pyke-hg/r1_working/pyke/krb_compiler/krbparser.py', 426), ('data -> IDENTIFIER_TOK', 'data', 1, 'p_quoted_last', '/home/bruce/python/workareas/pyke-hg/r1_working/pyke/krb_compiler/krbparser.py', 431), ('data -> FALSE_TOK', 'data', 1, 'p_false', '/home/bruce/python/workareas/pyke-hg/r1_working/pyke/krb_compiler/krbparser.py', 439), ('data -> TRUE_TOK', 'data', 1, 'p_true', '/home/bruce/python/workareas/pyke-hg/r1_working/pyke/krb_compiler/krbparser.py', 444), ('assertions -> assertion', 'assertions', 1, 'p_start_list', '/home/bruce/python/workareas/pyke-hg/r1_working/pyke/krb_compiler/krbparser.py', 449), ('bc_premises -> bc_premise', 'bc_premises', 1, 'p_start_list', '/home/bruce/python/workareas/pyke-hg/r1_working/pyke/krb_compiler/krbparser.py', 450), ('bc_rules -> bc_rule', 'bc_rules', 1, 'p_start_list', '/home/bruce/python/workareas/pyke-hg/r1_working/pyke/krb_compiler/krbparser.py', 451), ('data_list -> data', 'data_list', 1, 'p_start_list', '/home/bruce/python/workareas/pyke-hg/r1_working/pyke/krb_compiler/krbparser.py', 452), ('fc_premises -> fc_premise', 'fc_premises', 1, 'p_start_list', '/home/bruce/python/workareas/pyke-hg/r1_working/pyke/krb_compiler/krbparser.py', 453), ('fc_rules -> fc_rule', 'fc_rules', 1, 'p_start_list', '/home/bruce/python/workareas/pyke-hg/r1_working/pyke/krb_compiler/krbparser.py', 454), ('patterns -> pattern', 'patterns', 1, 'p_start_list', '/home/bruce/python/workareas/pyke-hg/r1_working/pyke/krb_compiler/krbparser.py', 455), ('patterns_proper -> pattern_proper', 'patterns_proper', 1, 'p_start_list', '/home/bruce/python/workareas/pyke-hg/r1_working/pyke/krb_compiler/krbparser.py', 456), ('without_names -> IDENTIFIER_TOK', 'without_names', 1, 'p_start_list', '/home/bruce/python/workareas/pyke-hg/r1_working/pyke/krb_compiler/krbparser.py', 457), ('bc_extras_opt -> <empty>', 'bc_extras_opt', 0, 'p_empty_tuple', '/home/bruce/python/workareas/pyke-hg/r1_working/pyke/krb_compiler/krbparser.py', 462), ('data -> LP_TOK RP_TOK', 'data', 2, 'p_empty_tuple', '/home/bruce/python/workareas/pyke-hg/r1_working/pyke/krb_compiler/krbparser.py', 463), ('foreach_opt -> <empty>', 'foreach_opt', 0, 'p_empty_tuple', '/home/bruce/python/workareas/pyke-hg/r1_working/pyke/krb_compiler/krbparser.py', 464), ('patterns_opt -> <empty>', 'patterns_opt', 0, 'p_empty_tuple', '/home/bruce/python/workareas/pyke-hg/r1_working/pyke/krb_compiler/krbparser.py', 465), ('plan_extras_opt -> <empty>', 'plan_extras_opt', 0, 'p_empty_tuple', '/home/bruce/python/workareas/pyke-hg/r1_working/pyke/krb_compiler/krbparser.py', 466), ('when_opt -> <empty>', 'when_opt', 0, 'p_empty_tuple', '/home/bruce/python/workareas/pyke-hg/r1_working/pyke/krb_compiler/krbparser.py', 467), ('without_opt -> <empty>', 'without_opt', 0, 'p_empty_tuple', '/home/bruce/python/workareas/pyke-hg/r1_working/pyke/krb_compiler/krbparser.py', 468), ('with_opt -> <empty>', 'with_opt', 0, 'p_double_empty_tuple', '/home/bruce/python/workareas/pyke-hg/r1_working/pyke/krb_compiler/krbparser.py', 473), ('assertions -> assertions assertion', 'assertions', 2, 'p_append_list', '/home/bruce/python/workareas/pyke-hg/r1_working/pyke/krb_compiler/krbparser.py', 478), ('bc_premises -> bc_premises inc_plan_vars bc_premise', 'bc_premises', 3, 'p_append_list', '/home/bruce/python/workareas/pyke-hg/r1_working/pyke/krb_compiler/krbparser.py', 479), ('bc_rules -> bc_rules bc_rule', 'bc_rules', 2, 'p_append_list', '/home/bruce/python/workareas/pyke-hg/r1_working/pyke/krb_compiler/krbparser.py', 480), ('data_list -> data_list , data', 'data_list', 3, 'p_append_list', '/home/bruce/python/workareas/pyke-hg/r1_working/pyke/krb_compiler/krbparser.py', 481), ('fc_premises -> fc_premises fc_premise', 'fc_premises', 2, 'p_append_list', '/home/bruce/python/workareas/pyke-hg/r1_working/pyke/krb_compiler/krbparser.py', 482), ('fc_rules -> fc_rules fc_rule', 'fc_rules', 2, 'p_append_list', '/home/bruce/python/workareas/pyke-hg/r1_working/pyke/krb_compiler/krbparser.py', 483), ('patterns -> patterns , pattern', 'patterns', 3, 'p_append_list', '/home/bruce/python/workareas/pyke-hg/r1_working/pyke/krb_compiler/krbparser.py', 484), ('patterns_proper -> patterns_proper , pattern', 'patterns_proper', 3, 'p_append_list', '/home/bruce/python/workareas/pyke-hg/r1_working/pyke/krb_compiler/krbparser.py', 485), ('without_names -> without_names , IDENTIFIER_TOK', 'without_names', 3, 'p_append_list', '/home/bruce/python/workareas/pyke-hg/r1_working/pyke/krb_compiler/krbparser.py', 486), ('pattern -> data', 'pattern', 1, 'p_pattern', '/home/bruce/python/workareas/pyke-hg/r1_working/pyke/krb_compiler/krbparser.py', 492), ('pattern_proper -> LP_TOK * variable RP_TOK', 'pattern_proper', 4, 'p_pattern_tuple1', '/home/bruce/python/workareas/pyke-hg/r1_working/pyke/krb_compiler/krbparser.py', 499), ('pattern_proper -> LP_TOK data_list , * variable RP_TOK', 'pattern_proper', 6, 'p_pattern_tuple2', '/home/bruce/python/workareas/pyke-hg/r1_working/pyke/krb_compiler/krbparser.py', 506), ('pattern_proper -> LP_TOK data_list , patterns_proper rest_opt RP_TOK', 'pattern_proper', 6, 'p_pattern_tuple3', '/home/bruce/python/workareas/pyke-hg/r1_working/pyke/krb_compiler/krbparser.py', 518), ('pattern_proper -> LP_TOK patterns_proper rest_opt RP_TOK', 'pattern_proper', 4, 'p_pattern_tuple4', '/home/bruce/python/workareas/pyke-hg/r1_working/pyke/krb_compiler/krbparser.py', 534), ('data -> LP_TOK data_list comma_opt RP_TOK', 'data', 4, 'p_tuple', '/home/bruce/python/workareas/pyke-hg/r1_working/pyke/krb_compiler/krbparser.py', 543)]
def code_function(): #function begin############################################ global code code=""" `include "{0}_env.sv" class {0}_model_base_test extends uvm_test; `uvm_component_utils({0}_model_base_test) //--------------------------------------- // env instance //--------------------------------------- {0}_model_env env; //--------------------------------------- // constructor //--------------------------------------- function new(string name = "{0}_model_base_test",uvm_component parent=null); super.new(name,parent); endfunction : new //--------------------------------------- // build_phase //--------------------------------------- virtual function void build_phase(uvm_phase phase); super.build_phase(phase); // Create the env env = {0}_model_env::type_id::create("env", this); endfunction : build_phase //--------------------------------------- // end_of_elobaration phase //--------------------------------------- virtual function void end_of_elaboration(); //print's the topology print(); endfunction //--------------------------------------- // end_of_elobaration phase //--------------------------------------- function void report_phase(uvm_phase phase); uvm_report_server svr; super.report_phase(phase); svr = uvm_report_server::get_server(); if(svr.get_severity_count(UVM_FATAL)+svr.get_severity_count(UVM_ERROR)>0) begin `uvm_info(get_type_name(), "---------------------------------------", UVM_NONE) `uvm_info(get_type_name(), "---- TEST FAIL ----", UVM_NONE) `uvm_info(get_type_name(), "---------------------------------------", UVM_NONE) end else begin `uvm_info(get_type_name(), "---------------------------------------", UVM_NONE) `uvm_info(get_type_name(), "---- TEST PASS ----", UVM_NONE) `uvm_info(get_type_name(), "---------------------------------------", UVM_NONE) end endfunction endclass : {0}_model_base_test """.format(protocol_name) print(code) #function end############################################ fh=open("protocol.csv","r") for protocol_name in fh: protocol_name=protocol_name.strip("\n") fph=open('{0}_test.sv'.format(protocol_name),"w") code_function() fph.write(code)
def code_function(): global code code = '\n\n`include "{0}_env.sv"\nclass {0}_model_base_test extends uvm_test;\n\n `uvm_component_utils({0}_model_base_test)\n \n //---------------------------------------\n // env instance \n //--------------------------------------- \n {0}_model_env env;\n\n //---------------------------------------\n // constructor\n //---------------------------------------\n function new(string name = "{0}_model_base_test",uvm_component parent=null);\n super.new(name,parent);\n endfunction : new\n\n //---------------------------------------\n // build_phase\n //---------------------------------------\n virtual function void build_phase(uvm_phase phase);\n super.build_phase(phase);\n\n // Create the env\n env = {0}_model_env::type_id::create("env", this);\n endfunction : build_phase\n \n //---------------------------------------\n // end_of_elobaration phase\n //--------------------------------------- \n virtual function void end_of_elaboration();\n //print\'s the topology\n print();\n endfunction\n\n //---------------------------------------\n // end_of_elobaration phase\n //--------------------------------------- \n function void report_phase(uvm_phase phase);\n uvm_report_server svr;\n super.report_phase(phase);\n \n svr = uvm_report_server::get_server();\n if(svr.get_severity_count(UVM_FATAL)+svr.get_severity_count(UVM_ERROR)>0) begin\n `uvm_info(get_type_name(), "---------------------------------------", UVM_NONE)\n `uvm_info(get_type_name(), "---- TEST FAIL ----", UVM_NONE)\n `uvm_info(get_type_name(), "---------------------------------------", UVM_NONE)\n end\n else begin\n `uvm_info(get_type_name(), "---------------------------------------", UVM_NONE)\n `uvm_info(get_type_name(), "---- TEST PASS ----", UVM_NONE)\n `uvm_info(get_type_name(), "---------------------------------------", UVM_NONE)\n end\n endfunction \n\nendclass : {0}_model_base_test\n'.format(protocol_name) print(code) fh = open('protocol.csv', 'r') for protocol_name in fh: protocol_name = protocol_name.strip('\n') fph = open('{0}_test.sv'.format(protocol_name), 'w') code_function() fph.write(code)
# The next lines will make the Pixel Turtle and its heading invisible # and will clear the screen for light show hidePixel() hideHeading() clear() # Those are the colors for the light show colors = [white, red, yellow, green, cyan, blue, purple, white] # First we move to the top left corner moveTo(0, 0) # For each color we will make the Pixel Turtle make a stripe of that color for color in colors: setColor(color) # Walk 7 steps backward (since Pixel Turtle is facing up) backward(7) # Side step to the right move(1, 0) # Walk 7 steps forward forward(7) # Side step to the right move(1, 0) # Move back to the center of the screen moveTo(8, 4) # Set the Pixel Turtle color back to its original green setColor(green) # Make both the Pixel Turtle and its heading visible again showPixel() showHeading()
hide_pixel() hide_heading() clear() colors = [white, red, yellow, green, cyan, blue, purple, white] move_to(0, 0) for color in colors: set_color(color) backward(7) move(1, 0) forward(7) move(1, 0) move_to(8, 4) set_color(green) show_pixel() show_heading()
# Write a Python program to multiply two numbers entered by the user and display their product # for more info on this quiz, go to this url: http://www.programmr.com/multiply-two-numbers-1 def multiply_number(): print("Please enter two numbers") user_inputs = [] result = 1 for i in range(2): user_input = int(input("Enter a number: ")) user_inputs.append(user_input) for i in user_inputs: result = i * result return result print(multiply_number())
def multiply_number(): print('Please enter two numbers') user_inputs = [] result = 1 for i in range(2): user_input = int(input('Enter a number: ')) user_inputs.append(user_input) for i in user_inputs: result = i * result return result print(multiply_number())
personal_details = ('Sanjar', 22, 'India') print(personal_details) name, _, country = personal_details print(name, country)
personal_details = ('Sanjar', 22, 'India') print(personal_details) (name, _, country) = personal_details print(name, country)
print ("how old are you?.",) age=raw_input() print("How tall are you?.",) height=raw_input() print("How much do you weight?.",) weight=raw_input() print("So you're %r old,%r tall and %r heavy."%(age,height,weight))
print('how old are you?.') age = raw_input() print('How tall are you?.') height = raw_input() print('How much do you weight?.') weight = raw_input() print("So you're %r old,%r tall and %r heavy." % (age, height, weight))
""" Define directories and options, here as an example for modeling crime offences. Input file requirements: Input csv file must include one column labeled "region_id" which holds the ID number for each location and two columns "centroid_x" and "centroid_y" which hold the x and y coordinate for each location, respectively. If shapefiles need to be processed, the requirement are two input files, one containing the numbers for the the model feature data (e.g. demographic data) for each region, and another file that contains the shape file for each region. Both files are linked via same ID's named as "region_id". """ # Main input directory: data_path = "../data/" # Filename for main input csv file: fname_input = "results_DV_year11.csv" # # Polygon shapefiles of areas boundaries, only needed if coordinates not already calculated and in main input file: shape_filename = "abs/shape_files/SA2_2011_AUST.shp" # assumes in data_path directory, optional. shape_region = 'New South Wales' # set to None if no particular region exctracted and all shapedata should be included, optional. # If center coordinates already calculated, provide data in main file with two column names "centroid_x" and "centroid_y": # Filename for crime input data including crime numbers and demographic/environment features # main output directory outpath = "../testresults/" # specific output directory for result plots, maps and tables outmcmc = outpath # add any subdirectory if required ####### Define options for analysis and visualisation split_traintest = 0.1 # splits data in train and test data, provide fraction of test simulate = False # Creates simulated data with 2dim spatial coordinates and 2 features and then runs code on this data. calc_center = False # Calculates centroids from polygons and converts from Lat/Lng to cartesian with center coord below. # If calc_center = False, coordinates have to be provided in main input file [fname_input] # using the two column names "centroid_x" and "centroid_y" center_lat = -32.163333 # Latitude coordinate for spatial center for conversion into cartesian coordinates, e.g. NSW centroid center_lng = 147.016667 # Longitude coordinate for spatial center, e.g. NSW centroid create_maps = False # creates interactive html maps of crime results, not included for simulated data. # GP setup kernelname = 'expsquared' # choose from: 'expsquared', 'matern32' or 'rationalq' (Rational Quadratic) # MCMC setup; see emcee documentation for more details (http://dfm.io/emcee/current/) nwalkers = 100 # Number of walkers, recommended at least 2 * Nparameter + 1 (recommended more) niter = 500 # Number of iterations, recommended at least 500 nburn = 200 # Number of iterations, recommended at least 20% of niter, check sampler chains for convergence. nfold_cross = 1 # Number of x-fold for cross-validation for test-train sets; set to 1 for only one run #(Notes: test first with nfold-cross = 1; computational time ~ nfold_cross; also not all plotting availabable yet for nfold_cross>1) use_log = False # select false if input features need NOT to be converted into log-space. # Note that all input features will be normalized from 0 to 1, whether log-space enabled or not. ###### List of input features # use population number by area of region instead of just absolute population numbers? #pop_per_area = True target_name = 'log_crime_rate' # Identify features in data that should be used for linear regression # Names must match column names in header, replace names below accordingly: x_feature_names = ['Med_tot_hh_inc_wee_C2011', 'Med_mortg_rep_mon_C2011', 'Med_rent_weekly_C2011', 'C11_No_religion_Tot', 'C11_Tot_Sep_M', 'Med_age_persns_C2011', 'Percnt_Unemploy_C11_P', 'Brthplace_Elsewhere_2011_Ce_P', 'LSH_Eng_only_2011_Ce_P', 'C11_P_CL_C_I_II_Tot', 'C11_Tot_T', 'Tot_persons_C11_P'] # Optionally provide additional description names for features, replace names accordingly: x_feature_desc = ["Median Tot hhd inc weekly", "Median Mortgage Repay monthly", "Median Rent Weekly", "No Religion", "Male Separated", "Median Age Persons", "Percent Unemployment", "Birthplace Elsewhere", "English Speaking Only", "Education Level Cert12", "Family One Parent", "Population"] #######################################
""" Define directories and options, here as an example for modeling crime offences. Input file requirements: Input csv file must include one column labeled "region_id" which holds the ID number for each location and two columns "centroid_x" and "centroid_y" which hold the x and y coordinate for each location, respectively. If shapefiles need to be processed, the requirement are two input files, one containing the numbers for the the model feature data (e.g. demographic data) for each region, and another file that contains the shape file for each region. Both files are linked via same ID's named as "region_id". """ data_path = '../data/' fname_input = 'results_DV_year11.csv' shape_filename = 'abs/shape_files/SA2_2011_AUST.shp' shape_region = 'New South Wales' outpath = '../testresults/' outmcmc = outpath split_traintest = 0.1 simulate = False calc_center = False center_lat = -32.163333 center_lng = 147.016667 create_maps = False kernelname = 'expsquared' nwalkers = 100 niter = 500 nburn = 200 nfold_cross = 1 use_log = False target_name = 'log_crime_rate' x_feature_names = ['Med_tot_hh_inc_wee_C2011', 'Med_mortg_rep_mon_C2011', 'Med_rent_weekly_C2011', 'C11_No_religion_Tot', 'C11_Tot_Sep_M', 'Med_age_persns_C2011', 'Percnt_Unemploy_C11_P', 'Brthplace_Elsewhere_2011_Ce_P', 'LSH_Eng_only_2011_Ce_P', 'C11_P_CL_C_I_II_Tot', 'C11_Tot_T', 'Tot_persons_C11_P'] x_feature_desc = ['Median Tot hhd inc weekly', 'Median Mortgage Repay monthly', 'Median Rent Weekly', 'No Religion', 'Male Separated', 'Median Age Persons', 'Percent Unemployment', 'Birthplace Elsewhere', 'English Speaking Only', 'Education Level Cert12', 'Family One Parent', 'Population']
x = list(input().lower()) y = list(input().lower()) for i,j in zip(x,y): if i>j: print("1") break elif i<j: print("-1") break else: print("0")
x = list(input().lower()) y = list(input().lower()) for (i, j) in zip(x, y): if i > j: print('1') break elif i < j: print('-1') break else: print('0')
fashion_mnist = tf.keras.datasets.fashion_mnist (train_images, train_labels), (test_images, test_labels) = fashion_mnist.load_data() class_names = ['T-shirt/top', 'Trouser', 'Pullover', 'Dress', 'Coat', 'Sandal', 'Shirt', 'Sneaker', 'Bag', 'Ankle boot'] (train_images, train_labels), (test_images, test_labels) = fashion_mnist.load_data() idxs = np.arange(len(test_labels)) grouped_idx = [idxs[test_labels==i] for i in range(test_labels.max()+1)] ims_idx = [idx[0] for idx in grouped_idx] cm = plt.get_cmap() fig, ax = plt.subplots(2, 6, figsize=(2*6, 2*2)) ax_idxs = [0,1,2,3,4, 6,7,8,9,10, ] axs = [ax_xy for ax_y in ax for ax_xy in ax_y] for i, (ax_idx, im_idx) in enumerate(zip(ax_idxs, ims_idx)): axi=axs[ax_idx] im = test_images[im_idx] im_class = test_labels[im_idx] axi.imshow(im, cmap='gray') axi.text(0, 27, f'{class_names[im_class]}', color='w', size=16) for axi in axs: for axy in [axi.get_xaxis(), axi.get_yaxis()]: axy.set_visible(False) axi.axis('off') axi = axs[5] plt.sca(axi) for i in range(10): plt.scatter([0], [15], c=[cm.colors[256*i//10]], s=200) plt.scatter([0], [15], c='w', s=180) fig.legend(class_names, fontsize=16) plt.tight_layout(0,1,1) # ==== mnist = tf.keras.datasets.mnist (train_images, train_labels), (test_images, test_labels) = mnist.load_data() class_names = [str(i) for i in range(10)] idxs = np.arange(len(test_labels)) grouped_idx = [idxs[test_labels==i] for i in range(test_labels.max()+1)] ims_idx = [idx[10] for idx in grouped_idx] cm = plt.get_cmap() fig, ax = plt.subplots(2, 6, figsize=(2*6, 2*2)) ax_idxs = [0,1,2,3,4, 6,7,8,9,10, ] axs = [ax_xy for ax_y in ax for ax_xy in ax_y] for i, (ax_idx, im_idx) in enumerate(zip(ax_idxs, ims_idx)): axi=axs[ax_idx] im = test_images[im_idx] im_class = test_labels[im_idx] axi.imshow(im, cmap='gray') axi.text(0, 27, f'{class_names[im_class]}', color='w', size=16) for axi in axs: for axy in [axi.get_xaxis(), axi.get_yaxis()]: axy.set_visible(False) axi.axis('off') axi = axs[5] plt.sca(axi) for i in range(10): plt.scatter([0], [15], c=[cm.colors[256*i//10]], s=200) plt.scatter([0], [15], c='w', s=280) fig.legend(class_names, fontsize=16) plt.tight_layout(0,1,1)
fashion_mnist = tf.keras.datasets.fashion_mnist ((train_images, train_labels), (test_images, test_labels)) = fashion_mnist.load_data() class_names = ['T-shirt/top', 'Trouser', 'Pullover', 'Dress', 'Coat', 'Sandal', 'Shirt', 'Sneaker', 'Bag', 'Ankle boot'] ((train_images, train_labels), (test_images, test_labels)) = fashion_mnist.load_data() idxs = np.arange(len(test_labels)) grouped_idx = [idxs[test_labels == i] for i in range(test_labels.max() + 1)] ims_idx = [idx[0] for idx in grouped_idx] cm = plt.get_cmap() (fig, ax) = plt.subplots(2, 6, figsize=(2 * 6, 2 * 2)) ax_idxs = [0, 1, 2, 3, 4, 6, 7, 8, 9, 10] axs = [ax_xy for ax_y in ax for ax_xy in ax_y] for (i, (ax_idx, im_idx)) in enumerate(zip(ax_idxs, ims_idx)): axi = axs[ax_idx] im = test_images[im_idx] im_class = test_labels[im_idx] axi.imshow(im, cmap='gray') axi.text(0, 27, f'{class_names[im_class]}', color='w', size=16) for axi in axs: for axy in [axi.get_xaxis(), axi.get_yaxis()]: axy.set_visible(False) axi.axis('off') axi = axs[5] plt.sca(axi) for i in range(10): plt.scatter([0], [15], c=[cm.colors[256 * i // 10]], s=200) plt.scatter([0], [15], c='w', s=180) fig.legend(class_names, fontsize=16) plt.tight_layout(0, 1, 1) mnist = tf.keras.datasets.mnist ((train_images, train_labels), (test_images, test_labels)) = mnist.load_data() class_names = [str(i) for i in range(10)] idxs = np.arange(len(test_labels)) grouped_idx = [idxs[test_labels == i] for i in range(test_labels.max() + 1)] ims_idx = [idx[10] for idx in grouped_idx] cm = plt.get_cmap() (fig, ax) = plt.subplots(2, 6, figsize=(2 * 6, 2 * 2)) ax_idxs = [0, 1, 2, 3, 4, 6, 7, 8, 9, 10] axs = [ax_xy for ax_y in ax for ax_xy in ax_y] for (i, (ax_idx, im_idx)) in enumerate(zip(ax_idxs, ims_idx)): axi = axs[ax_idx] im = test_images[im_idx] im_class = test_labels[im_idx] axi.imshow(im, cmap='gray') axi.text(0, 27, f'{class_names[im_class]}', color='w', size=16) for axi in axs: for axy in [axi.get_xaxis(), axi.get_yaxis()]: axy.set_visible(False) axi.axis('off') axi = axs[5] plt.sca(axi) for i in range(10): plt.scatter([0], [15], c=[cm.colors[256 * i // 10]], s=200) plt.scatter([0], [15], c='w', s=280) fig.legend(class_names, fontsize=16) plt.tight_layout(0, 1, 1)
marksheet = [] scores = [] n = int(input()) for i in range(n): name = input() score = float(input()) marksheet += [[name, score]] scores += [score] li = sorted(set(scores))[1] for n, s in marksheet: if s == li: print(n)
marksheet = [] scores = [] n = int(input()) for i in range(n): name = input() score = float(input()) marksheet += [[name, score]] scores += [score] li = sorted(set(scores))[1] for (n, s) in marksheet: if s == li: print(n)
def import_and_create_dictionary(filename): """This function is used to create an expense dictionary from a file Every line in the file should be in the format: key , value the key is a user's name and the value is an expense to update the user's total expense with. the value shld be a number, however it is possible that there s no value that the value is an invalid number or that the entire line is blank """ expenses = {} f = open(filename, "r") lines = f.readlines() for line in lines: # strip whitspaces from the beginning and the end of the line # split into a list append on comma seperator lst = line.strip().split(",") if len(lst) <= 1: continue key = lst[0].strip() value = lst[1].strip() try: # cast value to float value = float(value) # add new expenses amount to the current total expenses amount expenses[key] = expenses.get(key, 0 ) + value except: # otherwise go t top of for loop , to the next line in ist of lines continue f.close() return expenses def main(): expenses = import_and_create_dictionary('file.txt') print('expenses: ', expenses) if __name__ == '__main__': main()
def import_and_create_dictionary(filename): """This function is used to create an expense dictionary from a file Every line in the file should be in the format: key , value the key is a user's name and the value is an expense to update the user's total expense with. the value shld be a number, however it is possible that there s no value that the value is an invalid number or that the entire line is blank """ expenses = {} f = open(filename, 'r') lines = f.readlines() for line in lines: lst = line.strip().split(',') if len(lst) <= 1: continue key = lst[0].strip() value = lst[1].strip() try: value = float(value) expenses[key] = expenses.get(key, 0) + value except: continue f.close() return expenses def main(): expenses = import_and_create_dictionary('file.txt') print('expenses: ', expenses) if __name__ == '__main__': main()
# -*- coding: utf-8 -*- def main(): n = int(input()) ans = set() for i in range(n): ai, bi = map(int, input().split()) if ai > bi: ans.add((bi, ai)) else: ans.add((ai, bi)) print(len(ans)) if __name__ == '__main__': main()
def main(): n = int(input()) ans = set() for i in range(n): (ai, bi) = map(int, input().split()) if ai > bi: ans.add((bi, ai)) else: ans.add((ai, bi)) print(len(ans)) if __name__ == '__main__': main()
# vim: set ts=4 sw=4 et fileencoding=utf-8: '''Vim encoding mappings to Sublime Text''' ENCODING_MAP = { 'latin1': 'Western (Windows 1252)', 'koi8-r': 'Cyrillic (KOI8-R)', 'koi8-u': 'Cyrillic (KOI8-U)', 'macroman': 'Western (Mac Roman)', 'iso-8859-1': 'Western (ISO 8859-1)', 'iso-8859-2': 'Central European (ISO 8859-2)', 'iso-8859-3': 'Western (ISO 8859-3)', 'iso-8859-4': 'Baltic (ISO 8859-4)', 'iso-8859-5': 'Cyrillic (ISO 8859-5)', 'iso-8859-6': 'Arabic (ISO 8859-6)', 'iso-8859-7': 'Greek (ISO 8859-7)', 'iso-8859-8': 'Hebrew (ISO 8859-8)', 'iso-8859-9': 'Turkish (ISO 8859-9)', 'iso-8859-10': 'Nordic (ISO 8859-10)', 'iso-8859-13': 'Estonian (ISO 8859-13)', 'iso-8859-14': 'Celtic (ISO 8859-14)', 'iso-8859-15': 'Western (ISO 8859-15)', 'iso-8859-16': 'Romanian (ISO 8859-16)', 'cp437': 'DOS (CP 437)', 'cp737': None, 'cp775': None, 'cp850': None, 'cp852': None, 'cp855': None, 'cp857': None, 'cp860': None, 'cp861': None, 'cp862': None, 'cp863': None, 'cp865': None, 'cp866': 'Cyrillic (Windows 866)', 'cp869': None, 'cp874': None, 'cp1250': 'Central European (Windows 1250)', 'cp1251': 'Cyrillic (Windows 1251)', 'cp1252': 'Western (Windows 1252)', 'cp1253': 'Greek (Windows 1253)', 'cp1254': 'Turkish (Windows 1254)', 'cp1255': 'Hebrew (Windows 1255)', 'cp1256': 'Arabic (Windows 1256)', 'cp1257': 'Baltic (Windows 1257)', 'cp1258': 'Vietnamese (Windows 1258)', 'cp932': None, 'euc-jp': None, 'sjis ': None, 'cp949': None, 'euc-kr': None, 'cp936': None, 'euc-cn': None, 'cp950': None, 'big5': None, 'euc-tw': None, 'utf-8': 'utf-8', 'ucs-2le': 'utf-16 le', 'utf-16': 'utf-16 be', 'utf-16le': 'utf-16 le', 'ucs-4': None, 'ucs-4le': None }
"""Vim encoding mappings to Sublime Text""" encoding_map = {'latin1': 'Western (Windows 1252)', 'koi8-r': 'Cyrillic (KOI8-R)', 'koi8-u': 'Cyrillic (KOI8-U)', 'macroman': 'Western (Mac Roman)', 'iso-8859-1': 'Western (ISO 8859-1)', 'iso-8859-2': 'Central European (ISO 8859-2)', 'iso-8859-3': 'Western (ISO 8859-3)', 'iso-8859-4': 'Baltic (ISO 8859-4)', 'iso-8859-5': 'Cyrillic (ISO 8859-5)', 'iso-8859-6': 'Arabic (ISO 8859-6)', 'iso-8859-7': 'Greek (ISO 8859-7)', 'iso-8859-8': 'Hebrew (ISO 8859-8)', 'iso-8859-9': 'Turkish (ISO 8859-9)', 'iso-8859-10': 'Nordic (ISO 8859-10)', 'iso-8859-13': 'Estonian (ISO 8859-13)', 'iso-8859-14': 'Celtic (ISO 8859-14)', 'iso-8859-15': 'Western (ISO 8859-15)', 'iso-8859-16': 'Romanian (ISO 8859-16)', 'cp437': 'DOS (CP 437)', 'cp737': None, 'cp775': None, 'cp850': None, 'cp852': None, 'cp855': None, 'cp857': None, 'cp860': None, 'cp861': None, 'cp862': None, 'cp863': None, 'cp865': None, 'cp866': 'Cyrillic (Windows 866)', 'cp869': None, 'cp874': None, 'cp1250': 'Central European (Windows 1250)', 'cp1251': 'Cyrillic (Windows 1251)', 'cp1252': 'Western (Windows 1252)', 'cp1253': 'Greek (Windows 1253)', 'cp1254': 'Turkish (Windows 1254)', 'cp1255': 'Hebrew (Windows 1255)', 'cp1256': 'Arabic (Windows 1256)', 'cp1257': 'Baltic (Windows 1257)', 'cp1258': 'Vietnamese (Windows 1258)', 'cp932': None, 'euc-jp': None, 'sjis ': None, 'cp949': None, 'euc-kr': None, 'cp936': None, 'euc-cn': None, 'cp950': None, 'big5': None, 'euc-tw': None, 'utf-8': 'utf-8', 'ucs-2le': 'utf-16 le', 'utf-16': 'utf-16 be', 'utf-16le': 'utf-16 le', 'ucs-4': None, 'ucs-4le': None}
""" Given an array of integers and an integer k, you need to find the total number of continuous subarrays whose sum equals to k. Example 1: Input:nums = [1,1,1], k = 2 Output: 2 Solution: 1. Brute Force Enumerate all subarray 2. Accumulative Sum """ # Brute Force # Time: O(n^2) # Space: O(1) class Solution: def subarraySum(self, nums: List[int], k: int) -> int: n = len(nums) res = 0 for start in range(n): sum = 0 for end in range(start, n): sum += nums[end] if sum == k: res += 1 return res # Accumulative Sum # Time: O(n^2) # Space: O(n) class Solution: def subarraySum(self, nums: List[int], k: int) -> int: n = len(nums) res = 0 accumulative_sum = [0] s = 0 for num in nums: s += num accumulative_sum.append(s) for start in range(n): sum = 0 for end in range(start, n): if accumulative_sum[end+1] - accumulative_sum[start] == k: res += 1 return res # Hashtable (sum_i, number of occurences of sum_i) # check if sum_i - k has occured already, if it is, there is a match, we get the value of key: sum_i - k # Time: O(n) # Space: O(n) class Solution: def subarraySum(self, nums: List[int], k: int) -> int: n = len(nums) res = 0 s = 0 d = {0:1} # key: accmulative sum_i, value: number of occurence of sum_i for i in range(n): s += nums[i] if s - k in d: res += d[s-k] d[s] = d.get(s, 0) + 1 return res
""" Given an array of integers and an integer k, you need to find the total number of continuous subarrays whose sum equals to k. Example 1: Input:nums = [1,1,1], k = 2 Output: 2 Solution: 1. Brute Force Enumerate all subarray 2. Accumulative Sum """ class Solution: def subarray_sum(self, nums: List[int], k: int) -> int: n = len(nums) res = 0 for start in range(n): sum = 0 for end in range(start, n): sum += nums[end] if sum == k: res += 1 return res class Solution: def subarray_sum(self, nums: List[int], k: int) -> int: n = len(nums) res = 0 accumulative_sum = [0] s = 0 for num in nums: s += num accumulative_sum.append(s) for start in range(n): sum = 0 for end in range(start, n): if accumulative_sum[end + 1] - accumulative_sum[start] == k: res += 1 return res class Solution: def subarray_sum(self, nums: List[int], k: int) -> int: n = len(nums) res = 0 s = 0 d = {0: 1} for i in range(n): s += nums[i] if s - k in d: res += d[s - k] d[s] = d.get(s, 0) + 1 return res
# # PySNMP MIB module NNCEXTPVC-MIB (http://snmplabs.com/pysmi) # ASN.1 source file:///Users/davwang4/Dev/mibs.snmplabs.com/asn1/NNCEXTPVC-MIB # Produced by pysmi-0.3.4 at Mon Apr 29 20:13:11 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") ConstraintsIntersection, SingleValueConstraint, ValueRangeConstraint, ConstraintsUnion, ValueSizeConstraint = mibBuilder.importSymbols("ASN1-REFINEMENT", "ConstraintsIntersection", "SingleValueConstraint", "ValueRangeConstraint", "ConstraintsUnion", "ValueSizeConstraint") InterfaceIndex, = mibBuilder.importSymbols("IF-MIB", "InterfaceIndex") nncExtensions, = mibBuilder.importSymbols("NNCGNI0001-SMI", "nncExtensions") ObjectGroup, ModuleCompliance, NotificationGroup = mibBuilder.importSymbols("SNMPv2-CONF", "ObjectGroup", "ModuleCompliance", "NotificationGroup") Integer32, MibScalar, MibTable, MibTableRow, MibTableColumn, Counter32, iso, MibIdentifier, TimeTicks, Counter64, ObjectIdentity, IpAddress, Unsigned32, NotificationType, ModuleIdentity, Bits, Gauge32 = mibBuilder.importSymbols("SNMPv2-SMI", "Integer32", "MibScalar", "MibTable", "MibTableRow", "MibTableColumn", "Counter32", "iso", "MibIdentifier", "TimeTicks", "Counter64", "ObjectIdentity", "IpAddress", "Unsigned32", "NotificationType", "ModuleIdentity", "Bits", "Gauge32") DisplayString, RowStatus, TextualConvention = mibBuilder.importSymbols("SNMPv2-TC", "DisplayString", "RowStatus", "TextualConvention") nncExtPvc = ModuleIdentity((1, 3, 6, 1, 4, 1, 123, 3, 79)) if mibBuilder.loadTexts: nncExtPvc.setLastUpdated('200101261907Z') if mibBuilder.loadTexts: nncExtPvc.setOrganization('Alcatel Networks Corporation') nncExtPvcObjects = MibIdentifier((1, 3, 6, 1, 4, 1, 123, 3, 79, 1)) nncExtPvcGroups = MibIdentifier((1, 3, 6, 1, 4, 1, 123, 3, 79, 3)) nncExtPvcCompliances = MibIdentifier((1, 3, 6, 1, 4, 1, 123, 3, 79, 4)) nncCrPvpcTable = MibTable((1, 3, 6, 1, 4, 1, 123, 3, 79, 1, 1), ) if mibBuilder.loadTexts: nncCrPvpcTable.setStatus('current') nncCrPvpcTableEntry = MibTableRow((1, 3, 6, 1, 4, 1, 123, 3, 79, 1, 1, 1), ).setIndexNames((0, "NNCEXTPVC-MIB", "nncCrPvpcSrcIfIndex"), (0, "NNCEXTPVC-MIB", "nncCrPvpcSrcVpi"), (0, "NNCEXTPVC-MIB", "nncCrPvpcDstIfIndex"), (0, "NNCEXTPVC-MIB", "nncCrPvpcDstVpi")) if mibBuilder.loadTexts: nncCrPvpcTableEntry.setStatus('current') nncCrPvpcSrcIfIndex = MibTableColumn((1, 3, 6, 1, 4, 1, 123, 3, 79, 1, 1, 1, 1), InterfaceIndex()) if mibBuilder.loadTexts: nncCrPvpcSrcIfIndex.setStatus('current') nncCrPvpcSrcVpi = MibTableColumn((1, 3, 6, 1, 4, 1, 123, 3, 79, 1, 1, 1, 2), Integer32().subtype(subtypeSpec=ValueRangeConstraint(0, 4095))) if mibBuilder.loadTexts: nncCrPvpcSrcVpi.setStatus('current') nncCrPvpcDstIfIndex = MibTableColumn((1, 3, 6, 1, 4, 1, 123, 3, 79, 1, 1, 1, 3), InterfaceIndex()) if mibBuilder.loadTexts: nncCrPvpcDstIfIndex.setStatus('current') nncCrPvpcDstVpi = MibTableColumn((1, 3, 6, 1, 4, 1, 123, 3, 79, 1, 1, 1, 4), Integer32().subtype(subtypeSpec=ValueRangeConstraint(0, 4095))) if mibBuilder.loadTexts: nncCrPvpcDstVpi.setStatus('current') nncCrPvpcCastType = MibTableColumn((1, 3, 6, 1, 4, 1, 123, 3, 79, 1, 1, 1, 5), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2))).clone(namedValues=NamedValues(("p2p", 1), ("p2mp", 2))).clone('p2p')).setMaxAccess("readcreate") if mibBuilder.loadTexts: nncCrPvpcCastType.setStatus('current') nncCrPvpcFwdServiceCategory = MibTableColumn((1, 3, 6, 1, 4, 1, 123, 3, 79, 1, 1, 1, 6), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2, 3, 4, 6))).clone(namedValues=NamedValues(("cbr", 1), ("nrtvbr", 2), ("abr", 3), ("ubr", 4), ("rtvbr", 6))).clone('nrtvbr')).setMaxAccess("readcreate") if mibBuilder.loadTexts: nncCrPvpcFwdServiceCategory.setStatus('current') nncCrPvpcBwdServiceCategory = MibTableColumn((1, 3, 6, 1, 4, 1, 123, 3, 79, 1, 1, 1, 7), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2, 3, 4, 6))).clone(namedValues=NamedValues(("cbr", 1), ("nrtvbr", 2), ("abr", 3), ("ubr", 4), ("rtvbr", 6))).clone('nrtvbr')).setMaxAccess("readcreate") if mibBuilder.loadTexts: nncCrPvpcBwdServiceCategory.setStatus('current') nncCrPvpcFwdAbrDynTrfcIcr = MibTableColumn((1, 3, 6, 1, 4, 1, 123, 3, 79, 1, 1, 1, 8), Integer32().subtype(subtypeSpec=ValueRangeConstraint(0, 2488320)).clone(1000)).setMaxAccess("readcreate") if mibBuilder.loadTexts: nncCrPvpcFwdAbrDynTrfcIcr.setStatus('current') nncCrPvpcFwdAbrDynTrfcRif = MibTableColumn((1, 3, 6, 1, 4, 1, 123, 3, 79, 1, 1, 1, 9), Integer32().subtype(subtypeSpec=ValueRangeConstraint(0, 9)).clone(9)).setMaxAccess("readcreate") if mibBuilder.loadTexts: nncCrPvpcFwdAbrDynTrfcRif.setStatus('current') nncCrPvpcFwdAbrDynTrfcRdf = MibTableColumn((1, 3, 6, 1, 4, 1, 123, 3, 79, 1, 1, 1, 10), Integer32().subtype(subtypeSpec=ValueRangeConstraint(0, 9)).clone(9)).setMaxAccess("readcreate") if mibBuilder.loadTexts: nncCrPvpcFwdAbrDynTrfcRdf.setStatus('current') nncCrPvpcBwdAbrDynTrfcIcr = MibTableColumn((1, 3, 6, 1, 4, 1, 123, 3, 79, 1, 1, 1, 11), Integer32().subtype(subtypeSpec=ValueRangeConstraint(0, 2488320)).clone(1000)).setMaxAccess("readcreate") if mibBuilder.loadTexts: nncCrPvpcBwdAbrDynTrfcIcr.setStatus('current') nncCrPvpcBwdAbrDynTrfcRif = MibTableColumn((1, 3, 6, 1, 4, 1, 123, 3, 79, 1, 1, 1, 12), Integer32().subtype(subtypeSpec=ValueRangeConstraint(0, 9)).clone(9)).setMaxAccess("readcreate") if mibBuilder.loadTexts: nncCrPvpcBwdAbrDynTrfcRif.setStatus('current') nncCrPvpcBwdAbrDynTrfcRdf = MibTableColumn((1, 3, 6, 1, 4, 1, 123, 3, 79, 1, 1, 1, 13), Integer32().subtype(subtypeSpec=ValueRangeConstraint(0, 9)).clone(9)).setMaxAccess("readcreate") if mibBuilder.loadTexts: nncCrPvpcBwdAbrDynTrfcRdf.setStatus('current') nncCrPvpcSrcBillingFlag = MibTableColumn((1, 3, 6, 1, 4, 1, 123, 3, 79, 1, 1, 1, 14), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(0, 1))).clone(namedValues=NamedValues(("disabled", 0), ("enabled", 1))).clone('disabled')).setMaxAccess("readcreate") if mibBuilder.loadTexts: nncCrPvpcSrcBillingFlag.setStatus('current') nncCrPvpcDstBillingFlag = MibTableColumn((1, 3, 6, 1, 4, 1, 123, 3, 79, 1, 1, 1, 15), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(0, 1))).clone(namedValues=NamedValues(("disabled", 0), ("enabled", 1))).clone('disabled')).setMaxAccess("readcreate") if mibBuilder.loadTexts: nncCrPvpcDstBillingFlag.setStatus('current') nncCrPvpcFwdTmTrafficDescriptor = MibTableColumn((1, 3, 6, 1, 4, 1, 123, 3, 79, 1, 1, 1, 16), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(0, 1, 2, 3, 4, 5))).clone(namedValues=NamedValues(("none", 0), ("tagAll", 1), ("p0Plus1", 2), ("p0Plus1SlashS0Plus1", 3), ("p0Plus1SlashS0", 4), ("p0Plus1SlashM0Plus1", 5))).clone('p0Plus1SlashS0Plus1')).setMaxAccess("readcreate") if mibBuilder.loadTexts: nncCrPvpcFwdTmTrafficDescriptor.setStatus('current') nncCrPvpcFwdTmPolicingOption = MibTableColumn((1, 3, 6, 1, 4, 1, 123, 3, 79, 1, 1, 1, 17), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(0, 1, 2, 3))).clone(namedValues=NamedValues(("none", 0), ("disabled", 1), ("tag", 2), ("discard", 3))).clone('disabled')).setMaxAccess("readcreate") if mibBuilder.loadTexts: nncCrPvpcFwdTmPolicingOption.setStatus('current') nncCrPvpcFwdTmBucketOneRate = MibTableColumn((1, 3, 6, 1, 4, 1, 123, 3, 79, 1, 1, 1, 18), Integer32().subtype(subtypeSpec=ValueRangeConstraint(0, 2488320)).clone(1000)).setMaxAccess("readcreate") if mibBuilder.loadTexts: nncCrPvpcFwdTmBucketOneRate.setStatus('current') nncCrPvpcFwdTmBucketOneCdvt = MibTableColumn((1, 3, 6, 1, 4, 1, 123, 3, 79, 1, 1, 1, 19), Integer32().subtype(subtypeSpec=ValueRangeConstraint(1, 190000)).clone(250)).setMaxAccess("readcreate") if mibBuilder.loadTexts: nncCrPvpcFwdTmBucketOneCdvt.setStatus('current') nncCrPvpcFwdTmBucketTwoRate = MibTableColumn((1, 3, 6, 1, 4, 1, 123, 3, 79, 1, 1, 1, 20), Integer32().subtype(subtypeSpec=ValueRangeConstraint(0, 2488320)).clone(1000)).setMaxAccess("readcreate") if mibBuilder.loadTexts: nncCrPvpcFwdTmBucketTwoRate.setStatus('current') nncCrPvpcFwdTmBucketTwoMbs = MibTableColumn((1, 3, 6, 1, 4, 1, 123, 3, 79, 1, 1, 1, 21), Integer32().subtype(subtypeSpec=ValueRangeConstraint(1, 10000)).clone(32)).setMaxAccess("readcreate") if mibBuilder.loadTexts: nncCrPvpcFwdTmBucketTwoMbs.setStatus('current') nncCrPvpcFwdTmCdv = MibTableColumn((1, 3, 6, 1, 4, 1, 123, 3, 79, 1, 1, 1, 22), Integer32().subtype(subtypeSpec=ValueRangeConstraint(250, 10000)).clone(10000)).setMaxAccess("readcreate") if mibBuilder.loadTexts: nncCrPvpcFwdTmCdv.setStatus('current') nncCrPvpcFwdTmClr = MibTableColumn((1, 3, 6, 1, 4, 1, 123, 3, 79, 1, 1, 1, 23), Integer32().subtype(subtypeSpec=ValueRangeConstraint(1, 7)).clone(7)).setMaxAccess("readcreate") if mibBuilder.loadTexts: nncCrPvpcFwdTmClr.setStatus('current') nncCrPvpcBwdTmTrafficDescriptor = MibTableColumn((1, 3, 6, 1, 4, 1, 123, 3, 79, 1, 1, 1, 24), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(0, 1, 2, 3, 4, 5))).clone(namedValues=NamedValues(("none", 0), ("tagAll", 1), ("p0Plus1", 2), ("p0Plus1SlashS0Plus1", 3), ("p0Plus1SlashS0", 4), ("p0Plus1SlashM0Plus1", 5))).clone('p0Plus1SlashS0Plus1')).setMaxAccess("readcreate") if mibBuilder.loadTexts: nncCrPvpcBwdTmTrafficDescriptor.setStatus('current') nncCrPvpcBwdTmPolicingOption = MibTableColumn((1, 3, 6, 1, 4, 1, 123, 3, 79, 1, 1, 1, 25), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(0, 1, 2, 3))).clone(namedValues=NamedValues(("none", 0), ("disabled", 1), ("tag", 2), ("discard", 3))).clone('disabled')).setMaxAccess("readcreate") if mibBuilder.loadTexts: nncCrPvpcBwdTmPolicingOption.setStatus('current') nncCrPvpcBwdTmBucketOneRate = MibTableColumn((1, 3, 6, 1, 4, 1, 123, 3, 79, 1, 1, 1, 26), Integer32().subtype(subtypeSpec=ValueRangeConstraint(0, 2488320)).clone(1000)).setMaxAccess("readcreate") if mibBuilder.loadTexts: nncCrPvpcBwdTmBucketOneRate.setStatus('current') nncCrPvpcBwdTmBucketOneCdvt = MibTableColumn((1, 3, 6, 1, 4, 1, 123, 3, 79, 1, 1, 1, 27), Integer32().subtype(subtypeSpec=ValueRangeConstraint(1, 190000)).clone(250)).setMaxAccess("readcreate") if mibBuilder.loadTexts: nncCrPvpcBwdTmBucketOneCdvt.setStatus('current') nncCrPvpcBwdTmBucketTwoRate = MibTableColumn((1, 3, 6, 1, 4, 1, 123, 3, 79, 1, 1, 1, 28), Integer32().subtype(subtypeSpec=ValueRangeConstraint(0, 2488320)).clone(1000)).setMaxAccess("readcreate") if mibBuilder.loadTexts: nncCrPvpcBwdTmBucketTwoRate.setStatus('current') nncCrPvpcBwdTmBucketTwoMbs = MibTableColumn((1, 3, 6, 1, 4, 1, 123, 3, 79, 1, 1, 1, 29), Integer32().subtype(subtypeSpec=ValueRangeConstraint(1, 10000)).clone(32)).setMaxAccess("readcreate") if mibBuilder.loadTexts: nncCrPvpcBwdTmBucketTwoMbs.setStatus('current') nncCrPvpcBwdTmCdv = MibTableColumn((1, 3, 6, 1, 4, 1, 123, 3, 79, 1, 1, 1, 30), Integer32().subtype(subtypeSpec=ValueRangeConstraint(250, 10000)).clone(10000)).setMaxAccess("readcreate") if mibBuilder.loadTexts: nncCrPvpcBwdTmCdv.setStatus('current') nncCrPvpcBwdTmClr = MibTableColumn((1, 3, 6, 1, 4, 1, 123, 3, 79, 1, 1, 1, 31), Integer32().subtype(subtypeSpec=ValueRangeConstraint(1, 7)).clone(7)).setMaxAccess("readcreate") if mibBuilder.loadTexts: nncCrPvpcBwdTmClr.setStatus('current') nncCrPvpcSrcAlsConfig = MibTableColumn((1, 3, 6, 1, 4, 1, 123, 3, 79, 1, 1, 1, 32), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(0, 1))).clone(namedValues=NamedValues(("disabled", 0), ("enabled", 1))).clone('disabled')).setMaxAccess("readcreate") if mibBuilder.loadTexts: nncCrPvpcSrcAlsConfig.setStatus('current') nncCrPvpcDstAlsConfig = MibTableColumn((1, 3, 6, 1, 4, 1, 123, 3, 79, 1, 1, 1, 33), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(0, 1))).clone(namedValues=NamedValues(("disabled", 0), ("enabled", 1))).clone('disabled')).setMaxAccess("readcreate") if mibBuilder.loadTexts: nncCrPvpcDstAlsConfig.setStatus('current') nncCrPvpcCreator = MibTableColumn((1, 3, 6, 1, 4, 1, 123, 3, 79, 1, 1, 1, 34), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(0, 1, 2, 9))).clone(namedValues=NamedValues(("unknown", 0), ("nmti", 1), ("nm5620", 2), ("snmp", 9)))).setMaxAccess("readonly") if mibBuilder.loadTexts: nncCrPvpcCreator.setStatus('current') nncCrPvpcRowStatus = MibTableColumn((1, 3, 6, 1, 4, 1, 123, 3, 79, 1, 1, 1, 35), RowStatus()).setMaxAccess("readcreate") if mibBuilder.loadTexts: nncCrPvpcRowStatus.setStatus('current') nncCrPvccTable = MibTable((1, 3, 6, 1, 4, 1, 123, 3, 79, 1, 2), ) if mibBuilder.loadTexts: nncCrPvccTable.setStatus('current') nncCrPvccTableEntry = MibTableRow((1, 3, 6, 1, 4, 1, 123, 3, 79, 1, 2, 1), ).setIndexNames((0, "NNCEXTPVC-MIB", "nncCrPvccSrcIfIndex"), (0, "NNCEXTPVC-MIB", "nncCrPvccSrcVpi"), (0, "NNCEXTPVC-MIB", "nncCrPvccSrcVci"), (0, "NNCEXTPVC-MIB", "nncCrPvccDstIfIndex"), (0, "NNCEXTPVC-MIB", "nncCrPvccDstVpi"), (0, "NNCEXTPVC-MIB", "nncCrPvccDstVci")) if mibBuilder.loadTexts: nncCrPvccTableEntry.setStatus('current') nncCrPvccSrcIfIndex = MibTableColumn((1, 3, 6, 1, 4, 1, 123, 3, 79, 1, 2, 1, 1), InterfaceIndex()) if mibBuilder.loadTexts: nncCrPvccSrcIfIndex.setStatus('current') nncCrPvccSrcVpi = MibTableColumn((1, 3, 6, 1, 4, 1, 123, 3, 79, 1, 2, 1, 2), Integer32().subtype(subtypeSpec=ValueRangeConstraint(0, 4095))) if mibBuilder.loadTexts: nncCrPvccSrcVpi.setStatus('current') nncCrPvccSrcVci = MibTableColumn((1, 3, 6, 1, 4, 1, 123, 3, 79, 1, 2, 1, 3), Integer32().subtype(subtypeSpec=ValueRangeConstraint(0, 65535))) if mibBuilder.loadTexts: nncCrPvccSrcVci.setStatus('current') nncCrPvccDstIfIndex = MibTableColumn((1, 3, 6, 1, 4, 1, 123, 3, 79, 1, 2, 1, 4), InterfaceIndex()) if mibBuilder.loadTexts: nncCrPvccDstIfIndex.setStatus('current') nncCrPvccDstVpi = MibTableColumn((1, 3, 6, 1, 4, 1, 123, 3, 79, 1, 2, 1, 5), Integer32().subtype(subtypeSpec=ValueRangeConstraint(0, 4095))) if mibBuilder.loadTexts: nncCrPvccDstVpi.setStatus('current') nncCrPvccDstVci = MibTableColumn((1, 3, 6, 1, 4, 1, 123, 3, 79, 1, 2, 1, 6), Integer32().subtype(subtypeSpec=ValueRangeConstraint(0, 65535))) if mibBuilder.loadTexts: nncCrPvccDstVci.setStatus('current') nncCrPvccCastType = MibTableColumn((1, 3, 6, 1, 4, 1, 123, 3, 79, 1, 2, 1, 7), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2))).clone(namedValues=NamedValues(("p2p", 1), ("p2mp", 2))).clone('p2p')).setMaxAccess("readcreate") if mibBuilder.loadTexts: nncCrPvccCastType.setStatus('current') nncCrPvccFwdServiceCategory = MibTableColumn((1, 3, 6, 1, 4, 1, 123, 3, 79, 1, 2, 1, 8), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2, 3, 4, 6))).clone(namedValues=NamedValues(("cbr", 1), ("nrtvbr", 2), ("abr", 3), ("ubr", 4), ("rtvbr", 6))).clone('nrtvbr')).setMaxAccess("readcreate") if mibBuilder.loadTexts: nncCrPvccFwdServiceCategory.setStatus('current') nncCrPvccBwdServiceCategory = MibTableColumn((1, 3, 6, 1, 4, 1, 123, 3, 79, 1, 2, 1, 9), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2, 3, 4, 6))).clone(namedValues=NamedValues(("cbr", 1), ("nrtvbr", 2), ("abr", 3), ("ubr", 4), ("rtvbr", 6))).clone('nrtvbr')).setMaxAccess("readcreate") if mibBuilder.loadTexts: nncCrPvccBwdServiceCategory.setStatus('current') nncCrPvccFwdAbrDynTrfcIcr = MibTableColumn((1, 3, 6, 1, 4, 1, 123, 3, 79, 1, 2, 1, 10), Integer32().subtype(subtypeSpec=ValueRangeConstraint(0, 2488320)).clone(1000)).setMaxAccess("readcreate") if mibBuilder.loadTexts: nncCrPvccFwdAbrDynTrfcIcr.setStatus('current') nncCrPvccFwdAbrDynTrfcRif = MibTableColumn((1, 3, 6, 1, 4, 1, 123, 3, 79, 1, 2, 1, 11), Integer32().subtype(subtypeSpec=ValueRangeConstraint(0, 9)).clone(9)).setMaxAccess("readcreate") if mibBuilder.loadTexts: nncCrPvccFwdAbrDynTrfcRif.setStatus('current') nncCrPvccFwdAbrDynTrfcRdf = MibTableColumn((1, 3, 6, 1, 4, 1, 123, 3, 79, 1, 2, 1, 12), Integer32().subtype(subtypeSpec=ValueRangeConstraint(0, 9)).clone(9)).setMaxAccess("readcreate") if mibBuilder.loadTexts: nncCrPvccFwdAbrDynTrfcRdf.setStatus('current') nncCrPvccBwdAbrDynTrfcIcr = MibTableColumn((1, 3, 6, 1, 4, 1, 123, 3, 79, 1, 2, 1, 13), Integer32().subtype(subtypeSpec=ValueRangeConstraint(0, 2488320)).clone(1000)).setMaxAccess("readcreate") if mibBuilder.loadTexts: nncCrPvccBwdAbrDynTrfcIcr.setStatus('current') nncCrPvccBwdAbrDynTrfcRif = MibTableColumn((1, 3, 6, 1, 4, 1, 123, 3, 79, 1, 2, 1, 14), Integer32().subtype(subtypeSpec=ValueRangeConstraint(0, 9)).clone(9)).setMaxAccess("readcreate") if mibBuilder.loadTexts: nncCrPvccBwdAbrDynTrfcRif.setStatus('current') nncCrPvccBwdAbrDynTrfcRdf = MibTableColumn((1, 3, 6, 1, 4, 1, 123, 3, 79, 1, 2, 1, 15), Integer32().subtype(subtypeSpec=ValueRangeConstraint(0, 9)).clone(9)).setMaxAccess("readcreate") if mibBuilder.loadTexts: nncCrPvccBwdAbrDynTrfcRdf.setStatus('current') nncCrPvccSrcBillingFlag = MibTableColumn((1, 3, 6, 1, 4, 1, 123, 3, 79, 1, 2, 1, 16), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(0, 1))).clone(namedValues=NamedValues(("disabled", 0), ("enabled", 1))).clone('disabled')).setMaxAccess("readcreate") if mibBuilder.loadTexts: nncCrPvccSrcBillingFlag.setStatus('current') nncCrPvccDstBillingFlag = MibTableColumn((1, 3, 6, 1, 4, 1, 123, 3, 79, 1, 2, 1, 17), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(0, 1))).clone(namedValues=NamedValues(("disabled", 0), ("enabled", 1))).clone('disabled')).setMaxAccess("readcreate") if mibBuilder.loadTexts: nncCrPvccDstBillingFlag.setStatus('current') nncCrPvccFwdTmTrafficDescriptor = MibTableColumn((1, 3, 6, 1, 4, 1, 123, 3, 79, 1, 2, 1, 18), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(0, 1, 2, 3, 4, 5))).clone(namedValues=NamedValues(("none", 0), ("tagAll", 1), ("p0Plus1", 2), ("p0Plus1SlashS0Plus1", 3), ("p0Plus1SlashS0", 4), ("p0Plus1SlashM0Plus1", 5))).clone('p0Plus1SlashS0Plus1')).setMaxAccess("readcreate") if mibBuilder.loadTexts: nncCrPvccFwdTmTrafficDescriptor.setStatus('current') nncCrPvccFwdTmPolicingOption = MibTableColumn((1, 3, 6, 1, 4, 1, 123, 3, 79, 1, 2, 1, 19), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(0, 1, 2, 3))).clone(namedValues=NamedValues(("none", 0), ("disabled", 1), ("tag", 2), ("discard", 3))).clone('disabled')).setMaxAccess("readcreate") if mibBuilder.loadTexts: nncCrPvccFwdTmPolicingOption.setStatus('current') nncCrPvccFwdTmBucketOneRate = MibTableColumn((1, 3, 6, 1, 4, 1, 123, 3, 79, 1, 2, 1, 20), Integer32().subtype(subtypeSpec=ValueRangeConstraint(0, 2488320)).clone(1000)).setMaxAccess("readcreate") if mibBuilder.loadTexts: nncCrPvccFwdTmBucketOneRate.setStatus('current') nncCrPvccFwdTmBucketOneCdvt = MibTableColumn((1, 3, 6, 1, 4, 1, 123, 3, 79, 1, 2, 1, 21), Integer32().subtype(subtypeSpec=ValueRangeConstraint(1, 190000)).clone(250)).setMaxAccess("readcreate") if mibBuilder.loadTexts: nncCrPvccFwdTmBucketOneCdvt.setStatus('current') nncCrPvccFwdTmBucketTwoRate = MibTableColumn((1, 3, 6, 1, 4, 1, 123, 3, 79, 1, 2, 1, 22), Integer32().subtype(subtypeSpec=ValueRangeConstraint(0, 2488320)).clone(1000)).setMaxAccess("readcreate") if mibBuilder.loadTexts: nncCrPvccFwdTmBucketTwoRate.setStatus('current') nncCrPvccFwdTmBucketTwoMbs = MibTableColumn((1, 3, 6, 1, 4, 1, 123, 3, 79, 1, 2, 1, 23), Integer32().subtype(subtypeSpec=ValueRangeConstraint(1, 10000)).clone(32)).setMaxAccess("readcreate") if mibBuilder.loadTexts: nncCrPvccFwdTmBucketTwoMbs.setStatus('current') nncCrPvccFwdTmCdv = MibTableColumn((1, 3, 6, 1, 4, 1, 123, 3, 79, 1, 2, 1, 24), Integer32().subtype(subtypeSpec=ValueRangeConstraint(250, 10000)).clone(10000)).setMaxAccess("readcreate") if mibBuilder.loadTexts: nncCrPvccFwdTmCdv.setStatus('current') nncCrPvccFwdTmClr = MibTableColumn((1, 3, 6, 1, 4, 1, 123, 3, 79, 1, 2, 1, 25), Integer32().subtype(subtypeSpec=ValueRangeConstraint(1, 7)).clone(7)).setMaxAccess("readcreate") if mibBuilder.loadTexts: nncCrPvccFwdTmClr.setStatus('current') nncCrPvccFwdTmFrameDiscard = MibTableColumn((1, 3, 6, 1, 4, 1, 123, 3, 79, 1, 2, 1, 26), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(0, 1))).clone(namedValues=NamedValues(("disabled", 0), ("enabled", 1))).clone('disabled')).setMaxAccess("readcreate") if mibBuilder.loadTexts: nncCrPvccFwdTmFrameDiscard.setStatus('current') nncCrPvccBwdTmTrafficDescriptor = MibTableColumn((1, 3, 6, 1, 4, 1, 123, 3, 79, 1, 2, 1, 27), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(0, 1, 2, 3, 4, 5))).clone(namedValues=NamedValues(("none", 0), ("tagAll", 1), ("p0Plus1", 2), ("p0Plus1SlashS0Plus1", 3), ("p0Plus1SlashS0", 4), ("p0Plus1SlashM0Plus1", 5))).clone('p0Plus1SlashS0Plus1')).setMaxAccess("readcreate") if mibBuilder.loadTexts: nncCrPvccBwdTmTrafficDescriptor.setStatus('current') nncCrPvccBwdTmPolicingOption = MibTableColumn((1, 3, 6, 1, 4, 1, 123, 3, 79, 1, 2, 1, 28), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(0, 1, 2, 3))).clone(namedValues=NamedValues(("none", 0), ("disabled", 1), ("tag", 2), ("discard", 3))).clone('disabled')).setMaxAccess("readcreate") if mibBuilder.loadTexts: nncCrPvccBwdTmPolicingOption.setStatus('current') nncCrPvccBwdTmBucketOneRate = MibTableColumn((1, 3, 6, 1, 4, 1, 123, 3, 79, 1, 2, 1, 29), Integer32().subtype(subtypeSpec=ValueRangeConstraint(0, 2488320)).clone(1000)).setMaxAccess("readcreate") if mibBuilder.loadTexts: nncCrPvccBwdTmBucketOneRate.setStatus('current') nncCrPvccBwdTmBucketOneCdvt = MibTableColumn((1, 3, 6, 1, 4, 1, 123, 3, 79, 1, 2, 1, 30), Integer32().subtype(subtypeSpec=ValueRangeConstraint(1, 190000)).clone(250)).setMaxAccess("readcreate") if mibBuilder.loadTexts: nncCrPvccBwdTmBucketOneCdvt.setStatus('current') nncCrPvccBwdTmBucketTwoRate = MibTableColumn((1, 3, 6, 1, 4, 1, 123, 3, 79, 1, 2, 1, 31), Integer32().subtype(subtypeSpec=ValueRangeConstraint(0, 2488320)).clone(1000)).setMaxAccess("readcreate") if mibBuilder.loadTexts: nncCrPvccBwdTmBucketTwoRate.setStatus('current') nncCrPvccBwdTmBucketTwoMbs = MibTableColumn((1, 3, 6, 1, 4, 1, 123, 3, 79, 1, 2, 1, 32), Integer32().subtype(subtypeSpec=ValueRangeConstraint(1, 10000)).clone(32)).setMaxAccess("readcreate") if mibBuilder.loadTexts: nncCrPvccBwdTmBucketTwoMbs.setStatus('current') nncCrPvccBwdTmCdv = MibTableColumn((1, 3, 6, 1, 4, 1, 123, 3, 79, 1, 2, 1, 33), Integer32().subtype(subtypeSpec=ValueRangeConstraint(250, 10000)).clone(10000)).setMaxAccess("readcreate") if mibBuilder.loadTexts: nncCrPvccBwdTmCdv.setStatus('current') nncCrPvccBwdTmClr = MibTableColumn((1, 3, 6, 1, 4, 1, 123, 3, 79, 1, 2, 1, 34), Integer32().subtype(subtypeSpec=ValueRangeConstraint(1, 7)).clone(7)).setMaxAccess("readcreate") if mibBuilder.loadTexts: nncCrPvccBwdTmClr.setStatus('current') nncCrPvccBwdTmFrameDiscard = MibTableColumn((1, 3, 6, 1, 4, 1, 123, 3, 79, 1, 2, 1, 35), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(0, 1))).clone(namedValues=NamedValues(("disabled", 0), ("enabled", 1))).clone('disabled')).setMaxAccess("readcreate") if mibBuilder.loadTexts: nncCrPvccBwdTmFrameDiscard.setStatus('current') nncCrPvccSrcAlsConfig = MibTableColumn((1, 3, 6, 1, 4, 1, 123, 3, 79, 1, 2, 1, 36), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(0, 1))).clone(namedValues=NamedValues(("disabled", 0), ("enabled", 1))).clone('disabled')).setMaxAccess("readcreate") if mibBuilder.loadTexts: nncCrPvccSrcAlsConfig.setStatus('current') nncCrPvccDstAlsConfig = MibTableColumn((1, 3, 6, 1, 4, 1, 123, 3, 79, 1, 2, 1, 37), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(0, 1))).clone(namedValues=NamedValues(("disabled", 0), ("enabled", 1))).clone('disabled')).setMaxAccess("readcreate") if mibBuilder.loadTexts: nncCrPvccDstAlsConfig.setStatus('current') nncCrPvccCreator = MibTableColumn((1, 3, 6, 1, 4, 1, 123, 3, 79, 1, 2, 1, 38), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(0, 1, 2, 9))).clone(namedValues=NamedValues(("unknown", 0), ("nmti", 1), ("nm5620", 2), ("snmp", 9)))).setMaxAccess("readonly") if mibBuilder.loadTexts: nncCrPvccCreator.setStatus('current') nncCrPvccRowStatus = MibTableColumn((1, 3, 6, 1, 4, 1, 123, 3, 79, 1, 2, 1, 39), RowStatus()).setMaxAccess("readcreate") if mibBuilder.loadTexts: nncCrPvccRowStatus.setStatus('current') nncCrPvpcGroup = ObjectGroup((1, 3, 6, 1, 4, 1, 123, 3, 79, 3, 1)).setObjects(("NNCEXTPVC-MIB", "nncCrPvpcSrcIfIndex"), ("NNCEXTPVC-MIB", "nncCrPvpcSrcVpi"), ("NNCEXTPVC-MIB", "nncCrPvpcDstIfIndex"), ("NNCEXTPVC-MIB", "nncCrPvpcDstVpi"), ("NNCEXTPVC-MIB", "nncCrPvpcCastType"), ("NNCEXTPVC-MIB", "nncCrPvpcFwdServiceCategory"), ("NNCEXTPVC-MIB", "nncCrPvpcBwdServiceCategory"), ("NNCEXTPVC-MIB", "nncCrPvpcFwdAbrDynTrfcIcr"), ("NNCEXTPVC-MIB", "nncCrPvpcFwdAbrDynTrfcRif"), ("NNCEXTPVC-MIB", "nncCrPvpcFwdAbrDynTrfcRdf"), ("NNCEXTPVC-MIB", "nncCrPvpcBwdAbrDynTrfcIcr"), ("NNCEXTPVC-MIB", "nncCrPvpcBwdAbrDynTrfcRif"), ("NNCEXTPVC-MIB", "nncCrPvpcBwdAbrDynTrfcRdf"), ("NNCEXTPVC-MIB", "nncCrPvpcSrcBillingFlag"), ("NNCEXTPVC-MIB", "nncCrPvpcDstBillingFlag"), ("NNCEXTPVC-MIB", "nncCrPvpcFwdTmTrafficDescriptor"), ("NNCEXTPVC-MIB", "nncCrPvpcFwdTmPolicingOption"), ("NNCEXTPVC-MIB", "nncCrPvpcFwdTmBucketOneRate"), ("NNCEXTPVC-MIB", "nncCrPvpcFwdTmBucketOneCdvt"), ("NNCEXTPVC-MIB", "nncCrPvpcFwdTmBucketTwoRate"), ("NNCEXTPVC-MIB", "nncCrPvpcFwdTmBucketTwoMbs"), ("NNCEXTPVC-MIB", "nncCrPvpcFwdTmCdv"), ("NNCEXTPVC-MIB", "nncCrPvpcFwdTmClr"), ("NNCEXTPVC-MIB", "nncCrPvpcBwdTmTrafficDescriptor"), ("NNCEXTPVC-MIB", "nncCrPvpcBwdTmPolicingOption"), ("NNCEXTPVC-MIB", "nncCrPvpcBwdTmBucketOneRate"), ("NNCEXTPVC-MIB", "nncCrPvpcBwdTmBucketOneCdvt"), ("NNCEXTPVC-MIB", "nncCrPvpcBwdTmBucketTwoRate"), ("NNCEXTPVC-MIB", "nncCrPvpcBwdTmBucketTwoMbs"), ("NNCEXTPVC-MIB", "nncCrPvpcBwdTmCdv"), ("NNCEXTPVC-MIB", "nncCrPvpcBwdTmClr"), ("NNCEXTPVC-MIB", "nncCrPvpcSrcAlsConfig"), ("NNCEXTPVC-MIB", "nncCrPvpcDstAlsConfig"), ("NNCEXTPVC-MIB", "nncCrPvpcCreator"), ("NNCEXTPVC-MIB", "nncCrPvpcRowStatus")) if getattr(mibBuilder, 'version', (0, 0, 0)) > (4, 4, 0): nncCrPvpcGroup = nncCrPvpcGroup.setStatus('current') nncCrPvccGroup = ObjectGroup((1, 3, 6, 1, 4, 1, 123, 3, 79, 3, 2)).setObjects(("NNCEXTPVC-MIB", "nncCrPvccSrcIfIndex"), ("NNCEXTPVC-MIB", "nncCrPvccSrcVpi"), ("NNCEXTPVC-MIB", "nncCrPvccSrcVci"), ("NNCEXTPVC-MIB", "nncCrPvccDstIfIndex"), ("NNCEXTPVC-MIB", "nncCrPvccDstVpi"), ("NNCEXTPVC-MIB", "nncCrPvccDstVci"), ("NNCEXTPVC-MIB", "nncCrPvccCastType"), ("NNCEXTPVC-MIB", "nncCrPvccFwdServiceCategory"), ("NNCEXTPVC-MIB", "nncCrPvccBwdServiceCategory"), ("NNCEXTPVC-MIB", "nncCrPvccFwdAbrDynTrfcIcr"), ("NNCEXTPVC-MIB", "nncCrPvccFwdAbrDynTrfcRif"), ("NNCEXTPVC-MIB", "nncCrPvccFwdAbrDynTrfcRdf"), ("NNCEXTPVC-MIB", "nncCrPvccBwdAbrDynTrfcIcr"), ("NNCEXTPVC-MIB", "nncCrPvccBwdAbrDynTrfcRif"), ("NNCEXTPVC-MIB", "nncCrPvccBwdAbrDynTrfcRdf"), ("NNCEXTPVC-MIB", "nncCrPvccSrcBillingFlag"), ("NNCEXTPVC-MIB", "nncCrPvccDstBillingFlag"), ("NNCEXTPVC-MIB", "nncCrPvccFwdTmTrafficDescriptor"), ("NNCEXTPVC-MIB", "nncCrPvccFwdTmPolicingOption"), ("NNCEXTPVC-MIB", "nncCrPvccFwdTmBucketOneRate"), ("NNCEXTPVC-MIB", "nncCrPvccFwdTmBucketOneCdvt"), ("NNCEXTPVC-MIB", "nncCrPvccFwdTmBucketTwoRate"), ("NNCEXTPVC-MIB", "nncCrPvccFwdTmBucketTwoMbs"), ("NNCEXTPVC-MIB", "nncCrPvccFwdTmCdv"), ("NNCEXTPVC-MIB", "nncCrPvccFwdTmClr"), ("NNCEXTPVC-MIB", "nncCrPvccFwdTmFrameDiscard"), ("NNCEXTPVC-MIB", "nncCrPvccBwdTmTrafficDescriptor"), ("NNCEXTPVC-MIB", "nncCrPvccBwdTmPolicingOption"), ("NNCEXTPVC-MIB", "nncCrPvccBwdTmBucketOneRate"), ("NNCEXTPVC-MIB", "nncCrPvccBwdTmBucketOneCdvt"), ("NNCEXTPVC-MIB", "nncCrPvccBwdTmBucketTwoRate"), ("NNCEXTPVC-MIB", "nncCrPvccBwdTmBucketTwoMbs"), ("NNCEXTPVC-MIB", "nncCrPvccBwdTmCdv"), ("NNCEXTPVC-MIB", "nncCrPvccBwdTmClr"), ("NNCEXTPVC-MIB", "nncCrPvccBwdTmFrameDiscard"), ("NNCEXTPVC-MIB", "nncCrPvccSrcAlsConfig"), ("NNCEXTPVC-MIB", "nncCrPvccDstAlsConfig"), ("NNCEXTPVC-MIB", "nncCrPvccCreator"), ("NNCEXTPVC-MIB", "nncCrPvccRowStatus")) if getattr(mibBuilder, 'version', (0, 0, 0)) > (4, 4, 0): nncCrPvccGroup = nncCrPvccGroup.setStatus('current') nncPvcCompliance = ModuleCompliance((1, 3, 6, 1, 4, 1, 123, 3, 79, 4, 1)).setObjects(("NNCEXTPVC-MIB", "nncCrPvpcGroup"), ("NNCEXTPVC-MIB", "nncCrPvccGroup")) if getattr(mibBuilder, 'version', (0, 0, 0)) > (4, 4, 0): nncPvcCompliance = nncPvcCompliance.setStatus('current') mibBuilder.exportSymbols("NNCEXTPVC-MIB", nncCrPvpcBwdTmClr=nncCrPvpcBwdTmClr, nncCrPvpcSrcBillingFlag=nncCrPvpcSrcBillingFlag, nncCrPvccDstIfIndex=nncCrPvccDstIfIndex, nncExtPvcGroups=nncExtPvcGroups, nncCrPvpcFwdAbrDynTrfcIcr=nncCrPvpcFwdAbrDynTrfcIcr, nncCrPvccFwdAbrDynTrfcIcr=nncCrPvccFwdAbrDynTrfcIcr, nncCrPvpcFwdServiceCategory=nncCrPvpcFwdServiceCategory, nncCrPvpcTableEntry=nncCrPvpcTableEntry, nncCrPvccCastType=nncCrPvccCastType, nncCrPvccBwdAbrDynTrfcRif=nncCrPvccBwdAbrDynTrfcRif, nncCrPvccBwdAbrDynTrfcIcr=nncCrPvccBwdAbrDynTrfcIcr, nncCrPvpcFwdTmBucketTwoMbs=nncCrPvpcFwdTmBucketTwoMbs, nncCrPvccCreator=nncCrPvccCreator, nncCrPvccFwdTmBucketTwoRate=nncCrPvccFwdTmBucketTwoRate, nncCrPvpcSrcIfIndex=nncCrPvpcSrcIfIndex, nncCrPvccBwdTmBucketTwoRate=nncCrPvccBwdTmBucketTwoRate, nncCrPvpcBwdAbrDynTrfcIcr=nncCrPvpcBwdAbrDynTrfcIcr, nncCrPvpcBwdTmBucketOneCdvt=nncCrPvpcBwdTmBucketOneCdvt, nncCrPvccFwdTmFrameDiscard=nncCrPvccFwdTmFrameDiscard, nncCrPvccDstVci=nncCrPvccDstVci, nncExtPvcObjects=nncExtPvcObjects, nncCrPvpcDstIfIndex=nncCrPvpcDstIfIndex, nncCrPvccTableEntry=nncCrPvccTableEntry, nncCrPvccSrcVci=nncCrPvccSrcVci, nncCrPvccRowStatus=nncCrPvccRowStatus, PYSNMP_MODULE_ID=nncExtPvc, nncCrPvccSrcVpi=nncCrPvccSrcVpi, nncCrPvccFwdTmBucketTwoMbs=nncCrPvccFwdTmBucketTwoMbs, nncCrPvccBwdTmFrameDiscard=nncCrPvccBwdTmFrameDiscard, nncCrPvpcFwdAbrDynTrfcRdf=nncCrPvpcFwdAbrDynTrfcRdf, nncCrPvccFwdTmCdv=nncCrPvccFwdTmCdv, nncCrPvpcDstAlsConfig=nncCrPvpcDstAlsConfig, nncCrPvpcBwdServiceCategory=nncCrPvpcBwdServiceCategory, nncCrPvpcFwdTmPolicingOption=nncCrPvpcFwdTmPolicingOption, nncPvcCompliance=nncPvcCompliance, nncCrPvpcBwdTmTrafficDescriptor=nncCrPvpcBwdTmTrafficDescriptor, nncCrPvccFwdTmTrafficDescriptor=nncCrPvccFwdTmTrafficDescriptor, nncCrPvccBwdTmBucketTwoMbs=nncCrPvccBwdTmBucketTwoMbs, nncCrPvccBwdTmPolicingOption=nncCrPvccBwdTmPolicingOption, nncCrPvccFwdTmBucketOneRate=nncCrPvccFwdTmBucketOneRate, nncCrPvccBwdAbrDynTrfcRdf=nncCrPvccBwdAbrDynTrfcRdf, nncCrPvccSrcBillingFlag=nncCrPvccSrcBillingFlag, nncCrPvccFwdTmBucketOneCdvt=nncCrPvccFwdTmBucketOneCdvt, nncCrPvccBwdTmBucketOneRate=nncCrPvccBwdTmBucketOneRate, nncCrPvpcTable=nncCrPvpcTable, nncCrPvpcDstBillingFlag=nncCrPvpcDstBillingFlag, nncCrPvpcFwdTmCdv=nncCrPvpcFwdTmCdv, nncCrPvccDstBillingFlag=nncCrPvccDstBillingFlag, nncCrPvccFwdAbrDynTrfcRdf=nncCrPvccFwdAbrDynTrfcRdf, nncExtPvc=nncExtPvc, nncExtPvcCompliances=nncExtPvcCompliances, nncCrPvccFwdTmClr=nncCrPvccFwdTmClr, nncCrPvpcDstVpi=nncCrPvpcDstVpi, nncCrPvpcBwdAbrDynTrfcRdf=nncCrPvpcBwdAbrDynTrfcRdf, nncCrPvpcSrcVpi=nncCrPvpcSrcVpi, nncCrPvpcFwdTmTrafficDescriptor=nncCrPvpcFwdTmTrafficDescriptor, nncCrPvccSrcIfIndex=nncCrPvccSrcIfIndex, nncCrPvpcFwdTmClr=nncCrPvpcFwdTmClr, nncCrPvccSrcAlsConfig=nncCrPvccSrcAlsConfig, nncCrPvccBwdTmClr=nncCrPvccBwdTmClr, nncCrPvpcCastType=nncCrPvpcCastType, nncCrPvpcFwdAbrDynTrfcRif=nncCrPvpcFwdAbrDynTrfcRif, nncCrPvccTable=nncCrPvccTable, nncCrPvpcRowStatus=nncCrPvpcRowStatus, nncCrPvpcBwdTmBucketTwoRate=nncCrPvpcBwdTmBucketTwoRate, nncCrPvccBwdServiceCategory=nncCrPvccBwdServiceCategory, nncCrPvpcGroup=nncCrPvpcGroup, nncCrPvccGroup=nncCrPvccGroup, nncCrPvpcBwdTmCdv=nncCrPvpcBwdTmCdv, nncCrPvccBwdTmCdv=nncCrPvccBwdTmCdv, nncCrPvpcBwdTmPolicingOption=nncCrPvpcBwdTmPolicingOption, nncCrPvpcFwdTmBucketOneRate=nncCrPvpcFwdTmBucketOneRate, nncCrPvpcBwdAbrDynTrfcRif=nncCrPvpcBwdAbrDynTrfcRif, nncCrPvpcFwdTmBucketTwoRate=nncCrPvpcFwdTmBucketTwoRate, nncCrPvpcBwdTmBucketTwoMbs=nncCrPvpcBwdTmBucketTwoMbs, nncCrPvccBwdTmBucketOneCdvt=nncCrPvccBwdTmBucketOneCdvt, nncCrPvccFwdAbrDynTrfcRif=nncCrPvccFwdAbrDynTrfcRif, nncCrPvccDstVpi=nncCrPvccDstVpi, nncCrPvccBwdTmTrafficDescriptor=nncCrPvccBwdTmTrafficDescriptor, nncCrPvccDstAlsConfig=nncCrPvccDstAlsConfig, nncCrPvpcSrcAlsConfig=nncCrPvpcSrcAlsConfig, nncCrPvpcBwdTmBucketOneRate=nncCrPvpcBwdTmBucketOneRate, nncCrPvpcCreator=nncCrPvpcCreator, nncCrPvpcFwdTmBucketOneCdvt=nncCrPvpcFwdTmBucketOneCdvt, nncCrPvccFwdServiceCategory=nncCrPvccFwdServiceCategory, nncCrPvccFwdTmPolicingOption=nncCrPvccFwdTmPolicingOption)
(object_identifier, integer, octet_string) = mibBuilder.importSymbols('ASN1', 'ObjectIdentifier', 'Integer', 'OctetString') (named_values,) = mibBuilder.importSymbols('ASN1-ENUMERATION', 'NamedValues') (constraints_intersection, single_value_constraint, value_range_constraint, constraints_union, value_size_constraint) = mibBuilder.importSymbols('ASN1-REFINEMENT', 'ConstraintsIntersection', 'SingleValueConstraint', 'ValueRangeConstraint', 'ConstraintsUnion', 'ValueSizeConstraint') (interface_index,) = mibBuilder.importSymbols('IF-MIB', 'InterfaceIndex') (nnc_extensions,) = mibBuilder.importSymbols('NNCGNI0001-SMI', 'nncExtensions') (object_group, module_compliance, notification_group) = mibBuilder.importSymbols('SNMPv2-CONF', 'ObjectGroup', 'ModuleCompliance', 'NotificationGroup') (integer32, mib_scalar, mib_table, mib_table_row, mib_table_column, counter32, iso, mib_identifier, time_ticks, counter64, object_identity, ip_address, unsigned32, notification_type, module_identity, bits, gauge32) = mibBuilder.importSymbols('SNMPv2-SMI', 'Integer32', 'MibScalar', 'MibTable', 'MibTableRow', 'MibTableColumn', 'Counter32', 'iso', 'MibIdentifier', 'TimeTicks', 'Counter64', 'ObjectIdentity', 'IpAddress', 'Unsigned32', 'NotificationType', 'ModuleIdentity', 'Bits', 'Gauge32') (display_string, row_status, textual_convention) = mibBuilder.importSymbols('SNMPv2-TC', 'DisplayString', 'RowStatus', 'TextualConvention') nnc_ext_pvc = module_identity((1, 3, 6, 1, 4, 1, 123, 3, 79)) if mibBuilder.loadTexts: nncExtPvc.setLastUpdated('200101261907Z') if mibBuilder.loadTexts: nncExtPvc.setOrganization('Alcatel Networks Corporation') nnc_ext_pvc_objects = mib_identifier((1, 3, 6, 1, 4, 1, 123, 3, 79, 1)) nnc_ext_pvc_groups = mib_identifier((1, 3, 6, 1, 4, 1, 123, 3, 79, 3)) nnc_ext_pvc_compliances = mib_identifier((1, 3, 6, 1, 4, 1, 123, 3, 79, 4)) nnc_cr_pvpc_table = mib_table((1, 3, 6, 1, 4, 1, 123, 3, 79, 1, 1)) if mibBuilder.loadTexts: nncCrPvpcTable.setStatus('current') nnc_cr_pvpc_table_entry = mib_table_row((1, 3, 6, 1, 4, 1, 123, 3, 79, 1, 1, 1)).setIndexNames((0, 'NNCEXTPVC-MIB', 'nncCrPvpcSrcIfIndex'), (0, 'NNCEXTPVC-MIB', 'nncCrPvpcSrcVpi'), (0, 'NNCEXTPVC-MIB', 'nncCrPvpcDstIfIndex'), (0, 'NNCEXTPVC-MIB', 'nncCrPvpcDstVpi')) if mibBuilder.loadTexts: nncCrPvpcTableEntry.setStatus('current') nnc_cr_pvpc_src_if_index = mib_table_column((1, 3, 6, 1, 4, 1, 123, 3, 79, 1, 1, 1, 1), interface_index()) if mibBuilder.loadTexts: nncCrPvpcSrcIfIndex.setStatus('current') nnc_cr_pvpc_src_vpi = mib_table_column((1, 3, 6, 1, 4, 1, 123, 3, 79, 1, 1, 1, 2), integer32().subtype(subtypeSpec=value_range_constraint(0, 4095))) if mibBuilder.loadTexts: nncCrPvpcSrcVpi.setStatus('current') nnc_cr_pvpc_dst_if_index = mib_table_column((1, 3, 6, 1, 4, 1, 123, 3, 79, 1, 1, 1, 3), interface_index()) if mibBuilder.loadTexts: nncCrPvpcDstIfIndex.setStatus('current') nnc_cr_pvpc_dst_vpi = mib_table_column((1, 3, 6, 1, 4, 1, 123, 3, 79, 1, 1, 1, 4), integer32().subtype(subtypeSpec=value_range_constraint(0, 4095))) if mibBuilder.loadTexts: nncCrPvpcDstVpi.setStatus('current') nnc_cr_pvpc_cast_type = mib_table_column((1, 3, 6, 1, 4, 1, 123, 3, 79, 1, 1, 1, 5), integer32().subtype(subtypeSpec=constraints_union(single_value_constraint(1, 2))).clone(namedValues=named_values(('p2p', 1), ('p2mp', 2))).clone('p2p')).setMaxAccess('readcreate') if mibBuilder.loadTexts: nncCrPvpcCastType.setStatus('current') nnc_cr_pvpc_fwd_service_category = mib_table_column((1, 3, 6, 1, 4, 1, 123, 3, 79, 1, 1, 1, 6), integer32().subtype(subtypeSpec=constraints_union(single_value_constraint(1, 2, 3, 4, 6))).clone(namedValues=named_values(('cbr', 1), ('nrtvbr', 2), ('abr', 3), ('ubr', 4), ('rtvbr', 6))).clone('nrtvbr')).setMaxAccess('readcreate') if mibBuilder.loadTexts: nncCrPvpcFwdServiceCategory.setStatus('current') nnc_cr_pvpc_bwd_service_category = mib_table_column((1, 3, 6, 1, 4, 1, 123, 3, 79, 1, 1, 1, 7), integer32().subtype(subtypeSpec=constraints_union(single_value_constraint(1, 2, 3, 4, 6))).clone(namedValues=named_values(('cbr', 1), ('nrtvbr', 2), ('abr', 3), ('ubr', 4), ('rtvbr', 6))).clone('nrtvbr')).setMaxAccess('readcreate') if mibBuilder.loadTexts: nncCrPvpcBwdServiceCategory.setStatus('current') nnc_cr_pvpc_fwd_abr_dyn_trfc_icr = mib_table_column((1, 3, 6, 1, 4, 1, 123, 3, 79, 1, 1, 1, 8), integer32().subtype(subtypeSpec=value_range_constraint(0, 2488320)).clone(1000)).setMaxAccess('readcreate') if mibBuilder.loadTexts: nncCrPvpcFwdAbrDynTrfcIcr.setStatus('current') nnc_cr_pvpc_fwd_abr_dyn_trfc_rif = mib_table_column((1, 3, 6, 1, 4, 1, 123, 3, 79, 1, 1, 1, 9), integer32().subtype(subtypeSpec=value_range_constraint(0, 9)).clone(9)).setMaxAccess('readcreate') if mibBuilder.loadTexts: nncCrPvpcFwdAbrDynTrfcRif.setStatus('current') nnc_cr_pvpc_fwd_abr_dyn_trfc_rdf = mib_table_column((1, 3, 6, 1, 4, 1, 123, 3, 79, 1, 1, 1, 10), integer32().subtype(subtypeSpec=value_range_constraint(0, 9)).clone(9)).setMaxAccess('readcreate') if mibBuilder.loadTexts: nncCrPvpcFwdAbrDynTrfcRdf.setStatus('current') nnc_cr_pvpc_bwd_abr_dyn_trfc_icr = mib_table_column((1, 3, 6, 1, 4, 1, 123, 3, 79, 1, 1, 1, 11), integer32().subtype(subtypeSpec=value_range_constraint(0, 2488320)).clone(1000)).setMaxAccess('readcreate') if mibBuilder.loadTexts: nncCrPvpcBwdAbrDynTrfcIcr.setStatus('current') nnc_cr_pvpc_bwd_abr_dyn_trfc_rif = mib_table_column((1, 3, 6, 1, 4, 1, 123, 3, 79, 1, 1, 1, 12), integer32().subtype(subtypeSpec=value_range_constraint(0, 9)).clone(9)).setMaxAccess('readcreate') if mibBuilder.loadTexts: nncCrPvpcBwdAbrDynTrfcRif.setStatus('current') nnc_cr_pvpc_bwd_abr_dyn_trfc_rdf = mib_table_column((1, 3, 6, 1, 4, 1, 123, 3, 79, 1, 1, 1, 13), integer32().subtype(subtypeSpec=value_range_constraint(0, 9)).clone(9)).setMaxAccess('readcreate') if mibBuilder.loadTexts: nncCrPvpcBwdAbrDynTrfcRdf.setStatus('current') nnc_cr_pvpc_src_billing_flag = mib_table_column((1, 3, 6, 1, 4, 1, 123, 3, 79, 1, 1, 1, 14), integer32().subtype(subtypeSpec=constraints_union(single_value_constraint(0, 1))).clone(namedValues=named_values(('disabled', 0), ('enabled', 1))).clone('disabled')).setMaxAccess('readcreate') if mibBuilder.loadTexts: nncCrPvpcSrcBillingFlag.setStatus('current') nnc_cr_pvpc_dst_billing_flag = mib_table_column((1, 3, 6, 1, 4, 1, 123, 3, 79, 1, 1, 1, 15), integer32().subtype(subtypeSpec=constraints_union(single_value_constraint(0, 1))).clone(namedValues=named_values(('disabled', 0), ('enabled', 1))).clone('disabled')).setMaxAccess('readcreate') if mibBuilder.loadTexts: nncCrPvpcDstBillingFlag.setStatus('current') nnc_cr_pvpc_fwd_tm_traffic_descriptor = mib_table_column((1, 3, 6, 1, 4, 1, 123, 3, 79, 1, 1, 1, 16), integer32().subtype(subtypeSpec=constraints_union(single_value_constraint(0, 1, 2, 3, 4, 5))).clone(namedValues=named_values(('none', 0), ('tagAll', 1), ('p0Plus1', 2), ('p0Plus1SlashS0Plus1', 3), ('p0Plus1SlashS0', 4), ('p0Plus1SlashM0Plus1', 5))).clone('p0Plus1SlashS0Plus1')).setMaxAccess('readcreate') if mibBuilder.loadTexts: nncCrPvpcFwdTmTrafficDescriptor.setStatus('current') nnc_cr_pvpc_fwd_tm_policing_option = mib_table_column((1, 3, 6, 1, 4, 1, 123, 3, 79, 1, 1, 1, 17), integer32().subtype(subtypeSpec=constraints_union(single_value_constraint(0, 1, 2, 3))).clone(namedValues=named_values(('none', 0), ('disabled', 1), ('tag', 2), ('discard', 3))).clone('disabled')).setMaxAccess('readcreate') if mibBuilder.loadTexts: nncCrPvpcFwdTmPolicingOption.setStatus('current') nnc_cr_pvpc_fwd_tm_bucket_one_rate = mib_table_column((1, 3, 6, 1, 4, 1, 123, 3, 79, 1, 1, 1, 18), integer32().subtype(subtypeSpec=value_range_constraint(0, 2488320)).clone(1000)).setMaxAccess('readcreate') if mibBuilder.loadTexts: nncCrPvpcFwdTmBucketOneRate.setStatus('current') nnc_cr_pvpc_fwd_tm_bucket_one_cdvt = mib_table_column((1, 3, 6, 1, 4, 1, 123, 3, 79, 1, 1, 1, 19), integer32().subtype(subtypeSpec=value_range_constraint(1, 190000)).clone(250)).setMaxAccess('readcreate') if mibBuilder.loadTexts: nncCrPvpcFwdTmBucketOneCdvt.setStatus('current') nnc_cr_pvpc_fwd_tm_bucket_two_rate = mib_table_column((1, 3, 6, 1, 4, 1, 123, 3, 79, 1, 1, 1, 20), integer32().subtype(subtypeSpec=value_range_constraint(0, 2488320)).clone(1000)).setMaxAccess('readcreate') if mibBuilder.loadTexts: nncCrPvpcFwdTmBucketTwoRate.setStatus('current') nnc_cr_pvpc_fwd_tm_bucket_two_mbs = mib_table_column((1, 3, 6, 1, 4, 1, 123, 3, 79, 1, 1, 1, 21), integer32().subtype(subtypeSpec=value_range_constraint(1, 10000)).clone(32)).setMaxAccess('readcreate') if mibBuilder.loadTexts: nncCrPvpcFwdTmBucketTwoMbs.setStatus('current') nnc_cr_pvpc_fwd_tm_cdv = mib_table_column((1, 3, 6, 1, 4, 1, 123, 3, 79, 1, 1, 1, 22), integer32().subtype(subtypeSpec=value_range_constraint(250, 10000)).clone(10000)).setMaxAccess('readcreate') if mibBuilder.loadTexts: nncCrPvpcFwdTmCdv.setStatus('current') nnc_cr_pvpc_fwd_tm_clr = mib_table_column((1, 3, 6, 1, 4, 1, 123, 3, 79, 1, 1, 1, 23), integer32().subtype(subtypeSpec=value_range_constraint(1, 7)).clone(7)).setMaxAccess('readcreate') if mibBuilder.loadTexts: nncCrPvpcFwdTmClr.setStatus('current') nnc_cr_pvpc_bwd_tm_traffic_descriptor = mib_table_column((1, 3, 6, 1, 4, 1, 123, 3, 79, 1, 1, 1, 24), integer32().subtype(subtypeSpec=constraints_union(single_value_constraint(0, 1, 2, 3, 4, 5))).clone(namedValues=named_values(('none', 0), ('tagAll', 1), ('p0Plus1', 2), ('p0Plus1SlashS0Plus1', 3), ('p0Plus1SlashS0', 4), ('p0Plus1SlashM0Plus1', 5))).clone('p0Plus1SlashS0Plus1')).setMaxAccess('readcreate') if mibBuilder.loadTexts: nncCrPvpcBwdTmTrafficDescriptor.setStatus('current') nnc_cr_pvpc_bwd_tm_policing_option = mib_table_column((1, 3, 6, 1, 4, 1, 123, 3, 79, 1, 1, 1, 25), integer32().subtype(subtypeSpec=constraints_union(single_value_constraint(0, 1, 2, 3))).clone(namedValues=named_values(('none', 0), ('disabled', 1), ('tag', 2), ('discard', 3))).clone('disabled')).setMaxAccess('readcreate') if mibBuilder.loadTexts: nncCrPvpcBwdTmPolicingOption.setStatus('current') nnc_cr_pvpc_bwd_tm_bucket_one_rate = mib_table_column((1, 3, 6, 1, 4, 1, 123, 3, 79, 1, 1, 1, 26), integer32().subtype(subtypeSpec=value_range_constraint(0, 2488320)).clone(1000)).setMaxAccess('readcreate') if mibBuilder.loadTexts: nncCrPvpcBwdTmBucketOneRate.setStatus('current') nnc_cr_pvpc_bwd_tm_bucket_one_cdvt = mib_table_column((1, 3, 6, 1, 4, 1, 123, 3, 79, 1, 1, 1, 27), integer32().subtype(subtypeSpec=value_range_constraint(1, 190000)).clone(250)).setMaxAccess('readcreate') if mibBuilder.loadTexts: nncCrPvpcBwdTmBucketOneCdvt.setStatus('current') nnc_cr_pvpc_bwd_tm_bucket_two_rate = mib_table_column((1, 3, 6, 1, 4, 1, 123, 3, 79, 1, 1, 1, 28), integer32().subtype(subtypeSpec=value_range_constraint(0, 2488320)).clone(1000)).setMaxAccess('readcreate') if mibBuilder.loadTexts: nncCrPvpcBwdTmBucketTwoRate.setStatus('current') nnc_cr_pvpc_bwd_tm_bucket_two_mbs = mib_table_column((1, 3, 6, 1, 4, 1, 123, 3, 79, 1, 1, 1, 29), integer32().subtype(subtypeSpec=value_range_constraint(1, 10000)).clone(32)).setMaxAccess('readcreate') if mibBuilder.loadTexts: nncCrPvpcBwdTmBucketTwoMbs.setStatus('current') nnc_cr_pvpc_bwd_tm_cdv = mib_table_column((1, 3, 6, 1, 4, 1, 123, 3, 79, 1, 1, 1, 30), integer32().subtype(subtypeSpec=value_range_constraint(250, 10000)).clone(10000)).setMaxAccess('readcreate') if mibBuilder.loadTexts: nncCrPvpcBwdTmCdv.setStatus('current') nnc_cr_pvpc_bwd_tm_clr = mib_table_column((1, 3, 6, 1, 4, 1, 123, 3, 79, 1, 1, 1, 31), integer32().subtype(subtypeSpec=value_range_constraint(1, 7)).clone(7)).setMaxAccess('readcreate') if mibBuilder.loadTexts: nncCrPvpcBwdTmClr.setStatus('current') nnc_cr_pvpc_src_als_config = mib_table_column((1, 3, 6, 1, 4, 1, 123, 3, 79, 1, 1, 1, 32), integer32().subtype(subtypeSpec=constraints_union(single_value_constraint(0, 1))).clone(namedValues=named_values(('disabled', 0), ('enabled', 1))).clone('disabled')).setMaxAccess('readcreate') if mibBuilder.loadTexts: nncCrPvpcSrcAlsConfig.setStatus('current') nnc_cr_pvpc_dst_als_config = mib_table_column((1, 3, 6, 1, 4, 1, 123, 3, 79, 1, 1, 1, 33), integer32().subtype(subtypeSpec=constraints_union(single_value_constraint(0, 1))).clone(namedValues=named_values(('disabled', 0), ('enabled', 1))).clone('disabled')).setMaxAccess('readcreate') if mibBuilder.loadTexts: nncCrPvpcDstAlsConfig.setStatus('current') nnc_cr_pvpc_creator = mib_table_column((1, 3, 6, 1, 4, 1, 123, 3, 79, 1, 1, 1, 34), integer32().subtype(subtypeSpec=constraints_union(single_value_constraint(0, 1, 2, 9))).clone(namedValues=named_values(('unknown', 0), ('nmti', 1), ('nm5620', 2), ('snmp', 9)))).setMaxAccess('readonly') if mibBuilder.loadTexts: nncCrPvpcCreator.setStatus('current') nnc_cr_pvpc_row_status = mib_table_column((1, 3, 6, 1, 4, 1, 123, 3, 79, 1, 1, 1, 35), row_status()).setMaxAccess('readcreate') if mibBuilder.loadTexts: nncCrPvpcRowStatus.setStatus('current') nnc_cr_pvcc_table = mib_table((1, 3, 6, 1, 4, 1, 123, 3, 79, 1, 2)) if mibBuilder.loadTexts: nncCrPvccTable.setStatus('current') nnc_cr_pvcc_table_entry = mib_table_row((1, 3, 6, 1, 4, 1, 123, 3, 79, 1, 2, 1)).setIndexNames((0, 'NNCEXTPVC-MIB', 'nncCrPvccSrcIfIndex'), (0, 'NNCEXTPVC-MIB', 'nncCrPvccSrcVpi'), (0, 'NNCEXTPVC-MIB', 'nncCrPvccSrcVci'), (0, 'NNCEXTPVC-MIB', 'nncCrPvccDstIfIndex'), (0, 'NNCEXTPVC-MIB', 'nncCrPvccDstVpi'), (0, 'NNCEXTPVC-MIB', 'nncCrPvccDstVci')) if mibBuilder.loadTexts: nncCrPvccTableEntry.setStatus('current') nnc_cr_pvcc_src_if_index = mib_table_column((1, 3, 6, 1, 4, 1, 123, 3, 79, 1, 2, 1, 1), interface_index()) if mibBuilder.loadTexts: nncCrPvccSrcIfIndex.setStatus('current') nnc_cr_pvcc_src_vpi = mib_table_column((1, 3, 6, 1, 4, 1, 123, 3, 79, 1, 2, 1, 2), integer32().subtype(subtypeSpec=value_range_constraint(0, 4095))) if mibBuilder.loadTexts: nncCrPvccSrcVpi.setStatus('current') nnc_cr_pvcc_src_vci = mib_table_column((1, 3, 6, 1, 4, 1, 123, 3, 79, 1, 2, 1, 3), integer32().subtype(subtypeSpec=value_range_constraint(0, 65535))) if mibBuilder.loadTexts: nncCrPvccSrcVci.setStatus('current') nnc_cr_pvcc_dst_if_index = mib_table_column((1, 3, 6, 1, 4, 1, 123, 3, 79, 1, 2, 1, 4), interface_index()) if mibBuilder.loadTexts: nncCrPvccDstIfIndex.setStatus('current') nnc_cr_pvcc_dst_vpi = mib_table_column((1, 3, 6, 1, 4, 1, 123, 3, 79, 1, 2, 1, 5), integer32().subtype(subtypeSpec=value_range_constraint(0, 4095))) if mibBuilder.loadTexts: nncCrPvccDstVpi.setStatus('current') nnc_cr_pvcc_dst_vci = mib_table_column((1, 3, 6, 1, 4, 1, 123, 3, 79, 1, 2, 1, 6), integer32().subtype(subtypeSpec=value_range_constraint(0, 65535))) if mibBuilder.loadTexts: nncCrPvccDstVci.setStatus('current') nnc_cr_pvcc_cast_type = mib_table_column((1, 3, 6, 1, 4, 1, 123, 3, 79, 1, 2, 1, 7), integer32().subtype(subtypeSpec=constraints_union(single_value_constraint(1, 2))).clone(namedValues=named_values(('p2p', 1), ('p2mp', 2))).clone('p2p')).setMaxAccess('readcreate') if mibBuilder.loadTexts: nncCrPvccCastType.setStatus('current') nnc_cr_pvcc_fwd_service_category = mib_table_column((1, 3, 6, 1, 4, 1, 123, 3, 79, 1, 2, 1, 8), integer32().subtype(subtypeSpec=constraints_union(single_value_constraint(1, 2, 3, 4, 6))).clone(namedValues=named_values(('cbr', 1), ('nrtvbr', 2), ('abr', 3), ('ubr', 4), ('rtvbr', 6))).clone('nrtvbr')).setMaxAccess('readcreate') if mibBuilder.loadTexts: nncCrPvccFwdServiceCategory.setStatus('current') nnc_cr_pvcc_bwd_service_category = mib_table_column((1, 3, 6, 1, 4, 1, 123, 3, 79, 1, 2, 1, 9), integer32().subtype(subtypeSpec=constraints_union(single_value_constraint(1, 2, 3, 4, 6))).clone(namedValues=named_values(('cbr', 1), ('nrtvbr', 2), ('abr', 3), ('ubr', 4), ('rtvbr', 6))).clone('nrtvbr')).setMaxAccess('readcreate') if mibBuilder.loadTexts: nncCrPvccBwdServiceCategory.setStatus('current') nnc_cr_pvcc_fwd_abr_dyn_trfc_icr = mib_table_column((1, 3, 6, 1, 4, 1, 123, 3, 79, 1, 2, 1, 10), integer32().subtype(subtypeSpec=value_range_constraint(0, 2488320)).clone(1000)).setMaxAccess('readcreate') if mibBuilder.loadTexts: nncCrPvccFwdAbrDynTrfcIcr.setStatus('current') nnc_cr_pvcc_fwd_abr_dyn_trfc_rif = mib_table_column((1, 3, 6, 1, 4, 1, 123, 3, 79, 1, 2, 1, 11), integer32().subtype(subtypeSpec=value_range_constraint(0, 9)).clone(9)).setMaxAccess('readcreate') if mibBuilder.loadTexts: nncCrPvccFwdAbrDynTrfcRif.setStatus('current') nnc_cr_pvcc_fwd_abr_dyn_trfc_rdf = mib_table_column((1, 3, 6, 1, 4, 1, 123, 3, 79, 1, 2, 1, 12), integer32().subtype(subtypeSpec=value_range_constraint(0, 9)).clone(9)).setMaxAccess('readcreate') if mibBuilder.loadTexts: nncCrPvccFwdAbrDynTrfcRdf.setStatus('current') nnc_cr_pvcc_bwd_abr_dyn_trfc_icr = mib_table_column((1, 3, 6, 1, 4, 1, 123, 3, 79, 1, 2, 1, 13), integer32().subtype(subtypeSpec=value_range_constraint(0, 2488320)).clone(1000)).setMaxAccess('readcreate') if mibBuilder.loadTexts: nncCrPvccBwdAbrDynTrfcIcr.setStatus('current') nnc_cr_pvcc_bwd_abr_dyn_trfc_rif = mib_table_column((1, 3, 6, 1, 4, 1, 123, 3, 79, 1, 2, 1, 14), integer32().subtype(subtypeSpec=value_range_constraint(0, 9)).clone(9)).setMaxAccess('readcreate') if mibBuilder.loadTexts: nncCrPvccBwdAbrDynTrfcRif.setStatus('current') nnc_cr_pvcc_bwd_abr_dyn_trfc_rdf = mib_table_column((1, 3, 6, 1, 4, 1, 123, 3, 79, 1, 2, 1, 15), integer32().subtype(subtypeSpec=value_range_constraint(0, 9)).clone(9)).setMaxAccess('readcreate') if mibBuilder.loadTexts: nncCrPvccBwdAbrDynTrfcRdf.setStatus('current') nnc_cr_pvcc_src_billing_flag = mib_table_column((1, 3, 6, 1, 4, 1, 123, 3, 79, 1, 2, 1, 16), integer32().subtype(subtypeSpec=constraints_union(single_value_constraint(0, 1))).clone(namedValues=named_values(('disabled', 0), ('enabled', 1))).clone('disabled')).setMaxAccess('readcreate') if mibBuilder.loadTexts: nncCrPvccSrcBillingFlag.setStatus('current') nnc_cr_pvcc_dst_billing_flag = mib_table_column((1, 3, 6, 1, 4, 1, 123, 3, 79, 1, 2, 1, 17), integer32().subtype(subtypeSpec=constraints_union(single_value_constraint(0, 1))).clone(namedValues=named_values(('disabled', 0), ('enabled', 1))).clone('disabled')).setMaxAccess('readcreate') if mibBuilder.loadTexts: nncCrPvccDstBillingFlag.setStatus('current') nnc_cr_pvcc_fwd_tm_traffic_descriptor = mib_table_column((1, 3, 6, 1, 4, 1, 123, 3, 79, 1, 2, 1, 18), integer32().subtype(subtypeSpec=constraints_union(single_value_constraint(0, 1, 2, 3, 4, 5))).clone(namedValues=named_values(('none', 0), ('tagAll', 1), ('p0Plus1', 2), ('p0Plus1SlashS0Plus1', 3), ('p0Plus1SlashS0', 4), ('p0Plus1SlashM0Plus1', 5))).clone('p0Plus1SlashS0Plus1')).setMaxAccess('readcreate') if mibBuilder.loadTexts: nncCrPvccFwdTmTrafficDescriptor.setStatus('current') nnc_cr_pvcc_fwd_tm_policing_option = mib_table_column((1, 3, 6, 1, 4, 1, 123, 3, 79, 1, 2, 1, 19), integer32().subtype(subtypeSpec=constraints_union(single_value_constraint(0, 1, 2, 3))).clone(namedValues=named_values(('none', 0), ('disabled', 1), ('tag', 2), ('discard', 3))).clone('disabled')).setMaxAccess('readcreate') if mibBuilder.loadTexts: nncCrPvccFwdTmPolicingOption.setStatus('current') nnc_cr_pvcc_fwd_tm_bucket_one_rate = mib_table_column((1, 3, 6, 1, 4, 1, 123, 3, 79, 1, 2, 1, 20), integer32().subtype(subtypeSpec=value_range_constraint(0, 2488320)).clone(1000)).setMaxAccess('readcreate') if mibBuilder.loadTexts: nncCrPvccFwdTmBucketOneRate.setStatus('current') nnc_cr_pvcc_fwd_tm_bucket_one_cdvt = mib_table_column((1, 3, 6, 1, 4, 1, 123, 3, 79, 1, 2, 1, 21), integer32().subtype(subtypeSpec=value_range_constraint(1, 190000)).clone(250)).setMaxAccess('readcreate') if mibBuilder.loadTexts: nncCrPvccFwdTmBucketOneCdvt.setStatus('current') nnc_cr_pvcc_fwd_tm_bucket_two_rate = mib_table_column((1, 3, 6, 1, 4, 1, 123, 3, 79, 1, 2, 1, 22), integer32().subtype(subtypeSpec=value_range_constraint(0, 2488320)).clone(1000)).setMaxAccess('readcreate') if mibBuilder.loadTexts: nncCrPvccFwdTmBucketTwoRate.setStatus('current') nnc_cr_pvcc_fwd_tm_bucket_two_mbs = mib_table_column((1, 3, 6, 1, 4, 1, 123, 3, 79, 1, 2, 1, 23), integer32().subtype(subtypeSpec=value_range_constraint(1, 10000)).clone(32)).setMaxAccess('readcreate') if mibBuilder.loadTexts: nncCrPvccFwdTmBucketTwoMbs.setStatus('current') nnc_cr_pvcc_fwd_tm_cdv = mib_table_column((1, 3, 6, 1, 4, 1, 123, 3, 79, 1, 2, 1, 24), integer32().subtype(subtypeSpec=value_range_constraint(250, 10000)).clone(10000)).setMaxAccess('readcreate') if mibBuilder.loadTexts: nncCrPvccFwdTmCdv.setStatus('current') nnc_cr_pvcc_fwd_tm_clr = mib_table_column((1, 3, 6, 1, 4, 1, 123, 3, 79, 1, 2, 1, 25), integer32().subtype(subtypeSpec=value_range_constraint(1, 7)).clone(7)).setMaxAccess('readcreate') if mibBuilder.loadTexts: nncCrPvccFwdTmClr.setStatus('current') nnc_cr_pvcc_fwd_tm_frame_discard = mib_table_column((1, 3, 6, 1, 4, 1, 123, 3, 79, 1, 2, 1, 26), integer32().subtype(subtypeSpec=constraints_union(single_value_constraint(0, 1))).clone(namedValues=named_values(('disabled', 0), ('enabled', 1))).clone('disabled')).setMaxAccess('readcreate') if mibBuilder.loadTexts: nncCrPvccFwdTmFrameDiscard.setStatus('current') nnc_cr_pvcc_bwd_tm_traffic_descriptor = mib_table_column((1, 3, 6, 1, 4, 1, 123, 3, 79, 1, 2, 1, 27), integer32().subtype(subtypeSpec=constraints_union(single_value_constraint(0, 1, 2, 3, 4, 5))).clone(namedValues=named_values(('none', 0), ('tagAll', 1), ('p0Plus1', 2), ('p0Plus1SlashS0Plus1', 3), ('p0Plus1SlashS0', 4), ('p0Plus1SlashM0Plus1', 5))).clone('p0Plus1SlashS0Plus1')).setMaxAccess('readcreate') if mibBuilder.loadTexts: nncCrPvccBwdTmTrafficDescriptor.setStatus('current') nnc_cr_pvcc_bwd_tm_policing_option = mib_table_column((1, 3, 6, 1, 4, 1, 123, 3, 79, 1, 2, 1, 28), integer32().subtype(subtypeSpec=constraints_union(single_value_constraint(0, 1, 2, 3))).clone(namedValues=named_values(('none', 0), ('disabled', 1), ('tag', 2), ('discard', 3))).clone('disabled')).setMaxAccess('readcreate') if mibBuilder.loadTexts: nncCrPvccBwdTmPolicingOption.setStatus('current') nnc_cr_pvcc_bwd_tm_bucket_one_rate = mib_table_column((1, 3, 6, 1, 4, 1, 123, 3, 79, 1, 2, 1, 29), integer32().subtype(subtypeSpec=value_range_constraint(0, 2488320)).clone(1000)).setMaxAccess('readcreate') if mibBuilder.loadTexts: nncCrPvccBwdTmBucketOneRate.setStatus('current') nnc_cr_pvcc_bwd_tm_bucket_one_cdvt = mib_table_column((1, 3, 6, 1, 4, 1, 123, 3, 79, 1, 2, 1, 30), integer32().subtype(subtypeSpec=value_range_constraint(1, 190000)).clone(250)).setMaxAccess('readcreate') if mibBuilder.loadTexts: nncCrPvccBwdTmBucketOneCdvt.setStatus('current') nnc_cr_pvcc_bwd_tm_bucket_two_rate = mib_table_column((1, 3, 6, 1, 4, 1, 123, 3, 79, 1, 2, 1, 31), integer32().subtype(subtypeSpec=value_range_constraint(0, 2488320)).clone(1000)).setMaxAccess('readcreate') if mibBuilder.loadTexts: nncCrPvccBwdTmBucketTwoRate.setStatus('current') nnc_cr_pvcc_bwd_tm_bucket_two_mbs = mib_table_column((1, 3, 6, 1, 4, 1, 123, 3, 79, 1, 2, 1, 32), integer32().subtype(subtypeSpec=value_range_constraint(1, 10000)).clone(32)).setMaxAccess('readcreate') if mibBuilder.loadTexts: nncCrPvccBwdTmBucketTwoMbs.setStatus('current') nnc_cr_pvcc_bwd_tm_cdv = mib_table_column((1, 3, 6, 1, 4, 1, 123, 3, 79, 1, 2, 1, 33), integer32().subtype(subtypeSpec=value_range_constraint(250, 10000)).clone(10000)).setMaxAccess('readcreate') if mibBuilder.loadTexts: nncCrPvccBwdTmCdv.setStatus('current') nnc_cr_pvcc_bwd_tm_clr = mib_table_column((1, 3, 6, 1, 4, 1, 123, 3, 79, 1, 2, 1, 34), integer32().subtype(subtypeSpec=value_range_constraint(1, 7)).clone(7)).setMaxAccess('readcreate') if mibBuilder.loadTexts: nncCrPvccBwdTmClr.setStatus('current') nnc_cr_pvcc_bwd_tm_frame_discard = mib_table_column((1, 3, 6, 1, 4, 1, 123, 3, 79, 1, 2, 1, 35), integer32().subtype(subtypeSpec=constraints_union(single_value_constraint(0, 1))).clone(namedValues=named_values(('disabled', 0), ('enabled', 1))).clone('disabled')).setMaxAccess('readcreate') if mibBuilder.loadTexts: nncCrPvccBwdTmFrameDiscard.setStatus('current') nnc_cr_pvcc_src_als_config = mib_table_column((1, 3, 6, 1, 4, 1, 123, 3, 79, 1, 2, 1, 36), integer32().subtype(subtypeSpec=constraints_union(single_value_constraint(0, 1))).clone(namedValues=named_values(('disabled', 0), ('enabled', 1))).clone('disabled')).setMaxAccess('readcreate') if mibBuilder.loadTexts: nncCrPvccSrcAlsConfig.setStatus('current') nnc_cr_pvcc_dst_als_config = mib_table_column((1, 3, 6, 1, 4, 1, 123, 3, 79, 1, 2, 1, 37), integer32().subtype(subtypeSpec=constraints_union(single_value_constraint(0, 1))).clone(namedValues=named_values(('disabled', 0), ('enabled', 1))).clone('disabled')).setMaxAccess('readcreate') if mibBuilder.loadTexts: nncCrPvccDstAlsConfig.setStatus('current') nnc_cr_pvcc_creator = mib_table_column((1, 3, 6, 1, 4, 1, 123, 3, 79, 1, 2, 1, 38), integer32().subtype(subtypeSpec=constraints_union(single_value_constraint(0, 1, 2, 9))).clone(namedValues=named_values(('unknown', 0), ('nmti', 1), ('nm5620', 2), ('snmp', 9)))).setMaxAccess('readonly') if mibBuilder.loadTexts: nncCrPvccCreator.setStatus('current') nnc_cr_pvcc_row_status = mib_table_column((1, 3, 6, 1, 4, 1, 123, 3, 79, 1, 2, 1, 39), row_status()).setMaxAccess('readcreate') if mibBuilder.loadTexts: nncCrPvccRowStatus.setStatus('current') nnc_cr_pvpc_group = object_group((1, 3, 6, 1, 4, 1, 123, 3, 79, 3, 1)).setObjects(('NNCEXTPVC-MIB', 'nncCrPvpcSrcIfIndex'), ('NNCEXTPVC-MIB', 'nncCrPvpcSrcVpi'), ('NNCEXTPVC-MIB', 'nncCrPvpcDstIfIndex'), ('NNCEXTPVC-MIB', 'nncCrPvpcDstVpi'), ('NNCEXTPVC-MIB', 'nncCrPvpcCastType'), ('NNCEXTPVC-MIB', 'nncCrPvpcFwdServiceCategory'), ('NNCEXTPVC-MIB', 'nncCrPvpcBwdServiceCategory'), ('NNCEXTPVC-MIB', 'nncCrPvpcFwdAbrDynTrfcIcr'), ('NNCEXTPVC-MIB', 'nncCrPvpcFwdAbrDynTrfcRif'), ('NNCEXTPVC-MIB', 'nncCrPvpcFwdAbrDynTrfcRdf'), ('NNCEXTPVC-MIB', 'nncCrPvpcBwdAbrDynTrfcIcr'), ('NNCEXTPVC-MIB', 'nncCrPvpcBwdAbrDynTrfcRif'), ('NNCEXTPVC-MIB', 'nncCrPvpcBwdAbrDynTrfcRdf'), ('NNCEXTPVC-MIB', 'nncCrPvpcSrcBillingFlag'), ('NNCEXTPVC-MIB', 'nncCrPvpcDstBillingFlag'), ('NNCEXTPVC-MIB', 'nncCrPvpcFwdTmTrafficDescriptor'), ('NNCEXTPVC-MIB', 'nncCrPvpcFwdTmPolicingOption'), ('NNCEXTPVC-MIB', 'nncCrPvpcFwdTmBucketOneRate'), ('NNCEXTPVC-MIB', 'nncCrPvpcFwdTmBucketOneCdvt'), ('NNCEXTPVC-MIB', 'nncCrPvpcFwdTmBucketTwoRate'), ('NNCEXTPVC-MIB', 'nncCrPvpcFwdTmBucketTwoMbs'), ('NNCEXTPVC-MIB', 'nncCrPvpcFwdTmCdv'), ('NNCEXTPVC-MIB', 'nncCrPvpcFwdTmClr'), ('NNCEXTPVC-MIB', 'nncCrPvpcBwdTmTrafficDescriptor'), ('NNCEXTPVC-MIB', 'nncCrPvpcBwdTmPolicingOption'), ('NNCEXTPVC-MIB', 'nncCrPvpcBwdTmBucketOneRate'), ('NNCEXTPVC-MIB', 'nncCrPvpcBwdTmBucketOneCdvt'), ('NNCEXTPVC-MIB', 'nncCrPvpcBwdTmBucketTwoRate'), ('NNCEXTPVC-MIB', 'nncCrPvpcBwdTmBucketTwoMbs'), ('NNCEXTPVC-MIB', 'nncCrPvpcBwdTmCdv'), ('NNCEXTPVC-MIB', 'nncCrPvpcBwdTmClr'), ('NNCEXTPVC-MIB', 'nncCrPvpcSrcAlsConfig'), ('NNCEXTPVC-MIB', 'nncCrPvpcDstAlsConfig'), ('NNCEXTPVC-MIB', 'nncCrPvpcCreator'), ('NNCEXTPVC-MIB', 'nncCrPvpcRowStatus')) if getattr(mibBuilder, 'version', (0, 0, 0)) > (4, 4, 0): nnc_cr_pvpc_group = nncCrPvpcGroup.setStatus('current') nnc_cr_pvcc_group = object_group((1, 3, 6, 1, 4, 1, 123, 3, 79, 3, 2)).setObjects(('NNCEXTPVC-MIB', 'nncCrPvccSrcIfIndex'), ('NNCEXTPVC-MIB', 'nncCrPvccSrcVpi'), ('NNCEXTPVC-MIB', 'nncCrPvccSrcVci'), ('NNCEXTPVC-MIB', 'nncCrPvccDstIfIndex'), ('NNCEXTPVC-MIB', 'nncCrPvccDstVpi'), ('NNCEXTPVC-MIB', 'nncCrPvccDstVci'), ('NNCEXTPVC-MIB', 'nncCrPvccCastType'), ('NNCEXTPVC-MIB', 'nncCrPvccFwdServiceCategory'), ('NNCEXTPVC-MIB', 'nncCrPvccBwdServiceCategory'), ('NNCEXTPVC-MIB', 'nncCrPvccFwdAbrDynTrfcIcr'), ('NNCEXTPVC-MIB', 'nncCrPvccFwdAbrDynTrfcRif'), ('NNCEXTPVC-MIB', 'nncCrPvccFwdAbrDynTrfcRdf'), ('NNCEXTPVC-MIB', 'nncCrPvccBwdAbrDynTrfcIcr'), ('NNCEXTPVC-MIB', 'nncCrPvccBwdAbrDynTrfcRif'), ('NNCEXTPVC-MIB', 'nncCrPvccBwdAbrDynTrfcRdf'), ('NNCEXTPVC-MIB', 'nncCrPvccSrcBillingFlag'), ('NNCEXTPVC-MIB', 'nncCrPvccDstBillingFlag'), ('NNCEXTPVC-MIB', 'nncCrPvccFwdTmTrafficDescriptor'), ('NNCEXTPVC-MIB', 'nncCrPvccFwdTmPolicingOption'), ('NNCEXTPVC-MIB', 'nncCrPvccFwdTmBucketOneRate'), ('NNCEXTPVC-MIB', 'nncCrPvccFwdTmBucketOneCdvt'), ('NNCEXTPVC-MIB', 'nncCrPvccFwdTmBucketTwoRate'), ('NNCEXTPVC-MIB', 'nncCrPvccFwdTmBucketTwoMbs'), ('NNCEXTPVC-MIB', 'nncCrPvccFwdTmCdv'), ('NNCEXTPVC-MIB', 'nncCrPvccFwdTmClr'), ('NNCEXTPVC-MIB', 'nncCrPvccFwdTmFrameDiscard'), ('NNCEXTPVC-MIB', 'nncCrPvccBwdTmTrafficDescriptor'), ('NNCEXTPVC-MIB', 'nncCrPvccBwdTmPolicingOption'), ('NNCEXTPVC-MIB', 'nncCrPvccBwdTmBucketOneRate'), ('NNCEXTPVC-MIB', 'nncCrPvccBwdTmBucketOneCdvt'), ('NNCEXTPVC-MIB', 'nncCrPvccBwdTmBucketTwoRate'), ('NNCEXTPVC-MIB', 'nncCrPvccBwdTmBucketTwoMbs'), ('NNCEXTPVC-MIB', 'nncCrPvccBwdTmCdv'), ('NNCEXTPVC-MIB', 'nncCrPvccBwdTmClr'), ('NNCEXTPVC-MIB', 'nncCrPvccBwdTmFrameDiscard'), ('NNCEXTPVC-MIB', 'nncCrPvccSrcAlsConfig'), ('NNCEXTPVC-MIB', 'nncCrPvccDstAlsConfig'), ('NNCEXTPVC-MIB', 'nncCrPvccCreator'), ('NNCEXTPVC-MIB', 'nncCrPvccRowStatus')) if getattr(mibBuilder, 'version', (0, 0, 0)) > (4, 4, 0): nnc_cr_pvcc_group = nncCrPvccGroup.setStatus('current') nnc_pvc_compliance = module_compliance((1, 3, 6, 1, 4, 1, 123, 3, 79, 4, 1)).setObjects(('NNCEXTPVC-MIB', 'nncCrPvpcGroup'), ('NNCEXTPVC-MIB', 'nncCrPvccGroup')) if getattr(mibBuilder, 'version', (0, 0, 0)) > (4, 4, 0): nnc_pvc_compliance = nncPvcCompliance.setStatus('current') mibBuilder.exportSymbols('NNCEXTPVC-MIB', nncCrPvpcBwdTmClr=nncCrPvpcBwdTmClr, nncCrPvpcSrcBillingFlag=nncCrPvpcSrcBillingFlag, nncCrPvccDstIfIndex=nncCrPvccDstIfIndex, nncExtPvcGroups=nncExtPvcGroups, nncCrPvpcFwdAbrDynTrfcIcr=nncCrPvpcFwdAbrDynTrfcIcr, nncCrPvccFwdAbrDynTrfcIcr=nncCrPvccFwdAbrDynTrfcIcr, nncCrPvpcFwdServiceCategory=nncCrPvpcFwdServiceCategory, nncCrPvpcTableEntry=nncCrPvpcTableEntry, nncCrPvccCastType=nncCrPvccCastType, nncCrPvccBwdAbrDynTrfcRif=nncCrPvccBwdAbrDynTrfcRif, nncCrPvccBwdAbrDynTrfcIcr=nncCrPvccBwdAbrDynTrfcIcr, nncCrPvpcFwdTmBucketTwoMbs=nncCrPvpcFwdTmBucketTwoMbs, nncCrPvccCreator=nncCrPvccCreator, nncCrPvccFwdTmBucketTwoRate=nncCrPvccFwdTmBucketTwoRate, nncCrPvpcSrcIfIndex=nncCrPvpcSrcIfIndex, nncCrPvccBwdTmBucketTwoRate=nncCrPvccBwdTmBucketTwoRate, nncCrPvpcBwdAbrDynTrfcIcr=nncCrPvpcBwdAbrDynTrfcIcr, nncCrPvpcBwdTmBucketOneCdvt=nncCrPvpcBwdTmBucketOneCdvt, nncCrPvccFwdTmFrameDiscard=nncCrPvccFwdTmFrameDiscard, nncCrPvccDstVci=nncCrPvccDstVci, nncExtPvcObjects=nncExtPvcObjects, nncCrPvpcDstIfIndex=nncCrPvpcDstIfIndex, nncCrPvccTableEntry=nncCrPvccTableEntry, nncCrPvccSrcVci=nncCrPvccSrcVci, nncCrPvccRowStatus=nncCrPvccRowStatus, PYSNMP_MODULE_ID=nncExtPvc, nncCrPvccSrcVpi=nncCrPvccSrcVpi, nncCrPvccFwdTmBucketTwoMbs=nncCrPvccFwdTmBucketTwoMbs, nncCrPvccBwdTmFrameDiscard=nncCrPvccBwdTmFrameDiscard, nncCrPvpcFwdAbrDynTrfcRdf=nncCrPvpcFwdAbrDynTrfcRdf, nncCrPvccFwdTmCdv=nncCrPvccFwdTmCdv, nncCrPvpcDstAlsConfig=nncCrPvpcDstAlsConfig, nncCrPvpcBwdServiceCategory=nncCrPvpcBwdServiceCategory, nncCrPvpcFwdTmPolicingOption=nncCrPvpcFwdTmPolicingOption, nncPvcCompliance=nncPvcCompliance, nncCrPvpcBwdTmTrafficDescriptor=nncCrPvpcBwdTmTrafficDescriptor, nncCrPvccFwdTmTrafficDescriptor=nncCrPvccFwdTmTrafficDescriptor, nncCrPvccBwdTmBucketTwoMbs=nncCrPvccBwdTmBucketTwoMbs, nncCrPvccBwdTmPolicingOption=nncCrPvccBwdTmPolicingOption, nncCrPvccFwdTmBucketOneRate=nncCrPvccFwdTmBucketOneRate, nncCrPvccBwdAbrDynTrfcRdf=nncCrPvccBwdAbrDynTrfcRdf, nncCrPvccSrcBillingFlag=nncCrPvccSrcBillingFlag, nncCrPvccFwdTmBucketOneCdvt=nncCrPvccFwdTmBucketOneCdvt, nncCrPvccBwdTmBucketOneRate=nncCrPvccBwdTmBucketOneRate, nncCrPvpcTable=nncCrPvpcTable, nncCrPvpcDstBillingFlag=nncCrPvpcDstBillingFlag, nncCrPvpcFwdTmCdv=nncCrPvpcFwdTmCdv, nncCrPvccDstBillingFlag=nncCrPvccDstBillingFlag, nncCrPvccFwdAbrDynTrfcRdf=nncCrPvccFwdAbrDynTrfcRdf, nncExtPvc=nncExtPvc, nncExtPvcCompliances=nncExtPvcCompliances, nncCrPvccFwdTmClr=nncCrPvccFwdTmClr, nncCrPvpcDstVpi=nncCrPvpcDstVpi, nncCrPvpcBwdAbrDynTrfcRdf=nncCrPvpcBwdAbrDynTrfcRdf, nncCrPvpcSrcVpi=nncCrPvpcSrcVpi, nncCrPvpcFwdTmTrafficDescriptor=nncCrPvpcFwdTmTrafficDescriptor, nncCrPvccSrcIfIndex=nncCrPvccSrcIfIndex, nncCrPvpcFwdTmClr=nncCrPvpcFwdTmClr, nncCrPvccSrcAlsConfig=nncCrPvccSrcAlsConfig, nncCrPvccBwdTmClr=nncCrPvccBwdTmClr, nncCrPvpcCastType=nncCrPvpcCastType, nncCrPvpcFwdAbrDynTrfcRif=nncCrPvpcFwdAbrDynTrfcRif, nncCrPvccTable=nncCrPvccTable, nncCrPvpcRowStatus=nncCrPvpcRowStatus, nncCrPvpcBwdTmBucketTwoRate=nncCrPvpcBwdTmBucketTwoRate, nncCrPvccBwdServiceCategory=nncCrPvccBwdServiceCategory, nncCrPvpcGroup=nncCrPvpcGroup, nncCrPvccGroup=nncCrPvccGroup, nncCrPvpcBwdTmCdv=nncCrPvpcBwdTmCdv, nncCrPvccBwdTmCdv=nncCrPvccBwdTmCdv, nncCrPvpcBwdTmPolicingOption=nncCrPvpcBwdTmPolicingOption, nncCrPvpcFwdTmBucketOneRate=nncCrPvpcFwdTmBucketOneRate, nncCrPvpcBwdAbrDynTrfcRif=nncCrPvpcBwdAbrDynTrfcRif, nncCrPvpcFwdTmBucketTwoRate=nncCrPvpcFwdTmBucketTwoRate, nncCrPvpcBwdTmBucketTwoMbs=nncCrPvpcBwdTmBucketTwoMbs, nncCrPvccBwdTmBucketOneCdvt=nncCrPvccBwdTmBucketOneCdvt, nncCrPvccFwdAbrDynTrfcRif=nncCrPvccFwdAbrDynTrfcRif, nncCrPvccDstVpi=nncCrPvccDstVpi, nncCrPvccBwdTmTrafficDescriptor=nncCrPvccBwdTmTrafficDescriptor, nncCrPvccDstAlsConfig=nncCrPvccDstAlsConfig, nncCrPvpcSrcAlsConfig=nncCrPvpcSrcAlsConfig, nncCrPvpcBwdTmBucketOneRate=nncCrPvpcBwdTmBucketOneRate, nncCrPvpcCreator=nncCrPvpcCreator, nncCrPvpcFwdTmBucketOneCdvt=nncCrPvpcFwdTmBucketOneCdvt, nncCrPvccFwdServiceCategory=nncCrPvccFwdServiceCategory, nncCrPvccFwdTmPolicingOption=nncCrPvccFwdTmPolicingOption)
# The isBadVersion API is already defined for you. # def isBadVersion(version: int) -> int: class Solution: def firstBadVersion(self, n: int) -> int: start, end = 1, n while start < end: mid = start + (end - start) // 2 check = isBadVersion(mid) if check: end = mid else: start = mid + 1 return start
class Solution: def first_bad_version(self, n: int) -> int: (start, end) = (1, n) while start < end: mid = start + (end - start) // 2 check = is_bad_version(mid) if check: end = mid else: start = mid + 1 return start
load("@bazel_skylib//lib:shell.bzl", "shell") _CONTENT_PREFIX = """#!/usr/bin/env bash set -euo pipefail """ def _multirun_impl(ctx): transitive_depsets = [] content = [_CONTENT_PREFIX] for command in ctx.attr.commands: defaultInfo = command[DefaultInfo] if defaultInfo.files_to_run == None: fail("%s is not executable" % command.label, attr = "commands") exe = defaultInfo.files_to_run.executable if exe == None: fail("%s does not have an executable file" % command.label, attr = "commands") default_runfiles = defaultInfo.default_runfiles if default_runfiles != None: transitive_depsets.append(default_runfiles.files) content.append("echo Running %s\n./%s $@\n" % (shell.quote(str(command.label)), shell.quote(exe.short_path))) out_file = ctx.actions.declare_file(ctx.label.name + ".bash") ctx.actions.write( output = out_file, content = "".join(content), is_executable = True, ) return [DefaultInfo( files = depset([out_file]), runfiles = ctx.runfiles( transitive_files = depset([], transitive = transitive_depsets), ), executable = out_file, )] _multirun = rule( implementation = _multirun_impl, attrs = { "commands": attr.label_list( allow_empty = True, # this is explicitly allowed - generated invocations may need to run 0 targets mandatory = True, allow_files = True, doc = "Targets to run in specified order", cfg = "target", ), }, executable = True, ) def multirun(**kwargs): tags = kwargs.get("tags", []) if "manual" not in tags: tags.append("manual") kwargs["tags"] = tags _multirun( **kwargs ) def _command_impl(ctx): transitive_depsets = [] defaultInfo = ctx.attr.command[DefaultInfo] default_runfiles = defaultInfo.default_runfiles if default_runfiles != None: transitive_depsets.append(default_runfiles.files) str_env = [ "%s=%s" % (k, shell.quote(v)) for k, v in ctx.attr.environment.items() ] str_unqouted_env = [ "%s=%s" % (k, v) for k, v in ctx.attr.raw_environment.items() ] str_args = [ "%s=%s" % (k, shell.quote(v)) for k, v in ctx.attr.arguments.items() ] command_elements = ["exec env"] + \ str_env + \ str_unqouted_env + \ ["./%s" % shell.quote(defaultInfo.files_to_run.executable.short_path)] + \ str_args + \ ["$@\n"] out_file = ctx.actions.declare_file(ctx.label.name + ".bash") ctx.actions.write( output = out_file, content = _CONTENT_PREFIX + " ".join(command_elements), is_executable = True, ) return [ DefaultInfo( files = depset([out_file]), runfiles = ctx.runfiles( transitive_files = depset([], transitive = transitive_depsets), ), executable = out_file, ), ] _command = rule( implementation = _command_impl, attrs = { "arguments": attr.string_dict( doc = "Dictionary of command line arguments", ), "environment": attr.string_dict( doc = "Dictionary of environment variables", ), "raw_environment": attr.string_dict( doc = "Dictionary of unqouted environment variables", ), "command": attr.label( mandatory = True, allow_files = True, executable = True, doc = "Target to run", cfg = "target", ), }, executable = True, ) def command(**kwargs): tags = kwargs.get("tags", []) if "manual" not in tags: tags.append("manual") kwargs["tags"] = tags _command( **kwargs )
load('@bazel_skylib//lib:shell.bzl', 'shell') _content_prefix = '#!/usr/bin/env bash\n\nset -euo pipefail\n\n' def _multirun_impl(ctx): transitive_depsets = [] content = [_CONTENT_PREFIX] for command in ctx.attr.commands: default_info = command[DefaultInfo] if defaultInfo.files_to_run == None: fail('%s is not executable' % command.label, attr='commands') exe = defaultInfo.files_to_run.executable if exe == None: fail('%s does not have an executable file' % command.label, attr='commands') default_runfiles = defaultInfo.default_runfiles if default_runfiles != None: transitive_depsets.append(default_runfiles.files) content.append('echo Running %s\n./%s $@\n' % (shell.quote(str(command.label)), shell.quote(exe.short_path))) out_file = ctx.actions.declare_file(ctx.label.name + '.bash') ctx.actions.write(output=out_file, content=''.join(content), is_executable=True) return [default_info(files=depset([out_file]), runfiles=ctx.runfiles(transitive_files=depset([], transitive=transitive_depsets)), executable=out_file)] _multirun = rule(implementation=_multirun_impl, attrs={'commands': attr.label_list(allow_empty=True, mandatory=True, allow_files=True, doc='Targets to run in specified order', cfg='target')}, executable=True) def multirun(**kwargs): tags = kwargs.get('tags', []) if 'manual' not in tags: tags.append('manual') kwargs['tags'] = tags _multirun(**kwargs) def _command_impl(ctx): transitive_depsets = [] default_info = ctx.attr.command[DefaultInfo] default_runfiles = defaultInfo.default_runfiles if default_runfiles != None: transitive_depsets.append(default_runfiles.files) str_env = ['%s=%s' % (k, shell.quote(v)) for (k, v) in ctx.attr.environment.items()] str_unqouted_env = ['%s=%s' % (k, v) for (k, v) in ctx.attr.raw_environment.items()] str_args = ['%s=%s' % (k, shell.quote(v)) for (k, v) in ctx.attr.arguments.items()] command_elements = ['exec env'] + str_env + str_unqouted_env + ['./%s' % shell.quote(defaultInfo.files_to_run.executable.short_path)] + str_args + ['$@\n'] out_file = ctx.actions.declare_file(ctx.label.name + '.bash') ctx.actions.write(output=out_file, content=_CONTENT_PREFIX + ' '.join(command_elements), is_executable=True) return [default_info(files=depset([out_file]), runfiles=ctx.runfiles(transitive_files=depset([], transitive=transitive_depsets)), executable=out_file)] _command = rule(implementation=_command_impl, attrs={'arguments': attr.string_dict(doc='Dictionary of command line arguments'), 'environment': attr.string_dict(doc='Dictionary of environment variables'), 'raw_environment': attr.string_dict(doc='Dictionary of unqouted environment variables'), 'command': attr.label(mandatory=True, allow_files=True, executable=True, doc='Target to run', cfg='target')}, executable=True) def command(**kwargs): tags = kwargs.get('tags', []) if 'manual' not in tags: tags.append('manual') kwargs['tags'] = tags _command(**kwargs)
current_petrol = 0 current_position = 0 n = int(input().strip()) for i in range(n): petrol, distance = map(int, input().strip().split(' ')) current_petrol += petrol if (current_petrol > distance): current_petrol -= distance else: current_petrol = 0 current_position = i print(current_position + 1)
current_petrol = 0 current_position = 0 n = int(input().strip()) for i in range(n): (petrol, distance) = map(int, input().strip().split(' ')) current_petrol += petrol if current_petrol > distance: current_petrol -= distance else: current_petrol = 0 current_position = i print(current_position + 1)
APPNAME = 'assembly' APPAUTHOR = 'kbase' URL = 'http://kbase.us/services/assembly' AUTH_SERVICE = 'KBase' OAUTH_EXP_DAYS = 14 OAUTH_FILENAME = 'globus_oauth.prop'
appname = 'assembly' appauthor = 'kbase' url = 'http://kbase.us/services/assembly' auth_service = 'KBase' oauth_exp_days = 14 oauth_filename = 'globus_oauth.prop'