content
stringlengths
7
1.05M
fixed_cases
stringlengths
1
1.28M
class Character: def __init__(self, health, power): self.health=health self.power=power class Hero(Character): def __init__(self): super(Hero, self).__init__(10,5) class Goblin(Character): def __init__(self): super(Goblin, self).__init__(6,2)
class Character: def __init__(self, health, power): self.health = health self.power = power class Hero(Character): def __init__(self): super(Hero, self).__init__(10, 5) class Goblin(Character): def __init__(self): super(Goblin, self).__init__(6, 2)
def findDecision(obj): #obj[0]: Coupon, obj[1]: Education, obj[2]: Occupation # {"feature": "Coupon", "instances": 8148, "metric_value": 0.4751, "depth": 1} if obj[0]>1: # {"feature": "Education", "instances": 5867, "metric_value": 0.4695, "depth": 2} if obj[1]>0: # {"feature": "Occupation", "instances": 3831, "metric_value": 0.476, "depth": 3} if obj[2]<=19.12113309419569: return 'True' elif obj[2]>19.12113309419569: return 'True' else: return 'True' elif obj[1]<=0: # {"feature": "Occupation", "instances": 2036, "metric_value": 0.4536, "depth": 3} if obj[2]<=19.16456021452013: return 'True' elif obj[2]>19.16456021452013: return 'True' else: return 'True' else: return 'True' elif obj[0]<=1: # {"feature": "Occupation", "instances": 2281, "metric_value": 0.4847, "depth": 2} if obj[2]>2.070384793617607: # {"feature": "Education", "instances": 1816, "metric_value": 0.4893, "depth": 3} if obj[1]>0: return 'False' elif obj[1]<=0: return 'False' else: return 'False' elif obj[2]<=2.070384793617607: # {"feature": "Education", "instances": 465, "metric_value": 0.4291, "depth": 3} if obj[1]<=3: return 'False' elif obj[1]>3: return 'True' else: return 'True' else: return 'False' else: return 'False'
def find_decision(obj): if obj[0] > 1: if obj[1] > 0: if obj[2] <= 19.12113309419569: return 'True' elif obj[2] > 19.12113309419569: return 'True' else: return 'True' elif obj[1] <= 0: if obj[2] <= 19.16456021452013: return 'True' elif obj[2] > 19.16456021452013: return 'True' else: return 'True' else: return 'True' elif obj[0] <= 1: if obj[2] > 2.070384793617607: if obj[1] > 0: return 'False' elif obj[1] <= 0: return 'False' else: return 'False' elif obj[2] <= 2.070384793617607: if obj[1] <= 3: return 'False' elif obj[1] > 3: return 'True' else: return 'True' else: return 'False' else: return 'False'
class Progress: prg = '|/-\\' prg_len = len(prg) def __init__(self, total=0): self.i = 0 self.total = total self.val = '' self.update = self._progress if total else self._spin def _spin(self): self.i %= self.prg_len self.val = self.prg[self.i] def _progress(self): self.val = f'{self.i*100/self.total:3.2f}%' def __call__(self, desc=''): self.i += 1 self.update() print(f'\r{self.val} {desc[-40:]}', end='\x1b[1K') if self.total != 0 and self.total == self.i: self.__del__() def __del__(self): print('\r', end='\x1b[1K\r', flush=True)
class Progress: prg = '|/-\\' prg_len = len(prg) def __init__(self, total=0): self.i = 0 self.total = total self.val = '' self.update = self._progress if total else self._spin def _spin(self): self.i %= self.prg_len self.val = self.prg[self.i] def _progress(self): self.val = f'{self.i * 100 / self.total:3.2f}%' def __call__(self, desc=''): self.i += 1 self.update() print(f'\r{self.val} {desc[-40:]}', end='\x1b[1K') if self.total != 0 and self.total == self.i: self.__del__() def __del__(self): print('\r', end='\x1b[1K\r', flush=True)
#!/usr/bin/env python3 class Code: """ The Code class contains static attributes of the (Comp)utation, (Dest)ination, and Jump codes of the Hack language. More can be found under 'assets/'. """ # Static class attributes _jump_codes = ["null", "JGT", "JEQ", "JGE", "JLT", "JNE", "JLE", "JMP"] _dest_codes = ["null", "M", "D", "MD", "A", "AM", "AD", "AMD"] _comp_codes = {"0": "101010", "1": "111111", "-1": "111010", "D": "001100", "A": "110000", "M": "110000", "!D": "001101", "!A": "110001", "!M": "110001", "-D": "001111", "-A": "110011", "-M": "110011", "D+1": "011111", "A+1": "110111", "M+1": "110111", "D-1": "001110", "A-1": "110010", "M-1": "110010", "D+A": "000010", "D+M": "000010", "D-A": "010011", "D-M": "010011", "A-D": "000111", "M-D": "000111", "D&A": "000000", "D&M": "000000", "D|A": "010101", "D|M": "010101"} @staticmethod def decode_comp_code_a(code): """ The 'a' op code in the Hack computer determines whether to access the 'A' or the 'M' register, but not both. You can see this in the _comp_codes dictionary, where no Comp function includes both 'A' and 'M'. :param code: the Computation code to be parsed :return: the 'a' op code, '1' accesses the M-register, '0' accesses the A-register """ if "M" in code: return "1" else: return "0" @staticmethod def decode_comp_code(code) -> str: """ The (Comp)utation code specifies to the Hack computer which computation to perform. It chooses from a series of 17 arithmetic operations, represented by 7-bit binary numbers (1-bit op code and 6-bit comp code). :param instruction: The Comp code to be converted to 7-bit binary :return: a string of a 7-bit binary number (1-bit op code and 6-bit comp code). """ a_code = Code.decode_comp_code_a(code) comp_code = Code._comp_codes[code] return a_code + comp_code @staticmethod def decode_dest_code(code) -> int: """ The Dest code specifies to Hack computer where the output of the CPU is stored (in the A, M, D, or two of/ all registers). There are 8 different combinations of where the output can be stored, represented by a 3-bit binary number. In this method, we simply return an integer representing the Dest option. :param code: The DEst code to be evaluated. :return: the integer (0 < x < 7) associated with the Dest code, to be converted to 3-bit binary outside of scope. """ if not code: code = "null" assert code in Code._dest_codes return Code._dest_codes.index(code) @staticmethod def decode_jump_code(code) -> int: """ The Jump code specifies to Hack computer criteria for the program to 'jump' to another instruction in the ROM (technically, jumping towards an address in the ROM). There are 8 different criteria for Jump, which can be represented by a 3-bit binary number. In this method, we simply return an integer represending the Jump option. :param code: The Jump code to be evaluated. :return: the integer (0 < x < 7) associated with the Jump code, to be converted to 3-bit binary outside of scope. """ if not code: code = "null" assert code in Code._jump_codes return Code._jump_codes.index(code)
class Code: """ The Code class contains static attributes of the (Comp)utation, (Dest)ination, and Jump codes of the Hack language. More can be found under 'assets/'. """ _jump_codes = ['null', 'JGT', 'JEQ', 'JGE', 'JLT', 'JNE', 'JLE', 'JMP'] _dest_codes = ['null', 'M', 'D', 'MD', 'A', 'AM', 'AD', 'AMD'] _comp_codes = {'0': '101010', '1': '111111', '-1': '111010', 'D': '001100', 'A': '110000', 'M': '110000', '!D': '001101', '!A': '110001', '!M': '110001', '-D': '001111', '-A': '110011', '-M': '110011', 'D+1': '011111', 'A+1': '110111', 'M+1': '110111', 'D-1': '001110', 'A-1': '110010', 'M-1': '110010', 'D+A': '000010', 'D+M': '000010', 'D-A': '010011', 'D-M': '010011', 'A-D': '000111', 'M-D': '000111', 'D&A': '000000', 'D&M': '000000', 'D|A': '010101', 'D|M': '010101'} @staticmethod def decode_comp_code_a(code): """ The 'a' op code in the Hack computer determines whether to access the 'A' or the 'M' register, but not both. You can see this in the _comp_codes dictionary, where no Comp function includes both 'A' and 'M'. :param code: the Computation code to be parsed :return: the 'a' op code, '1' accesses the M-register, '0' accesses the A-register """ if 'M' in code: return '1' else: return '0' @staticmethod def decode_comp_code(code) -> str: """ The (Comp)utation code specifies to the Hack computer which computation to perform. It chooses from a series of 17 arithmetic operations, represented by 7-bit binary numbers (1-bit op code and 6-bit comp code). :param instruction: The Comp code to be converted to 7-bit binary :return: a string of a 7-bit binary number (1-bit op code and 6-bit comp code). """ a_code = Code.decode_comp_code_a(code) comp_code = Code._comp_codes[code] return a_code + comp_code @staticmethod def decode_dest_code(code) -> int: """ The Dest code specifies to Hack computer where the output of the CPU is stored (in the A, M, D, or two of/ all registers). There are 8 different combinations of where the output can be stored, represented by a 3-bit binary number. In this method, we simply return an integer representing the Dest option. :param code: The DEst code to be evaluated. :return: the integer (0 < x < 7) associated with the Dest code, to be converted to 3-bit binary outside of scope. """ if not code: code = 'null' assert code in Code._dest_codes return Code._dest_codes.index(code) @staticmethod def decode_jump_code(code) -> int: """ The Jump code specifies to Hack computer criteria for the program to 'jump' to another instruction in the ROM (technically, jumping towards an address in the ROM). There are 8 different criteria for Jump, which can be represented by a 3-bit binary number. In this method, we simply return an integer represending the Jump option. :param code: The Jump code to be evaluated. :return: the integer (0 < x < 7) associated with the Jump code, to be converted to 3-bit binary outside of scope. """ if not code: code = 'null' assert code in Code._jump_codes return Code._jump_codes.index(code)
n = int(input()) def encontrarCamino(viajes,temp,camino,CaminoActual,llaves): if temp == "C-137" and CaminoActual!=0: camino.append(CaminoActual) return camino else: if temp in llaves: for i in viajes[temp]: caminos=encontrarCamino(viajes,i,camino,CaminoActual+1,llaves) return caminos else: camino.append(-1) return camino for _ in range (0,n): cant = int(input()) viajes = {} inicio = "C-137" final= "" llaves = [] for j in range(0,cant): temp = input() dest = temp.split() if dest[0] not in viajes: llaves.append(dest[0]) viajes[dest[0]]=[dest[1]] else: viajes[dest[0]].append(dest[1]) final=dest[1] camino = encontrarCamino(viajes,inicio,[],0,llaves) bandera=True camino.sort() for i in camino: if i != -1: print("Pueden volver a C-137 en "+str(i)+" saltos") bandera=False break if bandera: print("Deambulan por el multiverso")
n = int(input()) def encontrar_camino(viajes, temp, camino, CaminoActual, llaves): if temp == 'C-137' and CaminoActual != 0: camino.append(CaminoActual) return camino elif temp in llaves: for i in viajes[temp]: caminos = encontrar_camino(viajes, i, camino, CaminoActual + 1, llaves) return caminos else: camino.append(-1) return camino for _ in range(0, n): cant = int(input()) viajes = {} inicio = 'C-137' final = '' llaves = [] for j in range(0, cant): temp = input() dest = temp.split() if dest[0] not in viajes: llaves.append(dest[0]) viajes[dest[0]] = [dest[1]] else: viajes[dest[0]].append(dest[1]) final = dest[1] camino = encontrar_camino(viajes, inicio, [], 0, llaves) bandera = True camino.sort() for i in camino: if i != -1: print('Pueden volver a C-137 en ' + str(i) + ' saltos') bandera = False break if bandera: print('Deambulan por el multiverso')
#Find a Motif in DNA: string = "AACTATGCAACTATGAAACTATGAACTATGATTCCAACTATGTAACTATGATGCATTAAACTATGAAACTATGAACTATGAACTATGAACTATGAAACTATGCGGAACTATGAACTATGGGGACAACTATGGAACTATGAGAACTATGTCAATTAACTATGCGTAACTATGGTCGAAACTATGAACTATGGAACTATGGCAACTATGCAAACTATGAAACTATGTAACTATGTGAAGGACGCACTAACTATGAGAAACTATGAACTATGAACTATGAACTATGCACGCGTTGTAACTATGATGACGATGAACTATGTATTAACTATGACCGAACTATGTCAACTATGTTTTAACTATGAAACTATGTAACTATGTGGTCAACTATGGCATTCCAACTATGGAACTATGAACTATGGTACCTAACTATGATCTGAAACTATGAACTATGGCAACTATGAACTATGGAAGAATCGCGGCTACCTTTCTCGAACTATGGAATTTAACTATGGAACTATGCTGAAACTATGAACCAAACTATGTAAACTATGAACTATGAAACTATGGCTAGAACTATGATGTAACTATGAAACTATGAACTATGAACTATGAACTATGGAACTATGGTTGATAACTATGCAACGGTACGATGGTCGTCAACTATGAACTATGGAAACTATGGAACTATGAACTATGTGTCAACTATGAACTATGTGGAACTATGCCTAAACTATGCTTCCTCTCACGTGTACGAAACTATGCGAAACTATGAACTATGATGCTCAATGAACTATGCAACTATGCTAACTATGTCTTTGTTCAACTATGACAACTATGTGGGCAACTATGAACTATGGGAACTATGAACTATGAACTATGTCATATATGAAGTAACTATGAACTATGAACTATGCAACTATGGAACTATGGAACTATGAAACTATGAACTATGGCAACTATGAAGCGAACTATGCAGAAACTATG" for i in range(len(string)): if string[i:].startswith("AACTATGAA"): print(i + 1)
string = 'AACTATGCAACTATGAAACTATGAACTATGATTCCAACTATGTAACTATGATGCATTAAACTATGAAACTATGAACTATGAACTATGAACTATGAAACTATGCGGAACTATGAACTATGGGGACAACTATGGAACTATGAGAACTATGTCAATTAACTATGCGTAACTATGGTCGAAACTATGAACTATGGAACTATGGCAACTATGCAAACTATGAAACTATGTAACTATGTGAAGGACGCACTAACTATGAGAAACTATGAACTATGAACTATGAACTATGCACGCGTTGTAACTATGATGACGATGAACTATGTATTAACTATGACCGAACTATGTCAACTATGTTTTAACTATGAAACTATGTAACTATGTGGTCAACTATGGCATTCCAACTATGGAACTATGAACTATGGTACCTAACTATGATCTGAAACTATGAACTATGGCAACTATGAACTATGGAAGAATCGCGGCTACCTTTCTCGAACTATGGAATTTAACTATGGAACTATGCTGAAACTATGAACCAAACTATGTAAACTATGAACTATGAAACTATGGCTAGAACTATGATGTAACTATGAAACTATGAACTATGAACTATGAACTATGGAACTATGGTTGATAACTATGCAACGGTACGATGGTCGTCAACTATGAACTATGGAAACTATGGAACTATGAACTATGTGTCAACTATGAACTATGTGGAACTATGCCTAAACTATGCTTCCTCTCACGTGTACGAAACTATGCGAAACTATGAACTATGATGCTCAATGAACTATGCAACTATGCTAACTATGTCTTTGTTCAACTATGACAACTATGTGGGCAACTATGAACTATGGGAACTATGAACTATGAACTATGTCATATATGAAGTAACTATGAACTATGAACTATGCAACTATGGAACTATGGAACTATGAAACTATGAACTATGGCAACTATGAAGCGAACTATGCAGAAACTATG' for i in range(len(string)): if string[i:].startswith('AACTATGAA'): print(i + 1)
def single_number(numbers): single = 0 for number in numbers: single ^= number return single if __name__ == "__main__": numbers = [3, 4, 2, 1, 3, 1, 4] assert single_number(numbers) == 2 numbers = input("Enter list of repeated numbers: ") numbers = map(int, numbers.split()) print(single_number(numbers))
def single_number(numbers): single = 0 for number in numbers: single ^= number return single if __name__ == '__main__': numbers = [3, 4, 2, 1, 3, 1, 4] assert single_number(numbers) == 2 numbers = input('Enter list of repeated numbers: ') numbers = map(int, numbers.split()) print(single_number(numbers))
# Name - Thilakarathna W M D U # Email - dtdinidu7@gmail.com # Date - 08/04/2020 tm = int(input()) # number of test cases for t in range(1, tm+1): lis = [int(i) for i in list(input())] # taking the input as list strg = '('*lis[0] + str(lis[0]) # final string to be displayed prev = lis[0] # track the previs count for i in range(1, len(lis)): # loop through the list tmp = lis[i]-prev prev = lis[i] if (tmp >= 0): strg += '('*tmp else: strg += ')'*(-1*tmp) strg += str(lis[i]) # adding the changes to the final strings to be displayed strg += ')'*lis[-1] print("Case #{}: {}".format(t, strg)) # print the final output
tm = int(input()) for t in range(1, tm + 1): lis = [int(i) for i in list(input())] strg = '(' * lis[0] + str(lis[0]) prev = lis[0] for i in range(1, len(lis)): tmp = lis[i] - prev prev = lis[i] if tmp >= 0: strg += '(' * tmp else: strg += ')' * (-1 * tmp) strg += str(lis[i]) strg += ')' * lis[-1] print('Case #{}: {}'.format(t, strg))
#!/usr/bin/env python3 class TokenBase(): """ Base class of all tokens """ def get_possible_words(self) -> list: """ Gets all possible words that can be made out of this token """ raise NotImplemented
class Tokenbase: """ Base class of all tokens """ def get_possible_words(self) -> list: """ Gets all possible words that can be made out of this token """ raise NotImplemented
# Sample untracked-keys file # If you get errors trying to 'import apikeys', do the following: # 1) Copy this file to apikeys.py (keeping it in the package directory) # 2) Replace all of the example values with real ones # 3) Generate your own cookie key, possibly using urandom as per below # You should then be able to start the server. db_connect_string = "" cookie_monster = "uqHHRiRIUyCIcB0RJJcv+T/Qc3wJS0p/jsyE1x36qBIa" admin_address = "administrator" site_url = "http://www.infiniteglitch.net" # Generated like this: # import base64, os; print(base64.b64encode(os.urandom(33))) # These settings are used only for the sending of emails. The server will # start with them at the defaults, but all email sending will fail. system_email = 'server@example.com' admin_email = 'username@example.com' # Use https://pypi.org/project/Flask-SendGrid/ to implement SendGrid SENDGRID_DEFAULT_FROM = "me@my.com" SENDGRID_API_KEY = "SG.random-string-from-sendgrid"
db_connect_string = '' cookie_monster = 'uqHHRiRIUyCIcB0RJJcv+T/Qc3wJS0p/jsyE1x36qBIa' admin_address = 'administrator' site_url = 'http://www.infiniteglitch.net' system_email = 'server@example.com' admin_email = 'username@example.com' sendgrid_default_from = 'me@my.com' sendgrid_api_key = 'SG.random-string-from-sendgrid'
# Definition for a binary tree node. # class TreeNode: # def __init__(self, x): # self.val = x # self.left = None # self.right = None class Solution: def subtreeWithAllDeepest(self, root: TreeNode) -> TreeNode: depths = [collections.defaultdict(list) for _ in range(500)] self.mx = 0 def helper(node, depth): if node: l = helper(node.left, depth + 1) r = helper(node.right, depth + 1) ans = max(l, r) self.mx = ans depths[depth][ans].append(node) return ans else: return depth - 1 helper(root, 0) while True: depths.pop() if len(depths[-1][self.mx]) == 1: return depths[-1][self.mx][0]
class Solution: def subtree_with_all_deepest(self, root: TreeNode) -> TreeNode: depths = [collections.defaultdict(list) for _ in range(500)] self.mx = 0 def helper(node, depth): if node: l = helper(node.left, depth + 1) r = helper(node.right, depth + 1) ans = max(l, r) self.mx = ans depths[depth][ans].append(node) return ans else: return depth - 1 helper(root, 0) while True: depths.pop() if len(depths[-1][self.mx]) == 1: return depths[-1][self.mx][0]
# # PySNMP MIB module S5-CHASSIS-TRAP-MIB (http://snmplabs.com/pysmi) # ASN.1 source file:///Users/davwang4/Dev/mibs.snmplabs.com/asn1/S5-CHASSIS-TRAP-MIB # Produced by pysmi-0.3.4 at Wed May 1 14:59:28 2019 # On host DAVWANG4-M-1475 platform Darwin version 18.5.0 by user davwang4 # Using Python version 3.7.3 (default, Mar 27 2019, 09:23:15) # Integer, ObjectIdentifier, OctetString = mibBuilder.importSymbols("ASN1", "Integer", "ObjectIdentifier", "OctetString") NamedValues, = mibBuilder.importSymbols("ASN1-ENUMERATION", "NamedValues") ValueSizeConstraint, ValueRangeConstraint, SingleValueConstraint, ConstraintsUnion, ConstraintsIntersection = mibBuilder.importSymbols("ASN1-REFINEMENT", "ValueSizeConstraint", "ValueRangeConstraint", "SingleValueConstraint", "ConstraintsUnion", "ConstraintsIntersection") s5ChasComOperState, s5ChasComType, s5ChasNotifyFanDirection = mibBuilder.importSymbols("S5-CHASSIS-MIB", "s5ChasComOperState", "s5ChasComType", "s5ChasNotifyFanDirection") s5ChaTrap, = mibBuilder.importSymbols("S5-ROOT-MIB", "s5ChaTrap") NotificationGroup, ModuleCompliance = mibBuilder.importSymbols("SNMPv2-CONF", "NotificationGroup", "ModuleCompliance") MibIdentifier, IpAddress, iso, MibScalar, MibTable, MibTableRow, MibTableColumn, TimeTicks, Unsigned32, Integer32, Gauge32, ObjectIdentity, ModuleIdentity, Bits, Counter64, Counter32, NotificationType = mibBuilder.importSymbols("SNMPv2-SMI", "MibIdentifier", "IpAddress", "iso", "MibScalar", "MibTable", "MibTableRow", "MibTableColumn", "TimeTicks", "Unsigned32", "Integer32", "Gauge32", "ObjectIdentity", "ModuleIdentity", "Bits", "Counter64", "Counter32", "NotificationType") DisplayString, TextualConvention = mibBuilder.importSymbols("SNMPv2-TC", "DisplayString", "TextualConvention") s5ChassisTrapMib = ModuleIdentity((1, 3, 6, 1, 4, 1, 45, 1, 6, 2, 4, 0)) s5ChassisTrapMib.setRevisions(('2011-04-15 00:00', '2011-03-29 00:00', '2009-07-29 00:00', '2004-07-20 00:00',)) if getattr(mibBuilder, 'version', (0, 0, 0)) > (4, 4, 0): if mibBuilder.loadTexts: s5ChassisTrapMib.setRevisionsDescriptions(('Version 125: Added s5CtrFanDirectionError and s5CtrHighTemperatureError.', 'Version 124: Added s5CtrFanRotationError.', 'Version 123: Fixed conversion to SMIv2', 'Version 122: Conversion to SMIv2',)) if mibBuilder.loadTexts: s5ChassisTrapMib.setLastUpdated('201104150000Z') if mibBuilder.loadTexts: s5ChassisTrapMib.setOrganization('Nortel Networks') if mibBuilder.loadTexts: s5ChassisTrapMib.setContactInfo('Nortel Networks') if mibBuilder.loadTexts: s5ChassisTrapMib.setDescription("5000 Chassis Trap MIB Copyright 1993-2004 Nortel Networks, Inc. All rights reserved. This Nortel Networks SNMP Management Information Base Specification (Specification) embodies Nortel Networks' confidential and proprietary intellectual property. Nortel Networks retains all title and ownership in the Specification, including any revisions. This Specification is supplied 'AS IS,' and Nortel Networks makes no warranty, either express or implied, as to the use, operation, condition, or performance of the Specification.") s5CtrHotSwap = NotificationType((1, 3, 6, 1, 4, 1, 45, 1, 6, 2, 4, 1)).setObjects(("S5-CHASSIS-MIB", "s5ChasComType"), ("S5-CHASSIS-MIB", "s5ChasComOperState")) if mibBuilder.loadTexts: s5CtrHotSwap.setStatus('current') if mibBuilder.loadTexts: s5CtrHotSwap.setDescription('A component or sub-component was inserted or deinserted in the chassis. This trap is sent only once when the condition is first detected. The following values are returned: s5ChasComType........the type of the component (or sub-component) that was inserted or deinserted, with the instance identifying the group, component, and sub-component. s5ChasComOperState...the operational status of the component or sub-component, with the instance identifying the group, component, and sub-component. The value is removed(3) when the item is removed.') s5CtrProblem = NotificationType((1, 3, 6, 1, 4, 1, 45, 1, 6, 2, 4, 2)).setObjects(("S5-CHASSIS-MIB", "s5ChasComType"), ("S5-CHASSIS-MIB", "s5ChasComOperState")) if mibBuilder.loadTexts: s5CtrProblem.setStatus('current') if mibBuilder.loadTexts: s5CtrProblem.setDescription('A component or sub-component has a problem condition, either warning, nonfatal, or fatal. This trap is sent only once when the condition is first detected. The following values are returned: s5ChasComType........the type of the component (or sub-component) that has the problem condition, with the instance identifying the group, component, and sub-component. s5ChasComOperState...the operational status of the component or sub-component, with the instance identifying the group, component, and sub-component.') s5CtrUnitUp = NotificationType((1, 3, 6, 1, 4, 1, 45, 1, 6, 2, 4, 3)).setObjects(("S5-CHASSIS-MIB", "s5ChasComType"), ("S5-CHASSIS-MIB", "s5ChasComOperState")) if mibBuilder.loadTexts: s5CtrUnitUp.setStatus('current') if mibBuilder.loadTexts: s5CtrUnitUp.setDescription('A component or sub-component has been newly detected. This trap is sent only once when the condition is first detected. The following values are returned: s5ChasComType........the type of the component (or sub-component) that has the problem condition, with the instance identifying the group, component, and sub-component. s5ChasComOperState...the operational status of the component or sub-component, with the instance identifying the group, component, and sub-component.') s5CtrUnitDown = NotificationType((1, 3, 6, 1, 4, 1, 45, 1, 6, 2, 4, 4)).setObjects(("S5-CHASSIS-MIB", "s5ChasComType"), ("S5-CHASSIS-MIB", "s5ChasComOperState")) if mibBuilder.loadTexts: s5CtrUnitDown.setStatus('current') if mibBuilder.loadTexts: s5CtrUnitDown.setDescription('A component or sub-component is no longer detected. This trap is sent only once when the condition is first detected. The following values are returned: s5ChasComType........the type of the component (or sub-component) that has the problem condition, with the instance identifying the group, component, and sub-component. s5ChasComOperState...the operational status of the component or sub-component, with the instance identifying the group, component, and sub-component.') s5CtrNewHotSwap = NotificationType((1, 3, 6, 1, 4, 1, 45, 1, 6, 2, 4, 0, 1)).setObjects(("S5-CHASSIS-MIB", "s5ChasComType"), ("S5-CHASSIS-MIB", "s5ChasComOperState")) if mibBuilder.loadTexts: s5CtrNewHotSwap.setStatus('current') if mibBuilder.loadTexts: s5CtrNewHotSwap.setDescription('A component or sub-component was inserted or deinserted in the chassis. This trap is sent only once when the condition is first detected. The following values are returned: s5ChasComType........the type of the component (or sub-component) that was inserted or deinserted, with the instance identifying the group, component, and sub-component. s5ChasComOperState...the operational status of the component or sub-component, with the instance identifying the group, component, and sub-component. The value is removed(3) when the item is removed.') s5CtrNewProblem = NotificationType((1, 3, 6, 1, 4, 1, 45, 1, 6, 2, 4, 0, 2)).setObjects(("S5-CHASSIS-MIB", "s5ChasComType"), ("S5-CHASSIS-MIB", "s5ChasComOperState")) if mibBuilder.loadTexts: s5CtrNewProblem.setStatus('current') if mibBuilder.loadTexts: s5CtrNewProblem.setDescription('A component or sub-component has a problem condition, either warning, nonfatal, or fatal. This trap is sent only once when the condition is first detected. The following values are returned: s5ChasComType........the type of the component (or sub-component) that has the problem condition, with the instance identifying the group, component, and sub-component. s5ChasComOperState...the operational status of the component or sub-component, with the instance identifying the group, component, and sub-component.') s5CtrNewUnitUp = NotificationType((1, 3, 6, 1, 4, 1, 45, 1, 6, 2, 4, 0, 3)).setObjects(("S5-CHASSIS-MIB", "s5ChasComType"), ("S5-CHASSIS-MIB", "s5ChasComOperState")) if mibBuilder.loadTexts: s5CtrNewUnitUp.setStatus('current') if mibBuilder.loadTexts: s5CtrNewUnitUp.setDescription('A component or sub-component has been newly detected. This trap is sent only once when the condition is first detected. The following values are returned: s5ChasComType........the type of the component (or sub-component) that has the problem condition, with the instance identifying the group, component, and sub-component. s5ChasComOperState...the operational status of the component or sub-component, with the instance identifying the group, component, and sub-component.') s5CtrNewUnitDown = NotificationType((1, 3, 6, 1, 4, 1, 45, 1, 6, 2, 4, 0, 4)).setObjects(("S5-CHASSIS-MIB", "s5ChasComType"), ("S5-CHASSIS-MIB", "s5ChasComOperState")) if mibBuilder.loadTexts: s5CtrNewUnitDown.setStatus('current') if mibBuilder.loadTexts: s5CtrNewUnitDown.setDescription('A component or sub-component is no longer detected. This trap is sent only once when the condition is first detected. The following values are returned: s5ChasComType........the type of the component (or sub-component) that has the problem condition, with the instance identifying the group, component, and sub-component. s5ChasComOperState...the operational status of the component or sub-component, with the instance identifying the group, component, and sub-component.') s5CtrFanRotationError = NotificationType((1, 3, 6, 1, 4, 1, 45, 1, 6, 2, 4, 0, 5)).setObjects(("S5-CHASSIS-MIB", "s5ChasComType"), ("S5-CHASSIS-MIB", "s5ChasComOperState")) if mibBuilder.loadTexts: s5CtrFanRotationError.setStatus('current') if mibBuilder.loadTexts: s5CtrFanRotationError.setDescription("A fan component's rotation is incorrect.") s5CtrFanDirectionError = NotificationType((1, 3, 6, 1, 4, 1, 45, 1, 6, 2, 4, 0, 6)).setObjects(("S5-CHASSIS-MIB", "s5ChasComType"), ("S5-CHASSIS-MIB", "s5ChasComOperState"), ("S5-CHASSIS-MIB", "s5ChasNotifyFanDirection")) if mibBuilder.loadTexts: s5CtrFanDirectionError.setStatus('current') if mibBuilder.loadTexts: s5CtrFanDirectionError.setDescription("A fan component's direction is incorrect.") s5CtrHighTemperatureError = NotificationType((1, 3, 6, 1, 4, 1, 45, 1, 6, 2, 4, 0, 7)).setObjects(("S5-CHASSIS-MIB", "s5ChasComType"), ("S5-CHASSIS-MIB", "s5ChasComOperState")) if mibBuilder.loadTexts: s5CtrHighTemperatureError.setStatus('current') if mibBuilder.loadTexts: s5CtrHighTemperatureError.setDescription('The system is overheated.') mibBuilder.exportSymbols("S5-CHASSIS-TRAP-MIB", s5CtrUnitDown=s5CtrUnitDown, s5CtrNewProblem=s5CtrNewProblem, s5CtrUnitUp=s5CtrUnitUp, s5CtrHighTemperatureError=s5CtrHighTemperatureError, PYSNMP_MODULE_ID=s5ChassisTrapMib, s5CtrNewUnitUp=s5CtrNewUnitUp, s5CtrProblem=s5CtrProblem, s5CtrFanDirectionError=s5CtrFanDirectionError, s5CtrNewUnitDown=s5CtrNewUnitDown, s5ChassisTrapMib=s5ChassisTrapMib, s5CtrFanRotationError=s5CtrFanRotationError, s5CtrNewHotSwap=s5CtrNewHotSwap, s5CtrHotSwap=s5CtrHotSwap)
(integer, object_identifier, octet_string) = mibBuilder.importSymbols('ASN1', 'Integer', 'ObjectIdentifier', 'OctetString') (named_values,) = mibBuilder.importSymbols('ASN1-ENUMERATION', 'NamedValues') (value_size_constraint, value_range_constraint, single_value_constraint, constraints_union, constraints_intersection) = mibBuilder.importSymbols('ASN1-REFINEMENT', 'ValueSizeConstraint', 'ValueRangeConstraint', 'SingleValueConstraint', 'ConstraintsUnion', 'ConstraintsIntersection') (s5_chas_com_oper_state, s5_chas_com_type, s5_chas_notify_fan_direction) = mibBuilder.importSymbols('S5-CHASSIS-MIB', 's5ChasComOperState', 's5ChasComType', 's5ChasNotifyFanDirection') (s5_cha_trap,) = mibBuilder.importSymbols('S5-ROOT-MIB', 's5ChaTrap') (notification_group, module_compliance) = mibBuilder.importSymbols('SNMPv2-CONF', 'NotificationGroup', 'ModuleCompliance') (mib_identifier, ip_address, iso, mib_scalar, mib_table, mib_table_row, mib_table_column, time_ticks, unsigned32, integer32, gauge32, object_identity, module_identity, bits, counter64, counter32, notification_type) = mibBuilder.importSymbols('SNMPv2-SMI', 'MibIdentifier', 'IpAddress', 'iso', 'MibScalar', 'MibTable', 'MibTableRow', 'MibTableColumn', 'TimeTicks', 'Unsigned32', 'Integer32', 'Gauge32', 'ObjectIdentity', 'ModuleIdentity', 'Bits', 'Counter64', 'Counter32', 'NotificationType') (display_string, textual_convention) = mibBuilder.importSymbols('SNMPv2-TC', 'DisplayString', 'TextualConvention') s5_chassis_trap_mib = module_identity((1, 3, 6, 1, 4, 1, 45, 1, 6, 2, 4, 0)) s5ChassisTrapMib.setRevisions(('2011-04-15 00:00', '2011-03-29 00:00', '2009-07-29 00:00', '2004-07-20 00:00')) if getattr(mibBuilder, 'version', (0, 0, 0)) > (4, 4, 0): if mibBuilder.loadTexts: s5ChassisTrapMib.setRevisionsDescriptions(('Version 125: Added s5CtrFanDirectionError and s5CtrHighTemperatureError.', 'Version 124: Added s5CtrFanRotationError.', 'Version 123: Fixed conversion to SMIv2', 'Version 122: Conversion to SMIv2')) if mibBuilder.loadTexts: s5ChassisTrapMib.setLastUpdated('201104150000Z') if mibBuilder.loadTexts: s5ChassisTrapMib.setOrganization('Nortel Networks') if mibBuilder.loadTexts: s5ChassisTrapMib.setContactInfo('Nortel Networks') if mibBuilder.loadTexts: s5ChassisTrapMib.setDescription("5000 Chassis Trap MIB Copyright 1993-2004 Nortel Networks, Inc. All rights reserved. This Nortel Networks SNMP Management Information Base Specification (Specification) embodies Nortel Networks' confidential and proprietary intellectual property. Nortel Networks retains all title and ownership in the Specification, including any revisions. This Specification is supplied 'AS IS,' and Nortel Networks makes no warranty, either express or implied, as to the use, operation, condition, or performance of the Specification.") s5_ctr_hot_swap = notification_type((1, 3, 6, 1, 4, 1, 45, 1, 6, 2, 4, 1)).setObjects(('S5-CHASSIS-MIB', 's5ChasComType'), ('S5-CHASSIS-MIB', 's5ChasComOperState')) if mibBuilder.loadTexts: s5CtrHotSwap.setStatus('current') if mibBuilder.loadTexts: s5CtrHotSwap.setDescription('A component or sub-component was inserted or deinserted in the chassis. This trap is sent only once when the condition is first detected. The following values are returned: s5ChasComType........the type of the component (or sub-component) that was inserted or deinserted, with the instance identifying the group, component, and sub-component. s5ChasComOperState...the operational status of the component or sub-component, with the instance identifying the group, component, and sub-component. The value is removed(3) when the item is removed.') s5_ctr_problem = notification_type((1, 3, 6, 1, 4, 1, 45, 1, 6, 2, 4, 2)).setObjects(('S5-CHASSIS-MIB', 's5ChasComType'), ('S5-CHASSIS-MIB', 's5ChasComOperState')) if mibBuilder.loadTexts: s5CtrProblem.setStatus('current') if mibBuilder.loadTexts: s5CtrProblem.setDescription('A component or sub-component has a problem condition, either warning, nonfatal, or fatal. This trap is sent only once when the condition is first detected. The following values are returned: s5ChasComType........the type of the component (or sub-component) that has the problem condition, with the instance identifying the group, component, and sub-component. s5ChasComOperState...the operational status of the component or sub-component, with the instance identifying the group, component, and sub-component.') s5_ctr_unit_up = notification_type((1, 3, 6, 1, 4, 1, 45, 1, 6, 2, 4, 3)).setObjects(('S5-CHASSIS-MIB', 's5ChasComType'), ('S5-CHASSIS-MIB', 's5ChasComOperState')) if mibBuilder.loadTexts: s5CtrUnitUp.setStatus('current') if mibBuilder.loadTexts: s5CtrUnitUp.setDescription('A component or sub-component has been newly detected. This trap is sent only once when the condition is first detected. The following values are returned: s5ChasComType........the type of the component (or sub-component) that has the problem condition, with the instance identifying the group, component, and sub-component. s5ChasComOperState...the operational status of the component or sub-component, with the instance identifying the group, component, and sub-component.') s5_ctr_unit_down = notification_type((1, 3, 6, 1, 4, 1, 45, 1, 6, 2, 4, 4)).setObjects(('S5-CHASSIS-MIB', 's5ChasComType'), ('S5-CHASSIS-MIB', 's5ChasComOperState')) if mibBuilder.loadTexts: s5CtrUnitDown.setStatus('current') if mibBuilder.loadTexts: s5CtrUnitDown.setDescription('A component or sub-component is no longer detected. This trap is sent only once when the condition is first detected. The following values are returned: s5ChasComType........the type of the component (or sub-component) that has the problem condition, with the instance identifying the group, component, and sub-component. s5ChasComOperState...the operational status of the component or sub-component, with the instance identifying the group, component, and sub-component.') s5_ctr_new_hot_swap = notification_type((1, 3, 6, 1, 4, 1, 45, 1, 6, 2, 4, 0, 1)).setObjects(('S5-CHASSIS-MIB', 's5ChasComType'), ('S5-CHASSIS-MIB', 's5ChasComOperState')) if mibBuilder.loadTexts: s5CtrNewHotSwap.setStatus('current') if mibBuilder.loadTexts: s5CtrNewHotSwap.setDescription('A component or sub-component was inserted or deinserted in the chassis. This trap is sent only once when the condition is first detected. The following values are returned: s5ChasComType........the type of the component (or sub-component) that was inserted or deinserted, with the instance identifying the group, component, and sub-component. s5ChasComOperState...the operational status of the component or sub-component, with the instance identifying the group, component, and sub-component. The value is removed(3) when the item is removed.') s5_ctr_new_problem = notification_type((1, 3, 6, 1, 4, 1, 45, 1, 6, 2, 4, 0, 2)).setObjects(('S5-CHASSIS-MIB', 's5ChasComType'), ('S5-CHASSIS-MIB', 's5ChasComOperState')) if mibBuilder.loadTexts: s5CtrNewProblem.setStatus('current') if mibBuilder.loadTexts: s5CtrNewProblem.setDescription('A component or sub-component has a problem condition, either warning, nonfatal, or fatal. This trap is sent only once when the condition is first detected. The following values are returned: s5ChasComType........the type of the component (or sub-component) that has the problem condition, with the instance identifying the group, component, and sub-component. s5ChasComOperState...the operational status of the component or sub-component, with the instance identifying the group, component, and sub-component.') s5_ctr_new_unit_up = notification_type((1, 3, 6, 1, 4, 1, 45, 1, 6, 2, 4, 0, 3)).setObjects(('S5-CHASSIS-MIB', 's5ChasComType'), ('S5-CHASSIS-MIB', 's5ChasComOperState')) if mibBuilder.loadTexts: s5CtrNewUnitUp.setStatus('current') if mibBuilder.loadTexts: s5CtrNewUnitUp.setDescription('A component or sub-component has been newly detected. This trap is sent only once when the condition is first detected. The following values are returned: s5ChasComType........the type of the component (or sub-component) that has the problem condition, with the instance identifying the group, component, and sub-component. s5ChasComOperState...the operational status of the component or sub-component, with the instance identifying the group, component, and sub-component.') s5_ctr_new_unit_down = notification_type((1, 3, 6, 1, 4, 1, 45, 1, 6, 2, 4, 0, 4)).setObjects(('S5-CHASSIS-MIB', 's5ChasComType'), ('S5-CHASSIS-MIB', 's5ChasComOperState')) if mibBuilder.loadTexts: s5CtrNewUnitDown.setStatus('current') if mibBuilder.loadTexts: s5CtrNewUnitDown.setDescription('A component or sub-component is no longer detected. This trap is sent only once when the condition is first detected. The following values are returned: s5ChasComType........the type of the component (or sub-component) that has the problem condition, with the instance identifying the group, component, and sub-component. s5ChasComOperState...the operational status of the component or sub-component, with the instance identifying the group, component, and sub-component.') s5_ctr_fan_rotation_error = notification_type((1, 3, 6, 1, 4, 1, 45, 1, 6, 2, 4, 0, 5)).setObjects(('S5-CHASSIS-MIB', 's5ChasComType'), ('S5-CHASSIS-MIB', 's5ChasComOperState')) if mibBuilder.loadTexts: s5CtrFanRotationError.setStatus('current') if mibBuilder.loadTexts: s5CtrFanRotationError.setDescription("A fan component's rotation is incorrect.") s5_ctr_fan_direction_error = notification_type((1, 3, 6, 1, 4, 1, 45, 1, 6, 2, 4, 0, 6)).setObjects(('S5-CHASSIS-MIB', 's5ChasComType'), ('S5-CHASSIS-MIB', 's5ChasComOperState'), ('S5-CHASSIS-MIB', 's5ChasNotifyFanDirection')) if mibBuilder.loadTexts: s5CtrFanDirectionError.setStatus('current') if mibBuilder.loadTexts: s5CtrFanDirectionError.setDescription("A fan component's direction is incorrect.") s5_ctr_high_temperature_error = notification_type((1, 3, 6, 1, 4, 1, 45, 1, 6, 2, 4, 0, 7)).setObjects(('S5-CHASSIS-MIB', 's5ChasComType'), ('S5-CHASSIS-MIB', 's5ChasComOperState')) if mibBuilder.loadTexts: s5CtrHighTemperatureError.setStatus('current') if mibBuilder.loadTexts: s5CtrHighTemperatureError.setDescription('The system is overheated.') mibBuilder.exportSymbols('S5-CHASSIS-TRAP-MIB', s5CtrUnitDown=s5CtrUnitDown, s5CtrNewProblem=s5CtrNewProblem, s5CtrUnitUp=s5CtrUnitUp, s5CtrHighTemperatureError=s5CtrHighTemperatureError, PYSNMP_MODULE_ID=s5ChassisTrapMib, s5CtrNewUnitUp=s5CtrNewUnitUp, s5CtrProblem=s5CtrProblem, s5CtrFanDirectionError=s5CtrFanDirectionError, s5CtrNewUnitDown=s5CtrNewUnitDown, s5ChassisTrapMib=s5ChassisTrapMib, s5CtrFanRotationError=s5CtrFanRotationError, s5CtrNewHotSwap=s5CtrNewHotSwap, s5CtrHotSwap=s5CtrHotSwap)
class Ssl(object): FIELD_MAP = { "domain": "domain", "expires": "expires", "issuer": "issuer", "org": "org", "subject": "subject", "valid": "valid", "version": "version" } def __init__(self): self.domain = "" self.expires = "" self.issuer = "" self.org = "" self.subject = "" self.valid = "" self.version = "" @staticmethod def from_dictionary(ssl_dict: dict): ssl = Ssl() field_map = getattr(ssl.__class__, "FIELD_MAP") for key_name in field_map: if key_name in ssl_dict: setattr(ssl, field_map[key_name], ssl_dict[key_name]) return ssl
class Ssl(object): field_map = {'domain': 'domain', 'expires': 'expires', 'issuer': 'issuer', 'org': 'org', 'subject': 'subject', 'valid': 'valid', 'version': 'version'} def __init__(self): self.domain = '' self.expires = '' self.issuer = '' self.org = '' self.subject = '' self.valid = '' self.version = '' @staticmethod def from_dictionary(ssl_dict: dict): ssl = ssl() field_map = getattr(ssl.__class__, 'FIELD_MAP') for key_name in field_map: if key_name in ssl_dict: setattr(ssl, field_map[key_name], ssl_dict[key_name]) return ssl
cuenta = [] for i in range(0,20): cuenta.append(i+1) print("Primeros 3 elementos en la lista") print(cuenta[slice(3)]) print() print("3 elementos del medio") print(cuenta[slice(7,10)]) print() print("ultimos 3 elementos de la lista") print(cuenta[slice(len(cuenta)-3,len(cuenta))])
cuenta = [] for i in range(0, 20): cuenta.append(i + 1) print('Primeros 3 elementos en la lista') print(cuenta[slice(3)]) print() print('3 elementos del medio') print(cuenta[slice(7, 10)]) print() print('ultimos 3 elementos de la lista') print(cuenta[slice(len(cuenta) - 3, len(cuenta))])
# -*- coding: utf-8 -*- inputCoordInicialFinalFazenda = list(map(int, input().split())) countTest = 1 while sum(inputCoordInicialFinalFazenda) != 0: qntOcorrenciaMeteoro = int(input()) qntOcorrenciaMeteoroDentroFazenda = 0 tamanhoFazendaCoordX = abs(inputCoordInicialFinalFazenda[0] - inputCoordInicialFinalFazenda[2]) tamanhoFazendaCoordY = abs(inputCoordInicialFinalFazenda[1] - inputCoordInicialFinalFazenda[3]) for indiceOcorrenciaMeteoro in range(0,qntOcorrenciaMeteoro): listInputCoordMeteoro = list(map(int, input().split())) if listInputCoordMeteoro[0] >= inputCoordInicialFinalFazenda[0] and abs(listInputCoordMeteoro[0] - inputCoordInicialFinalFazenda[0]) <= tamanhoFazendaCoordX: if listInputCoordMeteoro[1] <= inputCoordInicialFinalFazenda[1] and abs(listInputCoordMeteoro[1] - inputCoordInicialFinalFazenda[1]) <= tamanhoFazendaCoordY: qntOcorrenciaMeteoroDentroFazenda += 1 print("Teste {}".format(countTest)) print("{}".format(qntOcorrenciaMeteoroDentroFazenda)) countTest += 1 inputCoordInicialFinalFazenda = list(map(int, input().split()))
input_coord_inicial_final_fazenda = list(map(int, input().split())) count_test = 1 while sum(inputCoordInicialFinalFazenda) != 0: qnt_ocorrencia_meteoro = int(input()) qnt_ocorrencia_meteoro_dentro_fazenda = 0 tamanho_fazenda_coord_x = abs(inputCoordInicialFinalFazenda[0] - inputCoordInicialFinalFazenda[2]) tamanho_fazenda_coord_y = abs(inputCoordInicialFinalFazenda[1] - inputCoordInicialFinalFazenda[3]) for indice_ocorrencia_meteoro in range(0, qntOcorrenciaMeteoro): list_input_coord_meteoro = list(map(int, input().split())) if listInputCoordMeteoro[0] >= inputCoordInicialFinalFazenda[0] and abs(listInputCoordMeteoro[0] - inputCoordInicialFinalFazenda[0]) <= tamanhoFazendaCoordX: if listInputCoordMeteoro[1] <= inputCoordInicialFinalFazenda[1] and abs(listInputCoordMeteoro[1] - inputCoordInicialFinalFazenda[1]) <= tamanhoFazendaCoordY: qnt_ocorrencia_meteoro_dentro_fazenda += 1 print('Teste {}'.format(countTest)) print('{}'.format(qntOcorrenciaMeteoroDentroFazenda)) count_test += 1 input_coord_inicial_final_fazenda = list(map(int, input().split()))
def binary_search(items, target): """O(log n).""" low = 0 high = len(items) - 1 while low <= high: mid = (low + high) // 2 if items[mid] == target: return mid elif items[mid] < target: low = mid + 1 elif items[mid] > target: high = mid - 1 return None
def binary_search(items, target): """O(log n).""" low = 0 high = len(items) - 1 while low <= high: mid = (low + high) // 2 if items[mid] == target: return mid elif items[mid] < target: low = mid + 1 elif items[mid] > target: high = mid - 1 return None
endPoints={ "register" : "/register", "checkKyc" : "/check_kyc", "checkHandle" : "/check_handle", "requestKyc" : "/request_kyc", "issueSila" : "/issue_sila", "redeemSila" : "/redeem_sila", "transferSila" : "/transfer_sila", "addCrypto" : "/add_crypto", "addIdentity" : "/add_identity", "createBond" : "/create_bond", "checkHandle" : "/check_handle", "getAccounts" : "/get_accounts", "getTransactions" : "/get_transactions", "registerOperator" : "/register_operator", "linkAccount" : "/link_account", "schemaUrl" : "https://api.silamoney.com/0.2/getmessage?emptymessage=%sTestMessage", "apiUrl" : "https://%s.silamoney.com/0.2", "silaBalanceProd" : "https://silatokenapi.silamoney.com/silaBalance", "silaBalanceSandbox" : "https://sandbox.silatokenapi.silamoney.com/silaBalance" }
end_points = {'register': '/register', 'checkKyc': '/check_kyc', 'checkHandle': '/check_handle', 'requestKyc': '/request_kyc', 'issueSila': '/issue_sila', 'redeemSila': '/redeem_sila', 'transferSila': '/transfer_sila', 'addCrypto': '/add_crypto', 'addIdentity': '/add_identity', 'createBond': '/create_bond', 'checkHandle': '/check_handle', 'getAccounts': '/get_accounts', 'getTransactions': '/get_transactions', 'registerOperator': '/register_operator', 'linkAccount': '/link_account', 'schemaUrl': 'https://api.silamoney.com/0.2/getmessage?emptymessage=%sTestMessage', 'apiUrl': 'https://%s.silamoney.com/0.2', 'silaBalanceProd': 'https://silatokenapi.silamoney.com/silaBalance', 'silaBalanceSandbox': 'https://sandbox.silatokenapi.silamoney.com/silaBalance'}
id_to_channel = {} # Official Studio Channels id_to_channel['UC2-BeLxzUBSs0uSrmzWhJuQ'] = "20th Century Fox" id_to_channel['UCor9rW6PgxSQ9vUPWQdnaYQ'] = "FoxSearchlight" id_to_channel['UCz97F7dMxBNOfGYu3rx8aCw'] = "Sony Pictues" id_to_channel['UCFqyJFbsV-uEcosvNhg0PaQ'] = "Sony Pictures India" id_to_channel['UCjmJDM5pRKbUlVIzDYYWb6g'] = "Warner Bros" id_to_channel['UCbxjDfYwfF8RjYBp5htJ38Q'] = "Warner Bros UK" id_to_channel['UC9YHyj7QSkkSg2pjQ7M8Khg'] = "Paramount Movies" id_to_channel['UCpVqzaoo6_5dKbmgFGK1M_Q'] = "Paramount Movies NL" id_to_channel['UCq0OueAsdxH6b8nyAspwViw'] = "Universal Pictures" id_to_channel['UCIHg3K4EaY-ziWc5CyzWAzQ'] = "UniversalMovies" id_to_channel['UCZGYJFUizSax-yElQaFDp5Q'] = "Star Wars" id_to_channel['UC_IRYSp4auq7hKLvziWVH6w'] = "Disney-Pixar" id_to_channel['UCV3uIARCxZY6lWbeVVRZsKg'] = "DisneyMoviesOnDemand" id_to_channel['UCuaFvcY4MhZY3U43mMt1dYQ'] = "Disney Movie Trailers" id_to_channel['UC_976xMxPgzIa290Hqtk-9g'] = "Walt Disney Animation Studios" id_to_channel['UCJ6nMHaJPZvsJ-HmUmj1SeA'] = "Lionsgate Movies" id_to_channel['UCY26xU0-avwTJ6F6TzUZVEw'] = "DreamWorksTV" # Third party channels id_to_channel['UCi8e0iOVk1fEOogdfu4YgfA'] = "Movieclips Trailers" id_to_channel['UCTCjFFoX1un-j7ni4B6HJ3Q'] = "Movieclips Classic Trailers" id_to_channel['UCw7TdYd1d873DtdjkdKStUg'] = "White Yak Trailer" id_to_channel['UCDoLDRl0RbBWPIwR2xjjneg'] = "Video Detective" id_to_channel['UCpJN7kiUkDrH11p0GQhLyFw'] = "Movie Trailers Source" id_to_channel['UCj4lFy4F5PqXD7d41mCKVYw'] = "MovieAccessTrailers" id_to_channel['UCpo2fJvnalYlwN97ehhyfBQ'] = "hollywoodstreams" id_to_channel['UCT0hbLDa-unWsnZ6Rjzkfug'] = "FilmSelect Trailer" approved_channel_ids = id_to_channel.keys()
id_to_channel = {} id_to_channel['UC2-BeLxzUBSs0uSrmzWhJuQ'] = '20th Century Fox' id_to_channel['UCor9rW6PgxSQ9vUPWQdnaYQ'] = 'FoxSearchlight' id_to_channel['UCz97F7dMxBNOfGYu3rx8aCw'] = 'Sony Pictues' id_to_channel['UCFqyJFbsV-uEcosvNhg0PaQ'] = 'Sony Pictures India' id_to_channel['UCjmJDM5pRKbUlVIzDYYWb6g'] = 'Warner Bros' id_to_channel['UCbxjDfYwfF8RjYBp5htJ38Q'] = 'Warner Bros UK' id_to_channel['UC9YHyj7QSkkSg2pjQ7M8Khg'] = 'Paramount Movies' id_to_channel['UCpVqzaoo6_5dKbmgFGK1M_Q'] = 'Paramount Movies NL' id_to_channel['UCq0OueAsdxH6b8nyAspwViw'] = 'Universal Pictures' id_to_channel['UCIHg3K4EaY-ziWc5CyzWAzQ'] = 'UniversalMovies' id_to_channel['UCZGYJFUizSax-yElQaFDp5Q'] = 'Star Wars' id_to_channel['UC_IRYSp4auq7hKLvziWVH6w'] = 'Disney-Pixar' id_to_channel['UCV3uIARCxZY6lWbeVVRZsKg'] = 'DisneyMoviesOnDemand' id_to_channel['UCuaFvcY4MhZY3U43mMt1dYQ'] = 'Disney Movie Trailers' id_to_channel['UC_976xMxPgzIa290Hqtk-9g'] = 'Walt Disney Animation Studios' id_to_channel['UCJ6nMHaJPZvsJ-HmUmj1SeA'] = 'Lionsgate Movies' id_to_channel['UCY26xU0-avwTJ6F6TzUZVEw'] = 'DreamWorksTV' id_to_channel['UCi8e0iOVk1fEOogdfu4YgfA'] = 'Movieclips Trailers' id_to_channel['UCTCjFFoX1un-j7ni4B6HJ3Q'] = 'Movieclips Classic Trailers' id_to_channel['UCw7TdYd1d873DtdjkdKStUg'] = 'White Yak Trailer' id_to_channel['UCDoLDRl0RbBWPIwR2xjjneg'] = 'Video Detective' id_to_channel['UCpJN7kiUkDrH11p0GQhLyFw'] = 'Movie Trailers Source' id_to_channel['UCj4lFy4F5PqXD7d41mCKVYw'] = 'MovieAccessTrailers' id_to_channel['UCpo2fJvnalYlwN97ehhyfBQ'] = 'hollywoodstreams' id_to_channel['UCT0hbLDa-unWsnZ6Rjzkfug'] = 'FilmSelect Trailer' approved_channel_ids = id_to_channel.keys()
N=int(input()) v=[*map(int,input().split())] ba=ba2=-1 last=-1 dec_start=False for n,i in enumerate(v): if i>=last: if i>last: if not dec_start: ba=n else: ba2=n-1 break else: dec_start=True last=i if not dec_start: print("1 1") exit(0) if ba>-1 and ba2==-1: ba2=N-1 revv=v[ba:ba2+1] revv=revv[::-1] for i in range(len(revv)): v[ba+i]=revv[i] for i in range(1,len(v)): if v[i]<v[i-1]: print("impossible") exit(0) print(ba+1,ba2+1)
n = int(input()) v = [*map(int, input().split())] ba = ba2 = -1 last = -1 dec_start = False for (n, i) in enumerate(v): if i >= last: if i > last: if not dec_start: ba = n else: ba2 = n - 1 break else: dec_start = True last = i if not dec_start: print('1 1') exit(0) if ba > -1 and ba2 == -1: ba2 = N - 1 revv = v[ba:ba2 + 1] revv = revv[::-1] for i in range(len(revv)): v[ba + i] = revv[i] for i in range(1, len(v)): if v[i] < v[i - 1]: print('impossible') exit(0) print(ba + 1, ba2 + 1)
class ModelManager: models = [ { 'modelPath': 'core/models/mobilenet_ssd_v1_coco/frozen_inference_graph.pb', 'configPath': 'core/models/mobilenet_ssd_v1_coco/ssd_mobilenet_v1_coco_2017_11_17.pbtxt', 'classNames': { 0: 'background', 1: 'person', 2: 'bicycle', 3: 'car', 4: 'motorcycle', 5: 'airplane', 6: 'bus', 7: 'train', 8: 'truck', 9: 'boat', 10: 'traffic light', 11: 'fire hydrant', 13: 'stop sign', 14: 'parking meter', 15: 'bench', 16: 'bird', 17: 'cat', 18: 'dog', 19: 'horse', 20: 'sheep', 21: 'cow', 22: 'elephant', 23: 'bear', 24: 'zebra', 25: 'giraffe', 27: 'backpack', 28: 'umbrella', 31: 'handbag', 32: 'tie', 33: 'suitcase', 34: 'frisbee', 35: 'skis', 36: 'snowboard', 37: 'sports ball', 38: 'kite', 39: 'baseball bat', 40: 'baseball glove', 41: 'skateboard', 42: 'surfboard', 43: 'tennis racket', 44: 'bottle', 46: 'wine glass', 47: 'cup', 48: 'fork', 49: 'knife', 50: 'spoon', 51: 'bowl', 52: 'banana', 53: 'apple', 54: 'sandwich', 55: 'orange', 56: 'broccoli', 57: 'carrot', 58: 'hot dog', 59: 'pizza', 60: 'donut', 61: 'cake', 62: 'chair', 63: 'couch', 64: 'potted plant', 65: 'bed', 67: 'dining table', 70: 'toilet', 72: 'tv', 73: 'laptop', 74: 'mouse', 75: 'remote', 76: 'keyboard', 77: 'cell phone', 78: 'microwave', 79: 'oven', 80: 'toaster', 81: 'sink', 82: 'refrigerator', 84: 'book', 85: 'clock', 86: 'vase', 87: 'scissors', 88: 'teddy bear', 89: 'hair drier', 90: 'toothbrush' } }, { 'modelPath': 'core/models/mobilenet_ssd_v1_sports/frozen_inference_graph.pb', 'configPath': 'core/models/mobilenet_ssd_v1_sports/ssd_mobilenet_v1_sports_2020_10_04.pbtxt', 'classNames': { 0: 'background', 1: 'logo' } }, { 'modelPath': 'core/models/east_text_detection/frozen_east_text_detection.pb' }, { 'modelPath': 'core/models/meijieru_crnn/crnn.onnx' } ]
class Modelmanager: models = [{'modelPath': 'core/models/mobilenet_ssd_v1_coco/frozen_inference_graph.pb', 'configPath': 'core/models/mobilenet_ssd_v1_coco/ssd_mobilenet_v1_coco_2017_11_17.pbtxt', 'classNames': {0: 'background', 1: 'person', 2: 'bicycle', 3: 'car', 4: 'motorcycle', 5: 'airplane', 6: 'bus', 7: 'train', 8: 'truck', 9: 'boat', 10: 'traffic light', 11: 'fire hydrant', 13: 'stop sign', 14: 'parking meter', 15: 'bench', 16: 'bird', 17: 'cat', 18: 'dog', 19: 'horse', 20: 'sheep', 21: 'cow', 22: 'elephant', 23: 'bear', 24: 'zebra', 25: 'giraffe', 27: 'backpack', 28: 'umbrella', 31: 'handbag', 32: 'tie', 33: 'suitcase', 34: 'frisbee', 35: 'skis', 36: 'snowboard', 37: 'sports ball', 38: 'kite', 39: 'baseball bat', 40: 'baseball glove', 41: 'skateboard', 42: 'surfboard', 43: 'tennis racket', 44: 'bottle', 46: 'wine glass', 47: 'cup', 48: 'fork', 49: 'knife', 50: 'spoon', 51: 'bowl', 52: 'banana', 53: 'apple', 54: 'sandwich', 55: 'orange', 56: 'broccoli', 57: 'carrot', 58: 'hot dog', 59: 'pizza', 60: 'donut', 61: 'cake', 62: 'chair', 63: 'couch', 64: 'potted plant', 65: 'bed', 67: 'dining table', 70: 'toilet', 72: 'tv', 73: 'laptop', 74: 'mouse', 75: 'remote', 76: 'keyboard', 77: 'cell phone', 78: 'microwave', 79: 'oven', 80: 'toaster', 81: 'sink', 82: 'refrigerator', 84: 'book', 85: 'clock', 86: 'vase', 87: 'scissors', 88: 'teddy bear', 89: 'hair drier', 90: 'toothbrush'}}, {'modelPath': 'core/models/mobilenet_ssd_v1_sports/frozen_inference_graph.pb', 'configPath': 'core/models/mobilenet_ssd_v1_sports/ssd_mobilenet_v1_sports_2020_10_04.pbtxt', 'classNames': {0: 'background', 1: 'logo'}}, {'modelPath': 'core/models/east_text_detection/frozen_east_text_detection.pb'}, {'modelPath': 'core/models/meijieru_crnn/crnn.onnx'}]
# Space: O(n) # Time: O(n) # Solution without collections library # Definition for a binary tree node. # class TreeNode(object): # def __init__(self, val=0, left=None, right=None): # self.val = val # self.left = left # self.right = right class Solution(): def zigzagLevelOrder(self, root): queue = [[root, 0]] res = [] temp_res = [] level_status = 0 flag = 0 while queue: cur_root, cur_level = queue.pop(0) if level_status == cur_level: temp_res.append(cur_root.val) else: level_status = cur_level if flag == 0: res.append(temp_res) flag = 1 else: res.append(temp_res[::-1]) flag = 0 temp_res = [cur_root.val] if cur_root.left: queue.append([cur_root.left, cur_level + 1]) if cur_root.right: queue.append([cur_root.right, cur_level + 1]) if flag == 0: res.append(temp_res) else: res.append(temp_res[::-1]) return res
class Solution: def zigzag_level_order(self, root): queue = [[root, 0]] res = [] temp_res = [] level_status = 0 flag = 0 while queue: (cur_root, cur_level) = queue.pop(0) if level_status == cur_level: temp_res.append(cur_root.val) else: level_status = cur_level if flag == 0: res.append(temp_res) flag = 1 else: res.append(temp_res[::-1]) flag = 0 temp_res = [cur_root.val] if cur_root.left: queue.append([cur_root.left, cur_level + 1]) if cur_root.right: queue.append([cur_root.right, cur_level + 1]) if flag == 0: res.append(temp_res) else: res.append(temp_res[::-1]) return res
# adds a and b def addNumbers(a, b): return a+b # subtracts a and b def subNumbers(a, b): return a-b
def add_numbers(a, b): return a + b def sub_numbers(a, b): return a - b
#!/usr/bin/python """ Amicable numbers https://projecteuler.net/problem=21 """ def d(n): q = [] for i in range(1, n / 2 + 1, 1): if n % i == 0: q.append(i) return sum(q) def main(): w = [] for i in range(1, 10000, 1): if i == d(d(i)) and i != d(i): print(i) w.append(i) print(sum(w)) if __name__ == "__main__": main()
""" Amicable numbers https://projecteuler.net/problem=21 """ def d(n): q = [] for i in range(1, n / 2 + 1, 1): if n % i == 0: q.append(i) return sum(q) def main(): w = [] for i in range(1, 10000, 1): if i == d(d(i)) and i != d(i): print(i) w.append(i) print(sum(w)) if __name__ == '__main__': main()
# Evaluation function CAPACITY_SCALAR = 0.25 TARGET_SCORE = 1e4 # Bed update generation TIMESTEP = 50 UPDATE_CASES = ["normal_to_corona", "corona_leaves_hosp"] BED_UPDATE_PROB = 10 # Hospitals initialization NUMBER_FREE_BEDS = 25 NUMBER_CORONA_BEDS = 5 NUMBER_FREE_CORONA_BEDS = 3 NUMBER_CORONA_PAT_IN_NORMAL_BED = 1 SEVERITY_FOR_CORONA_BED = 0.8 # Properties for request generation NUMBER_PATIENTS = 10000 NUMBER_DAYS = 150 LAT_DELTA = 0.1 LON_DELTA = 0.1 NUMBER_INITALLY_INFECTED = 10 EXPONENTIAL_RATE = 0.15 # Vehicle Properties MAX_VEHICLE_RANGE = 100 # Precomputing parameters NBR_SEGMENTS = 200
capacity_scalar = 0.25 target_score = 10000.0 timestep = 50 update_cases = ['normal_to_corona', 'corona_leaves_hosp'] bed_update_prob = 10 number_free_beds = 25 number_corona_beds = 5 number_free_corona_beds = 3 number_corona_pat_in_normal_bed = 1 severity_for_corona_bed = 0.8 number_patients = 10000 number_days = 150 lat_delta = 0.1 lon_delta = 0.1 number_initally_infected = 10 exponential_rate = 0.15 max_vehicle_range = 100 nbr_segments = 200
class HttpResponseException(Exception): def __init__(self, http_response): super(HttpResponseException, self).__init__(http_response) self.http_response = http_response
class Httpresponseexception(Exception): def __init__(self, http_response): super(HttpResponseException, self).__init__(http_response) self.http_response = http_response
User_Name=input('What is your name? ') User_Age=input('How old are you? ') User_Home=input('Where do you live? ') print('Hello, ',User_Name) print('Your age is ',User_Age) print('You live in ',User_Home)
user__name = input('What is your name? ') user__age = input('How old are you? ') user__home = input('Where do you live? ') print('Hello, ', User_Name) print('Your age is ', User_Age) print('You live in ', User_Home)
def funA(fn): print('A') fn() return "success" @funA def funB(): print('B') print(funB) a = funB print(a) class Category: cake=lambda p: print(p) c=Category() c.cake()
def fun_a(fn): print('A') fn() return 'success' @funA def fun_b(): print('B') print(funB) a = funB print(a) class Category: cake = lambda p: print(p) c = category() c.cake()
#!/usr/bin/env python #pylint: skip-file # This source code is licensed under the Apache license found in the # LICENSE file in the root directory of this project. class CertificateInfo(object): def __init__(self): """ Attributes: swaggerTypes (dict): The key is attribute name and the value is attribute type. attributeMap (dict): The key is attribute name and the value is json key in definition. """ self.swaggerTypes = { 'keySize': 'int', 'serialNumber': 'str', 'issuerDN': 'str', 'subjectDN': 'str', 'keyType': 'str', 'noAfterDate': 'str', 'beginDateISO8601': 'str', 'noAfterDateISO8601': 'str', 'beginDate': 'str', 'signature': 'str' } self.attributeMap = { 'keySize': 'keySize', 'serialNumber': 'serialNumber', 'issuerDN': 'issuerDN', 'subjectDN': 'subjectDN', 'keyType': 'keyType', 'noAfterDate': 'noAfterDate', 'beginDateISO8601': 'beginDateISO8601', 'noAfterDateISO8601': 'noAfterDateISO8601', 'beginDate': 'beginDate', 'signature': 'signature' } self.keySize = None # int self.serialNumber = None # str self.issuerDN = None # str self.subjectDN = None # str self.keyType = None # str self.noAfterDate = None # str self.beginDateISO8601 = None # str self.noAfterDateISO8601 = None # str self.beginDate = None # str self.signature = None # str
class Certificateinfo(object): def __init__(self): """ Attributes: swaggerTypes (dict): The key is attribute name and the value is attribute type. attributeMap (dict): The key is attribute name and the value is json key in definition. """ self.swaggerTypes = {'keySize': 'int', 'serialNumber': 'str', 'issuerDN': 'str', 'subjectDN': 'str', 'keyType': 'str', 'noAfterDate': 'str', 'beginDateISO8601': 'str', 'noAfterDateISO8601': 'str', 'beginDate': 'str', 'signature': 'str'} self.attributeMap = {'keySize': 'keySize', 'serialNumber': 'serialNumber', 'issuerDN': 'issuerDN', 'subjectDN': 'subjectDN', 'keyType': 'keyType', 'noAfterDate': 'noAfterDate', 'beginDateISO8601': 'beginDateISO8601', 'noAfterDateISO8601': 'noAfterDateISO8601', 'beginDate': 'beginDate', 'signature': 'signature'} self.keySize = None self.serialNumber = None self.issuerDN = None self.subjectDN = None self.keyType = None self.noAfterDate = None self.beginDateISO8601 = None self.noAfterDateISO8601 = None self.beginDate = None self.signature = None
expected_output = { 'topo_id': { '0': { 'topo_name': { 'EVPN-Multicast-BTV': { 'topo_type': 'L2VRF'}}}, '4294967294': { 'topo_name': { 'GLOBAL': { 'topo_type': 'N/A'}}}, '4294967295': { 'topo_name': { 'ALL': { 'topo_type': 'N/A'}}}}}
expected_output = {'topo_id': {'0': {'topo_name': {'EVPN-Multicast-BTV': {'topo_type': 'L2VRF'}}}, '4294967294': {'topo_name': {'GLOBAL': {'topo_type': 'N/A'}}}, '4294967295': {'topo_name': {'ALL': {'topo_type': 'N/A'}}}}}
num1 = int(input("Enter the first number")) num2 = int(input("Enter second number")) op = input("Enter operator") if op == " + ": print(num1+num2) elif op == "-": print("The subraction is", num1-num2) elif op == "*": print("The multiplication is ",num1*num2) elif op == "/": print("The division is", num1/num2) else: print("Invalid operator")
num1 = int(input('Enter the first number')) num2 = int(input('Enter second number')) op = input('Enter operator') if op == ' + ': print(num1 + num2) elif op == '-': print('The subraction is', num1 - num2) elif op == '*': print('The multiplication is ', num1 * num2) elif op == '/': print('The division is', num1 / num2) else: print('Invalid operator')
def add_common_params(parser): parser.add_argument( '--batch-size', type=int, default=64, help='input batch size for training (default: 64)') parser.add_argument( '--test-batch-size', type=int, default=1000, help='input batch size for testing (default: 1000)') parser.add_argument( '--epochs', type=int, default=20, help='number of epochs to train (default: 10)') parser.add_argument( '--lr', type=float, default=0.01, help='learning rate (default: 0.01)') parser.add_argument( '--momentum', type=float, default=0, help='SGD momentum (default: 0)') parser.add_argument( '--seed', type=int, default=1, help='random seed (default: 1)') parser.add_argument( '--log-interval', type=int, default=10, help='how many batches to wait before logging training status') parser.add_argument( '--save-model', action='store_true', default=False, help='For Saving the current Model') def add_decentralized_params(parser): parser.add_argument( '--nodes', type=int, default=100, help='number of nodes in decentralized setting (default: 1000)') parser.add_argument( '--sample-size', type=int, default=1000, help='number of samples per node (default: 100)') parser.add_argument( '--committee-size', type=int, default=30, help='number of nodes in committee (default: 100)') parser.add_argument( '--participants-size', type=int, default=30, help='number of nodes selected as participants (default: 100)') parser.add_argument( '--byzantine', type=float, default=0.0, help='% of actual byzantine nodes inside the node pool (default: 0, range: 0-1') parser.add_argument( '--expected-byzantine', type=float, default=0.0, help='% of expected byzantine nodes inside the node pool (default: 0, range: 0-1') parser.add_argument( '--byzantine-mode', type=str, default='random', help='type of byzantine effect to be used (random, label swap, np-norm) (default: random, in case of swap enter the format swap-{}-{}.') parser.add_argument( '--no-multiprocess', action='store_true', default=False, help='turn off multiprocess mode (default: False)') parser.add_argument( '--aggregator', type=str, default='union-consensus', choices=['union-consensus', 'krum', 'average', 'trimmed-mean'], help='Choice of aggregator (default: union-consensus)')
def add_common_params(parser): parser.add_argument('--batch-size', type=int, default=64, help='input batch size for training (default: 64)') parser.add_argument('--test-batch-size', type=int, default=1000, help='input batch size for testing (default: 1000)') parser.add_argument('--epochs', type=int, default=20, help='number of epochs to train (default: 10)') parser.add_argument('--lr', type=float, default=0.01, help='learning rate (default: 0.01)') parser.add_argument('--momentum', type=float, default=0, help='SGD momentum (default: 0)') parser.add_argument('--seed', type=int, default=1, help='random seed (default: 1)') parser.add_argument('--log-interval', type=int, default=10, help='how many batches to wait before logging training status') parser.add_argument('--save-model', action='store_true', default=False, help='For Saving the current Model') def add_decentralized_params(parser): parser.add_argument('--nodes', type=int, default=100, help='number of nodes in decentralized setting (default: 1000)') parser.add_argument('--sample-size', type=int, default=1000, help='number of samples per node (default: 100)') parser.add_argument('--committee-size', type=int, default=30, help='number of nodes in committee (default: 100)') parser.add_argument('--participants-size', type=int, default=30, help='number of nodes selected as participants (default: 100)') parser.add_argument('--byzantine', type=float, default=0.0, help='% of actual byzantine nodes inside the node pool (default: 0, range: 0-1') parser.add_argument('--expected-byzantine', type=float, default=0.0, help='% of expected byzantine nodes inside the node pool (default: 0, range: 0-1') parser.add_argument('--byzantine-mode', type=str, default='random', help='type of byzantine effect to be used (random, label swap, np-norm) (default: random, in case of swap enter the format swap-{}-{}.') parser.add_argument('--no-multiprocess', action='store_true', default=False, help='turn off multiprocess mode (default: False)') parser.add_argument('--aggregator', type=str, default='union-consensus', choices=['union-consensus', 'krum', 'average', 'trimmed-mean'], help='Choice of aggregator (default: union-consensus)')
def div(a, b): if b==0: return "error" else: return a/b def add(a,b): return a+b
def div(a, b): if b == 0: return 'error' else: return a / b def add(a, b): return a + b
class Fibonacci: def __init__(self): self.memo = dict() self.memo[1] = 1 self.memo[2] = 1 def __call__(self, N): if N <= 0 or type(N) != int: raise ValueError('Invalid argument: %s' % str(N) ) if N in self.memo: return self.memo[N] else: ret = self(N-1) + self(N-2) self.memo[N] = ret return ret fibonacci = Fibonacci() print (fibonacci(15))
class Fibonacci: def __init__(self): self.memo = dict() self.memo[1] = 1 self.memo[2] = 1 def __call__(self, N): if N <= 0 or type(N) != int: raise value_error('Invalid argument: %s' % str(N)) if N in self.memo: return self.memo[N] else: ret = self(N - 1) + self(N - 2) self.memo[N] = ret return ret fibonacci = fibonacci() print(fibonacci(15))
o = input() e = input() ans = '' for i in range(min(len(o), len(e))): ans += o[i] ans += e[i] if len(o) > len(e): ans += o[len(o) - 1] if len(o) < len(e): ans += o[len(e) - 1] print(ans)
o = input() e = input() ans = '' for i in range(min(len(o), len(e))): ans += o[i] ans += e[i] if len(o) > len(e): ans += o[len(o) - 1] if len(o) < len(e): ans += o[len(e) - 1] print(ans)
# FOR LOOP print('This program prints all the even number upto n') n=int(input('Enter the value of n ')) for i in range(0,n): if(not i%2): print(i)
print('This program prints all the even number upto n') n = int(input('Enter the value of n ')) for i in range(0, n): if not i % 2: print(i)
load("//:import_external.bzl", import_external = "safe_wix_scala_maven_import_external") def dependencies(): import_external( name = "org_joda_joda_convert", artifact = "org.joda:joda-convert:2.1.1", artifact_sha256 = "9b5ec53c4974be36fdf97ba026f3cec4106b8109bb9b484883c8d81c433991fb", srcjar_sha256 = "9b73d3508f95165818637cc41e61031057e903dc4181522f49ff06e52b46c057", )
load('//:import_external.bzl', import_external='safe_wix_scala_maven_import_external') def dependencies(): import_external(name='org_joda_joda_convert', artifact='org.joda:joda-convert:2.1.1', artifact_sha256='9b5ec53c4974be36fdf97ba026f3cec4106b8109bb9b484883c8d81c433991fb', srcjar_sha256='9b73d3508f95165818637cc41e61031057e903dc4181522f49ff06e52b46c057')
sample_rate = 32000 window_size = 1024 hop_size = 500 # So that there are 64 frames per second mel_bins = 64 fmin = 50 # Hz fmax = 14000 # Hz frames_per_second = sample_rate // hop_size logmel_eps = -100 # This value indicates silence used for padding labels = ['Accelerating_and_revving_and_vroom', 'Accordion', 'Acoustic_guitar', 'Applause', 'Bark', 'Bass_drum', 'Bass_guitar', 'Bathtub_(filling_or_washing)', 'Bicycle_bell', 'Burping_and_eructation', 'Bus', 'Buzz', 'Car_passing_by', 'Cheering', 'Chewing_and_mastication', 'Child_speech_and_kid_speaking', 'Chink_and_clink', 'Chirp_and_tweet', 'Church_bell', 'Clapping', 'Computer_keyboard', 'Crackle', 'Cricket', 'Crowd', 'Cupboard_open_or_close', 'Cutlery_and_silverware', 'Dishes_and_pots_and_pans', 'Drawer_open_or_close', 'Drip', 'Electric_guitar', 'Fart', 'Female_singing', 'Female_speech_and_woman_speaking', 'Fill_(with_liquid)', 'Finger_snapping', 'Frying_(food)', 'Gasp', 'Glockenspiel', 'Gong', 'Gurgling', 'Harmonica', 'Hi-hat', 'Hiss', 'Keys_jangling', 'Knock', 'Male_singing', 'Male_speech_and_man_speaking', 'Marimba_and_xylophone', 'Mechanical_fan', 'Meow', 'Microwave_oven', 'Motorcycle', 'Printer', 'Purr', 'Race_car_and_auto_racing', 'Raindrop', 'Run', 'Scissors', 'Screaming', 'Shatter', 'Sigh', 'Sink_(filling_or_washing)', 'Skateboard', 'Slam', 'Sneeze', 'Squeak', 'Stream', 'Strum', 'Tap', 'Tick-tock', 'Toilet_flush', 'Traffic_noise_and_roadway_noise', 'Trickle_and_dribble', 'Walk_and_footsteps', 'Water_tap_and_faucet', 'Waves_and_surf', 'Whispering', 'Writing', 'Yell', 'Zipper_(clothing)'] lb_to_idx = {lb: idx for idx, lb in enumerate(labels)} idx_to_lb = {idx: lb for idx, lb in enumerate(labels)} classes_num = len(labels) folds_num = 4
sample_rate = 32000 window_size = 1024 hop_size = 500 mel_bins = 64 fmin = 50 fmax = 14000 frames_per_second = sample_rate // hop_size logmel_eps = -100 labels = ['Accelerating_and_revving_and_vroom', 'Accordion', 'Acoustic_guitar', 'Applause', 'Bark', 'Bass_drum', 'Bass_guitar', 'Bathtub_(filling_or_washing)', 'Bicycle_bell', 'Burping_and_eructation', 'Bus', 'Buzz', 'Car_passing_by', 'Cheering', 'Chewing_and_mastication', 'Child_speech_and_kid_speaking', 'Chink_and_clink', 'Chirp_and_tweet', 'Church_bell', 'Clapping', 'Computer_keyboard', 'Crackle', 'Cricket', 'Crowd', 'Cupboard_open_or_close', 'Cutlery_and_silverware', 'Dishes_and_pots_and_pans', 'Drawer_open_or_close', 'Drip', 'Electric_guitar', 'Fart', 'Female_singing', 'Female_speech_and_woman_speaking', 'Fill_(with_liquid)', 'Finger_snapping', 'Frying_(food)', 'Gasp', 'Glockenspiel', 'Gong', 'Gurgling', 'Harmonica', 'Hi-hat', 'Hiss', 'Keys_jangling', 'Knock', 'Male_singing', 'Male_speech_and_man_speaking', 'Marimba_and_xylophone', 'Mechanical_fan', 'Meow', 'Microwave_oven', 'Motorcycle', 'Printer', 'Purr', 'Race_car_and_auto_racing', 'Raindrop', 'Run', 'Scissors', 'Screaming', 'Shatter', 'Sigh', 'Sink_(filling_or_washing)', 'Skateboard', 'Slam', 'Sneeze', 'Squeak', 'Stream', 'Strum', 'Tap', 'Tick-tock', 'Toilet_flush', 'Traffic_noise_and_roadway_noise', 'Trickle_and_dribble', 'Walk_and_footsteps', 'Water_tap_and_faucet', 'Waves_and_surf', 'Whispering', 'Writing', 'Yell', 'Zipper_(clothing)'] lb_to_idx = {lb: idx for (idx, lb) in enumerate(labels)} idx_to_lb = {idx: lb for (idx, lb) in enumerate(labels)} classes_num = len(labels) folds_num = 4
def get_customized_mapping(cls): mapping = { "fda_orphan_drug": { "properties": { "designated_date": { "type": "date" }, "designation_status": { "normalizer": "keyword_lowercase_normalizer", "type": "keyword" }, "orphan_designation": { "properties": { "original_text": { "type": "text", "copy_to": [ "all" ] }, "umls": { "type": "text", "copy_to": [ "all" ] }, "parsed_text": { "type": "text", "copy_to": [ "all" ] } } }, "marketing_approval_date": { "type": "date" }, "exclusivity_end_date": { "type": "date" }, "pubchem_cid": { "type": "integer", "copy_to": [ "all" ] }, "inchikey": { "normalizer": "keyword_lowercase_normalizer", "type": "keyword" }, "trade_name": { "type": "text" }, "approved_labeled_indication": { "type": "text" }, "exclusivity_protected_indication": { "type": "text" }, "pubchem_sid": { "type": "text" }, "generic_name": { "type": "text", "copy_to": [ "all" ] }, "approval_status": { "type": "text" }, "sponsor": { "type": "text", "index": "false" } } } } return mapping
def get_customized_mapping(cls): mapping = {'fda_orphan_drug': {'properties': {'designated_date': {'type': 'date'}, 'designation_status': {'normalizer': 'keyword_lowercase_normalizer', 'type': 'keyword'}, 'orphan_designation': {'properties': {'original_text': {'type': 'text', 'copy_to': ['all']}, 'umls': {'type': 'text', 'copy_to': ['all']}, 'parsed_text': {'type': 'text', 'copy_to': ['all']}}}, 'marketing_approval_date': {'type': 'date'}, 'exclusivity_end_date': {'type': 'date'}, 'pubchem_cid': {'type': 'integer', 'copy_to': ['all']}, 'inchikey': {'normalizer': 'keyword_lowercase_normalizer', 'type': 'keyword'}, 'trade_name': {'type': 'text'}, 'approved_labeled_indication': {'type': 'text'}, 'exclusivity_protected_indication': {'type': 'text'}, 'pubchem_sid': {'type': 'text'}, 'generic_name': {'type': 'text', 'copy_to': ['all']}, 'approval_status': {'type': 'text'}, 'sponsor': {'type': 'text', 'index': 'false'}}}} return mapping
#! python3 def mapear(funcao, lista): return (funcao(elemento) for elemento in lista) if __name__ =='__main__': print(list(mapear(lambda x: x ** 2, [2, 3, 4])))
def mapear(funcao, lista): return (funcao(elemento) for elemento in lista) if __name__ == '__main__': print(list(mapear(lambda x: x ** 2, [2, 3, 4])))
class Hand: def __init__(self, cards): self.__cards = cards self.__total = self.sum_cards(cards) def __str__(self): string = 'total: ' + str(self.total()) + ' ' for card in self.cards(): string += str(card) string += ' ' return string def add_card(self, card): self.__cards.append(card) self.__total = self.sum_cards(self.__cards) def cards(self): return self.__cards def has_available_ace(self): aces = [ card for card in self.__cards if card.is_ace() ] if len(aces) == 0: return False other_than_ace = [ card for card in self.__cards if not card.is_ace() ] total_sum_other_than_ace = self.sum_cards(other_than_ace) return total_sum_other_than_ace <= (11 - len(aces)) def total(self): return self.__total def is_busted(self): return 21 < self.total() def sum_cards(self, cards): aces = [ card for card in cards if card.is_ace() ] other_than_ace = [ card for card in cards if not card.is_ace() ] total = 0 for card in other_than_ace: number = card.number() if 10 <= number and number <= 13: total += 10 else: total += number for card in aces: number = card.number() if (total + 11) <= 21: total += 11 else: total += number return total
class Hand: def __init__(self, cards): self.__cards = cards self.__total = self.sum_cards(cards) def __str__(self): string = 'total: ' + str(self.total()) + ' ' for card in self.cards(): string += str(card) string += ' ' return string def add_card(self, card): self.__cards.append(card) self.__total = self.sum_cards(self.__cards) def cards(self): return self.__cards def has_available_ace(self): aces = [card for card in self.__cards if card.is_ace()] if len(aces) == 0: return False other_than_ace = [card for card in self.__cards if not card.is_ace()] total_sum_other_than_ace = self.sum_cards(other_than_ace) return total_sum_other_than_ace <= 11 - len(aces) def total(self): return self.__total def is_busted(self): return 21 < self.total() def sum_cards(self, cards): aces = [card for card in cards if card.is_ace()] other_than_ace = [card for card in cards if not card.is_ace()] total = 0 for card in other_than_ace: number = card.number() if 10 <= number and number <= 13: total += 10 else: total += number for card in aces: number = card.number() if total + 11 <= 21: total += 11 else: total += number return total
#!/usr/bin/env python3 # https://codeforces.com/problemset/problem/17/A def f(l): n,k = l pl = [True]*(n+1) # TRUE=prime or not? for i in range(2): pl[i] = False ll = n+1 i = 2 while i<ll: if pl[i]: #only for prime j = (i<<1) while j<ll: pl[j] = False #non-prime j += i i += 1 pp = [i for i in range(ll) if pl[i]][1:] #discard 2 nn = len(pp) sl = [pp[i]+pp[i+1]+1 for i in range(nn-1)] l = [pl[s] for s in sl if s<=n] return sum(l)>=k l = list(map(int,input().split())) #1e3, 1e3 print('YES' if f(l) else 'NO')
def f(l): (n, k) = l pl = [True] * (n + 1) for i in range(2): pl[i] = False ll = n + 1 i = 2 while i < ll: if pl[i]: j = i << 1 while j < ll: pl[j] = False j += i i += 1 pp = [i for i in range(ll) if pl[i]][1:] nn = len(pp) sl = [pp[i] + pp[i + 1] + 1 for i in range(nn - 1)] l = [pl[s] for s in sl if s <= n] return sum(l) >= k l = list(map(int, input().split())) print('YES' if f(l) else 'NO')
"""Global shared constants for dart rules.""" dart_filetypes = [".dart"] api_summary_extension = "api.ds" analysis_extension = "analysis" codegen_outline_extension = "outline" WEB_PLATFORM = "web" VM_PLATFORM = "vm" FLUTTER_PLATFORM = "flutter" ALL_PLATFORMS = [WEB_PLATFORM, VM_PLATFORM, FLUTTER_PLATFORM]
"""Global shared constants for dart rules.""" dart_filetypes = ['.dart'] api_summary_extension = 'api.ds' analysis_extension = 'analysis' codegen_outline_extension = 'outline' web_platform = 'web' vm_platform = 'vm' flutter_platform = 'flutter' all_platforms = [WEB_PLATFORM, VM_PLATFORM, FLUTTER_PLATFORM]
def luck_check(s): if len(s) % 2 == 1: s = s[:len(s)//2] + s[len(s)//2 + 1:] return (sum(int(i) for i in s[:len(s)//2]) == sum(int(i) for i in s[len(s)//2:]))
def luck_check(s): if len(s) % 2 == 1: s = s[:len(s) // 2] + s[len(s) // 2 + 1:] return sum((int(i) for i in s[:len(s) // 2])) == sum((int(i) for i in s[len(s) // 2:]))
# This is the solution to the problem if the lines would "partition" # the containers, as physics works in real life. # This particular problem doesn't care about partitioning the water, though. HEIGHT = 0 INDEX = 1 BOUNDING_HEIGHT = 2 class Solution: ''' Given n non-negative integers a1, a2, ..., an, where each represents a point at coordinate (i, ai). n vertical lines are drawn such that the two endpoints of line i is at (i, ai) and (i, 0). Find two lines, which together with x-axis forms a container, such that the container contains the most water. Note: You may not slant the container and n is at least 2. ''' def maxArea(self, height): """ :type height: List[int] :rtype: int """ max_volume = 0 most_voluminous_container = (-1, -1) container = [0, 0, 0] for index, h in enumerate(height): if h >= container[HEIGHT] or h > container[BOUNDING_HEIGHT]: if h >= container[HEIGHT]: volume = (index - container[INDEX]) * min(h, container[HEIGHT]) else: container[BOUNDING_HEIGHT] = h volume = (index - container[INDEX]) * h if volume > max_volume: max_volume = volume most_voluminous_container = (container[INDEX], index) if h >= container[HEIGHT]: container = [h, index, 0] return max_volume def test(): data = [ {'in': [3, 0, 0, 3], 'out': 9}, {'in': [3, 0, 0, 1], 'out': 3}, {'in': [0, 0, 0, 1], 'out': 0}, {'in': [0, 0, 0, 1, 1], 'out': 1}, {'in': [1, 6, 1, 1, 3], 'out': 9}, ] solution = Solution() for d in data: ans = solution.maxArea(d['in']) print("max_volume in {} should be {}. answer: {}".format(d['in'], d['out'], ans)) if __name__ == "__main__": test()
height = 0 index = 1 bounding_height = 2 class Solution: """ Given n non-negative integers a1, a2, ..., an, where each represents a point at coordinate (i, ai). n vertical lines are drawn such that the two endpoints of line i is at (i, ai) and (i, 0). Find two lines, which together with x-axis forms a container, such that the container contains the most water. Note: You may not slant the container and n is at least 2. """ def max_area(self, height): """ :type height: List[int] :rtype: int """ max_volume = 0 most_voluminous_container = (-1, -1) container = [0, 0, 0] for (index, h) in enumerate(height): if h >= container[HEIGHT] or h > container[BOUNDING_HEIGHT]: if h >= container[HEIGHT]: volume = (index - container[INDEX]) * min(h, container[HEIGHT]) else: container[BOUNDING_HEIGHT] = h volume = (index - container[INDEX]) * h if volume > max_volume: max_volume = volume most_voluminous_container = (container[INDEX], index) if h >= container[HEIGHT]: container = [h, index, 0] return max_volume def test(): data = [{'in': [3, 0, 0, 3], 'out': 9}, {'in': [3, 0, 0, 1], 'out': 3}, {'in': [0, 0, 0, 1], 'out': 0}, {'in': [0, 0, 0, 1, 1], 'out': 1}, {'in': [1, 6, 1, 1, 3], 'out': 9}] solution = solution() for d in data: ans = solution.maxArea(d['in']) print('max_volume in {} should be {}. answer: {}'.format(d['in'], d['out'], ans)) if __name__ == '__main__': test()
def open_door(): # TODO: This needs to be in the stdlib. Driftwood.area.tilemap.layers[2].tile(4, 0).nowalk = None Driftwood.area.tilemap.layers[2].tile(4, 0).setgid(27) def open_door2(): Driftwood.area.tilemap.layers[2].tile(2, 0).nowalk = None Driftwood.area.tilemap.layers[2].tile(2, 0).setgid(27) def get_pearl(): if not _["inventory"].has("blue_pearl"): Driftwood.area.tilemap.layers[2].tile(5, 3).nowalk = None Driftwood.area.tilemap.layers[1].tile(5, 3).setgid(0) _["inventory"].get("blue_pearl", 1) _["inventory"].save() if "blue_pearl_light" in Driftwood.vars and Driftwood.vars["blue_pearl_light"]: Driftwood.light.kill(Driftwood.vars["blue_pearl_light"])
def open_door(): Driftwood.area.tilemap.layers[2].tile(4, 0).nowalk = None Driftwood.area.tilemap.layers[2].tile(4, 0).setgid(27) def open_door2(): Driftwood.area.tilemap.layers[2].tile(2, 0).nowalk = None Driftwood.area.tilemap.layers[2].tile(2, 0).setgid(27) def get_pearl(): if not _['inventory'].has('blue_pearl'): Driftwood.area.tilemap.layers[2].tile(5, 3).nowalk = None Driftwood.area.tilemap.layers[1].tile(5, 3).setgid(0) _['inventory'].get('blue_pearl', 1) _['inventory'].save() if 'blue_pearl_light' in Driftwood.vars and Driftwood.vars['blue_pearl_light']: Driftwood.light.kill(Driftwood.vars['blue_pearl_light'])
########################################################## # Author: Raghav Sikaria # LinkedIn: https://www.linkedin.com/in/raghavsikaria/ # Github: https://github.com/raghavsikaria # Last Update: 31-5-2020 # Project: LeetCode May 31 Day 2020 Challenge - Day 31 ########################################################## # QUESTION # This question is from the abovementioned challenge and can be found here on LeetCode: https://leetcode.com/explore/featured/card/may-leetcoding-challenge/538/week-5-may-29th-may-31st/3346/ ############################################################################ # Given two words word1 and word2, find the minimum number of operations required to convert word1 to word2. # You have the following 3 operations permitted on a word: # Insert a character # Delete a character # Replace a character # Example 1: # Input: word1 = "horse", word2 = "ros" # Output: 3 # Explanation: # horse -> rorse (replace 'h' with 'r') # rorse -> rose (remove 'r') # rose -> ros (remove 'e') # Example 2: # Input: word1 = "intention", word2 = "execution" # Output: 5 # Explanation: # intention -> inention (remove 't') # inention -> enention (replace 'i' with 'e') # enention -> exention (replace 'n' with 'x') # exention -> exection (replace 'n' with 'c') # exection -> execution (insert 'u') ############################################################################ # ACCEPTED SOLUTION # Standard DP problem # I am glad I could do it # But disheartened at the same time, # that this was only because of my ADA Subject # during my majors in CSE @ VIT # Coming up with a bottom-up solution # for a DP problem - is well - quite difficult! # Ensures O(nm) Time and O(nm) Space complexity class Solution: def minDistance(self, word1: str, word2: str) -> int: len_w1 = len(word1) len_w2 = len(word2) memoization_matrix = [[0]*(len_w1+1) for i in range(len_w2+1)] for i in range(len_w2+1): for j in range(len_w1+1): if j == 0: memoization_matrix[i][j] = i elif i == 0: memoization_matrix[i][j] = j elif word1[j-1] == word2[i-1]: memoization_matrix[i][j] = memoization_matrix[i-1][j-1] else: memoization_matrix[i][j] = min(memoization_matrix[i-1][j-1], memoization_matrix[i-1][j], memoization_matrix[i][j-1]) + 1 return memoization_matrix[-1][-1]
class Solution: def min_distance(self, word1: str, word2: str) -> int: len_w1 = len(word1) len_w2 = len(word2) memoization_matrix = [[0] * (len_w1 + 1) for i in range(len_w2 + 1)] for i in range(len_w2 + 1): for j in range(len_w1 + 1): if j == 0: memoization_matrix[i][j] = i elif i == 0: memoization_matrix[i][j] = j elif word1[j - 1] == word2[i - 1]: memoization_matrix[i][j] = memoization_matrix[i - 1][j - 1] else: memoization_matrix[i][j] = min(memoization_matrix[i - 1][j - 1], memoization_matrix[i - 1][j], memoization_matrix[i][j - 1]) + 1 return memoization_matrix[-1][-1]
"""Basic Sphinx configuration file for testing. We use ``confoverrides`` in the tests to provide the actual configuration. """ html_theme = "sphinxawesome_theme"
"""Basic Sphinx configuration file for testing. We use ``confoverrides`` in the tests to provide the actual configuration. """ html_theme = 'sphinxawesome_theme'
# vim: set fenc=utf8 ts=4 sw=4 et : class Plugin2(object): # pragma: no cover """Version 2 plugin interface.""" @staticmethod def help(): """Return a help string.""" pass def __init__(self, *args): """Called once during startup.""" pass def __deinit__(self): """Called once during shutdown.""" pass def flow_new(self, flow, frame): """Called every time a new flow is opened.""" pass def flow_expired(self, flow): """Called every time a flow expired, before printing the flow.""" pass def flow_end(self, flow): """Called every time a flow ends, before printing the flow.""" pass def frame_new(self, frame, flow): """Called for every new frame.""" pass
class Plugin2(object): """Version 2 plugin interface.""" @staticmethod def help(): """Return a help string.""" pass def __init__(self, *args): """Called once during startup.""" pass def __deinit__(self): """Called once during shutdown.""" pass def flow_new(self, flow, frame): """Called every time a new flow is opened.""" pass def flow_expired(self, flow): """Called every time a flow expired, before printing the flow.""" pass def flow_end(self, flow): """Called every time a flow ends, before printing the flow.""" pass def frame_new(self, frame, flow): """Called for every new frame.""" pass
# Pins [(606, 187), (331, 188), (469, 188), (188, 190), (549, 206), (397, 207), (243, 208), (483, 231), (312, 232), (401, 262)] #Pins [(605, 164), (186, 165), (471, 165), (549, 184), (395, 185), (241, 186), (484, 210), (401, 243)] mpins = [(606, 187), (331, 188), (469, 188), (188, 190), (549, 206), (397, 207), (243, 208), (483, 231), (312, 232), (401, 262)] bpins = [(605, 164), (186, 165), (471, 165), (549, 184), (395, 185), (241, 186), (484, 210), (401, 262)] if len(mpins) == 10: masterPinLocation = mpins for index, pin in enumerate(masterPinLocation): print (index, pin) print ('______________') A = sorted(masterPinLocation, key = lambda k: [-k[1], k[0]]) B = sorted(bpins, key = lambda k: [-k[1], k[0]]) dec = [512,256,128,64,32,16,8,4,2,1] print (A,B) ## pattern =0 for pin10 in B: for index, pin in enumerate(A): diff = (pin10[0]-pin[0])**2 + (pin10[1]-pin[1])**2 if (diff < 800): print(index,pin10,pin) pattern = pattern + dec[index] print(pattern,bin(pattern)) print("FFFF", str(bin(pattern))) print(str(bin(pattern))[3:7])
mpins = [(606, 187), (331, 188), (469, 188), (188, 190), (549, 206), (397, 207), (243, 208), (483, 231), (312, 232), (401, 262)] bpins = [(605, 164), (186, 165), (471, 165), (549, 184), (395, 185), (241, 186), (484, 210), (401, 262)] if len(mpins) == 10: master_pin_location = mpins for (index, pin) in enumerate(masterPinLocation): print(index, pin) print('______________') a = sorted(masterPinLocation, key=lambda k: [-k[1], k[0]]) b = sorted(bpins, key=lambda k: [-k[1], k[0]]) dec = [512, 256, 128, 64, 32, 16, 8, 4, 2, 1] print(A, B) pattern = 0 for pin10 in B: for (index, pin) in enumerate(A): diff = (pin10[0] - pin[0]) ** 2 + (pin10[1] - pin[1]) ** 2 if diff < 800: print(index, pin10, pin) pattern = pattern + dec[index] print(pattern, bin(pattern)) print('FFFF', str(bin(pattern))) print(str(bin(pattern))[3:7])
# Reserved words reserved = [ 'class', 'in', 'inherits', 'isvoid', 'let', 'new', 'of', 'not', 'loop', 'pool', 'case', 'esac', 'if', 'then', 'else', 'fi', 'while' ] tokens = [ 'COMMENTINLINE', 'DARROW', 'CLASS', 'IN', 'INHERITS', 'ISVOID', 'LET', 'NEW', 'OF', 'NOT', 'LOOP', 'POOL', 'CASE', 'ESAC', 'IF', 'THEN', 'ELSE', 'FI', 'WHILE', 'ASSIGN', 'LE', 'PLUS', 'MINUS', 'MULT', 'DIV', 'LPAREN', 'RPAREN', 'LBRACE', 'RBRACE', 'DOT', 'COLON', 'COMMA', 'SEMI', 'EQ', 'NEG', 'LT', 'AT', 'TYPEID', 'OBJECTID', 'INT_CONST', 'STR_CONST', 'COMMENT', 'BOOL_CONST' ] # Regex dos Tokens t_DARROW = '=>' t_ASSIGN = '<-' t_LE = '<=' t_PLUS = r'\+' t_MINUS = r'-' t_MULT = r'\*' t_DIV = r'/' t_LPAREN = r'\(' t_RPAREN = r'\)' t_LBRACE = r'\{' t_RBRACE = r'\}' t_DOT = r'\.' t_COLON = ':' t_COMMA = ',' t_SEMI = ';' t_EQ = '=' t_NEG = '~' t_LT = '<' t_AT = '@' t_ignore = ' \t\r\f' # Handle objects_types_and_reserved_words def t_ID(t): r'[a-zA-Z_][a-zA-Z_0-9]*' if t.value == 'true': t.type = 'BOOL_CONST' t.value = True return t if t.value == 'false': t.type = 'BOOL_CONST' t.value = False return t if t.value.lower() in reserved: t.type = t.value.upper() else: if t.value[0].islower(): t.type = 'OBJECTID' else: t.type = 'TYPEID' return t def t_COMMENT(t): r'--.* | \(\*.+[\n\*\w\s]*\*\)' pass def t_STRING(t): r'\"[^"]*\"' # Tira as aspas (only python 2) t.value = t.value[1:-1].decode("string-escape") t.type = 'STR_CONST' return t def t_INT_CONST(t): r'\d+' t.value = int(t.value) return t def t_NEWLINE(t): r'\n+' t.lexer.lineno += t.value.count("\n") lerror = [] def t_error(t): lr = (t.value[0], t.lineno, t.lexpos) lerror.append(lr) t.lexer.skip(1)
reserved = ['class', 'in', 'inherits', 'isvoid', 'let', 'new', 'of', 'not', 'loop', 'pool', 'case', 'esac', 'if', 'then', 'else', 'fi', 'while'] tokens = ['COMMENTINLINE', 'DARROW', 'CLASS', 'IN', 'INHERITS', 'ISVOID', 'LET', 'NEW', 'OF', 'NOT', 'LOOP', 'POOL', 'CASE', 'ESAC', 'IF', 'THEN', 'ELSE', 'FI', 'WHILE', 'ASSIGN', 'LE', 'PLUS', 'MINUS', 'MULT', 'DIV', 'LPAREN', 'RPAREN', 'LBRACE', 'RBRACE', 'DOT', 'COLON', 'COMMA', 'SEMI', 'EQ', 'NEG', 'LT', 'AT', 'TYPEID', 'OBJECTID', 'INT_CONST', 'STR_CONST', 'COMMENT', 'BOOL_CONST'] t_darrow = '=>' t_assign = '<-' t_le = '<=' t_plus = '\\+' t_minus = '-' t_mult = '\\*' t_div = '/' t_lparen = '\\(' t_rparen = '\\)' t_lbrace = '\\{' t_rbrace = '\\}' t_dot = '\\.' t_colon = ':' t_comma = ',' t_semi = ';' t_eq = '=' t_neg = '~' t_lt = '<' t_at = '@' t_ignore = ' \t\r\x0c' def t_id(t): """[a-zA-Z_][a-zA-Z_0-9]*""" if t.value == 'true': t.type = 'BOOL_CONST' t.value = True return t if t.value == 'false': t.type = 'BOOL_CONST' t.value = False return t if t.value.lower() in reserved: t.type = t.value.upper() elif t.value[0].islower(): t.type = 'OBJECTID' else: t.type = 'TYPEID' return t def t_comment(t): """--.* | \\(\\*.+[\\n\\*\\w\\s]*\\*\\)""" pass def t_string(t): '''\\"[^"]*\\"''' t.value = t.value[1:-1].decode('string-escape') t.type = 'STR_CONST' return t def t_int_const(t): """\\d+""" t.value = int(t.value) return t def t_newline(t): """\\n+""" t.lexer.lineno += t.value.count('\n') lerror = [] def t_error(t): lr = (t.value[0], t.lineno, t.lexpos) lerror.append(lr) t.lexer.skip(1)
#!/usr/bin/env python if __name__ == "__main__": print(__file__[0:-3]) elif __name__ == __file__[0:-3]: print("__name__ isn't __main__") else: print("Hmm, something's fishy!" )
if __name__ == '__main__': print(__file__[0:-3]) elif __name__ == __file__[0:-3]: print("__name__ isn't __main__") else: print("Hmm, something's fishy!")
ships = { "destroyer":[[[0,0], [0,1]], [[0,0],[1,0]]], "submarine":[[[0,0], [0,1], [0,2]], [[0,0],[1,0], [2,0]]], "cruiser": [[[0,0], [0,1], [0,2]], [[0,0],[1,0], [2,0]]], "carrier": [[[0,0], [0,1], [0,2], [0,3], [0,4]], [[0,0],[1,0], [2,0], [3,0], [4,0]]] } shipSymbols = {"destroyer":1, "submarine":2, "cruiser":3, "carrier":4} def matrixAddition(m1, m2): m3 = [] for i in range(int((len(m1)+len(m2))/2)): m3.append(m1[i]+m2[i]) return m3 #ShipName = Str, Origin = List (representing the upper/left most pos of the ship), orientation = Str ("vert", "hori"), array = the mapArray... def plotShip(shipName, origin, orientation, array): if orientation.lower() == "vert": shipData = ships[shipName.lower()][0] if orientation.lower() == "hori": shipData = ships[shipName.lower()][1] for point in shipData: pixelPos = matrixAddition(origin, point) if array[pixelPos[1]][pixelPos[0]] == 0: try: array[pixelPos[1]][pixelPos[0]] = shipSymbols[shipName.lower()] except: return [f"Failed to plot point {pixelPos[0]}, {pixelPos[1]}"] else: return ["Cannot overwrite other ships."] return [f"Sucessfully added: {shipName}", array]
ships = {'destroyer': [[[0, 0], [0, 1]], [[0, 0], [1, 0]]], 'submarine': [[[0, 0], [0, 1], [0, 2]], [[0, 0], [1, 0], [2, 0]]], 'cruiser': [[[0, 0], [0, 1], [0, 2]], [[0, 0], [1, 0], [2, 0]]], 'carrier': [[[0, 0], [0, 1], [0, 2], [0, 3], [0, 4]], [[0, 0], [1, 0], [2, 0], [3, 0], [4, 0]]]} ship_symbols = {'destroyer': 1, 'submarine': 2, 'cruiser': 3, 'carrier': 4} def matrix_addition(m1, m2): m3 = [] for i in range(int((len(m1) + len(m2)) / 2)): m3.append(m1[i] + m2[i]) return m3 def plot_ship(shipName, origin, orientation, array): if orientation.lower() == 'vert': ship_data = ships[shipName.lower()][0] if orientation.lower() == 'hori': ship_data = ships[shipName.lower()][1] for point in shipData: pixel_pos = matrix_addition(origin, point) if array[pixelPos[1]][pixelPos[0]] == 0: try: array[pixelPos[1]][pixelPos[0]] = shipSymbols[shipName.lower()] except: return [f'Failed to plot point {pixelPos[0]}, {pixelPos[1]}'] else: return ['Cannot overwrite other ships.'] return [f'Sucessfully added: {shipName}', array]
# what the heck is a class ? ## the class groups similar features together ## the init function in the class are the costructors class Enemy: life = 3 def __init__(self): print("Enemy created") def attack(self): print('ouch') self.life -= 1 def checklife(self): if self.life <=0: print('ian dead') else: print(str(self.life)+ 'life left') #create an object Enemy1 = Enemy() Enemy1.attack() Enemy1.checklife() #class variables are different from instance varibles
class Enemy: life = 3 def __init__(self): print('Enemy created') def attack(self): print('ouch') self.life -= 1 def checklife(self): if self.life <= 0: print('ian dead') else: print(str(self.life) + 'life left') enemy1 = enemy() Enemy1.attack() Enemy1.checklife()
""" Provides a collection of molior exceptions. """ class MoliorError(Exception): """Base exception for all molior specific errors.""" pass class MaintainerParseError(MoliorError): """ Exception which is raised if the maintainer could not be parsed. """ pass
""" Provides a collection of molior exceptions. """ class Moliorerror(Exception): """Base exception for all molior specific errors.""" pass class Maintainerparseerror(MoliorError): """ Exception which is raised if the maintainer could not be parsed. """ pass
sentence = "What is the Airspeed Velocity of an Unladen Swallow?" list_words = sentence.split() result = {word: len(word) for word in list_words} print(result)
sentence = 'What is the Airspeed Velocity of an Unladen Swallow?' list_words = sentence.split() result = {word: len(word) for word in list_words} print(result)
NUM_PAGES = 25 LIMIT = 500 FREQ = 0.1 STOP_LIST_FILE = "StopList.txt"
num_pages = 25 limit = 500 freq = 0.1 stop_list_file = 'StopList.txt'
# by Kami Bigdely # Extract class class Actor: def __init__(self, first_name, last_name, birth_year, movies, email): self.first_name = first_name self.last_name = last_name self.birth_year = birth_year self.movies = movies self.email = Email(email) def send_email(self): if self.birth_year > 1985: print(self.first_name, self.last_name) print('Movies Played: ', end='') for m in self.movies: print(m, end=', ') print() self.email.send_hiring_email() class Email: def __init__(self, email): self.email = email def send_hiring_email(self): print("email sent to: ", self.email) # first_names = ['elizabeth', 'Jim'] # last_names = ['debicki', 'Carrey'] # birth_year = [1990, 1962] # movies = [['Tenet', 'Vita & Virgina', 'Guardians of the Galexy', 'The Great Gatsby'],\ # ['Ace Ventura', 'The Mask', 'Dubm and Dumber', 'The Truman Show', 'Yes Man']] # emails = ['deb@makeschool.com', 'jim@makeschool.com'] elizabeth = Actor( 'Elizabeth', 'Debicki', 1990, ['Tenet', 'Vita & Virgina', 'Guardians of the Galexy', 'The Great Gatsby'], 'deb@makeschool.com' ) jim = Actor( 'Jim', 'Carrey', 1962, ['Ace Ventura', 'The Mask', 'Dubm and Dumber', 'The Truman Show', 'Yes Man'], 'jim@makeschool.com' ) elizabeth.send_email() jim.send_email() # for i, value in enumerate(emails): # if birth_year[i] > 1985: # print(first_names[i], last_names[i]) # print('Movies Played: ', end='') # for m in movies[i]: # print(m, end=', ') # print() # send_hiring_email(value)
class Actor: def __init__(self, first_name, last_name, birth_year, movies, email): self.first_name = first_name self.last_name = last_name self.birth_year = birth_year self.movies = movies self.email = email(email) def send_email(self): if self.birth_year > 1985: print(self.first_name, self.last_name) print('Movies Played: ', end='') for m in self.movies: print(m, end=', ') print() self.email.send_hiring_email() class Email: def __init__(self, email): self.email = email def send_hiring_email(self): print('email sent to: ', self.email) elizabeth = actor('Elizabeth', 'Debicki', 1990, ['Tenet', 'Vita & Virgina', 'Guardians of the Galexy', 'The Great Gatsby'], 'deb@makeschool.com') jim = actor('Jim', 'Carrey', 1962, ['Ace Ventura', 'The Mask', 'Dubm and Dumber', 'The Truman Show', 'Yes Man'], 'jim@makeschool.com') elizabeth.send_email() jim.send_email()
# # PySNMP MIB module MSERIES-ALARM-MIB (http://snmplabs.com/pysmi) # ASN.1 source file:///Users/davwang4/Dev/mibs.snmplabs.com/asn1/MSERIES-ALARM-MIB # Produced by pysmi-0.3.4 at Mon Apr 29 20:05:41 2019 # On host DAVWANG4-M-1475 platform Darwin version 18.5.0 by user davwang4 # Using Python version 3.7.3 (default, Mar 27 2019, 09:23:15) # Integer, OctetString, ObjectIdentifier = mibBuilder.importSymbols("ASN1", "Integer", "OctetString", "ObjectIdentifier") NamedValues, = mibBuilder.importSymbols("ASN1-ENUMERATION", "NamedValues") ValueSizeConstraint, SingleValueConstraint, ValueRangeConstraint, ConstraintsIntersection, ConstraintsUnion = mibBuilder.importSymbols("ASN1-REFINEMENT", "ValueSizeConstraint", "SingleValueConstraint", "ValueRangeConstraint", "ConstraintsIntersection", "ConstraintsUnion") mseries, = mibBuilder.importSymbols("MSERIES-MIB", "mseries") PortType, AlarmNotificationType, AlarmProbableCause, AlarmPerceivedSeverity, UnitType = mibBuilder.importSymbols("MSERIES-TC", "PortType", "AlarmNotificationType", "AlarmProbableCause", "AlarmPerceivedSeverity", "UnitType") ModuleCompliance, ObjectGroup, NotificationGroup = mibBuilder.importSymbols("SNMPv2-CONF", "ModuleCompliance", "ObjectGroup", "NotificationGroup") NotificationType, Gauge32, IpAddress, MibIdentifier, Bits, ObjectIdentity, Counter64, MibScalar, MibTable, MibTableRow, MibTableColumn, Integer32, TimeTicks, ModuleIdentity, iso, Counter32, Unsigned32 = mibBuilder.importSymbols("SNMPv2-SMI", "NotificationType", "Gauge32", "IpAddress", "MibIdentifier", "Bits", "ObjectIdentity", "Counter64", "MibScalar", "MibTable", "MibTableRow", "MibTableColumn", "Integer32", "TimeTicks", "ModuleIdentity", "iso", "Counter32", "Unsigned32") TextualConvention, DateAndTime, DisplayString = mibBuilder.importSymbols("SNMPv2-TC", "TextualConvention", "DateAndTime", "DisplayString") smartAlarm = ModuleIdentity((1, 3, 6, 1, 4, 1, 30826, 1, 1)) smartAlarm.setRevisions(('2014-02-12 14:15', '2013-10-15 13:41', '2011-12-05 00:00',)) if mibBuilder.loadTexts: smartAlarm.setLastUpdated('201402121415Z') if mibBuilder.loadTexts: smartAlarm.setOrganization('SmartOptics') alarmGeneral = MibIdentifier((1, 3, 6, 1, 4, 1, 30826, 1, 1, 1)) alarmActiveList = MibIdentifier((1, 3, 6, 1, 4, 1, 30826, 1, 1, 2)) alarmLogList = MibIdentifier((1, 3, 6, 1, 4, 1, 30826, 1, 1, 3)) alarmNotifications = MibIdentifier((1, 3, 6, 1, 4, 1, 30826, 1, 1, 4)) smartAlarmMIBConformance = MibIdentifier((1, 3, 6, 1, 4, 1, 30826, 1, 1, 5)) smartAlarmGroups = MibIdentifier((1, 3, 6, 1, 4, 1, 30826, 1, 1, 5, 1)) smartAlarmCompliances = MibIdentifier((1, 3, 6, 1, 4, 1, 30826, 1, 1, 5, 2)) smartAlarmGeneralLastSeqNumber = MibScalar((1, 3, 6, 1, 4, 1, 30826, 1, 1, 1, 1), Counter32()).setMaxAccess("readonly") if mibBuilder.loadTexts: smartAlarmGeneralLastSeqNumber.setStatus('current') smartAlarmGeneralHighestSeverity = MibScalar((1, 3, 6, 1, 4, 1, 30826, 1, 1, 1, 2), AlarmPerceivedSeverity()).setMaxAccess("readonly") if mibBuilder.loadTexts: smartAlarmGeneralHighestSeverity.setStatus('current') smartAlarmGeneralNumberActiveList = MibScalar((1, 3, 6, 1, 4, 1, 30826, 1, 1, 1, 3), Unsigned32()).setMaxAccess("readonly") if mibBuilder.loadTexts: smartAlarmGeneralNumberActiveList.setStatus('current') smartAlarmGeneralNumberLogList = MibScalar((1, 3, 6, 1, 4, 1, 30826, 1, 1, 1, 4), Unsigned32()).setMaxAccess("readonly") if mibBuilder.loadTexts: smartAlarmGeneralNumberLogList.setStatus('current') alarmActiveTable = MibTable((1, 3, 6, 1, 4, 1, 30826, 1, 1, 2, 1), ) if mibBuilder.loadTexts: alarmActiveTable.setStatus('current') alarmEntry = MibTableRow((1, 3, 6, 1, 4, 1, 30826, 1, 1, 2, 1, 1), ).setIndexNames((0, "MSERIES-ALARM-MIB", "alarmIndex")) if mibBuilder.loadTexts: alarmEntry.setStatus('current') alarmIndex = MibTableColumn((1, 3, 6, 1, 4, 1, 30826, 1, 1, 2, 1, 1, 1), Unsigned32().subtype(subtypeSpec=ValueRangeConstraint(1, 2147483647))).setMaxAccess("readonly") if mibBuilder.loadTexts: alarmIndex.setStatus('current') alarmUnit = MibTableColumn((1, 3, 6, 1, 4, 1, 30826, 1, 1, 2, 1, 1, 2), UnitType()).setMaxAccess("readonly") if mibBuilder.loadTexts: alarmUnit.setStatus('current') alarmPort = MibTableColumn((1, 3, 6, 1, 4, 1, 30826, 1, 1, 2, 1, 1, 3), Integer32()).setMaxAccess("readonly") if mibBuilder.loadTexts: alarmPort.setStatus('current') alarmText = MibTableColumn((1, 3, 6, 1, 4, 1, 30826, 1, 1, 2, 1, 1, 4), DisplayString()).setMaxAccess("readonly") if mibBuilder.loadTexts: alarmText.setStatus('current') alarmSeverity = MibTableColumn((1, 3, 6, 1, 4, 1, 30826, 1, 1, 2, 1, 1, 5), AlarmPerceivedSeverity()).setMaxAccess("readonly") if mibBuilder.loadTexts: alarmSeverity.setStatus('current') alarmActivationTime = MibTableColumn((1, 3, 6, 1, 4, 1, 30826, 1, 1, 2, 1, 1, 6), DateAndTime()).setMaxAccess("readonly") if mibBuilder.loadTexts: alarmActivationTime.setStatus('current') alarmCeaseTime = MibTableColumn((1, 3, 6, 1, 4, 1, 30826, 1, 1, 2, 1, 1, 7), DateAndTime()).setMaxAccess("readonly") if mibBuilder.loadTexts: alarmCeaseTime.setStatus('current') alarmSeqNumber = MibTableColumn((1, 3, 6, 1, 4, 1, 30826, 1, 1, 2, 1, 1, 8), Counter32()).setMaxAccess("readonly") if mibBuilder.loadTexts: alarmSeqNumber.setStatus('current') alarmHostName = MibTableColumn((1, 3, 6, 1, 4, 1, 30826, 1, 1, 2, 1, 1, 9), DisplayString()).setMaxAccess("readonly") if mibBuilder.loadTexts: alarmHostName.setStatus('current') alarmPortName = MibTableColumn((1, 3, 6, 1, 4, 1, 30826, 1, 1, 2, 1, 1, 10), DisplayString()).setMaxAccess("readonly") if mibBuilder.loadTexts: alarmPortName.setStatus('current') alarmPortType = MibTableColumn((1, 3, 6, 1, 4, 1, 30826, 1, 1, 2, 1, 1, 11), PortType()).setMaxAccess("readonly") if mibBuilder.loadTexts: alarmPortType.setStatus('current') alarmType = MibTableColumn((1, 3, 6, 1, 4, 1, 30826, 1, 1, 2, 1, 1, 12), AlarmNotificationType()).setMaxAccess("readonly") if mibBuilder.loadTexts: alarmType.setStatus('current') alarmCause = MibTableColumn((1, 3, 6, 1, 4, 1, 30826, 1, 1, 2, 1, 1, 13), AlarmProbableCause()).setMaxAccess("readonly") if mibBuilder.loadTexts: alarmCause.setStatus('current') alarmPortAlias = MibTableColumn((1, 3, 6, 1, 4, 1, 30826, 1, 1, 2, 1, 1, 14), DisplayString()).setMaxAccess("readonly") if mibBuilder.loadTexts: alarmPortAlias.setStatus('current') alarmLogTable = MibTable((1, 3, 6, 1, 4, 1, 30826, 1, 1, 3, 1), ) if mibBuilder.loadTexts: alarmLogTable.setStatus('current') alarmLogEntry = MibTableRow((1, 3, 6, 1, 4, 1, 30826, 1, 1, 3, 1, 1), ).setIndexNames((0, "MSERIES-ALARM-MIB", "alarmLogIndex")) if mibBuilder.loadTexts: alarmLogEntry.setStatus('current') alarmLogIndex = MibTableColumn((1, 3, 6, 1, 4, 1, 30826, 1, 1, 3, 1, 1, 1), Unsigned32().subtype(subtypeSpec=ValueRangeConstraint(1, 2147483647))).setMaxAccess("readonly") if mibBuilder.loadTexts: alarmLogIndex.setStatus('current') alarmLogUnit = MibTableColumn((1, 3, 6, 1, 4, 1, 30826, 1, 1, 3, 1, 1, 2), UnitType()).setMaxAccess("readonly") if mibBuilder.loadTexts: alarmLogUnit.setStatus('current') alarmLogPort = MibTableColumn((1, 3, 6, 1, 4, 1, 30826, 1, 1, 3, 1, 1, 3), Integer32()).setMaxAccess("readonly") if mibBuilder.loadTexts: alarmLogPort.setStatus('current') alarmLogText = MibTableColumn((1, 3, 6, 1, 4, 1, 30826, 1, 1, 3, 1, 1, 4), DisplayString()).setMaxAccess("readonly") if mibBuilder.loadTexts: alarmLogText.setStatus('current') alarmLogSeverity = MibTableColumn((1, 3, 6, 1, 4, 1, 30826, 1, 1, 3, 1, 1, 5), AlarmPerceivedSeverity()).setMaxAccess("readonly") if mibBuilder.loadTexts: alarmLogSeverity.setStatus('current') alarmLogActivationTime = MibTableColumn((1, 3, 6, 1, 4, 1, 30826, 1, 1, 3, 1, 1, 6), DateAndTime()).setMaxAccess("readonly") if mibBuilder.loadTexts: alarmLogActivationTime.setStatus('current') alarmLogCeaseTime = MibTableColumn((1, 3, 6, 1, 4, 1, 30826, 1, 1, 3, 1, 1, 7), DateAndTime()).setMaxAccess("readonly") if mibBuilder.loadTexts: alarmLogCeaseTime.setStatus('current') alarmLogSeqNumber = MibTableColumn((1, 3, 6, 1, 4, 1, 30826, 1, 1, 3, 1, 1, 8), Counter32()).setMaxAccess("readonly") if mibBuilder.loadTexts: alarmLogSeqNumber.setStatus('current') alarmLogHostName = MibTableColumn((1, 3, 6, 1, 4, 1, 30826, 1, 1, 3, 1, 1, 9), DisplayString()).setMaxAccess("readonly") if mibBuilder.loadTexts: alarmLogHostName.setStatus('current') alarmLogPortName = MibTableColumn((1, 3, 6, 1, 4, 1, 30826, 1, 1, 3, 1, 1, 10), DisplayString()).setMaxAccess("readonly") if mibBuilder.loadTexts: alarmLogPortName.setStatus('current') alarmLogPortType = MibTableColumn((1, 3, 6, 1, 4, 1, 30826, 1, 1, 3, 1, 1, 11), PortType()).setMaxAccess("readonly") if mibBuilder.loadTexts: alarmLogPortType.setStatus('current') alarmLogType = MibTableColumn((1, 3, 6, 1, 4, 1, 30826, 1, 1, 3, 1, 1, 12), AlarmNotificationType()).setMaxAccess("readonly") if mibBuilder.loadTexts: alarmLogType.setStatus('current') alarmLogCause = MibTableColumn((1, 3, 6, 1, 4, 1, 30826, 1, 1, 3, 1, 1, 13), AlarmProbableCause()).setMaxAccess("readonly") if mibBuilder.loadTexts: alarmLogCause.setStatus('current') alarmNotifyPrefix = MibIdentifier((1, 3, 6, 1, 4, 1, 30826, 1, 1, 4, 0)) alarmNotificationCleared = NotificationType((1, 3, 6, 1, 4, 1, 30826, 1, 1, 4, 0, 1)).setObjects(("MSERIES-ALARM-MIB", "alarmIndex"), ("MSERIES-ALARM-MIB", "alarmUnit"), ("MSERIES-ALARM-MIB", "alarmPort"), ("MSERIES-ALARM-MIB", "alarmText"), ("MSERIES-ALARM-MIB", "alarmSeverity"), ("MSERIES-ALARM-MIB", "alarmActivationTime"), ("MSERIES-ALARM-MIB", "alarmCeaseTime"), ("MSERIES-ALARM-MIB", "alarmSeqNumber"), ("MSERIES-ALARM-MIB", "alarmHostName"), ("MSERIES-ALARM-MIB", "alarmPortName"), ("MSERIES-ALARM-MIB", "alarmPortType"), ("MSERIES-ALARM-MIB", "alarmPortAlias")) if mibBuilder.loadTexts: alarmNotificationCleared.setStatus('current') alarmNotificationWarning = NotificationType((1, 3, 6, 1, 4, 1, 30826, 1, 1, 4, 0, 2)).setObjects(("MSERIES-ALARM-MIB", "alarmIndex"), ("MSERIES-ALARM-MIB", "alarmUnit"), ("MSERIES-ALARM-MIB", "alarmPort"), ("MSERIES-ALARM-MIB", "alarmText"), ("MSERIES-ALARM-MIB", "alarmSeverity"), ("MSERIES-ALARM-MIB", "alarmActivationTime"), ("MSERIES-ALARM-MIB", "alarmCeaseTime"), ("MSERIES-ALARM-MIB", "alarmSeqNumber"), ("MSERIES-ALARM-MIB", "alarmHostName"), ("MSERIES-ALARM-MIB", "alarmPortName"), ("MSERIES-ALARM-MIB", "alarmPortType"), ("MSERIES-ALARM-MIB", "alarmPortAlias")) if mibBuilder.loadTexts: alarmNotificationWarning.setStatus('current') alarmNotificationMinor = NotificationType((1, 3, 6, 1, 4, 1, 30826, 1, 1, 4, 0, 3)).setObjects(("MSERIES-ALARM-MIB", "alarmIndex"), ("MSERIES-ALARM-MIB", "alarmUnit"), ("MSERIES-ALARM-MIB", "alarmPort"), ("MSERIES-ALARM-MIB", "alarmText"), ("MSERIES-ALARM-MIB", "alarmSeverity"), ("MSERIES-ALARM-MIB", "alarmActivationTime"), ("MSERIES-ALARM-MIB", "alarmCeaseTime"), ("MSERIES-ALARM-MIB", "alarmSeqNumber"), ("MSERIES-ALARM-MIB", "alarmHostName"), ("MSERIES-ALARM-MIB", "alarmPortName"), ("MSERIES-ALARM-MIB", "alarmPortType"), ("MSERIES-ALARM-MIB", "alarmPortAlias")) if mibBuilder.loadTexts: alarmNotificationMinor.setStatus('current') alarmNotificationMajor = NotificationType((1, 3, 6, 1, 4, 1, 30826, 1, 1, 4, 0, 4)).setObjects(("MSERIES-ALARM-MIB", "alarmIndex"), ("MSERIES-ALARM-MIB", "alarmUnit"), ("MSERIES-ALARM-MIB", "alarmPort"), ("MSERIES-ALARM-MIB", "alarmText"), ("MSERIES-ALARM-MIB", "alarmSeverity"), ("MSERIES-ALARM-MIB", "alarmActivationTime"), ("MSERIES-ALARM-MIB", "alarmCeaseTime"), ("MSERIES-ALARM-MIB", "alarmSeqNumber"), ("MSERIES-ALARM-MIB", "alarmHostName"), ("MSERIES-ALARM-MIB", "alarmPortName"), ("MSERIES-ALARM-MIB", "alarmPortType"), ("MSERIES-ALARM-MIB", "alarmPortAlias")) if mibBuilder.loadTexts: alarmNotificationMajor.setStatus('current') alarmNotificationCritical = NotificationType((1, 3, 6, 1, 4, 1, 30826, 1, 1, 4, 0, 5)).setObjects(("MSERIES-ALARM-MIB", "alarmIndex"), ("MSERIES-ALARM-MIB", "alarmUnit"), ("MSERIES-ALARM-MIB", "alarmPort"), ("MSERIES-ALARM-MIB", "alarmText"), ("MSERIES-ALARM-MIB", "alarmSeverity"), ("MSERIES-ALARM-MIB", "alarmActivationTime"), ("MSERIES-ALARM-MIB", "alarmCeaseTime"), ("MSERIES-ALARM-MIB", "alarmSeqNumber"), ("MSERIES-ALARM-MIB", "alarmHostName"), ("MSERIES-ALARM-MIB", "alarmPortName"), ("MSERIES-ALARM-MIB", "alarmPortType"), ("MSERIES-ALARM-MIB", "alarmPortAlias")) if mibBuilder.loadTexts: alarmNotificationCritical.setStatus('current') smartAlarmGeneralGroupV1 = ObjectGroup((1, 3, 6, 1, 4, 1, 30826, 1, 1, 5, 1, 1)).setObjects(("MSERIES-ALARM-MIB", "smartAlarmGeneralLastSeqNumber"), ("MSERIES-ALARM-MIB", "smartAlarmGeneralHighestSeverity"), ("MSERIES-ALARM-MIB", "smartAlarmGeneralNumberActiveList"), ("MSERIES-ALARM-MIB", "smartAlarmGeneralNumberLogList")) if getattr(mibBuilder, 'version', (0, 0, 0)) > (4, 4, 0): smartAlarmGeneralGroupV1 = smartAlarmGeneralGroupV1.setStatus('current') smartAlarmNotificationGroupV1 = NotificationGroup((1, 3, 6, 1, 4, 1, 30826, 1, 1, 5, 1, 2)).setObjects(("MSERIES-ALARM-MIB", "alarmNotificationCleared"), ("MSERIES-ALARM-MIB", "alarmNotificationCritical"), ("MSERIES-ALARM-MIB", "alarmNotificationMajor"), ("MSERIES-ALARM-MIB", "alarmNotificationMinor"), ("MSERIES-ALARM-MIB", "alarmNotificationWarning")) if getattr(mibBuilder, 'version', (0, 0, 0)) > (4, 4, 0): smartAlarmNotificationGroupV1 = smartAlarmNotificationGroupV1.setStatus('current') smartAlarmActiveTableGroupV1 = ObjectGroup((1, 3, 6, 1, 4, 1, 30826, 1, 1, 5, 1, 3)).setObjects(("MSERIES-ALARM-MIB", "alarmIndex"), ("MSERIES-ALARM-MIB", "alarmUnit"), ("MSERIES-ALARM-MIB", "alarmPort"), ("MSERIES-ALARM-MIB", "alarmText"), ("MSERIES-ALARM-MIB", "alarmSeverity"), ("MSERIES-ALARM-MIB", "alarmActivationTime"), ("MSERIES-ALARM-MIB", "alarmCeaseTime"), ("MSERIES-ALARM-MIB", "alarmSeqNumber"), ("MSERIES-ALARM-MIB", "alarmHostName"), ("MSERIES-ALARM-MIB", "alarmPortName"), ("MSERIES-ALARM-MIB", "alarmPortType"), ("MSERIES-ALARM-MIB", "alarmType"), ("MSERIES-ALARM-MIB", "alarmCause")) if getattr(mibBuilder, 'version', (0, 0, 0)) > (4, 4, 0): smartAlarmActiveTableGroupV1 = smartAlarmActiveTableGroupV1.setStatus('current') smartAlarmLogTableGroupV1 = ObjectGroup((1, 3, 6, 1, 4, 1, 30826, 1, 1, 5, 1, 4)).setObjects(("MSERIES-ALARM-MIB", "alarmLogIndex"), ("MSERIES-ALARM-MIB", "alarmLogUnit"), ("MSERIES-ALARM-MIB", "alarmLogPort"), ("MSERIES-ALARM-MIB", "alarmLogText"), ("MSERIES-ALARM-MIB", "alarmLogSeverity"), ("MSERIES-ALARM-MIB", "alarmLogActivationTime"), ("MSERIES-ALARM-MIB", "alarmLogCeaseTime"), ("MSERIES-ALARM-MIB", "alarmLogSeqNumber"), ("MSERIES-ALARM-MIB", "alarmLogHostName"), ("MSERIES-ALARM-MIB", "alarmLogPortName"), ("MSERIES-ALARM-MIB", "alarmLogPortType"), ("MSERIES-ALARM-MIB", "alarmLogType"), ("MSERIES-ALARM-MIB", "alarmLogCause")) if getattr(mibBuilder, 'version', (0, 0, 0)) > (4, 4, 0): smartAlarmLogTableGroupV1 = smartAlarmLogTableGroupV1.setStatus('current') smartAlarmBasicComplV1 = ModuleCompliance((1, 3, 6, 1, 4, 1, 30826, 1, 1, 5, 2, 1)).setObjects(("MSERIES-ALARM-MIB", "smartAlarmGeneralGroupV1"), ("MSERIES-ALARM-MIB", "smartAlarmNotificationGroupV1"), ("MSERIES-ALARM-MIB", "smartAlarmActiveTableGroupV1"), ("MSERIES-ALARM-MIB", "smartAlarmLogTableGroupV1")) if getattr(mibBuilder, 'version', (0, 0, 0)) > (4, 4, 0): smartAlarmBasicComplV1 = smartAlarmBasicComplV1.setStatus('current') mibBuilder.exportSymbols("MSERIES-ALARM-MIB", alarmLogActivationTime=alarmLogActivationTime, smartAlarmCompliances=smartAlarmCompliances, smartAlarmGeneralNumberActiveList=smartAlarmGeneralNumberActiveList, alarmNotifyPrefix=alarmNotifyPrefix, alarmEntry=alarmEntry, alarmLogUnit=alarmLogUnit, alarmNotificationMajor=alarmNotificationMajor, smartAlarmActiveTableGroupV1=smartAlarmActiveTableGroupV1, alarmHostName=alarmHostName, alarmCause=alarmCause, alarmLogType=alarmLogType, smartAlarmGroups=smartAlarmGroups, alarmPort=alarmPort, alarmType=alarmType, alarmNotifications=alarmNotifications, smartAlarmGeneralHighestSeverity=smartAlarmGeneralHighestSeverity, alarmSeverity=alarmSeverity, alarmActivationTime=alarmActivationTime, alarmLogHostName=alarmLogHostName, alarmActiveList=alarmActiveList, alarmCeaseTime=alarmCeaseTime, alarmPortName=alarmPortName, alarmLogPort=alarmLogPort, alarmLogIndex=alarmLogIndex, smartAlarmBasicComplV1=smartAlarmBasicComplV1, alarmUnit=alarmUnit, alarmNotificationWarning=alarmNotificationWarning, alarmNotificationCritical=alarmNotificationCritical, alarmLogEntry=alarmLogEntry, alarmSeqNumber=alarmSeqNumber, PYSNMP_MODULE_ID=smartAlarm, alarmNotificationMinor=alarmNotificationMinor, alarmPortAlias=alarmPortAlias, alarmLogPortType=alarmLogPortType, alarmText=alarmText, smartAlarmGeneralNumberLogList=smartAlarmGeneralNumberLogList, alarmLogPortName=alarmLogPortName, alarmIndex=alarmIndex, alarmPortType=alarmPortType, alarmLogTable=alarmLogTable, smartAlarmGeneralGroupV1=smartAlarmGeneralGroupV1, smartAlarm=smartAlarm, alarmLogCeaseTime=alarmLogCeaseTime, alarmLogCause=alarmLogCause, alarmLogSeverity=alarmLogSeverity, alarmLogList=alarmLogList, smartAlarmGeneralLastSeqNumber=smartAlarmGeneralLastSeqNumber, alarmLogSeqNumber=alarmLogSeqNumber, alarmNotificationCleared=alarmNotificationCleared, smartAlarmNotificationGroupV1=smartAlarmNotificationGroupV1, smartAlarmLogTableGroupV1=smartAlarmLogTableGroupV1, alarmActiveTable=alarmActiveTable, alarmLogText=alarmLogText, alarmGeneral=alarmGeneral, smartAlarmMIBConformance=smartAlarmMIBConformance)
(integer, octet_string, object_identifier) = mibBuilder.importSymbols('ASN1', 'Integer', 'OctetString', 'ObjectIdentifier') (named_values,) = mibBuilder.importSymbols('ASN1-ENUMERATION', 'NamedValues') (value_size_constraint, single_value_constraint, value_range_constraint, constraints_intersection, constraints_union) = mibBuilder.importSymbols('ASN1-REFINEMENT', 'ValueSizeConstraint', 'SingleValueConstraint', 'ValueRangeConstraint', 'ConstraintsIntersection', 'ConstraintsUnion') (mseries,) = mibBuilder.importSymbols('MSERIES-MIB', 'mseries') (port_type, alarm_notification_type, alarm_probable_cause, alarm_perceived_severity, unit_type) = mibBuilder.importSymbols('MSERIES-TC', 'PortType', 'AlarmNotificationType', 'AlarmProbableCause', 'AlarmPerceivedSeverity', 'UnitType') (module_compliance, object_group, notification_group) = mibBuilder.importSymbols('SNMPv2-CONF', 'ModuleCompliance', 'ObjectGroup', 'NotificationGroup') (notification_type, gauge32, ip_address, mib_identifier, bits, object_identity, counter64, mib_scalar, mib_table, mib_table_row, mib_table_column, integer32, time_ticks, module_identity, iso, counter32, unsigned32) = mibBuilder.importSymbols('SNMPv2-SMI', 'NotificationType', 'Gauge32', 'IpAddress', 'MibIdentifier', 'Bits', 'ObjectIdentity', 'Counter64', 'MibScalar', 'MibTable', 'MibTableRow', 'MibTableColumn', 'Integer32', 'TimeTicks', 'ModuleIdentity', 'iso', 'Counter32', 'Unsigned32') (textual_convention, date_and_time, display_string) = mibBuilder.importSymbols('SNMPv2-TC', 'TextualConvention', 'DateAndTime', 'DisplayString') smart_alarm = module_identity((1, 3, 6, 1, 4, 1, 30826, 1, 1)) smartAlarm.setRevisions(('2014-02-12 14:15', '2013-10-15 13:41', '2011-12-05 00:00')) if mibBuilder.loadTexts: smartAlarm.setLastUpdated('201402121415Z') if mibBuilder.loadTexts: smartAlarm.setOrganization('SmartOptics') alarm_general = mib_identifier((1, 3, 6, 1, 4, 1, 30826, 1, 1, 1)) alarm_active_list = mib_identifier((1, 3, 6, 1, 4, 1, 30826, 1, 1, 2)) alarm_log_list = mib_identifier((1, 3, 6, 1, 4, 1, 30826, 1, 1, 3)) alarm_notifications = mib_identifier((1, 3, 6, 1, 4, 1, 30826, 1, 1, 4)) smart_alarm_mib_conformance = mib_identifier((1, 3, 6, 1, 4, 1, 30826, 1, 1, 5)) smart_alarm_groups = mib_identifier((1, 3, 6, 1, 4, 1, 30826, 1, 1, 5, 1)) smart_alarm_compliances = mib_identifier((1, 3, 6, 1, 4, 1, 30826, 1, 1, 5, 2)) smart_alarm_general_last_seq_number = mib_scalar((1, 3, 6, 1, 4, 1, 30826, 1, 1, 1, 1), counter32()).setMaxAccess('readonly') if mibBuilder.loadTexts: smartAlarmGeneralLastSeqNumber.setStatus('current') smart_alarm_general_highest_severity = mib_scalar((1, 3, 6, 1, 4, 1, 30826, 1, 1, 1, 2), alarm_perceived_severity()).setMaxAccess('readonly') if mibBuilder.loadTexts: smartAlarmGeneralHighestSeverity.setStatus('current') smart_alarm_general_number_active_list = mib_scalar((1, 3, 6, 1, 4, 1, 30826, 1, 1, 1, 3), unsigned32()).setMaxAccess('readonly') if mibBuilder.loadTexts: smartAlarmGeneralNumberActiveList.setStatus('current') smart_alarm_general_number_log_list = mib_scalar((1, 3, 6, 1, 4, 1, 30826, 1, 1, 1, 4), unsigned32()).setMaxAccess('readonly') if mibBuilder.loadTexts: smartAlarmGeneralNumberLogList.setStatus('current') alarm_active_table = mib_table((1, 3, 6, 1, 4, 1, 30826, 1, 1, 2, 1)) if mibBuilder.loadTexts: alarmActiveTable.setStatus('current') alarm_entry = mib_table_row((1, 3, 6, 1, 4, 1, 30826, 1, 1, 2, 1, 1)).setIndexNames((0, 'MSERIES-ALARM-MIB', 'alarmIndex')) if mibBuilder.loadTexts: alarmEntry.setStatus('current') alarm_index = mib_table_column((1, 3, 6, 1, 4, 1, 30826, 1, 1, 2, 1, 1, 1), unsigned32().subtype(subtypeSpec=value_range_constraint(1, 2147483647))).setMaxAccess('readonly') if mibBuilder.loadTexts: alarmIndex.setStatus('current') alarm_unit = mib_table_column((1, 3, 6, 1, 4, 1, 30826, 1, 1, 2, 1, 1, 2), unit_type()).setMaxAccess('readonly') if mibBuilder.loadTexts: alarmUnit.setStatus('current') alarm_port = mib_table_column((1, 3, 6, 1, 4, 1, 30826, 1, 1, 2, 1, 1, 3), integer32()).setMaxAccess('readonly') if mibBuilder.loadTexts: alarmPort.setStatus('current') alarm_text = mib_table_column((1, 3, 6, 1, 4, 1, 30826, 1, 1, 2, 1, 1, 4), display_string()).setMaxAccess('readonly') if mibBuilder.loadTexts: alarmText.setStatus('current') alarm_severity = mib_table_column((1, 3, 6, 1, 4, 1, 30826, 1, 1, 2, 1, 1, 5), alarm_perceived_severity()).setMaxAccess('readonly') if mibBuilder.loadTexts: alarmSeverity.setStatus('current') alarm_activation_time = mib_table_column((1, 3, 6, 1, 4, 1, 30826, 1, 1, 2, 1, 1, 6), date_and_time()).setMaxAccess('readonly') if mibBuilder.loadTexts: alarmActivationTime.setStatus('current') alarm_cease_time = mib_table_column((1, 3, 6, 1, 4, 1, 30826, 1, 1, 2, 1, 1, 7), date_and_time()).setMaxAccess('readonly') if mibBuilder.loadTexts: alarmCeaseTime.setStatus('current') alarm_seq_number = mib_table_column((1, 3, 6, 1, 4, 1, 30826, 1, 1, 2, 1, 1, 8), counter32()).setMaxAccess('readonly') if mibBuilder.loadTexts: alarmSeqNumber.setStatus('current') alarm_host_name = mib_table_column((1, 3, 6, 1, 4, 1, 30826, 1, 1, 2, 1, 1, 9), display_string()).setMaxAccess('readonly') if mibBuilder.loadTexts: alarmHostName.setStatus('current') alarm_port_name = mib_table_column((1, 3, 6, 1, 4, 1, 30826, 1, 1, 2, 1, 1, 10), display_string()).setMaxAccess('readonly') if mibBuilder.loadTexts: alarmPortName.setStatus('current') alarm_port_type = mib_table_column((1, 3, 6, 1, 4, 1, 30826, 1, 1, 2, 1, 1, 11), port_type()).setMaxAccess('readonly') if mibBuilder.loadTexts: alarmPortType.setStatus('current') alarm_type = mib_table_column((1, 3, 6, 1, 4, 1, 30826, 1, 1, 2, 1, 1, 12), alarm_notification_type()).setMaxAccess('readonly') if mibBuilder.loadTexts: alarmType.setStatus('current') alarm_cause = mib_table_column((1, 3, 6, 1, 4, 1, 30826, 1, 1, 2, 1, 1, 13), alarm_probable_cause()).setMaxAccess('readonly') if mibBuilder.loadTexts: alarmCause.setStatus('current') alarm_port_alias = mib_table_column((1, 3, 6, 1, 4, 1, 30826, 1, 1, 2, 1, 1, 14), display_string()).setMaxAccess('readonly') if mibBuilder.loadTexts: alarmPortAlias.setStatus('current') alarm_log_table = mib_table((1, 3, 6, 1, 4, 1, 30826, 1, 1, 3, 1)) if mibBuilder.loadTexts: alarmLogTable.setStatus('current') alarm_log_entry = mib_table_row((1, 3, 6, 1, 4, 1, 30826, 1, 1, 3, 1, 1)).setIndexNames((0, 'MSERIES-ALARM-MIB', 'alarmLogIndex')) if mibBuilder.loadTexts: alarmLogEntry.setStatus('current') alarm_log_index = mib_table_column((1, 3, 6, 1, 4, 1, 30826, 1, 1, 3, 1, 1, 1), unsigned32().subtype(subtypeSpec=value_range_constraint(1, 2147483647))).setMaxAccess('readonly') if mibBuilder.loadTexts: alarmLogIndex.setStatus('current') alarm_log_unit = mib_table_column((1, 3, 6, 1, 4, 1, 30826, 1, 1, 3, 1, 1, 2), unit_type()).setMaxAccess('readonly') if mibBuilder.loadTexts: alarmLogUnit.setStatus('current') alarm_log_port = mib_table_column((1, 3, 6, 1, 4, 1, 30826, 1, 1, 3, 1, 1, 3), integer32()).setMaxAccess('readonly') if mibBuilder.loadTexts: alarmLogPort.setStatus('current') alarm_log_text = mib_table_column((1, 3, 6, 1, 4, 1, 30826, 1, 1, 3, 1, 1, 4), display_string()).setMaxAccess('readonly') if mibBuilder.loadTexts: alarmLogText.setStatus('current') alarm_log_severity = mib_table_column((1, 3, 6, 1, 4, 1, 30826, 1, 1, 3, 1, 1, 5), alarm_perceived_severity()).setMaxAccess('readonly') if mibBuilder.loadTexts: alarmLogSeverity.setStatus('current') alarm_log_activation_time = mib_table_column((1, 3, 6, 1, 4, 1, 30826, 1, 1, 3, 1, 1, 6), date_and_time()).setMaxAccess('readonly') if mibBuilder.loadTexts: alarmLogActivationTime.setStatus('current') alarm_log_cease_time = mib_table_column((1, 3, 6, 1, 4, 1, 30826, 1, 1, 3, 1, 1, 7), date_and_time()).setMaxAccess('readonly') if mibBuilder.loadTexts: alarmLogCeaseTime.setStatus('current') alarm_log_seq_number = mib_table_column((1, 3, 6, 1, 4, 1, 30826, 1, 1, 3, 1, 1, 8), counter32()).setMaxAccess('readonly') if mibBuilder.loadTexts: alarmLogSeqNumber.setStatus('current') alarm_log_host_name = mib_table_column((1, 3, 6, 1, 4, 1, 30826, 1, 1, 3, 1, 1, 9), display_string()).setMaxAccess('readonly') if mibBuilder.loadTexts: alarmLogHostName.setStatus('current') alarm_log_port_name = mib_table_column((1, 3, 6, 1, 4, 1, 30826, 1, 1, 3, 1, 1, 10), display_string()).setMaxAccess('readonly') if mibBuilder.loadTexts: alarmLogPortName.setStatus('current') alarm_log_port_type = mib_table_column((1, 3, 6, 1, 4, 1, 30826, 1, 1, 3, 1, 1, 11), port_type()).setMaxAccess('readonly') if mibBuilder.loadTexts: alarmLogPortType.setStatus('current') alarm_log_type = mib_table_column((1, 3, 6, 1, 4, 1, 30826, 1, 1, 3, 1, 1, 12), alarm_notification_type()).setMaxAccess('readonly') if mibBuilder.loadTexts: alarmLogType.setStatus('current') alarm_log_cause = mib_table_column((1, 3, 6, 1, 4, 1, 30826, 1, 1, 3, 1, 1, 13), alarm_probable_cause()).setMaxAccess('readonly') if mibBuilder.loadTexts: alarmLogCause.setStatus('current') alarm_notify_prefix = mib_identifier((1, 3, 6, 1, 4, 1, 30826, 1, 1, 4, 0)) alarm_notification_cleared = notification_type((1, 3, 6, 1, 4, 1, 30826, 1, 1, 4, 0, 1)).setObjects(('MSERIES-ALARM-MIB', 'alarmIndex'), ('MSERIES-ALARM-MIB', 'alarmUnit'), ('MSERIES-ALARM-MIB', 'alarmPort'), ('MSERIES-ALARM-MIB', 'alarmText'), ('MSERIES-ALARM-MIB', 'alarmSeverity'), ('MSERIES-ALARM-MIB', 'alarmActivationTime'), ('MSERIES-ALARM-MIB', 'alarmCeaseTime'), ('MSERIES-ALARM-MIB', 'alarmSeqNumber'), ('MSERIES-ALARM-MIB', 'alarmHostName'), ('MSERIES-ALARM-MIB', 'alarmPortName'), ('MSERIES-ALARM-MIB', 'alarmPortType'), ('MSERIES-ALARM-MIB', 'alarmPortAlias')) if mibBuilder.loadTexts: alarmNotificationCleared.setStatus('current') alarm_notification_warning = notification_type((1, 3, 6, 1, 4, 1, 30826, 1, 1, 4, 0, 2)).setObjects(('MSERIES-ALARM-MIB', 'alarmIndex'), ('MSERIES-ALARM-MIB', 'alarmUnit'), ('MSERIES-ALARM-MIB', 'alarmPort'), ('MSERIES-ALARM-MIB', 'alarmText'), ('MSERIES-ALARM-MIB', 'alarmSeverity'), ('MSERIES-ALARM-MIB', 'alarmActivationTime'), ('MSERIES-ALARM-MIB', 'alarmCeaseTime'), ('MSERIES-ALARM-MIB', 'alarmSeqNumber'), ('MSERIES-ALARM-MIB', 'alarmHostName'), ('MSERIES-ALARM-MIB', 'alarmPortName'), ('MSERIES-ALARM-MIB', 'alarmPortType'), ('MSERIES-ALARM-MIB', 'alarmPortAlias')) if mibBuilder.loadTexts: alarmNotificationWarning.setStatus('current') alarm_notification_minor = notification_type((1, 3, 6, 1, 4, 1, 30826, 1, 1, 4, 0, 3)).setObjects(('MSERIES-ALARM-MIB', 'alarmIndex'), ('MSERIES-ALARM-MIB', 'alarmUnit'), ('MSERIES-ALARM-MIB', 'alarmPort'), ('MSERIES-ALARM-MIB', 'alarmText'), ('MSERIES-ALARM-MIB', 'alarmSeverity'), ('MSERIES-ALARM-MIB', 'alarmActivationTime'), ('MSERIES-ALARM-MIB', 'alarmCeaseTime'), ('MSERIES-ALARM-MIB', 'alarmSeqNumber'), ('MSERIES-ALARM-MIB', 'alarmHostName'), ('MSERIES-ALARM-MIB', 'alarmPortName'), ('MSERIES-ALARM-MIB', 'alarmPortType'), ('MSERIES-ALARM-MIB', 'alarmPortAlias')) if mibBuilder.loadTexts: alarmNotificationMinor.setStatus('current') alarm_notification_major = notification_type((1, 3, 6, 1, 4, 1, 30826, 1, 1, 4, 0, 4)).setObjects(('MSERIES-ALARM-MIB', 'alarmIndex'), ('MSERIES-ALARM-MIB', 'alarmUnit'), ('MSERIES-ALARM-MIB', 'alarmPort'), ('MSERIES-ALARM-MIB', 'alarmText'), ('MSERIES-ALARM-MIB', 'alarmSeverity'), ('MSERIES-ALARM-MIB', 'alarmActivationTime'), ('MSERIES-ALARM-MIB', 'alarmCeaseTime'), ('MSERIES-ALARM-MIB', 'alarmSeqNumber'), ('MSERIES-ALARM-MIB', 'alarmHostName'), ('MSERIES-ALARM-MIB', 'alarmPortName'), ('MSERIES-ALARM-MIB', 'alarmPortType'), ('MSERIES-ALARM-MIB', 'alarmPortAlias')) if mibBuilder.loadTexts: alarmNotificationMajor.setStatus('current') alarm_notification_critical = notification_type((1, 3, 6, 1, 4, 1, 30826, 1, 1, 4, 0, 5)).setObjects(('MSERIES-ALARM-MIB', 'alarmIndex'), ('MSERIES-ALARM-MIB', 'alarmUnit'), ('MSERIES-ALARM-MIB', 'alarmPort'), ('MSERIES-ALARM-MIB', 'alarmText'), ('MSERIES-ALARM-MIB', 'alarmSeverity'), ('MSERIES-ALARM-MIB', 'alarmActivationTime'), ('MSERIES-ALARM-MIB', 'alarmCeaseTime'), ('MSERIES-ALARM-MIB', 'alarmSeqNumber'), ('MSERIES-ALARM-MIB', 'alarmHostName'), ('MSERIES-ALARM-MIB', 'alarmPortName'), ('MSERIES-ALARM-MIB', 'alarmPortType'), ('MSERIES-ALARM-MIB', 'alarmPortAlias')) if mibBuilder.loadTexts: alarmNotificationCritical.setStatus('current') smart_alarm_general_group_v1 = object_group((1, 3, 6, 1, 4, 1, 30826, 1, 1, 5, 1, 1)).setObjects(('MSERIES-ALARM-MIB', 'smartAlarmGeneralLastSeqNumber'), ('MSERIES-ALARM-MIB', 'smartAlarmGeneralHighestSeverity'), ('MSERIES-ALARM-MIB', 'smartAlarmGeneralNumberActiveList'), ('MSERIES-ALARM-MIB', 'smartAlarmGeneralNumberLogList')) if getattr(mibBuilder, 'version', (0, 0, 0)) > (4, 4, 0): smart_alarm_general_group_v1 = smartAlarmGeneralGroupV1.setStatus('current') smart_alarm_notification_group_v1 = notification_group((1, 3, 6, 1, 4, 1, 30826, 1, 1, 5, 1, 2)).setObjects(('MSERIES-ALARM-MIB', 'alarmNotificationCleared'), ('MSERIES-ALARM-MIB', 'alarmNotificationCritical'), ('MSERIES-ALARM-MIB', 'alarmNotificationMajor'), ('MSERIES-ALARM-MIB', 'alarmNotificationMinor'), ('MSERIES-ALARM-MIB', 'alarmNotificationWarning')) if getattr(mibBuilder, 'version', (0, 0, 0)) > (4, 4, 0): smart_alarm_notification_group_v1 = smartAlarmNotificationGroupV1.setStatus('current') smart_alarm_active_table_group_v1 = object_group((1, 3, 6, 1, 4, 1, 30826, 1, 1, 5, 1, 3)).setObjects(('MSERIES-ALARM-MIB', 'alarmIndex'), ('MSERIES-ALARM-MIB', 'alarmUnit'), ('MSERIES-ALARM-MIB', 'alarmPort'), ('MSERIES-ALARM-MIB', 'alarmText'), ('MSERIES-ALARM-MIB', 'alarmSeverity'), ('MSERIES-ALARM-MIB', 'alarmActivationTime'), ('MSERIES-ALARM-MIB', 'alarmCeaseTime'), ('MSERIES-ALARM-MIB', 'alarmSeqNumber'), ('MSERIES-ALARM-MIB', 'alarmHostName'), ('MSERIES-ALARM-MIB', 'alarmPortName'), ('MSERIES-ALARM-MIB', 'alarmPortType'), ('MSERIES-ALARM-MIB', 'alarmType'), ('MSERIES-ALARM-MIB', 'alarmCause')) if getattr(mibBuilder, 'version', (0, 0, 0)) > (4, 4, 0): smart_alarm_active_table_group_v1 = smartAlarmActiveTableGroupV1.setStatus('current') smart_alarm_log_table_group_v1 = object_group((1, 3, 6, 1, 4, 1, 30826, 1, 1, 5, 1, 4)).setObjects(('MSERIES-ALARM-MIB', 'alarmLogIndex'), ('MSERIES-ALARM-MIB', 'alarmLogUnit'), ('MSERIES-ALARM-MIB', 'alarmLogPort'), ('MSERIES-ALARM-MIB', 'alarmLogText'), ('MSERIES-ALARM-MIB', 'alarmLogSeverity'), ('MSERIES-ALARM-MIB', 'alarmLogActivationTime'), ('MSERIES-ALARM-MIB', 'alarmLogCeaseTime'), ('MSERIES-ALARM-MIB', 'alarmLogSeqNumber'), ('MSERIES-ALARM-MIB', 'alarmLogHostName'), ('MSERIES-ALARM-MIB', 'alarmLogPortName'), ('MSERIES-ALARM-MIB', 'alarmLogPortType'), ('MSERIES-ALARM-MIB', 'alarmLogType'), ('MSERIES-ALARM-MIB', 'alarmLogCause')) if getattr(mibBuilder, 'version', (0, 0, 0)) > (4, 4, 0): smart_alarm_log_table_group_v1 = smartAlarmLogTableGroupV1.setStatus('current') smart_alarm_basic_compl_v1 = module_compliance((1, 3, 6, 1, 4, 1, 30826, 1, 1, 5, 2, 1)).setObjects(('MSERIES-ALARM-MIB', 'smartAlarmGeneralGroupV1'), ('MSERIES-ALARM-MIB', 'smartAlarmNotificationGroupV1'), ('MSERIES-ALARM-MIB', 'smartAlarmActiveTableGroupV1'), ('MSERIES-ALARM-MIB', 'smartAlarmLogTableGroupV1')) if getattr(mibBuilder, 'version', (0, 0, 0)) > (4, 4, 0): smart_alarm_basic_compl_v1 = smartAlarmBasicComplV1.setStatus('current') mibBuilder.exportSymbols('MSERIES-ALARM-MIB', alarmLogActivationTime=alarmLogActivationTime, smartAlarmCompliances=smartAlarmCompliances, smartAlarmGeneralNumberActiveList=smartAlarmGeneralNumberActiveList, alarmNotifyPrefix=alarmNotifyPrefix, alarmEntry=alarmEntry, alarmLogUnit=alarmLogUnit, alarmNotificationMajor=alarmNotificationMajor, smartAlarmActiveTableGroupV1=smartAlarmActiveTableGroupV1, alarmHostName=alarmHostName, alarmCause=alarmCause, alarmLogType=alarmLogType, smartAlarmGroups=smartAlarmGroups, alarmPort=alarmPort, alarmType=alarmType, alarmNotifications=alarmNotifications, smartAlarmGeneralHighestSeverity=smartAlarmGeneralHighestSeverity, alarmSeverity=alarmSeverity, alarmActivationTime=alarmActivationTime, alarmLogHostName=alarmLogHostName, alarmActiveList=alarmActiveList, alarmCeaseTime=alarmCeaseTime, alarmPortName=alarmPortName, alarmLogPort=alarmLogPort, alarmLogIndex=alarmLogIndex, smartAlarmBasicComplV1=smartAlarmBasicComplV1, alarmUnit=alarmUnit, alarmNotificationWarning=alarmNotificationWarning, alarmNotificationCritical=alarmNotificationCritical, alarmLogEntry=alarmLogEntry, alarmSeqNumber=alarmSeqNumber, PYSNMP_MODULE_ID=smartAlarm, alarmNotificationMinor=alarmNotificationMinor, alarmPortAlias=alarmPortAlias, alarmLogPortType=alarmLogPortType, alarmText=alarmText, smartAlarmGeneralNumberLogList=smartAlarmGeneralNumberLogList, alarmLogPortName=alarmLogPortName, alarmIndex=alarmIndex, alarmPortType=alarmPortType, alarmLogTable=alarmLogTable, smartAlarmGeneralGroupV1=smartAlarmGeneralGroupV1, smartAlarm=smartAlarm, alarmLogCeaseTime=alarmLogCeaseTime, alarmLogCause=alarmLogCause, alarmLogSeverity=alarmLogSeverity, alarmLogList=alarmLogList, smartAlarmGeneralLastSeqNumber=smartAlarmGeneralLastSeqNumber, alarmLogSeqNumber=alarmLogSeqNumber, alarmNotificationCleared=alarmNotificationCleared, smartAlarmNotificationGroupV1=smartAlarmNotificationGroupV1, smartAlarmLogTableGroupV1=smartAlarmLogTableGroupV1, alarmActiveTable=alarmActiveTable, alarmLogText=alarmLogText, alarmGeneral=alarmGeneral, smartAlarmMIBConformance=smartAlarmMIBConformance)
class Solution: def reverse(self, x): """ :type x: int :rtype: int """ cmp(x, 0)
class Solution: def reverse(self, x): """ :type x: int :rtype: int """ cmp(x, 0)
## allow us to use key value pairs ## create a program that will convert digit to num ## inside dic need {} monthConversions = { "Jan": "January", "Feb": "February", "Mar": "March", "Apr": "April", "May" : "May", "Jun" : "June", "Jul": "July", "Aug" : "August", "Sep" : "September", "Oct" : "October", "Nov" : "November", "Dec": "December", } ## key value can be anything as long as they are unique ### access them from the dic ## refer the key and then its going to go in dict and print the value print(monthConversions["Jun"]) ## second method print(monthConversions.get("Lum", "Not a valid key"))## get fct specify default value that we want to use
month_conversions = {'Jan': 'January', 'Feb': 'February', 'Mar': 'March', 'Apr': 'April', 'May': 'May', 'Jun': 'June', 'Jul': 'July', 'Aug': 'August', 'Sep': 'September', 'Oct': 'October', 'Nov': 'November', 'Dec': 'December'} print(monthConversions['Jun']) print(monthConversions.get('Lum', 'Not a valid key'))
# Databricks notebook source # MAGIC %md-sandbox # MAGIC # MAGIC <div style="text-align: center; line-height: 0; padding-top: 9px;"> # MAGIC <img src="https://databricks.com/wp-content/uploads/2018/03/db-academy-rgb-1200px.png" alt="Databricks Learning" style="width: 600px"> # MAGIC </div> # COMMAND ---------- # MAGIC %md # MAGIC # Conditionals and Loops # MAGIC # MAGIC ## ![Spark Logo Tiny](https://files.training.databricks.com/images/105/logo_spark_tiny.png) In this lesson you:<br><br> # MAGIC # MAGIC - Define syntax for writing lists and accessing their elements # MAGIC - Apply basic control flow statements to write programs that: # MAGIC - Repeat an action # MAGIC - Apply a function to any item on a list # MAGIC - Use conditional statements to how a program will execute # COMMAND ---------- # MAGIC %md # MAGIC ### 1) List # MAGIC # MAGIC Let's make a [list](https://www.w3schools.com/python/python_lists.asp) of what everyone ate for breakfast this morning. # MAGIC # MAGIC <img src="https://upload.wikimedia.org/wikipedia/commons/thumb/2/20/Scrambed_eggs.jpg/1280px-Scrambed_eggs.jpg" width="20%" height="10%"> # COMMAND ---------- breakfast_list = ["pancakes", "eggs", "waffles"] # COMMAND ---------- # MAGIC %md # MAGIC Let's get the first breakfast element from this list. # MAGIC # MAGIC **Note:** Everything in Python is 0-indexed, so the first element is at position 0. # COMMAND ---------- breakfast_list[0] # COMMAND ---------- # MAGIC %md # MAGIC Let's get the last breakfast item from this list. # COMMAND ---------- breakfast_list[-1] # COMMAND ---------- # MAGIC %md # MAGIC What if I want the second breakfast item and onwards? # COMMAND ---------- breakfast_list[1:] # COMMAND ---------- # MAGIC %md # MAGIC Let's add an element to our list. # COMMAND ---------- breakfast_list += ["apple"] # The += is a short cut for # breakfast_list = breakfast_list + ["apple"] # COMMAND ---------- # MAGIC %md # MAGIC ### 2) For Loops # MAGIC # MAGIC What if we wanted to print every breakfast we had this morning? # MAGIC # MAGIC Loops are a way to repeat a block of code while iterating over a sequence (["for-loop"](https://www.w3schools.com/python/python_for_loops.asp)). Notice how in the code below the syntax is: # MAGIC # MAGIC ``` # MAGIC for element in list: # MAGIC do something # MAGIC ``` # MAGIC # MAGIC Anything you want executed multiple times needs to be indented inside the for loop. `food` is a temporary variable we define below, but you can call it anything you like. # COMMAND ---------- for food in breakfast_list: print(food) print("This is executed once because it is outside the for loop") # COMMAND ---------- # MAGIC %md # MAGIC You can also get it to print out the index of the element in the list too, by using `enumerate`. # COMMAND ---------- for i, food in enumerate(breakfast_list): print(i, food) # COMMAND ---------- # MAGIC %md # MAGIC ### 3) Conditionals # MAGIC # MAGIC Sometimes, depending on certain conditions, we don't always want to execute every line of code. We can control this through using the `if`, `elif`, and `else` [conditionals](https://www.w3schools.com/python/python_conditions.asp). # MAGIC # MAGIC You are not required to have elif/else statements following an if statement. # COMMAND ---------- if food == "eggs": print("Make scrambled eggs") elif food == "waffles": print("I want maple syrup on my waffles") else: print(food) # COMMAND ---------- # MAGIC %md # MAGIC You can also nest these if/elif/else statements, or combine them with `or` & `and` # COMMAND ---------- if food != "eggs": if (food == "waffles") or (food == "pancakes"): print("I want maple syrup on my waffles") else: print("It must be an apple") else: print(food) # COMMAND ---------- # MAGIC %md # MAGIC We can put these if/elif/else statements inside of a for loop. # COMMAND ---------- for food in breakfast_list: if food != "eggs": if (food == "waffles") or (food == "pancakes"): print("I want maple syrup on my waffles") else: print("It must be an apple") else: print(food) # COMMAND ---------- # MAGIC %md # MAGIC ### 4) Ranges # MAGIC # MAGIC A _range_ represents an _immutable_ sequence of numbers, and is commonly used for looping a specific number of times in `for` loops. # COMMAND ---------- # Note that a range includes the start value and excludes the stop value print("A range from 1 up to but not including 5") for i in range(1, 5): print(i) # A start value of 0 is used if you don't specify a value print("\nA range from 0 up to but not including 5") for i in range(5): print(i) # COMMAND ---------- # MAGIC %md # MAGIC A difference between lists and ranges is that a range is a _generator_, which generates the values when they are accessed rather than storing all of the values in memory. If necessary, you can use the `list()` built-in function to create a list by materializing all of the elements of a range. # COMMAND ---------- values_range = range(5) print(f"The original range: {values_range}") values_list = list(values_range) print(f"The materialized range as a list: {values_list}") # COMMAND ---------- # MAGIC %md-sandbox # MAGIC &copy; 2021 Databricks, Inc. All rights reserved.<br/> # MAGIC Apache, Apache Spark, Spark and the Spark logo are trademarks of the <a href="https://www.apache.org/">Apache Software Foundation</a>.<br/> # MAGIC <br/> # MAGIC <a href="https://databricks.com/privacy-policy">Privacy Policy</a> | <a href="https://databricks.com/terms-of-use">Terms of Use</a> | <a href="https://help.databricks.com/">Support</a>
breakfast_list = ['pancakes', 'eggs', 'waffles'] breakfast_list[0] breakfast_list[-1] breakfast_list[1:] breakfast_list += ['apple'] for food in breakfast_list: print(food) print('This is executed once because it is outside the for loop') for (i, food) in enumerate(breakfast_list): print(i, food) if food == 'eggs': print('Make scrambled eggs') elif food == 'waffles': print('I want maple syrup on my waffles') else: print(food) if food != 'eggs': if food == 'waffles' or food == 'pancakes': print('I want maple syrup on my waffles') else: print('It must be an apple') else: print(food) for food in breakfast_list: if food != 'eggs': if food == 'waffles' or food == 'pancakes': print('I want maple syrup on my waffles') else: print('It must be an apple') else: print(food) print('A range from 1 up to but not including 5') for i in range(1, 5): print(i) print('\nA range from 0 up to but not including 5') for i in range(5): print(i) values_range = range(5) print(f'The original range: {values_range}') values_list = list(values_range) print(f'The materialized range as a list: {values_list}')
directions = { "E": [0, 1], "S": [-1, 0], "W": [0, -1], "N": [1, 0], } cardinal = { 0: "E", 1: "S", 2: "W", 3: "N", } def travel(input): cur_x = 0 cur_y = 0 facing = 0 for instruction in input: action = instruction[0] value = int(instruction[1:]) if action == "F": cur_x += directions[cardinal[facing]][0]*value cur_y += directions[cardinal[facing]][1]*value elif action == "R": facing = (facing + (value / 90)) % 4 elif action == "L": facing = (facing - (value / 90)) % 4 else: cur_x += directions[action][0]*value cur_y += directions[action][1]*value return abs(cur_x) + abs(cur_y) input = open('12/input.txt').read().splitlines() print(travel(input))
directions = {'E': [0, 1], 'S': [-1, 0], 'W': [0, -1], 'N': [1, 0]} cardinal = {0: 'E', 1: 'S', 2: 'W', 3: 'N'} def travel(input): cur_x = 0 cur_y = 0 facing = 0 for instruction in input: action = instruction[0] value = int(instruction[1:]) if action == 'F': cur_x += directions[cardinal[facing]][0] * value cur_y += directions[cardinal[facing]][1] * value elif action == 'R': facing = (facing + value / 90) % 4 elif action == 'L': facing = (facing - value / 90) % 4 else: cur_x += directions[action][0] * value cur_y += directions[action][1] * value return abs(cur_x) + abs(cur_y) input = open('12/input.txt').read().splitlines() print(travel(input))
#1 Manual way def keep_evens (nums): new_list = [] for num in nums: if num % 2 == 0: new_list.append(num) return new_list print(keep_evens([3, 4, 6, 7, 0, 1])) #2 def keep_evens(nums): new_seq = filter(lambda num: num %2 ==0, nums) #Instead of transforming an input like in map function #in filter function we are not transforming, we are just making a binary decision. So, the first parameter #is true or false ? if it's true we get if it's false we filtered out return list(new_seq) print(keep_evens([3, 4, 6, 7, 0, 1])) #3 lst = ['witch','halloween','pumpkin','cat','candy','wagon','moon'] lst2 = list(filter(lambda word: 'o' in word, lst)) print(lst2)
def keep_evens(nums): new_list = [] for num in nums: if num % 2 == 0: new_list.append(num) return new_list print(keep_evens([3, 4, 6, 7, 0, 1])) def keep_evens(nums): new_seq = filter(lambda num: num % 2 == 0, nums) return list(new_seq) print(keep_evens([3, 4, 6, 7, 0, 1])) lst = ['witch', 'halloween', 'pumpkin', 'cat', 'candy', 'wagon', 'moon'] lst2 = list(filter(lambda word: 'o' in word, lst)) print(lst2)
"""Utilities for use with the manifest structure returned by GetManifest """ __author__ = "Chris Stradtman" __license__ = "MIT" __version__ = "1.0" def getManifestEtag(manifest): """ returns Etag hash for manifest""" return manifest["Etag"] def getManifestType(manifest): """ returns manifest type for manifest""" return manifest["Content-Type"] def getManifestApiVersion(manifest): """ returns Api Version for for manifest""" return manifest["Docker-Distribution-Api-Version"] def getManifestRetrievalDate(manifest): """ returns datestring of data retrieval for manifest""" return manifest["Date"] def getManifestSchemaVersion(manifest): """ returns manifest schema version for manifest""" return manifest["manifest"]["schemaVersion"] def getManifestName(manifest): """ returns name of manifest""" return manifest["manifest"]["name"] def getManifestTag(manifest): """ returns tag for manifest""" return manifest["manifest"]["tag"] def getManifestArchitecture(manifest): """ returns system architecture for manifest""" return manifest["manifest"]["architecture"] def getManifestFsLayers(manifest): """ returns hashes pointing to layers for manifest""" return manifest["manifest"]["fsLayers"] def getManifestHistory(manifest): """ returns hist for manifest raw data unparsed""" return manifest["manifest"]["history"] def getManifestSignatures(manifest): """ returns signature for manifest unparsed""" return manifest["manifest"]["signatures"]
"""Utilities for use with the manifest structure returned by GetManifest """ __author__ = 'Chris Stradtman' __license__ = 'MIT' __version__ = '1.0' def get_manifest_etag(manifest): """ returns Etag hash for manifest""" return manifest['Etag'] def get_manifest_type(manifest): """ returns manifest type for manifest""" return manifest['Content-Type'] def get_manifest_api_version(manifest): """ returns Api Version for for manifest""" return manifest['Docker-Distribution-Api-Version'] def get_manifest_retrieval_date(manifest): """ returns datestring of data retrieval for manifest""" return manifest['Date'] def get_manifest_schema_version(manifest): """ returns manifest schema version for manifest""" return manifest['manifest']['schemaVersion'] def get_manifest_name(manifest): """ returns name of manifest""" return manifest['manifest']['name'] def get_manifest_tag(manifest): """ returns tag for manifest""" return manifest['manifest']['tag'] def get_manifest_architecture(manifest): """ returns system architecture for manifest""" return manifest['manifest']['architecture'] def get_manifest_fs_layers(manifest): """ returns hashes pointing to layers for manifest""" return manifest['manifest']['fsLayers'] def get_manifest_history(manifest): """ returns hist for manifest raw data unparsed""" return manifest['manifest']['history'] def get_manifest_signatures(manifest): """ returns signature for manifest unparsed""" return manifest['manifest']['signatures']
class Commands: def __init__(self, player_id): self.player_id = player_id def attack(self, direction): data = { 'command': 'attack', 'character_id': str(self.player_id), 'direction': direction } return data def collect(self): data = { 'command': 'collect', 'character_id': str(self.player_id) } return data def idle(self): data = { 'command': 'idle', 'character_id': str(self.player_id) } return data def move(self, direction): data = { 'command': 'move', 'character_id': str(self.player_id), 'direction': direction } return data def rest(self): data = { 'command': 'rest', 'character_id': str(self.player_id) } return data def store(self): data = { 'command': 'store', 'character_id': str(self.player_id) } return data
class Commands: def __init__(self, player_id): self.player_id = player_id def attack(self, direction): data = {'command': 'attack', 'character_id': str(self.player_id), 'direction': direction} return data def collect(self): data = {'command': 'collect', 'character_id': str(self.player_id)} return data def idle(self): data = {'command': 'idle', 'character_id': str(self.player_id)} return data def move(self, direction): data = {'command': 'move', 'character_id': str(self.player_id), 'direction': direction} return data def rest(self): data = {'command': 'rest', 'character_id': str(self.player_id)} return data def store(self): data = {'command': 'store', 'character_id': str(self.player_id)} return data
# coding: utf-8 # @author octopoulo <polluxyz@gmail.com> # @version 2020-11-12 """ Init """ __all__ = [ '__main__', 'antifraud', 'commoner', ]
""" Init """ __all__ = ['__main__', 'antifraud', 'commoner']
class Room: def __init__( self, id, name, description, n_to=None, s_to=None, e_to=None, w_to=None ): self.id = id self.name = name self.description = description self.n_to = n_to self.s_to = s_to self.e_to = e_to self.w_to = w_to # def __repr__(self): # pass # def __str__(self): # pass class World: def __init__(self, rooms=None): self.rooms = rooms pass def move(self, direction): pass entrance = Room( 0, "The Entrance", "You are presented with the front door to an old rickety house to the north which looks like it could fall down at any time. A low lit street beacons you to the east, and a deafening sound is comming from the west!", ) w_rooms = [entrance] w = World(w_rooms) print(entrance)
class Room: def __init__(self, id, name, description, n_to=None, s_to=None, e_to=None, w_to=None): self.id = id self.name = name self.description = description self.n_to = n_to self.s_to = s_to self.e_to = e_to self.w_to = w_to class World: def __init__(self, rooms=None): self.rooms = rooms pass def move(self, direction): pass entrance = room(0, 'The Entrance', 'You are presented with the front door to an old rickety house to the north which looks like it could fall down at any time. A low lit street beacons you to the east, and a deafening sound is comming from the west!') w_rooms = [entrance] w = world(w_rooms) print(entrance)
class Solution(object): def intersect(self, nums1, nums2): if len(nums1) > len(nums2): nums1, nums2 = nums2, nums1 c = collections.Counter(nums1) res = [] for i in nums2: if c[i] > 0: res += i, c[i] -= 1 return res
class Solution(object): def intersect(self, nums1, nums2): if len(nums1) > len(nums2): (nums1, nums2) = (nums2, nums1) c = collections.Counter(nums1) res = [] for i in nums2: if c[i] > 0: res += (i,) c[i] -= 1 return res
# Bite 5 https://codechalleng.es/bites/5/ NAMES = [ "arnold schwarzenegger", "alec baldwin", "bob belderbos", "julian sequeira", "sandra bullock", "keanu reeves", "julbob pybites", "bob belderbos", "julian sequeira", "al pacino", "brad pitt", "matt damon", "brad pitt", ] def dedup_and_title_case_names(names): """Should return a list of names, each name appears only once""" return list({name.title() for name in names}) def sort_by_surname_desc(names): """Returns names list sorted desc by surname""" names = dedup_and_title_case_names(names) split_names = [name.split() for name in names] split_names.sort(key=lambda name: name[1].lower(), reverse=True) return [" ".join(name) for name in split_names] def shortest_first_name(names): """Returns the shortest first name (str)""" names = dedup_and_title_case_names(names) return sorted([name.split()[0] for name in names], key=lambda name: len(name))[0] # Tests def test_dedup_and_title_case_names(): names = dedup_and_title_case_names(NAMES) assert names.count("Bob Belderbos") == 1 assert names.count("julian sequeira") == 0 assert names.count("Brad Pitt") == 1 assert len(names) == 10 assert all(n.title() in names for n in NAMES) def test_sort_by_surname_desc(): names = sort_by_surname_desc(NAMES) assert names[0] == "Julian Sequeira" assert names[-1] == "Alec Baldwin" def test_shortest_first_name(): assert shortest_first_name(NAMES) == "Al" # Bite 26 https://codechalleng.es/bites/26/ bites = { 6: "PyBites Die Hard", 7: "Parsing dates from logs", 9: "Palindromes", 10: "Practice exceptions", 11: "Enrich a class with dunder methods", 12: "Write a user validation function", 13: "Convert dict in namedtuple/json", 14: "Generate a table of n sequences", 15: "Enumerate 2 sequences", 16: "Special PyBites date generator", 17: "Form teams from a group of friends", 18: "Find the most common word", 19: "Write a simple property", 20: "Write a context manager", 21: "Query a nested data structure", } exclude_bites = {6, 10, 16, 18, 21} def filter_bites(bites=bites, bites_done=exclude_bites): """return the bites dict with the exclude_bites filtered out""" return {key: value for key, value in bites.items() if key not in exclude_bites} # Tests def test_filter_bites(): result = filter_bites() assert type(result) == dict assert len(result) == 10 for bite in exclude_bites: assert bite not in result, f"Bite {bite} should not be in result" if __name__ == "__main__": test_dedup_and_title_case_names() test_sort_by_surname_desc() test_shortest_first_name() print("Tests Pass for first bite!") test_filter_bites() print("All Tests pass!")
names = ['arnold schwarzenegger', 'alec baldwin', 'bob belderbos', 'julian sequeira', 'sandra bullock', 'keanu reeves', 'julbob pybites', 'bob belderbos', 'julian sequeira', 'al pacino', 'brad pitt', 'matt damon', 'brad pitt'] def dedup_and_title_case_names(names): """Should return a list of names, each name appears only once""" return list({name.title() for name in names}) def sort_by_surname_desc(names): """Returns names list sorted desc by surname""" names = dedup_and_title_case_names(names) split_names = [name.split() for name in names] split_names.sort(key=lambda name: name[1].lower(), reverse=True) return [' '.join(name) for name in split_names] def shortest_first_name(names): """Returns the shortest first name (str)""" names = dedup_and_title_case_names(names) return sorted([name.split()[0] for name in names], key=lambda name: len(name))[0] def test_dedup_and_title_case_names(): names = dedup_and_title_case_names(NAMES) assert names.count('Bob Belderbos') == 1 assert names.count('julian sequeira') == 0 assert names.count('Brad Pitt') == 1 assert len(names) == 10 assert all((n.title() in names for n in NAMES)) def test_sort_by_surname_desc(): names = sort_by_surname_desc(NAMES) assert names[0] == 'Julian Sequeira' assert names[-1] == 'Alec Baldwin' def test_shortest_first_name(): assert shortest_first_name(NAMES) == 'Al' bites = {6: 'PyBites Die Hard', 7: 'Parsing dates from logs', 9: 'Palindromes', 10: 'Practice exceptions', 11: 'Enrich a class with dunder methods', 12: 'Write a user validation function', 13: 'Convert dict in namedtuple/json', 14: 'Generate a table of n sequences', 15: 'Enumerate 2 sequences', 16: 'Special PyBites date generator', 17: 'Form teams from a group of friends', 18: 'Find the most common word', 19: 'Write a simple property', 20: 'Write a context manager', 21: 'Query a nested data structure'} exclude_bites = {6, 10, 16, 18, 21} def filter_bites(bites=bites, bites_done=exclude_bites): """return the bites dict with the exclude_bites filtered out""" return {key: value for (key, value) in bites.items() if key not in exclude_bites} def test_filter_bites(): result = filter_bites() assert type(result) == dict assert len(result) == 10 for bite in exclude_bites: assert bite not in result, f'Bite {bite} should not be in result' if __name__ == '__main__': test_dedup_and_title_case_names() test_sort_by_surname_desc() test_shortest_first_name() print('Tests Pass for first bite!') test_filter_bites() print('All Tests pass!')
# Released under the MIT License. See LICENSE for details. # # This file was automatically generated from "monkey_face.ma" # pylint: disable=all points = {} # noinspection PyDictCreation boxes = {} boxes['area_of_interest_bounds'] = (-1.657177611, 4.132574186, -1.580485661) + (0.0, 0.0, 0.0) + ( 17.36258946, 10.49020453, 12.31460338) points['ffa_spawn1'] = (-8.026373566, 3.349937889, -2.542088202) + ( 0.9450583628, 0.9450583628, 1.181509268) points['ffa_spawn2'] = (4.73470012, 3.308679998, -2.757871588) + (0.9335931003, 1.0, 1.217352295) points['ffa_spawn3'] = (-1.907161509, 3.326830784, -6.572223028) + (4.080767643, 1.0, 0.2880331593) points['ffa_spawn4'] = (-1.672823345, 3.326830784, 2.405442985) + (3.870724402, 1.0, 0.2880331593) points['flag1'] = (-8.968414135, 3.35709348, -2.804123917) points['flag2'] = (5.945128279, 3.354825248, -2.663635497) points['flag_default'] = (-1.688166134, 3.392387172, -2.238613943) boxes['map_bounds'] = (-1.615296127, 6.825502312, -2.200965435) + ( 0.0, 0.0, 0.0) + (22.51905077, 12.21074608, 15.9079565) points['powerup_spawn1'] = (-6.859406739, 4.429165244, -6.588618549) points['powerup_spawn2'] = (-5.422572086, 4.228850685, 2.803988636) points['powerup_spawn3'] = (3.148493267, 4.429165244, -6.588618549) points['powerup_spawn4'] = (1.830377363, 4.228850685, 2.803988636) points['shadow_lower_bottom'] = (-1.877364768, 0.9878677276, 5.50201662) points['shadow_lower_top'] = (-1.877364768, 2.881511768, 5.50201662) points['shadow_upper_bottom'] = (-1.877364768, 6.169020542, 5.50201662) points['shadow_upper_top'] = (-1.877364768, 10.2492777, 5.50201662) points['spawn1'] = (-8.026373566, 3.349937889, -2.542088202) + (0.9450583628, 0.9450583628, 1.181509268) points['spawn2'] = (4.73470012, 3.308679998, -2.757871588) + (0.9335931003, 1.0, 1.217352295)
points = {} boxes = {} boxes['area_of_interest_bounds'] = (-1.657177611, 4.132574186, -1.580485661) + (0.0, 0.0, 0.0) + (17.36258946, 10.49020453, 12.31460338) points['ffa_spawn1'] = (-8.026373566, 3.349937889, -2.542088202) + (0.9450583628, 0.9450583628, 1.181509268) points['ffa_spawn2'] = (4.73470012, 3.308679998, -2.757871588) + (0.9335931003, 1.0, 1.217352295) points['ffa_spawn3'] = (-1.907161509, 3.326830784, -6.572223028) + (4.080767643, 1.0, 0.2880331593) points['ffa_spawn4'] = (-1.672823345, 3.326830784, 2.405442985) + (3.870724402, 1.0, 0.2880331593) points['flag1'] = (-8.968414135, 3.35709348, -2.804123917) points['flag2'] = (5.945128279, 3.354825248, -2.663635497) points['flag_default'] = (-1.688166134, 3.392387172, -2.238613943) boxes['map_bounds'] = (-1.615296127, 6.825502312, -2.200965435) + (0.0, 0.0, 0.0) + (22.51905077, 12.21074608, 15.9079565) points['powerup_spawn1'] = (-6.859406739, 4.429165244, -6.588618549) points['powerup_spawn2'] = (-5.422572086, 4.228850685, 2.803988636) points['powerup_spawn3'] = (3.148493267, 4.429165244, -6.588618549) points['powerup_spawn4'] = (1.830377363, 4.228850685, 2.803988636) points['shadow_lower_bottom'] = (-1.877364768, 0.9878677276, 5.50201662) points['shadow_lower_top'] = (-1.877364768, 2.881511768, 5.50201662) points['shadow_upper_bottom'] = (-1.877364768, 6.169020542, 5.50201662) points['shadow_upper_top'] = (-1.877364768, 10.2492777, 5.50201662) points['spawn1'] = (-8.026373566, 3.349937889, -2.542088202) + (0.9450583628, 0.9450583628, 1.181509268) points['spawn2'] = (4.73470012, 3.308679998, -2.757871588) + (0.9335931003, 1.0, 1.217352295)
# Copyright 2016-2017 Intel Corporation. # # 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. """Abstract "packet forwarding" model. This is an abstract class for packet forwarders. """ class IPktFwd(object): """Interface class that is implemented by specific classes of packet forwarders """ def __enter__(self): """Start the packet forwarder. Provide a context manager interface to the packet forwarders. This simply calls the :func:`start` function. """ return self.start() def __exit__(self, type_, value, traceback): """Stop the packet forwarder. Provide a context manager interface to the packet forwarders. This simply calls the :func:`stop` function. """ self.stop() def start(self): """Start the packet forwarder. :returns: None """ raise NotImplementedError('Please call an implementation.') def start_for_guest(self): """Start the packet forward for guest config :returns: None """ def stop(self): """Stop the packet forwarder. :returns: None """ raise NotImplementedError('Please call an implementation.')
"""Abstract "packet forwarding" model. This is an abstract class for packet forwarders. """ class Ipktfwd(object): """Interface class that is implemented by specific classes of packet forwarders """ def __enter__(self): """Start the packet forwarder. Provide a context manager interface to the packet forwarders. This simply calls the :func:`start` function. """ return self.start() def __exit__(self, type_, value, traceback): """Stop the packet forwarder. Provide a context manager interface to the packet forwarders. This simply calls the :func:`stop` function. """ self.stop() def start(self): """Start the packet forwarder. :returns: None """ raise not_implemented_error('Please call an implementation.') def start_for_guest(self): """Start the packet forward for guest config :returns: None """ def stop(self): """Stop the packet forwarder. :returns: None """ raise not_implemented_error('Please call an implementation.')
# PySNMP SMI module. Autogenerated from smidump -f python SNMP-VIEW-BASED-ACM-MIB # by libsmi2pysnmp-0.1.3 at Tue Apr 3 16:57:42 2012, # Python version sys.version_info(major=2, minor=7, micro=2, releaselevel='final', serial=0) # Imports ( Integer, ObjectIdentifier, OctetString, ) = mibBuilder.importSymbols("ASN1", "Integer", "ObjectIdentifier", "OctetString") ( NamedValues, ) = mibBuilder.importSymbols("ASN1-ENUMERATION", "NamedValues") ( ConstraintsIntersection, ConstraintsUnion, SingleValueConstraint, ValueRangeConstraint, ValueSizeConstraint, ) = mibBuilder.importSymbols("ASN1-REFINEMENT", "ConstraintsIntersection", "ConstraintsUnion", "SingleValueConstraint", "ValueRangeConstraint", "ValueSizeConstraint") ( SnmpAdminString, SnmpSecurityLevel, SnmpSecurityModel, ) = mibBuilder.importSymbols("SNMP-FRAMEWORK-MIB", "SnmpAdminString", "SnmpSecurityLevel", "SnmpSecurityModel") ( ModuleCompliance, ObjectGroup, ) = mibBuilder.importSymbols("SNMPv2-CONF", "ModuleCompliance", "ObjectGroup") ( Bits, Integer32, ModuleIdentity, MibIdentifier, MibScalar, MibTable, MibTableRow, MibTableColumn, TimeTicks, snmpModules, ) = mibBuilder.importSymbols("SNMPv2-SMI", "Bits", "Integer32", "ModuleIdentity", "MibIdentifier", "MibScalar", "MibTable", "MibTableRow", "MibTableColumn", "TimeTicks", "snmpModules") ( RowStatus, StorageType, TestAndIncr, ) = mibBuilder.importSymbols("SNMPv2-TC", "RowStatus", "StorageType", "TestAndIncr") # Objects snmpVacmMIB = ModuleIdentity((1, 3, 6, 1, 6, 3, 16)).setRevisions(("2002-10-16 00:00","1999-01-20 00:00","1997-11-20 00:00",)) if mibBuilder.loadTexts: snmpVacmMIB.setOrganization("SNMPv3 Working Group") if mibBuilder.loadTexts: snmpVacmMIB.setContactInfo("WG-email: snmpv3@lists.tislabs.com\nSubscribe: majordomo@lists.tislabs.com\n In message body: subscribe snmpv3\n\nCo-Chair: Russ Mundy\n Network Associates Laboratories\npostal: 15204 Omega Drive, Suite 300\n Rockville, MD 20850-4601\n USA\nemail: mundy@tislabs.com\nphone: +1 301-947-7107\n\nCo-Chair: David Harrington\n Enterasys Networks\nPostal: 35 Industrial Way\n P. O. Box 5004\n Rochester, New Hampshire 03866-5005\n USA\nEMail: dbh@enterasys.com\nPhone: +1 603-337-2614\n\nCo-editor: Bert Wijnen\n Lucent Technologies\npostal: Schagen 33\n 3461 GL Linschoten\n Netherlands\nemail: bwijnen@lucent.com\nphone: +31-348-480-685\n\nCo-editor: Randy Presuhn\n BMC Software, Inc.\n\npostal: 2141 North First Street\n San Jose, CA 95131\n USA\nemail: randy_presuhn@bmc.com\nphone: +1 408-546-1006\n\nCo-editor: Keith McCloghrie\n Cisco Systems, Inc.\npostal: 170 West Tasman Drive\n San Jose, CA 95134-1706\n USA\nemail: kzm@cisco.com\nphone: +1-408-526-5260") if mibBuilder.loadTexts: snmpVacmMIB.setDescription("The management information definitions for the\nView-based Access Control Model for SNMP.\n\nCopyright (C) The Internet Society (2002). This\nversion of this MIB module is part of RFC 3415;\nsee the RFC itself for full legal notices.") vacmMIBObjects = MibIdentifier((1, 3, 6, 1, 6, 3, 16, 1)) vacmContextTable = MibTable((1, 3, 6, 1, 6, 3, 16, 1, 1)) if mibBuilder.loadTexts: vacmContextTable.setDescription("The table of locally available contexts.\n\nThis table provides information to SNMP Command\n\nGenerator applications so that they can properly\nconfigure the vacmAccessTable to control access to\nall contexts at the SNMP entity.\n\nThis table may change dynamically if the SNMP entity\nallows that contexts are added/deleted dynamically\n(for instance when its configuration changes). Such\nchanges would happen only if the management\ninstrumentation at that SNMP entity recognizes more\n(or fewer) contexts.\n\nThe presence of entries in this table and of entries\nin the vacmAccessTable are independent. That is, a\ncontext identified by an entry in this table is not\nnecessarily referenced by any entries in the\nvacmAccessTable; and the context(s) referenced by an\nentry in the vacmAccessTable does not necessarily\ncurrently exist and thus need not be identified by an\nentry in this table.\n\nThis table must be made accessible via the default\ncontext so that Command Responder applications have\na standard way of retrieving the information.\n\nThis table is read-only. It cannot be configured via\nSNMP.") vacmContextEntry = MibTableRow((1, 3, 6, 1, 6, 3, 16, 1, 1, 1)).setIndexNames((0, "SNMP-VIEW-BASED-ACM-MIB", "vacmContextName")) if mibBuilder.loadTexts: vacmContextEntry.setDescription("Information about a particular context.") vacmContextName = MibTableColumn((1, 3, 6, 1, 6, 3, 16, 1, 1, 1, 1), SnmpAdminString().subtype(subtypeSpec=ValueSizeConstraint(0, 32))).setMaxAccess("readonly") if mibBuilder.loadTexts: vacmContextName.setDescription("A human readable name identifying a particular\ncontext at a particular SNMP entity.\n\nThe empty contextName (zero length) represents the\ndefault context.") vacmSecurityToGroupTable = MibTable((1, 3, 6, 1, 6, 3, 16, 1, 2)) if mibBuilder.loadTexts: vacmSecurityToGroupTable.setDescription("This table maps a combination of securityModel and\nsecurityName into a groupName which is used to define\nan access control policy for a group of principals.") vacmSecurityToGroupEntry = MibTableRow((1, 3, 6, 1, 6, 3, 16, 1, 2, 1)).setIndexNames((0, "SNMP-VIEW-BASED-ACM-MIB", "vacmSecurityModel"), (0, "SNMP-VIEW-BASED-ACM-MIB", "vacmSecurityName")) if mibBuilder.loadTexts: vacmSecurityToGroupEntry.setDescription("An entry in this table maps the combination of a\nsecurityModel and securityName into a groupName.") vacmSecurityModel = MibTableColumn((1, 3, 6, 1, 6, 3, 16, 1, 2, 1, 1), SnmpSecurityModel().subtype(subtypeSpec=ValueRangeConstraint(1, 2147483647))).setMaxAccess("noaccess") if mibBuilder.loadTexts: vacmSecurityModel.setDescription("The Security Model, by which the vacmSecurityName\nreferenced by this entry is provided.\n\nNote, this object may not take the 'any' (0) value.") vacmSecurityName = MibTableColumn((1, 3, 6, 1, 6, 3, 16, 1, 2, 1, 2), SnmpAdminString().subtype(subtypeSpec=ValueSizeConstraint(1, 32))).setMaxAccess("noaccess") if mibBuilder.loadTexts: vacmSecurityName.setDescription("The securityName for the principal, represented in a\nSecurity Model independent format, which is mapped by\nthis entry to a groupName.") vacmGroupName = MibTableColumn((1, 3, 6, 1, 6, 3, 16, 1, 2, 1, 3), SnmpAdminString().subtype(subtypeSpec=ValueSizeConstraint(1, 32))).setMaxAccess("readcreate") if mibBuilder.loadTexts: vacmGroupName.setDescription("The name of the group to which this entry (e.g., the\ncombination of securityModel and securityName)\nbelongs.\n\nThis groupName is used as index into the\nvacmAccessTable to select an access control policy.\nHowever, a value in this table does not imply that an\ninstance with the value exists in table vacmAccesTable.") vacmSecurityToGroupStorageType = MibTableColumn((1, 3, 6, 1, 6, 3, 16, 1, 2, 1, 4), StorageType().clone('nonVolatile')).setMaxAccess("readcreate") if mibBuilder.loadTexts: vacmSecurityToGroupStorageType.setDescription("The storage type for this conceptual row.\nConceptual rows having the value 'permanent' need not\nallow write-access to any columnar objects in the row.") vacmSecurityToGroupStatus = MibTableColumn((1, 3, 6, 1, 6, 3, 16, 1, 2, 1, 5), RowStatus()).setMaxAccess("readcreate") if mibBuilder.loadTexts: vacmSecurityToGroupStatus.setDescription("The status of this conceptual row.\n\nUntil instances of all corresponding columns are\nappropriately configured, the value of the\n\ncorresponding instance of the vacmSecurityToGroupStatus\ncolumn is 'notReady'.\n\nIn particular, a newly created row cannot be made\nactive until a value has been set for vacmGroupName.\n\nThe RowStatus TC [RFC2579] requires that this\nDESCRIPTION clause states under which circumstances\nother objects in this row can be modified:\n\nThe value of this object has no effect on whether\nother objects in this conceptual row can be modified.") vacmAccessTable = MibTable((1, 3, 6, 1, 6, 3, 16, 1, 4)) if mibBuilder.loadTexts: vacmAccessTable.setDescription("The table of access rights for groups.\n\nEach entry is indexed by a groupName, a contextPrefix,\na securityModel and a securityLevel. To determine\nwhether access is allowed, one entry from this table\nneeds to be selected and the proper viewName from that\nentry must be used for access control checking.\n\nTo select the proper entry, follow these steps:\n\n1) the set of possible matches is formed by the\n intersection of the following sets of entries:\n\n the set of entries with identical vacmGroupName\n the union of these two sets:\n - the set with identical vacmAccessContextPrefix\n - the set of entries with vacmAccessContextMatch\n value of 'prefix' and matching\n vacmAccessContextPrefix\n intersected with the union of these two sets:\n - the set of entries with identical\n vacmSecurityModel\n - the set of entries with vacmSecurityModel\n value of 'any'\n intersected with the set of entries with\n vacmAccessSecurityLevel value less than or equal\n to the requested securityLevel\n\n2) if this set has only one member, we're done\n otherwise, it comes down to deciding how to weight\n the preferences between ContextPrefixes,\n SecurityModels, and SecurityLevels as follows:\n a) if the subset of entries with securityModel\n matching the securityModel in the message is\n not empty, then discard the rest.\n b) if the subset of entries with\n vacmAccessContextPrefix matching the contextName\n in the message is not empty,\n then discard the rest\n c) discard all entries with ContextPrefixes shorter\n than the longest one remaining in the set\n d) select the entry with the highest securityLevel\n\nPlease note that for securityLevel noAuthNoPriv, all\ngroups are really equivalent since the assumption that\nthe securityName has been authenticated does not hold.") vacmAccessEntry = MibTableRow((1, 3, 6, 1, 6, 3, 16, 1, 4, 1)).setIndexNames((0, "SNMP-VIEW-BASED-ACM-MIB", "vacmGroupName"), (0, "SNMP-VIEW-BASED-ACM-MIB", "vacmAccessContextPrefix"), (0, "SNMP-VIEW-BASED-ACM-MIB", "vacmAccessSecurityModel"), (0, "SNMP-VIEW-BASED-ACM-MIB", "vacmAccessSecurityLevel")) if mibBuilder.loadTexts: vacmAccessEntry.setDescription("An access right configured in the Local Configuration\nDatastore (LCD) authorizing access to an SNMP context.\n\nEntries in this table can use an instance value for\nobject vacmGroupName even if no entry in table\nvacmAccessSecurityToGroupTable has a corresponding\nvalue for object vacmGroupName.") vacmAccessContextPrefix = MibTableColumn((1, 3, 6, 1, 6, 3, 16, 1, 4, 1, 1), SnmpAdminString().subtype(subtypeSpec=ValueSizeConstraint(0, 32))).setMaxAccess("noaccess") if mibBuilder.loadTexts: vacmAccessContextPrefix.setDescription("In order to gain the access rights allowed by this\nconceptual row, a contextName must match exactly\n(if the value of vacmAccessContextMatch is 'exact')\nor partially (if the value of vacmAccessContextMatch\nis 'prefix') to the value of the instance of this\nobject.") vacmAccessSecurityModel = MibTableColumn((1, 3, 6, 1, 6, 3, 16, 1, 4, 1, 2), SnmpSecurityModel()).setMaxAccess("noaccess") if mibBuilder.loadTexts: vacmAccessSecurityModel.setDescription("In order to gain the access rights allowed by this\nconceptual row, this securityModel must be in use.") vacmAccessSecurityLevel = MibTableColumn((1, 3, 6, 1, 6, 3, 16, 1, 4, 1, 3), SnmpSecurityLevel()).setMaxAccess("noaccess") if mibBuilder.loadTexts: vacmAccessSecurityLevel.setDescription("The minimum level of security required in order to\ngain the access rights allowed by this conceptual\nrow. A securityLevel of noAuthNoPriv is less than\nauthNoPriv which in turn is less than authPriv.\n\nIf multiple entries are equally indexed except for\nthis vacmAccessSecurityLevel index, then the entry\nwhich has the highest value for\nvacmAccessSecurityLevel is selected.") vacmAccessContextMatch = MibTableColumn((1, 3, 6, 1, 6, 3, 16, 1, 4, 1, 4), Integer().subtype(subtypeSpec=SingleValueConstraint(2,1,)).subtype(namedValues=NamedValues(("exact", 1), ("prefix", 2), )).clone(1)).setMaxAccess("readcreate") if mibBuilder.loadTexts: vacmAccessContextMatch.setDescription("If the value of this object is exact(1), then all\nrows where the contextName exactly matches\nvacmAccessContextPrefix are selected.\n\nIf the value of this object is prefix(2), then all\nrows where the contextName whose starting octets\nexactly match vacmAccessContextPrefix are selected.\nThis allows for a simple form of wildcarding.") vacmAccessReadViewName = MibTableColumn((1, 3, 6, 1, 6, 3, 16, 1, 4, 1, 5), SnmpAdminString().subtype(subtypeSpec=ValueSizeConstraint(0, 32)).clone('')).setMaxAccess("readcreate") if mibBuilder.loadTexts: vacmAccessReadViewName.setDescription("The value of an instance of this object identifies\nthe MIB view of the SNMP context to which this\nconceptual row authorizes read access.\n\nThe identified MIB view is that one for which the\nvacmViewTreeFamilyViewName has the same value as the\ninstance of this object; if the value is the empty\nstring or if there is no active MIB view having this\nvalue of vacmViewTreeFamilyViewName, then no access\nis granted.") vacmAccessWriteViewName = MibTableColumn((1, 3, 6, 1, 6, 3, 16, 1, 4, 1, 6), SnmpAdminString().subtype(subtypeSpec=ValueSizeConstraint(0, 32)).clone('')).setMaxAccess("readcreate") if mibBuilder.loadTexts: vacmAccessWriteViewName.setDescription("The value of an instance of this object identifies\nthe MIB view of the SNMP context to which this\nconceptual row authorizes write access.\n\nThe identified MIB view is that one for which the\nvacmViewTreeFamilyViewName has the same value as the\ninstance of this object; if the value is the empty\nstring or if there is no active MIB view having this\nvalue of vacmViewTreeFamilyViewName, then no access\nis granted.") vacmAccessNotifyViewName = MibTableColumn((1, 3, 6, 1, 6, 3, 16, 1, 4, 1, 7), SnmpAdminString().subtype(subtypeSpec=ValueSizeConstraint(0, 32)).clone('')).setMaxAccess("readcreate") if mibBuilder.loadTexts: vacmAccessNotifyViewName.setDescription("The value of an instance of this object identifies\nthe MIB view of the SNMP context to which this\nconceptual row authorizes access for notifications.\n\nThe identified MIB view is that one for which the\nvacmViewTreeFamilyViewName has the same value as the\ninstance of this object; if the value is the empty\nstring or if there is no active MIB view having this\nvalue of vacmViewTreeFamilyViewName, then no access\nis granted.") vacmAccessStorageType = MibTableColumn((1, 3, 6, 1, 6, 3, 16, 1, 4, 1, 8), StorageType().clone('nonVolatile')).setMaxAccess("readcreate") if mibBuilder.loadTexts: vacmAccessStorageType.setDescription("The storage type for this conceptual row.\n\nConceptual rows having the value 'permanent' need not\nallow write-access to any columnar objects in the row.") vacmAccessStatus = MibTableColumn((1, 3, 6, 1, 6, 3, 16, 1, 4, 1, 9), RowStatus()).setMaxAccess("readcreate") if mibBuilder.loadTexts: vacmAccessStatus.setDescription("The status of this conceptual row.\n\nThe RowStatus TC [RFC2579] requires that this\nDESCRIPTION clause states under which circumstances\nother objects in this row can be modified:\n\nThe value of this object has no effect on whether\nother objects in this conceptual row can be modified.") vacmMIBViews = MibIdentifier((1, 3, 6, 1, 6, 3, 16, 1, 5)) vacmViewSpinLock = MibScalar((1, 3, 6, 1, 6, 3, 16, 1, 5, 1), TestAndIncr()).setMaxAccess("readwrite") if mibBuilder.loadTexts: vacmViewSpinLock.setDescription("An advisory lock used to allow cooperating SNMP\nCommand Generator applications to coordinate their\nuse of the Set operation in creating or modifying\nviews.\n\nWhen creating a new view or altering an existing\nview, it is important to understand the potential\ninteractions with other uses of the view. The\nvacmViewSpinLock should be retrieved. The name of\nthe view to be created should be determined to be\nunique by the SNMP Command Generator application by\nconsulting the vacmViewTreeFamilyTable. Finally,\nthe named view may be created (Set), including the\nadvisory lock.\nIf another SNMP Command Generator application has\naltered the views in the meantime, then the spin\nlock's value will have changed, and so this creation\nwill fail because it will specify the wrong value for\nthe spin lock.\n\nSince this is an advisory lock, the use of this lock\nis not enforced.") vacmViewTreeFamilyTable = MibTable((1, 3, 6, 1, 6, 3, 16, 1, 5, 2)) if mibBuilder.loadTexts: vacmViewTreeFamilyTable.setDescription("Locally held information about families of subtrees\nwithin MIB views.\n\nEach MIB view is defined by two sets of view subtrees:\n - the included view subtrees, and\n - the excluded view subtrees.\nEvery such view subtree, both the included and the\n\nexcluded ones, is defined in this table.\n\nTo determine if a particular object instance is in\na particular MIB view, compare the object instance's\nOBJECT IDENTIFIER with each of the MIB view's active\nentries in this table. If none match, then the\nobject instance is not in the MIB view. If one or\nmore match, then the object instance is included in,\nor excluded from, the MIB view according to the\nvalue of vacmViewTreeFamilyType in the entry whose\nvalue of vacmViewTreeFamilySubtree has the most\nsub-identifiers. If multiple entries match and have\nthe same number of sub-identifiers (when wildcarding\nis specified with the value of vacmViewTreeFamilyMask),\nthen the lexicographically greatest instance of\nvacmViewTreeFamilyType determines the inclusion or\nexclusion.\n\nAn object instance's OBJECT IDENTIFIER X matches an\nactive entry in this table when the number of\nsub-identifiers in X is at least as many as in the\nvalue of vacmViewTreeFamilySubtree for the entry,\nand each sub-identifier in the value of\nvacmViewTreeFamilySubtree matches its corresponding\nsub-identifier in X. Two sub-identifiers match\neither if the corresponding bit of the value of\nvacmViewTreeFamilyMask for the entry is zero (the\n'wild card' value), or if they are equal.\n\nA 'family' of subtrees is the set of subtrees defined\nby a particular combination of values of\nvacmViewTreeFamilySubtree and vacmViewTreeFamilyMask.\n\nIn the case where no 'wild card' is defined in the\nvacmViewTreeFamilyMask, the family of subtrees reduces\nto a single subtree.\n\nWhen creating or changing MIB views, an SNMP Command\nGenerator application should utilize the\nvacmViewSpinLock to try to avoid collisions. See\nDESCRIPTION clause of vacmViewSpinLock.\n\nWhen creating MIB views, it is strongly advised that\nfirst the 'excluded' vacmViewTreeFamilyEntries are\ncreated and then the 'included' entries.\n\nWhen deleting MIB views, it is strongly advised that\nfirst the 'included' vacmViewTreeFamilyEntries are\n\ndeleted and then the 'excluded' entries.\n\nIf a create for an entry for instance-level access\ncontrol is received and the implementation does not\nsupport instance-level granularity, then an\ninconsistentName error must be returned.") vacmViewTreeFamilyEntry = MibTableRow((1, 3, 6, 1, 6, 3, 16, 1, 5, 2, 1)).setIndexNames((0, "SNMP-VIEW-BASED-ACM-MIB", "vacmViewTreeFamilyViewName"), (0, "SNMP-VIEW-BASED-ACM-MIB", "vacmViewTreeFamilySubtree")) if mibBuilder.loadTexts: vacmViewTreeFamilyEntry.setDescription("Information on a particular family of view subtrees\nincluded in or excluded from a particular SNMP\ncontext's MIB view.\n\nImplementations must not restrict the number of\nfamilies of view subtrees for a given MIB view,\nexcept as dictated by resource constraints on the\noverall number of entries in the\nvacmViewTreeFamilyTable.\n\nIf no conceptual rows exist in this table for a given\nMIB view (viewName), that view may be thought of as\nconsisting of the empty set of view subtrees.") vacmViewTreeFamilyViewName = MibTableColumn((1, 3, 6, 1, 6, 3, 16, 1, 5, 2, 1, 1), SnmpAdminString().subtype(subtypeSpec=ValueSizeConstraint(1, 32))).setMaxAccess("noaccess") if mibBuilder.loadTexts: vacmViewTreeFamilyViewName.setDescription("The human readable name for a family of view subtrees.") vacmViewTreeFamilySubtree = MibTableColumn((1, 3, 6, 1, 6, 3, 16, 1, 5, 2, 1, 2), ObjectIdentifier()).setMaxAccess("noaccess") if mibBuilder.loadTexts: vacmViewTreeFamilySubtree.setDescription("The MIB subtree which when combined with the\ncorresponding instance of vacmViewTreeFamilyMask\ndefines a family of view subtrees.") vacmViewTreeFamilyMask = MibTableColumn((1, 3, 6, 1, 6, 3, 16, 1, 5, 2, 1, 3), OctetString().subtype(subtypeSpec=ValueSizeConstraint(0, 16)).clone('')).setMaxAccess("readcreate") if mibBuilder.loadTexts: vacmViewTreeFamilyMask.setDescription("The bit mask which, in combination with the\ncorresponding instance of vacmViewTreeFamilySubtree,\ndefines a family of view subtrees.\n\nEach bit of this bit mask corresponds to a\nsub-identifier of vacmViewTreeFamilySubtree, with the\nmost significant bit of the i-th octet of this octet\nstring value (extended if necessary, see below)\ncorresponding to the (8*i - 7)-th sub-identifier, and\nthe least significant bit of the i-th octet of this\noctet string corresponding to the (8*i)-th\nsub-identifier, where i is in the range 1 through 16.\n\nEach bit of this bit mask specifies whether or not\nthe corresponding sub-identifiers must match when\ndetermining if an OBJECT IDENTIFIER is in this\nfamily of view subtrees; a '1' indicates that an\nexact match must occur; a '0' indicates 'wild card',\ni.e., any sub-identifier value matches.\n\nThus, the OBJECT IDENTIFIER X of an object instance\nis contained in a family of view subtrees if, for\neach sub-identifier of the value of\nvacmViewTreeFamilySubtree, either:\n\n the i-th bit of vacmViewTreeFamilyMask is 0, or\n\n the i-th sub-identifier of X is equal to the i-th\n sub-identifier of the value of\n vacmViewTreeFamilySubtree.\n\nIf the value of this bit mask is M bits long and\n\nthere are more than M sub-identifiers in the\ncorresponding instance of vacmViewTreeFamilySubtree,\nthen the bit mask is extended with 1's to be the\nrequired length.\n\nNote that when the value of this object is the\nzero-length string, this extension rule results in\na mask of all-1's being used (i.e., no 'wild card'),\nand the family of view subtrees is the one view\nsubtree uniquely identified by the corresponding\ninstance of vacmViewTreeFamilySubtree.\n\nNote that masks of length greater than zero length\ndo not need to be supported. In this case this\nobject is made read-only.") vacmViewTreeFamilyType = MibTableColumn((1, 3, 6, 1, 6, 3, 16, 1, 5, 2, 1, 4), Integer().subtype(subtypeSpec=SingleValueConstraint(1,2,)).subtype(namedValues=NamedValues(("included", 1), ("excluded", 2), )).clone(1)).setMaxAccess("readcreate") if mibBuilder.loadTexts: vacmViewTreeFamilyType.setDescription("Indicates whether the corresponding instances of\nvacmViewTreeFamilySubtree and vacmViewTreeFamilyMask\ndefine a family of view subtrees which is included in\nor excluded from the MIB view.") vacmViewTreeFamilyStorageType = MibTableColumn((1, 3, 6, 1, 6, 3, 16, 1, 5, 2, 1, 5), StorageType().clone('nonVolatile')).setMaxAccess("readcreate") if mibBuilder.loadTexts: vacmViewTreeFamilyStorageType.setDescription("The storage type for this conceptual row.\n\nConceptual rows having the value 'permanent' need not\nallow write-access to any columnar objects in the row.") vacmViewTreeFamilyStatus = MibTableColumn((1, 3, 6, 1, 6, 3, 16, 1, 5, 2, 1, 6), RowStatus()).setMaxAccess("readcreate") if mibBuilder.loadTexts: vacmViewTreeFamilyStatus.setDescription("The status of this conceptual row.\n\nThe RowStatus TC [RFC2579] requires that this\nDESCRIPTION clause states under which circumstances\nother objects in this row can be modified:\n\nThe value of this object has no effect on whether\nother objects in this conceptual row can be modified.") vacmMIBConformance = MibIdentifier((1, 3, 6, 1, 6, 3, 16, 2)) vacmMIBCompliances = MibIdentifier((1, 3, 6, 1, 6, 3, 16, 2, 1)) vacmMIBGroups = MibIdentifier((1, 3, 6, 1, 6, 3, 16, 2, 2)) # Augmentions # Groups vacmBasicGroup = ObjectGroup((1, 3, 6, 1, 6, 3, 16, 2, 2, 1)).setObjects(*(("SNMP-VIEW-BASED-ACM-MIB", "vacmViewTreeFamilyStorageType"), ("SNMP-VIEW-BASED-ACM-MIB", "vacmAccessContextMatch"), ("SNMP-VIEW-BASED-ACM-MIB", "vacmAccessReadViewName"), ("SNMP-VIEW-BASED-ACM-MIB", "vacmViewTreeFamilyType"), ("SNMP-VIEW-BASED-ACM-MIB", "vacmGroupName"), ("SNMP-VIEW-BASED-ACM-MIB", "vacmSecurityToGroupStatus"), ("SNMP-VIEW-BASED-ACM-MIB", "vacmContextName"), ("SNMP-VIEW-BASED-ACM-MIB", "vacmAccessWriteViewName"), ("SNMP-VIEW-BASED-ACM-MIB", "vacmAccessNotifyViewName"), ("SNMP-VIEW-BASED-ACM-MIB", "vacmAccessStorageType"), ("SNMP-VIEW-BASED-ACM-MIB", "vacmViewTreeFamilyStatus"), ("SNMP-VIEW-BASED-ACM-MIB", "vacmAccessStatus"), ("SNMP-VIEW-BASED-ACM-MIB", "vacmSecurityToGroupStorageType"), ("SNMP-VIEW-BASED-ACM-MIB", "vacmViewTreeFamilyMask"), ("SNMP-VIEW-BASED-ACM-MIB", "vacmViewSpinLock"), ) ) if mibBuilder.loadTexts: vacmBasicGroup.setDescription("A collection of objects providing for remote\nconfiguration of an SNMP engine which implements\n\nthe SNMP View-based Access Control Model.") # Compliances vacmMIBCompliance = ModuleCompliance((1, 3, 6, 1, 6, 3, 16, 2, 1, 1)).setObjects(*(("SNMP-VIEW-BASED-ACM-MIB", "vacmBasicGroup"), ) ) if mibBuilder.loadTexts: vacmMIBCompliance.setDescription("The compliance statement for SNMP engines which\nimplement the SNMP View-based Access Control Model\nconfiguration MIB.") # Exports # Module identity mibBuilder.exportSymbols("SNMP-VIEW-BASED-ACM-MIB", PYSNMP_MODULE_ID=snmpVacmMIB) # Objects mibBuilder.exportSymbols("SNMP-VIEW-BASED-ACM-MIB", snmpVacmMIB=snmpVacmMIB, vacmMIBObjects=vacmMIBObjects, vacmContextTable=vacmContextTable, vacmContextEntry=vacmContextEntry, vacmContextName=vacmContextName, vacmSecurityToGroupTable=vacmSecurityToGroupTable, vacmSecurityToGroupEntry=vacmSecurityToGroupEntry, vacmSecurityModel=vacmSecurityModel, vacmSecurityName=vacmSecurityName, vacmGroupName=vacmGroupName, vacmSecurityToGroupStorageType=vacmSecurityToGroupStorageType, vacmSecurityToGroupStatus=vacmSecurityToGroupStatus, vacmAccessTable=vacmAccessTable, vacmAccessEntry=vacmAccessEntry, vacmAccessContextPrefix=vacmAccessContextPrefix, vacmAccessSecurityModel=vacmAccessSecurityModel, vacmAccessSecurityLevel=vacmAccessSecurityLevel, vacmAccessContextMatch=vacmAccessContextMatch, vacmAccessReadViewName=vacmAccessReadViewName, vacmAccessWriteViewName=vacmAccessWriteViewName, vacmAccessNotifyViewName=vacmAccessNotifyViewName, vacmAccessStorageType=vacmAccessStorageType, vacmAccessStatus=vacmAccessStatus, vacmMIBViews=vacmMIBViews, vacmViewSpinLock=vacmViewSpinLock, vacmViewTreeFamilyTable=vacmViewTreeFamilyTable, vacmViewTreeFamilyEntry=vacmViewTreeFamilyEntry, vacmViewTreeFamilyViewName=vacmViewTreeFamilyViewName, vacmViewTreeFamilySubtree=vacmViewTreeFamilySubtree, vacmViewTreeFamilyMask=vacmViewTreeFamilyMask, vacmViewTreeFamilyType=vacmViewTreeFamilyType, vacmViewTreeFamilyStorageType=vacmViewTreeFamilyStorageType, vacmViewTreeFamilyStatus=vacmViewTreeFamilyStatus, vacmMIBConformance=vacmMIBConformance, vacmMIBCompliances=vacmMIBCompliances, vacmMIBGroups=vacmMIBGroups) # Groups mibBuilder.exportSymbols("SNMP-VIEW-BASED-ACM-MIB", vacmBasicGroup=vacmBasicGroup) # Compliances mibBuilder.exportSymbols("SNMP-VIEW-BASED-ACM-MIB", vacmMIBCompliance=vacmMIBCompliance)
(integer, object_identifier, octet_string) = mibBuilder.importSymbols('ASN1', 'Integer', 'ObjectIdentifier', 'OctetString') (named_values,) = mibBuilder.importSymbols('ASN1-ENUMERATION', 'NamedValues') (constraints_intersection, constraints_union, single_value_constraint, value_range_constraint, value_size_constraint) = mibBuilder.importSymbols('ASN1-REFINEMENT', 'ConstraintsIntersection', 'ConstraintsUnion', 'SingleValueConstraint', 'ValueRangeConstraint', 'ValueSizeConstraint') (snmp_admin_string, snmp_security_level, snmp_security_model) = mibBuilder.importSymbols('SNMP-FRAMEWORK-MIB', 'SnmpAdminString', 'SnmpSecurityLevel', 'SnmpSecurityModel') (module_compliance, object_group) = mibBuilder.importSymbols('SNMPv2-CONF', 'ModuleCompliance', 'ObjectGroup') (bits, integer32, module_identity, mib_identifier, mib_scalar, mib_table, mib_table_row, mib_table_column, time_ticks, snmp_modules) = mibBuilder.importSymbols('SNMPv2-SMI', 'Bits', 'Integer32', 'ModuleIdentity', 'MibIdentifier', 'MibScalar', 'MibTable', 'MibTableRow', 'MibTableColumn', 'TimeTicks', 'snmpModules') (row_status, storage_type, test_and_incr) = mibBuilder.importSymbols('SNMPv2-TC', 'RowStatus', 'StorageType', 'TestAndIncr') snmp_vacm_mib = module_identity((1, 3, 6, 1, 6, 3, 16)).setRevisions(('2002-10-16 00:00', '1999-01-20 00:00', '1997-11-20 00:00')) if mibBuilder.loadTexts: snmpVacmMIB.setOrganization('SNMPv3 Working Group') if mibBuilder.loadTexts: snmpVacmMIB.setContactInfo('WG-email: snmpv3@lists.tislabs.com\nSubscribe: majordomo@lists.tislabs.com\n In message body: subscribe snmpv3\n\nCo-Chair: Russ Mundy\n Network Associates Laboratories\npostal: 15204 Omega Drive, Suite 300\n Rockville, MD 20850-4601\n USA\nemail: mundy@tislabs.com\nphone: +1 301-947-7107\n\nCo-Chair: David Harrington\n Enterasys Networks\nPostal: 35 Industrial Way\n P. O. Box 5004\n Rochester, New Hampshire 03866-5005\n USA\nEMail: dbh@enterasys.com\nPhone: +1 603-337-2614\n\nCo-editor: Bert Wijnen\n Lucent Technologies\npostal: Schagen 33\n 3461 GL Linschoten\n Netherlands\nemail: bwijnen@lucent.com\nphone: +31-348-480-685\n\nCo-editor: Randy Presuhn\n BMC Software, Inc.\n\npostal: 2141 North First Street\n San Jose, CA 95131\n USA\nemail: randy_presuhn@bmc.com\nphone: +1 408-546-1006\n\nCo-editor: Keith McCloghrie\n Cisco Systems, Inc.\npostal: 170 West Tasman Drive\n San Jose, CA 95134-1706\n USA\nemail: kzm@cisco.com\nphone: +1-408-526-5260') if mibBuilder.loadTexts: snmpVacmMIB.setDescription('The management information definitions for the\nView-based Access Control Model for SNMP.\n\nCopyright (C) The Internet Society (2002). This\nversion of this MIB module is part of RFC 3415;\nsee the RFC itself for full legal notices.') vacm_mib_objects = mib_identifier((1, 3, 6, 1, 6, 3, 16, 1)) vacm_context_table = mib_table((1, 3, 6, 1, 6, 3, 16, 1, 1)) if mibBuilder.loadTexts: vacmContextTable.setDescription('The table of locally available contexts.\n\nThis table provides information to SNMP Command\n\nGenerator applications so that they can properly\nconfigure the vacmAccessTable to control access to\nall contexts at the SNMP entity.\n\nThis table may change dynamically if the SNMP entity\nallows that contexts are added/deleted dynamically\n(for instance when its configuration changes). Such\nchanges would happen only if the management\ninstrumentation at that SNMP entity recognizes more\n(or fewer) contexts.\n\nThe presence of entries in this table and of entries\nin the vacmAccessTable are independent. That is, a\ncontext identified by an entry in this table is not\nnecessarily referenced by any entries in the\nvacmAccessTable; and the context(s) referenced by an\nentry in the vacmAccessTable does not necessarily\ncurrently exist and thus need not be identified by an\nentry in this table.\n\nThis table must be made accessible via the default\ncontext so that Command Responder applications have\na standard way of retrieving the information.\n\nThis table is read-only. It cannot be configured via\nSNMP.') vacm_context_entry = mib_table_row((1, 3, 6, 1, 6, 3, 16, 1, 1, 1)).setIndexNames((0, 'SNMP-VIEW-BASED-ACM-MIB', 'vacmContextName')) if mibBuilder.loadTexts: vacmContextEntry.setDescription('Information about a particular context.') vacm_context_name = mib_table_column((1, 3, 6, 1, 6, 3, 16, 1, 1, 1, 1), snmp_admin_string().subtype(subtypeSpec=value_size_constraint(0, 32))).setMaxAccess('readonly') if mibBuilder.loadTexts: vacmContextName.setDescription('A human readable name identifying a particular\ncontext at a particular SNMP entity.\n\nThe empty contextName (zero length) represents the\ndefault context.') vacm_security_to_group_table = mib_table((1, 3, 6, 1, 6, 3, 16, 1, 2)) if mibBuilder.loadTexts: vacmSecurityToGroupTable.setDescription('This table maps a combination of securityModel and\nsecurityName into a groupName which is used to define\nan access control policy for a group of principals.') vacm_security_to_group_entry = mib_table_row((1, 3, 6, 1, 6, 3, 16, 1, 2, 1)).setIndexNames((0, 'SNMP-VIEW-BASED-ACM-MIB', 'vacmSecurityModel'), (0, 'SNMP-VIEW-BASED-ACM-MIB', 'vacmSecurityName')) if mibBuilder.loadTexts: vacmSecurityToGroupEntry.setDescription('An entry in this table maps the combination of a\nsecurityModel and securityName into a groupName.') vacm_security_model = mib_table_column((1, 3, 6, 1, 6, 3, 16, 1, 2, 1, 1), snmp_security_model().subtype(subtypeSpec=value_range_constraint(1, 2147483647))).setMaxAccess('noaccess') if mibBuilder.loadTexts: vacmSecurityModel.setDescription("The Security Model, by which the vacmSecurityName\nreferenced by this entry is provided.\n\nNote, this object may not take the 'any' (0) value.") vacm_security_name = mib_table_column((1, 3, 6, 1, 6, 3, 16, 1, 2, 1, 2), snmp_admin_string().subtype(subtypeSpec=value_size_constraint(1, 32))).setMaxAccess('noaccess') if mibBuilder.loadTexts: vacmSecurityName.setDescription('The securityName for the principal, represented in a\nSecurity Model independent format, which is mapped by\nthis entry to a groupName.') vacm_group_name = mib_table_column((1, 3, 6, 1, 6, 3, 16, 1, 2, 1, 3), snmp_admin_string().subtype(subtypeSpec=value_size_constraint(1, 32))).setMaxAccess('readcreate') if mibBuilder.loadTexts: vacmGroupName.setDescription('The name of the group to which this entry (e.g., the\ncombination of securityModel and securityName)\nbelongs.\n\nThis groupName is used as index into the\nvacmAccessTable to select an access control policy.\nHowever, a value in this table does not imply that an\ninstance with the value exists in table vacmAccesTable.') vacm_security_to_group_storage_type = mib_table_column((1, 3, 6, 1, 6, 3, 16, 1, 2, 1, 4), storage_type().clone('nonVolatile')).setMaxAccess('readcreate') if mibBuilder.loadTexts: vacmSecurityToGroupStorageType.setDescription("The storage type for this conceptual row.\nConceptual rows having the value 'permanent' need not\nallow write-access to any columnar objects in the row.") vacm_security_to_group_status = mib_table_column((1, 3, 6, 1, 6, 3, 16, 1, 2, 1, 5), row_status()).setMaxAccess('readcreate') if mibBuilder.loadTexts: vacmSecurityToGroupStatus.setDescription("The status of this conceptual row.\n\nUntil instances of all corresponding columns are\nappropriately configured, the value of the\n\ncorresponding instance of the vacmSecurityToGroupStatus\ncolumn is 'notReady'.\n\nIn particular, a newly created row cannot be made\nactive until a value has been set for vacmGroupName.\n\nThe RowStatus TC [RFC2579] requires that this\nDESCRIPTION clause states under which circumstances\nother objects in this row can be modified:\n\nThe value of this object has no effect on whether\nother objects in this conceptual row can be modified.") vacm_access_table = mib_table((1, 3, 6, 1, 6, 3, 16, 1, 4)) if mibBuilder.loadTexts: vacmAccessTable.setDescription("The table of access rights for groups.\n\nEach entry is indexed by a groupName, a contextPrefix,\na securityModel and a securityLevel. To determine\nwhether access is allowed, one entry from this table\nneeds to be selected and the proper viewName from that\nentry must be used for access control checking.\n\nTo select the proper entry, follow these steps:\n\n1) the set of possible matches is formed by the\n intersection of the following sets of entries:\n\n the set of entries with identical vacmGroupName\n the union of these two sets:\n - the set with identical vacmAccessContextPrefix\n - the set of entries with vacmAccessContextMatch\n value of 'prefix' and matching\n vacmAccessContextPrefix\n intersected with the union of these two sets:\n - the set of entries with identical\n vacmSecurityModel\n - the set of entries with vacmSecurityModel\n value of 'any'\n intersected with the set of entries with\n vacmAccessSecurityLevel value less than or equal\n to the requested securityLevel\n\n2) if this set has only one member, we're done\n otherwise, it comes down to deciding how to weight\n the preferences between ContextPrefixes,\n SecurityModels, and SecurityLevels as follows:\n a) if the subset of entries with securityModel\n matching the securityModel in the message is\n not empty, then discard the rest.\n b) if the subset of entries with\n vacmAccessContextPrefix matching the contextName\n in the message is not empty,\n then discard the rest\n c) discard all entries with ContextPrefixes shorter\n than the longest one remaining in the set\n d) select the entry with the highest securityLevel\n\nPlease note that for securityLevel noAuthNoPriv, all\ngroups are really equivalent since the assumption that\nthe securityName has been authenticated does not hold.") vacm_access_entry = mib_table_row((1, 3, 6, 1, 6, 3, 16, 1, 4, 1)).setIndexNames((0, 'SNMP-VIEW-BASED-ACM-MIB', 'vacmGroupName'), (0, 'SNMP-VIEW-BASED-ACM-MIB', 'vacmAccessContextPrefix'), (0, 'SNMP-VIEW-BASED-ACM-MIB', 'vacmAccessSecurityModel'), (0, 'SNMP-VIEW-BASED-ACM-MIB', 'vacmAccessSecurityLevel')) if mibBuilder.loadTexts: vacmAccessEntry.setDescription('An access right configured in the Local Configuration\nDatastore (LCD) authorizing access to an SNMP context.\n\nEntries in this table can use an instance value for\nobject vacmGroupName even if no entry in table\nvacmAccessSecurityToGroupTable has a corresponding\nvalue for object vacmGroupName.') vacm_access_context_prefix = mib_table_column((1, 3, 6, 1, 6, 3, 16, 1, 4, 1, 1), snmp_admin_string().subtype(subtypeSpec=value_size_constraint(0, 32))).setMaxAccess('noaccess') if mibBuilder.loadTexts: vacmAccessContextPrefix.setDescription("In order to gain the access rights allowed by this\nconceptual row, a contextName must match exactly\n(if the value of vacmAccessContextMatch is 'exact')\nor partially (if the value of vacmAccessContextMatch\nis 'prefix') to the value of the instance of this\nobject.") vacm_access_security_model = mib_table_column((1, 3, 6, 1, 6, 3, 16, 1, 4, 1, 2), snmp_security_model()).setMaxAccess('noaccess') if mibBuilder.loadTexts: vacmAccessSecurityModel.setDescription('In order to gain the access rights allowed by this\nconceptual row, this securityModel must be in use.') vacm_access_security_level = mib_table_column((1, 3, 6, 1, 6, 3, 16, 1, 4, 1, 3), snmp_security_level()).setMaxAccess('noaccess') if mibBuilder.loadTexts: vacmAccessSecurityLevel.setDescription('The minimum level of security required in order to\ngain the access rights allowed by this conceptual\nrow. A securityLevel of noAuthNoPriv is less than\nauthNoPriv which in turn is less than authPriv.\n\nIf multiple entries are equally indexed except for\nthis vacmAccessSecurityLevel index, then the entry\nwhich has the highest value for\nvacmAccessSecurityLevel is selected.') vacm_access_context_match = mib_table_column((1, 3, 6, 1, 6, 3, 16, 1, 4, 1, 4), integer().subtype(subtypeSpec=single_value_constraint(2, 1)).subtype(namedValues=named_values(('exact', 1), ('prefix', 2))).clone(1)).setMaxAccess('readcreate') if mibBuilder.loadTexts: vacmAccessContextMatch.setDescription('If the value of this object is exact(1), then all\nrows where the contextName exactly matches\nvacmAccessContextPrefix are selected.\n\nIf the value of this object is prefix(2), then all\nrows where the contextName whose starting octets\nexactly match vacmAccessContextPrefix are selected.\nThis allows for a simple form of wildcarding.') vacm_access_read_view_name = mib_table_column((1, 3, 6, 1, 6, 3, 16, 1, 4, 1, 5), snmp_admin_string().subtype(subtypeSpec=value_size_constraint(0, 32)).clone('')).setMaxAccess('readcreate') if mibBuilder.loadTexts: vacmAccessReadViewName.setDescription('The value of an instance of this object identifies\nthe MIB view of the SNMP context to which this\nconceptual row authorizes read access.\n\nThe identified MIB view is that one for which the\nvacmViewTreeFamilyViewName has the same value as the\ninstance of this object; if the value is the empty\nstring or if there is no active MIB view having this\nvalue of vacmViewTreeFamilyViewName, then no access\nis granted.') vacm_access_write_view_name = mib_table_column((1, 3, 6, 1, 6, 3, 16, 1, 4, 1, 6), snmp_admin_string().subtype(subtypeSpec=value_size_constraint(0, 32)).clone('')).setMaxAccess('readcreate') if mibBuilder.loadTexts: vacmAccessWriteViewName.setDescription('The value of an instance of this object identifies\nthe MIB view of the SNMP context to which this\nconceptual row authorizes write access.\n\nThe identified MIB view is that one for which the\nvacmViewTreeFamilyViewName has the same value as the\ninstance of this object; if the value is the empty\nstring or if there is no active MIB view having this\nvalue of vacmViewTreeFamilyViewName, then no access\nis granted.') vacm_access_notify_view_name = mib_table_column((1, 3, 6, 1, 6, 3, 16, 1, 4, 1, 7), snmp_admin_string().subtype(subtypeSpec=value_size_constraint(0, 32)).clone('')).setMaxAccess('readcreate') if mibBuilder.loadTexts: vacmAccessNotifyViewName.setDescription('The value of an instance of this object identifies\nthe MIB view of the SNMP context to which this\nconceptual row authorizes access for notifications.\n\nThe identified MIB view is that one for which the\nvacmViewTreeFamilyViewName has the same value as the\ninstance of this object; if the value is the empty\nstring or if there is no active MIB view having this\nvalue of vacmViewTreeFamilyViewName, then no access\nis granted.') vacm_access_storage_type = mib_table_column((1, 3, 6, 1, 6, 3, 16, 1, 4, 1, 8), storage_type().clone('nonVolatile')).setMaxAccess('readcreate') if mibBuilder.loadTexts: vacmAccessStorageType.setDescription("The storage type for this conceptual row.\n\nConceptual rows having the value 'permanent' need not\nallow write-access to any columnar objects in the row.") vacm_access_status = mib_table_column((1, 3, 6, 1, 6, 3, 16, 1, 4, 1, 9), row_status()).setMaxAccess('readcreate') if mibBuilder.loadTexts: vacmAccessStatus.setDescription('The status of this conceptual row.\n\nThe RowStatus TC [RFC2579] requires that this\nDESCRIPTION clause states under which circumstances\nother objects in this row can be modified:\n\nThe value of this object has no effect on whether\nother objects in this conceptual row can be modified.') vacm_mib_views = mib_identifier((1, 3, 6, 1, 6, 3, 16, 1, 5)) vacm_view_spin_lock = mib_scalar((1, 3, 6, 1, 6, 3, 16, 1, 5, 1), test_and_incr()).setMaxAccess('readwrite') if mibBuilder.loadTexts: vacmViewSpinLock.setDescription("An advisory lock used to allow cooperating SNMP\nCommand Generator applications to coordinate their\nuse of the Set operation in creating or modifying\nviews.\n\nWhen creating a new view or altering an existing\nview, it is important to understand the potential\ninteractions with other uses of the view. The\nvacmViewSpinLock should be retrieved. The name of\nthe view to be created should be determined to be\nunique by the SNMP Command Generator application by\nconsulting the vacmViewTreeFamilyTable. Finally,\nthe named view may be created (Set), including the\nadvisory lock.\nIf another SNMP Command Generator application has\naltered the views in the meantime, then the spin\nlock's value will have changed, and so this creation\nwill fail because it will specify the wrong value for\nthe spin lock.\n\nSince this is an advisory lock, the use of this lock\nis not enforced.") vacm_view_tree_family_table = mib_table((1, 3, 6, 1, 6, 3, 16, 1, 5, 2)) if mibBuilder.loadTexts: vacmViewTreeFamilyTable.setDescription("Locally held information about families of subtrees\nwithin MIB views.\n\nEach MIB view is defined by two sets of view subtrees:\n - the included view subtrees, and\n - the excluded view subtrees.\nEvery such view subtree, both the included and the\n\nexcluded ones, is defined in this table.\n\nTo determine if a particular object instance is in\na particular MIB view, compare the object instance's\nOBJECT IDENTIFIER with each of the MIB view's active\nentries in this table. If none match, then the\nobject instance is not in the MIB view. If one or\nmore match, then the object instance is included in,\nor excluded from, the MIB view according to the\nvalue of vacmViewTreeFamilyType in the entry whose\nvalue of vacmViewTreeFamilySubtree has the most\nsub-identifiers. If multiple entries match and have\nthe same number of sub-identifiers (when wildcarding\nis specified with the value of vacmViewTreeFamilyMask),\nthen the lexicographically greatest instance of\nvacmViewTreeFamilyType determines the inclusion or\nexclusion.\n\nAn object instance's OBJECT IDENTIFIER X matches an\nactive entry in this table when the number of\nsub-identifiers in X is at least as many as in the\nvalue of vacmViewTreeFamilySubtree for the entry,\nand each sub-identifier in the value of\nvacmViewTreeFamilySubtree matches its corresponding\nsub-identifier in X. Two sub-identifiers match\neither if the corresponding bit of the value of\nvacmViewTreeFamilyMask for the entry is zero (the\n'wild card' value), or if they are equal.\n\nA 'family' of subtrees is the set of subtrees defined\nby a particular combination of values of\nvacmViewTreeFamilySubtree and vacmViewTreeFamilyMask.\n\nIn the case where no 'wild card' is defined in the\nvacmViewTreeFamilyMask, the family of subtrees reduces\nto a single subtree.\n\nWhen creating or changing MIB views, an SNMP Command\nGenerator application should utilize the\nvacmViewSpinLock to try to avoid collisions. See\nDESCRIPTION clause of vacmViewSpinLock.\n\nWhen creating MIB views, it is strongly advised that\nfirst the 'excluded' vacmViewTreeFamilyEntries are\ncreated and then the 'included' entries.\n\nWhen deleting MIB views, it is strongly advised that\nfirst the 'included' vacmViewTreeFamilyEntries are\n\ndeleted and then the 'excluded' entries.\n\nIf a create for an entry for instance-level access\ncontrol is received and the implementation does not\nsupport instance-level granularity, then an\ninconsistentName error must be returned.") vacm_view_tree_family_entry = mib_table_row((1, 3, 6, 1, 6, 3, 16, 1, 5, 2, 1)).setIndexNames((0, 'SNMP-VIEW-BASED-ACM-MIB', 'vacmViewTreeFamilyViewName'), (0, 'SNMP-VIEW-BASED-ACM-MIB', 'vacmViewTreeFamilySubtree')) if mibBuilder.loadTexts: vacmViewTreeFamilyEntry.setDescription("Information on a particular family of view subtrees\nincluded in or excluded from a particular SNMP\ncontext's MIB view.\n\nImplementations must not restrict the number of\nfamilies of view subtrees for a given MIB view,\nexcept as dictated by resource constraints on the\noverall number of entries in the\nvacmViewTreeFamilyTable.\n\nIf no conceptual rows exist in this table for a given\nMIB view (viewName), that view may be thought of as\nconsisting of the empty set of view subtrees.") vacm_view_tree_family_view_name = mib_table_column((1, 3, 6, 1, 6, 3, 16, 1, 5, 2, 1, 1), snmp_admin_string().subtype(subtypeSpec=value_size_constraint(1, 32))).setMaxAccess('noaccess') if mibBuilder.loadTexts: vacmViewTreeFamilyViewName.setDescription('The human readable name for a family of view subtrees.') vacm_view_tree_family_subtree = mib_table_column((1, 3, 6, 1, 6, 3, 16, 1, 5, 2, 1, 2), object_identifier()).setMaxAccess('noaccess') if mibBuilder.loadTexts: vacmViewTreeFamilySubtree.setDescription('The MIB subtree which when combined with the\ncorresponding instance of vacmViewTreeFamilyMask\ndefines a family of view subtrees.') vacm_view_tree_family_mask = mib_table_column((1, 3, 6, 1, 6, 3, 16, 1, 5, 2, 1, 3), octet_string().subtype(subtypeSpec=value_size_constraint(0, 16)).clone('')).setMaxAccess('readcreate') if mibBuilder.loadTexts: vacmViewTreeFamilyMask.setDescription("The bit mask which, in combination with the\ncorresponding instance of vacmViewTreeFamilySubtree,\ndefines a family of view subtrees.\n\nEach bit of this bit mask corresponds to a\nsub-identifier of vacmViewTreeFamilySubtree, with the\nmost significant bit of the i-th octet of this octet\nstring value (extended if necessary, see below)\ncorresponding to the (8*i - 7)-th sub-identifier, and\nthe least significant bit of the i-th octet of this\noctet string corresponding to the (8*i)-th\nsub-identifier, where i is in the range 1 through 16.\n\nEach bit of this bit mask specifies whether or not\nthe corresponding sub-identifiers must match when\ndetermining if an OBJECT IDENTIFIER is in this\nfamily of view subtrees; a '1' indicates that an\nexact match must occur; a '0' indicates 'wild card',\ni.e., any sub-identifier value matches.\n\nThus, the OBJECT IDENTIFIER X of an object instance\nis contained in a family of view subtrees if, for\neach sub-identifier of the value of\nvacmViewTreeFamilySubtree, either:\n\n the i-th bit of vacmViewTreeFamilyMask is 0, or\n\n the i-th sub-identifier of X is equal to the i-th\n sub-identifier of the value of\n vacmViewTreeFamilySubtree.\n\nIf the value of this bit mask is M bits long and\n\nthere are more than M sub-identifiers in the\ncorresponding instance of vacmViewTreeFamilySubtree,\nthen the bit mask is extended with 1's to be the\nrequired length.\n\nNote that when the value of this object is the\nzero-length string, this extension rule results in\na mask of all-1's being used (i.e., no 'wild card'),\nand the family of view subtrees is the one view\nsubtree uniquely identified by the corresponding\ninstance of vacmViewTreeFamilySubtree.\n\nNote that masks of length greater than zero length\ndo not need to be supported. In this case this\nobject is made read-only.") vacm_view_tree_family_type = mib_table_column((1, 3, 6, 1, 6, 3, 16, 1, 5, 2, 1, 4), integer().subtype(subtypeSpec=single_value_constraint(1, 2)).subtype(namedValues=named_values(('included', 1), ('excluded', 2))).clone(1)).setMaxAccess('readcreate') if mibBuilder.loadTexts: vacmViewTreeFamilyType.setDescription('Indicates whether the corresponding instances of\nvacmViewTreeFamilySubtree and vacmViewTreeFamilyMask\ndefine a family of view subtrees which is included in\nor excluded from the MIB view.') vacm_view_tree_family_storage_type = mib_table_column((1, 3, 6, 1, 6, 3, 16, 1, 5, 2, 1, 5), storage_type().clone('nonVolatile')).setMaxAccess('readcreate') if mibBuilder.loadTexts: vacmViewTreeFamilyStorageType.setDescription("The storage type for this conceptual row.\n\nConceptual rows having the value 'permanent' need not\nallow write-access to any columnar objects in the row.") vacm_view_tree_family_status = mib_table_column((1, 3, 6, 1, 6, 3, 16, 1, 5, 2, 1, 6), row_status()).setMaxAccess('readcreate') if mibBuilder.loadTexts: vacmViewTreeFamilyStatus.setDescription('The status of this conceptual row.\n\nThe RowStatus TC [RFC2579] requires that this\nDESCRIPTION clause states under which circumstances\nother objects in this row can be modified:\n\nThe value of this object has no effect on whether\nother objects in this conceptual row can be modified.') vacm_mib_conformance = mib_identifier((1, 3, 6, 1, 6, 3, 16, 2)) vacm_mib_compliances = mib_identifier((1, 3, 6, 1, 6, 3, 16, 2, 1)) vacm_mib_groups = mib_identifier((1, 3, 6, 1, 6, 3, 16, 2, 2)) vacm_basic_group = object_group((1, 3, 6, 1, 6, 3, 16, 2, 2, 1)).setObjects(*(('SNMP-VIEW-BASED-ACM-MIB', 'vacmViewTreeFamilyStorageType'), ('SNMP-VIEW-BASED-ACM-MIB', 'vacmAccessContextMatch'), ('SNMP-VIEW-BASED-ACM-MIB', 'vacmAccessReadViewName'), ('SNMP-VIEW-BASED-ACM-MIB', 'vacmViewTreeFamilyType'), ('SNMP-VIEW-BASED-ACM-MIB', 'vacmGroupName'), ('SNMP-VIEW-BASED-ACM-MIB', 'vacmSecurityToGroupStatus'), ('SNMP-VIEW-BASED-ACM-MIB', 'vacmContextName'), ('SNMP-VIEW-BASED-ACM-MIB', 'vacmAccessWriteViewName'), ('SNMP-VIEW-BASED-ACM-MIB', 'vacmAccessNotifyViewName'), ('SNMP-VIEW-BASED-ACM-MIB', 'vacmAccessStorageType'), ('SNMP-VIEW-BASED-ACM-MIB', 'vacmViewTreeFamilyStatus'), ('SNMP-VIEW-BASED-ACM-MIB', 'vacmAccessStatus'), ('SNMP-VIEW-BASED-ACM-MIB', 'vacmSecurityToGroupStorageType'), ('SNMP-VIEW-BASED-ACM-MIB', 'vacmViewTreeFamilyMask'), ('SNMP-VIEW-BASED-ACM-MIB', 'vacmViewSpinLock'))) if mibBuilder.loadTexts: vacmBasicGroup.setDescription('A collection of objects providing for remote\nconfiguration of an SNMP engine which implements\n\nthe SNMP View-based Access Control Model.') vacm_mib_compliance = module_compliance((1, 3, 6, 1, 6, 3, 16, 2, 1, 1)).setObjects(*(('SNMP-VIEW-BASED-ACM-MIB', 'vacmBasicGroup'),)) if mibBuilder.loadTexts: vacmMIBCompliance.setDescription('The compliance statement for SNMP engines which\nimplement the SNMP View-based Access Control Model\nconfiguration MIB.') mibBuilder.exportSymbols('SNMP-VIEW-BASED-ACM-MIB', PYSNMP_MODULE_ID=snmpVacmMIB) mibBuilder.exportSymbols('SNMP-VIEW-BASED-ACM-MIB', snmpVacmMIB=snmpVacmMIB, vacmMIBObjects=vacmMIBObjects, vacmContextTable=vacmContextTable, vacmContextEntry=vacmContextEntry, vacmContextName=vacmContextName, vacmSecurityToGroupTable=vacmSecurityToGroupTable, vacmSecurityToGroupEntry=vacmSecurityToGroupEntry, vacmSecurityModel=vacmSecurityModel, vacmSecurityName=vacmSecurityName, vacmGroupName=vacmGroupName, vacmSecurityToGroupStorageType=vacmSecurityToGroupStorageType, vacmSecurityToGroupStatus=vacmSecurityToGroupStatus, vacmAccessTable=vacmAccessTable, vacmAccessEntry=vacmAccessEntry, vacmAccessContextPrefix=vacmAccessContextPrefix, vacmAccessSecurityModel=vacmAccessSecurityModel, vacmAccessSecurityLevel=vacmAccessSecurityLevel, vacmAccessContextMatch=vacmAccessContextMatch, vacmAccessReadViewName=vacmAccessReadViewName, vacmAccessWriteViewName=vacmAccessWriteViewName, vacmAccessNotifyViewName=vacmAccessNotifyViewName, vacmAccessStorageType=vacmAccessStorageType, vacmAccessStatus=vacmAccessStatus, vacmMIBViews=vacmMIBViews, vacmViewSpinLock=vacmViewSpinLock, vacmViewTreeFamilyTable=vacmViewTreeFamilyTable, vacmViewTreeFamilyEntry=vacmViewTreeFamilyEntry, vacmViewTreeFamilyViewName=vacmViewTreeFamilyViewName, vacmViewTreeFamilySubtree=vacmViewTreeFamilySubtree, vacmViewTreeFamilyMask=vacmViewTreeFamilyMask, vacmViewTreeFamilyType=vacmViewTreeFamilyType, vacmViewTreeFamilyStorageType=vacmViewTreeFamilyStorageType, vacmViewTreeFamilyStatus=vacmViewTreeFamilyStatus, vacmMIBConformance=vacmMIBConformance, vacmMIBCompliances=vacmMIBCompliances, vacmMIBGroups=vacmMIBGroups) mibBuilder.exportSymbols('SNMP-VIEW-BASED-ACM-MIB', vacmBasicGroup=vacmBasicGroup) mibBuilder.exportSymbols('SNMP-VIEW-BASED-ACM-MIB', vacmMIBCompliance=vacmMIBCompliance)
class Solution(object): def partition(self, s): """ :type s: str :rtype: List[List[str]] """ return [[s[:i]]+rest for i in xrange(1,len(s)+1) if s[:i]==s[:i][::-1] for rest in self.partition(s[i:])] or [[]]
class Solution(object): def partition(self, s): """ :type s: str :rtype: List[List[str]] """ return [[s[:i]] + rest for i in xrange(1, len(s) + 1) if s[:i] == s[:i][::-1] for rest in self.partition(s[i:])] or [[]]
W = 8 N = 4 wi = [3, 3, 5, 6] ci = [3, 5, 10, 14] d = [[0] * (W + 1) for i in range(N + 1)] for i in range(1, N + 1): for w in range(1, W + 1): if wi[i-1] > w: d[i][w] = d[i-1][w] else: d[i][w] = max(d[i-1][w], d[i-1][w-wi[i-1]]+ci[i-1]) print('\n'.join([' '.join(map(str, d[i])) for i in range(N + 1)])) # Python3 program to find maximum # achievable value with a knapsack # of weight W and multiple instances allowed. # Returns the maximum value # with knapsack of W capacity def unboundedKnapsack(W, n, val, wt): # dp[i] is going to store maximum # value with knapsack capacity i. dp = [0 for i in range(W + 1)] ans = 0 # Fill dp[] using above recursive formula for i in range(W + 1): for j in range(n): if (wt[j] <= i): dp[i] = max(dp[i], dp[i - wt[j]] + val[j]) print(dp) return dp[W] # Driver program W = 5 val = [10] wt = [2] n = len(val) print(unboundedKnapsack(W, n, val, wt)) # This code is contributed by Anant Agarwal.
w = 8 n = 4 wi = [3, 3, 5, 6] ci = [3, 5, 10, 14] d = [[0] * (W + 1) for i in range(N + 1)] for i in range(1, N + 1): for w in range(1, W + 1): if wi[i - 1] > w: d[i][w] = d[i - 1][w] else: d[i][w] = max(d[i - 1][w], d[i - 1][w - wi[i - 1]] + ci[i - 1]) print('\n'.join([' '.join(map(str, d[i])) for i in range(N + 1)])) def unbounded_knapsack(W, n, val, wt): dp = [0 for i in range(W + 1)] ans = 0 for i in range(W + 1): for j in range(n): if wt[j] <= i: dp[i] = max(dp[i], dp[i - wt[j]] + val[j]) print(dp) return dp[W] w = 5 val = [10] wt = [2] n = len(val) print(unbounded_knapsack(W, n, val, wt))
def foo(i): print(i) for k in [1,2,3,4,5]: foo(k)
def foo(i): print(i) for k in [1, 2, 3, 4, 5]: foo(k)
class Solution: def minOperations(self, n: int) -> int: if n % 2 == 1: n_2 = n // 2 return n_2 ** 2 + n_2 else: n_2 = n // 2 return n_2 ** 2
class Solution: def min_operations(self, n: int) -> int: if n % 2 == 1: n_2 = n // 2 return n_2 ** 2 + n_2 else: n_2 = n // 2 return n_2 ** 2
class FrameRole(object): def __init__(self, source, description): assert(isinstance(source, str)) assert(isinstance(description, str)) self.__source = source self.__description = description @property def Source(self): return self.__source @property def Description(self): return self.__description
class Framerole(object): def __init__(self, source, description): assert isinstance(source, str) assert isinstance(description, str) self.__source = source self.__description = description @property def source(self): return self.__source @property def description(self): return self.__description
def f(x): if x == 0: return 0 return x + f(x - 1) print(f(3)) # Output is 6
def f(x): if x == 0: return 0 return x + f(x - 1) print(f(3))
def M(): i=0 while i<6: j=0 while j<5: if (j==0 or j==4) or (i<3 and (i-j==0 or i+j==4)): print("*",end=" ") else: print(end=" ") j+=1 i+=1 print()
def m(): i = 0 while i < 6: j = 0 while j < 5: if (j == 0 or j == 4) or (i < 3 and (i - j == 0 or i + j == 4)): print('*', end=' ') else: print(end=' ') j += 1 i += 1 print()
class Vaca: cola = True da_leche = False camina = False def __init__(self, nombre, color, cola): self._nombre = nombre self.color = color self.cola = cola def info(self): print("#"*30) print("Nombre :", self._nombre) print("Color:", self.color) print("Cola:", ("Con cola" if(self.cola) else "Sin cola")) print(("Esta caminando" if(self.camina) else "Esta detenida")) print("#"*30) def caminar(self): self.camina = True def detenerse(self): self.camina = False muu = Vaca("muu", "amarilla", True) muu._nombre = "cambio de nombre" muu.caminar() muu.info() clara_bella = Vaca("clara bella", "blanca", False) muu.caminar() muu.detenerse() clara_bella.info()
class Vaca: cola = True da_leche = False camina = False def __init__(self, nombre, color, cola): self._nombre = nombre self.color = color self.cola = cola def info(self): print('#' * 30) print('Nombre :', self._nombre) print('Color:', self.color) print('Cola:', 'Con cola' if self.cola else 'Sin cola') print('Esta caminando' if self.camina else 'Esta detenida') print('#' * 30) def caminar(self): self.camina = True def detenerse(self): self.camina = False muu = vaca('muu', 'amarilla', True) muu._nombre = 'cambio de nombre' muu.caminar() muu.info() clara_bella = vaca('clara bella', 'blanca', False) muu.caminar() muu.detenerse() clara_bella.info()
#This program says Hello and asks for my name print('Hello World') print('What\'s your name?')#ask for their name myName=input() print('Nice to meet you,'+ myName) print('your length name is : '+str(len(myName))) print('Your age?')#ask for their age myAge=input() print('You will be '+str(int(myAge)+1)+' in a year.')
print('Hello World') print("What's your name?") my_name = input() print('Nice to meet you,' + myName) print('your length name is : ' + str(len(myName))) print('Your age?') my_age = input() print('You will be ' + str(int(myAge) + 1) + ' in a year.')
STATS = [ { "num_node_expansions": 8573, "plan_length": 112, "search_time": 9.18, "total_time": 9.18 }, { "num_node_expansions": 9432, "plan_length": 109, "search_time": 10.41, "total_time": 10.41 }, { "num_node_expansions": 11788, "plan_length": 109, "search_time": 16.73, "total_time": 16.73 }, { "num_node_expansions": 13267, "plan_length": 104, "search_time": 19.14, "total_time": 19.14 }, { "num_node_expansions": 10980, "plan_length": 117, "search_time": 18.89, "total_time": 18.89 }, { "num_node_expansions": 16049, "plan_length": 125, "search_time": 11.02, "total_time": 11.02 }, { "num_node_expansions": 11133, "plan_length": 115, "search_time": 6.61, "total_time": 6.61 }, { "num_node_expansions": 15591, "plan_length": 118, "search_time": 11.84, "total_time": 11.84 }, { "num_node_expansions": 10616, "plan_length": 132, "search_time": 6.75, "total_time": 6.75 }, { "num_node_expansions": 33633, "plan_length": 143, "search_time": 18.68, "total_time": 18.68 }, { "num_node_expansions": 3525, "plan_length": 131, "search_time": 23.75, "total_time": 23.75 }, { "num_node_expansions": 17952, "plan_length": 140, "search_time": 25.3, "total_time": 25.3 }, { "num_node_expansions": 7168, "plan_length": 146, "search_time": 5.53, "total_time": 5.53 }, { "num_node_expansions": 17825, "plan_length": 140, "search_time": 23.5, "total_time": 23.5 }, { "num_node_expansions": 16370, "plan_length": 133, "search_time": 12.0, "total_time": 12.0 } ] num_timeouts = 40 num_timeouts = 0 num_problems = 55
stats = [{'num_node_expansions': 8573, 'plan_length': 112, 'search_time': 9.18, 'total_time': 9.18}, {'num_node_expansions': 9432, 'plan_length': 109, 'search_time': 10.41, 'total_time': 10.41}, {'num_node_expansions': 11788, 'plan_length': 109, 'search_time': 16.73, 'total_time': 16.73}, {'num_node_expansions': 13267, 'plan_length': 104, 'search_time': 19.14, 'total_time': 19.14}, {'num_node_expansions': 10980, 'plan_length': 117, 'search_time': 18.89, 'total_time': 18.89}, {'num_node_expansions': 16049, 'plan_length': 125, 'search_time': 11.02, 'total_time': 11.02}, {'num_node_expansions': 11133, 'plan_length': 115, 'search_time': 6.61, 'total_time': 6.61}, {'num_node_expansions': 15591, 'plan_length': 118, 'search_time': 11.84, 'total_time': 11.84}, {'num_node_expansions': 10616, 'plan_length': 132, 'search_time': 6.75, 'total_time': 6.75}, {'num_node_expansions': 33633, 'plan_length': 143, 'search_time': 18.68, 'total_time': 18.68}, {'num_node_expansions': 3525, 'plan_length': 131, 'search_time': 23.75, 'total_time': 23.75}, {'num_node_expansions': 17952, 'plan_length': 140, 'search_time': 25.3, 'total_time': 25.3}, {'num_node_expansions': 7168, 'plan_length': 146, 'search_time': 5.53, 'total_time': 5.53}, {'num_node_expansions': 17825, 'plan_length': 140, 'search_time': 23.5, 'total_time': 23.5}, {'num_node_expansions': 16370, 'plan_length': 133, 'search_time': 12.0, 'total_time': 12.0}] num_timeouts = 40 num_timeouts = 0 num_problems = 55
#https://practice.geeksforgeeks.org/problems/subarray-with-0-sum-1587115621/1 #Complete this function def subArrayExists(arr,n): ##Your code here #Return true or false sum=0 store =set() for i in range(n): sum+=arr[i] if sum==0 or sum in store: return 1 store.add(sum) return 0 #{ # Driver Code Starts #Initial Template for Python 3 def main(): T=int(input()) while(T>0): n=int(input()) arr=[int(x) for x in input().strip().split()] if(subArrayExists(arr,n)): print("Yes") else: print("No") T-=1 if __name__=="__main__": main() # } Driver Code Ends
def sub_array_exists(arr, n): sum = 0 store = set() for i in range(n): sum += arr[i] if sum == 0 or sum in store: return 1 store.add(sum) return 0 def main(): t = int(input()) while T > 0: n = int(input()) arr = [int(x) for x in input().strip().split()] if sub_array_exists(arr, n): print('Yes') else: print('No') t -= 1 if __name__ == '__main__': main()
def someAction_Decorator(func): def wrapper(*args, **kwargs): func(*args, **kwargs) print("something else") return wrapper class someAction_ClassDecorator(object): def __init__(self, func): self.func = func def __call__(self, *args, **kwargs): self.func(self, *args, **kwargs) print("something else") class ConcreteObject(object): @someAction_Decorator def someAction(self): print("something") class ConcreteObject2(object): @someAction_ClassDecorator def someAction(self): print("something") class ConcreteObject3(object): def someAction(self): print("something") if __name__ == "__main__": obj = ConcreteObject() obj.someAction() obj2 = ConcreteObject2() obj2.someAction()
def some_action__decorator(func): def wrapper(*args, **kwargs): func(*args, **kwargs) print('something else') return wrapper class Someaction_Classdecorator(object): def __init__(self, func): self.func = func def __call__(self, *args, **kwargs): self.func(self, *args, **kwargs) print('something else') class Concreteobject(object): @someAction_Decorator def some_action(self): print('something') class Concreteobject2(object): @someAction_ClassDecorator def some_action(self): print('something') class Concreteobject3(object): def some_action(self): print('something') if __name__ == '__main__': obj = concrete_object() obj.someAction() obj2 = concrete_object2() obj2.someAction()
# # PySNMP MIB module HIRSCHMANN-MMP4-ROUTING-MIB (http://snmplabs.com/pysmi) # ASN.1 source file:///Users/davwang4/Dev/mibs.snmplabs.com/asn1/HIRSCHMANN-MMP4-ROUTING-MIB # Produced by pysmi-0.3.4 at Mon Apr 29 19:18:18 2019 # On host DAVWANG4-M-1475 platform Darwin version 18.5.0 by user davwang4 # Using Python version 3.7.3 (default, Mar 27 2019, 09:23:15) # Integer, OctetString, ObjectIdentifier = mibBuilder.importSymbols("ASN1", "Integer", "OctetString", "ObjectIdentifier") NamedValues, = mibBuilder.importSymbols("ASN1-ENUMERATION", "NamedValues") ValueRangeConstraint, ValueSizeConstraint, SingleValueConstraint, ConstraintsIntersection, ConstraintsUnion = mibBuilder.importSymbols("ASN1-REFINEMENT", "ValueRangeConstraint", "ValueSizeConstraint", "SingleValueConstraint", "ConstraintsIntersection", "ConstraintsUnion") hmPlatform4, = mibBuilder.importSymbols("HIRSCHMANN-MMP4-BASICL2-MIB", "hmPlatform4") ospfVirtIfEntry, ospfIfEntry = mibBuilder.importSymbols("OSPF-MIB", "ospfVirtIfEntry", "ospfIfEntry") rip2IfConfEntry, = mibBuilder.importSymbols("RIPv2-MIB", "rip2IfConfEntry") ModuleCompliance, NotificationGroup = mibBuilder.importSymbols("SNMPv2-CONF", "ModuleCompliance", "NotificationGroup") Gauge32, TimeTicks, MibIdentifier, Counter32, ModuleIdentity, MibScalar, MibTable, MibTableRow, MibTableColumn, Unsigned32, Bits, Integer32, NotificationType, Counter64, IpAddress, iso, ObjectIdentity = mibBuilder.importSymbols("SNMPv2-SMI", "Gauge32", "TimeTicks", "MibIdentifier", "Counter32", "ModuleIdentity", "MibScalar", "MibTable", "MibTableRow", "MibTableColumn", "Unsigned32", "Bits", "Integer32", "NotificationType", "Counter64", "IpAddress", "iso", "ObjectIdentity") RowStatus, DisplayString, TextualConvention, MacAddress, TruthValue = mibBuilder.importSymbols("SNMPv2-TC", "RowStatus", "DisplayString", "TextualConvention", "MacAddress", "TruthValue") hmPlatform4Routing = ModuleIdentity((1, 3, 6, 1, 4, 1, 248, 15, 2)) hmPlatform4Routing.setRevisions(('2005-08-18 12:00', '2003-04-02 17:00',)) if mibBuilder.loadTexts: hmPlatform4Routing.setLastUpdated('200508181200Z') if mibBuilder.loadTexts: hmPlatform4Routing.setOrganization('Hirschmann Automation and Control GmbH') hmAgentSwitchArpGroup = MibIdentifier((1, 3, 6, 1, 4, 1, 248, 15, 2, 1)) hmAgentSwitchArpAgeoutTime = MibScalar((1, 3, 6, 1, 4, 1, 248, 15, 2, 1, 1), Integer32().subtype(subtypeSpec=ValueRangeConstraint(15, 21600)).clone(1200)).setMaxAccess("readwrite") if mibBuilder.loadTexts: hmAgentSwitchArpAgeoutTime.setStatus('current') hmAgentSwitchArpResponseTime = MibScalar((1, 3, 6, 1, 4, 1, 248, 15, 2, 1, 2), Integer32().subtype(subtypeSpec=ValueRangeConstraint(1, 10))).setMaxAccess("readwrite") if mibBuilder.loadTexts: hmAgentSwitchArpResponseTime.setStatus('current') hmAgentSwitchArpMaxRetries = MibScalar((1, 3, 6, 1, 4, 1, 248, 15, 2, 1, 3), Integer32().subtype(subtypeSpec=ValueRangeConstraint(0, 10))).setMaxAccess("readwrite") if mibBuilder.loadTexts: hmAgentSwitchArpMaxRetries.setStatus('current') hmAgentSwitchArpCacheSize = MibScalar((1, 3, 6, 1, 4, 1, 248, 15, 2, 1, 4), Integer32()).setMaxAccess("readwrite") if mibBuilder.loadTexts: hmAgentSwitchArpCacheSize.setStatus('current') hmAgentSwitchArpDynamicRenew = MibScalar((1, 3, 6, 1, 4, 1, 248, 15, 2, 1, 5), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2))).clone(namedValues=NamedValues(("enable", 1), ("disable", 2))).clone('enable')).setMaxAccess("readwrite") if mibBuilder.loadTexts: hmAgentSwitchArpDynamicRenew.setStatus('current') hmAgentSwitchArpTotalEntryCountCurrent = MibScalar((1, 3, 6, 1, 4, 1, 248, 15, 2, 1, 6), Gauge32()).setMaxAccess("readonly") if mibBuilder.loadTexts: hmAgentSwitchArpTotalEntryCountCurrent.setStatus('current') hmAgentSwitchArpTotalEntryCountPeak = MibScalar((1, 3, 6, 1, 4, 1, 248, 15, 2, 1, 7), Gauge32()).setMaxAccess("readonly") if mibBuilder.loadTexts: hmAgentSwitchArpTotalEntryCountPeak.setStatus('current') hmAgentSwitchArpStaticEntryCountCurrent = MibScalar((1, 3, 6, 1, 4, 1, 248, 15, 2, 1, 8), Gauge32()).setMaxAccess("readonly") if mibBuilder.loadTexts: hmAgentSwitchArpStaticEntryCountCurrent.setStatus('current') hmAgentSwitchArpStaticEntryCountMax = MibScalar((1, 3, 6, 1, 4, 1, 248, 15, 2, 1, 9), Integer32()).setMaxAccess("readonly") if mibBuilder.loadTexts: hmAgentSwitchArpStaticEntryCountMax.setStatus('current') hmAgentSwitchArpTable = MibTable((1, 3, 6, 1, 4, 1, 248, 15, 2, 1, 10), ) if mibBuilder.loadTexts: hmAgentSwitchArpTable.setStatus('current') hmAgentSwitchArpEntry = MibTableRow((1, 3, 6, 1, 4, 1, 248, 15, 2, 1, 10, 1), ).setIndexNames((0, "HIRSCHMANN-MMP4-ROUTING-MIB", "hmAgentSwitchArpIpAddress")) if mibBuilder.loadTexts: hmAgentSwitchArpEntry.setStatus('current') hmAgentSwitchArpAge = MibTableColumn((1, 3, 6, 1, 4, 1, 248, 15, 2, 1, 10, 1, 1), TimeTicks()).setMaxAccess("readonly") if mibBuilder.loadTexts: hmAgentSwitchArpAge.setStatus('current') hmAgentSwitchArpIpAddress = MibTableColumn((1, 3, 6, 1, 4, 1, 248, 15, 2, 1, 10, 1, 2), IpAddress()).setMaxAccess("readonly") if mibBuilder.loadTexts: hmAgentSwitchArpIpAddress.setStatus('current') hmAgentSwitchArpMacAddress = MibTableColumn((1, 3, 6, 1, 4, 1, 248, 15, 2, 1, 10, 1, 3), MacAddress()).setMaxAccess("readcreate") if mibBuilder.loadTexts: hmAgentSwitchArpMacAddress.setStatus('current') hmAgentSwitchArpInterface = MibTableColumn((1, 3, 6, 1, 4, 1, 248, 15, 2, 1, 10, 1, 4), Integer32()).setMaxAccess("readonly") if mibBuilder.loadTexts: hmAgentSwitchArpInterface.setStatus('current') hmAgentSwitchArpType = MibTableColumn((1, 3, 6, 1, 4, 1, 248, 15, 2, 1, 10, 1, 5), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2, 3, 4))).clone(namedValues=NamedValues(("local", 1), ("gateway", 2), ("static", 3), ("dynamic", 4)))).setMaxAccess("readonly") if mibBuilder.loadTexts: hmAgentSwitchArpType.setStatus('current') hmAgentSwitchArpStatus = MibTableColumn((1, 3, 6, 1, 4, 1, 248, 15, 2, 1, 10, 1, 6), RowStatus()).setMaxAccess("readwrite") if mibBuilder.loadTexts: hmAgentSwitchArpStatus.setStatus('current') hmAgentSwitchArpSparseLearn = MibScalar((1, 3, 6, 1, 4, 1, 248, 15, 2, 1, 11), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2))).clone(namedValues=NamedValues(("enable", 1), ("disable", 2))).clone('disable')).setMaxAccess("readwrite") if mibBuilder.loadTexts: hmAgentSwitchArpSparseLearn.setStatus('current') hmAgentSwitchIpGroup = MibIdentifier((1, 3, 6, 1, 4, 1, 248, 15, 2, 2)) hmAgentSwitchIpRoutingMode = MibScalar((1, 3, 6, 1, 4, 1, 248, 15, 2, 2, 1), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2))).clone(namedValues=NamedValues(("enable", 1), ("disable", 2)))).setMaxAccess("readwrite") if mibBuilder.loadTexts: hmAgentSwitchIpRoutingMode.setStatus('current') hmAgentSwitchIpVRRPMode = MibScalar((1, 3, 6, 1, 4, 1, 248, 15, 2, 2, 2), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2))).clone(namedValues=NamedValues(("enable", 1), ("disable", 2)))).setMaxAccess("readwrite") if mibBuilder.loadTexts: hmAgentSwitchIpVRRPMode.setStatus('current') hmAgentSwitchIpInterfaceTable = MibTable((1, 3, 6, 1, 4, 1, 248, 15, 2, 2, 3), ) if mibBuilder.loadTexts: hmAgentSwitchIpInterfaceTable.setStatus('current') hmAgentSwitchIpInterfaceEntry = MibTableRow((1, 3, 6, 1, 4, 1, 248, 15, 2, 2, 3, 1), ).setIndexNames((0, "HIRSCHMANN-MMP4-ROUTING-MIB", "hmAgentSwitchIpInterfaceIfIndex")) if mibBuilder.loadTexts: hmAgentSwitchIpInterfaceEntry.setStatus('current') hmAgentSwitchIpInterfaceIfIndex = MibTableColumn((1, 3, 6, 1, 4, 1, 248, 15, 2, 2, 3, 1, 1), Integer32()).setMaxAccess("readonly") if mibBuilder.loadTexts: hmAgentSwitchIpInterfaceIfIndex.setStatus('current') hmAgentSwitchIpInterfaceIpAddress = MibTableColumn((1, 3, 6, 1, 4, 1, 248, 15, 2, 2, 3, 1, 2), IpAddress()).setMaxAccess("readwrite") if mibBuilder.loadTexts: hmAgentSwitchIpInterfaceIpAddress.setStatus('current') hmAgentSwitchIpInterfaceNetMask = MibTableColumn((1, 3, 6, 1, 4, 1, 248, 15, 2, 2, 3, 1, 3), IpAddress()).setMaxAccess("readwrite") if mibBuilder.loadTexts: hmAgentSwitchIpInterfaceNetMask.setStatus('current') hmAgentSwitchIpInterfaceClearIp = MibTableColumn((1, 3, 6, 1, 4, 1, 248, 15, 2, 2, 3, 1, 4), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2))).clone(namedValues=NamedValues(("enable", 1), ("disable", 2)))).setMaxAccess("readwrite") if mibBuilder.loadTexts: hmAgentSwitchIpInterfaceClearIp.setStatus('current') hmAgentSwitchIpInterfaceRoutingMode = MibTableColumn((1, 3, 6, 1, 4, 1, 248, 15, 2, 2, 3, 1, 5), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2))).clone(namedValues=NamedValues(("enable", 1), ("disable", 2)))).setMaxAccess("readwrite") if mibBuilder.loadTexts: hmAgentSwitchIpInterfaceRoutingMode.setStatus('current') hmAgentSwitchIpInterfaceProxyARPMode = MibTableColumn((1, 3, 6, 1, 4, 1, 248, 15, 2, 2, 3, 1, 6), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2))).clone(namedValues=NamedValues(("enable", 1), ("disable", 2))).clone('disable')).setMaxAccess("readwrite") if mibBuilder.loadTexts: hmAgentSwitchIpInterfaceProxyARPMode.setStatus('current') hmAgentSwitchIpInterfaceMtuValue = MibTableColumn((1, 3, 6, 1, 4, 1, 248, 15, 2, 2, 3, 1, 7), Unsigned32().subtype(subtypeSpec=ConstraintsUnion(ValueRangeConstraint(0, 0), ValueRangeConstraint(68, 9000), ))).setMaxAccess("readwrite") if mibBuilder.loadTexts: hmAgentSwitchIpInterfaceMtuValue.setStatus('current') hmAgentSwitchIpInterfaceSlotNum = MibTableColumn((1, 3, 6, 1, 4, 1, 248, 15, 2, 2, 3, 1, 8), Integer32()).setMaxAccess("readonly") if mibBuilder.loadTexts: hmAgentSwitchIpInterfaceSlotNum.setStatus('current') hmAgentSwitchIpInterfacePortNum = MibTableColumn((1, 3, 6, 1, 4, 1, 248, 15, 2, 2, 3, 1, 9), Integer32()).setMaxAccess("readonly") if mibBuilder.loadTexts: hmAgentSwitchIpInterfacePortNum.setStatus('current') hmAgentSwitchIpInterfaceNetdirectedBCMode = MibTableColumn((1, 3, 6, 1, 4, 1, 248, 15, 2, 2, 3, 1, 10), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2))).clone(namedValues=NamedValues(("enable", 1), ("disable", 2))).clone('disable')).setMaxAccess("readwrite") if mibBuilder.loadTexts: hmAgentSwitchIpInterfaceNetdirectedBCMode.setStatus('current') hmAgentSwitchIpRouterDiscoveryTable = MibTable((1, 3, 6, 1, 4, 1, 248, 15, 2, 2, 4), ) if mibBuilder.loadTexts: hmAgentSwitchIpRouterDiscoveryTable.setStatus('current') hmAgentSwitchIpRouterDiscoveryEntry = MibTableRow((1, 3, 6, 1, 4, 1, 248, 15, 2, 2, 4, 1), ).setIndexNames((0, "HIRSCHMANN-MMP4-ROUTING-MIB", "hmAgentSwitchIpRouterDiscoveryIfIndex")) if mibBuilder.loadTexts: hmAgentSwitchIpRouterDiscoveryEntry.setStatus('current') hmAgentSwitchIpRouterDiscoveryIfIndex = MibTableColumn((1, 3, 6, 1, 4, 1, 248, 15, 2, 2, 4, 1, 1), Integer32()).setMaxAccess("readonly") if mibBuilder.loadTexts: hmAgentSwitchIpRouterDiscoveryIfIndex.setStatus('current') hmAgentSwitchIpRouterDiscoveryAdvertiseMode = MibTableColumn((1, 3, 6, 1, 4, 1, 248, 15, 2, 2, 4, 1, 2), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2))).clone(namedValues=NamedValues(("enable", 1), ("disable", 2))).clone('enable')).setMaxAccess("readwrite") if mibBuilder.loadTexts: hmAgentSwitchIpRouterDiscoveryAdvertiseMode.setStatus('current') hmAgentSwitchIpRouterDiscoveryMaxAdvertisementInterval = MibTableColumn((1, 3, 6, 1, 4, 1, 248, 15, 2, 2, 4, 1, 3), Integer32().subtype(subtypeSpec=ValueRangeConstraint(4, 1800)).clone(600)).setMaxAccess("readwrite") if mibBuilder.loadTexts: hmAgentSwitchIpRouterDiscoveryMaxAdvertisementInterval.setStatus('current') hmAgentSwitchIpRouterDiscoveryMinAdvertisementInterval = MibTableColumn((1, 3, 6, 1, 4, 1, 248, 15, 2, 2, 4, 1, 4), Integer32().subtype(subtypeSpec=ValueRangeConstraint(3, 1800)).clone(450)).setMaxAccess("readwrite") if mibBuilder.loadTexts: hmAgentSwitchIpRouterDiscoveryMinAdvertisementInterval.setStatus('current') hmAgentSwitchIpRouterDiscoveryAdvertisementLifetime = MibTableColumn((1, 3, 6, 1, 4, 1, 248, 15, 2, 2, 4, 1, 5), Integer32().subtype(subtypeSpec=ValueRangeConstraint(4, 9000)).clone(1800)).setMaxAccess("readwrite") if mibBuilder.loadTexts: hmAgentSwitchIpRouterDiscoveryAdvertisementLifetime.setStatus('current') hmAgentSwitchIpRouterDiscoveryPreferenceLevel = MibTableColumn((1, 3, 6, 1, 4, 1, 248, 15, 2, 2, 4, 1, 6), Integer32()).setMaxAccess("readwrite") if mibBuilder.loadTexts: hmAgentSwitchIpRouterDiscoveryPreferenceLevel.setStatus('current') hmAgentSwitchIpRouterDiscoveryAdvertisementAddress = MibTableColumn((1, 3, 6, 1, 4, 1, 248, 15, 2, 2, 4, 1, 7), IpAddress().clone(hexValue="E0000001")).setMaxAccess("readwrite") if mibBuilder.loadTexts: hmAgentSwitchIpRouterDiscoveryAdvertisementAddress.setStatus('current') hmAgentSwitchIpVlanTable = MibTable((1, 3, 6, 1, 4, 1, 248, 15, 2, 2, 5), ) if mibBuilder.loadTexts: hmAgentSwitchIpVlanTable.setStatus('current') hmAgentSwitchIpVlanEntry = MibTableRow((1, 3, 6, 1, 4, 1, 248, 15, 2, 2, 5, 1), ).setIndexNames((0, "HIRSCHMANN-MMP4-ROUTING-MIB", "hmAgentSwitchIpVlanId")) if mibBuilder.loadTexts: hmAgentSwitchIpVlanEntry.setStatus('current') hmAgentSwitchIpVlanId = MibTableColumn((1, 3, 6, 1, 4, 1, 248, 15, 2, 2, 5, 1, 1), Integer32()).setMaxAccess("readonly") if mibBuilder.loadTexts: hmAgentSwitchIpVlanId.setStatus('current') hmAgentSwitchIpVlanIfIndex = MibTableColumn((1, 3, 6, 1, 4, 1, 248, 15, 2, 2, 5, 1, 2), Integer32()).setMaxAccess("readonly") if mibBuilder.loadTexts: hmAgentSwitchIpVlanIfIndex.setStatus('current') hmAgentSwitchIpVlanRoutingStatus = MibTableColumn((1, 3, 6, 1, 4, 1, 248, 15, 2, 2, 5, 1, 3), RowStatus()).setMaxAccess("readcreate") if mibBuilder.loadTexts: hmAgentSwitchIpVlanRoutingStatus.setStatus('current') hmAgentSwitchSecondaryAddressTable = MibTable((1, 3, 6, 1, 4, 1, 248, 15, 2, 2, 6), ) if mibBuilder.loadTexts: hmAgentSwitchSecondaryAddressTable.setStatus('current') hmAgentSwitchSecondaryAddressEntry = MibTableRow((1, 3, 6, 1, 4, 1, 248, 15, 2, 2, 6, 1), ).setIndexNames((0, "HIRSCHMANN-MMP4-ROUTING-MIB", "hmAgentSwitchIpInterfaceIfIndex"), (0, "HIRSCHMANN-MMP4-ROUTING-MIB", "hmAgentSwitchSecondaryIpAddress")) if mibBuilder.loadTexts: hmAgentSwitchSecondaryAddressEntry.setStatus('current') hmAgentSwitchSecondaryIpAddress = MibTableColumn((1, 3, 6, 1, 4, 1, 248, 15, 2, 2, 6, 1, 1), IpAddress()) if mibBuilder.loadTexts: hmAgentSwitchSecondaryIpAddress.setStatus('current') hmAgentSwitchSecondaryNetMask = MibTableColumn((1, 3, 6, 1, 4, 1, 248, 15, 2, 2, 6, 1, 2), IpAddress()).setMaxAccess("readcreate") if mibBuilder.loadTexts: hmAgentSwitchSecondaryNetMask.setStatus('current') hmAgentSwitchSecondaryStatus = MibTableColumn((1, 3, 6, 1, 4, 1, 248, 15, 2, 2, 6, 1, 3), RowStatus()).setMaxAccess("readcreate") if mibBuilder.loadTexts: hmAgentSwitchSecondaryStatus.setStatus('current') hmAgentSwitchIpRoutePreferenceTable = MibTable((1, 3, 6, 1, 4, 1, 248, 15, 2, 2, 7), ) if mibBuilder.loadTexts: hmAgentSwitchIpRoutePreferenceTable.setStatus('current') hmAgentSwitchIpRoutePreferenceEntry = MibTableRow((1, 3, 6, 1, 4, 1, 248, 15, 2, 2, 7, 1), ).setIndexNames((0, "HIRSCHMANN-MMP4-ROUTING-MIB", "hmAgentSwitchIpRoutePreferenceSource")) if mibBuilder.loadTexts: hmAgentSwitchIpRoutePreferenceEntry.setStatus('current') hmAgentSwitchIpRoutePreferenceSource = MibTableColumn((1, 3, 6, 1, 4, 1, 248, 15, 2, 2, 7, 1, 1), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2, 3, 4, 5, 6, 7))).clone(namedValues=NamedValues(("connected", 1), ("static", 2), ("ospf-intra", 3), ("ospf-inter", 4), ("ospf-ext-t1", 5), ("ospf-ext-t2", 6), ("rip", 7)))).setMaxAccess("readonly") if mibBuilder.loadTexts: hmAgentSwitchIpRoutePreferenceSource.setStatus('current') hmAgentSwitchIpRoutePreferenceValue = MibTableColumn((1, 3, 6, 1, 4, 1, 248, 15, 2, 2, 7, 1, 2), Integer32().subtype(subtypeSpec=ValueRangeConstraint(0, 255))).setMaxAccess("readwrite") if mibBuilder.loadTexts: hmAgentSwitchIpRoutePreferenceValue.setStatus('current') hmAgentSwitchIpRouteStaticTable = MibTable((1, 3, 6, 1, 4, 1, 248, 15, 2, 2, 8), ) if mibBuilder.loadTexts: hmAgentSwitchIpRouteStaticTable.setStatus('current') hmAgentSwitchIpRouteStaticEntry = MibTableRow((1, 3, 6, 1, 4, 1, 248, 15, 2, 2, 8, 1), ).setIndexNames((0, "HIRSCHMANN-MMP4-ROUTING-MIB", "hmAgentSwitchIpRouteStaticDestination"), (0, "HIRSCHMANN-MMP4-ROUTING-MIB", "hmAgentSwitchIpRouteStaticDestinationMask"), (0, "HIRSCHMANN-MMP4-ROUTING-MIB", "hmAgentSwitchIpRouteStaticNextHop")) if mibBuilder.loadTexts: hmAgentSwitchIpRouteStaticEntry.setStatus('current') hmAgentSwitchIpRouteStaticDestination = MibTableColumn((1, 3, 6, 1, 4, 1, 248, 15, 2, 2, 8, 1, 1), IpAddress()) if mibBuilder.loadTexts: hmAgentSwitchIpRouteStaticDestination.setStatus('current') hmAgentSwitchIpRouteStaticDestinationMask = MibTableColumn((1, 3, 6, 1, 4, 1, 248, 15, 2, 2, 8, 1, 2), IpAddress()) if mibBuilder.loadTexts: hmAgentSwitchIpRouteStaticDestinationMask.setStatus('current') hmAgentSwitchIpRouteStaticNextHop = MibTableColumn((1, 3, 6, 1, 4, 1, 248, 15, 2, 2, 8, 1, 3), IpAddress()) if mibBuilder.loadTexts: hmAgentSwitchIpRouteStaticNextHop.setStatus('current') hmAgentSwitchIpRouteStaticPreference = MibTableColumn((1, 3, 6, 1, 4, 1, 248, 15, 2, 2, 8, 1, 4), Integer32().subtype(subtypeSpec=ValueRangeConstraint(1, 255))).setMaxAccess("readwrite") if mibBuilder.loadTexts: hmAgentSwitchIpRouteStaticPreference.setStatus('current') hmAgentSwitchIpRouteStaticStatus = MibTableColumn((1, 3, 6, 1, 4, 1, 248, 15, 2, 2, 8, 1, 5), RowStatus()).setMaxAccess("readwrite") if mibBuilder.loadTexts: hmAgentSwitchIpRouteStaticStatus.setStatus('current') hmAgentSwitchIpRouteStaticTrackId = MibTableColumn((1, 3, 6, 1, 4, 1, 248, 15, 2, 2, 8, 1, 6), Integer32().subtype(subtypeSpec=ValueRangeConstraint(0, 65535))).setMaxAccess("readwrite") if mibBuilder.loadTexts: hmAgentSwitchIpRouteStaticTrackId.setStatus('current') hmAgentSwitchIpVlanSingleMacMode = MibScalar((1, 3, 6, 1, 4, 1, 248, 15, 2, 2, 100), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2))).clone(namedValues=NamedValues(("enable", 1), ("disable", 2)))).setMaxAccess("readwrite") if mibBuilder.loadTexts: hmAgentSwitchIpVlanSingleMacMode.setStatus('current') hmAgentSwitchIpTableSizesGroup = MibIdentifier((1, 3, 6, 1, 4, 1, 248, 15, 2, 2, 101)) hmAgentSwitchIpTableSizeArp = MibScalar((1, 3, 6, 1, 4, 1, 248, 15, 2, 2, 101, 1), Integer32().subtype(subtypeSpec=ValueRangeConstraint(300, 4096))).setMaxAccess("readwrite") if mibBuilder.loadTexts: hmAgentSwitchIpTableSizeArp.setStatus('current') hmAgentSwitchIpTableSizeUCRoutes = MibScalar((1, 3, 6, 1, 4, 1, 248, 15, 2, 2, 101, 2), Integer32().subtype(subtypeSpec=ValueRangeConstraint(300, 4096))).setMaxAccess("readwrite") if mibBuilder.loadTexts: hmAgentSwitchIpTableSizeUCRoutes.setStatus('current') hmAgentSwitchIpTableSizeMCRoutes = MibScalar((1, 3, 6, 1, 4, 1, 248, 15, 2, 2, 101, 3), Integer32().subtype(subtypeSpec=ValueRangeConstraint(0, 512))).setMaxAccess("readwrite") if mibBuilder.loadTexts: hmAgentSwitchIpTableSizeMCRoutes.setStatus('current') hmAgentSwitchIpCurrentTableSizeArp = MibScalar((1, 3, 6, 1, 4, 1, 248, 15, 2, 2, 101, 4), Integer32().subtype(subtypeSpec=ValueRangeConstraint(300, 4096))).setMaxAccess("readonly") if mibBuilder.loadTexts: hmAgentSwitchIpCurrentTableSizeArp.setStatus('current') hmAgentSwitchIpCurrentTableSizeUCRoutes = MibScalar((1, 3, 6, 1, 4, 1, 248, 15, 2, 2, 101, 5), Integer32().subtype(subtypeSpec=ValueRangeConstraint(300, 4096))).setMaxAccess("readonly") if mibBuilder.loadTexts: hmAgentSwitchIpCurrentTableSizeUCRoutes.setStatus('current') hmAgentSwitchIpCurrentTableSizeMCRoutes = MibScalar((1, 3, 6, 1, 4, 1, 248, 15, 2, 2, 101, 6), Integer32().subtype(subtypeSpec=ValueRangeConstraint(0, 512))).setMaxAccess("readonly") if mibBuilder.loadTexts: hmAgentSwitchIpCurrentTableSizeMCRoutes.setStatus('current') hmAgentRouterRipConfigGroup = MibIdentifier((1, 3, 6, 1, 4, 1, 248, 15, 2, 3)) hmAgentRouterRipAdminState = MibScalar((1, 3, 6, 1, 4, 1, 248, 15, 2, 3, 1), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2))).clone(namedValues=NamedValues(("enable", 1), ("disable", 2)))).setMaxAccess("readwrite") if mibBuilder.loadTexts: hmAgentRouterRipAdminState.setStatus('current') hmAgentRouterRipSplitHorizonMode = MibScalar((1, 3, 6, 1, 4, 1, 248, 15, 2, 3, 2), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2, 3))).clone(namedValues=NamedValues(("none", 1), ("simple", 2), ("poisonReverse", 3))).clone('simple')).setMaxAccess("readwrite") if mibBuilder.loadTexts: hmAgentRouterRipSplitHorizonMode.setStatus('current') hmAgentRouterRipAutoSummaryMode = MibScalar((1, 3, 6, 1, 4, 1, 248, 15, 2, 3, 3), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2))).clone(namedValues=NamedValues(("enable", 1), ("disable", 2))).clone('enable')).setMaxAccess("readwrite") if mibBuilder.loadTexts: hmAgentRouterRipAutoSummaryMode.setStatus('current') hmAgentRouterRipHostRoutesAcceptMode = MibScalar((1, 3, 6, 1, 4, 1, 248, 15, 2, 3, 4), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2))).clone(namedValues=NamedValues(("enable", 1), ("disable", 2))).clone('enable')).setMaxAccess("readwrite") if mibBuilder.loadTexts: hmAgentRouterRipHostRoutesAcceptMode.setStatus('current') hmAgentRouterRipDefaultMetric = MibScalar((1, 3, 6, 1, 4, 1, 248, 15, 2, 3, 5), Integer32().subtype(subtypeSpec=ValueRangeConstraint(0, 15))).setMaxAccess("readwrite") if mibBuilder.loadTexts: hmAgentRouterRipDefaultMetric.setStatus('current') hmAgentRouterRipDefaultMetricConfigured = MibScalar((1, 3, 6, 1, 4, 1, 248, 15, 2, 3, 6), TruthValue()).setMaxAccess("readwrite") if mibBuilder.loadTexts: hmAgentRouterRipDefaultMetricConfigured.setStatus('current') hmAgentRouterRipDefaultInfoOriginate = MibScalar((1, 3, 6, 1, 4, 1, 248, 15, 2, 3, 7), TruthValue().clone('false')).setMaxAccess("readwrite") if mibBuilder.loadTexts: hmAgentRouterRipDefaultInfoOriginate.setStatus('current') hmAgentRipRouteRedistTable = MibTable((1, 3, 6, 1, 4, 1, 248, 15, 2, 3, 8), ) if mibBuilder.loadTexts: hmAgentRipRouteRedistTable.setStatus('current') hmAgentRipRouteRedistEntry = MibTableRow((1, 3, 6, 1, 4, 1, 248, 15, 2, 3, 8, 1), ).setIndexNames((0, "HIRSCHMANN-MMP4-ROUTING-MIB", "hmAgentRipRouteRedistSource")) if mibBuilder.loadTexts: hmAgentRipRouteRedistEntry.setStatus('current') hmAgentRipRouteRedistSource = MibTableColumn((1, 3, 6, 1, 4, 1, 248, 15, 2, 3, 8, 1, 1), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2, 3, 4))).clone(namedValues=NamedValues(("connected", 1), ("static", 2), ("ospf", 3), ("bgp", 4)))).setMaxAccess("readonly") if mibBuilder.loadTexts: hmAgentRipRouteRedistSource.setStatus('current') hmAgentRipRouteRedistMode = MibTableColumn((1, 3, 6, 1, 4, 1, 248, 15, 2, 3, 8, 1, 2), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2))).clone(namedValues=NamedValues(("enable", 1), ("disable", 2))).clone('disable')).setMaxAccess("readwrite") if mibBuilder.loadTexts: hmAgentRipRouteRedistMode.setStatus('current') hmAgentRipRouteRedistMetric = MibTableColumn((1, 3, 6, 1, 4, 1, 248, 15, 2, 3, 8, 1, 3), Integer32().subtype(subtypeSpec=ValueRangeConstraint(0, 15))).setMaxAccess("readwrite") if mibBuilder.loadTexts: hmAgentRipRouteRedistMetric.setStatus('current') hmAgentRipRouteRedistMetricConfigured = MibTableColumn((1, 3, 6, 1, 4, 1, 248, 15, 2, 3, 8, 1, 4), TruthValue()).setMaxAccess("readwrite") if mibBuilder.loadTexts: hmAgentRipRouteRedistMetricConfigured.setStatus('current') hmAgentRipRouteRedistMatchInternal = MibTableColumn((1, 3, 6, 1, 4, 1, 248, 15, 2, 3, 8, 1, 5), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2, 3))).clone(namedValues=NamedValues(("true", 1), ("false", 2), ("not-applicable", 3)))).setMaxAccess("readwrite") if mibBuilder.loadTexts: hmAgentRipRouteRedistMatchInternal.setStatus('current') hmAgentRipRouteRedistMatchExternal1 = MibTableColumn((1, 3, 6, 1, 4, 1, 248, 15, 2, 3, 8, 1, 6), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2, 3))).clone(namedValues=NamedValues(("true", 1), ("false", 2), ("not-applicable", 3)))).setMaxAccess("readwrite") if mibBuilder.loadTexts: hmAgentRipRouteRedistMatchExternal1.setStatus('current') hmAgentRipRouteRedistMatchExternal2 = MibTableColumn((1, 3, 6, 1, 4, 1, 248, 15, 2, 3, 8, 1, 7), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2, 3))).clone(namedValues=NamedValues(("true", 1), ("false", 2), ("not-applicable", 3)))).setMaxAccess("readwrite") if mibBuilder.loadTexts: hmAgentRipRouteRedistMatchExternal2.setStatus('current') hmAgentRipRouteRedistMatchNSSAExternal1 = MibTableColumn((1, 3, 6, 1, 4, 1, 248, 15, 2, 3, 8, 1, 8), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2, 3))).clone(namedValues=NamedValues(("true", 1), ("false", 2), ("not-applicable", 3)))).setMaxAccess("readwrite") if mibBuilder.loadTexts: hmAgentRipRouteRedistMatchNSSAExternal1.setStatus('current') hmAgentRipRouteRedistMatchNSSAExternal2 = MibTableColumn((1, 3, 6, 1, 4, 1, 248, 15, 2, 3, 8, 1, 9), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2, 3))).clone(namedValues=NamedValues(("true", 1), ("false", 2), ("not-applicable", 3)))).setMaxAccess("readwrite") if mibBuilder.loadTexts: hmAgentRipRouteRedistMatchNSSAExternal2.setStatus('current') hmAgentRipRouteRedistDistList = MibTableColumn((1, 3, 6, 1, 4, 1, 248, 15, 2, 3, 8, 1, 10), Unsigned32().subtype(subtypeSpec=ValueRangeConstraint(1, 199))).setMaxAccess("readwrite") if mibBuilder.loadTexts: hmAgentRipRouteRedistDistList.setStatus('current') hmAgentRipRouteRedistDistListConfigured = MibTableColumn((1, 3, 6, 1, 4, 1, 248, 15, 2, 3, 8, 1, 11), TruthValue()).setMaxAccess("readwrite") if mibBuilder.loadTexts: hmAgentRipRouteRedistDistListConfigured.setStatus('current') hmAgentRip2IfConfTable = MibTable((1, 3, 6, 1, 4, 1, 248, 15, 2, 3, 9), ) if mibBuilder.loadTexts: hmAgentRip2IfConfTable.setStatus('current') hmAgentRip2IfConfEntry = MibTableRow((1, 3, 6, 1, 4, 1, 248, 15, 2, 3, 9, 1), ) rip2IfConfEntry.registerAugmentions(("HIRSCHMANN-MMP4-ROUTING-MIB", "hmAgentRip2IfConfEntry")) hmAgentRip2IfConfEntry.setIndexNames(*rip2IfConfEntry.getIndexNames()) if mibBuilder.loadTexts: hmAgentRip2IfConfEntry.setStatus('current') hmAgentRip2IfConfAuthKeyId = MibTableColumn((1, 3, 6, 1, 4, 1, 248, 15, 2, 3, 9, 1, 1), Integer32().subtype(subtypeSpec=ValueRangeConstraint(0, 255))).setMaxAccess("readcreate") if mibBuilder.loadTexts: hmAgentRip2IfConfAuthKeyId.setStatus('current') hmAgentRip2InterfaceTable = MibTable((1, 3, 6, 1, 4, 1, 248, 15, 2, 3, 10), ) if mibBuilder.loadTexts: hmAgentRip2InterfaceTable.setStatus('current') hmAgentRip2InterfaceEntry = MibTableRow((1, 3, 6, 1, 4, 1, 248, 15, 2, 3, 10, 1), ).setIndexNames((0, "HIRSCHMANN-MMP4-ROUTING-MIB", "hmAgentRip2InterfaceIfIndex")) if mibBuilder.loadTexts: hmAgentRip2InterfaceEntry.setStatus('current') hmAgentRip2InterfaceIfIndex = MibTableColumn((1, 3, 6, 1, 4, 1, 248, 15, 2, 3, 10, 1, 1), Integer32()).setMaxAccess("readonly") if mibBuilder.loadTexts: hmAgentRip2InterfaceIfIndex.setStatus('current') hmAgentRip2InterfaceAuthType = MibTableColumn((1, 3, 6, 1, 4, 1, 248, 15, 2, 3, 10, 1, 2), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2, 3))).clone(namedValues=NamedValues(("noAuthentication", 1), ("simplePassword", 2), ("md5", 3)))).setMaxAccess("readwrite") if mibBuilder.loadTexts: hmAgentRip2InterfaceAuthType.setStatus('current') hmAgentRip2InterfaceAuthKey = MibTableColumn((1, 3, 6, 1, 4, 1, 248, 15, 2, 3, 10, 1, 3), OctetString().subtype(subtypeSpec=ValueSizeConstraint(0, 16))).setMaxAccess("readwrite") if mibBuilder.loadTexts: hmAgentRip2InterfaceAuthKey.setStatus('current') hmAgentRip2InterfaceAuthKeyId = MibTableColumn((1, 3, 6, 1, 4, 1, 248, 15, 2, 3, 10, 1, 4), Integer32().subtype(subtypeSpec=ValueRangeConstraint(0, 255))).setMaxAccess("readwrite") if mibBuilder.loadTexts: hmAgentRip2InterfaceAuthKeyId.setStatus('current') hmAgentRip2InterfaceSendVersion = MibTableColumn((1, 3, 6, 1, 4, 1, 248, 15, 2, 3, 10, 1, 5), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2, 3, 4))).clone(namedValues=NamedValues(("doNotSend", 1), ("ripVersion1", 2), ("rip1Compatible", 3), ("ripVersion2", 4)))).setMaxAccess("readwrite") if mibBuilder.loadTexts: hmAgentRip2InterfaceSendVersion.setStatus('current') hmAgentRip2InterfaceReceiveVersion = MibTableColumn((1, 3, 6, 1, 4, 1, 248, 15, 2, 3, 10, 1, 6), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2, 3, 4))).clone(namedValues=NamedValues(("rip1", 1), ("rip2", 2), ("rip1OrRip2", 3), ("doNotReceive", 4)))).setMaxAccess("readwrite") if mibBuilder.loadTexts: hmAgentRip2InterfaceReceiveVersion.setStatus('current') hmAgentRip2InterfaceAdminState = MibTableColumn((1, 3, 6, 1, 4, 1, 248, 15, 2, 3, 10, 1, 7), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2))).clone(namedValues=NamedValues(("enable", 1), ("disable", 2)))).setMaxAccess("readwrite") if mibBuilder.loadTexts: hmAgentRip2InterfaceAdminState.setStatus('current') hmAgentRip2RcvBadPackets = MibTableColumn((1, 3, 6, 1, 4, 1, 248, 15, 2, 3, 10, 1, 8), Counter32()).setMaxAccess("readonly") if mibBuilder.loadTexts: hmAgentRip2RcvBadPackets.setStatus('current') hmAgentRip2RcvBadRoutes = MibTableColumn((1, 3, 6, 1, 4, 1, 248, 15, 2, 3, 10, 1, 9), Counter32()).setMaxAccess("readonly") if mibBuilder.loadTexts: hmAgentRip2RcvBadRoutes.setStatus('current') hmAgentRip2SentUpdates = MibTableColumn((1, 3, 6, 1, 4, 1, 248, 15, 2, 3, 10, 1, 10), Counter32()).setMaxAccess("readonly") if mibBuilder.loadTexts: hmAgentRip2SentUpdates.setStatus('current') hmAgentRouterRipUpdateTimerInterval = MibScalar((1, 3, 6, 1, 4, 1, 248, 15, 2, 3, 50), Integer32().subtype(subtypeSpec=ValueRangeConstraint(1, 1000)).clone(30)).setMaxAccess("readwrite") if mibBuilder.loadTexts: hmAgentRouterRipUpdateTimerInterval.setStatus('current') hmAgentRouterOspfConfigGroup = MibIdentifier((1, 3, 6, 1, 4, 1, 248, 15, 2, 4)) hmAgentOspfDefaultMetric = MibScalar((1, 3, 6, 1, 4, 1, 248, 15, 2, 4, 1), Integer32().subtype(subtypeSpec=ValueRangeConstraint(1, 16777215))).setMaxAccess("readwrite") if mibBuilder.loadTexts: hmAgentOspfDefaultMetric.setStatus('current') hmAgentOspfDefaultMetricConfigured = MibScalar((1, 3, 6, 1, 4, 1, 248, 15, 2, 4, 2), TruthValue()).setMaxAccess("readwrite") if mibBuilder.loadTexts: hmAgentOspfDefaultMetricConfigured.setStatus('current') hmAgentOspfDefaultInfoOriginate = MibScalar((1, 3, 6, 1, 4, 1, 248, 15, 2, 4, 3), TruthValue().clone('false')).setMaxAccess("readwrite") if mibBuilder.loadTexts: hmAgentOspfDefaultInfoOriginate.setStatus('current') hmAgentOspfDefaultInfoOriginateAlways = MibScalar((1, 3, 6, 1, 4, 1, 248, 15, 2, 4, 4), TruthValue().clone('false')).setMaxAccess("readwrite") if mibBuilder.loadTexts: hmAgentOspfDefaultInfoOriginateAlways.setStatus('current') hmAgentOspfDefaultInfoOriginateMetric = MibScalar((1, 3, 6, 1, 4, 1, 248, 15, 2, 4, 5), Integer32().subtype(subtypeSpec=ValueRangeConstraint(0, 16777215)).clone(10)).setMaxAccess("readwrite") if mibBuilder.loadTexts: hmAgentOspfDefaultInfoOriginateMetric.setStatus('current') hmAgentOspfDefaultInfoOriginateMetricConfigured = MibScalar((1, 3, 6, 1, 4, 1, 248, 15, 2, 4, 6), TruthValue()).setMaxAccess("readwrite") if mibBuilder.loadTexts: hmAgentOspfDefaultInfoOriginateMetricConfigured.setStatus('current') hmAgentOspfDefaultInfoOriginateMetricType = MibScalar((1, 3, 6, 1, 4, 1, 248, 15, 2, 4, 7), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2))).clone(namedValues=NamedValues(("externalType1", 1), ("externalType2", 2))).clone(2)).setMaxAccess("readwrite") if mibBuilder.loadTexts: hmAgentOspfDefaultInfoOriginateMetricType.setStatus('current') hmAgentOspfRouteRedistTable = MibTable((1, 3, 6, 1, 4, 1, 248, 15, 2, 4, 8), ) if mibBuilder.loadTexts: hmAgentOspfRouteRedistTable.setStatus('current') hmAgentOspfRouteRedistEntry = MibTableRow((1, 3, 6, 1, 4, 1, 248, 15, 2, 4, 8, 1), ).setIndexNames((0, "HIRSCHMANN-MMP4-ROUTING-MIB", "hmAgentOspfRouteRedistSource")) if mibBuilder.loadTexts: hmAgentOspfRouteRedistEntry.setStatus('current') hmAgentOspfRouteRedistSource = MibTableColumn((1, 3, 6, 1, 4, 1, 248, 15, 2, 4, 8, 1, 1), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2, 3, 4))).clone(namedValues=NamedValues(("connected", 1), ("static", 2), ("rip", 3), ("bgp", 4)))).setMaxAccess("readonly") if mibBuilder.loadTexts: hmAgentOspfRouteRedistSource.setStatus('current') hmAgentOspfRouteRedistMode = MibTableColumn((1, 3, 6, 1, 4, 1, 248, 15, 2, 4, 8, 1, 2), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2))).clone(namedValues=NamedValues(("enable", 1), ("disable", 2))).clone('disable')).setMaxAccess("readwrite") if mibBuilder.loadTexts: hmAgentOspfRouteRedistMode.setStatus('current') hmAgentOspfRouteRedistMetric = MibTableColumn((1, 3, 6, 1, 4, 1, 248, 15, 2, 4, 8, 1, 3), Integer32().subtype(subtypeSpec=ValueRangeConstraint(0, 16777215))).setMaxAccess("readwrite") if mibBuilder.loadTexts: hmAgentOspfRouteRedistMetric.setStatus('current') hmAgentOspfRouteRedistMetricConfigured = MibTableColumn((1, 3, 6, 1, 4, 1, 248, 15, 2, 4, 8, 1, 4), TruthValue()).setMaxAccess("readwrite") if mibBuilder.loadTexts: hmAgentOspfRouteRedistMetricConfigured.setStatus('current') hmAgentOspfRouteRedistMetricType = MibTableColumn((1, 3, 6, 1, 4, 1, 248, 15, 2, 4, 8, 1, 5), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2))).clone(namedValues=NamedValues(("externalType1", 1), ("externalType2", 2))).clone('externalType2')).setMaxAccess("readwrite") if mibBuilder.loadTexts: hmAgentOspfRouteRedistMetricType.setStatus('current') hmAgentOspfRouteRedistTag = MibTableColumn((1, 3, 6, 1, 4, 1, 248, 15, 2, 4, 8, 1, 6), Unsigned32().subtype(subtypeSpec=ValueRangeConstraint(0, 4294967295))).setMaxAccess("readwrite") if mibBuilder.loadTexts: hmAgentOspfRouteRedistTag.setStatus('current') hmAgentOspfRouteRedistSubnets = MibTableColumn((1, 3, 6, 1, 4, 1, 248, 15, 2, 4, 8, 1, 7), TruthValue().clone('false')).setMaxAccess("readwrite") if mibBuilder.loadTexts: hmAgentOspfRouteRedistSubnets.setStatus('current') hmAgentOspfRouteRedistDistList = MibTableColumn((1, 3, 6, 1, 4, 1, 248, 15, 2, 4, 8, 1, 8), Unsigned32().subtype(subtypeSpec=ValueRangeConstraint(1, 199))).setMaxAccess("readwrite") if mibBuilder.loadTexts: hmAgentOspfRouteRedistDistList.setStatus('current') hmAgentOspfRouteRedistDistListConfigured = MibTableColumn((1, 3, 6, 1, 4, 1, 248, 15, 2, 4, 8, 1, 9), TruthValue()).setMaxAccess("readwrite") if mibBuilder.loadTexts: hmAgentOspfRouteRedistDistListConfigured.setStatus('current') hmAgentOspfIfTable = MibTable((1, 3, 6, 1, 4, 1, 248, 15, 2, 4, 9), ) if mibBuilder.loadTexts: hmAgentOspfIfTable.setStatus('current') hmAgentOspfIfEntry = MibTableRow((1, 3, 6, 1, 4, 1, 248, 15, 2, 4, 9, 1), ) ospfIfEntry.registerAugmentions(("HIRSCHMANN-MMP4-ROUTING-MIB", "hmAgentOspfIfEntry")) hmAgentOspfIfEntry.setIndexNames(*ospfIfEntry.getIndexNames()) if mibBuilder.loadTexts: hmAgentOspfIfEntry.setStatus('current') hmAgentOspfIfAuthKeyId = MibTableColumn((1, 3, 6, 1, 4, 1, 248, 15, 2, 4, 9, 1, 1), Integer32().subtype(subtypeSpec=ValueRangeConstraint(0, 255))).setMaxAccess("readcreate") if mibBuilder.loadTexts: hmAgentOspfIfAuthKeyId.setStatus('current') hmAgentOspfIfIpMtuIgnoreFlag = MibTableColumn((1, 3, 6, 1, 4, 1, 248, 15, 2, 4, 9, 1, 2), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2))).clone(namedValues=NamedValues(("enable", 1), ("disable", 2)))).setMaxAccess("readwrite") if mibBuilder.loadTexts: hmAgentOspfIfIpMtuIgnoreFlag.setStatus('current') hmAgentOspfVirtIfTable = MibTable((1, 3, 6, 1, 4, 1, 248, 15, 2, 4, 10), ) if mibBuilder.loadTexts: hmAgentOspfVirtIfTable.setStatus('current') hmAgentOspfVirtIfEntry = MibTableRow((1, 3, 6, 1, 4, 1, 248, 15, 2, 4, 10, 1), ) ospfVirtIfEntry.registerAugmentions(("HIRSCHMANN-MMP4-ROUTING-MIB", "hmAgentOspfVirtIfEntry")) hmAgentOspfVirtIfEntry.setIndexNames(*ospfVirtIfEntry.getIndexNames()) if mibBuilder.loadTexts: hmAgentOspfVirtIfEntry.setStatus('current') hmAgentOspfVirtIfAuthKeyId = MibTableColumn((1, 3, 6, 1, 4, 1, 248, 15, 2, 4, 10, 1, 1), Integer32().subtype(subtypeSpec=ValueRangeConstraint(0, 255))).setMaxAccess("readcreate") if mibBuilder.loadTexts: hmAgentOspfVirtIfAuthKeyId.setStatus('current') hmAgentRouterOspfRFC1583CompatibilityMode = MibScalar((1, 3, 6, 1, 4, 1, 248, 15, 2, 4, 11), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2))).clone(namedValues=NamedValues(("enable", 1), ("disable", 2))).clone('enable')).setMaxAccess("readwrite") if mibBuilder.loadTexts: hmAgentRouterOspfRFC1583CompatibilityMode.setStatus('current') hmAgentSnmpTrapFlagsConfigGroupLayer3 = MibIdentifier((1, 3, 6, 1, 4, 1, 248, 15, 2, 5)) hmAgentSnmpVRRPNewMasterTrapFlag = MibScalar((1, 3, 6, 1, 4, 1, 248, 15, 2, 5, 1), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2))).clone(namedValues=NamedValues(("enable", 1), ("disable", 2)))).setMaxAccess("readwrite") if mibBuilder.loadTexts: hmAgentSnmpVRRPNewMasterTrapFlag.setStatus('current') hmAgentSnmpVRRPAuthFailureTrapFlag = MibScalar((1, 3, 6, 1, 4, 1, 248, 15, 2, 5, 2), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2))).clone(namedValues=NamedValues(("enable", 1), ("disable", 2)))).setMaxAccess("readwrite") if mibBuilder.loadTexts: hmAgentSnmpVRRPAuthFailureTrapFlag.setStatus('current') hmAgentECMPGroup = MibIdentifier((1, 3, 6, 1, 4, 1, 248, 15, 2, 7)) hmAgentECMPOspfMaxPaths = MibScalar((1, 3, 6, 1, 4, 1, 248, 15, 2, 7, 1), Integer32().clone(4)).setMaxAccess("readwrite") if mibBuilder.loadTexts: hmAgentECMPOspfMaxPaths.setStatus('current') hmAgentRouterVrrpConfigGroup = MibIdentifier((1, 3, 6, 1, 4, 1, 248, 15, 2, 8)) hmAgentRouterVrrpAdminState = MibScalar((1, 3, 6, 1, 4, 1, 248, 15, 2, 8, 1), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2))).clone(namedValues=NamedValues(("enable", 1), ("disable", 2)))).setMaxAccess("readwrite") if mibBuilder.loadTexts: hmAgentRouterVrrpAdminState.setStatus('current') hmVrrpExtGroup = MibIdentifier((1, 3, 6, 1, 4, 1, 248, 15, 2, 9)) hmVrrpTrackingTable = MibTable((1, 3, 6, 1, 4, 1, 248, 15, 2, 9, 1), ) if mibBuilder.loadTexts: hmVrrpTrackingTable.setStatus('current') hmVrrpTrackingEntry = MibTableRow((1, 3, 6, 1, 4, 1, 248, 15, 2, 9, 1, 1), ).setIndexNames((0, "HIRSCHMANN-MMP4-ROUTING-MIB", "hmVrrpTrackIfIndex"), (0, "HIRSCHMANN-MMP4-ROUTING-MIB", "hmVrrpTrackVrid"), (0, "HIRSCHMANN-MMP4-ROUTING-MIB", "hmVrrpTrackId")) if mibBuilder.loadTexts: hmVrrpTrackingEntry.setStatus('current') hmVrrpTrackIfIndex = MibTableColumn((1, 3, 6, 1, 4, 1, 248, 15, 2, 9, 1, 1, 1), Integer32()) if mibBuilder.loadTexts: hmVrrpTrackIfIndex.setStatus('current') hmVrrpTrackVrid = MibTableColumn((1, 3, 6, 1, 4, 1, 248, 15, 2, 9, 1, 1, 2), Integer32().subtype(subtypeSpec=ValueRangeConstraint(1, 255))) if mibBuilder.loadTexts: hmVrrpTrackVrid.setStatus('current') hmVrrpTrackId = MibTableColumn((1, 3, 6, 1, 4, 1, 248, 15, 2, 9, 1, 1, 3), Integer32()) if mibBuilder.loadTexts: hmVrrpTrackId.setStatus('current') hmVrrpTrackDecrement = MibTableColumn((1, 3, 6, 1, 4, 1, 248, 15, 2, 9, 1, 1, 4), Integer32().subtype(subtypeSpec=ValueRangeConstraint(1, 253))).setMaxAccess("readwrite") if mibBuilder.loadTexts: hmVrrpTrackDecrement.setStatus('current') hmVrrpTrackOperStatus = MibTableColumn((1, 3, 6, 1, 4, 1, 248, 15, 2, 9, 1, 1, 5), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2))).clone(namedValues=NamedValues(("up", 1), ("down", 2)))).setMaxAccess("readonly") if mibBuilder.loadTexts: hmVrrpTrackOperStatus.setStatus('current') hmVrrpTrackRowStatus = MibTableColumn((1, 3, 6, 1, 4, 1, 248, 15, 2, 9, 1, 1, 6), RowStatus()).setMaxAccess("readcreate") if mibBuilder.loadTexts: hmVrrpTrackRowStatus.setStatus('current') hmVrrpExtTable = MibTable((1, 3, 6, 1, 4, 1, 248, 15, 2, 9, 2), ) if mibBuilder.loadTexts: hmVrrpExtTable.setStatus('current') hmVrrpExtEntry = MibTableRow((1, 3, 6, 1, 4, 1, 248, 15, 2, 9, 2, 1), ).setIndexNames((0, "HIRSCHMANN-MMP4-ROUTING-MIB", "hmVrrpExtIfIndex"), (0, "HIRSCHMANN-MMP4-ROUTING-MIB", "hmVrrpExtVrid")) if mibBuilder.loadTexts: hmVrrpExtEntry.setStatus('current') hmVrrpExtIfIndex = MibTableColumn((1, 3, 6, 1, 4, 1, 248, 15, 2, 9, 2, 1, 1), Integer32()) if mibBuilder.loadTexts: hmVrrpExtIfIndex.setStatus('current') hmVrrpExtVrid = MibTableColumn((1, 3, 6, 1, 4, 1, 248, 15, 2, 9, 2, 1, 2), Integer32().subtype(subtypeSpec=ValueRangeConstraint(1, 255))) if mibBuilder.loadTexts: hmVrrpExtVrid.setStatus('current') hmVrrpExtDomainId = MibTableColumn((1, 3, 6, 1, 4, 1, 248, 15, 2, 9, 2, 1, 3), Integer32().subtype(subtypeSpec=ValueRangeConstraint(0, 8))).setMaxAccess("readwrite") if mibBuilder.loadTexts: hmVrrpExtDomainId.setStatus('current') hmVrrpExtDomainRole = MibTableColumn((1, 3, 6, 1, 4, 1, 248, 15, 2, 9, 2, 1, 4), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2, 3))).clone(namedValues=NamedValues(("none", 1), ("member", 2), ("supervisor", 3)))).setMaxAccess("readwrite") if mibBuilder.loadTexts: hmVrrpExtDomainRole.setStatus('current') hmVrrpExtDomainStatus = MibTableColumn((1, 3, 6, 1, 4, 1, 248, 15, 2, 9, 2, 1, 5), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2, 3))).clone(namedValues=NamedValues(("noError", 1), ("noSupervisor", 2), ("supervisorDown", 3)))).setMaxAccess("readonly") if mibBuilder.loadTexts: hmVrrpExtDomainStatus.setStatus('current') hmVrrpExtAdvertAddress = MibTableColumn((1, 3, 6, 1, 4, 1, 248, 15, 2, 9, 2, 1, 6), IpAddress()).setMaxAccess("readwrite") if mibBuilder.loadTexts: hmVrrpExtAdvertAddress.setStatus('current') hmVrrpExtAdvertTimer = MibTableColumn((1, 3, 6, 1, 4, 1, 248, 15, 2, 9, 2, 1, 7), Integer32().subtype(subtypeSpec=ValueRangeConstraint(100, 255000))).setUnits('milliseconds').setMaxAccess("readwrite") if mibBuilder.loadTexts: hmVrrpExtAdvertTimer.setStatus('current') hmVrrpExtOperPriority = MibTableColumn((1, 3, 6, 1, 4, 1, 248, 15, 2, 9, 2, 1, 8), Integer32().subtype(subtypeSpec=ValueRangeConstraint(1, 255))).setMaxAccess("readonly") if mibBuilder.loadTexts: hmVrrpExtOperPriority.setStatus('current') hmVrrpExtNotifyAddress = MibTableColumn((1, 3, 6, 1, 4, 1, 248, 15, 2, 9, 2, 1, 9), IpAddress()).setMaxAccess("readwrite") if mibBuilder.loadTexts: hmVrrpExtNotifyAddress.setStatus('current') hmVrrpExtNotifyLinkdown = MibTableColumn((1, 3, 6, 1, 4, 1, 248, 15, 2, 9, 2, 1, 10), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2))).clone(namedValues=NamedValues(("enable", 1), ("disable", 2)))).setMaxAccess("readwrite") if mibBuilder.loadTexts: hmVrrpExtNotifyLinkdown.setStatus('current') hmVrrpExtPreemptionDelay = MibTableColumn((1, 3, 6, 1, 4, 1, 248, 15, 2, 9, 2, 1, 11), Integer32().subtype(subtypeSpec=ValueRangeConstraint(0, 65535))).setMaxAccess("readwrite") if mibBuilder.loadTexts: hmVrrpExtPreemptionDelay.setStatus('current') hmVrrpDomainTable = MibTable((1, 3, 6, 1, 4, 1, 248, 15, 2, 9, 3), ) if mibBuilder.loadTexts: hmVrrpDomainTable.setStatus('current') hmVrrpDomainEntry = MibTableRow((1, 3, 6, 1, 4, 1, 248, 15, 2, 9, 3, 1), ).setIndexNames((0, "HIRSCHMANN-MMP4-ROUTING-MIB", "hmVrrpDomainId")) if mibBuilder.loadTexts: hmVrrpDomainEntry.setStatus('current') hmVrrpDomainId = MibTableColumn((1, 3, 6, 1, 4, 1, 248, 15, 2, 9, 3, 1, 1), Integer32().subtype(subtypeSpec=ValueRangeConstraint(0, 8))) if mibBuilder.loadTexts: hmVrrpDomainId.setStatus('current') hmVrrpDomainMemberSendAdv = MibTableColumn((1, 3, 6, 1, 4, 1, 248, 15, 2, 9, 3, 1, 2), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2))).clone(namedValues=NamedValues(("enabled", 1), ("disabled", 2)))).setMaxAccess("readwrite") if mibBuilder.loadTexts: hmVrrpDomainMemberSendAdv.setStatus('current') hmVrrpDomainStatus = MibTableColumn((1, 3, 6, 1, 4, 1, 248, 15, 2, 9, 3, 1, 3), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2, 3))).clone(namedValues=NamedValues(("noError", 1), ("noSupervisor", 2), ("supervisorDown", 3)))).setMaxAccess("readonly") if mibBuilder.loadTexts: hmVrrpDomainStatus.setStatus('current') hmVrrpDomainSupervisorIfIndex = MibTableColumn((1, 3, 6, 1, 4, 1, 248, 15, 2, 9, 3, 1, 4), Integer32()).setMaxAccess("readonly") if mibBuilder.loadTexts: hmVrrpDomainSupervisorIfIndex.setStatus('current') hmVrrpDomainSupervisorVrid = MibTableColumn((1, 3, 6, 1, 4, 1, 248, 15, 2, 9, 3, 1, 5), Integer32().subtype(subtypeSpec=ValueRangeConstraint(0, 255))).setMaxAccess("readonly") if mibBuilder.loadTexts: hmVrrpDomainSupervisorVrid.setStatus('current') hmVrrpDomainOperPriority = MibTableColumn((1, 3, 6, 1, 4, 1, 248, 15, 2, 9, 3, 1, 6), Integer32().subtype(subtypeSpec=ValueRangeConstraint(0, 255))).setMaxAccess("readonly") if mibBuilder.loadTexts: hmVrrpDomainOperPriority.setStatus('current') hmVrrpDomainSupervisorOperState = MibTableColumn((1, 3, 6, 1, 4, 1, 248, 15, 2, 9, 3, 1, 7), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2, 3, 4))).clone(namedValues=NamedValues(("initialize", 1), ("backup", 2), ("master", 3), ("unknown", 4)))).setMaxAccess("readonly") if mibBuilder.loadTexts: hmVrrpDomainSupervisorOperState.setStatus('current') mibBuilder.exportSymbols("HIRSCHMANN-MMP4-ROUTING-MIB", hmAgentOspfDefaultInfoOriginateMetricType=hmAgentOspfDefaultInfoOriginateMetricType, hmAgentRouterOspfRFC1583CompatibilityMode=hmAgentRouterOspfRFC1583CompatibilityMode, hmAgentSwitchIpRouteStaticDestinationMask=hmAgentSwitchIpRouteStaticDestinationMask, hmAgentOspfRouteRedistMetricConfigured=hmAgentOspfRouteRedistMetricConfigured, hmAgentSwitchSecondaryAddressEntry=hmAgentSwitchSecondaryAddressEntry, hmAgentOspfIfEntry=hmAgentOspfIfEntry, hmVrrpDomainEntry=hmVrrpDomainEntry, hmVrrpDomainOperPriority=hmVrrpDomainOperPriority, hmAgentSwitchArpAge=hmAgentSwitchArpAge, hmAgentOspfRouteRedistSource=hmAgentOspfRouteRedistSource, hmAgentRipRouteRedistTable=hmAgentRipRouteRedistTable, hmAgentRipRouteRedistMatchExternal2=hmAgentRipRouteRedistMatchExternal2, hmAgentRipRouteRedistDistList=hmAgentRipRouteRedistDistList, hmVrrpExtPreemptionDelay=hmVrrpExtPreemptionDelay, hmVrrpTrackRowStatus=hmVrrpTrackRowStatus, hmAgentOspfIfIpMtuIgnoreFlag=hmAgentOspfIfIpMtuIgnoreFlag, hmAgentSwitchIpRouterDiscoveryPreferenceLevel=hmAgentSwitchIpRouterDiscoveryPreferenceLevel, hmVrrpExtVrid=hmVrrpExtVrid, hmAgentRipRouteRedistMetricConfigured=hmAgentRipRouteRedistMetricConfigured, hmAgentSwitchIpRouteStaticPreference=hmAgentSwitchIpRouteStaticPreference, hmAgentRip2InterfaceTable=hmAgentRip2InterfaceTable, hmAgentRip2RcvBadPackets=hmAgentRip2RcvBadPackets, hmAgentOspfIfTable=hmAgentOspfIfTable, hmAgentRip2InterfaceEntry=hmAgentRip2InterfaceEntry, hmAgentSwitchIpInterfaceRoutingMode=hmAgentSwitchIpInterfaceRoutingMode, hmAgentSwitchIpVlanTable=hmAgentSwitchIpVlanTable, hmAgentOspfRouteRedistMetricType=hmAgentOspfRouteRedistMetricType, hmAgentSwitchArpEntry=hmAgentSwitchArpEntry, hmAgentSwitchIpRoutingMode=hmAgentSwitchIpRoutingMode, hmAgentSwitchIpCurrentTableSizeUCRoutes=hmAgentSwitchIpCurrentTableSizeUCRoutes, hmVrrpDomainStatus=hmVrrpDomainStatus, hmAgentRip2InterfaceReceiveVersion=hmAgentRip2InterfaceReceiveVersion, hmAgentSwitchIpRouterDiscoveryMaxAdvertisementInterval=hmAgentSwitchIpRouterDiscoveryMaxAdvertisementInterval, hmAgentSwitchIpRouteStaticNextHop=hmAgentSwitchIpRouteStaticNextHop, hmAgentSwitchArpTotalEntryCountCurrent=hmAgentSwitchArpTotalEntryCountCurrent, hmAgentSwitchIpInterfaceProxyARPMode=hmAgentSwitchIpInterfaceProxyARPMode, hmAgentSnmpVRRPAuthFailureTrapFlag=hmAgentSnmpVRRPAuthFailureTrapFlag, hmAgentOspfDefaultMetricConfigured=hmAgentOspfDefaultMetricConfigured, hmAgentSnmpTrapFlagsConfigGroupLayer3=hmAgentSnmpTrapFlagsConfigGroupLayer3, hmAgentRip2InterfaceAdminState=hmAgentRip2InterfaceAdminState, hmVrrpExtOperPriority=hmVrrpExtOperPriority, hmAgentSwitchIpInterfaceNetdirectedBCMode=hmAgentSwitchIpInterfaceNetdirectedBCMode, hmAgentRouterVrrpConfigGroup=hmAgentRouterVrrpConfigGroup, hmVrrpDomainMemberSendAdv=hmVrrpDomainMemberSendAdv, hmAgentRip2IfConfEntry=hmAgentRip2IfConfEntry, hmAgentRipRouteRedistSource=hmAgentRipRouteRedistSource, hmAgentSnmpVRRPNewMasterTrapFlag=hmAgentSnmpVRRPNewMasterTrapFlag, hmVrrpExtEntry=hmVrrpExtEntry, hmAgentOspfRouteRedistMode=hmAgentOspfRouteRedistMode, hmVrrpTrackId=hmVrrpTrackId, hmAgentSwitchArpCacheSize=hmAgentSwitchArpCacheSize, hmAgentRouterRipAutoSummaryMode=hmAgentRouterRipAutoSummaryMode, hmAgentSwitchArpResponseTime=hmAgentSwitchArpResponseTime, hmAgentSwitchIpRoutePreferenceEntry=hmAgentSwitchIpRoutePreferenceEntry, hmAgentRip2InterfaceAuthType=hmAgentRip2InterfaceAuthType, hmAgentSwitchIpVlanEntry=hmAgentSwitchIpVlanEntry, hmAgentRouterRipSplitHorizonMode=hmAgentRouterRipSplitHorizonMode, hmAgentSwitchIpVRRPMode=hmAgentSwitchIpVRRPMode, hmAgentSwitchIpRouterDiscoveryAdvertisementAddress=hmAgentSwitchIpRouterDiscoveryAdvertisementAddress, hmAgentRouterRipDefaultMetricConfigured=hmAgentRouterRipDefaultMetricConfigured, hmAgentOspfDefaultInfoOriginate=hmAgentOspfDefaultInfoOriginate, hmAgentOspfVirtIfEntry=hmAgentOspfVirtIfEntry, hmVrrpExtNotifyAddress=hmVrrpExtNotifyAddress, hmVrrpExtGroup=hmVrrpExtGroup, hmAgentSwitchIpRoutePreferenceSource=hmAgentSwitchIpRoutePreferenceSource, hmVrrpDomainSupervisorVrid=hmVrrpDomainSupervisorVrid, hmAgentSwitchArpInterface=hmAgentSwitchArpInterface, hmAgentOspfRouteRedistMetric=hmAgentOspfRouteRedistMetric, hmVrrpDomainTable=hmVrrpDomainTable, hmAgentSwitchIpInterfaceClearIp=hmAgentSwitchIpInterfaceClearIp, hmAgentSwitchIpRouteStaticTable=hmAgentSwitchIpRouteStaticTable, hmVrrpExtDomainId=hmVrrpExtDomainId, hmAgentSwitchIpRouteStaticDestination=hmAgentSwitchIpRouteStaticDestination, hmAgentSwitchSecondaryIpAddress=hmAgentSwitchSecondaryIpAddress, hmAgentRip2InterfaceAuthKey=hmAgentRip2InterfaceAuthKey, hmAgentSwitchArpGroup=hmAgentSwitchArpGroup, hmAgentSwitchIpInterfaceNetMask=hmAgentSwitchIpInterfaceNetMask, hmAgentRipRouteRedistMatchNSSAExternal1=hmAgentRipRouteRedistMatchNSSAExternal1, hmPlatform4Routing=hmPlatform4Routing, hmAgentRip2SentUpdates=hmAgentRip2SentUpdates, hmAgentRipRouteRedistMetric=hmAgentRipRouteRedistMetric, hmAgentSwitchArpSparseLearn=hmAgentSwitchArpSparseLearn, hmAgentSwitchIpTableSizeMCRoutes=hmAgentSwitchIpTableSizeMCRoutes, hmAgentSwitchArpDynamicRenew=hmAgentSwitchArpDynamicRenew, hmAgentSwitchArpIpAddress=hmAgentSwitchArpIpAddress, hmVrrpTrackIfIndex=hmVrrpTrackIfIndex, hmAgentRip2RcvBadRoutes=hmAgentRip2RcvBadRoutes, hmAgentOspfRouteRedistSubnets=hmAgentOspfRouteRedistSubnets, hmAgentSwitchArpMacAddress=hmAgentSwitchArpMacAddress, hmAgentOspfRouteRedistDistList=hmAgentOspfRouteRedistDistList, hmVrrpDomainSupervisorIfIndex=hmVrrpDomainSupervisorIfIndex, hmAgentSwitchArpTable=hmAgentSwitchArpTable, hmVrrpDomainSupervisorOperState=hmVrrpDomainSupervisorOperState, hmVrrpTrackOperStatus=hmVrrpTrackOperStatus, hmAgentRouterRipHostRoutesAcceptMode=hmAgentRouterRipHostRoutesAcceptMode, hmVrrpExtAdvertTimer=hmVrrpExtAdvertTimer, hmAgentRouterVrrpAdminState=hmAgentRouterVrrpAdminState, hmVrrpTrackingEntry=hmVrrpTrackingEntry, hmAgentSwitchArpMaxRetries=hmAgentSwitchArpMaxRetries, hmAgentSwitchIpRouterDiscoveryEntry=hmAgentSwitchIpRouterDiscoveryEntry, hmAgentRipRouteRedistMatchNSSAExternal2=hmAgentRipRouteRedistMatchNSSAExternal2, hmAgentSwitchIpInterfaceEntry=hmAgentSwitchIpInterfaceEntry, hmAgentSwitchArpStaticEntryCountCurrent=hmAgentSwitchArpStaticEntryCountCurrent, hmAgentECMPGroup=hmAgentECMPGroup, hmAgentOspfIfAuthKeyId=hmAgentOspfIfAuthKeyId, hmAgentSwitchIpInterfaceIfIndex=hmAgentSwitchIpInterfaceIfIndex, hmAgentSwitchIpRouterDiscoveryTable=hmAgentSwitchIpRouterDiscoveryTable, hmAgentSwitchSecondaryStatus=hmAgentSwitchSecondaryStatus, hmAgentSwitchIpRouteStaticTrackId=hmAgentSwitchIpRouteStaticTrackId, hmAgentRip2InterfaceSendVersion=hmAgentRip2InterfaceSendVersion, hmAgentSwitchIpVlanId=hmAgentSwitchIpVlanId, hmAgentSwitchIpInterfacePortNum=hmAgentSwitchIpInterfacePortNum, hmVrrpTrackVrid=hmVrrpTrackVrid, hmAgentSwitchIpTableSizeUCRoutes=hmAgentSwitchIpTableSizeUCRoutes, hmAgentOspfDefaultInfoOriginateMetric=hmAgentOspfDefaultInfoOriginateMetric, hmAgentSwitchIpVlanRoutingStatus=hmAgentSwitchIpVlanRoutingStatus, hmVrrpDomainId=hmVrrpDomainId, hmAgentRouterOspfConfigGroup=hmAgentRouterOspfConfigGroup, hmAgentOspfRouteRedistDistListConfigured=hmAgentOspfRouteRedistDistListConfigured, hmVrrpTrackingTable=hmVrrpTrackingTable, hmAgentSwitchSecondaryAddressTable=hmAgentSwitchSecondaryAddressTable, hmAgentSwitchIpInterfaceMtuValue=hmAgentSwitchIpInterfaceMtuValue, hmAgentOspfDefaultInfoOriginateMetricConfigured=hmAgentOspfDefaultInfoOriginateMetricConfigured, hmAgentRip2InterfaceAuthKeyId=hmAgentRip2InterfaceAuthKeyId, hmAgentRouterRipAdminState=hmAgentRouterRipAdminState, hmAgentSwitchIpVlanIfIndex=hmAgentSwitchIpVlanIfIndex, hmAgentSwitchIpRouteStaticEntry=hmAgentSwitchIpRouteStaticEntry, hmAgentSwitchArpStatus=hmAgentSwitchArpStatus, hmAgentSwitchArpAgeoutTime=hmAgentSwitchArpAgeoutTime, hmAgentRipRouteRedistDistListConfigured=hmAgentRipRouteRedistDistListConfigured, hmAgentSwitchIpGroup=hmAgentSwitchIpGroup, hmAgentSwitchIpVlanSingleMacMode=hmAgentSwitchIpVlanSingleMacMode, hmAgentECMPOspfMaxPaths=hmAgentECMPOspfMaxPaths, hmVrrpExtAdvertAddress=hmVrrpExtAdvertAddress, hmAgentSwitchIpRouterDiscoveryIfIndex=hmAgentSwitchIpRouterDiscoveryIfIndex, hmAgentSwitchArpTotalEntryCountPeak=hmAgentSwitchArpTotalEntryCountPeak, hmAgentRip2InterfaceIfIndex=hmAgentRip2InterfaceIfIndex, hmAgentOspfDefaultInfoOriginateAlways=hmAgentOspfDefaultInfoOriginateAlways, hmAgentOspfVirtIfAuthKeyId=hmAgentOspfVirtIfAuthKeyId, hmAgentRipRouteRedistMatchExternal1=hmAgentRipRouteRedistMatchExternal1, hmAgentRip2IfConfAuthKeyId=hmAgentRip2IfConfAuthKeyId, hmAgentSwitchArpStaticEntryCountMax=hmAgentSwitchArpStaticEntryCountMax, hmAgentSwitchIpRoutePreferenceValue=hmAgentSwitchIpRoutePreferenceValue, hmVrrpExtDomainStatus=hmVrrpExtDomainStatus, hmAgentRipRouteRedistEntry=hmAgentRipRouteRedistEntry, hmAgentSwitchIpTableSizesGroup=hmAgentSwitchIpTableSizesGroup, hmVrrpExtIfIndex=hmVrrpExtIfIndex, hmVrrpExtTable=hmVrrpExtTable, hmAgentSwitchArpType=hmAgentSwitchArpType, hmAgentSwitchSecondaryNetMask=hmAgentSwitchSecondaryNetMask, hmAgentRouterRipConfigGroup=hmAgentRouterRipConfigGroup, hmAgentOspfDefaultMetric=hmAgentOspfDefaultMetric, hmAgentSwitchIpInterfaceSlotNum=hmAgentSwitchIpInterfaceSlotNum, hmAgentRouterRipDefaultMetric=hmAgentRouterRipDefaultMetric, hmAgentRouterRipUpdateTimerInterval=hmAgentRouterRipUpdateTimerInterval, hmAgentRipRouteRedistMatchInternal=hmAgentRipRouteRedistMatchInternal, hmAgentSwitchIpCurrentTableSizeArp=hmAgentSwitchIpCurrentTableSizeArp, hmAgentSwitchIpCurrentTableSizeMCRoutes=hmAgentSwitchIpCurrentTableSizeMCRoutes, hmAgentOspfRouteRedistTag=hmAgentOspfRouteRedistTag, hmAgentSwitchIpTableSizeArp=hmAgentSwitchIpTableSizeArp, hmAgentOspfRouteRedistEntry=hmAgentOspfRouteRedistEntry, hmAgentOspfVirtIfTable=hmAgentOspfVirtIfTable, hmAgentSwitchIpRouteStaticStatus=hmAgentSwitchIpRouteStaticStatus, hmVrrpExtDomainRole=hmVrrpExtDomainRole, hmAgentSwitchIpInterfaceTable=hmAgentSwitchIpInterfaceTable, hmAgentSwitchIpRouterDiscoveryMinAdvertisementInterval=hmAgentSwitchIpRouterDiscoveryMinAdvertisementInterval, hmAgentSwitchIpRoutePreferenceTable=hmAgentSwitchIpRoutePreferenceTable, hmAgentRip2IfConfTable=hmAgentRip2IfConfTable, hmAgentRipRouteRedistMode=hmAgentRipRouteRedistMode, hmVrrpTrackDecrement=hmVrrpTrackDecrement, hmAgentOspfRouteRedistTable=hmAgentOspfRouteRedistTable, hmAgentRouterRipDefaultInfoOriginate=hmAgentRouterRipDefaultInfoOriginate, hmAgentSwitchIpInterfaceIpAddress=hmAgentSwitchIpInterfaceIpAddress, hmAgentSwitchIpRouterDiscoveryAdvertiseMode=hmAgentSwitchIpRouterDiscoveryAdvertiseMode, hmVrrpExtNotifyLinkdown=hmVrrpExtNotifyLinkdown, PYSNMP_MODULE_ID=hmPlatform4Routing, hmAgentSwitchIpRouterDiscoveryAdvertisementLifetime=hmAgentSwitchIpRouterDiscoveryAdvertisementLifetime)
(integer, octet_string, object_identifier) = mibBuilder.importSymbols('ASN1', 'Integer', 'OctetString', 'ObjectIdentifier') (named_values,) = mibBuilder.importSymbols('ASN1-ENUMERATION', 'NamedValues') (value_range_constraint, value_size_constraint, single_value_constraint, constraints_intersection, constraints_union) = mibBuilder.importSymbols('ASN1-REFINEMENT', 'ValueRangeConstraint', 'ValueSizeConstraint', 'SingleValueConstraint', 'ConstraintsIntersection', 'ConstraintsUnion') (hm_platform4,) = mibBuilder.importSymbols('HIRSCHMANN-MMP4-BASICL2-MIB', 'hmPlatform4') (ospf_virt_if_entry, ospf_if_entry) = mibBuilder.importSymbols('OSPF-MIB', 'ospfVirtIfEntry', 'ospfIfEntry') (rip2_if_conf_entry,) = mibBuilder.importSymbols('RIPv2-MIB', 'rip2IfConfEntry') (module_compliance, notification_group) = mibBuilder.importSymbols('SNMPv2-CONF', 'ModuleCompliance', 'NotificationGroup') (gauge32, time_ticks, mib_identifier, counter32, module_identity, mib_scalar, mib_table, mib_table_row, mib_table_column, unsigned32, bits, integer32, notification_type, counter64, ip_address, iso, object_identity) = mibBuilder.importSymbols('SNMPv2-SMI', 'Gauge32', 'TimeTicks', 'MibIdentifier', 'Counter32', 'ModuleIdentity', 'MibScalar', 'MibTable', 'MibTableRow', 'MibTableColumn', 'Unsigned32', 'Bits', 'Integer32', 'NotificationType', 'Counter64', 'IpAddress', 'iso', 'ObjectIdentity') (row_status, display_string, textual_convention, mac_address, truth_value) = mibBuilder.importSymbols('SNMPv2-TC', 'RowStatus', 'DisplayString', 'TextualConvention', 'MacAddress', 'TruthValue') hm_platform4_routing = module_identity((1, 3, 6, 1, 4, 1, 248, 15, 2)) hmPlatform4Routing.setRevisions(('2005-08-18 12:00', '2003-04-02 17:00')) if mibBuilder.loadTexts: hmPlatform4Routing.setLastUpdated('200508181200Z') if mibBuilder.loadTexts: hmPlatform4Routing.setOrganization('Hirschmann Automation and Control GmbH') hm_agent_switch_arp_group = mib_identifier((1, 3, 6, 1, 4, 1, 248, 15, 2, 1)) hm_agent_switch_arp_ageout_time = mib_scalar((1, 3, 6, 1, 4, 1, 248, 15, 2, 1, 1), integer32().subtype(subtypeSpec=value_range_constraint(15, 21600)).clone(1200)).setMaxAccess('readwrite') if mibBuilder.loadTexts: hmAgentSwitchArpAgeoutTime.setStatus('current') hm_agent_switch_arp_response_time = mib_scalar((1, 3, 6, 1, 4, 1, 248, 15, 2, 1, 2), integer32().subtype(subtypeSpec=value_range_constraint(1, 10))).setMaxAccess('readwrite') if mibBuilder.loadTexts: hmAgentSwitchArpResponseTime.setStatus('current') hm_agent_switch_arp_max_retries = mib_scalar((1, 3, 6, 1, 4, 1, 248, 15, 2, 1, 3), integer32().subtype(subtypeSpec=value_range_constraint(0, 10))).setMaxAccess('readwrite') if mibBuilder.loadTexts: hmAgentSwitchArpMaxRetries.setStatus('current') hm_agent_switch_arp_cache_size = mib_scalar((1, 3, 6, 1, 4, 1, 248, 15, 2, 1, 4), integer32()).setMaxAccess('readwrite') if mibBuilder.loadTexts: hmAgentSwitchArpCacheSize.setStatus('current') hm_agent_switch_arp_dynamic_renew = mib_scalar((1, 3, 6, 1, 4, 1, 248, 15, 2, 1, 5), integer32().subtype(subtypeSpec=constraints_union(single_value_constraint(1, 2))).clone(namedValues=named_values(('enable', 1), ('disable', 2))).clone('enable')).setMaxAccess('readwrite') if mibBuilder.loadTexts: hmAgentSwitchArpDynamicRenew.setStatus('current') hm_agent_switch_arp_total_entry_count_current = mib_scalar((1, 3, 6, 1, 4, 1, 248, 15, 2, 1, 6), gauge32()).setMaxAccess('readonly') if mibBuilder.loadTexts: hmAgentSwitchArpTotalEntryCountCurrent.setStatus('current') hm_agent_switch_arp_total_entry_count_peak = mib_scalar((1, 3, 6, 1, 4, 1, 248, 15, 2, 1, 7), gauge32()).setMaxAccess('readonly') if mibBuilder.loadTexts: hmAgentSwitchArpTotalEntryCountPeak.setStatus('current') hm_agent_switch_arp_static_entry_count_current = mib_scalar((1, 3, 6, 1, 4, 1, 248, 15, 2, 1, 8), gauge32()).setMaxAccess('readonly') if mibBuilder.loadTexts: hmAgentSwitchArpStaticEntryCountCurrent.setStatus('current') hm_agent_switch_arp_static_entry_count_max = mib_scalar((1, 3, 6, 1, 4, 1, 248, 15, 2, 1, 9), integer32()).setMaxAccess('readonly') if mibBuilder.loadTexts: hmAgentSwitchArpStaticEntryCountMax.setStatus('current') hm_agent_switch_arp_table = mib_table((1, 3, 6, 1, 4, 1, 248, 15, 2, 1, 10)) if mibBuilder.loadTexts: hmAgentSwitchArpTable.setStatus('current') hm_agent_switch_arp_entry = mib_table_row((1, 3, 6, 1, 4, 1, 248, 15, 2, 1, 10, 1)).setIndexNames((0, 'HIRSCHMANN-MMP4-ROUTING-MIB', 'hmAgentSwitchArpIpAddress')) if mibBuilder.loadTexts: hmAgentSwitchArpEntry.setStatus('current') hm_agent_switch_arp_age = mib_table_column((1, 3, 6, 1, 4, 1, 248, 15, 2, 1, 10, 1, 1), time_ticks()).setMaxAccess('readonly') if mibBuilder.loadTexts: hmAgentSwitchArpAge.setStatus('current') hm_agent_switch_arp_ip_address = mib_table_column((1, 3, 6, 1, 4, 1, 248, 15, 2, 1, 10, 1, 2), ip_address()).setMaxAccess('readonly') if mibBuilder.loadTexts: hmAgentSwitchArpIpAddress.setStatus('current') hm_agent_switch_arp_mac_address = mib_table_column((1, 3, 6, 1, 4, 1, 248, 15, 2, 1, 10, 1, 3), mac_address()).setMaxAccess('readcreate') if mibBuilder.loadTexts: hmAgentSwitchArpMacAddress.setStatus('current') hm_agent_switch_arp_interface = mib_table_column((1, 3, 6, 1, 4, 1, 248, 15, 2, 1, 10, 1, 4), integer32()).setMaxAccess('readonly') if mibBuilder.loadTexts: hmAgentSwitchArpInterface.setStatus('current') hm_agent_switch_arp_type = mib_table_column((1, 3, 6, 1, 4, 1, 248, 15, 2, 1, 10, 1, 5), integer32().subtype(subtypeSpec=constraints_union(single_value_constraint(1, 2, 3, 4))).clone(namedValues=named_values(('local', 1), ('gateway', 2), ('static', 3), ('dynamic', 4)))).setMaxAccess('readonly') if mibBuilder.loadTexts: hmAgentSwitchArpType.setStatus('current') hm_agent_switch_arp_status = mib_table_column((1, 3, 6, 1, 4, 1, 248, 15, 2, 1, 10, 1, 6), row_status()).setMaxAccess('readwrite') if mibBuilder.loadTexts: hmAgentSwitchArpStatus.setStatus('current') hm_agent_switch_arp_sparse_learn = mib_scalar((1, 3, 6, 1, 4, 1, 248, 15, 2, 1, 11), integer32().subtype(subtypeSpec=constraints_union(single_value_constraint(1, 2))).clone(namedValues=named_values(('enable', 1), ('disable', 2))).clone('disable')).setMaxAccess('readwrite') if mibBuilder.loadTexts: hmAgentSwitchArpSparseLearn.setStatus('current') hm_agent_switch_ip_group = mib_identifier((1, 3, 6, 1, 4, 1, 248, 15, 2, 2)) hm_agent_switch_ip_routing_mode = mib_scalar((1, 3, 6, 1, 4, 1, 248, 15, 2, 2, 1), integer32().subtype(subtypeSpec=constraints_union(single_value_constraint(1, 2))).clone(namedValues=named_values(('enable', 1), ('disable', 2)))).setMaxAccess('readwrite') if mibBuilder.loadTexts: hmAgentSwitchIpRoutingMode.setStatus('current') hm_agent_switch_ip_vrrp_mode = mib_scalar((1, 3, 6, 1, 4, 1, 248, 15, 2, 2, 2), integer32().subtype(subtypeSpec=constraints_union(single_value_constraint(1, 2))).clone(namedValues=named_values(('enable', 1), ('disable', 2)))).setMaxAccess('readwrite') if mibBuilder.loadTexts: hmAgentSwitchIpVRRPMode.setStatus('current') hm_agent_switch_ip_interface_table = mib_table((1, 3, 6, 1, 4, 1, 248, 15, 2, 2, 3)) if mibBuilder.loadTexts: hmAgentSwitchIpInterfaceTable.setStatus('current') hm_agent_switch_ip_interface_entry = mib_table_row((1, 3, 6, 1, 4, 1, 248, 15, 2, 2, 3, 1)).setIndexNames((0, 'HIRSCHMANN-MMP4-ROUTING-MIB', 'hmAgentSwitchIpInterfaceIfIndex')) if mibBuilder.loadTexts: hmAgentSwitchIpInterfaceEntry.setStatus('current') hm_agent_switch_ip_interface_if_index = mib_table_column((1, 3, 6, 1, 4, 1, 248, 15, 2, 2, 3, 1, 1), integer32()).setMaxAccess('readonly') if mibBuilder.loadTexts: hmAgentSwitchIpInterfaceIfIndex.setStatus('current') hm_agent_switch_ip_interface_ip_address = mib_table_column((1, 3, 6, 1, 4, 1, 248, 15, 2, 2, 3, 1, 2), ip_address()).setMaxAccess('readwrite') if mibBuilder.loadTexts: hmAgentSwitchIpInterfaceIpAddress.setStatus('current') hm_agent_switch_ip_interface_net_mask = mib_table_column((1, 3, 6, 1, 4, 1, 248, 15, 2, 2, 3, 1, 3), ip_address()).setMaxAccess('readwrite') if mibBuilder.loadTexts: hmAgentSwitchIpInterfaceNetMask.setStatus('current') hm_agent_switch_ip_interface_clear_ip = mib_table_column((1, 3, 6, 1, 4, 1, 248, 15, 2, 2, 3, 1, 4), integer32().subtype(subtypeSpec=constraints_union(single_value_constraint(1, 2))).clone(namedValues=named_values(('enable', 1), ('disable', 2)))).setMaxAccess('readwrite') if mibBuilder.loadTexts: hmAgentSwitchIpInterfaceClearIp.setStatus('current') hm_agent_switch_ip_interface_routing_mode = mib_table_column((1, 3, 6, 1, 4, 1, 248, 15, 2, 2, 3, 1, 5), integer32().subtype(subtypeSpec=constraints_union(single_value_constraint(1, 2))).clone(namedValues=named_values(('enable', 1), ('disable', 2)))).setMaxAccess('readwrite') if mibBuilder.loadTexts: hmAgentSwitchIpInterfaceRoutingMode.setStatus('current') hm_agent_switch_ip_interface_proxy_arp_mode = mib_table_column((1, 3, 6, 1, 4, 1, 248, 15, 2, 2, 3, 1, 6), integer32().subtype(subtypeSpec=constraints_union(single_value_constraint(1, 2))).clone(namedValues=named_values(('enable', 1), ('disable', 2))).clone('disable')).setMaxAccess('readwrite') if mibBuilder.loadTexts: hmAgentSwitchIpInterfaceProxyARPMode.setStatus('current') hm_agent_switch_ip_interface_mtu_value = mib_table_column((1, 3, 6, 1, 4, 1, 248, 15, 2, 2, 3, 1, 7), unsigned32().subtype(subtypeSpec=constraints_union(value_range_constraint(0, 0), value_range_constraint(68, 9000)))).setMaxAccess('readwrite') if mibBuilder.loadTexts: hmAgentSwitchIpInterfaceMtuValue.setStatus('current') hm_agent_switch_ip_interface_slot_num = mib_table_column((1, 3, 6, 1, 4, 1, 248, 15, 2, 2, 3, 1, 8), integer32()).setMaxAccess('readonly') if mibBuilder.loadTexts: hmAgentSwitchIpInterfaceSlotNum.setStatus('current') hm_agent_switch_ip_interface_port_num = mib_table_column((1, 3, 6, 1, 4, 1, 248, 15, 2, 2, 3, 1, 9), integer32()).setMaxAccess('readonly') if mibBuilder.loadTexts: hmAgentSwitchIpInterfacePortNum.setStatus('current') hm_agent_switch_ip_interface_netdirected_bc_mode = mib_table_column((1, 3, 6, 1, 4, 1, 248, 15, 2, 2, 3, 1, 10), integer32().subtype(subtypeSpec=constraints_union(single_value_constraint(1, 2))).clone(namedValues=named_values(('enable', 1), ('disable', 2))).clone('disable')).setMaxAccess('readwrite') if mibBuilder.loadTexts: hmAgentSwitchIpInterfaceNetdirectedBCMode.setStatus('current') hm_agent_switch_ip_router_discovery_table = mib_table((1, 3, 6, 1, 4, 1, 248, 15, 2, 2, 4)) if mibBuilder.loadTexts: hmAgentSwitchIpRouterDiscoveryTable.setStatus('current') hm_agent_switch_ip_router_discovery_entry = mib_table_row((1, 3, 6, 1, 4, 1, 248, 15, 2, 2, 4, 1)).setIndexNames((0, 'HIRSCHMANN-MMP4-ROUTING-MIB', 'hmAgentSwitchIpRouterDiscoveryIfIndex')) if mibBuilder.loadTexts: hmAgentSwitchIpRouterDiscoveryEntry.setStatus('current') hm_agent_switch_ip_router_discovery_if_index = mib_table_column((1, 3, 6, 1, 4, 1, 248, 15, 2, 2, 4, 1, 1), integer32()).setMaxAccess('readonly') if mibBuilder.loadTexts: hmAgentSwitchIpRouterDiscoveryIfIndex.setStatus('current') hm_agent_switch_ip_router_discovery_advertise_mode = mib_table_column((1, 3, 6, 1, 4, 1, 248, 15, 2, 2, 4, 1, 2), integer32().subtype(subtypeSpec=constraints_union(single_value_constraint(1, 2))).clone(namedValues=named_values(('enable', 1), ('disable', 2))).clone('enable')).setMaxAccess('readwrite') if mibBuilder.loadTexts: hmAgentSwitchIpRouterDiscoveryAdvertiseMode.setStatus('current') hm_agent_switch_ip_router_discovery_max_advertisement_interval = mib_table_column((1, 3, 6, 1, 4, 1, 248, 15, 2, 2, 4, 1, 3), integer32().subtype(subtypeSpec=value_range_constraint(4, 1800)).clone(600)).setMaxAccess('readwrite') if mibBuilder.loadTexts: hmAgentSwitchIpRouterDiscoveryMaxAdvertisementInterval.setStatus('current') hm_agent_switch_ip_router_discovery_min_advertisement_interval = mib_table_column((1, 3, 6, 1, 4, 1, 248, 15, 2, 2, 4, 1, 4), integer32().subtype(subtypeSpec=value_range_constraint(3, 1800)).clone(450)).setMaxAccess('readwrite') if mibBuilder.loadTexts: hmAgentSwitchIpRouterDiscoveryMinAdvertisementInterval.setStatus('current') hm_agent_switch_ip_router_discovery_advertisement_lifetime = mib_table_column((1, 3, 6, 1, 4, 1, 248, 15, 2, 2, 4, 1, 5), integer32().subtype(subtypeSpec=value_range_constraint(4, 9000)).clone(1800)).setMaxAccess('readwrite') if mibBuilder.loadTexts: hmAgentSwitchIpRouterDiscoveryAdvertisementLifetime.setStatus('current') hm_agent_switch_ip_router_discovery_preference_level = mib_table_column((1, 3, 6, 1, 4, 1, 248, 15, 2, 2, 4, 1, 6), integer32()).setMaxAccess('readwrite') if mibBuilder.loadTexts: hmAgentSwitchIpRouterDiscoveryPreferenceLevel.setStatus('current') hm_agent_switch_ip_router_discovery_advertisement_address = mib_table_column((1, 3, 6, 1, 4, 1, 248, 15, 2, 2, 4, 1, 7), ip_address().clone(hexValue='E0000001')).setMaxAccess('readwrite') if mibBuilder.loadTexts: hmAgentSwitchIpRouterDiscoveryAdvertisementAddress.setStatus('current') hm_agent_switch_ip_vlan_table = mib_table((1, 3, 6, 1, 4, 1, 248, 15, 2, 2, 5)) if mibBuilder.loadTexts: hmAgentSwitchIpVlanTable.setStatus('current') hm_agent_switch_ip_vlan_entry = mib_table_row((1, 3, 6, 1, 4, 1, 248, 15, 2, 2, 5, 1)).setIndexNames((0, 'HIRSCHMANN-MMP4-ROUTING-MIB', 'hmAgentSwitchIpVlanId')) if mibBuilder.loadTexts: hmAgentSwitchIpVlanEntry.setStatus('current') hm_agent_switch_ip_vlan_id = mib_table_column((1, 3, 6, 1, 4, 1, 248, 15, 2, 2, 5, 1, 1), integer32()).setMaxAccess('readonly') if mibBuilder.loadTexts: hmAgentSwitchIpVlanId.setStatus('current') hm_agent_switch_ip_vlan_if_index = mib_table_column((1, 3, 6, 1, 4, 1, 248, 15, 2, 2, 5, 1, 2), integer32()).setMaxAccess('readonly') if mibBuilder.loadTexts: hmAgentSwitchIpVlanIfIndex.setStatus('current') hm_agent_switch_ip_vlan_routing_status = mib_table_column((1, 3, 6, 1, 4, 1, 248, 15, 2, 2, 5, 1, 3), row_status()).setMaxAccess('readcreate') if mibBuilder.loadTexts: hmAgentSwitchIpVlanRoutingStatus.setStatus('current') hm_agent_switch_secondary_address_table = mib_table((1, 3, 6, 1, 4, 1, 248, 15, 2, 2, 6)) if mibBuilder.loadTexts: hmAgentSwitchSecondaryAddressTable.setStatus('current') hm_agent_switch_secondary_address_entry = mib_table_row((1, 3, 6, 1, 4, 1, 248, 15, 2, 2, 6, 1)).setIndexNames((0, 'HIRSCHMANN-MMP4-ROUTING-MIB', 'hmAgentSwitchIpInterfaceIfIndex'), (0, 'HIRSCHMANN-MMP4-ROUTING-MIB', 'hmAgentSwitchSecondaryIpAddress')) if mibBuilder.loadTexts: hmAgentSwitchSecondaryAddressEntry.setStatus('current') hm_agent_switch_secondary_ip_address = mib_table_column((1, 3, 6, 1, 4, 1, 248, 15, 2, 2, 6, 1, 1), ip_address()) if mibBuilder.loadTexts: hmAgentSwitchSecondaryIpAddress.setStatus('current') hm_agent_switch_secondary_net_mask = mib_table_column((1, 3, 6, 1, 4, 1, 248, 15, 2, 2, 6, 1, 2), ip_address()).setMaxAccess('readcreate') if mibBuilder.loadTexts: hmAgentSwitchSecondaryNetMask.setStatus('current') hm_agent_switch_secondary_status = mib_table_column((1, 3, 6, 1, 4, 1, 248, 15, 2, 2, 6, 1, 3), row_status()).setMaxAccess('readcreate') if mibBuilder.loadTexts: hmAgentSwitchSecondaryStatus.setStatus('current') hm_agent_switch_ip_route_preference_table = mib_table((1, 3, 6, 1, 4, 1, 248, 15, 2, 2, 7)) if mibBuilder.loadTexts: hmAgentSwitchIpRoutePreferenceTable.setStatus('current') hm_agent_switch_ip_route_preference_entry = mib_table_row((1, 3, 6, 1, 4, 1, 248, 15, 2, 2, 7, 1)).setIndexNames((0, 'HIRSCHMANN-MMP4-ROUTING-MIB', 'hmAgentSwitchIpRoutePreferenceSource')) if mibBuilder.loadTexts: hmAgentSwitchIpRoutePreferenceEntry.setStatus('current') hm_agent_switch_ip_route_preference_source = mib_table_column((1, 3, 6, 1, 4, 1, 248, 15, 2, 2, 7, 1, 1), integer32().subtype(subtypeSpec=constraints_union(single_value_constraint(1, 2, 3, 4, 5, 6, 7))).clone(namedValues=named_values(('connected', 1), ('static', 2), ('ospf-intra', 3), ('ospf-inter', 4), ('ospf-ext-t1', 5), ('ospf-ext-t2', 6), ('rip', 7)))).setMaxAccess('readonly') if mibBuilder.loadTexts: hmAgentSwitchIpRoutePreferenceSource.setStatus('current') hm_agent_switch_ip_route_preference_value = mib_table_column((1, 3, 6, 1, 4, 1, 248, 15, 2, 2, 7, 1, 2), integer32().subtype(subtypeSpec=value_range_constraint(0, 255))).setMaxAccess('readwrite') if mibBuilder.loadTexts: hmAgentSwitchIpRoutePreferenceValue.setStatus('current') hm_agent_switch_ip_route_static_table = mib_table((1, 3, 6, 1, 4, 1, 248, 15, 2, 2, 8)) if mibBuilder.loadTexts: hmAgentSwitchIpRouteStaticTable.setStatus('current') hm_agent_switch_ip_route_static_entry = mib_table_row((1, 3, 6, 1, 4, 1, 248, 15, 2, 2, 8, 1)).setIndexNames((0, 'HIRSCHMANN-MMP4-ROUTING-MIB', 'hmAgentSwitchIpRouteStaticDestination'), (0, 'HIRSCHMANN-MMP4-ROUTING-MIB', 'hmAgentSwitchIpRouteStaticDestinationMask'), (0, 'HIRSCHMANN-MMP4-ROUTING-MIB', 'hmAgentSwitchIpRouteStaticNextHop')) if mibBuilder.loadTexts: hmAgentSwitchIpRouteStaticEntry.setStatus('current') hm_agent_switch_ip_route_static_destination = mib_table_column((1, 3, 6, 1, 4, 1, 248, 15, 2, 2, 8, 1, 1), ip_address()) if mibBuilder.loadTexts: hmAgentSwitchIpRouteStaticDestination.setStatus('current') hm_agent_switch_ip_route_static_destination_mask = mib_table_column((1, 3, 6, 1, 4, 1, 248, 15, 2, 2, 8, 1, 2), ip_address()) if mibBuilder.loadTexts: hmAgentSwitchIpRouteStaticDestinationMask.setStatus('current') hm_agent_switch_ip_route_static_next_hop = mib_table_column((1, 3, 6, 1, 4, 1, 248, 15, 2, 2, 8, 1, 3), ip_address()) if mibBuilder.loadTexts: hmAgentSwitchIpRouteStaticNextHop.setStatus('current') hm_agent_switch_ip_route_static_preference = mib_table_column((1, 3, 6, 1, 4, 1, 248, 15, 2, 2, 8, 1, 4), integer32().subtype(subtypeSpec=value_range_constraint(1, 255))).setMaxAccess('readwrite') if mibBuilder.loadTexts: hmAgentSwitchIpRouteStaticPreference.setStatus('current') hm_agent_switch_ip_route_static_status = mib_table_column((1, 3, 6, 1, 4, 1, 248, 15, 2, 2, 8, 1, 5), row_status()).setMaxAccess('readwrite') if mibBuilder.loadTexts: hmAgentSwitchIpRouteStaticStatus.setStatus('current') hm_agent_switch_ip_route_static_track_id = mib_table_column((1, 3, 6, 1, 4, 1, 248, 15, 2, 2, 8, 1, 6), integer32().subtype(subtypeSpec=value_range_constraint(0, 65535))).setMaxAccess('readwrite') if mibBuilder.loadTexts: hmAgentSwitchIpRouteStaticTrackId.setStatus('current') hm_agent_switch_ip_vlan_single_mac_mode = mib_scalar((1, 3, 6, 1, 4, 1, 248, 15, 2, 2, 100), integer32().subtype(subtypeSpec=constraints_union(single_value_constraint(1, 2))).clone(namedValues=named_values(('enable', 1), ('disable', 2)))).setMaxAccess('readwrite') if mibBuilder.loadTexts: hmAgentSwitchIpVlanSingleMacMode.setStatus('current') hm_agent_switch_ip_table_sizes_group = mib_identifier((1, 3, 6, 1, 4, 1, 248, 15, 2, 2, 101)) hm_agent_switch_ip_table_size_arp = mib_scalar((1, 3, 6, 1, 4, 1, 248, 15, 2, 2, 101, 1), integer32().subtype(subtypeSpec=value_range_constraint(300, 4096))).setMaxAccess('readwrite') if mibBuilder.loadTexts: hmAgentSwitchIpTableSizeArp.setStatus('current') hm_agent_switch_ip_table_size_uc_routes = mib_scalar((1, 3, 6, 1, 4, 1, 248, 15, 2, 2, 101, 2), integer32().subtype(subtypeSpec=value_range_constraint(300, 4096))).setMaxAccess('readwrite') if mibBuilder.loadTexts: hmAgentSwitchIpTableSizeUCRoutes.setStatus('current') hm_agent_switch_ip_table_size_mc_routes = mib_scalar((1, 3, 6, 1, 4, 1, 248, 15, 2, 2, 101, 3), integer32().subtype(subtypeSpec=value_range_constraint(0, 512))).setMaxAccess('readwrite') if mibBuilder.loadTexts: hmAgentSwitchIpTableSizeMCRoutes.setStatus('current') hm_agent_switch_ip_current_table_size_arp = mib_scalar((1, 3, 6, 1, 4, 1, 248, 15, 2, 2, 101, 4), integer32().subtype(subtypeSpec=value_range_constraint(300, 4096))).setMaxAccess('readonly') if mibBuilder.loadTexts: hmAgentSwitchIpCurrentTableSizeArp.setStatus('current') hm_agent_switch_ip_current_table_size_uc_routes = mib_scalar((1, 3, 6, 1, 4, 1, 248, 15, 2, 2, 101, 5), integer32().subtype(subtypeSpec=value_range_constraint(300, 4096))).setMaxAccess('readonly') if mibBuilder.loadTexts: hmAgentSwitchIpCurrentTableSizeUCRoutes.setStatus('current') hm_agent_switch_ip_current_table_size_mc_routes = mib_scalar((1, 3, 6, 1, 4, 1, 248, 15, 2, 2, 101, 6), integer32().subtype(subtypeSpec=value_range_constraint(0, 512))).setMaxAccess('readonly') if mibBuilder.loadTexts: hmAgentSwitchIpCurrentTableSizeMCRoutes.setStatus('current') hm_agent_router_rip_config_group = mib_identifier((1, 3, 6, 1, 4, 1, 248, 15, 2, 3)) hm_agent_router_rip_admin_state = mib_scalar((1, 3, 6, 1, 4, 1, 248, 15, 2, 3, 1), integer32().subtype(subtypeSpec=constraints_union(single_value_constraint(1, 2))).clone(namedValues=named_values(('enable', 1), ('disable', 2)))).setMaxAccess('readwrite') if mibBuilder.loadTexts: hmAgentRouterRipAdminState.setStatus('current') hm_agent_router_rip_split_horizon_mode = mib_scalar((1, 3, 6, 1, 4, 1, 248, 15, 2, 3, 2), integer32().subtype(subtypeSpec=constraints_union(single_value_constraint(1, 2, 3))).clone(namedValues=named_values(('none', 1), ('simple', 2), ('poisonReverse', 3))).clone('simple')).setMaxAccess('readwrite') if mibBuilder.loadTexts: hmAgentRouterRipSplitHorizonMode.setStatus('current') hm_agent_router_rip_auto_summary_mode = mib_scalar((1, 3, 6, 1, 4, 1, 248, 15, 2, 3, 3), integer32().subtype(subtypeSpec=constraints_union(single_value_constraint(1, 2))).clone(namedValues=named_values(('enable', 1), ('disable', 2))).clone('enable')).setMaxAccess('readwrite') if mibBuilder.loadTexts: hmAgentRouterRipAutoSummaryMode.setStatus('current') hm_agent_router_rip_host_routes_accept_mode = mib_scalar((1, 3, 6, 1, 4, 1, 248, 15, 2, 3, 4), integer32().subtype(subtypeSpec=constraints_union(single_value_constraint(1, 2))).clone(namedValues=named_values(('enable', 1), ('disable', 2))).clone('enable')).setMaxAccess('readwrite') if mibBuilder.loadTexts: hmAgentRouterRipHostRoutesAcceptMode.setStatus('current') hm_agent_router_rip_default_metric = mib_scalar((1, 3, 6, 1, 4, 1, 248, 15, 2, 3, 5), integer32().subtype(subtypeSpec=value_range_constraint(0, 15))).setMaxAccess('readwrite') if mibBuilder.loadTexts: hmAgentRouterRipDefaultMetric.setStatus('current') hm_agent_router_rip_default_metric_configured = mib_scalar((1, 3, 6, 1, 4, 1, 248, 15, 2, 3, 6), truth_value()).setMaxAccess('readwrite') if mibBuilder.loadTexts: hmAgentRouterRipDefaultMetricConfigured.setStatus('current') hm_agent_router_rip_default_info_originate = mib_scalar((1, 3, 6, 1, 4, 1, 248, 15, 2, 3, 7), truth_value().clone('false')).setMaxAccess('readwrite') if mibBuilder.loadTexts: hmAgentRouterRipDefaultInfoOriginate.setStatus('current') hm_agent_rip_route_redist_table = mib_table((1, 3, 6, 1, 4, 1, 248, 15, 2, 3, 8)) if mibBuilder.loadTexts: hmAgentRipRouteRedistTable.setStatus('current') hm_agent_rip_route_redist_entry = mib_table_row((1, 3, 6, 1, 4, 1, 248, 15, 2, 3, 8, 1)).setIndexNames((0, 'HIRSCHMANN-MMP4-ROUTING-MIB', 'hmAgentRipRouteRedistSource')) if mibBuilder.loadTexts: hmAgentRipRouteRedistEntry.setStatus('current') hm_agent_rip_route_redist_source = mib_table_column((1, 3, 6, 1, 4, 1, 248, 15, 2, 3, 8, 1, 1), integer32().subtype(subtypeSpec=constraints_union(single_value_constraint(1, 2, 3, 4))).clone(namedValues=named_values(('connected', 1), ('static', 2), ('ospf', 3), ('bgp', 4)))).setMaxAccess('readonly') if mibBuilder.loadTexts: hmAgentRipRouteRedistSource.setStatus('current') hm_agent_rip_route_redist_mode = mib_table_column((1, 3, 6, 1, 4, 1, 248, 15, 2, 3, 8, 1, 2), integer32().subtype(subtypeSpec=constraints_union(single_value_constraint(1, 2))).clone(namedValues=named_values(('enable', 1), ('disable', 2))).clone('disable')).setMaxAccess('readwrite') if mibBuilder.loadTexts: hmAgentRipRouteRedistMode.setStatus('current') hm_agent_rip_route_redist_metric = mib_table_column((1, 3, 6, 1, 4, 1, 248, 15, 2, 3, 8, 1, 3), integer32().subtype(subtypeSpec=value_range_constraint(0, 15))).setMaxAccess('readwrite') if mibBuilder.loadTexts: hmAgentRipRouteRedistMetric.setStatus('current') hm_agent_rip_route_redist_metric_configured = mib_table_column((1, 3, 6, 1, 4, 1, 248, 15, 2, 3, 8, 1, 4), truth_value()).setMaxAccess('readwrite') if mibBuilder.loadTexts: hmAgentRipRouteRedistMetricConfigured.setStatus('current') hm_agent_rip_route_redist_match_internal = mib_table_column((1, 3, 6, 1, 4, 1, 248, 15, 2, 3, 8, 1, 5), integer32().subtype(subtypeSpec=constraints_union(single_value_constraint(1, 2, 3))).clone(namedValues=named_values(('true', 1), ('false', 2), ('not-applicable', 3)))).setMaxAccess('readwrite') if mibBuilder.loadTexts: hmAgentRipRouteRedistMatchInternal.setStatus('current') hm_agent_rip_route_redist_match_external1 = mib_table_column((1, 3, 6, 1, 4, 1, 248, 15, 2, 3, 8, 1, 6), integer32().subtype(subtypeSpec=constraints_union(single_value_constraint(1, 2, 3))).clone(namedValues=named_values(('true', 1), ('false', 2), ('not-applicable', 3)))).setMaxAccess('readwrite') if mibBuilder.loadTexts: hmAgentRipRouteRedistMatchExternal1.setStatus('current') hm_agent_rip_route_redist_match_external2 = mib_table_column((1, 3, 6, 1, 4, 1, 248, 15, 2, 3, 8, 1, 7), integer32().subtype(subtypeSpec=constraints_union(single_value_constraint(1, 2, 3))).clone(namedValues=named_values(('true', 1), ('false', 2), ('not-applicable', 3)))).setMaxAccess('readwrite') if mibBuilder.loadTexts: hmAgentRipRouteRedistMatchExternal2.setStatus('current') hm_agent_rip_route_redist_match_nssa_external1 = mib_table_column((1, 3, 6, 1, 4, 1, 248, 15, 2, 3, 8, 1, 8), integer32().subtype(subtypeSpec=constraints_union(single_value_constraint(1, 2, 3))).clone(namedValues=named_values(('true', 1), ('false', 2), ('not-applicable', 3)))).setMaxAccess('readwrite') if mibBuilder.loadTexts: hmAgentRipRouteRedistMatchNSSAExternal1.setStatus('current') hm_agent_rip_route_redist_match_nssa_external2 = mib_table_column((1, 3, 6, 1, 4, 1, 248, 15, 2, 3, 8, 1, 9), integer32().subtype(subtypeSpec=constraints_union(single_value_constraint(1, 2, 3))).clone(namedValues=named_values(('true', 1), ('false', 2), ('not-applicable', 3)))).setMaxAccess('readwrite') if mibBuilder.loadTexts: hmAgentRipRouteRedistMatchNSSAExternal2.setStatus('current') hm_agent_rip_route_redist_dist_list = mib_table_column((1, 3, 6, 1, 4, 1, 248, 15, 2, 3, 8, 1, 10), unsigned32().subtype(subtypeSpec=value_range_constraint(1, 199))).setMaxAccess('readwrite') if mibBuilder.loadTexts: hmAgentRipRouteRedistDistList.setStatus('current') hm_agent_rip_route_redist_dist_list_configured = mib_table_column((1, 3, 6, 1, 4, 1, 248, 15, 2, 3, 8, 1, 11), truth_value()).setMaxAccess('readwrite') if mibBuilder.loadTexts: hmAgentRipRouteRedistDistListConfigured.setStatus('current') hm_agent_rip2_if_conf_table = mib_table((1, 3, 6, 1, 4, 1, 248, 15, 2, 3, 9)) if mibBuilder.loadTexts: hmAgentRip2IfConfTable.setStatus('current') hm_agent_rip2_if_conf_entry = mib_table_row((1, 3, 6, 1, 4, 1, 248, 15, 2, 3, 9, 1)) rip2IfConfEntry.registerAugmentions(('HIRSCHMANN-MMP4-ROUTING-MIB', 'hmAgentRip2IfConfEntry')) hmAgentRip2IfConfEntry.setIndexNames(*rip2IfConfEntry.getIndexNames()) if mibBuilder.loadTexts: hmAgentRip2IfConfEntry.setStatus('current') hm_agent_rip2_if_conf_auth_key_id = mib_table_column((1, 3, 6, 1, 4, 1, 248, 15, 2, 3, 9, 1, 1), integer32().subtype(subtypeSpec=value_range_constraint(0, 255))).setMaxAccess('readcreate') if mibBuilder.loadTexts: hmAgentRip2IfConfAuthKeyId.setStatus('current') hm_agent_rip2_interface_table = mib_table((1, 3, 6, 1, 4, 1, 248, 15, 2, 3, 10)) if mibBuilder.loadTexts: hmAgentRip2InterfaceTable.setStatus('current') hm_agent_rip2_interface_entry = mib_table_row((1, 3, 6, 1, 4, 1, 248, 15, 2, 3, 10, 1)).setIndexNames((0, 'HIRSCHMANN-MMP4-ROUTING-MIB', 'hmAgentRip2InterfaceIfIndex')) if mibBuilder.loadTexts: hmAgentRip2InterfaceEntry.setStatus('current') hm_agent_rip2_interface_if_index = mib_table_column((1, 3, 6, 1, 4, 1, 248, 15, 2, 3, 10, 1, 1), integer32()).setMaxAccess('readonly') if mibBuilder.loadTexts: hmAgentRip2InterfaceIfIndex.setStatus('current') hm_agent_rip2_interface_auth_type = mib_table_column((1, 3, 6, 1, 4, 1, 248, 15, 2, 3, 10, 1, 2), integer32().subtype(subtypeSpec=constraints_union(single_value_constraint(1, 2, 3))).clone(namedValues=named_values(('noAuthentication', 1), ('simplePassword', 2), ('md5', 3)))).setMaxAccess('readwrite') if mibBuilder.loadTexts: hmAgentRip2InterfaceAuthType.setStatus('current') hm_agent_rip2_interface_auth_key = mib_table_column((1, 3, 6, 1, 4, 1, 248, 15, 2, 3, 10, 1, 3), octet_string().subtype(subtypeSpec=value_size_constraint(0, 16))).setMaxAccess('readwrite') if mibBuilder.loadTexts: hmAgentRip2InterfaceAuthKey.setStatus('current') hm_agent_rip2_interface_auth_key_id = mib_table_column((1, 3, 6, 1, 4, 1, 248, 15, 2, 3, 10, 1, 4), integer32().subtype(subtypeSpec=value_range_constraint(0, 255))).setMaxAccess('readwrite') if mibBuilder.loadTexts: hmAgentRip2InterfaceAuthKeyId.setStatus('current') hm_agent_rip2_interface_send_version = mib_table_column((1, 3, 6, 1, 4, 1, 248, 15, 2, 3, 10, 1, 5), integer32().subtype(subtypeSpec=constraints_union(single_value_constraint(1, 2, 3, 4))).clone(namedValues=named_values(('doNotSend', 1), ('ripVersion1', 2), ('rip1Compatible', 3), ('ripVersion2', 4)))).setMaxAccess('readwrite') if mibBuilder.loadTexts: hmAgentRip2InterfaceSendVersion.setStatus('current') hm_agent_rip2_interface_receive_version = mib_table_column((1, 3, 6, 1, 4, 1, 248, 15, 2, 3, 10, 1, 6), integer32().subtype(subtypeSpec=constraints_union(single_value_constraint(1, 2, 3, 4))).clone(namedValues=named_values(('rip1', 1), ('rip2', 2), ('rip1OrRip2', 3), ('doNotReceive', 4)))).setMaxAccess('readwrite') if mibBuilder.loadTexts: hmAgentRip2InterfaceReceiveVersion.setStatus('current') hm_agent_rip2_interface_admin_state = mib_table_column((1, 3, 6, 1, 4, 1, 248, 15, 2, 3, 10, 1, 7), integer32().subtype(subtypeSpec=constraints_union(single_value_constraint(1, 2))).clone(namedValues=named_values(('enable', 1), ('disable', 2)))).setMaxAccess('readwrite') if mibBuilder.loadTexts: hmAgentRip2InterfaceAdminState.setStatus('current') hm_agent_rip2_rcv_bad_packets = mib_table_column((1, 3, 6, 1, 4, 1, 248, 15, 2, 3, 10, 1, 8), counter32()).setMaxAccess('readonly') if mibBuilder.loadTexts: hmAgentRip2RcvBadPackets.setStatus('current') hm_agent_rip2_rcv_bad_routes = mib_table_column((1, 3, 6, 1, 4, 1, 248, 15, 2, 3, 10, 1, 9), counter32()).setMaxAccess('readonly') if mibBuilder.loadTexts: hmAgentRip2RcvBadRoutes.setStatus('current') hm_agent_rip2_sent_updates = mib_table_column((1, 3, 6, 1, 4, 1, 248, 15, 2, 3, 10, 1, 10), counter32()).setMaxAccess('readonly') if mibBuilder.loadTexts: hmAgentRip2SentUpdates.setStatus('current') hm_agent_router_rip_update_timer_interval = mib_scalar((1, 3, 6, 1, 4, 1, 248, 15, 2, 3, 50), integer32().subtype(subtypeSpec=value_range_constraint(1, 1000)).clone(30)).setMaxAccess('readwrite') if mibBuilder.loadTexts: hmAgentRouterRipUpdateTimerInterval.setStatus('current') hm_agent_router_ospf_config_group = mib_identifier((1, 3, 6, 1, 4, 1, 248, 15, 2, 4)) hm_agent_ospf_default_metric = mib_scalar((1, 3, 6, 1, 4, 1, 248, 15, 2, 4, 1), integer32().subtype(subtypeSpec=value_range_constraint(1, 16777215))).setMaxAccess('readwrite') if mibBuilder.loadTexts: hmAgentOspfDefaultMetric.setStatus('current') hm_agent_ospf_default_metric_configured = mib_scalar((1, 3, 6, 1, 4, 1, 248, 15, 2, 4, 2), truth_value()).setMaxAccess('readwrite') if mibBuilder.loadTexts: hmAgentOspfDefaultMetricConfigured.setStatus('current') hm_agent_ospf_default_info_originate = mib_scalar((1, 3, 6, 1, 4, 1, 248, 15, 2, 4, 3), truth_value().clone('false')).setMaxAccess('readwrite') if mibBuilder.loadTexts: hmAgentOspfDefaultInfoOriginate.setStatus('current') hm_agent_ospf_default_info_originate_always = mib_scalar((1, 3, 6, 1, 4, 1, 248, 15, 2, 4, 4), truth_value().clone('false')).setMaxAccess('readwrite') if mibBuilder.loadTexts: hmAgentOspfDefaultInfoOriginateAlways.setStatus('current') hm_agent_ospf_default_info_originate_metric = mib_scalar((1, 3, 6, 1, 4, 1, 248, 15, 2, 4, 5), integer32().subtype(subtypeSpec=value_range_constraint(0, 16777215)).clone(10)).setMaxAccess('readwrite') if mibBuilder.loadTexts: hmAgentOspfDefaultInfoOriginateMetric.setStatus('current') hm_agent_ospf_default_info_originate_metric_configured = mib_scalar((1, 3, 6, 1, 4, 1, 248, 15, 2, 4, 6), truth_value()).setMaxAccess('readwrite') if mibBuilder.loadTexts: hmAgentOspfDefaultInfoOriginateMetricConfigured.setStatus('current') hm_agent_ospf_default_info_originate_metric_type = mib_scalar((1, 3, 6, 1, 4, 1, 248, 15, 2, 4, 7), integer32().subtype(subtypeSpec=constraints_union(single_value_constraint(1, 2))).clone(namedValues=named_values(('externalType1', 1), ('externalType2', 2))).clone(2)).setMaxAccess('readwrite') if mibBuilder.loadTexts: hmAgentOspfDefaultInfoOriginateMetricType.setStatus('current') hm_agent_ospf_route_redist_table = mib_table((1, 3, 6, 1, 4, 1, 248, 15, 2, 4, 8)) if mibBuilder.loadTexts: hmAgentOspfRouteRedistTable.setStatus('current') hm_agent_ospf_route_redist_entry = mib_table_row((1, 3, 6, 1, 4, 1, 248, 15, 2, 4, 8, 1)).setIndexNames((0, 'HIRSCHMANN-MMP4-ROUTING-MIB', 'hmAgentOspfRouteRedistSource')) if mibBuilder.loadTexts: hmAgentOspfRouteRedistEntry.setStatus('current') hm_agent_ospf_route_redist_source = mib_table_column((1, 3, 6, 1, 4, 1, 248, 15, 2, 4, 8, 1, 1), integer32().subtype(subtypeSpec=constraints_union(single_value_constraint(1, 2, 3, 4))).clone(namedValues=named_values(('connected', 1), ('static', 2), ('rip', 3), ('bgp', 4)))).setMaxAccess('readonly') if mibBuilder.loadTexts: hmAgentOspfRouteRedistSource.setStatus('current') hm_agent_ospf_route_redist_mode = mib_table_column((1, 3, 6, 1, 4, 1, 248, 15, 2, 4, 8, 1, 2), integer32().subtype(subtypeSpec=constraints_union(single_value_constraint(1, 2))).clone(namedValues=named_values(('enable', 1), ('disable', 2))).clone('disable')).setMaxAccess('readwrite') if mibBuilder.loadTexts: hmAgentOspfRouteRedistMode.setStatus('current') hm_agent_ospf_route_redist_metric = mib_table_column((1, 3, 6, 1, 4, 1, 248, 15, 2, 4, 8, 1, 3), integer32().subtype(subtypeSpec=value_range_constraint(0, 16777215))).setMaxAccess('readwrite') if mibBuilder.loadTexts: hmAgentOspfRouteRedistMetric.setStatus('current') hm_agent_ospf_route_redist_metric_configured = mib_table_column((1, 3, 6, 1, 4, 1, 248, 15, 2, 4, 8, 1, 4), truth_value()).setMaxAccess('readwrite') if mibBuilder.loadTexts: hmAgentOspfRouteRedistMetricConfigured.setStatus('current') hm_agent_ospf_route_redist_metric_type = mib_table_column((1, 3, 6, 1, 4, 1, 248, 15, 2, 4, 8, 1, 5), integer32().subtype(subtypeSpec=constraints_union(single_value_constraint(1, 2))).clone(namedValues=named_values(('externalType1', 1), ('externalType2', 2))).clone('externalType2')).setMaxAccess('readwrite') if mibBuilder.loadTexts: hmAgentOspfRouteRedistMetricType.setStatus('current') hm_agent_ospf_route_redist_tag = mib_table_column((1, 3, 6, 1, 4, 1, 248, 15, 2, 4, 8, 1, 6), unsigned32().subtype(subtypeSpec=value_range_constraint(0, 4294967295))).setMaxAccess('readwrite') if mibBuilder.loadTexts: hmAgentOspfRouteRedistTag.setStatus('current') hm_agent_ospf_route_redist_subnets = mib_table_column((1, 3, 6, 1, 4, 1, 248, 15, 2, 4, 8, 1, 7), truth_value().clone('false')).setMaxAccess('readwrite') if mibBuilder.loadTexts: hmAgentOspfRouteRedistSubnets.setStatus('current') hm_agent_ospf_route_redist_dist_list = mib_table_column((1, 3, 6, 1, 4, 1, 248, 15, 2, 4, 8, 1, 8), unsigned32().subtype(subtypeSpec=value_range_constraint(1, 199))).setMaxAccess('readwrite') if mibBuilder.loadTexts: hmAgentOspfRouteRedistDistList.setStatus('current') hm_agent_ospf_route_redist_dist_list_configured = mib_table_column((1, 3, 6, 1, 4, 1, 248, 15, 2, 4, 8, 1, 9), truth_value()).setMaxAccess('readwrite') if mibBuilder.loadTexts: hmAgentOspfRouteRedistDistListConfigured.setStatus('current') hm_agent_ospf_if_table = mib_table((1, 3, 6, 1, 4, 1, 248, 15, 2, 4, 9)) if mibBuilder.loadTexts: hmAgentOspfIfTable.setStatus('current') hm_agent_ospf_if_entry = mib_table_row((1, 3, 6, 1, 4, 1, 248, 15, 2, 4, 9, 1)) ospfIfEntry.registerAugmentions(('HIRSCHMANN-MMP4-ROUTING-MIB', 'hmAgentOspfIfEntry')) hmAgentOspfIfEntry.setIndexNames(*ospfIfEntry.getIndexNames()) if mibBuilder.loadTexts: hmAgentOspfIfEntry.setStatus('current') hm_agent_ospf_if_auth_key_id = mib_table_column((1, 3, 6, 1, 4, 1, 248, 15, 2, 4, 9, 1, 1), integer32().subtype(subtypeSpec=value_range_constraint(0, 255))).setMaxAccess('readcreate') if mibBuilder.loadTexts: hmAgentOspfIfAuthKeyId.setStatus('current') hm_agent_ospf_if_ip_mtu_ignore_flag = mib_table_column((1, 3, 6, 1, 4, 1, 248, 15, 2, 4, 9, 1, 2), integer32().subtype(subtypeSpec=constraints_union(single_value_constraint(1, 2))).clone(namedValues=named_values(('enable', 1), ('disable', 2)))).setMaxAccess('readwrite') if mibBuilder.loadTexts: hmAgentOspfIfIpMtuIgnoreFlag.setStatus('current') hm_agent_ospf_virt_if_table = mib_table((1, 3, 6, 1, 4, 1, 248, 15, 2, 4, 10)) if mibBuilder.loadTexts: hmAgentOspfVirtIfTable.setStatus('current') hm_agent_ospf_virt_if_entry = mib_table_row((1, 3, 6, 1, 4, 1, 248, 15, 2, 4, 10, 1)) ospfVirtIfEntry.registerAugmentions(('HIRSCHMANN-MMP4-ROUTING-MIB', 'hmAgentOspfVirtIfEntry')) hmAgentOspfVirtIfEntry.setIndexNames(*ospfVirtIfEntry.getIndexNames()) if mibBuilder.loadTexts: hmAgentOspfVirtIfEntry.setStatus('current') hm_agent_ospf_virt_if_auth_key_id = mib_table_column((1, 3, 6, 1, 4, 1, 248, 15, 2, 4, 10, 1, 1), integer32().subtype(subtypeSpec=value_range_constraint(0, 255))).setMaxAccess('readcreate') if mibBuilder.loadTexts: hmAgentOspfVirtIfAuthKeyId.setStatus('current') hm_agent_router_ospf_rfc1583_compatibility_mode = mib_scalar((1, 3, 6, 1, 4, 1, 248, 15, 2, 4, 11), integer32().subtype(subtypeSpec=constraints_union(single_value_constraint(1, 2))).clone(namedValues=named_values(('enable', 1), ('disable', 2))).clone('enable')).setMaxAccess('readwrite') if mibBuilder.loadTexts: hmAgentRouterOspfRFC1583CompatibilityMode.setStatus('current') hm_agent_snmp_trap_flags_config_group_layer3 = mib_identifier((1, 3, 6, 1, 4, 1, 248, 15, 2, 5)) hm_agent_snmp_vrrp_new_master_trap_flag = mib_scalar((1, 3, 6, 1, 4, 1, 248, 15, 2, 5, 1), integer32().subtype(subtypeSpec=constraints_union(single_value_constraint(1, 2))).clone(namedValues=named_values(('enable', 1), ('disable', 2)))).setMaxAccess('readwrite') if mibBuilder.loadTexts: hmAgentSnmpVRRPNewMasterTrapFlag.setStatus('current') hm_agent_snmp_vrrp_auth_failure_trap_flag = mib_scalar((1, 3, 6, 1, 4, 1, 248, 15, 2, 5, 2), integer32().subtype(subtypeSpec=constraints_union(single_value_constraint(1, 2))).clone(namedValues=named_values(('enable', 1), ('disable', 2)))).setMaxAccess('readwrite') if mibBuilder.loadTexts: hmAgentSnmpVRRPAuthFailureTrapFlag.setStatus('current') hm_agent_ecmp_group = mib_identifier((1, 3, 6, 1, 4, 1, 248, 15, 2, 7)) hm_agent_ecmp_ospf_max_paths = mib_scalar((1, 3, 6, 1, 4, 1, 248, 15, 2, 7, 1), integer32().clone(4)).setMaxAccess('readwrite') if mibBuilder.loadTexts: hmAgentECMPOspfMaxPaths.setStatus('current') hm_agent_router_vrrp_config_group = mib_identifier((1, 3, 6, 1, 4, 1, 248, 15, 2, 8)) hm_agent_router_vrrp_admin_state = mib_scalar((1, 3, 6, 1, 4, 1, 248, 15, 2, 8, 1), integer32().subtype(subtypeSpec=constraints_union(single_value_constraint(1, 2))).clone(namedValues=named_values(('enable', 1), ('disable', 2)))).setMaxAccess('readwrite') if mibBuilder.loadTexts: hmAgentRouterVrrpAdminState.setStatus('current') hm_vrrp_ext_group = mib_identifier((1, 3, 6, 1, 4, 1, 248, 15, 2, 9)) hm_vrrp_tracking_table = mib_table((1, 3, 6, 1, 4, 1, 248, 15, 2, 9, 1)) if mibBuilder.loadTexts: hmVrrpTrackingTable.setStatus('current') hm_vrrp_tracking_entry = mib_table_row((1, 3, 6, 1, 4, 1, 248, 15, 2, 9, 1, 1)).setIndexNames((0, 'HIRSCHMANN-MMP4-ROUTING-MIB', 'hmVrrpTrackIfIndex'), (0, 'HIRSCHMANN-MMP4-ROUTING-MIB', 'hmVrrpTrackVrid'), (0, 'HIRSCHMANN-MMP4-ROUTING-MIB', 'hmVrrpTrackId')) if mibBuilder.loadTexts: hmVrrpTrackingEntry.setStatus('current') hm_vrrp_track_if_index = mib_table_column((1, 3, 6, 1, 4, 1, 248, 15, 2, 9, 1, 1, 1), integer32()) if mibBuilder.loadTexts: hmVrrpTrackIfIndex.setStatus('current') hm_vrrp_track_vrid = mib_table_column((1, 3, 6, 1, 4, 1, 248, 15, 2, 9, 1, 1, 2), integer32().subtype(subtypeSpec=value_range_constraint(1, 255))) if mibBuilder.loadTexts: hmVrrpTrackVrid.setStatus('current') hm_vrrp_track_id = mib_table_column((1, 3, 6, 1, 4, 1, 248, 15, 2, 9, 1, 1, 3), integer32()) if mibBuilder.loadTexts: hmVrrpTrackId.setStatus('current') hm_vrrp_track_decrement = mib_table_column((1, 3, 6, 1, 4, 1, 248, 15, 2, 9, 1, 1, 4), integer32().subtype(subtypeSpec=value_range_constraint(1, 253))).setMaxAccess('readwrite') if mibBuilder.loadTexts: hmVrrpTrackDecrement.setStatus('current') hm_vrrp_track_oper_status = mib_table_column((1, 3, 6, 1, 4, 1, 248, 15, 2, 9, 1, 1, 5), integer32().subtype(subtypeSpec=constraints_union(single_value_constraint(1, 2))).clone(namedValues=named_values(('up', 1), ('down', 2)))).setMaxAccess('readonly') if mibBuilder.loadTexts: hmVrrpTrackOperStatus.setStatus('current') hm_vrrp_track_row_status = mib_table_column((1, 3, 6, 1, 4, 1, 248, 15, 2, 9, 1, 1, 6), row_status()).setMaxAccess('readcreate') if mibBuilder.loadTexts: hmVrrpTrackRowStatus.setStatus('current') hm_vrrp_ext_table = mib_table((1, 3, 6, 1, 4, 1, 248, 15, 2, 9, 2)) if mibBuilder.loadTexts: hmVrrpExtTable.setStatus('current') hm_vrrp_ext_entry = mib_table_row((1, 3, 6, 1, 4, 1, 248, 15, 2, 9, 2, 1)).setIndexNames((0, 'HIRSCHMANN-MMP4-ROUTING-MIB', 'hmVrrpExtIfIndex'), (0, 'HIRSCHMANN-MMP4-ROUTING-MIB', 'hmVrrpExtVrid')) if mibBuilder.loadTexts: hmVrrpExtEntry.setStatus('current') hm_vrrp_ext_if_index = mib_table_column((1, 3, 6, 1, 4, 1, 248, 15, 2, 9, 2, 1, 1), integer32()) if mibBuilder.loadTexts: hmVrrpExtIfIndex.setStatus('current') hm_vrrp_ext_vrid = mib_table_column((1, 3, 6, 1, 4, 1, 248, 15, 2, 9, 2, 1, 2), integer32().subtype(subtypeSpec=value_range_constraint(1, 255))) if mibBuilder.loadTexts: hmVrrpExtVrid.setStatus('current') hm_vrrp_ext_domain_id = mib_table_column((1, 3, 6, 1, 4, 1, 248, 15, 2, 9, 2, 1, 3), integer32().subtype(subtypeSpec=value_range_constraint(0, 8))).setMaxAccess('readwrite') if mibBuilder.loadTexts: hmVrrpExtDomainId.setStatus('current') hm_vrrp_ext_domain_role = mib_table_column((1, 3, 6, 1, 4, 1, 248, 15, 2, 9, 2, 1, 4), integer32().subtype(subtypeSpec=constraints_union(single_value_constraint(1, 2, 3))).clone(namedValues=named_values(('none', 1), ('member', 2), ('supervisor', 3)))).setMaxAccess('readwrite') if mibBuilder.loadTexts: hmVrrpExtDomainRole.setStatus('current') hm_vrrp_ext_domain_status = mib_table_column((1, 3, 6, 1, 4, 1, 248, 15, 2, 9, 2, 1, 5), integer32().subtype(subtypeSpec=constraints_union(single_value_constraint(1, 2, 3))).clone(namedValues=named_values(('noError', 1), ('noSupervisor', 2), ('supervisorDown', 3)))).setMaxAccess('readonly') if mibBuilder.loadTexts: hmVrrpExtDomainStatus.setStatus('current') hm_vrrp_ext_advert_address = mib_table_column((1, 3, 6, 1, 4, 1, 248, 15, 2, 9, 2, 1, 6), ip_address()).setMaxAccess('readwrite') if mibBuilder.loadTexts: hmVrrpExtAdvertAddress.setStatus('current') hm_vrrp_ext_advert_timer = mib_table_column((1, 3, 6, 1, 4, 1, 248, 15, 2, 9, 2, 1, 7), integer32().subtype(subtypeSpec=value_range_constraint(100, 255000))).setUnits('milliseconds').setMaxAccess('readwrite') if mibBuilder.loadTexts: hmVrrpExtAdvertTimer.setStatus('current') hm_vrrp_ext_oper_priority = mib_table_column((1, 3, 6, 1, 4, 1, 248, 15, 2, 9, 2, 1, 8), integer32().subtype(subtypeSpec=value_range_constraint(1, 255))).setMaxAccess('readonly') if mibBuilder.loadTexts: hmVrrpExtOperPriority.setStatus('current') hm_vrrp_ext_notify_address = mib_table_column((1, 3, 6, 1, 4, 1, 248, 15, 2, 9, 2, 1, 9), ip_address()).setMaxAccess('readwrite') if mibBuilder.loadTexts: hmVrrpExtNotifyAddress.setStatus('current') hm_vrrp_ext_notify_linkdown = mib_table_column((1, 3, 6, 1, 4, 1, 248, 15, 2, 9, 2, 1, 10), integer32().subtype(subtypeSpec=constraints_union(single_value_constraint(1, 2))).clone(namedValues=named_values(('enable', 1), ('disable', 2)))).setMaxAccess('readwrite') if mibBuilder.loadTexts: hmVrrpExtNotifyLinkdown.setStatus('current') hm_vrrp_ext_preemption_delay = mib_table_column((1, 3, 6, 1, 4, 1, 248, 15, 2, 9, 2, 1, 11), integer32().subtype(subtypeSpec=value_range_constraint(0, 65535))).setMaxAccess('readwrite') if mibBuilder.loadTexts: hmVrrpExtPreemptionDelay.setStatus('current') hm_vrrp_domain_table = mib_table((1, 3, 6, 1, 4, 1, 248, 15, 2, 9, 3)) if mibBuilder.loadTexts: hmVrrpDomainTable.setStatus('current') hm_vrrp_domain_entry = mib_table_row((1, 3, 6, 1, 4, 1, 248, 15, 2, 9, 3, 1)).setIndexNames((0, 'HIRSCHMANN-MMP4-ROUTING-MIB', 'hmVrrpDomainId')) if mibBuilder.loadTexts: hmVrrpDomainEntry.setStatus('current') hm_vrrp_domain_id = mib_table_column((1, 3, 6, 1, 4, 1, 248, 15, 2, 9, 3, 1, 1), integer32().subtype(subtypeSpec=value_range_constraint(0, 8))) if mibBuilder.loadTexts: hmVrrpDomainId.setStatus('current') hm_vrrp_domain_member_send_adv = mib_table_column((1, 3, 6, 1, 4, 1, 248, 15, 2, 9, 3, 1, 2), integer32().subtype(subtypeSpec=constraints_union(single_value_constraint(1, 2))).clone(namedValues=named_values(('enabled', 1), ('disabled', 2)))).setMaxAccess('readwrite') if mibBuilder.loadTexts: hmVrrpDomainMemberSendAdv.setStatus('current') hm_vrrp_domain_status = mib_table_column((1, 3, 6, 1, 4, 1, 248, 15, 2, 9, 3, 1, 3), integer32().subtype(subtypeSpec=constraints_union(single_value_constraint(1, 2, 3))).clone(namedValues=named_values(('noError', 1), ('noSupervisor', 2), ('supervisorDown', 3)))).setMaxAccess('readonly') if mibBuilder.loadTexts: hmVrrpDomainStatus.setStatus('current') hm_vrrp_domain_supervisor_if_index = mib_table_column((1, 3, 6, 1, 4, 1, 248, 15, 2, 9, 3, 1, 4), integer32()).setMaxAccess('readonly') if mibBuilder.loadTexts: hmVrrpDomainSupervisorIfIndex.setStatus('current') hm_vrrp_domain_supervisor_vrid = mib_table_column((1, 3, 6, 1, 4, 1, 248, 15, 2, 9, 3, 1, 5), integer32().subtype(subtypeSpec=value_range_constraint(0, 255))).setMaxAccess('readonly') if mibBuilder.loadTexts: hmVrrpDomainSupervisorVrid.setStatus('current') hm_vrrp_domain_oper_priority = mib_table_column((1, 3, 6, 1, 4, 1, 248, 15, 2, 9, 3, 1, 6), integer32().subtype(subtypeSpec=value_range_constraint(0, 255))).setMaxAccess('readonly') if mibBuilder.loadTexts: hmVrrpDomainOperPriority.setStatus('current') hm_vrrp_domain_supervisor_oper_state = mib_table_column((1, 3, 6, 1, 4, 1, 248, 15, 2, 9, 3, 1, 7), integer32().subtype(subtypeSpec=constraints_union(single_value_constraint(1, 2, 3, 4))).clone(namedValues=named_values(('initialize', 1), ('backup', 2), ('master', 3), ('unknown', 4)))).setMaxAccess('readonly') if mibBuilder.loadTexts: hmVrrpDomainSupervisorOperState.setStatus('current') mibBuilder.exportSymbols('HIRSCHMANN-MMP4-ROUTING-MIB', hmAgentOspfDefaultInfoOriginateMetricType=hmAgentOspfDefaultInfoOriginateMetricType, hmAgentRouterOspfRFC1583CompatibilityMode=hmAgentRouterOspfRFC1583CompatibilityMode, hmAgentSwitchIpRouteStaticDestinationMask=hmAgentSwitchIpRouteStaticDestinationMask, hmAgentOspfRouteRedistMetricConfigured=hmAgentOspfRouteRedistMetricConfigured, hmAgentSwitchSecondaryAddressEntry=hmAgentSwitchSecondaryAddressEntry, hmAgentOspfIfEntry=hmAgentOspfIfEntry, hmVrrpDomainEntry=hmVrrpDomainEntry, hmVrrpDomainOperPriority=hmVrrpDomainOperPriority, hmAgentSwitchArpAge=hmAgentSwitchArpAge, hmAgentOspfRouteRedistSource=hmAgentOspfRouteRedistSource, hmAgentRipRouteRedistTable=hmAgentRipRouteRedistTable, hmAgentRipRouteRedistMatchExternal2=hmAgentRipRouteRedistMatchExternal2, hmAgentRipRouteRedistDistList=hmAgentRipRouteRedistDistList, hmVrrpExtPreemptionDelay=hmVrrpExtPreemptionDelay, hmVrrpTrackRowStatus=hmVrrpTrackRowStatus, hmAgentOspfIfIpMtuIgnoreFlag=hmAgentOspfIfIpMtuIgnoreFlag, hmAgentSwitchIpRouterDiscoveryPreferenceLevel=hmAgentSwitchIpRouterDiscoveryPreferenceLevel, hmVrrpExtVrid=hmVrrpExtVrid, hmAgentRipRouteRedistMetricConfigured=hmAgentRipRouteRedistMetricConfigured, hmAgentSwitchIpRouteStaticPreference=hmAgentSwitchIpRouteStaticPreference, hmAgentRip2InterfaceTable=hmAgentRip2InterfaceTable, hmAgentRip2RcvBadPackets=hmAgentRip2RcvBadPackets, hmAgentOspfIfTable=hmAgentOspfIfTable, hmAgentRip2InterfaceEntry=hmAgentRip2InterfaceEntry, hmAgentSwitchIpInterfaceRoutingMode=hmAgentSwitchIpInterfaceRoutingMode, hmAgentSwitchIpVlanTable=hmAgentSwitchIpVlanTable, hmAgentOspfRouteRedistMetricType=hmAgentOspfRouteRedistMetricType, hmAgentSwitchArpEntry=hmAgentSwitchArpEntry, hmAgentSwitchIpRoutingMode=hmAgentSwitchIpRoutingMode, hmAgentSwitchIpCurrentTableSizeUCRoutes=hmAgentSwitchIpCurrentTableSizeUCRoutes, hmVrrpDomainStatus=hmVrrpDomainStatus, hmAgentRip2InterfaceReceiveVersion=hmAgentRip2InterfaceReceiveVersion, hmAgentSwitchIpRouterDiscoveryMaxAdvertisementInterval=hmAgentSwitchIpRouterDiscoveryMaxAdvertisementInterval, hmAgentSwitchIpRouteStaticNextHop=hmAgentSwitchIpRouteStaticNextHop, hmAgentSwitchArpTotalEntryCountCurrent=hmAgentSwitchArpTotalEntryCountCurrent, hmAgentSwitchIpInterfaceProxyARPMode=hmAgentSwitchIpInterfaceProxyARPMode, hmAgentSnmpVRRPAuthFailureTrapFlag=hmAgentSnmpVRRPAuthFailureTrapFlag, hmAgentOspfDefaultMetricConfigured=hmAgentOspfDefaultMetricConfigured, hmAgentSnmpTrapFlagsConfigGroupLayer3=hmAgentSnmpTrapFlagsConfigGroupLayer3, hmAgentRip2InterfaceAdminState=hmAgentRip2InterfaceAdminState, hmVrrpExtOperPriority=hmVrrpExtOperPriority, hmAgentSwitchIpInterfaceNetdirectedBCMode=hmAgentSwitchIpInterfaceNetdirectedBCMode, hmAgentRouterVrrpConfigGroup=hmAgentRouterVrrpConfigGroup, hmVrrpDomainMemberSendAdv=hmVrrpDomainMemberSendAdv, hmAgentRip2IfConfEntry=hmAgentRip2IfConfEntry, hmAgentRipRouteRedistSource=hmAgentRipRouteRedistSource, hmAgentSnmpVRRPNewMasterTrapFlag=hmAgentSnmpVRRPNewMasterTrapFlag, hmVrrpExtEntry=hmVrrpExtEntry, hmAgentOspfRouteRedistMode=hmAgentOspfRouteRedistMode, hmVrrpTrackId=hmVrrpTrackId, hmAgentSwitchArpCacheSize=hmAgentSwitchArpCacheSize, hmAgentRouterRipAutoSummaryMode=hmAgentRouterRipAutoSummaryMode, hmAgentSwitchArpResponseTime=hmAgentSwitchArpResponseTime, hmAgentSwitchIpRoutePreferenceEntry=hmAgentSwitchIpRoutePreferenceEntry, hmAgentRip2InterfaceAuthType=hmAgentRip2InterfaceAuthType, hmAgentSwitchIpVlanEntry=hmAgentSwitchIpVlanEntry, hmAgentRouterRipSplitHorizonMode=hmAgentRouterRipSplitHorizonMode, hmAgentSwitchIpVRRPMode=hmAgentSwitchIpVRRPMode, hmAgentSwitchIpRouterDiscoveryAdvertisementAddress=hmAgentSwitchIpRouterDiscoveryAdvertisementAddress, hmAgentRouterRipDefaultMetricConfigured=hmAgentRouterRipDefaultMetricConfigured, hmAgentOspfDefaultInfoOriginate=hmAgentOspfDefaultInfoOriginate, hmAgentOspfVirtIfEntry=hmAgentOspfVirtIfEntry, hmVrrpExtNotifyAddress=hmVrrpExtNotifyAddress, hmVrrpExtGroup=hmVrrpExtGroup, hmAgentSwitchIpRoutePreferenceSource=hmAgentSwitchIpRoutePreferenceSource, hmVrrpDomainSupervisorVrid=hmVrrpDomainSupervisorVrid, hmAgentSwitchArpInterface=hmAgentSwitchArpInterface, hmAgentOspfRouteRedistMetric=hmAgentOspfRouteRedistMetric, hmVrrpDomainTable=hmVrrpDomainTable, hmAgentSwitchIpInterfaceClearIp=hmAgentSwitchIpInterfaceClearIp, hmAgentSwitchIpRouteStaticTable=hmAgentSwitchIpRouteStaticTable, hmVrrpExtDomainId=hmVrrpExtDomainId, hmAgentSwitchIpRouteStaticDestination=hmAgentSwitchIpRouteStaticDestination, hmAgentSwitchSecondaryIpAddress=hmAgentSwitchSecondaryIpAddress, hmAgentRip2InterfaceAuthKey=hmAgentRip2InterfaceAuthKey, hmAgentSwitchArpGroup=hmAgentSwitchArpGroup, hmAgentSwitchIpInterfaceNetMask=hmAgentSwitchIpInterfaceNetMask, hmAgentRipRouteRedistMatchNSSAExternal1=hmAgentRipRouteRedistMatchNSSAExternal1, hmPlatform4Routing=hmPlatform4Routing, hmAgentRip2SentUpdates=hmAgentRip2SentUpdates, hmAgentRipRouteRedistMetric=hmAgentRipRouteRedistMetric, hmAgentSwitchArpSparseLearn=hmAgentSwitchArpSparseLearn, hmAgentSwitchIpTableSizeMCRoutes=hmAgentSwitchIpTableSizeMCRoutes, hmAgentSwitchArpDynamicRenew=hmAgentSwitchArpDynamicRenew, hmAgentSwitchArpIpAddress=hmAgentSwitchArpIpAddress, hmVrrpTrackIfIndex=hmVrrpTrackIfIndex, hmAgentRip2RcvBadRoutes=hmAgentRip2RcvBadRoutes, hmAgentOspfRouteRedistSubnets=hmAgentOspfRouteRedistSubnets, hmAgentSwitchArpMacAddress=hmAgentSwitchArpMacAddress, hmAgentOspfRouteRedistDistList=hmAgentOspfRouteRedistDistList, hmVrrpDomainSupervisorIfIndex=hmVrrpDomainSupervisorIfIndex, hmAgentSwitchArpTable=hmAgentSwitchArpTable, hmVrrpDomainSupervisorOperState=hmVrrpDomainSupervisorOperState, hmVrrpTrackOperStatus=hmVrrpTrackOperStatus, hmAgentRouterRipHostRoutesAcceptMode=hmAgentRouterRipHostRoutesAcceptMode, hmVrrpExtAdvertTimer=hmVrrpExtAdvertTimer, hmAgentRouterVrrpAdminState=hmAgentRouterVrrpAdminState, hmVrrpTrackingEntry=hmVrrpTrackingEntry, hmAgentSwitchArpMaxRetries=hmAgentSwitchArpMaxRetries, hmAgentSwitchIpRouterDiscoveryEntry=hmAgentSwitchIpRouterDiscoveryEntry, hmAgentRipRouteRedistMatchNSSAExternal2=hmAgentRipRouteRedistMatchNSSAExternal2, hmAgentSwitchIpInterfaceEntry=hmAgentSwitchIpInterfaceEntry, hmAgentSwitchArpStaticEntryCountCurrent=hmAgentSwitchArpStaticEntryCountCurrent, hmAgentECMPGroup=hmAgentECMPGroup, hmAgentOspfIfAuthKeyId=hmAgentOspfIfAuthKeyId, hmAgentSwitchIpInterfaceIfIndex=hmAgentSwitchIpInterfaceIfIndex, hmAgentSwitchIpRouterDiscoveryTable=hmAgentSwitchIpRouterDiscoveryTable, hmAgentSwitchSecondaryStatus=hmAgentSwitchSecondaryStatus, hmAgentSwitchIpRouteStaticTrackId=hmAgentSwitchIpRouteStaticTrackId, hmAgentRip2InterfaceSendVersion=hmAgentRip2InterfaceSendVersion, hmAgentSwitchIpVlanId=hmAgentSwitchIpVlanId, hmAgentSwitchIpInterfacePortNum=hmAgentSwitchIpInterfacePortNum, hmVrrpTrackVrid=hmVrrpTrackVrid, hmAgentSwitchIpTableSizeUCRoutes=hmAgentSwitchIpTableSizeUCRoutes, hmAgentOspfDefaultInfoOriginateMetric=hmAgentOspfDefaultInfoOriginateMetric, hmAgentSwitchIpVlanRoutingStatus=hmAgentSwitchIpVlanRoutingStatus, hmVrrpDomainId=hmVrrpDomainId, hmAgentRouterOspfConfigGroup=hmAgentRouterOspfConfigGroup, hmAgentOspfRouteRedistDistListConfigured=hmAgentOspfRouteRedistDistListConfigured, hmVrrpTrackingTable=hmVrrpTrackingTable, hmAgentSwitchSecondaryAddressTable=hmAgentSwitchSecondaryAddressTable, hmAgentSwitchIpInterfaceMtuValue=hmAgentSwitchIpInterfaceMtuValue, hmAgentOspfDefaultInfoOriginateMetricConfigured=hmAgentOspfDefaultInfoOriginateMetricConfigured, hmAgentRip2InterfaceAuthKeyId=hmAgentRip2InterfaceAuthKeyId, hmAgentRouterRipAdminState=hmAgentRouterRipAdminState, hmAgentSwitchIpVlanIfIndex=hmAgentSwitchIpVlanIfIndex, hmAgentSwitchIpRouteStaticEntry=hmAgentSwitchIpRouteStaticEntry, hmAgentSwitchArpStatus=hmAgentSwitchArpStatus, hmAgentSwitchArpAgeoutTime=hmAgentSwitchArpAgeoutTime, hmAgentRipRouteRedistDistListConfigured=hmAgentRipRouteRedistDistListConfigured, hmAgentSwitchIpGroup=hmAgentSwitchIpGroup, hmAgentSwitchIpVlanSingleMacMode=hmAgentSwitchIpVlanSingleMacMode, hmAgentECMPOspfMaxPaths=hmAgentECMPOspfMaxPaths, hmVrrpExtAdvertAddress=hmVrrpExtAdvertAddress, hmAgentSwitchIpRouterDiscoveryIfIndex=hmAgentSwitchIpRouterDiscoveryIfIndex, hmAgentSwitchArpTotalEntryCountPeak=hmAgentSwitchArpTotalEntryCountPeak, hmAgentRip2InterfaceIfIndex=hmAgentRip2InterfaceIfIndex, hmAgentOspfDefaultInfoOriginateAlways=hmAgentOspfDefaultInfoOriginateAlways, hmAgentOspfVirtIfAuthKeyId=hmAgentOspfVirtIfAuthKeyId, hmAgentRipRouteRedistMatchExternal1=hmAgentRipRouteRedistMatchExternal1, hmAgentRip2IfConfAuthKeyId=hmAgentRip2IfConfAuthKeyId, hmAgentSwitchArpStaticEntryCountMax=hmAgentSwitchArpStaticEntryCountMax, hmAgentSwitchIpRoutePreferenceValue=hmAgentSwitchIpRoutePreferenceValue, hmVrrpExtDomainStatus=hmVrrpExtDomainStatus, hmAgentRipRouteRedistEntry=hmAgentRipRouteRedistEntry, hmAgentSwitchIpTableSizesGroup=hmAgentSwitchIpTableSizesGroup, hmVrrpExtIfIndex=hmVrrpExtIfIndex, hmVrrpExtTable=hmVrrpExtTable, hmAgentSwitchArpType=hmAgentSwitchArpType, hmAgentSwitchSecondaryNetMask=hmAgentSwitchSecondaryNetMask, hmAgentRouterRipConfigGroup=hmAgentRouterRipConfigGroup, hmAgentOspfDefaultMetric=hmAgentOspfDefaultMetric, hmAgentSwitchIpInterfaceSlotNum=hmAgentSwitchIpInterfaceSlotNum, hmAgentRouterRipDefaultMetric=hmAgentRouterRipDefaultMetric, hmAgentRouterRipUpdateTimerInterval=hmAgentRouterRipUpdateTimerInterval, hmAgentRipRouteRedistMatchInternal=hmAgentRipRouteRedistMatchInternal, hmAgentSwitchIpCurrentTableSizeArp=hmAgentSwitchIpCurrentTableSizeArp, hmAgentSwitchIpCurrentTableSizeMCRoutes=hmAgentSwitchIpCurrentTableSizeMCRoutes, hmAgentOspfRouteRedistTag=hmAgentOspfRouteRedistTag, hmAgentSwitchIpTableSizeArp=hmAgentSwitchIpTableSizeArp, hmAgentOspfRouteRedistEntry=hmAgentOspfRouteRedistEntry, hmAgentOspfVirtIfTable=hmAgentOspfVirtIfTable, hmAgentSwitchIpRouteStaticStatus=hmAgentSwitchIpRouteStaticStatus, hmVrrpExtDomainRole=hmVrrpExtDomainRole, hmAgentSwitchIpInterfaceTable=hmAgentSwitchIpInterfaceTable, hmAgentSwitchIpRouterDiscoveryMinAdvertisementInterval=hmAgentSwitchIpRouterDiscoveryMinAdvertisementInterval, hmAgentSwitchIpRoutePreferenceTable=hmAgentSwitchIpRoutePreferenceTable, hmAgentRip2IfConfTable=hmAgentRip2IfConfTable, hmAgentRipRouteRedistMode=hmAgentRipRouteRedistMode, hmVrrpTrackDecrement=hmVrrpTrackDecrement, hmAgentOspfRouteRedistTable=hmAgentOspfRouteRedistTable, hmAgentRouterRipDefaultInfoOriginate=hmAgentRouterRipDefaultInfoOriginate, hmAgentSwitchIpInterfaceIpAddress=hmAgentSwitchIpInterfaceIpAddress, hmAgentSwitchIpRouterDiscoveryAdvertiseMode=hmAgentSwitchIpRouterDiscoveryAdvertiseMode, hmVrrpExtNotifyLinkdown=hmVrrpExtNotifyLinkdown, PYSNMP_MODULE_ID=hmPlatform4Routing, hmAgentSwitchIpRouterDiscoveryAdvertisementLifetime=hmAgentSwitchIpRouterDiscoveryAdvertisementLifetime)
def feuer_frei(concentration, barrels): fuel_hours = barrels * concentration if fuel_hours < 100: return '{} Stunden mehr Benzin ben\xf6tigt.'.format(100 - fuel_hours) elif fuel_hours == 100: return 'Perfekt!' return fuel_hours - 100
def feuer_frei(concentration, barrels): fuel_hours = barrels * concentration if fuel_hours < 100: return '{} Stunden mehr Benzin benötigt.'.format(100 - fuel_hours) elif fuel_hours == 100: return 'Perfekt!' return fuel_hours - 100
# Part 1 a_list = [1, 2, 3, 4, 5] a = a_list[1] b = a_list[3] print(a) print(b) # Part 2 a_string = "FIT2085" print(a_string[a]) print(a_string[b]) # Part 3 print("a = not True: " + str(not True)) print("b = 2 + 2 > 4: " + str(2 + 2 > 4)) print("c = not '0' == 0: " + str(not '0' == 0)) # Reassigning variables with non matching type values is possible d = True d = [] print("d = " + str(d)) # Converting a blank string to a boolean yields false print("e = not \"\": " + str(not "")) # Values that yield 'False' when converted to a boolean false_values = [0, "", [], None] for x in false_values: print(str(x) + " converted to boolean is: " + str(bool(x))) print("f = not 2 - len([a, \"potato\")): " + str(not 2 - len([a, "potato"]))) print("g = len(d): " + str(len([]))) print("h = not g: " + str(not 0)) print("i = len(d): " + str(len(['foo']))) print("j = not 'foo': " + str(not "foo")) print("k = not 4 % 1: " + str(not 4 % 1))
a_list = [1, 2, 3, 4, 5] a = a_list[1] b = a_list[3] print(a) print(b) a_string = 'FIT2085' print(a_string[a]) print(a_string[b]) print('a = not True: ' + str(not True)) print('b = 2 + 2 > 4: ' + str(2 + 2 > 4)) print("c = not '0' == 0: " + str(not '0' == 0)) d = True d = [] print('d = ' + str(d)) print('e = not "": ' + str(not '')) false_values = [0, '', [], None] for x in false_values: print(str(x) + ' converted to boolean is: ' + str(bool(x))) print('f = not 2 - len([a, "potato")): ' + str(not 2 - len([a, 'potato']))) print('g = len(d): ' + str(len([]))) print('h = not g: ' + str(not 0)) print('i = len(d): ' + str(len(['foo']))) print("j = not 'foo': " + str(not 'foo')) print('k = not 4 % 1: ' + str(not 4 % 1))
n1 = float(input('Primeiro segmento: ')) n2 = float(input('Segundo segmento: ')) n3 = float(input('Terceiro segmento: ')) if n1 < n1 + n3 and n2 < n1 +n3 and n3 < n1 + n2: print('Os segmentos podem formar um triangulo.') if n1 == n2 == n3 == n1 : print('EQUILATERO') elif n1 != n2 != n3 != n1: print('ESCALENO') else: print('ISOSCELES') else: print('Os segmentos acima NAO PODEM FORMAR triangulo.')
n1 = float(input('Primeiro segmento: ')) n2 = float(input('Segundo segmento: ')) n3 = float(input('Terceiro segmento: ')) if n1 < n1 + n3 and n2 < n1 + n3 and (n3 < n1 + n2): print('Os segmentos podem formar um triangulo.') if n1 == n2 == n3 == n1: print('EQUILATERO') elif n1 != n2 != n3 != n1: print('ESCALENO') else: print('ISOSCELES') else: print('Os segmentos acima NAO PODEM FORMAR triangulo.')
# dataset_paths = { # 'celeba_train': '', # 'celeba_test': '', # 'celeba_train_sketch': '', # 'celeba_test_sketch': '', # 'celeba_train_segmentation': '', # 'celeba_test_segmentation': '', # 'ffhq': '', # } dataset_paths = { 'trump_train': '/media/ubuntu/Data1/data/Trump/trump-high-res-photos_aligned_bf_1024_dfl2ffhq_train', 'trump_test': '/media/ubuntu/Data1/data/Trump/trump-high-res-photos_aligned_bf_1024_dfl2ffhq_test', } model_paths = { 'stylegan_ffhq': 'pretrained_models/stylegan2-ffhq-config-f.pt', 'ir_se50': 'pretrained_models/model_ir_se50.pth', 'circular_face': 'pretrained_models/CurricularFace_Backbone.pth', 'mtcnn_pnet': 'pretrained_models/mtcnn/pnet.npy', 'mtcnn_rnet': 'pretrained_models/mtcnn/rnet.npy', 'mtcnn_onet': 'pretrained_models/mtcnn/onet.npy', 'shape_predictor': 'shape_predictor_68_face_landmarks.dat' }
dataset_paths = {'trump_train': '/media/ubuntu/Data1/data/Trump/trump-high-res-photos_aligned_bf_1024_dfl2ffhq_train', 'trump_test': '/media/ubuntu/Data1/data/Trump/trump-high-res-photos_aligned_bf_1024_dfl2ffhq_test'} model_paths = {'stylegan_ffhq': 'pretrained_models/stylegan2-ffhq-config-f.pt', 'ir_se50': 'pretrained_models/model_ir_se50.pth', 'circular_face': 'pretrained_models/CurricularFace_Backbone.pth', 'mtcnn_pnet': 'pretrained_models/mtcnn/pnet.npy', 'mtcnn_rnet': 'pretrained_models/mtcnn/rnet.npy', 'mtcnn_onet': 'pretrained_models/mtcnn/onet.npy', 'shape_predictor': 'shape_predictor_68_face_landmarks.dat'}
e = [int(x) for x in str(input()).split()] q = e[0] e = [int(x) for x in str(input()).split()] for i in range(q): n = int(input()) if n in e: print(0) else: print(1) e.append(n)
e = [int(x) for x in str(input()).split()] q = e[0] e = [int(x) for x in str(input()).split()] for i in range(q): n = int(input()) if n in e: print(0) else: print(1) e.append(n)
""" 2 - The underscore is used to ignore a given value. You can just assign the values to underscore. """ x, _ , z = (1,2,3) print(x, z) a, *_ , b = (1,2,3,4,5) print(a,b) for _ in range(10): print('hello world')
""" 2 - The underscore is used to ignore a given value. You can just assign the values to underscore. """ (x, _, z) = (1, 2, 3) print(x, z) (a, *_, b) = (1, 2, 3, 4, 5) print(a, b) for _ in range(10): print('hello world')
# # PySNMP MIB module ISPGRPEXT-MIB (http://snmplabs.com/pysmi) # ASN.1 source file:///Users/davwang4/Dev/mibs.snmplabs.com/asn1/ISPGRPEXT-MIB # Produced by pysmi-0.3.4 at Wed May 1 13:57:33 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) # ispgrpExt, = mibBuilder.importSymbols("APENT-MIB", "ispgrpExt") ObjectIdentifier, OctetString, Integer = mibBuilder.importSymbols("ASN1", "ObjectIdentifier", "OctetString", "Integer") NamedValues, = mibBuilder.importSymbols("ASN1-ENUMERATION", "NamedValues") ConstraintsUnion, ValueSizeConstraint, ConstraintsIntersection, SingleValueConstraint, ValueRangeConstraint = mibBuilder.importSymbols("ASN1-REFINEMENT", "ConstraintsUnion", "ValueSizeConstraint", "ConstraintsIntersection", "SingleValueConstraint", "ValueRangeConstraint") NotificationGroup, ModuleCompliance = mibBuilder.importSymbols("SNMPv2-CONF", "NotificationGroup", "ModuleCompliance") MibScalar, MibTable, MibTableRow, MibTableColumn, IpAddress, MibIdentifier, NotificationType, Gauge32, iso, Counter64, Bits, ModuleIdentity, ObjectIdentity, Counter32, Unsigned32, TimeTicks, Integer32 = mibBuilder.importSymbols("SNMPv2-SMI", "MibScalar", "MibTable", "MibTableRow", "MibTableColumn", "IpAddress", "MibIdentifier", "NotificationType", "Gauge32", "iso", "Counter64", "Bits", "ModuleIdentity", "ObjectIdentity", "Counter32", "Unsigned32", "TimeTicks", "Integer32") DisplayString, TextualConvention, RowStatus = mibBuilder.importSymbols("SNMPv2-TC", "DisplayString", "TextualConvention", "RowStatus") apIspgrpExtMib = ModuleIdentity((1, 3, 6, 1, 4, 1, 2467, 1, 27, 1)) if mibBuilder.loadTexts: apIspgrpExtMib.setLastUpdated('9710092000Z') if mibBuilder.loadTexts: apIspgrpExtMib.setOrganization('ArrowPoint Communications Inc.') if mibBuilder.loadTexts: apIspgrpExtMib.setContactInfo(' Postal: ArrowPoint Communications Inc. 50 Nagog Park Acton, Massachusetts 01720 Tel: +1 978-206-3000 option 1 E-Mail: support@arrowpoint.com') if mibBuilder.loadTexts: apIspgrpExtMib.setDescription('The MIB module used to describe the ArrowPoint Communications ISP interface information') apIspgrpTable = MibTable((1, 3, 6, 1, 4, 1, 2467, 1, 27, 2), ) if mibBuilder.loadTexts: apIspgrpTable.setStatus('current') if mibBuilder.loadTexts: apIspgrpTable.setDescription('A list of Interfaces configured as uplinks to the specified ISP.') apIspgrpEntry = MibTableRow((1, 3, 6, 1, 4, 1, 2467, 1, 27, 2, 1), ).setIndexNames((0, "ISPGRPEXT-MIB", "apIspgrpName")) if mibBuilder.loadTexts: apIspgrpEntry.setStatus('current') if mibBuilder.loadTexts: apIspgrpEntry.setDescription('A group of information to uniquely identify the uplinks to one or more ISPs.') apIspgrpName = MibTableColumn((1, 3, 6, 1, 4, 1, 2467, 1, 27, 2, 1, 1), DisplayString().subtype(subtypeSpec=ValueSizeConstraint(1, 16))).setMaxAccess("readcreate") if mibBuilder.loadTexts: apIspgrpName.setStatus('current') if mibBuilder.loadTexts: apIspgrpName.setDescription('The name of the ISP connected to this composer.') apIspgrpIndex = MibTableColumn((1, 3, 6, 1, 4, 1, 2467, 1, 27, 2, 1, 2), Integer32()).setMaxAccess("readonly") if mibBuilder.loadTexts: apIspgrpIndex.setStatus('current') if mibBuilder.loadTexts: apIspgrpIndex.setDescription('The unique index for each ISP defined.') apIspgrpTotalBwdth = MibTableColumn((1, 3, 6, 1, 4, 1, 2467, 1, 27, 2, 1, 3), Integer32()).setMaxAccess("readonly") if mibBuilder.loadTexts: apIspgrpTotalBwdth.setStatus('current') if mibBuilder.loadTexts: apIspgrpTotalBwdth.setDescription('The Total Bandwidth connected to the specified ISP.') apIspgrpWebHostPipeBwdth = MibTableColumn((1, 3, 6, 1, 4, 1, 2467, 1, 27, 2, 1, 4), Integer32()).setMaxAccess("readonly") if mibBuilder.loadTexts: apIspgrpWebHostPipeBwdth.setStatus('current') if mibBuilder.loadTexts: apIspgrpWebHostPipeBwdth.setDescription('The amount of Bandwidth reserved for flow pipes to configured web hosts.') apIspgrpMode = MibTableColumn((1, 3, 6, 1, 4, 1, 2467, 1, 27, 2, 1, 5), Integer32().clone(1)).setMaxAccess("readcreate") if mibBuilder.loadTexts: apIspgrpMode.setStatus('current') if mibBuilder.loadTexts: apIspgrpMode.setDescription('This field signifies whether this ISP is considered the primary connection to the Internet or is a backup used only if the primary fails.') apIspgrpStatus = MibTableColumn((1, 3, 6, 1, 4, 1, 2467, 1, 27, 2, 1, 6), RowStatus()).setMaxAccess("readcreate") if mibBuilder.loadTexts: apIspgrpStatus.setStatus('current') if mibBuilder.loadTexts: apIspgrpStatus.setDescription('Status entry for this row ') apIspLinkTable = MibTable((1, 3, 6, 1, 4, 1, 2467, 1, 27, 3), ) if mibBuilder.loadTexts: apIspLinkTable.setStatus('current') if mibBuilder.loadTexts: apIspLinkTable.setDescription('A list of uplinks connected to a specified ISP.') apIspLinkEntry = MibTableRow((1, 3, 6, 1, 4, 1, 2467, 1, 27, 3, 1), ).setIndexNames((0, "ISPGRPEXT-MIB", "apIspName"), (0, "ISPGRPEXT-MIB", "apIspLinkifIndex")) if mibBuilder.loadTexts: apIspLinkEntry.setStatus('current') if mibBuilder.loadTexts: apIspLinkEntry.setDescription('A record to describe each uplink to a specified ISP.') apIspName = MibTableColumn((1, 3, 6, 1, 4, 1, 2467, 1, 27, 3, 1, 1), DisplayString().subtype(subtypeSpec=ValueSizeConstraint(1, 16))).setMaxAccess("readcreate") if mibBuilder.loadTexts: apIspName.setStatus('current') if mibBuilder.loadTexts: apIspName.setDescription('The name of the ISP which this uplink connects to.') apIspLinkIndex = MibTableColumn((1, 3, 6, 1, 4, 1, 2467, 1, 27, 3, 1, 2), Integer32()).setMaxAccess("readonly") if mibBuilder.loadTexts: apIspLinkIndex.setStatus('current') if mibBuilder.loadTexts: apIspLinkIndex.setDescription('The unique index for each ISP link configured on this box.') apIspLinkifIndex = MibTableColumn((1, 3, 6, 1, 4, 1, 2467, 1, 27, 3, 1, 3), Integer32()).setMaxAccess("readcreate") if mibBuilder.loadTexts: apIspLinkifIndex.setStatus('current') if mibBuilder.loadTexts: apIspLinkifIndex.setDescription('The If Index of the link being specified as an uplink.') apIspLinkBwdthAlloc = MibTableColumn((1, 3, 6, 1, 4, 1, 2467, 1, 27, 3, 1, 4), Integer32()).setMaxAccess("readonly") if mibBuilder.loadTexts: apIspLinkBwdthAlloc.setStatus('current') if mibBuilder.loadTexts: apIspLinkBwdthAlloc.setDescription('The statistics of allocated Bandwidth for this link.') apIspLinkBEBwdthAlloc = MibTableColumn((1, 3, 6, 1, 4, 1, 2467, 1, 27, 3, 1, 5), Integer32()).setMaxAccess("readonly") if mibBuilder.loadTexts: apIspLinkBEBwdthAlloc.setStatus('current') if mibBuilder.loadTexts: apIspLinkBEBwdthAlloc.setDescription('The amount of best effort traffic allocated on this link.') apIspLinkStatus = MibTableColumn((1, 3, 6, 1, 4, 1, 2467, 1, 27, 3, 1, 6), RowStatus()).setMaxAccess("readcreate") if mibBuilder.loadTexts: apIspLinkStatus.setStatus('current') if mibBuilder.loadTexts: apIspLinkStatus.setDescription('Status entry for this row ') mibBuilder.exportSymbols("ISPGRPEXT-MIB", apIspgrpWebHostPipeBwdth=apIspgrpWebHostPipeBwdth, apIspLinkStatus=apIspLinkStatus, apIspLinkifIndex=apIspLinkifIndex, apIspgrpTotalBwdth=apIspgrpTotalBwdth, apIspgrpName=apIspgrpName, apIspLinkBEBwdthAlloc=apIspLinkBEBwdthAlloc, PYSNMP_MODULE_ID=apIspgrpExtMib, apIspgrpEntry=apIspgrpEntry, apIspgrpMode=apIspgrpMode, apIspLinkIndex=apIspLinkIndex, apIspLinkEntry=apIspLinkEntry, apIspName=apIspName, apIspgrpIndex=apIspgrpIndex, apIspLinkBwdthAlloc=apIspLinkBwdthAlloc, apIspgrpExtMib=apIspgrpExtMib, apIspgrpStatus=apIspgrpStatus, apIspgrpTable=apIspgrpTable, apIspLinkTable=apIspLinkTable)
(ispgrp_ext,) = mibBuilder.importSymbols('APENT-MIB', 'ispgrpExt') (object_identifier, octet_string, integer) = mibBuilder.importSymbols('ASN1', 'ObjectIdentifier', 'OctetString', 'Integer') (named_values,) = mibBuilder.importSymbols('ASN1-ENUMERATION', 'NamedValues') (constraints_union, value_size_constraint, constraints_intersection, single_value_constraint, value_range_constraint) = mibBuilder.importSymbols('ASN1-REFINEMENT', 'ConstraintsUnion', 'ValueSizeConstraint', 'ConstraintsIntersection', 'SingleValueConstraint', 'ValueRangeConstraint') (notification_group, module_compliance) = mibBuilder.importSymbols('SNMPv2-CONF', 'NotificationGroup', 'ModuleCompliance') (mib_scalar, mib_table, mib_table_row, mib_table_column, ip_address, mib_identifier, notification_type, gauge32, iso, counter64, bits, module_identity, object_identity, counter32, unsigned32, time_ticks, integer32) = mibBuilder.importSymbols('SNMPv2-SMI', 'MibScalar', 'MibTable', 'MibTableRow', 'MibTableColumn', 'IpAddress', 'MibIdentifier', 'NotificationType', 'Gauge32', 'iso', 'Counter64', 'Bits', 'ModuleIdentity', 'ObjectIdentity', 'Counter32', 'Unsigned32', 'TimeTicks', 'Integer32') (display_string, textual_convention, row_status) = mibBuilder.importSymbols('SNMPv2-TC', 'DisplayString', 'TextualConvention', 'RowStatus') ap_ispgrp_ext_mib = module_identity((1, 3, 6, 1, 4, 1, 2467, 1, 27, 1)) if mibBuilder.loadTexts: apIspgrpExtMib.setLastUpdated('9710092000Z') if mibBuilder.loadTexts: apIspgrpExtMib.setOrganization('ArrowPoint Communications Inc.') if mibBuilder.loadTexts: apIspgrpExtMib.setContactInfo(' Postal: ArrowPoint Communications Inc. 50 Nagog Park Acton, Massachusetts 01720 Tel: +1 978-206-3000 option 1 E-Mail: support@arrowpoint.com') if mibBuilder.loadTexts: apIspgrpExtMib.setDescription('The MIB module used to describe the ArrowPoint Communications ISP interface information') ap_ispgrp_table = mib_table((1, 3, 6, 1, 4, 1, 2467, 1, 27, 2)) if mibBuilder.loadTexts: apIspgrpTable.setStatus('current') if mibBuilder.loadTexts: apIspgrpTable.setDescription('A list of Interfaces configured as uplinks to the specified ISP.') ap_ispgrp_entry = mib_table_row((1, 3, 6, 1, 4, 1, 2467, 1, 27, 2, 1)).setIndexNames((0, 'ISPGRPEXT-MIB', 'apIspgrpName')) if mibBuilder.loadTexts: apIspgrpEntry.setStatus('current') if mibBuilder.loadTexts: apIspgrpEntry.setDescription('A group of information to uniquely identify the uplinks to one or more ISPs.') ap_ispgrp_name = mib_table_column((1, 3, 6, 1, 4, 1, 2467, 1, 27, 2, 1, 1), display_string().subtype(subtypeSpec=value_size_constraint(1, 16))).setMaxAccess('readcreate') if mibBuilder.loadTexts: apIspgrpName.setStatus('current') if mibBuilder.loadTexts: apIspgrpName.setDescription('The name of the ISP connected to this composer.') ap_ispgrp_index = mib_table_column((1, 3, 6, 1, 4, 1, 2467, 1, 27, 2, 1, 2), integer32()).setMaxAccess('readonly') if mibBuilder.loadTexts: apIspgrpIndex.setStatus('current') if mibBuilder.loadTexts: apIspgrpIndex.setDescription('The unique index for each ISP defined.') ap_ispgrp_total_bwdth = mib_table_column((1, 3, 6, 1, 4, 1, 2467, 1, 27, 2, 1, 3), integer32()).setMaxAccess('readonly') if mibBuilder.loadTexts: apIspgrpTotalBwdth.setStatus('current') if mibBuilder.loadTexts: apIspgrpTotalBwdth.setDescription('The Total Bandwidth connected to the specified ISP.') ap_ispgrp_web_host_pipe_bwdth = mib_table_column((1, 3, 6, 1, 4, 1, 2467, 1, 27, 2, 1, 4), integer32()).setMaxAccess('readonly') if mibBuilder.loadTexts: apIspgrpWebHostPipeBwdth.setStatus('current') if mibBuilder.loadTexts: apIspgrpWebHostPipeBwdth.setDescription('The amount of Bandwidth reserved for flow pipes to configured web hosts.') ap_ispgrp_mode = mib_table_column((1, 3, 6, 1, 4, 1, 2467, 1, 27, 2, 1, 5), integer32().clone(1)).setMaxAccess('readcreate') if mibBuilder.loadTexts: apIspgrpMode.setStatus('current') if mibBuilder.loadTexts: apIspgrpMode.setDescription('This field signifies whether this ISP is considered the primary connection to the Internet or is a backup used only if the primary fails.') ap_ispgrp_status = mib_table_column((1, 3, 6, 1, 4, 1, 2467, 1, 27, 2, 1, 6), row_status()).setMaxAccess('readcreate') if mibBuilder.loadTexts: apIspgrpStatus.setStatus('current') if mibBuilder.loadTexts: apIspgrpStatus.setDescription('Status entry for this row ') ap_isp_link_table = mib_table((1, 3, 6, 1, 4, 1, 2467, 1, 27, 3)) if mibBuilder.loadTexts: apIspLinkTable.setStatus('current') if mibBuilder.loadTexts: apIspLinkTable.setDescription('A list of uplinks connected to a specified ISP.') ap_isp_link_entry = mib_table_row((1, 3, 6, 1, 4, 1, 2467, 1, 27, 3, 1)).setIndexNames((0, 'ISPGRPEXT-MIB', 'apIspName'), (0, 'ISPGRPEXT-MIB', 'apIspLinkifIndex')) if mibBuilder.loadTexts: apIspLinkEntry.setStatus('current') if mibBuilder.loadTexts: apIspLinkEntry.setDescription('A record to describe each uplink to a specified ISP.') ap_isp_name = mib_table_column((1, 3, 6, 1, 4, 1, 2467, 1, 27, 3, 1, 1), display_string().subtype(subtypeSpec=value_size_constraint(1, 16))).setMaxAccess('readcreate') if mibBuilder.loadTexts: apIspName.setStatus('current') if mibBuilder.loadTexts: apIspName.setDescription('The name of the ISP which this uplink connects to.') ap_isp_link_index = mib_table_column((1, 3, 6, 1, 4, 1, 2467, 1, 27, 3, 1, 2), integer32()).setMaxAccess('readonly') if mibBuilder.loadTexts: apIspLinkIndex.setStatus('current') if mibBuilder.loadTexts: apIspLinkIndex.setDescription('The unique index for each ISP link configured on this box.') ap_isp_linkif_index = mib_table_column((1, 3, 6, 1, 4, 1, 2467, 1, 27, 3, 1, 3), integer32()).setMaxAccess('readcreate') if mibBuilder.loadTexts: apIspLinkifIndex.setStatus('current') if mibBuilder.loadTexts: apIspLinkifIndex.setDescription('The If Index of the link being specified as an uplink.') ap_isp_link_bwdth_alloc = mib_table_column((1, 3, 6, 1, 4, 1, 2467, 1, 27, 3, 1, 4), integer32()).setMaxAccess('readonly') if mibBuilder.loadTexts: apIspLinkBwdthAlloc.setStatus('current') if mibBuilder.loadTexts: apIspLinkBwdthAlloc.setDescription('The statistics of allocated Bandwidth for this link.') ap_isp_link_be_bwdth_alloc = mib_table_column((1, 3, 6, 1, 4, 1, 2467, 1, 27, 3, 1, 5), integer32()).setMaxAccess('readonly') if mibBuilder.loadTexts: apIspLinkBEBwdthAlloc.setStatus('current') if mibBuilder.loadTexts: apIspLinkBEBwdthAlloc.setDescription('The amount of best effort traffic allocated on this link.') ap_isp_link_status = mib_table_column((1, 3, 6, 1, 4, 1, 2467, 1, 27, 3, 1, 6), row_status()).setMaxAccess('readcreate') if mibBuilder.loadTexts: apIspLinkStatus.setStatus('current') if mibBuilder.loadTexts: apIspLinkStatus.setDescription('Status entry for this row ') mibBuilder.exportSymbols('ISPGRPEXT-MIB', apIspgrpWebHostPipeBwdth=apIspgrpWebHostPipeBwdth, apIspLinkStatus=apIspLinkStatus, apIspLinkifIndex=apIspLinkifIndex, apIspgrpTotalBwdth=apIspgrpTotalBwdth, apIspgrpName=apIspgrpName, apIspLinkBEBwdthAlloc=apIspLinkBEBwdthAlloc, PYSNMP_MODULE_ID=apIspgrpExtMib, apIspgrpEntry=apIspgrpEntry, apIspgrpMode=apIspgrpMode, apIspLinkIndex=apIspLinkIndex, apIspLinkEntry=apIspLinkEntry, apIspName=apIspName, apIspgrpIndex=apIspgrpIndex, apIspLinkBwdthAlloc=apIspLinkBwdthAlloc, apIspgrpExtMib=apIspgrpExtMib, apIspgrpStatus=apIspgrpStatus, apIspgrpTable=apIspgrpTable, apIspLinkTable=apIspLinkTable)
class Solution: @staticmethod def naive(nums): s = set() for i in nums: if i in s: return True s.add(i) return False
class Solution: @staticmethod def naive(nums): s = set() for i in nums: if i in s: return True s.add(i) return False
foo = input("Team: ") for c in foo: print("Give me a " + c.upper() + "!" ) print("What does that spell? " + foo.upper() + "!") foo = input("What animal would you like? ") bar = input("How many? ") if foo.isupper() == True: print("Woah! No need to shout, you'll scare the animals!") elif int(bar) == 0: print("That's sad. No pet for you today.") elif int(bar) == 1: print("Great, here's your " + foo + "!") elif int(bar) > 1: print("Ok! " + str(bar) , str(foo) + "s coming right up!") def is_notable(name): # Write your function here. if name[0] == "N" and len(name) > 4: return True else: return False # Write the rest of your program here. foo = input("Type a nickname: ") if is_notable(foo) == True: print("That nickname is notable!") else: print("That nickname is not so notable!") def cups_to_grams(cups, density): # Convert cups to grams here. # The density is in grams-per-cup. answer = round(cups * density,1) return answer # Write the rest of your program here food = input("What food? ") cups = float(input("How much in cups? ")) gpc = float(input("How many grams per cup? ")) print(str(cups), "cups of",food,"is", str(cups_to_grams(cups, gpc)),"grams.") def to_celsius(f): # Calculate the temperature in Celsius answer = round((f-32) * 5/9,1) return answer # Write the rest of your program here fheight = float(input("Temp (F): ")) fheight = to_celsius(fheight) if fheight < 5: print(fheight, "C - Crikey it's cold!") elif fheight >= 5 and fheight < 20: print(fheight, "C - Getting a bit nippy!") elif fheight >= 20 and fheight < 35: print(fheight, "C - You beaut beach weather!") else: print(fheight, "C - Strewth, it's a scorcher!")
foo = input('Team: ') for c in foo: print('Give me a ' + c.upper() + '!') print('What does that spell? ' + foo.upper() + '!') foo = input('What animal would you like? ') bar = input('How many? ') if foo.isupper() == True: print("Woah! No need to shout, you'll scare the animals!") elif int(bar) == 0: print("That's sad. No pet for you today.") elif int(bar) == 1: print("Great, here's your " + foo + '!') elif int(bar) > 1: print('Ok! ' + str(bar), str(foo) + 's coming right up!') def is_notable(name): if name[0] == 'N' and len(name) > 4: return True else: return False foo = input('Type a nickname: ') if is_notable(foo) == True: print('That nickname is notable!') else: print('That nickname is not so notable!') def cups_to_grams(cups, density): answer = round(cups * density, 1) return answer food = input('What food? ') cups = float(input('How much in cups? ')) gpc = float(input('How many grams per cup? ')) print(str(cups), 'cups of', food, 'is', str(cups_to_grams(cups, gpc)), 'grams.') def to_celsius(f): answer = round((f - 32) * 5 / 9, 1) return answer fheight = float(input('Temp (F): ')) fheight = to_celsius(fheight) if fheight < 5: print(fheight, "C - Crikey it's cold!") elif fheight >= 5 and fheight < 20: print(fheight, 'C - Getting a bit nippy!') elif fheight >= 20 and fheight < 35: print(fheight, 'C - You beaut beach weather!') else: print(fheight, "C - Strewth, it's a scorcher!")
def main(request, response): response.headers.set("Cache-Control", "no-store") response.headers.set("Access-Control-Allow-Origin", request.headers.get("origin")) response.headers.set("Access-Control-Allow-Credentials", "true") uid = request.GET.first("uid", None) if request.method == "OPTIONS": response.headers.set("Access-Control-Allow-Methods", "PUT") else: username = request.auth.username password = request.auth.password if (not username) or (username != uid): response.headers.set("WWW-Authenticate", "Basic realm='Test Realm/Cross Origin'") response.status = 401 response.content = "Authentication cancelled" else: response.content = "User: " + username + ", Password: " + password
def main(request, response): response.headers.set('Cache-Control', 'no-store') response.headers.set('Access-Control-Allow-Origin', request.headers.get('origin')) response.headers.set('Access-Control-Allow-Credentials', 'true') uid = request.GET.first('uid', None) if request.method == 'OPTIONS': response.headers.set('Access-Control-Allow-Methods', 'PUT') else: username = request.auth.username password = request.auth.password if not username or username != uid: response.headers.set('WWW-Authenticate', "Basic realm='Test Realm/Cross Origin'") response.status = 401 response.content = 'Authentication cancelled' else: response.content = 'User: ' + username + ', Password: ' + password
#.q1 Multiply following matrices #Using for loops and print the result. a =[[1,2,3], [4,5,6], [7,8,9]] b=[[111,22,33], [44,55,56], [47,86,19]] mul=[[0,0,0], [0,0,0], [0,0,0]] for i in range(3): for j in range (3): for k in range (3): mul[i][j]+=a[i][k]*b[k][j] for l in mul: print(l)
a = [[1, 2, 3], [4, 5, 6], [7, 8, 9]] b = [[111, 22, 33], [44, 55, 56], [47, 86, 19]] mul = [[0, 0, 0], [0, 0, 0], [0, 0, 0]] for i in range(3): for j in range(3): for k in range(3): mul[i][j] += a[i][k] * b[k][j] for l in mul: print(l)
# 2020.08.07 # Problem Statement: # https://leetcode.com/problems/search-insert-position/ class Solution: def searchInsert(self, nums: List[int], target: int) -> int: # check empty list if len(nums) == 0: return 0 # check out of range, early return if target < nums[0]: return 0 elif target > nums[-1]: return len(nums) # initialize indexes for binary search and answer to return left, right = 0, len(nums) index = int((left+right)/2) # do binary search while True: if nums[index] == target: return index elif nums[index] > target: # find the index to insert if index > 0 and nums[index-1] < target: return index else: # search the left part right = index index = int((left+right)/2) else: # find the index to insert if index < len(nums)-1 and nums[index+1] > target: return index+1 else: # search the right part left = index index = int((left+right)/2)
class Solution: def search_insert(self, nums: List[int], target: int) -> int: if len(nums) == 0: return 0 if target < nums[0]: return 0 elif target > nums[-1]: return len(nums) (left, right) = (0, len(nums)) index = int((left + right) / 2) while True: if nums[index] == target: return index elif nums[index] > target: if index > 0 and nums[index - 1] < target: return index else: right = index index = int((left + right) / 2) elif index < len(nums) - 1 and nums[index + 1] > target: return index + 1 else: left = index index = int((left + right) / 2)
#encoding:utf-8 subreddit = 'formula1' # This is for your public telegram channel. t_channel = '@r_formula1' def send_post(submission, r2t): return r2t.send_simple(submission)
subreddit = 'formula1' t_channel = '@r_formula1' def send_post(submission, r2t): return r2t.send_simple(submission)
# https://leetcode.com/problems/dungeon-game/ class Solution(object): def calculateMinimumHP(self, dungeon): """ The demons had captured the princess and imprisoned her in the bottom-right corner of a dungeon. The dungeon consists of m x n rooms laid out in a 2D grid. Our valiant knight was initially positioned in the top-left room and must fight his way through dungeon to rescue the princess. The knight has an initial health point represented by a positive integer. If at any point his health point drops to 0 or below, he dies immediately. Some of the rooms are guarded by demons (represented by negative integers), so the knight loses health upon entering these rooms; other rooms are either empty (represented as 0) or contain magic orbs that increase the knight's health (represented by positive integers). To reach the princess as quickly as possible, the knight decides to move only rightward or downward in each step. Return the knight's minimum initial health so that he can rescue the princess. Note that any room can contain threats or power-ups, even the first room the knight enters and the bottom-right room where the princess is imprisoned. :type dungeon: List[List[int]] :rtype: int """
class Solution(object): def calculate_minimum_hp(self, dungeon): """ The demons had captured the princess and imprisoned her in the bottom-right corner of a dungeon. The dungeon consists of m x n rooms laid out in a 2D grid. Our valiant knight was initially positioned in the top-left room and must fight his way through dungeon to rescue the princess. The knight has an initial health point represented by a positive integer. If at any point his health point drops to 0 or below, he dies immediately. Some of the rooms are guarded by demons (represented by negative integers), so the knight loses health upon entering these rooms; other rooms are either empty (represented as 0) or contain magic orbs that increase the knight's health (represented by positive integers). To reach the princess as quickly as possible, the knight decides to move only rightward or downward in each step. Return the knight's minimum initial health so that he can rescue the princess. Note that any room can contain threats or power-ups, even the first room the knight enters and the bottom-right room where the princess is imprisoned. :type dungeon: List[List[int]] :rtype: int """
# Copyright (C) 2015 Google Inc., authors, and contributors <see AUTHORS file> # Licensed under http://www.apache.org/licenses/LICENSE-2.0 <see LICENSE file> # Created By: anze@reciprocitylabs.com # Maintained By: anze@reciprocitylabs.com scope = "Admin" description = """ gGRC System Administrator with super-user privileges. """ permissions = { "read": [], "create": [], "delete": [], "__GGRC_ADMIN__": [ "__GGRC_ALL__" ], "update": [] }
scope = 'Admin' description = '\n gGRC System Administrator with super-user privileges.\n ' permissions = {'read': [], 'create': [], 'delete': [], '__GGRC_ADMIN__': ['__GGRC_ALL__'], 'update': []}