content
stringlengths
7
1.05M
fixed_cases
stringlengths
1
1.28M
factor = int(input()) count = int(input()) list = [] counter = factor for _ in range(count): list.append(counter) counter += factor print(list)
factor = int(input()) count = int(input()) list = [] counter = factor for _ in range(count): list.append(counter) counter += factor print(list)
# Definition for a binary tree node. class _TreeNode: def __init__(self, val=0, left=None, right=None): self.val = val self.left = left self.right = right class Solution: def isSameTree(self, p: _TreeNode, q: _TreeNode) -> bool: # If both are none, the nodes are the same. if p is None and q is None: return True # If either is none, one is not. if p is None or q is None: return False # No need to recurse if they're the same object. if id(p) == id(q): return True # Check the values and recurse, DFS. return ( p.val == q.val and self.isSameTree(p.left, q.left) and self.isSameTree(p.right, q.right) )
class _Treenode: def __init__(self, val=0, left=None, right=None): self.val = val self.left = left self.right = right class Solution: def is_same_tree(self, p: _TreeNode, q: _TreeNode) -> bool: if p is None and q is None: return True if p is None or q is None: return False if id(p) == id(q): return True return p.val == q.val and self.isSameTree(p.left, q.left) and self.isSameTree(p.right, q.right)
# Based on https://github.com/zricethezav/gitleaks/blob/6f5ad9dc0b385c872f652324188ce91da7157c7c/test_data/test_repos/test_dir_1/server.test2.py # Do not hard code credentials client = boto3.client( 's3', # Hard coded strings as credentials, not recommended. aws_access_key_id='AKIAIO5FODNN7EXAMPLE', aws_secret_access_key='ABCDEF+c2L7yXeGvUyrPgYsDnWRRC1AYEXAMPLE' ) # gh_pat = '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'
client = boto3.client('s3', aws_access_key_id='AKIAIO5FODNN7EXAMPLE', aws_secret_access_key='ABCDEF+c2L7yXeGvUyrPgYsDnWRRC1AYEXAMPLE')
def find_range_values(curr_range): return list(map(int, curr_range.split(","))) def find_set(curr_range): start_value, end_value = find_range_values(curr_range) curr_set = set(range(start_value, end_value + 1)) return curr_set def find_longest_intersection(n): longest_intersection = set() for _ in range(n): first_range, second_range = input().split("-") first_set = find_set(first_range) second_set = find_set(second_range) curr_intersection = first_set.intersection(second_set) if len(curr_intersection) > len(longest_intersection): longest_intersection = curr_intersection return list(longest_intersection) def print_result(longest_intersection): print(f"Longest intersection is {longest_intersection} " f"with length {len(longest_intersection)}") print_result(find_longest_intersection(int(input())))
def find_range_values(curr_range): return list(map(int, curr_range.split(','))) def find_set(curr_range): (start_value, end_value) = find_range_values(curr_range) curr_set = set(range(start_value, end_value + 1)) return curr_set def find_longest_intersection(n): longest_intersection = set() for _ in range(n): (first_range, second_range) = input().split('-') first_set = find_set(first_range) second_set = find_set(second_range) curr_intersection = first_set.intersection(second_set) if len(curr_intersection) > len(longest_intersection): longest_intersection = curr_intersection return list(longest_intersection) def print_result(longest_intersection): print(f'Longest intersection is {longest_intersection} with length {len(longest_intersection)}') print_result(find_longest_intersection(int(input())))
CKAN_ROOT = "https://data.wprdc.org/" API_PATH = "api/3/action/" SQL_SEARCH_ENDPOINT = "datastore_search_sql" API_URL = CKAN_ROOT + API_PATH + SQL_SEARCH_ENDPOINT
ckan_root = 'https://data.wprdc.org/' api_path = 'api/3/action/' sql_search_endpoint = 'datastore_search_sql' api_url = CKAN_ROOT + API_PATH + SQL_SEARCH_ENDPOINT
# variables 3 a = "abc" print("a:", a, type(a)) a = 3 print("a:", a, type(a))
a = 'abc' print('a:', a, type(a)) a = 3 print('a:', a, type(a))
def put_languages(self, root): if hasattr(self, "languages") and self.languages: lang_string = ",".join(["/".join(x) for x in self.languages]) root.attrib["languages"] = lang_string def put_address(self, root): if self.address: if isinstance(self.address, str): root.attrib["address"] = self.address else: root.attrib["address"] = str("|".join(self.address))
def put_languages(self, root): if hasattr(self, 'languages') and self.languages: lang_string = ','.join(['/'.join(x) for x in self.languages]) root.attrib['languages'] = lang_string def put_address(self, root): if self.address: if isinstance(self.address, str): root.attrib['address'] = self.address else: root.attrib['address'] = str('|'.join(self.address))
# n = nums.length # time = 0(n) # space = O(1) class Solution: def maxSubArray(self, nums: List[int]) -> int: ret = max(nums) sub_sum = 0 for num in nums: sub_sum = max(0, sub_sum) + num ret = max(ret, sub_sum) return ret
class Solution: def max_sub_array(self, nums: List[int]) -> int: ret = max(nums) sub_sum = 0 for num in nums: sub_sum = max(0, sub_sum) + num ret = max(ret, sub_sum) return ret
class Heroes3(object): def __init__(self): super(Heroes3, self).__init__() self._army_size = { "Few" : (1, 4), "Several" : (5, 9), "Pack" : (10, 19), "Lots" : (20, 49), "Horde" : (50, 100), "Throng" : (100, 249), "Swarm" : (250, 499), "Zounds" : (500, 999), "Legion" : (1000, float("inf")) } def get_all(self): return self._army_size def get_army_description(self, size): for key in self._army_size: minimum, maximum = self._army_size[key] if size >= minimum and size <= maximum: return key else: return "Unknown" def main(): print("Hello, Heroes of Might and Magic 3!") if __name__ == "__main__": main()
class Heroes3(object): def __init__(self): super(Heroes3, self).__init__() self._army_size = {'Few': (1, 4), 'Several': (5, 9), 'Pack': (10, 19), 'Lots': (20, 49), 'Horde': (50, 100), 'Throng': (100, 249), 'Swarm': (250, 499), 'Zounds': (500, 999), 'Legion': (1000, float('inf'))} def get_all(self): return self._army_size def get_army_description(self, size): for key in self._army_size: (minimum, maximum) = self._army_size[key] if size >= minimum and size <= maximum: return key else: return 'Unknown' def main(): print('Hello, Heroes of Might and Magic 3!') if __name__ == '__main__': main()
count = int(input()) for i in range(count): k = int(input()) n = int(input()) people = [j for j in range(1,n+1)] for x in range (k): for v in range(n-1): people[v+1] += people[v] print(people[-1])
count = int(input()) for i in range(count): k = int(input()) n = int(input()) people = [j for j in range(1, n + 1)] for x in range(k): for v in range(n - 1): people[v + 1] += people[v] print(people[-1])
def goTo(logic, x, y): hero.moveXY(x, y) hero.say(logic) hero.moveXY(26, 16); a = hero.findNearestFriend().getSecretA() b = hero.findNearestFriend().getSecretB() c = hero.findNearestFriend().getSecretC() goTo(a and b or c, 25, 26) goTo((a or b) and c, 26, 32) goTo((a or c) and (b or c), 35, 32) goTo((a and b) or (not c and b), 40, 22)
def go_to(logic, x, y): hero.moveXY(x, y) hero.say(logic) hero.moveXY(26, 16) a = hero.findNearestFriend().getSecretA() b = hero.findNearestFriend().getSecretB() c = hero.findNearestFriend().getSecretC() go_to(a and b or c, 25, 26) go_to((a or b) and c, 26, 32) go_to((a or c) and (b or c), 35, 32) go_to(a and b or (not c and b), 40, 22)
def print_array(array): for i in array: print(i, end=" ") print("") def bubble_sort(array): for i in range(len(array)): swapped = False for j in range(0, len(array)-i-1): if array[j] >= array[j+1]: tmp = array[j+1] array[j+1] = array[j] array[j] = tmp swapped = True if not swapped: break foo_array = [9, 4, 3, 5, 1] print_array(foo_array) bubble_sort(foo_array) print_array(foo_array)
def print_array(array): for i in array: print(i, end=' ') print('') def bubble_sort(array): for i in range(len(array)): swapped = False for j in range(0, len(array) - i - 1): if array[j] >= array[j + 1]: tmp = array[j + 1] array[j + 1] = array[j] array[j] = tmp swapped = True if not swapped: break foo_array = [9, 4, 3, 5, 1] print_array(foo_array) bubble_sort(foo_array) print_array(foo_array)
class Solution: def findAnagrams(self, s: str, p: str) -> List[int]: size_s = len(s) size_p = len(p) counter1 = collections.defaultdict(int) counter2 = collections.defaultdict(int) ans = [] for c in p: counter2[c] += 1 for c in s[:size_p-1]: counter1[c] += 1 for i in range(size_p-1, size_s): counter1[s[i]] += 1 if i - size_p >= 0: counter1[s[i-size_p]] -= 1 if counter1[s[i-size_p]] == 0: del counter1[s[i-size_p]] if counter1 == counter2: ans.append(i-size_p+1) return ans
class Solution: def find_anagrams(self, s: str, p: str) -> List[int]: size_s = len(s) size_p = len(p) counter1 = collections.defaultdict(int) counter2 = collections.defaultdict(int) ans = [] for c in p: counter2[c] += 1 for c in s[:size_p - 1]: counter1[c] += 1 for i in range(size_p - 1, size_s): counter1[s[i]] += 1 if i - size_p >= 0: counter1[s[i - size_p]] -= 1 if counter1[s[i - size_p]] == 0: del counter1[s[i - size_p]] if counter1 == counter2: ans.append(i - size_p + 1) return ans
''' Created on Oct 3, 2015 @author: bcy-3 '''
""" Created on Oct 3, 2015 @author: bcy-3 """
app_name = "pusta2" prefix_url = "pusta2" static_files = { 'js': { 'pusta2/js/': ['main.js', ] }, 'css': { 'pusta2/css/': ['main.css', ] }, 'html': { 'pusta2/html/': ['index.html', ] } } permissions = { "edit": "Editing actualy nothing.", "sample1": "sample1longversion", }
app_name = 'pusta2' prefix_url = 'pusta2' static_files = {'js': {'pusta2/js/': ['main.js']}, 'css': {'pusta2/css/': ['main.css']}, 'html': {'pusta2/html/': ['index.html']}} permissions = {'edit': 'Editing actualy nothing.', 'sample1': 'sample1longversion'}
input = open('input.txt', 'r').read().split("\n") preamble_length = 25 invalid = 0 for i in range(preamble_length, len(input)): current = int(input[i]) found = False for j in range(i - preamble_length, i): for k in range (j + 1, i): sum = int(input[j]) + int(input[k]) if sum == current: found = True if not found: invalid = int(input[i]) print("No match found for " + input[i]) break def find_sequence(search): for i in range(0, len(input)) : sum_window = [] sum = 0 for k in range(i, len(input)): value = int(input[k]) sum += value sum_window.append(value) if sum == search: return sum_window if sum > search: break sequence = find_sequence(invalid) min_val = min(sequence) max_val = max(sequence) print(sequence) print("min = " + str(min_val)) print("max = " + str(max_val)) print("min + max = " + str(min_val + max_val))
input = open('input.txt', 'r').read().split('\n') preamble_length = 25 invalid = 0 for i in range(preamble_length, len(input)): current = int(input[i]) found = False for j in range(i - preamble_length, i): for k in range(j + 1, i): sum = int(input[j]) + int(input[k]) if sum == current: found = True if not found: invalid = int(input[i]) print('No match found for ' + input[i]) break def find_sequence(search): for i in range(0, len(input)): sum_window = [] sum = 0 for k in range(i, len(input)): value = int(input[k]) sum += value sum_window.append(value) if sum == search: return sum_window if sum > search: break sequence = find_sequence(invalid) min_val = min(sequence) max_val = max(sequence) print(sequence) print('min = ' + str(min_val)) print('max = ' + str(max_val)) print('min + max = ' + str(min_val + max_val))
x,y = map(float, input().split()) if (x == y == 0): print("Origem") elif (y == 0): print("Eixo X") elif (x == 0): print("Eixo Y") elif (x > 0) and (y > 0): print("Q1") elif (x < 0) and (y > 0): print("Q2") elif (x < 0) and (y < 0): print("Q3") elif (x > 0) and (y < 0): print("Q4")
(x, y) = map(float, input().split()) if x == y == 0: print('Origem') elif y == 0: print('Eixo X') elif x == 0: print('Eixo Y') elif x > 0 and y > 0: print('Q1') elif x < 0 and y > 0: print('Q2') elif x < 0 and y < 0: print('Q3') elif x > 0 and y < 0: print('Q4')
class Point(object): def __init__(self, x, y): self._x = x self._y = y def get_x(self): return self._x def set_x(self, x): self._x = x def get_y(self): return self._y def set_y(self, y): self._y = y def euclidean_distance(a, b): ax = a.get_x() ay = a.get_y() bx = b.get_x() by = b.get_y() dist = ((ax - bx) ** 2 + (ay - by) ** 2) ** 0.5 return dist
class Point(object): def __init__(self, x, y): self._x = x self._y = y def get_x(self): return self._x def set_x(self, x): self._x = x def get_y(self): return self._y def set_y(self, y): self._y = y def euclidean_distance(a, b): ax = a.get_x() ay = a.get_y() bx = b.get_x() by = b.get_y() dist = ((ax - bx) ** 2 + (ay - by) ** 2) ** 0.5 return dist
print("Height: ", end='') while True: height = input() # check if int try: height = int(height) except ValueError: print("Retry: ", end='') continue # check if suitable value if height >= 0 and height <= 23: break else: print("Height: ", end='') # draw pyramid for i in range(height): hashes = "#" * (i + 1) line = hashes.rjust(height) + ' ' + hashes print(line)
print('Height: ', end='') while True: height = input() try: height = int(height) except ValueError: print('Retry: ', end='') continue if height >= 0 and height <= 23: break else: print('Height: ', end='') for i in range(height): hashes = '#' * (i + 1) line = hashes.rjust(height) + ' ' + hashes print(line)
# In Search for the Lost Memory [Explorer Pirate + Jett] (3527) recoveredMemory = 7081 kyrin = 1090000 sm.setSpeakerID(kyrin) sm.sendNext("A stable position, with a calm demanor-- but I can tell you're hiding your explosive attacking abilities-- " "you've become quite an impressive pirate, #h #. It's been a while.") sm.sendSay("You used to be a kid that was scared of water-- and look at you now. " "I knew you'd grow to a formidable pirate, but like this? I am thrilled to see you all grown up like this.") sm.sendSay("What I can tell you is-- keep going. " "As the person responsible for making you a pirate, I have no doubt in my mind that you still have room to grow-- " "and that you will become an even more powerful force.") sm.startQuest(parentID) sm.completeQuest(parentID) sm.startQuest(recoveredMemory) sm.setQRValue(recoveredMemory, "1", False)
recovered_memory = 7081 kyrin = 1090000 sm.setSpeakerID(kyrin) sm.sendNext("A stable position, with a calm demanor-- but I can tell you're hiding your explosive attacking abilities-- you've become quite an impressive pirate, #h #. It's been a while.") sm.sendSay("You used to be a kid that was scared of water-- and look at you now. I knew you'd grow to a formidable pirate, but like this? I am thrilled to see you all grown up like this.") sm.sendSay('What I can tell you is-- keep going. As the person responsible for making you a pirate, I have no doubt in my mind that you still have room to grow-- and that you will become an even more powerful force.') sm.startQuest(parentID) sm.completeQuest(parentID) sm.startQuest(recoveredMemory) sm.setQRValue(recoveredMemory, '1', False)
class Powerup: def __init__(self, coord): self.coord = coord def use(self, player): raise NotImplementedError def ascii(self): return "P"
class Powerup: def __init__(self, coord): self.coord = coord def use(self, player): raise NotImplementedError def ascii(self): return 'P'
languages = { "c": "c", "cpp": "cpp", "cc": "cpp", "cs": "csharp", "java": "java", "py": "python", "rb": "ruby" }
languages = {'c': 'c', 'cpp': 'cpp', 'cc': 'cpp', 'cs': 'csharp', 'java': 'java', 'py': 'python', 'rb': 'ruby'}
#Arquivo que contem os parametros do jogo quantidade_jogadores = 2 #quantidade de Jogadores jogadores = [] #array que contem os jogadores(na ordem de jogo) tamanho_tabuleiro = 40 #tamanho do array do tabuleiro (sempre multiplo de 4 para o tabuleiro ficar quadrado) quantidade_dados = 2 #quantos dados serao usados quantidade_reves = int(tamanho_tabuleiro/5) #quantos Sorte/Reves existirao no tabuleiro dinheiro_inicial = 10000000 #dinheiro inicial de cada Jogador jogadas_default = 1 #quantidade de Jogadas que cada jogador possui(pode alterarse dados forem iguais) #cadeia e vai para cadeia devem ficar em cantos opostos do tabuleiro. Dividimos o tabuleiro em 4, # e colocamos o vai para cadeia na primeira "esquina", e a cadeia na terceira esquina pos_vai_para_cadeia = int(tamanho_tabuleiro/4) #Posicao da casa "vai para cadeia" pos_Cadeia = int(pos_vai_para_cadeia * 3) #posicao da casa "cadeia" contrucoes={ '1': 'Nada', '2': 'Casa', '3': 'Hotel' } possiveis_sorte = [ {"Ganhou na loteria!": "500"}, {"Foi promovido no emprego!": "1500"} ] possiveis_reves = [ {"Perdeu o mindinho da mao esquerda": "500"}, {"Seu filho pegou Piolho": "50"}, {"Policia Apreendeu seus 15 hectares de maconha, por pouco nao foi preso!": "3500"} ]
quantidade_jogadores = 2 jogadores = [] tamanho_tabuleiro = 40 quantidade_dados = 2 quantidade_reves = int(tamanho_tabuleiro / 5) dinheiro_inicial = 10000000 jogadas_default = 1 pos_vai_para_cadeia = int(tamanho_tabuleiro / 4) pos__cadeia = int(pos_vai_para_cadeia * 3) contrucoes = {'1': 'Nada', '2': 'Casa', '3': 'Hotel'} possiveis_sorte = [{'Ganhou na loteria!': '500'}, {'Foi promovido no emprego!': '1500'}] possiveis_reves = [{'Perdeu o mindinho da mao esquerda': '500'}, {'Seu filho pegou Piolho': '50'}, {'Policia Apreendeu seus 15 hectares de maconha, por pouco nao foi preso!': '3500'}]
s = 'azcbobobegghakl' num = 0 for i in range(0, len(s) - 2): if s[i] + s[i + 1] + s[i + 2] == 'bob': num += 1 print('Number of times bob occurs is: ' + str(num))
s = 'azcbobobegghakl' num = 0 for i in range(0, len(s) - 2): if s[i] + s[i + 1] + s[i + 2] == 'bob': num += 1 print('Number of times bob occurs is: ' + str(num))
# --- Day 14: Docking Data --- # As your ferry approaches the sea port, the captain asks for your help again. The computer system that runs this port isn't compatible with the docking program on the ferry, so the docking parameters aren't being correctly initialized in the docking program's memory. # After a brief inspection, you discover that the sea port's computer system uses a strange bitmask system in its initialization program. Although you don't have the correct decoder chip handy, you can emulate it in software! # The initialization program (your puzzle input) can either update the bitmask or write a value to memory. Values and memory addresses are both 36-bit unsigned integers. For example, ignoring bitmasks for a moment, a line like mem[8] = 11 would write the value 11 to memory address 8. # The bitmask is always given as a string of 36 bits, written with the most significant bit (representing 2^35) on the left and the least significant bit (2^0, that is, the 1s bit) on the right. The current bitmask is applied to values immediately before they are written to memory: a 0 or 1 overwrites the corresponding bit in the value, while an X leaves the bit in the value unchanged. # For example, consider the following program: # mask = XXXXXXXXXXXXXXXXXXXXXXXXXXXXX1XXXX0X # mem[8] = 11 # mem[7] = 101 # mem[8] = 0 # This program starts by specifying a bitmask (mask = ....). The mask it specifies will overwrite two bits in every written value: the 2s bit is overwritten with 0, and the 64s bit is overwritten with 1. # The program then attempts to write the value 11 to memory address 8. By expanding everything out to individual bits, the mask is applied as follows: # value: 000000000000000000000000000000001011 (decimal 11) # mask: XXXXXXXXXXXXXXXXXXXXXXXXXXXXX1XXXX0X # result: 000000000000000000000000000001001001 (decimal 73) # So, because of the mask, the value 73 is written to memory address 8 instead. Then, the program tries to write 101 to address 7: # value: 000000000000000000000000000001100101 (decimal 101) # mask: XXXXXXXXXXXXXXXXXXXXXXXXXXXXX1XXXX0X # result: 000000000000000000000000000001100101 (decimal 101) # This time, the mask has no effect, as the bits it overwrote were already the values the mask tried to set. Finally, the program tries to write 0 to address 8: # value: 000000000000000000000000000000000000 (decimal 0) # mask: XXXXXXXXXXXXXXXXXXXXXXXXXXXXX1XXXX0X # result: 000000000000000000000000000001000000 (decimal 64) # 64 is written to address 8 instead, overwriting the value that was there previously. # To initialize your ferry's docking program, you need the sum of all values left in memory after the initialization program completes. (The entire 36-bit address space begins initialized to the value 0 at every address.) In the above example, only two values in memory are not zero - 101 (at address 7) and 64 (at address 8) - producing a sum of 165. # Execute the initialization program. What is the sum of all values left in memory after it completes? def fileInput(): f = open(inputFile, 'r') with open(inputFile) as f: read_data = f.read().split('\n') f.close() return read_data def splitData(data): dataLine = [] maxSize = 0 global mem for line in data: newLine = line.split(' = ') if newLine[0] != 'mask': newLine[0] = int(newLine[0].lstrip("mem[").rstrip("]")) maxSize = max(maxSize,newLine[0]+1) newLine[1] = f'{int(newLine[1]):036b}' dataLine.append(newLine) mem = [0 for x in range(maxSize)] return dataLine def processData(data): global mask global mem global maskCount for line in data: if line[0] == 'mask': mask = line[1] maskCount = mask.count('X') else: line[1] = updateBits(mask,line[1]) mem[line[0]] = int(line[1],2) def updateBits(mask,bits): mask = [bit for bit in mask] bits = [bit for bit in bits] for i in range(36): if mask[i] != 'X': bits[i] = mask[i] return ''.join(bits) #/////////////////////////////////////////////////// inputFile = 'day14-input.txt' mask = 'XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX' maskCount = 0 mem = [] if __name__ == "__main__": data = fileInput() data = splitData(data) processData(data) print(sum(mem))
def file_input(): f = open(inputFile, 'r') with open(inputFile) as f: read_data = f.read().split('\n') f.close() return read_data def split_data(data): data_line = [] max_size = 0 global mem for line in data: new_line = line.split(' = ') if newLine[0] != 'mask': newLine[0] = int(newLine[0].lstrip('mem[').rstrip(']')) max_size = max(maxSize, newLine[0] + 1) newLine[1] = f'{int(newLine[1]):036b}' dataLine.append(newLine) mem = [0 for x in range(maxSize)] return dataLine def process_data(data): global mask global mem global maskCount for line in data: if line[0] == 'mask': mask = line[1] mask_count = mask.count('X') else: line[1] = update_bits(mask, line[1]) mem[line[0]] = int(line[1], 2) def update_bits(mask, bits): mask = [bit for bit in mask] bits = [bit for bit in bits] for i in range(36): if mask[i] != 'X': bits[i] = mask[i] return ''.join(bits) input_file = 'day14-input.txt' mask = 'XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX' mask_count = 0 mem = [] if __name__ == '__main__': data = file_input() data = split_data(data) process_data(data) print(sum(mem))
#!/usr/bin/env python3 class DNSMasq_DHCP_Generic_Switchable: def __init__(self, name, value): self.name = name self.value = value def __str__(self): if self.value is None: return self.name elif self.value is not None: return self.name + "=" + self.value class DNSMasq_DHCP_Option: def __init__(self, option, value): scope = None self.option = option self.value = value def __init__(self, scope, option, value): self.scope = scope self.option = option self.value = value def get_scope(self): return self.scope def get_option(self): return self.option def get_value(self): return self.value def get_comment(self): if self.get_option() == "3": return "# Default Gateway" elif self.get_option() == "6": return "# Default DNS" elif self.get_option() == "42": return "# Default NTP" else: return "" def __add__(self, o): return self.get_str() + o def __str__(self): return self.get_str() def get_str(self): res = [] if self.get_scope() is not None: res.append(str(self.get_scope())) res.append(str(self.get_option())) res.append(str(self.get_value())) return "dhcp-option=" + \ ",".join(res) + \ " " + \ str(self.get_comment()) class DNSMasq_DHCP_Range: def __init__(self, range_min, range_max, netmask, lease_time): scope = None self.range_min = range_min self.range_max = range_max self.netmask = netmask self.lease_time = lease_time def __init__(self, scope, range_min, range_max, netmask, lease_time): self.scope = scope self.range_min = range_min self.range_max = range_max self.netmask = netmask self.lease_time = lease_time def get_scope(self): return self.scope def get_range_min(self): return self.range_min def get_range_max(self): return self.range_max def get_netmask(self): return self.netmask def get_lease_time(self): return self.lease_time def __add__(self, o): return self.get_str() + o def __str__(self): return self.get_str() def get_str(self): res = [] if self.get_scope() is not None: res.append(str(self.get_scope())) res.append(str(self.get_range_min())) res.append(str(self.get_range_max())) res.append(str(self.get_netmask())) res.append(str(self.get_lease_time())) return "dhcp-range=" + \ ",".join(res) class DNSMasq_DHCP_Host: def __init__(self, mac_address, hostname, ip_address, lease_time): scope = None self.mac_address = mac_address self.hostname = hostname self.ip_address = ip_address self.lease_time = lease_time def __init__(self, scope, mac_address, hostname, ip_address, lease_time): self.scope = scope self.mac_address = mac_address self.hostname = hostname self.ip_address = ip_address self.lease_time = lease_time def get_scope(self): return self.scope def get_mac_address(self): return self.mac_address def get_hostname(self): return self.hostname def get_ip_address(self): return self.ip_address def get_lease_time(self): return self.lease_time def __add__(self, o): return self.get_str() + o def __str__(self): return self.get_str() def get_str(self): res = [] if self.get_scope() is not None: res.append(str(self.get_scope())) res.append(str(self.get_mac_address())) res.append(str(self.get_hostname())) res.append(str(self.get_ip_address())) res.append(str(self.get_lease_time())) return "dhcp-host=" + \ ",".join(res) class DNSMasq_DHCP_Section: def __init__(self): self.site = None self.role = None self.vlan_id = None self.vlan_name = None self.vrf_name = None self.prefix = None self.dhcp_options = [] self.dhcp_ranges = [] self.dhcp_hosts = [] def set_site(self, site): self.site = site def set_role(self, role): self.role = role def set_vlan_id(self, vlan_id): self.vlan_id = vlan_id def set_vlan_name(self, vlan_name): self.vlan_name = vlan_name def set_vrf_name(self, vrf_name): self.vrf_name = vrf_name def set_prefix(self, prefix): self.prefix = prefix def append_dhcp_option(self, dhcp_option): self.dhcp_options.append(dhcp_option) def append_dhcp_range(self, dhcp_range): self.dhcp_ranges.append(dhcp_range) def append_dhcp_host(self, dhcp_host): self.dhcp_hosts.append(dhcp_host) def get_header(self): # Example ### Site: Home ### Role: Untagged ### Vlan: 66 (Home VLAN) with ID: 66 ### VRF: vrf_66_homelan ### Prefix: 192.168.1.0/24 res = [] if self.site is not None: res.append("### Site: " + self.site) if self.role is not None: res.append("### Role: " + self.role) if self.vlan_id is not None and self.vlan_name is not None: res.append("### Vlan: " + self.vlan_name + " with ID: " + str(self.vlan_id)) elif self.vlan_id is not None: res.append("### Vlan ID: " + str(self.vlan_id)) elif self.vlan_name is not None: res.append("### Vlan: " + self.vlan_name) if self.vrf_name is not None: res.append("### VRF: " + self.vrf_name) if self.prefix is not None: res.append("### Prefix: " + self.prefix) return "\n".join(res) def get_options(self): return self.dhcp_options def get_ranges(self): return self.dhcp_ranges def get_hosts(self): return self.dhcp_hosts class DNSMasq_DHCP_Config: def __init__(self): self.dhcp_config_generic_switches = [] self.dhcp_config_sections = [] def append_to_dhcp_config_generic_switches(self, obj): self.dhcp_config_generic_switches.append(obj) def append_to_dhcp_config_sections(self, obj): self.dhcp_config_sections.append(obj) def print(self): print(self) def __str__(self): res = [] for sw in self.dhcp_config_generic_switches: res.append(str(sw)) for sec in self.dhcp_config_sections: res.append(str("")) res.append(str("")) res.append(str(sec.get_header())) res.append(str("")) for opts in sec.get_options(): res.append(str(opts)) res.append(str("")) for ran in sec.get_ranges(): res.append(str(ran)) res.append(str("")) for host in sec.get_hosts(): res.append(str(host)) return "\n".join(res)
class Dnsmasq_Dhcp_Generic_Switchable: def __init__(self, name, value): self.name = name self.value = value def __str__(self): if self.value is None: return self.name elif self.value is not None: return self.name + '=' + self.value class Dnsmasq_Dhcp_Option: def __init__(self, option, value): scope = None self.option = option self.value = value def __init__(self, scope, option, value): self.scope = scope self.option = option self.value = value def get_scope(self): return self.scope def get_option(self): return self.option def get_value(self): return self.value def get_comment(self): if self.get_option() == '3': return '# Default Gateway' elif self.get_option() == '6': return '# Default DNS' elif self.get_option() == '42': return '# Default NTP' else: return '' def __add__(self, o): return self.get_str() + o def __str__(self): return self.get_str() def get_str(self): res = [] if self.get_scope() is not None: res.append(str(self.get_scope())) res.append(str(self.get_option())) res.append(str(self.get_value())) return 'dhcp-option=' + ','.join(res) + ' ' + str(self.get_comment()) class Dnsmasq_Dhcp_Range: def __init__(self, range_min, range_max, netmask, lease_time): scope = None self.range_min = range_min self.range_max = range_max self.netmask = netmask self.lease_time = lease_time def __init__(self, scope, range_min, range_max, netmask, lease_time): self.scope = scope self.range_min = range_min self.range_max = range_max self.netmask = netmask self.lease_time = lease_time def get_scope(self): return self.scope def get_range_min(self): return self.range_min def get_range_max(self): return self.range_max def get_netmask(self): return self.netmask def get_lease_time(self): return self.lease_time def __add__(self, o): return self.get_str() + o def __str__(self): return self.get_str() def get_str(self): res = [] if self.get_scope() is not None: res.append(str(self.get_scope())) res.append(str(self.get_range_min())) res.append(str(self.get_range_max())) res.append(str(self.get_netmask())) res.append(str(self.get_lease_time())) return 'dhcp-range=' + ','.join(res) class Dnsmasq_Dhcp_Host: def __init__(self, mac_address, hostname, ip_address, lease_time): scope = None self.mac_address = mac_address self.hostname = hostname self.ip_address = ip_address self.lease_time = lease_time def __init__(self, scope, mac_address, hostname, ip_address, lease_time): self.scope = scope self.mac_address = mac_address self.hostname = hostname self.ip_address = ip_address self.lease_time = lease_time def get_scope(self): return self.scope def get_mac_address(self): return self.mac_address def get_hostname(self): return self.hostname def get_ip_address(self): return self.ip_address def get_lease_time(self): return self.lease_time def __add__(self, o): return self.get_str() + o def __str__(self): return self.get_str() def get_str(self): res = [] if self.get_scope() is not None: res.append(str(self.get_scope())) res.append(str(self.get_mac_address())) res.append(str(self.get_hostname())) res.append(str(self.get_ip_address())) res.append(str(self.get_lease_time())) return 'dhcp-host=' + ','.join(res) class Dnsmasq_Dhcp_Section: def __init__(self): self.site = None self.role = None self.vlan_id = None self.vlan_name = None self.vrf_name = None self.prefix = None self.dhcp_options = [] self.dhcp_ranges = [] self.dhcp_hosts = [] def set_site(self, site): self.site = site def set_role(self, role): self.role = role def set_vlan_id(self, vlan_id): self.vlan_id = vlan_id def set_vlan_name(self, vlan_name): self.vlan_name = vlan_name def set_vrf_name(self, vrf_name): self.vrf_name = vrf_name def set_prefix(self, prefix): self.prefix = prefix def append_dhcp_option(self, dhcp_option): self.dhcp_options.append(dhcp_option) def append_dhcp_range(self, dhcp_range): self.dhcp_ranges.append(dhcp_range) def append_dhcp_host(self, dhcp_host): self.dhcp_hosts.append(dhcp_host) def get_header(self): res = [] if self.site is not None: res.append('### Site: ' + self.site) if self.role is not None: res.append('### Role: ' + self.role) if self.vlan_id is not None and self.vlan_name is not None: res.append('### Vlan: ' + self.vlan_name + ' with ID: ' + str(self.vlan_id)) elif self.vlan_id is not None: res.append('### Vlan ID: ' + str(self.vlan_id)) elif self.vlan_name is not None: res.append('### Vlan: ' + self.vlan_name) if self.vrf_name is not None: res.append('### VRF: ' + self.vrf_name) if self.prefix is not None: res.append('### Prefix: ' + self.prefix) return '\n'.join(res) def get_options(self): return self.dhcp_options def get_ranges(self): return self.dhcp_ranges def get_hosts(self): return self.dhcp_hosts class Dnsmasq_Dhcp_Config: def __init__(self): self.dhcp_config_generic_switches = [] self.dhcp_config_sections = [] def append_to_dhcp_config_generic_switches(self, obj): self.dhcp_config_generic_switches.append(obj) def append_to_dhcp_config_sections(self, obj): self.dhcp_config_sections.append(obj) def print(self): print(self) def __str__(self): res = [] for sw in self.dhcp_config_generic_switches: res.append(str(sw)) for sec in self.dhcp_config_sections: res.append(str('')) res.append(str('')) res.append(str(sec.get_header())) res.append(str('')) for opts in sec.get_options(): res.append(str(opts)) res.append(str('')) for ran in sec.get_ranges(): res.append(str(ran)) res.append(str('')) for host in sec.get_hosts(): res.append(str(host)) return '\n'.join(res)
df4 = pandas.read_csv('supermarkets-commas.txt') df4 df5 = pandas.read_csv('supermarkets-semi-colons.txt',sep=';') df5
df4 = pandas.read_csv('supermarkets-commas.txt') df4 df5 = pandas.read_csv('supermarkets-semi-colons.txt', sep=';') df5
class DummyScheduler(object): def __init__(self, optimizer): pass def step(self): pass
class Dummyscheduler(object): def __init__(self, optimizer): pass def step(self): pass
a = [int(x) for x in input().split()] aset = set() for i in range(5): for j in range(i+1, 5): for k in range(j+1, 5): aset.add(a[i] + a[j] + a[k]) print(sorted(aset, reverse=True)[2])
a = [int(x) for x in input().split()] aset = set() for i in range(5): for j in range(i + 1, 5): for k in range(j + 1, 5): aset.add(a[i] + a[j] + a[k]) print(sorted(aset, reverse=True)[2])
# Configuration file for interface "rpc". This interface is # used in conjunction with RPC resource for cage-to-cage RPC calls. # # If location discovery at runtime is used (which is recommended), # then all the cages that wish to share the same RPC "namespace" need # identical broadcast ports, broadcast addresses that face the same # subnet and the same flock_id, which is an arbitrary identifier around # which all the related cages are grouped, same port broadcasts with # different flock id will be ignored. # # The RPC listener is bound to a random port in specified range, # which is later advertised at runtime to other cages. In case # such broadcast advertisement are forbidden an exact port number # can be specified, as a positive number (vs. negative for range). # In this case other cages will likely have an entry in # config_resource_rpc.py exact_locations parameter specifying this # cage's address. # # There is no need to make a copy of this file for each cage, # but you may need to modify the broadcast_address parameter # if your OS doesn't work with 255.255.255.255 broadcasts, # for example, under FreeBSD change it to something like # "192.168.0.1/192.168.255.255". config = dict \ ( protocol = "rpc", # meta random_port = -63000, # tcp, negative means "in range 63000..63999" max_connections = 100, # tcp broadcast_address = ("0.0.0.0/255.255.255.255", 12480), # rpc, "interface address/broadcast address", port ssl_ciphers = None, # ssl, optional str ssl_protocol = None, # ssl, optional "SSLv23", "TLSv1", "TLSv1_1", "TLSv1_2" or "TLS" flock_id = "DEFAULT", # rpc marshaling_methods = ("msgpack", "pickle"), # rpc, allowed marshaling methods max_packet_size = 1048576, # rpc, maximum allowed request/response size in bytes ) # DO NOT TOUCH BELOW THIS LINE __all__ = [ "get", "copy" ] get = lambda key, default = None: pmnc.config.get_(config, {}, key, default) copy = lambda: pmnc.config.copy_(config, {}) # EOF
config = dict(protocol='rpc', random_port=-63000, max_connections=100, broadcast_address=('0.0.0.0/255.255.255.255', 12480), ssl_ciphers=None, ssl_protocol=None, flock_id='DEFAULT', marshaling_methods=('msgpack', 'pickle'), max_packet_size=1048576) __all__ = ['get', 'copy'] get = lambda key, default=None: pmnc.config.get_(config, {}, key, default) copy = lambda : pmnc.config.copy_(config, {})
EXAMPLE_TWEETS = [ "Trump for President!!! #MAGA", "Trump is the best ever!", "RT @someuser: Trump is, by far, the best POTUS in history. \n\nBonus: He^s friggin^ awesome!\n\nTrump gave Pelosi and the Dems the ultimate\u2026 ", "If Clinton is elected, I'm moving to Canada", "Trump is doing a great job so far. Keep it up man.", "He is awesome, make american great again. Democrats is taking off. We love democrats.", "This tweet is about basketball, and I'm watching tonight on CBS Sports", "Hillary for President!!! #StrongerTogether", "Trump is the worst ever!", "If Trump is elected, I'm moving to Canada", "RT @MotherJones: A scientist who resisted Trump administration censorship of climate report just lost her job", "Trump is doing a terrible job so far. Vote him out ASAP." ]
example_tweets = ['Trump for President!!! #MAGA', 'Trump is the best ever!', 'RT @someuser: Trump is, by far, the best POTUS in history. \n\nBonus: He^s friggin^ awesome!\n\nTrump gave Pelosi and the Dems the ultimate… ', "If Clinton is elected, I'm moving to Canada", 'Trump is doing a great job so far. Keep it up man.', 'He is awesome, make american great again. Democrats is taking off. We love democrats.', "This tweet is about basketball, and I'm watching tonight on CBS Sports", 'Hillary for President!!! #StrongerTogether', 'Trump is the worst ever!', "If Trump is elected, I'm moving to Canada", 'RT @MotherJones: A scientist who resisted Trump administration censorship of climate report just lost her job', 'Trump is doing a terrible job so far. Vote him out ASAP.']
test_item = { "stac_version": "1.0.0", "stac_extensions": [], "type": "Feature", "id": "20201211_223832_CS2", "bbox": [ 172.91173669923782, 1.3438851951615003, 172.95469614953714, 1.3690476620161975 ], "geometry": { "type": "Polygon", "coordinates": [ [ [ 172.91173669923782, 1.3438851951615003 ], [ 172.95469614953714, 1.3438851951615003 ], [ 172.95469614953714, 1.3690476620161975 ], [ 172.91173669923782, 1.3690476620161975 ], [ 172.91173669923782, 1.3438851951615003 ] ] ] }, "properties": { "datetime": "2020-12-11T22:38:32.125000Z" }, "collection": "simple-collection", "links": [ { "rel": "collection", "href": "./collection.json", "type": "application/json", "title": "Simple Example Collection" }, { "rel": "root", "href": "./collection.json", "type": "application/json", "title": "Simple Example Collection" }, { "rel": "parent", "href": "./collection.json", "type": "application/json", "title": "Simple Example Collection" } ], "assets": { "visual": { "href": "https://storage.googleapis.com/open-cogs/stac-examples/20201211_223832_CS2.tif", "type": "image/tiff; application=geotiff; profile=cloud-optimized", "title": "3-Band Visual", "roles": [ "visual" ] }, "thumbnail": { "href": "https://storage.googleapis.com/open-cogs/stac-examples/20201211_223832_CS2.jpg", "title": "Thumbnail", "type": "image/jpeg", "roles": [ "thumbnail" ] } } }
test_item = {'stac_version': '1.0.0', 'stac_extensions': [], 'type': 'Feature', 'id': '20201211_223832_CS2', 'bbox': [172.91173669923782, 1.3438851951615003, 172.95469614953714, 1.3690476620161975], 'geometry': {'type': 'Polygon', 'coordinates': [[[172.91173669923782, 1.3438851951615003], [172.95469614953714, 1.3438851951615003], [172.95469614953714, 1.3690476620161975], [172.91173669923782, 1.3690476620161975], [172.91173669923782, 1.3438851951615003]]]}, 'properties': {'datetime': '2020-12-11T22:38:32.125000Z'}, 'collection': 'simple-collection', 'links': [{'rel': 'collection', 'href': './collection.json', 'type': 'application/json', 'title': 'Simple Example Collection'}, {'rel': 'root', 'href': './collection.json', 'type': 'application/json', 'title': 'Simple Example Collection'}, {'rel': 'parent', 'href': './collection.json', 'type': 'application/json', 'title': 'Simple Example Collection'}], 'assets': {'visual': {'href': 'https://storage.googleapis.com/open-cogs/stac-examples/20201211_223832_CS2.tif', 'type': 'image/tiff; application=geotiff; profile=cloud-optimized', 'title': '3-Band Visual', 'roles': ['visual']}, 'thumbnail': {'href': 'https://storage.googleapis.com/open-cogs/stac-examples/20201211_223832_CS2.jpg', 'title': 'Thumbnail', 'type': 'image/jpeg', 'roles': ['thumbnail']}}}
# output: ok assert([x for x in ()] == []) assert([x for x in range(0, 3)] == [0, 1, 2]) assert([(x, y) for x in range(0, 2) for y in range(2, 4)] == [(0, 2), (0, 3), (1, 2), (1, 3)]) assert([x for x in range(0, 3) if x >= 1] == [1, 2]) def inc(x): return x + 1 assert([inc(y) for y in (1, 2, 3)] == [2, 3, 4]) a = 1 assert([a for y in (1, 2, 3)] == [1, 1, 1]) assert([(lambda x: x * 2)(y) for y in (1, 2, 3)] == [2, 4, 6]) assert([(lambda x: y * 2)(y) for y in (1, 2, 3)] == [2, 4, 6]) print('ok')
assert [x for x in ()] == [] assert [x for x in range(0, 3)] == [0, 1, 2] assert [(x, y) for x in range(0, 2) for y in range(2, 4)] == [(0, 2), (0, 3), (1, 2), (1, 3)] assert [x for x in range(0, 3) if x >= 1] == [1, 2] def inc(x): return x + 1 assert [inc(y) for y in (1, 2, 3)] == [2, 3, 4] a = 1 assert [a for y in (1, 2, 3)] == [1, 1, 1] assert [(lambda x: x * 2)(y) for y in (1, 2, 3)] == [2, 4, 6] assert [(lambda x: y * 2)(y) for y in (1, 2, 3)] == [2, 4, 6] print('ok')
# # PySNMP MIB module ASCEND-MIBVDSLNET-MIB (http://snmplabs.com/pysmi) # ASN.1 source file:///Users/davwang4/Dev/mibs.snmplabs.com/asn1/ASCEND-MIBVDSLNET-MIB # Produced by pysmi-0.3.4 at Wed May 1 11:28:54 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) # configuration, = mibBuilder.importSymbols("ASCEND-MIB", "configuration") OctetString, Integer, ObjectIdentifier = mibBuilder.importSymbols("ASN1", "OctetString", "Integer", "ObjectIdentifier") NamedValues, = mibBuilder.importSymbols("ASN1-ENUMERATION", "NamedValues") SingleValueConstraint, ConstraintsUnion, ValueSizeConstraint, ValueRangeConstraint, ConstraintsIntersection = mibBuilder.importSymbols("ASN1-REFINEMENT", "SingleValueConstraint", "ConstraintsUnion", "ValueSizeConstraint", "ValueRangeConstraint", "ConstraintsIntersection") ModuleCompliance, NotificationGroup = mibBuilder.importSymbols("SNMPv2-CONF", "ModuleCompliance", "NotificationGroup") Counter32, Counter64, Integer32, Bits, TimeTicks, ObjectIdentity, Unsigned32, iso, NotificationType, MibIdentifier, ModuleIdentity, Gauge32, IpAddress, MibScalar, MibTable, MibTableRow, MibTableColumn = mibBuilder.importSymbols("SNMPv2-SMI", "Counter32", "Counter64", "Integer32", "Bits", "TimeTicks", "ObjectIdentity", "Unsigned32", "iso", "NotificationType", "MibIdentifier", "ModuleIdentity", "Gauge32", "IpAddress", "MibScalar", "MibTable", "MibTableRow", "MibTableColumn") TextualConvention, DisplayString = mibBuilder.importSymbols("SNMPv2-TC", "TextualConvention", "DisplayString") class DisplayString(OctetString): pass mibvdslNetworkProfile = MibIdentifier((1, 3, 6, 1, 4, 1, 529, 23, 9)) mibvdslNetworkProfileTable = MibTable((1, 3, 6, 1, 4, 1, 529, 23, 9, 1), ) if mibBuilder.loadTexts: mibvdslNetworkProfileTable.setStatus('mandatory') if mibBuilder.loadTexts: mibvdslNetworkProfileTable.setDescription('A list of mibvdslNetworkProfile profile entries.') mibvdslNetworkProfileEntry = MibTableRow((1, 3, 6, 1, 4, 1, 529, 23, 9, 1, 1), ).setIndexNames((0, "ASCEND-MIBVDSLNET-MIB", "vdslNetworkProfile-Shelf-o"), (0, "ASCEND-MIBVDSLNET-MIB", "vdslNetworkProfile-Slot-o"), (0, "ASCEND-MIBVDSLNET-MIB", "vdslNetworkProfile-Item-o")) if mibBuilder.loadTexts: mibvdslNetworkProfileEntry.setStatus('mandatory') if mibBuilder.loadTexts: mibvdslNetworkProfileEntry.setDescription('A mibvdslNetworkProfile entry containing objects that maps to the parameters of mibvdslNetworkProfile profile.') vdslNetworkProfile_Shelf_o = MibScalar((1, 3, 6, 1, 4, 1, 529, 23, 9, 1, 1, 1), Integer32()).setLabel("vdslNetworkProfile-Shelf-o").setMaxAccess("readonly") if mibBuilder.loadTexts: vdslNetworkProfile_Shelf_o.setStatus('mandatory') if mibBuilder.loadTexts: vdslNetworkProfile_Shelf_o.setDescription('') vdslNetworkProfile_Slot_o = MibScalar((1, 3, 6, 1, 4, 1, 529, 23, 9, 1, 1, 2), Integer32()).setLabel("vdslNetworkProfile-Slot-o").setMaxAccess("readonly") if mibBuilder.loadTexts: vdslNetworkProfile_Slot_o.setStatus('mandatory') if mibBuilder.loadTexts: vdslNetworkProfile_Slot_o.setDescription('') vdslNetworkProfile_Item_o = MibScalar((1, 3, 6, 1, 4, 1, 529, 23, 9, 1, 1, 3), Integer32()).setLabel("vdslNetworkProfile-Item-o").setMaxAccess("readonly") if mibBuilder.loadTexts: vdslNetworkProfile_Item_o.setStatus('mandatory') if mibBuilder.loadTexts: vdslNetworkProfile_Item_o.setDescription('') vdslNetworkProfile_Name = MibScalar((1, 3, 6, 1, 4, 1, 529, 23, 9, 1, 1, 4), DisplayString()).setLabel("vdslNetworkProfile-Name").setMaxAccess("readwrite") if mibBuilder.loadTexts: vdslNetworkProfile_Name.setStatus('mandatory') if mibBuilder.loadTexts: vdslNetworkProfile_Name.setDescription('For future use. The current design does not use the name field but instead references Vdsl lines by the physical address; we may in the future support referencing Vdsl lines by name as well as by address. The name consists of a null terminated ascii string supplied by the user; it defaults to the ascii form of the Vdsl line physical address.') vdslNetworkProfile_PhysicalAddress_Shelf = MibScalar((1, 3, 6, 1, 4, 1, 529, 23, 9, 1, 1, 11), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2, 3, 4, 5, 6, 7, 8, 9, 10))).clone(namedValues=NamedValues(("anyShelf", 1), ("shelf1", 2), ("shelf2", 3), ("shelf3", 4), ("shelf4", 5), ("shelf5", 6), ("shelf6", 7), ("shelf7", 8), ("shelf8", 9), ("shelf9", 10)))).setLabel("vdslNetworkProfile-PhysicalAddress-Shelf").setMaxAccess("readwrite") if mibBuilder.loadTexts: vdslNetworkProfile_PhysicalAddress_Shelf.setStatus('mandatory') if mibBuilder.loadTexts: vdslNetworkProfile_PhysicalAddress_Shelf.setDescription('The number of the shelf that the addressed physical device resides on.') vdslNetworkProfile_PhysicalAddress_Slot = MibScalar((1, 3, 6, 1, 4, 1, 529, 23, 9, 1, 1, 12), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 55, 56, 57, 58, 49, 50, 42, 53, 54, 45, 46, 51, 59))).clone(namedValues=NamedValues(("anySlot", 1), ("slot1", 2), ("slot2", 3), ("slot3", 4), ("slot4", 5), ("slot5", 6), ("slot6", 7), ("slot7", 8), ("slot8", 9), ("slot9", 10), ("slot10", 11), ("slot11", 12), ("slot12", 13), ("slot13", 14), ("slot14", 15), ("slot15", 16), ("slot16", 17), ("slot17", 18), ("slot18", 19), ("slot19", 20), ("slot20", 21), ("slot21", 22), ("slot22", 23), ("slot23", 24), ("slot24", 25), ("slot25", 26), ("slot26", 27), ("slot27", 28), ("slot28", 29), ("slot29", 30), ("slot30", 31), ("slot31", 32), ("slot32", 33), ("slot33", 34), ("slot34", 35), ("slot35", 36), ("slot36", 37), ("slot37", 38), ("slot38", 39), ("slot39", 40), ("slot40", 41), ("aLim", 55), ("bLim", 56), ("cLim", 57), ("dLim", 58), ("leftController", 49), ("rightController", 50), ("controller", 42), ("firstControlModule", 53), ("secondControlModule", 54), ("trunkModule1", 45), ("trunkModule2", 46), ("controlModule", 51), ("slotPrimary", 59)))).setLabel("vdslNetworkProfile-PhysicalAddress-Slot").setMaxAccess("readwrite") if mibBuilder.loadTexts: vdslNetworkProfile_PhysicalAddress_Slot.setStatus('mandatory') if mibBuilder.loadTexts: vdslNetworkProfile_PhysicalAddress_Slot.setDescription('The number of the slot that the addressed physical device resides on.') vdslNetworkProfile_PhysicalAddress_ItemNumber = MibScalar((1, 3, 6, 1, 4, 1, 529, 23, 9, 1, 1, 13), Integer32()).setLabel("vdslNetworkProfile-PhysicalAddress-ItemNumber").setMaxAccess("readwrite") if mibBuilder.loadTexts: vdslNetworkProfile_PhysicalAddress_ItemNumber.setStatus('mandatory') if mibBuilder.loadTexts: vdslNetworkProfile_PhysicalAddress_ItemNumber.setDescription('A number that specifies an addressable entity within the context of shelf and slot.') vdslNetworkProfile_Enabled = MibScalar((1, 3, 6, 1, 4, 1, 529, 23, 9, 1, 1, 16), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2))).clone(namedValues=NamedValues(("no", 1), ("yes", 2)))).setLabel("vdslNetworkProfile-Enabled").setMaxAccess("readwrite") if mibBuilder.loadTexts: vdslNetworkProfile_Enabled.setStatus('mandatory') if mibBuilder.loadTexts: vdslNetworkProfile_Enabled.setDescription('TRUE if the line is enabled, otherwise FALSE.') vdslNetworkProfile_SparingMode = MibScalar((1, 3, 6, 1, 4, 1, 529, 23, 9, 1, 1, 17), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2, 3))).clone(namedValues=NamedValues(("inactive", 1), ("manual", 2), ("automatic", 3)))).setLabel("vdslNetworkProfile-SparingMode").setMaxAccess("readwrite") if mibBuilder.loadTexts: vdslNetworkProfile_SparingMode.setStatus('mandatory') if mibBuilder.loadTexts: vdslNetworkProfile_SparingMode.setDescription('Port sparing operational mode for this port.') vdslNetworkProfile_IgnoreLineup = MibScalar((1, 3, 6, 1, 4, 1, 529, 23, 9, 1, 1, 18), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2, 3))).clone(namedValues=NamedValues(("systemDefined", 1), ("no", 2), ("yes", 3)))).setLabel("vdslNetworkProfile-IgnoreLineup").setMaxAccess("readwrite") if mibBuilder.loadTexts: vdslNetworkProfile_IgnoreLineup.setStatus('mandatory') if mibBuilder.loadTexts: vdslNetworkProfile_IgnoreLineup.setDescription('Ignore line up value for this port.') vdslNetworkProfile_LineConfig_NailedGroup = MibScalar((1, 3, 6, 1, 4, 1, 529, 23, 9, 1, 1, 19), Integer32()).setLabel("vdslNetworkProfile-LineConfig-NailedGroup").setMaxAccess("readwrite") if mibBuilder.loadTexts: vdslNetworkProfile_LineConfig_NailedGroup.setStatus('mandatory') if mibBuilder.loadTexts: vdslNetworkProfile_LineConfig_NailedGroup.setDescription('A number that identifies the this unique physical DSL line.') vdslNetworkProfile_LineConfig_VpSwitchingVpi = MibScalar((1, 3, 6, 1, 4, 1, 529, 23, 9, 1, 1, 20), Integer32()).setLabel("vdslNetworkProfile-LineConfig-VpSwitchingVpi").setMaxAccess("readwrite") if mibBuilder.loadTexts: vdslNetworkProfile_LineConfig_VpSwitchingVpi.setStatus('mandatory') if mibBuilder.loadTexts: vdslNetworkProfile_LineConfig_VpSwitchingVpi.setDescription('The Vpi to be used for the VP switching. Rest of the VPIs within valid vpi-vci-range will be used for the VC switching. Changes in this range will take effect immediately. THE USER SHOULD BE VERY CAREFUL WHILE CHANGING THIS VALUE BECAUSE ALL CONNECTIONS ON THE LIM WHERE THIS PORT BELONGS WILL BE DROPPED IN ORDER TO MAKE THIS NEW VALUE EFFECTIVE IMMEDIATELY.') vdslNetworkProfile_LineConfig_UpStreamFixedRate = MibScalar((1, 3, 6, 1, 4, 1, 529, 23, 9, 1, 1, 22), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2, 3, 4))).clone(namedValues=NamedValues(("n-1206667", 1), ("n-965333", 2), ("n-1930667", 3), ("n-3861333", 4)))).setLabel("vdslNetworkProfile-LineConfig-UpStreamFixedRate").setMaxAccess("readwrite") if mibBuilder.loadTexts: vdslNetworkProfile_LineConfig_UpStreamFixedRate.setStatus('mandatory') if mibBuilder.loadTexts: vdslNetworkProfile_LineConfig_UpStreamFixedRate.setDescription('The following Up/Down stream rate relationships are supported: (0.965Mbps/19.306Mbps); (1.930Mbps/11.463Mbps); (3.861Mbps/11.463Mbps); (3.861Mbps/15.626Mbps). Up Stream range: 0.965Mbps - 3.861Mbps.') vdslNetworkProfile_LineConfig_DownStreamFixedRate = MibScalar((1, 3, 6, 1, 4, 1, 529, 23, 9, 1, 1, 23), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2, 3, 4))).clone(namedValues=NamedValues(("n-1206667", 1), ("n-11463333", 2), ("n-15626333", 3), ("n-19306667", 4)))).setLabel("vdslNetworkProfile-LineConfig-DownStreamFixedRate").setMaxAccess("readwrite") if mibBuilder.loadTexts: vdslNetworkProfile_LineConfig_DownStreamFixedRate.setStatus('mandatory') if mibBuilder.loadTexts: vdslNetworkProfile_LineConfig_DownStreamFixedRate.setDescription('The following Up/Down stream rate relationships are supported: (0.965Mbps/19.306Mbps); (1.930Mbps/11.463Mbps); (3.861Mbps/11.463Mbps); (3.861Mbps/15.626Mbps). Down Stream range: 11.463Mbps - 15.626Mbps.') vdslNetworkProfile_LineConfig_ConfigLoopback = MibScalar((1, 3, 6, 1, 4, 1, 529, 23, 9, 1, 1, 24), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2, 3))).clone(namedValues=NamedValues(("disable", 1), ("digital", 2), ("analog", 3)))).setLabel("vdslNetworkProfile-LineConfig-ConfigLoopback").setMaxAccess("readwrite") if mibBuilder.loadTexts: vdslNetworkProfile_LineConfig_ConfigLoopback.setStatus('mandatory') if mibBuilder.loadTexts: vdslNetworkProfile_LineConfig_ConfigLoopback.setDescription('Configuration of different modem loopbacks.') vdslNetworkProfile_LineConfig_PsdValue = MibScalar((1, 3, 6, 1, 4, 1, 529, 23, 9, 1, 1, 25), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2))).clone(namedValues=NamedValues(("n-53dbm", 1), ("n-60dbm", 2)))).setLabel("vdslNetworkProfile-LineConfig-PsdValue").setMaxAccess("readwrite") if mibBuilder.loadTexts: vdslNetworkProfile_LineConfig_PsdValue.setStatus('mandatory') if mibBuilder.loadTexts: vdslNetworkProfile_LineConfig_PsdValue.setDescription('Configuration of PSD parameter. It defines the power that is allowed to be sent to the line.') vdslNetworkProfile_LineConfig_LinkStatecmd = MibScalar((1, 3, 6, 1, 4, 1, 529, 23, 9, 1, 1, 26), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(16, 1, 2, 3, 4, 5, 6, 7, 8))).clone(namedValues=NamedValues(("autoConnectCmd", 16), ("disconnectState", 1), ("connectState", 2), ("quietState", 3), ("idleReqState", 4), ("backToServState", 5), ("changeIdleParamState", 6), ("changeWarmStartParamState", 7), ("changeCurrentParamState", 8)))).setLabel("vdslNetworkProfile-LineConfig-LinkStatecmd").setMaxAccess("readwrite") if mibBuilder.loadTexts: vdslNetworkProfile_LineConfig_LinkStatecmd.setStatus('mandatory') if mibBuilder.loadTexts: vdslNetworkProfile_LineConfig_LinkStatecmd.setDescription('Sets the link connect state. Use this to control status of the VDSL link connect state machine. The auto-connect-cmd will train modem up to the final service. All the other commands are used to manualy operate the VDSL link connect state machine.') vdslNetworkProfile_Action_o = MibScalar((1, 3, 6, 1, 4, 1, 529, 23, 9, 1, 1, 14), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2, 3))).clone(namedValues=NamedValues(("noAction", 1), ("createProfile", 2), ("deleteProfile", 3)))).setLabel("vdslNetworkProfile-Action-o").setMaxAccess("readwrite") if mibBuilder.loadTexts: vdslNetworkProfile_Action_o.setStatus('mandatory') if mibBuilder.loadTexts: vdslNetworkProfile_Action_o.setDescription('') mibBuilder.exportSymbols("ASCEND-MIBVDSLNET-MIB", vdslNetworkProfile_Slot_o=vdslNetworkProfile_Slot_o, vdslNetworkProfile_Name=vdslNetworkProfile_Name, vdslNetworkProfile_LineConfig_LinkStatecmd=vdslNetworkProfile_LineConfig_LinkStatecmd, vdslNetworkProfile_LineConfig_VpSwitchingVpi=vdslNetworkProfile_LineConfig_VpSwitchingVpi, vdslNetworkProfile_PhysicalAddress_Slot=vdslNetworkProfile_PhysicalAddress_Slot, vdslNetworkProfile_PhysicalAddress_Shelf=vdslNetworkProfile_PhysicalAddress_Shelf, mibvdslNetworkProfileTable=mibvdslNetworkProfileTable, vdslNetworkProfile_IgnoreLineup=vdslNetworkProfile_IgnoreLineup, vdslNetworkProfile_SparingMode=vdslNetworkProfile_SparingMode, vdslNetworkProfile_PhysicalAddress_ItemNumber=vdslNetworkProfile_PhysicalAddress_ItemNumber, vdslNetworkProfile_LineConfig_PsdValue=vdslNetworkProfile_LineConfig_PsdValue, vdslNetworkProfile_LineConfig_DownStreamFixedRate=vdslNetworkProfile_LineConfig_DownStreamFixedRate, vdslNetworkProfile_Enabled=vdslNetworkProfile_Enabled, vdslNetworkProfile_LineConfig_NailedGroup=vdslNetworkProfile_LineConfig_NailedGroup, DisplayString=DisplayString, vdslNetworkProfile_Action_o=vdslNetworkProfile_Action_o, vdslNetworkProfile_Shelf_o=vdslNetworkProfile_Shelf_o, mibvdslNetworkProfile=mibvdslNetworkProfile, mibvdslNetworkProfileEntry=mibvdslNetworkProfileEntry, vdslNetworkProfile_Item_o=vdslNetworkProfile_Item_o, vdslNetworkProfile_LineConfig_UpStreamFixedRate=vdslNetworkProfile_LineConfig_UpStreamFixedRate, vdslNetworkProfile_LineConfig_ConfigLoopback=vdslNetworkProfile_LineConfig_ConfigLoopback)
(configuration,) = mibBuilder.importSymbols('ASCEND-MIB', 'configuration') (octet_string, integer, object_identifier) = mibBuilder.importSymbols('ASN1', 'OctetString', 'Integer', 'ObjectIdentifier') (named_values,) = mibBuilder.importSymbols('ASN1-ENUMERATION', 'NamedValues') (single_value_constraint, constraints_union, value_size_constraint, value_range_constraint, constraints_intersection) = mibBuilder.importSymbols('ASN1-REFINEMENT', 'SingleValueConstraint', 'ConstraintsUnion', 'ValueSizeConstraint', 'ValueRangeConstraint', 'ConstraintsIntersection') (module_compliance, notification_group) = mibBuilder.importSymbols('SNMPv2-CONF', 'ModuleCompliance', 'NotificationGroup') (counter32, counter64, integer32, bits, time_ticks, object_identity, unsigned32, iso, notification_type, mib_identifier, module_identity, gauge32, ip_address, mib_scalar, mib_table, mib_table_row, mib_table_column) = mibBuilder.importSymbols('SNMPv2-SMI', 'Counter32', 'Counter64', 'Integer32', 'Bits', 'TimeTicks', 'ObjectIdentity', 'Unsigned32', 'iso', 'NotificationType', 'MibIdentifier', 'ModuleIdentity', 'Gauge32', 'IpAddress', 'MibScalar', 'MibTable', 'MibTableRow', 'MibTableColumn') (textual_convention, display_string) = mibBuilder.importSymbols('SNMPv2-TC', 'TextualConvention', 'DisplayString') class Displaystring(OctetString): pass mibvdsl_network_profile = mib_identifier((1, 3, 6, 1, 4, 1, 529, 23, 9)) mibvdsl_network_profile_table = mib_table((1, 3, 6, 1, 4, 1, 529, 23, 9, 1)) if mibBuilder.loadTexts: mibvdslNetworkProfileTable.setStatus('mandatory') if mibBuilder.loadTexts: mibvdslNetworkProfileTable.setDescription('A list of mibvdslNetworkProfile profile entries.') mibvdsl_network_profile_entry = mib_table_row((1, 3, 6, 1, 4, 1, 529, 23, 9, 1, 1)).setIndexNames((0, 'ASCEND-MIBVDSLNET-MIB', 'vdslNetworkProfile-Shelf-o'), (0, 'ASCEND-MIBVDSLNET-MIB', 'vdslNetworkProfile-Slot-o'), (0, 'ASCEND-MIBVDSLNET-MIB', 'vdslNetworkProfile-Item-o')) if mibBuilder.loadTexts: mibvdslNetworkProfileEntry.setStatus('mandatory') if mibBuilder.loadTexts: mibvdslNetworkProfileEntry.setDescription('A mibvdslNetworkProfile entry containing objects that maps to the parameters of mibvdslNetworkProfile profile.') vdsl_network_profile__shelf_o = mib_scalar((1, 3, 6, 1, 4, 1, 529, 23, 9, 1, 1, 1), integer32()).setLabel('vdslNetworkProfile-Shelf-o').setMaxAccess('readonly') if mibBuilder.loadTexts: vdslNetworkProfile_Shelf_o.setStatus('mandatory') if mibBuilder.loadTexts: vdslNetworkProfile_Shelf_o.setDescription('') vdsl_network_profile__slot_o = mib_scalar((1, 3, 6, 1, 4, 1, 529, 23, 9, 1, 1, 2), integer32()).setLabel('vdslNetworkProfile-Slot-o').setMaxAccess('readonly') if mibBuilder.loadTexts: vdslNetworkProfile_Slot_o.setStatus('mandatory') if mibBuilder.loadTexts: vdslNetworkProfile_Slot_o.setDescription('') vdsl_network_profile__item_o = mib_scalar((1, 3, 6, 1, 4, 1, 529, 23, 9, 1, 1, 3), integer32()).setLabel('vdslNetworkProfile-Item-o').setMaxAccess('readonly') if mibBuilder.loadTexts: vdslNetworkProfile_Item_o.setStatus('mandatory') if mibBuilder.loadTexts: vdslNetworkProfile_Item_o.setDescription('') vdsl_network_profile__name = mib_scalar((1, 3, 6, 1, 4, 1, 529, 23, 9, 1, 1, 4), display_string()).setLabel('vdslNetworkProfile-Name').setMaxAccess('readwrite') if mibBuilder.loadTexts: vdslNetworkProfile_Name.setStatus('mandatory') if mibBuilder.loadTexts: vdslNetworkProfile_Name.setDescription('For future use. The current design does not use the name field but instead references Vdsl lines by the physical address; we may in the future support referencing Vdsl lines by name as well as by address. The name consists of a null terminated ascii string supplied by the user; it defaults to the ascii form of the Vdsl line physical address.') vdsl_network_profile__physical_address__shelf = mib_scalar((1, 3, 6, 1, 4, 1, 529, 23, 9, 1, 1, 11), integer32().subtype(subtypeSpec=constraints_union(single_value_constraint(1, 2, 3, 4, 5, 6, 7, 8, 9, 10))).clone(namedValues=named_values(('anyShelf', 1), ('shelf1', 2), ('shelf2', 3), ('shelf3', 4), ('shelf4', 5), ('shelf5', 6), ('shelf6', 7), ('shelf7', 8), ('shelf8', 9), ('shelf9', 10)))).setLabel('vdslNetworkProfile-PhysicalAddress-Shelf').setMaxAccess('readwrite') if mibBuilder.loadTexts: vdslNetworkProfile_PhysicalAddress_Shelf.setStatus('mandatory') if mibBuilder.loadTexts: vdslNetworkProfile_PhysicalAddress_Shelf.setDescription('The number of the shelf that the addressed physical device resides on.') vdsl_network_profile__physical_address__slot = mib_scalar((1, 3, 6, 1, 4, 1, 529, 23, 9, 1, 1, 12), integer32().subtype(subtypeSpec=constraints_union(single_value_constraint(1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 55, 56, 57, 58, 49, 50, 42, 53, 54, 45, 46, 51, 59))).clone(namedValues=named_values(('anySlot', 1), ('slot1', 2), ('slot2', 3), ('slot3', 4), ('slot4', 5), ('slot5', 6), ('slot6', 7), ('slot7', 8), ('slot8', 9), ('slot9', 10), ('slot10', 11), ('slot11', 12), ('slot12', 13), ('slot13', 14), ('slot14', 15), ('slot15', 16), ('slot16', 17), ('slot17', 18), ('slot18', 19), ('slot19', 20), ('slot20', 21), ('slot21', 22), ('slot22', 23), ('slot23', 24), ('slot24', 25), ('slot25', 26), ('slot26', 27), ('slot27', 28), ('slot28', 29), ('slot29', 30), ('slot30', 31), ('slot31', 32), ('slot32', 33), ('slot33', 34), ('slot34', 35), ('slot35', 36), ('slot36', 37), ('slot37', 38), ('slot38', 39), ('slot39', 40), ('slot40', 41), ('aLim', 55), ('bLim', 56), ('cLim', 57), ('dLim', 58), ('leftController', 49), ('rightController', 50), ('controller', 42), ('firstControlModule', 53), ('secondControlModule', 54), ('trunkModule1', 45), ('trunkModule2', 46), ('controlModule', 51), ('slotPrimary', 59)))).setLabel('vdslNetworkProfile-PhysicalAddress-Slot').setMaxAccess('readwrite') if mibBuilder.loadTexts: vdslNetworkProfile_PhysicalAddress_Slot.setStatus('mandatory') if mibBuilder.loadTexts: vdslNetworkProfile_PhysicalAddress_Slot.setDescription('The number of the slot that the addressed physical device resides on.') vdsl_network_profile__physical_address__item_number = mib_scalar((1, 3, 6, 1, 4, 1, 529, 23, 9, 1, 1, 13), integer32()).setLabel('vdslNetworkProfile-PhysicalAddress-ItemNumber').setMaxAccess('readwrite') if mibBuilder.loadTexts: vdslNetworkProfile_PhysicalAddress_ItemNumber.setStatus('mandatory') if mibBuilder.loadTexts: vdslNetworkProfile_PhysicalAddress_ItemNumber.setDescription('A number that specifies an addressable entity within the context of shelf and slot.') vdsl_network_profile__enabled = mib_scalar((1, 3, 6, 1, 4, 1, 529, 23, 9, 1, 1, 16), integer32().subtype(subtypeSpec=constraints_union(single_value_constraint(1, 2))).clone(namedValues=named_values(('no', 1), ('yes', 2)))).setLabel('vdslNetworkProfile-Enabled').setMaxAccess('readwrite') if mibBuilder.loadTexts: vdslNetworkProfile_Enabled.setStatus('mandatory') if mibBuilder.loadTexts: vdslNetworkProfile_Enabled.setDescription('TRUE if the line is enabled, otherwise FALSE.') vdsl_network_profile__sparing_mode = mib_scalar((1, 3, 6, 1, 4, 1, 529, 23, 9, 1, 1, 17), integer32().subtype(subtypeSpec=constraints_union(single_value_constraint(1, 2, 3))).clone(namedValues=named_values(('inactive', 1), ('manual', 2), ('automatic', 3)))).setLabel('vdslNetworkProfile-SparingMode').setMaxAccess('readwrite') if mibBuilder.loadTexts: vdslNetworkProfile_SparingMode.setStatus('mandatory') if mibBuilder.loadTexts: vdslNetworkProfile_SparingMode.setDescription('Port sparing operational mode for this port.') vdsl_network_profile__ignore_lineup = mib_scalar((1, 3, 6, 1, 4, 1, 529, 23, 9, 1, 1, 18), integer32().subtype(subtypeSpec=constraints_union(single_value_constraint(1, 2, 3))).clone(namedValues=named_values(('systemDefined', 1), ('no', 2), ('yes', 3)))).setLabel('vdslNetworkProfile-IgnoreLineup').setMaxAccess('readwrite') if mibBuilder.loadTexts: vdslNetworkProfile_IgnoreLineup.setStatus('mandatory') if mibBuilder.loadTexts: vdslNetworkProfile_IgnoreLineup.setDescription('Ignore line up value for this port.') vdsl_network_profile__line_config__nailed_group = mib_scalar((1, 3, 6, 1, 4, 1, 529, 23, 9, 1, 1, 19), integer32()).setLabel('vdslNetworkProfile-LineConfig-NailedGroup').setMaxAccess('readwrite') if mibBuilder.loadTexts: vdslNetworkProfile_LineConfig_NailedGroup.setStatus('mandatory') if mibBuilder.loadTexts: vdslNetworkProfile_LineConfig_NailedGroup.setDescription('A number that identifies the this unique physical DSL line.') vdsl_network_profile__line_config__vp_switching_vpi = mib_scalar((1, 3, 6, 1, 4, 1, 529, 23, 9, 1, 1, 20), integer32()).setLabel('vdslNetworkProfile-LineConfig-VpSwitchingVpi').setMaxAccess('readwrite') if mibBuilder.loadTexts: vdslNetworkProfile_LineConfig_VpSwitchingVpi.setStatus('mandatory') if mibBuilder.loadTexts: vdslNetworkProfile_LineConfig_VpSwitchingVpi.setDescription('The Vpi to be used for the VP switching. Rest of the VPIs within valid vpi-vci-range will be used for the VC switching. Changes in this range will take effect immediately. THE USER SHOULD BE VERY CAREFUL WHILE CHANGING THIS VALUE BECAUSE ALL CONNECTIONS ON THE LIM WHERE THIS PORT BELONGS WILL BE DROPPED IN ORDER TO MAKE THIS NEW VALUE EFFECTIVE IMMEDIATELY.') vdsl_network_profile__line_config__up_stream_fixed_rate = mib_scalar((1, 3, 6, 1, 4, 1, 529, 23, 9, 1, 1, 22), integer32().subtype(subtypeSpec=constraints_union(single_value_constraint(1, 2, 3, 4))).clone(namedValues=named_values(('n-1206667', 1), ('n-965333', 2), ('n-1930667', 3), ('n-3861333', 4)))).setLabel('vdslNetworkProfile-LineConfig-UpStreamFixedRate').setMaxAccess('readwrite') if mibBuilder.loadTexts: vdslNetworkProfile_LineConfig_UpStreamFixedRate.setStatus('mandatory') if mibBuilder.loadTexts: vdslNetworkProfile_LineConfig_UpStreamFixedRate.setDescription('The following Up/Down stream rate relationships are supported: (0.965Mbps/19.306Mbps); (1.930Mbps/11.463Mbps); (3.861Mbps/11.463Mbps); (3.861Mbps/15.626Mbps). Up Stream range: 0.965Mbps - 3.861Mbps.') vdsl_network_profile__line_config__down_stream_fixed_rate = mib_scalar((1, 3, 6, 1, 4, 1, 529, 23, 9, 1, 1, 23), integer32().subtype(subtypeSpec=constraints_union(single_value_constraint(1, 2, 3, 4))).clone(namedValues=named_values(('n-1206667', 1), ('n-11463333', 2), ('n-15626333', 3), ('n-19306667', 4)))).setLabel('vdslNetworkProfile-LineConfig-DownStreamFixedRate').setMaxAccess('readwrite') if mibBuilder.loadTexts: vdslNetworkProfile_LineConfig_DownStreamFixedRate.setStatus('mandatory') if mibBuilder.loadTexts: vdslNetworkProfile_LineConfig_DownStreamFixedRate.setDescription('The following Up/Down stream rate relationships are supported: (0.965Mbps/19.306Mbps); (1.930Mbps/11.463Mbps); (3.861Mbps/11.463Mbps); (3.861Mbps/15.626Mbps). Down Stream range: 11.463Mbps - 15.626Mbps.') vdsl_network_profile__line_config__config_loopback = mib_scalar((1, 3, 6, 1, 4, 1, 529, 23, 9, 1, 1, 24), integer32().subtype(subtypeSpec=constraints_union(single_value_constraint(1, 2, 3))).clone(namedValues=named_values(('disable', 1), ('digital', 2), ('analog', 3)))).setLabel('vdslNetworkProfile-LineConfig-ConfigLoopback').setMaxAccess('readwrite') if mibBuilder.loadTexts: vdslNetworkProfile_LineConfig_ConfigLoopback.setStatus('mandatory') if mibBuilder.loadTexts: vdslNetworkProfile_LineConfig_ConfigLoopback.setDescription('Configuration of different modem loopbacks.') vdsl_network_profile__line_config__psd_value = mib_scalar((1, 3, 6, 1, 4, 1, 529, 23, 9, 1, 1, 25), integer32().subtype(subtypeSpec=constraints_union(single_value_constraint(1, 2))).clone(namedValues=named_values(('n-53dbm', 1), ('n-60dbm', 2)))).setLabel('vdslNetworkProfile-LineConfig-PsdValue').setMaxAccess('readwrite') if mibBuilder.loadTexts: vdslNetworkProfile_LineConfig_PsdValue.setStatus('mandatory') if mibBuilder.loadTexts: vdslNetworkProfile_LineConfig_PsdValue.setDescription('Configuration of PSD parameter. It defines the power that is allowed to be sent to the line.') vdsl_network_profile__line_config__link_statecmd = mib_scalar((1, 3, 6, 1, 4, 1, 529, 23, 9, 1, 1, 26), integer32().subtype(subtypeSpec=constraints_union(single_value_constraint(16, 1, 2, 3, 4, 5, 6, 7, 8))).clone(namedValues=named_values(('autoConnectCmd', 16), ('disconnectState', 1), ('connectState', 2), ('quietState', 3), ('idleReqState', 4), ('backToServState', 5), ('changeIdleParamState', 6), ('changeWarmStartParamState', 7), ('changeCurrentParamState', 8)))).setLabel('vdslNetworkProfile-LineConfig-LinkStatecmd').setMaxAccess('readwrite') if mibBuilder.loadTexts: vdslNetworkProfile_LineConfig_LinkStatecmd.setStatus('mandatory') if mibBuilder.loadTexts: vdslNetworkProfile_LineConfig_LinkStatecmd.setDescription('Sets the link connect state. Use this to control status of the VDSL link connect state machine. The auto-connect-cmd will train modem up to the final service. All the other commands are used to manualy operate the VDSL link connect state machine.') vdsl_network_profile__action_o = mib_scalar((1, 3, 6, 1, 4, 1, 529, 23, 9, 1, 1, 14), integer32().subtype(subtypeSpec=constraints_union(single_value_constraint(1, 2, 3))).clone(namedValues=named_values(('noAction', 1), ('createProfile', 2), ('deleteProfile', 3)))).setLabel('vdslNetworkProfile-Action-o').setMaxAccess('readwrite') if mibBuilder.loadTexts: vdslNetworkProfile_Action_o.setStatus('mandatory') if mibBuilder.loadTexts: vdslNetworkProfile_Action_o.setDescription('') mibBuilder.exportSymbols('ASCEND-MIBVDSLNET-MIB', vdslNetworkProfile_Slot_o=vdslNetworkProfile_Slot_o, vdslNetworkProfile_Name=vdslNetworkProfile_Name, vdslNetworkProfile_LineConfig_LinkStatecmd=vdslNetworkProfile_LineConfig_LinkStatecmd, vdslNetworkProfile_LineConfig_VpSwitchingVpi=vdslNetworkProfile_LineConfig_VpSwitchingVpi, vdslNetworkProfile_PhysicalAddress_Slot=vdslNetworkProfile_PhysicalAddress_Slot, vdslNetworkProfile_PhysicalAddress_Shelf=vdslNetworkProfile_PhysicalAddress_Shelf, mibvdslNetworkProfileTable=mibvdslNetworkProfileTable, vdslNetworkProfile_IgnoreLineup=vdslNetworkProfile_IgnoreLineup, vdslNetworkProfile_SparingMode=vdslNetworkProfile_SparingMode, vdslNetworkProfile_PhysicalAddress_ItemNumber=vdslNetworkProfile_PhysicalAddress_ItemNumber, vdslNetworkProfile_LineConfig_PsdValue=vdslNetworkProfile_LineConfig_PsdValue, vdslNetworkProfile_LineConfig_DownStreamFixedRate=vdslNetworkProfile_LineConfig_DownStreamFixedRate, vdslNetworkProfile_Enabled=vdslNetworkProfile_Enabled, vdslNetworkProfile_LineConfig_NailedGroup=vdslNetworkProfile_LineConfig_NailedGroup, DisplayString=DisplayString, vdslNetworkProfile_Action_o=vdslNetworkProfile_Action_o, vdslNetworkProfile_Shelf_o=vdslNetworkProfile_Shelf_o, mibvdslNetworkProfile=mibvdslNetworkProfile, mibvdslNetworkProfileEntry=mibvdslNetworkProfileEntry, vdslNetworkProfile_Item_o=vdslNetworkProfile_Item_o, vdslNetworkProfile_LineConfig_UpStreamFixedRate=vdslNetworkProfile_LineConfig_UpStreamFixedRate, vdslNetworkProfile_LineConfig_ConfigLoopback=vdslNetworkProfile_LineConfig_ConfigLoopback)
def __init__(self): self.meetings = [] def book(self, start: int, end: int) -> bool: for s, e in self.meetings: if s < end and start < e: return False self.meetings.append([start, end]) return True
def __init__(self): self.meetings = [] def book(self, start: int, end: int) -> bool: for (s, e) in self.meetings: if s < end and start < e: return False self.meetings.append([start, end]) return True
# Given two sorted integer arrays nums1 and nums2, merge nums2 into nums1 as one sorted array. # # The number of elements initialized in nums1 and nums2 are m and n respectively. # You may assume that nums1 has enough space (size that is equal to m + n) to hold additional elements from nums2. # Source - https://leetcode.com/problems/merge-sorted-array/ # 2 pointers approach class Solution: def merge(self, nums1, m: int, nums2, n: int): i = m - 1 j = n - 1 k = m + n - 1 while i >= 0 and j >= 0: if nums1[i] > nums2[j]: nums1[k] = nums1[i] i -= 1 else: nums1[k] = nums2[j] j -= 1 k -= 1 if j >= 0: nums1[:k + 1] = nums2[:j + 1] print(nums1) # # Time complexity : O(m+n)log(m+n) # Space complexity : O(1) nums1 = [1,2,3,0,0,0] m = 3 nums2 = [2,5,6] n = 3 s = Solution().merge(nums1, m, nums2, n)
class Solution: def merge(self, nums1, m: int, nums2, n: int): i = m - 1 j = n - 1 k = m + n - 1 while i >= 0 and j >= 0: if nums1[i] > nums2[j]: nums1[k] = nums1[i] i -= 1 else: nums1[k] = nums2[j] j -= 1 k -= 1 if j >= 0: nums1[:k + 1] = nums2[:j + 1] print(nums1) nums1 = [1, 2, 3, 0, 0, 0] m = 3 nums2 = [2, 5, 6] n = 3 s = solution().merge(nums1, m, nums2, n)
# Example of mutual recursion with even/odd. # # Eli Bendersky [http://eli.thegreenplace.net] # This code is in the public domain. def is_even(n): if n == 0: return True else: return is_odd(n - 1) def is_odd(n): if n == 0: return False else: return is_even(n - 1) def is_even_thunked(n): if n == 0: return True else: return lambda: is_odd_thunked(n - 1) def is_odd_thunked(n): if n == 0: return False else: return lambda: is_even_thunked(n - 1) def trampoline(f, *args): v = f(*args) while callable(v): v = v() return v if __name__ == '__main__': print(is_even(800)) # If I try to run is_even(1000) with the default system recursion limit, it # blows up. But trampolining keeps the stack depth constant and small. print(trampoline(is_even_thunked, 1000))
def is_even(n): if n == 0: return True else: return is_odd(n - 1) def is_odd(n): if n == 0: return False else: return is_even(n - 1) def is_even_thunked(n): if n == 0: return True else: return lambda : is_odd_thunked(n - 1) def is_odd_thunked(n): if n == 0: return False else: return lambda : is_even_thunked(n - 1) def trampoline(f, *args): v = f(*args) while callable(v): v = v() return v if __name__ == '__main__': print(is_even(800)) print(trampoline(is_even_thunked, 1000))
X = {} print(5 in X) print(X[4]) print(X[5])
x = {} print(5 in X) print(X[4]) print(X[5])
# -*- coding: utf-8 -*- # Author: Tonio Teran <tonio@stateoftheart.ai> # Copyright: Stateoftheart AI PBC 2021. '''NEAR AI's library wrapper. Dataset information taken from: ''' SOURCE_METADATA = { 'name': 'nearai', 'original_name': 'NEAR Program Synthesis', 'url': 'https://github.com/nearai/program_synthesis' } DATASETS = {'Program Synthesis': ['AlgoLisp', 'Karel', 'NAPS']} def load_dataset(name: str) -> dict: return {'name': name, 'source': 'nearai'}
"""NEAR AI's library wrapper. Dataset information taken from: """ source_metadata = {'name': 'nearai', 'original_name': 'NEAR Program Synthesis', 'url': 'https://github.com/nearai/program_synthesis'} datasets = {'Program Synthesis': ['AlgoLisp', 'Karel', 'NAPS']} def load_dataset(name: str) -> dict: return {'name': name, 'source': 'nearai'}
#!/usr/bin/python inp = input(">> ") print(inp) count = 0 while True: print("hi") count += 1 if count == 3: break
inp = input('>> ') print(inp) count = 0 while True: print('hi') count += 1 if count == 3: break
#VERSION: 1.0 INFO = {"example":("test","This is an example mod")} RLTS = {"cls":(),"funcs":("echo"),"vars":()} def test(cmd): echo(0,cmd)
info = {'example': ('test', 'This is an example mod')} rlts = {'cls': (), 'funcs': 'echo', 'vars': ()} def test(cmd): echo(0, cmd)
#so sai quando escrever sair nome = str(input("Escreva nome :(sair para terminar)")) while nome != "sair": nome = str(input("Escreva nome: (sair para terminar)"))
nome = str(input('Escreva nome :(sair para terminar)')) while nome != 'sair': nome = str(input('Escreva nome: (sair para terminar)'))
def heap_sort(l: list): # flag is init def sort(num: int, node: int, flag: bool): # print(str(node) +' '+str(num)) if num == len(l) - 1: return if node < 0: l[0], l[-(num) - 1] = l[-(num) - 1], l[0] #swap topest num += 1 node = 0 if node * 2 + 1 < len(l) - num: if l[node] < l[node * 2 + 1]: l[node], l[node * 2 + 1] = l[node * 2 + 1], l[node] sort(num, node * 2 + 1, False) if node * 2 + 2 < len(l) - num: if l[node] < l[node * 2 + 2]: l[node], l[node * 2 + 2] = l[node * 2 + 2], l[node] sort(num, node * 2 + 2, False) if flag: sort(num, node - 1, True) sort(0, int(len(l) / 2) - 1, True) #last non-leaf if __name__ == "__main__": l = [6, 1, 17, 4, 20, 15, 33, 10, 194, 54, 99, 1004, 5, 477] heap_sort(l) print(l)
def heap_sort(l: list): def sort(num: int, node: int, flag: bool): if num == len(l) - 1: return if node < 0: (l[0], l[-num - 1]) = (l[-num - 1], l[0]) num += 1 node = 0 if node * 2 + 1 < len(l) - num: if l[node] < l[node * 2 + 1]: (l[node], l[node * 2 + 1]) = (l[node * 2 + 1], l[node]) sort(num, node * 2 + 1, False) if node * 2 + 2 < len(l) - num: if l[node] < l[node * 2 + 2]: (l[node], l[node * 2 + 2]) = (l[node * 2 + 2], l[node]) sort(num, node * 2 + 2, False) if flag: sort(num, node - 1, True) sort(0, int(len(l) / 2) - 1, True) if __name__ == '__main__': l = [6, 1, 17, 4, 20, 15, 33, 10, 194, 54, 99, 1004, 5, 477] heap_sort(l) print(l)
# directories where to look for duplicates dir_list = [ r"C:\Users\Gamer\Documents\Projekte\azzap\azzap-docker-dev\data\html\pub\media\catalog\product", r"C:\Users\Gamer\Documents\Projekte\azzap\azzap-docker-dev\data\html\pub\media\import\multishopifystoremageconnect", r"C:\Users\Gamer\Documents\Projekte\azzap\azzap-docker-dev\data\html\pub\media\import\mpmultishopifystoremageconnect", ]
dir_list = ['C:\\Users\\Gamer\\Documents\\Projekte\\azzap\\azzap-docker-dev\\data\\html\\pub\\media\\catalog\\product', 'C:\\Users\\Gamer\\Documents\\Projekte\\azzap\\azzap-docker-dev\\data\\html\\pub\\media\\import\\multishopifystoremageconnect', 'C:\\Users\\Gamer\\Documents\\Projekte\\azzap\\azzap-docker-dev\\data\\html\\pub\\media\\import\\mpmultishopifystoremageconnect']
print("NFC West W L T") print("-----------------------") print("Seattle 13 3 0") print("San Francisco 12 4 0") print("Arizona 10 6 0") print("St. Louis 7 9 0\n") print("NFC North W L T") print("-----------------------") print("Green Bay 8 7 1") print("Chicago 8 8 0") print("Detroit 7 9 0") print("Minnesota 5 10 1")
print('NFC West W L T') print('-----------------------') print('Seattle 13 3 0') print('San Francisco 12 4 0') print('Arizona 10 6 0') print('St. Louis 7 9 0\n') print('NFC North W L T') print('-----------------------') print('Green Bay 8 7 1') print('Chicago 8 8 0') print('Detroit 7 9 0') print('Minnesota 5 10 1')
pallet_color = [ (231, 234, 238), # 010 White (252, 166, 0), # 020Golden yellow (232, 167, 0), # 019 Signal yellow (254, 198, 0), # 021 Yellow (242, 203, 0), # 022 Light yellow (241, 225, 14), # 025 Brimstone yellow (116, 2, 16), # 312 Burgundy (145, 8, 20), # 030 Dark red (175, 0, 11), # 031 Red (199, 12, 0), # 032 Light red (211, 48, 0), # 047 Orange red (221, 68, 0), # 034 Orange (236, 102, 0), # 036 Light orange (255, 109, 0), # 035 Pastel orange (65, 40, 114), # 404 Purple (93, 43, 104), # 040 Violet (120, 95, 162), # 043 Lavender (186, 148, 188), # 042 Lilac (195, 40, 106), # 041 Pink (239, 135, 184), # 045 Soft pink (19, 29, 57), # 562 Deep sea blue (15, 17, 58), # 518 Steel blue (28, 47, 94), # 050 Dark blue (13, 31, 106), # 065 Cobalt blue (23, 43, 121), # 049 King blue (27, 47, 170), # 086 Brilliant blue (0, 58, 120), # 057 Blue (0, 65, 142), # 057 Traffic blue (0, 69, 131), # 051 Gentian blue (0, 79, 159), # 098 Gentian (0, 94, 173), # 052 Azure blue (0, 116, 187), # 084 Sky blue (0, 136, 195), # 053 Light blue (67, 162, 211), # 056 Ice blue (0, 131, 142), # 066 Turquoise blue (0, 155, 151), # 054 Turquoise (95, 206, 183), # 055 Mint (0, 60, 36), # 060 Dark green (0, 82, 54), # 613 Forest green (0, 122, 77), # 061 Green (0, 120, 63), # 068 Grass green (0, 137, 58), # 062 Light green (35, 155, 17), # 064 Yellow green (106, 167, 47), # 063 Lime-tree green (85, 51, 28), # 080 Brown (175, 89, 30), # 083 Nut brown (168, 135, 90), # 081 Light brown (205, 192, 158), # 082 Beige (231, 210, 147), # 023 Cream (6, 6, 7), # 070 Black (75, 76, 76), # 073 Dark grey (117, 125, 124), # 071 Grey (128, 133, 136), # 076 Telegrey (138, 143, 140), # 074 Middle grey (192, 195, 195), # 072 Light grey (111, 114, 116), # 090 Silver grey (121, 101, 50), # 091 Gold (105, 64, 30), # 092 Copper ] pallet_color_name = [ "010 White", "020Golden yellow", "019 Signal yellow", "021 Yellow", "022 Light yellow", "025 Brimstone yellow", "312 Burgundy", "030 Dark red", "031 Red", "032 Light red", "047 Orange red", "034 Orange", "036 Light orange", "035 Pastel orange", "404 Purple", "040 Violet", "043 Lavender", "042 Lilac", "041 Pink", "045 Soft pink", "562 Deep sea blue", "518 Steel blue", "050 Dark blue", "065 Cobalt blue", "049 King blue", "086 Brilliant blue", "057 Blue", "057 Traffic blue", "051 Gentian blue", "098 Gentian", "052 Azure blue", "084 Sky blue", "053 Light blue", "056 Ice blue", "066 Turquoise blue", "054 Turquoise", "055 Mint", "060 Dark green", "613 Forest green", "061 Green", "068 Grass green", "062 Light green", "064 Yellow green", "063 Lime-tree green", "080 Brown", "083 Nut brown", "081 Light brown", "082 Beige", "023 Cream", "070 Black", "073 Dark grey", "071 Grey", "076 Telegrey", "074 Middle grey", "072 Light grey", "090 Silver grey", "091 Gold", "092 Copper", ]
pallet_color = [(231, 234, 238), (252, 166, 0), (232, 167, 0), (254, 198, 0), (242, 203, 0), (241, 225, 14), (116, 2, 16), (145, 8, 20), (175, 0, 11), (199, 12, 0), (211, 48, 0), (221, 68, 0), (236, 102, 0), (255, 109, 0), (65, 40, 114), (93, 43, 104), (120, 95, 162), (186, 148, 188), (195, 40, 106), (239, 135, 184), (19, 29, 57), (15, 17, 58), (28, 47, 94), (13, 31, 106), (23, 43, 121), (27, 47, 170), (0, 58, 120), (0, 65, 142), (0, 69, 131), (0, 79, 159), (0, 94, 173), (0, 116, 187), (0, 136, 195), (67, 162, 211), (0, 131, 142), (0, 155, 151), (95, 206, 183), (0, 60, 36), (0, 82, 54), (0, 122, 77), (0, 120, 63), (0, 137, 58), (35, 155, 17), (106, 167, 47), (85, 51, 28), (175, 89, 30), (168, 135, 90), (205, 192, 158), (231, 210, 147), (6, 6, 7), (75, 76, 76), (117, 125, 124), (128, 133, 136), (138, 143, 140), (192, 195, 195), (111, 114, 116), (121, 101, 50), (105, 64, 30)] pallet_color_name = ['010 White', '020Golden yellow', '019 Signal yellow', '021 Yellow', '022 Light yellow', '025 Brimstone yellow', '312 Burgundy', '030 Dark red', '031 Red', '032 Light red', '047 Orange red', '034 Orange', '036 Light orange', '035 Pastel orange', '404 Purple', '040 Violet', '043 Lavender', '042 Lilac', '041 Pink', '045 Soft pink', '562 Deep sea blue', '518 Steel blue', '050 Dark blue', '065 Cobalt blue', '049 King blue', '086 Brilliant blue', '057 Blue', '057 Traffic blue', '051 Gentian blue', '098 Gentian', '052 Azure blue', '084 Sky blue', '053 Light blue', '056 Ice blue', '066 Turquoise blue', '054 Turquoise', '055 Mint', '060 Dark green', '613 Forest green', '061 Green', '068 Grass green', '062 Light green', '064 Yellow green', '063 Lime-tree green', '080 Brown', '083 Nut brown', '081 Light brown', '082 Beige', '023 Cream', '070 Black', '073 Dark grey', '071 Grey', '076 Telegrey', '074 Middle grey', '072 Light grey', '090 Silver grey', '091 Gold', '092 Copper']
# All metrics are treated as gauge as the counter instrument don't provide a set # method and for performance, it's always good to avoid calculation when ever it's possible. # Using the inc() method require the diff to be calculated! metrics = [ ## Custom metrics ("up", "the status of the node (1=running, 0=down, -1=connection issue, -2=node error)"), ("peers_count", "how many peers the node is seeing"), ("sigs_count", "how many nodes are currently validating"), ("header_nextValidators_count", "how many nodes are in the validators set for the next epoch"), ("header_nextValidators_is_included", "if the node is included in the next validators set"), ("header_nextValidators_stake_min", "the smallest amount of total stake in the validators set for the next epoch"), ("header_nextValidators_stake_max", "the biggest amount of total stake in the validators set for the next epoch"), ## /node/validator # ("validator_address", "validator_address"), ("validator_stakes_count", "the number of delegators currently staking on the node"), # ("validator_name", "validator_name"), ("validator_registered", "if the node is registered as validaator node"), ("validator_totalStake", "the total amount staked on the node"), # ("validator_url", "validator_url"), ## /system/peers #peers ## /system/epochproof # ("opaque", "opaque"), # ("sigs", "sigs"), # ("header_view", "header_view"), # ("header_nextValidators", "header_nextValidators"), # ("header_epoch", "header_epoch"), # ("header_accumulator", "header_accumulator"), # ("header_version", "header_version"), # ("header_timestamp", "header_timestamp"), ## /system/info # ("transports_0_metadata_port", "transports_0_metadata_port"), # ("transports_0_metadata_host", "transports_0_metadata_host"), # ("transports_0_sz", "transports_0_sz"), # ("transports_0_name", "transports_0_name"), # ("agent_protocol", "agent_protocol"), # ("agent_name", "agent_name"), # ("agent_version", "agent_version"), # ("hid", "hid"), # ("sz", "sz"), # ("nid", "nid"), # ("key", "key"), # ("info_counters_ledger_state_version", "info_counters_ledger_state_version"), ("info_counters_ledger_bft_commands_processed", "info_counters_ledger_bft_commands_processed"), ("info_counters_ledger_sync_commands_processed", "info_counters_ledger_sync_commands_processed"), ("info_counters_pacemaker_view", "info_counters_pacemaker_view"), ("info_counters_mempool_maxcount", "info_counters_mempool_maxcount"), ("info_counters_mempool_relayer_sent_count", "info_counters_mempool_relayer_sent_count"), ("info_counters_mempool_count", "info_counters_mempool_count"), ("info_counters_mempool_add_success", "info_counters_mempool_add_success"), ("info_counters_mempool_errors_other", "info_counters_mempool_errors_other"), ("info_counters_mempool_errors_hook", "info_counters_mempool_errors_hook"), ("info_counters_mempool_errors_conflict", "info_counters_mempool_errors_conflict"), ("info_counters_mempool_proposed_transaction", "info_counters_mempool_proposed_transaction"), ("info_counters_radix_engine_invalid_proposed_commands", "info_counters_radix_engine_invalid_proposed_commands"), ("info_counters_radix_engine_system_transactions", "info_counters_radix_engine_system_transactions"), ("info_counters_radix_engine_user_transactions", "info_counters_radix_engine_user_transactions"), ("info_counters_count_bdb_ledger_contains_tx", "info_counters_count_bdb_ledger_contains_tx"), ("info_counters_count_bdb_ledger_deletes", "info_counters_count_bdb_ledger_deletes"), ("info_counters_count_bdb_ledger_commit", "info_counters_count_bdb_ledger_commit"), ("info_counters_count_bdb_ledger_save", "info_counters_count_bdb_ledger_save"), ("info_counters_count_bdb_ledger_last_vertex", "info_counters_count_bdb_ledger_last_vertex"), ("info_counters_count_bdb_ledger_store", "info_counters_count_bdb_ledger_store"), ("info_counters_count_bdb_ledger_create_tx", "info_counters_count_bdb_ledger_create_tx"), ("info_counters_count_bdb_ledger_contains", "info_counters_count_bdb_ledger_contains"), ("info_counters_count_bdb_ledger_entries", "info_counters_count_bdb_ledger_entries"), ("info_counters_count_bdb_ledger_get_last", "info_counters_count_bdb_ledger_get_last"), ("info_counters_count_bdb_ledger_get_next", "info_counters_count_bdb_ledger_get_next"), ("info_counters_count_bdb_ledger_search", "info_counters_count_bdb_ledger_search"), ("info_counters_count_bdb_ledger_total", "info_counters_count_bdb_ledger_total"), ("info_counters_count_bdb_ledger_get_prev", "info_counters_count_bdb_ledger_get_prev"), ("info_counters_count_bdb_ledger_bytes_read", "info_counters_count_bdb_ledger_bytes_read"), ("info_counters_count_bdb_ledger_bytes_write", "info_counters_count_bdb_ledger_bytes_write"), ("info_counters_count_bdb_ledger_proofs_removed", "info_counters_count_bdb_ledger_proofs_removed"), ("info_counters_count_bdb_ledger_proofs_added", "info_counters_count_bdb_ledger_proofs_added"), ("info_counters_count_bdb_ledger_get", "info_counters_count_bdb_ledger_get"), ("info_counters_count_bdb_ledger_last_committed", "info_counters_count_bdb_ledger_last_committed"), ("info_counters_count_bdb_ledger_get_first", "info_counters_count_bdb_ledger_get_first"), ("info_counters_count_bdb_header_bytes_write", "info_counters_count_bdb_header_bytes_write"), ("info_counters_count_bdb_address_book_deletes", "info_counters_count_bdb_address_book_deletes"), ("info_counters_count_bdb_address_book_total", "info_counters_count_bdb_address_book_total"), ("info_counters_count_bdb_address_book_bytes_read", "info_counters_count_bdb_address_book_bytes_read"), ("info_counters_count_bdb_address_book_bytes_write", "info_counters_count_bdb_address_book_bytes_write"), ("info_counters_count_bdb_safety_state_total", "info_counters_count_bdb_safety_state_total"), ("info_counters_count_bdb_safety_state_bytes_read", "info_counters_count_bdb_safety_state_bytes_read"), ("info_counters_count_bdb_safety_state_bytes_write", "info_counters_count_bdb_safety_state_bytes_write"), ("info_counters_count_apidb_balance_total", "info_counters_count_apidb_balance_total"), ("info_counters_count_apidb_balance_read", "info_counters_count_apidb_balance_read"), ("info_counters_count_apidb_balance_bytes_read", "info_counters_count_apidb_balance_bytes_read"), ("info_counters_count_apidb_balance_bytes_write", "info_counters_count_apidb_balance_bytes_write"), ("info_counters_count_apidb_balance_write", "info_counters_count_apidb_balance_write"), ("info_counters_count_apidb_flush_count", "info_counters_count_apidb_flush_count"), ("info_counters_count_apidb_queue_size", "info_counters_count_apidb_queue_size"), ("info_counters_count_apidb_transaction_total", "info_counters_count_apidb_transaction_total"), ("info_counters_count_apidb_transaction_read", "info_counters_count_apidb_transaction_read"), ("info_counters_count_apidb_transaction_bytes_read", "info_counters_count_apidb_transaction_bytes_read"), ("info_counters_count_apidb_transaction_bytes_write", "info_counters_count_apidb_transaction_bytes_write"), ("info_counters_count_apidb_transaction_write", "info_counters_count_apidb_transaction_write"), ("info_counters_count_apidb_token_total", "info_counters_count_apidb_token_total"), ("info_counters_count_apidb_token_read", "info_counters_count_apidb_token_read"), ("info_counters_count_apidb_token_bytes_read", "info_counters_count_apidb_token_bytes_read"), ("info_counters_count_apidb_token_bytes_write", "info_counters_count_apidb_token_bytes_write"), ("info_counters_count_apidb_token_write", "info_counters_count_apidb_token_write"), ("info_counters_epoch_manager_queued_consensus_events", "info_counters_epoch_manager_queued_consensus_events"), ("info_counters_hashed_bytes", "info_counters_hashed_bytes"), ("info_counters_networking_received_bytes", "info_counters_networking_received_bytes"), ("info_counters_networking_tcp_out_opened", "info_counters_networking_tcp_out_opened"), ("info_counters_networking_tcp_dropped_messages", "info_counters_networking_tcp_dropped_messages"), ("info_counters_networking_tcp_in_opened", "info_counters_networking_tcp_in_opened"), ("info_counters_networking_tcp_closed", "info_counters_networking_tcp_closed"), ("info_counters_networking_udp_dropped_messages", "info_counters_networking_udp_dropped_messages"), ("info_counters_networking_sent_bytes", "info_counters_networking_sent_bytes"), ("info_counters_sync_processed", "info_counters_sync_processed"), ("info_counters_sync_target_state_version", "info_counters_sync_target_state_version"), ("info_counters_sync_remote_requests_processed", "info_counters_sync_remote_requests_processed"), ("info_counters_sync_invalid_commands_received", "info_counters_sync_invalid_commands_received"), ("info_counters_sync_last_read_millis", "info_counters_sync_last_read_millis"), ("info_counters_sync_target_current_diff", "info_counters_sync_target_current_diff"), ("info_counters_signatures_verified", "info_counters_signatures_verified"), ("info_counters_signatures_signed", "info_counters_signatures_signed"), ("info_counters_elapsed_bdb_ledger_contains_tx", "info_counters_elapsed_bdb_ledger_contains_tx"), ("info_counters_elapsed_bdb_ledger_commit", "info_counters_elapsed_bdb_ledger_commit"), ("info_counters_elapsed_bdb_ledger_save", "info_counters_elapsed_bdb_ledger_save"), ("info_counters_elapsed_bdb_ledger_last_vertex", "info_counters_elapsed_bdb_ledger_last_vertex"), ("info_counters_elapsed_bdb_ledger_store", "info_counters_elapsed_bdb_ledger_store"), ("info_counters_elapsed_bdb_ledger_create_tx", "info_counters_elapsed_bdb_ledger_create_tx"), ("info_counters_elapsed_bdb_ledger_contains", "info_counters_elapsed_bdb_ledger_contains"), ("info_counters_elapsed_bdb_ledger_entries", "info_counters_elapsed_bdb_ledger_entries"), ("info_counters_elapsed_bdb_ledger_get_last", "info_counters_elapsed_bdb_ledger_get_last"), ("info_counters_elapsed_bdb_ledger_search", "info_counters_elapsed_bdb_ledger_search"), ("info_counters_elapsed_bdb_ledger_total", "info_counters_elapsed_bdb_ledger_total"), ("info_counters_elapsed_bdb_ledger_get", "info_counters_elapsed_bdb_ledger_get"), ("info_counters_elapsed_bdb_ledger_last_committed", "info_counters_elapsed_bdb_ledger_last_committed"), ("info_counters_elapsed_bdb_ledger_get_first", "info_counters_elapsed_bdb_ledger_get_first"), ("info_counters_elapsed_bdb_address_book", "info_counters_elapsed_bdb_address_book"), ("info_counters_elapsed_bdb_safety_state", "info_counters_elapsed_bdb_safety_state"), ("info_counters_elapsed_apidb_balance_read", "info_counters_elapsed_apidb_balance_read"), ("info_counters_elapsed_apidb_balance_write", "info_counters_elapsed_apidb_balance_write"), ("info_counters_elapsed_apidb_flush_time", "info_counters_elapsed_apidb_flush_time"), ("info_counters_elapsed_apidb_transaction_read", "info_counters_elapsed_apidb_transaction_read"), ("info_counters_elapsed_apidb_transaction_write", "info_counters_elapsed_apidb_transaction_write"), ("info_counters_elapsed_apidb_token_read", "info_counters_elapsed_apidb_token_read"), ("info_counters_elapsed_apidb_token_write", "info_counters_elapsed_apidb_token_write"), ("info_counters_bft_state_version", "info_counters_bft_state_version"), ("info_counters_bft_vote_quorums", "info_counters_bft_vote_quorums"), ("info_counters_bft_rejected", "info_counters_bft_rejected"), ("info_counters_bft_vertex_store_rebuilds", "info_counters_bft_vertex_store_rebuilds"), ("info_counters_bft_vertex_store_forks", "info_counters_bft_vertex_store_forks"), ("info_counters_bft_sync_request_timeouts", "info_counters_bft_sync_request_timeouts"), ("info_counters_bft_sync_requests_sent", "info_counters_bft_sync_requests_sent"), ("info_counters_bft_timeout", "info_counters_bft_timeout"), ("info_counters_bft_vertex_store_size", "info_counters_bft_vertex_store_size"), ("info_counters_bft_processed", "info_counters_bft_processed"), ("info_counters_bft_consensus_events", "info_counters_bft_consensus_events"), ("info_counters_bft_indirect_parent", "info_counters_bft_indirect_parent"), ("info_counters_bft_proposals_made", "info_counters_bft_proposals_made"), ("info_counters_bft_timed_out_views", "info_counters_bft_timed_out_views"), ("info_counters_bft_timeout_quorums", "info_counters_bft_timeout_quorums"), ("info_counters_startup_time_ms", "info_counters_startup_time_ms"), ("info_counters_messages_inbound_processed", "info_counters_messages_inbound_processed"), ("info_counters_messages_inbound_discarded", "info_counters_messages_inbound_discarded"), ("info_counters_messages_inbound_badsignature", "info_counters_messages_inbound_badsignature"), ("info_counters_messages_inbound_received", "info_counters_messages_inbound_received"), ("info_counters_messages_outbound_processed", "info_counters_messages_outbound_processed"), ("info_counters_messages_outbound_aborted", "info_counters_messages_outbound_aborted"), ("info_counters_messages_outbound_pending", "info_counters_messages_outbound_pending"), ("info_counters_messages_outbound_sent", "info_counters_messages_outbound_sent"), ("info_counters_persistence_safety_store_saves", "info_counters_persistence_safety_store_saves"), ("info_counters_persistence_vertex_store_saves", "info_counters_persistence_vertex_store_saves"), ("info_counters_persistence_atom_log_write_bytes", "info_counters_persistence_atom_log_write_bytes"), ("info_counters_persistence_atom_log_write_compressed", "info_counters_persistence_atom_log_write_compressed"), ("info_counters_time_duration", "info_counters_time_duration"), # ("info_counters_time_since", "info_counters_time_since"), ("info_configuration_pacemakerRate", "info_configuration_pacemakerRate"), ("info_configuration_pacemakerTimeout", "info_configuration_pacemakerTimeout"), ("info_configuration_pacemakerMaxExponent", "info_configuration_pacemakerMaxExponent"), ("info_system_version_system_version_agent_version", "info_system_version_system_version_agent_version"), ("info_system_version_system_version_protocol_version", "info_system_version_system_version_protocol_version"), # ("info_system_version_system_version_display", "info_system_version_system_version_display"), # ("info_system_version_system_version_commit", "info_system_version_system_version_commit"), # ("info_system_version_system_version_branch", "info_system_version_system_version_branch"), ("info_epochManager_currentView_view", "info_epochManager_currentView_view"), ("info_epochManager_currentView_epoch", "info_epochManager_currentView_epoch"), ]
metrics = [('up', 'the status of the node (1=running, 0=down, -1=connection issue, -2=node error)'), ('peers_count', 'how many peers the node is seeing'), ('sigs_count', 'how many nodes are currently validating'), ('header_nextValidators_count', 'how many nodes are in the validators set for the next epoch'), ('header_nextValidators_is_included', 'if the node is included in the next validators set'), ('header_nextValidators_stake_min', 'the smallest amount of total stake in the validators set for the next epoch'), ('header_nextValidators_stake_max', 'the biggest amount of total stake in the validators set for the next epoch'), ('validator_stakes_count', 'the number of delegators currently staking on the node'), ('validator_registered', 'if the node is registered as validaator node'), ('validator_totalStake', 'the total amount staked on the node'), ('info_counters_ledger_bft_commands_processed', 'info_counters_ledger_bft_commands_processed'), ('info_counters_ledger_sync_commands_processed', 'info_counters_ledger_sync_commands_processed'), ('info_counters_pacemaker_view', 'info_counters_pacemaker_view'), ('info_counters_mempool_maxcount', 'info_counters_mempool_maxcount'), ('info_counters_mempool_relayer_sent_count', 'info_counters_mempool_relayer_sent_count'), ('info_counters_mempool_count', 'info_counters_mempool_count'), ('info_counters_mempool_add_success', 'info_counters_mempool_add_success'), ('info_counters_mempool_errors_other', 'info_counters_mempool_errors_other'), ('info_counters_mempool_errors_hook', 'info_counters_mempool_errors_hook'), ('info_counters_mempool_errors_conflict', 'info_counters_mempool_errors_conflict'), ('info_counters_mempool_proposed_transaction', 'info_counters_mempool_proposed_transaction'), ('info_counters_radix_engine_invalid_proposed_commands', 'info_counters_radix_engine_invalid_proposed_commands'), ('info_counters_radix_engine_system_transactions', 'info_counters_radix_engine_system_transactions'), ('info_counters_radix_engine_user_transactions', 'info_counters_radix_engine_user_transactions'), ('info_counters_count_bdb_ledger_contains_tx', 'info_counters_count_bdb_ledger_contains_tx'), ('info_counters_count_bdb_ledger_deletes', 'info_counters_count_bdb_ledger_deletes'), ('info_counters_count_bdb_ledger_commit', 'info_counters_count_bdb_ledger_commit'), ('info_counters_count_bdb_ledger_save', 'info_counters_count_bdb_ledger_save'), ('info_counters_count_bdb_ledger_last_vertex', 'info_counters_count_bdb_ledger_last_vertex'), ('info_counters_count_bdb_ledger_store', 'info_counters_count_bdb_ledger_store'), ('info_counters_count_bdb_ledger_create_tx', 'info_counters_count_bdb_ledger_create_tx'), ('info_counters_count_bdb_ledger_contains', 'info_counters_count_bdb_ledger_contains'), ('info_counters_count_bdb_ledger_entries', 'info_counters_count_bdb_ledger_entries'), ('info_counters_count_bdb_ledger_get_last', 'info_counters_count_bdb_ledger_get_last'), ('info_counters_count_bdb_ledger_get_next', 'info_counters_count_bdb_ledger_get_next'), ('info_counters_count_bdb_ledger_search', 'info_counters_count_bdb_ledger_search'), ('info_counters_count_bdb_ledger_total', 'info_counters_count_bdb_ledger_total'), ('info_counters_count_bdb_ledger_get_prev', 'info_counters_count_bdb_ledger_get_prev'), ('info_counters_count_bdb_ledger_bytes_read', 'info_counters_count_bdb_ledger_bytes_read'), ('info_counters_count_bdb_ledger_bytes_write', 'info_counters_count_bdb_ledger_bytes_write'), ('info_counters_count_bdb_ledger_proofs_removed', 'info_counters_count_bdb_ledger_proofs_removed'), ('info_counters_count_bdb_ledger_proofs_added', 'info_counters_count_bdb_ledger_proofs_added'), ('info_counters_count_bdb_ledger_get', 'info_counters_count_bdb_ledger_get'), ('info_counters_count_bdb_ledger_last_committed', 'info_counters_count_bdb_ledger_last_committed'), ('info_counters_count_bdb_ledger_get_first', 'info_counters_count_bdb_ledger_get_first'), ('info_counters_count_bdb_header_bytes_write', 'info_counters_count_bdb_header_bytes_write'), ('info_counters_count_bdb_address_book_deletes', 'info_counters_count_bdb_address_book_deletes'), ('info_counters_count_bdb_address_book_total', 'info_counters_count_bdb_address_book_total'), ('info_counters_count_bdb_address_book_bytes_read', 'info_counters_count_bdb_address_book_bytes_read'), ('info_counters_count_bdb_address_book_bytes_write', 'info_counters_count_bdb_address_book_bytes_write'), ('info_counters_count_bdb_safety_state_total', 'info_counters_count_bdb_safety_state_total'), ('info_counters_count_bdb_safety_state_bytes_read', 'info_counters_count_bdb_safety_state_bytes_read'), ('info_counters_count_bdb_safety_state_bytes_write', 'info_counters_count_bdb_safety_state_bytes_write'), ('info_counters_count_apidb_balance_total', 'info_counters_count_apidb_balance_total'), ('info_counters_count_apidb_balance_read', 'info_counters_count_apidb_balance_read'), ('info_counters_count_apidb_balance_bytes_read', 'info_counters_count_apidb_balance_bytes_read'), ('info_counters_count_apidb_balance_bytes_write', 'info_counters_count_apidb_balance_bytes_write'), ('info_counters_count_apidb_balance_write', 'info_counters_count_apidb_balance_write'), ('info_counters_count_apidb_flush_count', 'info_counters_count_apidb_flush_count'), ('info_counters_count_apidb_queue_size', 'info_counters_count_apidb_queue_size'), ('info_counters_count_apidb_transaction_total', 'info_counters_count_apidb_transaction_total'), ('info_counters_count_apidb_transaction_read', 'info_counters_count_apidb_transaction_read'), ('info_counters_count_apidb_transaction_bytes_read', 'info_counters_count_apidb_transaction_bytes_read'), ('info_counters_count_apidb_transaction_bytes_write', 'info_counters_count_apidb_transaction_bytes_write'), ('info_counters_count_apidb_transaction_write', 'info_counters_count_apidb_transaction_write'), ('info_counters_count_apidb_token_total', 'info_counters_count_apidb_token_total'), ('info_counters_count_apidb_token_read', 'info_counters_count_apidb_token_read'), ('info_counters_count_apidb_token_bytes_read', 'info_counters_count_apidb_token_bytes_read'), ('info_counters_count_apidb_token_bytes_write', 'info_counters_count_apidb_token_bytes_write'), ('info_counters_count_apidb_token_write', 'info_counters_count_apidb_token_write'), ('info_counters_epoch_manager_queued_consensus_events', 'info_counters_epoch_manager_queued_consensus_events'), ('info_counters_hashed_bytes', 'info_counters_hashed_bytes'), ('info_counters_networking_received_bytes', 'info_counters_networking_received_bytes'), ('info_counters_networking_tcp_out_opened', 'info_counters_networking_tcp_out_opened'), ('info_counters_networking_tcp_dropped_messages', 'info_counters_networking_tcp_dropped_messages'), ('info_counters_networking_tcp_in_opened', 'info_counters_networking_tcp_in_opened'), ('info_counters_networking_tcp_closed', 'info_counters_networking_tcp_closed'), ('info_counters_networking_udp_dropped_messages', 'info_counters_networking_udp_dropped_messages'), ('info_counters_networking_sent_bytes', 'info_counters_networking_sent_bytes'), ('info_counters_sync_processed', 'info_counters_sync_processed'), ('info_counters_sync_target_state_version', 'info_counters_sync_target_state_version'), ('info_counters_sync_remote_requests_processed', 'info_counters_sync_remote_requests_processed'), ('info_counters_sync_invalid_commands_received', 'info_counters_sync_invalid_commands_received'), ('info_counters_sync_last_read_millis', 'info_counters_sync_last_read_millis'), ('info_counters_sync_target_current_diff', 'info_counters_sync_target_current_diff'), ('info_counters_signatures_verified', 'info_counters_signatures_verified'), ('info_counters_signatures_signed', 'info_counters_signatures_signed'), ('info_counters_elapsed_bdb_ledger_contains_tx', 'info_counters_elapsed_bdb_ledger_contains_tx'), ('info_counters_elapsed_bdb_ledger_commit', 'info_counters_elapsed_bdb_ledger_commit'), ('info_counters_elapsed_bdb_ledger_save', 'info_counters_elapsed_bdb_ledger_save'), ('info_counters_elapsed_bdb_ledger_last_vertex', 'info_counters_elapsed_bdb_ledger_last_vertex'), ('info_counters_elapsed_bdb_ledger_store', 'info_counters_elapsed_bdb_ledger_store'), ('info_counters_elapsed_bdb_ledger_create_tx', 'info_counters_elapsed_bdb_ledger_create_tx'), ('info_counters_elapsed_bdb_ledger_contains', 'info_counters_elapsed_bdb_ledger_contains'), ('info_counters_elapsed_bdb_ledger_entries', 'info_counters_elapsed_bdb_ledger_entries'), ('info_counters_elapsed_bdb_ledger_get_last', 'info_counters_elapsed_bdb_ledger_get_last'), ('info_counters_elapsed_bdb_ledger_search', 'info_counters_elapsed_bdb_ledger_search'), ('info_counters_elapsed_bdb_ledger_total', 'info_counters_elapsed_bdb_ledger_total'), ('info_counters_elapsed_bdb_ledger_get', 'info_counters_elapsed_bdb_ledger_get'), ('info_counters_elapsed_bdb_ledger_last_committed', 'info_counters_elapsed_bdb_ledger_last_committed'), ('info_counters_elapsed_bdb_ledger_get_first', 'info_counters_elapsed_bdb_ledger_get_first'), ('info_counters_elapsed_bdb_address_book', 'info_counters_elapsed_bdb_address_book'), ('info_counters_elapsed_bdb_safety_state', 'info_counters_elapsed_bdb_safety_state'), ('info_counters_elapsed_apidb_balance_read', 'info_counters_elapsed_apidb_balance_read'), ('info_counters_elapsed_apidb_balance_write', 'info_counters_elapsed_apidb_balance_write'), ('info_counters_elapsed_apidb_flush_time', 'info_counters_elapsed_apidb_flush_time'), ('info_counters_elapsed_apidb_transaction_read', 'info_counters_elapsed_apidb_transaction_read'), ('info_counters_elapsed_apidb_transaction_write', 'info_counters_elapsed_apidb_transaction_write'), ('info_counters_elapsed_apidb_token_read', 'info_counters_elapsed_apidb_token_read'), ('info_counters_elapsed_apidb_token_write', 'info_counters_elapsed_apidb_token_write'), ('info_counters_bft_state_version', 'info_counters_bft_state_version'), ('info_counters_bft_vote_quorums', 'info_counters_bft_vote_quorums'), ('info_counters_bft_rejected', 'info_counters_bft_rejected'), ('info_counters_bft_vertex_store_rebuilds', 'info_counters_bft_vertex_store_rebuilds'), ('info_counters_bft_vertex_store_forks', 'info_counters_bft_vertex_store_forks'), ('info_counters_bft_sync_request_timeouts', 'info_counters_bft_sync_request_timeouts'), ('info_counters_bft_sync_requests_sent', 'info_counters_bft_sync_requests_sent'), ('info_counters_bft_timeout', 'info_counters_bft_timeout'), ('info_counters_bft_vertex_store_size', 'info_counters_bft_vertex_store_size'), ('info_counters_bft_processed', 'info_counters_bft_processed'), ('info_counters_bft_consensus_events', 'info_counters_bft_consensus_events'), ('info_counters_bft_indirect_parent', 'info_counters_bft_indirect_parent'), ('info_counters_bft_proposals_made', 'info_counters_bft_proposals_made'), ('info_counters_bft_timed_out_views', 'info_counters_bft_timed_out_views'), ('info_counters_bft_timeout_quorums', 'info_counters_bft_timeout_quorums'), ('info_counters_startup_time_ms', 'info_counters_startup_time_ms'), ('info_counters_messages_inbound_processed', 'info_counters_messages_inbound_processed'), ('info_counters_messages_inbound_discarded', 'info_counters_messages_inbound_discarded'), ('info_counters_messages_inbound_badsignature', 'info_counters_messages_inbound_badsignature'), ('info_counters_messages_inbound_received', 'info_counters_messages_inbound_received'), ('info_counters_messages_outbound_processed', 'info_counters_messages_outbound_processed'), ('info_counters_messages_outbound_aborted', 'info_counters_messages_outbound_aborted'), ('info_counters_messages_outbound_pending', 'info_counters_messages_outbound_pending'), ('info_counters_messages_outbound_sent', 'info_counters_messages_outbound_sent'), ('info_counters_persistence_safety_store_saves', 'info_counters_persistence_safety_store_saves'), ('info_counters_persistence_vertex_store_saves', 'info_counters_persistence_vertex_store_saves'), ('info_counters_persistence_atom_log_write_bytes', 'info_counters_persistence_atom_log_write_bytes'), ('info_counters_persistence_atom_log_write_compressed', 'info_counters_persistence_atom_log_write_compressed'), ('info_counters_time_duration', 'info_counters_time_duration'), ('info_configuration_pacemakerRate', 'info_configuration_pacemakerRate'), ('info_configuration_pacemakerTimeout', 'info_configuration_pacemakerTimeout'), ('info_configuration_pacemakerMaxExponent', 'info_configuration_pacemakerMaxExponent'), ('info_system_version_system_version_agent_version', 'info_system_version_system_version_agent_version'), ('info_system_version_system_version_protocol_version', 'info_system_version_system_version_protocol_version'), ('info_epochManager_currentView_view', 'info_epochManager_currentView_view'), ('info_epochManager_currentView_epoch', 'info_epochManager_currentView_epoch')]
def test_slash_request_forbidden(client): assert client.get("/").status_code == 404 def test_api_root_request_forbidden(client): assert client.get("/api").status_code == 404 assert client.get("/api/").status_code == 404 def test_auth_root_request_forbidden(client): assert client.get("/auth").status_code == 404 assert client.get("/auth/").status_code == 404
def test_slash_request_forbidden(client): assert client.get('/').status_code == 404 def test_api_root_request_forbidden(client): assert client.get('/api').status_code == 404 assert client.get('/api/').status_code == 404 def test_auth_root_request_forbidden(client): assert client.get('/auth').status_code == 404 assert client.get('/auth/').status_code == 404
a, b, c = map(int, input().split()) if (a == b and a != c) or (a ==c and a != b) or (b == c and b != a): print("Yes") else: print("No")
(a, b, c) = map(int, input().split()) if a == b and a != c or (a == c and a != b) or (b == c and b != a): print('Yes') else: print('No')
#Check for the existence of file no_of_items=0 try: f=open("./TODO (CLI-VER)/todolist.txt") p=0 for i in f.readlines():#Counting the number of items if the file exists already p+=1 no_of_items=p-2 except: f=open("./TODO (CLI-VER)/todolist.txt",'w') f.write("_________TODO LIST__________\n") f.write(" TIME WORK") finally: f.close() #Todo list print("Press 1: Add Item \nPress 2: Delete Item \nPress 3: Update item \nPress 4: Display Items\nPress 5: Exit") n=int(input()) while n==1 or n==2 or n==3 or n==4: if n==1: todo=[] print("Enter the time in HH:MM format(24 hours format)") time=input() print("Enter your Work") work=input() no_of_items+=1 with open('./TODO (CLI-VER)/todolist.txt','a') as f: f.write("\n"+str(no_of_items)+" "+time+" "+work) elif n==2: if(no_of_items<=0): print("There is no item in the list kindly add some items") else: print("____________________________________________________________") print("Your Current List: ") todo=[] with open('./TODO (CLI-VER)/todolist.txt') as f: for i in f.readlines(): print(i) todo.append(i) print("____________________________________________________________") print("Enter the position of the item you want to delete : ") pos=int(input()) if(pos<=0): print("Please enter a valid position") elif (pos>(no_of_items)): print("Please enter the position <= {}".format(no_of_items)) else: todo.pop(pos+1) no_of_items-=1 if(no_of_items<=0): print("Congratulations your todo list is empty!") with open('./TODO (CLI-VER)/todolist.txt','w') as f: for i in range(len(todo)): if i>=(pos+1): f.write(str(pos)+todo[i][1:]) pos+=1 else: f.write(todo[i]) elif n==3: print("____________________________________________________________") print("Your Current List: ") todo=[] with open('./TODO (CLI-VER)/todolist.txt') as f: for i in f.readlines(): print(i) todo.append(i) print("____________________________________________________________") print("Enter the position of the items you want to update : ") pos=int(input()) if(pos<=0): print("Please enter a valid position") elif (pos>(no_of_items)): print("Please enter the position <= {}".format(no_of_items)) else: print("What you want to update : ") print("Press 1: Time\nPress 2: Work") choice=int(input()) if choice==1: print("Enter your updated time :") time=input() p=todo[pos+1].index(":") y=0 with open('./TODO (CLI-VER)/todolist.txt','w') as f: for i in range(len(todo)): if i==pos+1: f.write(str(pos)+" "+time+""+''.join(todo[pos+1][p+3:])) else: f.write(todo[i]) elif choice==2: print("Enter your updated work :") work=input() p=todo[pos+1].index(":") y=0 with open('./TODO (CLI-VER)/todolist.txt','w') as f: for i in range(len(todo)): if i==pos+1: f.write(str(pos)+" "+''.join(todo[pos+1][p-2:p+3])+" "+work) else: f.write(todo[i]) elif n==4: print("Your Current List: ") todo=[] print("____________________________________________________________") with open('./TODO (CLI-VER)/todolist.txt') as f: for i in f.readlines(): print(i) todo.append(i) print("____________________________________________________________") print("Press 1: Add Item \nPress 2: Delete the Item\nPress 3: Update item\nPress 4:Display Items\nPress 5:Exit") n=int(input()) print("Thank you for using our application")
no_of_items = 0 try: f = open('./TODO (CLI-VER)/todolist.txt') p = 0 for i in f.readlines(): p += 1 no_of_items = p - 2 except: f = open('./TODO (CLI-VER)/todolist.txt', 'w') f.write('_________TODO LIST__________\n') f.write(' TIME WORK') finally: f.close() print('Press 1: Add Item \nPress 2: Delete Item \nPress 3: Update item \nPress 4: Display Items\nPress 5: Exit') n = int(input()) while n == 1 or n == 2 or n == 3 or (n == 4): if n == 1: todo = [] print('Enter the time in HH:MM format(24 hours format)') time = input() print('Enter your Work') work = input() no_of_items += 1 with open('./TODO (CLI-VER)/todolist.txt', 'a') as f: f.write('\n' + str(no_of_items) + ' ' + time + ' ' + work) elif n == 2: if no_of_items <= 0: print('There is no item in the list kindly add some items') else: print('____________________________________________________________') print('Your Current List: ') todo = [] with open('./TODO (CLI-VER)/todolist.txt') as f: for i in f.readlines(): print(i) todo.append(i) print('____________________________________________________________') print('Enter the position of the item you want to delete : ') pos = int(input()) if pos <= 0: print('Please enter a valid position') elif pos > no_of_items: print('Please enter the position <= {}'.format(no_of_items)) else: todo.pop(pos + 1) no_of_items -= 1 if no_of_items <= 0: print('Congratulations your todo list is empty!') with open('./TODO (CLI-VER)/todolist.txt', 'w') as f: for i in range(len(todo)): if i >= pos + 1: f.write(str(pos) + todo[i][1:]) pos += 1 else: f.write(todo[i]) elif n == 3: print('____________________________________________________________') print('Your Current List: ') todo = [] with open('./TODO (CLI-VER)/todolist.txt') as f: for i in f.readlines(): print(i) todo.append(i) print('____________________________________________________________') print('Enter the position of the items you want to update : ') pos = int(input()) if pos <= 0: print('Please enter a valid position') elif pos > no_of_items: print('Please enter the position <= {}'.format(no_of_items)) else: print('What you want to update : ') print('Press 1: Time\nPress 2: Work') choice = int(input()) if choice == 1: print('Enter your updated time :') time = input() p = todo[pos + 1].index(':') y = 0 with open('./TODO (CLI-VER)/todolist.txt', 'w') as f: for i in range(len(todo)): if i == pos + 1: f.write(str(pos) + ' ' + time + '' + ''.join(todo[pos + 1][p + 3:])) else: f.write(todo[i]) elif choice == 2: print('Enter your updated work :') work = input() p = todo[pos + 1].index(':') y = 0 with open('./TODO (CLI-VER)/todolist.txt', 'w') as f: for i in range(len(todo)): if i == pos + 1: f.write(str(pos) + ' ' + ''.join(todo[pos + 1][p - 2:p + 3]) + ' ' + work) else: f.write(todo[i]) elif n == 4: print('Your Current List: ') todo = [] print('____________________________________________________________') with open('./TODO (CLI-VER)/todolist.txt') as f: for i in f.readlines(): print(i) todo.append(i) print('____________________________________________________________') print('Press 1: Add Item \nPress 2: Delete the Item\nPress 3: Update item\nPress 4:Display Items\nPress 5:Exit') n = int(input()) print('Thank you for using our application')
class Solution: def minFlips(self, target: str) -> int: nflips = 0 for ison in map(lambda x : x == '1', target): if ((not ison) and nflips % 2 == 1) or (ison and nflips % 2 == 0): nflips += 1 return nflips
class Solution: def min_flips(self, target: str) -> int: nflips = 0 for ison in map(lambda x: x == '1', target): if not ison and nflips % 2 == 1 or (ison and nflips % 2 == 0): nflips += 1 return nflips
class Solution: def searchMatrix(self, matrix: List[List[int]], target: int) -> bool: for i in matrix: for j in i: if j==target:return True return False
class Solution: def search_matrix(self, matrix: List[List[int]], target: int) -> bool: for i in matrix: for j in i: if j == target: return True return False
class FermiDataGetter(object): def __init__(self) -> None: raise NotImplementedError()
class Fermidatagetter(object): def __init__(self) -> None: raise not_implemented_error()
# -*- coding: utf-8 -*- ''' >>> from pycm import * >>> import os >>> import json >>> y_actu = [2, 0, 2, 2, 0, 1, 1, 2, 2, 0, 1, 2] >>> y_pred = [0, 0, 2, 1, 0, 2, 1, 0, 2, 0, 2, 2] >>> cm = ConfusionMatrix(y_actu, y_pred) >>> cm pycm.ConfusionMatrix(classes: [0, 1, 2]) >>> len(cm) 3 >>> print(cm) Predict 0 1 2 Actual 0 3 0 0 <BLANKLINE> 1 0 1 2 <BLANKLINE> 2 2 1 3 <BLANKLINE> <BLANKLINE> <BLANKLINE> <BLANKLINE> <BLANKLINE> Overall Statistics : <BLANKLINE> 95% CI (0.30439,0.86228) AUNP 0.66667 AUNU 0.69444 Bennett S 0.375 CBA 0.47778 Chi-Squared 6.6 Chi-Squared DF 4 Conditional Entropy 0.95915 Cramer V 0.5244 Cross Entropy 1.59352 Gwet AC1 0.38931 Hamming Loss 0.41667 Joint Entropy 2.45915 KL Divergence 0.09352 Kappa 0.35484 Kappa 95% CI (-0.07708,0.78675) Kappa No Prevalence 0.16667 Kappa Standard Error 0.22036 Kappa Unbiased 0.34426 Lambda A 0.16667 Lambda B 0.42857 Mutual Information 0.52421 NIR 0.5 Overall ACC 0.58333 Overall CEN 0.46381 Overall J (1.225,0.40833) Overall MCC 0.36667 Overall MCEN 0.51894 Overall RACC 0.35417 Overall RACCU 0.36458 P-Value 0.38721 PPV Macro 0.56667 PPV Micro 0.58333 Phi-Squared 0.55 RCI 0.34947 RR 4.0 Reference Entropy 1.5 Response Entropy 1.48336 SOA1(Landis & Koch) Fair SOA2(Fleiss) Poor SOA3(Altman) Fair SOA4(Cicchetti) Poor Scott PI 0.34426 Standard Error 0.14232 TPR Macro 0.61111 TPR Micro 0.58333 Zero-one Loss 5 <BLANKLINE> Class Statistics : <BLANKLINE> Classes 0 1 2 ACC(Accuracy) 0.83333 0.75 0.58333 AUC(Area under the roc curve) 0.88889 0.61111 0.58333 AUCI(Auc value interpretation) Very Good Fair Poor BM(Informedness or bookmaker informedness) 0.77778 0.22222 0.16667 CEN(Confusion entropy) 0.25 0.49658 0.60442 DOR(Diagnostic odds ratio) None 4.0 2.0 DP(Discriminant power) None 0.33193 0.16597 DPI(Discriminant power interpretation) None Poor Poor ERR(Error rate) 0.16667 0.25 0.41667 F0.5(F0.5 score) 0.65217 0.45455 0.57692 F1(F1 score - harmonic mean of precision and sensitivity) 0.75 0.4 0.54545 F2(F2 score) 0.88235 0.35714 0.51724 FDR(False discovery rate) 0.4 0.5 0.4 FN(False negative/miss/type 2 error) 0 2 3 FNR(Miss rate or false negative rate) 0.0 0.66667 0.5 FOR(False omission rate) 0.0 0.2 0.42857 FP(False positive/type 1 error/false alarm) 2 1 2 FPR(Fall-out or false positive rate) 0.22222 0.11111 0.33333 G(G-measure geometric mean of precision and sensitivity) 0.7746 0.40825 0.54772 GI(Gini index) 0.77778 0.22222 0.16667 IS(Information score) 1.26303 1.0 0.26303 J(Jaccard index) 0.6 0.25 0.375 LS(Lift score) 2.4 2.0 1.2 MCC(Matthews correlation coefficient) 0.68313 0.2582 0.16903 MCEN(Modified confusion entropy) 0.26439 0.5 0.6875 MK(Markedness) 0.6 0.3 0.17143 N(Condition negative) 9 9 6 NLR(Negative likelihood ratio) 0.0 0.75 0.75 NPV(Negative predictive value) 1.0 0.8 0.57143 P(Condition positive or support) 3 3 6 PLR(Positive likelihood ratio) 4.5 3.0 1.5 PLRI(Positive likelihood ratio interpretation) Poor Poor Poor POP(Population) 12 12 12 PPV(Precision or positive predictive value) 0.6 0.5 0.6 PRE(Prevalence) 0.25 0.25 0.5 RACC(Random accuracy) 0.10417 0.04167 0.20833 RACCU(Random accuracy unbiased) 0.11111 0.0434 0.21007 TN(True negative/correct rejection) 7 8 4 TNR(Specificity or true negative rate) 0.77778 0.88889 0.66667 TON(Test outcome negative) 7 10 7 TOP(Test outcome positive) 5 2 5 TP(True positive/hit) 3 1 3 TPR(Sensitivity, recall, hit rate, or true positive rate) 1.0 0.33333 0.5 Y(Youden index) 0.77778 0.22222 0.16667 dInd(Distance index) 0.22222 0.67586 0.60093 sInd(Similarity index) 0.84287 0.52209 0.57508 <BLANKLINE> >>> cm.relabel({0:"L1",1:"L2",2:"L3"}) >>> print(cm) Predict L1 L2 L3 Actual L1 3 0 0 <BLANKLINE> L2 0 1 2 <BLANKLINE> L3 2 1 3 <BLANKLINE> <BLANKLINE> <BLANKLINE> <BLANKLINE> <BLANKLINE> Overall Statistics : <BLANKLINE> 95% CI (0.30439,0.86228) AUNP 0.66667 AUNU 0.69444 Bennett S 0.375 CBA 0.47778 Chi-Squared 6.6 Chi-Squared DF 4 Conditional Entropy 0.95915 Cramer V 0.5244 Cross Entropy 1.59352 Gwet AC1 0.38931 Hamming Loss 0.41667 Joint Entropy 2.45915 KL Divergence 0.09352 Kappa 0.35484 Kappa 95% CI (-0.07708,0.78675) Kappa No Prevalence 0.16667 Kappa Standard Error 0.22036 Kappa Unbiased 0.34426 Lambda A 0.16667 Lambda B 0.42857 Mutual Information 0.52421 NIR 0.5 Overall ACC 0.58333 Overall CEN 0.46381 Overall J (1.225,0.40833) Overall MCC 0.36667 Overall MCEN 0.51894 Overall RACC 0.35417 Overall RACCU 0.36458 P-Value 0.38721 PPV Macro 0.56667 PPV Micro 0.58333 Phi-Squared 0.55 RCI 0.34947 RR 4.0 Reference Entropy 1.5 Response Entropy 1.48336 SOA1(Landis & Koch) Fair SOA2(Fleiss) Poor SOA3(Altman) Fair SOA4(Cicchetti) Poor Scott PI 0.34426 Standard Error 0.14232 TPR Macro 0.61111 TPR Micro 0.58333 Zero-one Loss 5 <BLANKLINE> Class Statistics : <BLANKLINE> Classes L1 L2 L3 ACC(Accuracy) 0.83333 0.75 0.58333 AUC(Area under the roc curve) 0.88889 0.61111 0.58333 AUCI(Auc value interpretation) Very Good Fair Poor BM(Informedness or bookmaker informedness) 0.77778 0.22222 0.16667 CEN(Confusion entropy) 0.25 0.49658 0.60442 DOR(Diagnostic odds ratio) None 4.0 2.0 DP(Discriminant power) None 0.33193 0.16597 DPI(Discriminant power interpretation) None Poor Poor ERR(Error rate) 0.16667 0.25 0.41667 F0.5(F0.5 score) 0.65217 0.45455 0.57692 F1(F1 score - harmonic mean of precision and sensitivity) 0.75 0.4 0.54545 F2(F2 score) 0.88235 0.35714 0.51724 FDR(False discovery rate) 0.4 0.5 0.4 FN(False negative/miss/type 2 error) 0 2 3 FNR(Miss rate or false negative rate) 0.0 0.66667 0.5 FOR(False omission rate) 0.0 0.2 0.42857 FP(False positive/type 1 error/false alarm) 2 1 2 FPR(Fall-out or false positive rate) 0.22222 0.11111 0.33333 G(G-measure geometric mean of precision and sensitivity) 0.7746 0.40825 0.54772 GI(Gini index) 0.77778 0.22222 0.16667 IS(Information score) 1.26303 1.0 0.26303 J(Jaccard index) 0.6 0.25 0.375 LS(Lift score) 2.4 2.0 1.2 MCC(Matthews correlation coefficient) 0.68313 0.2582 0.16903 MCEN(Modified confusion entropy) 0.26439 0.5 0.6875 MK(Markedness) 0.6 0.3 0.17143 N(Condition negative) 9 9 6 NLR(Negative likelihood ratio) 0.0 0.75 0.75 NPV(Negative predictive value) 1.0 0.8 0.57143 P(Condition positive or support) 3 3 6 PLR(Positive likelihood ratio) 4.5 3.0 1.5 PLRI(Positive likelihood ratio interpretation) Poor Poor Poor POP(Population) 12 12 12 PPV(Precision or positive predictive value) 0.6 0.5 0.6 PRE(Prevalence) 0.25 0.25 0.5 RACC(Random accuracy) 0.10417 0.04167 0.20833 RACCU(Random accuracy unbiased) 0.11111 0.0434 0.21007 TN(True negative/correct rejection) 7 8 4 TNR(Specificity or true negative rate) 0.77778 0.88889 0.66667 TON(Test outcome negative) 7 10 7 TOP(Test outcome positive) 5 2 5 TP(True positive/hit) 3 1 3 TPR(Sensitivity, recall, hit rate, or true positive rate) 1.0 0.33333 0.5 Y(Youden index) 0.77778 0.22222 0.16667 dInd(Distance index) 0.22222 0.67586 0.60093 sInd(Similarity index) 0.84287 0.52209 0.57508 <BLANKLINE> >>> cm.Y["L2"] 0.2222222222222221 >>> cm_2 = ConfusionMatrix(y_actu, 2) Traceback (most recent call last): ... pycm.pycm_obj.pycmVectorError: The type of input vectors is assumed to be a list or a NumPy array >>> cm_3 = ConfusionMatrix(y_actu, [1,2]) Traceback (most recent call last): ... pycm.pycm_obj.pycmVectorError: Input vectors must have same length >>> cm_4 = ConfusionMatrix([], []) Traceback (most recent call last): ... pycm.pycm_obj.pycmVectorError: Input vectors are empty >>> cm_5 = ConfusionMatrix([1,1,1,], [1,1,1,1]) Traceback (most recent call last): ... pycm.pycm_obj.pycmVectorError: Input vectors must have same length >>> pycm_help() <BLANKLINE> PyCM is a multi-class confusion matrix library written in Python that supports both input data vectors and direct matrix, and a proper tool for post-classification model evaluation that supports most classes and overall statistics parameters. PyCM is the swiss-army knife of confusion matrices, targeted mainly at data scientists that need a broad array of metrics for predictive models and an accurate evaluation of large variety of classifiers. <BLANKLINE> Repo : https://github.com/sepandhaghighi/pycm Webpage : http://www.pycm.ir <BLANKLINE> <BLANKLINE> >>> RCI_calc(24,0) 'None' >>> CBA_calc([1,2], {1:{1:0,2:0},2:{1:0,2:0}}, {1:0,2:0}, {1:0,2:0}) 'None' >>> RR_calc([], {1:0,2:0}) 'None' >>> overall_MCC_calc([1,2], {1:{1:0,2:0},2:{1:0,2:0}}, {1:0,2:0}, {1:0,2:0}) 'None' >>> CEN_misclassification_calc({1:{1:0,2:0},2:{1:0,2:0}},{1:0,2:0},{1:0,2:0},1,1,2) 'None' >>> vector_check([1,2,3,0.4]) False >>> vector_check([1,2,3,-2]) False >>> matrix_check({1:{1:0.5,2:0},2:{1:0,2:0}}) False >>> matrix_check([]) False >>> TTPN_calc(0,0) 'None' >>> TTPN_calc(1,4) 0.2 >>> FXR_calc(None) 'None' >>> FXR_calc(0.2) 0.8 >>> ACC_calc(0,0,0,0) 'None' >>> ACC_calc(1,1,3,4) 0.2222222222222222 >>> MCC_calc(0,2,0,2) 'None' >>> MCC_calc(1,2,3,4) -0.408248290463863 >>> LR_calc(1,2) 0.5 >>> LR_calc(1,0) 'None' >>> MK_BM_calc(2,"None") 'None' >>> MK_BM_calc(1,2) 2 >>> PRE_calc(None,2) 'None' >>> PRE_calc(1,5) 0.2 >>> PRE_calc(1,0) 'None' >>> G_calc(None,2) 'None' >>> G_calc(1,2) 1.4142135623730951 >>> RACC_calc(2,3,4) 0.375 >>> reliability_calc(1,None) 'None' >>> reliability_calc(2,0.3) 1.7 >>> micro_calc({1:2,2:3},{1:1,2:4}) 0.5 >>> micro_calc({1:2,2:3},None) 'None' >>> macro_calc(None) 'None' >>> macro_calc({1:2,2:3}) 2.5 >>> F_calc(TP=0,FP=0,FN=0,Beta=1) 'None' >>> F_calc(TP=3,FP=2,FN=1,Beta=5) 0.7428571428571429 >>> save_stat=cm.save_stat("test",address=False) >>> save_stat=={'Status': True, 'Message': None} True >>> save_stat=cm.save_stat("test_filtered",address=False,overall_param=["Kappa","Scott PI"],class_param=["TPR","TNR","ACC","AUC"]) >>> save_stat=={'Status': True, 'Message': None} True >>> save_stat=cm.save_stat("test_filtered2",address=False,overall_param=["Kappa","Scott PI"],class_param=["TPR","TNR","ACC","AUC"],class_name=["L1","L2"]) >>> save_stat=={'Status': True, 'Message': None} True >>> save_stat=cm.save_stat("test_filtered3",address=False,overall_param=["Kappa","Scott PI"],class_param=["TPR","TNR","ACC","AUC"],class_name=[]) >>> save_stat=={'Status': True, 'Message': None} True >>> save_stat=cm.save_stat("/asdasd,qweqwe.eo/",address=True) >>> save_stat=={'Status': False, 'Message': "[Errno 2] No such file or directory: '/asdasd,qweqwe.eo/.pycm'"} True >>> ERR_calc(None) 'None' >>> ERR_calc(0.1) 0.9 >>> cm.F_beta(4)["L1"] 0.9622641509433962 >>> cm.F_beta(4)["L2"] 0.34 >>> cm.F_beta(4)["L3"] 0.504950495049505 >>> import numpy as np >>> y_test = np.array([600, 200, 200, 200, 200, 200, 200, 200, 500, 500, 500, 200, 200, 200, 200, 200, 200, 200, 200, 200]) >>> y_pred = np.array([100, 200, 200, 100, 100, 200, 200, 200, 100, 200, 500, 100, 100, 100, 100, 100, 100, 100, 500, 200]) >>> cm=ConfusionMatrix(y_test, y_pred) >>> print(cm) Predict 100 200 500 600 Actual 100 0 0 0 0 <BLANKLINE> 200 9 6 1 0 <BLANKLINE> 500 1 1 1 0 <BLANKLINE> 600 1 0 0 0 <BLANKLINE> <BLANKLINE> <BLANKLINE> <BLANKLINE> <BLANKLINE> Overall Statistics : <BLANKLINE> 95% CI (0.14096,0.55904) AUNP None AUNU None Bennett S 0.13333 CBA 0.17708 Chi-Squared None Chi-Squared DF 9 Conditional Entropy 1.23579 Cramer V None Cross Entropy 1.70995 Gwet AC1 0.19505 Hamming Loss 0.65 Joint Entropy 2.11997 KL Divergence None Kappa 0.07801 Kappa 95% CI (-0.2185,0.37453) Kappa No Prevalence -0.3 Kappa Standard Error 0.15128 Kappa Unbiased -0.12554 Lambda A 0.0 Lambda B 0.0 Mutual Information 0.10088 NIR 0.8 Overall ACC 0.35 Overall CEN 0.3648 Overall J (0.60294,0.15074) Overall MCC 0.12642 Overall MCEN 0.37463 Overall RACC 0.295 Overall RACCU 0.4225 P-Value 1.0 PPV Macro None PPV Micro 0.35 Phi-Squared None RCI 0.11409 RR 5.0 Reference Entropy 0.88418 Response Entropy 1.33667 SOA1(Landis & Koch) Slight SOA2(Fleiss) Poor SOA3(Altman) Poor SOA4(Cicchetti) Poor Scott PI -0.12554 Standard Error 0.10665 TPR Macro None TPR Micro 0.35 Zero-one Loss 13 <BLANKLINE> Class Statistics : <BLANKLINE> Classes 100 200 500 600 ACC(Accuracy) 0.45 0.45 0.85 0.95 AUC(Area under the roc curve) None 0.5625 0.63725 0.5 AUCI(Auc value interpretation) None Poor Fair Poor BM(Informedness or bookmaker informedness) None 0.125 0.27451 0.0 CEN(Confusion entropy) 0.33496 0.35708 0.53895 0.0 DOR(Diagnostic odds ratio) None 1.8 8.0 None DP(Discriminant power) None 0.14074 0.4979 None DPI(Discriminant power interpretation) None Poor Poor None ERR(Error rate) 0.55 0.55 0.15 0.05 F0.5(F0.5 score) 0.0 0.68182 0.45455 0.0 F1(F1 score - harmonic mean of precision and sensitivity) 0.0 0.52174 0.4 0.0 F2(F2 score) 0.0 0.42254 0.35714 0.0 FDR(False discovery rate) 1.0 0.14286 0.5 None FN(False negative/miss/type 2 error) 0 10 2 1 FNR(Miss rate or false negative rate) None 0.625 0.66667 1.0 FOR(False omission rate) 0.0 0.76923 0.11111 0.05 FP(False positive/type 1 error/false alarm) 11 1 1 0 FPR(Fall-out or false positive rate) 0.55 0.25 0.05882 0.0 G(G-measure geometric mean of precision and sensitivity) None 0.56695 0.40825 None GI(Gini index) None 0.125 0.27451 0.0 IS(Information score) None 0.09954 1.73697 None J(Jaccard index) 0.0 0.35294 0.25 0.0 LS(Lift score) None 1.07143 3.33333 None MCC(Matthews correlation coefficient) None 0.10483 0.32673 None MCEN(Modified confusion entropy) 0.33496 0.37394 0.58028 0.0 MK(Markedness) 0.0 0.08791 0.38889 None N(Condition negative) 20 4 17 19 NLR(Negative likelihood ratio) None 0.83333 0.70833 1.0 NPV(Negative predictive value) 1.0 0.23077 0.88889 0.95 P(Condition positive or support) 0 16 3 1 PLR(Positive likelihood ratio) None 1.5 5.66667 None PLRI(Positive likelihood ratio interpretation) None Poor Fair None POP(Population) 20 20 20 20 PPV(Precision or positive predictive value) 0.0 0.85714 0.5 None PRE(Prevalence) 0.0 0.8 0.15 0.05 RACC(Random accuracy) 0.0 0.28 0.015 0.0 RACCU(Random accuracy unbiased) 0.07563 0.33062 0.01562 0.00063 TN(True negative/correct rejection) 9 3 16 19 TNR(Specificity or true negative rate) 0.45 0.75 0.94118 1.0 TON(Test outcome negative) 9 13 18 20 TOP(Test outcome positive) 11 7 2 0 TP(True positive/hit) 0 6 1 0 TPR(Sensitivity, recall, hit rate, or true positive rate) None 0.375 0.33333 0.0 Y(Youden index) None 0.125 0.27451 0.0 dInd(Distance index) None 0.67315 0.66926 1.0 sInd(Similarity index) None 0.52401 0.52676 0.29289 <BLANKLINE> >>> cm.stat() Overall Statistics : <BLANKLINE> 95% CI (0.14096,0.55904) AUNP None AUNU None Bennett S 0.13333 CBA 0.17708 Chi-Squared None Chi-Squared DF 9 Conditional Entropy 1.23579 Cramer V None Cross Entropy 1.70995 Gwet AC1 0.19505 Hamming Loss 0.65 Joint Entropy 2.11997 KL Divergence None Kappa 0.07801 Kappa 95% CI (-0.2185,0.37453) Kappa No Prevalence -0.3 Kappa Standard Error 0.15128 Kappa Unbiased -0.12554 Lambda A 0.0 Lambda B 0.0 Mutual Information 0.10088 NIR 0.8 Overall ACC 0.35 Overall CEN 0.3648 Overall J (0.60294,0.15074) Overall MCC 0.12642 Overall MCEN 0.37463 Overall RACC 0.295 Overall RACCU 0.4225 P-Value 1.0 PPV Macro None PPV Micro 0.35 Phi-Squared None RCI 0.11409 RR 5.0 Reference Entropy 0.88418 Response Entropy 1.33667 SOA1(Landis & Koch) Slight SOA2(Fleiss) Poor SOA3(Altman) Poor SOA4(Cicchetti) Poor Scott PI -0.12554 Standard Error 0.10665 TPR Macro None TPR Micro 0.35 Zero-one Loss 13 <BLANKLINE> Class Statistics : <BLANKLINE> Classes 100 200 500 600 ACC(Accuracy) 0.45 0.45 0.85 0.95 AUC(Area under the roc curve) None 0.5625 0.63725 0.5 AUCI(Auc value interpretation) None Poor Fair Poor BM(Informedness or bookmaker informedness) None 0.125 0.27451 0.0 CEN(Confusion entropy) 0.33496 0.35708 0.53895 0.0 DOR(Diagnostic odds ratio) None 1.8 8.0 None DP(Discriminant power) None 0.14074 0.4979 None DPI(Discriminant power interpretation) None Poor Poor None ERR(Error rate) 0.55 0.55 0.15 0.05 F0.5(F0.5 score) 0.0 0.68182 0.45455 0.0 F1(F1 score - harmonic mean of precision and sensitivity) 0.0 0.52174 0.4 0.0 F2(F2 score) 0.0 0.42254 0.35714 0.0 FDR(False discovery rate) 1.0 0.14286 0.5 None FN(False negative/miss/type 2 error) 0 10 2 1 FNR(Miss rate or false negative rate) None 0.625 0.66667 1.0 FOR(False omission rate) 0.0 0.76923 0.11111 0.05 FP(False positive/type 1 error/false alarm) 11 1 1 0 FPR(Fall-out or false positive rate) 0.55 0.25 0.05882 0.0 G(G-measure geometric mean of precision and sensitivity) None 0.56695 0.40825 None GI(Gini index) None 0.125 0.27451 0.0 IS(Information score) None 0.09954 1.73697 None J(Jaccard index) 0.0 0.35294 0.25 0.0 LS(Lift score) None 1.07143 3.33333 None MCC(Matthews correlation coefficient) None 0.10483 0.32673 None MCEN(Modified confusion entropy) 0.33496 0.37394 0.58028 0.0 MK(Markedness) 0.0 0.08791 0.38889 None N(Condition negative) 20 4 17 19 NLR(Negative likelihood ratio) None 0.83333 0.70833 1.0 NPV(Negative predictive value) 1.0 0.23077 0.88889 0.95 P(Condition positive or support) 0 16 3 1 PLR(Positive likelihood ratio) None 1.5 5.66667 None PLRI(Positive likelihood ratio interpretation) None Poor Fair None POP(Population) 20 20 20 20 PPV(Precision or positive predictive value) 0.0 0.85714 0.5 None PRE(Prevalence) 0.0 0.8 0.15 0.05 RACC(Random accuracy) 0.0 0.28 0.015 0.0 RACCU(Random accuracy unbiased) 0.07563 0.33062 0.01562 0.00063 TN(True negative/correct rejection) 9 3 16 19 TNR(Specificity or true negative rate) 0.45 0.75 0.94118 1.0 TON(Test outcome negative) 9 13 18 20 TOP(Test outcome positive) 11 7 2 0 TP(True positive/hit) 0 6 1 0 TPR(Sensitivity, recall, hit rate, or true positive rate) None 0.375 0.33333 0.0 Y(Youden index) None 0.125 0.27451 0.0 dInd(Distance index) None 0.67315 0.66926 1.0 sInd(Similarity index) None 0.52401 0.52676 0.29289 <BLANKLINE> >>> cm.stat(overall_param=["Kappa","Scott PI"],class_param=["TPR","TNR","ACC","AUC"]) Overall Statistics : <BLANKLINE> Kappa 0.07801 Scott PI -0.12554 <BLANKLINE> Class Statistics : <BLANKLINE> Classes 100 200 500 600 ACC(Accuracy) 0.45 0.45 0.85 0.95 AUC(Area under the roc curve) None 0.5625 0.63725 0.5 TNR(Specificity or true negative rate) 0.45 0.75 0.94118 1.0 TPR(Sensitivity, recall, hit rate, or true positive rate) None 0.375 0.33333 0.0 <BLANKLINE> >>> cm.stat(overall_param=["Kappa","Scott PI"],class_param=["TPR","TNR","ACC","AUC"],class_name=[100]) Overall Statistics : <BLANKLINE> Kappa 0.07801 Scott PI -0.12554 <BLANKLINE> Class Statistics : <BLANKLINE> Classes 100 ACC(Accuracy) 0.45 AUC(Area under the roc curve) None TNR(Specificity or true negative rate) 0.45 TPR(Sensitivity, recall, hit rate, or true positive rate) None <BLANKLINE> >>> cm.stat(overall_param=["Kappa","Scott PI"],class_param=["TPR","TNR","ACC","AUC"],class_name=[]) Overall Statistics : <BLANKLINE> Kappa 0.07801 Scott PI -0.12554 <BLANKLINE> >>> cm.stat(overall_param=["Kappa","Scott PI"],class_param=[],class_name=[100]) Overall Statistics : <BLANKLINE> Kappa 0.07801 Scott PI -0.12554 <BLANKLINE> >>> cm.stat(overall_param=["Kappa","Scott PI"],class_param=["TPR"],class_name=[100]) Overall Statistics : <BLANKLINE> Kappa 0.07801 Scott PI -0.12554 <BLANKLINE> Class Statistics : <BLANKLINE> Classes 100 TPR(Sensitivity, recall, hit rate, or true positive rate) None <BLANKLINE> >>> cm.stat(overall_param=[],class_param=["TPR"],class_name=[100]) <BLANKLINE> Class Statistics : <BLANKLINE> Classes 100 TPR(Sensitivity, recall, hit rate, or true positive rate) None <BLANKLINE> >>> cm.print_normalized_matrix() Predict 100 200 500 600 Actual 100 0.0 0.0 0.0 0.0 200 0.5625 0.375 0.0625 0.0 500 0.33333 0.33333 0.33333 0.0 600 1.0 0.0 0.0 0.0 <BLANKLINE> >>> cm.print_matrix() Predict 100 200 500 600 Actual 100 0 0 0 0 200 9 6 1 0 500 1 1 1 0 600 1 0 0 0 <BLANKLINE> >>> cm.print_matrix(one_vs_all=True,class_name=200) Predict 200 ~ Actual 200 6 10 ~ 1 3 <BLANKLINE> >>> cm.print_normalized_matrix(one_vs_all=True,class_name=200) Predict 200 ~ Actual 200 0.375 0.625 ~ 0.25 0.75 <BLANKLINE> >>> kappa_analysis_koch(-0.1) 'Poor' >>> kappa_analysis_koch(0) 'Slight' >>> kappa_analysis_koch(0.2) 'Fair' >>> kappa_analysis_koch(0.4) 'Moderate' >>> kappa_analysis_koch(0.6) 'Substantial' >>> kappa_analysis_koch(0.8) 'Almost Perfect' >>> kappa_analysis_koch(1.2) 'None' >>> kappa_analysis_fleiss(0.4) 'Intermediate to Good' >>> kappa_analysis_fleiss(0.75) 'Excellent' >>> kappa_analysis_fleiss(1.2) 'Excellent' >>> kappa_analysis_altman(-0.2) 'Poor' >>> kappa_analysis_altman(0.2) 'Fair' >>> kappa_analysis_altman(0.4) 'Moderate' >>> kappa_analysis_altman(0.6) 'Good' >>> kappa_analysis_altman(0.8) 'Very Good' >>> kappa_analysis_altman(1.2) 'None' >>> kappa_analysis_fleiss(0.2) 'Poor' >>> kappa_analysis_cicchetti(0.3) 'Poor' >>> kappa_analysis_cicchetti(0.5) 'Fair' >>> kappa_analysis_cicchetti(0.65) 'Good' >>> kappa_analysis_cicchetti(0.8) 'Excellent' >>> PLR_analysis(1) 'Negligible' >>> PLR_analysis(3) 'Poor' >>> PLR_analysis(7) 'Fair' >>> PLR_analysis(11) 'Good' >>> DP_analysis(0.2) 'Poor' >>> DP_analysis(1.5) 'Limited' >>> DP_analysis(2.5) 'Fair' >>> DP_analysis(10) 'Good' >>> AUC_analysis(0.5) 'Poor' >>> AUC_analysis(0.65) 'Fair' >>> AUC_analysis(0.75) 'Good' >>> AUC_analysis(0.86) 'Very Good' >>> AUC_analysis(0.97) 'Excellent' >>> AUC_analysis(1.0) 'Excellent' >>> PC_PI_calc(1,1,1) 'None' >>> PC_PI_calc({1:12},{1:6},{1:45}) 0.04000000000000001 >>> PC_AC1_calc(1,1,1) 'None' >>> PC_AC1_calc({1:123,2:2},{1:120,2:5},{1:125,2:125}) 0.05443200000000002 >>> y_act=[0,0,0,0,0,0,0,0,0,0,0,0,1,1,1,1,1,1,1,1,1,2,2,2,2,2,2] >>> y_pre=[0,0,0,0,0,0,0,0,0,1,1,1,0,0,0,1,1,1,1,1,2,0,1,2,2,2,2] >>> cm2=ConfusionMatrix(y_act,y_pre) >>> chi_squared=chi_square_calc(cm2.classes,cm2.table,cm2.TOP,cm2.P,cm2.POP) >>> chi_squared 15.525641025641026 >>> population = list(cm2.POP.values())[0] >>> phi_squared=phi_square_calc(chi_squared,population) >>> phi_squared 0.5750237416904084 >>> V=cramers_V_calc(phi_squared,cm2.classes) >>> V 0.5362013342441477 >>> DF=DF_calc(cm2.classes) >>> DF 4 >>> SE=se_calc(cm2.Overall_ACC,population) >>> SE 0.09072184232530289 >>> CI=CI_calc(cm2.Overall_ACC,SE) >>> CI (0.48885185570907297, 0.8444814776242603) >>> response_entropy=entropy_calc(cm2.TOP,cm2.POP) >>> response_entropy 1.486565953154142 >>> reference_entropy=entropy_calc(cm2.P,cm2.POP) >>> reference_entropy 1.5304930567574824 >>> cross_entropy = cross_entropy_calc(cm2.TOP,cm2.P,cm2.POP) >>> cross_entropy 1.5376219392005763 >>> join_entropy = joint_entropy_calc(cm2.classes,cm2.table,cm2.POP) >>> join_entropy 2.619748965432189 >>> conditional_entropy = conditional_entropy_calc(cm2.classes,cm2.table,cm2.P,cm2.POP) >>> conditional_entropy 1.089255908674706 >>> kl_divergence=kl_divergence_calc(cm2.P,cm2.TOP,cm2.POP) >>> kl_divergence 0.007128882443093773 >>> lambda_B=lambda_B_calc(cm2.classes,cm2.table,cm2.TOP,population) >>> lambda_B 0.35714285714285715 >>> lambda_A=lambda_A_calc(cm2.classes,cm2.table,cm2.P,population) >>> lambda_A 0.4 >>> IS_calc(13,0,0,38) 1.5474877953024933 >>> kappa_no_prevalence_calc(cm2.Overall_ACC) 0.33333333333333326 >>> reliability_calc(cm2.Overall_RACC,cm2.Overall_ACC) 0.4740259740259741 >>> mutual_information_calc(cm2.ResponseEntropy,cm2.ConditionalEntropy) 0.39731004447943596 >>> cm3=ConfusionMatrix(matrix=cm2.table) >>> cm3 pycm.ConfusionMatrix(classes: [0, 1, 2]) >>> cm3.CI (0.48885185570907297, 0.8444814776242603) >>> cm3.Chi_Squared 15.525641025641026 >>> cm3.Phi_Squared 0.5750237416904084 >>> cm3.V 0.5362013342441477 >>> cm3.DF 4 >>> cm3.ResponseEntropy 1.486565953154142 >>> cm3.ReferenceEntropy 1.5304930567574824 >>> cm3.CrossEntropy 1.5376219392005763 >>> cm3.JointEntropy 2.619748965432189 >>> cm3.ConditionalEntropy 1.089255908674706 >>> cm3.KL 0.007128882443093773 >>> cm3.LambdaA 0.4 >>> cm3.LambdaB 0.35714285714285715 >>> cm3=ConfusionMatrix(matrix={}) Traceback (most recent call last): ... pycm.pycm_obj.pycmMatrixError: Input confusion matrix format error >>> cm_4=ConfusionMatrix(matrix={1:{1:2,"1":2},"1":{1:2,"1":3}}) Traceback (most recent call last): ... pycm.pycm_obj.pycmMatrixError: Type of the input matrix classes is assumed be the same >>> cm_5=ConfusionMatrix(matrix={1:{1:2}}) Traceback (most recent call last): ... pycm.pycm_obj.pycmVectorError: Number of the classes is lower than 2 >>> save_stat=cm.save_html("test",address=False) >>> save_stat=={'Status': True, 'Message': None} True >>> save_stat=cm.save_html("test_filtered",address=False,overall_param=["Kappa","Scott PI"],class_param=["TPR","TNR","ACC","AUC"]) >>> save_stat=={'Status': True, 'Message': None} True >>> save_stat=cm.save_html("test_filtered2",address=False,overall_param=["Kappa","Scott PI"],class_param=["TPR","TNR","ACC","AUC"],class_name=[100]) >>> save_stat=={'Status': True, 'Message': None} True >>> save_stat=cm.save_html("test_filtered3",address=False,overall_param=["Kappa","Scott PI"],class_param=["TPR","TNR","ACC","AUC"],class_name=[]) >>> save_stat=={'Status': True, 'Message': None} True >>> save_stat=cm.save_html("test_filtered4",address=False,overall_param=["Kappa","Scott PI"],class_param=[],class_name=[100]) >>> save_stat=={'Status': True, 'Message': None} True >>> save_stat=cm.save_html("test_filtered5",address=False,overall_param=[],class_param=["TPR","TNR","ACC","AUC"],class_name=[100]) >>> save_stat=={'Status': True, 'Message': None} True >>> save_stat=cm.save_html("test_colored",address=False,color=(130,100,200)) >>> save_stat=={'Status': True, 'Message': None} True >>> save_stat=cm.save_csv("test",address=False) >>> save_stat=={'Status': True, 'Message': None} True >>> save_stat=cm.save_csv("test_filtered",address=False,class_param=["TPR","TNR","ACC","AUC"]) >>> save_stat=={'Status': True, 'Message': None} True >>> save_stat=cm.save_csv("test_filtered2",address=False,class_param=["TPR","TNR","ACC","AUC"],class_name=[100]) >>> save_stat=={'Status': True, 'Message': None} True >>> save_stat=cm.save_csv("test_filtered3",address=False,class_param=["TPR","TNR","ACC","AUC"],class_name=[]) >>> save_stat=={'Status': True, 'Message': None} True >>> save_stat=cm.save_csv("test_filtered4",address=False,class_param=[],class_name=[100]) >>> save_stat=={'Status': True, 'Message': None} True >>> save_stat=cm.save_html("/asdasd,qweqwe.eo/",address=True) >>> save_stat=={'Status': False, 'Message': "[Errno 2] No such file or directory: '/asdasd,qweqwe.eo/.html'"} True >>> save_stat=cm.save_csv("/asdasd,qweqwe.eo/",address=True) >>> save_stat=={'Status': False, 'Message': "[Errno 2] No such file or directory: '/asdasd,qweqwe.eo/.csv'"} True >>> def activation(i): ... if i<0.7: ... return 1 ... else: ... return 0 >>> cm_6 = ConfusionMatrix([0,0,1,0],[0.87,0.34,0.9,0.12],threshold=activation) >>> cm_6.print_matrix() Predict 0 1 Actual 0 1 2 1 1 0 >>> save_obj=cm.save_obj("test",address=False) >>> save_obj=={'Status': True, 'Message': None} True >>> cm_file=ConfusionMatrix(file=open("test.obj","r")) >>> print(cm_file) Predict 100 200 500 600 Actual 100 0 0 0 0 <BLANKLINE> 200 9 6 1 0 <BLANKLINE> 500 1 1 1 0 <BLANKLINE> 600 1 0 0 0 <BLANKLINE> <BLANKLINE> <BLANKLINE> <BLANKLINE> <BLANKLINE> Overall Statistics : <BLANKLINE> 95% CI (0.14096,0.55904) AUNP None AUNU None Bennett S 0.13333 CBA 0.17708 Chi-Squared None Chi-Squared DF 9 Conditional Entropy 1.23579 Cramer V None Cross Entropy 1.70995 Gwet AC1 0.19505 Hamming Loss 0.65 Joint Entropy 2.11997 KL Divergence None Kappa 0.07801 Kappa 95% CI (-0.2185,0.37453) Kappa No Prevalence -0.3 Kappa Standard Error 0.15128 Kappa Unbiased -0.12554 Lambda A 0.0 Lambda B 0.0 Mutual Information 0.10088 NIR 0.8 Overall ACC 0.35 Overall CEN 0.3648 Overall J (0.60294,0.15074) Overall MCC 0.12642 Overall MCEN 0.37463 Overall RACC 0.295 Overall RACCU 0.4225 P-Value 1.0 PPV Macro None PPV Micro 0.35 Phi-Squared None RCI 0.11409 RR 5.0 Reference Entropy 0.88418 Response Entropy 1.33667 SOA1(Landis & Koch) Slight SOA2(Fleiss) Poor SOA3(Altman) Poor SOA4(Cicchetti) Poor Scott PI -0.12554 Standard Error 0.10665 TPR Macro None TPR Micro 0.35 Zero-one Loss 13 <BLANKLINE> Class Statistics : <BLANKLINE> Classes 100 200 500 600 ACC(Accuracy) 0.45 0.45 0.85 0.95 AUC(Area under the roc curve) None 0.5625 0.63725 0.5 AUCI(Auc value interpretation) None Poor Fair Poor BM(Informedness or bookmaker informedness) None 0.125 0.27451 0.0 CEN(Confusion entropy) 0.33496 0.35708 0.53895 0.0 DOR(Diagnostic odds ratio) None 1.8 8.0 None DP(Discriminant power) None 0.14074 0.4979 None DPI(Discriminant power interpretation) None Poor Poor None ERR(Error rate) 0.55 0.55 0.15 0.05 F0.5(F0.5 score) 0.0 0.68182 0.45455 0.0 F1(F1 score - harmonic mean of precision and sensitivity) 0.0 0.52174 0.4 0.0 F2(F2 score) 0.0 0.42254 0.35714 0.0 FDR(False discovery rate) 1.0 0.14286 0.5 None FN(False negative/miss/type 2 error) 0 10 2 1 FNR(Miss rate or false negative rate) None 0.625 0.66667 1.0 FOR(False omission rate) 0.0 0.76923 0.11111 0.05 FP(False positive/type 1 error/false alarm) 11 1 1 0 FPR(Fall-out or false positive rate) 0.55 0.25 0.05882 0.0 G(G-measure geometric mean of precision and sensitivity) None 0.56695 0.40825 None GI(Gini index) None 0.125 0.27451 0.0 IS(Information score) None 0.09954 1.73697 None J(Jaccard index) 0.0 0.35294 0.25 0.0 LS(Lift score) None 1.07143 3.33333 None MCC(Matthews correlation coefficient) None 0.10483 0.32673 None MCEN(Modified confusion entropy) 0.33496 0.37394 0.58028 0.0 MK(Markedness) 0.0 0.08791 0.38889 None N(Condition negative) 20 4 17 19 NLR(Negative likelihood ratio) None 0.83333 0.70833 1.0 NPV(Negative predictive value) 1.0 0.23077 0.88889 0.95 P(Condition positive or support) 0 16 3 1 PLR(Positive likelihood ratio) None 1.5 5.66667 None PLRI(Positive likelihood ratio interpretation) None Poor Fair None POP(Population) 20 20 20 20 PPV(Precision or positive predictive value) 0.0 0.85714 0.5 None PRE(Prevalence) 0.0 0.8 0.15 0.05 RACC(Random accuracy) 0.0 0.28 0.015 0.0 RACCU(Random accuracy unbiased) 0.07563 0.33062 0.01562 0.00063 TN(True negative/correct rejection) 9 3 16 19 TNR(Specificity or true negative rate) 0.45 0.75 0.94118 1.0 TON(Test outcome negative) 9 13 18 20 TOP(Test outcome positive) 11 7 2 0 TP(True positive/hit) 0 6 1 0 TPR(Sensitivity, recall, hit rate, or true positive rate) None 0.375 0.33333 0.0 Y(Youden index) None 0.125 0.27451 0.0 dInd(Distance index) None 0.67315 0.66926 1.0 sInd(Similarity index) None 0.52401 0.52676 0.29289 <BLANKLINE> >>> save_obj=cm_6.save_obj("test2",address=False) >>> save_obj=={'Status': True, 'Message': None} True >>> cm_file_2=ConfusionMatrix(file=open("test2.obj","r")) >>> cm_file_2.print_matrix() Predict 0 1 Actual 0 1 2 1 1 0 >>> cm = ConfusionMatrix(matrix={"Class1":{"Class1":9,"Class2":3,"Class3":0},"Class2":{"Class1":3,"Class2":5,"Class3":1},"Class3":{"Class1":1,"Class2":1,"Class3":4}}) >>> print(cm) Predict Class1 Class2 Class3 Actual Class1 9 3 0 <BLANKLINE> Class2 3 5 1 <BLANKLINE> Class3 1 1 4 <BLANKLINE> <BLANKLINE> <BLANKLINE> <BLANKLINE> <BLANKLINE> Overall Statistics : <BLANKLINE> 95% CI (0.48885,0.84448) AUNP 0.73175 AUNU 0.73929 Bennett S 0.5 CBA 0.63818 Chi-Squared 15.52564 Chi-Squared DF 4 Conditional Entropy 1.08926 Cramer V 0.5362 Cross Entropy 1.53762 Gwet AC1 0.51229 Hamming Loss 0.33333 Joint Entropy 2.61975 KL Divergence 0.00713 Kappa 0.47403 Kappa 95% CI (0.19345,0.7546) Kappa No Prevalence 0.33333 Kappa Standard Error 0.14315 Kappa Unbiased 0.47346 Lambda A 0.4 Lambda B 0.35714 Mutual Information 0.39731 NIR 0.44444 Overall ACC 0.66667 Overall CEN 0.52986 Overall J (1.51854,0.50618) Overall MCC 0.47511 Overall MCEN 0.65286 Overall RACC 0.36626 Overall RACCU 0.36694 P-Value 0.01667 PPV Macro 0.68262 PPV Micro 0.66667 Phi-Squared 0.57502 RCI 0.2596 RR 9.0 Reference Entropy 1.53049 Response Entropy 1.48657 SOA1(Landis & Koch) Moderate SOA2(Fleiss) Intermediate to Good SOA3(Altman) Moderate SOA4(Cicchetti) Fair Scott PI 0.47346 Standard Error 0.09072 TPR Macro 0.65741 TPR Micro 0.66667 Zero-one Loss 9 <BLANKLINE> Class Statistics : <BLANKLINE> Classes Class1 Class2 Class3 ACC(Accuracy) 0.74074 0.7037 0.88889 AUC(Area under the roc curve) 0.74167 0.66667 0.80952 AUCI(Auc value interpretation) Good Fair Very Good BM(Informedness or bookmaker informedness) 0.48333 0.33333 0.61905 CEN(Confusion entropy) 0.45994 0.66249 0.47174 DOR(Diagnostic odds ratio) 8.25 4.375 40.0 DP(Discriminant power) 0.50527 0.35339 0.88326 DPI(Discriminant power interpretation) Poor Poor Poor ERR(Error rate) 0.25926 0.2963 0.11111 F0.5(F0.5 score) 0.70312 0.55556 0.76923 F1(F1 score - harmonic mean of precision and sensitivity) 0.72 0.55556 0.72727 F2(F2 score) 0.7377 0.55556 0.68966 FDR(False discovery rate) 0.30769 0.44444 0.2 FN(False negative/miss/type 2 error) 3 4 2 FNR(Miss rate or false negative rate) 0.25 0.44444 0.33333 FOR(False omission rate) 0.21429 0.22222 0.09091 FP(False positive/type 1 error/false alarm) 4 4 1 FPR(Fall-out or false positive rate) 0.26667 0.22222 0.04762 G(G-measure geometric mean of precision and sensitivity) 0.72058 0.55556 0.7303 GI(Gini index) 0.48333 0.33333 0.61905 IS(Information score) 0.63941 0.73697 1.848 J(Jaccard index) 0.5625 0.38462 0.57143 LS(Lift score) 1.55769 1.66667 3.6 MCC(Matthews correlation coefficient) 0.48067 0.33333 0.66254 MCEN(Modified confusion entropy) 0.57782 0.77284 0.60158 MK(Markedness) 0.47802 0.33333 0.70909 N(Condition negative) 15 18 21 NLR(Negative likelihood ratio) 0.34091 0.57143 0.35 NPV(Negative predictive value) 0.78571 0.77778 0.90909 P(Condition positive or support) 12 9 6 PLR(Positive likelihood ratio) 2.8125 2.5 14.0 PLRI(Positive likelihood ratio interpretation) Poor Poor Good POP(Population) 27 27 27 PPV(Precision or positive predictive value) 0.69231 0.55556 0.8 PRE(Prevalence) 0.44444 0.33333 0.22222 RACC(Random accuracy) 0.21399 0.11111 0.04115 RACCU(Random accuracy unbiased) 0.21433 0.11111 0.0415 TN(True negative/correct rejection) 11 14 20 TNR(Specificity or true negative rate) 0.73333 0.77778 0.95238 TON(Test outcome negative) 14 18 22 TOP(Test outcome positive) 13 9 5 TP(True positive/hit) 9 5 4 TPR(Sensitivity, recall, hit rate, or true positive rate) 0.75 0.55556 0.66667 Y(Youden index) 0.48333 0.33333 0.61905 dInd(Distance index) 0.36553 0.4969 0.33672 sInd(Similarity index) 0.74153 0.64864 0.7619 <BLANKLINE> >>> cm = ConfusionMatrix(matrix={"Class1":{"Class1":9,"Class2":3,"Class3":1},"Class2":{"Class1":3,"Class2":5,"Class3":1},"Class3":{"Class1":0,"Class2":1,"Class3":4}},transpose=True) >>> print(cm) Predict Class1 Class2 Class3 Actual Class1 9 3 0 <BLANKLINE> Class2 3 5 1 <BLANKLINE> Class3 1 1 4 <BLANKLINE> <BLANKLINE> <BLANKLINE> <BLANKLINE> <BLANKLINE> Overall Statistics : <BLANKLINE> 95% CI (0.48885,0.84448) AUNP 0.73175 AUNU 0.73929 Bennett S 0.5 CBA 0.63818 Chi-Squared 15.52564 Chi-Squared DF 4 Conditional Entropy 1.08926 Cramer V 0.5362 Cross Entropy 1.53762 Gwet AC1 0.51229 Hamming Loss 0.33333 Joint Entropy 2.61975 KL Divergence 0.00713 Kappa 0.47403 Kappa 95% CI (0.19345,0.7546) Kappa No Prevalence 0.33333 Kappa Standard Error 0.14315 Kappa Unbiased 0.47346 Lambda A 0.4 Lambda B 0.35714 Mutual Information 0.39731 NIR 0.44444 Overall ACC 0.66667 Overall CEN 0.52986 Overall J (1.51854,0.50618) Overall MCC 0.47511 Overall MCEN 0.65286 Overall RACC 0.36626 Overall RACCU 0.36694 P-Value 0.01667 PPV Macro 0.68262 PPV Micro 0.66667 Phi-Squared 0.57502 RCI 0.2596 RR 9.0 Reference Entropy 1.53049 Response Entropy 1.48657 SOA1(Landis & Koch) Moderate SOA2(Fleiss) Intermediate to Good SOA3(Altman) Moderate SOA4(Cicchetti) Fair Scott PI 0.47346 Standard Error 0.09072 TPR Macro 0.65741 TPR Micro 0.66667 Zero-one Loss 9 <BLANKLINE> Class Statistics : <BLANKLINE> Classes Class1 Class2 Class3 ACC(Accuracy) 0.74074 0.7037 0.88889 AUC(Area under the roc curve) 0.74167 0.66667 0.80952 AUCI(Auc value interpretation) Good Fair Very Good BM(Informedness or bookmaker informedness) 0.48333 0.33333 0.61905 CEN(Confusion entropy) 0.45994 0.66249 0.47174 DOR(Diagnostic odds ratio) 8.25 4.375 40.0 DP(Discriminant power) 0.50527 0.35339 0.88326 DPI(Discriminant power interpretation) Poor Poor Poor ERR(Error rate) 0.25926 0.2963 0.11111 F0.5(F0.5 score) 0.70312 0.55556 0.76923 F1(F1 score - harmonic mean of precision and sensitivity) 0.72 0.55556 0.72727 F2(F2 score) 0.7377 0.55556 0.68966 FDR(False discovery rate) 0.30769 0.44444 0.2 FN(False negative/miss/type 2 error) 3 4 2 FNR(Miss rate or false negative rate) 0.25 0.44444 0.33333 FOR(False omission rate) 0.21429 0.22222 0.09091 FP(False positive/type 1 error/false alarm) 4 4 1 FPR(Fall-out or false positive rate) 0.26667 0.22222 0.04762 G(G-measure geometric mean of precision and sensitivity) 0.72058 0.55556 0.7303 GI(Gini index) 0.48333 0.33333 0.61905 IS(Information score) 0.63941 0.73697 1.848 J(Jaccard index) 0.5625 0.38462 0.57143 LS(Lift score) 1.55769 1.66667 3.6 MCC(Matthews correlation coefficient) 0.48067 0.33333 0.66254 MCEN(Modified confusion entropy) 0.57782 0.77284 0.60158 MK(Markedness) 0.47802 0.33333 0.70909 N(Condition negative) 15 18 21 NLR(Negative likelihood ratio) 0.34091 0.57143 0.35 NPV(Negative predictive value) 0.78571 0.77778 0.90909 P(Condition positive or support) 12 9 6 PLR(Positive likelihood ratio) 2.8125 2.5 14.0 PLRI(Positive likelihood ratio interpretation) Poor Poor Good POP(Population) 27 27 27 PPV(Precision or positive predictive value) 0.69231 0.55556 0.8 PRE(Prevalence) 0.44444 0.33333 0.22222 RACC(Random accuracy) 0.21399 0.11111 0.04115 RACCU(Random accuracy unbiased) 0.21433 0.11111 0.0415 TN(True negative/correct rejection) 11 14 20 TNR(Specificity or true negative rate) 0.73333 0.77778 0.95238 TON(Test outcome negative) 14 18 22 TOP(Test outcome positive) 13 9 5 TP(True positive/hit) 9 5 4 TPR(Sensitivity, recall, hit rate, or true positive rate) 0.75 0.55556 0.66667 Y(Youden index) 0.48333 0.33333 0.61905 dInd(Distance index) 0.36553 0.4969 0.33672 sInd(Similarity index) 0.74153 0.64864 0.7619 <BLANKLINE> >>> online_help(param=None) Please choose one parameter : <BLANKLINE> Example : online_help("J") or online_help(2) <BLANKLINE> 1-95% CI 2-ACC 3-AUC 4-AUCI 5-AUNP 6-AUNU 7-BM 8-Bennett S 9-CBA 10-CEN 11-Chi-Squared 12-Chi-Squared DF 13-Conditional Entropy 14-Cramer V 15-Cross Entropy 16-DOR 17-DP 18-DPI 19-ERR 20-F0.5 21-F1 22-F2 23-FDR 24-FN 25-FNR 26-FOR 27-FP 28-FPR 29-G 30-GI 31-Gwet AC1 32-Hamming Loss 33-IS 34-J 35-Joint Entropy 36-KL Divergence 37-Kappa 38-Kappa 95% CI 39-Kappa No Prevalence 40-Kappa Standard Error 41-Kappa Unbiased 42-LS 43-Lambda A 44-Lambda B 45-MCC 46-MCEN 47-MK 48-Mutual Information 49-N 50-NIR 51-NLR 52-NPV 53-Overall ACC 54-Overall CEN 55-Overall J 56-Overall MCC 57-Overall MCEN 58-Overall RACC 59-Overall RACCU 60-P 61-P-Value 62-PLR 63-PLRI 64-POP 65-PPV 66-PPV Macro 67-PPV Micro 68-PRE 69-Phi-Squared 70-RACC 71-RACCU 72-RCI 73-RR 74-Reference Entropy 75-Response Entropy 76-SOA1(Landis & Koch) 77-SOA2(Fleiss) 78-SOA3(Altman) 79-SOA4(Cicchetti) 80-Scott PI 81-Standard Error 82-TN 83-TNR 84-TON 85-TOP 86-TP 87-TPR 88-TPR Macro 89-TPR Micro 90-Y 91-Zero-one Loss 92-dInd 93-sInd >>> online_help("J") ... >>> online_help(4) ... >>> y_actu = [2, 0, 2, 2, 0, 1, 1, 2, 2, 0, 1, 2] >>> y_pred = [0, 0, 2, 1, 0, 2, 1, 0, 2, 0, 2, 2] >>> cm = ConfusionMatrix(y_actu, y_pred, sample_weight=[2, 2, 2, 2, 3, 1, 1, 2, 2, 1, 1, 2]) >>> print(cm) Predict 0 1 2 Actual 0 6 0 0 <BLANKLINE> 1 0 1 2 <BLANKLINE> 2 4 2 6 <BLANKLINE> <BLANKLINE> <BLANKLINE> <BLANKLINE> <BLANKLINE> Overall Statistics : <BLANKLINE> 95% CI (0.41134,0.82675) AUNP 0.7 AUNU 0.70556 Bennett S 0.42857 CBA 0.47778 Chi-Squared 10.44167 Chi-Squared DF 4 Conditional Entropy 0.96498 Cramer V 0.49861 Cross Entropy 1.50249 Gwet AC1 0.45277 Hamming Loss 0.38095 Joint Entropy 2.34377 KL Divergence 0.1237 Kappa 0.3913 Kappa 95% CI (0.05943,0.72318) Kappa No Prevalence 0.2381 Kappa Standard Error 0.16932 Kappa Unbiased 0.37313 Lambda A 0.22222 Lambda B 0.36364 Mutual Information 0.47618 NIR 0.57143 Overall ACC 0.61905 Overall CEN 0.43947 Overall J (1.22857,0.40952) Overall MCC 0.41558 Overall MCEN 0.50059 Overall RACC 0.37415 Overall RACCU 0.39229 P-Value 0.41709 PPV Macro 0.56111 PPV Micro 0.61905 Phi-Squared 0.49722 RCI 0.34536 RR 7.0 Reference Entropy 1.37878 Response Entropy 1.44117 SOA1(Landis & Koch) Fair SOA2(Fleiss) Poor SOA3(Altman) Fair SOA4(Cicchetti) Poor Scott PI 0.37313 Standard Error 0.10597 TPR Macro 0.61111 TPR Micro 0.61905 Zero-one Loss 8 <BLANKLINE> Class Statistics : <BLANKLINE> Classes 0 1 2 ACC(Accuracy) 0.80952 0.80952 0.61905 AUC(Area under the roc curve) 0.86667 0.61111 0.63889 AUCI(Auc value interpretation) Very Good Fair Fair BM(Informedness or bookmaker informedness) 0.73333 0.22222 0.27778 CEN(Confusion entropy) 0.25 0.52832 0.56439 DOR(Diagnostic odds ratio) None 4.0 3.5 DP(Discriminant power) None 0.33193 0.29996 DPI(Discriminant power interpretation) None Poor Poor ERR(Error rate) 0.19048 0.19048 0.38095 F0.5(F0.5 score) 0.65217 0.33333 0.68182 F1(F1 score - harmonic mean of precision and sensitivity) 0.75 0.33333 0.6 F2(F2 score) 0.88235 0.33333 0.53571 FDR(False discovery rate) 0.4 0.66667 0.25 FN(False negative/miss/type 2 error) 0 2 6 FNR(Miss rate or false negative rate) 0.0 0.66667 0.5 FOR(False omission rate) 0.0 0.11111 0.46154 FP(False positive/type 1 error/false alarm) 4 2 2 FPR(Fall-out or false positive rate) 0.26667 0.11111 0.22222 G(G-measure geometric mean of precision and sensitivity) 0.7746 0.33333 0.61237 GI(Gini index) 0.73333 0.22222 0.27778 IS(Information score) 1.07039 1.22239 0.39232 J(Jaccard index) 0.6 0.2 0.42857 LS(Lift score) 2.1 2.33333 1.3125 MCC(Matthews correlation coefficient) 0.66332 0.22222 0.28307 MCEN(Modified confusion entropy) 0.26439 0.52877 0.65924 MK(Markedness) 0.6 0.22222 0.28846 N(Condition negative) 15 18 9 NLR(Negative likelihood ratio) 0.0 0.75 0.64286 NPV(Negative predictive value) 1.0 0.88889 0.53846 P(Condition positive or support) 6 3 12 PLR(Positive likelihood ratio) 3.75 3.0 2.25 PLRI(Positive likelihood ratio interpretation) Poor Poor Poor POP(Population) 21 21 21 PPV(Precision or positive predictive value) 0.6 0.33333 0.75 PRE(Prevalence) 0.28571 0.14286 0.57143 RACC(Random accuracy) 0.13605 0.02041 0.21769 RACCU(Random accuracy unbiased) 0.14512 0.02041 0.22676 TN(True negative/correct rejection) 11 16 7 TNR(Specificity or true negative rate) 0.73333 0.88889 0.77778 TON(Test outcome negative) 11 18 13 TOP(Test outcome positive) 10 3 8 TP(True positive/hit) 6 1 6 TPR(Sensitivity, recall, hit rate, or true positive rate) 1.0 0.33333 0.5 Y(Youden index) 0.73333 0.22222 0.27778 dInd(Distance index) 0.26667 0.67586 0.54716 sInd(Similarity index) 0.81144 0.52209 0.6131 <BLANKLINE> >>> save_obj=cm.save_obj("test3",address=False) >>> save_obj=={'Status': True, 'Message': None} True >>> cm_file_3=ConfusionMatrix(file=open("test3.obj","r")) >>> cm_file_3.print_matrix() Predict 0 1 2 Actual 0 6 0 0 1 0 1 2 2 4 2 6 <BLANKLINE> >>> cm_file_3.stat() Overall Statistics : <BLANKLINE> 95% CI (0.41134,0.82675) AUNP 0.7 AUNU 0.70556 Bennett S 0.42857 CBA 0.47778 Chi-Squared 10.44167 Chi-Squared DF 4 Conditional Entropy 0.96498 Cramer V 0.49861 Cross Entropy 1.50249 Gwet AC1 0.45277 Hamming Loss 0.38095 Joint Entropy 2.34377 KL Divergence 0.1237 Kappa 0.3913 Kappa 95% CI (0.05943,0.72318) Kappa No Prevalence 0.2381 Kappa Standard Error 0.16932 Kappa Unbiased 0.37313 Lambda A 0.22222 Lambda B 0.36364 Mutual Information 0.47618 NIR 0.57143 Overall ACC 0.61905 Overall CEN 0.43947 Overall J (1.22857,0.40952) Overall MCC 0.41558 Overall MCEN 0.50059 Overall RACC 0.37415 Overall RACCU 0.39229 P-Value 0.41709 PPV Macro 0.56111 PPV Micro 0.61905 Phi-Squared 0.49722 RCI 0.34536 RR 7.0 Reference Entropy 1.37878 Response Entropy 1.44117 SOA1(Landis & Koch) Fair SOA2(Fleiss) Poor SOA3(Altman) Fair SOA4(Cicchetti) Poor Scott PI 0.37313 Standard Error 0.10597 TPR Macro 0.61111 TPR Micro 0.61905 Zero-one Loss 8 <BLANKLINE> Class Statistics : <BLANKLINE> Classes 0 1 2 ACC(Accuracy) 0.80952 0.80952 0.61905 AUC(Area under the roc curve) 0.86667 0.61111 0.63889 AUCI(Auc value interpretation) Very Good Fair Fair BM(Informedness or bookmaker informedness) 0.73333 0.22222 0.27778 CEN(Confusion entropy) 0.25 0.52832 0.56439 DOR(Diagnostic odds ratio) None 4.0 3.5 DP(Discriminant power) None 0.33193 0.29996 DPI(Discriminant power interpretation) None Poor Poor ERR(Error rate) 0.19048 0.19048 0.38095 F0.5(F0.5 score) 0.65217 0.33333 0.68182 F1(F1 score - harmonic mean of precision and sensitivity) 0.75 0.33333 0.6 F2(F2 score) 0.88235 0.33333 0.53571 FDR(False discovery rate) 0.4 0.66667 0.25 FN(False negative/miss/type 2 error) 0 2 6 FNR(Miss rate or false negative rate) 0.0 0.66667 0.5 FOR(False omission rate) 0.0 0.11111 0.46154 FP(False positive/type 1 error/false alarm) 4 2 2 FPR(Fall-out or false positive rate) 0.26667 0.11111 0.22222 G(G-measure geometric mean of precision and sensitivity) 0.7746 0.33333 0.61237 GI(Gini index) 0.73333 0.22222 0.27778 IS(Information score) 1.07039 1.22239 0.39232 J(Jaccard index) 0.6 0.2 0.42857 LS(Lift score) 2.1 2.33333 1.3125 MCC(Matthews correlation coefficient) 0.66332 0.22222 0.28307 MCEN(Modified confusion entropy) 0.26439 0.52877 0.65924 MK(Markedness) 0.6 0.22222 0.28846 N(Condition negative) 15 18 9 NLR(Negative likelihood ratio) 0.0 0.75 0.64286 NPV(Negative predictive value) 1.0 0.88889 0.53846 P(Condition positive or support) 6 3 12 PLR(Positive likelihood ratio) 3.75 3.0 2.25 PLRI(Positive likelihood ratio interpretation) Poor Poor Poor POP(Population) 21 21 21 PPV(Precision or positive predictive value) 0.6 0.33333 0.75 PRE(Prevalence) 0.28571 0.14286 0.57143 RACC(Random accuracy) 0.13605 0.02041 0.21769 RACCU(Random accuracy unbiased) 0.14512 0.02041 0.22676 TN(True negative/correct rejection) 11 16 7 TNR(Specificity or true negative rate) 0.73333 0.88889 0.77778 TON(Test outcome negative) 11 18 13 TOP(Test outcome positive) 10 3 8 TP(True positive/hit) 6 1 6 TPR(Sensitivity, recall, hit rate, or true positive rate) 1.0 0.33333 0.5 Y(Youden index) 0.73333 0.22222 0.27778 dInd(Distance index) 0.26667 0.67586 0.54716 sInd(Similarity index) 0.81144 0.52209 0.6131 >>> NIR_calc({'Class2': 804, 'Class1': 196},1000) # Verified Case 0.804 >>> cm = ConfusionMatrix(matrix={0:{0:3,1:1},1:{0:4,1:2}}) # Verified Case >>> cm.LS[1] 1.1111111111111112 >>> cm.LS[0] 1.0714285714285714 >>> cm = ConfusionMatrix(matrix={"Class1":{"Class1":183,"Class2":13},"Class2":{"Class1":141,"Class2":663}}) # Verified Case >>> cm.PValue 0.000342386296143693 >>> cm = ConfusionMatrix(matrix={"Class1":{"Class1":4,"Class2":2},"Class2":{"Class1":2,"Class2":4}}) # Verified Case >>> cm.Overall_CEN 0.861654166907052 >>> cm.Overall_MCEN 0.6666666666666666 >>> cm.IS["Class1"] 0.4150374992788437 >>> cm.IS["Class2"] 0.4150374992788437 >>> cm = ConfusionMatrix(matrix={1:{1:5,2:0,3:0},2:{1:0,2:10,3:0},3:{1:0,2:300,3:0}}) # Verified Case >>> cm.Overall_CEN 0.022168905807495587 >>> cm.Overall_MCC 0.3012440235352457 >>> cm.CBA 0.3440860215053763 >>> cm = ConfusionMatrix(matrix={1:{1:1,2:3,3:0,4:0},2:{1:9,2:1,3:0,4:0},3:{1:0,2:0,3:100,4:0},4:{1:0,2:0,3:0,4:200}}) # Verified Case >>> cm.RCI 0.9785616782831341 >>> cm = ConfusionMatrix(matrix={1:{1:1,2:0,3:3},2:{1:0,2:100,3:0},3:{1:0,2:0,3:200}}) # Verified Case >>> cm.RCI 0.9264007150415143 >>> cm = ConfusionMatrix(matrix={1:{1:5,2:0,3:0},2:{1:0,2:10,3:0},3:{1:0,2:300,3:0}}) >>> cm.RCI 0.3675708571923818 >>> cm = ConfusionMatrix(matrix={1:{1:12806,2:26332},2:{1:5484,2:299777}},transpose=True) # Verified Case >>> cm.AUC[1] 0.8097090079101759 >>> cm.GI[1] 0.6194180158203517 >>> cm.Overall_ACC 0.9076187793808925 >>> cm.DP[1] 0.7854399677022138 >>> cm.Y[1] 0.6194180158203517 >>> cm.BM[1] 0.6194180158203517 >>> cm = ConfusionMatrix(matrix={1:{1:13182,2:30516},2:{1:5108,2:295593}},transpose=True) # Verified Case >>> cm.AUC[1] 0.8135728157964055 >>> cm.GI[1] 0.627145631592811 >>> cm.Overall_ACC 0.896561836706843 >>> cm.DP[1] 0.770700985610517 >>> cm.Y[1] 0.627145631592811 >>> cm.BM[1] 0.627145631592811 >>> save_obj = cm.save_obj("test4",address=False) >>> save_obj=={'Status': True, 'Message': None} True >>> cm_file=ConfusionMatrix(file=open("test4.obj","r")) >>> cm_file.DP[1] 0.770700985610517 >>> cm_file.Y[1] 0.627145631592811 >>> cm_file.BM[1] 0.627145631592811 >>> cm_file.transpose True >>> json.dump({"Actual-Vector": None, "Digit": 5, "Predict-Vector": None, "Matrix": {"0": {"0": 3, "1": 0, "2": 2}, "1": {"0": 0, "1": 1, "2": 1}, "2": {"0": 0, "1": 2, "2": 3}}, "Transpose": True,"Sample-Weight": None},open("test5.obj","w")) >>> cm_file=ConfusionMatrix(file=open("test5.obj","r")) >>> cm_file.transpose True >>> cm_file.matrix == {"0": {"0": 3, "1": 0, "2": 2}, "1": {"0": 0, "1": 1, "2": 1}, "2": {"0": 0, "1": 2, "2": 3}} True >>> cm = ConfusionMatrix([1,2,3,4],[1,2,3,"4"]) >>> cm pycm.ConfusionMatrix(classes: ['1', '2', '3', '4']) >>> os.remove("test.csv") >>> os.remove("test.obj") >>> os.remove("test.html") >>> os.remove("test_filtered.html") >>> os.remove("test_filtered.csv") >>> os.remove("test_filtered.pycm") >>> os.remove("test_filtered2.html") >>> os.remove("test_filtered3.html") >>> os.remove("test_filtered4.html") >>> os.remove("test_filtered5.html") >>> os.remove("test_colored.html") >>> os.remove("test_filtered2.csv") >>> os.remove("test_filtered3.csv") >>> os.remove("test_filtered4.csv") >>> os.remove("test_filtered2.pycm") >>> os.remove("test_filtered3.pycm") >>> os.remove("test2.obj") >>> os.remove("test3.obj") >>> os.remove("test4.obj") >>> os.remove("test5.obj") >>> os.remove("test.pycm") '''
""" >>> from pycm import * >>> import os >>> import json >>> y_actu = [2, 0, 2, 2, 0, 1, 1, 2, 2, 0, 1, 2] >>> y_pred = [0, 0, 2, 1, 0, 2, 1, 0, 2, 0, 2, 2] >>> cm = ConfusionMatrix(y_actu, y_pred) >>> cm pycm.ConfusionMatrix(classes: [0, 1, 2]) >>> len(cm) 3 >>> print(cm) Predict 0 1 2 Actual 0 3 0 0 <BLANKLINE> 1 0 1 2 <BLANKLINE> 2 2 1 3 <BLANKLINE> <BLANKLINE> <BLANKLINE> <BLANKLINE> <BLANKLINE> Overall Statistics : <BLANKLINE> 95% CI (0.30439,0.86228) AUNP 0.66667 AUNU 0.69444 Bennett S 0.375 CBA 0.47778 Chi-Squared 6.6 Chi-Squared DF 4 Conditional Entropy 0.95915 Cramer V 0.5244 Cross Entropy 1.59352 Gwet AC1 0.38931 Hamming Loss 0.41667 Joint Entropy 2.45915 KL Divergence 0.09352 Kappa 0.35484 Kappa 95% CI (-0.07708,0.78675) Kappa No Prevalence 0.16667 Kappa Standard Error 0.22036 Kappa Unbiased 0.34426 Lambda A 0.16667 Lambda B 0.42857 Mutual Information 0.52421 NIR 0.5 Overall ACC 0.58333 Overall CEN 0.46381 Overall J (1.225,0.40833) Overall MCC 0.36667 Overall MCEN 0.51894 Overall RACC 0.35417 Overall RACCU 0.36458 P-Value 0.38721 PPV Macro 0.56667 PPV Micro 0.58333 Phi-Squared 0.55 RCI 0.34947 RR 4.0 Reference Entropy 1.5 Response Entropy 1.48336 SOA1(Landis & Koch) Fair SOA2(Fleiss) Poor SOA3(Altman) Fair SOA4(Cicchetti) Poor Scott PI 0.34426 Standard Error 0.14232 TPR Macro 0.61111 TPR Micro 0.58333 Zero-one Loss 5 <BLANKLINE> Class Statistics : <BLANKLINE> Classes 0 1 2 ACC(Accuracy) 0.83333 0.75 0.58333 AUC(Area under the roc curve) 0.88889 0.61111 0.58333 AUCI(Auc value interpretation) Very Good Fair Poor BM(Informedness or bookmaker informedness) 0.77778 0.22222 0.16667 CEN(Confusion entropy) 0.25 0.49658 0.60442 DOR(Diagnostic odds ratio) None 4.0 2.0 DP(Discriminant power) None 0.33193 0.16597 DPI(Discriminant power interpretation) None Poor Poor ERR(Error rate) 0.16667 0.25 0.41667 F0.5(F0.5 score) 0.65217 0.45455 0.57692 F1(F1 score - harmonic mean of precision and sensitivity) 0.75 0.4 0.54545 F2(F2 score) 0.88235 0.35714 0.51724 FDR(False discovery rate) 0.4 0.5 0.4 FN(False negative/miss/type 2 error) 0 2 3 FNR(Miss rate or false negative rate) 0.0 0.66667 0.5 FOR(False omission rate) 0.0 0.2 0.42857 FP(False positive/type 1 error/false alarm) 2 1 2 FPR(Fall-out or false positive rate) 0.22222 0.11111 0.33333 G(G-measure geometric mean of precision and sensitivity) 0.7746 0.40825 0.54772 GI(Gini index) 0.77778 0.22222 0.16667 IS(Information score) 1.26303 1.0 0.26303 J(Jaccard index) 0.6 0.25 0.375 LS(Lift score) 2.4 2.0 1.2 MCC(Matthews correlation coefficient) 0.68313 0.2582 0.16903 MCEN(Modified confusion entropy) 0.26439 0.5 0.6875 MK(Markedness) 0.6 0.3 0.17143 N(Condition negative) 9 9 6 NLR(Negative likelihood ratio) 0.0 0.75 0.75 NPV(Negative predictive value) 1.0 0.8 0.57143 P(Condition positive or support) 3 3 6 PLR(Positive likelihood ratio) 4.5 3.0 1.5 PLRI(Positive likelihood ratio interpretation) Poor Poor Poor POP(Population) 12 12 12 PPV(Precision or positive predictive value) 0.6 0.5 0.6 PRE(Prevalence) 0.25 0.25 0.5 RACC(Random accuracy) 0.10417 0.04167 0.20833 RACCU(Random accuracy unbiased) 0.11111 0.0434 0.21007 TN(True negative/correct rejection) 7 8 4 TNR(Specificity or true negative rate) 0.77778 0.88889 0.66667 TON(Test outcome negative) 7 10 7 TOP(Test outcome positive) 5 2 5 TP(True positive/hit) 3 1 3 TPR(Sensitivity, recall, hit rate, or true positive rate) 1.0 0.33333 0.5 Y(Youden index) 0.77778 0.22222 0.16667 dInd(Distance index) 0.22222 0.67586 0.60093 sInd(Similarity index) 0.84287 0.52209 0.57508 <BLANKLINE> >>> cm.relabel({0:"L1",1:"L2",2:"L3"}) >>> print(cm) Predict L1 L2 L3 Actual L1 3 0 0 <BLANKLINE> L2 0 1 2 <BLANKLINE> L3 2 1 3 <BLANKLINE> <BLANKLINE> <BLANKLINE> <BLANKLINE> <BLANKLINE> Overall Statistics : <BLANKLINE> 95% CI (0.30439,0.86228) AUNP 0.66667 AUNU 0.69444 Bennett S 0.375 CBA 0.47778 Chi-Squared 6.6 Chi-Squared DF 4 Conditional Entropy 0.95915 Cramer V 0.5244 Cross Entropy 1.59352 Gwet AC1 0.38931 Hamming Loss 0.41667 Joint Entropy 2.45915 KL Divergence 0.09352 Kappa 0.35484 Kappa 95% CI (-0.07708,0.78675) Kappa No Prevalence 0.16667 Kappa Standard Error 0.22036 Kappa Unbiased 0.34426 Lambda A 0.16667 Lambda B 0.42857 Mutual Information 0.52421 NIR 0.5 Overall ACC 0.58333 Overall CEN 0.46381 Overall J (1.225,0.40833) Overall MCC 0.36667 Overall MCEN 0.51894 Overall RACC 0.35417 Overall RACCU 0.36458 P-Value 0.38721 PPV Macro 0.56667 PPV Micro 0.58333 Phi-Squared 0.55 RCI 0.34947 RR 4.0 Reference Entropy 1.5 Response Entropy 1.48336 SOA1(Landis & Koch) Fair SOA2(Fleiss) Poor SOA3(Altman) Fair SOA4(Cicchetti) Poor Scott PI 0.34426 Standard Error 0.14232 TPR Macro 0.61111 TPR Micro 0.58333 Zero-one Loss 5 <BLANKLINE> Class Statistics : <BLANKLINE> Classes L1 L2 L3 ACC(Accuracy) 0.83333 0.75 0.58333 AUC(Area under the roc curve) 0.88889 0.61111 0.58333 AUCI(Auc value interpretation) Very Good Fair Poor BM(Informedness or bookmaker informedness) 0.77778 0.22222 0.16667 CEN(Confusion entropy) 0.25 0.49658 0.60442 DOR(Diagnostic odds ratio) None 4.0 2.0 DP(Discriminant power) None 0.33193 0.16597 DPI(Discriminant power interpretation) None Poor Poor ERR(Error rate) 0.16667 0.25 0.41667 F0.5(F0.5 score) 0.65217 0.45455 0.57692 F1(F1 score - harmonic mean of precision and sensitivity) 0.75 0.4 0.54545 F2(F2 score) 0.88235 0.35714 0.51724 FDR(False discovery rate) 0.4 0.5 0.4 FN(False negative/miss/type 2 error) 0 2 3 FNR(Miss rate or false negative rate) 0.0 0.66667 0.5 FOR(False omission rate) 0.0 0.2 0.42857 FP(False positive/type 1 error/false alarm) 2 1 2 FPR(Fall-out or false positive rate) 0.22222 0.11111 0.33333 G(G-measure geometric mean of precision and sensitivity) 0.7746 0.40825 0.54772 GI(Gini index) 0.77778 0.22222 0.16667 IS(Information score) 1.26303 1.0 0.26303 J(Jaccard index) 0.6 0.25 0.375 LS(Lift score) 2.4 2.0 1.2 MCC(Matthews correlation coefficient) 0.68313 0.2582 0.16903 MCEN(Modified confusion entropy) 0.26439 0.5 0.6875 MK(Markedness) 0.6 0.3 0.17143 N(Condition negative) 9 9 6 NLR(Negative likelihood ratio) 0.0 0.75 0.75 NPV(Negative predictive value) 1.0 0.8 0.57143 P(Condition positive or support) 3 3 6 PLR(Positive likelihood ratio) 4.5 3.0 1.5 PLRI(Positive likelihood ratio interpretation) Poor Poor Poor POP(Population) 12 12 12 PPV(Precision or positive predictive value) 0.6 0.5 0.6 PRE(Prevalence) 0.25 0.25 0.5 RACC(Random accuracy) 0.10417 0.04167 0.20833 RACCU(Random accuracy unbiased) 0.11111 0.0434 0.21007 TN(True negative/correct rejection) 7 8 4 TNR(Specificity or true negative rate) 0.77778 0.88889 0.66667 TON(Test outcome negative) 7 10 7 TOP(Test outcome positive) 5 2 5 TP(True positive/hit) 3 1 3 TPR(Sensitivity, recall, hit rate, or true positive rate) 1.0 0.33333 0.5 Y(Youden index) 0.77778 0.22222 0.16667 dInd(Distance index) 0.22222 0.67586 0.60093 sInd(Similarity index) 0.84287 0.52209 0.57508 <BLANKLINE> >>> cm.Y["L2"] 0.2222222222222221 >>> cm_2 = ConfusionMatrix(y_actu, 2) Traceback (most recent call last): ... pycm.pycm_obj.pycmVectorError: The type of input vectors is assumed to be a list or a NumPy array >>> cm_3 = ConfusionMatrix(y_actu, [1,2]) Traceback (most recent call last): ... pycm.pycm_obj.pycmVectorError: Input vectors must have same length >>> cm_4 = ConfusionMatrix([], []) Traceback (most recent call last): ... pycm.pycm_obj.pycmVectorError: Input vectors are empty >>> cm_5 = ConfusionMatrix([1,1,1,], [1,1,1,1]) Traceback (most recent call last): ... pycm.pycm_obj.pycmVectorError: Input vectors must have same length >>> pycm_help() <BLANKLINE> PyCM is a multi-class confusion matrix library written in Python that supports both input data vectors and direct matrix, and a proper tool for post-classification model evaluation that supports most classes and overall statistics parameters. PyCM is the swiss-army knife of confusion matrices, targeted mainly at data scientists that need a broad array of metrics for predictive models and an accurate evaluation of large variety of classifiers. <BLANKLINE> Repo : https://github.com/sepandhaghighi/pycm Webpage : http://www.pycm.ir <BLANKLINE> <BLANKLINE> >>> RCI_calc(24,0) 'None' >>> CBA_calc([1,2], {1:{1:0,2:0},2:{1:0,2:0}}, {1:0,2:0}, {1:0,2:0}) 'None' >>> RR_calc([], {1:0,2:0}) 'None' >>> overall_MCC_calc([1,2], {1:{1:0,2:0},2:{1:0,2:0}}, {1:0,2:0}, {1:0,2:0}) 'None' >>> CEN_misclassification_calc({1:{1:0,2:0},2:{1:0,2:0}},{1:0,2:0},{1:0,2:0},1,1,2) 'None' >>> vector_check([1,2,3,0.4]) False >>> vector_check([1,2,3,-2]) False >>> matrix_check({1:{1:0.5,2:0},2:{1:0,2:0}}) False >>> matrix_check([]) False >>> TTPN_calc(0,0) 'None' >>> TTPN_calc(1,4) 0.2 >>> FXR_calc(None) 'None' >>> FXR_calc(0.2) 0.8 >>> ACC_calc(0,0,0,0) 'None' >>> ACC_calc(1,1,3,4) 0.2222222222222222 >>> MCC_calc(0,2,0,2) 'None' >>> MCC_calc(1,2,3,4) -0.408248290463863 >>> LR_calc(1,2) 0.5 >>> LR_calc(1,0) 'None' >>> MK_BM_calc(2,"None") 'None' >>> MK_BM_calc(1,2) 2 >>> PRE_calc(None,2) 'None' >>> PRE_calc(1,5) 0.2 >>> PRE_calc(1,0) 'None' >>> G_calc(None,2) 'None' >>> G_calc(1,2) 1.4142135623730951 >>> RACC_calc(2,3,4) 0.375 >>> reliability_calc(1,None) 'None' >>> reliability_calc(2,0.3) 1.7 >>> micro_calc({1:2,2:3},{1:1,2:4}) 0.5 >>> micro_calc({1:2,2:3},None) 'None' >>> macro_calc(None) 'None' >>> macro_calc({1:2,2:3}) 2.5 >>> F_calc(TP=0,FP=0,FN=0,Beta=1) 'None' >>> F_calc(TP=3,FP=2,FN=1,Beta=5) 0.7428571428571429 >>> save_stat=cm.save_stat("test",address=False) >>> save_stat=={'Status': True, 'Message': None} True >>> save_stat=cm.save_stat("test_filtered",address=False,overall_param=["Kappa","Scott PI"],class_param=["TPR","TNR","ACC","AUC"]) >>> save_stat=={'Status': True, 'Message': None} True >>> save_stat=cm.save_stat("test_filtered2",address=False,overall_param=["Kappa","Scott PI"],class_param=["TPR","TNR","ACC","AUC"],class_name=["L1","L2"]) >>> save_stat=={'Status': True, 'Message': None} True >>> save_stat=cm.save_stat("test_filtered3",address=False,overall_param=["Kappa","Scott PI"],class_param=["TPR","TNR","ACC","AUC"],class_name=[]) >>> save_stat=={'Status': True, 'Message': None} True >>> save_stat=cm.save_stat("/asdasd,qweqwe.eo/",address=True) >>> save_stat=={'Status': False, 'Message': "[Errno 2] No such file or directory: '/asdasd,qweqwe.eo/.pycm'"} True >>> ERR_calc(None) 'None' >>> ERR_calc(0.1) 0.9 >>> cm.F_beta(4)["L1"] 0.9622641509433962 >>> cm.F_beta(4)["L2"] 0.34 >>> cm.F_beta(4)["L3"] 0.504950495049505 >>> import numpy as np >>> y_test = np.array([600, 200, 200, 200, 200, 200, 200, 200, 500, 500, 500, 200, 200, 200, 200, 200, 200, 200, 200, 200]) >>> y_pred = np.array([100, 200, 200, 100, 100, 200, 200, 200, 100, 200, 500, 100, 100, 100, 100, 100, 100, 100, 500, 200]) >>> cm=ConfusionMatrix(y_test, y_pred) >>> print(cm) Predict 100 200 500 600 Actual 100 0 0 0 0 <BLANKLINE> 200 9 6 1 0 <BLANKLINE> 500 1 1 1 0 <BLANKLINE> 600 1 0 0 0 <BLANKLINE> <BLANKLINE> <BLANKLINE> <BLANKLINE> <BLANKLINE> Overall Statistics : <BLANKLINE> 95% CI (0.14096,0.55904) AUNP None AUNU None Bennett S 0.13333 CBA 0.17708 Chi-Squared None Chi-Squared DF 9 Conditional Entropy 1.23579 Cramer V None Cross Entropy 1.70995 Gwet AC1 0.19505 Hamming Loss 0.65 Joint Entropy 2.11997 KL Divergence None Kappa 0.07801 Kappa 95% CI (-0.2185,0.37453) Kappa No Prevalence -0.3 Kappa Standard Error 0.15128 Kappa Unbiased -0.12554 Lambda A 0.0 Lambda B 0.0 Mutual Information 0.10088 NIR 0.8 Overall ACC 0.35 Overall CEN 0.3648 Overall J (0.60294,0.15074) Overall MCC 0.12642 Overall MCEN 0.37463 Overall RACC 0.295 Overall RACCU 0.4225 P-Value 1.0 PPV Macro None PPV Micro 0.35 Phi-Squared None RCI 0.11409 RR 5.0 Reference Entropy 0.88418 Response Entropy 1.33667 SOA1(Landis & Koch) Slight SOA2(Fleiss) Poor SOA3(Altman) Poor SOA4(Cicchetti) Poor Scott PI -0.12554 Standard Error 0.10665 TPR Macro None TPR Micro 0.35 Zero-one Loss 13 <BLANKLINE> Class Statistics : <BLANKLINE> Classes 100 200 500 600 ACC(Accuracy) 0.45 0.45 0.85 0.95 AUC(Area under the roc curve) None 0.5625 0.63725 0.5 AUCI(Auc value interpretation) None Poor Fair Poor BM(Informedness or bookmaker informedness) None 0.125 0.27451 0.0 CEN(Confusion entropy) 0.33496 0.35708 0.53895 0.0 DOR(Diagnostic odds ratio) None 1.8 8.0 None DP(Discriminant power) None 0.14074 0.4979 None DPI(Discriminant power interpretation) None Poor Poor None ERR(Error rate) 0.55 0.55 0.15 0.05 F0.5(F0.5 score) 0.0 0.68182 0.45455 0.0 F1(F1 score - harmonic mean of precision and sensitivity) 0.0 0.52174 0.4 0.0 F2(F2 score) 0.0 0.42254 0.35714 0.0 FDR(False discovery rate) 1.0 0.14286 0.5 None FN(False negative/miss/type 2 error) 0 10 2 1 FNR(Miss rate or false negative rate) None 0.625 0.66667 1.0 FOR(False omission rate) 0.0 0.76923 0.11111 0.05 FP(False positive/type 1 error/false alarm) 11 1 1 0 FPR(Fall-out or false positive rate) 0.55 0.25 0.05882 0.0 G(G-measure geometric mean of precision and sensitivity) None 0.56695 0.40825 None GI(Gini index) None 0.125 0.27451 0.0 IS(Information score) None 0.09954 1.73697 None J(Jaccard index) 0.0 0.35294 0.25 0.0 LS(Lift score) None 1.07143 3.33333 None MCC(Matthews correlation coefficient) None 0.10483 0.32673 None MCEN(Modified confusion entropy) 0.33496 0.37394 0.58028 0.0 MK(Markedness) 0.0 0.08791 0.38889 None N(Condition negative) 20 4 17 19 NLR(Negative likelihood ratio) None 0.83333 0.70833 1.0 NPV(Negative predictive value) 1.0 0.23077 0.88889 0.95 P(Condition positive or support) 0 16 3 1 PLR(Positive likelihood ratio) None 1.5 5.66667 None PLRI(Positive likelihood ratio interpretation) None Poor Fair None POP(Population) 20 20 20 20 PPV(Precision or positive predictive value) 0.0 0.85714 0.5 None PRE(Prevalence) 0.0 0.8 0.15 0.05 RACC(Random accuracy) 0.0 0.28 0.015 0.0 RACCU(Random accuracy unbiased) 0.07563 0.33062 0.01562 0.00063 TN(True negative/correct rejection) 9 3 16 19 TNR(Specificity or true negative rate) 0.45 0.75 0.94118 1.0 TON(Test outcome negative) 9 13 18 20 TOP(Test outcome positive) 11 7 2 0 TP(True positive/hit) 0 6 1 0 TPR(Sensitivity, recall, hit rate, or true positive rate) None 0.375 0.33333 0.0 Y(Youden index) None 0.125 0.27451 0.0 dInd(Distance index) None 0.67315 0.66926 1.0 sInd(Similarity index) None 0.52401 0.52676 0.29289 <BLANKLINE> >>> cm.stat() Overall Statistics : <BLANKLINE> 95% CI (0.14096,0.55904) AUNP None AUNU None Bennett S 0.13333 CBA 0.17708 Chi-Squared None Chi-Squared DF 9 Conditional Entropy 1.23579 Cramer V None Cross Entropy 1.70995 Gwet AC1 0.19505 Hamming Loss 0.65 Joint Entropy 2.11997 KL Divergence None Kappa 0.07801 Kappa 95% CI (-0.2185,0.37453) Kappa No Prevalence -0.3 Kappa Standard Error 0.15128 Kappa Unbiased -0.12554 Lambda A 0.0 Lambda B 0.0 Mutual Information 0.10088 NIR 0.8 Overall ACC 0.35 Overall CEN 0.3648 Overall J (0.60294,0.15074) Overall MCC 0.12642 Overall MCEN 0.37463 Overall RACC 0.295 Overall RACCU 0.4225 P-Value 1.0 PPV Macro None PPV Micro 0.35 Phi-Squared None RCI 0.11409 RR 5.0 Reference Entropy 0.88418 Response Entropy 1.33667 SOA1(Landis & Koch) Slight SOA2(Fleiss) Poor SOA3(Altman) Poor SOA4(Cicchetti) Poor Scott PI -0.12554 Standard Error 0.10665 TPR Macro None TPR Micro 0.35 Zero-one Loss 13 <BLANKLINE> Class Statistics : <BLANKLINE> Classes 100 200 500 600 ACC(Accuracy) 0.45 0.45 0.85 0.95 AUC(Area under the roc curve) None 0.5625 0.63725 0.5 AUCI(Auc value interpretation) None Poor Fair Poor BM(Informedness or bookmaker informedness) None 0.125 0.27451 0.0 CEN(Confusion entropy) 0.33496 0.35708 0.53895 0.0 DOR(Diagnostic odds ratio) None 1.8 8.0 None DP(Discriminant power) None 0.14074 0.4979 None DPI(Discriminant power interpretation) None Poor Poor None ERR(Error rate) 0.55 0.55 0.15 0.05 F0.5(F0.5 score) 0.0 0.68182 0.45455 0.0 F1(F1 score - harmonic mean of precision and sensitivity) 0.0 0.52174 0.4 0.0 F2(F2 score) 0.0 0.42254 0.35714 0.0 FDR(False discovery rate) 1.0 0.14286 0.5 None FN(False negative/miss/type 2 error) 0 10 2 1 FNR(Miss rate or false negative rate) None 0.625 0.66667 1.0 FOR(False omission rate) 0.0 0.76923 0.11111 0.05 FP(False positive/type 1 error/false alarm) 11 1 1 0 FPR(Fall-out or false positive rate) 0.55 0.25 0.05882 0.0 G(G-measure geometric mean of precision and sensitivity) None 0.56695 0.40825 None GI(Gini index) None 0.125 0.27451 0.0 IS(Information score) None 0.09954 1.73697 None J(Jaccard index) 0.0 0.35294 0.25 0.0 LS(Lift score) None 1.07143 3.33333 None MCC(Matthews correlation coefficient) None 0.10483 0.32673 None MCEN(Modified confusion entropy) 0.33496 0.37394 0.58028 0.0 MK(Markedness) 0.0 0.08791 0.38889 None N(Condition negative) 20 4 17 19 NLR(Negative likelihood ratio) None 0.83333 0.70833 1.0 NPV(Negative predictive value) 1.0 0.23077 0.88889 0.95 P(Condition positive or support) 0 16 3 1 PLR(Positive likelihood ratio) None 1.5 5.66667 None PLRI(Positive likelihood ratio interpretation) None Poor Fair None POP(Population) 20 20 20 20 PPV(Precision or positive predictive value) 0.0 0.85714 0.5 None PRE(Prevalence) 0.0 0.8 0.15 0.05 RACC(Random accuracy) 0.0 0.28 0.015 0.0 RACCU(Random accuracy unbiased) 0.07563 0.33062 0.01562 0.00063 TN(True negative/correct rejection) 9 3 16 19 TNR(Specificity or true negative rate) 0.45 0.75 0.94118 1.0 TON(Test outcome negative) 9 13 18 20 TOP(Test outcome positive) 11 7 2 0 TP(True positive/hit) 0 6 1 0 TPR(Sensitivity, recall, hit rate, or true positive rate) None 0.375 0.33333 0.0 Y(Youden index) None 0.125 0.27451 0.0 dInd(Distance index) None 0.67315 0.66926 1.0 sInd(Similarity index) None 0.52401 0.52676 0.29289 <BLANKLINE> >>> cm.stat(overall_param=["Kappa","Scott PI"],class_param=["TPR","TNR","ACC","AUC"]) Overall Statistics : <BLANKLINE> Kappa 0.07801 Scott PI -0.12554 <BLANKLINE> Class Statistics : <BLANKLINE> Classes 100 200 500 600 ACC(Accuracy) 0.45 0.45 0.85 0.95 AUC(Area under the roc curve) None 0.5625 0.63725 0.5 TNR(Specificity or true negative rate) 0.45 0.75 0.94118 1.0 TPR(Sensitivity, recall, hit rate, or true positive rate) None 0.375 0.33333 0.0 <BLANKLINE> >>> cm.stat(overall_param=["Kappa","Scott PI"],class_param=["TPR","TNR","ACC","AUC"],class_name=[100]) Overall Statistics : <BLANKLINE> Kappa 0.07801 Scott PI -0.12554 <BLANKLINE> Class Statistics : <BLANKLINE> Classes 100 ACC(Accuracy) 0.45 AUC(Area under the roc curve) None TNR(Specificity or true negative rate) 0.45 TPR(Sensitivity, recall, hit rate, or true positive rate) None <BLANKLINE> >>> cm.stat(overall_param=["Kappa","Scott PI"],class_param=["TPR","TNR","ACC","AUC"],class_name=[]) Overall Statistics : <BLANKLINE> Kappa 0.07801 Scott PI -0.12554 <BLANKLINE> >>> cm.stat(overall_param=["Kappa","Scott PI"],class_param=[],class_name=[100]) Overall Statistics : <BLANKLINE> Kappa 0.07801 Scott PI -0.12554 <BLANKLINE> >>> cm.stat(overall_param=["Kappa","Scott PI"],class_param=["TPR"],class_name=[100]) Overall Statistics : <BLANKLINE> Kappa 0.07801 Scott PI -0.12554 <BLANKLINE> Class Statistics : <BLANKLINE> Classes 100 TPR(Sensitivity, recall, hit rate, or true positive rate) None <BLANKLINE> >>> cm.stat(overall_param=[],class_param=["TPR"],class_name=[100]) <BLANKLINE> Class Statistics : <BLANKLINE> Classes 100 TPR(Sensitivity, recall, hit rate, or true positive rate) None <BLANKLINE> >>> cm.print_normalized_matrix() Predict 100 200 500 600 Actual 100 0.0 0.0 0.0 0.0 200 0.5625 0.375 0.0625 0.0 500 0.33333 0.33333 0.33333 0.0 600 1.0 0.0 0.0 0.0 <BLANKLINE> >>> cm.print_matrix() Predict 100 200 500 600 Actual 100 0 0 0 0 200 9 6 1 0 500 1 1 1 0 600 1 0 0 0 <BLANKLINE> >>> cm.print_matrix(one_vs_all=True,class_name=200) Predict 200 ~ Actual 200 6 10 ~ 1 3 <BLANKLINE> >>> cm.print_normalized_matrix(one_vs_all=True,class_name=200) Predict 200 ~ Actual 200 0.375 0.625 ~ 0.25 0.75 <BLANKLINE> >>> kappa_analysis_koch(-0.1) 'Poor' >>> kappa_analysis_koch(0) 'Slight' >>> kappa_analysis_koch(0.2) 'Fair' >>> kappa_analysis_koch(0.4) 'Moderate' >>> kappa_analysis_koch(0.6) 'Substantial' >>> kappa_analysis_koch(0.8) 'Almost Perfect' >>> kappa_analysis_koch(1.2) 'None' >>> kappa_analysis_fleiss(0.4) 'Intermediate to Good' >>> kappa_analysis_fleiss(0.75) 'Excellent' >>> kappa_analysis_fleiss(1.2) 'Excellent' >>> kappa_analysis_altman(-0.2) 'Poor' >>> kappa_analysis_altman(0.2) 'Fair' >>> kappa_analysis_altman(0.4) 'Moderate' >>> kappa_analysis_altman(0.6) 'Good' >>> kappa_analysis_altman(0.8) 'Very Good' >>> kappa_analysis_altman(1.2) 'None' >>> kappa_analysis_fleiss(0.2) 'Poor' >>> kappa_analysis_cicchetti(0.3) 'Poor' >>> kappa_analysis_cicchetti(0.5) 'Fair' >>> kappa_analysis_cicchetti(0.65) 'Good' >>> kappa_analysis_cicchetti(0.8) 'Excellent' >>> PLR_analysis(1) 'Negligible' >>> PLR_analysis(3) 'Poor' >>> PLR_analysis(7) 'Fair' >>> PLR_analysis(11) 'Good' >>> DP_analysis(0.2) 'Poor' >>> DP_analysis(1.5) 'Limited' >>> DP_analysis(2.5) 'Fair' >>> DP_analysis(10) 'Good' >>> AUC_analysis(0.5) 'Poor' >>> AUC_analysis(0.65) 'Fair' >>> AUC_analysis(0.75) 'Good' >>> AUC_analysis(0.86) 'Very Good' >>> AUC_analysis(0.97) 'Excellent' >>> AUC_analysis(1.0) 'Excellent' >>> PC_PI_calc(1,1,1) 'None' >>> PC_PI_calc({1:12},{1:6},{1:45}) 0.04000000000000001 >>> PC_AC1_calc(1,1,1) 'None' >>> PC_AC1_calc({1:123,2:2},{1:120,2:5},{1:125,2:125}) 0.05443200000000002 >>> y_act=[0,0,0,0,0,0,0,0,0,0,0,0,1,1,1,1,1,1,1,1,1,2,2,2,2,2,2] >>> y_pre=[0,0,0,0,0,0,0,0,0,1,1,1,0,0,0,1,1,1,1,1,2,0,1,2,2,2,2] >>> cm2=ConfusionMatrix(y_act,y_pre) >>> chi_squared=chi_square_calc(cm2.classes,cm2.table,cm2.TOP,cm2.P,cm2.POP) >>> chi_squared 15.525641025641026 >>> population = list(cm2.POP.values())[0] >>> phi_squared=phi_square_calc(chi_squared,population) >>> phi_squared 0.5750237416904084 >>> V=cramers_V_calc(phi_squared,cm2.classes) >>> V 0.5362013342441477 >>> DF=DF_calc(cm2.classes) >>> DF 4 >>> SE=se_calc(cm2.Overall_ACC,population) >>> SE 0.09072184232530289 >>> CI=CI_calc(cm2.Overall_ACC,SE) >>> CI (0.48885185570907297, 0.8444814776242603) >>> response_entropy=entropy_calc(cm2.TOP,cm2.POP) >>> response_entropy 1.486565953154142 >>> reference_entropy=entropy_calc(cm2.P,cm2.POP) >>> reference_entropy 1.5304930567574824 >>> cross_entropy = cross_entropy_calc(cm2.TOP,cm2.P,cm2.POP) >>> cross_entropy 1.5376219392005763 >>> join_entropy = joint_entropy_calc(cm2.classes,cm2.table,cm2.POP) >>> join_entropy 2.619748965432189 >>> conditional_entropy = conditional_entropy_calc(cm2.classes,cm2.table,cm2.P,cm2.POP) >>> conditional_entropy 1.089255908674706 >>> kl_divergence=kl_divergence_calc(cm2.P,cm2.TOP,cm2.POP) >>> kl_divergence 0.007128882443093773 >>> lambda_B=lambda_B_calc(cm2.classes,cm2.table,cm2.TOP,population) >>> lambda_B 0.35714285714285715 >>> lambda_A=lambda_A_calc(cm2.classes,cm2.table,cm2.P,population) >>> lambda_A 0.4 >>> IS_calc(13,0,0,38) 1.5474877953024933 >>> kappa_no_prevalence_calc(cm2.Overall_ACC) 0.33333333333333326 >>> reliability_calc(cm2.Overall_RACC,cm2.Overall_ACC) 0.4740259740259741 >>> mutual_information_calc(cm2.ResponseEntropy,cm2.ConditionalEntropy) 0.39731004447943596 >>> cm3=ConfusionMatrix(matrix=cm2.table) >>> cm3 pycm.ConfusionMatrix(classes: [0, 1, 2]) >>> cm3.CI (0.48885185570907297, 0.8444814776242603) >>> cm3.Chi_Squared 15.525641025641026 >>> cm3.Phi_Squared 0.5750237416904084 >>> cm3.V 0.5362013342441477 >>> cm3.DF 4 >>> cm3.ResponseEntropy 1.486565953154142 >>> cm3.ReferenceEntropy 1.5304930567574824 >>> cm3.CrossEntropy 1.5376219392005763 >>> cm3.JointEntropy 2.619748965432189 >>> cm3.ConditionalEntropy 1.089255908674706 >>> cm3.KL 0.007128882443093773 >>> cm3.LambdaA 0.4 >>> cm3.LambdaB 0.35714285714285715 >>> cm3=ConfusionMatrix(matrix={}) Traceback (most recent call last): ... pycm.pycm_obj.pycmMatrixError: Input confusion matrix format error >>> cm_4=ConfusionMatrix(matrix={1:{1:2,"1":2},"1":{1:2,"1":3}}) Traceback (most recent call last): ... pycm.pycm_obj.pycmMatrixError: Type of the input matrix classes is assumed be the same >>> cm_5=ConfusionMatrix(matrix={1:{1:2}}) Traceback (most recent call last): ... pycm.pycm_obj.pycmVectorError: Number of the classes is lower than 2 >>> save_stat=cm.save_html("test",address=False) >>> save_stat=={'Status': True, 'Message': None} True >>> save_stat=cm.save_html("test_filtered",address=False,overall_param=["Kappa","Scott PI"],class_param=["TPR","TNR","ACC","AUC"]) >>> save_stat=={'Status': True, 'Message': None} True >>> save_stat=cm.save_html("test_filtered2",address=False,overall_param=["Kappa","Scott PI"],class_param=["TPR","TNR","ACC","AUC"],class_name=[100]) >>> save_stat=={'Status': True, 'Message': None} True >>> save_stat=cm.save_html("test_filtered3",address=False,overall_param=["Kappa","Scott PI"],class_param=["TPR","TNR","ACC","AUC"],class_name=[]) >>> save_stat=={'Status': True, 'Message': None} True >>> save_stat=cm.save_html("test_filtered4",address=False,overall_param=["Kappa","Scott PI"],class_param=[],class_name=[100]) >>> save_stat=={'Status': True, 'Message': None} True >>> save_stat=cm.save_html("test_filtered5",address=False,overall_param=[],class_param=["TPR","TNR","ACC","AUC"],class_name=[100]) >>> save_stat=={'Status': True, 'Message': None} True >>> save_stat=cm.save_html("test_colored",address=False,color=(130,100,200)) >>> save_stat=={'Status': True, 'Message': None} True >>> save_stat=cm.save_csv("test",address=False) >>> save_stat=={'Status': True, 'Message': None} True >>> save_stat=cm.save_csv("test_filtered",address=False,class_param=["TPR","TNR","ACC","AUC"]) >>> save_stat=={'Status': True, 'Message': None} True >>> save_stat=cm.save_csv("test_filtered2",address=False,class_param=["TPR","TNR","ACC","AUC"],class_name=[100]) >>> save_stat=={'Status': True, 'Message': None} True >>> save_stat=cm.save_csv("test_filtered3",address=False,class_param=["TPR","TNR","ACC","AUC"],class_name=[]) >>> save_stat=={'Status': True, 'Message': None} True >>> save_stat=cm.save_csv("test_filtered4",address=False,class_param=[],class_name=[100]) >>> save_stat=={'Status': True, 'Message': None} True >>> save_stat=cm.save_html("/asdasd,qweqwe.eo/",address=True) >>> save_stat=={'Status': False, 'Message': "[Errno 2] No such file or directory: '/asdasd,qweqwe.eo/.html'"} True >>> save_stat=cm.save_csv("/asdasd,qweqwe.eo/",address=True) >>> save_stat=={'Status': False, 'Message': "[Errno 2] No such file or directory: '/asdasd,qweqwe.eo/.csv'"} True >>> def activation(i): ... if i<0.7: ... return 1 ... else: ... return 0 >>> cm_6 = ConfusionMatrix([0,0,1,0],[0.87,0.34,0.9,0.12],threshold=activation) >>> cm_6.print_matrix() Predict 0 1 Actual 0 1 2 1 1 0 >>> save_obj=cm.save_obj("test",address=False) >>> save_obj=={'Status': True, 'Message': None} True >>> cm_file=ConfusionMatrix(file=open("test.obj","r")) >>> print(cm_file) Predict 100 200 500 600 Actual 100 0 0 0 0 <BLANKLINE> 200 9 6 1 0 <BLANKLINE> 500 1 1 1 0 <BLANKLINE> 600 1 0 0 0 <BLANKLINE> <BLANKLINE> <BLANKLINE> <BLANKLINE> <BLANKLINE> Overall Statistics : <BLANKLINE> 95% CI (0.14096,0.55904) AUNP None AUNU None Bennett S 0.13333 CBA 0.17708 Chi-Squared None Chi-Squared DF 9 Conditional Entropy 1.23579 Cramer V None Cross Entropy 1.70995 Gwet AC1 0.19505 Hamming Loss 0.65 Joint Entropy 2.11997 KL Divergence None Kappa 0.07801 Kappa 95% CI (-0.2185,0.37453) Kappa No Prevalence -0.3 Kappa Standard Error 0.15128 Kappa Unbiased -0.12554 Lambda A 0.0 Lambda B 0.0 Mutual Information 0.10088 NIR 0.8 Overall ACC 0.35 Overall CEN 0.3648 Overall J (0.60294,0.15074) Overall MCC 0.12642 Overall MCEN 0.37463 Overall RACC 0.295 Overall RACCU 0.4225 P-Value 1.0 PPV Macro None PPV Micro 0.35 Phi-Squared None RCI 0.11409 RR 5.0 Reference Entropy 0.88418 Response Entropy 1.33667 SOA1(Landis & Koch) Slight SOA2(Fleiss) Poor SOA3(Altman) Poor SOA4(Cicchetti) Poor Scott PI -0.12554 Standard Error 0.10665 TPR Macro None TPR Micro 0.35 Zero-one Loss 13 <BLANKLINE> Class Statistics : <BLANKLINE> Classes 100 200 500 600 ACC(Accuracy) 0.45 0.45 0.85 0.95 AUC(Area under the roc curve) None 0.5625 0.63725 0.5 AUCI(Auc value interpretation) None Poor Fair Poor BM(Informedness or bookmaker informedness) None 0.125 0.27451 0.0 CEN(Confusion entropy) 0.33496 0.35708 0.53895 0.0 DOR(Diagnostic odds ratio) None 1.8 8.0 None DP(Discriminant power) None 0.14074 0.4979 None DPI(Discriminant power interpretation) None Poor Poor None ERR(Error rate) 0.55 0.55 0.15 0.05 F0.5(F0.5 score) 0.0 0.68182 0.45455 0.0 F1(F1 score - harmonic mean of precision and sensitivity) 0.0 0.52174 0.4 0.0 F2(F2 score) 0.0 0.42254 0.35714 0.0 FDR(False discovery rate) 1.0 0.14286 0.5 None FN(False negative/miss/type 2 error) 0 10 2 1 FNR(Miss rate or false negative rate) None 0.625 0.66667 1.0 FOR(False omission rate) 0.0 0.76923 0.11111 0.05 FP(False positive/type 1 error/false alarm) 11 1 1 0 FPR(Fall-out or false positive rate) 0.55 0.25 0.05882 0.0 G(G-measure geometric mean of precision and sensitivity) None 0.56695 0.40825 None GI(Gini index) None 0.125 0.27451 0.0 IS(Information score) None 0.09954 1.73697 None J(Jaccard index) 0.0 0.35294 0.25 0.0 LS(Lift score) None 1.07143 3.33333 None MCC(Matthews correlation coefficient) None 0.10483 0.32673 None MCEN(Modified confusion entropy) 0.33496 0.37394 0.58028 0.0 MK(Markedness) 0.0 0.08791 0.38889 None N(Condition negative) 20 4 17 19 NLR(Negative likelihood ratio) None 0.83333 0.70833 1.0 NPV(Negative predictive value) 1.0 0.23077 0.88889 0.95 P(Condition positive or support) 0 16 3 1 PLR(Positive likelihood ratio) None 1.5 5.66667 None PLRI(Positive likelihood ratio interpretation) None Poor Fair None POP(Population) 20 20 20 20 PPV(Precision or positive predictive value) 0.0 0.85714 0.5 None PRE(Prevalence) 0.0 0.8 0.15 0.05 RACC(Random accuracy) 0.0 0.28 0.015 0.0 RACCU(Random accuracy unbiased) 0.07563 0.33062 0.01562 0.00063 TN(True negative/correct rejection) 9 3 16 19 TNR(Specificity or true negative rate) 0.45 0.75 0.94118 1.0 TON(Test outcome negative) 9 13 18 20 TOP(Test outcome positive) 11 7 2 0 TP(True positive/hit) 0 6 1 0 TPR(Sensitivity, recall, hit rate, or true positive rate) None 0.375 0.33333 0.0 Y(Youden index) None 0.125 0.27451 0.0 dInd(Distance index) None 0.67315 0.66926 1.0 sInd(Similarity index) None 0.52401 0.52676 0.29289 <BLANKLINE> >>> save_obj=cm_6.save_obj("test2",address=False) >>> save_obj=={'Status': True, 'Message': None} True >>> cm_file_2=ConfusionMatrix(file=open("test2.obj","r")) >>> cm_file_2.print_matrix() Predict 0 1 Actual 0 1 2 1 1 0 >>> cm = ConfusionMatrix(matrix={"Class1":{"Class1":9,"Class2":3,"Class3":0},"Class2":{"Class1":3,"Class2":5,"Class3":1},"Class3":{"Class1":1,"Class2":1,"Class3":4}}) >>> print(cm) Predict Class1 Class2 Class3 Actual Class1 9 3 0 <BLANKLINE> Class2 3 5 1 <BLANKLINE> Class3 1 1 4 <BLANKLINE> <BLANKLINE> <BLANKLINE> <BLANKLINE> <BLANKLINE> Overall Statistics : <BLANKLINE> 95% CI (0.48885,0.84448) AUNP 0.73175 AUNU 0.73929 Bennett S 0.5 CBA 0.63818 Chi-Squared 15.52564 Chi-Squared DF 4 Conditional Entropy 1.08926 Cramer V 0.5362 Cross Entropy 1.53762 Gwet AC1 0.51229 Hamming Loss 0.33333 Joint Entropy 2.61975 KL Divergence 0.00713 Kappa 0.47403 Kappa 95% CI (0.19345,0.7546) Kappa No Prevalence 0.33333 Kappa Standard Error 0.14315 Kappa Unbiased 0.47346 Lambda A 0.4 Lambda B 0.35714 Mutual Information 0.39731 NIR 0.44444 Overall ACC 0.66667 Overall CEN 0.52986 Overall J (1.51854,0.50618) Overall MCC 0.47511 Overall MCEN 0.65286 Overall RACC 0.36626 Overall RACCU 0.36694 P-Value 0.01667 PPV Macro 0.68262 PPV Micro 0.66667 Phi-Squared 0.57502 RCI 0.2596 RR 9.0 Reference Entropy 1.53049 Response Entropy 1.48657 SOA1(Landis & Koch) Moderate SOA2(Fleiss) Intermediate to Good SOA3(Altman) Moderate SOA4(Cicchetti) Fair Scott PI 0.47346 Standard Error 0.09072 TPR Macro 0.65741 TPR Micro 0.66667 Zero-one Loss 9 <BLANKLINE> Class Statistics : <BLANKLINE> Classes Class1 Class2 Class3 ACC(Accuracy) 0.74074 0.7037 0.88889 AUC(Area under the roc curve) 0.74167 0.66667 0.80952 AUCI(Auc value interpretation) Good Fair Very Good BM(Informedness or bookmaker informedness) 0.48333 0.33333 0.61905 CEN(Confusion entropy) 0.45994 0.66249 0.47174 DOR(Diagnostic odds ratio) 8.25 4.375 40.0 DP(Discriminant power) 0.50527 0.35339 0.88326 DPI(Discriminant power interpretation) Poor Poor Poor ERR(Error rate) 0.25926 0.2963 0.11111 F0.5(F0.5 score) 0.70312 0.55556 0.76923 F1(F1 score - harmonic mean of precision and sensitivity) 0.72 0.55556 0.72727 F2(F2 score) 0.7377 0.55556 0.68966 FDR(False discovery rate) 0.30769 0.44444 0.2 FN(False negative/miss/type 2 error) 3 4 2 FNR(Miss rate or false negative rate) 0.25 0.44444 0.33333 FOR(False omission rate) 0.21429 0.22222 0.09091 FP(False positive/type 1 error/false alarm) 4 4 1 FPR(Fall-out or false positive rate) 0.26667 0.22222 0.04762 G(G-measure geometric mean of precision and sensitivity) 0.72058 0.55556 0.7303 GI(Gini index) 0.48333 0.33333 0.61905 IS(Information score) 0.63941 0.73697 1.848 J(Jaccard index) 0.5625 0.38462 0.57143 LS(Lift score) 1.55769 1.66667 3.6 MCC(Matthews correlation coefficient) 0.48067 0.33333 0.66254 MCEN(Modified confusion entropy) 0.57782 0.77284 0.60158 MK(Markedness) 0.47802 0.33333 0.70909 N(Condition negative) 15 18 21 NLR(Negative likelihood ratio) 0.34091 0.57143 0.35 NPV(Negative predictive value) 0.78571 0.77778 0.90909 P(Condition positive or support) 12 9 6 PLR(Positive likelihood ratio) 2.8125 2.5 14.0 PLRI(Positive likelihood ratio interpretation) Poor Poor Good POP(Population) 27 27 27 PPV(Precision or positive predictive value) 0.69231 0.55556 0.8 PRE(Prevalence) 0.44444 0.33333 0.22222 RACC(Random accuracy) 0.21399 0.11111 0.04115 RACCU(Random accuracy unbiased) 0.21433 0.11111 0.0415 TN(True negative/correct rejection) 11 14 20 TNR(Specificity or true negative rate) 0.73333 0.77778 0.95238 TON(Test outcome negative) 14 18 22 TOP(Test outcome positive) 13 9 5 TP(True positive/hit) 9 5 4 TPR(Sensitivity, recall, hit rate, or true positive rate) 0.75 0.55556 0.66667 Y(Youden index) 0.48333 0.33333 0.61905 dInd(Distance index) 0.36553 0.4969 0.33672 sInd(Similarity index) 0.74153 0.64864 0.7619 <BLANKLINE> >>> cm = ConfusionMatrix(matrix={"Class1":{"Class1":9,"Class2":3,"Class3":1},"Class2":{"Class1":3,"Class2":5,"Class3":1},"Class3":{"Class1":0,"Class2":1,"Class3":4}},transpose=True) >>> print(cm) Predict Class1 Class2 Class3 Actual Class1 9 3 0 <BLANKLINE> Class2 3 5 1 <BLANKLINE> Class3 1 1 4 <BLANKLINE> <BLANKLINE> <BLANKLINE> <BLANKLINE> <BLANKLINE> Overall Statistics : <BLANKLINE> 95% CI (0.48885,0.84448) AUNP 0.73175 AUNU 0.73929 Bennett S 0.5 CBA 0.63818 Chi-Squared 15.52564 Chi-Squared DF 4 Conditional Entropy 1.08926 Cramer V 0.5362 Cross Entropy 1.53762 Gwet AC1 0.51229 Hamming Loss 0.33333 Joint Entropy 2.61975 KL Divergence 0.00713 Kappa 0.47403 Kappa 95% CI (0.19345,0.7546) Kappa No Prevalence 0.33333 Kappa Standard Error 0.14315 Kappa Unbiased 0.47346 Lambda A 0.4 Lambda B 0.35714 Mutual Information 0.39731 NIR 0.44444 Overall ACC 0.66667 Overall CEN 0.52986 Overall J (1.51854,0.50618) Overall MCC 0.47511 Overall MCEN 0.65286 Overall RACC 0.36626 Overall RACCU 0.36694 P-Value 0.01667 PPV Macro 0.68262 PPV Micro 0.66667 Phi-Squared 0.57502 RCI 0.2596 RR 9.0 Reference Entropy 1.53049 Response Entropy 1.48657 SOA1(Landis & Koch) Moderate SOA2(Fleiss) Intermediate to Good SOA3(Altman) Moderate SOA4(Cicchetti) Fair Scott PI 0.47346 Standard Error 0.09072 TPR Macro 0.65741 TPR Micro 0.66667 Zero-one Loss 9 <BLANKLINE> Class Statistics : <BLANKLINE> Classes Class1 Class2 Class3 ACC(Accuracy) 0.74074 0.7037 0.88889 AUC(Area under the roc curve) 0.74167 0.66667 0.80952 AUCI(Auc value interpretation) Good Fair Very Good BM(Informedness or bookmaker informedness) 0.48333 0.33333 0.61905 CEN(Confusion entropy) 0.45994 0.66249 0.47174 DOR(Diagnostic odds ratio) 8.25 4.375 40.0 DP(Discriminant power) 0.50527 0.35339 0.88326 DPI(Discriminant power interpretation) Poor Poor Poor ERR(Error rate) 0.25926 0.2963 0.11111 F0.5(F0.5 score) 0.70312 0.55556 0.76923 F1(F1 score - harmonic mean of precision and sensitivity) 0.72 0.55556 0.72727 F2(F2 score) 0.7377 0.55556 0.68966 FDR(False discovery rate) 0.30769 0.44444 0.2 FN(False negative/miss/type 2 error) 3 4 2 FNR(Miss rate or false negative rate) 0.25 0.44444 0.33333 FOR(False omission rate) 0.21429 0.22222 0.09091 FP(False positive/type 1 error/false alarm) 4 4 1 FPR(Fall-out or false positive rate) 0.26667 0.22222 0.04762 G(G-measure geometric mean of precision and sensitivity) 0.72058 0.55556 0.7303 GI(Gini index) 0.48333 0.33333 0.61905 IS(Information score) 0.63941 0.73697 1.848 J(Jaccard index) 0.5625 0.38462 0.57143 LS(Lift score) 1.55769 1.66667 3.6 MCC(Matthews correlation coefficient) 0.48067 0.33333 0.66254 MCEN(Modified confusion entropy) 0.57782 0.77284 0.60158 MK(Markedness) 0.47802 0.33333 0.70909 N(Condition negative) 15 18 21 NLR(Negative likelihood ratio) 0.34091 0.57143 0.35 NPV(Negative predictive value) 0.78571 0.77778 0.90909 P(Condition positive or support) 12 9 6 PLR(Positive likelihood ratio) 2.8125 2.5 14.0 PLRI(Positive likelihood ratio interpretation) Poor Poor Good POP(Population) 27 27 27 PPV(Precision or positive predictive value) 0.69231 0.55556 0.8 PRE(Prevalence) 0.44444 0.33333 0.22222 RACC(Random accuracy) 0.21399 0.11111 0.04115 RACCU(Random accuracy unbiased) 0.21433 0.11111 0.0415 TN(True negative/correct rejection) 11 14 20 TNR(Specificity or true negative rate) 0.73333 0.77778 0.95238 TON(Test outcome negative) 14 18 22 TOP(Test outcome positive) 13 9 5 TP(True positive/hit) 9 5 4 TPR(Sensitivity, recall, hit rate, or true positive rate) 0.75 0.55556 0.66667 Y(Youden index) 0.48333 0.33333 0.61905 dInd(Distance index) 0.36553 0.4969 0.33672 sInd(Similarity index) 0.74153 0.64864 0.7619 <BLANKLINE> >>> online_help(param=None) Please choose one parameter : <BLANKLINE> Example : online_help("J") or online_help(2) <BLANKLINE> 1-95% CI 2-ACC 3-AUC 4-AUCI 5-AUNP 6-AUNU 7-BM 8-Bennett S 9-CBA 10-CEN 11-Chi-Squared 12-Chi-Squared DF 13-Conditional Entropy 14-Cramer V 15-Cross Entropy 16-DOR 17-DP 18-DPI 19-ERR 20-F0.5 21-F1 22-F2 23-FDR 24-FN 25-FNR 26-FOR 27-FP 28-FPR 29-G 30-GI 31-Gwet AC1 32-Hamming Loss 33-IS 34-J 35-Joint Entropy 36-KL Divergence 37-Kappa 38-Kappa 95% CI 39-Kappa No Prevalence 40-Kappa Standard Error 41-Kappa Unbiased 42-LS 43-Lambda A 44-Lambda B 45-MCC 46-MCEN 47-MK 48-Mutual Information 49-N 50-NIR 51-NLR 52-NPV 53-Overall ACC 54-Overall CEN 55-Overall J 56-Overall MCC 57-Overall MCEN 58-Overall RACC 59-Overall RACCU 60-P 61-P-Value 62-PLR 63-PLRI 64-POP 65-PPV 66-PPV Macro 67-PPV Micro 68-PRE 69-Phi-Squared 70-RACC 71-RACCU 72-RCI 73-RR 74-Reference Entropy 75-Response Entropy 76-SOA1(Landis & Koch) 77-SOA2(Fleiss) 78-SOA3(Altman) 79-SOA4(Cicchetti) 80-Scott PI 81-Standard Error 82-TN 83-TNR 84-TON 85-TOP 86-TP 87-TPR 88-TPR Macro 89-TPR Micro 90-Y 91-Zero-one Loss 92-dInd 93-sInd >>> online_help("J") ... >>> online_help(4) ... >>> y_actu = [2, 0, 2, 2, 0, 1, 1, 2, 2, 0, 1, 2] >>> y_pred = [0, 0, 2, 1, 0, 2, 1, 0, 2, 0, 2, 2] >>> cm = ConfusionMatrix(y_actu, y_pred, sample_weight=[2, 2, 2, 2, 3, 1, 1, 2, 2, 1, 1, 2]) >>> print(cm) Predict 0 1 2 Actual 0 6 0 0 <BLANKLINE> 1 0 1 2 <BLANKLINE> 2 4 2 6 <BLANKLINE> <BLANKLINE> <BLANKLINE> <BLANKLINE> <BLANKLINE> Overall Statistics : <BLANKLINE> 95% CI (0.41134,0.82675) AUNP 0.7 AUNU 0.70556 Bennett S 0.42857 CBA 0.47778 Chi-Squared 10.44167 Chi-Squared DF 4 Conditional Entropy 0.96498 Cramer V 0.49861 Cross Entropy 1.50249 Gwet AC1 0.45277 Hamming Loss 0.38095 Joint Entropy 2.34377 KL Divergence 0.1237 Kappa 0.3913 Kappa 95% CI (0.05943,0.72318) Kappa No Prevalence 0.2381 Kappa Standard Error 0.16932 Kappa Unbiased 0.37313 Lambda A 0.22222 Lambda B 0.36364 Mutual Information 0.47618 NIR 0.57143 Overall ACC 0.61905 Overall CEN 0.43947 Overall J (1.22857,0.40952) Overall MCC 0.41558 Overall MCEN 0.50059 Overall RACC 0.37415 Overall RACCU 0.39229 P-Value 0.41709 PPV Macro 0.56111 PPV Micro 0.61905 Phi-Squared 0.49722 RCI 0.34536 RR 7.0 Reference Entropy 1.37878 Response Entropy 1.44117 SOA1(Landis & Koch) Fair SOA2(Fleiss) Poor SOA3(Altman) Fair SOA4(Cicchetti) Poor Scott PI 0.37313 Standard Error 0.10597 TPR Macro 0.61111 TPR Micro 0.61905 Zero-one Loss 8 <BLANKLINE> Class Statistics : <BLANKLINE> Classes 0 1 2 ACC(Accuracy) 0.80952 0.80952 0.61905 AUC(Area under the roc curve) 0.86667 0.61111 0.63889 AUCI(Auc value interpretation) Very Good Fair Fair BM(Informedness or bookmaker informedness) 0.73333 0.22222 0.27778 CEN(Confusion entropy) 0.25 0.52832 0.56439 DOR(Diagnostic odds ratio) None 4.0 3.5 DP(Discriminant power) None 0.33193 0.29996 DPI(Discriminant power interpretation) None Poor Poor ERR(Error rate) 0.19048 0.19048 0.38095 F0.5(F0.5 score) 0.65217 0.33333 0.68182 F1(F1 score - harmonic mean of precision and sensitivity) 0.75 0.33333 0.6 F2(F2 score) 0.88235 0.33333 0.53571 FDR(False discovery rate) 0.4 0.66667 0.25 FN(False negative/miss/type 2 error) 0 2 6 FNR(Miss rate or false negative rate) 0.0 0.66667 0.5 FOR(False omission rate) 0.0 0.11111 0.46154 FP(False positive/type 1 error/false alarm) 4 2 2 FPR(Fall-out or false positive rate) 0.26667 0.11111 0.22222 G(G-measure geometric mean of precision and sensitivity) 0.7746 0.33333 0.61237 GI(Gini index) 0.73333 0.22222 0.27778 IS(Information score) 1.07039 1.22239 0.39232 J(Jaccard index) 0.6 0.2 0.42857 LS(Lift score) 2.1 2.33333 1.3125 MCC(Matthews correlation coefficient) 0.66332 0.22222 0.28307 MCEN(Modified confusion entropy) 0.26439 0.52877 0.65924 MK(Markedness) 0.6 0.22222 0.28846 N(Condition negative) 15 18 9 NLR(Negative likelihood ratio) 0.0 0.75 0.64286 NPV(Negative predictive value) 1.0 0.88889 0.53846 P(Condition positive or support) 6 3 12 PLR(Positive likelihood ratio) 3.75 3.0 2.25 PLRI(Positive likelihood ratio interpretation) Poor Poor Poor POP(Population) 21 21 21 PPV(Precision or positive predictive value) 0.6 0.33333 0.75 PRE(Prevalence) 0.28571 0.14286 0.57143 RACC(Random accuracy) 0.13605 0.02041 0.21769 RACCU(Random accuracy unbiased) 0.14512 0.02041 0.22676 TN(True negative/correct rejection) 11 16 7 TNR(Specificity or true negative rate) 0.73333 0.88889 0.77778 TON(Test outcome negative) 11 18 13 TOP(Test outcome positive) 10 3 8 TP(True positive/hit) 6 1 6 TPR(Sensitivity, recall, hit rate, or true positive rate) 1.0 0.33333 0.5 Y(Youden index) 0.73333 0.22222 0.27778 dInd(Distance index) 0.26667 0.67586 0.54716 sInd(Similarity index) 0.81144 0.52209 0.6131 <BLANKLINE> >>> save_obj=cm.save_obj("test3",address=False) >>> save_obj=={'Status': True, 'Message': None} True >>> cm_file_3=ConfusionMatrix(file=open("test3.obj","r")) >>> cm_file_3.print_matrix() Predict 0 1 2 Actual 0 6 0 0 1 0 1 2 2 4 2 6 <BLANKLINE> >>> cm_file_3.stat() Overall Statistics : <BLANKLINE> 95% CI (0.41134,0.82675) AUNP 0.7 AUNU 0.70556 Bennett S 0.42857 CBA 0.47778 Chi-Squared 10.44167 Chi-Squared DF 4 Conditional Entropy 0.96498 Cramer V 0.49861 Cross Entropy 1.50249 Gwet AC1 0.45277 Hamming Loss 0.38095 Joint Entropy 2.34377 KL Divergence 0.1237 Kappa 0.3913 Kappa 95% CI (0.05943,0.72318) Kappa No Prevalence 0.2381 Kappa Standard Error 0.16932 Kappa Unbiased 0.37313 Lambda A 0.22222 Lambda B 0.36364 Mutual Information 0.47618 NIR 0.57143 Overall ACC 0.61905 Overall CEN 0.43947 Overall J (1.22857,0.40952) Overall MCC 0.41558 Overall MCEN 0.50059 Overall RACC 0.37415 Overall RACCU 0.39229 P-Value 0.41709 PPV Macro 0.56111 PPV Micro 0.61905 Phi-Squared 0.49722 RCI 0.34536 RR 7.0 Reference Entropy 1.37878 Response Entropy 1.44117 SOA1(Landis & Koch) Fair SOA2(Fleiss) Poor SOA3(Altman) Fair SOA4(Cicchetti) Poor Scott PI 0.37313 Standard Error 0.10597 TPR Macro 0.61111 TPR Micro 0.61905 Zero-one Loss 8 <BLANKLINE> Class Statistics : <BLANKLINE> Classes 0 1 2 ACC(Accuracy) 0.80952 0.80952 0.61905 AUC(Area under the roc curve) 0.86667 0.61111 0.63889 AUCI(Auc value interpretation) Very Good Fair Fair BM(Informedness or bookmaker informedness) 0.73333 0.22222 0.27778 CEN(Confusion entropy) 0.25 0.52832 0.56439 DOR(Diagnostic odds ratio) None 4.0 3.5 DP(Discriminant power) None 0.33193 0.29996 DPI(Discriminant power interpretation) None Poor Poor ERR(Error rate) 0.19048 0.19048 0.38095 F0.5(F0.5 score) 0.65217 0.33333 0.68182 F1(F1 score - harmonic mean of precision and sensitivity) 0.75 0.33333 0.6 F2(F2 score) 0.88235 0.33333 0.53571 FDR(False discovery rate) 0.4 0.66667 0.25 FN(False negative/miss/type 2 error) 0 2 6 FNR(Miss rate or false negative rate) 0.0 0.66667 0.5 FOR(False omission rate) 0.0 0.11111 0.46154 FP(False positive/type 1 error/false alarm) 4 2 2 FPR(Fall-out or false positive rate) 0.26667 0.11111 0.22222 G(G-measure geometric mean of precision and sensitivity) 0.7746 0.33333 0.61237 GI(Gini index) 0.73333 0.22222 0.27778 IS(Information score) 1.07039 1.22239 0.39232 J(Jaccard index) 0.6 0.2 0.42857 LS(Lift score) 2.1 2.33333 1.3125 MCC(Matthews correlation coefficient) 0.66332 0.22222 0.28307 MCEN(Modified confusion entropy) 0.26439 0.52877 0.65924 MK(Markedness) 0.6 0.22222 0.28846 N(Condition negative) 15 18 9 NLR(Negative likelihood ratio) 0.0 0.75 0.64286 NPV(Negative predictive value) 1.0 0.88889 0.53846 P(Condition positive or support) 6 3 12 PLR(Positive likelihood ratio) 3.75 3.0 2.25 PLRI(Positive likelihood ratio interpretation) Poor Poor Poor POP(Population) 21 21 21 PPV(Precision or positive predictive value) 0.6 0.33333 0.75 PRE(Prevalence) 0.28571 0.14286 0.57143 RACC(Random accuracy) 0.13605 0.02041 0.21769 RACCU(Random accuracy unbiased) 0.14512 0.02041 0.22676 TN(True negative/correct rejection) 11 16 7 TNR(Specificity or true negative rate) 0.73333 0.88889 0.77778 TON(Test outcome negative) 11 18 13 TOP(Test outcome positive) 10 3 8 TP(True positive/hit) 6 1 6 TPR(Sensitivity, recall, hit rate, or true positive rate) 1.0 0.33333 0.5 Y(Youden index) 0.73333 0.22222 0.27778 dInd(Distance index) 0.26667 0.67586 0.54716 sInd(Similarity index) 0.81144 0.52209 0.6131 >>> NIR_calc({'Class2': 804, 'Class1': 196},1000) # Verified Case 0.804 >>> cm = ConfusionMatrix(matrix={0:{0:3,1:1},1:{0:4,1:2}}) # Verified Case >>> cm.LS[1] 1.1111111111111112 >>> cm.LS[0] 1.0714285714285714 >>> cm = ConfusionMatrix(matrix={"Class1":{"Class1":183,"Class2":13},"Class2":{"Class1":141,"Class2":663}}) # Verified Case >>> cm.PValue 0.000342386296143693 >>> cm = ConfusionMatrix(matrix={"Class1":{"Class1":4,"Class2":2},"Class2":{"Class1":2,"Class2":4}}) # Verified Case >>> cm.Overall_CEN 0.861654166907052 >>> cm.Overall_MCEN 0.6666666666666666 >>> cm.IS["Class1"] 0.4150374992788437 >>> cm.IS["Class2"] 0.4150374992788437 >>> cm = ConfusionMatrix(matrix={1:{1:5,2:0,3:0},2:{1:0,2:10,3:0},3:{1:0,2:300,3:0}}) # Verified Case >>> cm.Overall_CEN 0.022168905807495587 >>> cm.Overall_MCC 0.3012440235352457 >>> cm.CBA 0.3440860215053763 >>> cm = ConfusionMatrix(matrix={1:{1:1,2:3,3:0,4:0},2:{1:9,2:1,3:0,4:0},3:{1:0,2:0,3:100,4:0},4:{1:0,2:0,3:0,4:200}}) # Verified Case >>> cm.RCI 0.9785616782831341 >>> cm = ConfusionMatrix(matrix={1:{1:1,2:0,3:3},2:{1:0,2:100,3:0},3:{1:0,2:0,3:200}}) # Verified Case >>> cm.RCI 0.9264007150415143 >>> cm = ConfusionMatrix(matrix={1:{1:5,2:0,3:0},2:{1:0,2:10,3:0},3:{1:0,2:300,3:0}}) >>> cm.RCI 0.3675708571923818 >>> cm = ConfusionMatrix(matrix={1:{1:12806,2:26332},2:{1:5484,2:299777}},transpose=True) # Verified Case >>> cm.AUC[1] 0.8097090079101759 >>> cm.GI[1] 0.6194180158203517 >>> cm.Overall_ACC 0.9076187793808925 >>> cm.DP[1] 0.7854399677022138 >>> cm.Y[1] 0.6194180158203517 >>> cm.BM[1] 0.6194180158203517 >>> cm = ConfusionMatrix(matrix={1:{1:13182,2:30516},2:{1:5108,2:295593}},transpose=True) # Verified Case >>> cm.AUC[1] 0.8135728157964055 >>> cm.GI[1] 0.627145631592811 >>> cm.Overall_ACC 0.896561836706843 >>> cm.DP[1] 0.770700985610517 >>> cm.Y[1] 0.627145631592811 >>> cm.BM[1] 0.627145631592811 >>> save_obj = cm.save_obj("test4",address=False) >>> save_obj=={'Status': True, 'Message': None} True >>> cm_file=ConfusionMatrix(file=open("test4.obj","r")) >>> cm_file.DP[1] 0.770700985610517 >>> cm_file.Y[1] 0.627145631592811 >>> cm_file.BM[1] 0.627145631592811 >>> cm_file.transpose True >>> json.dump({"Actual-Vector": None, "Digit": 5, "Predict-Vector": None, "Matrix": {"0": {"0": 3, "1": 0, "2": 2}, "1": {"0": 0, "1": 1, "2": 1}, "2": {"0": 0, "1": 2, "2": 3}}, "Transpose": True,"Sample-Weight": None},open("test5.obj","w")) >>> cm_file=ConfusionMatrix(file=open("test5.obj","r")) >>> cm_file.transpose True >>> cm_file.matrix == {"0": {"0": 3, "1": 0, "2": 2}, "1": {"0": 0, "1": 1, "2": 1}, "2": {"0": 0, "1": 2, "2": 3}} True >>> cm = ConfusionMatrix([1,2,3,4],[1,2,3,"4"]) >>> cm pycm.ConfusionMatrix(classes: ['1', '2', '3', '4']) >>> os.remove("test.csv") >>> os.remove("test.obj") >>> os.remove("test.html") >>> os.remove("test_filtered.html") >>> os.remove("test_filtered.csv") >>> os.remove("test_filtered.pycm") >>> os.remove("test_filtered2.html") >>> os.remove("test_filtered3.html") >>> os.remove("test_filtered4.html") >>> os.remove("test_filtered5.html") >>> os.remove("test_colored.html") >>> os.remove("test_filtered2.csv") >>> os.remove("test_filtered3.csv") >>> os.remove("test_filtered4.csv") >>> os.remove("test_filtered2.pycm") >>> os.remove("test_filtered3.pycm") >>> os.remove("test2.obj") >>> os.remove("test3.obj") >>> os.remove("test4.obj") >>> os.remove("test5.obj") >>> os.remove("test.pycm") """
#encoding:utf-8 subreddit = 'talesfromtechsupport' t_channel = '@r_talesfromtechsupport' def send_post(submission, r2t): return r2t.send_simple(submission)
subreddit = 'talesfromtechsupport' t_channel = '@r_talesfromtechsupport' def send_post(submission, r2t): return r2t.send_simple(submission)
def factors(n): factorlist=[] for i in range(1,n+1): if n%i==0: factorlist=factorlist+[i] return(factorlist) def isprime(n): return(factors(n)==[1,n]) def sumprimes(l): sum=0 for i in range(0,len(l)): if isprime(l[i]): sum=sum+l[i] return(sum)
def factors(n): factorlist = [] for i in range(1, n + 1): if n % i == 0: factorlist = factorlist + [i] return factorlist def isprime(n): return factors(n) == [1, n] def sumprimes(l): sum = 0 for i in range(0, len(l)): if isprime(l[i]): sum = sum + l[i] return sum
def swap(array,i,j): #this simply swaps the values array[i],array[j]=array[j],array[i] '''HeapifyMax function, our root node is at index i. We will first assume that the value at index 'i' is the largest. Then we will find index of left and right child. Then we will check if left and right child exist or not.Now, we will compare our value at index i with left and right child. If either of two children have greater value then "largest" will store the index of greater value and will swap the values. if the largest is equal to index i then no swapping. This will be a recursive funtion so that value gets to its correct position. MAKES PARENT MAX THAN CHILD''' def HeapifyMax(items,length,index): largest=index leftchild=(index*2)+1 #finding index of leftchild rightchild=(index*2)+2 #finding index of right child if leftchild<length and items[index]<items[leftchild]: #checking left chid exist and comparing with parent node largest=leftchild if rightchild<length and items[largest]<items[rightchild]: #checking right chid exist and comparing with parent node largest=rightchild if largest!=index: #swaping items[index],items[largest] = items[largest],items[index] HeapifyMax(items,length,largest) #recurssion '''HeapifyMin function, our root node is at index i. We will first assume that the value at index 'i' is the smallest. Then we will find index of left and right child. Then we will check if left and right child exist or not.Now, we will compare our value at index i with left and right child. If either of two children have smaller value then "smallest" will store the index of greater value and will swap the values. if the smallest is equal to index i then no swapping. This will be a recursive funtion so that value gets to its correct position. MAKES PARENT MIN THAN CHILD''' def HeapifyMin(items,length,index): smallest=index leftchild=(index*2)+1 #finding index of leftchild rightchild=(index*2)+2 #finding index of right child if leftchild<length and items[index]>items[leftchild]: #checking left chid exist and comparing with parent node smallest=leftchild if rightchild<length and items[smallest]>items[rightchild]: #checking right chid exist and comparing with parent node smallest=rightchild if smallest!=index: #swaping items[index],items[smallest] = items[smallest],items[index] HeapifyMin(items,length,smallest) '''HeapSortDes function will sort descending order.''' def HeapSortDes(items): length=len(items) MinHeap(items) for i in range(length-1, 0, -1): #extracting values one by one. items[i], items[0] = items[0], items[i] # swaping HeapifyMin(items, i, 0) return items '''HeapSortAsc function will sort descending order''' def HeapSortAsc(items): length=len(items) MaxHeap(items) for i in range(length-1, 0, -1): #extracting values one by one. items[i], items[0] = items[0], items[i] # swaping HeapifyMax(items, i, 0) return items '''Now, we are creating our Max Heap function which will use Heapifymax function to place values at their correct position.''' def MaxHeap(items): length=len(items) for i in range(length // 2 - 1, -1, -1): #last parent node HeapifyMax(items,length,i) return items '''Now, we are creating our Min Heap function which will use HeapifyMin function to place values at their correct position.''' def MinHeap(items): length=len(items) for i in range(length // 2 - 1, -1, -1): #last parent node HeapifyMin(items,length,i) return items ''' We will define our enqueue function which will recieve data We will add it to the end of the heap and then move it to its correct position.''' def enqueue(items,data): items.append(data) return items '''Let's define our DequeueMax function which will delete the highest priority element. There are 3 possibilities for the function. First possibility that there are 2 or 3 values in the heap in which we will move move max value to the end of the heap before popping it out then we want to move the value that we swapped to the top position The second possibility is that there is only one value in the heap. In this case we can simply pop the top value from the heap then we will have empty heap after that. The third possibility is that there is no element in the heap. In this case we will just return "NO ELEMENT".''' def DequeueMax(items): if len(items)>1: #first case swap(items,0,len(items)-1) maximum=items.pop() HeapifyMax(items,len(items),0) return maximum elif len(items)==1: #second case maximum=items.pop() return maximum else: #third case return "NO ELEMENT IN THE QUEUE " '''Let's define our DequeueMin function which will dequeue the highest priority element. There are 3 possibilities for the function. First possibility that there are 2 or 3 values in the heap in which we will move move min value to the end of the heap before popping it out then we want to move the value that we swapped to the top position The second possibility is that there is only one value in the heap. In this case we can simply pop the top value from the heap then we will have empty heap after that. The third possibility is that there is no element in the heap. In this case we will just return "NO ELEMENT".''' def DequeueMin(items): if len(items)>1: #first case swap(items,0,len(items)-1) minimum=items.pop() HeapifyMin(items,len(items),0) return minimum elif len(items)==1: #second case minimum=items.pop() return minimum else: #third case return "NO ELEMENT IN THE QUEUE " '''We will define Highestpriority function which will give the highest priority element. Highestpriority function simply checks to see if we have atleast one value on the heap. If we do have then it will return the first value on a heap list. If we don't have any value then it will simply returns "NO ELEMENT" i.e. heap is empty''' def Highestpriority(items): if len(items)!=0: return items[0] else: return "NO ELEMENT IN THE QUEUE" '''This is the python program in which we create the user input queue first then the choices will be asked to user. this runs in an infinite loop till the user choose to exit.''' print("Python program to implement Priority Queue using Heap") print("CREATE YOUR QUEUE") '''User input queue''' myqueue=[] n=int(input("Enter no. of elements you want in your queue:")) for j in range(0,n): element=int(input("Enter element:")) myqueue.append(element) print("Your Queue Is:",myqueue) print("1.Create Your Max Priority Queue") print("2.Create Your Min Priority Queue") choice=int(input("Enter Your Choice:")) if choice==1: print("Your Max Priority Queue Is:",HeapSortDes(myqueue)) #prints priority queue usin MaxHeap function while True: print("a. Enqueue in Priority Queue") print("b. Dequeue Highest Priority Element ") print("c. Highest Priority Element ") print("d. Exit ") option=input("Enter Your Choice:") if option=='a' or option=='A': value=int(input("Enter the value you want to insert in your priority queue:")) enqueue(myqueue,value) print("You New Priority Queue is:",HeapSortDes(myqueue)) elif option=='b' or option=='B': k=DequeueMax(myqueue) print("Dequeued Highest priority elemnet is:", k) print("Your New Priority Queue is:", HeapSortDes(myqueue)) elif option=='c' or option=='C': m=Highestpriority(myqueue) print("Highest priority element is:",m) elif option=='d' or option=='D': break else: print("INVALID CHOICE") elif choice==2: print("Your Min Priority Queue Is:",HeapSortAsc(myqueue)) #prints priority queue usin MaxHeap function while True: print("a. Enqueue in Min Priority Queue") print("b. Dequeue Highest Priority Element ") print("c. Highest Priority Element ") print("d. Exit ") options=input("Enter Your Choice:") if options=='a' or options=='A' : value=int(input("Enter the value you want to insert in your priority queue:")) enqueue(myqueue,value) print("You New Priority Queue is:",HeapSortAsc(myqueue)) elif options=='b' or options=='B': y=DequeueMin(myqueue) print("Dequeued Highest priority elemnet is:", y) print("Your New Priority Queue is:", HeapSortAsc(myqueue)) elif options=='c' or options=='C': h=Highestpriority(myqueue) print("Highest priority element is:",h) elif options=='d' or options=='D': break else: print("INVALID CHOICE") else: print("INVALID CHOICE")
def swap(array, i, j): (array[i], array[j]) = (array[j], array[i]) 'HeapifyMax function, our root node is at index i. We will first assume that \nthe value at index \'i\' is the largest. Then we will find index of left and right child.\nThen we will check if left and right child exist or not.Now, we will compare our value \nat index i with left and right child. If either of two children have greater value \nthen "largest" will store the index of greater value and will swap\nthe values. if the largest is equal to index i then no swapping. This will be a recursive\nfuntion so that value gets to its correct position. MAKES PARENT MAX THAN CHILD' def heapify_max(items, length, index): largest = index leftchild = index * 2 + 1 rightchild = index * 2 + 2 if leftchild < length and items[index] < items[leftchild]: largest = leftchild if rightchild < length and items[largest] < items[rightchild]: largest = rightchild if largest != index: (items[index], items[largest]) = (items[largest], items[index]) heapify_max(items, length, largest) 'HeapifyMin function, our root node is at index i. We will first assume that \nthe value at index \'i\' is the smallest. Then we will find index of left and right child.\nThen we will check if left and right child exist or not.Now, we will compare our value \nat index i with left and right child. If either of two children have smaller value \nthen "smallest" will store the index of greater value and will swap\nthe values. if the smallest is equal to index i then no swapping. This will be a recursive\nfuntion so that value gets to its correct position. MAKES PARENT MIN THAN CHILD' def heapify_min(items, length, index): smallest = index leftchild = index * 2 + 1 rightchild = index * 2 + 2 if leftchild < length and items[index] > items[leftchild]: smallest = leftchild if rightchild < length and items[smallest] > items[rightchild]: smallest = rightchild if smallest != index: (items[index], items[smallest]) = (items[smallest], items[index]) heapify_min(items, length, smallest) 'HeapSortDes function will sort descending order.' def heap_sort_des(items): length = len(items) min_heap(items) for i in range(length - 1, 0, -1): (items[i], items[0]) = (items[0], items[i]) heapify_min(items, i, 0) return items 'HeapSortAsc function will sort descending order' def heap_sort_asc(items): length = len(items) max_heap(items) for i in range(length - 1, 0, -1): (items[i], items[0]) = (items[0], items[i]) heapify_max(items, i, 0) return items 'Now, we are creating our Max Heap function which will use Heapifymax function to place\nvalues at their correct position.' def max_heap(items): length = len(items) for i in range(length // 2 - 1, -1, -1): heapify_max(items, length, i) return items 'Now, we are creating our Min Heap function which will use HeapifyMin function to place\nvalues at their correct position.' def min_heap(items): length = len(items) for i in range(length // 2 - 1, -1, -1): heapify_min(items, length, i) return items ' We will define our enqueue function which will recieve data\nWe will add it to the end of the heap and then move it to its\ncorrect position.' def enqueue(items, data): items.append(data) return items 'Let\'s define our DequeueMax function which will delete the highest priority element. \nThere are 3 possibilities for the function.\nFirst possibility that there are 2 or 3 values in the heap\nin which we will move move max value to the end of the heap before popping it out\nthen we want to move the value that we swapped to the top position\nThe second possibility is that there is only one value in the heap.\nIn this case we can simply pop the top value from the heap then we will have \nempty heap after that.\nThe third possibility is that there is no element in the heap. In this case we\nwill just return "NO ELEMENT".' def dequeue_max(items): if len(items) > 1: swap(items, 0, len(items) - 1) maximum = items.pop() heapify_max(items, len(items), 0) return maximum elif len(items) == 1: maximum = items.pop() return maximum else: return 'NO ELEMENT IN THE QUEUE ' 'Let\'s define our DequeueMin function which will dequeue the highest priority element. \nThere are 3 possibilities for the function.\nFirst possibility that there are 2 or 3 values in the heap\nin which we will move move min value to the end of the heap before popping it out\nthen we want to move the value that we swapped to the top position\nThe second possibility is that there is only one value in the heap.\nIn this case we can simply pop the top value from the heap then we will have \nempty heap after that.\nThe third possibility is that there is no element in the heap. In this case we\nwill just return "NO ELEMENT".' def dequeue_min(items): if len(items) > 1: swap(items, 0, len(items) - 1) minimum = items.pop() heapify_min(items, len(items), 0) return minimum elif len(items) == 1: minimum = items.pop() return minimum else: return 'NO ELEMENT IN THE QUEUE ' 'We will define Highestpriority function which will give the highest priority element. \nHighestpriority function simply checks to see if we have atleast one value on the heap.\nIf we do have then it will return the first value on a heap list. If we don\'t\nhave any value then it will simply returns "NO ELEMENT" i.e. heap is empty' def highestpriority(items): if len(items) != 0: return items[0] else: return 'NO ELEMENT IN THE QUEUE' 'This is the python program in which we create the user input queue first then \nthe choices will be asked to user. this runs in an infinite loop till the user \nchoose to exit.' print('Python program to implement Priority Queue using Heap') print('CREATE YOUR QUEUE') 'User input queue' myqueue = [] n = int(input('Enter no. of elements you want in your queue:')) for j in range(0, n): element = int(input('Enter element:')) myqueue.append(element) print('Your Queue Is:', myqueue) print('1.Create Your Max Priority Queue') print('2.Create Your Min Priority Queue') choice = int(input('Enter Your Choice:')) if choice == 1: print('Your Max Priority Queue Is:', heap_sort_des(myqueue)) while True: print('a. Enqueue in Priority Queue') print('b. Dequeue Highest Priority Element ') print('c. Highest Priority Element ') print('d. Exit ') option = input('Enter Your Choice:') if option == 'a' or option == 'A': value = int(input('Enter the value you want to insert in your priority queue:')) enqueue(myqueue, value) print('You New Priority Queue is:', heap_sort_des(myqueue)) elif option == 'b' or option == 'B': k = dequeue_max(myqueue) print('Dequeued Highest priority elemnet is:', k) print('Your New Priority Queue is:', heap_sort_des(myqueue)) elif option == 'c' or option == 'C': m = highestpriority(myqueue) print('Highest priority element is:', m) elif option == 'd' or option == 'D': break else: print('INVALID CHOICE') elif choice == 2: print('Your Min Priority Queue Is:', heap_sort_asc(myqueue)) while True: print('a. Enqueue in Min Priority Queue') print('b. Dequeue Highest Priority Element ') print('c. Highest Priority Element ') print('d. Exit ') options = input('Enter Your Choice:') if options == 'a' or options == 'A': value = int(input('Enter the value you want to insert in your priority queue:')) enqueue(myqueue, value) print('You New Priority Queue is:', heap_sort_asc(myqueue)) elif options == 'b' or options == 'B': y = dequeue_min(myqueue) print('Dequeued Highest priority elemnet is:', y) print('Your New Priority Queue is:', heap_sort_asc(myqueue)) elif options == 'c' or options == 'C': h = highestpriority(myqueue) print('Highest priority element is:', h) elif options == 'd' or options == 'D': break else: print('INVALID CHOICE') else: print('INVALID CHOICE')
# https://app.codesignal.com/arcade/intro/level-5/g6dc9KJyxmFjB98dL def areEquallyStrong(your_left, your_right, friends_left, friends_right): # Two arms are equally strong if the heaviest weights they each are # able to lift are equal. Two people are equally strong if their # strongest arms are equally strong and so are their weakest arms. my_max = max(your_left, your_right) my_min = min(your_left, your_right) fr_max = max(friends_left, friends_right) fr_min = min(friends_left, friends_right) # Check if me and my friend are equally strong! return my_max == fr_max and my_min == fr_min
def are_equally_strong(your_left, your_right, friends_left, friends_right): my_max = max(your_left, your_right) my_min = min(your_left, your_right) fr_max = max(friends_left, friends_right) fr_min = min(friends_left, friends_right) return my_max == fr_max and my_min == fr_min
# Source : https://leetcode.com/problems/4sum/ # Author : YipingPan # Date : 2020-08-16 ##################################################################################################### # # Given an array nums of n integers and an integer target, are there elements a, b, c, and d in nums # such that a + b + c + d = target? Find all unique quadruplets in the array which gives the sum of # target. # # Note: # # The solution set must not contain duplicate quadruplets. # # Example: # # Given array nums = [1, 0, -1, 0, -2, 2], and target = 0. # # A solution set is: # [ # [-1, 0, 0, 1], # [-2, -1, 1, 2], # [-2, 0, 0, 2] # ] # ##################################################################################################### class Solution: def fourSum(self, nums: List[int], target: int) -> List[List[int]]: # dic {sum1:[[i,j],[i,j]], sum2:[[i,j],[i,j]], ...} # O(n^2) # for x in dic: if dic[target-x] ... dic = collections.defaultdict(list) for i in range(len(nums)): for j in range(len(nums)): if i<j: dic[nums[i]+nums[j]].append([i,j]) res = set() for x in dic: if target-x in dic: ### be careful here. Don't use " if dic[target-x] " because it will change the size of dic. for pair1 in dic[x]: for pair2 in dic[target-x]: a,b,c,d = pair1[0],pair1[1],pair2[0],pair2[1] if len(set([a,b,c,d]))==4: res.add(tuple(sorted([nums[a],nums[b],nums[c],nums[d]]))) return list(res)
class Solution: def four_sum(self, nums: List[int], target: int) -> List[List[int]]: dic = collections.defaultdict(list) for i in range(len(nums)): for j in range(len(nums)): if i < j: dic[nums[i] + nums[j]].append([i, j]) res = set() for x in dic: if target - x in dic: for pair1 in dic[x]: for pair2 in dic[target - x]: (a, b, c, d) = (pair1[0], pair1[1], pair2[0], pair2[1]) if len(set([a, b, c, d])) == 4: res.add(tuple(sorted([nums[a], nums[b], nums[c], nums[d]]))) return list(res)
dict_rhythms = { "E(2,3)" : "A common Afro-Cuban drum pattern when started on the second onset as in [101]. For example, it is the conga rhythm of the (6/8)-time Swing Tumbao. It is common in Latin American music, as for example in the Cueca, and the coros de clave. It is common in Arabic music, as for example in the Al Taer rhythm of Nubia. It is also a rhythmic pattern of the Drum Dance of the Slavey Indians of Northern Canada", "E(2,5)" : "A rhythm found in Greece, Namibia, Rwanda and Central Africa. It is also a 13th century Persian rhythm called Khafif-e-ramal, as well as the rhythm of the dance Makedonka from the FYROM. Tchaikovsky used it as the metric pattern in the second movement of his Symphony No. 6. Started on the second onset as in [10010] it is a rhythm found in Central Africa, Bulgaria, Turkey, Turkestan and Norway. It is also the metric pattern of Dave Brubeck's Take Five, as well as Mars from The Planets by Gustav Holst. Rotated as in [10010100100], it is a Serbian rhythmic pattern. When it is started on the fourth (last) onset it is the Daasa al kbiri rhythmic pattern of Yemen.", "E(3,4)" : "It is the archetypal pattern of the Cumbia from Colombia, as well as a Calypso rhythm from Trinidad. It is also a thirteenth century Persian rhythm called Khalif-e-saghil, as well as the trochoid choreic rhythmic pattern of ancient Greece.", "E(3,5)" : "When started on the second onset, it is a thirteenth century Persian rhythm by the name of Khafif-e-ramal, as well as a Rumanian folk-dance rhythm.", "E(3,7)" : "It is the Ruchenitza rhythm used in a Bulgarian folk-dance. It is also the metric pattern of Pink Floyd's Money.", "E(3,8)" : "It is none other than one of the most famous rythms on the planet. In Cuba it goes by the name of the tresillo and in the USA is often called the Habanera rhythm used in hundreds of rockabilly songs during the 1950s. It can often be heard in early rock-and-roll hits in the left-hand patterns of the piano, or played on the string bass or saxophone. A good example is the bass rhythm in Elvis Presley's Hound Dog. The tresillo pattern is also found widely in West African traditional music. For example, it is played on the atoke bell in the Sohu, an Ewe dance from Ghana. The tresillo can also be recognized as the first bar of the ubiquitous two-bar clave Son given by [1001001000101000].", "E(4,7)" : "It is a Ruchenitza Bulgarian folk-dance rhythm.", "E(4,9)" : "It is the Aksak rhythm of Turkey. It is also the metric pattern used by Dave Brubeck in his piece Rondo a la Turk.", "E(4,11)" : "It is the metric pattern used by Frank Zappa in his piece titled Outside Now.", "E(4,12)" : "It is periodic with four repetitions of E(1,3) = [100]. It is the (12/8)-time Fandago clapping pattern in the Flamenco music of southern Spain, where 1 denotes a loud clap and 0 soft clap.", "E(4,15)" : "It is the metric pattern of the pancam savari tal of North Indian music.", "E(5,6)" : "It yields the York-Samai pattern, a popular Arabic rhythm. It is also a handclapping rhythm used in the Al Medemi songs of Oman.", "E(5,7)" : "It is the Nawakhat pattern, a popular Arabic rhythm. In Nubia it is called the Al Noht rhythm.", "E(5,8)" : "It is the Cuban cinquillo pattern, the Malfuf rhythmic pattern of Egypt, as well as the Korean Nong Pyon drum pattern. Started on the second onset, it is a popular Middle Eastern rhythm, as well as the Timini rhythm of Senegal, the Adzogbo dance rhythm of Benin, the Spanish Tango, the Maksum of Egypt, and a 13th century Persian rhythm, the Al-saghil-alsani. When it is started on the third onset it is the Musemmen rhythm of Turkey. When it is started on the fourth onset it is the Kromanti rhythm of Surinam.", "E(5,9)" : "It is a popular Arabic rhythm called Agsag-Samai. Started on the second onset, it is a drum pattern used by the Venda in South Africa, as well as a Rumanian folk-dance rhythm. It is also the rhythmic pattern of the Sigaktistos rhythm of Greece, and the Samai aktsak rhythm of Turkey. Started on the third onset, it is the rhythmic pattern of the Nawahiid rhythm of Turkey.", "E(5,11)" : "It is the metric pattern of the Savari tala used in the Hindustani music of India. It is also a rhythmic pattern used in Bulgaria and Serbia. In Bulgaria is is used in the Kopanitsa. This metric pattern has been used by Moussorgsky in Pictures at an Exhibition. Started on the third onset, it is the rhythm of the dance Kalajdzijsko Oro from the FYROM, and it appears in Bulgarian music as well.", "E(5,12)" : "It is a common rhythm played in the Central African Republic by the Aka Pygmies. It is also the Venda clapping pattern of a South African children's song, and a rhythm pattern used in the FYROM. Started on the second onset, it is the Columbia bell pattern popular in Cuba and West Africa, as well as a drumming pattern used in the Chakacha dance of Kenya, and also used in the FYROM . Started on the third onset, it is the Bemba bell pattern used in Northern Zimbabwe, and the rhythm of the dance from the FYROM Ibraim Odza Oro. Started on the fourth onset, it is the Fume Fume bell pattern popular in West Africa, and is a rhythm used in the former Yugoslavia. Finally, when started on the fifth onset it is the Salve bell pattern used in the Dominican Republic in a rhythm called Canto de Vela in honor of the Virgin Mary, as well as the drum rhythmic pattern of the Moroccan Al Kudam.", "E(5,13)" : "It is a rhythm from the FYROM which is also played by starting it on the fourth onset as follows: [1010010010100].", "E(5,16)" : "It is the Bossa-Nova rhythm necklace of Brazil. The actual Bossa-Nova rhythm usually starts on the third onset as follows: [1001001000100100]. However, other starting places are also documented in world music practices, such as [1001001001000100].", "E(6,7)" : "It is the Pontakos rhythm of Greece when started on the sixth (last) onset.", "E(6,13)" : "It is the rhythm of the dance Mama Cone pita from the FYROM. Started on the third onset, it is the rhythm of the dance Postupano Oro from the FYROM, as well as the Krivo Plovdivsko Horo of Bulgaria.", "E(7,8)" : "When started on the seventh (last) onset, is a typical rhythm played on the Bendir (frame drum), and used in the accompaniment of songs of the Tuareg people of Libya.", "E(7,9)" : "It is the Bazaragana rhythmic pattern of Greece.", "E(7,10)" : "It is the Lenk fahhte rhythmic pattern of Turkey.", "E(7,12)" : "It is a common West African bell pattern. For example, it is used in the Mpre rhythm of the Ashanti people of Ghana. Started on the seventh (last) onset, it is a Yoruba bell pattern of Nigeria, a Babenzele pattern of Central Africa, and a Mende pattern of Sierra Leone.", "E(7,15)" : "It is a Bulgarian rhythm when started on the third onset.", "E(7,16)" : "It is a Samba rhythm necklace from Brazil. The actual Samba rhythm is [1010010101001010] obtained by starting E(7, 16) on the last onset, and it coincides with a rhythm from the FYROM. When E(7, 16) is started on the fifth onset it is a clapping pattern from Ghana. When it is started on the second onset it is a rhythmic pattern found in the former Yugoslavia.", "E(7,17)" : "It is a rhythm from the FYROM when started on the second onset.", "E(7,18)" : "It is a Bulgarian rhythmic pattern.", "E(8,17)" : "It is a Bulgarian rhythmic pattern which is also started on the fifth onset.", "E(8,19)" : "It is a Bulgarian rhythmic pattern when started on the second onset.", "E(9,14)" : "When started on the second onset, it is the rhythmic pattern of the Tsofyan rhythm of Algeria.", "E(9,16)" : "It is a rhythm necklace used in the Central African Republic. When it is started on the second onset it is a bell pattern of the Luba people of Congo. When it is started on the fourth onset it is a rhythm played in West and Central Africa, as well as a cow-bell pattern in the Brazilian samba. When it is started on the penultimate onset it is the bell pattern of the Ngbaka-Maibo rhythms of the Central African Republic.", "E(9,22)" : "It is a Bulgarian rhythmic pattern when started on the second onset.", "E(9,23)" : "It is a Bulgarian rhythm.", "E(11,12)" : "When started on the second onset, is thedrum pattern of the Rahmani (a cylindrical double-headed drum) used in the Sot silam dance from Mirbat in the South of Oman.", "E(11,24)" : "It is a rhythm necklace of the Aka Pygmies of Central Africa. It is usually started on the seventh onset. Started on the second onset, it is a Bulgarian rhythm.", "E(13,24)" : "It is another rhythm necklace of the Aka Pygmies of the upper Sangha. Started on the penultimate onset, it is the Bobangi metal-blade pattern used by the Aka Pygmies.", "E(15,34)" : "It is a Bulgarian rhythmic pattern when started on the penultimate onset." }
dict_rhythms = {'E(2,3)': 'A common Afro-Cuban drum pattern when started on the second onset as in [101]. For example, it is the conga rhythm of the (6/8)-time Swing Tumbao. It is common in Latin American music, as for example in the Cueca, and the coros de clave. It is common in Arabic music, as for example in the Al Taer rhythm of Nubia. It is also a rhythmic pattern of the Drum Dance of the Slavey Indians of Northern Canada', 'E(2,5)': "A rhythm found in Greece, Namibia, Rwanda and Central Africa. It is also a 13th century Persian rhythm called Khafif-e-ramal, as well as the rhythm of the dance Makedonka from the FYROM. Tchaikovsky used it as the metric pattern in the second movement of his Symphony No. 6. Started on the second onset as in [10010] it is a rhythm found in Central Africa, Bulgaria, Turkey, Turkestan and Norway. It is also the metric pattern of Dave Brubeck's Take Five, as well as Mars from The Planets by Gustav Holst. Rotated as in [10010100100], it is a Serbian rhythmic pattern. When it is started on the fourth (last) onset it is the Daasa al kbiri rhythmic pattern of Yemen.", 'E(3,4)': 'It is the archetypal pattern of the Cumbia from Colombia, as well as a Calypso rhythm from Trinidad. It is also a thirteenth century Persian rhythm called Khalif-e-saghil, as well as the trochoid choreic rhythmic pattern of ancient Greece.', 'E(3,5)': 'When started on the second onset, it is a thirteenth century Persian rhythm by the name of Khafif-e-ramal, as well as a Rumanian folk-dance rhythm.', 'E(3,7)': "It is the Ruchenitza rhythm used in a Bulgarian folk-dance. It is also the metric pattern of Pink Floyd's Money.", 'E(3,8)': "It is none other than one of the most famous rythms on the planet. In Cuba it goes by the name of the tresillo and in the USA is often called the Habanera rhythm used in hundreds of rockabilly songs during the 1950s. It can often be heard in early rock-and-roll hits in the left-hand patterns of the piano, or played on the string bass or saxophone. A good example is the bass rhythm in Elvis Presley's Hound Dog. The tresillo pattern is also found widely in West African traditional music. For example, it is played on the atoke bell in the Sohu, an Ewe dance from Ghana. The tresillo can also be recognized as the first bar of the ubiquitous two-bar clave Son given by [1001001000101000].", 'E(4,7)': 'It is a Ruchenitza Bulgarian folk-dance rhythm.', 'E(4,9)': 'It is the Aksak rhythm of Turkey. It is also the metric pattern used by Dave Brubeck in his piece Rondo a la Turk.', 'E(4,11)': 'It is the metric pattern used by Frank Zappa in his piece titled Outside Now.', 'E(4,12)': 'It is periodic with four repetitions of E(1,3) = [100]. It is the (12/8)-time Fandago clapping pattern in the Flamenco music of southern Spain, where 1 denotes a loud clap and 0 soft clap.', 'E(4,15)': 'It is the metric pattern of the pancam savari tal of North Indian music.', 'E(5,6)': 'It yields the York-Samai pattern, a popular Arabic rhythm. It is also a handclapping rhythm used in the Al Medemi songs of Oman.', 'E(5,7)': 'It is the Nawakhat pattern, a popular Arabic rhythm. In Nubia it is called the Al Noht rhythm.', 'E(5,8)': 'It is the Cuban cinquillo pattern, the Malfuf rhythmic pattern of Egypt, as well as the Korean Nong Pyon drum pattern. Started on the second onset, it is a popular Middle Eastern rhythm, as well as the Timini rhythm of Senegal, the Adzogbo dance rhythm of Benin, the Spanish Tango, the Maksum of Egypt, and a 13th century Persian rhythm, the Al-saghil-alsani. When it is started on the third onset it is the Musemmen rhythm of Turkey. When it is started on the fourth onset it is the Kromanti rhythm of Surinam.', 'E(5,9)': 'It is a popular Arabic rhythm called Agsag-Samai. Started on the second onset, it is a drum pattern used by the Venda in South Africa, as well as a Rumanian folk-dance rhythm. It is also the rhythmic pattern of the Sigaktistos rhythm of Greece, and the Samai aktsak rhythm of Turkey. Started on the third onset, it is the rhythmic pattern of the Nawahiid rhythm of Turkey.', 'E(5,11)': 'It is the metric pattern of the Savari tala used in the Hindustani music of India. It is also a rhythmic pattern used in Bulgaria and Serbia. In Bulgaria is is used in the Kopanitsa. This metric pattern has been used by Moussorgsky in Pictures at an Exhibition. Started on the third onset, it is the rhythm of the dance Kalajdzijsko Oro from the FYROM, and it appears in Bulgarian music as well.', 'E(5,12)': "It is a common rhythm played in the Central African Republic by the Aka Pygmies. It is also the Venda clapping pattern of a South African children's song, and a rhythm pattern used in the FYROM. Started on the second onset, it is the Columbia bell pattern popular in Cuba and West Africa, as well as a drumming pattern used in the Chakacha dance of Kenya, and also used in the FYROM . Started on the third onset, it is the Bemba bell pattern used in Northern Zimbabwe, and the rhythm of the dance from the FYROM Ibraim Odza Oro. Started on the fourth onset, it is the Fume Fume bell pattern popular in West Africa, and is a rhythm used in the former Yugoslavia. Finally, when started on the fifth onset it is the Salve bell pattern used in the Dominican Republic in a rhythm called Canto de Vela in honor of the Virgin Mary, as well as the drum rhythmic pattern of the Moroccan Al Kudam.", 'E(5,13)': 'It is a rhythm from the FYROM which is also played by starting it on the fourth onset as follows: [1010010010100].', 'E(5,16)': 'It is the Bossa-Nova rhythm necklace of Brazil. The actual Bossa-Nova rhythm usually starts on the third onset as follows: [1001001000100100]. However, other starting places are also documented in world music practices, such as [1001001001000100].', 'E(6,7)': 'It is the Pontakos rhythm of Greece when started on the sixth (last) onset.', 'E(6,13)': 'It is the rhythm of the dance Mama Cone pita from the FYROM. Started on the third onset, it is the rhythm of the dance Postupano Oro from the FYROM, as well as the Krivo Plovdivsko Horo of Bulgaria.', 'E(7,8)': 'When started on the seventh (last) onset, is a typical rhythm played on the Bendir (frame drum), and used in the accompaniment of songs of the Tuareg people of Libya.', 'E(7,9)': 'It is the Bazaragana rhythmic pattern of Greece.', 'E(7,10)': 'It is the Lenk fahhte rhythmic pattern of Turkey.', 'E(7,12)': 'It is a common West African bell pattern. For example, it is used in the Mpre rhythm of the Ashanti people of Ghana. Started on the seventh (last) onset, it is a Yoruba bell pattern of Nigeria, a Babenzele pattern of Central Africa, and a Mende pattern of Sierra Leone.', 'E(7,15)': 'It is a Bulgarian rhythm when started on the third onset.', 'E(7,16)': 'It is a Samba rhythm necklace from Brazil. The actual Samba rhythm is [1010010101001010] obtained by starting E(7, 16) on the last onset, and it coincides with a rhythm from the FYROM. When E(7, 16) is started on the fifth onset it is a clapping pattern from Ghana. When it is started on the second onset it is a rhythmic pattern found in the former Yugoslavia.', 'E(7,17)': 'It is a rhythm from the FYROM when started on the second onset.', 'E(7,18)': 'It is a Bulgarian rhythmic pattern.', 'E(8,17)': 'It is a Bulgarian rhythmic pattern which is also started on the fifth onset.', 'E(8,19)': 'It is a Bulgarian rhythmic pattern when started on the second onset.', 'E(9,14)': 'When started on the second onset, it is the rhythmic pattern of the Tsofyan rhythm of Algeria.', 'E(9,16)': 'It is a rhythm necklace used in the Central African Republic. When it is started on the second onset it is a bell pattern of the Luba people of Congo. When it is started on the fourth onset it is a rhythm played in West and Central Africa, as well as a cow-bell pattern in the Brazilian samba. When it is started on the penultimate onset it is the bell pattern of the Ngbaka-Maibo rhythms of the Central African Republic.', 'E(9,22)': 'It is a Bulgarian rhythmic pattern when started on the second onset.', 'E(9,23)': 'It is a Bulgarian rhythm.', 'E(11,12)': 'When started on the second onset, is thedrum pattern of the Rahmani (a cylindrical double-headed drum) used in the Sot silam dance from Mirbat in the South of Oman.', 'E(11,24)': 'It is a rhythm necklace of the Aka Pygmies of Central Africa. It is usually started on the seventh onset. Started on the second onset, it is a Bulgarian rhythm.', 'E(13,24)': 'It is another rhythm necklace of the Aka Pygmies of the upper Sangha. Started on the penultimate onset, it is the Bobangi metal-blade pattern used by the Aka Pygmies.', 'E(15,34)': 'It is a Bulgarian rhythmic pattern when started on the penultimate onset.'}
def fun(a, b): return 1 fun(1, 2)
def fun(a, b): return 1 fun(1, 2)
# Create a program to check if an integer is a perfect square. # 4, 9, 25 any ideas? Use Square Root # input num = int(input('Enter a value: ')) # processing & output if (num ** 0.5) % 1 != 0: print(num, 'is not a perfect square.') else: print(num, 'is a perfect square.')
num = int(input('Enter a value: ')) if num ** 0.5 % 1 != 0: print(num, 'is not a perfect square.') else: print(num, 'is a perfect square.')
#!/usr/bin/env python # -*- coding: utf-8; py-indent-offset:4 -*- ############################################################################### # Copyright 2018 The AnPyLar Team. All Rights Reserved. # Use of this source code is governed by an MIT-style license that # can be found in the LICENSE file at http://anpylar.com/mit-license ############################################################################### styles_css = ''' /* Master Styles */ h1 { color: #369; font-family: Arial, Helvetica, sans-serif; font-size: 250%; } h2, h3 { color: #444; font-family: Arial, Helvetica, sans-serif; font-weight: lighter; } body { margin: 2em; } body, input[text], button { color: #888; font-family: Cambria, Georgia; } a { cursor: pointer; cursor: hand; } button { font-family: Arial; background-color: #eee; border: none; padding: 5px 10px; border-radius: 4px; cursor: pointer; cursor: hand; } button:hover { background-color: #cfd8dc; } button:disabled { background-color: #eee; color: #aaa; cursor: auto; } /* Navigation link styles */ nav a { padding: 5px 10px; text-decoration: none; margin-right: 10px; margin-top: 10px; display: inline-block; background-color: #eee; border-radius: 4px; } nav a:visited, a:link { color: #607D8B; } nav a:hover { color: #039be5; background-color: #CFD8DC; } nav a.active { color: #039be5; } /* everywhere else */ * { font-family: Arial, Helvetica, sans-serif; } /* Copyright 2017 Google Inc. All Rights Reserved. Use of this source code is governed by an MIT-style license that can be found in the LICENSE file at http://angular.io/license */ '''
styles_css = '\n/* Master Styles */\nh1 {\n color: #369;\n font-family: Arial, Helvetica, sans-serif;\n font-size: 250%;\n}\nh2, h3 {\n color: #444;\n font-family: Arial, Helvetica, sans-serif;\n font-weight: lighter;\n}\nbody {\n margin: 2em;\n}\nbody, input[text], button {\n color: #888;\n font-family: Cambria, Georgia;\n}\na {\n cursor: pointer;\n cursor: hand;\n}\nbutton {\n font-family: Arial;\n background-color: #eee;\n border: none;\n padding: 5px 10px;\n border-radius: 4px;\n cursor: pointer;\n cursor: hand;\n}\nbutton:hover {\n background-color: #cfd8dc;\n}\nbutton:disabled {\n background-color: #eee;\n color: #aaa;\n cursor: auto;\n}\n\n/* Navigation link styles */\nnav a {\n padding: 5px 10px;\n text-decoration: none;\n margin-right: 10px;\n margin-top: 10px;\n display: inline-block;\n background-color: #eee;\n border-radius: 4px;\n}\nnav a:visited, a:link {\n color: #607D8B;\n}\nnav a:hover {\n color: #039be5;\n background-color: #CFD8DC;\n}\nnav a.active {\n color: #039be5;\n}\n\n/* everywhere else */\n* {\n font-family: Arial, Helvetica, sans-serif;\n}\n\n\n/*\nCopyright 2017 Google Inc. All Rights Reserved.\nUse of this source code is governed by an MIT-style license that\ncan be found in the LICENSE file at http://angular.io/license\n*/\n'
def Insertion_Sort(lst): l = len(lst) for i in range(1,l): temp = lst[i] j = i-1 while j>=0: if temp[0]<lst[j][0]: lst[j+1] = lst[j] lst[j] = temp j = j-1 return lst lst = [] lst = ['Tininha', 'Dudinha','Carlinhos','Marquinhos','Joaozinho','Bruninha','Fernandinha','Rafinha','Pedrinho','Aninha','Tamirinha','Gaguinho','Zezinho','Luquinhas','Julhinha'] print(Insertion_Sort(lst)) lst_1 = ['Tininha', 'Dudinha','Carlinhos','Marquinhos','Joaozinho','Bruninha','Fernandinha','Rafinha','Pedrinho','Aninha','Tamirinha','Gaguinho','Zezinho','Luquinhas','Julhinha'] lst_1.sort() # sort() will sort it in alphabetic order print(lst_1) lst_1.sort(reverse = True) # sort() will sort it in alphabetic DSC order print(lst_1) lst_1.sort(key = len) # sort() will sort it according to length print(lst_1)
def insertion__sort(lst): l = len(lst) for i in range(1, l): temp = lst[i] j = i - 1 while j >= 0: if temp[0] < lst[j][0]: lst[j + 1] = lst[j] lst[j] = temp j = j - 1 return lst lst = [] lst = ['Tininha', 'Dudinha', 'Carlinhos', 'Marquinhos', 'Joaozinho', 'Bruninha', 'Fernandinha', 'Rafinha', 'Pedrinho', 'Aninha', 'Tamirinha', 'Gaguinho', 'Zezinho', 'Luquinhas', 'Julhinha'] print(insertion__sort(lst)) lst_1 = ['Tininha', 'Dudinha', 'Carlinhos', 'Marquinhos', 'Joaozinho', 'Bruninha', 'Fernandinha', 'Rafinha', 'Pedrinho', 'Aninha', 'Tamirinha', 'Gaguinho', 'Zezinho', 'Luquinhas', 'Julhinha'] lst_1.sort() print(lst_1) lst_1.sort(reverse=True) print(lst_1) lst_1.sort(key=len) print(lst_1)
# parsetab.py # This file is automatically generated. Do not edit. _tabversion = '3.2' _lr_method = 'LALR' _lr_signature = 'D\xccZ\x0b=\xf2\xd6\x89\x1e\xeb\xa3n\xa2z\xd6n' _lr_action_items = {'PEEK':([179,250,251,256,296,303,325,346,351,358,361,372,374,375,376,378,381,382,],[244,244,-98,-82,-81,-88,-97,-95,-89,-94,-99,-90,-92,-100,-101,-93,-91,-96,]),'TRANS':([0,1,2,5,7,15,45,56,62,73,120,149,161,178,220,229,239,256,257,258,263,272,273,274,281,289,291,296,313,315,317,319,322,339,343,344,354,356,],[8,8,-29,-70,-34,-39,-65,-6,-7,-30,-64,-32,-31,-10,-33,-17,-14,-82,-41,-36,-38,-40,-35,-37,8,-18,-16,-81,-20,8,-19,-21,-13,-8,-15,-12,-9,-11,]),'STAR':([5,11,20,22,61,81,83,84,87,93,94,96,97,99,100,101,102,132,135,136,138,140,142,160,162,174,185,197,199,201,205,206,207,208,209,210,211,212,213,214,215,216,217,218,219,227,254,264,266,269,271,295,309,310,330,331,333,335,336,353,363,373,],[-70,33,-62,-61,-60,128,-139,-138,-115,-107,-104,-137,-106,-110,-142,147,-140,-109,147,147,147,-105,-133,-130,147,241,128,147,-111,-134,-141,147,147,-116,147,147,147,147,147,147,147,147,-117,147,147,33,147,-135,-113,-136,-108,147,-137,147,147,147,-112,-102,-114,147,-103,147,]),'SLASH':([5,20,22,61,83,84,87,93,94,96,97,99,100,101,102,132,135,136,138,140,142,160,162,197,199,201,205,206,207,208,209,210,211,212,213,214,215,216,217,218,219,254,264,266,269,271,295,309,310,330,331,333,335,336,353,363,373,],[-70,-62,-61,-60,-139,-138,-115,-107,-104,-137,-106,-110,-142,157,-140,-109,157,157,157,-105,-133,-130,157,157,-111,-134,-141,157,157,-116,157,157,157,157,157,157,157,157,-117,157,157,157,-135,-113,-136,-108,157,-137,157,157,157,-112,-102,-114,157,-103,157,]),'FLOATNUMBER':([54,88,89,91,98,103,105,133,143,145,146,147,148,150,151,152,153,154,155,156,157,158,159,179,245,250,251,256,265,267,268,270,296,302,303,304,325,334,346,351,358,361,367,372,374,375,376,378,381,382,],[83,83,83,83,83,83,83,83,83,83,83,83,83,83,83,83,83,83,83,83,83,83,83,83,83,83,-98,-82,83,83,83,83,-81,83,-88,83,-97,83,-95,-89,-94,-99,83,-90,-92,-100,-101,-93,-91,-96,]),'VOID':([0,1,2,5,7,15,45,56,62,73,120,149,161,172,178,220,229,230,233,235,237,238,239,256,257,258,263,272,273,274,281,289,291,296,313,315,317,319,322,339,343,344,354,356,],[3,3,-29,-70,-34,-39,-65,-6,-7,-30,-64,-32,-31,3,-10,-33,-17,3,-26,3,-27,-28,-14,-82,-41,-36,-38,-40,-35,-37,3,-18,-16,-81,-20,3,-19,-21,-13,-8,-15,-12,-9,-11,]),'GLOBAL':([0,1,2,5,7,15,45,56,62,73,120,149,161,178,220,229,239,256,257,258,263,272,273,274,281,289,291,296,313,315,317,319,322,339,343,344,354,356,],[4,4,-29,-70,-34,-39,-65,-6,-7,-30,-64,-32,-31,-10,-33,-17,-14,-82,-41,-36,-38,-40,-35,-37,4,-18,-16,-81,-20,4,-19,-21,-13,-8,-15,-12,-9,-11,]),'NUMBER':([54,88,89,91,98,103,105,123,133,143,145,146,147,148,150,151,152,153,154,155,156,157,158,159,179,188,245,250,251,256,265,267,268,270,296,302,303,304,325,334,346,351,358,361,367,372,374,375,376,378,381,382,],[84,84,84,84,84,84,84,182,84,84,84,84,84,84,84,84,84,84,84,84,84,84,84,84,84,260,84,84,-98,-82,84,84,84,84,-81,84,-88,84,-97,84,-95,-89,-94,-99,84,-90,-92,-100,-101,-93,-91,-96,]),',':([5,20,22,32,44,45,46,48,49,55,58,59,60,61,63,64,65,68,75,77,78,81,83,84,87,93,94,96,97,99,100,102,116,120,121,126,127,130,132,135,136,140,142,160,163,164,171,180,181,182,189,191,194,197,199,200,201,205,206,207,208,209,210,211,212,213,214,215,216,217,218,219,243,259,260,261,264,266,269,271,275,282,284,288,306,309,324,328,329,332,333,335,336,341,357,359,362,363,],[-70,-62,-61,51,51,-65,67,71,51,51,51,51,51,-60,51,51,114,119,-80,124,125,129,-139,-138,-115,-107,-104,-137,-106,-110,-142,-140,174,-64,177,51,-51,51,-109,-132,-131,-105,-133,-130,51,51,232,-78,-77,-79,-52,129,-142,265,-111,268,-134,-141,-126,-129,-116,-125,-124,-122,-123,-119,-120,-121,-118,-117,-128,-127,51,-56,-54,-55,-135,-113,-136,-108,51,51,318,51,-53,334,345,348,349,352,-112,-102,-114,51,51,367,370,-103,]),'GT':([5,20,22,61,83,84,87,93,94,96,97,99,100,101,102,132,135,136,138,140,142,160,162,197,199,201,205,206,207,208,209,210,211,212,213,214,215,216,217,218,219,254,264,266,269,271,295,309,310,330,331,333,335,336,353,363,373,],[-70,-62,-61,-60,-139,-138,-115,-107,-104,-137,-106,-110,-142,155,-140,-109,155,155,155,-105,-133,-130,155,155,-111,-134,-141,155,-129,-116,155,155,-122,-123,-119,-120,-121,-118,-117,-128,155,155,-135,-113,-136,-108,155,-137,155,155,155,-112,-102,-114,155,-103,155,]),'NEW':([54,88,89,91,98,103,105,133,143,145,146,147,148,150,151,152,153,154,155,156,157,158,159,179,245,250,251,256,265,267,268,270,296,302,303,304,325,334,346,351,358,361,367,372,374,375,376,378,381,382,],[86,86,86,86,86,86,86,86,86,86,86,86,86,86,86,86,86,86,86,86,86,86,86,86,86,86,-98,-82,86,86,86,86,-81,86,-88,86,-97,86,-95,-89,-94,-99,86,-90,-92,-100,-101,-93,-91,-96,]),'RIGHTSHIFT':([5,20,22,61,83,84,87,93,94,96,97,99,100,101,102,132,135,136,138,140,142,160,162,197,199,201,205,206,207,208,209,210,211,212,213,214,215,216,217,218,219,254,264,266,269,271,295,309,310,330,331,333,335,336,353,363,373,],[-70,-62,-61,-60,-139,-138,-115,-107,-104,-137,-106,-110,-142,158,-140,-109,158,158,158,-105,-133,-130,158,158,-111,-134,-141,158,-129,-116,158,158,158,158,-119,158,158,-118,-117,-128,158,158,-135,-113,-136,-108,158,-137,158,158,158,-112,-102,-114,158,-103,158,]),'CHECK_NEXT_CYCLE':([179,250,251,256,296,303,325,346,351,358,361,372,374,375,376,378,381,382,],[247,247,-98,-82,-81,-88,-97,-95,-89,-94,-99,-90,-92,-100,-101,-93,-91,-96,]),'DOT':([5,20,22,61,83,84,87,93,94,96,97,99,100,102,132,140,199,201,205,264,266,269,271,309,333,335,336,363,],[-70,-62,-61,-60,-139,-138,134,-107,-104,-137,-106,-110,-142,-140,-109,-105,-111,-134,-141,-135,-113,-136,-108,-137,-112,-102,-114,-103,]),'LEFTSHIFT':([5,20,22,61,83,84,87,93,94,96,97,99,100,101,102,132,135,136,138,140,142,160,162,197,199,201,205,206,207,208,209,210,211,212,213,214,215,216,217,218,219,254,264,266,269,271,295,309,310,330,331,333,335,336,353,363,373,],[-70,-62,-61,-60,-139,-138,-115,-107,-104,-137,-106,-110,-142,146,-140,-109,146,146,146,-105,-133,-130,146,146,-111,-134,-141,146,-129,-116,146,146,146,146,-119,146,146,-118,-117,-128,146,146,-135,-113,-136,-108,146,-137,146,146,146,-112,-102,-114,146,-103,146,]),'INCR':([54,88,89,91,98,103,105,133,143,145,146,147,148,150,151,152,153,154,155,156,157,158,159,179,245,250,251,256,265,267,268,270,296,302,303,304,325,334,346,351,358,361,367,372,374,375,376,378,381,382,],[89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,-98,-82,89,89,89,89,-81,89,-88,89,-97,89,-95,-89,-94,-99,89,-90,-92,-100,-101,-93,-91,-96,]),'LE':([5,20,22,61,83,84,87,93,94,96,97,99,100,101,102,132,135,136,138,140,142,160,162,197,199,201,205,206,207,208,209,210,211,212,213,214,215,216,217,218,219,254,264,266,269,271,295,309,310,330,331,333,335,336,353,363,373,],[-70,-62,-61,-60,-139,-138,-115,-107,-104,-137,-106,-110,-142,151,-140,-109,151,151,151,-105,-133,-130,151,151,-111,-134,-141,151,-129,-116,151,151,-122,-123,-119,-120,-121,-118,-117,-128,151,151,-135,-113,-136,-108,151,-137,151,151,151,-112,-102,-114,151,-103,151,]),'SEMI':([5,20,22,32,34,40,50,52,55,61,68,75,76,77,83,84,87,93,94,96,97,99,100,101,102,104,126,130,132,135,136,140,142,160,162,163,164,168,180,181,182,183,187,193,199,201,205,206,207,208,209,210,211,212,213,214,215,216,217,218,219,221,222,254,264,266,269,271,275,282,295,312,323,326,331,333,335,336,341,347,355,363,368,380,],[-70,-62,-61,-2,56,62,73,-74,-2,-60,117,-80,-73,-76,-139,-138,-115,-107,-104,-137,-106,-110,-142,149,-140,161,-2,-2,-109,-132,-131,-105,-133,-130,220,-2,-2,229,-78,-77,-79,-75,258,263,-111,-134,-141,-126,-129,-116,-125,-124,-122,-123,-119,-120,-121,-118,-117,-128,-127,273,274,303,-135,-113,-136,-108,-2,-2,325,337,344,346,351,-112,-102,-114,-2,358,364,-103,374,382,]),'STATIC_CAST':([54,88,89,91,98,103,105,133,143,145,146,147,148,150,151,152,153,154,155,156,157,158,159,179,245,250,251,256,265,267,268,270,296,302,303,304,325,334,346,351,358,361,367,372,374,375,376,378,381,382,],[90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,-98,-82,90,90,90,90,-81,90,-88,90,-97,90,-95,-89,-94,-99,90,-90,-92,-100,-101,-93,-91,-96,]),')':([5,20,22,44,45,49,52,53,57,58,59,60,61,63,64,66,72,75,76,77,78,79,80,81,82,83,84,87,93,94,96,97,99,100,102,106,107,108,109,111,112,113,116,120,125,127,129,132,135,136,138,140,142,143,160,180,181,182,183,184,186,189,190,191,192,194,195,196,197,199,201,202,204,205,206,207,208,209,210,211,212,213,214,215,216,217,218,219,240,241,242,243,259,260,261,264,265,266,267,269,270,271,288,293,297,306,307,308,309,310,311,321,327,330,333,335,336,353,357,359,360,363,365,373,377,],[-70,-62,-61,-2,-65,-2,-74,-2,-2,-2,110,-2,-60,-2,-2,115,122,-80,-73,-76,-49,126,-50,-58,130,-139,-138,-115,-107,-104,-137,-106,-110,-142,-140,163,164,165,166,168,169,170,173,-64,-2,-51,-2,-109,-132,-131,201,-105,-133,-2,-130,-78,-77,-79,-75,-48,-50,-52,-57,-58,-59,-142,264,-87,-86,-111,-134,269,271,-141,-126,-129,-116,-125,-124,-122,-123,-119,-120,-121,-118,-117,-128,-127,-71,-72,292,-2,-56,-54,-55,-135,-2,-113,-2,-136,-2,-108,-2,323,326,-53,-85,333,-137,335,336,342,347,350,-112,-102,-114,363,-2,366,368,-103,371,379,380,]),'(':([4,5,8,9,10,17,18,19,23,24,26,32,35,54,85,88,89,90,91,92,98,100,103,105,133,143,145,146,147,148,150,151,152,153,154,155,156,157,158,159,179,199,203,244,245,247,248,249,250,251,252,253,255,256,265,267,268,270,296,302,303,304,325,334,346,351,358,361,367,372,374,375,376,378,381,382,],[28,-70,29,30,31,36,37,38,41,42,43,53,57,91,131,91,91,137,91,139,91,143,91,91,91,91,91,91,91,91,91,91,91,91,91,91,91,91,91,91,91,267,270,294,91,297,298,299,91,-98,301,302,305,-82,91,91,91,91,-81,91,-88,91,-97,91,-95,-89,-94,-99,91,-90,-92,-100,-101,-93,-91,-96,]),'IS_INVALID':([54,88,89,91,98,103,105,133,143,145,146,147,148,150,151,152,153,154,155,156,157,158,159,179,245,250,251,256,265,267,268,270,296,302,303,304,325,334,346,351,358,361,367,372,374,375,376,378,381,382,],[92,92,92,92,92,92,92,92,92,92,92,92,92,92,92,92,92,92,92,92,92,92,92,92,92,92,-98,-82,92,92,92,92,-81,92,-88,92,-97,92,-95,-89,-94,-99,92,-90,-92,-100,-101,-93,-91,-96,]),'NE':([5,20,22,61,83,84,87,93,94,96,97,99,100,101,102,132,135,136,138,140,142,160,162,197,199,201,205,206,207,208,209,210,211,212,213,214,215,216,217,218,219,254,264,266,269,271,295,309,310,330,331,333,335,336,353,363,373,],[-70,-62,-61,-60,-139,-138,-115,-107,-104,-137,-106,-110,-142,148,-140,-109,148,148,148,-105,-133,-130,148,148,-111,-134,-141,148,-129,-116,-125,-124,-122,-123,-119,-120,-121,-118,-117,-128,148,148,-135,-113,-136,-108,148,-137,148,148,148,-112,-102,-114,148,-103,148,]),'OUT_PORT':([0,1,2,5,7,15,45,56,62,73,120,149,161,178,220,229,239,256,257,258,263,272,273,274,281,289,291,296,313,315,317,319,322,339,343,344,354,356,],[9,9,-29,-70,-34,-39,-65,-6,-7,-30,-64,-32,-31,-10,-33,-17,-14,-82,-41,-36,-38,-40,-35,-37,9,-18,-16,-81,-20,9,-19,-21,-13,-8,-15,-12,-9,-11,]),'ENQUEUE':([179,250,251,256,296,303,325,346,351,358,361,372,374,375,376,378,381,382,],[249,249,-98,-82,-81,-88,-97,-95,-89,-94,-99,-90,-92,-100,-101,-93,-91,-96,]),'LT':([5,20,22,61,83,84,87,93,94,96,97,99,100,101,102,132,135,136,138,140,142,160,162,197,199,201,205,206,207,208,209,210,211,212,213,214,215,216,217,218,219,254,264,266,269,271,295,309,310,330,331,333,335,336,353,363,373,],[-70,-62,-61,-60,-139,-138,-115,-107,-104,-137,-106,-110,-142,154,-140,-109,154,154,154,-105,-133,-130,154,154,-111,-134,-141,154,-129,-116,154,154,-122,-123,-119,-120,-121,-118,-117,-128,154,154,-135,-113,-136,-108,154,-137,154,154,154,-112,-102,-114,154,-103,154,]),'DOUBLE_COLON':([5,20,22,61,95,100,],[-70,39,-61,-60,141,-61,]),'PLUS':([5,20,22,61,83,84,87,93,94,96,97,99,100,101,102,132,135,136,138,140,142,160,162,197,199,201,205,206,207,208,209,210,211,212,213,214,215,216,217,218,219,254,264,266,269,271,295,309,310,330,331,333,335,336,353,363,373,],[-70,-62,-61,-60,-139,-138,-115,-107,-104,-137,-106,-110,-142,156,-140,-109,156,156,156,-105,-133,-130,156,156,-111,-134,-141,156,156,-116,156,156,156,156,-119,156,156,-118,-117,156,156,156,-135,-113,-136,-108,156,-137,156,156,156,-112,-102,-114,156,-103,156,]),'DECR':([54,88,89,91,98,103,105,133,143,145,146,147,148,150,151,152,153,154,155,156,157,158,159,179,245,250,251,256,265,267,268,270,296,302,303,304,325,334,346,351,358,361,367,372,374,375,376,378,381,382,],[88,88,88,88,88,88,88,88,88,88,88,88,88,88,88,88,88,88,88,88,88,88,88,88,88,88,-98,-82,88,88,88,88,-81,88,-88,88,-97,88,-95,-89,-94,-99,88,-90,-92,-100,-101,-93,-91,-96,]),'ACTION':([0,1,2,5,7,15,45,56,62,73,120,149,161,178,220,229,239,256,257,258,263,272,273,274,281,289,291,296,313,315,317,319,322,339,343,344,354,356,],[10,10,-29,-70,-34,-39,-65,-6,-7,-30,-64,-32,-31,-10,-33,-17,-14,-82,-41,-36,-38,-40,-35,-37,10,-18,-16,-81,-20,10,-19,-21,-13,-8,-15,-12,-9,-11,]),':':([5,100,110,166,340,],[-70,144,167,224,144,]),'=':([5,74,],[-70,123,]),'ASSIGN':([5,20,22,32,55,61,83,84,87,93,94,96,97,99,100,102,127,132,135,136,140,142,160,189,199,201,205,206,207,208,209,210,211,212,213,214,215,216,217,218,219,254,264,266,269,271,282,333,335,336,363,],[-70,-62,-61,54,105,-60,-139,-138,-115,-107,-104,-137,-106,-110,-142,-140,188,-109,-132,-131,-105,-133,-130,262,-111,-134,-141,-126,-129,-116,-125,-124,-122,-123,-119,-120,-121,-118,-117,-128,-127,304,-135,-113,-136,-108,54,-112,-102,-114,-103,]),'$end':([0,1,2,5,6,7,12,13,15,25,27,45,56,62,73,120,149,161,178,220,229,239,256,257,258,263,272,273,274,289,291,296,313,317,319,322,339,343,344,354,356,],[-2,-2,-29,-70,0,-34,-5,-3,-39,-1,-4,-65,-6,-7,-30,-64,-32,-31,-10,-33,-17,-14,-82,-41,-36,-38,-40,-35,-37,-18,-16,-81,-20,-19,-21,-13,-8,-15,-12,-9,-11,]),'IDENT':([0,1,2,3,5,7,11,15,16,20,22,28,29,30,31,33,36,37,38,39,41,42,43,45,47,51,53,54,56,57,61,62,67,68,71,73,81,86,88,89,91,95,98,100,103,105,114,117,119,120,123,124,125,128,129,131,133,134,137,139,141,143,144,145,146,147,148,149,150,151,152,153,154,155,156,157,158,159,161,167,172,173,174,177,178,179,185,220,223,224,225,227,229,230,231,232,233,235,237,238,239,245,250,251,256,257,258,263,265,267,268,270,272,273,274,277,281,286,289,291,292,294,296,298,299,301,302,303,304,305,313,315,317,318,319,322,325,334,337,339,343,344,345,346,348,349,351,354,356,358,361,364,367,372,374,375,376,378,381,382,],[5,5,-29,-63,-70,-34,5,-39,5,-62,-61,5,5,5,5,5,5,5,5,5,5,5,5,-65,5,5,5,5,-6,5,-60,-7,5,5,5,-30,5,5,5,5,5,5,5,-61,5,5,5,5,5,-64,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,-32,5,5,5,5,5,5,5,5,5,5,-31,5,5,5,5,5,-10,5,5,-33,5,5,5,5,-17,5,5,5,-26,5,-27,-28,5,5,5,-98,-82,-41,-36,-38,5,5,5,5,-40,-35,-37,5,5,5,-18,-16,5,5,-81,5,5,5,5,-88,5,5,-20,5,-19,5,-21,5,-97,5,-44,-8,-15,-12,5,-95,5,5,-89,-9,-11,-94,-99,-47,5,-90,-92,-100,-101,-93,-91,-96,]),'PROTOCOL':([0,1,2,5,7,15,45,56,62,73,120,149,161,178,220,229,239,256,257,258,263,272,273,274,281,289,291,296,313,315,317,319,322,339,343,344,354,356,],[14,14,-29,-70,-34,-39,-65,-6,-7,-30,-64,-32,-31,-10,-33,-17,-14,-82,-41,-36,-38,-40,-35,-37,14,-18,-16,-81,-20,14,-19,-21,-13,-8,-15,-12,-9,-11,]),'STRING':([14,21,51,54,88,89,91,98,103,105,123,124,133,143,145,146,147,148,150,151,152,153,154,155,156,157,158,159,179,188,245,250,251,256,262,265,267,268,270,296,302,303,304,325,334,346,351,352,358,361,367,370,372,374,375,376,378,381,382,],[34,40,75,96,96,96,96,96,96,96,181,75,96,96,96,96,96,96,96,96,96,96,96,96,96,96,96,96,96,259,96,96,-98,-82,306,96,96,309,96,-81,96,-88,96,-97,96,-95,-89,362,-94,-99,96,377,-90,-92,-100,-101,-93,-91,-96,]),'STALL_AND_WAIT':([179,250,251,256,296,303,325,346,351,358,361,372,374,375,376,378,381,382,],[252,252,-98,-82,-81,-88,-97,-95,-89,-94,-99,-90,-92,-100,-101,-93,-91,-96,]),'OOD':([54,88,89,91,98,103,105,133,143,145,146,147,148,150,151,152,153,154,155,156,157,158,159,179,245,250,251,256,265,267,268,270,296,302,303,304,325,334,346,351,358,361,367,372,374,375,376,378,381,382,],[99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,-98,-82,99,99,99,99,-81,99,-88,99,-97,99,-95,-89,-94,-99,99,-90,-92,-100,-101,-93,-91,-96,]),'ENUM':([0,1,2,5,7,15,45,56,62,73,120,149,161,178,220,229,239,256,257,258,263,272,273,274,281,289,291,296,313,315,317,319,322,339,343,344,354,356,],[17,17,-29,-70,-34,-39,-65,-6,-7,-30,-64,-32,-31,-10,-33,-17,-14,-82,-41,-36,-38,-40,-35,-37,17,-18,-16,-81,-20,17,-19,-21,-13,-8,-15,-12,-9,-11,]),'ELSE':([256,296,361,],[-82,-81,369,]),'MACHINE':([0,1,2,5,7,15,45,56,62,73,120,149,161,178,220,229,239,256,257,258,263,272,273,274,281,289,291,296,313,315,317,319,322,339,343,344,354,356,],[18,18,-29,-70,-34,-39,-65,-6,-7,-30,-64,-32,-31,-10,-33,-17,-14,-82,-41,-36,-38,-40,-35,-37,18,-18,-16,-81,-20,18,-19,-21,-13,-8,-15,-12,-9,-11,]),'GE':([5,20,22,61,83,84,87,93,94,96,97,99,100,101,102,132,135,136,138,140,142,160,162,197,199,201,205,206,207,208,209,210,211,212,213,214,215,216,217,218,219,254,264,266,269,271,295,309,310,330,331,333,335,336,353,363,373,],[-70,-62,-61,-60,-139,-138,-115,-107,-104,-137,-106,-110,-142,152,-140,-109,152,152,152,-105,-133,-130,152,152,-111,-134,-141,152,-129,-116,152,152,-122,-123,-119,-120,-121,-118,-117,-128,152,152,-135,-113,-136,-108,152,-137,152,152,152,-112,-102,-114,152,-103,152,]),'EXTERN_TYPE':([0,1,2,5,7,15,45,56,62,73,120,149,161,178,220,229,239,256,257,258,263,272,273,274,281,289,291,296,313,315,317,319,322,339,343,344,354,356,],[19,19,-29,-70,-34,-39,-65,-6,-7,-30,-64,-32,-31,-10,-33,-17,-14,-82,-41,-36,-38,-40,-35,-37,19,-18,-16,-81,-20,19,-19,-21,-13,-8,-15,-12,-9,-11,]),'[':([5,20,22,61,83,84,87,93,94,96,97,99,100,102,132,140,199,201,205,264,266,269,271,309,333,335,336,363,],[-70,-62,-61,-60,-139,-138,133,-107,-104,-137,-106,-110,-142,-140,-109,-105,-111,-134,-141,-135,-113,-136,-108,-137,-112,-102,-114,-103,]),'INCLUDE':([0,1,2,5,7,15,45,56,62,73,120,149,161,178,220,229,239,256,257,258,263,272,273,274,281,289,291,296,313,315,317,319,322,339,343,344,354,356,],[21,21,-29,-70,-34,-39,-65,-6,-7,-30,-64,-32,-31,-10,-33,-17,-14,-82,-41,-36,-38,-40,-35,-37,21,-18,-16,-81,-20,21,-19,-21,-13,-8,-15,-12,-9,-11,]),']':([5,20,22,61,83,84,87,93,94,96,97,99,100,102,132,133,135,136,140,142,160,196,197,198,199,201,205,206,207,208,209,210,211,212,213,214,215,216,217,218,219,264,265,266,269,271,307,333,335,336,363,],[-70,-62,-61,-60,-139,-138,-115,-107,-104,-137,-106,-110,-142,-140,-109,-2,-132,-131,-105,-133,-130,-87,-86,266,-111,-134,-141,-126,-129,-116,-125,-124,-122,-123,-119,-120,-121,-118,-117,-128,-127,-135,-2,-113,-136,-108,-85,-112,-102,-114,-103,]),'IF':([179,250,251,256,296,303,325,346,351,358,361,369,372,374,375,376,378,381,382,],[253,253,-98,-82,-81,-88,-97,-95,-89,-94,-99,253,-90,-92,-100,-101,-93,-91,-96,]),'AND':([5,20,22,61,83,84,87,93,94,96,97,99,100,101,102,132,135,136,138,140,142,160,162,197,199,201,205,206,207,208,209,210,211,212,213,214,215,216,217,218,219,254,264,266,269,271,295,309,310,330,331,333,335,336,353,363,373,],[-70,-62,-61,-60,-139,-138,-115,-107,-104,-137,-106,-110,-142,145,-140,-109,145,145,145,-105,-133,-130,145,145,-111,-134,-141,-126,-129,-116,-125,-124,-122,-123,-119,-120,-121,-118,-117,-128,-127,145,-135,-113,-136,-108,145,-137,145,145,145,-112,-102,-114,145,-103,145,]),'DASH':([5,20,22,54,61,83,84,87,88,89,91,93,94,96,97,98,99,100,101,102,103,105,132,133,135,136,138,140,142,143,145,146,147,148,150,151,152,153,154,155,156,157,158,159,160,162,179,197,199,201,205,206,207,208,209,210,211,212,213,214,215,216,217,218,219,245,250,251,254,256,264,265,266,267,268,269,270,271,295,296,302,303,304,309,310,325,330,331,333,334,335,336,346,351,353,358,361,363,367,372,373,374,375,376,378,381,382,],[-70,-62,-61,98,-60,-139,-138,-115,98,98,98,-107,-104,-137,-106,98,-110,-142,153,-140,98,98,-109,98,153,153,153,-105,-133,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,-130,153,98,153,-111,-134,-141,153,153,-116,153,153,153,153,-119,153,153,-118,-117,153,153,98,98,-98,153,-82,-135,98,-113,98,98,-136,98,-108,153,-81,98,-88,98,-137,153,-97,153,153,-112,98,-102,-114,-95,-89,153,-94,-99,-103,98,-90,153,-92,-100,-101,-93,-91,-96,]),'RETURN':([179,250,251,256,296,303,325,346,351,358,361,372,374,375,376,378,381,382,],[245,245,-98,-82,-81,-88,-97,-95,-89,-94,-99,-90,-92,-100,-101,-93,-91,-96,]),'EQ':([5,20,22,61,83,84,87,93,94,96,97,99,100,101,102,132,135,136,138,140,142,160,162,197,199,201,205,206,207,208,209,210,211,212,213,214,215,216,217,218,219,254,264,266,269,271,295,309,310,330,331,333,335,336,353,363,373,],[-70,-62,-61,-60,-139,-138,-115,-107,-104,-137,-106,-110,-142,150,-140,-109,150,150,150,-105,-133,-130,150,150,-111,-134,-141,150,-129,-116,-125,-124,-122,-123,-119,-120,-121,-118,-117,-128,150,150,-135,-113,-136,-108,150,-137,150,150,150,-112,-102,-114,150,-103,150,]),'STRUCT':([0,1,2,5,7,15,45,56,62,73,120,149,161,178,220,229,239,256,257,258,263,272,273,274,281,289,291,296,313,315,317,319,322,339,343,344,354,356,],[23,23,-29,-70,-34,-39,-65,-6,-7,-30,-64,-32,-31,-10,-33,-17,-14,-82,-41,-36,-38,-40,-35,-37,23,-18,-16,-81,-20,23,-19,-21,-13,-8,-15,-12,-9,-11,]),'CHECK_STOP_SLOTS':([179,250,251,256,296,303,325,346,351,358,361,372,374,375,376,378,381,382,],[255,255,-98,-82,-81,-88,-97,-95,-89,-94,-99,-90,-92,-100,-101,-93,-91,-96,]),'STATE_DECL':([0,1,2,5,7,15,45,56,62,73,120,149,161,178,220,229,239,256,257,258,263,272,273,274,281,289,291,296,313,315,317,319,322,339,343,344,354,356,],[24,24,-29,-70,-34,-39,-65,-6,-7,-30,-64,-32,-31,-10,-33,-17,-14,-82,-41,-36,-38,-40,-35,-37,24,-18,-16,-81,-20,24,-19,-21,-13,-8,-15,-12,-9,-11,]),'CHECK_ALLOCATE':([179,250,251,256,296,303,325,346,351,358,361,372,374,375,376,378,381,382,],[248,248,-98,-82,-81,-88,-97,-95,-89,-94,-99,-90,-92,-100,-101,-93,-91,-96,]),'LIT_BOOL':([54,88,89,91,98,103,105,133,143,145,146,147,148,150,151,152,153,154,155,156,157,158,159,179,188,245,250,251,256,265,267,268,270,296,302,303,304,325,334,346,351,358,361,367,372,374,375,376,378,381,382,],[102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,261,102,102,-98,-82,102,102,102,102,-81,102,-88,102,-97,102,-95,-89,-94,-99,102,-90,-92,-100,-101,-93,-91,-96,]),'IS_VALID':([54,88,89,91,98,103,105,133,143,145,146,147,148,150,151,152,153,154,155,156,157,158,159,179,245,250,251,256,265,267,268,270,296,302,303,304,325,334,346,351,358,361,367,372,374,375,376,378,381,382,],[85,85,85,85,85,85,85,85,85,85,85,85,85,85,85,85,85,85,85,85,85,85,85,85,85,85,-98,-82,85,85,85,85,-81,85,-88,85,-97,85,-95,-89,-94,-99,85,-90,-92,-100,-101,-93,-91,-96,]),'NOT':([54,88,89,91,98,103,105,133,143,145,146,147,148,150,151,152,153,154,155,156,157,158,159,179,245,250,251,256,265,267,268,270,296,302,303,304,325,334,346,351,358,361,367,372,374,375,376,378,381,382,],[103,103,103,103,103,103,103,103,103,103,103,103,103,103,103,103,103,103,103,103,103,103,103,103,103,103,-98,-82,103,103,103,103,-81,103,-88,103,-97,103,-95,-89,-94,-99,103,-90,-92,-100,-101,-93,-91,-96,]),'{':([5,29,37,45,52,67,73,75,76,77,115,120,122,126,149,161,163,165,167,169,170,173,180,181,182,183,187,220,221,224,225,226,228,239,279,280,292,322,342,350,366,369,371,379,],[-70,47,47,-65,-74,47,-30,-80,-73,-76,172,-64,179,-2,-32,-31,-2,223,-2,230,231,47,-78,-77,-79,-75,179,-33,179,-2,-2,281,-23,47,315,-22,47,47,179,179,179,179,179,179,]),'}':([1,2,5,7,12,13,15,27,45,47,56,62,68,69,70,73,117,118,119,120,149,161,172,175,176,178,179,220,223,229,230,231,233,234,235,236,237,238,239,246,250,251,256,257,258,263,272,273,274,276,277,278,281,283,285,286,287,289,290,291,296,300,303,313,314,315,316,317,319,320,322,325,337,338,339,343,344,346,351,354,356,358,361,364,372,374,375,376,378,381,382,],[-2,-29,-70,-34,-5,-3,-39,-4,-65,-2,-6,-7,-2,120,-69,-30,-2,-68,-2,-64,-32,-31,-2,-66,-67,-10,256,-33,-2,-17,-2,-2,-26,289,-2,-25,-27,-28,-14,296,-84,-98,-82,-41,-36,-38,-40,-35,-37,313,-2,-43,-2,317,319,-2,-46,-18,-24,-16,-81,-83,-88,-20,-42,-2,339,-19,-21,-45,-13,-97,-44,354,-8,-15,-12,-95,-89,-9,-11,-94,-99,-47,-90,-92,-100,-101,-93,-91,-96,]),'OR':([5,20,22,61,83,84,87,93,94,96,97,99,100,101,102,132,135,136,138,140,142,160,162,197,199,201,205,206,207,208,209,210,211,212,213,214,215,216,217,218,219,254,264,266,269,271,295,309,310,330,331,333,335,336,353,363,373,],[-70,-62,-61,-60,-139,-138,-115,-107,-104,-137,-106,-110,-142,159,-140,-109,159,159,159,-105,-133,-130,159,159,-111,-134,-141,-126,-129,-116,-125,-124,-122,-123,-119,-120,-121,-118,-117,-128,-127,159,-135,-113,-136,-108,159,-137,159,159,159,-112,-102,-114,159,-103,159,]),'IN_PORT':([0,1,2,5,7,15,45,56,62,73,120,149,161,178,220,229,239,256,257,258,263,272,273,274,281,289,291,296,313,315,317,319,322,339,343,344,354,356,],[26,26,-29,-70,-34,-39,-65,-6,-7,-30,-64,-32,-31,-10,-33,-17,-14,-82,-41,-36,-38,-40,-35,-37,26,-18,-16,-81,-20,26,-19,-21,-13,-8,-15,-12,-9,-11,]),} _lr_action = { } for _k, _v in _lr_action_items.items(): for _x,_y in zip(_v[0],_v[1]): if not _x in _lr_action: _lr_action[_x] = { } _lr_action[_x][_k] = _y del _lr_action_items _lr_goto_items = {'decl':([0,1,281,315,],[1,1,1,1,]),'obj_decl':([0,1,167,172,224,225,230,235,281,315,],[2,2,225,233,225,225,233,233,2,2,]),'statements':([122,187,221,342,350,366,369,371,379,],[178,257,272,356,361,372,375,378,381,]),'type_enums':([223,277,],[276,314,]),'pairsx':([51,124,],[76,183,]),'type_members':([172,230,235,],[234,283,290,]),'ident_or_star':([174,],[242,]),'statements_inner':([179,250,],[246,300,]),'enumeration':([54,88,89,91,98,103,105,133,143,145,146,147,148,150,151,152,153,154,155,156,157,158,159,179,245,250,265,267,268,270,302,304,318,334,367,],[93,93,93,93,93,93,93,93,93,93,93,93,93,93,93,93,93,93,93,93,93,93,93,93,93,93,93,93,93,93,93,93,341,93,93,]),'file':([0,],[6,]),'type_state':([231,286,],[286,286,]),'type_member':([172,230,235,],[235,235,235,]),'aexpr':([54,88,89,91,98,103,105,133,143,145,146,147,148,150,151,152,153,154,155,156,157,158,159,179,245,250,265,267,268,270,302,304,334,367,],[87,87,87,87,87,87,87,87,87,87,87,87,87,87,87,87,87,87,87,87,87,87,87,87,87,87,87,87,87,87,87,87,87,87,]),'param':([53,57,125,],[78,78,78,]),'literal':([54,88,89,91,98,103,105,133,143,145,146,147,148,150,151,152,153,154,155,156,157,158,159,179,245,250,265,267,268,270,302,304,334,367,],[97,97,97,97,97,97,97,97,97,97,97,97,97,97,97,97,97,97,97,97,97,97,97,97,97,97,97,97,97,97,97,97,97,97,]),'params':([53,57,125,],[79,106,184,]),'statement':([179,250,],[250,250,]),'var':([54,88,89,91,98,103,105,131,133,139,143,145,146,147,148,150,151,152,153,154,155,156,157,158,159,177,179,232,245,250,265,267,268,270,294,298,299,301,302,304,305,334,349,367,],[94,94,94,94,94,94,94,195,94,202,94,94,94,94,94,94,94,94,94,94,94,94,94,94,94,243,94,288,94,94,94,94,94,94,324,327,328,329,94,94,332,94,360,94,]),'if_statement':([179,250,369,],[251,251,376,]),'type':([0,1,28,36,38,41,42,53,54,57,71,86,88,89,91,98,103,105,114,125,129,133,137,143,145,146,147,148,150,151,152,153,154,155,156,157,158,159,167,172,179,224,225,230,235,245,250,265,267,268,270,281,302,304,315,334,345,348,367,],[11,11,44,58,60,63,64,81,95,81,121,132,95,95,95,95,95,95,171,185,191,95,200,95,95,95,95,95,95,95,95,95,95,95,95,95,95,95,227,11,95,227,227,11,11,95,95,95,95,95,95,11,95,95,11,95,357,359,95,]),'empty':([0,1,32,44,47,49,53,55,57,58,59,60,63,64,68,117,119,125,126,129,130,133,143,163,164,167,172,223,224,225,230,231,235,243,265,267,270,275,277,281,282,286,288,315,341,357,],[12,12,52,52,70,52,80,52,80,52,52,52,52,52,70,70,70,186,52,192,52,196,196,52,52,228,236,278,228,228,236,287,236,52,196,196,196,52,278,12,52,287,52,12,52,52,]),'declsx':([0,1,281,315,],[13,27,13,13,]),'func_decl':([0,1,172,230,235,281,315,],[7,7,237,237,237,7,7,]),'func_def':([0,1,172,230,235,281,315,],[15,15,238,238,238,15,15,]),'idents':([29,37,67,173,239,292,322,],[46,59,116,239,291,322,343,]),'void':([0,1,172,230,235,281,315,],[16,16,16,16,16,16,16,]),'identx':([47,68,117,119,],[69,118,175,176,]),'type_states':([231,286,],[285,320,]),'pair':([51,124,],[77,77,]),'type_enum':([223,277,],[277,277,]),'typestr':([0,1,28,36,38,41,42,53,54,57,71,86,88,89,91,98,103,105,114,125,129,133,137,143,145,146,147,148,150,151,152,153,154,155,156,157,158,159,167,172,179,224,225,230,235,245,250,265,267,268,270,281,302,304,315,334,345,348,367,],[20,20,20,20,20,20,20,20,20,20,20,20,20,20,20,20,20,20,20,20,20,20,20,20,20,20,20,20,20,20,20,20,20,20,20,20,20,20,20,20,20,20,20,20,20,20,20,20,20,20,20,20,20,20,20,20,20,20,20,]),'types':([53,57,129,],[82,107,190,]),'pairs':([32,44,49,55,58,59,60,63,64,126,130,163,164,243,275,282,288,341,357,],[50,66,72,104,108,109,111,112,113,187,193,221,222,293,312,50,321,355,365,]),'ident':([0,1,11,16,28,29,30,31,33,36,37,38,39,41,42,43,47,51,53,54,57,67,68,71,81,86,88,89,91,95,98,103,105,114,117,119,123,124,125,128,129,131,133,134,137,139,141,143,144,145,146,147,148,150,151,152,153,154,155,156,157,158,159,167,172,173,174,177,179,185,223,224,225,227,230,231,232,235,239,245,250,265,267,268,270,277,281,286,292,294,298,299,301,302,304,305,315,318,322,334,345,348,349,367,],[22,22,32,35,22,45,48,49,55,22,45,22,61,22,22,65,68,74,22,100,22,45,68,22,127,22,100,100,100,140,100,100,100,22,68,68,180,74,22,189,22,194,100,199,22,194,203,100,205,100,100,100,100,100,100,100,100,100,100,100,100,100,100,22,22,45,240,194,100,127,275,22,22,282,22,284,194,22,45,100,100,100,100,100,100,275,22,284,45,194,194,194,194,100,100,194,22,340,45,100,22,22,194,100,]),'obj_decls':([167,224,225,],[226,279,280,]),'expr':([54,88,89,91,98,103,105,133,143,145,146,147,148,150,151,152,153,154,155,156,157,158,159,179,245,250,265,267,268,270,302,304,334,367,],[101,135,136,138,142,160,162,197,197,206,207,208,209,210,211,212,213,214,215,216,217,218,219,254,295,254,197,197,310,197,330,331,353,373,]),'exprs':([133,143,265,267,270,],[198,204,307,308,311,]),'decls':([0,281,315,],[25,316,338,]),} _lr_goto = { } for _k, _v in _lr_goto_items.items(): for _x,_y in zip(_v[0],_v[1]): if not _x in _lr_goto: _lr_goto[_x] = { } _lr_goto[_x][_k] = _y del _lr_goto_items _lr_productions = [ ("S' -> file","S'",1,None,None,None), ('file -> decls','file',1,'p_file','/users/alian/simulators/pdgem5/src/mem/slicc/parser.py',219), ('empty -> <empty>','empty',0,'p_empty','/users/alian/simulators/pdgem5/src/mem/slicc/parser.py',223), ('decls -> declsx','decls',1,'p_decls','/users/alian/simulators/pdgem5/src/mem/slicc/parser.py',226), ('declsx -> decl declsx','declsx',2,'p_declsx__list','/users/alian/simulators/pdgem5/src/mem/slicc/parser.py',230), ('declsx -> empty','declsx',1,'p_declsx__none','/users/alian/simulators/pdgem5/src/mem/slicc/parser.py',240), ('decl -> PROTOCOL STRING SEMI','decl',3,'p_decl__protocol','/users/alian/simulators/pdgem5/src/mem/slicc/parser.py',244), ('decl -> INCLUDE STRING SEMI','decl',3,'p_decl__include','/users/alian/simulators/pdgem5/src/mem/slicc/parser.py',253), ('decl -> MACHINE ( idents ) : obj_decls { decls }','decl',9,'p_decl__machine0','/users/alian/simulators/pdgem5/src/mem/slicc/parser.py',262), ('decl -> MACHINE ( idents pairs ) : obj_decls { decls }','decl',10,'p_decl__machine1','/users/alian/simulators/pdgem5/src/mem/slicc/parser.py',266), ('decl -> ACTION ( ident pairs ) statements','decl',6,'p_decl__action','/users/alian/simulators/pdgem5/src/mem/slicc/parser.py',270), ('decl -> IN_PORT ( ident , type , var pairs ) statements','decl',10,'p_decl__in_port','/users/alian/simulators/pdgem5/src/mem/slicc/parser.py',274), ('decl -> OUT_PORT ( ident , type , var pairs ) SEMI','decl',10,'p_decl__out_port','/users/alian/simulators/pdgem5/src/mem/slicc/parser.py',278), ('decl -> TRANS ( idents , idents , ident_or_star ) idents','decl',9,'p_decl__trans0','/users/alian/simulators/pdgem5/src/mem/slicc/parser.py',282), ('decl -> TRANS ( idents , idents ) idents','decl',7,'p_decl__trans1','/users/alian/simulators/pdgem5/src/mem/slicc/parser.py',286), ('decl -> TRANS ( idents , idents , ident_or_star ) idents idents','decl',10,'p_decl__trans2','/users/alian/simulators/pdgem5/src/mem/slicc/parser.py',290), ('decl -> TRANS ( idents , idents ) idents idents','decl',8,'p_decl__trans3','/users/alian/simulators/pdgem5/src/mem/slicc/parser.py',294), ('decl -> EXTERN_TYPE ( type pairs ) SEMI','decl',6,'p_decl__extern0','/users/alian/simulators/pdgem5/src/mem/slicc/parser.py',298), ('decl -> GLOBAL ( type pairs ) { type_members }','decl',8,'p_decl__global','/users/alian/simulators/pdgem5/src/mem/slicc/parser.py',303), ('decl -> STRUCT ( type pairs ) { type_members }','decl',8,'p_decl__struct','/users/alian/simulators/pdgem5/src/mem/slicc/parser.py',308), ('decl -> ENUM ( type pairs ) { type_enums }','decl',8,'p_decl__enum','/users/alian/simulators/pdgem5/src/mem/slicc/parser.py',312), ('decl -> STATE_DECL ( type pairs ) { type_states }','decl',8,'p_decl__state_decl','/users/alian/simulators/pdgem5/src/mem/slicc/parser.py',317), ('obj_decls -> obj_decl obj_decls','obj_decls',2,'p_obj_decls__list','/users/alian/simulators/pdgem5/src/mem/slicc/parser.py',324), ('obj_decls -> empty','obj_decls',1,'p_obj_decls__empty','/users/alian/simulators/pdgem5/src/mem/slicc/parser.py',328), ('type_members -> type_member type_members','type_members',2,'p_type_members__list','/users/alian/simulators/pdgem5/src/mem/slicc/parser.py',332), ('type_members -> empty','type_members',1,'p_type_members__empty','/users/alian/simulators/pdgem5/src/mem/slicc/parser.py',336), ('type_member -> obj_decl','type_member',1,'p_type_member__0','/users/alian/simulators/pdgem5/src/mem/slicc/parser.py',340), ('type_member -> func_decl','type_member',1,'p_type_member__0','/users/alian/simulators/pdgem5/src/mem/slicc/parser.py',341), ('type_member -> func_def','type_member',1,'p_type_member__0','/users/alian/simulators/pdgem5/src/mem/slicc/parser.py',342), ('decl -> obj_decl','decl',1,'p_decl__obj_decl','/users/alian/simulators/pdgem5/src/mem/slicc/parser.py',347), ('obj_decl -> type ident pairs SEMI','obj_decl',4,'p_obj_decl__0','/users/alian/simulators/pdgem5/src/mem/slicc/parser.py',351), ('obj_decl -> type STAR ident pairs SEMI','obj_decl',5,'p_obj_decl__1','/users/alian/simulators/pdgem5/src/mem/slicc/parser.py',355), ('obj_decl -> type ident ASSIGN expr SEMI','obj_decl',5,'p_obj_decl__2','/users/alian/simulators/pdgem5/src/mem/slicc/parser.py',359), ('obj_decl -> type STAR ident ASSIGN expr SEMI','obj_decl',6,'p_obj_decl__3','/users/alian/simulators/pdgem5/src/mem/slicc/parser.py',364), ('decl -> func_decl','decl',1,'p_decl__func_decl','/users/alian/simulators/pdgem5/src/mem/slicc/parser.py',370), ('func_decl -> void ident ( params ) pairs SEMI','func_decl',7,'p_func_decl__0','/users/alian/simulators/pdgem5/src/mem/slicc/parser.py',374), ('func_decl -> type ident ( params ) pairs SEMI','func_decl',7,'p_func_decl__0','/users/alian/simulators/pdgem5/src/mem/slicc/parser.py',375), ('func_decl -> void ident ( types ) pairs SEMI','func_decl',7,'p_func_decl__1','/users/alian/simulators/pdgem5/src/mem/slicc/parser.py',379), ('func_decl -> type ident ( types ) pairs SEMI','func_decl',7,'p_func_decl__1','/users/alian/simulators/pdgem5/src/mem/slicc/parser.py',380), ('decl -> func_def','decl',1,'p_decl__func_def','/users/alian/simulators/pdgem5/src/mem/slicc/parser.py',384), ('func_def -> void ident ( params ) pairs statements','func_def',7,'p_func_def__0','/users/alian/simulators/pdgem5/src/mem/slicc/parser.py',388), ('func_def -> type ident ( params ) pairs statements','func_def',7,'p_func_def__0','/users/alian/simulators/pdgem5/src/mem/slicc/parser.py',389), ('type_enums -> type_enum type_enums','type_enums',2,'p_type_enums__list','/users/alian/simulators/pdgem5/src/mem/slicc/parser.py',394), ('type_enums -> empty','type_enums',1,'p_type_enums__empty','/users/alian/simulators/pdgem5/src/mem/slicc/parser.py',398), ('type_enum -> ident pairs SEMI','type_enum',3,'p_type_enum','/users/alian/simulators/pdgem5/src/mem/slicc/parser.py',402), ('type_states -> type_state type_states','type_states',2,'p_type_states__list','/users/alian/simulators/pdgem5/src/mem/slicc/parser.py',407), ('type_states -> empty','type_states',1,'p_type_states__empty','/users/alian/simulators/pdgem5/src/mem/slicc/parser.py',411), ('type_state -> ident , enumeration pairs SEMI','type_state',5,'p_type_state','/users/alian/simulators/pdgem5/src/mem/slicc/parser.py',415), ('params -> param , params','params',3,'p_params__many','/users/alian/simulators/pdgem5/src/mem/slicc/parser.py',420), ('params -> param','params',1,'p_params__one','/users/alian/simulators/pdgem5/src/mem/slicc/parser.py',424), ('params -> empty','params',1,'p_params__none','/users/alian/simulators/pdgem5/src/mem/slicc/parser.py',428), ('param -> type ident','param',2,'p_param','/users/alian/simulators/pdgem5/src/mem/slicc/parser.py',432), ('param -> type STAR ident','param',3,'p_param__pointer','/users/alian/simulators/pdgem5/src/mem/slicc/parser.py',436), ('param -> type STAR ident ASSIGN STRING','param',5,'p_param__pointer_default','/users/alian/simulators/pdgem5/src/mem/slicc/parser.py',440), ('param -> type ident ASSIGN NUMBER','param',4,'p_param__default_number','/users/alian/simulators/pdgem5/src/mem/slicc/parser.py',444), ('param -> type ident ASSIGN LIT_BOOL','param',4,'p_param__default_bool','/users/alian/simulators/pdgem5/src/mem/slicc/parser.py',448), ('param -> type ident ASSIGN STRING','param',4,'p_param__default_string','/users/alian/simulators/pdgem5/src/mem/slicc/parser.py',452), ('types -> type , types','types',3,'p_types__multiple','/users/alian/simulators/pdgem5/src/mem/slicc/parser.py',457), ('types -> type','types',1,'p_types__one','/users/alian/simulators/pdgem5/src/mem/slicc/parser.py',461), ('types -> empty','types',1,'p_types__empty','/users/alian/simulators/pdgem5/src/mem/slicc/parser.py',465), ('typestr -> typestr DOUBLE_COLON ident','typestr',3,'p_typestr__multi','/users/alian/simulators/pdgem5/src/mem/slicc/parser.py',469), ('typestr -> ident','typestr',1,'p_typestr__single','/users/alian/simulators/pdgem5/src/mem/slicc/parser.py',473), ('type -> typestr','type',1,'p_type__one','/users/alian/simulators/pdgem5/src/mem/slicc/parser.py',477), ('void -> VOID','void',1,'p_void','/users/alian/simulators/pdgem5/src/mem/slicc/parser.py',481), ('idents -> { identx }','idents',3,'p_idents__braced','/users/alian/simulators/pdgem5/src/mem/slicc/parser.py',486), ('idents -> ident','idents',1,'p_idents__bare','/users/alian/simulators/pdgem5/src/mem/slicc/parser.py',490), ('identx -> ident SEMI identx','identx',3,'p_identx__multiple_1','/users/alian/simulators/pdgem5/src/mem/slicc/parser.py',494), ('identx -> ident , identx','identx',3,'p_identx__multiple_1','/users/alian/simulators/pdgem5/src/mem/slicc/parser.py',495), ('identx -> ident identx','identx',2,'p_identx__multiple_2','/users/alian/simulators/pdgem5/src/mem/slicc/parser.py',499), ('identx -> empty','identx',1,'p_identx__single','/users/alian/simulators/pdgem5/src/mem/slicc/parser.py',503), ('ident -> IDENT','ident',1,'p_ident','/users/alian/simulators/pdgem5/src/mem/slicc/parser.py',507), ('ident_or_star -> ident','ident_or_star',1,'p_ident_or_star','/users/alian/simulators/pdgem5/src/mem/slicc/parser.py',511), ('ident_or_star -> STAR','ident_or_star',1,'p_ident_or_star','/users/alian/simulators/pdgem5/src/mem/slicc/parser.py',512), ('pairs -> , pairsx','pairs',2,'p_pairs__list','/users/alian/simulators/pdgem5/src/mem/slicc/parser.py',517), ('pairs -> empty','pairs',1,'p_pairs__empty','/users/alian/simulators/pdgem5/src/mem/slicc/parser.py',521), ('pairsx -> pair , pairsx','pairsx',3,'p_pairsx__many','/users/alian/simulators/pdgem5/src/mem/slicc/parser.py',525), ('pairsx -> pair','pairsx',1,'p_pairsx__one','/users/alian/simulators/pdgem5/src/mem/slicc/parser.py',530), ('pair -> ident = STRING','pair',3,'p_pair__assign','/users/alian/simulators/pdgem5/src/mem/slicc/parser.py',535), ('pair -> ident = ident','pair',3,'p_pair__assign','/users/alian/simulators/pdgem5/src/mem/slicc/parser.py',536), ('pair -> ident = NUMBER','pair',3,'p_pair__assign','/users/alian/simulators/pdgem5/src/mem/slicc/parser.py',537), ('pair -> STRING','pair',1,'p_pair__literal','/users/alian/simulators/pdgem5/src/mem/slicc/parser.py',541), ('statements -> { statements_inner }','statements',3,'p_statements__inner','/users/alian/simulators/pdgem5/src/mem/slicc/parser.py',546), ('statements -> { }','statements',2,'p_statements__none','/users/alian/simulators/pdgem5/src/mem/slicc/parser.py',550), ('statements_inner -> statement statements_inner','statements_inner',2,'p_statements_inner__many','/users/alian/simulators/pdgem5/src/mem/slicc/parser.py',554), ('statements_inner -> statement','statements_inner',1,'p_statements_inner__one','/users/alian/simulators/pdgem5/src/mem/slicc/parser.py',558), ('exprs -> expr , exprs','exprs',3,'p_exprs__multiple','/users/alian/simulators/pdgem5/src/mem/slicc/parser.py',562), ('exprs -> expr','exprs',1,'p_exprs__one','/users/alian/simulators/pdgem5/src/mem/slicc/parser.py',566), ('exprs -> empty','exprs',1,'p_exprs__empty','/users/alian/simulators/pdgem5/src/mem/slicc/parser.py',570), ('statement -> expr SEMI','statement',2,'p_statement__expression','/users/alian/simulators/pdgem5/src/mem/slicc/parser.py',574), ('statement -> expr ASSIGN expr SEMI','statement',4,'p_statement__assign','/users/alian/simulators/pdgem5/src/mem/slicc/parser.py',578), ('statement -> ENQUEUE ( var , type ) statements','statement',7,'p_statement__enqueue','/users/alian/simulators/pdgem5/src/mem/slicc/parser.py',582), ('statement -> ENQUEUE ( var , type , expr ) statements','statement',9,'p_statement__enqueue_latency','/users/alian/simulators/pdgem5/src/mem/slicc/parser.py',586), ('statement -> STALL_AND_WAIT ( var , var ) SEMI','statement',7,'p_statement__stall_and_wait','/users/alian/simulators/pdgem5/src/mem/slicc/parser.py',590), ('statement -> PEEK ( var , type pairs ) statements','statement',8,'p_statement__peek','/users/alian/simulators/pdgem5/src/mem/slicc/parser.py',594), ('statement -> CHECK_ALLOCATE ( var ) SEMI','statement',5,'p_statement__check_allocate','/users/alian/simulators/pdgem5/src/mem/slicc/parser.py',598), ('statement -> CHECK_NEXT_CYCLE ( ) SEMI','statement',4,'p_statement__check_next_cycle','/users/alian/simulators/pdgem5/src/mem/slicc/parser.py',602), ('statement -> CHECK_STOP_SLOTS ( var , STRING , STRING ) SEMI','statement',9,'p_statement__check_stop','/users/alian/simulators/pdgem5/src/mem/slicc/parser.py',606), ('statement -> RETURN expr SEMI','statement',3,'p_statement__return','/users/alian/simulators/pdgem5/src/mem/slicc/parser.py',610), ('statement -> if_statement','statement',1,'p_statement__if','/users/alian/simulators/pdgem5/src/mem/slicc/parser.py',614), ('if_statement -> IF ( expr ) statements','if_statement',5,'p_if_statement__if','/users/alian/simulators/pdgem5/src/mem/slicc/parser.py',618), ('if_statement -> IF ( expr ) statements ELSE statements','if_statement',7,'p_if_statement__if_else','/users/alian/simulators/pdgem5/src/mem/slicc/parser.py',622), ('if_statement -> IF ( expr ) statements ELSE if_statement','if_statement',7,'p_statement__if_else_if','/users/alian/simulators/pdgem5/src/mem/slicc/parser.py',626), ('aexpr -> STATIC_CAST ( type , expr )','aexpr',6,'p_expr__static_cast','/users/alian/simulators/pdgem5/src/mem/slicc/parser.py',631), ('aexpr -> STATIC_CAST ( type , STRING , expr )','aexpr',8,'p_expr__static_cast_ptr','/users/alian/simulators/pdgem5/src/mem/slicc/parser.py',635), ('aexpr -> var','aexpr',1,'p_expr__var','/users/alian/simulators/pdgem5/src/mem/slicc/parser.py',639), ('aexpr -> type ident','aexpr',2,'p_expr__localvar','/users/alian/simulators/pdgem5/src/mem/slicc/parser.py',643), ('aexpr -> literal','aexpr',1,'p_expr__literal','/users/alian/simulators/pdgem5/src/mem/slicc/parser.py',647), ('aexpr -> enumeration','aexpr',1,'p_expr__enumeration','/users/alian/simulators/pdgem5/src/mem/slicc/parser.py',651), ('aexpr -> ident ( exprs )','aexpr',4,'p_expr__func_call','/users/alian/simulators/pdgem5/src/mem/slicc/parser.py',655), ('aexpr -> NEW type','aexpr',2,'p_expr__new','/users/alian/simulators/pdgem5/src/mem/slicc/parser.py',659), ('aexpr -> OOD','aexpr',1,'p_expr__null','/users/alian/simulators/pdgem5/src/mem/slicc/parser.py',663), ('aexpr -> aexpr DOT ident','aexpr',3,'p_expr__member','/users/alian/simulators/pdgem5/src/mem/slicc/parser.py',667), ('aexpr -> aexpr DOT ident ( exprs )','aexpr',6,'p_expr__member_method_call','/users/alian/simulators/pdgem5/src/mem/slicc/parser.py',671), ('aexpr -> aexpr [ exprs ]','aexpr',4,'p_expr__member_method_call_lookup','/users/alian/simulators/pdgem5/src/mem/slicc/parser.py',675), ('aexpr -> type DOUBLE_COLON ident ( exprs )','aexpr',6,'p_expr__class_method_call','/users/alian/simulators/pdgem5/src/mem/slicc/parser.py',679), ('expr -> aexpr','expr',1,'p_expr__aexpr','/users/alian/simulators/pdgem5/src/mem/slicc/parser.py',683), ('expr -> expr STAR expr','expr',3,'p_expr__binary_op','/users/alian/simulators/pdgem5/src/mem/slicc/parser.py',687), ('expr -> expr SLASH expr','expr',3,'p_expr__binary_op','/users/alian/simulators/pdgem5/src/mem/slicc/parser.py',688), ('expr -> expr PLUS expr','expr',3,'p_expr__binary_op','/users/alian/simulators/pdgem5/src/mem/slicc/parser.py',689), ('expr -> expr DASH expr','expr',3,'p_expr__binary_op','/users/alian/simulators/pdgem5/src/mem/slicc/parser.py',690), ('expr -> expr LT expr','expr',3,'p_expr__binary_op','/users/alian/simulators/pdgem5/src/mem/slicc/parser.py',691), ('expr -> expr GT expr','expr',3,'p_expr__binary_op','/users/alian/simulators/pdgem5/src/mem/slicc/parser.py',692), ('expr -> expr LE expr','expr',3,'p_expr__binary_op','/users/alian/simulators/pdgem5/src/mem/slicc/parser.py',693), ('expr -> expr GE expr','expr',3,'p_expr__binary_op','/users/alian/simulators/pdgem5/src/mem/slicc/parser.py',694), ('expr -> expr EQ expr','expr',3,'p_expr__binary_op','/users/alian/simulators/pdgem5/src/mem/slicc/parser.py',695), ('expr -> expr NE expr','expr',3,'p_expr__binary_op','/users/alian/simulators/pdgem5/src/mem/slicc/parser.py',696), ('expr -> expr AND expr','expr',3,'p_expr__binary_op','/users/alian/simulators/pdgem5/src/mem/slicc/parser.py',697), ('expr -> expr OR expr','expr',3,'p_expr__binary_op','/users/alian/simulators/pdgem5/src/mem/slicc/parser.py',698), ('expr -> expr RIGHTSHIFT expr','expr',3,'p_expr__binary_op','/users/alian/simulators/pdgem5/src/mem/slicc/parser.py',699), ('expr -> expr LEFTSHIFT expr','expr',3,'p_expr__binary_op','/users/alian/simulators/pdgem5/src/mem/slicc/parser.py',700), ('expr -> NOT expr','expr',2,'p_expr__unary_op','/users/alian/simulators/pdgem5/src/mem/slicc/parser.py',705), ('expr -> INCR expr','expr',2,'p_expr__unary_op','/users/alian/simulators/pdgem5/src/mem/slicc/parser.py',706), ('expr -> DECR expr','expr',2,'p_expr__unary_op','/users/alian/simulators/pdgem5/src/mem/slicc/parser.py',707), ('expr -> DASH expr','expr',2,'p_expr__unary_op','/users/alian/simulators/pdgem5/src/mem/slicc/parser.py',708), ('aexpr -> ( expr )','aexpr',3,'p_expr__parens','/users/alian/simulators/pdgem5/src/mem/slicc/parser.py',712), ('aexpr -> IS_VALID ( var )','aexpr',4,'p_expr__is_valid_ptr','/users/alian/simulators/pdgem5/src/mem/slicc/parser.py',716), ('aexpr -> IS_INVALID ( var )','aexpr',4,'p_expr__is_invalid_ptr','/users/alian/simulators/pdgem5/src/mem/slicc/parser.py',720), ('literal -> STRING','literal',1,'p_literal__string','/users/alian/simulators/pdgem5/src/mem/slicc/parser.py',724), ('literal -> NUMBER','literal',1,'p_literal__number','/users/alian/simulators/pdgem5/src/mem/slicc/parser.py',728), ('literal -> FLOATNUMBER','literal',1,'p_literal__float','/users/alian/simulators/pdgem5/src/mem/slicc/parser.py',732), ('literal -> LIT_BOOL','literal',1,'p_literal__bool','/users/alian/simulators/pdgem5/src/mem/slicc/parser.py',736), ('enumeration -> ident : ident','enumeration',3,'p_enumeration','/users/alian/simulators/pdgem5/src/mem/slicc/parser.py',740), ('var -> ident','var',1,'p_var','/users/alian/simulators/pdgem5/src/mem/slicc/parser.py',744), ]
_tabversion = '3.2' _lr_method = 'LALR' _lr_signature = 'DÌZ\x0b=òÖ\x89\x1eë£n¢zÖn' _lr_action_items = {'PEEK': ([179, 250, 251, 256, 296, 303, 325, 346, 351, 358, 361, 372, 374, 375, 376, 378, 381, 382], [244, 244, -98, -82, -81, -88, -97, -95, -89, -94, -99, -90, -92, -100, -101, -93, -91, -96]), 'TRANS': ([0, 1, 2, 5, 7, 15, 45, 56, 62, 73, 120, 149, 161, 178, 220, 229, 239, 256, 257, 258, 263, 272, 273, 274, 281, 289, 291, 296, 313, 315, 317, 319, 322, 339, 343, 344, 354, 356], [8, 8, -29, -70, -34, -39, -65, -6, -7, -30, -64, -32, -31, -10, -33, -17, -14, -82, -41, -36, -38, -40, -35, -37, 8, -18, -16, -81, -20, 8, -19, -21, -13, -8, -15, -12, -9, -11]), 'STAR': ([5, 11, 20, 22, 61, 81, 83, 84, 87, 93, 94, 96, 97, 99, 100, 101, 102, 132, 135, 136, 138, 140, 142, 160, 162, 174, 185, 197, 199, 201, 205, 206, 207, 208, 209, 210, 211, 212, 213, 214, 215, 216, 217, 218, 219, 227, 254, 264, 266, 269, 271, 295, 309, 310, 330, 331, 333, 335, 336, 353, 363, 373], [-70, 33, -62, -61, -60, 128, -139, -138, -115, -107, -104, -137, -106, -110, -142, 147, -140, -109, 147, 147, 147, -105, -133, -130, 147, 241, 128, 147, -111, -134, -141, 147, 147, -116, 147, 147, 147, 147, 147, 147, 147, 147, -117, 147, 147, 33, 147, -135, -113, -136, -108, 147, -137, 147, 147, 147, -112, -102, -114, 147, -103, 147]), 'SLASH': ([5, 20, 22, 61, 83, 84, 87, 93, 94, 96, 97, 99, 100, 101, 102, 132, 135, 136, 138, 140, 142, 160, 162, 197, 199, 201, 205, 206, 207, 208, 209, 210, 211, 212, 213, 214, 215, 216, 217, 218, 219, 254, 264, 266, 269, 271, 295, 309, 310, 330, 331, 333, 335, 336, 353, 363, 373], [-70, -62, -61, -60, -139, -138, -115, -107, -104, -137, -106, -110, -142, 157, -140, -109, 157, 157, 157, -105, -133, -130, 157, 157, -111, -134, -141, 157, 157, -116, 157, 157, 157, 157, 157, 157, 157, 157, -117, 157, 157, 157, -135, -113, -136, -108, 157, -137, 157, 157, 157, -112, -102, -114, 157, -103, 157]), 'FLOATNUMBER': ([54, 88, 89, 91, 98, 103, 105, 133, 143, 145, 146, 147, 148, 150, 151, 152, 153, 154, 155, 156, 157, 158, 159, 179, 245, 250, 251, 256, 265, 267, 268, 270, 296, 302, 303, 304, 325, 334, 346, 351, 358, 361, 367, 372, 374, 375, 376, 378, 381, 382], [83, 83, 83, 83, 83, 83, 83, 83, 83, 83, 83, 83, 83, 83, 83, 83, 83, 83, 83, 83, 83, 83, 83, 83, 83, 83, -98, -82, 83, 83, 83, 83, -81, 83, -88, 83, -97, 83, -95, -89, -94, -99, 83, -90, -92, -100, -101, -93, -91, -96]), 'VOID': ([0, 1, 2, 5, 7, 15, 45, 56, 62, 73, 120, 149, 161, 172, 178, 220, 229, 230, 233, 235, 237, 238, 239, 256, 257, 258, 263, 272, 273, 274, 281, 289, 291, 296, 313, 315, 317, 319, 322, 339, 343, 344, 354, 356], [3, 3, -29, -70, -34, -39, -65, -6, -7, -30, -64, -32, -31, 3, -10, -33, -17, 3, -26, 3, -27, -28, -14, -82, -41, -36, -38, -40, -35, -37, 3, -18, -16, -81, -20, 3, -19, -21, -13, -8, -15, -12, -9, -11]), 'GLOBAL': ([0, 1, 2, 5, 7, 15, 45, 56, 62, 73, 120, 149, 161, 178, 220, 229, 239, 256, 257, 258, 263, 272, 273, 274, 281, 289, 291, 296, 313, 315, 317, 319, 322, 339, 343, 344, 354, 356], [4, 4, -29, -70, -34, -39, -65, -6, -7, -30, -64, -32, -31, -10, -33, -17, -14, -82, -41, -36, -38, -40, -35, -37, 4, -18, -16, -81, -20, 4, -19, -21, -13, -8, -15, -12, -9, -11]), 'NUMBER': ([54, 88, 89, 91, 98, 103, 105, 123, 133, 143, 145, 146, 147, 148, 150, 151, 152, 153, 154, 155, 156, 157, 158, 159, 179, 188, 245, 250, 251, 256, 265, 267, 268, 270, 296, 302, 303, 304, 325, 334, 346, 351, 358, 361, 367, 372, 374, 375, 376, 378, 381, 382], [84, 84, 84, 84, 84, 84, 84, 182, 84, 84, 84, 84, 84, 84, 84, 84, 84, 84, 84, 84, 84, 84, 84, 84, 84, 260, 84, 84, -98, -82, 84, 84, 84, 84, -81, 84, -88, 84, -97, 84, -95, -89, -94, -99, 84, -90, -92, -100, -101, -93, -91, -96]), ',': ([5, 20, 22, 32, 44, 45, 46, 48, 49, 55, 58, 59, 60, 61, 63, 64, 65, 68, 75, 77, 78, 81, 83, 84, 87, 93, 94, 96, 97, 99, 100, 102, 116, 120, 121, 126, 127, 130, 132, 135, 136, 140, 142, 160, 163, 164, 171, 180, 181, 182, 189, 191, 194, 197, 199, 200, 201, 205, 206, 207, 208, 209, 210, 211, 212, 213, 214, 215, 216, 217, 218, 219, 243, 259, 260, 261, 264, 266, 269, 271, 275, 282, 284, 288, 306, 309, 324, 328, 329, 332, 333, 335, 336, 341, 357, 359, 362, 363], [-70, -62, -61, 51, 51, -65, 67, 71, 51, 51, 51, 51, 51, -60, 51, 51, 114, 119, -80, 124, 125, 129, -139, -138, -115, -107, -104, -137, -106, -110, -142, -140, 174, -64, 177, 51, -51, 51, -109, -132, -131, -105, -133, -130, 51, 51, 232, -78, -77, -79, -52, 129, -142, 265, -111, 268, -134, -141, -126, -129, -116, -125, -124, -122, -123, -119, -120, -121, -118, -117, -128, -127, 51, -56, -54, -55, -135, -113, -136, -108, 51, 51, 318, 51, -53, 334, 345, 348, 349, 352, -112, -102, -114, 51, 51, 367, 370, -103]), 'GT': ([5, 20, 22, 61, 83, 84, 87, 93, 94, 96, 97, 99, 100, 101, 102, 132, 135, 136, 138, 140, 142, 160, 162, 197, 199, 201, 205, 206, 207, 208, 209, 210, 211, 212, 213, 214, 215, 216, 217, 218, 219, 254, 264, 266, 269, 271, 295, 309, 310, 330, 331, 333, 335, 336, 353, 363, 373], [-70, -62, -61, -60, -139, -138, -115, -107, -104, -137, -106, -110, -142, 155, -140, -109, 155, 155, 155, -105, -133, -130, 155, 155, -111, -134, -141, 155, -129, -116, 155, 155, -122, -123, -119, -120, -121, -118, -117, -128, 155, 155, -135, -113, -136, -108, 155, -137, 155, 155, 155, -112, -102, -114, 155, -103, 155]), 'NEW': ([54, 88, 89, 91, 98, 103, 105, 133, 143, 145, 146, 147, 148, 150, 151, 152, 153, 154, 155, 156, 157, 158, 159, 179, 245, 250, 251, 256, 265, 267, 268, 270, 296, 302, 303, 304, 325, 334, 346, 351, 358, 361, 367, 372, 374, 375, 376, 378, 381, 382], [86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, -98, -82, 86, 86, 86, 86, -81, 86, -88, 86, -97, 86, -95, -89, -94, -99, 86, -90, -92, -100, -101, -93, -91, -96]), 'RIGHTSHIFT': ([5, 20, 22, 61, 83, 84, 87, 93, 94, 96, 97, 99, 100, 101, 102, 132, 135, 136, 138, 140, 142, 160, 162, 197, 199, 201, 205, 206, 207, 208, 209, 210, 211, 212, 213, 214, 215, 216, 217, 218, 219, 254, 264, 266, 269, 271, 295, 309, 310, 330, 331, 333, 335, 336, 353, 363, 373], [-70, -62, -61, -60, -139, -138, -115, -107, -104, -137, -106, -110, -142, 158, -140, -109, 158, 158, 158, -105, -133, -130, 158, 158, -111, -134, -141, 158, -129, -116, 158, 158, 158, 158, -119, 158, 158, -118, -117, -128, 158, 158, -135, -113, -136, -108, 158, -137, 158, 158, 158, -112, -102, -114, 158, -103, 158]), 'CHECK_NEXT_CYCLE': ([179, 250, 251, 256, 296, 303, 325, 346, 351, 358, 361, 372, 374, 375, 376, 378, 381, 382], [247, 247, -98, -82, -81, -88, -97, -95, -89, -94, -99, -90, -92, -100, -101, -93, -91, -96]), 'DOT': ([5, 20, 22, 61, 83, 84, 87, 93, 94, 96, 97, 99, 100, 102, 132, 140, 199, 201, 205, 264, 266, 269, 271, 309, 333, 335, 336, 363], [-70, -62, -61, -60, -139, -138, 134, -107, -104, -137, -106, -110, -142, -140, -109, -105, -111, -134, -141, -135, -113, -136, -108, -137, -112, -102, -114, -103]), 'LEFTSHIFT': ([5, 20, 22, 61, 83, 84, 87, 93, 94, 96, 97, 99, 100, 101, 102, 132, 135, 136, 138, 140, 142, 160, 162, 197, 199, 201, 205, 206, 207, 208, 209, 210, 211, 212, 213, 214, 215, 216, 217, 218, 219, 254, 264, 266, 269, 271, 295, 309, 310, 330, 331, 333, 335, 336, 353, 363, 373], [-70, -62, -61, -60, -139, -138, -115, -107, -104, -137, -106, -110, -142, 146, -140, -109, 146, 146, 146, -105, -133, -130, 146, 146, -111, -134, -141, 146, -129, -116, 146, 146, 146, 146, -119, 146, 146, -118, -117, -128, 146, 146, -135, -113, -136, -108, 146, -137, 146, 146, 146, -112, -102, -114, 146, -103, 146]), 'INCR': ([54, 88, 89, 91, 98, 103, 105, 133, 143, 145, 146, 147, 148, 150, 151, 152, 153, 154, 155, 156, 157, 158, 159, 179, 245, 250, 251, 256, 265, 267, 268, 270, 296, 302, 303, 304, 325, 334, 346, 351, 358, 361, 367, 372, 374, 375, 376, 378, 381, 382], [89, 89, 89, 89, 89, 89, 89, 89, 89, 89, 89, 89, 89, 89, 89, 89, 89, 89, 89, 89, 89, 89, 89, 89, 89, 89, -98, -82, 89, 89, 89, 89, -81, 89, -88, 89, -97, 89, -95, -89, -94, -99, 89, -90, -92, -100, -101, -93, -91, -96]), 'LE': ([5, 20, 22, 61, 83, 84, 87, 93, 94, 96, 97, 99, 100, 101, 102, 132, 135, 136, 138, 140, 142, 160, 162, 197, 199, 201, 205, 206, 207, 208, 209, 210, 211, 212, 213, 214, 215, 216, 217, 218, 219, 254, 264, 266, 269, 271, 295, 309, 310, 330, 331, 333, 335, 336, 353, 363, 373], [-70, -62, -61, -60, -139, -138, -115, -107, -104, -137, -106, -110, -142, 151, -140, -109, 151, 151, 151, -105, -133, -130, 151, 151, -111, -134, -141, 151, -129, -116, 151, 151, -122, -123, -119, -120, -121, -118, -117, -128, 151, 151, -135, -113, -136, -108, 151, -137, 151, 151, 151, -112, -102, -114, 151, -103, 151]), 'SEMI': ([5, 20, 22, 32, 34, 40, 50, 52, 55, 61, 68, 75, 76, 77, 83, 84, 87, 93, 94, 96, 97, 99, 100, 101, 102, 104, 126, 130, 132, 135, 136, 140, 142, 160, 162, 163, 164, 168, 180, 181, 182, 183, 187, 193, 199, 201, 205, 206, 207, 208, 209, 210, 211, 212, 213, 214, 215, 216, 217, 218, 219, 221, 222, 254, 264, 266, 269, 271, 275, 282, 295, 312, 323, 326, 331, 333, 335, 336, 341, 347, 355, 363, 368, 380], [-70, -62, -61, -2, 56, 62, 73, -74, -2, -60, 117, -80, -73, -76, -139, -138, -115, -107, -104, -137, -106, -110, -142, 149, -140, 161, -2, -2, -109, -132, -131, -105, -133, -130, 220, -2, -2, 229, -78, -77, -79, -75, 258, 263, -111, -134, -141, -126, -129, -116, -125, -124, -122, -123, -119, -120, -121, -118, -117, -128, -127, 273, 274, 303, -135, -113, -136, -108, -2, -2, 325, 337, 344, 346, 351, -112, -102, -114, -2, 358, 364, -103, 374, 382]), 'STATIC_CAST': ([54, 88, 89, 91, 98, 103, 105, 133, 143, 145, 146, 147, 148, 150, 151, 152, 153, 154, 155, 156, 157, 158, 159, 179, 245, 250, 251, 256, 265, 267, 268, 270, 296, 302, 303, 304, 325, 334, 346, 351, 358, 361, 367, 372, 374, 375, 376, 378, 381, 382], [90, 90, 90, 90, 90, 90, 90, 90, 90, 90, 90, 90, 90, 90, 90, 90, 90, 90, 90, 90, 90, 90, 90, 90, 90, 90, -98, -82, 90, 90, 90, 90, -81, 90, -88, 90, -97, 90, -95, -89, -94, -99, 90, -90, -92, -100, -101, -93, -91, -96]), ')': ([5, 20, 22, 44, 45, 49, 52, 53, 57, 58, 59, 60, 61, 63, 64, 66, 72, 75, 76, 77, 78, 79, 80, 81, 82, 83, 84, 87, 93, 94, 96, 97, 99, 100, 102, 106, 107, 108, 109, 111, 112, 113, 116, 120, 125, 127, 129, 132, 135, 136, 138, 140, 142, 143, 160, 180, 181, 182, 183, 184, 186, 189, 190, 191, 192, 194, 195, 196, 197, 199, 201, 202, 204, 205, 206, 207, 208, 209, 210, 211, 212, 213, 214, 215, 216, 217, 218, 219, 240, 241, 242, 243, 259, 260, 261, 264, 265, 266, 267, 269, 270, 271, 288, 293, 297, 306, 307, 308, 309, 310, 311, 321, 327, 330, 333, 335, 336, 353, 357, 359, 360, 363, 365, 373, 377], [-70, -62, -61, -2, -65, -2, -74, -2, -2, -2, 110, -2, -60, -2, -2, 115, 122, -80, -73, -76, -49, 126, -50, -58, 130, -139, -138, -115, -107, -104, -137, -106, -110, -142, -140, 163, 164, 165, 166, 168, 169, 170, 173, -64, -2, -51, -2, -109, -132, -131, 201, -105, -133, -2, -130, -78, -77, -79, -75, -48, -50, -52, -57, -58, -59, -142, 264, -87, -86, -111, -134, 269, 271, -141, -126, -129, -116, -125, -124, -122, -123, -119, -120, -121, -118, -117, -128, -127, -71, -72, 292, -2, -56, -54, -55, -135, -2, -113, -2, -136, -2, -108, -2, 323, 326, -53, -85, 333, -137, 335, 336, 342, 347, 350, -112, -102, -114, 363, -2, 366, 368, -103, 371, 379, 380]), '(': ([4, 5, 8, 9, 10, 17, 18, 19, 23, 24, 26, 32, 35, 54, 85, 88, 89, 90, 91, 92, 98, 100, 103, 105, 133, 143, 145, 146, 147, 148, 150, 151, 152, 153, 154, 155, 156, 157, 158, 159, 179, 199, 203, 244, 245, 247, 248, 249, 250, 251, 252, 253, 255, 256, 265, 267, 268, 270, 296, 302, 303, 304, 325, 334, 346, 351, 358, 361, 367, 372, 374, 375, 376, 378, 381, 382], [28, -70, 29, 30, 31, 36, 37, 38, 41, 42, 43, 53, 57, 91, 131, 91, 91, 137, 91, 139, 91, 143, 91, 91, 91, 91, 91, 91, 91, 91, 91, 91, 91, 91, 91, 91, 91, 91, 91, 91, 91, 267, 270, 294, 91, 297, 298, 299, 91, -98, 301, 302, 305, -82, 91, 91, 91, 91, -81, 91, -88, 91, -97, 91, -95, -89, -94, -99, 91, -90, -92, -100, -101, -93, -91, -96]), 'IS_INVALID': ([54, 88, 89, 91, 98, 103, 105, 133, 143, 145, 146, 147, 148, 150, 151, 152, 153, 154, 155, 156, 157, 158, 159, 179, 245, 250, 251, 256, 265, 267, 268, 270, 296, 302, 303, 304, 325, 334, 346, 351, 358, 361, 367, 372, 374, 375, 376, 378, 381, 382], [92, 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, -98, -82, 92, 92, 92, 92, -81, 92, -88, 92, -97, 92, -95, -89, -94, -99, 92, -90, -92, -100, -101, -93, -91, -96]), 'NE': ([5, 20, 22, 61, 83, 84, 87, 93, 94, 96, 97, 99, 100, 101, 102, 132, 135, 136, 138, 140, 142, 160, 162, 197, 199, 201, 205, 206, 207, 208, 209, 210, 211, 212, 213, 214, 215, 216, 217, 218, 219, 254, 264, 266, 269, 271, 295, 309, 310, 330, 331, 333, 335, 336, 353, 363, 373], [-70, -62, -61, -60, -139, -138, -115, -107, -104, -137, -106, -110, -142, 148, -140, -109, 148, 148, 148, -105, -133, -130, 148, 148, -111, -134, -141, 148, -129, -116, -125, -124, -122, -123, -119, -120, -121, -118, -117, -128, 148, 148, -135, -113, -136, -108, 148, -137, 148, 148, 148, -112, -102, -114, 148, -103, 148]), 'OUT_PORT': ([0, 1, 2, 5, 7, 15, 45, 56, 62, 73, 120, 149, 161, 178, 220, 229, 239, 256, 257, 258, 263, 272, 273, 274, 281, 289, 291, 296, 313, 315, 317, 319, 322, 339, 343, 344, 354, 356], [9, 9, -29, -70, -34, -39, -65, -6, -7, -30, -64, -32, -31, -10, -33, -17, -14, -82, -41, -36, -38, -40, -35, -37, 9, -18, -16, -81, -20, 9, -19, -21, -13, -8, -15, -12, -9, -11]), 'ENQUEUE': ([179, 250, 251, 256, 296, 303, 325, 346, 351, 358, 361, 372, 374, 375, 376, 378, 381, 382], [249, 249, -98, -82, -81, -88, -97, -95, -89, -94, -99, -90, -92, -100, -101, -93, -91, -96]), 'LT': ([5, 20, 22, 61, 83, 84, 87, 93, 94, 96, 97, 99, 100, 101, 102, 132, 135, 136, 138, 140, 142, 160, 162, 197, 199, 201, 205, 206, 207, 208, 209, 210, 211, 212, 213, 214, 215, 216, 217, 218, 219, 254, 264, 266, 269, 271, 295, 309, 310, 330, 331, 333, 335, 336, 353, 363, 373], [-70, -62, -61, -60, -139, -138, -115, -107, -104, -137, -106, -110, -142, 154, -140, -109, 154, 154, 154, -105, -133, -130, 154, 154, -111, -134, -141, 154, -129, -116, 154, 154, -122, -123, -119, -120, -121, -118, -117, -128, 154, 154, -135, -113, -136, -108, 154, -137, 154, 154, 154, -112, -102, -114, 154, -103, 154]), 'DOUBLE_COLON': ([5, 20, 22, 61, 95, 100], [-70, 39, -61, -60, 141, -61]), 'PLUS': ([5, 20, 22, 61, 83, 84, 87, 93, 94, 96, 97, 99, 100, 101, 102, 132, 135, 136, 138, 140, 142, 160, 162, 197, 199, 201, 205, 206, 207, 208, 209, 210, 211, 212, 213, 214, 215, 216, 217, 218, 219, 254, 264, 266, 269, 271, 295, 309, 310, 330, 331, 333, 335, 336, 353, 363, 373], [-70, -62, -61, -60, -139, -138, -115, -107, -104, -137, -106, -110, -142, 156, -140, -109, 156, 156, 156, -105, -133, -130, 156, 156, -111, -134, -141, 156, 156, -116, 156, 156, 156, 156, -119, 156, 156, -118, -117, 156, 156, 156, -135, -113, -136, -108, 156, -137, 156, 156, 156, -112, -102, -114, 156, -103, 156]), 'DECR': ([54, 88, 89, 91, 98, 103, 105, 133, 143, 145, 146, 147, 148, 150, 151, 152, 153, 154, 155, 156, 157, 158, 159, 179, 245, 250, 251, 256, 265, 267, 268, 270, 296, 302, 303, 304, 325, 334, 346, 351, 358, 361, 367, 372, 374, 375, 376, 378, 381, 382], [88, 88, 88, 88, 88, 88, 88, 88, 88, 88, 88, 88, 88, 88, 88, 88, 88, 88, 88, 88, 88, 88, 88, 88, 88, 88, -98, -82, 88, 88, 88, 88, -81, 88, -88, 88, -97, 88, -95, -89, -94, -99, 88, -90, -92, -100, -101, -93, -91, -96]), 'ACTION': ([0, 1, 2, 5, 7, 15, 45, 56, 62, 73, 120, 149, 161, 178, 220, 229, 239, 256, 257, 258, 263, 272, 273, 274, 281, 289, 291, 296, 313, 315, 317, 319, 322, 339, 343, 344, 354, 356], [10, 10, -29, -70, -34, -39, -65, -6, -7, -30, -64, -32, -31, -10, -33, -17, -14, -82, -41, -36, -38, -40, -35, -37, 10, -18, -16, -81, -20, 10, -19, -21, -13, -8, -15, -12, -9, -11]), ':': ([5, 100, 110, 166, 340], [-70, 144, 167, 224, 144]), '=': ([5, 74], [-70, 123]), 'ASSIGN': ([5, 20, 22, 32, 55, 61, 83, 84, 87, 93, 94, 96, 97, 99, 100, 102, 127, 132, 135, 136, 140, 142, 160, 189, 199, 201, 205, 206, 207, 208, 209, 210, 211, 212, 213, 214, 215, 216, 217, 218, 219, 254, 264, 266, 269, 271, 282, 333, 335, 336, 363], [-70, -62, -61, 54, 105, -60, -139, -138, -115, -107, -104, -137, -106, -110, -142, -140, 188, -109, -132, -131, -105, -133, -130, 262, -111, -134, -141, -126, -129, -116, -125, -124, -122, -123, -119, -120, -121, -118, -117, -128, -127, 304, -135, -113, -136, -108, 54, -112, -102, -114, -103]), '$end': ([0, 1, 2, 5, 6, 7, 12, 13, 15, 25, 27, 45, 56, 62, 73, 120, 149, 161, 178, 220, 229, 239, 256, 257, 258, 263, 272, 273, 274, 289, 291, 296, 313, 317, 319, 322, 339, 343, 344, 354, 356], [-2, -2, -29, -70, 0, -34, -5, -3, -39, -1, -4, -65, -6, -7, -30, -64, -32, -31, -10, -33, -17, -14, -82, -41, -36, -38, -40, -35, -37, -18, -16, -81, -20, -19, -21, -13, -8, -15, -12, -9, -11]), 'IDENT': ([0, 1, 2, 3, 5, 7, 11, 15, 16, 20, 22, 28, 29, 30, 31, 33, 36, 37, 38, 39, 41, 42, 43, 45, 47, 51, 53, 54, 56, 57, 61, 62, 67, 68, 71, 73, 81, 86, 88, 89, 91, 95, 98, 100, 103, 105, 114, 117, 119, 120, 123, 124, 125, 128, 129, 131, 133, 134, 137, 139, 141, 143, 144, 145, 146, 147, 148, 149, 150, 151, 152, 153, 154, 155, 156, 157, 158, 159, 161, 167, 172, 173, 174, 177, 178, 179, 185, 220, 223, 224, 225, 227, 229, 230, 231, 232, 233, 235, 237, 238, 239, 245, 250, 251, 256, 257, 258, 263, 265, 267, 268, 270, 272, 273, 274, 277, 281, 286, 289, 291, 292, 294, 296, 298, 299, 301, 302, 303, 304, 305, 313, 315, 317, 318, 319, 322, 325, 334, 337, 339, 343, 344, 345, 346, 348, 349, 351, 354, 356, 358, 361, 364, 367, 372, 374, 375, 376, 378, 381, 382], [5, 5, -29, -63, -70, -34, 5, -39, 5, -62, -61, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, -65, 5, 5, 5, 5, -6, 5, -60, -7, 5, 5, 5, -30, 5, 5, 5, 5, 5, 5, 5, -61, 5, 5, 5, 5, 5, -64, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, -32, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, -31, 5, 5, 5, 5, 5, -10, 5, 5, -33, 5, 5, 5, 5, -17, 5, 5, 5, -26, 5, -27, -28, 5, 5, 5, -98, -82, -41, -36, -38, 5, 5, 5, 5, -40, -35, -37, 5, 5, 5, -18, -16, 5, 5, -81, 5, 5, 5, 5, -88, 5, 5, -20, 5, -19, 5, -21, 5, -97, 5, -44, -8, -15, -12, 5, -95, 5, 5, -89, -9, -11, -94, -99, -47, 5, -90, -92, -100, -101, -93, -91, -96]), 'PROTOCOL': ([0, 1, 2, 5, 7, 15, 45, 56, 62, 73, 120, 149, 161, 178, 220, 229, 239, 256, 257, 258, 263, 272, 273, 274, 281, 289, 291, 296, 313, 315, 317, 319, 322, 339, 343, 344, 354, 356], [14, 14, -29, -70, -34, -39, -65, -6, -7, -30, -64, -32, -31, -10, -33, -17, -14, -82, -41, -36, -38, -40, -35, -37, 14, -18, -16, -81, -20, 14, -19, -21, -13, -8, -15, -12, -9, -11]), 'STRING': ([14, 21, 51, 54, 88, 89, 91, 98, 103, 105, 123, 124, 133, 143, 145, 146, 147, 148, 150, 151, 152, 153, 154, 155, 156, 157, 158, 159, 179, 188, 245, 250, 251, 256, 262, 265, 267, 268, 270, 296, 302, 303, 304, 325, 334, 346, 351, 352, 358, 361, 367, 370, 372, 374, 375, 376, 378, 381, 382], [34, 40, 75, 96, 96, 96, 96, 96, 96, 96, 181, 75, 96, 96, 96, 96, 96, 96, 96, 96, 96, 96, 96, 96, 96, 96, 96, 96, 96, 259, 96, 96, -98, -82, 306, 96, 96, 309, 96, -81, 96, -88, 96, -97, 96, -95, -89, 362, -94, -99, 96, 377, -90, -92, -100, -101, -93, -91, -96]), 'STALL_AND_WAIT': ([179, 250, 251, 256, 296, 303, 325, 346, 351, 358, 361, 372, 374, 375, 376, 378, 381, 382], [252, 252, -98, -82, -81, -88, -97, -95, -89, -94, -99, -90, -92, -100, -101, -93, -91, -96]), 'OOD': ([54, 88, 89, 91, 98, 103, 105, 133, 143, 145, 146, 147, 148, 150, 151, 152, 153, 154, 155, 156, 157, 158, 159, 179, 245, 250, 251, 256, 265, 267, 268, 270, 296, 302, 303, 304, 325, 334, 346, 351, 358, 361, 367, 372, 374, 375, 376, 378, 381, 382], [99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, -98, -82, 99, 99, 99, 99, -81, 99, -88, 99, -97, 99, -95, -89, -94, -99, 99, -90, -92, -100, -101, -93, -91, -96]), 'ENUM': ([0, 1, 2, 5, 7, 15, 45, 56, 62, 73, 120, 149, 161, 178, 220, 229, 239, 256, 257, 258, 263, 272, 273, 274, 281, 289, 291, 296, 313, 315, 317, 319, 322, 339, 343, 344, 354, 356], [17, 17, -29, -70, -34, -39, -65, -6, -7, -30, -64, -32, -31, -10, -33, -17, -14, -82, -41, -36, -38, -40, -35, -37, 17, -18, -16, -81, -20, 17, -19, -21, -13, -8, -15, -12, -9, -11]), 'ELSE': ([256, 296, 361], [-82, -81, 369]), 'MACHINE': ([0, 1, 2, 5, 7, 15, 45, 56, 62, 73, 120, 149, 161, 178, 220, 229, 239, 256, 257, 258, 263, 272, 273, 274, 281, 289, 291, 296, 313, 315, 317, 319, 322, 339, 343, 344, 354, 356], [18, 18, -29, -70, -34, -39, -65, -6, -7, -30, -64, -32, -31, -10, -33, -17, -14, -82, -41, -36, -38, -40, -35, -37, 18, -18, -16, -81, -20, 18, -19, -21, -13, -8, -15, -12, -9, -11]), 'GE': ([5, 20, 22, 61, 83, 84, 87, 93, 94, 96, 97, 99, 100, 101, 102, 132, 135, 136, 138, 140, 142, 160, 162, 197, 199, 201, 205, 206, 207, 208, 209, 210, 211, 212, 213, 214, 215, 216, 217, 218, 219, 254, 264, 266, 269, 271, 295, 309, 310, 330, 331, 333, 335, 336, 353, 363, 373], [-70, -62, -61, -60, -139, -138, -115, -107, -104, -137, -106, -110, -142, 152, -140, -109, 152, 152, 152, -105, -133, -130, 152, 152, -111, -134, -141, 152, -129, -116, 152, 152, -122, -123, -119, -120, -121, -118, -117, -128, 152, 152, -135, -113, -136, -108, 152, -137, 152, 152, 152, -112, -102, -114, 152, -103, 152]), 'EXTERN_TYPE': ([0, 1, 2, 5, 7, 15, 45, 56, 62, 73, 120, 149, 161, 178, 220, 229, 239, 256, 257, 258, 263, 272, 273, 274, 281, 289, 291, 296, 313, 315, 317, 319, 322, 339, 343, 344, 354, 356], [19, 19, -29, -70, -34, -39, -65, -6, -7, -30, -64, -32, -31, -10, -33, -17, -14, -82, -41, -36, -38, -40, -35, -37, 19, -18, -16, -81, -20, 19, -19, -21, -13, -8, -15, -12, -9, -11]), '[': ([5, 20, 22, 61, 83, 84, 87, 93, 94, 96, 97, 99, 100, 102, 132, 140, 199, 201, 205, 264, 266, 269, 271, 309, 333, 335, 336, 363], [-70, -62, -61, -60, -139, -138, 133, -107, -104, -137, -106, -110, -142, -140, -109, -105, -111, -134, -141, -135, -113, -136, -108, -137, -112, -102, -114, -103]), 'INCLUDE': ([0, 1, 2, 5, 7, 15, 45, 56, 62, 73, 120, 149, 161, 178, 220, 229, 239, 256, 257, 258, 263, 272, 273, 274, 281, 289, 291, 296, 313, 315, 317, 319, 322, 339, 343, 344, 354, 356], [21, 21, -29, -70, -34, -39, -65, -6, -7, -30, -64, -32, -31, -10, -33, -17, -14, -82, -41, -36, -38, -40, -35, -37, 21, -18, -16, -81, -20, 21, -19, -21, -13, -8, -15, -12, -9, -11]), ']': ([5, 20, 22, 61, 83, 84, 87, 93, 94, 96, 97, 99, 100, 102, 132, 133, 135, 136, 140, 142, 160, 196, 197, 198, 199, 201, 205, 206, 207, 208, 209, 210, 211, 212, 213, 214, 215, 216, 217, 218, 219, 264, 265, 266, 269, 271, 307, 333, 335, 336, 363], [-70, -62, -61, -60, -139, -138, -115, -107, -104, -137, -106, -110, -142, -140, -109, -2, -132, -131, -105, -133, -130, -87, -86, 266, -111, -134, -141, -126, -129, -116, -125, -124, -122, -123, -119, -120, -121, -118, -117, -128, -127, -135, -2, -113, -136, -108, -85, -112, -102, -114, -103]), 'IF': ([179, 250, 251, 256, 296, 303, 325, 346, 351, 358, 361, 369, 372, 374, 375, 376, 378, 381, 382], [253, 253, -98, -82, -81, -88, -97, -95, -89, -94, -99, 253, -90, -92, -100, -101, -93, -91, -96]), 'AND': ([5, 20, 22, 61, 83, 84, 87, 93, 94, 96, 97, 99, 100, 101, 102, 132, 135, 136, 138, 140, 142, 160, 162, 197, 199, 201, 205, 206, 207, 208, 209, 210, 211, 212, 213, 214, 215, 216, 217, 218, 219, 254, 264, 266, 269, 271, 295, 309, 310, 330, 331, 333, 335, 336, 353, 363, 373], [-70, -62, -61, -60, -139, -138, -115, -107, -104, -137, -106, -110, -142, 145, -140, -109, 145, 145, 145, -105, -133, -130, 145, 145, -111, -134, -141, -126, -129, -116, -125, -124, -122, -123, -119, -120, -121, -118, -117, -128, -127, 145, -135, -113, -136, -108, 145, -137, 145, 145, 145, -112, -102, -114, 145, -103, 145]), 'DASH': ([5, 20, 22, 54, 61, 83, 84, 87, 88, 89, 91, 93, 94, 96, 97, 98, 99, 100, 101, 102, 103, 105, 132, 133, 135, 136, 138, 140, 142, 143, 145, 146, 147, 148, 150, 151, 152, 153, 154, 155, 156, 157, 158, 159, 160, 162, 179, 197, 199, 201, 205, 206, 207, 208, 209, 210, 211, 212, 213, 214, 215, 216, 217, 218, 219, 245, 250, 251, 254, 256, 264, 265, 266, 267, 268, 269, 270, 271, 295, 296, 302, 303, 304, 309, 310, 325, 330, 331, 333, 334, 335, 336, 346, 351, 353, 358, 361, 363, 367, 372, 373, 374, 375, 376, 378, 381, 382], [-70, -62, -61, 98, -60, -139, -138, -115, 98, 98, 98, -107, -104, -137, -106, 98, -110, -142, 153, -140, 98, 98, -109, 98, 153, 153, 153, -105, -133, 98, 98, 98, 98, 98, 98, 98, 98, 98, 98, 98, 98, 98, 98, 98, -130, 153, 98, 153, -111, -134, -141, 153, 153, -116, 153, 153, 153, 153, -119, 153, 153, -118, -117, 153, 153, 98, 98, -98, 153, -82, -135, 98, -113, 98, 98, -136, 98, -108, 153, -81, 98, -88, 98, -137, 153, -97, 153, 153, -112, 98, -102, -114, -95, -89, 153, -94, -99, -103, 98, -90, 153, -92, -100, -101, -93, -91, -96]), 'RETURN': ([179, 250, 251, 256, 296, 303, 325, 346, 351, 358, 361, 372, 374, 375, 376, 378, 381, 382], [245, 245, -98, -82, -81, -88, -97, -95, -89, -94, -99, -90, -92, -100, -101, -93, -91, -96]), 'EQ': ([5, 20, 22, 61, 83, 84, 87, 93, 94, 96, 97, 99, 100, 101, 102, 132, 135, 136, 138, 140, 142, 160, 162, 197, 199, 201, 205, 206, 207, 208, 209, 210, 211, 212, 213, 214, 215, 216, 217, 218, 219, 254, 264, 266, 269, 271, 295, 309, 310, 330, 331, 333, 335, 336, 353, 363, 373], [-70, -62, -61, -60, -139, -138, -115, -107, -104, -137, -106, -110, -142, 150, -140, -109, 150, 150, 150, -105, -133, -130, 150, 150, -111, -134, -141, 150, -129, -116, -125, -124, -122, -123, -119, -120, -121, -118, -117, -128, 150, 150, -135, -113, -136, -108, 150, -137, 150, 150, 150, -112, -102, -114, 150, -103, 150]), 'STRUCT': ([0, 1, 2, 5, 7, 15, 45, 56, 62, 73, 120, 149, 161, 178, 220, 229, 239, 256, 257, 258, 263, 272, 273, 274, 281, 289, 291, 296, 313, 315, 317, 319, 322, 339, 343, 344, 354, 356], [23, 23, -29, -70, -34, -39, -65, -6, -7, -30, -64, -32, -31, -10, -33, -17, -14, -82, -41, -36, -38, -40, -35, -37, 23, -18, -16, -81, -20, 23, -19, -21, -13, -8, -15, -12, -9, -11]), 'CHECK_STOP_SLOTS': ([179, 250, 251, 256, 296, 303, 325, 346, 351, 358, 361, 372, 374, 375, 376, 378, 381, 382], [255, 255, -98, -82, -81, -88, -97, -95, -89, -94, -99, -90, -92, -100, -101, -93, -91, -96]), 'STATE_DECL': ([0, 1, 2, 5, 7, 15, 45, 56, 62, 73, 120, 149, 161, 178, 220, 229, 239, 256, 257, 258, 263, 272, 273, 274, 281, 289, 291, 296, 313, 315, 317, 319, 322, 339, 343, 344, 354, 356], [24, 24, -29, -70, -34, -39, -65, -6, -7, -30, -64, -32, -31, -10, -33, -17, -14, -82, -41, -36, -38, -40, -35, -37, 24, -18, -16, -81, -20, 24, -19, -21, -13, -8, -15, -12, -9, -11]), 'CHECK_ALLOCATE': ([179, 250, 251, 256, 296, 303, 325, 346, 351, 358, 361, 372, 374, 375, 376, 378, 381, 382], [248, 248, -98, -82, -81, -88, -97, -95, -89, -94, -99, -90, -92, -100, -101, -93, -91, -96]), 'LIT_BOOL': ([54, 88, 89, 91, 98, 103, 105, 133, 143, 145, 146, 147, 148, 150, 151, 152, 153, 154, 155, 156, 157, 158, 159, 179, 188, 245, 250, 251, 256, 265, 267, 268, 270, 296, 302, 303, 304, 325, 334, 346, 351, 358, 361, 367, 372, 374, 375, 376, 378, 381, 382], [102, 102, 102, 102, 102, 102, 102, 102, 102, 102, 102, 102, 102, 102, 102, 102, 102, 102, 102, 102, 102, 102, 102, 102, 261, 102, 102, -98, -82, 102, 102, 102, 102, -81, 102, -88, 102, -97, 102, -95, -89, -94, -99, 102, -90, -92, -100, -101, -93, -91, -96]), 'IS_VALID': ([54, 88, 89, 91, 98, 103, 105, 133, 143, 145, 146, 147, 148, 150, 151, 152, 153, 154, 155, 156, 157, 158, 159, 179, 245, 250, 251, 256, 265, 267, 268, 270, 296, 302, 303, 304, 325, 334, 346, 351, 358, 361, 367, 372, 374, 375, 376, 378, 381, 382], [85, 85, 85, 85, 85, 85, 85, 85, 85, 85, 85, 85, 85, 85, 85, 85, 85, 85, 85, 85, 85, 85, 85, 85, 85, 85, -98, -82, 85, 85, 85, 85, -81, 85, -88, 85, -97, 85, -95, -89, -94, -99, 85, -90, -92, -100, -101, -93, -91, -96]), 'NOT': ([54, 88, 89, 91, 98, 103, 105, 133, 143, 145, 146, 147, 148, 150, 151, 152, 153, 154, 155, 156, 157, 158, 159, 179, 245, 250, 251, 256, 265, 267, 268, 270, 296, 302, 303, 304, 325, 334, 346, 351, 358, 361, 367, 372, 374, 375, 376, 378, 381, 382], [103, 103, 103, 103, 103, 103, 103, 103, 103, 103, 103, 103, 103, 103, 103, 103, 103, 103, 103, 103, 103, 103, 103, 103, 103, 103, -98, -82, 103, 103, 103, 103, -81, 103, -88, 103, -97, 103, -95, -89, -94, -99, 103, -90, -92, -100, -101, -93, -91, -96]), '{': ([5, 29, 37, 45, 52, 67, 73, 75, 76, 77, 115, 120, 122, 126, 149, 161, 163, 165, 167, 169, 170, 173, 180, 181, 182, 183, 187, 220, 221, 224, 225, 226, 228, 239, 279, 280, 292, 322, 342, 350, 366, 369, 371, 379], [-70, 47, 47, -65, -74, 47, -30, -80, -73, -76, 172, -64, 179, -2, -32, -31, -2, 223, -2, 230, 231, 47, -78, -77, -79, -75, 179, -33, 179, -2, -2, 281, -23, 47, 315, -22, 47, 47, 179, 179, 179, 179, 179, 179]), '}': ([1, 2, 5, 7, 12, 13, 15, 27, 45, 47, 56, 62, 68, 69, 70, 73, 117, 118, 119, 120, 149, 161, 172, 175, 176, 178, 179, 220, 223, 229, 230, 231, 233, 234, 235, 236, 237, 238, 239, 246, 250, 251, 256, 257, 258, 263, 272, 273, 274, 276, 277, 278, 281, 283, 285, 286, 287, 289, 290, 291, 296, 300, 303, 313, 314, 315, 316, 317, 319, 320, 322, 325, 337, 338, 339, 343, 344, 346, 351, 354, 356, 358, 361, 364, 372, 374, 375, 376, 378, 381, 382], [-2, -29, -70, -34, -5, -3, -39, -4, -65, -2, -6, -7, -2, 120, -69, -30, -2, -68, -2, -64, -32, -31, -2, -66, -67, -10, 256, -33, -2, -17, -2, -2, -26, 289, -2, -25, -27, -28, -14, 296, -84, -98, -82, -41, -36, -38, -40, -35, -37, 313, -2, -43, -2, 317, 319, -2, -46, -18, -24, -16, -81, -83, -88, -20, -42, -2, 339, -19, -21, -45, -13, -97, -44, 354, -8, -15, -12, -95, -89, -9, -11, -94, -99, -47, -90, -92, -100, -101, -93, -91, -96]), 'OR': ([5, 20, 22, 61, 83, 84, 87, 93, 94, 96, 97, 99, 100, 101, 102, 132, 135, 136, 138, 140, 142, 160, 162, 197, 199, 201, 205, 206, 207, 208, 209, 210, 211, 212, 213, 214, 215, 216, 217, 218, 219, 254, 264, 266, 269, 271, 295, 309, 310, 330, 331, 333, 335, 336, 353, 363, 373], [-70, -62, -61, -60, -139, -138, -115, -107, -104, -137, -106, -110, -142, 159, -140, -109, 159, 159, 159, -105, -133, -130, 159, 159, -111, -134, -141, -126, -129, -116, -125, -124, -122, -123, -119, -120, -121, -118, -117, -128, -127, 159, -135, -113, -136, -108, 159, -137, 159, 159, 159, -112, -102, -114, 159, -103, 159]), 'IN_PORT': ([0, 1, 2, 5, 7, 15, 45, 56, 62, 73, 120, 149, 161, 178, 220, 229, 239, 256, 257, 258, 263, 272, 273, 274, 281, 289, 291, 296, 313, 315, 317, 319, 322, 339, 343, 344, 354, 356], [26, 26, -29, -70, -34, -39, -65, -6, -7, -30, -64, -32, -31, -10, -33, -17, -14, -82, -41, -36, -38, -40, -35, -37, 26, -18, -16, -81, -20, 26, -19, -21, -13, -8, -15, -12, -9, -11])} _lr_action = {} for (_k, _v) in _lr_action_items.items(): for (_x, _y) in zip(_v[0], _v[1]): if not _x in _lr_action: _lr_action[_x] = {} _lr_action[_x][_k] = _y del _lr_action_items _lr_goto_items = {'decl': ([0, 1, 281, 315], [1, 1, 1, 1]), 'obj_decl': ([0, 1, 167, 172, 224, 225, 230, 235, 281, 315], [2, 2, 225, 233, 225, 225, 233, 233, 2, 2]), 'statements': ([122, 187, 221, 342, 350, 366, 369, 371, 379], [178, 257, 272, 356, 361, 372, 375, 378, 381]), 'type_enums': ([223, 277], [276, 314]), 'pairsx': ([51, 124], [76, 183]), 'type_members': ([172, 230, 235], [234, 283, 290]), 'ident_or_star': ([174], [242]), 'statements_inner': ([179, 250], [246, 300]), 'enumeration': ([54, 88, 89, 91, 98, 103, 105, 133, 143, 145, 146, 147, 148, 150, 151, 152, 153, 154, 155, 156, 157, 158, 159, 179, 245, 250, 265, 267, 268, 270, 302, 304, 318, 334, 367], [93, 93, 93, 93, 93, 93, 93, 93, 93, 93, 93, 93, 93, 93, 93, 93, 93, 93, 93, 93, 93, 93, 93, 93, 93, 93, 93, 93, 93, 93, 93, 93, 341, 93, 93]), 'file': ([0], [6]), 'type_state': ([231, 286], [286, 286]), 'type_member': ([172, 230, 235], [235, 235, 235]), 'aexpr': ([54, 88, 89, 91, 98, 103, 105, 133, 143, 145, 146, 147, 148, 150, 151, 152, 153, 154, 155, 156, 157, 158, 159, 179, 245, 250, 265, 267, 268, 270, 302, 304, 334, 367], [87, 87, 87, 87, 87, 87, 87, 87, 87, 87, 87, 87, 87, 87, 87, 87, 87, 87, 87, 87, 87, 87, 87, 87, 87, 87, 87, 87, 87, 87, 87, 87, 87, 87]), 'param': ([53, 57, 125], [78, 78, 78]), 'literal': ([54, 88, 89, 91, 98, 103, 105, 133, 143, 145, 146, 147, 148, 150, 151, 152, 153, 154, 155, 156, 157, 158, 159, 179, 245, 250, 265, 267, 268, 270, 302, 304, 334, 367], [97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97]), 'params': ([53, 57, 125], [79, 106, 184]), 'statement': ([179, 250], [250, 250]), 'var': ([54, 88, 89, 91, 98, 103, 105, 131, 133, 139, 143, 145, 146, 147, 148, 150, 151, 152, 153, 154, 155, 156, 157, 158, 159, 177, 179, 232, 245, 250, 265, 267, 268, 270, 294, 298, 299, 301, 302, 304, 305, 334, 349, 367], [94, 94, 94, 94, 94, 94, 94, 195, 94, 202, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 243, 94, 288, 94, 94, 94, 94, 94, 94, 324, 327, 328, 329, 94, 94, 332, 94, 360, 94]), 'if_statement': ([179, 250, 369], [251, 251, 376]), 'type': ([0, 1, 28, 36, 38, 41, 42, 53, 54, 57, 71, 86, 88, 89, 91, 98, 103, 105, 114, 125, 129, 133, 137, 143, 145, 146, 147, 148, 150, 151, 152, 153, 154, 155, 156, 157, 158, 159, 167, 172, 179, 224, 225, 230, 235, 245, 250, 265, 267, 268, 270, 281, 302, 304, 315, 334, 345, 348, 367], [11, 11, 44, 58, 60, 63, 64, 81, 95, 81, 121, 132, 95, 95, 95, 95, 95, 95, 171, 185, 191, 95, 200, 95, 95, 95, 95, 95, 95, 95, 95, 95, 95, 95, 95, 95, 95, 95, 227, 11, 95, 227, 227, 11, 11, 95, 95, 95, 95, 95, 95, 11, 95, 95, 11, 95, 357, 359, 95]), 'empty': ([0, 1, 32, 44, 47, 49, 53, 55, 57, 58, 59, 60, 63, 64, 68, 117, 119, 125, 126, 129, 130, 133, 143, 163, 164, 167, 172, 223, 224, 225, 230, 231, 235, 243, 265, 267, 270, 275, 277, 281, 282, 286, 288, 315, 341, 357], [12, 12, 52, 52, 70, 52, 80, 52, 80, 52, 52, 52, 52, 52, 70, 70, 70, 186, 52, 192, 52, 196, 196, 52, 52, 228, 236, 278, 228, 228, 236, 287, 236, 52, 196, 196, 196, 52, 278, 12, 52, 287, 52, 12, 52, 52]), 'declsx': ([0, 1, 281, 315], [13, 27, 13, 13]), 'func_decl': ([0, 1, 172, 230, 235, 281, 315], [7, 7, 237, 237, 237, 7, 7]), 'func_def': ([0, 1, 172, 230, 235, 281, 315], [15, 15, 238, 238, 238, 15, 15]), 'idents': ([29, 37, 67, 173, 239, 292, 322], [46, 59, 116, 239, 291, 322, 343]), 'void': ([0, 1, 172, 230, 235, 281, 315], [16, 16, 16, 16, 16, 16, 16]), 'identx': ([47, 68, 117, 119], [69, 118, 175, 176]), 'type_states': ([231, 286], [285, 320]), 'pair': ([51, 124], [77, 77]), 'type_enum': ([223, 277], [277, 277]), 'typestr': ([0, 1, 28, 36, 38, 41, 42, 53, 54, 57, 71, 86, 88, 89, 91, 98, 103, 105, 114, 125, 129, 133, 137, 143, 145, 146, 147, 148, 150, 151, 152, 153, 154, 155, 156, 157, 158, 159, 167, 172, 179, 224, 225, 230, 235, 245, 250, 265, 267, 268, 270, 281, 302, 304, 315, 334, 345, 348, 367], [20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20]), 'types': ([53, 57, 129], [82, 107, 190]), 'pairs': ([32, 44, 49, 55, 58, 59, 60, 63, 64, 126, 130, 163, 164, 243, 275, 282, 288, 341, 357], [50, 66, 72, 104, 108, 109, 111, 112, 113, 187, 193, 221, 222, 293, 312, 50, 321, 355, 365]), 'ident': ([0, 1, 11, 16, 28, 29, 30, 31, 33, 36, 37, 38, 39, 41, 42, 43, 47, 51, 53, 54, 57, 67, 68, 71, 81, 86, 88, 89, 91, 95, 98, 103, 105, 114, 117, 119, 123, 124, 125, 128, 129, 131, 133, 134, 137, 139, 141, 143, 144, 145, 146, 147, 148, 150, 151, 152, 153, 154, 155, 156, 157, 158, 159, 167, 172, 173, 174, 177, 179, 185, 223, 224, 225, 227, 230, 231, 232, 235, 239, 245, 250, 265, 267, 268, 270, 277, 281, 286, 292, 294, 298, 299, 301, 302, 304, 305, 315, 318, 322, 334, 345, 348, 349, 367], [22, 22, 32, 35, 22, 45, 48, 49, 55, 22, 45, 22, 61, 22, 22, 65, 68, 74, 22, 100, 22, 45, 68, 22, 127, 22, 100, 100, 100, 140, 100, 100, 100, 22, 68, 68, 180, 74, 22, 189, 22, 194, 100, 199, 22, 194, 203, 100, 205, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 22, 22, 45, 240, 194, 100, 127, 275, 22, 22, 282, 22, 284, 194, 22, 45, 100, 100, 100, 100, 100, 100, 275, 22, 284, 45, 194, 194, 194, 194, 100, 100, 194, 22, 340, 45, 100, 22, 22, 194, 100]), 'obj_decls': ([167, 224, 225], [226, 279, 280]), 'expr': ([54, 88, 89, 91, 98, 103, 105, 133, 143, 145, 146, 147, 148, 150, 151, 152, 153, 154, 155, 156, 157, 158, 159, 179, 245, 250, 265, 267, 268, 270, 302, 304, 334, 367], [101, 135, 136, 138, 142, 160, 162, 197, 197, 206, 207, 208, 209, 210, 211, 212, 213, 214, 215, 216, 217, 218, 219, 254, 295, 254, 197, 197, 310, 197, 330, 331, 353, 373]), 'exprs': ([133, 143, 265, 267, 270], [198, 204, 307, 308, 311]), 'decls': ([0, 281, 315], [25, 316, 338])} _lr_goto = {} for (_k, _v) in _lr_goto_items.items(): for (_x, _y) in zip(_v[0], _v[1]): if not _x in _lr_goto: _lr_goto[_x] = {} _lr_goto[_x][_k] = _y del _lr_goto_items _lr_productions = [("S' -> file", "S'", 1, None, None, None), ('file -> decls', 'file', 1, 'p_file', '/users/alian/simulators/pdgem5/src/mem/slicc/parser.py', 219), ('empty -> <empty>', 'empty', 0, 'p_empty', '/users/alian/simulators/pdgem5/src/mem/slicc/parser.py', 223), ('decls -> declsx', 'decls', 1, 'p_decls', '/users/alian/simulators/pdgem5/src/mem/slicc/parser.py', 226), ('declsx -> decl declsx', 'declsx', 2, 'p_declsx__list', '/users/alian/simulators/pdgem5/src/mem/slicc/parser.py', 230), ('declsx -> empty', 'declsx', 1, 'p_declsx__none', '/users/alian/simulators/pdgem5/src/mem/slicc/parser.py', 240), ('decl -> PROTOCOL STRING SEMI', 'decl', 3, 'p_decl__protocol', '/users/alian/simulators/pdgem5/src/mem/slicc/parser.py', 244), ('decl -> INCLUDE STRING SEMI', 'decl', 3, 'p_decl__include', '/users/alian/simulators/pdgem5/src/mem/slicc/parser.py', 253), ('decl -> MACHINE ( idents ) : obj_decls { decls }', 'decl', 9, 'p_decl__machine0', '/users/alian/simulators/pdgem5/src/mem/slicc/parser.py', 262), ('decl -> MACHINE ( idents pairs ) : obj_decls { decls }', 'decl', 10, 'p_decl__machine1', '/users/alian/simulators/pdgem5/src/mem/slicc/parser.py', 266), ('decl -> ACTION ( ident pairs ) statements', 'decl', 6, 'p_decl__action', '/users/alian/simulators/pdgem5/src/mem/slicc/parser.py', 270), ('decl -> IN_PORT ( ident , type , var pairs ) statements', 'decl', 10, 'p_decl__in_port', '/users/alian/simulators/pdgem5/src/mem/slicc/parser.py', 274), ('decl -> OUT_PORT ( ident , type , var pairs ) SEMI', 'decl', 10, 'p_decl__out_port', '/users/alian/simulators/pdgem5/src/mem/slicc/parser.py', 278), ('decl -> TRANS ( idents , idents , ident_or_star ) idents', 'decl', 9, 'p_decl__trans0', '/users/alian/simulators/pdgem5/src/mem/slicc/parser.py', 282), ('decl -> TRANS ( idents , idents ) idents', 'decl', 7, 'p_decl__trans1', '/users/alian/simulators/pdgem5/src/mem/slicc/parser.py', 286), ('decl -> TRANS ( idents , idents , ident_or_star ) idents idents', 'decl', 10, 'p_decl__trans2', '/users/alian/simulators/pdgem5/src/mem/slicc/parser.py', 290), ('decl -> TRANS ( idents , idents ) idents idents', 'decl', 8, 'p_decl__trans3', '/users/alian/simulators/pdgem5/src/mem/slicc/parser.py', 294), ('decl -> EXTERN_TYPE ( type pairs ) SEMI', 'decl', 6, 'p_decl__extern0', '/users/alian/simulators/pdgem5/src/mem/slicc/parser.py', 298), ('decl -> GLOBAL ( type pairs ) { type_members }', 'decl', 8, 'p_decl__global', '/users/alian/simulators/pdgem5/src/mem/slicc/parser.py', 303), ('decl -> STRUCT ( type pairs ) { type_members }', 'decl', 8, 'p_decl__struct', '/users/alian/simulators/pdgem5/src/mem/slicc/parser.py', 308), ('decl -> ENUM ( type pairs ) { type_enums }', 'decl', 8, 'p_decl__enum', '/users/alian/simulators/pdgem5/src/mem/slicc/parser.py', 312), ('decl -> STATE_DECL ( type pairs ) { type_states }', 'decl', 8, 'p_decl__state_decl', '/users/alian/simulators/pdgem5/src/mem/slicc/parser.py', 317), ('obj_decls -> obj_decl obj_decls', 'obj_decls', 2, 'p_obj_decls__list', '/users/alian/simulators/pdgem5/src/mem/slicc/parser.py', 324), ('obj_decls -> empty', 'obj_decls', 1, 'p_obj_decls__empty', '/users/alian/simulators/pdgem5/src/mem/slicc/parser.py', 328), ('type_members -> type_member type_members', 'type_members', 2, 'p_type_members__list', '/users/alian/simulators/pdgem5/src/mem/slicc/parser.py', 332), ('type_members -> empty', 'type_members', 1, 'p_type_members__empty', '/users/alian/simulators/pdgem5/src/mem/slicc/parser.py', 336), ('type_member -> obj_decl', 'type_member', 1, 'p_type_member__0', '/users/alian/simulators/pdgem5/src/mem/slicc/parser.py', 340), ('type_member -> func_decl', 'type_member', 1, 'p_type_member__0', '/users/alian/simulators/pdgem5/src/mem/slicc/parser.py', 341), ('type_member -> func_def', 'type_member', 1, 'p_type_member__0', '/users/alian/simulators/pdgem5/src/mem/slicc/parser.py', 342), ('decl -> obj_decl', 'decl', 1, 'p_decl__obj_decl', '/users/alian/simulators/pdgem5/src/mem/slicc/parser.py', 347), ('obj_decl -> type ident pairs SEMI', 'obj_decl', 4, 'p_obj_decl__0', '/users/alian/simulators/pdgem5/src/mem/slicc/parser.py', 351), ('obj_decl -> type STAR ident pairs SEMI', 'obj_decl', 5, 'p_obj_decl__1', '/users/alian/simulators/pdgem5/src/mem/slicc/parser.py', 355), ('obj_decl -> type ident ASSIGN expr SEMI', 'obj_decl', 5, 'p_obj_decl__2', '/users/alian/simulators/pdgem5/src/mem/slicc/parser.py', 359), ('obj_decl -> type STAR ident ASSIGN expr SEMI', 'obj_decl', 6, 'p_obj_decl__3', '/users/alian/simulators/pdgem5/src/mem/slicc/parser.py', 364), ('decl -> func_decl', 'decl', 1, 'p_decl__func_decl', '/users/alian/simulators/pdgem5/src/mem/slicc/parser.py', 370), ('func_decl -> void ident ( params ) pairs SEMI', 'func_decl', 7, 'p_func_decl__0', '/users/alian/simulators/pdgem5/src/mem/slicc/parser.py', 374), ('func_decl -> type ident ( params ) pairs SEMI', 'func_decl', 7, 'p_func_decl__0', '/users/alian/simulators/pdgem5/src/mem/slicc/parser.py', 375), ('func_decl -> void ident ( types ) pairs SEMI', 'func_decl', 7, 'p_func_decl__1', '/users/alian/simulators/pdgem5/src/mem/slicc/parser.py', 379), ('func_decl -> type ident ( types ) pairs SEMI', 'func_decl', 7, 'p_func_decl__1', '/users/alian/simulators/pdgem5/src/mem/slicc/parser.py', 380), ('decl -> func_def', 'decl', 1, 'p_decl__func_def', '/users/alian/simulators/pdgem5/src/mem/slicc/parser.py', 384), ('func_def -> void ident ( params ) pairs statements', 'func_def', 7, 'p_func_def__0', '/users/alian/simulators/pdgem5/src/mem/slicc/parser.py', 388), ('func_def -> type ident ( params ) pairs statements', 'func_def', 7, 'p_func_def__0', '/users/alian/simulators/pdgem5/src/mem/slicc/parser.py', 389), ('type_enums -> type_enum type_enums', 'type_enums', 2, 'p_type_enums__list', '/users/alian/simulators/pdgem5/src/mem/slicc/parser.py', 394), ('type_enums -> empty', 'type_enums', 1, 'p_type_enums__empty', '/users/alian/simulators/pdgem5/src/mem/slicc/parser.py', 398), ('type_enum -> ident pairs SEMI', 'type_enum', 3, 'p_type_enum', '/users/alian/simulators/pdgem5/src/mem/slicc/parser.py', 402), ('type_states -> type_state type_states', 'type_states', 2, 'p_type_states__list', '/users/alian/simulators/pdgem5/src/mem/slicc/parser.py', 407), ('type_states -> empty', 'type_states', 1, 'p_type_states__empty', '/users/alian/simulators/pdgem5/src/mem/slicc/parser.py', 411), ('type_state -> ident , enumeration pairs SEMI', 'type_state', 5, 'p_type_state', '/users/alian/simulators/pdgem5/src/mem/slicc/parser.py', 415), ('params -> param , params', 'params', 3, 'p_params__many', '/users/alian/simulators/pdgem5/src/mem/slicc/parser.py', 420), ('params -> param', 'params', 1, 'p_params__one', '/users/alian/simulators/pdgem5/src/mem/slicc/parser.py', 424), ('params -> empty', 'params', 1, 'p_params__none', '/users/alian/simulators/pdgem5/src/mem/slicc/parser.py', 428), ('param -> type ident', 'param', 2, 'p_param', '/users/alian/simulators/pdgem5/src/mem/slicc/parser.py', 432), ('param -> type STAR ident', 'param', 3, 'p_param__pointer', '/users/alian/simulators/pdgem5/src/mem/slicc/parser.py', 436), ('param -> type STAR ident ASSIGN STRING', 'param', 5, 'p_param__pointer_default', '/users/alian/simulators/pdgem5/src/mem/slicc/parser.py', 440), ('param -> type ident ASSIGN NUMBER', 'param', 4, 'p_param__default_number', '/users/alian/simulators/pdgem5/src/mem/slicc/parser.py', 444), ('param -> type ident ASSIGN LIT_BOOL', 'param', 4, 'p_param__default_bool', '/users/alian/simulators/pdgem5/src/mem/slicc/parser.py', 448), ('param -> type ident ASSIGN STRING', 'param', 4, 'p_param__default_string', '/users/alian/simulators/pdgem5/src/mem/slicc/parser.py', 452), ('types -> type , types', 'types', 3, 'p_types__multiple', '/users/alian/simulators/pdgem5/src/mem/slicc/parser.py', 457), ('types -> type', 'types', 1, 'p_types__one', '/users/alian/simulators/pdgem5/src/mem/slicc/parser.py', 461), ('types -> empty', 'types', 1, 'p_types__empty', '/users/alian/simulators/pdgem5/src/mem/slicc/parser.py', 465), ('typestr -> typestr DOUBLE_COLON ident', 'typestr', 3, 'p_typestr__multi', '/users/alian/simulators/pdgem5/src/mem/slicc/parser.py', 469), ('typestr -> ident', 'typestr', 1, 'p_typestr__single', '/users/alian/simulators/pdgem5/src/mem/slicc/parser.py', 473), ('type -> typestr', 'type', 1, 'p_type__one', '/users/alian/simulators/pdgem5/src/mem/slicc/parser.py', 477), ('void -> VOID', 'void', 1, 'p_void', '/users/alian/simulators/pdgem5/src/mem/slicc/parser.py', 481), ('idents -> { identx }', 'idents', 3, 'p_idents__braced', '/users/alian/simulators/pdgem5/src/mem/slicc/parser.py', 486), ('idents -> ident', 'idents', 1, 'p_idents__bare', '/users/alian/simulators/pdgem5/src/mem/slicc/parser.py', 490), ('identx -> ident SEMI identx', 'identx', 3, 'p_identx__multiple_1', '/users/alian/simulators/pdgem5/src/mem/slicc/parser.py', 494), ('identx -> ident , identx', 'identx', 3, 'p_identx__multiple_1', '/users/alian/simulators/pdgem5/src/mem/slicc/parser.py', 495), ('identx -> ident identx', 'identx', 2, 'p_identx__multiple_2', '/users/alian/simulators/pdgem5/src/mem/slicc/parser.py', 499), ('identx -> empty', 'identx', 1, 'p_identx__single', '/users/alian/simulators/pdgem5/src/mem/slicc/parser.py', 503), ('ident -> IDENT', 'ident', 1, 'p_ident', '/users/alian/simulators/pdgem5/src/mem/slicc/parser.py', 507), ('ident_or_star -> ident', 'ident_or_star', 1, 'p_ident_or_star', '/users/alian/simulators/pdgem5/src/mem/slicc/parser.py', 511), ('ident_or_star -> STAR', 'ident_or_star', 1, 'p_ident_or_star', '/users/alian/simulators/pdgem5/src/mem/slicc/parser.py', 512), ('pairs -> , pairsx', 'pairs', 2, 'p_pairs__list', '/users/alian/simulators/pdgem5/src/mem/slicc/parser.py', 517), ('pairs -> empty', 'pairs', 1, 'p_pairs__empty', '/users/alian/simulators/pdgem5/src/mem/slicc/parser.py', 521), ('pairsx -> pair , pairsx', 'pairsx', 3, 'p_pairsx__many', '/users/alian/simulators/pdgem5/src/mem/slicc/parser.py', 525), ('pairsx -> pair', 'pairsx', 1, 'p_pairsx__one', '/users/alian/simulators/pdgem5/src/mem/slicc/parser.py', 530), ('pair -> ident = STRING', 'pair', 3, 'p_pair__assign', '/users/alian/simulators/pdgem5/src/mem/slicc/parser.py', 535), ('pair -> ident = ident', 'pair', 3, 'p_pair__assign', '/users/alian/simulators/pdgem5/src/mem/slicc/parser.py', 536), ('pair -> ident = NUMBER', 'pair', 3, 'p_pair__assign', '/users/alian/simulators/pdgem5/src/mem/slicc/parser.py', 537), ('pair -> STRING', 'pair', 1, 'p_pair__literal', '/users/alian/simulators/pdgem5/src/mem/slicc/parser.py', 541), ('statements -> { statements_inner }', 'statements', 3, 'p_statements__inner', '/users/alian/simulators/pdgem5/src/mem/slicc/parser.py', 546), ('statements -> { }', 'statements', 2, 'p_statements__none', '/users/alian/simulators/pdgem5/src/mem/slicc/parser.py', 550), ('statements_inner -> statement statements_inner', 'statements_inner', 2, 'p_statements_inner__many', '/users/alian/simulators/pdgem5/src/mem/slicc/parser.py', 554), ('statements_inner -> statement', 'statements_inner', 1, 'p_statements_inner__one', '/users/alian/simulators/pdgem5/src/mem/slicc/parser.py', 558), ('exprs -> expr , exprs', 'exprs', 3, 'p_exprs__multiple', '/users/alian/simulators/pdgem5/src/mem/slicc/parser.py', 562), ('exprs -> expr', 'exprs', 1, 'p_exprs__one', '/users/alian/simulators/pdgem5/src/mem/slicc/parser.py', 566), ('exprs -> empty', 'exprs', 1, 'p_exprs__empty', '/users/alian/simulators/pdgem5/src/mem/slicc/parser.py', 570), ('statement -> expr SEMI', 'statement', 2, 'p_statement__expression', '/users/alian/simulators/pdgem5/src/mem/slicc/parser.py', 574), ('statement -> expr ASSIGN expr SEMI', 'statement', 4, 'p_statement__assign', '/users/alian/simulators/pdgem5/src/mem/slicc/parser.py', 578), ('statement -> ENQUEUE ( var , type ) statements', 'statement', 7, 'p_statement__enqueue', '/users/alian/simulators/pdgem5/src/mem/slicc/parser.py', 582), ('statement -> ENQUEUE ( var , type , expr ) statements', 'statement', 9, 'p_statement__enqueue_latency', '/users/alian/simulators/pdgem5/src/mem/slicc/parser.py', 586), ('statement -> STALL_AND_WAIT ( var , var ) SEMI', 'statement', 7, 'p_statement__stall_and_wait', '/users/alian/simulators/pdgem5/src/mem/slicc/parser.py', 590), ('statement -> PEEK ( var , type pairs ) statements', 'statement', 8, 'p_statement__peek', '/users/alian/simulators/pdgem5/src/mem/slicc/parser.py', 594), ('statement -> CHECK_ALLOCATE ( var ) SEMI', 'statement', 5, 'p_statement__check_allocate', '/users/alian/simulators/pdgem5/src/mem/slicc/parser.py', 598), ('statement -> CHECK_NEXT_CYCLE ( ) SEMI', 'statement', 4, 'p_statement__check_next_cycle', '/users/alian/simulators/pdgem5/src/mem/slicc/parser.py', 602), ('statement -> CHECK_STOP_SLOTS ( var , STRING , STRING ) SEMI', 'statement', 9, 'p_statement__check_stop', '/users/alian/simulators/pdgem5/src/mem/slicc/parser.py', 606), ('statement -> RETURN expr SEMI', 'statement', 3, 'p_statement__return', '/users/alian/simulators/pdgem5/src/mem/slicc/parser.py', 610), ('statement -> if_statement', 'statement', 1, 'p_statement__if', '/users/alian/simulators/pdgem5/src/mem/slicc/parser.py', 614), ('if_statement -> IF ( expr ) statements', 'if_statement', 5, 'p_if_statement__if', '/users/alian/simulators/pdgem5/src/mem/slicc/parser.py', 618), ('if_statement -> IF ( expr ) statements ELSE statements', 'if_statement', 7, 'p_if_statement__if_else', '/users/alian/simulators/pdgem5/src/mem/slicc/parser.py', 622), ('if_statement -> IF ( expr ) statements ELSE if_statement', 'if_statement', 7, 'p_statement__if_else_if', '/users/alian/simulators/pdgem5/src/mem/slicc/parser.py', 626), ('aexpr -> STATIC_CAST ( type , expr )', 'aexpr', 6, 'p_expr__static_cast', '/users/alian/simulators/pdgem5/src/mem/slicc/parser.py', 631), ('aexpr -> STATIC_CAST ( type , STRING , expr )', 'aexpr', 8, 'p_expr__static_cast_ptr', '/users/alian/simulators/pdgem5/src/mem/slicc/parser.py', 635), ('aexpr -> var', 'aexpr', 1, 'p_expr__var', '/users/alian/simulators/pdgem5/src/mem/slicc/parser.py', 639), ('aexpr -> type ident', 'aexpr', 2, 'p_expr__localvar', '/users/alian/simulators/pdgem5/src/mem/slicc/parser.py', 643), ('aexpr -> literal', 'aexpr', 1, 'p_expr__literal', '/users/alian/simulators/pdgem5/src/mem/slicc/parser.py', 647), ('aexpr -> enumeration', 'aexpr', 1, 'p_expr__enumeration', '/users/alian/simulators/pdgem5/src/mem/slicc/parser.py', 651), ('aexpr -> ident ( exprs )', 'aexpr', 4, 'p_expr__func_call', '/users/alian/simulators/pdgem5/src/mem/slicc/parser.py', 655), ('aexpr -> NEW type', 'aexpr', 2, 'p_expr__new', '/users/alian/simulators/pdgem5/src/mem/slicc/parser.py', 659), ('aexpr -> OOD', 'aexpr', 1, 'p_expr__null', '/users/alian/simulators/pdgem5/src/mem/slicc/parser.py', 663), ('aexpr -> aexpr DOT ident', 'aexpr', 3, 'p_expr__member', '/users/alian/simulators/pdgem5/src/mem/slicc/parser.py', 667), ('aexpr -> aexpr DOT ident ( exprs )', 'aexpr', 6, 'p_expr__member_method_call', '/users/alian/simulators/pdgem5/src/mem/slicc/parser.py', 671), ('aexpr -> aexpr [ exprs ]', 'aexpr', 4, 'p_expr__member_method_call_lookup', '/users/alian/simulators/pdgem5/src/mem/slicc/parser.py', 675), ('aexpr -> type DOUBLE_COLON ident ( exprs )', 'aexpr', 6, 'p_expr__class_method_call', '/users/alian/simulators/pdgem5/src/mem/slicc/parser.py', 679), ('expr -> aexpr', 'expr', 1, 'p_expr__aexpr', '/users/alian/simulators/pdgem5/src/mem/slicc/parser.py', 683), ('expr -> expr STAR expr', 'expr', 3, 'p_expr__binary_op', '/users/alian/simulators/pdgem5/src/mem/slicc/parser.py', 687), ('expr -> expr SLASH expr', 'expr', 3, 'p_expr__binary_op', '/users/alian/simulators/pdgem5/src/mem/slicc/parser.py', 688), ('expr -> expr PLUS expr', 'expr', 3, 'p_expr__binary_op', '/users/alian/simulators/pdgem5/src/mem/slicc/parser.py', 689), ('expr -> expr DASH expr', 'expr', 3, 'p_expr__binary_op', '/users/alian/simulators/pdgem5/src/mem/slicc/parser.py', 690), ('expr -> expr LT expr', 'expr', 3, 'p_expr__binary_op', '/users/alian/simulators/pdgem5/src/mem/slicc/parser.py', 691), ('expr -> expr GT expr', 'expr', 3, 'p_expr__binary_op', '/users/alian/simulators/pdgem5/src/mem/slicc/parser.py', 692), ('expr -> expr LE expr', 'expr', 3, 'p_expr__binary_op', '/users/alian/simulators/pdgem5/src/mem/slicc/parser.py', 693), ('expr -> expr GE expr', 'expr', 3, 'p_expr__binary_op', '/users/alian/simulators/pdgem5/src/mem/slicc/parser.py', 694), ('expr -> expr EQ expr', 'expr', 3, 'p_expr__binary_op', '/users/alian/simulators/pdgem5/src/mem/slicc/parser.py', 695), ('expr -> expr NE expr', 'expr', 3, 'p_expr__binary_op', '/users/alian/simulators/pdgem5/src/mem/slicc/parser.py', 696), ('expr -> expr AND expr', 'expr', 3, 'p_expr__binary_op', '/users/alian/simulators/pdgem5/src/mem/slicc/parser.py', 697), ('expr -> expr OR expr', 'expr', 3, 'p_expr__binary_op', '/users/alian/simulators/pdgem5/src/mem/slicc/parser.py', 698), ('expr -> expr RIGHTSHIFT expr', 'expr', 3, 'p_expr__binary_op', '/users/alian/simulators/pdgem5/src/mem/slicc/parser.py', 699), ('expr -> expr LEFTSHIFT expr', 'expr', 3, 'p_expr__binary_op', '/users/alian/simulators/pdgem5/src/mem/slicc/parser.py', 700), ('expr -> NOT expr', 'expr', 2, 'p_expr__unary_op', '/users/alian/simulators/pdgem5/src/mem/slicc/parser.py', 705), ('expr -> INCR expr', 'expr', 2, 'p_expr__unary_op', '/users/alian/simulators/pdgem5/src/mem/slicc/parser.py', 706), ('expr -> DECR expr', 'expr', 2, 'p_expr__unary_op', '/users/alian/simulators/pdgem5/src/mem/slicc/parser.py', 707), ('expr -> DASH expr', 'expr', 2, 'p_expr__unary_op', '/users/alian/simulators/pdgem5/src/mem/slicc/parser.py', 708), ('aexpr -> ( expr )', 'aexpr', 3, 'p_expr__parens', '/users/alian/simulators/pdgem5/src/mem/slicc/parser.py', 712), ('aexpr -> IS_VALID ( var )', 'aexpr', 4, 'p_expr__is_valid_ptr', '/users/alian/simulators/pdgem5/src/mem/slicc/parser.py', 716), ('aexpr -> IS_INVALID ( var )', 'aexpr', 4, 'p_expr__is_invalid_ptr', '/users/alian/simulators/pdgem5/src/mem/slicc/parser.py', 720), ('literal -> STRING', 'literal', 1, 'p_literal__string', '/users/alian/simulators/pdgem5/src/mem/slicc/parser.py', 724), ('literal -> NUMBER', 'literal', 1, 'p_literal__number', '/users/alian/simulators/pdgem5/src/mem/slicc/parser.py', 728), ('literal -> FLOATNUMBER', 'literal', 1, 'p_literal__float', '/users/alian/simulators/pdgem5/src/mem/slicc/parser.py', 732), ('literal -> LIT_BOOL', 'literal', 1, 'p_literal__bool', '/users/alian/simulators/pdgem5/src/mem/slicc/parser.py', 736), ('enumeration -> ident : ident', 'enumeration', 3, 'p_enumeration', '/users/alian/simulators/pdgem5/src/mem/slicc/parser.py', 740), ('var -> ident', 'var', 1, 'p_var', '/users/alian/simulators/pdgem5/src/mem/slicc/parser.py', 744)]
def hoopCount(n): if n > 9: return "Great, now move on to tricks" else: return "Keep at it until you get it"
def hoop_count(n): if n > 9: return 'Great, now move on to tricks' else: return 'Keep at it until you get it'
# # PySNMP MIB module Dell-LAN-TRAP-MIB (http://snmplabs.com/pysmi) # ASN.1 source file:///Users/davwang4/Dev/mibs.snmplabs.com/asn1/Dell-LAN-TRAP-MIB # Produced by pysmi-0.3.4 at Wed May 1 12:56:05 2019 # On host DAVWANG4-M-1475 platform Darwin version 18.5.0 by user davwang4 # Using Python version 3.7.3 (default, Mar 27 2019, 09:23:15) # ObjectIdentifier, Integer, OctetString = mibBuilder.importSymbols("ASN1", "ObjectIdentifier", "Integer", "OctetString") NamedValues, = mibBuilder.importSymbols("ASN1-ENUMERATION", "NamedValues") ConstraintsIntersection, ConstraintsUnion, SingleValueConstraint, ValueRangeConstraint, ValueSizeConstraint = mibBuilder.importSymbols("ASN1-REFINEMENT", "ConstraintsIntersection", "ConstraintsUnion", "SingleValueConstraint", "ValueRangeConstraint", "ValueSizeConstraint") dellLan, dellLanCommon = mibBuilder.importSymbols("Dell-Vendor-MIB", "dellLan", "dellLanCommon") ModuleCompliance, NotificationGroup = mibBuilder.importSymbols("SNMPv2-CONF", "ModuleCompliance", "NotificationGroup") ObjectIdentity, Gauge32, Unsigned32, IpAddress, MibScalar, MibTable, MibTableRow, MibTableColumn, TimeTicks, MibIdentifier, Bits, Counter32, Counter64, NotificationType, Integer32, iso, ModuleIdentity = mibBuilder.importSymbols("SNMPv2-SMI", "ObjectIdentity", "Gauge32", "Unsigned32", "IpAddress", "MibScalar", "MibTable", "MibTableRow", "MibTableColumn", "TimeTicks", "MibIdentifier", "Bits", "Counter32", "Counter64", "NotificationType", "Integer32", "iso", "ModuleIdentity") DisplayString, DateAndTime, TextualConvention = mibBuilder.importSymbols("SNMPv2-TC", "DisplayString", "DateAndTime", "TextualConvention") dellAlarmGroup = ModuleIdentity((1, 3, 6, 1, 4, 1, 674, 10895, 5000, 1, 1)) if mibBuilder.loadTexts: dellAlarmGroup.setLastUpdated('200504260000Z') if mibBuilder.loadTexts: dellAlarmGroup.setOrganization('Dell.') if mibBuilder.loadTexts: dellAlarmGroup.setContactInfo(' ') if mibBuilder.loadTexts: dellAlarmGroup.setDescription(' ') dellTrapInfo = MibScalar((1, 3, 6, 1, 4, 1, 674, 10895, 5000, 1, 1, 1), DisplayString()).setMaxAccess("readonly") if mibBuilder.loadTexts: dellTrapInfo.setStatus('current') if mibBuilder.loadTexts: dellTrapInfo.setDescription('This text string may be used to provide additional information regarding the trap being sent. Any specific formatting information is given in the trap definition.') dellTrapSeverity = MibScalar((1, 3, 6, 1, 4, 1, 674, 10895, 5000, 1, 1, 2), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(0, 1, 2, 3, 4))).clone(namedValues=NamedValues(("clear", 0), ("info", 1), ("minor", 2), ("major", 3), ("critical", 4)))).setMaxAccess("readonly") if mibBuilder.loadTexts: dellTrapSeverity.setStatus('current') if mibBuilder.loadTexts: dellTrapSeverity.setDescription('The severity type of the enterprise-specific trap sent to the Network Management Station by the Dell managed device. The Severity level are defined as follows: Critical - service affecting event. Major - a major error which is not service affecting but does require immediate user attention to prevent further degredation of the system, which may lead to a critical error. For example, if a redundant port failure would be considered a major event whereas the failure of an unprotected port is a critical event. Minor - a minor event which is not service affecting and is unlikely to lead to a major or critical event. The user does not need to take immediate actions but some action is required to clear the event. Info - a notification to the user of some event that does not require any user action. For example, a security notification is useful information but does not require the user to take any specific immediate action. This event is not cleared. Clear - this special trap is sent to clear some previously sent trap. Note that if the sequence number sent with the clear event is 0 then the clear event is used to indicate that all outstanding event of this particular type on a given source (dellTrapSource) has been cleared. If the event sequence number (dellTrapSeqNum) is sent with a non-zero value, then the clear event is sent to clear only the specific trap instance designated by the sequence number in question.') dellTrapSource = MibScalar((1, 3, 6, 1, 4, 1, 674, 10895, 5000, 1, 1, 3), DisplayString()).setMaxAccess("readonly") if mibBuilder.loadTexts: dellTrapSource.setStatus('current') if mibBuilder.loadTexts: dellTrapSource.setDescription("The trap source is a string identifying the component of the device generating the trap. The source identifies the component associated with the fault. This may for example, identify the unit, slot, port, and possibly logical ports (VLAN, LAG) from which the fault occurs. The format of the source string is: 'TYPE=#:TYPE=#:...' where the TYPE may be one of 'unit' or 'slot' or 'port' or 'VLAN' or 'LAG'. For example: 'unit=3:slot=1:port=2' - indicates the trap comes from port 2 in slot 1 of the switch #3 in the stack. 'unit=2:VLAN=10' - indicates the trap comes from VLAN=10 in unit 2. 'unit=1' - indicates the trap comes from unit 1.") dellTrapSeqNum = MibScalar((1, 3, 6, 1, 4, 1, 674, 10895, 5000, 1, 1, 4), Unsigned32()).setMaxAccess("readonly") if mibBuilder.loadTexts: dellTrapSeqNum.setStatus('current') if mibBuilder.loadTexts: dellTrapSeqNum.setDescription('Since SNMP traps are transported using UDP, there is a possibility for the trap to be lost in transit. To allow the NMS the ability to detect this possibility, all traps will include a trap sequence number as part of its variable binding list. The trap sequence number may be reset each time the system reboots and will increment for each trap sent from the device. When a missing trap sequence number is detected the NMS may be able to refresh its state of the switch to determine what event it may have missed.') dellTrapTimeStamp = MibScalar((1, 3, 6, 1, 4, 1, 674, 10895, 5000, 1, 1, 5), DateAndTime()).setMaxAccess("readonly") if mibBuilder.loadTexts: dellTrapTimeStamp.setStatus('current') if mibBuilder.loadTexts: dellTrapTimeStamp.setDescription('The trap header includes the system up time which mark when the trap was generated, but often it is important to know the absolute time when the trap was generated. This time stamp is based on GMT (universal time) time zone. This will allow the timestamps to be correlated consistently across a large network.') hwResourceOverflow = NotificationType((1, 3, 6, 1, 4, 1, 674, 10895, 500)).setObjects(("Dell-LAN-TRAP-MIB", "dellTrapTimeStamp"), ("Dell-LAN-TRAP-MIB", "dellTrapSeqNum"), ("Dell-LAN-TRAP-MIB", "dellTrapSource"), ("Dell-LAN-TRAP-MIB", "dellTrapSeverity"), ("Dell-LAN-TRAP-MIB", "dellTrapInfo")) if mibBuilder.loadTexts: hwResourceOverflow.setStatus('current') if mibBuilder.loadTexts: hwResourceOverflow.setDescription('Indicates that a switch hardware resource overflowed. The dellTrapSource should indicate the unit number whereas dellTrapInfo should identify the resource that overflowed.') swResourceOverflow = NotificationType((1, 3, 6, 1, 4, 1, 674, 10895, 510)).setObjects(("Dell-LAN-TRAP-MIB", "dellTrapTimeStamp"), ("Dell-LAN-TRAP-MIB", "dellTrapSeqNum"), ("Dell-LAN-TRAP-MIB", "dellTrapSource"), ("Dell-LAN-TRAP-MIB", "dellTrapSeverity"), ("Dell-LAN-TRAP-MIB", "dellTrapInfo")) if mibBuilder.loadTexts: swResourceOverflow.setStatus('current') if mibBuilder.loadTexts: swResourceOverflow.setDescription('Indicates that a switch software resource overflowed. The dellTrapSource should indicate the unit number whereas dellTrapInfo should identify the resource that overflowed (e.g. maximum VLAN/LAG/MACs/IPs exceeded).') configChanged = NotificationType((1, 3, 6, 1, 4, 1, 674, 10895, 520)).setObjects(("Dell-LAN-TRAP-MIB", "dellTrapTimeStamp"), ("Dell-LAN-TRAP-MIB", "dellTrapSeqNum"), ("Dell-LAN-TRAP-MIB", "dellTrapSource"), ("Dell-LAN-TRAP-MIB", "dellTrapSeverity"), ("Dell-LAN-TRAP-MIB", "dellTrapInfo")) if mibBuilder.loadTexts: configChanged.setStatus('current') if mibBuilder.loadTexts: configChanged.setDescription('Indicates that the switch configuration has changed. The dellTrapSource should indicate the source of the change such as the unit, slot, port, VLAN, LAG, etc. The dellTrapInfo may indicate additional information regarding the change.') resetRequired = NotificationType((1, 3, 6, 1, 4, 1, 674, 10895, 530)).setObjects(("Dell-LAN-TRAP-MIB", "dellTrapTimeStamp"), ("Dell-LAN-TRAP-MIB", "dellTrapSeqNum"), ("Dell-LAN-TRAP-MIB", "dellTrapSource"), ("Dell-LAN-TRAP-MIB", "dellTrapSeverity"), ("Dell-LAN-TRAP-MIB", "dellTrapInfo")) if mibBuilder.loadTexts: resetRequired.setStatus('current') if mibBuilder.loadTexts: resetRequired.setDescription('This trap indicates that in order to perform the last SET request, a reset operation of the router/bridge is required. This may occur for any number of reasons such as if the change affects the routing protocols to be switched from SPF to STP. This trap warns the user to manually reset the switch using either physical or software reset.') endTftp = NotificationType((1, 3, 6, 1, 4, 1, 674, 10895, 540)).setObjects(("Dell-LAN-TRAP-MIB", "dellTrapTimeStamp"), ("Dell-LAN-TRAP-MIB", "dellTrapSeqNum"), ("Dell-LAN-TRAP-MIB", "dellTrapSource"), ("Dell-LAN-TRAP-MIB", "dellTrapSeverity"), ("Dell-LAN-TRAP-MIB", "dellTrapInfo")) if mibBuilder.loadTexts: endTftp.setStatus('current') if mibBuilder.loadTexts: endTftp.setDescription('This trap indicates that the device finished a TFTP transaction with the management station. The dellTrapInfo field will provide TFTP exit code and name/type of the file being transferred.') abortTftp = NotificationType((1, 3, 6, 1, 4, 1, 674, 10895, 550)).setObjects(("Dell-LAN-TRAP-MIB", "dellTrapTimeStamp"), ("Dell-LAN-TRAP-MIB", "dellTrapSeqNum"), ("Dell-LAN-TRAP-MIB", "dellTrapSource"), ("Dell-LAN-TRAP-MIB", "dellTrapSeverity"), ("Dell-LAN-TRAP-MIB", "dellTrapInfo")) if mibBuilder.loadTexts: abortTftp.setStatus('current') if mibBuilder.loadTexts: abortTftp.setDescription('This trap indicates that in the device aborted a TFTP session with the management station. The dellTrapInfo field will provide TFTP exit code and name/type of the file being transferred.') startTftp = NotificationType((1, 3, 6, 1, 4, 1, 674, 10895, 560)).setObjects(("Dell-LAN-TRAP-MIB", "dellTrapTimeStamp"), ("Dell-LAN-TRAP-MIB", "dellTrapSeqNum"), ("Dell-LAN-TRAP-MIB", "dellTrapSource"), ("Dell-LAN-TRAP-MIB", "dellTrapSeverity"), ("Dell-LAN-TRAP-MIB", "dellTrapInfo")) if mibBuilder.loadTexts: startTftp.setStatus('current') if mibBuilder.loadTexts: startTftp.setDescription('Informational trap indicating that the device has intiated a TFTP session. dellTrapInfo will contain the name/type of the file being transferred.') linkFailure = NotificationType((1, 3, 6, 1, 4, 1, 674, 10895, 570)).setObjects(("Dell-LAN-TRAP-MIB", "dellTrapTimeStamp"), ("Dell-LAN-TRAP-MIB", "dellTrapSeqNum"), ("Dell-LAN-TRAP-MIB", "dellTrapSource"), ("Dell-LAN-TRAP-MIB", "dellTrapSeverity"), ("Dell-LAN-TRAP-MIB", "dellTrapInfo")) if mibBuilder.loadTexts: linkFailure.setStatus('current') if mibBuilder.loadTexts: linkFailure.setDescription('Link failure detected, no backup available. The dellTrapSource should indicate the fail link.') linkFailureSwitchBackUp = NotificationType((1, 3, 6, 1, 4, 1, 674, 10895, 580)).setObjects(("Dell-LAN-TRAP-MIB", "dellTrapTimeStamp"), ("Dell-LAN-TRAP-MIB", "dellTrapSeqNum"), ("Dell-LAN-TRAP-MIB", "dellTrapSource"), ("Dell-LAN-TRAP-MIB", "dellTrapSeverity"), ("Dell-LAN-TRAP-MIB", "dellTrapInfo")) if mibBuilder.loadTexts: linkFailureSwitchBackUp.setStatus('current') if mibBuilder.loadTexts: linkFailureSwitchBackUp.setDescription('Automantic switchover to backup link because of main link fault. The dellTrapSource indicates the backup link coming on, and the dellTrapInfo indicates the failed link.') mainLinkUp = NotificationType((1, 3, 6, 1, 4, 1, 674, 10895, 590)).setObjects(("Dell-LAN-TRAP-MIB", "dellTrapTimeStamp"), ("Dell-LAN-TRAP-MIB", "dellTrapSeqNum"), ("Dell-LAN-TRAP-MIB", "dellTrapSource"), ("Dell-LAN-TRAP-MIB", "dellTrapSeverity"), ("Dell-LAN-TRAP-MIB", "dellTrapInfo")) if mibBuilder.loadTexts: mainLinkUp.setStatus('current') if mibBuilder.loadTexts: mainLinkUp.setDescription('Communication returned to main link. The dellTrapSource indicates the main link coming up, and the dellTrapInfo indicates the backup link.') errorsDuringInit = NotificationType((1, 3, 6, 1, 4, 1, 674, 10895, 600)).setObjects(("Dell-LAN-TRAP-MIB", "dellTrapTimeStamp"), ("Dell-LAN-TRAP-MIB", "dellTrapSeqNum"), ("Dell-LAN-TRAP-MIB", "dellTrapSource"), ("Dell-LAN-TRAP-MIB", "dellTrapSeverity"), ("Dell-LAN-TRAP-MIB", "dellTrapInfo")) if mibBuilder.loadTexts: errorsDuringInit.setStatus('current') if mibBuilder.loadTexts: errorsDuringInit.setDescription('This trap indicates that the an error occured during initialization phase of the switch. Additional information is provided in the dellTrapInfo field.') vlanDynPortAdded = NotificationType((1, 3, 6, 1, 4, 1, 674, 10895, 610)).setObjects(("Dell-LAN-TRAP-MIB", "dellTrapTimeStamp"), ("Dell-LAN-TRAP-MIB", "dellTrapSeqNum"), ("Dell-LAN-TRAP-MIB", "dellTrapSource"), ("Dell-LAN-TRAP-MIB", "dellTrapSeverity"), ("Dell-LAN-TRAP-MIB", "dellTrapInfo")) if mibBuilder.loadTexts: vlanDynPortAdded.setStatus('current') if mibBuilder.loadTexts: vlanDynPortAdded.setDescription('Indicates that a port was dynamically added to the VLAN. The dellTrapSource will indicate the VLAN, and the dellTrapInfo will indicate the port being added.') vlanDynPortRemoved = NotificationType((1, 3, 6, 1, 4, 1, 674, 10895, 620)).setObjects(("Dell-LAN-TRAP-MIB", "dellTrapTimeStamp"), ("Dell-LAN-TRAP-MIB", "dellTrapSeqNum"), ("Dell-LAN-TRAP-MIB", "dellTrapSource"), ("Dell-LAN-TRAP-MIB", "dellTrapSeverity"), ("Dell-LAN-TRAP-MIB", "dellTrapInfo")) if mibBuilder.loadTexts: vlanDynPortRemoved.setStatus('current') if mibBuilder.loadTexts: vlanDynPortRemoved.setDescription('Indicates that a port was dynamically removed from a VLAN. The dellTrapSource will indicate the VLAN, and the dellTrapInfo will indicate the port being removed.') ipZhrReqStaticConnNotAccepted = NotificationType((1, 3, 6, 1, 4, 1, 674, 10895, 630)).setObjects(("Dell-LAN-TRAP-MIB", "dellTrapTimeStamp"), ("Dell-LAN-TRAP-MIB", "dellTrapSeqNum"), ("Dell-LAN-TRAP-MIB", "dellTrapSource"), ("Dell-LAN-TRAP-MIB", "dellTrapSeverity"), ("Dell-LAN-TRAP-MIB", "dellTrapInfo")) if mibBuilder.loadTexts: ipZhrReqStaticConnNotAccepted.setStatus('current') if mibBuilder.loadTexts: ipZhrReqStaticConnNotAccepted.setDescription('The requested static connection was not accepted because there is no available IP virtual address to allocate to it.') ipZhrVirtualIpAsSource = NotificationType((1, 3, 6, 1, 4, 1, 674, 10895, 640)).setObjects(("Dell-LAN-TRAP-MIB", "dellTrapTimeStamp"), ("Dell-LAN-TRAP-MIB", "dellTrapSeqNum"), ("Dell-LAN-TRAP-MIB", "dellTrapSource"), ("Dell-LAN-TRAP-MIB", "dellTrapSeverity"), ("Dell-LAN-TRAP-MIB", "dellTrapInfo")) if mibBuilder.loadTexts: ipZhrVirtualIpAsSource.setStatus('current') if mibBuilder.loadTexts: ipZhrVirtualIpAsSource.setDescription('The virtual IP address appeared as a source IP. All the connections using it will be deleted and it will not be further allocated to new connections.') ipZhrNotAllocVirtualIp = NotificationType((1, 3, 6, 1, 4, 1, 674, 10895, 650)).setObjects(("Dell-LAN-TRAP-MIB", "dellTrapTimeStamp"), ("Dell-LAN-TRAP-MIB", "dellTrapSeqNum"), ("Dell-LAN-TRAP-MIB", "dellTrapSource"), ("Dell-LAN-TRAP-MIB", "dellTrapSeverity"), ("Dell-LAN-TRAP-MIB", "dellTrapInfo")) if mibBuilder.loadTexts: ipZhrNotAllocVirtualIp.setStatus('current') if mibBuilder.loadTexts: ipZhrNotAllocVirtualIp.setDescription('The source IP address sent an ARP specifying a virtual IP which was not allocated for this source. This virtual IP will not be allocated to connections of this specific source IP.') stackMasterFailed = NotificationType((1, 3, 6, 1, 4, 1, 674, 10895, 660)).setObjects(("Dell-LAN-TRAP-MIB", "dellTrapTimeStamp"), ("Dell-LAN-TRAP-MIB", "dellTrapSeqNum"), ("Dell-LAN-TRAP-MIB", "dellTrapSource"), ("Dell-LAN-TRAP-MIB", "dellTrapSeverity"), ("Dell-LAN-TRAP-MIB", "dellTrapInfo")) if mibBuilder.loadTexts: stackMasterFailed.setStatus('current') if mibBuilder.loadTexts: stackMasterFailed.setDescription('Indicates that the stack master unit has failed. This trap is generated by the new master when it takes over the stack. The dellTrapSource should be the new master unit #, and the dellTrapInfo should identify the old master unit #.') stackNewMasterElected = NotificationType((1, 3, 6, 1, 4, 1, 674, 10895, 670)).setObjects(("Dell-LAN-TRAP-MIB", "dellTrapTimeStamp"), ("Dell-LAN-TRAP-MIB", "dellTrapSeqNum"), ("Dell-LAN-TRAP-MIB", "dellTrapSource"), ("Dell-LAN-TRAP-MIB", "dellTrapSeverity"), ("Dell-LAN-TRAP-MIB", "dellTrapInfo")) if mibBuilder.loadTexts: stackNewMasterElected.setStatus('current') if mibBuilder.loadTexts: stackNewMasterElected.setDescription('Indicates when a new master has been elected. This is different from a stack failure in that the master has not failed but for some reason a new master has been elected (e.g. the user requested a new master. The trap should be generated by the new master. the dellTrapSource should identify the new master, and the dellTrapInfo should identify the old master.') stackMemberUnitFailed = NotificationType((1, 3, 6, 1, 4, 1, 674, 10895, 680)).setObjects(("Dell-LAN-TRAP-MIB", "dellTrapTimeStamp"), ("Dell-LAN-TRAP-MIB", "dellTrapSeqNum"), ("Dell-LAN-TRAP-MIB", "dellTrapSource"), ("Dell-LAN-TRAP-MIB", "dellTrapSeverity"), ("Dell-LAN-TRAP-MIB", "dellTrapInfo")) if mibBuilder.loadTexts: stackMemberUnitFailed.setStatus('current') if mibBuilder.loadTexts: stackMemberUnitFailed.setDescription('Indicates that a member of the stack has failed. This condition is detected by the master unit so the dellTrapSource should indicate the master unit ID and the dellTrapInfo should indicate the member unit that failed.') stackNewMemberUnitAdded = NotificationType((1, 3, 6, 1, 4, 1, 674, 10895, 690)).setObjects(("Dell-LAN-TRAP-MIB", "dellTrapTimeStamp"), ("Dell-LAN-TRAP-MIB", "dellTrapSeqNum"), ("Dell-LAN-TRAP-MIB", "dellTrapSource"), ("Dell-LAN-TRAP-MIB", "dellTrapSeverity"), ("Dell-LAN-TRAP-MIB", "dellTrapInfo")) if mibBuilder.loadTexts: stackNewMemberUnitAdded.setStatus('current') if mibBuilder.loadTexts: stackNewMemberUnitAdded.setDescription('Indicates that a new member unit has been added to the stack. This trap is generated by the master unit so the dellTrapSource should indicate the master unit ID, and the dellTrapInfo should identify the new unit ID.') stackMemberUnitRemoved = NotificationType((1, 3, 6, 1, 4, 1, 674, 10895, 700)).setObjects(("Dell-LAN-TRAP-MIB", "dellTrapTimeStamp"), ("Dell-LAN-TRAP-MIB", "dellTrapSeqNum"), ("Dell-LAN-TRAP-MIB", "dellTrapSource"), ("Dell-LAN-TRAP-MIB", "dellTrapSeverity"), ("Dell-LAN-TRAP-MIB", "dellTrapInfo")) if mibBuilder.loadTexts: stackMemberUnitRemoved.setStatus('current') if mibBuilder.loadTexts: stackMemberUnitRemoved.setDescription('Indicates that a member unit has been removed from the stack. The dellTrapSource indicates the master unit ID and the dellTrapInfo indicates the unit ID being removed.') stackSplitMasterReport = NotificationType((1, 3, 6, 1, 4, 1, 674, 10895, 710)).setObjects(("Dell-LAN-TRAP-MIB", "dellTrapTimeStamp"), ("Dell-LAN-TRAP-MIB", "dellTrapSeqNum"), ("Dell-LAN-TRAP-MIB", "dellTrapSource"), ("Dell-LAN-TRAP-MIB", "dellTrapSeverity"), ("Dell-LAN-TRAP-MIB", "dellTrapInfo")) if mibBuilder.loadTexts: stackSplitMasterReport.setStatus('current') if mibBuilder.loadTexts: stackSplitMasterReport.setDescription('Indicates that the stack has split into two distinct stacks which means that each stack may end up with its own master temporarily until the stack is rejoined. This is possibly different from the stackMemberUnitFailed trap, which indicates only a single unit failure. This trap indicates that the master has lost track of part of the stack membership so that the other units may elect their own master. The dellTrapSource should indicate the master unit ID and the dellTrapInfo should identify the units that are split from the main stack.') stackSplitNewMasterReport = NotificationType((1, 3, 6, 1, 4, 1, 674, 10895, 720)).setObjects(("Dell-LAN-TRAP-MIB", "dellTrapTimeStamp"), ("Dell-LAN-TRAP-MIB", "dellTrapSeqNum"), ("Dell-LAN-TRAP-MIB", "dellTrapSource"), ("Dell-LAN-TRAP-MIB", "dellTrapSeverity"), ("Dell-LAN-TRAP-MIB", "dellTrapInfo")) if mibBuilder.loadTexts: stackSplitNewMasterReport.setStatus('current') if mibBuilder.loadTexts: stackSplitNewMasterReport.setDescription('Indicates that the stack has split into two distinct stacks which means that each stack may end up with its own master temporarily until the stack is rejoined. This trap is generated by the new master unit elected in the split sub-stack. The dellTrapSource should identify the new master unit ID, and the dellTrapInfo should identify the old master unit ID before the split occured.') stackRejoined = NotificationType((1, 3, 6, 1, 4, 1, 674, 10895, 730)).setObjects(("Dell-LAN-TRAP-MIB", "dellTrapTimeStamp"), ("Dell-LAN-TRAP-MIB", "dellTrapSeqNum"), ("Dell-LAN-TRAP-MIB", "dellTrapSource"), ("Dell-LAN-TRAP-MIB", "dellTrapSeverity"), ("Dell-LAN-TRAP-MIB", "dellTrapInfo")) if mibBuilder.loadTexts: stackRejoined.setStatus('current') if mibBuilder.loadTexts: stackRejoined.setDescription('Indicates that previously split stack has rejoined. The rejoined stack will elect a master and this trap should be generated by the elected master. The dellTrapSource should indicate the master unit ID and the dellTrapInfo should list the unit IDs of the members.') stackLinkFailed = NotificationType((1, 3, 6, 1, 4, 1, 674, 10895, 740)).setObjects(("Dell-LAN-TRAP-MIB", "dellTrapTimeStamp"), ("Dell-LAN-TRAP-MIB", "dellTrapSeqNum"), ("Dell-LAN-TRAP-MIB", "dellTrapSource"), ("Dell-LAN-TRAP-MIB", "dellTrapSeverity"), ("Dell-LAN-TRAP-MIB", "dellTrapInfo")) if mibBuilder.loadTexts: stackLinkFailed.setStatus('current') if mibBuilder.loadTexts: stackLinkFailed.setDescription('Indicates a failure in one of the stacking link. If this stack was connected in a ring, then the failure of a stacking link results in a chain stack instead of a ring. Another failure in the chain topology would result in a split stack. If the stack is connected in a meshed or star topology then multiple link failure may be tolerated. This trap may be generated by any unit within the stack and must indicate the source of the failure. The dellTrapSource should identify one end of the link where the failure is detected. The dellTrapInfo may provide additional information about the failure.') dhcpAllocationFailure = NotificationType((1, 3, 6, 1, 4, 1, 674, 10895, 750)).setObjects(("Dell-LAN-TRAP-MIB", "dellTrapTimeStamp"), ("Dell-LAN-TRAP-MIB", "dellTrapSeqNum"), ("Dell-LAN-TRAP-MIB", "dellTrapSource"), ("Dell-LAN-TRAP-MIB", "dellTrapSeverity"), ("Dell-LAN-TRAP-MIB", "dellTrapInfo")) if mibBuilder.loadTexts: dhcpAllocationFailure.setStatus('current') if mibBuilder.loadTexts: dhcpAllocationFailure.setDescription('DHCP failed to allocate an IP address to a requesting host because of memory shortage or inadequate configuration of available IP addresses.') dot1dStpPortStateForwarding = NotificationType((1, 3, 6, 1, 4, 1, 674, 10895, 760)).setObjects(("Dell-LAN-TRAP-MIB", "dellTrapTimeStamp"), ("Dell-LAN-TRAP-MIB", "dellTrapSeqNum"), ("Dell-LAN-TRAP-MIB", "dellTrapSource"), ("Dell-LAN-TRAP-MIB", "dellTrapSeverity"), ("Dell-LAN-TRAP-MIB", "dellTrapInfo")) if mibBuilder.loadTexts: dot1dStpPortStateForwarding.setStatus('current') if mibBuilder.loadTexts: dot1dStpPortStateForwarding.setDescription('The trap is sent by a bridge when any of its configured ports transitions from the Learning state to the Forwarding state.') dot1dStpPortStateNotForwarding = NotificationType((1, 3, 6, 1, 4, 1, 674, 10895, 770)).setObjects(("Dell-LAN-TRAP-MIB", "dellTrapTimeStamp"), ("Dell-LAN-TRAP-MIB", "dellTrapSeqNum"), ("Dell-LAN-TRAP-MIB", "dellTrapSource"), ("Dell-LAN-TRAP-MIB", "dellTrapSeverity"), ("Dell-LAN-TRAP-MIB", "dellTrapInfo")) if mibBuilder.loadTexts: dot1dStpPortStateNotForwarding.setStatus('current') if mibBuilder.loadTexts: dot1dStpPortStateNotForwarding.setDescription('The trap is sent by a bridge when any of its configured ports transitions from the Forwarding state to the Blocking state.') policyDropPacketTrap = NotificationType((1, 3, 6, 1, 4, 1, 674, 10895, 780)).setObjects(("Dell-LAN-TRAP-MIB", "dellTrapTimeStamp"), ("Dell-LAN-TRAP-MIB", "dellTrapSeqNum"), ("Dell-LAN-TRAP-MIB", "dellTrapSource"), ("Dell-LAN-TRAP-MIB", "dellTrapSeverity"), ("Dell-LAN-TRAP-MIB", "dellTrapInfo")) if mibBuilder.loadTexts: policyDropPacketTrap.setStatus('current') if mibBuilder.loadTexts: policyDropPacketTrap.setDescription('Indicates that the packet drop due to the policy. This trap may result in a huge number of trap packets and should be used only for debugging purposes. The number of traps sent per time period is user configurable and the user may enable/disable generation of this trap.') policyForwardPacketTrap = NotificationType((1, 3, 6, 1, 4, 1, 674, 10895, 790)).setObjects(("Dell-LAN-TRAP-MIB", "dellTrapTimeStamp"), ("Dell-LAN-TRAP-MIB", "dellTrapSeqNum"), ("Dell-LAN-TRAP-MIB", "dellTrapSource"), ("Dell-LAN-TRAP-MIB", "dellTrapSeverity"), ("Dell-LAN-TRAP-MIB", "dellTrapInfo")) if mibBuilder.loadTexts: policyForwardPacketTrap.setStatus('current') if mibBuilder.loadTexts: policyForwardPacketTrap.setDescription('Indicates that the packet has forward based on policy. The number of traps sent per time period is user configurable and the user may enable/disable generation of this trap.') igmpV1MsgReceived = NotificationType((1, 3, 6, 1, 4, 1, 674, 10895, 800)).setObjects(("Dell-LAN-TRAP-MIB", "dellTrapTimeStamp"), ("Dell-LAN-TRAP-MIB", "dellTrapSeqNum"), ("Dell-LAN-TRAP-MIB", "dellTrapSource"), ("Dell-LAN-TRAP-MIB", "dellTrapSeverity"), ("Dell-LAN-TRAP-MIB", "dellTrapInfo")) if mibBuilder.loadTexts: igmpV1MsgReceived.setStatus('current') if mibBuilder.loadTexts: igmpV1MsgReceived.setDescription('An IGMP Message of v1 received on a given interface. The dellTrapSource should indicate the interface.') vrrpEntriesDeleted = NotificationType((1, 3, 6, 1, 4, 1, 674, 10895, 810)).setObjects(("Dell-LAN-TRAP-MIB", "dellTrapTimeStamp"), ("Dell-LAN-TRAP-MIB", "dellTrapSeqNum"), ("Dell-LAN-TRAP-MIB", "dellTrapSource"), ("Dell-LAN-TRAP-MIB", "dellTrapSeverity"), ("Dell-LAN-TRAP-MIB", "dellTrapInfo")) if mibBuilder.loadTexts: vrrpEntriesDeleted.setStatus('current') if mibBuilder.loadTexts: vrrpEntriesDeleted.setDescription('One or more VRRP entries deleted due to IP interface deletion or transition. ') trunkPortAddedTrap = NotificationType((1, 3, 6, 1, 4, 1, 674, 10895, 820)).setObjects(("Dell-LAN-TRAP-MIB", "dellTrapTimeStamp"), ("Dell-LAN-TRAP-MIB", "dellTrapSeqNum"), ("Dell-LAN-TRAP-MIB", "dellTrapSource"), ("Dell-LAN-TRAP-MIB", "dellTrapSeverity"), ("Dell-LAN-TRAP-MIB", "dellTrapInfo")) if mibBuilder.loadTexts: trunkPortAddedTrap.setStatus('current') if mibBuilder.loadTexts: trunkPortAddedTrap.setDescription('Informational trap indicating that a port is added to a trunk. The dellTrapSource should indicate the trunk to which the port is added. The dellTrapInfo should indicate the port being added.') trunkPortRemovedTrap = NotificationType((1, 3, 6, 1, 4, 1, 674, 10895, 830)).setObjects(("Dell-LAN-TRAP-MIB", "dellTrapTimeStamp"), ("Dell-LAN-TRAP-MIB", "dellTrapSeqNum"), ("Dell-LAN-TRAP-MIB", "dellTrapSource"), ("Dell-LAN-TRAP-MIB", "dellTrapSeverity"), ("Dell-LAN-TRAP-MIB", "dellTrapInfo")) if mibBuilder.loadTexts: trunkPortRemovedTrap.setStatus('current') if mibBuilder.loadTexts: trunkPortRemovedTrap.setDescription('This warning is generated when a port removed from a trunk. The dellTrapSource should indicate the trunk from which the port is removed. The dellTrapInfo should indicate the port being removed.') lockPortTrap = NotificationType((1, 3, 6, 1, 4, 1, 674, 10895, 840)).setObjects(("Dell-LAN-TRAP-MIB", "dellTrapTimeStamp"), ("Dell-LAN-TRAP-MIB", "dellTrapSeqNum"), ("Dell-LAN-TRAP-MIB", "dellTrapSource"), ("Dell-LAN-TRAP-MIB", "dellTrapSeverity"), ("Dell-LAN-TRAP-MIB", "dellTrapInfo")) if mibBuilder.loadTexts: lockPortTrap.setStatus('current') if mibBuilder.loadTexts: lockPortTrap.setDescription('Informational trap indicating that a port that is blocked from MAC learning has receive a frame with new source Mac Address. The dellTrapSource should identify the port and the dellTrapInfo should specify the new MAC address received.') vlanDynVlanAdded = NotificationType((1, 3, 6, 1, 4, 1, 674, 10895, 850)).setObjects(("Dell-LAN-TRAP-MIB", "dellTrapTimeStamp"), ("Dell-LAN-TRAP-MIB", "dellTrapSeqNum"), ("Dell-LAN-TRAP-MIB", "dellTrapSource"), ("Dell-LAN-TRAP-MIB", "dellTrapSeverity"), ("Dell-LAN-TRAP-MIB", "dellTrapInfo")) if mibBuilder.loadTexts: vlanDynVlanAdded.setStatus('current') if mibBuilder.loadTexts: vlanDynVlanAdded.setDescription('Indicates that a dynamic VLAN has been added via GVRP. The dellTrapSource should identify the VLAN being added.') vlanDynVlanRemoved = NotificationType((1, 3, 6, 1, 4, 1, 674, 10895, 860)).setObjects(("Dell-LAN-TRAP-MIB", "dellTrapTimeStamp"), ("Dell-LAN-TRAP-MIB", "dellTrapSeqNum"), ("Dell-LAN-TRAP-MIB", "dellTrapSource"), ("Dell-LAN-TRAP-MIB", "dellTrapSeverity"), ("Dell-LAN-TRAP-MIB", "dellTrapInfo")) if mibBuilder.loadTexts: vlanDynVlanRemoved.setStatus('current') if mibBuilder.loadTexts: vlanDynVlanRemoved.setDescription('Indicates that a dynamic VLAN has been removed via GVRP. The dellTrapSource should identify the VLAN being removed.') vlanDynamicToStatic = NotificationType((1, 3, 6, 1, 4, 1, 674, 10895, 870)).setObjects(("Dell-LAN-TRAP-MIB", "dellTrapTimeStamp"), ("Dell-LAN-TRAP-MIB", "dellTrapSeqNum"), ("Dell-LAN-TRAP-MIB", "dellTrapSource"), ("Dell-LAN-TRAP-MIB", "dellTrapSeverity"), ("Dell-LAN-TRAP-MIB", "dellTrapInfo")) if mibBuilder.loadTexts: vlanDynamicToStatic.setStatus('current') if mibBuilder.loadTexts: vlanDynamicToStatic.setDescription('Indicates that a dynamic VLAN has been made static. The dellTrapSource should identify the VLAN.') vlanStaticToDynamic = NotificationType((1, 3, 6, 1, 4, 1, 674, 10895, 880)).setObjects(("Dell-LAN-TRAP-MIB", "dellTrapTimeStamp"), ("Dell-LAN-TRAP-MIB", "dellTrapSeqNum"), ("Dell-LAN-TRAP-MIB", "dellTrapSource"), ("Dell-LAN-TRAP-MIB", "dellTrapSeverity"), ("Dell-LAN-TRAP-MIB", "dellTrapInfo")) if mibBuilder.loadTexts: vlanStaticToDynamic.setStatus('current') if mibBuilder.loadTexts: vlanStaticToDynamic.setDescription('Indicates that a static VLAN has been made dynamic. The dellTrapSource should identify the VLAN.') envMonFanStateChange = NotificationType((1, 3, 6, 1, 4, 1, 674, 10895, 890)).setObjects(("Dell-LAN-TRAP-MIB", "dellTrapTimeStamp"), ("Dell-LAN-TRAP-MIB", "dellTrapSeqNum"), ("Dell-LAN-TRAP-MIB", "dellTrapSource"), ("Dell-LAN-TRAP-MIB", "dellTrapSeverity"), ("Dell-LAN-TRAP-MIB", "dellTrapInfo")) if mibBuilder.loadTexts: envMonFanStateChange.setStatus('current') if mibBuilder.loadTexts: envMonFanStateChange.setDescription('Trap indicating the fan state. The dellTrapSource should identify the exact fan index if there are multiple fans. The dellTrapInfo may provide additional info relating to the fan new state.') envMonPowerSupplyStateChange = NotificationType((1, 3, 6, 1, 4, 1, 674, 10895, 900)).setObjects(("Dell-LAN-TRAP-MIB", "dellTrapTimeStamp"), ("Dell-LAN-TRAP-MIB", "dellTrapSeqNum"), ("Dell-LAN-TRAP-MIB", "dellTrapSource"), ("Dell-LAN-TRAP-MIB", "dellTrapSeverity"), ("Dell-LAN-TRAP-MIB", "dellTrapInfo")) if mibBuilder.loadTexts: envMonPowerSupplyStateChange.setStatus('current') if mibBuilder.loadTexts: envMonPowerSupplyStateChange.setDescription('Trap indicating the power supply state. The dellTrapSource should identify the exact power supply. The dellTrapInfo may provide additional info regarding the power state.') envMonTemperatureRisingAlarm = NotificationType((1, 3, 6, 1, 4, 1, 674, 10895, 910)).setObjects(("Dell-LAN-TRAP-MIB", "dellTrapTimeStamp"), ("Dell-LAN-TRAP-MIB", "dellTrapSeqNum"), ("Dell-LAN-TRAP-MIB", "dellTrapSource"), ("Dell-LAN-TRAP-MIB", "dellTrapSeverity"), ("Dell-LAN-TRAP-MIB", "dellTrapInfo")) if mibBuilder.loadTexts: envMonTemperatureRisingAlarm.setStatus('current') if mibBuilder.loadTexts: envMonTemperatureRisingAlarm.setDescription('Trap indicating that the temperature in the device has exceeded the device specific safe temperature threshold.') copyFinished = NotificationType((1, 3, 6, 1, 4, 1, 674, 10895, 920)).setObjects(("Dell-LAN-TRAP-MIB", "dellTrapTimeStamp"), ("Dell-LAN-TRAP-MIB", "dellTrapSeqNum"), ("Dell-LAN-TRAP-MIB", "dellTrapSource"), ("Dell-LAN-TRAP-MIB", "dellTrapSeverity"), ("Dell-LAN-TRAP-MIB", "dellTrapInfo")) if mibBuilder.loadTexts: copyFinished.setStatus('current') if mibBuilder.loadTexts: copyFinished.setDescription('Informational trap indicating that the device has finished a copy operation successfully.') copyFailed = NotificationType((1, 3, 6, 1, 4, 1, 674, 10895, 930)).setObjects(("Dell-LAN-TRAP-MIB", "dellTrapTimeStamp"), ("Dell-LAN-TRAP-MIB", "dellTrapSeqNum"), ("Dell-LAN-TRAP-MIB", "dellTrapSource"), ("Dell-LAN-TRAP-MIB", "dellTrapSeverity"), ("Dell-LAN-TRAP-MIB", "dellTrapInfo")) if mibBuilder.loadTexts: copyFailed.setStatus('current') if mibBuilder.loadTexts: copyFailed.setDescription('Informational trap indicating that the copy operation has failed.') dot1xPortStatusAuthorizedTrap = NotificationType((1, 3, 6, 1, 4, 1, 674, 10895, 940)).setObjects(("Dell-LAN-TRAP-MIB", "dellTrapTimeStamp"), ("Dell-LAN-TRAP-MIB", "dellTrapSeqNum"), ("Dell-LAN-TRAP-MIB", "dellTrapSource"), ("Dell-LAN-TRAP-MIB", "dellTrapSeverity"), ("Dell-LAN-TRAP-MIB", "dellTrapInfo")) if mibBuilder.loadTexts: dot1xPortStatusAuthorizedTrap.setStatus('current') if mibBuilder.loadTexts: dot1xPortStatusAuthorizedTrap.setDescription('Informational trap indicating that port 802.1x status is authorized.') dot1xPortStatusUnauthorizedTrap = NotificationType((1, 3, 6, 1, 4, 1, 674, 10895, 950)).setObjects(("Dell-LAN-TRAP-MIB", "dellTrapTimeStamp"), ("Dell-LAN-TRAP-MIB", "dellTrapSeqNum"), ("Dell-LAN-TRAP-MIB", "dellTrapSource"), ("Dell-LAN-TRAP-MIB", "dellTrapSeverity"), ("Dell-LAN-TRAP-MIB", "dellTrapInfo")) if mibBuilder.loadTexts: dot1xPortStatusUnauthorizedTrap.setStatus('current') if mibBuilder.loadTexts: dot1xPortStatusUnauthorizedTrap.setDescription('Warning trap is indicating that port 802.1x status is unAuthorized.') broadcastStormDetected = NotificationType((1, 3, 6, 1, 4, 1, 674, 10895, 960)).setObjects(("Dell-LAN-TRAP-MIB", "dellTrapTimeStamp"), ("Dell-LAN-TRAP-MIB", "dellTrapSeqNum"), ("Dell-LAN-TRAP-MIB", "dellTrapSource"), ("Dell-LAN-TRAP-MIB", "dellTrapSeverity"), ("Dell-LAN-TRAP-MIB", "dellTrapInfo")) if mibBuilder.loadTexts: broadcastStormDetected.setStatus('current') if mibBuilder.loadTexts: broadcastStormDetected.setDescription('Indicates that a broadcast storm has been detected. The dellTrapSource should indicate the port on which the broadcast storm is detected.') stpElectedAsRoot = NotificationType((1, 3, 6, 1, 4, 1, 674, 10895, 970)).setObjects(("Dell-LAN-TRAP-MIB", "dellTrapTimeStamp"), ("Dell-LAN-TRAP-MIB", "dellTrapSeqNum"), ("Dell-LAN-TRAP-MIB", "dellTrapSource"), ("Dell-LAN-TRAP-MIB", "dellTrapSeverity"), ("Dell-LAN-TRAP-MIB", "dellTrapInfo")) if mibBuilder.loadTexts: stpElectedAsRoot.setStatus('current') if mibBuilder.loadTexts: stpElectedAsRoot.setDescription('Indicates that the switch has been elected as the new STP root.') stpNewRootElected = NotificationType((1, 3, 6, 1, 4, 1, 674, 10895, 980)).setObjects(("Dell-LAN-TRAP-MIB", "dellTrapTimeStamp"), ("Dell-LAN-TRAP-MIB", "dellTrapSeqNum"), ("Dell-LAN-TRAP-MIB", "dellTrapSource"), ("Dell-LAN-TRAP-MIB", "dellTrapSeverity"), ("Dell-LAN-TRAP-MIB", "dellTrapInfo")) if mibBuilder.loadTexts: stpNewRootElected.setStatus('current') if mibBuilder.loadTexts: stpNewRootElected.setDescription('Indicates that a new root has been elected. The dellTrapSource should indicate the member unit number and the dellTrapInfo should provide information on the new root.') igmpElectedAsQuerier = NotificationType((1, 3, 6, 1, 4, 1, 674, 10895, 990)).setObjects(("Dell-LAN-TRAP-MIB", "dellTrapTimeStamp"), ("Dell-LAN-TRAP-MIB", "dellTrapSeqNum"), ("Dell-LAN-TRAP-MIB", "dellTrapSource"), ("Dell-LAN-TRAP-MIB", "dellTrapSeverity"), ("Dell-LAN-TRAP-MIB", "dellTrapInfo")) if mibBuilder.loadTexts: igmpElectedAsQuerier.setStatus('current') if mibBuilder.loadTexts: igmpElectedAsQuerier.setDescription('Indicates that this switch has been elected as the new IGMP snooping querier.') invalidUserLoginAttempted = NotificationType((1, 3, 6, 1, 4, 1, 674, 10895, 1000)).setObjects(("Dell-LAN-TRAP-MIB", "dellTrapTimeStamp"), ("Dell-LAN-TRAP-MIB", "dellTrapSeqNum"), ("Dell-LAN-TRAP-MIB", "dellTrapSource"), ("Dell-LAN-TRAP-MIB", "dellTrapSeverity"), ("Dell-LAN-TRAP-MIB", "dellTrapInfo")) if mibBuilder.loadTexts: invalidUserLoginAttempted.setStatus('current') if mibBuilder.loadTexts: invalidUserLoginAttempted.setDescription('Indicates that an invalid user tries to login to the CLI or Web. The dellTrapSource should indicate the unit member ID and the dellTrapInfo should indicate whether the login attempt is on the CLI or Web and the IP address from which the attempt was made.') managementACLViolation = NotificationType((1, 3, 6, 1, 4, 1, 674, 10895, 1010)).setObjects(("Dell-LAN-TRAP-MIB", "dellTrapTimeStamp"), ("Dell-LAN-TRAP-MIB", "dellTrapSeqNum"), ("Dell-LAN-TRAP-MIB", "dellTrapSource"), ("Dell-LAN-TRAP-MIB", "dellTrapSeverity"), ("Dell-LAN-TRAP-MIB", "dellTrapInfo")) if mibBuilder.loadTexts: managementACLViolation.setStatus('current') if mibBuilder.loadTexts: managementACLViolation.setDescription('Indicates that an SNMP request or CLI/Web access request was received but does not meet the management ACL rules. For example, if the request comes from an invalid IP address or has the wrong SNMP community string (for V1/2c) or is not authenticated for SNMPv3, etc. The dellTrapSource should indicate the unit # and the dellTrapInfo should indicate which interface (web, cli, snmp) is violated and the source IP address of the request.') sfpInserted = NotificationType((1, 3, 6, 1, 4, 1, 674, 10895, 1020)).setObjects(("Dell-LAN-TRAP-MIB", "dellTrapTimeStamp"), ("Dell-LAN-TRAP-MIB", "dellTrapSeqNum"), ("Dell-LAN-TRAP-MIB", "dellTrapSource"), ("Dell-LAN-TRAP-MIB", "dellTrapSeverity"), ("Dell-LAN-TRAP-MIB", "dellTrapInfo")) if mibBuilder.loadTexts: sfpInserted.setStatus('current') if mibBuilder.loadTexts: sfpInserted.setDescription('Indicates that an SFP was inserted into the system. The dellTrapSource should indicate the unit # and the dellTrapInfo should indicate on which interface was the SFP inserted.') sfpRemoved = NotificationType((1, 3, 6, 1, 4, 1, 674, 10895, 1030)).setObjects(("Dell-LAN-TRAP-MIB", "dellTrapTimeStamp"), ("Dell-LAN-TRAP-MIB", "dellTrapSeqNum"), ("Dell-LAN-TRAP-MIB", "dellTrapSource"), ("Dell-LAN-TRAP-MIB", "dellTrapSeverity"), ("Dell-LAN-TRAP-MIB", "dellTrapInfo")) if mibBuilder.loadTexts: sfpRemoved.setStatus('current') if mibBuilder.loadTexts: sfpRemoved.setDescription('Indicates that an SFP was removed from the system. The dellTrapSource should indicate the unit # and the dellTrapInfo should indicate from which interface was the SFP removed.') xfpInserted = NotificationType((1, 3, 6, 1, 4, 1, 674, 10895, 1040)).setObjects(("Dell-LAN-TRAP-MIB", "dellTrapTimeStamp"), ("Dell-LAN-TRAP-MIB", "dellTrapSeqNum"), ("Dell-LAN-TRAP-MIB", "dellTrapSource"), ("Dell-LAN-TRAP-MIB", "dellTrapSeverity"), ("Dell-LAN-TRAP-MIB", "dellTrapInfo")) if mibBuilder.loadTexts: xfpInserted.setStatus('current') if mibBuilder.loadTexts: xfpInserted.setDescription('Indicates that an XFP was inserted into the system. The dellTrapSource should indicate the unit # and the dellTrapInfo should indicate on which interface was the XFP inserted.') xfpRemoved = NotificationType((1, 3, 6, 1, 4, 1, 674, 10895, 1050)).setObjects(("Dell-LAN-TRAP-MIB", "dellTrapTimeStamp"), ("Dell-LAN-TRAP-MIB", "dellTrapSeqNum"), ("Dell-LAN-TRAP-MIB", "dellTrapSource"), ("Dell-LAN-TRAP-MIB", "dellTrapSeverity"), ("Dell-LAN-TRAP-MIB", "dellTrapInfo")) if mibBuilder.loadTexts: xfpRemoved.setStatus('current') if mibBuilder.loadTexts: xfpRemoved.setDescription('Indicates that an XFP was removed from the system. The dellTrapSource should indicate the unit # and the dellTrapInfo should indicate from which interface was the XFP removed.') mibBuilder.exportSymbols("Dell-LAN-TRAP-MIB", dellAlarmGroup=dellAlarmGroup, PYSNMP_MODULE_ID=dellAlarmGroup, mainLinkUp=mainLinkUp, vlanDynPortRemoved=vlanDynPortRemoved, abortTftp=abortTftp, lockPortTrap=lockPortTrap, broadcastStormDetected=broadcastStormDetected, dellTrapSeverity=dellTrapSeverity, dellTrapSeqNum=dellTrapSeqNum, stackMemberUnitRemoved=stackMemberUnitRemoved, dot1xPortStatusUnauthorizedTrap=dot1xPortStatusUnauthorizedTrap, stackSplitNewMasterReport=stackSplitNewMasterReport, sfpInserted=sfpInserted, hwResourceOverflow=hwResourceOverflow, endTftp=endTftp, policyDropPacketTrap=policyDropPacketTrap, igmpV1MsgReceived=igmpV1MsgReceived, invalidUserLoginAttempted=invalidUserLoginAttempted, envMonTemperatureRisingAlarm=envMonTemperatureRisingAlarm, swResourceOverflow=swResourceOverflow, stackNewMemberUnitAdded=stackNewMemberUnitAdded, vlanDynVlanAdded=vlanDynVlanAdded, stackNewMasterElected=stackNewMasterElected, managementACLViolation=managementACLViolation, stpElectedAsRoot=stpElectedAsRoot, policyForwardPacketTrap=policyForwardPacketTrap, dellTrapInfo=dellTrapInfo, configChanged=configChanged, vlanDynPortAdded=vlanDynPortAdded, vrrpEntriesDeleted=vrrpEntriesDeleted, ipZhrVirtualIpAsSource=ipZhrVirtualIpAsSource, dellTrapTimeStamp=dellTrapTimeStamp, startTftp=startTftp, linkFailureSwitchBackUp=linkFailureSwitchBackUp, dot1dStpPortStateNotForwarding=dot1dStpPortStateNotForwarding, resetRequired=resetRequired, ipZhrReqStaticConnNotAccepted=ipZhrReqStaticConnNotAccepted, trunkPortAddedTrap=trunkPortAddedTrap, trunkPortRemovedTrap=trunkPortRemovedTrap, stackLinkFailed=stackLinkFailed, vlanDynamicToStatic=vlanDynamicToStatic, vlanStaticToDynamic=vlanStaticToDynamic, envMonPowerSupplyStateChange=envMonPowerSupplyStateChange, dot1xPortStatusAuthorizedTrap=dot1xPortStatusAuthorizedTrap, dellTrapSource=dellTrapSource, stpNewRootElected=stpNewRootElected, igmpElectedAsQuerier=igmpElectedAsQuerier, xfpRemoved=xfpRemoved, copyFailed=copyFailed, xfpInserted=xfpInserted, envMonFanStateChange=envMonFanStateChange, dot1dStpPortStateForwarding=dot1dStpPortStateForwarding, linkFailure=linkFailure, stackMasterFailed=stackMasterFailed, ipZhrNotAllocVirtualIp=ipZhrNotAllocVirtualIp, stackSplitMasterReport=stackSplitMasterReport, dhcpAllocationFailure=dhcpAllocationFailure, vlanDynVlanRemoved=vlanDynVlanRemoved, sfpRemoved=sfpRemoved, stackRejoined=stackRejoined, stackMemberUnitFailed=stackMemberUnitFailed, copyFinished=copyFinished, errorsDuringInit=errorsDuringInit)
(object_identifier, integer, octet_string) = mibBuilder.importSymbols('ASN1', 'ObjectIdentifier', 'Integer', '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') (dell_lan, dell_lan_common) = mibBuilder.importSymbols('Dell-Vendor-MIB', 'dellLan', 'dellLanCommon') (module_compliance, notification_group) = mibBuilder.importSymbols('SNMPv2-CONF', 'ModuleCompliance', 'NotificationGroup') (object_identity, gauge32, unsigned32, ip_address, mib_scalar, mib_table, mib_table_row, mib_table_column, time_ticks, mib_identifier, bits, counter32, counter64, notification_type, integer32, iso, module_identity) = mibBuilder.importSymbols('SNMPv2-SMI', 'ObjectIdentity', 'Gauge32', 'Unsigned32', 'IpAddress', 'MibScalar', 'MibTable', 'MibTableRow', 'MibTableColumn', 'TimeTicks', 'MibIdentifier', 'Bits', 'Counter32', 'Counter64', 'NotificationType', 'Integer32', 'iso', 'ModuleIdentity') (display_string, date_and_time, textual_convention) = mibBuilder.importSymbols('SNMPv2-TC', 'DisplayString', 'DateAndTime', 'TextualConvention') dell_alarm_group = module_identity((1, 3, 6, 1, 4, 1, 674, 10895, 5000, 1, 1)) if mibBuilder.loadTexts: dellAlarmGroup.setLastUpdated('200504260000Z') if mibBuilder.loadTexts: dellAlarmGroup.setOrganization('Dell.') if mibBuilder.loadTexts: dellAlarmGroup.setContactInfo(' ') if mibBuilder.loadTexts: dellAlarmGroup.setDescription(' ') dell_trap_info = mib_scalar((1, 3, 6, 1, 4, 1, 674, 10895, 5000, 1, 1, 1), display_string()).setMaxAccess('readonly') if mibBuilder.loadTexts: dellTrapInfo.setStatus('current') if mibBuilder.loadTexts: dellTrapInfo.setDescription('This text string may be used to provide additional information regarding the trap being sent. Any specific formatting information is given in the trap definition.') dell_trap_severity = mib_scalar((1, 3, 6, 1, 4, 1, 674, 10895, 5000, 1, 1, 2), integer32().subtype(subtypeSpec=constraints_union(single_value_constraint(0, 1, 2, 3, 4))).clone(namedValues=named_values(('clear', 0), ('info', 1), ('minor', 2), ('major', 3), ('critical', 4)))).setMaxAccess('readonly') if mibBuilder.loadTexts: dellTrapSeverity.setStatus('current') if mibBuilder.loadTexts: dellTrapSeverity.setDescription('The severity type of the enterprise-specific trap sent to the Network Management Station by the Dell managed device. The Severity level are defined as follows: Critical - service affecting event. Major - a major error which is not service affecting but does require immediate user attention to prevent further degredation of the system, which may lead to a critical error. For example, if a redundant port failure would be considered a major event whereas the failure of an unprotected port is a critical event. Minor - a minor event which is not service affecting and is unlikely to lead to a major or critical event. The user does not need to take immediate actions but some action is required to clear the event. Info - a notification to the user of some event that does not require any user action. For example, a security notification is useful information but does not require the user to take any specific immediate action. This event is not cleared. Clear - this special trap is sent to clear some previously sent trap. Note that if the sequence number sent with the clear event is 0 then the clear event is used to indicate that all outstanding event of this particular type on a given source (dellTrapSource) has been cleared. If the event sequence number (dellTrapSeqNum) is sent with a non-zero value, then the clear event is sent to clear only the specific trap instance designated by the sequence number in question.') dell_trap_source = mib_scalar((1, 3, 6, 1, 4, 1, 674, 10895, 5000, 1, 1, 3), display_string()).setMaxAccess('readonly') if mibBuilder.loadTexts: dellTrapSource.setStatus('current') if mibBuilder.loadTexts: dellTrapSource.setDescription("The trap source is a string identifying the component of the device generating the trap. The source identifies the component associated with the fault. This may for example, identify the unit, slot, port, and possibly logical ports (VLAN, LAG) from which the fault occurs. The format of the source string is: 'TYPE=#:TYPE=#:...' where the TYPE may be one of 'unit' or 'slot' or 'port' or 'VLAN' or 'LAG'. For example: 'unit=3:slot=1:port=2' - indicates the trap comes from port 2 in slot 1 of the switch #3 in the stack. 'unit=2:VLAN=10' - indicates the trap comes from VLAN=10 in unit 2. 'unit=1' - indicates the trap comes from unit 1.") dell_trap_seq_num = mib_scalar((1, 3, 6, 1, 4, 1, 674, 10895, 5000, 1, 1, 4), unsigned32()).setMaxAccess('readonly') if mibBuilder.loadTexts: dellTrapSeqNum.setStatus('current') if mibBuilder.loadTexts: dellTrapSeqNum.setDescription('Since SNMP traps are transported using UDP, there is a possibility for the trap to be lost in transit. To allow the NMS the ability to detect this possibility, all traps will include a trap sequence number as part of its variable binding list. The trap sequence number may be reset each time the system reboots and will increment for each trap sent from the device. When a missing trap sequence number is detected the NMS may be able to refresh its state of the switch to determine what event it may have missed.') dell_trap_time_stamp = mib_scalar((1, 3, 6, 1, 4, 1, 674, 10895, 5000, 1, 1, 5), date_and_time()).setMaxAccess('readonly') if mibBuilder.loadTexts: dellTrapTimeStamp.setStatus('current') if mibBuilder.loadTexts: dellTrapTimeStamp.setDescription('The trap header includes the system up time which mark when the trap was generated, but often it is important to know the absolute time when the trap was generated. This time stamp is based on GMT (universal time) time zone. This will allow the timestamps to be correlated consistently across a large network.') hw_resource_overflow = notification_type((1, 3, 6, 1, 4, 1, 674, 10895, 500)).setObjects(('Dell-LAN-TRAP-MIB', 'dellTrapTimeStamp'), ('Dell-LAN-TRAP-MIB', 'dellTrapSeqNum'), ('Dell-LAN-TRAP-MIB', 'dellTrapSource'), ('Dell-LAN-TRAP-MIB', 'dellTrapSeverity'), ('Dell-LAN-TRAP-MIB', 'dellTrapInfo')) if mibBuilder.loadTexts: hwResourceOverflow.setStatus('current') if mibBuilder.loadTexts: hwResourceOverflow.setDescription('Indicates that a switch hardware resource overflowed. The dellTrapSource should indicate the unit number whereas dellTrapInfo should identify the resource that overflowed.') sw_resource_overflow = notification_type((1, 3, 6, 1, 4, 1, 674, 10895, 510)).setObjects(('Dell-LAN-TRAP-MIB', 'dellTrapTimeStamp'), ('Dell-LAN-TRAP-MIB', 'dellTrapSeqNum'), ('Dell-LAN-TRAP-MIB', 'dellTrapSource'), ('Dell-LAN-TRAP-MIB', 'dellTrapSeverity'), ('Dell-LAN-TRAP-MIB', 'dellTrapInfo')) if mibBuilder.loadTexts: swResourceOverflow.setStatus('current') if mibBuilder.loadTexts: swResourceOverflow.setDescription('Indicates that a switch software resource overflowed. The dellTrapSource should indicate the unit number whereas dellTrapInfo should identify the resource that overflowed (e.g. maximum VLAN/LAG/MACs/IPs exceeded).') config_changed = notification_type((1, 3, 6, 1, 4, 1, 674, 10895, 520)).setObjects(('Dell-LAN-TRAP-MIB', 'dellTrapTimeStamp'), ('Dell-LAN-TRAP-MIB', 'dellTrapSeqNum'), ('Dell-LAN-TRAP-MIB', 'dellTrapSource'), ('Dell-LAN-TRAP-MIB', 'dellTrapSeverity'), ('Dell-LAN-TRAP-MIB', 'dellTrapInfo')) if mibBuilder.loadTexts: configChanged.setStatus('current') if mibBuilder.loadTexts: configChanged.setDescription('Indicates that the switch configuration has changed. The dellTrapSource should indicate the source of the change such as the unit, slot, port, VLAN, LAG, etc. The dellTrapInfo may indicate additional information regarding the change.') reset_required = notification_type((1, 3, 6, 1, 4, 1, 674, 10895, 530)).setObjects(('Dell-LAN-TRAP-MIB', 'dellTrapTimeStamp'), ('Dell-LAN-TRAP-MIB', 'dellTrapSeqNum'), ('Dell-LAN-TRAP-MIB', 'dellTrapSource'), ('Dell-LAN-TRAP-MIB', 'dellTrapSeverity'), ('Dell-LAN-TRAP-MIB', 'dellTrapInfo')) if mibBuilder.loadTexts: resetRequired.setStatus('current') if mibBuilder.loadTexts: resetRequired.setDescription('This trap indicates that in order to perform the last SET request, a reset operation of the router/bridge is required. This may occur for any number of reasons such as if the change affects the routing protocols to be switched from SPF to STP. This trap warns the user to manually reset the switch using either physical or software reset.') end_tftp = notification_type((1, 3, 6, 1, 4, 1, 674, 10895, 540)).setObjects(('Dell-LAN-TRAP-MIB', 'dellTrapTimeStamp'), ('Dell-LAN-TRAP-MIB', 'dellTrapSeqNum'), ('Dell-LAN-TRAP-MIB', 'dellTrapSource'), ('Dell-LAN-TRAP-MIB', 'dellTrapSeverity'), ('Dell-LAN-TRAP-MIB', 'dellTrapInfo')) if mibBuilder.loadTexts: endTftp.setStatus('current') if mibBuilder.loadTexts: endTftp.setDescription('This trap indicates that the device finished a TFTP transaction with the management station. The dellTrapInfo field will provide TFTP exit code and name/type of the file being transferred.') abort_tftp = notification_type((1, 3, 6, 1, 4, 1, 674, 10895, 550)).setObjects(('Dell-LAN-TRAP-MIB', 'dellTrapTimeStamp'), ('Dell-LAN-TRAP-MIB', 'dellTrapSeqNum'), ('Dell-LAN-TRAP-MIB', 'dellTrapSource'), ('Dell-LAN-TRAP-MIB', 'dellTrapSeverity'), ('Dell-LAN-TRAP-MIB', 'dellTrapInfo')) if mibBuilder.loadTexts: abortTftp.setStatus('current') if mibBuilder.loadTexts: abortTftp.setDescription('This trap indicates that in the device aborted a TFTP session with the management station. The dellTrapInfo field will provide TFTP exit code and name/type of the file being transferred.') start_tftp = notification_type((1, 3, 6, 1, 4, 1, 674, 10895, 560)).setObjects(('Dell-LAN-TRAP-MIB', 'dellTrapTimeStamp'), ('Dell-LAN-TRAP-MIB', 'dellTrapSeqNum'), ('Dell-LAN-TRAP-MIB', 'dellTrapSource'), ('Dell-LAN-TRAP-MIB', 'dellTrapSeverity'), ('Dell-LAN-TRAP-MIB', 'dellTrapInfo')) if mibBuilder.loadTexts: startTftp.setStatus('current') if mibBuilder.loadTexts: startTftp.setDescription('Informational trap indicating that the device has intiated a TFTP session. dellTrapInfo will contain the name/type of the file being transferred.') link_failure = notification_type((1, 3, 6, 1, 4, 1, 674, 10895, 570)).setObjects(('Dell-LAN-TRAP-MIB', 'dellTrapTimeStamp'), ('Dell-LAN-TRAP-MIB', 'dellTrapSeqNum'), ('Dell-LAN-TRAP-MIB', 'dellTrapSource'), ('Dell-LAN-TRAP-MIB', 'dellTrapSeverity'), ('Dell-LAN-TRAP-MIB', 'dellTrapInfo')) if mibBuilder.loadTexts: linkFailure.setStatus('current') if mibBuilder.loadTexts: linkFailure.setDescription('Link failure detected, no backup available. The dellTrapSource should indicate the fail link.') link_failure_switch_back_up = notification_type((1, 3, 6, 1, 4, 1, 674, 10895, 580)).setObjects(('Dell-LAN-TRAP-MIB', 'dellTrapTimeStamp'), ('Dell-LAN-TRAP-MIB', 'dellTrapSeqNum'), ('Dell-LAN-TRAP-MIB', 'dellTrapSource'), ('Dell-LAN-TRAP-MIB', 'dellTrapSeverity'), ('Dell-LAN-TRAP-MIB', 'dellTrapInfo')) if mibBuilder.loadTexts: linkFailureSwitchBackUp.setStatus('current') if mibBuilder.loadTexts: linkFailureSwitchBackUp.setDescription('Automantic switchover to backup link because of main link fault. The dellTrapSource indicates the backup link coming on, and the dellTrapInfo indicates the failed link.') main_link_up = notification_type((1, 3, 6, 1, 4, 1, 674, 10895, 590)).setObjects(('Dell-LAN-TRAP-MIB', 'dellTrapTimeStamp'), ('Dell-LAN-TRAP-MIB', 'dellTrapSeqNum'), ('Dell-LAN-TRAP-MIB', 'dellTrapSource'), ('Dell-LAN-TRAP-MIB', 'dellTrapSeverity'), ('Dell-LAN-TRAP-MIB', 'dellTrapInfo')) if mibBuilder.loadTexts: mainLinkUp.setStatus('current') if mibBuilder.loadTexts: mainLinkUp.setDescription('Communication returned to main link. The dellTrapSource indicates the main link coming up, and the dellTrapInfo indicates the backup link.') errors_during_init = notification_type((1, 3, 6, 1, 4, 1, 674, 10895, 600)).setObjects(('Dell-LAN-TRAP-MIB', 'dellTrapTimeStamp'), ('Dell-LAN-TRAP-MIB', 'dellTrapSeqNum'), ('Dell-LAN-TRAP-MIB', 'dellTrapSource'), ('Dell-LAN-TRAP-MIB', 'dellTrapSeverity'), ('Dell-LAN-TRAP-MIB', 'dellTrapInfo')) if mibBuilder.loadTexts: errorsDuringInit.setStatus('current') if mibBuilder.loadTexts: errorsDuringInit.setDescription('This trap indicates that the an error occured during initialization phase of the switch. Additional information is provided in the dellTrapInfo field.') vlan_dyn_port_added = notification_type((1, 3, 6, 1, 4, 1, 674, 10895, 610)).setObjects(('Dell-LAN-TRAP-MIB', 'dellTrapTimeStamp'), ('Dell-LAN-TRAP-MIB', 'dellTrapSeqNum'), ('Dell-LAN-TRAP-MIB', 'dellTrapSource'), ('Dell-LAN-TRAP-MIB', 'dellTrapSeverity'), ('Dell-LAN-TRAP-MIB', 'dellTrapInfo')) if mibBuilder.loadTexts: vlanDynPortAdded.setStatus('current') if mibBuilder.loadTexts: vlanDynPortAdded.setDescription('Indicates that a port was dynamically added to the VLAN. The dellTrapSource will indicate the VLAN, and the dellTrapInfo will indicate the port being added.') vlan_dyn_port_removed = notification_type((1, 3, 6, 1, 4, 1, 674, 10895, 620)).setObjects(('Dell-LAN-TRAP-MIB', 'dellTrapTimeStamp'), ('Dell-LAN-TRAP-MIB', 'dellTrapSeqNum'), ('Dell-LAN-TRAP-MIB', 'dellTrapSource'), ('Dell-LAN-TRAP-MIB', 'dellTrapSeverity'), ('Dell-LAN-TRAP-MIB', 'dellTrapInfo')) if mibBuilder.loadTexts: vlanDynPortRemoved.setStatus('current') if mibBuilder.loadTexts: vlanDynPortRemoved.setDescription('Indicates that a port was dynamically removed from a VLAN. The dellTrapSource will indicate the VLAN, and the dellTrapInfo will indicate the port being removed.') ip_zhr_req_static_conn_not_accepted = notification_type((1, 3, 6, 1, 4, 1, 674, 10895, 630)).setObjects(('Dell-LAN-TRAP-MIB', 'dellTrapTimeStamp'), ('Dell-LAN-TRAP-MIB', 'dellTrapSeqNum'), ('Dell-LAN-TRAP-MIB', 'dellTrapSource'), ('Dell-LAN-TRAP-MIB', 'dellTrapSeverity'), ('Dell-LAN-TRAP-MIB', 'dellTrapInfo')) if mibBuilder.loadTexts: ipZhrReqStaticConnNotAccepted.setStatus('current') if mibBuilder.loadTexts: ipZhrReqStaticConnNotAccepted.setDescription('The requested static connection was not accepted because there is no available IP virtual address to allocate to it.') ip_zhr_virtual_ip_as_source = notification_type((1, 3, 6, 1, 4, 1, 674, 10895, 640)).setObjects(('Dell-LAN-TRAP-MIB', 'dellTrapTimeStamp'), ('Dell-LAN-TRAP-MIB', 'dellTrapSeqNum'), ('Dell-LAN-TRAP-MIB', 'dellTrapSource'), ('Dell-LAN-TRAP-MIB', 'dellTrapSeverity'), ('Dell-LAN-TRAP-MIB', 'dellTrapInfo')) if mibBuilder.loadTexts: ipZhrVirtualIpAsSource.setStatus('current') if mibBuilder.loadTexts: ipZhrVirtualIpAsSource.setDescription('The virtual IP address appeared as a source IP. All the connections using it will be deleted and it will not be further allocated to new connections.') ip_zhr_not_alloc_virtual_ip = notification_type((1, 3, 6, 1, 4, 1, 674, 10895, 650)).setObjects(('Dell-LAN-TRAP-MIB', 'dellTrapTimeStamp'), ('Dell-LAN-TRAP-MIB', 'dellTrapSeqNum'), ('Dell-LAN-TRAP-MIB', 'dellTrapSource'), ('Dell-LAN-TRAP-MIB', 'dellTrapSeverity'), ('Dell-LAN-TRAP-MIB', 'dellTrapInfo')) if mibBuilder.loadTexts: ipZhrNotAllocVirtualIp.setStatus('current') if mibBuilder.loadTexts: ipZhrNotAllocVirtualIp.setDescription('The source IP address sent an ARP specifying a virtual IP which was not allocated for this source. This virtual IP will not be allocated to connections of this specific source IP.') stack_master_failed = notification_type((1, 3, 6, 1, 4, 1, 674, 10895, 660)).setObjects(('Dell-LAN-TRAP-MIB', 'dellTrapTimeStamp'), ('Dell-LAN-TRAP-MIB', 'dellTrapSeqNum'), ('Dell-LAN-TRAP-MIB', 'dellTrapSource'), ('Dell-LAN-TRAP-MIB', 'dellTrapSeverity'), ('Dell-LAN-TRAP-MIB', 'dellTrapInfo')) if mibBuilder.loadTexts: stackMasterFailed.setStatus('current') if mibBuilder.loadTexts: stackMasterFailed.setDescription('Indicates that the stack master unit has failed. This trap is generated by the new master when it takes over the stack. The dellTrapSource should be the new master unit #, and the dellTrapInfo should identify the old master unit #.') stack_new_master_elected = notification_type((1, 3, 6, 1, 4, 1, 674, 10895, 670)).setObjects(('Dell-LAN-TRAP-MIB', 'dellTrapTimeStamp'), ('Dell-LAN-TRAP-MIB', 'dellTrapSeqNum'), ('Dell-LAN-TRAP-MIB', 'dellTrapSource'), ('Dell-LAN-TRAP-MIB', 'dellTrapSeverity'), ('Dell-LAN-TRAP-MIB', 'dellTrapInfo')) if mibBuilder.loadTexts: stackNewMasterElected.setStatus('current') if mibBuilder.loadTexts: stackNewMasterElected.setDescription('Indicates when a new master has been elected. This is different from a stack failure in that the master has not failed but for some reason a new master has been elected (e.g. the user requested a new master. The trap should be generated by the new master. the dellTrapSource should identify the new master, and the dellTrapInfo should identify the old master.') stack_member_unit_failed = notification_type((1, 3, 6, 1, 4, 1, 674, 10895, 680)).setObjects(('Dell-LAN-TRAP-MIB', 'dellTrapTimeStamp'), ('Dell-LAN-TRAP-MIB', 'dellTrapSeqNum'), ('Dell-LAN-TRAP-MIB', 'dellTrapSource'), ('Dell-LAN-TRAP-MIB', 'dellTrapSeverity'), ('Dell-LAN-TRAP-MIB', 'dellTrapInfo')) if mibBuilder.loadTexts: stackMemberUnitFailed.setStatus('current') if mibBuilder.loadTexts: stackMemberUnitFailed.setDescription('Indicates that a member of the stack has failed. This condition is detected by the master unit so the dellTrapSource should indicate the master unit ID and the dellTrapInfo should indicate the member unit that failed.') stack_new_member_unit_added = notification_type((1, 3, 6, 1, 4, 1, 674, 10895, 690)).setObjects(('Dell-LAN-TRAP-MIB', 'dellTrapTimeStamp'), ('Dell-LAN-TRAP-MIB', 'dellTrapSeqNum'), ('Dell-LAN-TRAP-MIB', 'dellTrapSource'), ('Dell-LAN-TRAP-MIB', 'dellTrapSeverity'), ('Dell-LAN-TRAP-MIB', 'dellTrapInfo')) if mibBuilder.loadTexts: stackNewMemberUnitAdded.setStatus('current') if mibBuilder.loadTexts: stackNewMemberUnitAdded.setDescription('Indicates that a new member unit has been added to the stack. This trap is generated by the master unit so the dellTrapSource should indicate the master unit ID, and the dellTrapInfo should identify the new unit ID.') stack_member_unit_removed = notification_type((1, 3, 6, 1, 4, 1, 674, 10895, 700)).setObjects(('Dell-LAN-TRAP-MIB', 'dellTrapTimeStamp'), ('Dell-LAN-TRAP-MIB', 'dellTrapSeqNum'), ('Dell-LAN-TRAP-MIB', 'dellTrapSource'), ('Dell-LAN-TRAP-MIB', 'dellTrapSeverity'), ('Dell-LAN-TRAP-MIB', 'dellTrapInfo')) if mibBuilder.loadTexts: stackMemberUnitRemoved.setStatus('current') if mibBuilder.loadTexts: stackMemberUnitRemoved.setDescription('Indicates that a member unit has been removed from the stack. The dellTrapSource indicates the master unit ID and the dellTrapInfo indicates the unit ID being removed.') stack_split_master_report = notification_type((1, 3, 6, 1, 4, 1, 674, 10895, 710)).setObjects(('Dell-LAN-TRAP-MIB', 'dellTrapTimeStamp'), ('Dell-LAN-TRAP-MIB', 'dellTrapSeqNum'), ('Dell-LAN-TRAP-MIB', 'dellTrapSource'), ('Dell-LAN-TRAP-MIB', 'dellTrapSeverity'), ('Dell-LAN-TRAP-MIB', 'dellTrapInfo')) if mibBuilder.loadTexts: stackSplitMasterReport.setStatus('current') if mibBuilder.loadTexts: stackSplitMasterReport.setDescription('Indicates that the stack has split into two distinct stacks which means that each stack may end up with its own master temporarily until the stack is rejoined. This is possibly different from the stackMemberUnitFailed trap, which indicates only a single unit failure. This trap indicates that the master has lost track of part of the stack membership so that the other units may elect their own master. The dellTrapSource should indicate the master unit ID and the dellTrapInfo should identify the units that are split from the main stack.') stack_split_new_master_report = notification_type((1, 3, 6, 1, 4, 1, 674, 10895, 720)).setObjects(('Dell-LAN-TRAP-MIB', 'dellTrapTimeStamp'), ('Dell-LAN-TRAP-MIB', 'dellTrapSeqNum'), ('Dell-LAN-TRAP-MIB', 'dellTrapSource'), ('Dell-LAN-TRAP-MIB', 'dellTrapSeverity'), ('Dell-LAN-TRAP-MIB', 'dellTrapInfo')) if mibBuilder.loadTexts: stackSplitNewMasterReport.setStatus('current') if mibBuilder.loadTexts: stackSplitNewMasterReport.setDescription('Indicates that the stack has split into two distinct stacks which means that each stack may end up with its own master temporarily until the stack is rejoined. This trap is generated by the new master unit elected in the split sub-stack. The dellTrapSource should identify the new master unit ID, and the dellTrapInfo should identify the old master unit ID before the split occured.') stack_rejoined = notification_type((1, 3, 6, 1, 4, 1, 674, 10895, 730)).setObjects(('Dell-LAN-TRAP-MIB', 'dellTrapTimeStamp'), ('Dell-LAN-TRAP-MIB', 'dellTrapSeqNum'), ('Dell-LAN-TRAP-MIB', 'dellTrapSource'), ('Dell-LAN-TRAP-MIB', 'dellTrapSeverity'), ('Dell-LAN-TRAP-MIB', 'dellTrapInfo')) if mibBuilder.loadTexts: stackRejoined.setStatus('current') if mibBuilder.loadTexts: stackRejoined.setDescription('Indicates that previously split stack has rejoined. The rejoined stack will elect a master and this trap should be generated by the elected master. The dellTrapSource should indicate the master unit ID and the dellTrapInfo should list the unit IDs of the members.') stack_link_failed = notification_type((1, 3, 6, 1, 4, 1, 674, 10895, 740)).setObjects(('Dell-LAN-TRAP-MIB', 'dellTrapTimeStamp'), ('Dell-LAN-TRAP-MIB', 'dellTrapSeqNum'), ('Dell-LAN-TRAP-MIB', 'dellTrapSource'), ('Dell-LAN-TRAP-MIB', 'dellTrapSeverity'), ('Dell-LAN-TRAP-MIB', 'dellTrapInfo')) if mibBuilder.loadTexts: stackLinkFailed.setStatus('current') if mibBuilder.loadTexts: stackLinkFailed.setDescription('Indicates a failure in one of the stacking link. If this stack was connected in a ring, then the failure of a stacking link results in a chain stack instead of a ring. Another failure in the chain topology would result in a split stack. If the stack is connected in a meshed or star topology then multiple link failure may be tolerated. This trap may be generated by any unit within the stack and must indicate the source of the failure. The dellTrapSource should identify one end of the link where the failure is detected. The dellTrapInfo may provide additional information about the failure.') dhcp_allocation_failure = notification_type((1, 3, 6, 1, 4, 1, 674, 10895, 750)).setObjects(('Dell-LAN-TRAP-MIB', 'dellTrapTimeStamp'), ('Dell-LAN-TRAP-MIB', 'dellTrapSeqNum'), ('Dell-LAN-TRAP-MIB', 'dellTrapSource'), ('Dell-LAN-TRAP-MIB', 'dellTrapSeverity'), ('Dell-LAN-TRAP-MIB', 'dellTrapInfo')) if mibBuilder.loadTexts: dhcpAllocationFailure.setStatus('current') if mibBuilder.loadTexts: dhcpAllocationFailure.setDescription('DHCP failed to allocate an IP address to a requesting host because of memory shortage or inadequate configuration of available IP addresses.') dot1d_stp_port_state_forwarding = notification_type((1, 3, 6, 1, 4, 1, 674, 10895, 760)).setObjects(('Dell-LAN-TRAP-MIB', 'dellTrapTimeStamp'), ('Dell-LAN-TRAP-MIB', 'dellTrapSeqNum'), ('Dell-LAN-TRAP-MIB', 'dellTrapSource'), ('Dell-LAN-TRAP-MIB', 'dellTrapSeverity'), ('Dell-LAN-TRAP-MIB', 'dellTrapInfo')) if mibBuilder.loadTexts: dot1dStpPortStateForwarding.setStatus('current') if mibBuilder.loadTexts: dot1dStpPortStateForwarding.setDescription('The trap is sent by a bridge when any of its configured ports transitions from the Learning state to the Forwarding state.') dot1d_stp_port_state_not_forwarding = notification_type((1, 3, 6, 1, 4, 1, 674, 10895, 770)).setObjects(('Dell-LAN-TRAP-MIB', 'dellTrapTimeStamp'), ('Dell-LAN-TRAP-MIB', 'dellTrapSeqNum'), ('Dell-LAN-TRAP-MIB', 'dellTrapSource'), ('Dell-LAN-TRAP-MIB', 'dellTrapSeverity'), ('Dell-LAN-TRAP-MIB', 'dellTrapInfo')) if mibBuilder.loadTexts: dot1dStpPortStateNotForwarding.setStatus('current') if mibBuilder.loadTexts: dot1dStpPortStateNotForwarding.setDescription('The trap is sent by a bridge when any of its configured ports transitions from the Forwarding state to the Blocking state.') policy_drop_packet_trap = notification_type((1, 3, 6, 1, 4, 1, 674, 10895, 780)).setObjects(('Dell-LAN-TRAP-MIB', 'dellTrapTimeStamp'), ('Dell-LAN-TRAP-MIB', 'dellTrapSeqNum'), ('Dell-LAN-TRAP-MIB', 'dellTrapSource'), ('Dell-LAN-TRAP-MIB', 'dellTrapSeverity'), ('Dell-LAN-TRAP-MIB', 'dellTrapInfo')) if mibBuilder.loadTexts: policyDropPacketTrap.setStatus('current') if mibBuilder.loadTexts: policyDropPacketTrap.setDescription('Indicates that the packet drop due to the policy. This trap may result in a huge number of trap packets and should be used only for debugging purposes. The number of traps sent per time period is user configurable and the user may enable/disable generation of this trap.') policy_forward_packet_trap = notification_type((1, 3, 6, 1, 4, 1, 674, 10895, 790)).setObjects(('Dell-LAN-TRAP-MIB', 'dellTrapTimeStamp'), ('Dell-LAN-TRAP-MIB', 'dellTrapSeqNum'), ('Dell-LAN-TRAP-MIB', 'dellTrapSource'), ('Dell-LAN-TRAP-MIB', 'dellTrapSeverity'), ('Dell-LAN-TRAP-MIB', 'dellTrapInfo')) if mibBuilder.loadTexts: policyForwardPacketTrap.setStatus('current') if mibBuilder.loadTexts: policyForwardPacketTrap.setDescription('Indicates that the packet has forward based on policy. The number of traps sent per time period is user configurable and the user may enable/disable generation of this trap.') igmp_v1_msg_received = notification_type((1, 3, 6, 1, 4, 1, 674, 10895, 800)).setObjects(('Dell-LAN-TRAP-MIB', 'dellTrapTimeStamp'), ('Dell-LAN-TRAP-MIB', 'dellTrapSeqNum'), ('Dell-LAN-TRAP-MIB', 'dellTrapSource'), ('Dell-LAN-TRAP-MIB', 'dellTrapSeverity'), ('Dell-LAN-TRAP-MIB', 'dellTrapInfo')) if mibBuilder.loadTexts: igmpV1MsgReceived.setStatus('current') if mibBuilder.loadTexts: igmpV1MsgReceived.setDescription('An IGMP Message of v1 received on a given interface. The dellTrapSource should indicate the interface.') vrrp_entries_deleted = notification_type((1, 3, 6, 1, 4, 1, 674, 10895, 810)).setObjects(('Dell-LAN-TRAP-MIB', 'dellTrapTimeStamp'), ('Dell-LAN-TRAP-MIB', 'dellTrapSeqNum'), ('Dell-LAN-TRAP-MIB', 'dellTrapSource'), ('Dell-LAN-TRAP-MIB', 'dellTrapSeverity'), ('Dell-LAN-TRAP-MIB', 'dellTrapInfo')) if mibBuilder.loadTexts: vrrpEntriesDeleted.setStatus('current') if mibBuilder.loadTexts: vrrpEntriesDeleted.setDescription('One or more VRRP entries deleted due to IP interface deletion or transition. ') trunk_port_added_trap = notification_type((1, 3, 6, 1, 4, 1, 674, 10895, 820)).setObjects(('Dell-LAN-TRAP-MIB', 'dellTrapTimeStamp'), ('Dell-LAN-TRAP-MIB', 'dellTrapSeqNum'), ('Dell-LAN-TRAP-MIB', 'dellTrapSource'), ('Dell-LAN-TRAP-MIB', 'dellTrapSeverity'), ('Dell-LAN-TRAP-MIB', 'dellTrapInfo')) if mibBuilder.loadTexts: trunkPortAddedTrap.setStatus('current') if mibBuilder.loadTexts: trunkPortAddedTrap.setDescription('Informational trap indicating that a port is added to a trunk. The dellTrapSource should indicate the trunk to which the port is added. The dellTrapInfo should indicate the port being added.') trunk_port_removed_trap = notification_type((1, 3, 6, 1, 4, 1, 674, 10895, 830)).setObjects(('Dell-LAN-TRAP-MIB', 'dellTrapTimeStamp'), ('Dell-LAN-TRAP-MIB', 'dellTrapSeqNum'), ('Dell-LAN-TRAP-MIB', 'dellTrapSource'), ('Dell-LAN-TRAP-MIB', 'dellTrapSeverity'), ('Dell-LAN-TRAP-MIB', 'dellTrapInfo')) if mibBuilder.loadTexts: trunkPortRemovedTrap.setStatus('current') if mibBuilder.loadTexts: trunkPortRemovedTrap.setDescription('This warning is generated when a port removed from a trunk. The dellTrapSource should indicate the trunk from which the port is removed. The dellTrapInfo should indicate the port being removed.') lock_port_trap = notification_type((1, 3, 6, 1, 4, 1, 674, 10895, 840)).setObjects(('Dell-LAN-TRAP-MIB', 'dellTrapTimeStamp'), ('Dell-LAN-TRAP-MIB', 'dellTrapSeqNum'), ('Dell-LAN-TRAP-MIB', 'dellTrapSource'), ('Dell-LAN-TRAP-MIB', 'dellTrapSeverity'), ('Dell-LAN-TRAP-MIB', 'dellTrapInfo')) if mibBuilder.loadTexts: lockPortTrap.setStatus('current') if mibBuilder.loadTexts: lockPortTrap.setDescription('Informational trap indicating that a port that is blocked from MAC learning has receive a frame with new source Mac Address. The dellTrapSource should identify the port and the dellTrapInfo should specify the new MAC address received.') vlan_dyn_vlan_added = notification_type((1, 3, 6, 1, 4, 1, 674, 10895, 850)).setObjects(('Dell-LAN-TRAP-MIB', 'dellTrapTimeStamp'), ('Dell-LAN-TRAP-MIB', 'dellTrapSeqNum'), ('Dell-LAN-TRAP-MIB', 'dellTrapSource'), ('Dell-LAN-TRAP-MIB', 'dellTrapSeverity'), ('Dell-LAN-TRAP-MIB', 'dellTrapInfo')) if mibBuilder.loadTexts: vlanDynVlanAdded.setStatus('current') if mibBuilder.loadTexts: vlanDynVlanAdded.setDescription('Indicates that a dynamic VLAN has been added via GVRP. The dellTrapSource should identify the VLAN being added.') vlan_dyn_vlan_removed = notification_type((1, 3, 6, 1, 4, 1, 674, 10895, 860)).setObjects(('Dell-LAN-TRAP-MIB', 'dellTrapTimeStamp'), ('Dell-LAN-TRAP-MIB', 'dellTrapSeqNum'), ('Dell-LAN-TRAP-MIB', 'dellTrapSource'), ('Dell-LAN-TRAP-MIB', 'dellTrapSeverity'), ('Dell-LAN-TRAP-MIB', 'dellTrapInfo')) if mibBuilder.loadTexts: vlanDynVlanRemoved.setStatus('current') if mibBuilder.loadTexts: vlanDynVlanRemoved.setDescription('Indicates that a dynamic VLAN has been removed via GVRP. The dellTrapSource should identify the VLAN being removed.') vlan_dynamic_to_static = notification_type((1, 3, 6, 1, 4, 1, 674, 10895, 870)).setObjects(('Dell-LAN-TRAP-MIB', 'dellTrapTimeStamp'), ('Dell-LAN-TRAP-MIB', 'dellTrapSeqNum'), ('Dell-LAN-TRAP-MIB', 'dellTrapSource'), ('Dell-LAN-TRAP-MIB', 'dellTrapSeverity'), ('Dell-LAN-TRAP-MIB', 'dellTrapInfo')) if mibBuilder.loadTexts: vlanDynamicToStatic.setStatus('current') if mibBuilder.loadTexts: vlanDynamicToStatic.setDescription('Indicates that a dynamic VLAN has been made static. The dellTrapSource should identify the VLAN.') vlan_static_to_dynamic = notification_type((1, 3, 6, 1, 4, 1, 674, 10895, 880)).setObjects(('Dell-LAN-TRAP-MIB', 'dellTrapTimeStamp'), ('Dell-LAN-TRAP-MIB', 'dellTrapSeqNum'), ('Dell-LAN-TRAP-MIB', 'dellTrapSource'), ('Dell-LAN-TRAP-MIB', 'dellTrapSeverity'), ('Dell-LAN-TRAP-MIB', 'dellTrapInfo')) if mibBuilder.loadTexts: vlanStaticToDynamic.setStatus('current') if mibBuilder.loadTexts: vlanStaticToDynamic.setDescription('Indicates that a static VLAN has been made dynamic. The dellTrapSource should identify the VLAN.') env_mon_fan_state_change = notification_type((1, 3, 6, 1, 4, 1, 674, 10895, 890)).setObjects(('Dell-LAN-TRAP-MIB', 'dellTrapTimeStamp'), ('Dell-LAN-TRAP-MIB', 'dellTrapSeqNum'), ('Dell-LAN-TRAP-MIB', 'dellTrapSource'), ('Dell-LAN-TRAP-MIB', 'dellTrapSeverity'), ('Dell-LAN-TRAP-MIB', 'dellTrapInfo')) if mibBuilder.loadTexts: envMonFanStateChange.setStatus('current') if mibBuilder.loadTexts: envMonFanStateChange.setDescription('Trap indicating the fan state. The dellTrapSource should identify the exact fan index if there are multiple fans. The dellTrapInfo may provide additional info relating to the fan new state.') env_mon_power_supply_state_change = notification_type((1, 3, 6, 1, 4, 1, 674, 10895, 900)).setObjects(('Dell-LAN-TRAP-MIB', 'dellTrapTimeStamp'), ('Dell-LAN-TRAP-MIB', 'dellTrapSeqNum'), ('Dell-LAN-TRAP-MIB', 'dellTrapSource'), ('Dell-LAN-TRAP-MIB', 'dellTrapSeverity'), ('Dell-LAN-TRAP-MIB', 'dellTrapInfo')) if mibBuilder.loadTexts: envMonPowerSupplyStateChange.setStatus('current') if mibBuilder.loadTexts: envMonPowerSupplyStateChange.setDescription('Trap indicating the power supply state. The dellTrapSource should identify the exact power supply. The dellTrapInfo may provide additional info regarding the power state.') env_mon_temperature_rising_alarm = notification_type((1, 3, 6, 1, 4, 1, 674, 10895, 910)).setObjects(('Dell-LAN-TRAP-MIB', 'dellTrapTimeStamp'), ('Dell-LAN-TRAP-MIB', 'dellTrapSeqNum'), ('Dell-LAN-TRAP-MIB', 'dellTrapSource'), ('Dell-LAN-TRAP-MIB', 'dellTrapSeverity'), ('Dell-LAN-TRAP-MIB', 'dellTrapInfo')) if mibBuilder.loadTexts: envMonTemperatureRisingAlarm.setStatus('current') if mibBuilder.loadTexts: envMonTemperatureRisingAlarm.setDescription('Trap indicating that the temperature in the device has exceeded the device specific safe temperature threshold.') copy_finished = notification_type((1, 3, 6, 1, 4, 1, 674, 10895, 920)).setObjects(('Dell-LAN-TRAP-MIB', 'dellTrapTimeStamp'), ('Dell-LAN-TRAP-MIB', 'dellTrapSeqNum'), ('Dell-LAN-TRAP-MIB', 'dellTrapSource'), ('Dell-LAN-TRAP-MIB', 'dellTrapSeverity'), ('Dell-LAN-TRAP-MIB', 'dellTrapInfo')) if mibBuilder.loadTexts: copyFinished.setStatus('current') if mibBuilder.loadTexts: copyFinished.setDescription('Informational trap indicating that the device has finished a copy operation successfully.') copy_failed = notification_type((1, 3, 6, 1, 4, 1, 674, 10895, 930)).setObjects(('Dell-LAN-TRAP-MIB', 'dellTrapTimeStamp'), ('Dell-LAN-TRAP-MIB', 'dellTrapSeqNum'), ('Dell-LAN-TRAP-MIB', 'dellTrapSource'), ('Dell-LAN-TRAP-MIB', 'dellTrapSeverity'), ('Dell-LAN-TRAP-MIB', 'dellTrapInfo')) if mibBuilder.loadTexts: copyFailed.setStatus('current') if mibBuilder.loadTexts: copyFailed.setDescription('Informational trap indicating that the copy operation has failed.') dot1x_port_status_authorized_trap = notification_type((1, 3, 6, 1, 4, 1, 674, 10895, 940)).setObjects(('Dell-LAN-TRAP-MIB', 'dellTrapTimeStamp'), ('Dell-LAN-TRAP-MIB', 'dellTrapSeqNum'), ('Dell-LAN-TRAP-MIB', 'dellTrapSource'), ('Dell-LAN-TRAP-MIB', 'dellTrapSeverity'), ('Dell-LAN-TRAP-MIB', 'dellTrapInfo')) if mibBuilder.loadTexts: dot1xPortStatusAuthorizedTrap.setStatus('current') if mibBuilder.loadTexts: dot1xPortStatusAuthorizedTrap.setDescription('Informational trap indicating that port 802.1x status is authorized.') dot1x_port_status_unauthorized_trap = notification_type((1, 3, 6, 1, 4, 1, 674, 10895, 950)).setObjects(('Dell-LAN-TRAP-MIB', 'dellTrapTimeStamp'), ('Dell-LAN-TRAP-MIB', 'dellTrapSeqNum'), ('Dell-LAN-TRAP-MIB', 'dellTrapSource'), ('Dell-LAN-TRAP-MIB', 'dellTrapSeverity'), ('Dell-LAN-TRAP-MIB', 'dellTrapInfo')) if mibBuilder.loadTexts: dot1xPortStatusUnauthorizedTrap.setStatus('current') if mibBuilder.loadTexts: dot1xPortStatusUnauthorizedTrap.setDescription('Warning trap is indicating that port 802.1x status is unAuthorized.') broadcast_storm_detected = notification_type((1, 3, 6, 1, 4, 1, 674, 10895, 960)).setObjects(('Dell-LAN-TRAP-MIB', 'dellTrapTimeStamp'), ('Dell-LAN-TRAP-MIB', 'dellTrapSeqNum'), ('Dell-LAN-TRAP-MIB', 'dellTrapSource'), ('Dell-LAN-TRAP-MIB', 'dellTrapSeverity'), ('Dell-LAN-TRAP-MIB', 'dellTrapInfo')) if mibBuilder.loadTexts: broadcastStormDetected.setStatus('current') if mibBuilder.loadTexts: broadcastStormDetected.setDescription('Indicates that a broadcast storm has been detected. The dellTrapSource should indicate the port on which the broadcast storm is detected.') stp_elected_as_root = notification_type((1, 3, 6, 1, 4, 1, 674, 10895, 970)).setObjects(('Dell-LAN-TRAP-MIB', 'dellTrapTimeStamp'), ('Dell-LAN-TRAP-MIB', 'dellTrapSeqNum'), ('Dell-LAN-TRAP-MIB', 'dellTrapSource'), ('Dell-LAN-TRAP-MIB', 'dellTrapSeverity'), ('Dell-LAN-TRAP-MIB', 'dellTrapInfo')) if mibBuilder.loadTexts: stpElectedAsRoot.setStatus('current') if mibBuilder.loadTexts: stpElectedAsRoot.setDescription('Indicates that the switch has been elected as the new STP root.') stp_new_root_elected = notification_type((1, 3, 6, 1, 4, 1, 674, 10895, 980)).setObjects(('Dell-LAN-TRAP-MIB', 'dellTrapTimeStamp'), ('Dell-LAN-TRAP-MIB', 'dellTrapSeqNum'), ('Dell-LAN-TRAP-MIB', 'dellTrapSource'), ('Dell-LAN-TRAP-MIB', 'dellTrapSeverity'), ('Dell-LAN-TRAP-MIB', 'dellTrapInfo')) if mibBuilder.loadTexts: stpNewRootElected.setStatus('current') if mibBuilder.loadTexts: stpNewRootElected.setDescription('Indicates that a new root has been elected. The dellTrapSource should indicate the member unit number and the dellTrapInfo should provide information on the new root.') igmp_elected_as_querier = notification_type((1, 3, 6, 1, 4, 1, 674, 10895, 990)).setObjects(('Dell-LAN-TRAP-MIB', 'dellTrapTimeStamp'), ('Dell-LAN-TRAP-MIB', 'dellTrapSeqNum'), ('Dell-LAN-TRAP-MIB', 'dellTrapSource'), ('Dell-LAN-TRAP-MIB', 'dellTrapSeverity'), ('Dell-LAN-TRAP-MIB', 'dellTrapInfo')) if mibBuilder.loadTexts: igmpElectedAsQuerier.setStatus('current') if mibBuilder.loadTexts: igmpElectedAsQuerier.setDescription('Indicates that this switch has been elected as the new IGMP snooping querier.') invalid_user_login_attempted = notification_type((1, 3, 6, 1, 4, 1, 674, 10895, 1000)).setObjects(('Dell-LAN-TRAP-MIB', 'dellTrapTimeStamp'), ('Dell-LAN-TRAP-MIB', 'dellTrapSeqNum'), ('Dell-LAN-TRAP-MIB', 'dellTrapSource'), ('Dell-LAN-TRAP-MIB', 'dellTrapSeverity'), ('Dell-LAN-TRAP-MIB', 'dellTrapInfo')) if mibBuilder.loadTexts: invalidUserLoginAttempted.setStatus('current') if mibBuilder.loadTexts: invalidUserLoginAttempted.setDescription('Indicates that an invalid user tries to login to the CLI or Web. The dellTrapSource should indicate the unit member ID and the dellTrapInfo should indicate whether the login attempt is on the CLI or Web and the IP address from which the attempt was made.') management_acl_violation = notification_type((1, 3, 6, 1, 4, 1, 674, 10895, 1010)).setObjects(('Dell-LAN-TRAP-MIB', 'dellTrapTimeStamp'), ('Dell-LAN-TRAP-MIB', 'dellTrapSeqNum'), ('Dell-LAN-TRAP-MIB', 'dellTrapSource'), ('Dell-LAN-TRAP-MIB', 'dellTrapSeverity'), ('Dell-LAN-TRAP-MIB', 'dellTrapInfo')) if mibBuilder.loadTexts: managementACLViolation.setStatus('current') if mibBuilder.loadTexts: managementACLViolation.setDescription('Indicates that an SNMP request or CLI/Web access request was received but does not meet the management ACL rules. For example, if the request comes from an invalid IP address or has the wrong SNMP community string (for V1/2c) or is not authenticated for SNMPv3, etc. The dellTrapSource should indicate the unit # and the dellTrapInfo should indicate which interface (web, cli, snmp) is violated and the source IP address of the request.') sfp_inserted = notification_type((1, 3, 6, 1, 4, 1, 674, 10895, 1020)).setObjects(('Dell-LAN-TRAP-MIB', 'dellTrapTimeStamp'), ('Dell-LAN-TRAP-MIB', 'dellTrapSeqNum'), ('Dell-LAN-TRAP-MIB', 'dellTrapSource'), ('Dell-LAN-TRAP-MIB', 'dellTrapSeverity'), ('Dell-LAN-TRAP-MIB', 'dellTrapInfo')) if mibBuilder.loadTexts: sfpInserted.setStatus('current') if mibBuilder.loadTexts: sfpInserted.setDescription('Indicates that an SFP was inserted into the system. The dellTrapSource should indicate the unit # and the dellTrapInfo should indicate on which interface was the SFP inserted.') sfp_removed = notification_type((1, 3, 6, 1, 4, 1, 674, 10895, 1030)).setObjects(('Dell-LAN-TRAP-MIB', 'dellTrapTimeStamp'), ('Dell-LAN-TRAP-MIB', 'dellTrapSeqNum'), ('Dell-LAN-TRAP-MIB', 'dellTrapSource'), ('Dell-LAN-TRAP-MIB', 'dellTrapSeverity'), ('Dell-LAN-TRAP-MIB', 'dellTrapInfo')) if mibBuilder.loadTexts: sfpRemoved.setStatus('current') if mibBuilder.loadTexts: sfpRemoved.setDescription('Indicates that an SFP was removed from the system. The dellTrapSource should indicate the unit # and the dellTrapInfo should indicate from which interface was the SFP removed.') xfp_inserted = notification_type((1, 3, 6, 1, 4, 1, 674, 10895, 1040)).setObjects(('Dell-LAN-TRAP-MIB', 'dellTrapTimeStamp'), ('Dell-LAN-TRAP-MIB', 'dellTrapSeqNum'), ('Dell-LAN-TRAP-MIB', 'dellTrapSource'), ('Dell-LAN-TRAP-MIB', 'dellTrapSeverity'), ('Dell-LAN-TRAP-MIB', 'dellTrapInfo')) if mibBuilder.loadTexts: xfpInserted.setStatus('current') if mibBuilder.loadTexts: xfpInserted.setDescription('Indicates that an XFP was inserted into the system. The dellTrapSource should indicate the unit # and the dellTrapInfo should indicate on which interface was the XFP inserted.') xfp_removed = notification_type((1, 3, 6, 1, 4, 1, 674, 10895, 1050)).setObjects(('Dell-LAN-TRAP-MIB', 'dellTrapTimeStamp'), ('Dell-LAN-TRAP-MIB', 'dellTrapSeqNum'), ('Dell-LAN-TRAP-MIB', 'dellTrapSource'), ('Dell-LAN-TRAP-MIB', 'dellTrapSeverity'), ('Dell-LAN-TRAP-MIB', 'dellTrapInfo')) if mibBuilder.loadTexts: xfpRemoved.setStatus('current') if mibBuilder.loadTexts: xfpRemoved.setDescription('Indicates that an XFP was removed from the system. The dellTrapSource should indicate the unit # and the dellTrapInfo should indicate from which interface was the XFP removed.') mibBuilder.exportSymbols('Dell-LAN-TRAP-MIB', dellAlarmGroup=dellAlarmGroup, PYSNMP_MODULE_ID=dellAlarmGroup, mainLinkUp=mainLinkUp, vlanDynPortRemoved=vlanDynPortRemoved, abortTftp=abortTftp, lockPortTrap=lockPortTrap, broadcastStormDetected=broadcastStormDetected, dellTrapSeverity=dellTrapSeverity, dellTrapSeqNum=dellTrapSeqNum, stackMemberUnitRemoved=stackMemberUnitRemoved, dot1xPortStatusUnauthorizedTrap=dot1xPortStatusUnauthorizedTrap, stackSplitNewMasterReport=stackSplitNewMasterReport, sfpInserted=sfpInserted, hwResourceOverflow=hwResourceOverflow, endTftp=endTftp, policyDropPacketTrap=policyDropPacketTrap, igmpV1MsgReceived=igmpV1MsgReceived, invalidUserLoginAttempted=invalidUserLoginAttempted, envMonTemperatureRisingAlarm=envMonTemperatureRisingAlarm, swResourceOverflow=swResourceOverflow, stackNewMemberUnitAdded=stackNewMemberUnitAdded, vlanDynVlanAdded=vlanDynVlanAdded, stackNewMasterElected=stackNewMasterElected, managementACLViolation=managementACLViolation, stpElectedAsRoot=stpElectedAsRoot, policyForwardPacketTrap=policyForwardPacketTrap, dellTrapInfo=dellTrapInfo, configChanged=configChanged, vlanDynPortAdded=vlanDynPortAdded, vrrpEntriesDeleted=vrrpEntriesDeleted, ipZhrVirtualIpAsSource=ipZhrVirtualIpAsSource, dellTrapTimeStamp=dellTrapTimeStamp, startTftp=startTftp, linkFailureSwitchBackUp=linkFailureSwitchBackUp, dot1dStpPortStateNotForwarding=dot1dStpPortStateNotForwarding, resetRequired=resetRequired, ipZhrReqStaticConnNotAccepted=ipZhrReqStaticConnNotAccepted, trunkPortAddedTrap=trunkPortAddedTrap, trunkPortRemovedTrap=trunkPortRemovedTrap, stackLinkFailed=stackLinkFailed, vlanDynamicToStatic=vlanDynamicToStatic, vlanStaticToDynamic=vlanStaticToDynamic, envMonPowerSupplyStateChange=envMonPowerSupplyStateChange, dot1xPortStatusAuthorizedTrap=dot1xPortStatusAuthorizedTrap, dellTrapSource=dellTrapSource, stpNewRootElected=stpNewRootElected, igmpElectedAsQuerier=igmpElectedAsQuerier, xfpRemoved=xfpRemoved, copyFailed=copyFailed, xfpInserted=xfpInserted, envMonFanStateChange=envMonFanStateChange, dot1dStpPortStateForwarding=dot1dStpPortStateForwarding, linkFailure=linkFailure, stackMasterFailed=stackMasterFailed, ipZhrNotAllocVirtualIp=ipZhrNotAllocVirtualIp, stackSplitMasterReport=stackSplitMasterReport, dhcpAllocationFailure=dhcpAllocationFailure, vlanDynVlanRemoved=vlanDynVlanRemoved, sfpRemoved=sfpRemoved, stackRejoined=stackRejoined, stackMemberUnitFailed=stackMemberUnitFailed, copyFinished=copyFinished, errorsDuringInit=errorsDuringInit)
class DummyClass: dummy_var = 'original' def __init__(self, init_param=0): pass def __call__(self, call_param=0): return 'not_mocked_call' def some_method(self): # def some_method(self, some_method_param): return 'not_mocked_some_method' def some_other_method(self, some_other_method_param): return 'not_mocked_some_other_method'
class Dummyclass: dummy_var = 'original' def __init__(self, init_param=0): pass def __call__(self, call_param=0): return 'not_mocked_call' def some_method(self): return 'not_mocked_some_method' def some_other_method(self, some_other_method_param): return 'not_mocked_some_other_method'
H, W, A, B = map(int, input().split()) board = [[0] * W for _ in range(H)] for i in range(B): for j in range(A): board[i][j] = 1 for i in range(B, H): for j in range(A, W): board[i][j] = 1 assert all(sum(row) in [A, W-A] for row in board) assert all(sum(board[i][j] for i in range(H)) in [B, H-B] for j in range(W)) for row in board: print("".join(map(str, row)))
(h, w, a, b) = map(int, input().split()) board = [[0] * W for _ in range(H)] for i in range(B): for j in range(A): board[i][j] = 1 for i in range(B, H): for j in range(A, W): board[i][j] = 1 assert all((sum(row) in [A, W - A] for row in board)) assert all((sum((board[i][j] for i in range(H))) in [B, H - B] for j in range(W))) for row in board: print(''.join(map(str, row)))
def genSubsets(L): ''' L: list Returns: all subsets of L ''' # base case if len(L) == 0: return [[]] # recursive block # all the subsets of smaller + all the subsets of smaller combined with extra = all subsets of L extra = L[0:1] smaller = genSubsets(L[1:]) combine = [] for i in smaller: combine.append(extra + i) return smaller + combine
def gen_subsets(L): """ L: list Returns: all subsets of L """ if len(L) == 0: return [[]] extra = L[0:1] smaller = gen_subsets(L[1:]) combine = [] for i in smaller: combine.append(extra + i) return smaller + combine
class Solution(object): def isUgly(self, num): if not num: return False for factor in (2, 3, 5): while num % factor == 0: num /= factor return num == 1
class Solution(object): def is_ugly(self, num): if not num: return False for factor in (2, 3, 5): while num % factor == 0: num /= factor return num == 1
# Please change this appropriately TRAIN_DATA = "../input/train.csv" TEST_DATA = "../input/test.csv" HTML_DATA = "../input/html_data.csv" CLEAN_TRAIN_DATA = "../input2/train_v2.csv" CLEAN_TEST_DATA = "../input2/test_v2.csv" TRAIN_TEXT_MODEL_PATH = "../input2/train_text_preds.csv" TEST_TEXT_MODEL_PATH = "../input2/test_text_preds.csv" SUBMISSION_PATH = "../input2/submission.csv" # Preferably keep them as is LABEL_COLS = ["others", "news", "publication", "profile", "conferences", "forum", "clinicalTrials", "thesis", "guidelines"] TAG_DICT = {"others":0, "news": 1, "publication":2, "profile": 3, "conferences": 4, "forum": 5, "clinicalTrials": 6, "thesis": 7, "guidelines": 8}
train_data = '../input/train.csv' test_data = '../input/test.csv' html_data = '../input/html_data.csv' clean_train_data = '../input2/train_v2.csv' clean_test_data = '../input2/test_v2.csv' train_text_model_path = '../input2/train_text_preds.csv' test_text_model_path = '../input2/test_text_preds.csv' submission_path = '../input2/submission.csv' label_cols = ['others', 'news', 'publication', 'profile', 'conferences', 'forum', 'clinicalTrials', 'thesis', 'guidelines'] tag_dict = {'others': 0, 'news': 1, 'publication': 2, 'profile': 3, 'conferences': 4, 'forum': 5, 'clinicalTrials': 6, 'thesis': 7, 'guidelines': 8}
_day_bands = ['n2_lbh' , 'n2_vk' , 'n2_1pg' , 'n2_2pg' , 'n2p_1ng' , 'n2p_mnl' , 'no_bands' ] _night_bands = ['o2_nglow','o2_atm'] _bands = _day_bands + _night_bands _band_cmd = {'n2_lbh':'syn_lbh' , 'n2_vk':'syn_vk' , 'n2_1pg':'syn_1pg' , 'n2_2pg':'syn_2pg' , 'n2p_1ng':'syn_1ng' , 'n2p_mnl':'syn_mnl' , 'no_bands':'syn_no' , 'o2_atm':'syn_atm' , 'o2_nglow':'syn_o2' } def band_command(band_name): return _band_cmd[band_name]
_day_bands = ['n2_lbh', 'n2_vk', 'n2_1pg', 'n2_2pg', 'n2p_1ng', 'n2p_mnl', 'no_bands'] _night_bands = ['o2_nglow', 'o2_atm'] _bands = _day_bands + _night_bands _band_cmd = {'n2_lbh': 'syn_lbh', 'n2_vk': 'syn_vk', 'n2_1pg': 'syn_1pg', 'n2_2pg': 'syn_2pg', 'n2p_1ng': 'syn_1ng', 'n2p_mnl': 'syn_mnl', 'no_bands': 'syn_no', 'o2_atm': 'syn_atm', 'o2_nglow': 'syn_o2'} def band_command(band_name): return _band_cmd[band_name]
# Aaron Donnelly # This program will count the number of re-occurences of the letter 'e' in a txt file selected by the user. f= open(input("Insert a .txt filename "), "r") x= f.read().count('e') print("There are",x, "e's in this text")
f = open(input('Insert a .txt filename '), 'r') x = f.read().count('e') print('There are', x, "e's in this text")
# # PySNMP MIB module WWP-COMMUNITY-MIB (http://snmplabs.com/pysmi) # ASN.1 source file:///Users/davwang4/Dev/mibs.snmplabs.com/asn1/WWP-COMMUNITY-MIB # Produced by pysmi-0.3.4 at Mon Apr 29 21:30: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) # ObjectIdentifier, Integer, OctetString = mibBuilder.importSymbols("ASN1", "ObjectIdentifier", "Integer", "OctetString") NamedValues, = mibBuilder.importSymbols("ASN1-ENUMERATION", "NamedValues") ConstraintsUnion, ValueRangeConstraint, SingleValueConstraint, ValueSizeConstraint, ConstraintsIntersection = mibBuilder.importSymbols("ASN1-REFINEMENT", "ConstraintsUnion", "ValueRangeConstraint", "SingleValueConstraint", "ValueSizeConstraint", "ConstraintsIntersection") ModuleCompliance, NotificationGroup = mibBuilder.importSymbols("SNMPv2-CONF", "ModuleCompliance", "NotificationGroup") MibScalar, MibTable, MibTableRow, MibTableColumn, IpAddress, Gauge32, Counter64, ObjectIdentity, ModuleIdentity, Integer32, Bits, TimeTicks, Unsigned32, NotificationType, iso, MibIdentifier, Counter32 = mibBuilder.importSymbols("SNMPv2-SMI", "MibScalar", "MibTable", "MibTableRow", "MibTableColumn", "IpAddress", "Gauge32", "Counter64", "ObjectIdentity", "ModuleIdentity", "Integer32", "Bits", "TimeTicks", "Unsigned32", "NotificationType", "iso", "MibIdentifier", "Counter32") RowStatus, TextualConvention, DisplayString = mibBuilder.importSymbols("SNMPv2-TC", "RowStatus", "TextualConvention", "DisplayString") wwpModules, = mibBuilder.importSymbols("WWP-SMI", "wwpModules") wwpCommunityMIB = ModuleIdentity((1, 3, 6, 1, 4, 1, 6141, 2, 32)) wwpCommunityMIB.setRevisions(('2001-04-03 17:00',)) if mibBuilder.loadTexts: wwpCommunityMIB.setLastUpdated('200104031700Z') if mibBuilder.loadTexts: wwpCommunityMIB.setOrganization('World Wide Packets, Inc') wwpCommunityMIBObjects = MibIdentifier((1, 3, 6, 1, 4, 1, 6141, 2, 32, 1)) wwpCommunity = MibIdentifier((1, 3, 6, 1, 4, 1, 6141, 2, 32, 1, 1)) wwpCommunityMIBNotificationPrefix = MibIdentifier((1, 3, 6, 1, 4, 1, 6141, 2, 32, 2)) wwpCommunityMIBNotifications = MibIdentifier((1, 3, 6, 1, 4, 1, 6141, 2, 32, 2, 0)) wwpCommunityMIBConformance = MibIdentifier((1, 3, 6, 1, 4, 1, 6141, 2, 32, 3)) wwpCommunityMIBCompliances = MibIdentifier((1, 3, 6, 1, 4, 1, 6141, 2, 32, 3, 1)) wwpCommunityMIBGroups = MibIdentifier((1, 3, 6, 1, 4, 1, 6141, 2, 32, 3, 2)) wwpCommunityTable = MibTable((1, 3, 6, 1, 4, 1, 6141, 2, 32, 1, 1, 1), ) if mibBuilder.loadTexts: wwpCommunityTable.setStatus('current') wwpCommunityEntry = MibTableRow((1, 3, 6, 1, 4, 1, 6141, 2, 32, 1, 1, 1, 1), ).setIndexNames((0, "WWP-COMMUNITY-MIB", "wwpCommunityName"), (0, "WWP-COMMUNITY-MIB", "wwpCommunityIpAddress")) if mibBuilder.loadTexts: wwpCommunityEntry.setStatus('current') wwpCommunityName = MibTableColumn((1, 3, 6, 1, 4, 1, 6141, 2, 32, 1, 1, 1, 1, 1), OctetString().subtype(subtypeSpec=ValueSizeConstraint(0, 64))).setMaxAccess("readonly") if mibBuilder.loadTexts: wwpCommunityName.setStatus('current') wwpCommunityIpAddress = MibTableColumn((1, 3, 6, 1, 4, 1, 6141, 2, 32, 1, 1, 1, 1, 2), IpAddress()).setMaxAccess("readonly") if mibBuilder.loadTexts: wwpCommunityIpAddress.setStatus('current') wwpCommunityRights = MibTableColumn((1, 3, 6, 1, 4, 1, 6141, 2, 32, 1, 1, 1, 1, 3), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2))).clone(namedValues=NamedValues(("readOnly", 1), ("readWrite", 2)))).setMaxAccess("readwrite") if mibBuilder.loadTexts: wwpCommunityRights.setStatus('current') wwpCommunityStatus = MibTableColumn((1, 3, 6, 1, 4, 1, 6141, 2, 32, 1, 1, 1, 1, 4), RowStatus()).setMaxAccess("readcreate") if mibBuilder.loadTexts: wwpCommunityStatus.setStatus('current') wwpNotifCommunityTable = MibTable((1, 3, 6, 1, 4, 1, 6141, 2, 32, 1, 1, 2), ) if mibBuilder.loadTexts: wwpNotifCommunityTable.setStatus('current') wwpNotifCommunityEntry = MibTableRow((1, 3, 6, 1, 4, 1, 6141, 2, 32, 1, 1, 2, 1), ).setIndexNames((0, "WWP-COMMUNITY-MIB", "wwpNotifCommunityName"), (0, "WWP-COMMUNITY-MIB", "wwpNotifCommunityDestAddr")) if mibBuilder.loadTexts: wwpNotifCommunityEntry.setStatus('current') wwpNotifCommunityName = MibTableColumn((1, 3, 6, 1, 4, 1, 6141, 2, 32, 1, 1, 2, 1, 1), OctetString().subtype(subtypeSpec=ValueSizeConstraint(0, 64))).setMaxAccess("readonly") if mibBuilder.loadTexts: wwpNotifCommunityName.setStatus('current') wwpNotifCommunityDestAddr = MibTableColumn((1, 3, 6, 1, 4, 1, 6141, 2, 32, 1, 1, 2, 1, 2), IpAddress()).setMaxAccess("readonly") if mibBuilder.loadTexts: wwpNotifCommunityDestAddr.setStatus('current') wwpNotifCommunityStatus = MibTableColumn((1, 3, 6, 1, 4, 1, 6141, 2, 32, 1, 1, 2, 1, 3), RowStatus()).setMaxAccess("readcreate") if mibBuilder.loadTexts: wwpNotifCommunityStatus.setStatus('current') wwpCommunityPersist = MibScalar((1, 3, 6, 1, 4, 1, 6141, 2, 32, 1, 1, 3), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(0, 1))).clone(namedValues=NamedValues(("none", 0), ("persist", 1)))).setMaxAccess("readwrite") if mibBuilder.loadTexts: wwpCommunityPersist.setStatus('current') mibBuilder.exportSymbols("WWP-COMMUNITY-MIB", wwpCommunityMIBCompliances=wwpCommunityMIBCompliances, wwpCommunityIpAddress=wwpCommunityIpAddress, wwpCommunity=wwpCommunity, wwpCommunityTable=wwpCommunityTable, wwpCommunityMIBConformance=wwpCommunityMIBConformance, wwpCommunityStatus=wwpCommunityStatus, wwpNotifCommunityName=wwpNotifCommunityName, wwpCommunityMIBNotificationPrefix=wwpCommunityMIBNotificationPrefix, wwpNotifCommunityTable=wwpNotifCommunityTable, wwpNotifCommunityEntry=wwpNotifCommunityEntry, wwpCommunityMIBGroups=wwpCommunityMIBGroups, PYSNMP_MODULE_ID=wwpCommunityMIB, wwpNotifCommunityDestAddr=wwpNotifCommunityDestAddr, wwpCommunityEntry=wwpCommunityEntry, wwpCommunityMIB=wwpCommunityMIB, wwpCommunityName=wwpCommunityName, wwpCommunityMIBObjects=wwpCommunityMIBObjects, wwpNotifCommunityStatus=wwpNotifCommunityStatus, wwpCommunityPersist=wwpCommunityPersist, wwpCommunityMIBNotifications=wwpCommunityMIBNotifications, wwpCommunityRights=wwpCommunityRights)
(object_identifier, integer, octet_string) = mibBuilder.importSymbols('ASN1', 'ObjectIdentifier', 'Integer', 'OctetString') (named_values,) = mibBuilder.importSymbols('ASN1-ENUMERATION', 'NamedValues') (constraints_union, value_range_constraint, single_value_constraint, value_size_constraint, constraints_intersection) = mibBuilder.importSymbols('ASN1-REFINEMENT', 'ConstraintsUnion', 'ValueRangeConstraint', 'SingleValueConstraint', 'ValueSizeConstraint', 'ConstraintsIntersection') (module_compliance, notification_group) = mibBuilder.importSymbols('SNMPv2-CONF', 'ModuleCompliance', 'NotificationGroup') (mib_scalar, mib_table, mib_table_row, mib_table_column, ip_address, gauge32, counter64, object_identity, module_identity, integer32, bits, time_ticks, unsigned32, notification_type, iso, mib_identifier, counter32) = mibBuilder.importSymbols('SNMPv2-SMI', 'MibScalar', 'MibTable', 'MibTableRow', 'MibTableColumn', 'IpAddress', 'Gauge32', 'Counter64', 'ObjectIdentity', 'ModuleIdentity', 'Integer32', 'Bits', 'TimeTicks', 'Unsigned32', 'NotificationType', 'iso', 'MibIdentifier', 'Counter32') (row_status, textual_convention, display_string) = mibBuilder.importSymbols('SNMPv2-TC', 'RowStatus', 'TextualConvention', 'DisplayString') (wwp_modules,) = mibBuilder.importSymbols('WWP-SMI', 'wwpModules') wwp_community_mib = module_identity((1, 3, 6, 1, 4, 1, 6141, 2, 32)) wwpCommunityMIB.setRevisions(('2001-04-03 17:00',)) if mibBuilder.loadTexts: wwpCommunityMIB.setLastUpdated('200104031700Z') if mibBuilder.loadTexts: wwpCommunityMIB.setOrganization('World Wide Packets, Inc') wwp_community_mib_objects = mib_identifier((1, 3, 6, 1, 4, 1, 6141, 2, 32, 1)) wwp_community = mib_identifier((1, 3, 6, 1, 4, 1, 6141, 2, 32, 1, 1)) wwp_community_mib_notification_prefix = mib_identifier((1, 3, 6, 1, 4, 1, 6141, 2, 32, 2)) wwp_community_mib_notifications = mib_identifier((1, 3, 6, 1, 4, 1, 6141, 2, 32, 2, 0)) wwp_community_mib_conformance = mib_identifier((1, 3, 6, 1, 4, 1, 6141, 2, 32, 3)) wwp_community_mib_compliances = mib_identifier((1, 3, 6, 1, 4, 1, 6141, 2, 32, 3, 1)) wwp_community_mib_groups = mib_identifier((1, 3, 6, 1, 4, 1, 6141, 2, 32, 3, 2)) wwp_community_table = mib_table((1, 3, 6, 1, 4, 1, 6141, 2, 32, 1, 1, 1)) if mibBuilder.loadTexts: wwpCommunityTable.setStatus('current') wwp_community_entry = mib_table_row((1, 3, 6, 1, 4, 1, 6141, 2, 32, 1, 1, 1, 1)).setIndexNames((0, 'WWP-COMMUNITY-MIB', 'wwpCommunityName'), (0, 'WWP-COMMUNITY-MIB', 'wwpCommunityIpAddress')) if mibBuilder.loadTexts: wwpCommunityEntry.setStatus('current') wwp_community_name = mib_table_column((1, 3, 6, 1, 4, 1, 6141, 2, 32, 1, 1, 1, 1, 1), octet_string().subtype(subtypeSpec=value_size_constraint(0, 64))).setMaxAccess('readonly') if mibBuilder.loadTexts: wwpCommunityName.setStatus('current') wwp_community_ip_address = mib_table_column((1, 3, 6, 1, 4, 1, 6141, 2, 32, 1, 1, 1, 1, 2), ip_address()).setMaxAccess('readonly') if mibBuilder.loadTexts: wwpCommunityIpAddress.setStatus('current') wwp_community_rights = mib_table_column((1, 3, 6, 1, 4, 1, 6141, 2, 32, 1, 1, 1, 1, 3), integer32().subtype(subtypeSpec=constraints_union(single_value_constraint(1, 2))).clone(namedValues=named_values(('readOnly', 1), ('readWrite', 2)))).setMaxAccess('readwrite') if mibBuilder.loadTexts: wwpCommunityRights.setStatus('current') wwp_community_status = mib_table_column((1, 3, 6, 1, 4, 1, 6141, 2, 32, 1, 1, 1, 1, 4), row_status()).setMaxAccess('readcreate') if mibBuilder.loadTexts: wwpCommunityStatus.setStatus('current') wwp_notif_community_table = mib_table((1, 3, 6, 1, 4, 1, 6141, 2, 32, 1, 1, 2)) if mibBuilder.loadTexts: wwpNotifCommunityTable.setStatus('current') wwp_notif_community_entry = mib_table_row((1, 3, 6, 1, 4, 1, 6141, 2, 32, 1, 1, 2, 1)).setIndexNames((0, 'WWP-COMMUNITY-MIB', 'wwpNotifCommunityName'), (0, 'WWP-COMMUNITY-MIB', 'wwpNotifCommunityDestAddr')) if mibBuilder.loadTexts: wwpNotifCommunityEntry.setStatus('current') wwp_notif_community_name = mib_table_column((1, 3, 6, 1, 4, 1, 6141, 2, 32, 1, 1, 2, 1, 1), octet_string().subtype(subtypeSpec=value_size_constraint(0, 64))).setMaxAccess('readonly') if mibBuilder.loadTexts: wwpNotifCommunityName.setStatus('current') wwp_notif_community_dest_addr = mib_table_column((1, 3, 6, 1, 4, 1, 6141, 2, 32, 1, 1, 2, 1, 2), ip_address()).setMaxAccess('readonly') if mibBuilder.loadTexts: wwpNotifCommunityDestAddr.setStatus('current') wwp_notif_community_status = mib_table_column((1, 3, 6, 1, 4, 1, 6141, 2, 32, 1, 1, 2, 1, 3), row_status()).setMaxAccess('readcreate') if mibBuilder.loadTexts: wwpNotifCommunityStatus.setStatus('current') wwp_community_persist = mib_scalar((1, 3, 6, 1, 4, 1, 6141, 2, 32, 1, 1, 3), integer32().subtype(subtypeSpec=constraints_union(single_value_constraint(0, 1))).clone(namedValues=named_values(('none', 0), ('persist', 1)))).setMaxAccess('readwrite') if mibBuilder.loadTexts: wwpCommunityPersist.setStatus('current') mibBuilder.exportSymbols('WWP-COMMUNITY-MIB', wwpCommunityMIBCompliances=wwpCommunityMIBCompliances, wwpCommunityIpAddress=wwpCommunityIpAddress, wwpCommunity=wwpCommunity, wwpCommunityTable=wwpCommunityTable, wwpCommunityMIBConformance=wwpCommunityMIBConformance, wwpCommunityStatus=wwpCommunityStatus, wwpNotifCommunityName=wwpNotifCommunityName, wwpCommunityMIBNotificationPrefix=wwpCommunityMIBNotificationPrefix, wwpNotifCommunityTable=wwpNotifCommunityTable, wwpNotifCommunityEntry=wwpNotifCommunityEntry, wwpCommunityMIBGroups=wwpCommunityMIBGroups, PYSNMP_MODULE_ID=wwpCommunityMIB, wwpNotifCommunityDestAddr=wwpNotifCommunityDestAddr, wwpCommunityEntry=wwpCommunityEntry, wwpCommunityMIB=wwpCommunityMIB, wwpCommunityName=wwpCommunityName, wwpCommunityMIBObjects=wwpCommunityMIBObjects, wwpNotifCommunityStatus=wwpNotifCommunityStatus, wwpCommunityPersist=wwpCommunityPersist, wwpCommunityMIBNotifications=wwpCommunityMIBNotifications, wwpCommunityRights=wwpCommunityRights)
class Solution: def XXX(self, nums: List[int]) -> List[List[int]]: return [[n] + sub for i, n in enumerate(nums) for sub in self.XXX(nums[:i] + nums[i+1:])] or [nums]
class Solution: def xxx(self, nums: List[int]) -> List[List[int]]: return [[n] + sub for (i, n) in enumerate(nums) for sub in self.XXX(nums[:i] + nums[i + 1:])] or [nums]
''' Created on Nov 6, 2013 @author: agreen This module is used by the cubing_tests module as a data store. ''' enabled = True class DAR: xfibre_pos = False yfibre_pos = False
""" Created on Nov 6, 2013 @author: agreen This module is used by the cubing_tests module as a data store. """ enabled = True class Dar: xfibre_pos = False yfibre_pos = False
class Field(object): def __init__(self, name=None, default=None, data_type=None): self.name = name self.default = default self.required = self.default is None self.type = data_type def build(self): result = {key: value for key, value in self.__dict__.items() if value is not None} if self.name is not None: del result["name"] result = {self.name: result} return result class MultiField(object): def __init__(self, fields, name=None): self.fields = fields self.name = name def build(self): result = {} for i in self.fields: result.update(i.build()) if self.name is None: return result else: return {self.name: result} class TypeField(Field): data_type = None def __init__(self, name=None, default=None): super().__init__(name=name, default=default, data_type=self.data_type) class IntegerField(TypeField): data_type = "integer" class FloatField(TypeField): data_type = "float" class StringField(TypeField): data_type = "string" class BooleanField(TypeField): data_type = "boolean" class ListField(object): def __init__(self, name, field=None): self.name = name if field is None: self.field = StringField() else: self.field = field def build(self): return {self.name: [self.field.build()]}
class Field(object): def __init__(self, name=None, default=None, data_type=None): self.name = name self.default = default self.required = self.default is None self.type = data_type def build(self): result = {key: value for (key, value) in self.__dict__.items() if value is not None} if self.name is not None: del result['name'] result = {self.name: result} return result class Multifield(object): def __init__(self, fields, name=None): self.fields = fields self.name = name def build(self): result = {} for i in self.fields: result.update(i.build()) if self.name is None: return result else: return {self.name: result} class Typefield(Field): data_type = None def __init__(self, name=None, default=None): super().__init__(name=name, default=default, data_type=self.data_type) class Integerfield(TypeField): data_type = 'integer' class Floatfield(TypeField): data_type = 'float' class Stringfield(TypeField): data_type = 'string' class Booleanfield(TypeField): data_type = 'boolean' class Listfield(object): def __init__(self, name, field=None): self.name = name if field is None: self.field = string_field() else: self.field = field def build(self): return {self.name: [self.field.build()]}
COLORS = dict([ ('CLEANUP', '\033[94m'), ('CREATE', '\033[92m'), ('INSTALL', '\033[92m'), ('SKIP', '\033[93m'), ('FAIL', '\033[31m'), ('DEFAULT', '\033[39m'), ('UNDEFINED', '\033[37m'), ('STATUS', '\033[36m') ]) def typed_message(message, message_type=None): color = COLORS.setdefault(message_type, COLORS['UNDEFINED']) tagged_type = "%s[%s] ..." % (color, message_type) print("%26s %s %s" % (tagged_type, COLORS['DEFAULT'], message))
colors = dict([('CLEANUP', '\x1b[94m'), ('CREATE', '\x1b[92m'), ('INSTALL', '\x1b[92m'), ('SKIP', '\x1b[93m'), ('FAIL', '\x1b[31m'), ('DEFAULT', '\x1b[39m'), ('UNDEFINED', '\x1b[37m'), ('STATUS', '\x1b[36m')]) def typed_message(message, message_type=None): color = COLORS.setdefault(message_type, COLORS['UNDEFINED']) tagged_type = '%s[%s] ...' % (color, message_type) print('%26s %s %s' % (tagged_type, COLORS['DEFAULT'], message))
class Solution: def reverse(self, x: int) -> int: rev = 0 y = abs(x) while y: rev = rev*10 + y % 10 y //= 10 sign = -1 if x < 0 else 1 if(rev > 0x7fffffff): return 0 return sign * rev
class Solution: def reverse(self, x: int) -> int: rev = 0 y = abs(x) while y: rev = rev * 10 + y % 10 y //= 10 sign = -1 if x < 0 else 1 if rev > 2147483647: return 0 return sign * rev
# device present global variables DS3231_Present = False BMP280_Present = False AM2315_Present = False ADS1015_Present = False ADS1115_Present = False
ds3231__present = False bmp280__present = False am2315__present = False ads1015__present = False ads1115__present = False
ObjectId = int class Object: def __init__(self, id_): self.id: ObjectId = id_ self.count = 1 self.neighbors = {self} @property def neighbor_count(self): return sum([neighbor.count for neighbor in self.neighbors]) def __repr__(self): return f'{self.id}_'
object_id = int class Object: def __init__(self, id_): self.id: ObjectId = id_ self.count = 1 self.neighbors = {self} @property def neighbor_count(self): return sum([neighbor.count for neighbor in self.neighbors]) def __repr__(self): return f'{self.id}_'
# Linear search algorithm # @ra1ski def linear_search(item, _list): index = None for idx, val in enumerate(_list): if val == item: index = idx break return index if __name__ == '__main__': _list = ['chrome', 'firefox', 'opera', 'ie', 'netscape'] item = input('Type browser name:') foundIndex = linear_search(item, _list) if foundIndex is not None: print('Item is in the list. Index: %d. Iterations: %d' % (foundIndex, foundIndex)) else: _list.append(item) print('Item is not in the list, but we appened it for you', _list)
def linear_search(item, _list): index = None for (idx, val) in enumerate(_list): if val == item: index = idx break return index if __name__ == '__main__': _list = ['chrome', 'firefox', 'opera', 'ie', 'netscape'] item = input('Type browser name:') found_index = linear_search(item, _list) if foundIndex is not None: print('Item is in the list. Index: %d. Iterations: %d' % (foundIndex, foundIndex)) else: _list.append(item) print('Item is not in the list, but we appened it for you', _list)
city = input("Enter the name of the city: ") sales = float(input("Enter the percentage of sales: ")) commission = 0 if 0 <= sales <= 500: if city == "Sofia": commission = 0.05 elif city == "Varna": commission == 0.045 elif city == "Plovdiv": commission == 0.055 elif 500 < sales <= 1000: if city == "Sofia": commission = 0.07 elif city == "Varna": commission == 0.075 elif city == "Plovdiv": commission == 0.08 elif 1000 < sales <= 10000: if city == "Sofia": commission = 0.08 elif city == "Varna": commission == 0.1 elif city == "Plovdiv": commission == 0.12 elif sales > 10000: if city == "Sofia": commission = 0.12 elif city == "Varna": commission == 0.13 elif city == "Plovdiv": commission == 0.145 if commission == 0: print("error") else: total_sum = sales * commission print(f"{total_sum:.2f}")
city = input('Enter the name of the city: ') sales = float(input('Enter the percentage of sales: ')) commission = 0 if 0 <= sales <= 500: if city == 'Sofia': commission = 0.05 elif city == 'Varna': commission == 0.045 elif city == 'Plovdiv': commission == 0.055 elif 500 < sales <= 1000: if city == 'Sofia': commission = 0.07 elif city == 'Varna': commission == 0.075 elif city == 'Plovdiv': commission == 0.08 elif 1000 < sales <= 10000: if city == 'Sofia': commission = 0.08 elif city == 'Varna': commission == 0.1 elif city == 'Plovdiv': commission == 0.12 elif sales > 10000: if city == 'Sofia': commission = 0.12 elif city == 'Varna': commission == 0.13 elif city == 'Plovdiv': commission == 0.145 if commission == 0: print('error') else: total_sum = sales * commission print(f'{total_sum:.2f}')
def get_dotted_mask_split(ip_address_mask_cidr): p = int(ip_address_mask_cidr) ip_address_mask_dotted_split = [] for i in range(4): if p >= 0: if p - 8 >= 0: ip_address_mask_dotted_split.append('255') p -= 8 else: byte = 256 - pow(2, 8 - p) byte_str = str(byte) ip_address_mask_dotted_split.append(byte_str) p -= 8 else: ip_address_mask_dotted_split.append('0') return ip_address_mask_dotted_split
def get_dotted_mask_split(ip_address_mask_cidr): p = int(ip_address_mask_cidr) ip_address_mask_dotted_split = [] for i in range(4): if p >= 0: if p - 8 >= 0: ip_address_mask_dotted_split.append('255') p -= 8 else: byte = 256 - pow(2, 8 - p) byte_str = str(byte) ip_address_mask_dotted_split.append(byte_str) p -= 8 else: ip_address_mask_dotted_split.append('0') return ip_address_mask_dotted_split
#!/usr/bin/python class Node: def __init__(self, value): self.left = None self.right = None self.value = value class Tree: def __init__(self): self.root = None @property def root_node(self): return self.root def add(self, value): if self.root is None: self.root = Node(value) else: self._add(value, self.root) def _add(self, value, node): if value < node.value: if node.left is not None: self._add(value, node.left) else: node.left = Node(value) else: if node.right is not None: self._add(value, node.right) else: node.right = Node(value) def find(self, value): if self.root is not None: return self._find(value, self.root) else: return None def _find(self, value, node): if value == node.value: return node elif value < node.value and node.left is not None: self._find(value, node.left) elif value > node.value and node.right is not None: self._find(value, node.right) def rebalance_tree(self): if self.root is None: return tree_list = self.get_tree_values() new_tree = Tree() self._rebalance_tree(tree_list, new_tree) self.root = new_tree.root def _rebalance_tree(self, tree_list, new_tree): # find the middle. if len(tree_list) == 0: return tree_middle = int(len(tree_list) / 2) print("Tree list : {}, Tree middle: {}".format(tree_list, tree_middle)) new_tree.add(tree_list[tree_middle - 1]) new_tree.add(tree_list[tree_middle]) new_tree.print_tree() # make 2 lists, one for left and right. if len(tree_list) <= 2: return tree_list_left = tree_list[0:tree_middle - 1] tree_list_right = tree_list[tree_middle:len(tree_list) + 1] self._rebalance_tree(tree_list_left, new_tree) self._rebalance_tree(tree_list_right, new_tree) def compare_tree(self, tree_to_compare): if self.root is None and tree_to_compare.root is None: return True return self._compare_tree(self.root, tree_to_compare.root) def _compare_tree(self, node1, node2): if self._compare_node(node1, node2) is False: return False if node1.right: if self._compare_tree(node1.right, node2.right) is False: return False if node1.left: if self._compare_tree(node1.left, node2.left) is False: return False return True @staticmethod def _compare_node(node1, node2): if node1 is None and node2 is None: return True if node1 is None or node2 is None: return False if node1.value != node2.value: return False if (node1.right is None) != (node2.right is None): return False if (node1.left is None) != (node2.left is None): return False return True def delete_tree(self): # garbage collector will do this for us. self.root = None def print_tree(self): if self.root is not None: tree_values = self.get_tree_values() print("Tree: {}".format(tree_values)) else: print("Tree is empty") def get_tree_values(self): tree_list = [] if self.root is not None: self._get_tree_values(self.root, tree_list) return tree_list def _get_tree_values(self, node, tree_list): if node is not None: self._get_tree_values(node.left, tree_list) tree_list.append(node.value) self._get_tree_values(node.right, tree_list)
class Node: def __init__(self, value): self.left = None self.right = None self.value = value class Tree: def __init__(self): self.root = None @property def root_node(self): return self.root def add(self, value): if self.root is None: self.root = node(value) else: self._add(value, self.root) def _add(self, value, node): if value < node.value: if node.left is not None: self._add(value, node.left) else: node.left = node(value) elif node.right is not None: self._add(value, node.right) else: node.right = node(value) def find(self, value): if self.root is not None: return self._find(value, self.root) else: return None def _find(self, value, node): if value == node.value: return node elif value < node.value and node.left is not None: self._find(value, node.left) elif value > node.value and node.right is not None: self._find(value, node.right) def rebalance_tree(self): if self.root is None: return tree_list = self.get_tree_values() new_tree = tree() self._rebalance_tree(tree_list, new_tree) self.root = new_tree.root def _rebalance_tree(self, tree_list, new_tree): if len(tree_list) == 0: return tree_middle = int(len(tree_list) / 2) print('Tree list : {}, Tree middle: {}'.format(tree_list, tree_middle)) new_tree.add(tree_list[tree_middle - 1]) new_tree.add(tree_list[tree_middle]) new_tree.print_tree() if len(tree_list) <= 2: return tree_list_left = tree_list[0:tree_middle - 1] tree_list_right = tree_list[tree_middle:len(tree_list) + 1] self._rebalance_tree(tree_list_left, new_tree) self._rebalance_tree(tree_list_right, new_tree) def compare_tree(self, tree_to_compare): if self.root is None and tree_to_compare.root is None: return True return self._compare_tree(self.root, tree_to_compare.root) def _compare_tree(self, node1, node2): if self._compare_node(node1, node2) is False: return False if node1.right: if self._compare_tree(node1.right, node2.right) is False: return False if node1.left: if self._compare_tree(node1.left, node2.left) is False: return False return True @staticmethod def _compare_node(node1, node2): if node1 is None and node2 is None: return True if node1 is None or node2 is None: return False if node1.value != node2.value: return False if (node1.right is None) != (node2.right is None): return False if (node1.left is None) != (node2.left is None): return False return True def delete_tree(self): self.root = None def print_tree(self): if self.root is not None: tree_values = self.get_tree_values() print('Tree: {}'.format(tree_values)) else: print('Tree is empty') def get_tree_values(self): tree_list = [] if self.root is not None: self._get_tree_values(self.root, tree_list) return tree_list def _get_tree_values(self, node, tree_list): if node is not None: self._get_tree_values(node.left, tree_list) tree_list.append(node.value) self._get_tree_values(node.right, tree_list)
#Conor O'Riordan # Write a program that asks the user to input any positive integer and outputs the successive values of the following calculation. # At each step calculate the next value by taking the current value and # if it is even, divide it by two, but if it is odd, multiply it by three and add one. # Have the program end if the current value is one. #Version includes print text to describe number input #Version includes print text to describe number output #Enter positive number pos_int = int(input("Please enter a positive integer:")) #While Loop #If Statement to calculate based on Odd or Even Number while pos_int > 1: if pos_int % 2 == 0: print(round(pos_int),"is even so divide by two. This gives:",round(pos_int/2)) pos_int = pos_int/2 else: print(round(pos_int),"is odd so multiply by three and add one. This gives:",round((pos_int*3)+1)) pos_int = (pos_int*3)+1 #Prints when program completes print("We have now reached",round(pos_int),"!!!! Programme completed") #Version with print text
pos_int = int(input('Please enter a positive integer:')) while pos_int > 1: if pos_int % 2 == 0: print(round(pos_int), 'is even so divide by two. This gives:', round(pos_int / 2)) pos_int = pos_int / 2 else: print(round(pos_int), 'is odd so multiply by three and add one. This gives:', round(pos_int * 3 + 1)) pos_int = pos_int * 3 + 1 print('We have now reached', round(pos_int), '!!!! Programme completed')
#!/usr/bin/python3 # https://practice.geeksforgeeks.org/problems/odd-even-level-difference/1 def getLevelDiff(root): h = {0: 0, 1: 0} level = 0 populateDiff(root, level, h) return h[0]-h[1] def populateDiff(root, level, h): if root == None: return l = level%2 h[l] += root.data populateDiff(root.left, level+1, h) populateDiff(root.right, level+1, h)
def get_level_diff(root): h = {0: 0, 1: 0} level = 0 populate_diff(root, level, h) return h[0] - h[1] def populate_diff(root, level, h): if root == None: return l = level % 2 h[l] += root.data populate_diff(root.left, level + 1, h) populate_diff(root.right, level + 1, h)
# # PySNMP MIB module Vsm-MIB (http://snmplabs.com/pysmi) # ASN.1 source file:///Users/davwang4/Dev/mibs.snmplabs.com/asn1/Vsm-MIB # Produced by pysmi-0.3.4 at Wed May 1 15:35:46 2019 # On host DAVWANG4-M-1475 platform Darwin version 18.5.0 by user davwang4 # Using Python version 3.7.3 (default, Mar 27 2019, 09:23:15) # ObjectIdentifier, OctetString, Integer = mibBuilder.importSymbols("ASN1", "ObjectIdentifier", "OctetString", "Integer") NamedValues, = mibBuilder.importSymbols("ASN1-ENUMERATION", "NamedValues") SingleValueConstraint, ConstraintsIntersection, ValueSizeConstraint, ConstraintsUnion, ValueRangeConstraint = mibBuilder.importSymbols("ASN1-REFINEMENT", "SingleValueConstraint", "ConstraintsIntersection", "ValueSizeConstraint", "ConstraintsUnion", "ValueRangeConstraint") dv2, = mibBuilder.importSymbols("DV2-MIB", "dv2") ModuleCompliance, NotificationGroup = mibBuilder.importSymbols("SNMPv2-CONF", "ModuleCompliance", "NotificationGroup") iso, NotificationType, Unsigned32, MibIdentifier, MibScalar, MibTable, MibTableRow, MibTableColumn, Integer32, ModuleIdentity, Gauge32, TimeTicks, ObjectIdentity, Bits, IpAddress, Counter64, Counter32 = mibBuilder.importSymbols("SNMPv2-SMI", "iso", "NotificationType", "Unsigned32", "MibIdentifier", "MibScalar", "MibTable", "MibTableRow", "MibTableColumn", "Integer32", "ModuleIdentity", "Gauge32", "TimeTicks", "ObjectIdentity", "Bits", "IpAddress", "Counter64", "Counter32") TextualConvention, DisplayString = mibBuilder.importSymbols("SNMPv2-TC", "TextualConvention", "DisplayString") dv2Vsm = MibIdentifier((1, 3, 6, 1, 4, 1, 251, 1, 1, 47)) class VciInteger(Integer32): subtypeSpec = Integer32.subtypeSpec + ValueRangeConstraint(0, 65535) class VpiInteger(Integer32): subtypeSpec = Integer32.subtypeSpec + ValueRangeConstraint(0, 255) class VsmBundle(Integer32): subtypeSpec = Integer32.subtypeSpec + ValueRangeConstraint(1, 127) vsmCardCfgTable = MibTable((1, 3, 6, 1, 4, 1, 251, 1, 1, 47, 1), ) if mibBuilder.loadTexts: vsmCardCfgTable.setStatus('mandatory') if mibBuilder.loadTexts: vsmCardCfgTable.setDescription('The VSM card configuration table.') vsmCardCfgTableEntry = MibTableRow((1, 3, 6, 1, 4, 1, 251, 1, 1, 47, 1, 1), ).setIndexNames((0, "Vsm-MIB", "vsmCardCfgIndex")) if mibBuilder.loadTexts: vsmCardCfgTableEntry.setStatus('mandatory') vsmCardCfgIndex = MibTableColumn((1, 3, 6, 1, 4, 1, 251, 1, 1, 47, 1, 1, 1), Integer32().subtype(subtypeSpec=ValueRangeConstraint(0, 0))).setMaxAccess("readonly") if mibBuilder.loadTexts: vsmCardCfgIndex.setStatus('mandatory') if mibBuilder.loadTexts: vsmCardCfgIndex.setDescription('Index for VSM Card Cfg Table') vsmCardCfgBndlTslotStatus = MibTableColumn((1, 3, 6, 1, 4, 1, 251, 1, 1, 47, 1, 1, 2), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2))).clone(namedValues=NamedValues(("enabled", 1), ("disabled", 2))).clone('enabled')).setMaxAccess("readonly") if mibBuilder.loadTexts: vsmCardCfgBndlTslotStatus.setStatus('mandatory') if mibBuilder.loadTexts: vsmCardCfgBndlTslotStatus.setDescription('Enables the collection of Bundle and Timeslot status') vsmLinkTable = MibTable((1, 3, 6, 1, 4, 1, 251, 1, 1, 47, 2), ) if mibBuilder.loadTexts: vsmLinkTable.setStatus('mandatory') if mibBuilder.loadTexts: vsmLinkTable.setDescription('Table for VSM Link configuration') vsmLinkEntry = MibTableRow((1, 3, 6, 1, 4, 1, 251, 1, 1, 47, 2, 1), ).setIndexNames((0, "Vsm-MIB", "vsmLinkLink")) if mibBuilder.loadTexts: vsmLinkEntry.setStatus('mandatory') vsmLinkLink = MibTableColumn((1, 3, 6, 1, 4, 1, 251, 1, 1, 47, 2, 1, 1), Integer32().subtype(subtypeSpec=ValueRangeConstraint(0, 3))).setMaxAccess("readonly") if mibBuilder.loadTexts: vsmLinkLink.setStatus('mandatory') if mibBuilder.loadTexts: vsmLinkLink.setDescription('Link Number for Table Entry') vsmLinkEnable = MibTableColumn((1, 3, 6, 1, 4, 1, 251, 1, 1, 47, 2, 1, 2), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(2, 1))).clone(namedValues=NamedValues(("disabled", 2), ("enabled", 1))).clone('disabled')).setMaxAccess("readwrite") if mibBuilder.loadTexts: vsmLinkEnable.setStatus('mandatory') if mibBuilder.loadTexts: vsmLinkEnable.setDescription("Enable/Disable Link <DETAIL_DESCRIPTION> The user has the ability to enable or disable each of the LIM's links individually.") vsmLinkEnableStat = MibTableColumn((1, 3, 6, 1, 4, 1, 251, 1, 1, 47, 2, 1, 3), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(2, 1, 3, 4, 5, 6, 7, 8))).clone(namedValues=NamedValues(("disabled", 2), ("enabled", 1), ("wait-for-valid-lim", 3), ("link-not-used", 4), ("error", 5), ("wait-signaling-lim", 6), ("wait-lim-framing", 7), ("wait-frame-bit", 8))).clone('disabled')).setMaxAccess("readonly") if mibBuilder.loadTexts: vsmLinkEnableStat.setStatus('mandatory') if mibBuilder.loadTexts: vsmLinkEnableStat.setDescription('Link Enable Status <DETAIL_DESCRIPTION> The current status of link depends on a valid lim type, the availability of a link on the LIM and LIM Configuration.') vsmLinkSigType = MibTableColumn((1, 3, 6, 1, 4, 1, 251, 1, 1, 47, 2, 1, 4), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(2, 1))).clone(namedValues=NamedValues(("cas", 2), ("none", 1))).clone('cas')).setMaxAccess("readwrite") if mibBuilder.loadTexts: vsmLinkSigType.setStatus('mandatory') if mibBuilder.loadTexts: vsmLinkSigType.setDescription("Enable/Disable Signalling <DETAIL_DESCRIPTION> The user has the ability to enable or disable signalling for each of the LIM's links individually.") vsmTsCfgTable = MibTable((1, 3, 6, 1, 4, 1, 251, 1, 1, 47, 3), ) if mibBuilder.loadTexts: vsmTsCfgTable.setStatus('mandatory') if mibBuilder.loadTexts: vsmTsCfgTable.setDescription('The timeslot configuration table.') vsmTsCfgTableEntry = MibTableRow((1, 3, 6, 1, 4, 1, 251, 1, 1, 47, 3, 1), ).setIndexNames((0, "Vsm-MIB", "vsmTsCfgLinkNo"), (0, "Vsm-MIB", "vsmTsCfgTsNo")) if mibBuilder.loadTexts: vsmTsCfgTableEntry.setStatus('mandatory') vsmTsCfgLinkNo = MibTableColumn((1, 3, 6, 1, 4, 1, 251, 1, 1, 47, 3, 1, 1), Integer32().subtype(subtypeSpec=ValueRangeConstraint(0, 3))).setMaxAccess("readwrite") if mibBuilder.loadTexts: vsmTsCfgLinkNo.setStatus('mandatory') if mibBuilder.loadTexts: vsmTsCfgLinkNo.setDescription('The link number.') vsmTsCfgTsNo = MibTableColumn((1, 3, 6, 1, 4, 1, 251, 1, 1, 47, 3, 1, 2), Integer32().subtype(subtypeSpec=ValueRangeConstraint(0, 31))).setMaxAccess("readwrite") if mibBuilder.loadTexts: vsmTsCfgTsNo.setStatus('mandatory') if mibBuilder.loadTexts: vsmTsCfgTsNo.setDescription('The timeslot number of the link.') vsmTsCfgBundleNo = MibTableColumn((1, 3, 6, 1, 4, 1, 251, 1, 1, 47, 3, 1, 3), VsmBundle().clone(1)).setMaxAccess("readwrite") if mibBuilder.loadTexts: vsmTsCfgBundleNo.setStatus('mandatory') if mibBuilder.loadTexts: vsmTsCfgBundleNo.setDescription('The Bundle mapped to this timeslot.') vsmTsCfgAALTyp = MibTableColumn((1, 3, 6, 1, 4, 1, 251, 1, 1, 47, 3, 1, 4), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(2, 1))).clone(namedValues=NamedValues(("aal2", 2), ("aal1", 1))).clone('aal2')).setMaxAccess("readwrite") if mibBuilder.loadTexts: vsmTsCfgAALTyp.setStatus('mandatory') if mibBuilder.loadTexts: vsmTsCfgAALTyp.setDescription('AAL type used for timeslot. This must match the AAL type used by the bundle to which this timeslot is assigned.') vsmTsCfgChanID = MibTableColumn((1, 3, 6, 1, 4, 1, 251, 1, 1, 47, 3, 1, 5), Integer32().subtype(subtypeSpec=ValueRangeConstraint(8, 255)).clone(8)).setMaxAccess("readwrite") if mibBuilder.loadTexts: vsmTsCfgChanID.setStatus('mandatory') if mibBuilder.loadTexts: vsmTsCfgChanID.setDescription('The Channel ID (CID) this TS is mapped to. The CID must be unique across AAL2 VCs of an end-to-end connection. AAL2 only. ') vsmTsCfgCmprssionTyp = MibTableColumn((1, 3, 6, 1, 4, 1, 251, 1, 1, 47, 3, 1, 6), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(2, 1))).clone(namedValues=NamedValues(("adpcmG726-32k", 2), ("none", 1))).clone('adpcmG726-32k')).setMaxAccess("readwrite") if mibBuilder.loadTexts: vsmTsCfgCmprssionTyp.setStatus('mandatory') if mibBuilder.loadTexts: vsmTsCfgCmprssionTyp.setDescription('The voice compression algorithm being used for the timeslot. AAL2 only.') vsmTsCfgFaxMdmHndlng = MibTableColumn((1, 3, 6, 1, 4, 1, 251, 1, 1, 47, 3, 1, 7), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(2, 1))).clone(namedValues=NamedValues(("auto-disable", 2), ("always-compress", 1))).clone('auto-disable')).setMaxAccess("readwrite") if mibBuilder.loadTexts: vsmTsCfgFaxMdmHndlng.setStatus('mandatory') if mibBuilder.loadTexts: vsmTsCfgFaxMdmHndlng.setDescription('The option to handle Fax/Modem signal. AAL2 only. pass-through: make no change when tone is detected, if compressing then keep compressing.bypass: If compressing and tone detected, attempt to switch to uncompressed') vsmTsCfgEchoCancel = MibTableColumn((1, 3, 6, 1, 4, 1, 251, 1, 1, 47, 3, 1, 8), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(3, 1, 2))).clone(namedValues=NamedValues(("auto-disable", 3), ("enable", 1), ("disable", 2))).clone('auto-disable')).setMaxAccess("readwrite") if mibBuilder.loadTexts: vsmTsCfgEchoCancel.setStatus('mandatory') if mibBuilder.loadTexts: vsmTsCfgEchoCancel.setDescription('Indicate whether echo cancellation is enabled.') vsmTsCfgSilenceRmvl = MibTableColumn((1, 3, 6, 1, 4, 1, 251, 1, 1, 47, 3, 1, 9), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(3, 1, 2))).clone(namedValues=NamedValues(("auto-disable", 3), ("enable", 1), ("disable", 2))).clone('auto-disable')).setMaxAccess("readwrite") if mibBuilder.loadTexts: vsmTsCfgSilenceRmvl.setStatus('mandatory') if mibBuilder.loadTexts: vsmTsCfgSilenceRmvl.setDescription('Allows for the configuration of silence removal. Auto will disable silence removal when a FAX/modem tone is detected. AAL2 only.') vsmTsCfgIdleDetect = MibTableColumn((1, 3, 6, 1, 4, 1, 251, 1, 1, 47, 3, 1, 10), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2))).clone(namedValues=NamedValues(("enable", 1), ("disable", 2))).clone('enable')).setMaxAccess("readwrite") if mibBuilder.loadTexts: vsmTsCfgIdleDetect.setStatus('mandatory') if mibBuilder.loadTexts: vsmTsCfgIdleDetect.setDescription('Indicate whether idle channel detection is enabled. If disabled this timeslot will always send cells, even when on hook. AAL2 only.') vsmTsCfgRmtLaw = MibTableColumn((1, 3, 6, 1, 4, 1, 251, 1, 1, 47, 3, 1, 11), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(3, 1, 2))).clone(namedValues=NamedValues(("auto", 3), ("u-law", 1), ("a-law", 2))).clone('auto')).setMaxAccess("readwrite") if mibBuilder.loadTexts: vsmTsCfgRmtLaw.setStatus('mandatory') if mibBuilder.loadTexts: vsmTsCfgRmtLaw.setDescription("Indicates the remote VSM's companding type. u-law for T1, a-law for E1. Auto means use the same type as the local link.") vsmTsCfgSignalTyp = MibTableColumn((1, 3, 6, 1, 4, 1, 251, 1, 1, 47, 3, 1, 12), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(6, 2, 3, 4, 5, 7, 8, 1))).clone(namedValues=NamedValues(("e-and-m", 6), ("gs-fxo-fxs", 2), ("gs-fxs-fxo", 3), ("ls-fxo-fxs", 4), ("ls-fxs-fxo", 5), ("ssr2", 7), ("plar", 8), ("none", 1))).clone('e-and-m')).setMaxAccess("readwrite") if mibBuilder.loadTexts: vsmTsCfgSignalTyp.setStatus('mandatory') if mibBuilder.loadTexts: vsmTsCfgSignalTyp.setDescription('This object specifies the signal type of the timeslot. None is used to turn off signaling to allow for data transport.') vsmTsCfgSigCndTypNB = MibTableColumn((1, 3, 6, 1, 4, 1, 251, 1, 1, 47, 3, 1, 13), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2, 3, 5, 6, 7))).clone(namedValues=NamedValues(("onhook-A0B0", 1), ("onhook-A0B1", 2), ("offhook-A01B01", 3), ("failure-A1B1", 5), ("failure-A10B1", 6), ("failure-A1B1C1D1", 7))).clone('onhook-A0B0')).setMaxAccess("readwrite") if mibBuilder.loadTexts: vsmTsCfgSigCndTypNB.setStatus('mandatory') if mibBuilder.loadTexts: vsmTsCfgSigCndTypNB.setDescription('The object specifies the type of signaling conditioning to narrowband.') vsmTsCfgSigCndTypATM = MibTableColumn((1, 3, 6, 1, 4, 1, 251, 1, 1, 47, 3, 1, 14), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2, 3, 5, 6, 7))).clone(namedValues=NamedValues(("onhook-A0B0", 1), ("onhook-A0B1", 2), ("offhook-A01B01", 3), ("failure-A1B1", 5), ("failure-A10B1", 6), ("failure-A1B1C1D1", 7))).clone('onhook-A0B0')).setMaxAccess("readwrite") if mibBuilder.loadTexts: vsmTsCfgSigCndTypATM.setStatus('mandatory') if mibBuilder.loadTexts: vsmTsCfgSigCndTypATM.setDescription('The object specifies the type of signaling conditioning to ATM.') vsmTsCfgDataCndTypNB = MibTableColumn((1, 3, 6, 1, 4, 1, 251, 1, 1, 47, 3, 1, 15), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(2, 3, 4, 5, 6, 7, 8, 9, 10, 1))).clone(namedValues=NamedValues(("muLaw-0V-7F", 2), ("muLaw-0V-FF", 3), ("aLaw-0V-D5", 4), ("aLaw-0V-54", 5), ("dacs-trbl-E4", 6), ("ctrl-mode-FE", 7), ("cir-oos-36", 8), ("mux-oos-1A", 9), ("user-data-FF", 10), ("none", 1))).clone('muLaw-0V-7F')).setMaxAccess("readwrite") if mibBuilder.loadTexts: vsmTsCfgDataCndTypNB.setStatus('mandatory') if mibBuilder.loadTexts: vsmTsCfgDataCndTypNB.setDescription('The object specifies the type of data conditioning to narrowband.') vsmTsCfgDataCndTypATM = MibTableColumn((1, 3, 6, 1, 4, 1, 251, 1, 1, 47, 3, 1, 16), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(2, 3, 4, 5, 6, 7, 8, 9, 10, 1))).clone(namedValues=NamedValues(("muLaw-0V-7F", 2), ("muLaw-0V-FF", 3), ("aLaw-0V-D5", 4), ("aLaw-0V-54", 5), ("dacs-trbl-E4", 6), ("ctrl-mode-FE", 7), ("cir-oos-36", 8), ("mux-oos-1A", 9), ("user-data-FF", 10), ("none", 1))).clone('muLaw-0V-7F')).setMaxAccess("readwrite") if mibBuilder.loadTexts: vsmTsCfgDataCndTypATM.setStatus('mandatory') if mibBuilder.loadTexts: vsmTsCfgDataCndTypATM.setDescription('The object specifies the type of data conditioning to ATM.') vsmTsCfgMulticast = MibTableColumn((1, 3, 6, 1, 4, 1, 251, 1, 1, 47, 3, 1, 17), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(2, 1))).clone(namedValues=NamedValues(("disabled", 2), ("enabled", 1))).clone('disabled')).setMaxAccess("readwrite") if mibBuilder.loadTexts: vsmTsCfgMulticast.setStatus('mandatory') if mibBuilder.loadTexts: vsmTsCfgMulticast.setDescription('Multicast state: disabled = no multicast') vsmTsCfgOperStatus = MibTableColumn((1, 3, 6, 1, 4, 1, 251, 1, 1, 47, 3, 1, 18), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(2, 1, 3, 4, 5, 6, 7, 9, 10, 11, 12, 13, 14, 15, 16, 17))).clone(namedValues=NamedValues(("down", 2), ("up", 1), ("configured", 3), ("inv-cfg", 4), ("aal-mismatch", 5), ("no-more-DSPs", 6), ("inv-CID", 7), ("inv-Lk-no", 9), ("inv-Sil-Det", 10), ("inv-CmpTyp", 11), ("unknown-Lim", 12), ("inv-MCast", 13), ("inv-maxtslot", 14), ("aal1-max-TS", 15), ("inv-MCast-BN", 16), ("non-CAS-link", 17))).clone('down')).setMaxAccess("readonly") if mibBuilder.loadTexts: vsmTsCfgOperStatus.setStatus('mandatory') if mibBuilder.loadTexts: vsmTsCfgOperStatus.setDescription('The operating status of the timeslot.') vsmTsCfgAdminStatus = MibTableColumn((1, 3, 6, 1, 4, 1, 251, 1, 1, 47, 3, 1, 19), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(2, 1, 3))).clone(namedValues=NamedValues(("down", 2), ("up", 1), ("reconfig", 3))).clone('down')).setMaxAccess("readwrite") if mibBuilder.loadTexts: vsmTsCfgAdminStatus.setStatus('mandatory') if mibBuilder.loadTexts: vsmTsCfgAdminStatus.setDescription('The administrative status of the timeslot.') vsmTsCfgValidity = MibTableColumn((1, 3, 6, 1, 4, 1, 251, 1, 1, 47, 3, 1, 20), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2))).clone(namedValues=NamedValues(("valid", 1), ("invalid", 2)))).setMaxAccess("readwrite") if mibBuilder.loadTexts: vsmTsCfgValidity.setStatus('mandatory') if mibBuilder.loadTexts: vsmTsCfgValidity.setDescription('Set to invalid(2) to delete this row.') vsmBundleCfgTable = MibTable((1, 3, 6, 1, 4, 1, 251, 1, 1, 47, 4), ) if mibBuilder.loadTexts: vsmBundleCfgTable.setStatus('mandatory') if mibBuilder.loadTexts: vsmBundleCfgTable.setDescription('The configuration table for a Bundle. <DETAIL_DESCRIPTION> A VSM Bundle specifies the service requirements of a virtual channel connection, including AAL type, connection type (pvc,svc), bandwidth and QoS.') vsmBundleCfgTableEntry = MibTableRow((1, 3, 6, 1, 4, 1, 251, 1, 1, 47, 4, 1), ).setIndexNames((0, "Vsm-MIB", "vsmBundleCfgNo")) if mibBuilder.loadTexts: vsmBundleCfgTableEntry.setStatus('mandatory') vsmBundleCfgNo = MibTableColumn((1, 3, 6, 1, 4, 1, 251, 1, 1, 47, 4, 1, 1), VsmBundle()).setMaxAccess("readwrite") if mibBuilder.loadTexts: vsmBundleCfgNo.setStatus('mandatory') if mibBuilder.loadTexts: vsmBundleCfgNo.setDescription('The Bundle number.') vsmBundleCfgVcVpi = MibTableColumn((1, 3, 6, 1, 4, 1, 251, 1, 1, 47, 4, 1, 2), VpiInteger().clone(1)).setMaxAccess("readwrite") if mibBuilder.loadTexts: vsmBundleCfgVcVpi.setStatus('mandatory') if mibBuilder.loadTexts: vsmBundleCfgVcVpi.setDescription('The VPI of the VCC.') vsmBundleCfgVcVci = MibTableColumn((1, 3, 6, 1, 4, 1, 251, 1, 1, 47, 4, 1, 3), VciInteger().clone(1)).setMaxAccess("readonly") if mibBuilder.loadTexts: vsmBundleCfgVcVci.setStatus('mandatory') if mibBuilder.loadTexts: vsmBundleCfgVcVci.setDescription('The VCI of the VCC. This is the same as the Bundle no. for VSM.') vsmBundleCfgVcAALTyp = MibTableColumn((1, 3, 6, 1, 4, 1, 251, 1, 1, 47, 4, 1, 4), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(2, 1))).clone(namedValues=NamedValues(("aal2", 2), ("aal1", 1))).clone('aal2')).setMaxAccess("readwrite") if mibBuilder.loadTexts: vsmBundleCfgVcAALTyp.setStatus('mandatory') if mibBuilder.loadTexts: vsmBundleCfgVcAALTyp.setDescription('The AAL type used for the Bundle. This must match the AAL type used by the timeslot that is assigned to this bundle.') vsmBundleCfgMaxTslot = MibTableColumn((1, 3, 6, 1, 4, 1, 251, 1, 1, 47, 4, 1, 5), Integer32().subtype(subtypeSpec=ValueRangeConstraint(1, 120)).clone(1)).setMaxAccess("readwrite") if mibBuilder.loadTexts: vsmBundleCfgMaxTslot.setStatus('mandatory') if mibBuilder.loadTexts: vsmBundleCfgMaxTslot.setDescription('Specify the maximum number of timeslots that will be configured for the bundle. AAL2 only') vsmBundleCfgVcCDV = MibTableColumn((1, 3, 6, 1, 4, 1, 251, 1, 1, 47, 4, 1, 6), Integer32().subtype(subtypeSpec=ValueRangeConstraint(1, 128)).clone(8)).setMaxAccess("readwrite") if mibBuilder.loadTexts: vsmBundleCfgVcCDV.setStatus('mandatory') if mibBuilder.loadTexts: vsmBundleCfgVcCDV.setDescription('ATM cell delay variation between VSMs (in 125 microsecond intervals) <DETAIL_DESCRIPTION> ATM cell delay variation between VSMs (in 125 microsecond intervals). The maximum programmable value for cell delay variation is 16 milliseconds. Therefore, the greatest number which may be entered in this field is 128 (128 * 125 microsecond units). The default value is 8 (1 millisecond).') vsmBundleCfgTimerCU = MibTableColumn((1, 3, 6, 1, 4, 1, 251, 1, 1, 47, 4, 1, 7), Integer32().subtype(subtypeSpec=ValueRangeConstraint(0, 20)).clone(4)).setMaxAccess("readwrite") if mibBuilder.loadTexts: vsmBundleCfgTimerCU.setStatus('mandatory') if mibBuilder.loadTexts: vsmBundleCfgTimerCU.setDescription('Maximum amount of time (msec) to hold ATM cell before padding and sending. 0 results in an infinite wait. AAL2 only.') vsmBundleCfgCESPartialFill = MibTableColumn((1, 3, 6, 1, 4, 1, 251, 1, 1, 47, 4, 1, 8), Integer32().subtype(subtypeSpec=ValueRangeConstraint(1, 47)).clone(47)).setMaxAccess("readwrite") if mibBuilder.loadTexts: vsmBundleCfgCESPartialFill.setStatus('mandatory') if mibBuilder.loadTexts: vsmBundleCfgCESPartialFill.setDescription('Specify the no. of user octets per cell for partial cell fill. AAL1 only.') vsmBundleCfgVcTyp = MibTableColumn((1, 3, 6, 1, 4, 1, 251, 1, 1, 47, 4, 1, 9), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2, 3))).clone(namedValues=NamedValues(("pvc", 1), ("spvc", 2), ("svc", 3))).clone('pvc')).setMaxAccess("readwrite") if mibBuilder.loadTexts: vsmBundleCfgVcTyp.setStatus('mandatory') if mibBuilder.loadTexts: vsmBundleCfgVcTyp.setDescription('The option to setup VCC.') vsmBundleCfgTrapCfg = MibTableColumn((1, 3, 6, 1, 4, 1, 251, 1, 1, 47, 4, 1, 10), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2))).clone(namedValues=NamedValues(("no-trap", 1), ("state-change", 2))).clone('no-trap')).setMaxAccess("readwrite") if mibBuilder.loadTexts: vsmBundleCfgTrapCfg.setStatus('mandatory') if mibBuilder.loadTexts: vsmBundleCfgTrapCfg.setDescription('State change results in traps sent to the management station.') vsmBundleCfgOperStatus = MibTableColumn((1, 3, 6, 1, 4, 1, 251, 1, 1, 47, 4, 1, 11), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(2, 1, 3, 4, 5, 7, 9, 10, 11))).clone(namedValues=NamedValues(("down", 2), ("up", 1), ("configured", 3), ("inv-cfg", 4), ("aal-mismatch", 5), ("inv-VPI", 7), ("bndl-novc", 9), ("inv-maxtslot", 10), ("inv-VPI-15", 11))).clone('down')).setMaxAccess("readonly") if mibBuilder.loadTexts: vsmBundleCfgOperStatus.setStatus('mandatory') if mibBuilder.loadTexts: vsmBundleCfgOperStatus.setDescription('The operating status of the bundle.') vsmBundleCfgAdminStatus = MibTableColumn((1, 3, 6, 1, 4, 1, 251, 1, 1, 47, 4, 1, 12), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(2, 1, 3))).clone(namedValues=NamedValues(("down", 2), ("up", 1), ("reconfig", 3))).clone('down')).setMaxAccess("readwrite") if mibBuilder.loadTexts: vsmBundleCfgAdminStatus.setStatus('mandatory') if mibBuilder.loadTexts: vsmBundleCfgAdminStatus.setDescription('The administration status of the bundle.') vsmBundleCfgValidity = MibTableColumn((1, 3, 6, 1, 4, 1, 251, 1, 1, 47, 4, 1, 13), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2))).clone(namedValues=NamedValues(("valid", 1), ("invalid", 2)))).setMaxAccess("readwrite") if mibBuilder.loadTexts: vsmBundleCfgValidity.setStatus('mandatory') if mibBuilder.loadTexts: vsmBundleCfgValidity.setDescription('Set to invalid(2) to delete this row.') vsmCardStatTable = MibTable((1, 3, 6, 1, 4, 1, 251, 1, 1, 47, 5), ) if mibBuilder.loadTexts: vsmCardStatTable.setStatus('mandatory') if mibBuilder.loadTexts: vsmCardStatTable.setDescription('The VSM card status table.') vsmCardStatTableEntry = MibTableRow((1, 3, 6, 1, 4, 1, 251, 1, 1, 47, 5, 1), ).setIndexNames((0, "Vsm-MIB", "vsmCardStatIndex")) if mibBuilder.loadTexts: vsmCardStatTableEntry.setStatus('mandatory') vsmCardStatIndex = MibTableColumn((1, 3, 6, 1, 4, 1, 251, 1, 1, 47, 5, 1, 1), Integer32().subtype(subtypeSpec=ValueRangeConstraint(0, 0))).setMaxAccess("readonly") if mibBuilder.loadTexts: vsmCardStatIndex.setStatus('mandatory') if mibBuilder.loadTexts: vsmCardStatIndex.setDescription('Index for VSM Card Status Table') vsmCardStatBdType = MibTableColumn((1, 3, 6, 1, 4, 1, 251, 1, 1, 47, 5, 1, 2), DisplayString().subtype(subtypeSpec=ValueSizeConstraint(0, 40))).setMaxAccess("readonly") if mibBuilder.loadTexts: vsmCardStatBdType.setStatus('mandatory') if mibBuilder.loadTexts: vsmCardStatBdType.setDescription('VSM Hardware type') vsmCardStatHWSWCompatibility = MibTableColumn((1, 3, 6, 1, 4, 1, 251, 1, 1, 47, 5, 1, 3), DisplayString().subtype(subtypeSpec=ValueSizeConstraint(0, 40))).setMaxAccess("readonly") if mibBuilder.loadTexts: vsmCardStatHWSWCompatibility.setStatus('mandatory') if mibBuilder.loadTexts: vsmCardStatHWSWCompatibility.setDescription('Hardware Software Compatibility between bin, Basecard & DOC') vsmCardStatBinPres = MibTableColumn((1, 3, 6, 1, 4, 1, 251, 1, 1, 47, 5, 1, 4), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2))).clone(namedValues=NamedValues(("bin-not-present", 1), ("present", 2)))).setMaxAccess("readonly") if mibBuilder.loadTexts: vsmCardStatBinPres.setStatus('mandatory') if mibBuilder.loadTexts: vsmCardStatBinPres.setDescription('Indicates presence of vsm.bin file') vsmCardStatBinRev = MibTableColumn((1, 3, 6, 1, 4, 1, 251, 1, 1, 47, 5, 1, 5), DisplayString().subtype(subtypeSpec=ValueSizeConstraint(0, 8))).setMaxAccess("readonly") if mibBuilder.loadTexts: vsmCardStatBinRev.setStatus('mandatory') if mibBuilder.loadTexts: vsmCardStatBinRev.setDescription('The vsm.bin revision number') vsmCardStatBdRev = MibTableColumn((1, 3, 6, 1, 4, 1, 251, 1, 1, 47, 5, 1, 6), DisplayString().subtype(subtypeSpec=ValueSizeConstraint(0, 20))).setMaxAccess("readonly") if mibBuilder.loadTexts: vsmCardStatBdRev.setStatus('mandatory') if mibBuilder.loadTexts: vsmCardStatBdRev.setDescription('The Card Hardware Feature Revision') vsmCardStatDoc1Type = MibTableColumn((1, 3, 6, 1, 4, 1, 251, 1, 1, 47, 5, 1, 7), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2, 3, 4))).clone(namedValues=NamedValues(("unknown-doc-type", 1), ("type-48-channel", 2), ("type-60-channel", 3), ("doc-not-present", 4)))).setMaxAccess("readonly") if mibBuilder.loadTexts: vsmCardStatDoc1Type.setStatus('mandatory') if mibBuilder.loadTexts: vsmCardStatDoc1Type.setDescription('DOC 1 type supports 48 or 60 channels') vsmCardStatDoc1TypeRev = MibTableColumn((1, 3, 6, 1, 4, 1, 251, 1, 1, 47, 5, 1, 8), DisplayString().subtype(subtypeSpec=ValueSizeConstraint(0, 30))).setMaxAccess("readonly") if mibBuilder.loadTexts: vsmCardStatDoc1TypeRev.setStatus('mandatory') if mibBuilder.loadTexts: vsmCardStatDoc1TypeRev.setDescription('DOC 1 Hardware Revision') vsmCardStatDoc2Type = MibTableColumn((1, 3, 6, 1, 4, 1, 251, 1, 1, 47, 5, 1, 9), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2, 3, 4))).clone(namedValues=NamedValues(("unknown-doc-type", 1), ("type-48-channel", 2), ("type-60-channel", 3), ("doc-not-present", 4)))).setMaxAccess("readonly") if mibBuilder.loadTexts: vsmCardStatDoc2Type.setStatus('mandatory') if mibBuilder.loadTexts: vsmCardStatDoc2Type.setDescription('DOC 2 type supports 48 or 60 channels') vsmCardStatDoc2TypeRev = MibTableColumn((1, 3, 6, 1, 4, 1, 251, 1, 1, 47, 5, 1, 10), DisplayString().subtype(subtypeSpec=ValueSizeConstraint(0, 30))).setMaxAccess("readonly") if mibBuilder.loadTexts: vsmCardStatDoc2TypeRev.setStatus('mandatory') if mibBuilder.loadTexts: vsmCardStatDoc2TypeRev.setDescription('DOC 2 Hardware Revision') vsmCardStatLimType = MibTableColumn((1, 3, 6, 1, 4, 1, 251, 1, 1, 47, 5, 1, 11), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2, 3, 4, 5))).clone(namedValues=NamedValues(("invalid-or-no-lim", 1), ("ds1-dual-signaling-lim", 2), ("ds1-quad-signaling-lim", 3), ("e1-dual-signaling-lim", 4), ("e1-quad-signaling-lim", 5)))).setMaxAccess("readonly") if mibBuilder.loadTexts: vsmCardStatLimType.setStatus('mandatory') if mibBuilder.loadTexts: vsmCardStatLimType.setDescription('LIM detected for the VSM card.') vsmTsStatTable = MibTable((1, 3, 6, 1, 4, 1, 251, 1, 1, 47, 6), ) if mibBuilder.loadTexts: vsmTsStatTable.setStatus('mandatory') if mibBuilder.loadTexts: vsmTsStatTable.setDescription('The VSM Timeslot status table.') vsmTsStatTableEntry = MibTableRow((1, 3, 6, 1, 4, 1, 251, 1, 1, 47, 6, 1), ).setIndexNames((0, "Vsm-MIB", "vsmTsStatLinkNo"), (0, "Vsm-MIB", "vsmTsStatTSNo")) if mibBuilder.loadTexts: vsmTsStatTableEntry.setStatus('mandatory') vsmTsStatLinkNo = MibTableColumn((1, 3, 6, 1, 4, 1, 251, 1, 1, 47, 6, 1, 1), Integer32().subtype(subtypeSpec=ValueRangeConstraint(0, 3))).setMaxAccess("readonly") if mibBuilder.loadTexts: vsmTsStatLinkNo.setStatus('mandatory') if mibBuilder.loadTexts: vsmTsStatLinkNo.setDescription('The Link Number') vsmTsStatTSNo = MibTableColumn((1, 3, 6, 1, 4, 1, 251, 1, 1, 47, 6, 1, 2), Integer32().subtype(subtypeSpec=ValueRangeConstraint(0, 31))).setMaxAccess("readonly") if mibBuilder.loadTexts: vsmTsStatTSNo.setStatus('mandatory') if mibBuilder.loadTexts: vsmTsStatTSNo.setDescription('The timeslot number of the link.') vsmTsStatBundleNo = MibTableColumn((1, 3, 6, 1, 4, 1, 251, 1, 1, 47, 6, 1, 3), VsmBundle()).setMaxAccess("readonly") if mibBuilder.loadTexts: vsmTsStatBundleNo.setStatus('mandatory') if mibBuilder.loadTexts: vsmTsStatBundleNo.setDescription('The Bundle number.') vsmTsStatXmitBytes = MibTableColumn((1, 3, 6, 1, 4, 1, 251, 1, 1, 47, 6, 1, 4), Counter32()).setMaxAccess("readonly") if mibBuilder.loadTexts: vsmTsStatXmitBytes.setStatus('mandatory') if mibBuilder.loadTexts: vsmTsStatXmitBytes.setDescription('Number of bytes which have been transmitted <DETAIL_DESCRIPTION> Only applies to AAL2 operating mode. This object provides the user with a count of the number of bytes which have been transmitted to the service interface.') vsmTsStatRecvBytes = MibTableColumn((1, 3, 6, 1, 4, 1, 251, 1, 1, 47, 6, 1, 5), Counter32()).setMaxAccess("readonly") if mibBuilder.loadTexts: vsmTsStatRecvBytes.setStatus('mandatory') if mibBuilder.loadTexts: vsmTsStatRecvBytes.setDescription('Number of packets which have been reassembled <DETAIL_DESCRIPTION> Only applies to AAL2 operating mode. This object provides the user with a count of the number of AAL2 packets which have been reassembled or played out to the service interface. It excludes packets that were discarded for any reason, including packets that were not used due to being declared misinserted or discarded while the reassembler was waiting to achieve synchronization') vsmTsStatUnderflows = MibTableColumn((1, 3, 6, 1, 4, 1, 251, 1, 1, 47, 6, 1, 6), Counter32()).setMaxAccess("readonly") if mibBuilder.loadTexts: vsmTsStatUnderflows.setStatus('mandatory') if mibBuilder.loadTexts: vsmTsStatUnderflows.setDescription('Number of underflow indications <DETAIL_DESCRIPTION> Only applies to AAL2 operating mode. This object provides the user with a count of the number of underflow indications reported by the DSP to the Maker device (in 2 ms intervals).') vsmTsStatLostPackets = MibTableColumn((1, 3, 6, 1, 4, 1, 251, 1, 1, 47, 6, 1, 7), Counter32()).setMaxAccess("readonly") if mibBuilder.loadTexts: vsmTsStatLostPackets.setStatus('mandatory') if mibBuilder.loadTexts: vsmTsStatLostPackets.setDescription('Number of lost packets <DETAIL_DESCRIPTION> Only applies to AAL2 operating mode. This object provides the user with a count of the number of AAL2 packets which have been detected as lost in the network prior to the destination CES IWF layer processing. The cause of a lost packet is an invalid sequence number.') vsmTsStatAALType = MibTableColumn((1, 3, 6, 1, 4, 1, 251, 1, 1, 47, 6, 1, 8), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(2, 1))).clone(namedValues=NamedValues(("aal2", 2), ("aal1", 1))).clone('aal2')).setMaxAccess("readonly") if mibBuilder.loadTexts: vsmTsStatAALType.setStatus('mandatory') if mibBuilder.loadTexts: vsmTsStatAALType.setDescription('AAL type used for timeslot.') vsmTsStatVCID = MibTableColumn((1, 3, 6, 1, 4, 1, 251, 1, 1, 47, 6, 1, 9), Integer32()).setMaxAccess("readonly") if mibBuilder.loadTexts: vsmTsStatVCID.setStatus('mandatory') if mibBuilder.loadTexts: vsmTsStatVCID.setDescription('The number of the CID on which this BC is transmitting') vsmTsStatCID = MibTableColumn((1, 3, 6, 1, 4, 1, 251, 1, 1, 47, 6, 1, 10), Integer32()).setMaxAccess("readonly") if mibBuilder.loadTexts: vsmTsStatCID.setStatus('mandatory') if mibBuilder.loadTexts: vsmTsStatCID.setDescription('The number of the CID assigned to this BC') vsmTsStatActive = MibTableColumn((1, 3, 6, 1, 4, 1, 251, 1, 1, 47, 6, 1, 11), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2))).clone(namedValues=NamedValues(("yes", 1), ("no", 2)))).setMaxAccess("readonly") if mibBuilder.loadTexts: vsmTsStatActive.setStatus('mandatory') if mibBuilder.loadTexts: vsmTsStatActive.setDescription('State of Time Slot (Bearer Channel): yes = active; no = not active <DETAIL_DESCRIPTION> Provides the user with the activity mode of each Time Slot individually. A Time Slot is considered active if it is being processed into ATM cells. Examples of active Time Slots: 1) an off-hook voice channel 2) any data channel Example of inactive Time Slot: 1) an on-hook voice channel ') vsmTsStatDataLnk = MibTableColumn((1, 3, 6, 1, 4, 1, 251, 1, 1, 47, 6, 1, 12), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2))).clone(namedValues=NamedValues(("dsp", 1), ("bypass", 2)))).setMaxAccess("readonly") if mibBuilder.loadTexts: vsmTsStatDataLnk.setStatus('mandatory') if mibBuilder.loadTexts: vsmTsStatDataLnk.setDescription('Indicates whether bearer channel is using DSP or Bypass') vsmTsStatBlocked = MibTableColumn((1, 3, 6, 1, 4, 1, 251, 1, 1, 47, 6, 1, 13), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(2, 1))).clone(namedValues=NamedValues(("no", 2), ("yes", 1))).clone('no')).setMaxAccess("readonly") if mibBuilder.loadTexts: vsmTsStatBlocked.setStatus('mandatory') if mibBuilder.loadTexts: vsmTsStatBlocked.setDescription('Indicates whether bearer channel is in blocked mode') vsmTsStatIdleIdle = MibTableColumn((1, 3, 6, 1, 4, 1, 251, 1, 1, 47, 6, 1, 14), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(2, 1))).clone(namedValues=NamedValues(("no", 2), ("yes", 1))).clone('no')).setMaxAccess("readonly") if mibBuilder.loadTexts: vsmTsStatIdleIdle.setStatus('mandatory') if mibBuilder.loadTexts: vsmTsStatIdleIdle.setDescription('Indicates whether bearer channel is on-hook or off-hook') vsmTsStatHold = MibTableColumn((1, 3, 6, 1, 4, 1, 251, 1, 1, 47, 6, 1, 15), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(2, 1))).clone(namedValues=NamedValues(("no", 2), ("yes", 1))).clone('no')).setMaxAccess("readonly") if mibBuilder.loadTexts: vsmTsStatHold.setStatus('mandatory') if mibBuilder.loadTexts: vsmTsStatHold.setDescription('Indicates whether bearer channel is in hold mode') vsmTsStatRemoteCompressed = MibTableColumn((1, 3, 6, 1, 4, 1, 251, 1, 1, 47, 6, 1, 16), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(2, 1))).clone(namedValues=NamedValues(("no", 2), ("yes", 1))).clone('no')).setMaxAccess("readonly") if mibBuilder.loadTexts: vsmTsStatRemoteCompressed.setStatus('mandatory') if mibBuilder.loadTexts: vsmTsStatRemoteCompressed.setDescription('Indicates use of compression algorithm on remote channel <DETAIL_DESCRIPTION> A yes indicates that a compression algorithm is being used on the remote channel data. No indicates that no compression algorithm is being used on remote channel.') vsmTsStatRemoteSilent = MibTableColumn((1, 3, 6, 1, 4, 1, 251, 1, 1, 47, 6, 1, 17), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(2, 1))).clone(namedValues=NamedValues(("no", 2), ("yes", 1))).clone('no')).setMaxAccess("readonly") if mibBuilder.loadTexts: vsmTsStatRemoteSilent.setStatus('mandatory') if mibBuilder.loadTexts: vsmTsStatRemoteSilent.setDescription('Indicates whether remote channel is in silent mode or non silent mode <DETAIL_DESCRIPTION> ') vsmTsStatCompressed = MibTableColumn((1, 3, 6, 1, 4, 1, 251, 1, 1, 47, 6, 1, 18), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(2, 1))).clone(namedValues=NamedValues(("no", 2), ("yes", 1))).clone('no')).setMaxAccess("readonly") if mibBuilder.loadTexts: vsmTsStatCompressed.setStatus('mandatory') if mibBuilder.loadTexts: vsmTsStatCompressed.setDescription('Indicates use of compression algorithm on local channel <DETAIL_DESCRIPTION> A yes indicates that a compression algorithm is being used on the local channel data. No indicates that no compression algorithm is being used on the local channel.') vsmTsStatSilent = MibTableColumn((1, 3, 6, 1, 4, 1, 251, 1, 1, 47, 6, 1, 19), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(2, 1))).clone(namedValues=NamedValues(("no", 2), ("yes", 1))).clone('no')).setMaxAccess("readonly") if mibBuilder.loadTexts: vsmTsStatSilent.setStatus('mandatory') if mibBuilder.loadTexts: vsmTsStatSilent.setDescription('Time Slot Silence Status <DETAIL_DESCRIPTION> Indicates whether local channel is in silent mode (yes) or non silent mode (no)') vsmTsStatConditioning = MibTableColumn((1, 3, 6, 1, 4, 1, 251, 1, 1, 47, 6, 1, 20), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(2, 1))).clone(namedValues=NamedValues(("no", 2), ("yes", 1))).clone('no')).setMaxAccess("readonly") if mibBuilder.loadTexts: vsmTsStatConditioning.setStatus('mandatory') if mibBuilder.loadTexts: vsmTsStatConditioning.setDescription('Conditioning status: yes = conditioning; no = not conditioning <DETAIL_DESCRIPTION> Data conditioning is initiated upon the detection of a variety of error situations including, but not limited to, LOS, LOF and AIS.') vsmTsStatRemoteConditioning = MibTableColumn((1, 3, 6, 1, 4, 1, 251, 1, 1, 47, 6, 1, 21), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(2, 1))).clone(namedValues=NamedValues(("no", 2), ("yes", 1))).clone('no')).setMaxAccess("readonly") if mibBuilder.loadTexts: vsmTsStatRemoteConditioning.setStatus('mandatory') if mibBuilder.loadTexts: vsmTsStatRemoteConditioning.setDescription('Conditioning status: yes = conditioning; no = not conditioning <DETAIL_DESCRIPTION> Data conditioning is initiated upon the detection of a variety of error situations including, but not limited to, LOS, LOF and AIS.This indicates the remote side is conditioning.') vsmTsStatRIWF = MibTableColumn((1, 3, 6, 1, 4, 1, 251, 1, 1, 47, 6, 1, 22), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(2, 1))).clone(namedValues=NamedValues(("no", 2), ("yes", 1))).clone('no')).setMaxAccess("readonly") if mibBuilder.loadTexts: vsmTsStatRIWF.setStatus('mandatory') if mibBuilder.loadTexts: vsmTsStatRIWF.setDescription('Remote interworking function alarm active <DETAIL_DESCRIPTION> ') vsmTsStatLossofRefresh = MibTableColumn((1, 3, 6, 1, 4, 1, 251, 1, 1, 47, 6, 1, 23), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(2, 1))).clone(namedValues=NamedValues(("no", 2), ("yes", 1))).clone('no')).setMaxAccess("readonly") if mibBuilder.loadTexts: vsmTsStatLossofRefresh.setStatus('mandatory') if mibBuilder.loadTexts: vsmTsStatLossofRefresh.setDescription("CAS Refresh status: yes = loss of refresh; no = no alarm <DETAIL_DESCRIPTION> This only applies when signalling is configured for the timeslot. When no signalling is configured this defaults to 'no'. When signalling is configured and it is detected that there is no response to the refresh packet, this bit is set to 'yes'. This will result in ATM signalling and data conditioning.") vsmTsStatCasValuesPDH = MibTableColumn((1, 3, 6, 1, 4, 1, 251, 1, 1, 47, 6, 1, 24), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16))).clone(namedValues=NamedValues(("a0-b0-c0-d0", 1), ("a0-b0-c0-d1", 2), ("a0-b0-c1-d0", 3), ("a0-b0-c1-d1", 4), ("a0-b1-c0-d0", 5), ("a0-b1-c0-d1", 6), ("a0-b1-c1-d0", 7), ("a0-b1-c1-d1", 8), ("a1-b0-c0-d0", 9), ("a1-b0-c0-d1", 10), ("a1-b0-c1-d0", 11), ("a1-b0-c1-d1", 12), ("a1-b1-c0-d0", 13), ("a1-b1-c0-d1", 14), ("a1-b1-c1-d0", 15), ("a1-b1-c1-d1", 16)))).setMaxAccess("readonly") if mibBuilder.loadTexts: vsmTsStatCasValuesPDH.setStatus('mandatory') if mibBuilder.loadTexts: vsmTsStatCasValuesPDH.setDescription('Value of A B C D bits being sent from VSM physical interface (PDH side) <DETAIL_DESCRIPTION> Provides a snapshot of the current state of the A B C D signalling bits on the PDH side of the network') vsmTsStatCasValuesATM = MibTableColumn((1, 3, 6, 1, 4, 1, 251, 1, 1, 47, 6, 1, 25), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16))).clone(namedValues=NamedValues(("a0-b0-c0-d0", 1), ("a0-b0-c0-d1", 2), ("a0-b0-c1-d0", 3), ("a0-b0-c1-d1", 4), ("a0-b1-c0-d0", 5), ("a0-b1-c0-d1", 6), ("a0-b1-c1-d0", 7), ("a0-b1-c1-d1", 8), ("a1-b0-c0-d0", 9), ("a1-b0-c0-d1", 10), ("a1-b0-c1-d0", 11), ("a1-b0-c1-d1", 12), ("a1-b1-c0-d0", 13), ("a1-b1-c0-d1", 14), ("a1-b1-c1-d0", 15), ("a1-b1-c1-d1", 16)))).setMaxAccess("readonly") if mibBuilder.loadTexts: vsmTsStatCasValuesATM.setStatus('mandatory') if mibBuilder.loadTexts: vsmTsStatCasValuesATM.setDescription('Value of A B C D bits being sent from the ATM network <DETAIL_DESCRIPTION> Provides a snapshot of the current state of the A B C D signalling bits on the ATM side of the network') vsmTsStatReset = MibTableColumn((1, 3, 6, 1, 4, 1, 251, 1, 1, 47, 6, 1, 26), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(2, 1))).clone(namedValues=NamedValues(("no", 2), ("yes", 1))).clone('no')).setMaxAccess("readwrite") if mibBuilder.loadTexts: vsmTsStatReset.setStatus('mandatory') if mibBuilder.loadTexts: vsmTsStatReset.setDescription('Set to yes(1) to reset all counters in the Time Slot status table.') vsmBundleStatTable = MibTable((1, 3, 6, 1, 4, 1, 251, 1, 1, 47, 7), ) if mibBuilder.loadTexts: vsmBundleStatTable.setStatus('mandatory') if mibBuilder.loadTexts: vsmBundleStatTable.setDescription('The VSM Bundle status table.') vsmBundleStatTableEntry = MibTableRow((1, 3, 6, 1, 4, 1, 251, 1, 1, 47, 7, 1), ).setIndexNames((0, "Vsm-MIB", "vsmBundleStatBundleNo")) if mibBuilder.loadTexts: vsmBundleStatTableEntry.setStatus('mandatory') vsmBundleStatBundleNo = MibTableColumn((1, 3, 6, 1, 4, 1, 251, 1, 1, 47, 7, 1, 1), VsmBundle()).setMaxAccess("readonly") if mibBuilder.loadTexts: vsmBundleStatBundleNo.setStatus('mandatory') if mibBuilder.loadTexts: vsmBundleStatBundleNo.setDescription('The Bundle number.') vsmBundleStatXmitCells = MibTableColumn((1, 3, 6, 1, 4, 1, 251, 1, 1, 47, 7, 1, 2), Counter32()).setMaxAccess("readonly") if mibBuilder.loadTexts: vsmBundleStatXmitCells.setStatus('mandatory') if mibBuilder.loadTexts: vsmBundleStatXmitCells.setDescription('The count of the number of AAL2 cells transmitted') vsmBundleStatRecvCells = MibTableColumn((1, 3, 6, 1, 4, 1, 251, 1, 1, 47, 7, 1, 3), Counter32()).setMaxAccess("readonly") if mibBuilder.loadTexts: vsmBundleStatRecvCells.setStatus('mandatory') if mibBuilder.loadTexts: vsmBundleStatRecvCells.setDescription('The count of cells that have been played out to the PDH link.') vsmBundleStatPvcActive = MibTableColumn((1, 3, 6, 1, 4, 1, 251, 1, 1, 47, 7, 1, 4), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(2, 1))).clone(namedValues=NamedValues(("not-active", 2), ("active", 1))).clone('not-active')).setMaxAccess("readonly") if mibBuilder.loadTexts: vsmBundleStatPvcActive.setStatus('mandatory') if mibBuilder.loadTexts: vsmBundleStatPvcActive.setDescription('Is the PVC on this Bundle active.') vsmBundleStatAALType = MibTableColumn((1, 3, 6, 1, 4, 1, 251, 1, 1, 47, 7, 1, 5), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(2, 1))).clone(namedValues=NamedValues(("aal2", 2), ("aal1", 1))).clone('aal2')).setMaxAccess("readonly") if mibBuilder.loadTexts: vsmBundleStatAALType.setStatus('mandatory') if mibBuilder.loadTexts: vsmBundleStatAALType.setDescription('The AAL type used for the Bundle.') vsmBundleStatBufUndrflws = MibTableColumn((1, 3, 6, 1, 4, 1, 251, 1, 1, 47, 7, 1, 6), Counter32()).setMaxAccess("readonly") if mibBuilder.loadTexts: vsmBundleStatBufUndrflws.setStatus('mandatory') if mibBuilder.loadTexts: vsmBundleStatBufUndrflws.setDescription('The number of buffer underflows (AAL1 only).') vsmBundleStatBufOverflows = MibTableColumn((1, 3, 6, 1, 4, 1, 251, 1, 1, 47, 7, 1, 7), Counter32()).setMaxAccess("readonly") if mibBuilder.loadTexts: vsmBundleStatBufOverflows.setStatus('mandatory') if mibBuilder.loadTexts: vsmBundleStatBufOverflows.setDescription('The number of buffer overflows (AAL1 only).') vsmBundleStatPtrReframes = MibTableColumn((1, 3, 6, 1, 4, 1, 251, 1, 1, 47, 7, 1, 8), Counter32()).setMaxAccess("readonly") if mibBuilder.loadTexts: vsmBundleStatPtrReframes.setStatus('mandatory') if mibBuilder.loadTexts: vsmBundleStatPtrReframes.setDescription('The count of the number of events in which SDT pointer is not where it is expected (AAL1 only). <DETAIL_DESCRIPTION> The count of the number of events in which SDT pointer is not where it is expected (AAL1 only). This counter is 0 for unstructured CES mode') vsmBundleStatLostCells = MibTableColumn((1, 3, 6, 1, 4, 1, 251, 1, 1, 47, 7, 1, 9), Counter32()).setMaxAccess("readonly") if mibBuilder.loadTexts: vsmBundleStatLostCells.setStatus('mandatory') if mibBuilder.loadTexts: vsmBundleStatLostCells.setDescription('The number of AAL1 cells detected as lost prior to the destination') vsmBundleStatHdrErrors = MibTableColumn((1, 3, 6, 1, 4, 1, 251, 1, 1, 47, 7, 1, 10), Counter32()).setMaxAccess("readonly") if mibBuilder.loadTexts: vsmBundleStatHdrErrors.setStatus('mandatory') if mibBuilder.loadTexts: vsmBundleStatHdrErrors.setDescription('The count of all AAL1 and AAL2 header errors <DETAIL_DESCRIPTION> The Header Error count represents a sum of start pointer, sequence number and parity errors.') vsmBundleStatBadCID = MibTableColumn((1, 3, 6, 1, 4, 1, 251, 1, 1, 47, 7, 1, 11), Counter32()).setMaxAccess("readonly") if mibBuilder.loadTexts: vsmBundleStatBadCID.setStatus('mandatory') if mibBuilder.loadTexts: vsmBundleStatBadCID.setDescription('The count of the number of AAL2 cells having a bad CID') vsmBundleStatAAL2LostCells = MibTableColumn((1, 3, 6, 1, 4, 1, 251, 1, 1, 47, 7, 1, 12), Counter32()).setMaxAccess("readonly") if mibBuilder.loadTexts: vsmBundleStatAAL2LostCells.setStatus('mandatory') if mibBuilder.loadTexts: vsmBundleStatAAL2LostCells.setDescription('The count of the number of lost AAL2 cells <DETAIL_DESCRIPTION> When operating in AAL2 mode, a non-zero count of lost cells is an indication that invalid sequence numbers exist') vsmBundleStatReset = MibTableColumn((1, 3, 6, 1, 4, 1, 251, 1, 1, 47, 7, 1, 13), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(2, 1))).clone(namedValues=NamedValues(("no", 2), ("yes", 1))).clone('no')).setMaxAccess("readwrite") if mibBuilder.loadTexts: vsmBundleStatReset.setStatus('mandatory') if mibBuilder.loadTexts: vsmBundleStatReset.setDescription('Set to yes(1) to reset all counters in the Bundle status table.') vsmBundleStatConditioning = MibTableColumn((1, 3, 6, 1, 4, 1, 251, 1, 1, 47, 7, 1, 14), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(2, 1))).clone(namedValues=NamedValues(("no", 2), ("yes", 1))).clone('no')).setMaxAccess("readonly") if mibBuilder.loadTexts: vsmBundleStatConditioning.setStatus('mandatory') if mibBuilder.loadTexts: vsmBundleStatConditioning.setDescription('Conditioning status: yes = conditioning; no = not conditioning <DETAIL_DESCRIPTION> Data conditioning is initiated upon the detection of any or all of a variety of errors including: no received cell flow, header errors, buffer underflow, buffer overflow, pointer reframes or lost cells.') mibBuilder.exportSymbols("Vsm-MIB", vsmTsStatUnderflows=vsmTsStatUnderflows, vsmTsStatLossofRefresh=vsmTsStatLossofRefresh, vsmCardStatBdType=vsmCardStatBdType, vsmTsCfgOperStatus=vsmTsCfgOperStatus, vsmCardStatDoc2Type=vsmCardStatDoc2Type, vsmTsCfgDataCndTypNB=vsmTsCfgDataCndTypNB, vsmCardStatHWSWCompatibility=vsmCardStatHWSWCompatibility, vsmCardStatTable=vsmCardStatTable, vsmBundleCfgNo=vsmBundleCfgNo, vsmBundleStatRecvCells=vsmBundleStatRecvCells, VsmBundle=VsmBundle, vsmBundleStatPvcActive=vsmBundleStatPvcActive, vsmTsStatAALType=vsmTsStatAALType, vsmTsStatConditioning=vsmTsStatConditioning, vsmTsStatActive=vsmTsStatActive, vsmBundleCfgTableEntry=vsmBundleCfgTableEntry, vsmLinkSigType=vsmLinkSigType, vsmBundleStatAAL2LostCells=vsmBundleStatAAL2LostCells, vsmCardStatDoc1Type=vsmCardStatDoc1Type, vsmTsStatTableEntry=vsmTsStatTableEntry, vsmBundleStatTable=vsmBundleStatTable, vsmTsCfgIdleDetect=vsmTsCfgIdleDetect, vsmBundleStatHdrErrors=vsmBundleStatHdrErrors, vsmTsStatCasValuesPDH=vsmTsStatCasValuesPDH, vsmTsCfgSilenceRmvl=vsmTsCfgSilenceRmvl, vsmTsCfgTsNo=vsmTsCfgTsNo, vsmBundleCfgMaxTslot=vsmBundleCfgMaxTslot, vsmBundleStatConditioning=vsmBundleStatConditioning, vsmTsStatCID=vsmTsStatCID, vsmTsStatDataLnk=vsmTsStatDataLnk, vsmTsStatBundleNo=vsmTsStatBundleNo, vsmTsCfgSigCndTypNB=vsmTsCfgSigCndTypNB, vsmCardCfgTable=vsmCardCfgTable, vsmBundleCfgVcCDV=vsmBundleCfgVcCDV, vsmTsStatLostPackets=vsmTsStatLostPackets, vsmTsStatIdleIdle=vsmTsStatIdleIdle, vsmCardCfgTableEntry=vsmCardCfgTableEntry, vsmTsCfgAALTyp=vsmTsCfgAALTyp, vsmLinkEnable=vsmLinkEnable, vsmTsStatRIWF=vsmTsStatRIWF, vsmLinkEnableStat=vsmLinkEnableStat, vsmTsStatXmitBytes=vsmTsStatXmitBytes, vsmTsStatRecvBytes=vsmTsStatRecvBytes, vsmLinkTable=vsmLinkTable, vsmBundleStatBadCID=vsmBundleStatBadCID, vsmBundleCfgAdminStatus=vsmBundleCfgAdminStatus, vsmCardCfgBndlTslotStatus=vsmCardCfgBndlTslotStatus, vsmBundleCfgVcVci=vsmBundleCfgVcVci, vsmBundleCfgTimerCU=vsmBundleCfgTimerCU, vsmBundleCfgVcTyp=vsmBundleCfgVcTyp, vsmCardStatBdRev=vsmCardStatBdRev, vsmBundleStatBundleNo=vsmBundleStatBundleNo, vsmBundleCfgVcVpi=vsmBundleCfgVcVpi, vsmBundleStatPtrReframes=vsmBundleStatPtrReframes, vsmBundleCfgOperStatus=vsmBundleCfgOperStatus, vsmTsCfgValidity=vsmTsCfgValidity, vsmCardCfgIndex=vsmCardCfgIndex, vsmTsCfgTableEntry=vsmTsCfgTableEntry, vsmTsStatTSNo=vsmTsStatTSNo, vsmBundleCfgValidity=vsmBundleCfgValidity, vsmCardStatLimType=vsmCardStatLimType, vsmTsStatReset=vsmTsStatReset, vsmTsCfgSignalTyp=vsmTsCfgSignalTyp, vsmBundleStatBufUndrflws=vsmBundleStatBufUndrflws, dv2Vsm=dv2Vsm, vsmTsCfgEchoCancel=vsmTsCfgEchoCancel, vsmTsCfgCmprssionTyp=vsmTsCfgCmprssionTyp, vsmCardStatIndex=vsmCardStatIndex, vsmTsStatBlocked=vsmTsStatBlocked, vsmTsCfgRmtLaw=vsmTsCfgRmtLaw, vsmBundleStatAALType=vsmBundleStatAALType, vsmTsCfgFaxMdmHndlng=vsmTsCfgFaxMdmHndlng, vsmCardStatTableEntry=vsmCardStatTableEntry, VpiInteger=VpiInteger, vsmBundleStatTableEntry=vsmBundleStatTableEntry, vsmTsCfgTable=vsmTsCfgTable, vsmBundleCfgVcAALTyp=vsmBundleCfgVcAALTyp, vsmTsCfgBundleNo=vsmTsCfgBundleNo, vsmTsCfgDataCndTypATM=vsmTsCfgDataCndTypATM, vsmBundleCfgCESPartialFill=vsmBundleCfgCESPartialFill, vsmTsStatVCID=vsmTsStatVCID, vsmBundleCfgTable=vsmBundleCfgTable, vsmBundleStatXmitCells=vsmBundleStatXmitCells, vsmLinkLink=vsmLinkLink, vsmTsStatRemoteCompressed=vsmTsStatRemoteCompressed, vsmCardStatDoc2TypeRev=vsmCardStatDoc2TypeRev, vsmCardStatDoc1TypeRev=vsmCardStatDoc1TypeRev, vsmTsCfgLinkNo=vsmTsCfgLinkNo, vsmTsCfgSigCndTypATM=vsmTsCfgSigCndTypATM, vsmBundleStatLostCells=vsmBundleStatLostCells, vsmBundleStatReset=vsmBundleStatReset, vsmBundleStatBufOverflows=vsmBundleStatBufOverflows, vsmTsCfgAdminStatus=vsmTsCfgAdminStatus, vsmTsStatTable=vsmTsStatTable, vsmTsStatHold=vsmTsStatHold, vsmTsStatRemoteSilent=vsmTsStatRemoteSilent, vsmBundleCfgTrapCfg=vsmBundleCfgTrapCfg, vsmCardStatBinRev=vsmCardStatBinRev, vsmTsStatCompressed=vsmTsStatCompressed, vsmLinkEntry=vsmLinkEntry, VciInteger=VciInteger, vsmTsCfgChanID=vsmTsCfgChanID, vsmTsStatSilent=vsmTsStatSilent, vsmTsStatCasValuesATM=vsmTsStatCasValuesATM, vsmTsCfgMulticast=vsmTsCfgMulticast, vsmTsStatRemoteConditioning=vsmTsStatRemoteConditioning, vsmCardStatBinPres=vsmCardStatBinPres, vsmTsStatLinkNo=vsmTsStatLinkNo)
(object_identifier, octet_string, integer) = mibBuilder.importSymbols('ASN1', 'ObjectIdentifier', 'OctetString', 'Integer') (named_values,) = mibBuilder.importSymbols('ASN1-ENUMERATION', 'NamedValues') (single_value_constraint, constraints_intersection, value_size_constraint, constraints_union, value_range_constraint) = mibBuilder.importSymbols('ASN1-REFINEMENT', 'SingleValueConstraint', 'ConstraintsIntersection', 'ValueSizeConstraint', 'ConstraintsUnion', 'ValueRangeConstraint') (dv2,) = mibBuilder.importSymbols('DV2-MIB', 'dv2') (module_compliance, notification_group) = mibBuilder.importSymbols('SNMPv2-CONF', 'ModuleCompliance', 'NotificationGroup') (iso, notification_type, unsigned32, mib_identifier, mib_scalar, mib_table, mib_table_row, mib_table_column, integer32, module_identity, gauge32, time_ticks, object_identity, bits, ip_address, counter64, counter32) = mibBuilder.importSymbols('SNMPv2-SMI', 'iso', 'NotificationType', 'Unsigned32', 'MibIdentifier', 'MibScalar', 'MibTable', 'MibTableRow', 'MibTableColumn', 'Integer32', 'ModuleIdentity', 'Gauge32', 'TimeTicks', 'ObjectIdentity', 'Bits', 'IpAddress', 'Counter64', 'Counter32') (textual_convention, display_string) = mibBuilder.importSymbols('SNMPv2-TC', 'TextualConvention', 'DisplayString') dv2_vsm = mib_identifier((1, 3, 6, 1, 4, 1, 251, 1, 1, 47)) class Vciinteger(Integer32): subtype_spec = Integer32.subtypeSpec + value_range_constraint(0, 65535) class Vpiinteger(Integer32): subtype_spec = Integer32.subtypeSpec + value_range_constraint(0, 255) class Vsmbundle(Integer32): subtype_spec = Integer32.subtypeSpec + value_range_constraint(1, 127) vsm_card_cfg_table = mib_table((1, 3, 6, 1, 4, 1, 251, 1, 1, 47, 1)) if mibBuilder.loadTexts: vsmCardCfgTable.setStatus('mandatory') if mibBuilder.loadTexts: vsmCardCfgTable.setDescription('The VSM card configuration table.') vsm_card_cfg_table_entry = mib_table_row((1, 3, 6, 1, 4, 1, 251, 1, 1, 47, 1, 1)).setIndexNames((0, 'Vsm-MIB', 'vsmCardCfgIndex')) if mibBuilder.loadTexts: vsmCardCfgTableEntry.setStatus('mandatory') vsm_card_cfg_index = mib_table_column((1, 3, 6, 1, 4, 1, 251, 1, 1, 47, 1, 1, 1), integer32().subtype(subtypeSpec=value_range_constraint(0, 0))).setMaxAccess('readonly') if mibBuilder.loadTexts: vsmCardCfgIndex.setStatus('mandatory') if mibBuilder.loadTexts: vsmCardCfgIndex.setDescription('Index for VSM Card Cfg Table') vsm_card_cfg_bndl_tslot_status = mib_table_column((1, 3, 6, 1, 4, 1, 251, 1, 1, 47, 1, 1, 2), integer32().subtype(subtypeSpec=constraints_union(single_value_constraint(1, 2))).clone(namedValues=named_values(('enabled', 1), ('disabled', 2))).clone('enabled')).setMaxAccess('readonly') if mibBuilder.loadTexts: vsmCardCfgBndlTslotStatus.setStatus('mandatory') if mibBuilder.loadTexts: vsmCardCfgBndlTslotStatus.setDescription('Enables the collection of Bundle and Timeslot status') vsm_link_table = mib_table((1, 3, 6, 1, 4, 1, 251, 1, 1, 47, 2)) if mibBuilder.loadTexts: vsmLinkTable.setStatus('mandatory') if mibBuilder.loadTexts: vsmLinkTable.setDescription('Table for VSM Link configuration') vsm_link_entry = mib_table_row((1, 3, 6, 1, 4, 1, 251, 1, 1, 47, 2, 1)).setIndexNames((0, 'Vsm-MIB', 'vsmLinkLink')) if mibBuilder.loadTexts: vsmLinkEntry.setStatus('mandatory') vsm_link_link = mib_table_column((1, 3, 6, 1, 4, 1, 251, 1, 1, 47, 2, 1, 1), integer32().subtype(subtypeSpec=value_range_constraint(0, 3))).setMaxAccess('readonly') if mibBuilder.loadTexts: vsmLinkLink.setStatus('mandatory') if mibBuilder.loadTexts: vsmLinkLink.setDescription('Link Number for Table Entry') vsm_link_enable = mib_table_column((1, 3, 6, 1, 4, 1, 251, 1, 1, 47, 2, 1, 2), integer32().subtype(subtypeSpec=constraints_union(single_value_constraint(2, 1))).clone(namedValues=named_values(('disabled', 2), ('enabled', 1))).clone('disabled')).setMaxAccess('readwrite') if mibBuilder.loadTexts: vsmLinkEnable.setStatus('mandatory') if mibBuilder.loadTexts: vsmLinkEnable.setDescription("Enable/Disable Link <DETAIL_DESCRIPTION> The user has the ability to enable or disable each of the LIM's links individually.") vsm_link_enable_stat = mib_table_column((1, 3, 6, 1, 4, 1, 251, 1, 1, 47, 2, 1, 3), integer32().subtype(subtypeSpec=constraints_union(single_value_constraint(2, 1, 3, 4, 5, 6, 7, 8))).clone(namedValues=named_values(('disabled', 2), ('enabled', 1), ('wait-for-valid-lim', 3), ('link-not-used', 4), ('error', 5), ('wait-signaling-lim', 6), ('wait-lim-framing', 7), ('wait-frame-bit', 8))).clone('disabled')).setMaxAccess('readonly') if mibBuilder.loadTexts: vsmLinkEnableStat.setStatus('mandatory') if mibBuilder.loadTexts: vsmLinkEnableStat.setDescription('Link Enable Status <DETAIL_DESCRIPTION> The current status of link depends on a valid lim type, the availability of a link on the LIM and LIM Configuration.') vsm_link_sig_type = mib_table_column((1, 3, 6, 1, 4, 1, 251, 1, 1, 47, 2, 1, 4), integer32().subtype(subtypeSpec=constraints_union(single_value_constraint(2, 1))).clone(namedValues=named_values(('cas', 2), ('none', 1))).clone('cas')).setMaxAccess('readwrite') if mibBuilder.loadTexts: vsmLinkSigType.setStatus('mandatory') if mibBuilder.loadTexts: vsmLinkSigType.setDescription("Enable/Disable Signalling <DETAIL_DESCRIPTION> The user has the ability to enable or disable signalling for each of the LIM's links individually.") vsm_ts_cfg_table = mib_table((1, 3, 6, 1, 4, 1, 251, 1, 1, 47, 3)) if mibBuilder.loadTexts: vsmTsCfgTable.setStatus('mandatory') if mibBuilder.loadTexts: vsmTsCfgTable.setDescription('The timeslot configuration table.') vsm_ts_cfg_table_entry = mib_table_row((1, 3, 6, 1, 4, 1, 251, 1, 1, 47, 3, 1)).setIndexNames((0, 'Vsm-MIB', 'vsmTsCfgLinkNo'), (0, 'Vsm-MIB', 'vsmTsCfgTsNo')) if mibBuilder.loadTexts: vsmTsCfgTableEntry.setStatus('mandatory') vsm_ts_cfg_link_no = mib_table_column((1, 3, 6, 1, 4, 1, 251, 1, 1, 47, 3, 1, 1), integer32().subtype(subtypeSpec=value_range_constraint(0, 3))).setMaxAccess('readwrite') if mibBuilder.loadTexts: vsmTsCfgLinkNo.setStatus('mandatory') if mibBuilder.loadTexts: vsmTsCfgLinkNo.setDescription('The link number.') vsm_ts_cfg_ts_no = mib_table_column((1, 3, 6, 1, 4, 1, 251, 1, 1, 47, 3, 1, 2), integer32().subtype(subtypeSpec=value_range_constraint(0, 31))).setMaxAccess('readwrite') if mibBuilder.loadTexts: vsmTsCfgTsNo.setStatus('mandatory') if mibBuilder.loadTexts: vsmTsCfgTsNo.setDescription('The timeslot number of the link.') vsm_ts_cfg_bundle_no = mib_table_column((1, 3, 6, 1, 4, 1, 251, 1, 1, 47, 3, 1, 3), vsm_bundle().clone(1)).setMaxAccess('readwrite') if mibBuilder.loadTexts: vsmTsCfgBundleNo.setStatus('mandatory') if mibBuilder.loadTexts: vsmTsCfgBundleNo.setDescription('The Bundle mapped to this timeslot.') vsm_ts_cfg_aal_typ = mib_table_column((1, 3, 6, 1, 4, 1, 251, 1, 1, 47, 3, 1, 4), integer32().subtype(subtypeSpec=constraints_union(single_value_constraint(2, 1))).clone(namedValues=named_values(('aal2', 2), ('aal1', 1))).clone('aal2')).setMaxAccess('readwrite') if mibBuilder.loadTexts: vsmTsCfgAALTyp.setStatus('mandatory') if mibBuilder.loadTexts: vsmTsCfgAALTyp.setDescription('AAL type used for timeslot. This must match the AAL type used by the bundle to which this timeslot is assigned.') vsm_ts_cfg_chan_id = mib_table_column((1, 3, 6, 1, 4, 1, 251, 1, 1, 47, 3, 1, 5), integer32().subtype(subtypeSpec=value_range_constraint(8, 255)).clone(8)).setMaxAccess('readwrite') if mibBuilder.loadTexts: vsmTsCfgChanID.setStatus('mandatory') if mibBuilder.loadTexts: vsmTsCfgChanID.setDescription('The Channel ID (CID) this TS is mapped to. The CID must be unique across AAL2 VCs of an end-to-end connection. AAL2 only. ') vsm_ts_cfg_cmprssion_typ = mib_table_column((1, 3, 6, 1, 4, 1, 251, 1, 1, 47, 3, 1, 6), integer32().subtype(subtypeSpec=constraints_union(single_value_constraint(2, 1))).clone(namedValues=named_values(('adpcmG726-32k', 2), ('none', 1))).clone('adpcmG726-32k')).setMaxAccess('readwrite') if mibBuilder.loadTexts: vsmTsCfgCmprssionTyp.setStatus('mandatory') if mibBuilder.loadTexts: vsmTsCfgCmprssionTyp.setDescription('The voice compression algorithm being used for the timeslot. AAL2 only.') vsm_ts_cfg_fax_mdm_hndlng = mib_table_column((1, 3, 6, 1, 4, 1, 251, 1, 1, 47, 3, 1, 7), integer32().subtype(subtypeSpec=constraints_union(single_value_constraint(2, 1))).clone(namedValues=named_values(('auto-disable', 2), ('always-compress', 1))).clone('auto-disable')).setMaxAccess('readwrite') if mibBuilder.loadTexts: vsmTsCfgFaxMdmHndlng.setStatus('mandatory') if mibBuilder.loadTexts: vsmTsCfgFaxMdmHndlng.setDescription('The option to handle Fax/Modem signal. AAL2 only. pass-through: make no change when tone is detected, if compressing then keep compressing.bypass: If compressing and tone detected, attempt to switch to uncompressed') vsm_ts_cfg_echo_cancel = mib_table_column((1, 3, 6, 1, 4, 1, 251, 1, 1, 47, 3, 1, 8), integer32().subtype(subtypeSpec=constraints_union(single_value_constraint(3, 1, 2))).clone(namedValues=named_values(('auto-disable', 3), ('enable', 1), ('disable', 2))).clone('auto-disable')).setMaxAccess('readwrite') if mibBuilder.loadTexts: vsmTsCfgEchoCancel.setStatus('mandatory') if mibBuilder.loadTexts: vsmTsCfgEchoCancel.setDescription('Indicate whether echo cancellation is enabled.') vsm_ts_cfg_silence_rmvl = mib_table_column((1, 3, 6, 1, 4, 1, 251, 1, 1, 47, 3, 1, 9), integer32().subtype(subtypeSpec=constraints_union(single_value_constraint(3, 1, 2))).clone(namedValues=named_values(('auto-disable', 3), ('enable', 1), ('disable', 2))).clone('auto-disable')).setMaxAccess('readwrite') if mibBuilder.loadTexts: vsmTsCfgSilenceRmvl.setStatus('mandatory') if mibBuilder.loadTexts: vsmTsCfgSilenceRmvl.setDescription('Allows for the configuration of silence removal. Auto will disable silence removal when a FAX/modem tone is detected. AAL2 only.') vsm_ts_cfg_idle_detect = mib_table_column((1, 3, 6, 1, 4, 1, 251, 1, 1, 47, 3, 1, 10), 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: vsmTsCfgIdleDetect.setStatus('mandatory') if mibBuilder.loadTexts: vsmTsCfgIdleDetect.setDescription('Indicate whether idle channel detection is enabled. If disabled this timeslot will always send cells, even when on hook. AAL2 only.') vsm_ts_cfg_rmt_law = mib_table_column((1, 3, 6, 1, 4, 1, 251, 1, 1, 47, 3, 1, 11), integer32().subtype(subtypeSpec=constraints_union(single_value_constraint(3, 1, 2))).clone(namedValues=named_values(('auto', 3), ('u-law', 1), ('a-law', 2))).clone('auto')).setMaxAccess('readwrite') if mibBuilder.loadTexts: vsmTsCfgRmtLaw.setStatus('mandatory') if mibBuilder.loadTexts: vsmTsCfgRmtLaw.setDescription("Indicates the remote VSM's companding type. u-law for T1, a-law for E1. Auto means use the same type as the local link.") vsm_ts_cfg_signal_typ = mib_table_column((1, 3, 6, 1, 4, 1, 251, 1, 1, 47, 3, 1, 12), integer32().subtype(subtypeSpec=constraints_union(single_value_constraint(6, 2, 3, 4, 5, 7, 8, 1))).clone(namedValues=named_values(('e-and-m', 6), ('gs-fxo-fxs', 2), ('gs-fxs-fxo', 3), ('ls-fxo-fxs', 4), ('ls-fxs-fxo', 5), ('ssr2', 7), ('plar', 8), ('none', 1))).clone('e-and-m')).setMaxAccess('readwrite') if mibBuilder.loadTexts: vsmTsCfgSignalTyp.setStatus('mandatory') if mibBuilder.loadTexts: vsmTsCfgSignalTyp.setDescription('This object specifies the signal type of the timeslot. None is used to turn off signaling to allow for data transport.') vsm_ts_cfg_sig_cnd_typ_nb = mib_table_column((1, 3, 6, 1, 4, 1, 251, 1, 1, 47, 3, 1, 13), integer32().subtype(subtypeSpec=constraints_union(single_value_constraint(1, 2, 3, 5, 6, 7))).clone(namedValues=named_values(('onhook-A0B0', 1), ('onhook-A0B1', 2), ('offhook-A01B01', 3), ('failure-A1B1', 5), ('failure-A10B1', 6), ('failure-A1B1C1D1', 7))).clone('onhook-A0B0')).setMaxAccess('readwrite') if mibBuilder.loadTexts: vsmTsCfgSigCndTypNB.setStatus('mandatory') if mibBuilder.loadTexts: vsmTsCfgSigCndTypNB.setDescription('The object specifies the type of signaling conditioning to narrowband.') vsm_ts_cfg_sig_cnd_typ_atm = mib_table_column((1, 3, 6, 1, 4, 1, 251, 1, 1, 47, 3, 1, 14), integer32().subtype(subtypeSpec=constraints_union(single_value_constraint(1, 2, 3, 5, 6, 7))).clone(namedValues=named_values(('onhook-A0B0', 1), ('onhook-A0B1', 2), ('offhook-A01B01', 3), ('failure-A1B1', 5), ('failure-A10B1', 6), ('failure-A1B1C1D1', 7))).clone('onhook-A0B0')).setMaxAccess('readwrite') if mibBuilder.loadTexts: vsmTsCfgSigCndTypATM.setStatus('mandatory') if mibBuilder.loadTexts: vsmTsCfgSigCndTypATM.setDescription('The object specifies the type of signaling conditioning to ATM.') vsm_ts_cfg_data_cnd_typ_nb = mib_table_column((1, 3, 6, 1, 4, 1, 251, 1, 1, 47, 3, 1, 15), integer32().subtype(subtypeSpec=constraints_union(single_value_constraint(2, 3, 4, 5, 6, 7, 8, 9, 10, 1))).clone(namedValues=named_values(('muLaw-0V-7F', 2), ('muLaw-0V-FF', 3), ('aLaw-0V-D5', 4), ('aLaw-0V-54', 5), ('dacs-trbl-E4', 6), ('ctrl-mode-FE', 7), ('cir-oos-36', 8), ('mux-oos-1A', 9), ('user-data-FF', 10), ('none', 1))).clone('muLaw-0V-7F')).setMaxAccess('readwrite') if mibBuilder.loadTexts: vsmTsCfgDataCndTypNB.setStatus('mandatory') if mibBuilder.loadTexts: vsmTsCfgDataCndTypNB.setDescription('The object specifies the type of data conditioning to narrowband.') vsm_ts_cfg_data_cnd_typ_atm = mib_table_column((1, 3, 6, 1, 4, 1, 251, 1, 1, 47, 3, 1, 16), integer32().subtype(subtypeSpec=constraints_union(single_value_constraint(2, 3, 4, 5, 6, 7, 8, 9, 10, 1))).clone(namedValues=named_values(('muLaw-0V-7F', 2), ('muLaw-0V-FF', 3), ('aLaw-0V-D5', 4), ('aLaw-0V-54', 5), ('dacs-trbl-E4', 6), ('ctrl-mode-FE', 7), ('cir-oos-36', 8), ('mux-oos-1A', 9), ('user-data-FF', 10), ('none', 1))).clone('muLaw-0V-7F')).setMaxAccess('readwrite') if mibBuilder.loadTexts: vsmTsCfgDataCndTypATM.setStatus('mandatory') if mibBuilder.loadTexts: vsmTsCfgDataCndTypATM.setDescription('The object specifies the type of data conditioning to ATM.') vsm_ts_cfg_multicast = mib_table_column((1, 3, 6, 1, 4, 1, 251, 1, 1, 47, 3, 1, 17), integer32().subtype(subtypeSpec=constraints_union(single_value_constraint(2, 1))).clone(namedValues=named_values(('disabled', 2), ('enabled', 1))).clone('disabled')).setMaxAccess('readwrite') if mibBuilder.loadTexts: vsmTsCfgMulticast.setStatus('mandatory') if mibBuilder.loadTexts: vsmTsCfgMulticast.setDescription('Multicast state: disabled = no multicast') vsm_ts_cfg_oper_status = mib_table_column((1, 3, 6, 1, 4, 1, 251, 1, 1, 47, 3, 1, 18), integer32().subtype(subtypeSpec=constraints_union(single_value_constraint(2, 1, 3, 4, 5, 6, 7, 9, 10, 11, 12, 13, 14, 15, 16, 17))).clone(namedValues=named_values(('down', 2), ('up', 1), ('configured', 3), ('inv-cfg', 4), ('aal-mismatch', 5), ('no-more-DSPs', 6), ('inv-CID', 7), ('inv-Lk-no', 9), ('inv-Sil-Det', 10), ('inv-CmpTyp', 11), ('unknown-Lim', 12), ('inv-MCast', 13), ('inv-maxtslot', 14), ('aal1-max-TS', 15), ('inv-MCast-BN', 16), ('non-CAS-link', 17))).clone('down')).setMaxAccess('readonly') if mibBuilder.loadTexts: vsmTsCfgOperStatus.setStatus('mandatory') if mibBuilder.loadTexts: vsmTsCfgOperStatus.setDescription('The operating status of the timeslot.') vsm_ts_cfg_admin_status = mib_table_column((1, 3, 6, 1, 4, 1, 251, 1, 1, 47, 3, 1, 19), integer32().subtype(subtypeSpec=constraints_union(single_value_constraint(2, 1, 3))).clone(namedValues=named_values(('down', 2), ('up', 1), ('reconfig', 3))).clone('down')).setMaxAccess('readwrite') if mibBuilder.loadTexts: vsmTsCfgAdminStatus.setStatus('mandatory') if mibBuilder.loadTexts: vsmTsCfgAdminStatus.setDescription('The administrative status of the timeslot.') vsm_ts_cfg_validity = mib_table_column((1, 3, 6, 1, 4, 1, 251, 1, 1, 47, 3, 1, 20), integer32().subtype(subtypeSpec=constraints_union(single_value_constraint(1, 2))).clone(namedValues=named_values(('valid', 1), ('invalid', 2)))).setMaxAccess('readwrite') if mibBuilder.loadTexts: vsmTsCfgValidity.setStatus('mandatory') if mibBuilder.loadTexts: vsmTsCfgValidity.setDescription('Set to invalid(2) to delete this row.') vsm_bundle_cfg_table = mib_table((1, 3, 6, 1, 4, 1, 251, 1, 1, 47, 4)) if mibBuilder.loadTexts: vsmBundleCfgTable.setStatus('mandatory') if mibBuilder.loadTexts: vsmBundleCfgTable.setDescription('The configuration table for a Bundle. <DETAIL_DESCRIPTION> A VSM Bundle specifies the service requirements of a virtual channel connection, including AAL type, connection type (pvc,svc), bandwidth and QoS.') vsm_bundle_cfg_table_entry = mib_table_row((1, 3, 6, 1, 4, 1, 251, 1, 1, 47, 4, 1)).setIndexNames((0, 'Vsm-MIB', 'vsmBundleCfgNo')) if mibBuilder.loadTexts: vsmBundleCfgTableEntry.setStatus('mandatory') vsm_bundle_cfg_no = mib_table_column((1, 3, 6, 1, 4, 1, 251, 1, 1, 47, 4, 1, 1), vsm_bundle()).setMaxAccess('readwrite') if mibBuilder.loadTexts: vsmBundleCfgNo.setStatus('mandatory') if mibBuilder.loadTexts: vsmBundleCfgNo.setDescription('The Bundle number.') vsm_bundle_cfg_vc_vpi = mib_table_column((1, 3, 6, 1, 4, 1, 251, 1, 1, 47, 4, 1, 2), vpi_integer().clone(1)).setMaxAccess('readwrite') if mibBuilder.loadTexts: vsmBundleCfgVcVpi.setStatus('mandatory') if mibBuilder.loadTexts: vsmBundleCfgVcVpi.setDescription('The VPI of the VCC.') vsm_bundle_cfg_vc_vci = mib_table_column((1, 3, 6, 1, 4, 1, 251, 1, 1, 47, 4, 1, 3), vci_integer().clone(1)).setMaxAccess('readonly') if mibBuilder.loadTexts: vsmBundleCfgVcVci.setStatus('mandatory') if mibBuilder.loadTexts: vsmBundleCfgVcVci.setDescription('The VCI of the VCC. This is the same as the Bundle no. for VSM.') vsm_bundle_cfg_vc_aal_typ = mib_table_column((1, 3, 6, 1, 4, 1, 251, 1, 1, 47, 4, 1, 4), integer32().subtype(subtypeSpec=constraints_union(single_value_constraint(2, 1))).clone(namedValues=named_values(('aal2', 2), ('aal1', 1))).clone('aal2')).setMaxAccess('readwrite') if mibBuilder.loadTexts: vsmBundleCfgVcAALTyp.setStatus('mandatory') if mibBuilder.loadTexts: vsmBundleCfgVcAALTyp.setDescription('The AAL type used for the Bundle. This must match the AAL type used by the timeslot that is assigned to this bundle.') vsm_bundle_cfg_max_tslot = mib_table_column((1, 3, 6, 1, 4, 1, 251, 1, 1, 47, 4, 1, 5), integer32().subtype(subtypeSpec=value_range_constraint(1, 120)).clone(1)).setMaxAccess('readwrite') if mibBuilder.loadTexts: vsmBundleCfgMaxTslot.setStatus('mandatory') if mibBuilder.loadTexts: vsmBundleCfgMaxTslot.setDescription('Specify the maximum number of timeslots that will be configured for the bundle. AAL2 only') vsm_bundle_cfg_vc_cdv = mib_table_column((1, 3, 6, 1, 4, 1, 251, 1, 1, 47, 4, 1, 6), integer32().subtype(subtypeSpec=value_range_constraint(1, 128)).clone(8)).setMaxAccess('readwrite') if mibBuilder.loadTexts: vsmBundleCfgVcCDV.setStatus('mandatory') if mibBuilder.loadTexts: vsmBundleCfgVcCDV.setDescription('ATM cell delay variation between VSMs (in 125 microsecond intervals) <DETAIL_DESCRIPTION> ATM cell delay variation between VSMs (in 125 microsecond intervals). The maximum programmable value for cell delay variation is 16 milliseconds. Therefore, the greatest number which may be entered in this field is 128 (128 * 125 microsecond units). The default value is 8 (1 millisecond).') vsm_bundle_cfg_timer_cu = mib_table_column((1, 3, 6, 1, 4, 1, 251, 1, 1, 47, 4, 1, 7), integer32().subtype(subtypeSpec=value_range_constraint(0, 20)).clone(4)).setMaxAccess('readwrite') if mibBuilder.loadTexts: vsmBundleCfgTimerCU.setStatus('mandatory') if mibBuilder.loadTexts: vsmBundleCfgTimerCU.setDescription('Maximum amount of time (msec) to hold ATM cell before padding and sending. 0 results in an infinite wait. AAL2 only.') vsm_bundle_cfg_ces_partial_fill = mib_table_column((1, 3, 6, 1, 4, 1, 251, 1, 1, 47, 4, 1, 8), integer32().subtype(subtypeSpec=value_range_constraint(1, 47)).clone(47)).setMaxAccess('readwrite') if mibBuilder.loadTexts: vsmBundleCfgCESPartialFill.setStatus('mandatory') if mibBuilder.loadTexts: vsmBundleCfgCESPartialFill.setDescription('Specify the no. of user octets per cell for partial cell fill. AAL1 only.') vsm_bundle_cfg_vc_typ = mib_table_column((1, 3, 6, 1, 4, 1, 251, 1, 1, 47, 4, 1, 9), integer32().subtype(subtypeSpec=constraints_union(single_value_constraint(1, 2, 3))).clone(namedValues=named_values(('pvc', 1), ('spvc', 2), ('svc', 3))).clone('pvc')).setMaxAccess('readwrite') if mibBuilder.loadTexts: vsmBundleCfgVcTyp.setStatus('mandatory') if mibBuilder.loadTexts: vsmBundleCfgVcTyp.setDescription('The option to setup VCC.') vsm_bundle_cfg_trap_cfg = mib_table_column((1, 3, 6, 1, 4, 1, 251, 1, 1, 47, 4, 1, 10), integer32().subtype(subtypeSpec=constraints_union(single_value_constraint(1, 2))).clone(namedValues=named_values(('no-trap', 1), ('state-change', 2))).clone('no-trap')).setMaxAccess('readwrite') if mibBuilder.loadTexts: vsmBundleCfgTrapCfg.setStatus('mandatory') if mibBuilder.loadTexts: vsmBundleCfgTrapCfg.setDescription('State change results in traps sent to the management station.') vsm_bundle_cfg_oper_status = mib_table_column((1, 3, 6, 1, 4, 1, 251, 1, 1, 47, 4, 1, 11), integer32().subtype(subtypeSpec=constraints_union(single_value_constraint(2, 1, 3, 4, 5, 7, 9, 10, 11))).clone(namedValues=named_values(('down', 2), ('up', 1), ('configured', 3), ('inv-cfg', 4), ('aal-mismatch', 5), ('inv-VPI', 7), ('bndl-novc', 9), ('inv-maxtslot', 10), ('inv-VPI-15', 11))).clone('down')).setMaxAccess('readonly') if mibBuilder.loadTexts: vsmBundleCfgOperStatus.setStatus('mandatory') if mibBuilder.loadTexts: vsmBundleCfgOperStatus.setDescription('The operating status of the bundle.') vsm_bundle_cfg_admin_status = mib_table_column((1, 3, 6, 1, 4, 1, 251, 1, 1, 47, 4, 1, 12), integer32().subtype(subtypeSpec=constraints_union(single_value_constraint(2, 1, 3))).clone(namedValues=named_values(('down', 2), ('up', 1), ('reconfig', 3))).clone('down')).setMaxAccess('readwrite') if mibBuilder.loadTexts: vsmBundleCfgAdminStatus.setStatus('mandatory') if mibBuilder.loadTexts: vsmBundleCfgAdminStatus.setDescription('The administration status of the bundle.') vsm_bundle_cfg_validity = mib_table_column((1, 3, 6, 1, 4, 1, 251, 1, 1, 47, 4, 1, 13), integer32().subtype(subtypeSpec=constraints_union(single_value_constraint(1, 2))).clone(namedValues=named_values(('valid', 1), ('invalid', 2)))).setMaxAccess('readwrite') if mibBuilder.loadTexts: vsmBundleCfgValidity.setStatus('mandatory') if mibBuilder.loadTexts: vsmBundleCfgValidity.setDescription('Set to invalid(2) to delete this row.') vsm_card_stat_table = mib_table((1, 3, 6, 1, 4, 1, 251, 1, 1, 47, 5)) if mibBuilder.loadTexts: vsmCardStatTable.setStatus('mandatory') if mibBuilder.loadTexts: vsmCardStatTable.setDescription('The VSM card status table.') vsm_card_stat_table_entry = mib_table_row((1, 3, 6, 1, 4, 1, 251, 1, 1, 47, 5, 1)).setIndexNames((0, 'Vsm-MIB', 'vsmCardStatIndex')) if mibBuilder.loadTexts: vsmCardStatTableEntry.setStatus('mandatory') vsm_card_stat_index = mib_table_column((1, 3, 6, 1, 4, 1, 251, 1, 1, 47, 5, 1, 1), integer32().subtype(subtypeSpec=value_range_constraint(0, 0))).setMaxAccess('readonly') if mibBuilder.loadTexts: vsmCardStatIndex.setStatus('mandatory') if mibBuilder.loadTexts: vsmCardStatIndex.setDescription('Index for VSM Card Status Table') vsm_card_stat_bd_type = mib_table_column((1, 3, 6, 1, 4, 1, 251, 1, 1, 47, 5, 1, 2), display_string().subtype(subtypeSpec=value_size_constraint(0, 40))).setMaxAccess('readonly') if mibBuilder.loadTexts: vsmCardStatBdType.setStatus('mandatory') if mibBuilder.loadTexts: vsmCardStatBdType.setDescription('VSM Hardware type') vsm_card_stat_hwsw_compatibility = mib_table_column((1, 3, 6, 1, 4, 1, 251, 1, 1, 47, 5, 1, 3), display_string().subtype(subtypeSpec=value_size_constraint(0, 40))).setMaxAccess('readonly') if mibBuilder.loadTexts: vsmCardStatHWSWCompatibility.setStatus('mandatory') if mibBuilder.loadTexts: vsmCardStatHWSWCompatibility.setDescription('Hardware Software Compatibility between bin, Basecard & DOC') vsm_card_stat_bin_pres = mib_table_column((1, 3, 6, 1, 4, 1, 251, 1, 1, 47, 5, 1, 4), integer32().subtype(subtypeSpec=constraints_union(single_value_constraint(1, 2))).clone(namedValues=named_values(('bin-not-present', 1), ('present', 2)))).setMaxAccess('readonly') if mibBuilder.loadTexts: vsmCardStatBinPres.setStatus('mandatory') if mibBuilder.loadTexts: vsmCardStatBinPres.setDescription('Indicates presence of vsm.bin file') vsm_card_stat_bin_rev = mib_table_column((1, 3, 6, 1, 4, 1, 251, 1, 1, 47, 5, 1, 5), display_string().subtype(subtypeSpec=value_size_constraint(0, 8))).setMaxAccess('readonly') if mibBuilder.loadTexts: vsmCardStatBinRev.setStatus('mandatory') if mibBuilder.loadTexts: vsmCardStatBinRev.setDescription('The vsm.bin revision number') vsm_card_stat_bd_rev = mib_table_column((1, 3, 6, 1, 4, 1, 251, 1, 1, 47, 5, 1, 6), display_string().subtype(subtypeSpec=value_size_constraint(0, 20))).setMaxAccess('readonly') if mibBuilder.loadTexts: vsmCardStatBdRev.setStatus('mandatory') if mibBuilder.loadTexts: vsmCardStatBdRev.setDescription('The Card Hardware Feature Revision') vsm_card_stat_doc1_type = mib_table_column((1, 3, 6, 1, 4, 1, 251, 1, 1, 47, 5, 1, 7), integer32().subtype(subtypeSpec=constraints_union(single_value_constraint(1, 2, 3, 4))).clone(namedValues=named_values(('unknown-doc-type', 1), ('type-48-channel', 2), ('type-60-channel', 3), ('doc-not-present', 4)))).setMaxAccess('readonly') if mibBuilder.loadTexts: vsmCardStatDoc1Type.setStatus('mandatory') if mibBuilder.loadTexts: vsmCardStatDoc1Type.setDescription('DOC 1 type supports 48 or 60 channels') vsm_card_stat_doc1_type_rev = mib_table_column((1, 3, 6, 1, 4, 1, 251, 1, 1, 47, 5, 1, 8), display_string().subtype(subtypeSpec=value_size_constraint(0, 30))).setMaxAccess('readonly') if mibBuilder.loadTexts: vsmCardStatDoc1TypeRev.setStatus('mandatory') if mibBuilder.loadTexts: vsmCardStatDoc1TypeRev.setDescription('DOC 1 Hardware Revision') vsm_card_stat_doc2_type = mib_table_column((1, 3, 6, 1, 4, 1, 251, 1, 1, 47, 5, 1, 9), integer32().subtype(subtypeSpec=constraints_union(single_value_constraint(1, 2, 3, 4))).clone(namedValues=named_values(('unknown-doc-type', 1), ('type-48-channel', 2), ('type-60-channel', 3), ('doc-not-present', 4)))).setMaxAccess('readonly') if mibBuilder.loadTexts: vsmCardStatDoc2Type.setStatus('mandatory') if mibBuilder.loadTexts: vsmCardStatDoc2Type.setDescription('DOC 2 type supports 48 or 60 channels') vsm_card_stat_doc2_type_rev = mib_table_column((1, 3, 6, 1, 4, 1, 251, 1, 1, 47, 5, 1, 10), display_string().subtype(subtypeSpec=value_size_constraint(0, 30))).setMaxAccess('readonly') if mibBuilder.loadTexts: vsmCardStatDoc2TypeRev.setStatus('mandatory') if mibBuilder.loadTexts: vsmCardStatDoc2TypeRev.setDescription('DOC 2 Hardware Revision') vsm_card_stat_lim_type = mib_table_column((1, 3, 6, 1, 4, 1, 251, 1, 1, 47, 5, 1, 11), integer32().subtype(subtypeSpec=constraints_union(single_value_constraint(1, 2, 3, 4, 5))).clone(namedValues=named_values(('invalid-or-no-lim', 1), ('ds1-dual-signaling-lim', 2), ('ds1-quad-signaling-lim', 3), ('e1-dual-signaling-lim', 4), ('e1-quad-signaling-lim', 5)))).setMaxAccess('readonly') if mibBuilder.loadTexts: vsmCardStatLimType.setStatus('mandatory') if mibBuilder.loadTexts: vsmCardStatLimType.setDescription('LIM detected for the VSM card.') vsm_ts_stat_table = mib_table((1, 3, 6, 1, 4, 1, 251, 1, 1, 47, 6)) if mibBuilder.loadTexts: vsmTsStatTable.setStatus('mandatory') if mibBuilder.loadTexts: vsmTsStatTable.setDescription('The VSM Timeslot status table.') vsm_ts_stat_table_entry = mib_table_row((1, 3, 6, 1, 4, 1, 251, 1, 1, 47, 6, 1)).setIndexNames((0, 'Vsm-MIB', 'vsmTsStatLinkNo'), (0, 'Vsm-MIB', 'vsmTsStatTSNo')) if mibBuilder.loadTexts: vsmTsStatTableEntry.setStatus('mandatory') vsm_ts_stat_link_no = mib_table_column((1, 3, 6, 1, 4, 1, 251, 1, 1, 47, 6, 1, 1), integer32().subtype(subtypeSpec=value_range_constraint(0, 3))).setMaxAccess('readonly') if mibBuilder.loadTexts: vsmTsStatLinkNo.setStatus('mandatory') if mibBuilder.loadTexts: vsmTsStatLinkNo.setDescription('The Link Number') vsm_ts_stat_ts_no = mib_table_column((1, 3, 6, 1, 4, 1, 251, 1, 1, 47, 6, 1, 2), integer32().subtype(subtypeSpec=value_range_constraint(0, 31))).setMaxAccess('readonly') if mibBuilder.loadTexts: vsmTsStatTSNo.setStatus('mandatory') if mibBuilder.loadTexts: vsmTsStatTSNo.setDescription('The timeslot number of the link.') vsm_ts_stat_bundle_no = mib_table_column((1, 3, 6, 1, 4, 1, 251, 1, 1, 47, 6, 1, 3), vsm_bundle()).setMaxAccess('readonly') if mibBuilder.loadTexts: vsmTsStatBundleNo.setStatus('mandatory') if mibBuilder.loadTexts: vsmTsStatBundleNo.setDescription('The Bundle number.') vsm_ts_stat_xmit_bytes = mib_table_column((1, 3, 6, 1, 4, 1, 251, 1, 1, 47, 6, 1, 4), counter32()).setMaxAccess('readonly') if mibBuilder.loadTexts: vsmTsStatXmitBytes.setStatus('mandatory') if mibBuilder.loadTexts: vsmTsStatXmitBytes.setDescription('Number of bytes which have been transmitted <DETAIL_DESCRIPTION> Only applies to AAL2 operating mode. This object provides the user with a count of the number of bytes which have been transmitted to the service interface.') vsm_ts_stat_recv_bytes = mib_table_column((1, 3, 6, 1, 4, 1, 251, 1, 1, 47, 6, 1, 5), counter32()).setMaxAccess('readonly') if mibBuilder.loadTexts: vsmTsStatRecvBytes.setStatus('mandatory') if mibBuilder.loadTexts: vsmTsStatRecvBytes.setDescription('Number of packets which have been reassembled <DETAIL_DESCRIPTION> Only applies to AAL2 operating mode. This object provides the user with a count of the number of AAL2 packets which have been reassembled or played out to the service interface. It excludes packets that were discarded for any reason, including packets that were not used due to being declared misinserted or discarded while the reassembler was waiting to achieve synchronization') vsm_ts_stat_underflows = mib_table_column((1, 3, 6, 1, 4, 1, 251, 1, 1, 47, 6, 1, 6), counter32()).setMaxAccess('readonly') if mibBuilder.loadTexts: vsmTsStatUnderflows.setStatus('mandatory') if mibBuilder.loadTexts: vsmTsStatUnderflows.setDescription('Number of underflow indications <DETAIL_DESCRIPTION> Only applies to AAL2 operating mode. This object provides the user with a count of the number of underflow indications reported by the DSP to the Maker device (in 2 ms intervals).') vsm_ts_stat_lost_packets = mib_table_column((1, 3, 6, 1, 4, 1, 251, 1, 1, 47, 6, 1, 7), counter32()).setMaxAccess('readonly') if mibBuilder.loadTexts: vsmTsStatLostPackets.setStatus('mandatory') if mibBuilder.loadTexts: vsmTsStatLostPackets.setDescription('Number of lost packets <DETAIL_DESCRIPTION> Only applies to AAL2 operating mode. This object provides the user with a count of the number of AAL2 packets which have been detected as lost in the network prior to the destination CES IWF layer processing. The cause of a lost packet is an invalid sequence number.') vsm_ts_stat_aal_type = mib_table_column((1, 3, 6, 1, 4, 1, 251, 1, 1, 47, 6, 1, 8), integer32().subtype(subtypeSpec=constraints_union(single_value_constraint(2, 1))).clone(namedValues=named_values(('aal2', 2), ('aal1', 1))).clone('aal2')).setMaxAccess('readonly') if mibBuilder.loadTexts: vsmTsStatAALType.setStatus('mandatory') if mibBuilder.loadTexts: vsmTsStatAALType.setDescription('AAL type used for timeslot.') vsm_ts_stat_vcid = mib_table_column((1, 3, 6, 1, 4, 1, 251, 1, 1, 47, 6, 1, 9), integer32()).setMaxAccess('readonly') if mibBuilder.loadTexts: vsmTsStatVCID.setStatus('mandatory') if mibBuilder.loadTexts: vsmTsStatVCID.setDescription('The number of the CID on which this BC is transmitting') vsm_ts_stat_cid = mib_table_column((1, 3, 6, 1, 4, 1, 251, 1, 1, 47, 6, 1, 10), integer32()).setMaxAccess('readonly') if mibBuilder.loadTexts: vsmTsStatCID.setStatus('mandatory') if mibBuilder.loadTexts: vsmTsStatCID.setDescription('The number of the CID assigned to this BC') vsm_ts_stat_active = mib_table_column((1, 3, 6, 1, 4, 1, 251, 1, 1, 47, 6, 1, 11), integer32().subtype(subtypeSpec=constraints_union(single_value_constraint(1, 2))).clone(namedValues=named_values(('yes', 1), ('no', 2)))).setMaxAccess('readonly') if mibBuilder.loadTexts: vsmTsStatActive.setStatus('mandatory') if mibBuilder.loadTexts: vsmTsStatActive.setDescription('State of Time Slot (Bearer Channel): yes = active; no = not active <DETAIL_DESCRIPTION> Provides the user with the activity mode of each Time Slot individually. A Time Slot is considered active if it is being processed into ATM cells. Examples of active Time Slots: 1) an off-hook voice channel 2) any data channel Example of inactive Time Slot: 1) an on-hook voice channel ') vsm_ts_stat_data_lnk = mib_table_column((1, 3, 6, 1, 4, 1, 251, 1, 1, 47, 6, 1, 12), integer32().subtype(subtypeSpec=constraints_union(single_value_constraint(1, 2))).clone(namedValues=named_values(('dsp', 1), ('bypass', 2)))).setMaxAccess('readonly') if mibBuilder.loadTexts: vsmTsStatDataLnk.setStatus('mandatory') if mibBuilder.loadTexts: vsmTsStatDataLnk.setDescription('Indicates whether bearer channel is using DSP or Bypass') vsm_ts_stat_blocked = mib_table_column((1, 3, 6, 1, 4, 1, 251, 1, 1, 47, 6, 1, 13), integer32().subtype(subtypeSpec=constraints_union(single_value_constraint(2, 1))).clone(namedValues=named_values(('no', 2), ('yes', 1))).clone('no')).setMaxAccess('readonly') if mibBuilder.loadTexts: vsmTsStatBlocked.setStatus('mandatory') if mibBuilder.loadTexts: vsmTsStatBlocked.setDescription('Indicates whether bearer channel is in blocked mode') vsm_ts_stat_idle_idle = mib_table_column((1, 3, 6, 1, 4, 1, 251, 1, 1, 47, 6, 1, 14), integer32().subtype(subtypeSpec=constraints_union(single_value_constraint(2, 1))).clone(namedValues=named_values(('no', 2), ('yes', 1))).clone('no')).setMaxAccess('readonly') if mibBuilder.loadTexts: vsmTsStatIdleIdle.setStatus('mandatory') if mibBuilder.loadTexts: vsmTsStatIdleIdle.setDescription('Indicates whether bearer channel is on-hook or off-hook') vsm_ts_stat_hold = mib_table_column((1, 3, 6, 1, 4, 1, 251, 1, 1, 47, 6, 1, 15), integer32().subtype(subtypeSpec=constraints_union(single_value_constraint(2, 1))).clone(namedValues=named_values(('no', 2), ('yes', 1))).clone('no')).setMaxAccess('readonly') if mibBuilder.loadTexts: vsmTsStatHold.setStatus('mandatory') if mibBuilder.loadTexts: vsmTsStatHold.setDescription('Indicates whether bearer channel is in hold mode') vsm_ts_stat_remote_compressed = mib_table_column((1, 3, 6, 1, 4, 1, 251, 1, 1, 47, 6, 1, 16), integer32().subtype(subtypeSpec=constraints_union(single_value_constraint(2, 1))).clone(namedValues=named_values(('no', 2), ('yes', 1))).clone('no')).setMaxAccess('readonly') if mibBuilder.loadTexts: vsmTsStatRemoteCompressed.setStatus('mandatory') if mibBuilder.loadTexts: vsmTsStatRemoteCompressed.setDescription('Indicates use of compression algorithm on remote channel <DETAIL_DESCRIPTION> A yes indicates that a compression algorithm is being used on the remote channel data. No indicates that no compression algorithm is being used on remote channel.') vsm_ts_stat_remote_silent = mib_table_column((1, 3, 6, 1, 4, 1, 251, 1, 1, 47, 6, 1, 17), integer32().subtype(subtypeSpec=constraints_union(single_value_constraint(2, 1))).clone(namedValues=named_values(('no', 2), ('yes', 1))).clone('no')).setMaxAccess('readonly') if mibBuilder.loadTexts: vsmTsStatRemoteSilent.setStatus('mandatory') if mibBuilder.loadTexts: vsmTsStatRemoteSilent.setDescription('Indicates whether remote channel is in silent mode or non silent mode <DETAIL_DESCRIPTION> ') vsm_ts_stat_compressed = mib_table_column((1, 3, 6, 1, 4, 1, 251, 1, 1, 47, 6, 1, 18), integer32().subtype(subtypeSpec=constraints_union(single_value_constraint(2, 1))).clone(namedValues=named_values(('no', 2), ('yes', 1))).clone('no')).setMaxAccess('readonly') if mibBuilder.loadTexts: vsmTsStatCompressed.setStatus('mandatory') if mibBuilder.loadTexts: vsmTsStatCompressed.setDescription('Indicates use of compression algorithm on local channel <DETAIL_DESCRIPTION> A yes indicates that a compression algorithm is being used on the local channel data. No indicates that no compression algorithm is being used on the local channel.') vsm_ts_stat_silent = mib_table_column((1, 3, 6, 1, 4, 1, 251, 1, 1, 47, 6, 1, 19), integer32().subtype(subtypeSpec=constraints_union(single_value_constraint(2, 1))).clone(namedValues=named_values(('no', 2), ('yes', 1))).clone('no')).setMaxAccess('readonly') if mibBuilder.loadTexts: vsmTsStatSilent.setStatus('mandatory') if mibBuilder.loadTexts: vsmTsStatSilent.setDescription('Time Slot Silence Status <DETAIL_DESCRIPTION> Indicates whether local channel is in silent mode (yes) or non silent mode (no)') vsm_ts_stat_conditioning = mib_table_column((1, 3, 6, 1, 4, 1, 251, 1, 1, 47, 6, 1, 20), integer32().subtype(subtypeSpec=constraints_union(single_value_constraint(2, 1))).clone(namedValues=named_values(('no', 2), ('yes', 1))).clone('no')).setMaxAccess('readonly') if mibBuilder.loadTexts: vsmTsStatConditioning.setStatus('mandatory') if mibBuilder.loadTexts: vsmTsStatConditioning.setDescription('Conditioning status: yes = conditioning; no = not conditioning <DETAIL_DESCRIPTION> Data conditioning is initiated upon the detection of a variety of error situations including, but not limited to, LOS, LOF and AIS.') vsm_ts_stat_remote_conditioning = mib_table_column((1, 3, 6, 1, 4, 1, 251, 1, 1, 47, 6, 1, 21), integer32().subtype(subtypeSpec=constraints_union(single_value_constraint(2, 1))).clone(namedValues=named_values(('no', 2), ('yes', 1))).clone('no')).setMaxAccess('readonly') if mibBuilder.loadTexts: vsmTsStatRemoteConditioning.setStatus('mandatory') if mibBuilder.loadTexts: vsmTsStatRemoteConditioning.setDescription('Conditioning status: yes = conditioning; no = not conditioning <DETAIL_DESCRIPTION> Data conditioning is initiated upon the detection of a variety of error situations including, but not limited to, LOS, LOF and AIS.This indicates the remote side is conditioning.') vsm_ts_stat_riwf = mib_table_column((1, 3, 6, 1, 4, 1, 251, 1, 1, 47, 6, 1, 22), integer32().subtype(subtypeSpec=constraints_union(single_value_constraint(2, 1))).clone(namedValues=named_values(('no', 2), ('yes', 1))).clone('no')).setMaxAccess('readonly') if mibBuilder.loadTexts: vsmTsStatRIWF.setStatus('mandatory') if mibBuilder.loadTexts: vsmTsStatRIWF.setDescription('Remote interworking function alarm active <DETAIL_DESCRIPTION> ') vsm_ts_stat_lossof_refresh = mib_table_column((1, 3, 6, 1, 4, 1, 251, 1, 1, 47, 6, 1, 23), integer32().subtype(subtypeSpec=constraints_union(single_value_constraint(2, 1))).clone(namedValues=named_values(('no', 2), ('yes', 1))).clone('no')).setMaxAccess('readonly') if mibBuilder.loadTexts: vsmTsStatLossofRefresh.setStatus('mandatory') if mibBuilder.loadTexts: vsmTsStatLossofRefresh.setDescription("CAS Refresh status: yes = loss of refresh; no = no alarm <DETAIL_DESCRIPTION> This only applies when signalling is configured for the timeslot. When no signalling is configured this defaults to 'no'. When signalling is configured and it is detected that there is no response to the refresh packet, this bit is set to 'yes'. This will result in ATM signalling and data conditioning.") vsm_ts_stat_cas_values_pdh = mib_table_column((1, 3, 6, 1, 4, 1, 251, 1, 1, 47, 6, 1, 24), integer32().subtype(subtypeSpec=constraints_union(single_value_constraint(1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16))).clone(namedValues=named_values(('a0-b0-c0-d0', 1), ('a0-b0-c0-d1', 2), ('a0-b0-c1-d0', 3), ('a0-b0-c1-d1', 4), ('a0-b1-c0-d0', 5), ('a0-b1-c0-d1', 6), ('a0-b1-c1-d0', 7), ('a0-b1-c1-d1', 8), ('a1-b0-c0-d0', 9), ('a1-b0-c0-d1', 10), ('a1-b0-c1-d0', 11), ('a1-b0-c1-d1', 12), ('a1-b1-c0-d0', 13), ('a1-b1-c0-d1', 14), ('a1-b1-c1-d0', 15), ('a1-b1-c1-d1', 16)))).setMaxAccess('readonly') if mibBuilder.loadTexts: vsmTsStatCasValuesPDH.setStatus('mandatory') if mibBuilder.loadTexts: vsmTsStatCasValuesPDH.setDescription('Value of A B C D bits being sent from VSM physical interface (PDH side) <DETAIL_DESCRIPTION> Provides a snapshot of the current state of the A B C D signalling bits on the PDH side of the network') vsm_ts_stat_cas_values_atm = mib_table_column((1, 3, 6, 1, 4, 1, 251, 1, 1, 47, 6, 1, 25), integer32().subtype(subtypeSpec=constraints_union(single_value_constraint(1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16))).clone(namedValues=named_values(('a0-b0-c0-d0', 1), ('a0-b0-c0-d1', 2), ('a0-b0-c1-d0', 3), ('a0-b0-c1-d1', 4), ('a0-b1-c0-d0', 5), ('a0-b1-c0-d1', 6), ('a0-b1-c1-d0', 7), ('a0-b1-c1-d1', 8), ('a1-b0-c0-d0', 9), ('a1-b0-c0-d1', 10), ('a1-b0-c1-d0', 11), ('a1-b0-c1-d1', 12), ('a1-b1-c0-d0', 13), ('a1-b1-c0-d1', 14), ('a1-b1-c1-d0', 15), ('a1-b1-c1-d1', 16)))).setMaxAccess('readonly') if mibBuilder.loadTexts: vsmTsStatCasValuesATM.setStatus('mandatory') if mibBuilder.loadTexts: vsmTsStatCasValuesATM.setDescription('Value of A B C D bits being sent from the ATM network <DETAIL_DESCRIPTION> Provides a snapshot of the current state of the A B C D signalling bits on the ATM side of the network') vsm_ts_stat_reset = mib_table_column((1, 3, 6, 1, 4, 1, 251, 1, 1, 47, 6, 1, 26), integer32().subtype(subtypeSpec=constraints_union(single_value_constraint(2, 1))).clone(namedValues=named_values(('no', 2), ('yes', 1))).clone('no')).setMaxAccess('readwrite') if mibBuilder.loadTexts: vsmTsStatReset.setStatus('mandatory') if mibBuilder.loadTexts: vsmTsStatReset.setDescription('Set to yes(1) to reset all counters in the Time Slot status table.') vsm_bundle_stat_table = mib_table((1, 3, 6, 1, 4, 1, 251, 1, 1, 47, 7)) if mibBuilder.loadTexts: vsmBundleStatTable.setStatus('mandatory') if mibBuilder.loadTexts: vsmBundleStatTable.setDescription('The VSM Bundle status table.') vsm_bundle_stat_table_entry = mib_table_row((1, 3, 6, 1, 4, 1, 251, 1, 1, 47, 7, 1)).setIndexNames((0, 'Vsm-MIB', 'vsmBundleStatBundleNo')) if mibBuilder.loadTexts: vsmBundleStatTableEntry.setStatus('mandatory') vsm_bundle_stat_bundle_no = mib_table_column((1, 3, 6, 1, 4, 1, 251, 1, 1, 47, 7, 1, 1), vsm_bundle()).setMaxAccess('readonly') if mibBuilder.loadTexts: vsmBundleStatBundleNo.setStatus('mandatory') if mibBuilder.loadTexts: vsmBundleStatBundleNo.setDescription('The Bundle number.') vsm_bundle_stat_xmit_cells = mib_table_column((1, 3, 6, 1, 4, 1, 251, 1, 1, 47, 7, 1, 2), counter32()).setMaxAccess('readonly') if mibBuilder.loadTexts: vsmBundleStatXmitCells.setStatus('mandatory') if mibBuilder.loadTexts: vsmBundleStatXmitCells.setDescription('The count of the number of AAL2 cells transmitted') vsm_bundle_stat_recv_cells = mib_table_column((1, 3, 6, 1, 4, 1, 251, 1, 1, 47, 7, 1, 3), counter32()).setMaxAccess('readonly') if mibBuilder.loadTexts: vsmBundleStatRecvCells.setStatus('mandatory') if mibBuilder.loadTexts: vsmBundleStatRecvCells.setDescription('The count of cells that have been played out to the PDH link.') vsm_bundle_stat_pvc_active = mib_table_column((1, 3, 6, 1, 4, 1, 251, 1, 1, 47, 7, 1, 4), integer32().subtype(subtypeSpec=constraints_union(single_value_constraint(2, 1))).clone(namedValues=named_values(('not-active', 2), ('active', 1))).clone('not-active')).setMaxAccess('readonly') if mibBuilder.loadTexts: vsmBundleStatPvcActive.setStatus('mandatory') if mibBuilder.loadTexts: vsmBundleStatPvcActive.setDescription('Is the PVC on this Bundle active.') vsm_bundle_stat_aal_type = mib_table_column((1, 3, 6, 1, 4, 1, 251, 1, 1, 47, 7, 1, 5), integer32().subtype(subtypeSpec=constraints_union(single_value_constraint(2, 1))).clone(namedValues=named_values(('aal2', 2), ('aal1', 1))).clone('aal2')).setMaxAccess('readonly') if mibBuilder.loadTexts: vsmBundleStatAALType.setStatus('mandatory') if mibBuilder.loadTexts: vsmBundleStatAALType.setDescription('The AAL type used for the Bundle.') vsm_bundle_stat_buf_undrflws = mib_table_column((1, 3, 6, 1, 4, 1, 251, 1, 1, 47, 7, 1, 6), counter32()).setMaxAccess('readonly') if mibBuilder.loadTexts: vsmBundleStatBufUndrflws.setStatus('mandatory') if mibBuilder.loadTexts: vsmBundleStatBufUndrflws.setDescription('The number of buffer underflows (AAL1 only).') vsm_bundle_stat_buf_overflows = mib_table_column((1, 3, 6, 1, 4, 1, 251, 1, 1, 47, 7, 1, 7), counter32()).setMaxAccess('readonly') if mibBuilder.loadTexts: vsmBundleStatBufOverflows.setStatus('mandatory') if mibBuilder.loadTexts: vsmBundleStatBufOverflows.setDescription('The number of buffer overflows (AAL1 only).') vsm_bundle_stat_ptr_reframes = mib_table_column((1, 3, 6, 1, 4, 1, 251, 1, 1, 47, 7, 1, 8), counter32()).setMaxAccess('readonly') if mibBuilder.loadTexts: vsmBundleStatPtrReframes.setStatus('mandatory') if mibBuilder.loadTexts: vsmBundleStatPtrReframes.setDescription('The count of the number of events in which SDT pointer is not where it is expected (AAL1 only). <DETAIL_DESCRIPTION> The count of the number of events in which SDT pointer is not where it is expected (AAL1 only). This counter is 0 for unstructured CES mode') vsm_bundle_stat_lost_cells = mib_table_column((1, 3, 6, 1, 4, 1, 251, 1, 1, 47, 7, 1, 9), counter32()).setMaxAccess('readonly') if mibBuilder.loadTexts: vsmBundleStatLostCells.setStatus('mandatory') if mibBuilder.loadTexts: vsmBundleStatLostCells.setDescription('The number of AAL1 cells detected as lost prior to the destination') vsm_bundle_stat_hdr_errors = mib_table_column((1, 3, 6, 1, 4, 1, 251, 1, 1, 47, 7, 1, 10), counter32()).setMaxAccess('readonly') if mibBuilder.loadTexts: vsmBundleStatHdrErrors.setStatus('mandatory') if mibBuilder.loadTexts: vsmBundleStatHdrErrors.setDescription('The count of all AAL1 and AAL2 header errors <DETAIL_DESCRIPTION> The Header Error count represents a sum of start pointer, sequence number and parity errors.') vsm_bundle_stat_bad_cid = mib_table_column((1, 3, 6, 1, 4, 1, 251, 1, 1, 47, 7, 1, 11), counter32()).setMaxAccess('readonly') if mibBuilder.loadTexts: vsmBundleStatBadCID.setStatus('mandatory') if mibBuilder.loadTexts: vsmBundleStatBadCID.setDescription('The count of the number of AAL2 cells having a bad CID') vsm_bundle_stat_aal2_lost_cells = mib_table_column((1, 3, 6, 1, 4, 1, 251, 1, 1, 47, 7, 1, 12), counter32()).setMaxAccess('readonly') if mibBuilder.loadTexts: vsmBundleStatAAL2LostCells.setStatus('mandatory') if mibBuilder.loadTexts: vsmBundleStatAAL2LostCells.setDescription('The count of the number of lost AAL2 cells <DETAIL_DESCRIPTION> When operating in AAL2 mode, a non-zero count of lost cells is an indication that invalid sequence numbers exist') vsm_bundle_stat_reset = mib_table_column((1, 3, 6, 1, 4, 1, 251, 1, 1, 47, 7, 1, 13), integer32().subtype(subtypeSpec=constraints_union(single_value_constraint(2, 1))).clone(namedValues=named_values(('no', 2), ('yes', 1))).clone('no')).setMaxAccess('readwrite') if mibBuilder.loadTexts: vsmBundleStatReset.setStatus('mandatory') if mibBuilder.loadTexts: vsmBundleStatReset.setDescription('Set to yes(1) to reset all counters in the Bundle status table.') vsm_bundle_stat_conditioning = mib_table_column((1, 3, 6, 1, 4, 1, 251, 1, 1, 47, 7, 1, 14), integer32().subtype(subtypeSpec=constraints_union(single_value_constraint(2, 1))).clone(namedValues=named_values(('no', 2), ('yes', 1))).clone('no')).setMaxAccess('readonly') if mibBuilder.loadTexts: vsmBundleStatConditioning.setStatus('mandatory') if mibBuilder.loadTexts: vsmBundleStatConditioning.setDescription('Conditioning status: yes = conditioning; no = not conditioning <DETAIL_DESCRIPTION> Data conditioning is initiated upon the detection of any or all of a variety of errors including: no received cell flow, header errors, buffer underflow, buffer overflow, pointer reframes or lost cells.') mibBuilder.exportSymbols('Vsm-MIB', vsmTsStatUnderflows=vsmTsStatUnderflows, vsmTsStatLossofRefresh=vsmTsStatLossofRefresh, vsmCardStatBdType=vsmCardStatBdType, vsmTsCfgOperStatus=vsmTsCfgOperStatus, vsmCardStatDoc2Type=vsmCardStatDoc2Type, vsmTsCfgDataCndTypNB=vsmTsCfgDataCndTypNB, vsmCardStatHWSWCompatibility=vsmCardStatHWSWCompatibility, vsmCardStatTable=vsmCardStatTable, vsmBundleCfgNo=vsmBundleCfgNo, vsmBundleStatRecvCells=vsmBundleStatRecvCells, VsmBundle=VsmBundle, vsmBundleStatPvcActive=vsmBundleStatPvcActive, vsmTsStatAALType=vsmTsStatAALType, vsmTsStatConditioning=vsmTsStatConditioning, vsmTsStatActive=vsmTsStatActive, vsmBundleCfgTableEntry=vsmBundleCfgTableEntry, vsmLinkSigType=vsmLinkSigType, vsmBundleStatAAL2LostCells=vsmBundleStatAAL2LostCells, vsmCardStatDoc1Type=vsmCardStatDoc1Type, vsmTsStatTableEntry=vsmTsStatTableEntry, vsmBundleStatTable=vsmBundleStatTable, vsmTsCfgIdleDetect=vsmTsCfgIdleDetect, vsmBundleStatHdrErrors=vsmBundleStatHdrErrors, vsmTsStatCasValuesPDH=vsmTsStatCasValuesPDH, vsmTsCfgSilenceRmvl=vsmTsCfgSilenceRmvl, vsmTsCfgTsNo=vsmTsCfgTsNo, vsmBundleCfgMaxTslot=vsmBundleCfgMaxTslot, vsmBundleStatConditioning=vsmBundleStatConditioning, vsmTsStatCID=vsmTsStatCID, vsmTsStatDataLnk=vsmTsStatDataLnk, vsmTsStatBundleNo=vsmTsStatBundleNo, vsmTsCfgSigCndTypNB=vsmTsCfgSigCndTypNB, vsmCardCfgTable=vsmCardCfgTable, vsmBundleCfgVcCDV=vsmBundleCfgVcCDV, vsmTsStatLostPackets=vsmTsStatLostPackets, vsmTsStatIdleIdle=vsmTsStatIdleIdle, vsmCardCfgTableEntry=vsmCardCfgTableEntry, vsmTsCfgAALTyp=vsmTsCfgAALTyp, vsmLinkEnable=vsmLinkEnable, vsmTsStatRIWF=vsmTsStatRIWF, vsmLinkEnableStat=vsmLinkEnableStat, vsmTsStatXmitBytes=vsmTsStatXmitBytes, vsmTsStatRecvBytes=vsmTsStatRecvBytes, vsmLinkTable=vsmLinkTable, vsmBundleStatBadCID=vsmBundleStatBadCID, vsmBundleCfgAdminStatus=vsmBundleCfgAdminStatus, vsmCardCfgBndlTslotStatus=vsmCardCfgBndlTslotStatus, vsmBundleCfgVcVci=vsmBundleCfgVcVci, vsmBundleCfgTimerCU=vsmBundleCfgTimerCU, vsmBundleCfgVcTyp=vsmBundleCfgVcTyp, vsmCardStatBdRev=vsmCardStatBdRev, vsmBundleStatBundleNo=vsmBundleStatBundleNo, vsmBundleCfgVcVpi=vsmBundleCfgVcVpi, vsmBundleStatPtrReframes=vsmBundleStatPtrReframes, vsmBundleCfgOperStatus=vsmBundleCfgOperStatus, vsmTsCfgValidity=vsmTsCfgValidity, vsmCardCfgIndex=vsmCardCfgIndex, vsmTsCfgTableEntry=vsmTsCfgTableEntry, vsmTsStatTSNo=vsmTsStatTSNo, vsmBundleCfgValidity=vsmBundleCfgValidity, vsmCardStatLimType=vsmCardStatLimType, vsmTsStatReset=vsmTsStatReset, vsmTsCfgSignalTyp=vsmTsCfgSignalTyp, vsmBundleStatBufUndrflws=vsmBundleStatBufUndrflws, dv2Vsm=dv2Vsm, vsmTsCfgEchoCancel=vsmTsCfgEchoCancel, vsmTsCfgCmprssionTyp=vsmTsCfgCmprssionTyp, vsmCardStatIndex=vsmCardStatIndex, vsmTsStatBlocked=vsmTsStatBlocked, vsmTsCfgRmtLaw=vsmTsCfgRmtLaw, vsmBundleStatAALType=vsmBundleStatAALType, vsmTsCfgFaxMdmHndlng=vsmTsCfgFaxMdmHndlng, vsmCardStatTableEntry=vsmCardStatTableEntry, VpiInteger=VpiInteger, vsmBundleStatTableEntry=vsmBundleStatTableEntry, vsmTsCfgTable=vsmTsCfgTable, vsmBundleCfgVcAALTyp=vsmBundleCfgVcAALTyp, vsmTsCfgBundleNo=vsmTsCfgBundleNo, vsmTsCfgDataCndTypATM=vsmTsCfgDataCndTypATM, vsmBundleCfgCESPartialFill=vsmBundleCfgCESPartialFill, vsmTsStatVCID=vsmTsStatVCID, vsmBundleCfgTable=vsmBundleCfgTable, vsmBundleStatXmitCells=vsmBundleStatXmitCells, vsmLinkLink=vsmLinkLink, vsmTsStatRemoteCompressed=vsmTsStatRemoteCompressed, vsmCardStatDoc2TypeRev=vsmCardStatDoc2TypeRev, vsmCardStatDoc1TypeRev=vsmCardStatDoc1TypeRev, vsmTsCfgLinkNo=vsmTsCfgLinkNo, vsmTsCfgSigCndTypATM=vsmTsCfgSigCndTypATM, vsmBundleStatLostCells=vsmBundleStatLostCells, vsmBundleStatReset=vsmBundleStatReset, vsmBundleStatBufOverflows=vsmBundleStatBufOverflows, vsmTsCfgAdminStatus=vsmTsCfgAdminStatus, vsmTsStatTable=vsmTsStatTable, vsmTsStatHold=vsmTsStatHold, vsmTsStatRemoteSilent=vsmTsStatRemoteSilent, vsmBundleCfgTrapCfg=vsmBundleCfgTrapCfg, vsmCardStatBinRev=vsmCardStatBinRev, vsmTsStatCompressed=vsmTsStatCompressed, vsmLinkEntry=vsmLinkEntry, VciInteger=VciInteger, vsmTsCfgChanID=vsmTsCfgChanID, vsmTsStatSilent=vsmTsStatSilent, vsmTsStatCasValuesATM=vsmTsStatCasValuesATM, vsmTsCfgMulticast=vsmTsCfgMulticast, vsmTsStatRemoteConditioning=vsmTsStatRemoteConditioning, vsmCardStatBinPres=vsmCardStatBinPres, vsmTsStatLinkNo=vsmTsStatLinkNo)
'''1. Write a Python program to compute the greatest common divisor (GCD) of two positive integers.''' def lcm(x, y): if x > y: z = x else: z = y while(True): if((z % x == 0) and (z % y == 0)): lcm = z break z += 1 return lcm print(lcm(4, 6)) print(lcm(15, 17)) #Reference: w3resource
"""1. Write a Python program to compute the greatest common divisor (GCD) of two positive integers.""" def lcm(x, y): if x > y: z = x else: z = y while True: if z % x == 0 and z % y == 0: lcm = z break z += 1 return lcm print(lcm(4, 6)) print(lcm(15, 17))
for t in range(int(input())): n = int(input()) L = list(map(int,input().split())) L.sort() d = dict() for i in L: d[i] = 1 cnt = 0 for i in range(n): for j in range(i+1,n): try: if d[L[i] - (L[j]-L[i])] == 1: cnt+=1 except: "" try: if d[L[j] + (L[j]-L[i])] == 1: cnt+=1 except: "" print(cnt // 2)
for t in range(int(input())): n = int(input()) l = list(map(int, input().split())) L.sort() d = dict() for i in L: d[i] = 1 cnt = 0 for i in range(n): for j in range(i + 1, n): try: if d[L[i] - (L[j] - L[i])] == 1: cnt += 1 except: '' try: if d[L[j] + (L[j] - L[i])] == 1: cnt += 1 except: '' print(cnt // 2)
''' Remove Smallest ''' t = int(input()) for ll in range(t): n = int(input()) integers = set(map(int, input().split(' '))) integers = list(integers) integers.sort() for i in range(1,len(integers)): if abs(integers[i]-integers[i-1]) > 1: print('NO') break else: print('YES')
""" Remove Smallest """ t = int(input()) for ll in range(t): n = int(input()) integers = set(map(int, input().split(' '))) integers = list(integers) integers.sort() for i in range(1, len(integers)): if abs(integers[i] - integers[i - 1]) > 1: print('NO') break else: print('YES')
{ "targets": [ { "target_name": "test_constructor", "sources": [ "test_constructor.c" ] }, { "target_name": "test_constructor_name", "sources": [ "test_constructor_name.c" ] } ] }
{'targets': [{'target_name': 'test_constructor', 'sources': ['test_constructor.c']}, {'target_name': 'test_constructor_name', 'sources': ['test_constructor_name.c']}]}
class Logger: def __init__(self, filepath): self.filepath = filepath def write(self, msg): with open(self.filepath, "a") as logfile: logfile.write("{}\n".format(msg))
class Logger: def __init__(self, filepath): self.filepath = filepath def write(self, msg): with open(self.filepath, 'a') as logfile: logfile.write('{}\n'.format(msg))
''' contains functions that convenient math stuff, usually involving operations that are not defined in normal mathematics but could be useful @author: Klint ''' # matrix stuff, collapse matrix in interesting ways def collapse_matrix_cols(matrix: [list])-> list: '''flatten a matrix by m by n into a array of size m by adding columns together ie | a_00 a_10 ... a_m0 | | a_01 ............. | | ................. | = [a_00 + a_01 + .. + a_0n, a_10 + a_11 + ... + a_1n, a_m0 + a_m1 + ... + a_mn] | a_0n ........ a_mn | ''' to_return = [] size = len(matrix[0]) for j in range(size): to_append = 0 for i in range(len(matrix)): assert(len(matrix[i]) == size) to_append += matrix[i][j] to_return.append(to_append) return to_return def collapse_matrix_rows(matrix: [list])-> list: '''flatten a matrix by adding rows ''' to_return = [] for row in matrix: to_return = sum(row) return to_return #
""" contains functions that convenient math stuff, usually involving operations that are not defined in normal mathematics but could be useful @author: Klint """ def collapse_matrix_cols(matrix: [list]) -> list: """flatten a matrix by m by n into a array of size m by adding columns together ie | a_00 a_10 ... a_m0 | | a_01 ............. | | ................. | = [a_00 + a_01 + .. + a_0n, a_10 + a_11 + ... + a_1n, a_m0 + a_m1 + ... + a_mn] | a_0n ........ a_mn | """ to_return = [] size = len(matrix[0]) for j in range(size): to_append = 0 for i in range(len(matrix)): assert len(matrix[i]) == size to_append += matrix[i][j] to_return.append(to_append) return to_return def collapse_matrix_rows(matrix: [list]) -> list: """flatten a matrix by adding rows """ to_return = [] for row in matrix: to_return = sum(row) return to_return
def write (name, stream): stream.write("#include <unico.h>\n") stream.write("#include <stddef.h>\n") stream.write("extern int %s (size_t, size_t, unicos*);\n" % name)
def write(name, stream): stream.write('#include <unico.h>\n') stream.write('#include <stddef.h>\n') stream.write('extern int %s (size_t, size_t, unicos*);\n' % name)
#! /usr/bin/env python3 # coding: utf-8 # Thanks to imbadatreading, should have through about LCM def add_step_size(buses): buses_with_step = list() for num in range(len(buses)): if buses[num] != 'x': buses_with_step.append((int(buses[num]), num)) return buses_with_step def find_awesome_timestamp(buses): current_time = 0 lcm = 1 for order_bus in range(len(buses) - 1): bus = int(buses[order_bus + 1][0]) step = int(buses[order_bus + 1][1]) lcm = lcm * buses[order_bus][0] print("bus={}/step={}/lcm={}".format(bus, step, lcm)) while ((current_time + step) % bus) != 0: current_time += lcm return current_time def main(): input_file = open('input', 'r') lines = input_file.readlines() clean_lines = map(lambda x: x.rstrip("\n"), lines) print(clean_lines) buses = add_step_size(list(clean_lines[1].split(','))) print(buses) result = find_awesome_timestamp(buses) print(result) print("Result: {}".format(result)) if __name__ == '__main__': main()
def add_step_size(buses): buses_with_step = list() for num in range(len(buses)): if buses[num] != 'x': buses_with_step.append((int(buses[num]), num)) return buses_with_step def find_awesome_timestamp(buses): current_time = 0 lcm = 1 for order_bus in range(len(buses) - 1): bus = int(buses[order_bus + 1][0]) step = int(buses[order_bus + 1][1]) lcm = lcm * buses[order_bus][0] print('bus={}/step={}/lcm={}'.format(bus, step, lcm)) while (current_time + step) % bus != 0: current_time += lcm return current_time def main(): input_file = open('input', 'r') lines = input_file.readlines() clean_lines = map(lambda x: x.rstrip('\n'), lines) print(clean_lines) buses = add_step_size(list(clean_lines[1].split(','))) print(buses) result = find_awesome_timestamp(buses) print(result) print('Result: {}'.format(result)) if __name__ == '__main__': main()
#!/usr/bin/env python3 f = open("input.txt", "r").read().splitlines() REGISTERS_MAP = {"w": 0, "x": 1, "y": 2, "z": 3} def checker(number): num_str = str(number) if "0" in num_str: return False if len(num_str) != 14: return False # Registers are in form [w,x,y,z] counter = 0 registers = [0] * 4 for line in f: instr_arr = line.split() instr = instr_arr[0] first = instr_arr[1] if "inp" in instr: registers[REGISTERS_MAP[first]] = int(num_str[counter]) counter += 1 continue second = instr_arr[2] if second in REGISTERS_MAP: second_val = registers[REGISTERS_MAP[second]] else: second_val = int(second) if "add" in instr: registers[REGISTERS_MAP[first]] += second_val elif "mul" in instr: registers[REGISTERS_MAP[first]] *= second_val elif "div" in instr: registers[REGISTERS_MAP[first]] //= second_val elif "mod" in instr: registers[REGISTERS_MAP[first]] %= second_val else: registers[REGISTERS_MAP[first]] = ( 1 if registers[REGISTERS_MAP[first]] == second_val else 0 ) # check valid of z == 0 if registers[REGISTERS_MAP["z"]] == 0: return True return False
f = open('input.txt', 'r').read().splitlines() registers_map = {'w': 0, 'x': 1, 'y': 2, 'z': 3} def checker(number): num_str = str(number) if '0' in num_str: return False if len(num_str) != 14: return False counter = 0 registers = [0] * 4 for line in f: instr_arr = line.split() instr = instr_arr[0] first = instr_arr[1] if 'inp' in instr: registers[REGISTERS_MAP[first]] = int(num_str[counter]) counter += 1 continue second = instr_arr[2] if second in REGISTERS_MAP: second_val = registers[REGISTERS_MAP[second]] else: second_val = int(second) if 'add' in instr: registers[REGISTERS_MAP[first]] += second_val elif 'mul' in instr: registers[REGISTERS_MAP[first]] *= second_val elif 'div' in instr: registers[REGISTERS_MAP[first]] //= second_val elif 'mod' in instr: registers[REGISTERS_MAP[first]] %= second_val else: registers[REGISTERS_MAP[first]] = 1 if registers[REGISTERS_MAP[first]] == second_val else 0 if registers[REGISTERS_MAP['z']] == 0: return True return False
# bunch of color constants class Color: WHITE = (255, 255, 255) BLACK = (0, 0, 0) RED = (255, 0, 0) BLUE = (0, 128, 255) GREEN = (0, 153, 0) YELLOW = (255, 255, 0) BROWN = (204, 102, 0) PINK = (255, 102, 178) PURPLE = (153, 51, 255) GREY = (128, 128, 128) colors = { 1: WHITE, 2: YELLOW, 3: RED, 4: BLUE, 5: GREEN, 6: BLACK, 7: BROWN, 8: PINK, 9: PURPLE, 10: GREY }
class Color: white = (255, 255, 255) black = (0, 0, 0) red = (255, 0, 0) blue = (0, 128, 255) green = (0, 153, 0) yellow = (255, 255, 0) brown = (204, 102, 0) pink = (255, 102, 178) purple = (153, 51, 255) grey = (128, 128, 128) colors = {1: WHITE, 2: YELLOW, 3: RED, 4: BLUE, 5: GREEN, 6: BLACK, 7: BROWN, 8: PINK, 9: PURPLE, 10: GREY}
VERSION = "0.2" if __name__ == '__main__': print(VERSION)
version = '0.2' if __name__ == '__main__': print(VERSION)