content
stringlengths
7
1.05M
fixed_cases
stringlengths
1
1.28M
__author__ = 'Jeffrey Seifried' __description__ = 'Scraping tools for getting me a damn Nintendo Switch' __email__ = 'jeffrey.seifried@gmail.com' __program__ = 'switch' __url__ = 'http://github.com/jeffseif/{}'.format(__program__) __version__ = '1.0.0' __year__ = '2017' HEADERS = { 'Accept': '*/*', 'Accept-Encoding': 'gzip, deflate, sdch', 'Accept-Language': 'en-US,en;q=0.8', 'Connection': 'keep-alive', 'Referer': 'https://www.google.com/', 'User-Agent': 'Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/57.0.2987.133 Safari/537.36', # noqa } TTL = 600 # IO caches will be ignored after 10 minutes
__author__ = 'Jeffrey Seifried' __description__ = 'Scraping tools for getting me a damn Nintendo Switch' __email__ = 'jeffrey.seifried@gmail.com' __program__ = 'switch' __url__ = 'http://github.com/jeffseif/{}'.format(__program__) __version__ = '1.0.0' __year__ = '2017' headers = {'Accept': '*/*', 'Accept-Encoding': 'gzip, deflate, sdch', 'Accept-Language': 'en-US,en;q=0.8', 'Connection': 'keep-alive', 'Referer': 'https://www.google.com/', 'User-Agent': 'Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/57.0.2987.133 Safari/537.36'} ttl = 600
class FibonacciImpl: arr = [0,1,1] def calculate(self, num: int): if num < len(self.arr): return self.arr[num] else: for i in range(len(self.arr)-1, num): new_fib = self.arr[i-1] + self.arr[i] self.arr.append(new_fib) return self.arr[num] fib_impl = FibonacciImpl() def fib(num): global fib_impl return fib_impl.calculate(num) def metod_fib(func, a, b, eps=0.001, sigma=0.001 / 10): N = int((b - a) / (2 * eps)) print('tyt N - ',N) x1 = a + fib(N - 2) / fib(N) * (b - a) x2 = a + fib(N - 1) / fib(N) * (b - a) for k in range(2, N - 2): if func(x1) <= func(x2): b = x2 x2 = x1 x1 = a + fib(N - k - 3) / fib(N - k - 1) * (b - a) else: a = x1 x1 = x2 x2 = a + fib(N - k - 2) / fib(N - k - 1) * (b - a) x2 = x1 + sigma if func(x1) <= func(x2): b = x2 else: a = x1 return (a + b) / 2
class Fibonacciimpl: arr = [0, 1, 1] def calculate(self, num: int): if num < len(self.arr): return self.arr[num] else: for i in range(len(self.arr) - 1, num): new_fib = self.arr[i - 1] + self.arr[i] self.arr.append(new_fib) return self.arr[num] fib_impl = fibonacci_impl() def fib(num): global fib_impl return fib_impl.calculate(num) def metod_fib(func, a, b, eps=0.001, sigma=0.001 / 10): n = int((b - a) / (2 * eps)) print('tyt N - ', N) x1 = a + fib(N - 2) / fib(N) * (b - a) x2 = a + fib(N - 1) / fib(N) * (b - a) for k in range(2, N - 2): if func(x1) <= func(x2): b = x2 x2 = x1 x1 = a + fib(N - k - 3) / fib(N - k - 1) * (b - a) else: a = x1 x1 = x2 x2 = a + fib(N - k - 2) / fib(N - k - 1) * (b - a) x2 = x1 + sigma if func(x1) <= func(x2): b = x2 else: a = x1 return (a + b) / 2
class Color(object): def __init__(self, rgb_value, name): self.rgb_value = rgb_value self.name = name if __name__ == "__main__": c = Color("#ff0000", "bright_red") print(c.name) c.name = "red"
class Color(object): def __init__(self, rgb_value, name): self.rgb_value = rgb_value self.name = name if __name__ == '__main__': c = color('#ff0000', 'bright_red') print(c.name) c.name = 'red'
def balanced_brackets(inp): # if odd number, can't be balanced if len(inp) % 2 is not 0: return False # opening brackets opening = set('[{(') s = [] # functions as a stack (last in, first out) for c in inp: # if no items in stack, add first character if len(s) is 0: s.append(c) else: # if character (c) is closing bracket and last item in stack is opening of same # style bracket, remove opening from stack if (s[-1] == "[" and c == "]") or (s[-1] == "{" and c == "}") or (s[-1] == "(" and c == ")"): s.pop() # if character is new opening, add to stack elif c in opening: s.append(c) # if character is not opening (closing) and is not paired with an opening, # unbalanced string (return false) else: return False # balanced if no leftover openings in stack (because all were removed due to # correct closing brackets) return len(s) is 0 print(balanced_brackets("([])[]({})") is True and balanced_brackets("([)]") is False and balanced_brackets("((()") is False)
def balanced_brackets(inp): if len(inp) % 2 is not 0: return False opening = set('[{(') s = [] for c in inp: if len(s) is 0: s.append(c) elif s[-1] == '[' and c == ']' or (s[-1] == '{' and c == '}') or (s[-1] == '(' and c == ')'): s.pop() elif c in opening: s.append(c) else: return False return len(s) is 0 print(balanced_brackets('([])[]({})') is True and balanced_brackets('([)]') is False and (balanced_brackets('((()') is False))
class Solution: def pathSum(self, root: TreeNode, sum: int) -> int: if not root: return 0 def dfs(root: TreeNode, sum: int) -> int: if not root: return 0 return (sum == root.val) + \ dfs(root.left, sum - root.val) + \ dfs(root.right, sum - root.val) return dfs(root, sum) + \ self.pathSum(root.left, sum) + \ self.pathSum(root.right, sum)
class Solution: def path_sum(self, root: TreeNode, sum: int) -> int: if not root: return 0 def dfs(root: TreeNode, sum: int) -> int: if not root: return 0 return (sum == root.val) + dfs(root.left, sum - root.val) + dfs(root.right, sum - root.val) return dfs(root, sum) + self.pathSum(root.left, sum) + self.pathSum(root.right, sum)
#!/usr/bin/env python3 # -*- coding:utf-8 -*- # @author JourWon # @date 2022/1/7 # @file ListNode.py def __init__(self, x): self.val = x self.next = None
def __init__(self, x): self.val = x self.next = None
#!/usr/bin/env python def main(): print("Start training") x_array = [1.0, 2.0, 3.0, 4.0, 5.0] # y = 2x + 3 y_array = [5.0, 7.0, 9.0, 11.0, 13.0] instance_number = len(x_array) learning_rate = 0.01 epoch_number = 100 w = 1.0 b = 1.0 for epoch_index in range(epoch_number): w_grad = 0.0 b_grad = 0.0 loss = 0.0 for i in range(instance_number): x = x_array[i] y = y_array[i] w_grad += -2.0 / instance_number * x * (y - w * x - b) b_grad += -2.0 / instance_number * (y - w * x - b) loss += 1.0 / instance_number * pow(y - w * x - b, 2) w -= learning_rate * w_grad b -= learning_rate * b_grad print("Epoch is: {} w is: {}, w is: {}, loss is: {}".format( epoch_index, w, b, loss)) if __name__ == "__main__": main()
def main(): print('Start training') x_array = [1.0, 2.0, 3.0, 4.0, 5.0] y_array = [5.0, 7.0, 9.0, 11.0, 13.0] instance_number = len(x_array) learning_rate = 0.01 epoch_number = 100 w = 1.0 b = 1.0 for epoch_index in range(epoch_number): w_grad = 0.0 b_grad = 0.0 loss = 0.0 for i in range(instance_number): x = x_array[i] y = y_array[i] w_grad += -2.0 / instance_number * x * (y - w * x - b) b_grad += -2.0 / instance_number * (y - w * x - b) loss += 1.0 / instance_number * pow(y - w * x - b, 2) w -= learning_rate * w_grad b -= learning_rate * b_grad print('Epoch is: {} w is: {}, w is: {}, loss is: {}'.format(epoch_index, w, b, loss)) if __name__ == '__main__': main()
def chunks(messageLength, chunkSize): chunkValues = [] for i in range(0, len(messageLength), chunkSize): chunkValues.append(messageLength[i:i+chunkSize]) return chunkValues def leftRotate(chunk, rotateLength): return ((chunk << rotateLength) | (chunk >> (32 - rotateLength))) & 0xffffffff def sha1(message): #initial hash values h0 = 0x67452301 h1 = 0xEFCDAB89 h2 = 0x98BADCFE h3 = 0x10325476 h4 = 0xC3D2E1F0 messageLength = "" #preprocessing for char in range(len(message)): messageLength += '{0:08b}'.format(ord(message[char])) temp = messageLength messageLength += '1' while(len(messageLength) % 512 != 448): messageLength += '0' messageLength += '{0:064b}'.format(len(temp)) chunk = chunks(messageLength, 512) for eachChunk in chunk: words = chunks(eachChunk, 32) w = [0] * 80 for n in range(0, 16): w[n] = int(words[n], 2) for i in range(16, 80): w[i] = leftRotate((w[i-3] ^ w[i-8] ^ w[i-14] ^ w[i-16]), 1) #Initialize hash value for this chunk: a = h0 b = h1 c = h2 d = h3 e = h4 #main loop: for i in range(0, 80): if 0 <= i <= 19: f = (b & c) | ((~b) & d) k = 0x5A827999 elif 20 <= i <= 39: f = b ^ c ^ d k = 0x6ED9EBA1 elif 40 <= i <= 59: f = (b & c) | (b & d) | (c & d) k = 0x8F1BBCDC elif 60 <= i <= 79: f = b ^ c ^ d k = 0xCA62C1D6 a, b, c, d, e = ((leftRotate(a, 5) + f + e + k + w[i]) & 0xffffffff, a, leftRotate(b, 30), c, d) h0 = h0 + a & 0xffffffff h1 = h1 + b & 0xffffffff h2 = h2 + c & 0xffffffff h3 = h3 + d & 0xffffffff h4 = h4 + e & 0xffffffff return '%08x%08x%08x%08x%08x' % (h0, h1, h2, h3, h4)
def chunks(messageLength, chunkSize): chunk_values = [] for i in range(0, len(messageLength), chunkSize): chunkValues.append(messageLength[i:i + chunkSize]) return chunkValues def left_rotate(chunk, rotateLength): return (chunk << rotateLength | chunk >> 32 - rotateLength) & 4294967295 def sha1(message): h0 = 1732584193 h1 = 4023233417 h2 = 2562383102 h3 = 271733878 h4 = 3285377520 message_length = '' for char in range(len(message)): message_length += '{0:08b}'.format(ord(message[char])) temp = messageLength message_length += '1' while len(messageLength) % 512 != 448: message_length += '0' message_length += '{0:064b}'.format(len(temp)) chunk = chunks(messageLength, 512) for each_chunk in chunk: words = chunks(eachChunk, 32) w = [0] * 80 for n in range(0, 16): w[n] = int(words[n], 2) for i in range(16, 80): w[i] = left_rotate(w[i - 3] ^ w[i - 8] ^ w[i - 14] ^ w[i - 16], 1) a = h0 b = h1 c = h2 d = h3 e = h4 for i in range(0, 80): if 0 <= i <= 19: f = b & c | ~b & d k = 1518500249 elif 20 <= i <= 39: f = b ^ c ^ d k = 1859775393 elif 40 <= i <= 59: f = b & c | b & d | c & d k = 2400959708 elif 60 <= i <= 79: f = b ^ c ^ d k = 3395469782 (a, b, c, d, e) = (left_rotate(a, 5) + f + e + k + w[i] & 4294967295, a, left_rotate(b, 30), c, d) h0 = h0 + a & 4294967295 h1 = h1 + b & 4294967295 h2 = h2 + c & 4294967295 h3 = h3 + d & 4294967295 h4 = h4 + e & 4294967295 return '%08x%08x%08x%08x%08x' % (h0, h1, h2, h3, h4)
''' - Leetcode problem: 937 - Difficulty: Easy - Brief problem description: You have an array of logs. Each log is a space delimited string of words. For each log, the first word in each log is an alphanumeric identifier. Then, either: Each word after the identifier will consist only of lowercase letters, or; Each word after the identifier will consist only of digits. We will call these two varieties of logs letter-logs and digit-logs. It is guaranteed that each log has at least one word after its identifier. Reorder the logs so that all of the letter-logs come before any digit-log. The letter-logs are ordered lexicographically ignoring identifier, with the identifier used in case of ties. The digit-logs should be put in their original order. Return the final order of the logs. Example 1: Input: logs = ["dig1 8 1 5 1","let1 art can","dig2 3 6","let2 own kit dig","let3 art zero"] Output: ["let1 art can","let3 art zero","let2 own kit dig","dig1 8 1 5 1","dig2 3 6"] Constraints: 0 <= logs.length <= 100 3 <= logs[i].length <= 100 logs[i] is guaranteed to have an identifier, and a word after the identifier. - Solution Summary: - Used Resources: --- Bo Zhou ''' class Solution: def reorderLogFiles(self, logs: List[str]) -> List[str]: def sortFun(log): head, body = log.split(' ', 1) if body[0].isalpha(): return (0, body, head) else: return (1,) return sorted(logs, key=sortFun)
""" - Leetcode problem: 937 - Difficulty: Easy - Brief problem description: You have an array of logs. Each log is a space delimited string of words. For each log, the first word in each log is an alphanumeric identifier. Then, either: Each word after the identifier will consist only of lowercase letters, or; Each word after the identifier will consist only of digits. We will call these two varieties of logs letter-logs and digit-logs. It is guaranteed that each log has at least one word after its identifier. Reorder the logs so that all of the letter-logs come before any digit-log. The letter-logs are ordered lexicographically ignoring identifier, with the identifier used in case of ties. The digit-logs should be put in their original order. Return the final order of the logs. Example 1: Input: logs = ["dig1 8 1 5 1","let1 art can","dig2 3 6","let2 own kit dig","let3 art zero"] Output: ["let1 art can","let3 art zero","let2 own kit dig","dig1 8 1 5 1","dig2 3 6"] Constraints: 0 <= logs.length <= 100 3 <= logs[i].length <= 100 logs[i] is guaranteed to have an identifier, and a word after the identifier. - Solution Summary: - Used Resources: --- Bo Zhou """ class Solution: def reorder_log_files(self, logs: List[str]) -> List[str]: def sort_fun(log): (head, body) = log.split(' ', 1) if body[0].isalpha(): return (0, body, head) else: return (1,) return sorted(logs, key=sortFun)
n, k = map(int, input().split()) participants = list(map(int, input().split())) target_score = participants[k - 1] total = 0 for participant in participants: if participant >= target_score and participant > 0: total += 1 print(total)
(n, k) = map(int, input().split()) participants = list(map(int, input().split())) target_score = participants[k - 1] total = 0 for participant in participants: if participant >= target_score and participant > 0: total += 1 print(total)
a,b,c,d = map(int, input().split()) if b > c and d > a and (c+d) > (a+b) and c > 0 and d > 0 and a%2 == 0: print("Valores aceitos") else: print("Valores nao aceitos")
(a, b, c, d) = map(int, input().split()) if b > c and d > a and (c + d > a + b) and (c > 0) and (d > 0) and (a % 2 == 0): print('Valores aceitos') else: print('Valores nao aceitos')
def get_all_directions_values(row, col, board): total = 0 total += int(board[0][col]) total += int(board[-1][col]) total += int(board[row][0]) total += int(board[row][-1]) return total def outside_board(shoot): row, col = shoot return 0 > row or row > 6 or 0 > col or col > 6 def bullseye(shoot, board): row, col = shoot if board[row][col] == 'B': return True return False def other_hit_conditions(shoot, current_player, board): row, col = shoot if board[row][col].isdigit(): current_player[1] -= int(board[row][col]) elif board[row][col] == 'D': total = get_all_directions_values(row, col, board) current_player[1] -= total * 2 elif board[row][col] == 'T': total = get_all_directions_values(row, col, board) current_player[1] -= total * 3 def play(player_names, board): player_1 = [player_names[0], 501, 0] player_2 = [player_names[1], 501, 0] turn = 1 while True: current_player = player_2 if turn % 2 == 0 else player_1 shoot = [int(n) for n in input().lstrip('(').rstrip(')').split(', ')] current_player[2] += 1 if outside_board(shoot): turn += 1 continue elif bullseye(shoot, board): return current_player[2], current_player[0] else: other_hit_conditions(shoot, current_player, board) if current_player[1] <= 0: return current_player[2], current_player[0] turn += 1 def create_board(): board = [] for _ in range(7): board.append(input().split(' ')) return board player_names = input().split(', ') board = create_board() winner = play(player_names, board) print(f'{winner[1]} won the game with {winner[0]} throws!')
def get_all_directions_values(row, col, board): total = 0 total += int(board[0][col]) total += int(board[-1][col]) total += int(board[row][0]) total += int(board[row][-1]) return total def outside_board(shoot): (row, col) = shoot return 0 > row or row > 6 or 0 > col or (col > 6) def bullseye(shoot, board): (row, col) = shoot if board[row][col] == 'B': return True return False def other_hit_conditions(shoot, current_player, board): (row, col) = shoot if board[row][col].isdigit(): current_player[1] -= int(board[row][col]) elif board[row][col] == 'D': total = get_all_directions_values(row, col, board) current_player[1] -= total * 2 elif board[row][col] == 'T': total = get_all_directions_values(row, col, board) current_player[1] -= total * 3 def play(player_names, board): player_1 = [player_names[0], 501, 0] player_2 = [player_names[1], 501, 0] turn = 1 while True: current_player = player_2 if turn % 2 == 0 else player_1 shoot = [int(n) for n in input().lstrip('(').rstrip(')').split(', ')] current_player[2] += 1 if outside_board(shoot): turn += 1 continue elif bullseye(shoot, board): return (current_player[2], current_player[0]) else: other_hit_conditions(shoot, current_player, board) if current_player[1] <= 0: return (current_player[2], current_player[0]) turn += 1 def create_board(): board = [] for _ in range(7): board.append(input().split(' ')) return board player_names = input().split(', ') board = create_board() winner = play(player_names, board) print(f'{winner[1]} won the game with {winner[0]} throws!')
bridgelist = [] with open('input.txt') as infile: for line in infile.readlines(): i, o = line.strip().split('/') i, o = int(i), int(o) bridgelist.append((i,o,)) def build_bridge(bridgelist, already_used=None, current_value=0, connector_used=0): if already_used == None: already_used = ((0,0),) cur_max = 0 for candidate in filter(lambda x: connector_used in x, bridgelist): if candidate not in already_used: begin, end = candidate connects_to = end if begin == connector_used else begin used_now = already_used + (candidate,) value = build_bridge(bridgelist, already_used=used_now, current_value=(current_value+sum(candidate)), connector_used=connects_to) if value > cur_max: cur_max = value if cur_max != 0: return cur_max else: print('Found end of bridge') return current_value print(build_bridge(bridgelist))
bridgelist = [] with open('input.txt') as infile: for line in infile.readlines(): (i, o) = line.strip().split('/') (i, o) = (int(i), int(o)) bridgelist.append((i, o)) def build_bridge(bridgelist, already_used=None, current_value=0, connector_used=0): if already_used == None: already_used = ((0, 0),) cur_max = 0 for candidate in filter(lambda x: connector_used in x, bridgelist): if candidate not in already_used: (begin, end) = candidate connects_to = end if begin == connector_used else begin used_now = already_used + (candidate,) value = build_bridge(bridgelist, already_used=used_now, current_value=current_value + sum(candidate), connector_used=connects_to) if value > cur_max: cur_max = value if cur_max != 0: return cur_max else: print('Found end of bridge') return current_value print(build_bridge(bridgelist))
# https://leetcode.com/explore/featured/card/top-interview-questions-easy/92/array/727/ class Solution: def removeDuplicates(self, nums: list[int]) -> int: length = 0 curNum = None for idx in range(len(nums)): if nums[idx] != curNum: curNum = nums[idx] nums[length] = curNum length += 1 return length, nums nums = [1, 1, 2] length, nums = Solution().removeDuplicates(nums) print(length, nums) nums = [0, 0, 1, 1, 1, 2, 2, 3, 3, 4] length, nums = Solution().removeDuplicates(nums) print(length, nums)
class Solution: def remove_duplicates(self, nums: list[int]) -> int: length = 0 cur_num = None for idx in range(len(nums)): if nums[idx] != curNum: cur_num = nums[idx] nums[length] = curNum length += 1 return (length, nums) nums = [1, 1, 2] (length, nums) = solution().removeDuplicates(nums) print(length, nums) nums = [0, 0, 1, 1, 1, 2, 2, 3, 3, 4] (length, nums) = solution().removeDuplicates(nums) print(length, nums)
class workspaceApiPara: getWorkspace_POST_request = {"ad_group_list": {"type": list, "default": []}} setWorkspace_POST_request = {}, updateWorkspace_POST_request = {}, getWorkspace_GET_response = {}, setWorkspace_POST_response = {} updateWorkspace_POST_response = {}
class Workspaceapipara: get_workspace_post_request = {'ad_group_list': {'type': list, 'default': []}} set_workspace_post_request = ({},) update_workspace_post_request = ({},) get_workspace_get_response = ({},) set_workspace_post_response = {} update_workspace_post_response = {}
expected_output = { "interfaces": { "Port-channel1": { "name": "Port-channel1", "protocol": "lacp", "members": { "GigabitEthernet2": { "interface": "GigabitEthernet2", "oper_key": 1, "admin_key": 1, "port_num": 1, "lacp_port_priority": 32768, "flags": "SA", "activity": "auto", "state": "bndl", "bundled": True, "port_state": 61, }, "GigabitEthernet3": { "interface": "GigabitEthernet3", "oper_key": 1, "admin_key": 1, "port_num": 1, "lacp_port_priority": 32768, "flags": "SA", "activity": "auto", "state": "bndl", "bundled": True, "port_state": 61, }, }, }, "Port-channel2": { "name": "Port-channel2", "protocol": "lacp", "members": { "GigabitEthernet4": { "interface": "GigabitEthernet4", "oper_key": 2, "admin_key": 2, "port_num": 1, "lacp_port_priority": 32768, "flags": "SA", "state": "bndl", "activity": "auto", "bundled": True, "port_state": 61, }, "GigabitEthernet5": { "interface": "GigabitEthernet5", "oper_key": 2, "admin_key": 2, "port_num": 1, "lacp_port_priority": 32768, "flags": "SA", "activity": "auto", "state": "bndl", "bundled": True, "port_state": 61, }, "GigabitEthernet6": { "interface": "GigabitEthernet6", "oper_key": 2, "admin_key": 2, "port_num": 1, "lacp_port_priority": 32768, "flags": "SA", "activity": "auto", "state": "bndl", "bundled": True, "port_state": 61, }, }, }, } }
expected_output = {'interfaces': {'Port-channel1': {'name': 'Port-channel1', 'protocol': 'lacp', 'members': {'GigabitEthernet2': {'interface': 'GigabitEthernet2', 'oper_key': 1, 'admin_key': 1, 'port_num': 1, 'lacp_port_priority': 32768, 'flags': 'SA', 'activity': 'auto', 'state': 'bndl', 'bundled': True, 'port_state': 61}, 'GigabitEthernet3': {'interface': 'GigabitEthernet3', 'oper_key': 1, 'admin_key': 1, 'port_num': 1, 'lacp_port_priority': 32768, 'flags': 'SA', 'activity': 'auto', 'state': 'bndl', 'bundled': True, 'port_state': 61}}}, 'Port-channel2': {'name': 'Port-channel2', 'protocol': 'lacp', 'members': {'GigabitEthernet4': {'interface': 'GigabitEthernet4', 'oper_key': 2, 'admin_key': 2, 'port_num': 1, 'lacp_port_priority': 32768, 'flags': 'SA', 'state': 'bndl', 'activity': 'auto', 'bundled': True, 'port_state': 61}, 'GigabitEthernet5': {'interface': 'GigabitEthernet5', 'oper_key': 2, 'admin_key': 2, 'port_num': 1, 'lacp_port_priority': 32768, 'flags': 'SA', 'activity': 'auto', 'state': 'bndl', 'bundled': True, 'port_state': 61}, 'GigabitEthernet6': {'interface': 'GigabitEthernet6', 'oper_key': 2, 'admin_key': 2, 'port_num': 1, 'lacp_port_priority': 32768, 'flags': 'SA', 'activity': 'auto', 'state': 'bndl', 'bundled': True, 'port_state': 61}}}}}
# # PySNMP MIB module CONTIVITY-INFO-V1-MIB (http://snmplabs.com/pysmi) # ASN.1 source file:///Users/davwang4/Dev/mibs.snmplabs.com/asn1/CONTIVITY-INFO-V1-MIB # Produced by pysmi-0.3.4 at Wed May 1 12:26:50 2019 # On host DAVWANG4-M-1475 platform Darwin version 18.5.0 by user davwang4 # Using Python version 3.7.3 (default, Mar 27 2019, 09:23:15) # Integer, OctetString, ObjectIdentifier = mibBuilder.importSymbols("ASN1", "Integer", "OctetString", "ObjectIdentifier") NamedValues, = mibBuilder.importSymbols("ASN1-ENUMERATION", "NamedValues") ValueSizeConstraint, ConstraintsIntersection, ConstraintsUnion, SingleValueConstraint, ValueRangeConstraint = mibBuilder.importSymbols("ASN1-REFINEMENT", "ValueSizeConstraint", "ConstraintsIntersection", "ConstraintsUnion", "SingleValueConstraint", "ValueRangeConstraint") contivity, = mibBuilder.importSymbols("NEWOAK-MIB", "contivity") NotificationGroup, ModuleCompliance = mibBuilder.importSymbols("SNMPv2-CONF", "NotificationGroup", "ModuleCompliance") MibScalar, MibTable, MibTableRow, MibTableColumn, Bits, Counter32, TimeTicks, IpAddress, Counter64, NotificationType, Gauge32, Integer32, Unsigned32, iso, ModuleIdentity, MibIdentifier, ObjectIdentity = mibBuilder.importSymbols("SNMPv2-SMI", "MibScalar", "MibTable", "MibTableRow", "MibTableColumn", "Bits", "Counter32", "TimeTicks", "IpAddress", "Counter64", "NotificationType", "Gauge32", "Integer32", "Unsigned32", "iso", "ModuleIdentity", "MibIdentifier", "ObjectIdentity") TextualConvention, DisplayString = mibBuilder.importSymbols("SNMPv2-TC", "TextualConvention", "DisplayString") snmpAgentInfo_ces = ModuleIdentity((1, 3, 6, 1, 4, 1, 2505, 1, 15)).setLabel("snmpAgentInfo-ces") snmpAgentInfo_ces.setRevisions(('1900-08-07 22:30',)) if getattr(mibBuilder, 'version', (0, 0, 0)) > (4, 4, 0): if mibBuilder.loadTexts: snmpAgentInfo_ces.setRevisionsDescriptions(('Added snmpAgentInfo-Utilities-RevDate-ces, snmpAgentInfo-Utilities-Rev-ces, snmpAgentInfo-Utilities-ServerRev-ces ',)) if mibBuilder.loadTexts: snmpAgentInfo_ces.setLastUpdated('0008072230Z') if mibBuilder.loadTexts: snmpAgentInfo_ces.setOrganization('Nortel Networks,Inc.') if mibBuilder.loadTexts: snmpAgentInfo_ces.setContactInfo('support@nortelnetworks.com Postal: Nortel Networks,Inc. 80 Central St. Boxboro, MA 01719 Tel: +1 978 264 7100 E-Mail: support@nortelnetworks.com') if mibBuilder.loadTexts: snmpAgentInfo_ces.setDescription('on the Convitiy Extranet Switch.') snmpAgentInfo_Utilities_ces = MibIdentifier((1, 3, 6, 1, 4, 1, 2505, 1, 15, 1)).setLabel("snmpAgentInfo-Utilities-ces") snmpAgentInfo_Utilities_Ping_ces = MibIdentifier((1, 3, 6, 1, 4, 1, 2505, 1, 15, 1, 1)).setLabel("snmpAgentInfo-Utilities-Ping-ces") snmpAgentInfo_Utilities_RevDate_ces = MibScalar((1, 3, 6, 1, 4, 1, 2505, 1, 15, 1, 1, 1), DisplayString()).setLabel("snmpAgentInfo-Utilities-RevDate-ces").setMaxAccess("readonly") if mibBuilder.loadTexts: snmpAgentInfo_Utilities_RevDate_ces.setStatus('mandatory') if mibBuilder.loadTexts: snmpAgentInfo_Utilities_RevDate_ces.setDescription('This value should match the LAST-UPDATED value in the MIB.') snmpAgentInfo_Utilities_Rev_ces = MibScalar((1, 3, 6, 1, 4, 1, 2505, 1, 15, 1, 1, 2), Integer32()).setLabel("snmpAgentInfo-Utilities-Rev-ces").setMaxAccess("readonly") if mibBuilder.loadTexts: snmpAgentInfo_Utilities_Rev_ces.setStatus('mandatory') if mibBuilder.loadTexts: snmpAgentInfo_Utilities_Rev_ces.setDescription('This is an integer that is increment for each change in the implementation of the MIB since the LAST-UPDATED date/time.') snmpAgentInfo_Utilities_ServerRev_ces = MibScalar((1, 3, 6, 1, 4, 1, 2505, 1, 15, 1, 1, 3), DisplayString()).setLabel("snmpAgentInfo-Utilities-ServerRev-ces").setMaxAccess("readonly") if mibBuilder.loadTexts: snmpAgentInfo_Utilities_ServerRev_ces.setStatus('mandatory') if mibBuilder.loadTexts: snmpAgentInfo_Utilities_ServerRev_ces.setDescription('This is the major and minor version numbers for the server image it is compatible with.') pingAddress_ces = MibScalar((1, 3, 6, 1, 4, 1, 2505, 1, 15, 1, 1, 4), IpAddress()).setLabel("pingAddress-ces") if mibBuilder.loadTexts: pingAddress_ces.setStatus('mandatory') if mibBuilder.loadTexts: pingAddress_ces.setDescription('') pingRepetitions_ces = MibScalar((1, 3, 6, 1, 4, 1, 2505, 1, 15, 1, 1, 5), Integer32().subtype(subtypeSpec=ValueRangeConstraint(1, 2147483647))).setLabel("pingRepetitions-ces") if mibBuilder.loadTexts: pingRepetitions_ces.setStatus('mandatory') if mibBuilder.loadTexts: pingRepetitions_ces.setDescription('') pingPacketSize_ces = MibScalar((1, 3, 6, 1, 4, 1, 2505, 1, 15, 1, 1, 6), Integer32().subtype(subtypeSpec=ValueRangeConstraint(64, 4076))).setLabel("pingPacketSize-ces") if mibBuilder.loadTexts: pingPacketSize_ces.setStatus('mandatory') if mibBuilder.loadTexts: pingPacketSize_ces.setDescription('') pingSrcAddress_ces = MibScalar((1, 3, 6, 1, 4, 1, 2505, 1, 15, 1, 1, 7), IpAddress()).setLabel("pingSrcAddress-ces") if mibBuilder.loadTexts: pingSrcAddress_ces.setStatus('mandatory') if mibBuilder.loadTexts: pingSrcAddress_ces.setDescription('') pingTable_ces = MibTable((1, 3, 6, 1, 4, 1, 2505, 1, 15, 1, 1, 8), ).setLabel("pingTable-ces") if mibBuilder.loadTexts: pingTable_ces.setStatus('mandatory') if mibBuilder.loadTexts: pingTable_ces.setDescription('') pingEntry_ces = MibTableRow((1, 3, 6, 1, 4, 1, 2505, 1, 15, 1, 1, 8, 1), ).setLabel("pingEntry-ces").setIndexNames((0, "CONTIVITY-INFO-V1-MIB", "pingAddress-ces"), (0, "CONTIVITY-INFO-V1-MIB", "pingRepetitions-ces"), (0, "CONTIVITY-INFO-V1-MIB", "pingPacketSize-ces"), (0, "CONTIVITY-INFO-V1-MIB", "pingSrcAddress-ces")) if mibBuilder.loadTexts: pingEntry_ces.setStatus('mandatory') if mibBuilder.loadTexts: pingEntry_ces.setDescription('') pingAverageTime_ces = MibScalar((1, 3, 6, 1, 4, 1, 2505, 1, 15, 1, 1, 8, 1, 1), Integer32()).setLabel("pingAverageTime-ces").setMaxAccess("readonly") if mibBuilder.loadTexts: pingAverageTime_ces.setStatus('mandatory') if mibBuilder.loadTexts: pingAverageTime_ces.setDescription('Possible Values: -1 indicates that the address could not be pinged. -2 indicates that the instance specified did not conform to valid IP address. A value other than -1 is the average of pings. If the value is 0, then the average ping time is less than 16ms') pingPercentLoss_ces = MibScalar((1, 3, 6, 1, 4, 1, 2505, 1, 15, 1, 1, 8, 1, 2), Integer32()).setLabel("pingPercentLoss-ces").setMaxAccess("readonly") if mibBuilder.loadTexts: pingPercentLoss_ces.setStatus('mandatory') if mibBuilder.loadTexts: pingPercentLoss_ces.setDescription('Possible Values: -1 indicates that the address could not be pinged. -2 indicates that the instance specified did not conform to valid IP address. A value other than -1 is the percentage of pings loss') mibBuilder.exportSymbols("CONTIVITY-INFO-V1-MIB", PYSNMP_MODULE_ID=snmpAgentInfo_ces, snmpAgentInfo_Utilities_Rev_ces=snmpAgentInfo_Utilities_Rev_ces, pingAddress_ces=pingAddress_ces, snmpAgentInfo_Utilities_Ping_ces=snmpAgentInfo_Utilities_Ping_ces, pingRepetitions_ces=pingRepetitions_ces, snmpAgentInfo_Utilities_RevDate_ces=snmpAgentInfo_Utilities_RevDate_ces, pingTable_ces=pingTable_ces, pingAverageTime_ces=pingAverageTime_ces, pingPacketSize_ces=pingPacketSize_ces, snmpAgentInfo_Utilities_ServerRev_ces=snmpAgentInfo_Utilities_ServerRev_ces, pingSrcAddress_ces=pingSrcAddress_ces, snmpAgentInfo_ces=snmpAgentInfo_ces, pingPercentLoss_ces=pingPercentLoss_ces, snmpAgentInfo_Utilities_ces=snmpAgentInfo_Utilities_ces, pingEntry_ces=pingEntry_ces)
(integer, octet_string, object_identifier) = mibBuilder.importSymbols('ASN1', 'Integer', 'OctetString', 'ObjectIdentifier') (named_values,) = mibBuilder.importSymbols('ASN1-ENUMERATION', 'NamedValues') (value_size_constraint, constraints_intersection, constraints_union, single_value_constraint, value_range_constraint) = mibBuilder.importSymbols('ASN1-REFINEMENT', 'ValueSizeConstraint', 'ConstraintsIntersection', 'ConstraintsUnion', 'SingleValueConstraint', 'ValueRangeConstraint') (contivity,) = mibBuilder.importSymbols('NEWOAK-MIB', 'contivity') (notification_group, module_compliance) = mibBuilder.importSymbols('SNMPv2-CONF', 'NotificationGroup', 'ModuleCompliance') (mib_scalar, mib_table, mib_table_row, mib_table_column, bits, counter32, time_ticks, ip_address, counter64, notification_type, gauge32, integer32, unsigned32, iso, module_identity, mib_identifier, object_identity) = mibBuilder.importSymbols('SNMPv2-SMI', 'MibScalar', 'MibTable', 'MibTableRow', 'MibTableColumn', 'Bits', 'Counter32', 'TimeTicks', 'IpAddress', 'Counter64', 'NotificationType', 'Gauge32', 'Integer32', 'Unsigned32', 'iso', 'ModuleIdentity', 'MibIdentifier', 'ObjectIdentity') (textual_convention, display_string) = mibBuilder.importSymbols('SNMPv2-TC', 'TextualConvention', 'DisplayString') snmp_agent_info_ces = module_identity((1, 3, 6, 1, 4, 1, 2505, 1, 15)).setLabel('snmpAgentInfo-ces') snmpAgentInfo_ces.setRevisions(('1900-08-07 22:30',)) if getattr(mibBuilder, 'version', (0, 0, 0)) > (4, 4, 0): if mibBuilder.loadTexts: snmpAgentInfo_ces.setRevisionsDescriptions(('Added snmpAgentInfo-Utilities-RevDate-ces, snmpAgentInfo-Utilities-Rev-ces, snmpAgentInfo-Utilities-ServerRev-ces ',)) if mibBuilder.loadTexts: snmpAgentInfo_ces.setLastUpdated('0008072230Z') if mibBuilder.loadTexts: snmpAgentInfo_ces.setOrganization('Nortel Networks,Inc.') if mibBuilder.loadTexts: snmpAgentInfo_ces.setContactInfo('support@nortelnetworks.com Postal: Nortel Networks,Inc. 80 Central St. Boxboro, MA 01719 Tel: +1 978 264 7100 E-Mail: support@nortelnetworks.com') if mibBuilder.loadTexts: snmpAgentInfo_ces.setDescription('on the Convitiy Extranet Switch.') snmp_agent_info__utilities_ces = mib_identifier((1, 3, 6, 1, 4, 1, 2505, 1, 15, 1)).setLabel('snmpAgentInfo-Utilities-ces') snmp_agent_info__utilities__ping_ces = mib_identifier((1, 3, 6, 1, 4, 1, 2505, 1, 15, 1, 1)).setLabel('snmpAgentInfo-Utilities-Ping-ces') snmp_agent_info__utilities__rev_date_ces = mib_scalar((1, 3, 6, 1, 4, 1, 2505, 1, 15, 1, 1, 1), display_string()).setLabel('snmpAgentInfo-Utilities-RevDate-ces').setMaxAccess('readonly') if mibBuilder.loadTexts: snmpAgentInfo_Utilities_RevDate_ces.setStatus('mandatory') if mibBuilder.loadTexts: snmpAgentInfo_Utilities_RevDate_ces.setDescription('This value should match the LAST-UPDATED value in the MIB.') snmp_agent_info__utilities__rev_ces = mib_scalar((1, 3, 6, 1, 4, 1, 2505, 1, 15, 1, 1, 2), integer32()).setLabel('snmpAgentInfo-Utilities-Rev-ces').setMaxAccess('readonly') if mibBuilder.loadTexts: snmpAgentInfo_Utilities_Rev_ces.setStatus('mandatory') if mibBuilder.loadTexts: snmpAgentInfo_Utilities_Rev_ces.setDescription('This is an integer that is increment for each change in the implementation of the MIB since the LAST-UPDATED date/time.') snmp_agent_info__utilities__server_rev_ces = mib_scalar((1, 3, 6, 1, 4, 1, 2505, 1, 15, 1, 1, 3), display_string()).setLabel('snmpAgentInfo-Utilities-ServerRev-ces').setMaxAccess('readonly') if mibBuilder.loadTexts: snmpAgentInfo_Utilities_ServerRev_ces.setStatus('mandatory') if mibBuilder.loadTexts: snmpAgentInfo_Utilities_ServerRev_ces.setDescription('This is the major and minor version numbers for the server image it is compatible with.') ping_address_ces = mib_scalar((1, 3, 6, 1, 4, 1, 2505, 1, 15, 1, 1, 4), ip_address()).setLabel('pingAddress-ces') if mibBuilder.loadTexts: pingAddress_ces.setStatus('mandatory') if mibBuilder.loadTexts: pingAddress_ces.setDescription('') ping_repetitions_ces = mib_scalar((1, 3, 6, 1, 4, 1, 2505, 1, 15, 1, 1, 5), integer32().subtype(subtypeSpec=value_range_constraint(1, 2147483647))).setLabel('pingRepetitions-ces') if mibBuilder.loadTexts: pingRepetitions_ces.setStatus('mandatory') if mibBuilder.loadTexts: pingRepetitions_ces.setDescription('') ping_packet_size_ces = mib_scalar((1, 3, 6, 1, 4, 1, 2505, 1, 15, 1, 1, 6), integer32().subtype(subtypeSpec=value_range_constraint(64, 4076))).setLabel('pingPacketSize-ces') if mibBuilder.loadTexts: pingPacketSize_ces.setStatus('mandatory') if mibBuilder.loadTexts: pingPacketSize_ces.setDescription('') ping_src_address_ces = mib_scalar((1, 3, 6, 1, 4, 1, 2505, 1, 15, 1, 1, 7), ip_address()).setLabel('pingSrcAddress-ces') if mibBuilder.loadTexts: pingSrcAddress_ces.setStatus('mandatory') if mibBuilder.loadTexts: pingSrcAddress_ces.setDescription('') ping_table_ces = mib_table((1, 3, 6, 1, 4, 1, 2505, 1, 15, 1, 1, 8)).setLabel('pingTable-ces') if mibBuilder.loadTexts: pingTable_ces.setStatus('mandatory') if mibBuilder.loadTexts: pingTable_ces.setDescription('') ping_entry_ces = mib_table_row((1, 3, 6, 1, 4, 1, 2505, 1, 15, 1, 1, 8, 1)).setLabel('pingEntry-ces').setIndexNames((0, 'CONTIVITY-INFO-V1-MIB', 'pingAddress-ces'), (0, 'CONTIVITY-INFO-V1-MIB', 'pingRepetitions-ces'), (0, 'CONTIVITY-INFO-V1-MIB', 'pingPacketSize-ces'), (0, 'CONTIVITY-INFO-V1-MIB', 'pingSrcAddress-ces')) if mibBuilder.loadTexts: pingEntry_ces.setStatus('mandatory') if mibBuilder.loadTexts: pingEntry_ces.setDescription('') ping_average_time_ces = mib_scalar((1, 3, 6, 1, 4, 1, 2505, 1, 15, 1, 1, 8, 1, 1), integer32()).setLabel('pingAverageTime-ces').setMaxAccess('readonly') if mibBuilder.loadTexts: pingAverageTime_ces.setStatus('mandatory') if mibBuilder.loadTexts: pingAverageTime_ces.setDescription('Possible Values: -1 indicates that the address could not be pinged. -2 indicates that the instance specified did not conform to valid IP address. A value other than -1 is the average of pings. If the value is 0, then the average ping time is less than 16ms') ping_percent_loss_ces = mib_scalar((1, 3, 6, 1, 4, 1, 2505, 1, 15, 1, 1, 8, 1, 2), integer32()).setLabel('pingPercentLoss-ces').setMaxAccess('readonly') if mibBuilder.loadTexts: pingPercentLoss_ces.setStatus('mandatory') if mibBuilder.loadTexts: pingPercentLoss_ces.setDescription('Possible Values: -1 indicates that the address could not be pinged. -2 indicates that the instance specified did not conform to valid IP address. A value other than -1 is the percentage of pings loss') mibBuilder.exportSymbols('CONTIVITY-INFO-V1-MIB', PYSNMP_MODULE_ID=snmpAgentInfo_ces, snmpAgentInfo_Utilities_Rev_ces=snmpAgentInfo_Utilities_Rev_ces, pingAddress_ces=pingAddress_ces, snmpAgentInfo_Utilities_Ping_ces=snmpAgentInfo_Utilities_Ping_ces, pingRepetitions_ces=pingRepetitions_ces, snmpAgentInfo_Utilities_RevDate_ces=snmpAgentInfo_Utilities_RevDate_ces, pingTable_ces=pingTable_ces, pingAverageTime_ces=pingAverageTime_ces, pingPacketSize_ces=pingPacketSize_ces, snmpAgentInfo_Utilities_ServerRev_ces=snmpAgentInfo_Utilities_ServerRev_ces, pingSrcAddress_ces=pingSrcAddress_ces, snmpAgentInfo_ces=snmpAgentInfo_ces, pingPercentLoss_ces=pingPercentLoss_ces, snmpAgentInfo_Utilities_ces=snmpAgentInfo_Utilities_ces, pingEntry_ces=pingEntry_ces)
def domain_name(url): st = url.replace("http://", "") tt = st.replace("https://","") ut = tt.replace("www.","") s = ut.split(".") return s[0] print(domain_name("http://github.com/carbonfive/raygun"))
def domain_name(url): st = url.replace('http://', '') tt = st.replace('https://', '') ut = tt.replace('www.', '') s = ut.split('.') return s[0] print(domain_name('http://github.com/carbonfive/raygun'))
fullSWOF2DPath='../FullSWOF_2D' def getFullSWOF2DPath(): return fullSWOF2DPath
full_swof2_d_path = '../FullSWOF_2D' def get_full_swof2_d_path(): return fullSWOF2DPath
# INSTRUCTIONS # ------------ # Create ```config.py``` in this folder, take this file as reference. # ```config.py``` will not be committed to Git, added in .gitignore # Add project settings and API_KEYS here... NEWS_API_KEY = ""
news_api_key = ''
# -*- coding: utf-8 -*- ''' File name: code\maximum_path_sum_ii\sol_67.py Author: Vaidic Joshi Date created: Oct 20, 2018 Python Version: 3.x ''' # Solution to Project Euler Problem #67 :: Maximum path sum II # # For more information see: # https://projecteuler.net/problem=67 # Problem Statement ''' By starting at the top of the triangle below and moving to adjacent numbers on the row below, the maximum total from top to bottom is 23. 37 4 2 4 6 8 5 9 3 That is, 3 + 7 + 4 + 9 = 23. Find the maximum total from top to bottom in triangle.txt (right click and 'Save Link/Target As...'), a 15K text file containing a triangle with one-hundred rows. NOTE: This is a much more difficult version of Problem 18. It is not possible to try every route to solve this problem, as there are 299 altogether! If you could check one trillion (1012) routes every second it would take over twenty billion years to check them all. There is an efficient algorithm to solve it. ;o) ''' # Solution # Solution Approach ''' '''
""" File name: code\\maximum_path_sum_ii\\sol_67.py Author: Vaidic Joshi Date created: Oct 20, 2018 Python Version: 3.x """ "\nBy starting at the top of the triangle below and moving to adjacent numbers on the row below, the maximum total from top to bottom is 23.\n37 4\n2 4 6\n8 5 9 3\nThat is, 3 + 7 + 4 + 9 = 23.\nFind the maximum total from top to bottom in triangle.txt (right click and 'Save Link/Target As...'), a 15K text file containing a triangle with one-hundred rows.\nNOTE: This is a much more difficult version of Problem 18. It is not possible to try every route to solve this problem, as there are 299 altogether! If you could check one trillion (1012) routes every second it would take over twenty billion years to check them all. There is an efficient algorithm to solve it. ;o)\n" '\n'
# # PySNMP MIB module DIFF-SERV-MIB (http://snmplabs.com/pysmi) # ASN.1 source file:///Users/davwang4/Dev/mibs.snmplabs.com/asn1/DIFF-SERV-MIB # Produced by pysmi-0.3.4 at Wed May 1 12:23:07 2019 # On host DAVWANG4-M-1475 platform Darwin version 18.5.0 by user davwang4 # Using Python version 3.7.3 (default, Mar 27 2019, 09:23:15) # Integer, OctetString, ObjectIdentifier = mibBuilder.importSymbols("ASN1", "Integer", "OctetString", "ObjectIdentifier") NamedValues, = mibBuilder.importSymbols("ASN1-ENUMERATION", "NamedValues") SingleValueConstraint, ValueRangeConstraint, ConstraintsIntersection, ConstraintsUnion, ValueSizeConstraint = mibBuilder.importSymbols("ASN1-REFINEMENT", "SingleValueConstraint", "ValueRangeConstraint", "ConstraintsIntersection", "ConstraintsUnion", "ValueSizeConstraint") ifIndex, = mibBuilder.importSymbols("IF-MIB", "ifIndex") InetAddressType, InetAddress = mibBuilder.importSymbols("INET-ADDRESS-MIB", "InetAddressType", "InetAddress") BurstSize, = mibBuilder.importSymbols("INTEGRATED-SERVICES-MIB", "BurstSize") NotificationGroup, ObjectGroup, ModuleCompliance = mibBuilder.importSymbols("SNMPv2-CONF", "NotificationGroup", "ObjectGroup", "ModuleCompliance") Unsigned32, ModuleIdentity, MibIdentifier, mib_2, MibScalar, MibTable, MibTableRow, MibTableColumn, Counter32, Integer32, TimeTicks, zeroDotZero, Bits, ObjectIdentity, NotificationType, Gauge32, IpAddress, iso, Counter64 = mibBuilder.importSymbols("SNMPv2-SMI", "Unsigned32", "ModuleIdentity", "MibIdentifier", "mib-2", "MibScalar", "MibTable", "MibTableRow", "MibTableColumn", "Counter32", "Integer32", "TimeTicks", "zeroDotZero", "Bits", "ObjectIdentity", "NotificationType", "Gauge32", "IpAddress", "iso", "Counter64") DisplayString, RowStatus, TimeStamp, TextualConvention, RowPointer = mibBuilder.importSymbols("SNMPv2-TC", "DisplayString", "RowStatus", "TimeStamp", "TextualConvention", "RowPointer") diffServMib = ModuleIdentity((1, 3, 6, 1, 2, 1, 12345)) diffServMib.setRevisions(('2000-07-13 00:00',)) if getattr(mibBuilder, 'version', (0, 0, 0)) > (4, 4, 0): if mibBuilder.loadTexts: diffServMib.setRevisionsDescriptions(('Initial version, published as RFC xxxx.',)) if mibBuilder.loadTexts: diffServMib.setLastUpdated('200007130000Z') if mibBuilder.loadTexts: diffServMib.setOrganization('IETF Diffserv WG') if mibBuilder.loadTexts: diffServMib.setContactInfo(' Brian Carpenter (co-chair of Diffserv WG) c/o iCAIR 1890 Maple Ave, #150 Evanston, IL 60201, USA Phone: +1 847 467 7811 E-mail: brian@icair.org Kathleen Nichols (co-chair of Diffserv WG) Packet Design E-mail: nichols@packetdesign.com Fred Baker (author) Cisco Systems 519 Lado Drive Santa Barbara, CA 93111, USA E-mail: fred@cisco.com Kwok Ho Chan (author) Nortel Networks 600 Technology Park Drive Billerica, MA 01821, USA E-mail: khchan@nortelnetworks.com Andrew Smith (author) E-mail: ah-smith@pacbell.net') if mibBuilder.loadTexts: diffServMib.setDescription('This MIB defines the objects necessary to manage a device that uses the Differentiated Services Architecture described in RFC 2475 and the Informal Management Model for DiffServ Routers in draft-ietf-diffserv-model-04.txt.') diffServObjects = MibIdentifier((1, 3, 6, 1, 2, 1, 12345, 1)) diffServTables = MibIdentifier((1, 3, 6, 1, 2, 1, 12345, 2)) diffServMIBConformance = MibIdentifier((1, 3, 6, 1, 2, 1, 12345, 3)) class Dscp(TextualConvention, Integer32): description = 'The IP header Diffserv Code-Point that may be used for discriminating or marking a traffic stream. The value -1 is used to indicate a wildcard i.e. any value.' status = 'current' displayHint = 'd' subtypeSpec = Integer32.subtypeSpec + ConstraintsUnion(ValueRangeConstraint(-1, -1), ValueRangeConstraint(0, 63), ) class SixTupleClfrL4Port(TextualConvention, Integer32): description = 'A value indicating a Layer-4 protocol port number.' status = 'current' displayHint = 'd' subtypeSpec = Integer32.subtypeSpec + ValueRangeConstraint(0, 65535) class IfDirection(TextualConvention, Integer32): description = "Specifies a direction of data travel on an interface. 'inbound' traffic is operated on during reception from the interface, while 'outbound' traffic is operated on prior to transmission on the interface." status = 'current' subtypeSpec = Integer32.subtypeSpec + ConstraintsUnion(SingleValueConstraint(1, 2)) namedValues = NamedValues(("inbound", 1), ("outbound", 2)) diffServClassifierTable = MibTable((1, 3, 6, 1, 2, 1, 12345, 2, 1), ) if mibBuilder.loadTexts: diffServClassifierTable.setReference('[MODEL] section 4.1') if mibBuilder.loadTexts: diffServClassifierTable.setStatus('current') if mibBuilder.loadTexts: diffServClassifierTable.setDescription('The classifier table defines the classifiers that are applied to traffic arriving at this interface in a particular direction. Specific classifiers are defined by RowPointers in the entries of this table which identify entries in filter tables of specific types, e.g. Multi-Field Classifiers (MFCs) for IP are defined in the diffServSixTupleClfrTable. Other classifier types may be defined elsewhere.') diffServClassifierEntry = MibTableRow((1, 3, 6, 1, 2, 1, 12345, 2, 1, 1), ).setIndexNames((0, "IF-MIB", "ifIndex"), (0, "DIFF-SERV-MIB", "diffServClassifierIfDirection"), (0, "DIFF-SERV-MIB", "diffServClassifierTcb"), (0, "DIFF-SERV-MIB", "diffServClassifierId")) if mibBuilder.loadTexts: diffServClassifierEntry.setStatus('current') if mibBuilder.loadTexts: diffServClassifierEntry.setDescription('An entry in the classifier table describes a single element of the classifier.') diffServClassifierIfDirection = MibTableColumn((1, 3, 6, 1, 2, 1, 12345, 2, 1, 1, 1), IfDirection()) if mibBuilder.loadTexts: diffServClassifierIfDirection.setStatus('current') if mibBuilder.loadTexts: diffServClassifierIfDirection.setDescription('Specifies the direction for which this classifier entry applies on this interface.') diffServClassifierTcb = MibTableColumn((1, 3, 6, 1, 2, 1, 12345, 2, 1, 1, 2), Unsigned32()) if mibBuilder.loadTexts: diffServClassifierTcb.setStatus('current') if mibBuilder.loadTexts: diffServClassifierTcb.setDescription('Specifies the TCB of which this classifier element is a part. Lower numbers indicate an element that belongs to a classifier that is part of a TCB that is, at least conceptually, applied to traffic before those with higher numbers - this is necessary to resolve ambiguity in cases where different TCBs contain filters that overlap with each other. A manager wanting to create a new TCB should either first search this table for existing entries and pick a value for this variable that is not currently represented - some form of pseudo- random choice is likely to minimise collisions. After successful creation of a conceptual row using the chosen value, the manager should check again that there are no other rows with this value that have been created by a different manager that could, potentially, interfere with the classifier elements that are desired.') diffServClassifierId = MibTableColumn((1, 3, 6, 1, 2, 1, 12345, 2, 1, 1, 3), Unsigned32()) if mibBuilder.loadTexts: diffServClassifierId.setStatus('current') if mibBuilder.loadTexts: diffServClassifierId.setDescription('A classifier ID that enumerates the classifier elements. The set of such identifiers spans the whole agent. Managers should obtain new values for row creation in this table by reading diffServClassifierNextFree.') diffServClassifierFilter = MibTableColumn((1, 3, 6, 1, 2, 1, 12345, 2, 1, 1, 4), RowPointer().clone((0, 0))).setMaxAccess("readcreate") if mibBuilder.loadTexts: diffServClassifierFilter.setStatus('current') if mibBuilder.loadTexts: diffServClassifierFilter.setDescription('A pointer to a valid entry in another table that describes the applicable classification filter, e.g. an entry in diffServSixTupleClfrTable. If the row pointed to does not exist, the classifier is ignored. The value zeroDotZero is interpreted to match anything not matched by another classifier - only one such entry may exist in this table.') diffServClassifierNext = MibTableColumn((1, 3, 6, 1, 2, 1, 12345, 2, 1, 1, 5), RowPointer()).setMaxAccess("readcreate") if mibBuilder.loadTexts: diffServClassifierNext.setStatus('current') if mibBuilder.loadTexts: diffServClassifierNext.setDescription('This selects the next datapath element to handle packets matching the filter pattern. For example, this can point to an entry in a meter, action, algorithmic dropper or queue table. If the row pointed to does not exist, the classifier element is ignored.') diffServClassifierPrecedence = MibTableColumn((1, 3, 6, 1, 2, 1, 12345, 2, 1, 1, 6), Unsigned32()).setMaxAccess("readcreate") if mibBuilder.loadTexts: diffServClassifierPrecedence.setStatus('current') if mibBuilder.loadTexts: diffServClassifierPrecedence.setDescription('The relative precedence in which classifiers are applied: higher numbers represent classifiers with higher precedence. Classifiers with the same precedence must be unambiguous i.e. they must define non-overlapping patterns, and are considered to be applied simultaneously to the traffic stream. Classifiers with different precedence may overlap in their filters: the classifier with the highest precedence that matches is taken. On a given interface, there must be a complete classifier in place at all times for the first TCB (lowest value of diffServClassifierTcb) in the ingress direction. This means that there will always be one or more filters that match every possible pattern that could be presented in an incoming packet. There is no such requirement for subsequent TCBs in the ingress direction, nor for any TCB in the egress direction.') diffServClassifierStatus = MibTableColumn((1, 3, 6, 1, 2, 1, 12345, 2, 1, 1, 7), RowStatus()).setMaxAccess("readcreate") if mibBuilder.loadTexts: diffServClassifierStatus.setStatus('current') if mibBuilder.loadTexts: diffServClassifierStatus.setDescription('The RowStatus variable controls the activation, deactivation, or deletion of a classifier. Any writable variable may be modified whether the row is active or notInService.') diffServClassifierNextFree = MibScalar((1, 3, 6, 1, 2, 1, 12345, 1, 1), Unsigned32()).setMaxAccess("readonly") if mibBuilder.loadTexts: diffServClassifierNextFree.setStatus('current') if mibBuilder.loadTexts: diffServClassifierNextFree.setDescription('This object yields a value when read that is currently-unused for a diffServClassifierId instance. If a configuring system attempts to create a new row in the diffServClassifierTable using this value, that operation will fail if the value has, in the meantime, been used to create another row that is currently valid.') diffServSixTupleClfrTable = MibTable((1, 3, 6, 1, 2, 1, 12345, 2, 2), ) if mibBuilder.loadTexts: diffServSixTupleClfrTable.setReference('[MODEL] section 4.2.2') if mibBuilder.loadTexts: diffServSixTupleClfrTable.setStatus('current') if mibBuilder.loadTexts: diffServSixTupleClfrTable.setDescription('A table of IP Six-Tuple Classifier filter entries that a system may use to identify IP traffic.') diffServSixTupleClfrEntry = MibTableRow((1, 3, 6, 1, 2, 1, 12345, 2, 2, 1), ).setIndexNames((0, "DIFF-SERV-MIB", "diffServSixTupleClfrId")) if mibBuilder.loadTexts: diffServSixTupleClfrEntry.setStatus('current') if mibBuilder.loadTexts: diffServSixTupleClfrEntry.setDescription('An IP Six-Tuple Classifier entry describes a single filter.') diffServSixTupleClfrId = MibTableColumn((1, 3, 6, 1, 2, 1, 12345, 2, 2, 1, 1), Unsigned32()) if mibBuilder.loadTexts: diffServSixTupleClfrId.setStatus('current') if mibBuilder.loadTexts: diffServSixTupleClfrId.setDescription('A unique identifier for the filter. Filters may be shared by multiple interfaces in the same system. Managers should obtain new values for row creation in this table by reading diffServSixTupleClfrNextFree.') diffServSixTupleClfrDstAddrType = MibTableColumn((1, 3, 6, 1, 2, 1, 12345, 2, 2, 1, 2), InetAddressType()).setMaxAccess("readcreate") if mibBuilder.loadTexts: diffServSixTupleClfrDstAddrType.setStatus('current') if mibBuilder.loadTexts: diffServSixTupleClfrDstAddrType.setDescription('The type of IP destination address used by this classifier entry.') diffServSixTupleClfrDstAddr = MibTableColumn((1, 3, 6, 1, 2, 1, 12345, 2, 2, 1, 3), InetAddress()).setMaxAccess("readcreate") if mibBuilder.loadTexts: diffServSixTupleClfrDstAddr.setStatus('current') if mibBuilder.loadTexts: diffServSixTupleClfrDstAddr.setDescription("The IP address to match against the packet's destination IP address.") diffServSixTupleClfrDstAddrMask = MibTableColumn((1, 3, 6, 1, 2, 1, 12345, 2, 2, 1, 4), Unsigned32()).setUnits('bits').setMaxAccess("readcreate") if mibBuilder.loadTexts: diffServSixTupleClfrDstAddrMask.setStatus('current') if mibBuilder.loadTexts: diffServSixTupleClfrDstAddrMask.setDescription('The length of a mask for the matching of the destination IP address. Masks are constructed by setting bits in sequence from the most-significant bit downwards for diffServSixTupleClfrDstAddrMask bits length. All other bits in the mask, up to the number needed to fill the length of the address diffServSixTupleClfrDstAddr are cleared to zero. A zero bit in the mask then means that the corresponding bit in the address always matches.') diffServSixTupleClfrSrcAddrType = MibTableColumn((1, 3, 6, 1, 2, 1, 12345, 2, 2, 1, 5), InetAddressType()).setMaxAccess("readcreate") if mibBuilder.loadTexts: diffServSixTupleClfrSrcAddrType.setStatus('current') if mibBuilder.loadTexts: diffServSixTupleClfrSrcAddrType.setDescription('The type of IP source address used by this classifier entry.') diffServSixTupleClfrSrcAddr = MibTableColumn((1, 3, 6, 1, 2, 1, 12345, 2, 2, 1, 6), InetAddress()).setMaxAccess("readcreate") if mibBuilder.loadTexts: diffServSixTupleClfrSrcAddr.setStatus('current') if mibBuilder.loadTexts: diffServSixTupleClfrSrcAddr.setDescription('The IP address to match against the source IP address of each packet.') diffServSixTupleClfrSrcAddrMask = MibTableColumn((1, 3, 6, 1, 2, 1, 12345, 2, 2, 1, 7), Unsigned32()).setUnits('bits').setMaxAccess("readcreate") if mibBuilder.loadTexts: diffServSixTupleClfrSrcAddrMask.setStatus('current') if mibBuilder.loadTexts: diffServSixTupleClfrSrcAddrMask.setDescription('The length of a mask for the matching of the source IP address. Masks are constructed by setting bits in sequence from the most- significant bit downwards for diffServSixTupleClfrSrcAddrMask bits length. All other bits in the mask, up to the number needed to fill the length of the address diffServSixTupleClfrSrcAddr are cleared to zero. A zero bit in the mask then means that the corresponding bit in the address always matches.') diffServSixTupleClfrDscp = MibTableColumn((1, 3, 6, 1, 2, 1, 12345, 2, 2, 1, 8), Dscp().clone(-1)).setMaxAccess("readcreate") if mibBuilder.loadTexts: diffServSixTupleClfrDscp.setStatus('current') if mibBuilder.loadTexts: diffServSixTupleClfrDscp.setDescription('The value that the DSCP in the packet must have to match this entry. A value of -1 indicates that a specific DSCP value has not been defined and thus all DSCP values are considered a match.') diffServSixTupleClfrProtocol = MibTableColumn((1, 3, 6, 1, 2, 1, 12345, 2, 2, 1, 9), Integer32().subtype(subtypeSpec=ValueRangeConstraint(0, 255))).setMaxAccess("readcreate") if mibBuilder.loadTexts: diffServSixTupleClfrProtocol.setStatus('current') if mibBuilder.loadTexts: diffServSixTupleClfrProtocol.setDescription('The IP protocol to match against the IPv4 protocol number in the packet. A value of zero means match all.') diffServSixTupleClfrDstL4PortMin = MibTableColumn((1, 3, 6, 1, 2, 1, 12345, 2, 2, 1, 10), SixTupleClfrL4Port()).setMaxAccess("readcreate") if mibBuilder.loadTexts: diffServSixTupleClfrDstL4PortMin.setStatus('current') if mibBuilder.loadTexts: diffServSixTupleClfrDstL4PortMin.setDescription('The minimum value that the layer-4 destination port number in the packet must have in order to match this classifier entry.') diffServSixTupleClfrDstL4PortMax = MibTableColumn((1, 3, 6, 1, 2, 1, 12345, 2, 2, 1, 11), SixTupleClfrL4Port().clone(65535)).setMaxAccess("readcreate") if mibBuilder.loadTexts: diffServSixTupleClfrDstL4PortMax.setStatus('current') if mibBuilder.loadTexts: diffServSixTupleClfrDstL4PortMax.setDescription('The maximum value that the layer-4 destination port number in the packet must have in order to match this classifier entry. This value must be equal to or greater that the value specified for this entry in diffServSixTupleClfrDstL4PortMin.') diffServSixTupleClfrSrcL4PortMin = MibTableColumn((1, 3, 6, 1, 2, 1, 12345, 2, 2, 1, 12), SixTupleClfrL4Port()).setMaxAccess("readcreate") if mibBuilder.loadTexts: diffServSixTupleClfrSrcL4PortMin.setStatus('current') if mibBuilder.loadTexts: diffServSixTupleClfrSrcL4PortMin.setDescription('The minimum value that the layer-4 source port number in the packet must have in order to match this classifier entry.') diffServSixTupleClfrSrcL4PortMax = MibTableColumn((1, 3, 6, 1, 2, 1, 12345, 2, 2, 1, 13), SixTupleClfrL4Port().clone(65535)).setMaxAccess("readcreate") if mibBuilder.loadTexts: diffServSixTupleClfrSrcL4PortMax.setStatus('current') if mibBuilder.loadTexts: diffServSixTupleClfrSrcL4PortMax.setDescription('The maximum value that the layer-4 source port number in the packet must have in oder to match this classifier entry. This value must be equal to or greater that the value specified for this entry in dsSixTupleIpSrcL4PortMin.') diffServSixTupleClfrStatus = MibTableColumn((1, 3, 6, 1, 2, 1, 12345, 2, 2, 1, 14), RowStatus()).setMaxAccess("readcreate") if mibBuilder.loadTexts: diffServSixTupleClfrStatus.setStatus('current') if mibBuilder.loadTexts: diffServSixTupleClfrStatus.setDescription('The RowStatus variable controls the activation, deactivation, or deletion of a classifier. Any writable variable may be modified whether the row is active or notInService.') diffServSixTupleClfrNextFree = MibScalar((1, 3, 6, 1, 2, 1, 12345, 1, 2), Unsigned32()).setMaxAccess("readonly") if mibBuilder.loadTexts: diffServSixTupleClfrNextFree.setStatus('current') if mibBuilder.loadTexts: diffServSixTupleClfrNextFree.setDescription('This object yields a value when read that is currently-unused for a diffServSixTupleClfrId instance. If a configuring system attempts to create a new row in the diffServSixTupleClfrTable using this value, that operation will fail if the value has, in the meantime, been used to create another row that is currently valid.') diffServMeterTable = MibTable((1, 3, 6, 1, 2, 1, 12345, 2, 3), ) if mibBuilder.loadTexts: diffServMeterTable.setReference('[MODEL] section 5.1') if mibBuilder.loadTexts: diffServMeterTable.setStatus('current') if mibBuilder.loadTexts: diffServMeterTable.setDescription('This table enumerates generic meters that a system may use to police a stream of traffic. The traffic stream to be metered is determined by the element(s) upstream of the meter i.e. by the object(s) that point to each entry in this table. This may include all traffic on an interface. Specific meter details are to be found in diffServMeterSpecific.') diffServMeterEntry = MibTableRow((1, 3, 6, 1, 2, 1, 12345, 2, 3, 1), ).setIndexNames((0, "IF-MIB", "ifIndex"), (0, "DIFF-SERV-MIB", "diffServMeterIfDirection"), (0, "DIFF-SERV-MIB", "diffServMeterId")) if mibBuilder.loadTexts: diffServMeterEntry.setStatus('current') if mibBuilder.loadTexts: diffServMeterEntry.setDescription('An entry in the meter table describing a single meter.') diffServMeterIfDirection = MibTableColumn((1, 3, 6, 1, 2, 1, 12345, 2, 3, 1, 1), IfDirection()) if mibBuilder.loadTexts: diffServMeterIfDirection.setStatus('current') if mibBuilder.loadTexts: diffServMeterIfDirection.setDescription('Specifies the direction for which this meter entry applies on this interface.') diffServMeterId = MibTableColumn((1, 3, 6, 1, 2, 1, 12345, 2, 3, 1, 2), Unsigned32()) if mibBuilder.loadTexts: diffServMeterId.setStatus('current') if mibBuilder.loadTexts: diffServMeterId.setDescription('This identifies a meter entry. Managers should obtain new values for row creation in this table by reading diffServMeterNextFree.') diffServMeterSucceedNext = MibTableColumn((1, 3, 6, 1, 2, 1, 12345, 2, 3, 1, 3), RowPointer().clone((0, 0))).setMaxAccess("readcreate") if mibBuilder.loadTexts: diffServMeterSucceedNext.setStatus('current') if mibBuilder.loadTexts: diffServMeterSucceedNext.setDescription('If the traffic does conform to the meter, this indicates the next datapath element to handle the traffic e.g. an Action or another Meter datapath element. The value zeroDotZero in this variable indicates no further Diffserv treatment is performed on this traffic by the current interface for this interface direction. If the row pointed to does not exist, the meter element is considered inactive.') diffServMeterFailNext = MibTableColumn((1, 3, 6, 1, 2, 1, 12345, 2, 3, 1, 4), RowPointer().clone((0, 0))).setMaxAccess("readcreate") if mibBuilder.loadTexts: diffServMeterFailNext.setStatus('current') if mibBuilder.loadTexts: diffServMeterFailNext.setDescription('If the traffic does not conform to the meter, this indicates the next datapath element to handle the traffic e.g. an Action or Meter datapath element. The value zeroDotZero in this variable indicates no further Diffserv treatment is performed on this traffic by the current interface for this interface direction. If the row pointed to does not exist, the meter element is considered inactive.') diffServMeterSpecific = MibTableColumn((1, 3, 6, 1, 2, 1, 12345, 2, 3, 1, 5), ObjectIdentifier()).setMaxAccess("readcreate") if mibBuilder.loadTexts: diffServMeterSpecific.setStatus('current') if mibBuilder.loadTexts: diffServMeterSpecific.setDescription('This indicates the behaviour of the meter by pointing to a table containing detailed parameters. Note that entries in that specific table must be managed explicitly. One example of a valid object would be diffServTBMeterTable, whose entries are indexed by the same variables as this table, for describing an instance of a token-bucket meter.') diffServMeterStatus = MibTableColumn((1, 3, 6, 1, 2, 1, 12345, 2, 3, 1, 6), RowStatus()).setMaxAccess("readcreate") if mibBuilder.loadTexts: diffServMeterStatus.setStatus('current') if mibBuilder.loadTexts: diffServMeterStatus.setDescription('The RowStatus variable controls the activation, deactivation, or deletion of a meter. Any writable variable may be modified whether the row is active or notInService.') diffServMeterNextFree = MibScalar((1, 3, 6, 1, 2, 1, 12345, 1, 3), Unsigned32()).setMaxAccess("readonly") if mibBuilder.loadTexts: diffServMeterNextFree.setStatus('current') if mibBuilder.loadTexts: diffServMeterNextFree.setDescription('This object yields a value when read that is currently-unused for a diffServMeterId instance. If a configuring system attempts to create a new row in the diffServMeterTable using this value, that operation will fail if the value has, in the meantime, been used to create another row that is currently valid.') diffServTBMeterTable = MibTable((1, 3, 6, 1, 2, 1, 12345, 2, 4), ) if mibBuilder.loadTexts: diffServTBMeterTable.setReference('[MODEL] section 5.1.3') if mibBuilder.loadTexts: diffServTBMeterTable.setStatus('current') if mibBuilder.loadTexts: diffServTBMeterTable.setDescription('This table enumerates specific token-bucket meters that a system may use to police a stream of traffic. Such meters are modelled here as having a single rate and a burst size. Multiple meter elements may be logically cascaded using their diffServMeterSucceedNext pointers if a multi-rate token bucket is needed. One example of this might be for an AF PHB implementation that used two-rate meters. Such cascading of meter elements of specific type of token-bucket indicates forwarding behaviour that is functionally equivalent to a multi- rate meter: the sequential nature of the representation is merely a notational convenience for this MIB. Entries in this table share indexing with a parent diffServMeterEntry although they must be managed (e.g. created/deleted) by explicit management action, independently of the associated value of diffServMeterSpecific.') diffServTBMeterEntry = MibTableRow((1, 3, 6, 1, 2, 1, 12345, 2, 4, 1), ).setIndexNames((0, "IF-MIB", "ifIndex"), (0, "DIFF-SERV-MIB", "diffServMeterIfDirection"), (0, "DIFF-SERV-MIB", "diffServMeterId")) if mibBuilder.loadTexts: diffServTBMeterEntry.setStatus('current') if mibBuilder.loadTexts: diffServTBMeterEntry.setDescription('An entry that describes a single token-bucket meter, indexed by the same variables as a diffServMeterEntry.') diffServTBMeterRate = MibTableColumn((1, 3, 6, 1, 2, 1, 12345, 2, 4, 1, 1), Unsigned32()).setUnits('kilobits per second').setMaxAccess("readcreate") if mibBuilder.loadTexts: diffServTBMeterRate.setStatus('current') if mibBuilder.loadTexts: diffServTBMeterRate.setDescription('The token-bucket rate, in kilobits per second (kbps).') diffServTBMeterBurstSize = MibTableColumn((1, 3, 6, 1, 2, 1, 12345, 2, 4, 1, 2), BurstSize()).setUnits('Bytes').setMaxAccess("readcreate") if mibBuilder.loadTexts: diffServTBMeterBurstSize.setStatus('current') if mibBuilder.loadTexts: diffServTBMeterBurstSize.setDescription('The maximum number of bytes in a single transmission burst. The interval over which the burst is to be measured can be derived as diffServTBMeterBurstSize*8*1000/diffServTBMeterRate.') diffServTBMeterStatus = MibTableColumn((1, 3, 6, 1, 2, 1, 12345, 2, 4, 1, 3), RowStatus()).setMaxAccess("readcreate") if mibBuilder.loadTexts: diffServTBMeterStatus.setStatus('current') if mibBuilder.loadTexts: diffServTBMeterStatus.setDescription('The RowStatus variable controls the activation, deactivation, or deletion of a meter. Any writable variable may be modified whether the row is active or notInService.') diffServActionTable = MibTable((1, 3, 6, 1, 2, 1, 12345, 2, 5), ) if mibBuilder.loadTexts: diffServActionTable.setReference('[MODEL] section 6.') if mibBuilder.loadTexts: diffServActionTable.setStatus('current') if mibBuilder.loadTexts: diffServActionTable.setDescription('The Action Table enumerates actions that can be performed to a stream of traffic. Multiple actions can be concatenated. For example, after marking a stream of traffic exiting from a meter, a device can then perform a count action of the conforming or non-conforming traffic. Specific actions are indicated by diffServActionSpecific which points to another object which describes the action in further detail.') diffServActionEntry = MibTableRow((1, 3, 6, 1, 2, 1, 12345, 2, 5, 1), ).setIndexNames((0, "IF-MIB", "ifIndex"), (0, "DIFF-SERV-MIB", "diffServActionIfDirection"), (0, "DIFF-SERV-MIB", "diffServActionId")) if mibBuilder.loadTexts: diffServActionEntry.setStatus('current') if mibBuilder.loadTexts: diffServActionEntry.setDescription('An entry in the action table describing the actions applied to traffic arriving at its input.') diffServActionIfDirection = MibTableColumn((1, 3, 6, 1, 2, 1, 12345, 2, 5, 1, 1), IfDirection()) if mibBuilder.loadTexts: diffServActionIfDirection.setStatus('current') if mibBuilder.loadTexts: diffServActionIfDirection.setDescription('Specifies the direction for which this action entry applies on this interface.') diffServActionId = MibTableColumn((1, 3, 6, 1, 2, 1, 12345, 2, 5, 1, 2), Unsigned32()) if mibBuilder.loadTexts: diffServActionId.setStatus('current') if mibBuilder.loadTexts: diffServActionId.setDescription('This identifies the action entry. Managers should obtain new values for row creation in this table by reading diffServActionNextFree.') diffServActionNext = MibTableColumn((1, 3, 6, 1, 2, 1, 12345, 2, 5, 1, 3), RowPointer().clone((0, 0))).setMaxAccess("readcreate") if mibBuilder.loadTexts: diffServActionNext.setStatus('current') if mibBuilder.loadTexts: diffServActionNext.setDescription('The Next pointer indicates the next datapath element to handle the traffic. For example, a queue datapath element. The value zeroDotZero in this variable indicates no further DiffServ treatment is performed on this flow by the current interface for this interface direction. If the row pointed to does not exist, the action element is considered inactive.') diffServActionSpecific = MibTableColumn((1, 3, 6, 1, 2, 1, 12345, 2, 5, 1, 4), ObjectIdentifier()).setMaxAccess("readcreate") if mibBuilder.loadTexts: diffServActionSpecific.setStatus('current') if mibBuilder.loadTexts: diffServActionSpecific.setDescription('A pointer to an object instance providing additional information for the type of action indicated by this action table entry. For the standard actions defined by this MIB module, this should point to one of the following: a diffServDscpMarkActEntry, a diffServCountActEntry, the diffServAbsoluteDropAction OID. For other actions, it may point to an object instance defined in some other MIB.') diffServActionStatus = MibTableColumn((1, 3, 6, 1, 2, 1, 12345, 2, 5, 1, 5), RowStatus()).setMaxAccess("readcreate") if mibBuilder.loadTexts: diffServActionStatus.setStatus('current') if mibBuilder.loadTexts: diffServActionStatus.setDescription('The RowStatus variable controls the activation, deactivation or deletion of an action element. Any writable variable may be modified whether the row is active or notInService.') diffServActionNextFree = MibScalar((1, 3, 6, 1, 2, 1, 12345, 1, 4), Unsigned32()).setMaxAccess("readonly") if mibBuilder.loadTexts: diffServActionNextFree.setStatus('current') if mibBuilder.loadTexts: diffServActionNextFree.setDescription('This object yields a value when read that is currently-unused for a diffServActionId instance. If a configuring system attempts to create a new row in the diffServActionTable using this value, that operation will fail if the value has, in the meantime, been used to create another row that is currently valid.') diffServDscpMarkActTable = MibTable((1, 3, 6, 1, 2, 1, 12345, 2, 6), ) if mibBuilder.loadTexts: diffServDscpMarkActTable.setReference('[MODEL] section 6.1') if mibBuilder.loadTexts: diffServDscpMarkActTable.setStatus('current') if mibBuilder.loadTexts: diffServDscpMarkActTable.setDescription('This table enumerates specific DSCPs used for marking or remarking the DSCP field of IP packets. The entries of this table may be referenced by a diffServActionSpecific attribute that points to diffServDscpMarkActTable.') diffServDscpMarkActEntry = MibTableRow((1, 3, 6, 1, 2, 1, 12345, 2, 6, 1), ).setIndexNames((0, "DIFF-SERV-MIB", "diffServDscpMarkActDscp")) if mibBuilder.loadTexts: diffServDscpMarkActEntry.setStatus('current') if mibBuilder.loadTexts: diffServDscpMarkActEntry.setDescription('An entry in the DSCP mark action table that describes a single DSCP used for marking.') diffServDscpMarkActDscp = MibTableColumn((1, 3, 6, 1, 2, 1, 12345, 2, 6, 1, 1), Dscp()).setMaxAccess("readonly") if mibBuilder.loadTexts: diffServDscpMarkActDscp.setStatus('current') if mibBuilder.loadTexts: diffServDscpMarkActDscp.setDescription('The DSCP that this Action uses for marking/remarking traffic. Note that a DSCP value of -1 is not permitted in this table. It is quite possible that the only packets subject to this Action are already marked with this DSCP. Note also that Diffserv may result in packet remarking both on ingress to a network and on egress from it and it is quite possible that ingress and egress would occur in the same router.') diffServCountActTable = MibTable((1, 3, 6, 1, 2, 1, 12345, 2, 7), ) if mibBuilder.loadTexts: diffServCountActTable.setReference('[MODEL] section 6.5') if mibBuilder.loadTexts: diffServCountActTable.setStatus('current') if mibBuilder.loadTexts: diffServCountActTable.setDescription('This table contains counters for all the traffic passing through an action element.') diffServCountActEntry = MibTableRow((1, 3, 6, 1, 2, 1, 12345, 2, 7, 1), ).setIndexNames((0, "IF-MIB", "ifIndex"), (0, "DIFF-SERV-MIB", "diffServActionIfDirection"), (0, "DIFF-SERV-MIB", "diffServActionId")) if mibBuilder.loadTexts: diffServCountActEntry.setStatus('current') if mibBuilder.loadTexts: diffServCountActEntry.setDescription('An entry in the count action table that describes a single set of traffic counters. Entries in this table share indexing with those in the base diffServActionTable although they must be managed (e.g. created/deleted) by explicit management action, independently of the associated value of diffServActionSpecific.') diffServCountActOctets = MibTableColumn((1, 3, 6, 1, 2, 1, 12345, 2, 7, 1, 1), Counter32()).setMaxAccess("readonly") if mibBuilder.loadTexts: diffServCountActOctets.setStatus('current') if mibBuilder.loadTexts: diffServCountActOctets.setDescription('The number of octets at the Action datapath element. On high speed devices, this object implements the least significant 32 bits of diffServcountActHCOctets. Discontinuities in the value of this counter can occur at re- initialization of the management system and at other times as indicated by the value of diffServCountActDiscontTime for this entry.') diffServCountActHCOctets = MibTableColumn((1, 3, 6, 1, 2, 1, 12345, 2, 7, 1, 2), Counter64()).setMaxAccess("readonly") if mibBuilder.loadTexts: diffServCountActHCOctets.setStatus('current') if mibBuilder.loadTexts: diffServCountActHCOctets.setDescription('The number of octets at the Action datapath element. This object should be used on high speed interfaces. Discontinuities in the value of this counter can occur at re- initialization of the management system and at other times as indicated by the value of diffServCountActDiscontTime for this entry.') diffServCountActPkts = MibTableColumn((1, 3, 6, 1, 2, 1, 12345, 2, 7, 1, 3), Counter32()).setMaxAccess("readonly") if mibBuilder.loadTexts: diffServCountActPkts.setStatus('current') if mibBuilder.loadTexts: diffServCountActPkts.setDescription('The number of packets at the Action datapath element. On high speed devices, this object implements the least significant 32 bits of diffServcountActHCPkts. Discontinuities in the value of this counter can occur at re- initialization of the management system and at other times as indicated by the value of diffServCountActDiscontTime for this entry.') diffServCountActHCPkts = MibTableColumn((1, 3, 6, 1, 2, 1, 12345, 2, 7, 1, 4), Counter64()).setMaxAccess("readonly") if mibBuilder.loadTexts: diffServCountActHCPkts.setStatus('current') if mibBuilder.loadTexts: diffServCountActHCPkts.setDescription('The number of packets at the Action datapath element. This object should be used on high speed interfaces. Discontinuities in the value of this counter can occur at re- initialization of the management system and at other times as indicated by the value of diffServCountActDiscontTime for this entry.') diffServCountActDiscontTime = MibTableColumn((1, 3, 6, 1, 2, 1, 12345, 2, 7, 1, 5), TimeStamp()).setMaxAccess("readonly") if mibBuilder.loadTexts: diffServCountActDiscontTime.setStatus('current') if mibBuilder.loadTexts: diffServCountActDiscontTime.setDescription("The value of sysUpTime on the most recent occasion at which any one or more of this entry's counters suffered a discontinuity. If no such discontinuities have occurred since the last re- initialization of the local management subsystem, then this object contains a zero value.") diffServCountActStatus = MibTableColumn((1, 3, 6, 1, 2, 1, 12345, 2, 7, 1, 6), RowStatus()).setMaxAccess("readcreate") if mibBuilder.loadTexts: diffServCountActStatus.setStatus('current') if mibBuilder.loadTexts: diffServCountActStatus.setDescription('The RowStatus variable controls the activation, deactivation, or deletion of this entry. Any writable variable may be modified whether the row is active or notInService.') diffServAbsoluteDropAction = ObjectIdentity((1, 3, 6, 1, 2, 1, 12345, 1, 6)) if mibBuilder.loadTexts: diffServAbsoluteDropAction.setStatus('current') if mibBuilder.loadTexts: diffServAbsoluteDropAction.setDescription('This object identifier may be used as the value of a diffServActionSpecific pointer in order to indicate that all packets following this path are to be dropped unconditionally at this point. It is likely, but not required, that this action will be preceded by a counter action.') diffServAlgDropTable = MibTable((1, 3, 6, 1, 2, 1, 12345, 2, 8), ) if mibBuilder.loadTexts: diffServAlgDropTable.setReference('[MODEL] section 7.1.3') if mibBuilder.loadTexts: diffServAlgDropTable.setStatus('current') if mibBuilder.loadTexts: diffServAlgDropTable.setDescription('The algorithmic drop table contains entries describing an element that drops packets according to some algorithm.') diffServAlgDropEntry = MibTableRow((1, 3, 6, 1, 2, 1, 12345, 2, 8, 1), ).setIndexNames((0, "IF-MIB", "ifIndex"), (0, "DIFF-SERV-MIB", "diffServAlgDropIfDirection"), (0, "DIFF-SERV-MIB", "diffServAlgDropId")) if mibBuilder.loadTexts: diffServAlgDropEntry.setStatus('current') if mibBuilder.loadTexts: diffServAlgDropEntry.setDescription('An entry describes a process that drops packets according to some algorithm. Further details of the algorithm type are to be found in diffServAlgDropType and may be pointed to by diffServAlgDropSpecific.') diffServAlgDropIfDirection = MibTableColumn((1, 3, 6, 1, 2, 1, 12345, 2, 8, 1, 1), IfDirection()) if mibBuilder.loadTexts: diffServAlgDropIfDirection.setStatus('current') if mibBuilder.loadTexts: diffServAlgDropIfDirection.setDescription('Specifies the direction for which this algorithmic dropper entry applies on this interface.') diffServAlgDropId = MibTableColumn((1, 3, 6, 1, 2, 1, 12345, 2, 8, 1, 2), Unsigned32()) if mibBuilder.loadTexts: diffServAlgDropId.setStatus('current') if mibBuilder.loadTexts: diffServAlgDropId.setDescription('This identifies the drop action entry. Managers should obtain new values for row creation in this table by reading diffServAlgDropNextFree.') diffServAlgDropType = MibTableColumn((1, 3, 6, 1, 2, 1, 12345, 2, 8, 1, 3), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2, 3, 4))).clone(namedValues=NamedValues(("other", 1), ("tailDrop", 2), ("headDrop", 3), ("randomDrop", 4)))).setMaxAccess("readcreate") if mibBuilder.loadTexts: diffServAlgDropType.setStatus('current') if mibBuilder.loadTexts: diffServAlgDropType.setDescription('The type of algorithm used by this dropper. A value of tailDrop(2) or headDrop(3) represents an algorithm that is completely specified by this MIB. A value of other(1) requires further specification in some other MIB module. The tailDrop(2) algorithm is described as follows: diffServAlgDropQThreshold represents the depth of the queue diffServAlgDropQMeasure at which all newly arriving packets will be dropped. The headDrop(3) algorithm is described as follows: if a packet arrives when the current depth of the queue diffServAlgDropQMeasure is at diffServAlgDropQThreshold, packets currently at the head of the queue are dropped to make room for the new packet to be enqueued at the tail of the queue. The randomDrop(4) algorithm is described as follows: on packet arrival, an algorithm is executed which may randomly drop the packet, or drop other packet(s) from the queue in its place. The specifics of the algorithm may be proprietary. For this algorithm, an associated diffServRandomDropEntry is indicated by pointing diffServAlgDropSpecific at the diffServRandomDropTable. The relevant entry in that table is selected by the common indexing of the two tables. For this algorithm, diffServAlgQThreshold is understood to be the absolute maximum size of the queue and additional parameters are described in diffServRandomDropTable.') diffServAlgDropNext = MibTableColumn((1, 3, 6, 1, 2, 1, 12345, 2, 8, 1, 4), RowPointer()).setMaxAccess("readcreate") if mibBuilder.loadTexts: diffServAlgDropNext.setStatus('current') if mibBuilder.loadTexts: diffServAlgDropNext.setDescription('The Next pointer indicates the next datapath element to handle the traffic e.g. a queue datapath element. The value zeroDotZero in this variable indicates no further DiffServ treatment is performed on this flow by the current interface for this interface direction. If the row pointed to does not exist, the algorithmic dropper element is considered inactive.') diffServAlgDropQMeasure = MibTableColumn((1, 3, 6, 1, 2, 1, 12345, 2, 8, 1, 5), RowPointer()).setMaxAccess("readcreate") if mibBuilder.loadTexts: diffServAlgDropQMeasure.setStatus('current') if mibBuilder.loadTexts: diffServAlgDropQMeasure.setDescription('Points to an entry in the diffServQueueTable to indicate the queue that a drop algorithm is to monitor when deciding whether to drop a packet. If the row pointed to does not exist, the algorithmic dropper element is considered inactive.') diffServAlgDropQThreshold = MibTableColumn((1, 3, 6, 1, 2, 1, 12345, 2, 8, 1, 6), Unsigned32()).setUnits('Bytes').setMaxAccess("readcreate") if mibBuilder.loadTexts: diffServAlgDropQThreshold.setStatus('current') if mibBuilder.loadTexts: diffServAlgDropQThreshold.setDescription('A threshold on the depth in bytes of the queue being measured at which a trigger is generated to the dropping algorithm. For the tailDrop(2) or headDrop(3) algorithms, this represents the depth of the queue diffServAlgDropQMeasure at which the drop action will take place. Other algorithms will need to define their own semantics for this threshold.') diffServAlgDropSpecific = MibTableColumn((1, 3, 6, 1, 2, 1, 12345, 2, 8, 1, 7), ObjectIdentifier()).setMaxAccess("readcreate") if mibBuilder.loadTexts: diffServAlgDropSpecific.setStatus('current') if mibBuilder.loadTexts: diffServAlgDropSpecific.setDescription('Points to a table (not an entry in the table) defined elsewhere that provides further detail regarding a drop algorithm. Entries in such a table are indexed by the same variables as this diffServAlgDropEntry but note that those entries must be managed independently of those in this table. Entries with diffServAlgDropType equal to other(1) may have this point to a table defined in another MIB module. Entries with diffServAlgDropType equal to randomDrop(4) must have this point to diffServRandomDropTable. For all other algorithms, this should take the value zeroDotzero.') diffServAlgDropOctets = MibTableColumn((1, 3, 6, 1, 2, 1, 12345, 2, 8, 1, 8), Counter32()).setMaxAccess("readonly") if mibBuilder.loadTexts: diffServAlgDropOctets.setStatus('current') if mibBuilder.loadTexts: diffServAlgDropOctets.setDescription('The number of octets that have been dropped by this drop process. On high speed devices, this object implements the least significant 32 bits of diffServAlgDropHCOctets. Discontinuities in the value of this counter can occur at re- initialization of the management system and at other times as indicated by the value of ifCounterDiscontinuityTime appropriate to this interface.') diffServAlgDropHCOctets = MibTableColumn((1, 3, 6, 1, 2, 1, 12345, 2, 8, 1, 9), Counter64()).setMaxAccess("readonly") if mibBuilder.loadTexts: diffServAlgDropHCOctets.setStatus('current') if mibBuilder.loadTexts: diffServAlgDropHCOctets.setDescription('The number of octets that have been dropped by this drop process. This object should be used on high speed interfaces. Discontinuities in the value of this counter can occur at re- initialization of the management system and at other times as indicated by the value of ifCounterDiscontinuityTime appropriate to this interface.') diffServAlgDropPkts = MibTableColumn((1, 3, 6, 1, 2, 1, 12345, 2, 8, 1, 10), Counter32()).setMaxAccess("readonly") if mibBuilder.loadTexts: diffServAlgDropPkts.setStatus('current') if mibBuilder.loadTexts: diffServAlgDropPkts.setDescription('The number of packets that have been dropped by this drop process. On high speed devices, this object implements the least significant 32 bits of diffServAlgDropHCPkts. Discontinuities in the value of this counter can occur at re- initialization of the management system and at other times as indicated by the value of ifCounterDiscontinuityTime appropriate to this interface.') diffServAlgDropHCPkts = MibTableColumn((1, 3, 6, 1, 2, 1, 12345, 2, 8, 1, 11), Counter64()).setMaxAccess("readonly") if mibBuilder.loadTexts: diffServAlgDropHCPkts.setStatus('current') if mibBuilder.loadTexts: diffServAlgDropHCPkts.setDescription('The number of packets that have been dropped by this drop process. This object should be used on high speed interfaces. Discontinuities in the value of this counter can occur at re- initialization of the management system and at other times as indicated by the value of ifCounterDiscontinuityTime appropriate to this interface.') diffServAlgDropStatus = MibTableColumn((1, 3, 6, 1, 2, 1, 12345, 2, 8, 1, 12), RowStatus()).setMaxAccess("readcreate") if mibBuilder.loadTexts: diffServAlgDropStatus.setStatus('current') if mibBuilder.loadTexts: diffServAlgDropStatus.setDescription('The RowStatus variable controls the activation, deactivation, or deletion of this entry. Any writable variable may be modified whether the row is active or notInService.') diffServAlgDropNextFree = MibScalar((1, 3, 6, 1, 2, 1, 12345, 1, 7), Unsigned32()).setMaxAccess("readonly") if mibBuilder.loadTexts: diffServAlgDropNextFree.setStatus('current') if mibBuilder.loadTexts: diffServAlgDropNextFree.setDescription('This object yields a value when read that is currently-unused for a diffServAlgDropId instance. If a configuring system attempts to create a new row in the diffServAlgDropTable using this value, that operation will fail if the value has, in the meantime, been used to create another row that is currently valid.') diffServRandomDropTable = MibTable((1, 3, 6, 1, 2, 1, 12345, 2, 9), ) if mibBuilder.loadTexts: diffServRandomDropTable.setReference('[MODEL] section 7.1.3') if mibBuilder.loadTexts: diffServRandomDropTable.setStatus('current') if mibBuilder.loadTexts: diffServRandomDropTable.setDescription('The random drop table augments the algorithmic drop table. It contains entries describing a process that drops packets randomly. This table is intended to be pointed to by the associated diffServAlgDropSpecific in such cases.') diffServRandomDropEntry = MibTableRow((1, 3, 6, 1, 2, 1, 12345, 2, 9, 1), ).setIndexNames((0, "IF-MIB", "ifIndex"), (0, "DIFF-SERV-MIB", "diffServAlgDropIfDirection"), (0, "DIFF-SERV-MIB", "diffServAlgDropId")) if mibBuilder.loadTexts: diffServRandomDropEntry.setStatus('current') if mibBuilder.loadTexts: diffServRandomDropEntry.setDescription('An entry describes a process that drops packets according to a random algorithm. Entries in this table share indexing with a parent diffServAlgDropEntry although they must be managed (e.g. created/deleted) by explicit management action, independently of the associated value of diffServAlgDropSpecific.') diffServRandomDropMinThreshBytes = MibTableColumn((1, 3, 6, 1, 2, 1, 12345, 2, 9, 1, 1), Unsigned32()).setUnits('bytes').setMaxAccess("readcreate") if mibBuilder.loadTexts: diffServRandomDropMinThreshBytes.setStatus('current') if mibBuilder.loadTexts: diffServRandomDropMinThreshBytes.setDescription('The average queue depth in bytes, beyond which traffic has a non-zero probability of being dropped. Changes in this variable may or may not be reflected in the reported value of diffServRandomDropMinThreshPkts.') diffServRandomDropMinThreshPkts = MibTableColumn((1, 3, 6, 1, 2, 1, 12345, 2, 9, 1, 2), Unsigned32()).setUnits('packets').setMaxAccess("readcreate") if mibBuilder.loadTexts: diffServRandomDropMinThreshPkts.setStatus('current') if mibBuilder.loadTexts: diffServRandomDropMinThreshPkts.setDescription('The average queue depth in packets, beyond which traffic has a non-zero probability of being dropped. Changes in this variable may or may not be reflected in the reported value of diffServRandomDropMinThreshBytes.') diffServRandomDropMaxThreshBytes = MibTableColumn((1, 3, 6, 1, 2, 1, 12345, 2, 9, 1, 3), Unsigned32()).setUnits('bytes').setMaxAccess("readcreate") if mibBuilder.loadTexts: diffServRandomDropMaxThreshBytes.setStatus('current') if mibBuilder.loadTexts: diffServRandomDropMaxThreshBytes.setDescription('The average queue depth beyond which traffic has a probability indicated by diffServRandomDropInvMaxProb of being dropped or marked. Note that this differs from the physical queue limit, which is stored in diffServAlgDropQThreshold. Changes in this variable may or may not be reflected in the reported value of diffServRandomDropMaxThreshPkts.') diffServRandomDropMaxThreshPkts = MibTableColumn((1, 3, 6, 1, 2, 1, 12345, 2, 9, 1, 4), Unsigned32()).setUnits('packets').setMaxAccess("readcreate") if mibBuilder.loadTexts: diffServRandomDropMaxThreshPkts.setStatus('current') if mibBuilder.loadTexts: diffServRandomDropMaxThreshPkts.setDescription('The average queue depth beyond which traffic has a probability indicated by diffServRandomDropInvMaxProb of being dropped or marked. Note that this differs from the physical queue limit, which is stored in diffServAlgDropQThreshold. Changes in this variable may or may not be reflected in the reported value of diffServRandomDropMaxThreshBytes.') diffServRandomDropInvWeight = MibTableColumn((1, 3, 6, 1, 2, 1, 12345, 2, 9, 1, 5), Unsigned32()).setMaxAccess("readcreate") if mibBuilder.loadTexts: diffServRandomDropInvWeight.setStatus('current') if mibBuilder.loadTexts: diffServRandomDropInvWeight.setDescription('The weighting of past history in affecting the calculation of the current queue average. The moving average of the queue depth uses the inverse of this value as the factor for the new queue depth, and one minus that inverse as the factor for the historical average. Implementations may choose to limit the acceptable set of values to a specified set, such as powers of 2.') diffServRandomDropProbMax = MibTableColumn((1, 3, 6, 1, 2, 1, 12345, 2, 9, 1, 6), Unsigned32()).setMaxAccess("readcreate") if mibBuilder.loadTexts: diffServRandomDropProbMax.setStatus('current') if mibBuilder.loadTexts: diffServRandomDropProbMax.setDescription('The worst case random drop probability, expressed in drops per thousand packets. For example, if every packet may be dropped in the worst case (100%), this has the value 1000. Alternatively, if in the worst case one percent (1%) of traffic may be dropped, it has the value 10.') diffServRandomDropStatus = MibTableColumn((1, 3, 6, 1, 2, 1, 12345, 2, 9, 1, 7), RowStatus()).setMaxAccess("readcreate") if mibBuilder.loadTexts: diffServRandomDropStatus.setStatus('current') if mibBuilder.loadTexts: diffServRandomDropStatus.setDescription('The RowStatus variable controls the activation, deactivation, or deletion of this entry. Any writable variable may be modified whether the row is active or notInService.') diffServQTable = MibTable((1, 3, 6, 1, 2, 1, 12345, 2, 10), ) if mibBuilder.loadTexts: diffServQTable.setStatus('current') if mibBuilder.loadTexts: diffServQTable.setDescription('The Queue Table enumerates the individual queues on an interface.') diffServQEntry = MibTableRow((1, 3, 6, 1, 2, 1, 12345, 2, 10, 1), ).setIndexNames((0, "IF-MIB", "ifIndex"), (0, "DIFF-SERV-MIB", "diffServQIfDirection"), (0, "DIFF-SERV-MIB", "diffServQId")) if mibBuilder.loadTexts: diffServQEntry.setStatus('current') if mibBuilder.loadTexts: diffServQEntry.setDescription('An entry in the Queue Table describes a single queue in one direction on an interface.') diffServQIfDirection = MibTableColumn((1, 3, 6, 1, 2, 1, 12345, 2, 10, 1, 1), IfDirection()) if mibBuilder.loadTexts: diffServQIfDirection.setStatus('current') if mibBuilder.loadTexts: diffServQIfDirection.setDescription('Specifies the direction for which this queue entry applies on this interface.') diffServQId = MibTableColumn((1, 3, 6, 1, 2, 1, 12345, 2, 10, 1, 2), Unsigned32()) if mibBuilder.loadTexts: diffServQId.setStatus('current') if mibBuilder.loadTexts: diffServQId.setDescription('The Queue Id enumerates the Queue entry. Managers should obtain new values for row creation in this table by reading diffServQNextFree.') diffServQNext = MibTableColumn((1, 3, 6, 1, 2, 1, 12345, 2, 10, 1, 3), RowPointer()).setMaxAccess("readcreate") if mibBuilder.loadTexts: diffServQNext.setStatus('current') if mibBuilder.loadTexts: diffServQNext.setDescription('The Next pointer indicates the next datapath element to handle the traffic e.g. a scheduler datapath element. If the row pointed to does not exist, the queue element is considered inactive.') diffServQPriority = MibTableColumn((1, 3, 6, 1, 2, 1, 12345, 2, 10, 1, 4), Unsigned32()).setMaxAccess("readcreate") if mibBuilder.loadTexts: diffServQPriority.setStatus('current') if mibBuilder.loadTexts: diffServQPriority.setDescription('The priority of this queue, to be used as a parameter to the next scheduler element downstream from this one.') diffServQMinRateAbs = MibTableColumn((1, 3, 6, 1, 2, 1, 12345, 2, 10, 1, 5), Unsigned32()).setUnits('kilobits per second').setMaxAccess("readcreate") if mibBuilder.loadTexts: diffServQMinRateAbs.setReference('ifSpeed, ifHighSpeed from [IFMIB]') if mibBuilder.loadTexts: diffServQMinRateAbs.setStatus('current') if mibBuilder.loadTexts: diffServQMinRateAbs.setDescription("The minimum absolute rate, in kilobits/sec, that a downstream scheduler element should allocate to this queue. If the value is zero, then there is effectively no minimum rate guarantee. If the value is non-zero, the scheduler will assure the servicing of this queue to at least this rate. Note that this attribute's value is coupled to that of diffServQMinRateRel: changes to one will affect the value of the other. They are linked by the following equation: diffServQMinRateRel = diffServQMinRateAbs * 10,000,000/ifSpeed or, if appropriate: diffServQMinRateRel = diffServQMinRateAbs * 10 / ifHighSpeed") diffServQMinRateRel = MibTableColumn((1, 3, 6, 1, 2, 1, 12345, 2, 10, 1, 6), Unsigned32()).setMaxAccess("readcreate") if mibBuilder.loadTexts: diffServQMinRateRel.setReference('ifSpeed, ifHighSpeed from [IFMIB]') if mibBuilder.loadTexts: diffServQMinRateRel.setStatus('current') if mibBuilder.loadTexts: diffServQMinRateRel.setDescription("The minimum rate that a downstream scheduler element should allocate to this queue, relative to the maximum rate of the interface as reported by ifSpeed or ifHighSpeed, in units of 1/10,000 of 1. If the value is zero, then there is effectively no minimum rate guarantee. If the value is non-zero, the scheduler will assure the servicing of this queue to at least this rate. Note that this attribute's value is coupled to that of diffServQMinRateAbs: changes to one will affect the value of the other. They are linked by the following equation: diffServQMinRateAbs = ifSpeed * diffServQMinRateRel/10,000,000 or, if appropriate: diffServQMinRateAbs = ifHighSpeed * diffServQMinRateRel / 10") diffServQMaxRateAbs = MibTableColumn((1, 3, 6, 1, 2, 1, 12345, 2, 10, 1, 7), Unsigned32()).setUnits('kilobits per second').setMaxAccess("readcreate") if mibBuilder.loadTexts: diffServQMaxRateAbs.setReference('ifSpeed, ifHighSpeed from [IFMIB]') if mibBuilder.loadTexts: diffServQMaxRateAbs.setStatus('current') if mibBuilder.loadTexts: diffServQMaxRateAbs.setDescription("The maximum rate in kilobits/sec that a downstream scheduler element should allocate to this queue. If the value is zero, then there is effectively no maximum rate limit and that the scheduler should attempt to be work-conserving for this queue. If the value is non-zero, the scheduler will limit the servicing of this queue to, at most, this rate in a non-work-conserving manner. Note that this attribute's value is coupled to that of diffServQMaxRateRel: changes to one will affect the value of the other. They are linked by the following equation: diffServQMaxRateRel = diffServQMaxRateAbs * 10,000,000/ifSpeed or, if appropriate: diffServQMaxRateRel = diffServQMaxRateAbs * 10 / ifHighSpeed") diffServQMaxRateRel = MibTableColumn((1, 3, 6, 1, 2, 1, 12345, 2, 10, 1, 8), Unsigned32()).setMaxAccess("readcreate") if mibBuilder.loadTexts: diffServQMaxRateRel.setReference('ifSpeed, ifHighSpeed from [IFMIB]') if mibBuilder.loadTexts: diffServQMaxRateRel.setStatus('current') if mibBuilder.loadTexts: diffServQMaxRateRel.setDescription("The maximum rate that a downstream scheduler element should allocate to this queue, relative to the maximum rate of the interface as reported by ifSpeed or ifHighSpeed, in units of 1/10,000 of 1. If the value is zero, then there is effectively no maximum rate limit and the scheduler should attempt to be work-conserving for this queue. If the value is non-zero, the scheduler will limit the servicing of this queue to, at most, this rate in a non-work-conserving manner. Note that this attribute's value is coupled to that of diffServQMaxRateAbs: changes to one will affect the value of the other. They are linked by the following equation: diffServQMaxRateAbs = ifSpeed * diffServQMaxRateRel/10,000,000 or, if appropriate: diffServQMaxRateAbs = ifHighSpeed * diffServQMaxRateRel / 10") diffServQStatus = MibTableColumn((1, 3, 6, 1, 2, 1, 12345, 2, 10, 1, 9), RowStatus()).setMaxAccess("readcreate") if mibBuilder.loadTexts: diffServQStatus.setStatus('current') if mibBuilder.loadTexts: diffServQStatus.setDescription('The RowStatus variable controls the activation, deactivation, or deletion of a queue. Any writable variable may be modified whether the row is active or notInService.') diffServQNextFree = MibScalar((1, 3, 6, 1, 2, 1, 12345, 1, 8), Unsigned32()).setMaxAccess("readonly") if mibBuilder.loadTexts: diffServQNextFree.setStatus('current') if mibBuilder.loadTexts: diffServQNextFree.setDescription('This object yields a value when read that is currently-unused for a diffServQId instance. If a configuring system attempts to create a new row in the diffServQTable using this value, that operation will fail if the value has, in the meantime, been used to create another row that is currently valid.') diffServSchedulerTable = MibTable((1, 3, 6, 1, 2, 1, 12345, 2, 11), ) if mibBuilder.loadTexts: diffServSchedulerTable.setReference('[MODEL] section 7.1.2') if mibBuilder.loadTexts: diffServSchedulerTable.setStatus('current') if mibBuilder.loadTexts: diffServSchedulerTable.setDescription('The Scheduler Table enumerates packet schedulers. Multiple scheduling algorithms can be used on a given interface, with each algorithm described by one diffServSchedulerEntry.') diffServSchedulerEntry = MibTableRow((1, 3, 6, 1, 2, 1, 12345, 2, 11, 1), ).setIndexNames((0, "IF-MIB", "ifIndex"), (0, "DIFF-SERV-MIB", "diffServSchedulerIfDirection"), (0, "DIFF-SERV-MIB", "diffServSchedulerId")) if mibBuilder.loadTexts: diffServSchedulerEntry.setStatus('current') if mibBuilder.loadTexts: diffServSchedulerEntry.setDescription('An entry in the Scheduler Table describing a single instance of a scheduling algorithm.') diffServSchedulerIfDirection = MibTableColumn((1, 3, 6, 1, 2, 1, 12345, 2, 11, 1, 1), IfDirection()) if mibBuilder.loadTexts: diffServSchedulerIfDirection.setStatus('current') if mibBuilder.loadTexts: diffServSchedulerIfDirection.setDescription('Specifies the direction for which this scheduler entry applies on this interface.') diffServSchedulerId = MibTableColumn((1, 3, 6, 1, 2, 1, 12345, 2, 11, 1, 2), Unsigned32()) if mibBuilder.loadTexts: diffServSchedulerId.setStatus('current') if mibBuilder.loadTexts: diffServSchedulerId.setDescription('This identifies the scheduler entry. Managers should obtain new values for row creation in this table by reading diffServSchedulerNextFree.') diffServSchedulerMethod = MibTableColumn((1, 3, 6, 1, 2, 1, 12345, 2, 11, 1, 3), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2, 3))).clone(namedValues=NamedValues(("other", 1), ("priorityq", 2), ("wrr", 3)))).setMaxAccess("readcreate") if mibBuilder.loadTexts: diffServSchedulerMethod.setReference('[MODEL] section 7.1.2') if mibBuilder.loadTexts: diffServSchedulerMethod.setStatus('current') if mibBuilder.loadTexts: diffServSchedulerMethod.setDescription('The scheduling algorithm used by this Scheduler. A value of priorityq(2) is used to indicate strict priority queueing: only the diffServQPriority attributes of the queues feeding this scheduler are used when determining the next packet to schedule. A value of wrr(3) indicates weighted round-robin scheduling. Packets are scheduled from each of the queues feeding this scheduler according to all of the parameters of the diffServQueue entry.') diffServSchedulerNext = MibTableColumn((1, 3, 6, 1, 2, 1, 12345, 2, 11, 1, 4), RowPointer().clone((0, 0))).setMaxAccess("readcreate") if mibBuilder.loadTexts: diffServSchedulerNext.setStatus('current') if mibBuilder.loadTexts: diffServSchedulerNext.setDescription('Selects the next data path component, which can be another scheduler or other TC elements. One usage of multiple scheduler elements in series is for Class Base Queueing (CBQ). The value zeroDotZero in this variable indicates no further DiffServ treatment is performed on this flow by the current interface for this interface direction. For example, for an inbound interface the value zeroDotZero indicates that the packet flow has now completed inbound DiffServ treatment and should be forwarded on to the appropriate outbound interface. If the row pointed to does not exist, the scheduler element is considered inactive.') diffServSchedulerStatus = MibTableColumn((1, 3, 6, 1, 2, 1, 12345, 2, 11, 1, 5), RowStatus()).setMaxAccess("readcreate") if mibBuilder.loadTexts: diffServSchedulerStatus.setStatus('current') if mibBuilder.loadTexts: diffServSchedulerStatus.setDescription('The RowStatus variable controls the activation, deactivation, or deletion of a queue. Any writable variable may be modified whether the row is active or notInService.') diffServSchedulerNextFree = MibScalar((1, 3, 6, 1, 2, 1, 12345, 1, 9), Unsigned32()).setMaxAccess("readonly") if mibBuilder.loadTexts: diffServSchedulerNextFree.setStatus('current') if mibBuilder.loadTexts: diffServSchedulerNextFree.setDescription('This object yields a value when read that is currently-unused for a diffServSchedulerId instance. If a configuring system attempts to create a new row in the diffServSchedulerTable using this value, that operation will fail if the value has, in the meantime, been used to create another row that is currently valid.') diffServMIBCompliances = MibIdentifier((1, 3, 6, 1, 2, 1, 12345, 3, 1)) diffServMIBGroups = MibIdentifier((1, 3, 6, 1, 2, 1, 12345, 3, 2)) diffServMIBCompliance = ModuleCompliance((1, 3, 6, 1, 2, 1, 12345, 3, 1, 1)).setObjects(("DIFF-SERV-MIB", "diffServMIBClassifierGroup"), ("DIFF-SERV-MIB", "diffServMIBSixTupleClfrGroup"), ("DIFF-SERV-MIB", "diffServMIBActionGroup"), ("DIFF-SERV-MIB", "diffServMIBAlgDropGroup"), ("DIFF-SERV-MIB", "diffServMIBQueueGroup"), ("DIFF-SERV-MIB", "diffServMIBSchedulerGroup"), ("DIFF-SERV-MIB", "diffServMIBCounterGroup"), ("DIFF-SERV-MIB", "diffServMIBHCCounterGroup"), ("DIFF-SERV-MIB", "diffServMIBVHCCounterGroup"), ("DIFF-SERV-MIB", "diffServMIBMeterGroup"), ("DIFF-SERV-MIB", "diffServMIBTokenBucketMeterGroup"), ("DIFF-SERV-MIB", "diffServMIBDscpMarkActionGroup"), ("DIFF-SERV-MIB", "diffServMIBRandomDropGroup"), ("DIFF-SERV-MIB", "diffServMIBStaticGroup")) if getattr(mibBuilder, 'version', (0, 0, 0)) > (4, 4, 0): diffServMIBCompliance = diffServMIBCompliance.setStatus('current') if mibBuilder.loadTexts: diffServMIBCompliance.setDescription('This MIB may be implemented as a read-only or as a read-create MIB. As a result, it may be used for monitoring or for configuration.') diffServMIBClassifierGroup = ObjectGroup((1, 3, 6, 1, 2, 1, 12345, 3, 2, 1)).setObjects(("DIFF-SERV-MIB", "diffServClassifierFilter"), ("DIFF-SERV-MIB", "diffServClassifierNext"), ("DIFF-SERV-MIB", "diffServClassifierPrecedence"), ("DIFF-SERV-MIB", "diffServClassifierStatus")) if getattr(mibBuilder, 'version', (0, 0, 0)) > (4, 4, 0): diffServMIBClassifierGroup = diffServMIBClassifierGroup.setStatus('current') if mibBuilder.loadTexts: diffServMIBClassifierGroup.setDescription('The Classifier Group defines the MIB Objects that describe a generic classifier element.') diffServMIBSixTupleClfrGroup = ObjectGroup((1, 3, 6, 1, 2, 1, 12345, 3, 2, 2)).setObjects(("DIFF-SERV-MIB", "diffServSixTupleClfrDstAddrType"), ("DIFF-SERV-MIB", "diffServSixTupleClfrDstAddr"), ("DIFF-SERV-MIB", "diffServSixTupleClfrDstAddrMask"), ("DIFF-SERV-MIB", "diffServSixTupleClfrDstAddrType"), ("DIFF-SERV-MIB", "diffServSixTupleClfrSrcAddrType"), ("DIFF-SERV-MIB", "diffServSixTupleClfrSrcAddrMask"), ("DIFF-SERV-MIB", "diffServSixTupleClfrDscp"), ("DIFF-SERV-MIB", "diffServSixTupleClfrProtocol"), ("DIFF-SERV-MIB", "diffServSixTupleClfrDstL4PortMin"), ("DIFF-SERV-MIB", "diffServSixTupleClfrDstL4PortMax"), ("DIFF-SERV-MIB", "diffServSixTupleClfrSrcL4PortMin"), ("DIFF-SERV-MIB", "diffServSixTupleClfrSrcL4PortMax"), ("DIFF-SERV-MIB", "diffServSixTupleClfrStatus")) if getattr(mibBuilder, 'version', (0, 0, 0)) > (4, 4, 0): diffServMIBSixTupleClfrGroup = diffServMIBSixTupleClfrGroup.setStatus('current') if mibBuilder.loadTexts: diffServMIBSixTupleClfrGroup.setDescription('The Six-tuple Classifier Group defines the MIB Objects that describe a classifier element for matching on 6 fields of an IP and upper-layer protocol header.') diffServMIBMeterGroup = ObjectGroup((1, 3, 6, 1, 2, 1, 12345, 3, 2, 3)).setObjects(("DIFF-SERV-MIB", "diffServMeterSucceedNext"), ("DIFF-SERV-MIB", "diffServMeterFailNext"), ("DIFF-SERV-MIB", "diffServMeterSpecific"), ("DIFF-SERV-MIB", "diffServMeterStatus")) if getattr(mibBuilder, 'version', (0, 0, 0)) > (4, 4, 0): diffServMIBMeterGroup = diffServMIBMeterGroup.setStatus('current') if mibBuilder.loadTexts: diffServMIBMeterGroup.setDescription('The Meter Group defines the objects used in describing a generic meter element.') diffServMIBTokenBucketMeterGroup = ObjectGroup((1, 3, 6, 1, 2, 1, 12345, 3, 2, 4)).setObjects(("DIFF-SERV-MIB", "diffServTBMeterRate"), ("DIFF-SERV-MIB", "diffServTBMeterBurstSize"), ("DIFF-SERV-MIB", "diffServTBMeterStatus")) if getattr(mibBuilder, 'version', (0, 0, 0)) > (4, 4, 0): diffServMIBTokenBucketMeterGroup = diffServMIBTokenBucketMeterGroup.setStatus('current') if mibBuilder.loadTexts: diffServMIBTokenBucketMeterGroup.setDescription('The Token-Bucket Meter Group defines the objects used in describing a single-rate token bucket meter element.') diffServMIBActionGroup = ObjectGroup((1, 3, 6, 1, 2, 1, 12345, 3, 2, 5)).setObjects(("DIFF-SERV-MIB", "diffServActionNext"), ("DIFF-SERV-MIB", "diffServActionSpecific"), ("DIFF-SERV-MIB", "diffServActionStatus")) if getattr(mibBuilder, 'version', (0, 0, 0)) > (4, 4, 0): diffServMIBActionGroup = diffServMIBActionGroup.setStatus('current') if mibBuilder.loadTexts: diffServMIBActionGroup.setDescription('The Action Group defines the objects used in describing a generic action element.') diffServMIBDscpMarkActionGroup = ObjectGroup((1, 3, 6, 1, 2, 1, 12345, 3, 2, 6)).setObjects(("DIFF-SERV-MIB", "diffServDscpMarkActDscp")) if getattr(mibBuilder, 'version', (0, 0, 0)) > (4, 4, 0): diffServMIBDscpMarkActionGroup = diffServMIBDscpMarkActionGroup.setStatus('current') if mibBuilder.loadTexts: diffServMIBDscpMarkActionGroup.setDescription('The DSCP Mark Action Group defines the objects used in describing a DSCP Marking Action element.') diffServMIBCounterGroup = ObjectGroup((1, 3, 6, 1, 2, 1, 12345, 3, 2, 7)).setObjects(("DIFF-SERV-MIB", "diffServCountActOctets"), ("DIFF-SERV-MIB", "diffServCountActPkts"), ("DIFF-SERV-MIB", "diffServCountActStatus"), ("DIFF-SERV-MIB", "diffServAlgDropOctets"), ("DIFF-SERV-MIB", "diffServAlgDropPkts")) if getattr(mibBuilder, 'version', (0, 0, 0)) > (4, 4, 0): diffServMIBCounterGroup = diffServMIBCounterGroup.setStatus('current') if mibBuilder.loadTexts: diffServMIBCounterGroup.setDescription('A collection of objects providing information specific to non- high speed (non-high speed interfaces transmit and receive at speeds less than or equal to 20,000,000 bits/second) packet- oriented network interfaces.') diffServMIBHCCounterGroup = ObjectGroup((1, 3, 6, 1, 2, 1, 12345, 3, 2, 8)).setObjects(("DIFF-SERV-MIB", "diffServCountActOctets"), ("DIFF-SERV-MIB", "diffServCountActHCOctets"), ("DIFF-SERV-MIB", "diffServCountActPkts"), ("DIFF-SERV-MIB", "diffServCountActStatus"), ("DIFF-SERV-MIB", "diffServAlgDropOctets"), ("DIFF-SERV-MIB", "diffServAlgDropHCOctets"), ("DIFF-SERV-MIB", "diffServAlgDropPkts")) if getattr(mibBuilder, 'version', (0, 0, 0)) > (4, 4, 0): diffServMIBHCCounterGroup = diffServMIBHCCounterGroup.setStatus('current') if mibBuilder.loadTexts: diffServMIBHCCounterGroup.setDescription('A collection of objects providing information specific to non- high speed (non-high speed interfaces transmit and receive at speeds less than or equal to 20,000,000 bits/second) packet- oriented network interfaces.') diffServMIBVHCCounterGroup = ObjectGroup((1, 3, 6, 1, 2, 1, 12345, 3, 2, 9)).setObjects(("DIFF-SERV-MIB", "diffServCountActOctets"), ("DIFF-SERV-MIB", "diffServCountActHCOctets"), ("DIFF-SERV-MIB", "diffServCountActPkts"), ("DIFF-SERV-MIB", "diffServCountActHCPkts"), ("DIFF-SERV-MIB", "diffServCountActStatus"), ("DIFF-SERV-MIB", "diffServAlgDropOctets"), ("DIFF-SERV-MIB", "diffServAlgDropHCOctets"), ("DIFF-SERV-MIB", "diffServAlgDropPkts"), ("DIFF-SERV-MIB", "diffServAlgDropHCPkts")) if getattr(mibBuilder, 'version', (0, 0, 0)) > (4, 4, 0): diffServMIBVHCCounterGroup = diffServMIBVHCCounterGroup.setStatus('current') if mibBuilder.loadTexts: diffServMIBVHCCounterGroup.setDescription('A collection of objects providing information specific to non- high speed (non-high speed interfaces transmit and receive at speeds less than or equal to 20,000,000 bits/second) packet- oriented network interfaces.') diffServMIBAlgDropGroup = ObjectGroup((1, 3, 6, 1, 2, 1, 12345, 3, 2, 10)).setObjects(("DIFF-SERV-MIB", "diffServAlgDropType"), ("DIFF-SERV-MIB", "diffServAlgDropNext"), ("DIFF-SERV-MIB", "diffServAlgDropQMeasure"), ("DIFF-SERV-MIB", "diffServAlgDropQThreshold"), ("DIFF-SERV-MIB", "diffServAlgDropSpecific"), ("DIFF-SERV-MIB", "diffServAlgDropStatus")) if getattr(mibBuilder, 'version', (0, 0, 0)) > (4, 4, 0): diffServMIBAlgDropGroup = diffServMIBAlgDropGroup.setStatus('current') if mibBuilder.loadTexts: diffServMIBAlgDropGroup.setDescription('The Algorithmic Drop Group contains the objects that describe algorithmic dropper operation and configuration.') diffServMIBRandomDropGroup = ObjectGroup((1, 3, 6, 1, 2, 1, 12345, 3, 2, 11)).setObjects(("DIFF-SERV-MIB", "diffServRandomDropMinThreshBytes"), ("DIFF-SERV-MIB", "diffServRandomDropMinThreshPkts"), ("DIFF-SERV-MIB", "diffServRandomDropMaxThreshBytes"), ("DIFF-SERV-MIB", "diffServRandomDropMaxThreshPkts"), ("DIFF-SERV-MIB", "diffServRandomDropInvWeight"), ("DIFF-SERV-MIB", "diffServRandomDropProbMax"), ("DIFF-SERV-MIB", "diffServRandomDropStatus")) if getattr(mibBuilder, 'version', (0, 0, 0)) > (4, 4, 0): diffServMIBRandomDropGroup = diffServMIBRandomDropGroup.setStatus('current') if mibBuilder.loadTexts: diffServMIBRandomDropGroup.setDescription('The Random Drop Group augments the Algorithmic Drop Group for random dropper operation and configuration.') diffServMIBQueueGroup = ObjectGroup((1, 3, 6, 1, 2, 1, 12345, 3, 2, 12)).setObjects(("DIFF-SERV-MIB", "diffServQPriority"), ("DIFF-SERV-MIB", "diffServQNext"), ("DIFF-SERV-MIB", "diffServQMinRateAbs"), ("DIFF-SERV-MIB", "diffServQMinRateRel"), ("DIFF-SERV-MIB", "diffServQMaxRateAbs"), ("DIFF-SERV-MIB", "diffServQMaxRateRel"), ("DIFF-SERV-MIB", "diffServQStatus")) if getattr(mibBuilder, 'version', (0, 0, 0)) > (4, 4, 0): diffServMIBQueueGroup = diffServMIBQueueGroup.setStatus('current') if mibBuilder.loadTexts: diffServMIBQueueGroup.setDescription("The Queue Group contains the objects that describe an interface's queues.") diffServMIBSchedulerGroup = ObjectGroup((1, 3, 6, 1, 2, 1, 12345, 3, 2, 13)).setObjects(("DIFF-SERV-MIB", "diffServSchedulerMethod"), ("DIFF-SERV-MIB", "diffServSchedulerNext"), ("DIFF-SERV-MIB", "diffServSchedulerStatus")) if getattr(mibBuilder, 'version', (0, 0, 0)) > (4, 4, 0): diffServMIBSchedulerGroup = diffServMIBSchedulerGroup.setStatus('current') if mibBuilder.loadTexts: diffServMIBSchedulerGroup.setDescription('The Scheduler Group contains the objects that describe packet schedulers on interfaces.') diffServMIBStaticGroup = ObjectGroup((1, 3, 6, 1, 2, 1, 12345, 3, 2, 14)).setObjects(("DIFF-SERV-MIB", "diffServClassifierNextFree"), ("DIFF-SERV-MIB", "diffServSixTupleClfrNextFree"), ("DIFF-SERV-MIB", "diffServMeterNextFree"), ("DIFF-SERV-MIB", "diffServActionNextFree"), ("DIFF-SERV-MIB", "diffServAlgDropNextFree"), ("DIFF-SERV-MIB", "diffServQNextFree"), ("DIFF-SERV-MIB", "diffServSchedulerNextFree")) if getattr(mibBuilder, 'version', (0, 0, 0)) > (4, 4, 0): diffServMIBStaticGroup = diffServMIBStaticGroup.setStatus('current') if mibBuilder.loadTexts: diffServMIBStaticGroup.setDescription('The Static Group contains readable scalar objects used in creating unique identifiers for classifiers, meters, actions and queues. These are required whenever row creation operations on such tables are supported.') mibBuilder.exportSymbols("DIFF-SERV-MIB", diffServMeterId=diffServMeterId, diffServClassifierStatus=diffServClassifierStatus, diffServClassifierId=diffServClassifierId, diffServCountActHCPkts=diffServCountActHCPkts, diffServMeterSucceedNext=diffServMeterSucceedNext, diffServTBMeterStatus=diffServTBMeterStatus, diffServAlgDropQMeasure=diffServAlgDropQMeasure, diffServQMaxRateRel=diffServQMaxRateRel, diffServSixTupleClfrNextFree=diffServSixTupleClfrNextFree, diffServCountActPkts=diffServCountActPkts, diffServSixTupleClfrDstL4PortMin=diffServSixTupleClfrDstL4PortMin, diffServSixTupleClfrSrcAddrMask=diffServSixTupleClfrSrcAddrMask, diffServRandomDropMaxThreshPkts=diffServRandomDropMaxThreshPkts, diffServMIBHCCounterGroup=diffServMIBHCCounterGroup, diffServRandomDropMinThreshBytes=diffServRandomDropMinThreshBytes, diffServMIBSixTupleClfrGroup=diffServMIBSixTupleClfrGroup, diffServActionId=diffServActionId, diffServQNextFree=diffServQNextFree, diffServCountActHCOctets=diffServCountActHCOctets, diffServCountActOctets=diffServCountActOctets, diffServClassifierNextFree=diffServClassifierNextFree, diffServAlgDropId=diffServAlgDropId, diffServQPriority=diffServQPriority, diffServTBMeterRate=diffServTBMeterRate, diffServSixTupleClfrTable=diffServSixTupleClfrTable, PYSNMP_MODULE_ID=diffServMib, diffServCountActDiscontTime=diffServCountActDiscontTime, diffServQMaxRateAbs=diffServQMaxRateAbs, diffServSixTupleClfrDstAddr=diffServSixTupleClfrDstAddr, diffServSchedulerEntry=diffServSchedulerEntry, diffServDscpMarkActEntry=diffServDscpMarkActEntry, diffServRandomDropMaxThreshBytes=diffServRandomDropMaxThreshBytes, diffServSixTupleClfrDstAddrType=diffServSixTupleClfrDstAddrType, diffServSixTupleClfrEntry=diffServSixTupleClfrEntry, diffServSchedulerNextFree=diffServSchedulerNextFree, diffServMIBCounterGroup=diffServMIBCounterGroup, diffServSixTupleClfrDstL4PortMax=diffServSixTupleClfrDstL4PortMax, diffServAlgDropPkts=diffServAlgDropPkts, diffServMIBVHCCounterGroup=diffServMIBVHCCounterGroup, diffServSixTupleClfrSrcAddr=diffServSixTupleClfrSrcAddr, diffServMIBActionGroup=diffServMIBActionGroup, diffServAlgDropSpecific=diffServAlgDropSpecific, diffServQMinRateRel=diffServQMinRateRel, diffServMIBGroups=diffServMIBGroups, diffServSchedulerTable=diffServSchedulerTable, diffServObjects=diffServObjects, diffServSixTupleClfrSrcL4PortMax=diffServSixTupleClfrSrcL4PortMax, diffServAlgDropTable=diffServAlgDropTable, diffServClassifierEntry=diffServClassifierEntry, diffServClassifierFilter=diffServClassifierFilter, diffServRandomDropStatus=diffServRandomDropStatus, IfDirection=IfDirection, diffServAlgDropOctets=diffServAlgDropOctets, diffServActionTable=diffServActionTable, diffServAlgDropHCOctets=diffServAlgDropHCOctets, diffServSchedulerIfDirection=diffServSchedulerIfDirection, diffServRandomDropProbMax=diffServRandomDropProbMax, diffServMIBConformance=diffServMIBConformance, diffServMeterIfDirection=diffServMeterIfDirection, diffServRandomDropMinThreshPkts=diffServRandomDropMinThreshPkts, diffServActionIfDirection=diffServActionIfDirection, diffServQNext=diffServQNext, diffServCountActTable=diffServCountActTable, diffServRandomDropEntry=diffServRandomDropEntry, diffServMIBTokenBucketMeterGroup=diffServMIBTokenBucketMeterGroup, diffServTBMeterTable=diffServTBMeterTable, diffServMIBStaticGroup=diffServMIBStaticGroup, diffServAlgDropNext=diffServAlgDropNext, diffServSchedulerNext=diffServSchedulerNext, diffServMeterStatus=diffServMeterStatus, diffServQMinRateAbs=diffServQMinRateAbs, diffServSixTupleClfrSrcAddrType=diffServSixTupleClfrSrcAddrType, diffServMeterSpecific=diffServMeterSpecific, diffServMIBRandomDropGroup=diffServMIBRandomDropGroup, diffServAlgDropEntry=diffServAlgDropEntry, diffServSchedulerId=diffServSchedulerId, diffServTBMeterEntry=diffServTBMeterEntry, SixTupleClfrL4Port=SixTupleClfrL4Port, diffServClassifierNext=diffServClassifierNext, diffServSchedulerMethod=diffServSchedulerMethod, diffServDscpMarkActTable=diffServDscpMarkActTable, diffServMIBCompliance=diffServMIBCompliance, diffServAlgDropType=diffServAlgDropType, diffServAlgDropQThreshold=diffServAlgDropQThreshold, diffServCountActStatus=diffServCountActStatus, diffServQStatus=diffServQStatus, diffServClassifierIfDirection=diffServClassifierIfDirection, diffServSixTupleClfrDscp=diffServSixTupleClfrDscp, diffServClassifierTable=diffServClassifierTable, diffServSixTupleClfrDstAddrMask=diffServSixTupleClfrDstAddrMask, diffServAlgDropHCPkts=diffServAlgDropHCPkts, diffServMIBDscpMarkActionGroup=diffServMIBDscpMarkActionGroup, diffServSixTupleClfrStatus=diffServSixTupleClfrStatus, diffServMeterTable=diffServMeterTable, diffServActionNext=diffServActionNext, diffServMeterFailNext=diffServMeterFailNext, diffServActionNextFree=diffServActionNextFree, diffServActionStatus=diffServActionStatus, diffServCountActEntry=diffServCountActEntry, diffServRandomDropTable=diffServRandomDropTable, diffServSixTupleClfrSrcL4PortMin=diffServSixTupleClfrSrcL4PortMin, diffServMIBClassifierGroup=diffServMIBClassifierGroup, diffServMIBSchedulerGroup=diffServMIBSchedulerGroup, diffServClassifierPrecedence=diffServClassifierPrecedence, diffServRandomDropInvWeight=diffServRandomDropInvWeight, diffServMIBAlgDropGroup=diffServMIBAlgDropGroup, diffServSchedulerStatus=diffServSchedulerStatus, diffServQIfDirection=diffServQIfDirection, diffServMeterNextFree=diffServMeterNextFree, diffServAlgDropNextFree=diffServAlgDropNextFree, diffServDscpMarkActDscp=diffServDscpMarkActDscp, diffServTBMeterBurstSize=diffServTBMeterBurstSize, diffServQTable=diffServQTable, diffServClassifierTcb=diffServClassifierTcb, diffServTables=diffServTables, diffServMIBMeterGroup=diffServMIBMeterGroup, diffServAlgDropIfDirection=diffServAlgDropIfDirection, diffServQId=diffServQId, diffServMIBQueueGroup=diffServMIBQueueGroup, diffServMIBCompliances=diffServMIBCompliances, diffServAbsoluteDropAction=diffServAbsoluteDropAction, diffServMeterEntry=diffServMeterEntry, diffServActionSpecific=diffServActionSpecific, diffServAlgDropStatus=diffServAlgDropStatus, diffServQEntry=diffServQEntry, diffServSixTupleClfrProtocol=diffServSixTupleClfrProtocol, diffServMib=diffServMib, diffServActionEntry=diffServActionEntry, diffServSixTupleClfrId=diffServSixTupleClfrId, Dscp=Dscp)
(integer, octet_string, object_identifier) = mibBuilder.importSymbols('ASN1', 'Integer', 'OctetString', 'ObjectIdentifier') (named_values,) = mibBuilder.importSymbols('ASN1-ENUMERATION', 'NamedValues') (single_value_constraint, value_range_constraint, constraints_intersection, constraints_union, value_size_constraint) = mibBuilder.importSymbols('ASN1-REFINEMENT', 'SingleValueConstraint', 'ValueRangeConstraint', 'ConstraintsIntersection', 'ConstraintsUnion', 'ValueSizeConstraint') (if_index,) = mibBuilder.importSymbols('IF-MIB', 'ifIndex') (inet_address_type, inet_address) = mibBuilder.importSymbols('INET-ADDRESS-MIB', 'InetAddressType', 'InetAddress') (burst_size,) = mibBuilder.importSymbols('INTEGRATED-SERVICES-MIB', 'BurstSize') (notification_group, object_group, module_compliance) = mibBuilder.importSymbols('SNMPv2-CONF', 'NotificationGroup', 'ObjectGroup', 'ModuleCompliance') (unsigned32, module_identity, mib_identifier, mib_2, mib_scalar, mib_table, mib_table_row, mib_table_column, counter32, integer32, time_ticks, zero_dot_zero, bits, object_identity, notification_type, gauge32, ip_address, iso, counter64) = mibBuilder.importSymbols('SNMPv2-SMI', 'Unsigned32', 'ModuleIdentity', 'MibIdentifier', 'mib-2', 'MibScalar', 'MibTable', 'MibTableRow', 'MibTableColumn', 'Counter32', 'Integer32', 'TimeTicks', 'zeroDotZero', 'Bits', 'ObjectIdentity', 'NotificationType', 'Gauge32', 'IpAddress', 'iso', 'Counter64') (display_string, row_status, time_stamp, textual_convention, row_pointer) = mibBuilder.importSymbols('SNMPv2-TC', 'DisplayString', 'RowStatus', 'TimeStamp', 'TextualConvention', 'RowPointer') diff_serv_mib = module_identity((1, 3, 6, 1, 2, 1, 12345)) diffServMib.setRevisions(('2000-07-13 00:00',)) if getattr(mibBuilder, 'version', (0, 0, 0)) > (4, 4, 0): if mibBuilder.loadTexts: diffServMib.setRevisionsDescriptions(('Initial version, published as RFC xxxx.',)) if mibBuilder.loadTexts: diffServMib.setLastUpdated('200007130000Z') if mibBuilder.loadTexts: diffServMib.setOrganization('IETF Diffserv WG') if mibBuilder.loadTexts: diffServMib.setContactInfo(' Brian Carpenter (co-chair of Diffserv WG) c/o iCAIR 1890 Maple Ave, #150 Evanston, IL 60201, USA Phone: +1 847 467 7811 E-mail: brian@icair.org Kathleen Nichols (co-chair of Diffserv WG) Packet Design E-mail: nichols@packetdesign.com Fred Baker (author) Cisco Systems 519 Lado Drive Santa Barbara, CA 93111, USA E-mail: fred@cisco.com Kwok Ho Chan (author) Nortel Networks 600 Technology Park Drive Billerica, MA 01821, USA E-mail: khchan@nortelnetworks.com Andrew Smith (author) E-mail: ah-smith@pacbell.net') if mibBuilder.loadTexts: diffServMib.setDescription('This MIB defines the objects necessary to manage a device that uses the Differentiated Services Architecture described in RFC 2475 and the Informal Management Model for DiffServ Routers in draft-ietf-diffserv-model-04.txt.') diff_serv_objects = mib_identifier((1, 3, 6, 1, 2, 1, 12345, 1)) diff_serv_tables = mib_identifier((1, 3, 6, 1, 2, 1, 12345, 2)) diff_serv_mib_conformance = mib_identifier((1, 3, 6, 1, 2, 1, 12345, 3)) class Dscp(TextualConvention, Integer32): description = 'The IP header Diffserv Code-Point that may be used for discriminating or marking a traffic stream. The value -1 is used to indicate a wildcard i.e. any value.' status = 'current' display_hint = 'd' subtype_spec = Integer32.subtypeSpec + constraints_union(value_range_constraint(-1, -1), value_range_constraint(0, 63)) class Sixtupleclfrl4Port(TextualConvention, Integer32): description = 'A value indicating a Layer-4 protocol port number.' status = 'current' display_hint = 'd' subtype_spec = Integer32.subtypeSpec + value_range_constraint(0, 65535) class Ifdirection(TextualConvention, Integer32): description = "Specifies a direction of data travel on an interface. 'inbound' traffic is operated on during reception from the interface, while 'outbound' traffic is operated on prior to transmission on the interface." status = 'current' subtype_spec = Integer32.subtypeSpec + constraints_union(single_value_constraint(1, 2)) named_values = named_values(('inbound', 1), ('outbound', 2)) diff_serv_classifier_table = mib_table((1, 3, 6, 1, 2, 1, 12345, 2, 1)) if mibBuilder.loadTexts: diffServClassifierTable.setReference('[MODEL] section 4.1') if mibBuilder.loadTexts: diffServClassifierTable.setStatus('current') if mibBuilder.loadTexts: diffServClassifierTable.setDescription('The classifier table defines the classifiers that are applied to traffic arriving at this interface in a particular direction. Specific classifiers are defined by RowPointers in the entries of this table which identify entries in filter tables of specific types, e.g. Multi-Field Classifiers (MFCs) for IP are defined in the diffServSixTupleClfrTable. Other classifier types may be defined elsewhere.') diff_serv_classifier_entry = mib_table_row((1, 3, 6, 1, 2, 1, 12345, 2, 1, 1)).setIndexNames((0, 'IF-MIB', 'ifIndex'), (0, 'DIFF-SERV-MIB', 'diffServClassifierIfDirection'), (0, 'DIFF-SERV-MIB', 'diffServClassifierTcb'), (0, 'DIFF-SERV-MIB', 'diffServClassifierId')) if mibBuilder.loadTexts: diffServClassifierEntry.setStatus('current') if mibBuilder.loadTexts: diffServClassifierEntry.setDescription('An entry in the classifier table describes a single element of the classifier.') diff_serv_classifier_if_direction = mib_table_column((1, 3, 6, 1, 2, 1, 12345, 2, 1, 1, 1), if_direction()) if mibBuilder.loadTexts: diffServClassifierIfDirection.setStatus('current') if mibBuilder.loadTexts: diffServClassifierIfDirection.setDescription('Specifies the direction for which this classifier entry applies on this interface.') diff_serv_classifier_tcb = mib_table_column((1, 3, 6, 1, 2, 1, 12345, 2, 1, 1, 2), unsigned32()) if mibBuilder.loadTexts: diffServClassifierTcb.setStatus('current') if mibBuilder.loadTexts: diffServClassifierTcb.setDescription('Specifies the TCB of which this classifier element is a part. Lower numbers indicate an element that belongs to a classifier that is part of a TCB that is, at least conceptually, applied to traffic before those with higher numbers - this is necessary to resolve ambiguity in cases where different TCBs contain filters that overlap with each other. A manager wanting to create a new TCB should either first search this table for existing entries and pick a value for this variable that is not currently represented - some form of pseudo- random choice is likely to minimise collisions. After successful creation of a conceptual row using the chosen value, the manager should check again that there are no other rows with this value that have been created by a different manager that could, potentially, interfere with the classifier elements that are desired.') diff_serv_classifier_id = mib_table_column((1, 3, 6, 1, 2, 1, 12345, 2, 1, 1, 3), unsigned32()) if mibBuilder.loadTexts: diffServClassifierId.setStatus('current') if mibBuilder.loadTexts: diffServClassifierId.setDescription('A classifier ID that enumerates the classifier elements. The set of such identifiers spans the whole agent. Managers should obtain new values for row creation in this table by reading diffServClassifierNextFree.') diff_serv_classifier_filter = mib_table_column((1, 3, 6, 1, 2, 1, 12345, 2, 1, 1, 4), row_pointer().clone((0, 0))).setMaxAccess('readcreate') if mibBuilder.loadTexts: diffServClassifierFilter.setStatus('current') if mibBuilder.loadTexts: diffServClassifierFilter.setDescription('A pointer to a valid entry in another table that describes the applicable classification filter, e.g. an entry in diffServSixTupleClfrTable. If the row pointed to does not exist, the classifier is ignored. The value zeroDotZero is interpreted to match anything not matched by another classifier - only one such entry may exist in this table.') diff_serv_classifier_next = mib_table_column((1, 3, 6, 1, 2, 1, 12345, 2, 1, 1, 5), row_pointer()).setMaxAccess('readcreate') if mibBuilder.loadTexts: diffServClassifierNext.setStatus('current') if mibBuilder.loadTexts: diffServClassifierNext.setDescription('This selects the next datapath element to handle packets matching the filter pattern. For example, this can point to an entry in a meter, action, algorithmic dropper or queue table. If the row pointed to does not exist, the classifier element is ignored.') diff_serv_classifier_precedence = mib_table_column((1, 3, 6, 1, 2, 1, 12345, 2, 1, 1, 6), unsigned32()).setMaxAccess('readcreate') if mibBuilder.loadTexts: diffServClassifierPrecedence.setStatus('current') if mibBuilder.loadTexts: diffServClassifierPrecedence.setDescription('The relative precedence in which classifiers are applied: higher numbers represent classifiers with higher precedence. Classifiers with the same precedence must be unambiguous i.e. they must define non-overlapping patterns, and are considered to be applied simultaneously to the traffic stream. Classifiers with different precedence may overlap in their filters: the classifier with the highest precedence that matches is taken. On a given interface, there must be a complete classifier in place at all times for the first TCB (lowest value of diffServClassifierTcb) in the ingress direction. This means that there will always be one or more filters that match every possible pattern that could be presented in an incoming packet. There is no such requirement for subsequent TCBs in the ingress direction, nor for any TCB in the egress direction.') diff_serv_classifier_status = mib_table_column((1, 3, 6, 1, 2, 1, 12345, 2, 1, 1, 7), row_status()).setMaxAccess('readcreate') if mibBuilder.loadTexts: diffServClassifierStatus.setStatus('current') if mibBuilder.loadTexts: diffServClassifierStatus.setDescription('The RowStatus variable controls the activation, deactivation, or deletion of a classifier. Any writable variable may be modified whether the row is active or notInService.') diff_serv_classifier_next_free = mib_scalar((1, 3, 6, 1, 2, 1, 12345, 1, 1), unsigned32()).setMaxAccess('readonly') if mibBuilder.loadTexts: diffServClassifierNextFree.setStatus('current') if mibBuilder.loadTexts: diffServClassifierNextFree.setDescription('This object yields a value when read that is currently-unused for a diffServClassifierId instance. If a configuring system attempts to create a new row in the diffServClassifierTable using this value, that operation will fail if the value has, in the meantime, been used to create another row that is currently valid.') diff_serv_six_tuple_clfr_table = mib_table((1, 3, 6, 1, 2, 1, 12345, 2, 2)) if mibBuilder.loadTexts: diffServSixTupleClfrTable.setReference('[MODEL] section 4.2.2') if mibBuilder.loadTexts: diffServSixTupleClfrTable.setStatus('current') if mibBuilder.loadTexts: diffServSixTupleClfrTable.setDescription('A table of IP Six-Tuple Classifier filter entries that a system may use to identify IP traffic.') diff_serv_six_tuple_clfr_entry = mib_table_row((1, 3, 6, 1, 2, 1, 12345, 2, 2, 1)).setIndexNames((0, 'DIFF-SERV-MIB', 'diffServSixTupleClfrId')) if mibBuilder.loadTexts: diffServSixTupleClfrEntry.setStatus('current') if mibBuilder.loadTexts: diffServSixTupleClfrEntry.setDescription('An IP Six-Tuple Classifier entry describes a single filter.') diff_serv_six_tuple_clfr_id = mib_table_column((1, 3, 6, 1, 2, 1, 12345, 2, 2, 1, 1), unsigned32()) if mibBuilder.loadTexts: diffServSixTupleClfrId.setStatus('current') if mibBuilder.loadTexts: diffServSixTupleClfrId.setDescription('A unique identifier for the filter. Filters may be shared by multiple interfaces in the same system. Managers should obtain new values for row creation in this table by reading diffServSixTupleClfrNextFree.') diff_serv_six_tuple_clfr_dst_addr_type = mib_table_column((1, 3, 6, 1, 2, 1, 12345, 2, 2, 1, 2), inet_address_type()).setMaxAccess('readcreate') if mibBuilder.loadTexts: diffServSixTupleClfrDstAddrType.setStatus('current') if mibBuilder.loadTexts: diffServSixTupleClfrDstAddrType.setDescription('The type of IP destination address used by this classifier entry.') diff_serv_six_tuple_clfr_dst_addr = mib_table_column((1, 3, 6, 1, 2, 1, 12345, 2, 2, 1, 3), inet_address()).setMaxAccess('readcreate') if mibBuilder.loadTexts: diffServSixTupleClfrDstAddr.setStatus('current') if mibBuilder.loadTexts: diffServSixTupleClfrDstAddr.setDescription("The IP address to match against the packet's destination IP address.") diff_serv_six_tuple_clfr_dst_addr_mask = mib_table_column((1, 3, 6, 1, 2, 1, 12345, 2, 2, 1, 4), unsigned32()).setUnits('bits').setMaxAccess('readcreate') if mibBuilder.loadTexts: diffServSixTupleClfrDstAddrMask.setStatus('current') if mibBuilder.loadTexts: diffServSixTupleClfrDstAddrMask.setDescription('The length of a mask for the matching of the destination IP address. Masks are constructed by setting bits in sequence from the most-significant bit downwards for diffServSixTupleClfrDstAddrMask bits length. All other bits in the mask, up to the number needed to fill the length of the address diffServSixTupleClfrDstAddr are cleared to zero. A zero bit in the mask then means that the corresponding bit in the address always matches.') diff_serv_six_tuple_clfr_src_addr_type = mib_table_column((1, 3, 6, 1, 2, 1, 12345, 2, 2, 1, 5), inet_address_type()).setMaxAccess('readcreate') if mibBuilder.loadTexts: diffServSixTupleClfrSrcAddrType.setStatus('current') if mibBuilder.loadTexts: diffServSixTupleClfrSrcAddrType.setDescription('The type of IP source address used by this classifier entry.') diff_serv_six_tuple_clfr_src_addr = mib_table_column((1, 3, 6, 1, 2, 1, 12345, 2, 2, 1, 6), inet_address()).setMaxAccess('readcreate') if mibBuilder.loadTexts: diffServSixTupleClfrSrcAddr.setStatus('current') if mibBuilder.loadTexts: diffServSixTupleClfrSrcAddr.setDescription('The IP address to match against the source IP address of each packet.') diff_serv_six_tuple_clfr_src_addr_mask = mib_table_column((1, 3, 6, 1, 2, 1, 12345, 2, 2, 1, 7), unsigned32()).setUnits('bits').setMaxAccess('readcreate') if mibBuilder.loadTexts: diffServSixTupleClfrSrcAddrMask.setStatus('current') if mibBuilder.loadTexts: diffServSixTupleClfrSrcAddrMask.setDescription('The length of a mask for the matching of the source IP address. Masks are constructed by setting bits in sequence from the most- significant bit downwards for diffServSixTupleClfrSrcAddrMask bits length. All other bits in the mask, up to the number needed to fill the length of the address diffServSixTupleClfrSrcAddr are cleared to zero. A zero bit in the mask then means that the corresponding bit in the address always matches.') diff_serv_six_tuple_clfr_dscp = mib_table_column((1, 3, 6, 1, 2, 1, 12345, 2, 2, 1, 8), dscp().clone(-1)).setMaxAccess('readcreate') if mibBuilder.loadTexts: diffServSixTupleClfrDscp.setStatus('current') if mibBuilder.loadTexts: diffServSixTupleClfrDscp.setDescription('The value that the DSCP in the packet must have to match this entry. A value of -1 indicates that a specific DSCP value has not been defined and thus all DSCP values are considered a match.') diff_serv_six_tuple_clfr_protocol = mib_table_column((1, 3, 6, 1, 2, 1, 12345, 2, 2, 1, 9), integer32().subtype(subtypeSpec=value_range_constraint(0, 255))).setMaxAccess('readcreate') if mibBuilder.loadTexts: diffServSixTupleClfrProtocol.setStatus('current') if mibBuilder.loadTexts: diffServSixTupleClfrProtocol.setDescription('The IP protocol to match against the IPv4 protocol number in the packet. A value of zero means match all.') diff_serv_six_tuple_clfr_dst_l4_port_min = mib_table_column((1, 3, 6, 1, 2, 1, 12345, 2, 2, 1, 10), six_tuple_clfr_l4_port()).setMaxAccess('readcreate') if mibBuilder.loadTexts: diffServSixTupleClfrDstL4PortMin.setStatus('current') if mibBuilder.loadTexts: diffServSixTupleClfrDstL4PortMin.setDescription('The minimum value that the layer-4 destination port number in the packet must have in order to match this classifier entry.') diff_serv_six_tuple_clfr_dst_l4_port_max = mib_table_column((1, 3, 6, 1, 2, 1, 12345, 2, 2, 1, 11), six_tuple_clfr_l4_port().clone(65535)).setMaxAccess('readcreate') if mibBuilder.loadTexts: diffServSixTupleClfrDstL4PortMax.setStatus('current') if mibBuilder.loadTexts: diffServSixTupleClfrDstL4PortMax.setDescription('The maximum value that the layer-4 destination port number in the packet must have in order to match this classifier entry. This value must be equal to or greater that the value specified for this entry in diffServSixTupleClfrDstL4PortMin.') diff_serv_six_tuple_clfr_src_l4_port_min = mib_table_column((1, 3, 6, 1, 2, 1, 12345, 2, 2, 1, 12), six_tuple_clfr_l4_port()).setMaxAccess('readcreate') if mibBuilder.loadTexts: diffServSixTupleClfrSrcL4PortMin.setStatus('current') if mibBuilder.loadTexts: diffServSixTupleClfrSrcL4PortMin.setDescription('The minimum value that the layer-4 source port number in the packet must have in order to match this classifier entry.') diff_serv_six_tuple_clfr_src_l4_port_max = mib_table_column((1, 3, 6, 1, 2, 1, 12345, 2, 2, 1, 13), six_tuple_clfr_l4_port().clone(65535)).setMaxAccess('readcreate') if mibBuilder.loadTexts: diffServSixTupleClfrSrcL4PortMax.setStatus('current') if mibBuilder.loadTexts: diffServSixTupleClfrSrcL4PortMax.setDescription('The maximum value that the layer-4 source port number in the packet must have in oder to match this classifier entry. This value must be equal to or greater that the value specified for this entry in dsSixTupleIpSrcL4PortMin.') diff_serv_six_tuple_clfr_status = mib_table_column((1, 3, 6, 1, 2, 1, 12345, 2, 2, 1, 14), row_status()).setMaxAccess('readcreate') if mibBuilder.loadTexts: diffServSixTupleClfrStatus.setStatus('current') if mibBuilder.loadTexts: diffServSixTupleClfrStatus.setDescription('The RowStatus variable controls the activation, deactivation, or deletion of a classifier. Any writable variable may be modified whether the row is active or notInService.') diff_serv_six_tuple_clfr_next_free = mib_scalar((1, 3, 6, 1, 2, 1, 12345, 1, 2), unsigned32()).setMaxAccess('readonly') if mibBuilder.loadTexts: diffServSixTupleClfrNextFree.setStatus('current') if mibBuilder.loadTexts: diffServSixTupleClfrNextFree.setDescription('This object yields a value when read that is currently-unused for a diffServSixTupleClfrId instance. If a configuring system attempts to create a new row in the diffServSixTupleClfrTable using this value, that operation will fail if the value has, in the meantime, been used to create another row that is currently valid.') diff_serv_meter_table = mib_table((1, 3, 6, 1, 2, 1, 12345, 2, 3)) if mibBuilder.loadTexts: diffServMeterTable.setReference('[MODEL] section 5.1') if mibBuilder.loadTexts: diffServMeterTable.setStatus('current') if mibBuilder.loadTexts: diffServMeterTable.setDescription('This table enumerates generic meters that a system may use to police a stream of traffic. The traffic stream to be metered is determined by the element(s) upstream of the meter i.e. by the object(s) that point to each entry in this table. This may include all traffic on an interface. Specific meter details are to be found in diffServMeterSpecific.') diff_serv_meter_entry = mib_table_row((1, 3, 6, 1, 2, 1, 12345, 2, 3, 1)).setIndexNames((0, 'IF-MIB', 'ifIndex'), (0, 'DIFF-SERV-MIB', 'diffServMeterIfDirection'), (0, 'DIFF-SERV-MIB', 'diffServMeterId')) if mibBuilder.loadTexts: diffServMeterEntry.setStatus('current') if mibBuilder.loadTexts: diffServMeterEntry.setDescription('An entry in the meter table describing a single meter.') diff_serv_meter_if_direction = mib_table_column((1, 3, 6, 1, 2, 1, 12345, 2, 3, 1, 1), if_direction()) if mibBuilder.loadTexts: diffServMeterIfDirection.setStatus('current') if mibBuilder.loadTexts: diffServMeterIfDirection.setDescription('Specifies the direction for which this meter entry applies on this interface.') diff_serv_meter_id = mib_table_column((1, 3, 6, 1, 2, 1, 12345, 2, 3, 1, 2), unsigned32()) if mibBuilder.loadTexts: diffServMeterId.setStatus('current') if mibBuilder.loadTexts: diffServMeterId.setDescription('This identifies a meter entry. Managers should obtain new values for row creation in this table by reading diffServMeterNextFree.') diff_serv_meter_succeed_next = mib_table_column((1, 3, 6, 1, 2, 1, 12345, 2, 3, 1, 3), row_pointer().clone((0, 0))).setMaxAccess('readcreate') if mibBuilder.loadTexts: diffServMeterSucceedNext.setStatus('current') if mibBuilder.loadTexts: diffServMeterSucceedNext.setDescription('If the traffic does conform to the meter, this indicates the next datapath element to handle the traffic e.g. an Action or another Meter datapath element. The value zeroDotZero in this variable indicates no further Diffserv treatment is performed on this traffic by the current interface for this interface direction. If the row pointed to does not exist, the meter element is considered inactive.') diff_serv_meter_fail_next = mib_table_column((1, 3, 6, 1, 2, 1, 12345, 2, 3, 1, 4), row_pointer().clone((0, 0))).setMaxAccess('readcreate') if mibBuilder.loadTexts: diffServMeterFailNext.setStatus('current') if mibBuilder.loadTexts: diffServMeterFailNext.setDescription('If the traffic does not conform to the meter, this indicates the next datapath element to handle the traffic e.g. an Action or Meter datapath element. The value zeroDotZero in this variable indicates no further Diffserv treatment is performed on this traffic by the current interface for this interface direction. If the row pointed to does not exist, the meter element is considered inactive.') diff_serv_meter_specific = mib_table_column((1, 3, 6, 1, 2, 1, 12345, 2, 3, 1, 5), object_identifier()).setMaxAccess('readcreate') if mibBuilder.loadTexts: diffServMeterSpecific.setStatus('current') if mibBuilder.loadTexts: diffServMeterSpecific.setDescription('This indicates the behaviour of the meter by pointing to a table containing detailed parameters. Note that entries in that specific table must be managed explicitly. One example of a valid object would be diffServTBMeterTable, whose entries are indexed by the same variables as this table, for describing an instance of a token-bucket meter.') diff_serv_meter_status = mib_table_column((1, 3, 6, 1, 2, 1, 12345, 2, 3, 1, 6), row_status()).setMaxAccess('readcreate') if mibBuilder.loadTexts: diffServMeterStatus.setStatus('current') if mibBuilder.loadTexts: diffServMeterStatus.setDescription('The RowStatus variable controls the activation, deactivation, or deletion of a meter. Any writable variable may be modified whether the row is active or notInService.') diff_serv_meter_next_free = mib_scalar((1, 3, 6, 1, 2, 1, 12345, 1, 3), unsigned32()).setMaxAccess('readonly') if mibBuilder.loadTexts: diffServMeterNextFree.setStatus('current') if mibBuilder.loadTexts: diffServMeterNextFree.setDescription('This object yields a value when read that is currently-unused for a diffServMeterId instance. If a configuring system attempts to create a new row in the diffServMeterTable using this value, that operation will fail if the value has, in the meantime, been used to create another row that is currently valid.') diff_serv_tb_meter_table = mib_table((1, 3, 6, 1, 2, 1, 12345, 2, 4)) if mibBuilder.loadTexts: diffServTBMeterTable.setReference('[MODEL] section 5.1.3') if mibBuilder.loadTexts: diffServTBMeterTable.setStatus('current') if mibBuilder.loadTexts: diffServTBMeterTable.setDescription('This table enumerates specific token-bucket meters that a system may use to police a stream of traffic. Such meters are modelled here as having a single rate and a burst size. Multiple meter elements may be logically cascaded using their diffServMeterSucceedNext pointers if a multi-rate token bucket is needed. One example of this might be for an AF PHB implementation that used two-rate meters. Such cascading of meter elements of specific type of token-bucket indicates forwarding behaviour that is functionally equivalent to a multi- rate meter: the sequential nature of the representation is merely a notational convenience for this MIB. Entries in this table share indexing with a parent diffServMeterEntry although they must be managed (e.g. created/deleted) by explicit management action, independently of the associated value of diffServMeterSpecific.') diff_serv_tb_meter_entry = mib_table_row((1, 3, 6, 1, 2, 1, 12345, 2, 4, 1)).setIndexNames((0, 'IF-MIB', 'ifIndex'), (0, 'DIFF-SERV-MIB', 'diffServMeterIfDirection'), (0, 'DIFF-SERV-MIB', 'diffServMeterId')) if mibBuilder.loadTexts: diffServTBMeterEntry.setStatus('current') if mibBuilder.loadTexts: diffServTBMeterEntry.setDescription('An entry that describes a single token-bucket meter, indexed by the same variables as a diffServMeterEntry.') diff_serv_tb_meter_rate = mib_table_column((1, 3, 6, 1, 2, 1, 12345, 2, 4, 1, 1), unsigned32()).setUnits('kilobits per second').setMaxAccess('readcreate') if mibBuilder.loadTexts: diffServTBMeterRate.setStatus('current') if mibBuilder.loadTexts: diffServTBMeterRate.setDescription('The token-bucket rate, in kilobits per second (kbps).') diff_serv_tb_meter_burst_size = mib_table_column((1, 3, 6, 1, 2, 1, 12345, 2, 4, 1, 2), burst_size()).setUnits('Bytes').setMaxAccess('readcreate') if mibBuilder.loadTexts: diffServTBMeterBurstSize.setStatus('current') if mibBuilder.loadTexts: diffServTBMeterBurstSize.setDescription('The maximum number of bytes in a single transmission burst. The interval over which the burst is to be measured can be derived as diffServTBMeterBurstSize*8*1000/diffServTBMeterRate.') diff_serv_tb_meter_status = mib_table_column((1, 3, 6, 1, 2, 1, 12345, 2, 4, 1, 3), row_status()).setMaxAccess('readcreate') if mibBuilder.loadTexts: diffServTBMeterStatus.setStatus('current') if mibBuilder.loadTexts: diffServTBMeterStatus.setDescription('The RowStatus variable controls the activation, deactivation, or deletion of a meter. Any writable variable may be modified whether the row is active or notInService.') diff_serv_action_table = mib_table((1, 3, 6, 1, 2, 1, 12345, 2, 5)) if mibBuilder.loadTexts: diffServActionTable.setReference('[MODEL] section 6.') if mibBuilder.loadTexts: diffServActionTable.setStatus('current') if mibBuilder.loadTexts: diffServActionTable.setDescription('The Action Table enumerates actions that can be performed to a stream of traffic. Multiple actions can be concatenated. For example, after marking a stream of traffic exiting from a meter, a device can then perform a count action of the conforming or non-conforming traffic. Specific actions are indicated by diffServActionSpecific which points to another object which describes the action in further detail.') diff_serv_action_entry = mib_table_row((1, 3, 6, 1, 2, 1, 12345, 2, 5, 1)).setIndexNames((0, 'IF-MIB', 'ifIndex'), (0, 'DIFF-SERV-MIB', 'diffServActionIfDirection'), (0, 'DIFF-SERV-MIB', 'diffServActionId')) if mibBuilder.loadTexts: diffServActionEntry.setStatus('current') if mibBuilder.loadTexts: diffServActionEntry.setDescription('An entry in the action table describing the actions applied to traffic arriving at its input.') diff_serv_action_if_direction = mib_table_column((1, 3, 6, 1, 2, 1, 12345, 2, 5, 1, 1), if_direction()) if mibBuilder.loadTexts: diffServActionIfDirection.setStatus('current') if mibBuilder.loadTexts: diffServActionIfDirection.setDescription('Specifies the direction for which this action entry applies on this interface.') diff_serv_action_id = mib_table_column((1, 3, 6, 1, 2, 1, 12345, 2, 5, 1, 2), unsigned32()) if mibBuilder.loadTexts: diffServActionId.setStatus('current') if mibBuilder.loadTexts: diffServActionId.setDescription('This identifies the action entry. Managers should obtain new values for row creation in this table by reading diffServActionNextFree.') diff_serv_action_next = mib_table_column((1, 3, 6, 1, 2, 1, 12345, 2, 5, 1, 3), row_pointer().clone((0, 0))).setMaxAccess('readcreate') if mibBuilder.loadTexts: diffServActionNext.setStatus('current') if mibBuilder.loadTexts: diffServActionNext.setDescription('The Next pointer indicates the next datapath element to handle the traffic. For example, a queue datapath element. The value zeroDotZero in this variable indicates no further DiffServ treatment is performed on this flow by the current interface for this interface direction. If the row pointed to does not exist, the action element is considered inactive.') diff_serv_action_specific = mib_table_column((1, 3, 6, 1, 2, 1, 12345, 2, 5, 1, 4), object_identifier()).setMaxAccess('readcreate') if mibBuilder.loadTexts: diffServActionSpecific.setStatus('current') if mibBuilder.loadTexts: diffServActionSpecific.setDescription('A pointer to an object instance providing additional information for the type of action indicated by this action table entry. For the standard actions defined by this MIB module, this should point to one of the following: a diffServDscpMarkActEntry, a diffServCountActEntry, the diffServAbsoluteDropAction OID. For other actions, it may point to an object instance defined in some other MIB.') diff_serv_action_status = mib_table_column((1, 3, 6, 1, 2, 1, 12345, 2, 5, 1, 5), row_status()).setMaxAccess('readcreate') if mibBuilder.loadTexts: diffServActionStatus.setStatus('current') if mibBuilder.loadTexts: diffServActionStatus.setDescription('The RowStatus variable controls the activation, deactivation or deletion of an action element. Any writable variable may be modified whether the row is active or notInService.') diff_serv_action_next_free = mib_scalar((1, 3, 6, 1, 2, 1, 12345, 1, 4), unsigned32()).setMaxAccess('readonly') if mibBuilder.loadTexts: diffServActionNextFree.setStatus('current') if mibBuilder.loadTexts: diffServActionNextFree.setDescription('This object yields a value when read that is currently-unused for a diffServActionId instance. If a configuring system attempts to create a new row in the diffServActionTable using this value, that operation will fail if the value has, in the meantime, been used to create another row that is currently valid.') diff_serv_dscp_mark_act_table = mib_table((1, 3, 6, 1, 2, 1, 12345, 2, 6)) if mibBuilder.loadTexts: diffServDscpMarkActTable.setReference('[MODEL] section 6.1') if mibBuilder.loadTexts: diffServDscpMarkActTable.setStatus('current') if mibBuilder.loadTexts: diffServDscpMarkActTable.setDescription('This table enumerates specific DSCPs used for marking or remarking the DSCP field of IP packets. The entries of this table may be referenced by a diffServActionSpecific attribute that points to diffServDscpMarkActTable.') diff_serv_dscp_mark_act_entry = mib_table_row((1, 3, 6, 1, 2, 1, 12345, 2, 6, 1)).setIndexNames((0, 'DIFF-SERV-MIB', 'diffServDscpMarkActDscp')) if mibBuilder.loadTexts: diffServDscpMarkActEntry.setStatus('current') if mibBuilder.loadTexts: diffServDscpMarkActEntry.setDescription('An entry in the DSCP mark action table that describes a single DSCP used for marking.') diff_serv_dscp_mark_act_dscp = mib_table_column((1, 3, 6, 1, 2, 1, 12345, 2, 6, 1, 1), dscp()).setMaxAccess('readonly') if mibBuilder.loadTexts: diffServDscpMarkActDscp.setStatus('current') if mibBuilder.loadTexts: diffServDscpMarkActDscp.setDescription('The DSCP that this Action uses for marking/remarking traffic. Note that a DSCP value of -1 is not permitted in this table. It is quite possible that the only packets subject to this Action are already marked with this DSCP. Note also that Diffserv may result in packet remarking both on ingress to a network and on egress from it and it is quite possible that ingress and egress would occur in the same router.') diff_serv_count_act_table = mib_table((1, 3, 6, 1, 2, 1, 12345, 2, 7)) if mibBuilder.loadTexts: diffServCountActTable.setReference('[MODEL] section 6.5') if mibBuilder.loadTexts: diffServCountActTable.setStatus('current') if mibBuilder.loadTexts: diffServCountActTable.setDescription('This table contains counters for all the traffic passing through an action element.') diff_serv_count_act_entry = mib_table_row((1, 3, 6, 1, 2, 1, 12345, 2, 7, 1)).setIndexNames((0, 'IF-MIB', 'ifIndex'), (0, 'DIFF-SERV-MIB', 'diffServActionIfDirection'), (0, 'DIFF-SERV-MIB', 'diffServActionId')) if mibBuilder.loadTexts: diffServCountActEntry.setStatus('current') if mibBuilder.loadTexts: diffServCountActEntry.setDescription('An entry in the count action table that describes a single set of traffic counters. Entries in this table share indexing with those in the base diffServActionTable although they must be managed (e.g. created/deleted) by explicit management action, independently of the associated value of diffServActionSpecific.') diff_serv_count_act_octets = mib_table_column((1, 3, 6, 1, 2, 1, 12345, 2, 7, 1, 1), counter32()).setMaxAccess('readonly') if mibBuilder.loadTexts: diffServCountActOctets.setStatus('current') if mibBuilder.loadTexts: diffServCountActOctets.setDescription('The number of octets at the Action datapath element. On high speed devices, this object implements the least significant 32 bits of diffServcountActHCOctets. Discontinuities in the value of this counter can occur at re- initialization of the management system and at other times as indicated by the value of diffServCountActDiscontTime for this entry.') diff_serv_count_act_hc_octets = mib_table_column((1, 3, 6, 1, 2, 1, 12345, 2, 7, 1, 2), counter64()).setMaxAccess('readonly') if mibBuilder.loadTexts: diffServCountActHCOctets.setStatus('current') if mibBuilder.loadTexts: diffServCountActHCOctets.setDescription('The number of octets at the Action datapath element. This object should be used on high speed interfaces. Discontinuities in the value of this counter can occur at re- initialization of the management system and at other times as indicated by the value of diffServCountActDiscontTime for this entry.') diff_serv_count_act_pkts = mib_table_column((1, 3, 6, 1, 2, 1, 12345, 2, 7, 1, 3), counter32()).setMaxAccess('readonly') if mibBuilder.loadTexts: diffServCountActPkts.setStatus('current') if mibBuilder.loadTexts: diffServCountActPkts.setDescription('The number of packets at the Action datapath element. On high speed devices, this object implements the least significant 32 bits of diffServcountActHCPkts. Discontinuities in the value of this counter can occur at re- initialization of the management system and at other times as indicated by the value of diffServCountActDiscontTime for this entry.') diff_serv_count_act_hc_pkts = mib_table_column((1, 3, 6, 1, 2, 1, 12345, 2, 7, 1, 4), counter64()).setMaxAccess('readonly') if mibBuilder.loadTexts: diffServCountActHCPkts.setStatus('current') if mibBuilder.loadTexts: diffServCountActHCPkts.setDescription('The number of packets at the Action datapath element. This object should be used on high speed interfaces. Discontinuities in the value of this counter can occur at re- initialization of the management system and at other times as indicated by the value of diffServCountActDiscontTime for this entry.') diff_serv_count_act_discont_time = mib_table_column((1, 3, 6, 1, 2, 1, 12345, 2, 7, 1, 5), time_stamp()).setMaxAccess('readonly') if mibBuilder.loadTexts: diffServCountActDiscontTime.setStatus('current') if mibBuilder.loadTexts: diffServCountActDiscontTime.setDescription("The value of sysUpTime on the most recent occasion at which any one or more of this entry's counters suffered a discontinuity. If no such discontinuities have occurred since the last re- initialization of the local management subsystem, then this object contains a zero value.") diff_serv_count_act_status = mib_table_column((1, 3, 6, 1, 2, 1, 12345, 2, 7, 1, 6), row_status()).setMaxAccess('readcreate') if mibBuilder.loadTexts: diffServCountActStatus.setStatus('current') if mibBuilder.loadTexts: diffServCountActStatus.setDescription('The RowStatus variable controls the activation, deactivation, or deletion of this entry. Any writable variable may be modified whether the row is active or notInService.') diff_serv_absolute_drop_action = object_identity((1, 3, 6, 1, 2, 1, 12345, 1, 6)) if mibBuilder.loadTexts: diffServAbsoluteDropAction.setStatus('current') if mibBuilder.loadTexts: diffServAbsoluteDropAction.setDescription('This object identifier may be used as the value of a diffServActionSpecific pointer in order to indicate that all packets following this path are to be dropped unconditionally at this point. It is likely, but not required, that this action will be preceded by a counter action.') diff_serv_alg_drop_table = mib_table((1, 3, 6, 1, 2, 1, 12345, 2, 8)) if mibBuilder.loadTexts: diffServAlgDropTable.setReference('[MODEL] section 7.1.3') if mibBuilder.loadTexts: diffServAlgDropTable.setStatus('current') if mibBuilder.loadTexts: diffServAlgDropTable.setDescription('The algorithmic drop table contains entries describing an element that drops packets according to some algorithm.') diff_serv_alg_drop_entry = mib_table_row((1, 3, 6, 1, 2, 1, 12345, 2, 8, 1)).setIndexNames((0, 'IF-MIB', 'ifIndex'), (0, 'DIFF-SERV-MIB', 'diffServAlgDropIfDirection'), (0, 'DIFF-SERV-MIB', 'diffServAlgDropId')) if mibBuilder.loadTexts: diffServAlgDropEntry.setStatus('current') if mibBuilder.loadTexts: diffServAlgDropEntry.setDescription('An entry describes a process that drops packets according to some algorithm. Further details of the algorithm type are to be found in diffServAlgDropType and may be pointed to by diffServAlgDropSpecific.') diff_serv_alg_drop_if_direction = mib_table_column((1, 3, 6, 1, 2, 1, 12345, 2, 8, 1, 1), if_direction()) if mibBuilder.loadTexts: diffServAlgDropIfDirection.setStatus('current') if mibBuilder.loadTexts: diffServAlgDropIfDirection.setDescription('Specifies the direction for which this algorithmic dropper entry applies on this interface.') diff_serv_alg_drop_id = mib_table_column((1, 3, 6, 1, 2, 1, 12345, 2, 8, 1, 2), unsigned32()) if mibBuilder.loadTexts: diffServAlgDropId.setStatus('current') if mibBuilder.loadTexts: diffServAlgDropId.setDescription('This identifies the drop action entry. Managers should obtain new values for row creation in this table by reading diffServAlgDropNextFree.') diff_serv_alg_drop_type = mib_table_column((1, 3, 6, 1, 2, 1, 12345, 2, 8, 1, 3), integer32().subtype(subtypeSpec=constraints_union(single_value_constraint(1, 2, 3, 4))).clone(namedValues=named_values(('other', 1), ('tailDrop', 2), ('headDrop', 3), ('randomDrop', 4)))).setMaxAccess('readcreate') if mibBuilder.loadTexts: diffServAlgDropType.setStatus('current') if mibBuilder.loadTexts: diffServAlgDropType.setDescription('The type of algorithm used by this dropper. A value of tailDrop(2) or headDrop(3) represents an algorithm that is completely specified by this MIB. A value of other(1) requires further specification in some other MIB module. The tailDrop(2) algorithm is described as follows: diffServAlgDropQThreshold represents the depth of the queue diffServAlgDropQMeasure at which all newly arriving packets will be dropped. The headDrop(3) algorithm is described as follows: if a packet arrives when the current depth of the queue diffServAlgDropQMeasure is at diffServAlgDropQThreshold, packets currently at the head of the queue are dropped to make room for the new packet to be enqueued at the tail of the queue. The randomDrop(4) algorithm is described as follows: on packet arrival, an algorithm is executed which may randomly drop the packet, or drop other packet(s) from the queue in its place. The specifics of the algorithm may be proprietary. For this algorithm, an associated diffServRandomDropEntry is indicated by pointing diffServAlgDropSpecific at the diffServRandomDropTable. The relevant entry in that table is selected by the common indexing of the two tables. For this algorithm, diffServAlgQThreshold is understood to be the absolute maximum size of the queue and additional parameters are described in diffServRandomDropTable.') diff_serv_alg_drop_next = mib_table_column((1, 3, 6, 1, 2, 1, 12345, 2, 8, 1, 4), row_pointer()).setMaxAccess('readcreate') if mibBuilder.loadTexts: diffServAlgDropNext.setStatus('current') if mibBuilder.loadTexts: diffServAlgDropNext.setDescription('The Next pointer indicates the next datapath element to handle the traffic e.g. a queue datapath element. The value zeroDotZero in this variable indicates no further DiffServ treatment is performed on this flow by the current interface for this interface direction. If the row pointed to does not exist, the algorithmic dropper element is considered inactive.') diff_serv_alg_drop_q_measure = mib_table_column((1, 3, 6, 1, 2, 1, 12345, 2, 8, 1, 5), row_pointer()).setMaxAccess('readcreate') if mibBuilder.loadTexts: diffServAlgDropQMeasure.setStatus('current') if mibBuilder.loadTexts: diffServAlgDropQMeasure.setDescription('Points to an entry in the diffServQueueTable to indicate the queue that a drop algorithm is to monitor when deciding whether to drop a packet. If the row pointed to does not exist, the algorithmic dropper element is considered inactive.') diff_serv_alg_drop_q_threshold = mib_table_column((1, 3, 6, 1, 2, 1, 12345, 2, 8, 1, 6), unsigned32()).setUnits('Bytes').setMaxAccess('readcreate') if mibBuilder.loadTexts: diffServAlgDropQThreshold.setStatus('current') if mibBuilder.loadTexts: diffServAlgDropQThreshold.setDescription('A threshold on the depth in bytes of the queue being measured at which a trigger is generated to the dropping algorithm. For the tailDrop(2) or headDrop(3) algorithms, this represents the depth of the queue diffServAlgDropQMeasure at which the drop action will take place. Other algorithms will need to define their own semantics for this threshold.') diff_serv_alg_drop_specific = mib_table_column((1, 3, 6, 1, 2, 1, 12345, 2, 8, 1, 7), object_identifier()).setMaxAccess('readcreate') if mibBuilder.loadTexts: diffServAlgDropSpecific.setStatus('current') if mibBuilder.loadTexts: diffServAlgDropSpecific.setDescription('Points to a table (not an entry in the table) defined elsewhere that provides further detail regarding a drop algorithm. Entries in such a table are indexed by the same variables as this diffServAlgDropEntry but note that those entries must be managed independently of those in this table. Entries with diffServAlgDropType equal to other(1) may have this point to a table defined in another MIB module. Entries with diffServAlgDropType equal to randomDrop(4) must have this point to diffServRandomDropTable. For all other algorithms, this should take the value zeroDotzero.') diff_serv_alg_drop_octets = mib_table_column((1, 3, 6, 1, 2, 1, 12345, 2, 8, 1, 8), counter32()).setMaxAccess('readonly') if mibBuilder.loadTexts: diffServAlgDropOctets.setStatus('current') if mibBuilder.loadTexts: diffServAlgDropOctets.setDescription('The number of octets that have been dropped by this drop process. On high speed devices, this object implements the least significant 32 bits of diffServAlgDropHCOctets. Discontinuities in the value of this counter can occur at re- initialization of the management system and at other times as indicated by the value of ifCounterDiscontinuityTime appropriate to this interface.') diff_serv_alg_drop_hc_octets = mib_table_column((1, 3, 6, 1, 2, 1, 12345, 2, 8, 1, 9), counter64()).setMaxAccess('readonly') if mibBuilder.loadTexts: diffServAlgDropHCOctets.setStatus('current') if mibBuilder.loadTexts: diffServAlgDropHCOctets.setDescription('The number of octets that have been dropped by this drop process. This object should be used on high speed interfaces. Discontinuities in the value of this counter can occur at re- initialization of the management system and at other times as indicated by the value of ifCounterDiscontinuityTime appropriate to this interface.') diff_serv_alg_drop_pkts = mib_table_column((1, 3, 6, 1, 2, 1, 12345, 2, 8, 1, 10), counter32()).setMaxAccess('readonly') if mibBuilder.loadTexts: diffServAlgDropPkts.setStatus('current') if mibBuilder.loadTexts: diffServAlgDropPkts.setDescription('The number of packets that have been dropped by this drop process. On high speed devices, this object implements the least significant 32 bits of diffServAlgDropHCPkts. Discontinuities in the value of this counter can occur at re- initialization of the management system and at other times as indicated by the value of ifCounterDiscontinuityTime appropriate to this interface.') diff_serv_alg_drop_hc_pkts = mib_table_column((1, 3, 6, 1, 2, 1, 12345, 2, 8, 1, 11), counter64()).setMaxAccess('readonly') if mibBuilder.loadTexts: diffServAlgDropHCPkts.setStatus('current') if mibBuilder.loadTexts: diffServAlgDropHCPkts.setDescription('The number of packets that have been dropped by this drop process. This object should be used on high speed interfaces. Discontinuities in the value of this counter can occur at re- initialization of the management system and at other times as indicated by the value of ifCounterDiscontinuityTime appropriate to this interface.') diff_serv_alg_drop_status = mib_table_column((1, 3, 6, 1, 2, 1, 12345, 2, 8, 1, 12), row_status()).setMaxAccess('readcreate') if mibBuilder.loadTexts: diffServAlgDropStatus.setStatus('current') if mibBuilder.loadTexts: diffServAlgDropStatus.setDescription('The RowStatus variable controls the activation, deactivation, or deletion of this entry. Any writable variable may be modified whether the row is active or notInService.') diff_serv_alg_drop_next_free = mib_scalar((1, 3, 6, 1, 2, 1, 12345, 1, 7), unsigned32()).setMaxAccess('readonly') if mibBuilder.loadTexts: diffServAlgDropNextFree.setStatus('current') if mibBuilder.loadTexts: diffServAlgDropNextFree.setDescription('This object yields a value when read that is currently-unused for a diffServAlgDropId instance. If a configuring system attempts to create a new row in the diffServAlgDropTable using this value, that operation will fail if the value has, in the meantime, been used to create another row that is currently valid.') diff_serv_random_drop_table = mib_table((1, 3, 6, 1, 2, 1, 12345, 2, 9)) if mibBuilder.loadTexts: diffServRandomDropTable.setReference('[MODEL] section 7.1.3') if mibBuilder.loadTexts: diffServRandomDropTable.setStatus('current') if mibBuilder.loadTexts: diffServRandomDropTable.setDescription('The random drop table augments the algorithmic drop table. It contains entries describing a process that drops packets randomly. This table is intended to be pointed to by the associated diffServAlgDropSpecific in such cases.') diff_serv_random_drop_entry = mib_table_row((1, 3, 6, 1, 2, 1, 12345, 2, 9, 1)).setIndexNames((0, 'IF-MIB', 'ifIndex'), (0, 'DIFF-SERV-MIB', 'diffServAlgDropIfDirection'), (0, 'DIFF-SERV-MIB', 'diffServAlgDropId')) if mibBuilder.loadTexts: diffServRandomDropEntry.setStatus('current') if mibBuilder.loadTexts: diffServRandomDropEntry.setDescription('An entry describes a process that drops packets according to a random algorithm. Entries in this table share indexing with a parent diffServAlgDropEntry although they must be managed (e.g. created/deleted) by explicit management action, independently of the associated value of diffServAlgDropSpecific.') diff_serv_random_drop_min_thresh_bytes = mib_table_column((1, 3, 6, 1, 2, 1, 12345, 2, 9, 1, 1), unsigned32()).setUnits('bytes').setMaxAccess('readcreate') if mibBuilder.loadTexts: diffServRandomDropMinThreshBytes.setStatus('current') if mibBuilder.loadTexts: diffServRandomDropMinThreshBytes.setDescription('The average queue depth in bytes, beyond which traffic has a non-zero probability of being dropped. Changes in this variable may or may not be reflected in the reported value of diffServRandomDropMinThreshPkts.') diff_serv_random_drop_min_thresh_pkts = mib_table_column((1, 3, 6, 1, 2, 1, 12345, 2, 9, 1, 2), unsigned32()).setUnits('packets').setMaxAccess('readcreate') if mibBuilder.loadTexts: diffServRandomDropMinThreshPkts.setStatus('current') if mibBuilder.loadTexts: diffServRandomDropMinThreshPkts.setDescription('The average queue depth in packets, beyond which traffic has a non-zero probability of being dropped. Changes in this variable may or may not be reflected in the reported value of diffServRandomDropMinThreshBytes.') diff_serv_random_drop_max_thresh_bytes = mib_table_column((1, 3, 6, 1, 2, 1, 12345, 2, 9, 1, 3), unsigned32()).setUnits('bytes').setMaxAccess('readcreate') if mibBuilder.loadTexts: diffServRandomDropMaxThreshBytes.setStatus('current') if mibBuilder.loadTexts: diffServRandomDropMaxThreshBytes.setDescription('The average queue depth beyond which traffic has a probability indicated by diffServRandomDropInvMaxProb of being dropped or marked. Note that this differs from the physical queue limit, which is stored in diffServAlgDropQThreshold. Changes in this variable may or may not be reflected in the reported value of diffServRandomDropMaxThreshPkts.') diff_serv_random_drop_max_thresh_pkts = mib_table_column((1, 3, 6, 1, 2, 1, 12345, 2, 9, 1, 4), unsigned32()).setUnits('packets').setMaxAccess('readcreate') if mibBuilder.loadTexts: diffServRandomDropMaxThreshPkts.setStatus('current') if mibBuilder.loadTexts: diffServRandomDropMaxThreshPkts.setDescription('The average queue depth beyond which traffic has a probability indicated by diffServRandomDropInvMaxProb of being dropped or marked. Note that this differs from the physical queue limit, which is stored in diffServAlgDropQThreshold. Changes in this variable may or may not be reflected in the reported value of diffServRandomDropMaxThreshBytes.') diff_serv_random_drop_inv_weight = mib_table_column((1, 3, 6, 1, 2, 1, 12345, 2, 9, 1, 5), unsigned32()).setMaxAccess('readcreate') if mibBuilder.loadTexts: diffServRandomDropInvWeight.setStatus('current') if mibBuilder.loadTexts: diffServRandomDropInvWeight.setDescription('The weighting of past history in affecting the calculation of the current queue average. The moving average of the queue depth uses the inverse of this value as the factor for the new queue depth, and one minus that inverse as the factor for the historical average. Implementations may choose to limit the acceptable set of values to a specified set, such as powers of 2.') diff_serv_random_drop_prob_max = mib_table_column((1, 3, 6, 1, 2, 1, 12345, 2, 9, 1, 6), unsigned32()).setMaxAccess('readcreate') if mibBuilder.loadTexts: diffServRandomDropProbMax.setStatus('current') if mibBuilder.loadTexts: diffServRandomDropProbMax.setDescription('The worst case random drop probability, expressed in drops per thousand packets. For example, if every packet may be dropped in the worst case (100%), this has the value 1000. Alternatively, if in the worst case one percent (1%) of traffic may be dropped, it has the value 10.') diff_serv_random_drop_status = mib_table_column((1, 3, 6, 1, 2, 1, 12345, 2, 9, 1, 7), row_status()).setMaxAccess('readcreate') if mibBuilder.loadTexts: diffServRandomDropStatus.setStatus('current') if mibBuilder.loadTexts: diffServRandomDropStatus.setDescription('The RowStatus variable controls the activation, deactivation, or deletion of this entry. Any writable variable may be modified whether the row is active or notInService.') diff_serv_q_table = mib_table((1, 3, 6, 1, 2, 1, 12345, 2, 10)) if mibBuilder.loadTexts: diffServQTable.setStatus('current') if mibBuilder.loadTexts: diffServQTable.setDescription('The Queue Table enumerates the individual queues on an interface.') diff_serv_q_entry = mib_table_row((1, 3, 6, 1, 2, 1, 12345, 2, 10, 1)).setIndexNames((0, 'IF-MIB', 'ifIndex'), (0, 'DIFF-SERV-MIB', 'diffServQIfDirection'), (0, 'DIFF-SERV-MIB', 'diffServQId')) if mibBuilder.loadTexts: diffServQEntry.setStatus('current') if mibBuilder.loadTexts: diffServQEntry.setDescription('An entry in the Queue Table describes a single queue in one direction on an interface.') diff_serv_q_if_direction = mib_table_column((1, 3, 6, 1, 2, 1, 12345, 2, 10, 1, 1), if_direction()) if mibBuilder.loadTexts: diffServQIfDirection.setStatus('current') if mibBuilder.loadTexts: diffServQIfDirection.setDescription('Specifies the direction for which this queue entry applies on this interface.') diff_serv_q_id = mib_table_column((1, 3, 6, 1, 2, 1, 12345, 2, 10, 1, 2), unsigned32()) if mibBuilder.loadTexts: diffServQId.setStatus('current') if mibBuilder.loadTexts: diffServQId.setDescription('The Queue Id enumerates the Queue entry. Managers should obtain new values for row creation in this table by reading diffServQNextFree.') diff_serv_q_next = mib_table_column((1, 3, 6, 1, 2, 1, 12345, 2, 10, 1, 3), row_pointer()).setMaxAccess('readcreate') if mibBuilder.loadTexts: diffServQNext.setStatus('current') if mibBuilder.loadTexts: diffServQNext.setDescription('The Next pointer indicates the next datapath element to handle the traffic e.g. a scheduler datapath element. If the row pointed to does not exist, the queue element is considered inactive.') diff_serv_q_priority = mib_table_column((1, 3, 6, 1, 2, 1, 12345, 2, 10, 1, 4), unsigned32()).setMaxAccess('readcreate') if mibBuilder.loadTexts: diffServQPriority.setStatus('current') if mibBuilder.loadTexts: diffServQPriority.setDescription('The priority of this queue, to be used as a parameter to the next scheduler element downstream from this one.') diff_serv_q_min_rate_abs = mib_table_column((1, 3, 6, 1, 2, 1, 12345, 2, 10, 1, 5), unsigned32()).setUnits('kilobits per second').setMaxAccess('readcreate') if mibBuilder.loadTexts: diffServQMinRateAbs.setReference('ifSpeed, ifHighSpeed from [IFMIB]') if mibBuilder.loadTexts: diffServQMinRateAbs.setStatus('current') if mibBuilder.loadTexts: diffServQMinRateAbs.setDescription("The minimum absolute rate, in kilobits/sec, that a downstream scheduler element should allocate to this queue. If the value is zero, then there is effectively no minimum rate guarantee. If the value is non-zero, the scheduler will assure the servicing of this queue to at least this rate. Note that this attribute's value is coupled to that of diffServQMinRateRel: changes to one will affect the value of the other. They are linked by the following equation: diffServQMinRateRel = diffServQMinRateAbs * 10,000,000/ifSpeed or, if appropriate: diffServQMinRateRel = diffServQMinRateAbs * 10 / ifHighSpeed") diff_serv_q_min_rate_rel = mib_table_column((1, 3, 6, 1, 2, 1, 12345, 2, 10, 1, 6), unsigned32()).setMaxAccess('readcreate') if mibBuilder.loadTexts: diffServQMinRateRel.setReference('ifSpeed, ifHighSpeed from [IFMIB]') if mibBuilder.loadTexts: diffServQMinRateRel.setStatus('current') if mibBuilder.loadTexts: diffServQMinRateRel.setDescription("The minimum rate that a downstream scheduler element should allocate to this queue, relative to the maximum rate of the interface as reported by ifSpeed or ifHighSpeed, in units of 1/10,000 of 1. If the value is zero, then there is effectively no minimum rate guarantee. If the value is non-zero, the scheduler will assure the servicing of this queue to at least this rate. Note that this attribute's value is coupled to that of diffServQMinRateAbs: changes to one will affect the value of the other. They are linked by the following equation: diffServQMinRateAbs = ifSpeed * diffServQMinRateRel/10,000,000 or, if appropriate: diffServQMinRateAbs = ifHighSpeed * diffServQMinRateRel / 10") diff_serv_q_max_rate_abs = mib_table_column((1, 3, 6, 1, 2, 1, 12345, 2, 10, 1, 7), unsigned32()).setUnits('kilobits per second').setMaxAccess('readcreate') if mibBuilder.loadTexts: diffServQMaxRateAbs.setReference('ifSpeed, ifHighSpeed from [IFMIB]') if mibBuilder.loadTexts: diffServQMaxRateAbs.setStatus('current') if mibBuilder.loadTexts: diffServQMaxRateAbs.setDescription("The maximum rate in kilobits/sec that a downstream scheduler element should allocate to this queue. If the value is zero, then there is effectively no maximum rate limit and that the scheduler should attempt to be work-conserving for this queue. If the value is non-zero, the scheduler will limit the servicing of this queue to, at most, this rate in a non-work-conserving manner. Note that this attribute's value is coupled to that of diffServQMaxRateRel: changes to one will affect the value of the other. They are linked by the following equation: diffServQMaxRateRel = diffServQMaxRateAbs * 10,000,000/ifSpeed or, if appropriate: diffServQMaxRateRel = diffServQMaxRateAbs * 10 / ifHighSpeed") diff_serv_q_max_rate_rel = mib_table_column((1, 3, 6, 1, 2, 1, 12345, 2, 10, 1, 8), unsigned32()).setMaxAccess('readcreate') if mibBuilder.loadTexts: diffServQMaxRateRel.setReference('ifSpeed, ifHighSpeed from [IFMIB]') if mibBuilder.loadTexts: diffServQMaxRateRel.setStatus('current') if mibBuilder.loadTexts: diffServQMaxRateRel.setDescription("The maximum rate that a downstream scheduler element should allocate to this queue, relative to the maximum rate of the interface as reported by ifSpeed or ifHighSpeed, in units of 1/10,000 of 1. If the value is zero, then there is effectively no maximum rate limit and the scheduler should attempt to be work-conserving for this queue. If the value is non-zero, the scheduler will limit the servicing of this queue to, at most, this rate in a non-work-conserving manner. Note that this attribute's value is coupled to that of diffServQMaxRateAbs: changes to one will affect the value of the other. They are linked by the following equation: diffServQMaxRateAbs = ifSpeed * diffServQMaxRateRel/10,000,000 or, if appropriate: diffServQMaxRateAbs = ifHighSpeed * diffServQMaxRateRel / 10") diff_serv_q_status = mib_table_column((1, 3, 6, 1, 2, 1, 12345, 2, 10, 1, 9), row_status()).setMaxAccess('readcreate') if mibBuilder.loadTexts: diffServQStatus.setStatus('current') if mibBuilder.loadTexts: diffServQStatus.setDescription('The RowStatus variable controls the activation, deactivation, or deletion of a queue. Any writable variable may be modified whether the row is active or notInService.') diff_serv_q_next_free = mib_scalar((1, 3, 6, 1, 2, 1, 12345, 1, 8), unsigned32()).setMaxAccess('readonly') if mibBuilder.loadTexts: diffServQNextFree.setStatus('current') if mibBuilder.loadTexts: diffServQNextFree.setDescription('This object yields a value when read that is currently-unused for a diffServQId instance. If a configuring system attempts to create a new row in the diffServQTable using this value, that operation will fail if the value has, in the meantime, been used to create another row that is currently valid.') diff_serv_scheduler_table = mib_table((1, 3, 6, 1, 2, 1, 12345, 2, 11)) if mibBuilder.loadTexts: diffServSchedulerTable.setReference('[MODEL] section 7.1.2') if mibBuilder.loadTexts: diffServSchedulerTable.setStatus('current') if mibBuilder.loadTexts: diffServSchedulerTable.setDescription('The Scheduler Table enumerates packet schedulers. Multiple scheduling algorithms can be used on a given interface, with each algorithm described by one diffServSchedulerEntry.') diff_serv_scheduler_entry = mib_table_row((1, 3, 6, 1, 2, 1, 12345, 2, 11, 1)).setIndexNames((0, 'IF-MIB', 'ifIndex'), (0, 'DIFF-SERV-MIB', 'diffServSchedulerIfDirection'), (0, 'DIFF-SERV-MIB', 'diffServSchedulerId')) if mibBuilder.loadTexts: diffServSchedulerEntry.setStatus('current') if mibBuilder.loadTexts: diffServSchedulerEntry.setDescription('An entry in the Scheduler Table describing a single instance of a scheduling algorithm.') diff_serv_scheduler_if_direction = mib_table_column((1, 3, 6, 1, 2, 1, 12345, 2, 11, 1, 1), if_direction()) if mibBuilder.loadTexts: diffServSchedulerIfDirection.setStatus('current') if mibBuilder.loadTexts: diffServSchedulerIfDirection.setDescription('Specifies the direction for which this scheduler entry applies on this interface.') diff_serv_scheduler_id = mib_table_column((1, 3, 6, 1, 2, 1, 12345, 2, 11, 1, 2), unsigned32()) if mibBuilder.loadTexts: diffServSchedulerId.setStatus('current') if mibBuilder.loadTexts: diffServSchedulerId.setDescription('This identifies the scheduler entry. Managers should obtain new values for row creation in this table by reading diffServSchedulerNextFree.') diff_serv_scheduler_method = mib_table_column((1, 3, 6, 1, 2, 1, 12345, 2, 11, 1, 3), integer32().subtype(subtypeSpec=constraints_union(single_value_constraint(1, 2, 3))).clone(namedValues=named_values(('other', 1), ('priorityq', 2), ('wrr', 3)))).setMaxAccess('readcreate') if mibBuilder.loadTexts: diffServSchedulerMethod.setReference('[MODEL] section 7.1.2') if mibBuilder.loadTexts: diffServSchedulerMethod.setStatus('current') if mibBuilder.loadTexts: diffServSchedulerMethod.setDescription('The scheduling algorithm used by this Scheduler. A value of priorityq(2) is used to indicate strict priority queueing: only the diffServQPriority attributes of the queues feeding this scheduler are used when determining the next packet to schedule. A value of wrr(3) indicates weighted round-robin scheduling. Packets are scheduled from each of the queues feeding this scheduler according to all of the parameters of the diffServQueue entry.') diff_serv_scheduler_next = mib_table_column((1, 3, 6, 1, 2, 1, 12345, 2, 11, 1, 4), row_pointer().clone((0, 0))).setMaxAccess('readcreate') if mibBuilder.loadTexts: diffServSchedulerNext.setStatus('current') if mibBuilder.loadTexts: diffServSchedulerNext.setDescription('Selects the next data path component, which can be another scheduler or other TC elements. One usage of multiple scheduler elements in series is for Class Base Queueing (CBQ). The value zeroDotZero in this variable indicates no further DiffServ treatment is performed on this flow by the current interface for this interface direction. For example, for an inbound interface the value zeroDotZero indicates that the packet flow has now completed inbound DiffServ treatment and should be forwarded on to the appropriate outbound interface. If the row pointed to does not exist, the scheduler element is considered inactive.') diff_serv_scheduler_status = mib_table_column((1, 3, 6, 1, 2, 1, 12345, 2, 11, 1, 5), row_status()).setMaxAccess('readcreate') if mibBuilder.loadTexts: diffServSchedulerStatus.setStatus('current') if mibBuilder.loadTexts: diffServSchedulerStatus.setDescription('The RowStatus variable controls the activation, deactivation, or deletion of a queue. Any writable variable may be modified whether the row is active or notInService.') diff_serv_scheduler_next_free = mib_scalar((1, 3, 6, 1, 2, 1, 12345, 1, 9), unsigned32()).setMaxAccess('readonly') if mibBuilder.loadTexts: diffServSchedulerNextFree.setStatus('current') if mibBuilder.loadTexts: diffServSchedulerNextFree.setDescription('This object yields a value when read that is currently-unused for a diffServSchedulerId instance. If a configuring system attempts to create a new row in the diffServSchedulerTable using this value, that operation will fail if the value has, in the meantime, been used to create another row that is currently valid.') diff_serv_mib_compliances = mib_identifier((1, 3, 6, 1, 2, 1, 12345, 3, 1)) diff_serv_mib_groups = mib_identifier((1, 3, 6, 1, 2, 1, 12345, 3, 2)) diff_serv_mib_compliance = module_compliance((1, 3, 6, 1, 2, 1, 12345, 3, 1, 1)).setObjects(('DIFF-SERV-MIB', 'diffServMIBClassifierGroup'), ('DIFF-SERV-MIB', 'diffServMIBSixTupleClfrGroup'), ('DIFF-SERV-MIB', 'diffServMIBActionGroup'), ('DIFF-SERV-MIB', 'diffServMIBAlgDropGroup'), ('DIFF-SERV-MIB', 'diffServMIBQueueGroup'), ('DIFF-SERV-MIB', 'diffServMIBSchedulerGroup'), ('DIFF-SERV-MIB', 'diffServMIBCounterGroup'), ('DIFF-SERV-MIB', 'diffServMIBHCCounterGroup'), ('DIFF-SERV-MIB', 'diffServMIBVHCCounterGroup'), ('DIFF-SERV-MIB', 'diffServMIBMeterGroup'), ('DIFF-SERV-MIB', 'diffServMIBTokenBucketMeterGroup'), ('DIFF-SERV-MIB', 'diffServMIBDscpMarkActionGroup'), ('DIFF-SERV-MIB', 'diffServMIBRandomDropGroup'), ('DIFF-SERV-MIB', 'diffServMIBStaticGroup')) if getattr(mibBuilder, 'version', (0, 0, 0)) > (4, 4, 0): diff_serv_mib_compliance = diffServMIBCompliance.setStatus('current') if mibBuilder.loadTexts: diffServMIBCompliance.setDescription('This MIB may be implemented as a read-only or as a read-create MIB. As a result, it may be used for monitoring or for configuration.') diff_serv_mib_classifier_group = object_group((1, 3, 6, 1, 2, 1, 12345, 3, 2, 1)).setObjects(('DIFF-SERV-MIB', 'diffServClassifierFilter'), ('DIFF-SERV-MIB', 'diffServClassifierNext'), ('DIFF-SERV-MIB', 'diffServClassifierPrecedence'), ('DIFF-SERV-MIB', 'diffServClassifierStatus')) if getattr(mibBuilder, 'version', (0, 0, 0)) > (4, 4, 0): diff_serv_mib_classifier_group = diffServMIBClassifierGroup.setStatus('current') if mibBuilder.loadTexts: diffServMIBClassifierGroup.setDescription('The Classifier Group defines the MIB Objects that describe a generic classifier element.') diff_serv_mib_six_tuple_clfr_group = object_group((1, 3, 6, 1, 2, 1, 12345, 3, 2, 2)).setObjects(('DIFF-SERV-MIB', 'diffServSixTupleClfrDstAddrType'), ('DIFF-SERV-MIB', 'diffServSixTupleClfrDstAddr'), ('DIFF-SERV-MIB', 'diffServSixTupleClfrDstAddrMask'), ('DIFF-SERV-MIB', 'diffServSixTupleClfrDstAddrType'), ('DIFF-SERV-MIB', 'diffServSixTupleClfrSrcAddrType'), ('DIFF-SERV-MIB', 'diffServSixTupleClfrSrcAddrMask'), ('DIFF-SERV-MIB', 'diffServSixTupleClfrDscp'), ('DIFF-SERV-MIB', 'diffServSixTupleClfrProtocol'), ('DIFF-SERV-MIB', 'diffServSixTupleClfrDstL4PortMin'), ('DIFF-SERV-MIB', 'diffServSixTupleClfrDstL4PortMax'), ('DIFF-SERV-MIB', 'diffServSixTupleClfrSrcL4PortMin'), ('DIFF-SERV-MIB', 'diffServSixTupleClfrSrcL4PortMax'), ('DIFF-SERV-MIB', 'diffServSixTupleClfrStatus')) if getattr(mibBuilder, 'version', (0, 0, 0)) > (4, 4, 0): diff_serv_mib_six_tuple_clfr_group = diffServMIBSixTupleClfrGroup.setStatus('current') if mibBuilder.loadTexts: diffServMIBSixTupleClfrGroup.setDescription('The Six-tuple Classifier Group defines the MIB Objects that describe a classifier element for matching on 6 fields of an IP and upper-layer protocol header.') diff_serv_mib_meter_group = object_group((1, 3, 6, 1, 2, 1, 12345, 3, 2, 3)).setObjects(('DIFF-SERV-MIB', 'diffServMeterSucceedNext'), ('DIFF-SERV-MIB', 'diffServMeterFailNext'), ('DIFF-SERV-MIB', 'diffServMeterSpecific'), ('DIFF-SERV-MIB', 'diffServMeterStatus')) if getattr(mibBuilder, 'version', (0, 0, 0)) > (4, 4, 0): diff_serv_mib_meter_group = diffServMIBMeterGroup.setStatus('current') if mibBuilder.loadTexts: diffServMIBMeterGroup.setDescription('The Meter Group defines the objects used in describing a generic meter element.') diff_serv_mib_token_bucket_meter_group = object_group((1, 3, 6, 1, 2, 1, 12345, 3, 2, 4)).setObjects(('DIFF-SERV-MIB', 'diffServTBMeterRate'), ('DIFF-SERV-MIB', 'diffServTBMeterBurstSize'), ('DIFF-SERV-MIB', 'diffServTBMeterStatus')) if getattr(mibBuilder, 'version', (0, 0, 0)) > (4, 4, 0): diff_serv_mib_token_bucket_meter_group = diffServMIBTokenBucketMeterGroup.setStatus('current') if mibBuilder.loadTexts: diffServMIBTokenBucketMeterGroup.setDescription('The Token-Bucket Meter Group defines the objects used in describing a single-rate token bucket meter element.') diff_serv_mib_action_group = object_group((1, 3, 6, 1, 2, 1, 12345, 3, 2, 5)).setObjects(('DIFF-SERV-MIB', 'diffServActionNext'), ('DIFF-SERV-MIB', 'diffServActionSpecific'), ('DIFF-SERV-MIB', 'diffServActionStatus')) if getattr(mibBuilder, 'version', (0, 0, 0)) > (4, 4, 0): diff_serv_mib_action_group = diffServMIBActionGroup.setStatus('current') if mibBuilder.loadTexts: diffServMIBActionGroup.setDescription('The Action Group defines the objects used in describing a generic action element.') diff_serv_mib_dscp_mark_action_group = object_group((1, 3, 6, 1, 2, 1, 12345, 3, 2, 6)).setObjects(('DIFF-SERV-MIB', 'diffServDscpMarkActDscp')) if getattr(mibBuilder, 'version', (0, 0, 0)) > (4, 4, 0): diff_serv_mib_dscp_mark_action_group = diffServMIBDscpMarkActionGroup.setStatus('current') if mibBuilder.loadTexts: diffServMIBDscpMarkActionGroup.setDescription('The DSCP Mark Action Group defines the objects used in describing a DSCP Marking Action element.') diff_serv_mib_counter_group = object_group((1, 3, 6, 1, 2, 1, 12345, 3, 2, 7)).setObjects(('DIFF-SERV-MIB', 'diffServCountActOctets'), ('DIFF-SERV-MIB', 'diffServCountActPkts'), ('DIFF-SERV-MIB', 'diffServCountActStatus'), ('DIFF-SERV-MIB', 'diffServAlgDropOctets'), ('DIFF-SERV-MIB', 'diffServAlgDropPkts')) if getattr(mibBuilder, 'version', (0, 0, 0)) > (4, 4, 0): diff_serv_mib_counter_group = diffServMIBCounterGroup.setStatus('current') if mibBuilder.loadTexts: diffServMIBCounterGroup.setDescription('A collection of objects providing information specific to non- high speed (non-high speed interfaces transmit and receive at speeds less than or equal to 20,000,000 bits/second) packet- oriented network interfaces.') diff_serv_mibhc_counter_group = object_group((1, 3, 6, 1, 2, 1, 12345, 3, 2, 8)).setObjects(('DIFF-SERV-MIB', 'diffServCountActOctets'), ('DIFF-SERV-MIB', 'diffServCountActHCOctets'), ('DIFF-SERV-MIB', 'diffServCountActPkts'), ('DIFF-SERV-MIB', 'diffServCountActStatus'), ('DIFF-SERV-MIB', 'diffServAlgDropOctets'), ('DIFF-SERV-MIB', 'diffServAlgDropHCOctets'), ('DIFF-SERV-MIB', 'diffServAlgDropPkts')) if getattr(mibBuilder, 'version', (0, 0, 0)) > (4, 4, 0): diff_serv_mibhc_counter_group = diffServMIBHCCounterGroup.setStatus('current') if mibBuilder.loadTexts: diffServMIBHCCounterGroup.setDescription('A collection of objects providing information specific to non- high speed (non-high speed interfaces transmit and receive at speeds less than or equal to 20,000,000 bits/second) packet- oriented network interfaces.') diff_serv_mibvhc_counter_group = object_group((1, 3, 6, 1, 2, 1, 12345, 3, 2, 9)).setObjects(('DIFF-SERV-MIB', 'diffServCountActOctets'), ('DIFF-SERV-MIB', 'diffServCountActHCOctets'), ('DIFF-SERV-MIB', 'diffServCountActPkts'), ('DIFF-SERV-MIB', 'diffServCountActHCPkts'), ('DIFF-SERV-MIB', 'diffServCountActStatus'), ('DIFF-SERV-MIB', 'diffServAlgDropOctets'), ('DIFF-SERV-MIB', 'diffServAlgDropHCOctets'), ('DIFF-SERV-MIB', 'diffServAlgDropPkts'), ('DIFF-SERV-MIB', 'diffServAlgDropHCPkts')) if getattr(mibBuilder, 'version', (0, 0, 0)) > (4, 4, 0): diff_serv_mibvhc_counter_group = diffServMIBVHCCounterGroup.setStatus('current') if mibBuilder.loadTexts: diffServMIBVHCCounterGroup.setDescription('A collection of objects providing information specific to non- high speed (non-high speed interfaces transmit and receive at speeds less than or equal to 20,000,000 bits/second) packet- oriented network interfaces.') diff_serv_mib_alg_drop_group = object_group((1, 3, 6, 1, 2, 1, 12345, 3, 2, 10)).setObjects(('DIFF-SERV-MIB', 'diffServAlgDropType'), ('DIFF-SERV-MIB', 'diffServAlgDropNext'), ('DIFF-SERV-MIB', 'diffServAlgDropQMeasure'), ('DIFF-SERV-MIB', 'diffServAlgDropQThreshold'), ('DIFF-SERV-MIB', 'diffServAlgDropSpecific'), ('DIFF-SERV-MIB', 'diffServAlgDropStatus')) if getattr(mibBuilder, 'version', (0, 0, 0)) > (4, 4, 0): diff_serv_mib_alg_drop_group = diffServMIBAlgDropGroup.setStatus('current') if mibBuilder.loadTexts: diffServMIBAlgDropGroup.setDescription('The Algorithmic Drop Group contains the objects that describe algorithmic dropper operation and configuration.') diff_serv_mib_random_drop_group = object_group((1, 3, 6, 1, 2, 1, 12345, 3, 2, 11)).setObjects(('DIFF-SERV-MIB', 'diffServRandomDropMinThreshBytes'), ('DIFF-SERV-MIB', 'diffServRandomDropMinThreshPkts'), ('DIFF-SERV-MIB', 'diffServRandomDropMaxThreshBytes'), ('DIFF-SERV-MIB', 'diffServRandomDropMaxThreshPkts'), ('DIFF-SERV-MIB', 'diffServRandomDropInvWeight'), ('DIFF-SERV-MIB', 'diffServRandomDropProbMax'), ('DIFF-SERV-MIB', 'diffServRandomDropStatus')) if getattr(mibBuilder, 'version', (0, 0, 0)) > (4, 4, 0): diff_serv_mib_random_drop_group = diffServMIBRandomDropGroup.setStatus('current') if mibBuilder.loadTexts: diffServMIBRandomDropGroup.setDescription('The Random Drop Group augments the Algorithmic Drop Group for random dropper operation and configuration.') diff_serv_mib_queue_group = object_group((1, 3, 6, 1, 2, 1, 12345, 3, 2, 12)).setObjects(('DIFF-SERV-MIB', 'diffServQPriority'), ('DIFF-SERV-MIB', 'diffServQNext'), ('DIFF-SERV-MIB', 'diffServQMinRateAbs'), ('DIFF-SERV-MIB', 'diffServQMinRateRel'), ('DIFF-SERV-MIB', 'diffServQMaxRateAbs'), ('DIFF-SERV-MIB', 'diffServQMaxRateRel'), ('DIFF-SERV-MIB', 'diffServQStatus')) if getattr(mibBuilder, 'version', (0, 0, 0)) > (4, 4, 0): diff_serv_mib_queue_group = diffServMIBQueueGroup.setStatus('current') if mibBuilder.loadTexts: diffServMIBQueueGroup.setDescription("The Queue Group contains the objects that describe an interface's queues.") diff_serv_mib_scheduler_group = object_group((1, 3, 6, 1, 2, 1, 12345, 3, 2, 13)).setObjects(('DIFF-SERV-MIB', 'diffServSchedulerMethod'), ('DIFF-SERV-MIB', 'diffServSchedulerNext'), ('DIFF-SERV-MIB', 'diffServSchedulerStatus')) if getattr(mibBuilder, 'version', (0, 0, 0)) > (4, 4, 0): diff_serv_mib_scheduler_group = diffServMIBSchedulerGroup.setStatus('current') if mibBuilder.loadTexts: diffServMIBSchedulerGroup.setDescription('The Scheduler Group contains the objects that describe packet schedulers on interfaces.') diff_serv_mib_static_group = object_group((1, 3, 6, 1, 2, 1, 12345, 3, 2, 14)).setObjects(('DIFF-SERV-MIB', 'diffServClassifierNextFree'), ('DIFF-SERV-MIB', 'diffServSixTupleClfrNextFree'), ('DIFF-SERV-MIB', 'diffServMeterNextFree'), ('DIFF-SERV-MIB', 'diffServActionNextFree'), ('DIFF-SERV-MIB', 'diffServAlgDropNextFree'), ('DIFF-SERV-MIB', 'diffServQNextFree'), ('DIFF-SERV-MIB', 'diffServSchedulerNextFree')) if getattr(mibBuilder, 'version', (0, 0, 0)) > (4, 4, 0): diff_serv_mib_static_group = diffServMIBStaticGroup.setStatus('current') if mibBuilder.loadTexts: diffServMIBStaticGroup.setDescription('The Static Group contains readable scalar objects used in creating unique identifiers for classifiers, meters, actions and queues. These are required whenever row creation operations on such tables are supported.') mibBuilder.exportSymbols('DIFF-SERV-MIB', diffServMeterId=diffServMeterId, diffServClassifierStatus=diffServClassifierStatus, diffServClassifierId=diffServClassifierId, diffServCountActHCPkts=diffServCountActHCPkts, diffServMeterSucceedNext=diffServMeterSucceedNext, diffServTBMeterStatus=diffServTBMeterStatus, diffServAlgDropQMeasure=diffServAlgDropQMeasure, diffServQMaxRateRel=diffServQMaxRateRel, diffServSixTupleClfrNextFree=diffServSixTupleClfrNextFree, diffServCountActPkts=diffServCountActPkts, diffServSixTupleClfrDstL4PortMin=diffServSixTupleClfrDstL4PortMin, diffServSixTupleClfrSrcAddrMask=diffServSixTupleClfrSrcAddrMask, diffServRandomDropMaxThreshPkts=diffServRandomDropMaxThreshPkts, diffServMIBHCCounterGroup=diffServMIBHCCounterGroup, diffServRandomDropMinThreshBytes=diffServRandomDropMinThreshBytes, diffServMIBSixTupleClfrGroup=diffServMIBSixTupleClfrGroup, diffServActionId=diffServActionId, diffServQNextFree=diffServQNextFree, diffServCountActHCOctets=diffServCountActHCOctets, diffServCountActOctets=diffServCountActOctets, diffServClassifierNextFree=diffServClassifierNextFree, diffServAlgDropId=diffServAlgDropId, diffServQPriority=diffServQPriority, diffServTBMeterRate=diffServTBMeterRate, diffServSixTupleClfrTable=diffServSixTupleClfrTable, PYSNMP_MODULE_ID=diffServMib, diffServCountActDiscontTime=diffServCountActDiscontTime, diffServQMaxRateAbs=diffServQMaxRateAbs, diffServSixTupleClfrDstAddr=diffServSixTupleClfrDstAddr, diffServSchedulerEntry=diffServSchedulerEntry, diffServDscpMarkActEntry=diffServDscpMarkActEntry, diffServRandomDropMaxThreshBytes=diffServRandomDropMaxThreshBytes, diffServSixTupleClfrDstAddrType=diffServSixTupleClfrDstAddrType, diffServSixTupleClfrEntry=diffServSixTupleClfrEntry, diffServSchedulerNextFree=diffServSchedulerNextFree, diffServMIBCounterGroup=diffServMIBCounterGroup, diffServSixTupleClfrDstL4PortMax=diffServSixTupleClfrDstL4PortMax, diffServAlgDropPkts=diffServAlgDropPkts, diffServMIBVHCCounterGroup=diffServMIBVHCCounterGroup, diffServSixTupleClfrSrcAddr=diffServSixTupleClfrSrcAddr, diffServMIBActionGroup=diffServMIBActionGroup, diffServAlgDropSpecific=diffServAlgDropSpecific, diffServQMinRateRel=diffServQMinRateRel, diffServMIBGroups=diffServMIBGroups, diffServSchedulerTable=diffServSchedulerTable, diffServObjects=diffServObjects, diffServSixTupleClfrSrcL4PortMax=diffServSixTupleClfrSrcL4PortMax, diffServAlgDropTable=diffServAlgDropTable, diffServClassifierEntry=diffServClassifierEntry, diffServClassifierFilter=diffServClassifierFilter, diffServRandomDropStatus=diffServRandomDropStatus, IfDirection=IfDirection, diffServAlgDropOctets=diffServAlgDropOctets, diffServActionTable=diffServActionTable, diffServAlgDropHCOctets=diffServAlgDropHCOctets, diffServSchedulerIfDirection=diffServSchedulerIfDirection, diffServRandomDropProbMax=diffServRandomDropProbMax, diffServMIBConformance=diffServMIBConformance, diffServMeterIfDirection=diffServMeterIfDirection, diffServRandomDropMinThreshPkts=diffServRandomDropMinThreshPkts, diffServActionIfDirection=diffServActionIfDirection, diffServQNext=diffServQNext, diffServCountActTable=diffServCountActTable, diffServRandomDropEntry=diffServRandomDropEntry, diffServMIBTokenBucketMeterGroup=diffServMIBTokenBucketMeterGroup, diffServTBMeterTable=diffServTBMeterTable, diffServMIBStaticGroup=diffServMIBStaticGroup, diffServAlgDropNext=diffServAlgDropNext, diffServSchedulerNext=diffServSchedulerNext, diffServMeterStatus=diffServMeterStatus, diffServQMinRateAbs=diffServQMinRateAbs, diffServSixTupleClfrSrcAddrType=diffServSixTupleClfrSrcAddrType, diffServMeterSpecific=diffServMeterSpecific, diffServMIBRandomDropGroup=diffServMIBRandomDropGroup, diffServAlgDropEntry=diffServAlgDropEntry, diffServSchedulerId=diffServSchedulerId, diffServTBMeterEntry=diffServTBMeterEntry, SixTupleClfrL4Port=SixTupleClfrL4Port, diffServClassifierNext=diffServClassifierNext, diffServSchedulerMethod=diffServSchedulerMethod, diffServDscpMarkActTable=diffServDscpMarkActTable, diffServMIBCompliance=diffServMIBCompliance, diffServAlgDropType=diffServAlgDropType, diffServAlgDropQThreshold=diffServAlgDropQThreshold, diffServCountActStatus=diffServCountActStatus, diffServQStatus=diffServQStatus, diffServClassifierIfDirection=diffServClassifierIfDirection, diffServSixTupleClfrDscp=diffServSixTupleClfrDscp, diffServClassifierTable=diffServClassifierTable, diffServSixTupleClfrDstAddrMask=diffServSixTupleClfrDstAddrMask, diffServAlgDropHCPkts=diffServAlgDropHCPkts, diffServMIBDscpMarkActionGroup=diffServMIBDscpMarkActionGroup, diffServSixTupleClfrStatus=diffServSixTupleClfrStatus, diffServMeterTable=diffServMeterTable, diffServActionNext=diffServActionNext, diffServMeterFailNext=diffServMeterFailNext, diffServActionNextFree=diffServActionNextFree, diffServActionStatus=diffServActionStatus, diffServCountActEntry=diffServCountActEntry, diffServRandomDropTable=diffServRandomDropTable, diffServSixTupleClfrSrcL4PortMin=diffServSixTupleClfrSrcL4PortMin, diffServMIBClassifierGroup=diffServMIBClassifierGroup, diffServMIBSchedulerGroup=diffServMIBSchedulerGroup, diffServClassifierPrecedence=diffServClassifierPrecedence, diffServRandomDropInvWeight=diffServRandomDropInvWeight, diffServMIBAlgDropGroup=diffServMIBAlgDropGroup, diffServSchedulerStatus=diffServSchedulerStatus, diffServQIfDirection=diffServQIfDirection, diffServMeterNextFree=diffServMeterNextFree, diffServAlgDropNextFree=diffServAlgDropNextFree, diffServDscpMarkActDscp=diffServDscpMarkActDscp, diffServTBMeterBurstSize=diffServTBMeterBurstSize, diffServQTable=diffServQTable, diffServClassifierTcb=diffServClassifierTcb, diffServTables=diffServTables, diffServMIBMeterGroup=diffServMIBMeterGroup, diffServAlgDropIfDirection=diffServAlgDropIfDirection, diffServQId=diffServQId, diffServMIBQueueGroup=diffServMIBQueueGroup, diffServMIBCompliances=diffServMIBCompliances, diffServAbsoluteDropAction=diffServAbsoluteDropAction, diffServMeterEntry=diffServMeterEntry, diffServActionSpecific=diffServActionSpecific, diffServAlgDropStatus=diffServAlgDropStatus, diffServQEntry=diffServQEntry, diffServSixTupleClfrProtocol=diffServSixTupleClfrProtocol, diffServMib=diffServMib, diffServActionEntry=diffServActionEntry, diffServSixTupleClfrId=diffServSixTupleClfrId, Dscp=Dscp)
# 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 hasPathSum(self, root: TreeNode, targetSum: int) -> bool: # return true, if adding up values along path = targetSum # go through each node, if it exists: # subtract value to targetSum # if value is < 0: return if not root: return False targetSum -= root.val # check leaf node if not root.left and not root.right and targetSum == 0: return True return self.hasPathSum(root.left, targetSum) or self.hasPathSum( root.right, targetSum ) # if left is zero, return true. # if right is zero return true
class Solution: def has_path_sum(self, root: TreeNode, targetSum: int) -> bool: if not root: return False target_sum -= root.val if not root.left and (not root.right) and (targetSum == 0): return True return self.hasPathSum(root.left, targetSum) or self.hasPathSum(root.right, targetSum)
USERNAME = 'super.user.1' PASSWORD = 'X!16a99a4e' CONSUMER_KEY = 'f3haancaj0vm4lkx2erk3uwdzy2elz00of513u5w' TOKEN = 'eyJhbGciOiJIUzI1NiJ9.eyIiOiIifQ.Qjz0-kry1Yb7PH0Pw1PbRWrgaqsFYPbac3RHQ-eykk4' # API server URL BASE_URL = "https://openlab.openbankproject.com" API_VERSION = "v3.0.0" CONTENT_JSON = { 'content-type' : 'application/json' } DL_TOKEN = { 'Authorization' : f'DirectLogin token={TOKEN}' } # # API server will redirect your browser to this URL, should be non-functional # # You will paste the redirect location here when running the script # CALLBACK_URI = 'http://127.0.0.1/cb' BANKS = ['hsbc.01.hk.hsbc', 'hsbc.02.hk.hsbc', 'hsbc.01.uk.uk', 'hsbc.02.uk.uk'] # OUR_BANK = 'gh.29.uk' # # Our COUNTERPARTY account id (of the same currency) # OUR_COUNTERPARTY = '8ca8a7e4-6d02-48e3-a029-0b2bf89de9f0' # COUNTERPARTY_BANK = 'gh.29.uk' # # this following two fields are just used in V210 # OUR_COUNTERPARTY_ID = '' # OUR_COUNTERPARTY_IBAN = '' # # Our currency to use # OUR_CURRENCY = 'GBP' # # Our value to transfer # # values below 1000 do not requre challenge request # OUR_VALUE = '0.01' # OUR_VALUE_LARGE = '1000.00'
username = 'super.user.1' password = 'X!16a99a4e' consumer_key = 'f3haancaj0vm4lkx2erk3uwdzy2elz00of513u5w' token = 'eyJhbGciOiJIUzI1NiJ9.eyIiOiIifQ.Qjz0-kry1Yb7PH0Pw1PbRWrgaqsFYPbac3RHQ-eykk4' base_url = 'https://openlab.openbankproject.com' api_version = 'v3.0.0' content_json = {'content-type': 'application/json'} dl_token = {'Authorization': f'DirectLogin token={TOKEN}'} banks = ['hsbc.01.hk.hsbc', 'hsbc.02.hk.hsbc', 'hsbc.01.uk.uk', 'hsbc.02.uk.uk']
class Alerts: def _init_ (self,Alert_Id, Alert_Name, Alert_Code): self.Alert_Id= AlertId self.Alert_Name = Alert_Name self.Alert_Code = Alert_Code
class Alerts: def _init_(self, Alert_Id, Alert_Name, Alert_Code): self.Alert_Id = AlertId self.Alert_Name = Alert_Name self.Alert_Code = Alert_Code
n = int(input('me diga um numero: ')) s = n + 1 a = n - 1 print ('o sucessor de {} e {}'. format(n, s)) print ('o antecessor de {} e {}'.format(n, a))
n = int(input('me diga um numero: ')) s = n + 1 a = n - 1 print('o sucessor de {} e {}'.format(n, s)) print('o antecessor de {} e {}'.format(n, a))
def main(): a = 0 while True: a += 1 if a % 1000 == 0: print(a) if __name__ == "__main__": main()
def main(): a = 0 while True: a += 1 if a % 1000 == 0: print(a) if __name__ == '__main__': main()
def get_words(wordlist, resume=None): with open(wordlist) as f: raw_words = f.read() found_resume = False words = list() for word in raw_words.split(): if resume is not None: if found_resume: words.append(word) else: if word == resume: found_resume = True print(f'Resuming wordlist from: {resume}') else: words.append(word) return words
def get_words(wordlist, resume=None): with open(wordlist) as f: raw_words = f.read() found_resume = False words = list() for word in raw_words.split(): if resume is not None: if found_resume: words.append(word) elif word == resume: found_resume = True print(f'Resuming wordlist from: {resume}') else: words.append(word) return words
def fact(x): if x == 1: return 1 return x * fact(x-1) if __name__=='__main__': print("fact(5) = %s" % fact(5))
def fact(x): if x == 1: return 1 return x * fact(x - 1) if __name__ == '__main__': print('fact(5) = %s' % fact(5))
def extraerDatos(dato): palo = dato[0:1] # Se extrae el primer caracter correspondiente a un palo aux = dato.split(palo) valor = int(aux[1]) # Se extra el valor del caracter if (valor >= 10): # En el envido las cartas de 10 para arriba suman cero valor = 0 return palo, valor def contarEnvido(carta1,carta2,carta3): palo1, aux1 = extraerDatos(carta1) palo2, aux2 = extraerDatos(carta2) palo3, aux3 = extraerDatos(carta3) if ((palo1 == palo2) and (palo2 == palo3)): #print("Flor") # Flor significa que las 3 cartas son del mismo palo suma = 20 + aux1+aux2+aux3 if suma > 33: # La maxima suma que se puede realizar con la flor es 33 auxMax = max([aux1,aux2,aux3]) auxMin = min([aux1,aux2,aux3]) if ((aux1 > auxMin) and (aux1 < auxMax)): suma = 20 + aux1 + auxMax if ((aux2 > auxMin) and (aux2 < auxMax)): suma = 20 + aux2 + auxMax if ((aux3 > auxMin) and (aux3 < auxMax)): suma = 20 + aux3 + auxMax texto = "FLOR. La suma de la flor es: " + str(suma) #print("La suma de la flor es: {}".format(suma)) elif ((palo1 == palo2) and (palo2 != palo3)): suma = 20 + aux1 + aux2 texto = "La suma del envido es: " + str(suma) #print("La suma del envido es: {}".format(suma)) elif ((palo1 == palo3) and (palo1 != palo2)): suma = 20 + aux1 + aux3 texto = "La suma del envido es: " + str(suma) #print("La suma del envido es: {}".format(suma)) elif ((palo2 == palo3) and (palo1 != palo2)): suma = 20 + aux2 + aux3 texto = "La suma del envido es: " + str(suma) #print("La suma del envido es: {}".format(suma)) else: #print("Mentiste. No tenias nada para el envido") suma = max([aux1,aux2,aux3]) texto = "La suma del envido es: " + str(suma) #print("La suma del envido es: {}".format(suma)) return texto
def extraer_datos(dato): palo = dato[0:1] aux = dato.split(palo) valor = int(aux[1]) if valor >= 10: valor = 0 return (palo, valor) def contar_envido(carta1, carta2, carta3): (palo1, aux1) = extraer_datos(carta1) (palo2, aux2) = extraer_datos(carta2) (palo3, aux3) = extraer_datos(carta3) if palo1 == palo2 and palo2 == palo3: suma = 20 + aux1 + aux2 + aux3 if suma > 33: aux_max = max([aux1, aux2, aux3]) aux_min = min([aux1, aux2, aux3]) if aux1 > auxMin and aux1 < auxMax: suma = 20 + aux1 + auxMax if aux2 > auxMin and aux2 < auxMax: suma = 20 + aux2 + auxMax if aux3 > auxMin and aux3 < auxMax: suma = 20 + aux3 + auxMax texto = 'FLOR. La suma de la flor es: ' + str(suma) elif palo1 == palo2 and palo2 != palo3: suma = 20 + aux1 + aux2 texto = 'La suma del envido es: ' + str(suma) elif palo1 == palo3 and palo1 != palo2: suma = 20 + aux1 + aux3 texto = 'La suma del envido es: ' + str(suma) elif palo2 == palo3 and palo1 != palo2: suma = 20 + aux2 + aux3 texto = 'La suma del envido es: ' + str(suma) else: suma = max([aux1, aux2, aux3]) texto = 'La suma del envido es: ' + str(suma) return texto
class Life: def __init__(self, width, height): self.width = width self.height = height self.frame = [[0 for x in range(width)] for y in range(height)] def import_frame(self, fname): with open(fname, 'r') as f: lines = f.readlines() for i, line in enumerate(lines): line_vals = list(map(int, line.split(' '))) self.frame[i] = [line_vals[j] if j < len(line_vals) else self.frame[i][j] for j in range(len(self.frame[i]))] def tick(self): next_gen = [[0 for x in range(self.width)] for y in range(self.height)] f = self.frame for i in range(self.height): for j in range(self.width): u = i - 1 #up d = i + 1 if i + 1 < self.height else 0 #down l = j - 1 #left r = j + 1 if j + 1 < self.width else 0 #right alive_neighbours = f[u][l] + f[u][j] + f[u][r] + f[i][l] + f[i][r] + f[d][l] + f[d][j] + f[d][r] if f[i][j]: if 1 < alive_neighbours < 4: next_gen[i][j] = 1 else: if alive_neighbours == 3: next_gen[i][j] = 1 self.frame = next_gen
class Life: def __init__(self, width, height): self.width = width self.height = height self.frame = [[0 for x in range(width)] for y in range(height)] def import_frame(self, fname): with open(fname, 'r') as f: lines = f.readlines() for (i, line) in enumerate(lines): line_vals = list(map(int, line.split(' '))) self.frame[i] = [line_vals[j] if j < len(line_vals) else self.frame[i][j] for j in range(len(self.frame[i]))] def tick(self): next_gen = [[0 for x in range(self.width)] for y in range(self.height)] f = self.frame for i in range(self.height): for j in range(self.width): u = i - 1 d = i + 1 if i + 1 < self.height else 0 l = j - 1 r = j + 1 if j + 1 < self.width else 0 alive_neighbours = f[u][l] + f[u][j] + f[u][r] + f[i][l] + f[i][r] + f[d][l] + f[d][j] + f[d][r] if f[i][j]: if 1 < alive_neighbours < 4: next_gen[i][j] = 1 elif alive_neighbours == 3: next_gen[i][j] = 1 self.frame = next_gen
class Estadistica: def __init__(self): self.bodega_saladillo = [] self.bodega_saladillo_hora = [] self.bodega_andina = [] self.bodega_andina_hora = [] self.camiones_t2 = [] self.error_bodega = 0 self.barcos_puerto = [] self.ocupacion_trenes = [] def promedios(self): suma1 = 0 suma2 = 0 for n in self.bodega_saladillo_hora: suma1 += n for n in self.bodega_andina_hora: suma2 += n self.bodega_saladillo.append(suma1/len(self.bodega_saladillo_hora)) self.bodega_andina.append(suma2/len(self.bodega_andina_hora)) def ocupacion_trenes_calculo(self, carga): self.ocupacion_trenes.append(carga/740) def nuevo_dia(self, saladillo, andina): self.bodega_saladillo_hora.append(saladillo) self.bodega_andina_hora.append(andina) self.promedios() self.bodega_saladillo_hora = [] self.bodega_andina_hora = [] def nueva_hora(self, saladillo, andina): self.bodega_saladillo_hora.append(saladillo) self.bodega_andina_hora.append(andina) def nuevo_dia_dos(self, andina, saladillo): self.bodega_andina.append(andina) self.bodega_saladillo.append(saladillo) def tramo2(self): self.camiones_t2 += 1 def calculo_error(self, bodega): if bodega > 7500: self.error_bodega += 1 def usando_camiones(self, camiones): self.camiones_t2.append(camiones) def bodega_csv(self): file = open('bodega_saladillo.csv', 'a') for i in self.bodega_saladillo: file.write(","+str(i) + '\n') file.write("-" + '\n') file2 = open('bodega_andina.csv', 'a') for i in self.bodega_andina: file2.write(","+str(i) + '\n') file2.write("-" + '\n') file3 = open('puerto.csv', 'a') for i in self.barcos_puerto: file3.write(";"+str(i) + '\n') file3.write("-" + '\n') file4 = open('tramo2.csv', 'a') for i in self.camiones_t2: file4.write(";"+str(i) + '\n') file4.write("-"+'\n')
class Estadistica: def __init__(self): self.bodega_saladillo = [] self.bodega_saladillo_hora = [] self.bodega_andina = [] self.bodega_andina_hora = [] self.camiones_t2 = [] self.error_bodega = 0 self.barcos_puerto = [] self.ocupacion_trenes = [] def promedios(self): suma1 = 0 suma2 = 0 for n in self.bodega_saladillo_hora: suma1 += n for n in self.bodega_andina_hora: suma2 += n self.bodega_saladillo.append(suma1 / len(self.bodega_saladillo_hora)) self.bodega_andina.append(suma2 / len(self.bodega_andina_hora)) def ocupacion_trenes_calculo(self, carga): self.ocupacion_trenes.append(carga / 740) def nuevo_dia(self, saladillo, andina): self.bodega_saladillo_hora.append(saladillo) self.bodega_andina_hora.append(andina) self.promedios() self.bodega_saladillo_hora = [] self.bodega_andina_hora = [] def nueva_hora(self, saladillo, andina): self.bodega_saladillo_hora.append(saladillo) self.bodega_andina_hora.append(andina) def nuevo_dia_dos(self, andina, saladillo): self.bodega_andina.append(andina) self.bodega_saladillo.append(saladillo) def tramo2(self): self.camiones_t2 += 1 def calculo_error(self, bodega): if bodega > 7500: self.error_bodega += 1 def usando_camiones(self, camiones): self.camiones_t2.append(camiones) def bodega_csv(self): file = open('bodega_saladillo.csv', 'a') for i in self.bodega_saladillo: file.write(',' + str(i) + '\n') file.write('-' + '\n') file2 = open('bodega_andina.csv', 'a') for i in self.bodega_andina: file2.write(',' + str(i) + '\n') file2.write('-' + '\n') file3 = open('puerto.csv', 'a') for i in self.barcos_puerto: file3.write(';' + str(i) + '\n') file3.write('-' + '\n') file4 = open('tramo2.csv', 'a') for i in self.camiones_t2: file4.write(';' + str(i) + '\n') file4.write('-' + '\n')
# Write a program that reads in three strings and sorts them lexicographically. # Enter a string: Charlie # Enter a string: Able # Enter a string: Baker # Able # Baker # Charlie string1 = str(input("Enter a string: ")) string2 = str(input("Enter a string: ")) string3 = str(input("Enter a string: ")) if string1 < string2 and string1 < string3: print(string1) if string2 < string3: print(string2) print(string3) else: print(string3) print(string2) elif string1 > string2 and string2 < string3: print(string2) if string1 < string3: print(string1) print(string3) else: print(string3) print(string1) else: print(string3) if string1 < string2: print(string1) print(string2) else: print(string2) print(string1)
string1 = str(input('Enter a string: ')) string2 = str(input('Enter a string: ')) string3 = str(input('Enter a string: ')) if string1 < string2 and string1 < string3: print(string1) if string2 < string3: print(string2) print(string3) else: print(string3) print(string2) elif string1 > string2 and string2 < string3: print(string2) if string1 < string3: print(string1) print(string3) else: print(string3) print(string1) else: print(string3) if string1 < string2: print(string1) print(string2) else: print(string2) print(string1)
#!/usr/bin/env python #coding: utf-8 class Solution: # @return a boolean def isValid(self, s): stack = [] for x in s: if x == '(' or x == '{' or x == '[': stack.append(x) else: if not stack: return False y = stack.pop() if x == ')' and y != '(': return False if x == ']' and y != '[': return False if x == '}' and y != '{': return False if not stack: return True return False if __name__ == '__main__': s = Solution() assert True == s.isValid('()') assert True == s.isValid('()[]{}') assert False == s.isValid('(]') assert False == s.isValid('([)]')
class Solution: def is_valid(self, s): stack = [] for x in s: if x == '(' or x == '{' or x == '[': stack.append(x) else: if not stack: return False y = stack.pop() if x == ')' and y != '(': return False if x == ']' and y != '[': return False if x == '}' and y != '{': return False if not stack: return True return False if __name__ == '__main__': s = solution() assert True == s.isValid('()') assert True == s.isValid('()[]{}') assert False == s.isValid('(]') assert False == s.isValid('([)]')
def doSubtraction(): a=30 b=20 print(a-b) doSubtraction() #This is Code for Subtraction
def do_subtraction(): a = 30 b = 20 print(a - b) do_subtraction()
o = int(input()) c = -1 for i in range(1000000000000): i = str(i) t = 0 for j in range(len(i)): k = abs(int(i[j - 1]) - int(i[j])) if k > 1: t = 1 break if t: continue c += 1 if c == o: print(i) break
o = int(input()) c = -1 for i in range(1000000000000): i = str(i) t = 0 for j in range(len(i)): k = abs(int(i[j - 1]) - int(i[j])) if k > 1: t = 1 break if t: continue c += 1 if c == o: print(i) break
print('hello world') for item in [1,2,3,4,5,6,'foo','bar','baz']: print('eh') class MyCustomClass(object): arg = None def __init__(arg): self.arg = arg def my_method(self): return self.arg + 1 def more_python(self): return 1 + 1 + 2 def new_method(): return self.arg * arg def asdf_asdf(): return "asdf" def even_more_python(self): return 1 + 3 + 4 @custom_generator def generator_example(n): run = 0 while run < 1000: run = run + 1 yield run @classmethod def get_my_demos_done(): return False @classmethod def more_things(): return True @classmethod def asdfasdfdsa(): return "asdf" def custom_generator(func): return func()
print('hello world') for item in [1, 2, 3, 4, 5, 6, 'foo', 'bar', 'baz']: print('eh') class Mycustomclass(object): arg = None def __init__(arg): self.arg = arg def my_method(self): return self.arg + 1 def more_python(self): return 1 + 1 + 2 def new_method(): return self.arg * arg def asdf_asdf(): return 'asdf' def even_more_python(self): return 1 + 3 + 4 @custom_generator def generator_example(n): run = 0 while run < 1000: run = run + 1 yield run @classmethod def get_my_demos_done(): return False @classmethod def more_things(): return True @classmethod def asdfasdfdsa(): return 'asdf' def custom_generator(func): return func()
class DocumentDocstring: def __init__(self, expression): self._exp = expression self._docstring = expression.value.s def title(self): return self._docstring.split('\n')[0] def body(self): b = [] skipped_lines = 1 for s in self._docstring.split('\n'): if skipped_lines == 0: b.append(s) else: skipped_lines = skipped_lines - 1 return b
class Documentdocstring: def __init__(self, expression): self._exp = expression self._docstring = expression.value.s def title(self): return self._docstring.split('\n')[0] def body(self): b = [] skipped_lines = 1 for s in self._docstring.split('\n'): if skipped_lines == 0: b.append(s) else: skipped_lines = skipped_lines - 1 return b
class Solution: def romanToInt(self, s: str) -> int: res = 0 last = None for d in s: if d == 'M': res += 800 if last == 'C' else 1000 elif d == 'D': res += 300 if last == 'C' else 500 elif d == 'C': res += 80 if last == 'X' else 100 elif d == 'L': res += 30 if last == 'X' else 50 elif d == 'X': res += 8 if last == 'I' else 10 elif d == 'V': res += 3 if last == 'I' else 5 else: # d == 'I' res += 1 last = d return res
class Solution: def roman_to_int(self, s: str) -> int: res = 0 last = None for d in s: if d == 'M': res += 800 if last == 'C' else 1000 elif d == 'D': res += 300 if last == 'C' else 500 elif d == 'C': res += 80 if last == 'X' else 100 elif d == 'L': res += 30 if last == 'X' else 50 elif d == 'X': res += 8 if last == 'I' else 10 elif d == 'V': res += 3 if last == 'I' else 5 else: res += 1 last = d return res
s = 1 valor = soma = 0 for c in range(2, 101): valor = s / c soma += valor print(f'{soma+1:.2f}')
s = 1 valor = soma = 0 for c in range(2, 101): valor = s / c soma += valor print(f'{soma + 1:.2f}')
a = 18 b = 13 print(a-b) # Answer should be 5
a = 18 b = 13 print(a - b)
# Question: https://projecteuler.net/problem=115 M = 50 T = 10**6 DP1 = [] DP2 = [] for i in range(M): DP1.append(1) DP2.append(0) while DP1[-1] + DP2[-1] <= T: DP1_i = DP1[-1] + DP2[-1] DP2_i = DP1[-M] + DP2[-1] DP1.append(DP1_i) DP2.append(DP2_i) print(len(DP1) - 1) # --- # Even better recursive formula # Let DP[N] = DP1[N] + DP2[N] # We have, DP1[N] = DP1[N-1] + DP2[N-1] = DP[N-1] -> DP1[N] = DP[N-1] # and DP2[N-1] = DP[N-1] - DP1[N-1] = DP[N-1] - DP[N-2] # We have DP2[N] = DP1[N-M] + DP2[N-1] = DP[N-M-1] + (DP[N-1] - DP[N-2]) # So, DP[N] = DP1[N] + DP2[N] = DP[N-1] + (DP[N-M-1] + DP[N-1] - DP[N-2]) = 2 * DP[N-1] - DP[N-2] + DP[N-M-1] DP = [] for i in range(M): DP.append(1) DP.append(2) while DP[-1] <= T: DP.append(2 * DP[-1] - DP[-2] + DP[-M-1]) print(len(DP) - 1) assert(DP[-1] == DP1[-1] + DP2[-1])
m = 50 t = 10 ** 6 dp1 = [] dp2 = [] for i in range(M): DP1.append(1) DP2.append(0) while DP1[-1] + DP2[-1] <= T: dp1_i = DP1[-1] + DP2[-1] dp2_i = DP1[-M] + DP2[-1] DP1.append(DP1_i) DP2.append(DP2_i) print(len(DP1) - 1) dp = [] for i in range(M): DP.append(1) DP.append(2) while DP[-1] <= T: DP.append(2 * DP[-1] - DP[-2] + DP[-M - 1]) print(len(DP) - 1) assert DP[-1] == DP1[-1] + DP2[-1]
expected_output = { 'event_num': { 2: { 'event_name': '_wdtimer', 'value': '180' }, } }
expected_output = {'event_num': {2: {'event_name': '_wdtimer', 'value': '180'}}}
d = {}; print(len(d)) d = {'k1':'v1', 'k2':'v2'}; print(len(d)) print(iter(d)) for i in iter(d): print(i)
d = {} print(len(d)) d = {'k1': 'v1', 'k2': 'v2'} print(len(d)) print(iter(d)) for i in iter(d): print(i)
print('===== \033[31mDESAFIO 02\033[m =====') dia = input('Dia = ') mes = input('Mes = ') ano = input('Ano = ') print('Voce nasceu no dia \033[33m{}\033[m de \033[33m{}\033[m de \033[33m{}\033[m. Correto?'.format(dia, mes, ano))
print('===== \x1b[31mDESAFIO 02\x1b[m =====') dia = input('Dia = ') mes = input('Mes = ') ano = input('Ano = ') print('Voce nasceu no dia \x1b[33m{}\x1b[m de \x1b[33m{}\x1b[m de \x1b[33m{}\x1b[m. Correto?'.format(dia, mes, ano))
# # PySNMP MIB module ENVIRONMENT-MIB (http://snmplabs.com/pysmi) # ASN.1 source file:///Users/davwang4/Dev/mibs.snmplabs.com/asn1/ENVIRONMENT-MIB # Produced by pysmi-0.3.4 at Wed May 1 13:05:02 2019 # On host DAVWANG4-M-1475 platform Darwin version 18.5.0 by user davwang4 # Using Python version 3.7.3 (default, Mar 27 2019, 09:23:15) # Integer, ObjectIdentifier, OctetString = mibBuilder.importSymbols("ASN1", "Integer", "ObjectIdentifier", "OctetString") NamedValues, = mibBuilder.importSymbols("ASN1-ENUMERATION", "NamedValues") ValueSizeConstraint, ConstraintsIntersection, ValueRangeConstraint, SingleValueConstraint, ConstraintsUnion = mibBuilder.importSymbols("ASN1-REFINEMENT", "ValueSizeConstraint", "ConstraintsIntersection", "ValueRangeConstraint", "SingleValueConstraint", "ConstraintsUnion") ntEnterpriseDataTasmanMgmt, = mibBuilder.importSymbols("NT-ENTERPRISE-DATA-MIB", "ntEnterpriseDataTasmanMgmt") ModuleCompliance, NotificationGroup = mibBuilder.importSymbols("SNMPv2-CONF", "ModuleCompliance", "NotificationGroup") iso, Counter32, MibScalar, MibTable, MibTableRow, MibTableColumn, Bits, Unsigned32, TimeTicks, ObjectIdentity, IpAddress, MibIdentifier, Counter64, ModuleIdentity, Integer32, Gauge32, NotificationType = mibBuilder.importSymbols("SNMPv2-SMI", "iso", "Counter32", "MibScalar", "MibTable", "MibTableRow", "MibTableColumn", "Bits", "Unsigned32", "TimeTicks", "ObjectIdentity", "IpAddress", "MibIdentifier", "Counter64", "ModuleIdentity", "Integer32", "Gauge32", "NotificationType") TruthValue, TextualConvention, DisplayString = mibBuilder.importSymbols("SNMPv2-TC", "TruthValue", "TextualConvention", "DisplayString") nnenvironmentMib = ModuleIdentity((1, 3, 6, 1, 4, 1, 562, 73, 1, 1, 1, 3)) nnenvironmentMib.setRevisions(('1900-08-18 00:00',)) if getattr(mibBuilder, 'version', (0, 0, 0)) > (4, 4, 0): if mibBuilder.loadTexts: nnenvironmentMib.setRevisionsDescriptions(('Initial version of Environment MIB.',)) if mibBuilder.loadTexts: nnenvironmentMib.setLastUpdated('0008180000Z') if mibBuilder.loadTexts: nnenvironmentMib.setOrganization('Nortel Networks') if mibBuilder.loadTexts: nnenvironmentMib.setContactInfo(' Nortel Networks 8200 Dixie Road Brampton, Ontario L6T 5P6 Canada 1-800-4Nortel www.nortelnetworks.com ') if mibBuilder.loadTexts: nnenvironmentMib.setDescription('') class EnvState(TextualConvention, Integer32): description = 'Represents the state of a device being monitored.' status = 'current' subtypeSpec = Integer32.subtypeSpec + ConstraintsUnion(SingleValueConstraint(1, 2, 3, 4, 5)) namedValues = NamedValues(("normal", 1), ("warning", 2), ("critical", 3), ("fail", 4), ("turned-off", 5)) class EnvInstalled(TextualConvention, Integer32): description = 'Installed flag for power supply.' status = 'current' subtypeSpec = Integer32.subtypeSpec + ConstraintsUnion(SingleValueConstraint(1, 2)) namedValues = NamedValues(("not-installed", 1), ("installed", 2)) class EnvStatus(TextualConvention, Integer32): description = 'Installed flag for power supply.' status = 'current' subtypeSpec = Integer32.subtypeSpec + ConstraintsUnion(SingleValueConstraint(1, 2, 3)) namedValues = NamedValues(("absent", 1), ("failed", 2), ("normal", 3)) class EnvType(TextualConvention, Integer32): description = 'Installed flag for power supply.' status = 'current' subtypeSpec = Integer32.subtypeSpec + ConstraintsUnion(SingleValueConstraint(1, 2, 3, 4)) namedValues = NamedValues(("supply-AC-ONLY", 1), ("supply-AC-PoE", 2), ("supply-DC", 3), ("unknown", 4)) nnenvObjects = MibIdentifier((1, 3, 6, 1, 4, 1, 562, 73, 1, 1, 1, 3, 1)) nnenvNotificationEnables = MibIdentifier((1, 3, 6, 1, 4, 1, 562, 73, 1, 1, 1, 3, 2)) nnenvNotifications = MibIdentifier((1, 3, 6, 1, 4, 1, 562, 73, 1, 1, 1, 3, 3)) nnenvTraps = MibIdentifier((1, 3, 6, 1, 4, 1, 562, 73, 1, 1, 1, 3, 3, 0)) nnenvTempSensorGroup = MibIdentifier((1, 3, 6, 1, 4, 1, 562, 73, 1, 1, 1, 3, 1, 1)) nnenvTempSensorValue = MibScalar((1, 3, 6, 1, 4, 1, 562, 73, 1, 1, 1, 3, 1, 1, 1), Gauge32()).setMaxAccess("readonly") if mibBuilder.loadTexts: nnenvTempSensorValue.setStatus('current') if mibBuilder.loadTexts: nnenvTempSensorValue.setDescription(' The Average value of the temperature sensors. ') nnenvTempSensorState = MibScalar((1, 3, 6, 1, 4, 1, 562, 73, 1, 1, 1, 3, 1, 1, 2), EnvState()).setMaxAccess("readonly") if mibBuilder.loadTexts: nnenvTempSensorState.setStatus('current') if mibBuilder.loadTexts: nnenvTempSensorState.setDescription(' The Average status of the temperature sensors. ') nnenvFanTable = MibTable((1, 3, 6, 1, 4, 1, 562, 73, 1, 1, 1, 3, 1, 2), ) if mibBuilder.loadTexts: nnenvFanTable.setStatus('current') if mibBuilder.loadTexts: nnenvFanTable.setDescription('A list of fan unit entries.') nnenvFanEntry = MibTableRow((1, 3, 6, 1, 4, 1, 562, 73, 1, 1, 1, 3, 1, 2, 1), ).setIndexNames((0, "ENVIRONMENT-MIB", "nnenvFanUnitIndex")) if mibBuilder.loadTexts: nnenvFanEntry.setStatus('current') if mibBuilder.loadTexts: nnenvFanEntry.setDescription('Entry containing information about a fan within the chassis.') nnenvFanUnitIndex = MibTableColumn((1, 3, 6, 1, 4, 1, 562, 73, 1, 1, 1, 3, 1, 2, 1, 1), Integer32().subtype(subtypeSpec=ValueRangeConstraint(0, 1))).setMaxAccess("accessiblefornotify") if mibBuilder.loadTexts: nnenvFanUnitIndex.setStatus('current') if mibBuilder.loadTexts: nnenvFanUnitIndex.setDescription('The index to access an entry in the table. ') nnenvFanState = MibTableColumn((1, 3, 6, 1, 4, 1, 562, 73, 1, 1, 1, 3, 1, 2, 1, 2), EnvState()).setMaxAccess("readonly") if mibBuilder.loadTexts: nnenvFanState.setStatus('current') if mibBuilder.loadTexts: nnenvFanState.setDescription(' The current state of fan 0, normal/fail. ') nnenvPwrsupPowerFailCount = MibScalar((1, 3, 6, 1, 4, 1, 562, 73, 1, 1, 1, 3, 1, 3), Integer32()).setMaxAccess("readonly") if mibBuilder.loadTexts: nnenvPwrsupPowerFailCount.setStatus('current') if mibBuilder.loadTexts: nnenvPwrsupPowerFailCount.setDescription('Number of failures of either power supply since boot-up.') nnenvPwrsupTable = MibTable((1, 3, 6, 1, 4, 1, 562, 73, 1, 1, 1, 3, 1, 4), ) if mibBuilder.loadTexts: nnenvPwrsupTable.setStatus('current') if mibBuilder.loadTexts: nnenvPwrsupTable.setDescription('A list of power supply status information.') nnenvPwrsupEntry = MibTableRow((1, 3, 6, 1, 4, 1, 562, 73, 1, 1, 1, 3, 1, 4, 1), ).setIndexNames((0, "ENVIRONMENT-MIB", "nnenvPwrsupIndex")) if mibBuilder.loadTexts: nnenvPwrsupEntry.setStatus('current') if mibBuilder.loadTexts: nnenvPwrsupEntry.setDescription('Entry containing power supply information.') nnenvPwrsupIndex = MibTableColumn((1, 3, 6, 1, 4, 1, 562, 73, 1, 1, 1, 3, 1, 4, 1, 1), Integer32().subtype(subtypeSpec=ValueRangeConstraint(1, 2))).setMaxAccess("accessiblefornotify") if mibBuilder.loadTexts: nnenvPwrsupIndex.setStatus('current') if mibBuilder.loadTexts: nnenvPwrsupIndex.setDescription('Index to access entry.') nnenvPwrsupInstalled = MibTableColumn((1, 3, 6, 1, 4, 1, 562, 73, 1, 1, 1, 3, 1, 4, 1, 2), EnvInstalled()).setMaxAccess("readonly") if mibBuilder.loadTexts: nnenvPwrsupInstalled.setStatus('current') if mibBuilder.loadTexts: nnenvPwrsupInstalled.setDescription('Power supply installed flag.') nnenvPwrsupStatus = MibTableColumn((1, 3, 6, 1, 4, 1, 562, 73, 1, 1, 1, 3, 1, 4, 1, 3), EnvStatus()).setMaxAccess("readonly") if mibBuilder.loadTexts: nnenvPwrsupStatus.setStatus('current') if mibBuilder.loadTexts: nnenvPwrsupStatus.setDescription('Power supply up/down status.') nnenvPwrsupType = MibTableColumn((1, 3, 6, 1, 4, 1, 562, 73, 1, 1, 1, 3, 1, 4, 1, 4), EnvType()).setMaxAccess("readonly") if mibBuilder.loadTexts: nnenvPwrsupType.setStatus('current') if mibBuilder.loadTexts: nnenvPwrsupType.setDescription('Power supply type.') nnenvPwrsupUptime = MibTableColumn((1, 3, 6, 1, 4, 1, 562, 73, 1, 1, 1, 3, 1, 4, 1, 5), Integer32()).setMaxAccess("readonly") if mibBuilder.loadTexts: nnenvPwrsupUptime.setStatus('current') if mibBuilder.loadTexts: nnenvPwrsupUptime.setDescription('Seconds since power supply came up.') nnenvPwrsupDowntime = MibTableColumn((1, 3, 6, 1, 4, 1, 562, 73, 1, 1, 1, 3, 1, 4, 1, 6), Integer32()).setMaxAccess("readonly") if mibBuilder.loadTexts: nnenvPwrsupDowntime.setStatus('current') if mibBuilder.loadTexts: nnenvPwrsupDowntime.setDescription('Seconds since power supply went down.') nnenvEnableTemperatureNotification = MibScalar((1, 3, 6, 1, 4, 1, 562, 73, 1, 1, 1, 3, 2, 1), TruthValue().clone('true')).setMaxAccess("readwrite") if mibBuilder.loadTexts: nnenvEnableTemperatureNotification.setStatus('current') if mibBuilder.loadTexts: nnenvEnableTemperatureNotification.setDescription('Indicates whether the system produces the envTemperatureNotification. The default is yes. Note: implementation is TBD. ') nnenvEnableFanNotification = MibScalar((1, 3, 6, 1, 4, 1, 562, 73, 1, 1, 1, 3, 2, 2), TruthValue().clone('true')).setMaxAccess("readwrite") if mibBuilder.loadTexts: nnenvEnableFanNotification.setStatus('current') if mibBuilder.loadTexts: nnenvEnableFanNotification.setDescription('Indicates whether the system produces the envFanNotification. The default is yes. ') nnenvEnablePowerNotification = MibScalar((1, 3, 6, 1, 4, 1, 562, 73, 1, 1, 1, 3, 2, 3), TruthValue().clone('true')).setMaxAccess("readwrite") if mibBuilder.loadTexts: nnenvEnablePowerNotification.setStatus('current') if mibBuilder.loadTexts: nnenvEnablePowerNotification.setDescription('Indicates whether the system produces the envPowerNotification. The default is yes. ') nnenvTemperatureNotification = NotificationType((1, 3, 6, 1, 4, 1, 562, 73, 1, 1, 1, 3, 3, 0, 1)).setObjects(("ENVIRONMENT-MIB", "nnenvTempSensorValue"), ("ENVIRONMENT-MIB", "nnenvTempSensorState")) if mibBuilder.loadTexts: nnenvTemperatureNotification.setStatus('current') if mibBuilder.loadTexts: nnenvTemperatureNotification.setDescription(' An envTemeratureNotification is sent if the environmental monitoring detects that the temperature is at a critical state. This may cause the system to shut down. This notification is sent only if envEnableTemperatureNotification is set to true. ') nnenvFanNotification = NotificationType((1, 3, 6, 1, 4, 1, 562, 73, 1, 1, 1, 3, 3, 0, 2)).setObjects(("ENVIRONMENT-MIB", "nnenvFanUnitIndex"), ("ENVIRONMENT-MIB", "nnenvFanState")) if mibBuilder.loadTexts: nnenvFanNotification.setStatus('current') if mibBuilder.loadTexts: nnenvFanNotification.setDescription(' An envFanNotification is sent if the environmental monitoring detects that a fan is in a critical state. This may cause the system to shut down. This notification is sent only if envEnableFanNotification is set to true. ') nnenvPowerSupply1DownNotification = NotificationType((1, 3, 6, 1, 4, 1, 562, 73, 1, 1, 1, 3, 3, 0, 3)).setObjects(("ENVIRONMENT-MIB", "nnenvPwrsupPowerFailCount"), ("ENVIRONMENT-MIB", "nnenvPwrsupIndex"), ("ENVIRONMENT-MIB", "nnenvPwrsupInstalled"), ("ENVIRONMENT-MIB", "nnenvPwrsupStatus"), ("ENVIRONMENT-MIB", "nnenvPwrsupType"), ("ENVIRONMENT-MIB", "nnenvPwrsupUptime"), ("ENVIRONMENT-MIB", "nnenvPwrsupDowntime")) if mibBuilder.loadTexts: nnenvPowerSupply1DownNotification.setStatus('current') if mibBuilder.loadTexts: nnenvPowerSupply1DownNotification.setDescription(' An envPowerNotification is sent if the environmental monitoring detects that a power supply has changed status. This notification is sent only if envEnablePowerNotification is set to true. ') nnenvPowerSupply1UpNotification = NotificationType((1, 3, 6, 1, 4, 1, 562, 73, 1, 1, 1, 3, 3, 0, 4)).setObjects(("ENVIRONMENT-MIB", "nnenvPwrsupPowerFailCount"), ("ENVIRONMENT-MIB", "nnenvPwrsupIndex"), ("ENVIRONMENT-MIB", "nnenvPwrsupInstalled"), ("ENVIRONMENT-MIB", "nnenvPwrsupStatus"), ("ENVIRONMENT-MIB", "nnenvPwrsupType"), ("ENVIRONMENT-MIB", "nnenvPwrsupUptime"), ("ENVIRONMENT-MIB", "nnenvPwrsupDowntime")) if mibBuilder.loadTexts: nnenvPowerSupply1UpNotification.setStatus('current') if mibBuilder.loadTexts: nnenvPowerSupply1UpNotification.setDescription(' An envPowerNotification is sent if the environmental monitoring detects that a power supply has changed status. This notification is sent only if envEnablePowerNotification is set to true. ') nnenvPowerSupply2DownNotification = NotificationType((1, 3, 6, 1, 4, 1, 562, 73, 1, 1, 1, 3, 3, 0, 5)).setObjects(("ENVIRONMENT-MIB", "nnenvPwrsupPowerFailCount"), ("ENVIRONMENT-MIB", "nnenvPwrsupIndex"), ("ENVIRONMENT-MIB", "nnenvPwrsupInstalled"), ("ENVIRONMENT-MIB", "nnenvPwrsupStatus"), ("ENVIRONMENT-MIB", "nnenvPwrsupType"), ("ENVIRONMENT-MIB", "nnenvPwrsupUptime"), ("ENVIRONMENT-MIB", "nnenvPwrsupDowntime")) if mibBuilder.loadTexts: nnenvPowerSupply2DownNotification.setStatus('current') if mibBuilder.loadTexts: nnenvPowerSupply2DownNotification.setDescription(' An envPowerNotification is sent if the environmental monitoring detects that a power supply has changed status. This notification is sent only if envEnablePowerNotification is set to true. ') nnenvPowerSupply2UpNotification = NotificationType((1, 3, 6, 1, 4, 1, 562, 73, 1, 1, 1, 3, 3, 0, 6)).setObjects(("ENVIRONMENT-MIB", "nnenvPwrsupPowerFailCount"), ("ENVIRONMENT-MIB", "nnenvPwrsupIndex"), ("ENVIRONMENT-MIB", "nnenvPwrsupInstalled"), ("ENVIRONMENT-MIB", "nnenvPwrsupStatus"), ("ENVIRONMENT-MIB", "nnenvPwrsupType"), ("ENVIRONMENT-MIB", "nnenvPwrsupUptime"), ("ENVIRONMENT-MIB", "nnenvPwrsupDowntime")) if mibBuilder.loadTexts: nnenvPowerSupply2UpNotification.setStatus('current') if mibBuilder.loadTexts: nnenvPowerSupply2UpNotification.setDescription(' An envPowerNotification is sent if the environmental monitoring detects that a power supply has changed status. This notification is sent only if envEnablePowerNotification is set to true. ') nnenvironementNotificationGroup = NotificationGroup((1, 3, 6, 1, 4, 1, 562, 73, 1, 1, 1, 3, 4)).setObjects(("ENVIRONMENT-MIB", "nnenvTemperatureNotification"), ("ENVIRONMENT-MIB", "nnenvFanNotification"), ("ENVIRONMENT-MIB", "nnenvPowerSupply1DownNotification"), ("ENVIRONMENT-MIB", "nnenvPowerSupply1UpNotification"), ("ENVIRONMENT-MIB", "nnenvPowerSupply2DownNotification"), ("ENVIRONMENT-MIB", "nnenvPowerSupply2UpNotification")) if getattr(mibBuilder, 'version', (0, 0, 0)) > (4, 4, 0): nnenvironementNotificationGroup = nnenvironementNotificationGroup.setStatus('current') if mibBuilder.loadTexts: nnenvironementNotificationGroup.setDescription('THE Envrionment MIB Notification Group') mibBuilder.exportSymbols("ENVIRONMENT-MIB", nnenvPowerSupply1UpNotification=nnenvPowerSupply1UpNotification, nnenvEnableTemperatureNotification=nnenvEnableTemperatureNotification, nnenvObjects=nnenvObjects, nnenvPowerSupply1DownNotification=nnenvPowerSupply1DownNotification, nnenvPwrsupDowntime=nnenvPwrsupDowntime, nnenvTraps=nnenvTraps, nnenvPwrsupEntry=nnenvPwrsupEntry, nnenvPwrsupType=nnenvPwrsupType, nnenvEnablePowerNotification=nnenvEnablePowerNotification, nnenvNotifications=nnenvNotifications, nnenvFanNotification=nnenvFanNotification, nnenvEnableFanNotification=nnenvEnableFanNotification, nnenvPwrsupTable=nnenvPwrsupTable, EnvType=EnvType, nnenvFanTable=nnenvFanTable, EnvStatus=EnvStatus, nnenvironementNotificationGroup=nnenvironementNotificationGroup, PYSNMP_MODULE_ID=nnenvironmentMib, nnenvFanUnitIndex=nnenvFanUnitIndex, nnenvironmentMib=nnenvironmentMib, nnenvPwrsupUptime=nnenvPwrsupUptime, nnenvFanState=nnenvFanState, nnenvFanEntry=nnenvFanEntry, EnvState=EnvState, EnvInstalled=EnvInstalled, nnenvTempSensorGroup=nnenvTempSensorGroup, nnenvTemperatureNotification=nnenvTemperatureNotification, nnenvPowerSupply2UpNotification=nnenvPowerSupply2UpNotification, nnenvPowerSupply2DownNotification=nnenvPowerSupply2DownNotification, nnenvTempSensorState=nnenvTempSensorState, nnenvPwrsupPowerFailCount=nnenvPwrsupPowerFailCount, nnenvPwrsupStatus=nnenvPwrsupStatus, nnenvPwrsupIndex=nnenvPwrsupIndex, nnenvNotificationEnables=nnenvNotificationEnables, nnenvTempSensorValue=nnenvTempSensorValue, nnenvPwrsupInstalled=nnenvPwrsupInstalled)
(integer, object_identifier, octet_string) = mibBuilder.importSymbols('ASN1', 'Integer', 'ObjectIdentifier', 'OctetString') (named_values,) = mibBuilder.importSymbols('ASN1-ENUMERATION', 'NamedValues') (value_size_constraint, constraints_intersection, value_range_constraint, single_value_constraint, constraints_union) = mibBuilder.importSymbols('ASN1-REFINEMENT', 'ValueSizeConstraint', 'ConstraintsIntersection', 'ValueRangeConstraint', 'SingleValueConstraint', 'ConstraintsUnion') (nt_enterprise_data_tasman_mgmt,) = mibBuilder.importSymbols('NT-ENTERPRISE-DATA-MIB', 'ntEnterpriseDataTasmanMgmt') (module_compliance, notification_group) = mibBuilder.importSymbols('SNMPv2-CONF', 'ModuleCompliance', 'NotificationGroup') (iso, counter32, mib_scalar, mib_table, mib_table_row, mib_table_column, bits, unsigned32, time_ticks, object_identity, ip_address, mib_identifier, counter64, module_identity, integer32, gauge32, notification_type) = mibBuilder.importSymbols('SNMPv2-SMI', 'iso', 'Counter32', 'MibScalar', 'MibTable', 'MibTableRow', 'MibTableColumn', 'Bits', 'Unsigned32', 'TimeTicks', 'ObjectIdentity', 'IpAddress', 'MibIdentifier', 'Counter64', 'ModuleIdentity', 'Integer32', 'Gauge32', 'NotificationType') (truth_value, textual_convention, display_string) = mibBuilder.importSymbols('SNMPv2-TC', 'TruthValue', 'TextualConvention', 'DisplayString') nnenvironment_mib = module_identity((1, 3, 6, 1, 4, 1, 562, 73, 1, 1, 1, 3)) nnenvironmentMib.setRevisions(('1900-08-18 00:00',)) if getattr(mibBuilder, 'version', (0, 0, 0)) > (4, 4, 0): if mibBuilder.loadTexts: nnenvironmentMib.setRevisionsDescriptions(('Initial version of Environment MIB.',)) if mibBuilder.loadTexts: nnenvironmentMib.setLastUpdated('0008180000Z') if mibBuilder.loadTexts: nnenvironmentMib.setOrganization('Nortel Networks') if mibBuilder.loadTexts: nnenvironmentMib.setContactInfo(' Nortel Networks 8200 Dixie Road Brampton, Ontario L6T 5P6 Canada 1-800-4Nortel www.nortelnetworks.com ') if mibBuilder.loadTexts: nnenvironmentMib.setDescription('') class Envstate(TextualConvention, Integer32): description = 'Represents the state of a device being monitored.' status = 'current' subtype_spec = Integer32.subtypeSpec + constraints_union(single_value_constraint(1, 2, 3, 4, 5)) named_values = named_values(('normal', 1), ('warning', 2), ('critical', 3), ('fail', 4), ('turned-off', 5)) class Envinstalled(TextualConvention, Integer32): description = 'Installed flag for power supply.' status = 'current' subtype_spec = Integer32.subtypeSpec + constraints_union(single_value_constraint(1, 2)) named_values = named_values(('not-installed', 1), ('installed', 2)) class Envstatus(TextualConvention, Integer32): description = 'Installed flag for power supply.' status = 'current' subtype_spec = Integer32.subtypeSpec + constraints_union(single_value_constraint(1, 2, 3)) named_values = named_values(('absent', 1), ('failed', 2), ('normal', 3)) class Envtype(TextualConvention, Integer32): description = 'Installed flag for power supply.' status = 'current' subtype_spec = Integer32.subtypeSpec + constraints_union(single_value_constraint(1, 2, 3, 4)) named_values = named_values(('supply-AC-ONLY', 1), ('supply-AC-PoE', 2), ('supply-DC', 3), ('unknown', 4)) nnenv_objects = mib_identifier((1, 3, 6, 1, 4, 1, 562, 73, 1, 1, 1, 3, 1)) nnenv_notification_enables = mib_identifier((1, 3, 6, 1, 4, 1, 562, 73, 1, 1, 1, 3, 2)) nnenv_notifications = mib_identifier((1, 3, 6, 1, 4, 1, 562, 73, 1, 1, 1, 3, 3)) nnenv_traps = mib_identifier((1, 3, 6, 1, 4, 1, 562, 73, 1, 1, 1, 3, 3, 0)) nnenv_temp_sensor_group = mib_identifier((1, 3, 6, 1, 4, 1, 562, 73, 1, 1, 1, 3, 1, 1)) nnenv_temp_sensor_value = mib_scalar((1, 3, 6, 1, 4, 1, 562, 73, 1, 1, 1, 3, 1, 1, 1), gauge32()).setMaxAccess('readonly') if mibBuilder.loadTexts: nnenvTempSensorValue.setStatus('current') if mibBuilder.loadTexts: nnenvTempSensorValue.setDescription(' The Average value of the temperature sensors. ') nnenv_temp_sensor_state = mib_scalar((1, 3, 6, 1, 4, 1, 562, 73, 1, 1, 1, 3, 1, 1, 2), env_state()).setMaxAccess('readonly') if mibBuilder.loadTexts: nnenvTempSensorState.setStatus('current') if mibBuilder.loadTexts: nnenvTempSensorState.setDescription(' The Average status of the temperature sensors. ') nnenv_fan_table = mib_table((1, 3, 6, 1, 4, 1, 562, 73, 1, 1, 1, 3, 1, 2)) if mibBuilder.loadTexts: nnenvFanTable.setStatus('current') if mibBuilder.loadTexts: nnenvFanTable.setDescription('A list of fan unit entries.') nnenv_fan_entry = mib_table_row((1, 3, 6, 1, 4, 1, 562, 73, 1, 1, 1, 3, 1, 2, 1)).setIndexNames((0, 'ENVIRONMENT-MIB', 'nnenvFanUnitIndex')) if mibBuilder.loadTexts: nnenvFanEntry.setStatus('current') if mibBuilder.loadTexts: nnenvFanEntry.setDescription('Entry containing information about a fan within the chassis.') nnenv_fan_unit_index = mib_table_column((1, 3, 6, 1, 4, 1, 562, 73, 1, 1, 1, 3, 1, 2, 1, 1), integer32().subtype(subtypeSpec=value_range_constraint(0, 1))).setMaxAccess('accessiblefornotify') if mibBuilder.loadTexts: nnenvFanUnitIndex.setStatus('current') if mibBuilder.loadTexts: nnenvFanUnitIndex.setDescription('The index to access an entry in the table. ') nnenv_fan_state = mib_table_column((1, 3, 6, 1, 4, 1, 562, 73, 1, 1, 1, 3, 1, 2, 1, 2), env_state()).setMaxAccess('readonly') if mibBuilder.loadTexts: nnenvFanState.setStatus('current') if mibBuilder.loadTexts: nnenvFanState.setDescription(' The current state of fan 0, normal/fail. ') nnenv_pwrsup_power_fail_count = mib_scalar((1, 3, 6, 1, 4, 1, 562, 73, 1, 1, 1, 3, 1, 3), integer32()).setMaxAccess('readonly') if mibBuilder.loadTexts: nnenvPwrsupPowerFailCount.setStatus('current') if mibBuilder.loadTexts: nnenvPwrsupPowerFailCount.setDescription('Number of failures of either power supply since boot-up.') nnenv_pwrsup_table = mib_table((1, 3, 6, 1, 4, 1, 562, 73, 1, 1, 1, 3, 1, 4)) if mibBuilder.loadTexts: nnenvPwrsupTable.setStatus('current') if mibBuilder.loadTexts: nnenvPwrsupTable.setDescription('A list of power supply status information.') nnenv_pwrsup_entry = mib_table_row((1, 3, 6, 1, 4, 1, 562, 73, 1, 1, 1, 3, 1, 4, 1)).setIndexNames((0, 'ENVIRONMENT-MIB', 'nnenvPwrsupIndex')) if mibBuilder.loadTexts: nnenvPwrsupEntry.setStatus('current') if mibBuilder.loadTexts: nnenvPwrsupEntry.setDescription('Entry containing power supply information.') nnenv_pwrsup_index = mib_table_column((1, 3, 6, 1, 4, 1, 562, 73, 1, 1, 1, 3, 1, 4, 1, 1), integer32().subtype(subtypeSpec=value_range_constraint(1, 2))).setMaxAccess('accessiblefornotify') if mibBuilder.loadTexts: nnenvPwrsupIndex.setStatus('current') if mibBuilder.loadTexts: nnenvPwrsupIndex.setDescription('Index to access entry.') nnenv_pwrsup_installed = mib_table_column((1, 3, 6, 1, 4, 1, 562, 73, 1, 1, 1, 3, 1, 4, 1, 2), env_installed()).setMaxAccess('readonly') if mibBuilder.loadTexts: nnenvPwrsupInstalled.setStatus('current') if mibBuilder.loadTexts: nnenvPwrsupInstalled.setDescription('Power supply installed flag.') nnenv_pwrsup_status = mib_table_column((1, 3, 6, 1, 4, 1, 562, 73, 1, 1, 1, 3, 1, 4, 1, 3), env_status()).setMaxAccess('readonly') if mibBuilder.loadTexts: nnenvPwrsupStatus.setStatus('current') if mibBuilder.loadTexts: nnenvPwrsupStatus.setDescription('Power supply up/down status.') nnenv_pwrsup_type = mib_table_column((1, 3, 6, 1, 4, 1, 562, 73, 1, 1, 1, 3, 1, 4, 1, 4), env_type()).setMaxAccess('readonly') if mibBuilder.loadTexts: nnenvPwrsupType.setStatus('current') if mibBuilder.loadTexts: nnenvPwrsupType.setDescription('Power supply type.') nnenv_pwrsup_uptime = mib_table_column((1, 3, 6, 1, 4, 1, 562, 73, 1, 1, 1, 3, 1, 4, 1, 5), integer32()).setMaxAccess('readonly') if mibBuilder.loadTexts: nnenvPwrsupUptime.setStatus('current') if mibBuilder.loadTexts: nnenvPwrsupUptime.setDescription('Seconds since power supply came up.') nnenv_pwrsup_downtime = mib_table_column((1, 3, 6, 1, 4, 1, 562, 73, 1, 1, 1, 3, 1, 4, 1, 6), integer32()).setMaxAccess('readonly') if mibBuilder.loadTexts: nnenvPwrsupDowntime.setStatus('current') if mibBuilder.loadTexts: nnenvPwrsupDowntime.setDescription('Seconds since power supply went down.') nnenv_enable_temperature_notification = mib_scalar((1, 3, 6, 1, 4, 1, 562, 73, 1, 1, 1, 3, 2, 1), truth_value().clone('true')).setMaxAccess('readwrite') if mibBuilder.loadTexts: nnenvEnableTemperatureNotification.setStatus('current') if mibBuilder.loadTexts: nnenvEnableTemperatureNotification.setDescription('Indicates whether the system produces the envTemperatureNotification. The default is yes. Note: implementation is TBD. ') nnenv_enable_fan_notification = mib_scalar((1, 3, 6, 1, 4, 1, 562, 73, 1, 1, 1, 3, 2, 2), truth_value().clone('true')).setMaxAccess('readwrite') if mibBuilder.loadTexts: nnenvEnableFanNotification.setStatus('current') if mibBuilder.loadTexts: nnenvEnableFanNotification.setDescription('Indicates whether the system produces the envFanNotification. The default is yes. ') nnenv_enable_power_notification = mib_scalar((1, 3, 6, 1, 4, 1, 562, 73, 1, 1, 1, 3, 2, 3), truth_value().clone('true')).setMaxAccess('readwrite') if mibBuilder.loadTexts: nnenvEnablePowerNotification.setStatus('current') if mibBuilder.loadTexts: nnenvEnablePowerNotification.setDescription('Indicates whether the system produces the envPowerNotification. The default is yes. ') nnenv_temperature_notification = notification_type((1, 3, 6, 1, 4, 1, 562, 73, 1, 1, 1, 3, 3, 0, 1)).setObjects(('ENVIRONMENT-MIB', 'nnenvTempSensorValue'), ('ENVIRONMENT-MIB', 'nnenvTempSensorState')) if mibBuilder.loadTexts: nnenvTemperatureNotification.setStatus('current') if mibBuilder.loadTexts: nnenvTemperatureNotification.setDescription(' An envTemeratureNotification is sent if the environmental monitoring detects that the temperature is at a critical state. This may cause the system to shut down. This notification is sent only if envEnableTemperatureNotification is set to true. ') nnenv_fan_notification = notification_type((1, 3, 6, 1, 4, 1, 562, 73, 1, 1, 1, 3, 3, 0, 2)).setObjects(('ENVIRONMENT-MIB', 'nnenvFanUnitIndex'), ('ENVIRONMENT-MIB', 'nnenvFanState')) if mibBuilder.loadTexts: nnenvFanNotification.setStatus('current') if mibBuilder.loadTexts: nnenvFanNotification.setDescription(' An envFanNotification is sent if the environmental monitoring detects that a fan is in a critical state. This may cause the system to shut down. This notification is sent only if envEnableFanNotification is set to true. ') nnenv_power_supply1_down_notification = notification_type((1, 3, 6, 1, 4, 1, 562, 73, 1, 1, 1, 3, 3, 0, 3)).setObjects(('ENVIRONMENT-MIB', 'nnenvPwrsupPowerFailCount'), ('ENVIRONMENT-MIB', 'nnenvPwrsupIndex'), ('ENVIRONMENT-MIB', 'nnenvPwrsupInstalled'), ('ENVIRONMENT-MIB', 'nnenvPwrsupStatus'), ('ENVIRONMENT-MIB', 'nnenvPwrsupType'), ('ENVIRONMENT-MIB', 'nnenvPwrsupUptime'), ('ENVIRONMENT-MIB', 'nnenvPwrsupDowntime')) if mibBuilder.loadTexts: nnenvPowerSupply1DownNotification.setStatus('current') if mibBuilder.loadTexts: nnenvPowerSupply1DownNotification.setDescription(' An envPowerNotification is sent if the environmental monitoring detects that a power supply has changed status. This notification is sent only if envEnablePowerNotification is set to true. ') nnenv_power_supply1_up_notification = notification_type((1, 3, 6, 1, 4, 1, 562, 73, 1, 1, 1, 3, 3, 0, 4)).setObjects(('ENVIRONMENT-MIB', 'nnenvPwrsupPowerFailCount'), ('ENVIRONMENT-MIB', 'nnenvPwrsupIndex'), ('ENVIRONMENT-MIB', 'nnenvPwrsupInstalled'), ('ENVIRONMENT-MIB', 'nnenvPwrsupStatus'), ('ENVIRONMENT-MIB', 'nnenvPwrsupType'), ('ENVIRONMENT-MIB', 'nnenvPwrsupUptime'), ('ENVIRONMENT-MIB', 'nnenvPwrsupDowntime')) if mibBuilder.loadTexts: nnenvPowerSupply1UpNotification.setStatus('current') if mibBuilder.loadTexts: nnenvPowerSupply1UpNotification.setDescription(' An envPowerNotification is sent if the environmental monitoring detects that a power supply has changed status. This notification is sent only if envEnablePowerNotification is set to true. ') nnenv_power_supply2_down_notification = notification_type((1, 3, 6, 1, 4, 1, 562, 73, 1, 1, 1, 3, 3, 0, 5)).setObjects(('ENVIRONMENT-MIB', 'nnenvPwrsupPowerFailCount'), ('ENVIRONMENT-MIB', 'nnenvPwrsupIndex'), ('ENVIRONMENT-MIB', 'nnenvPwrsupInstalled'), ('ENVIRONMENT-MIB', 'nnenvPwrsupStatus'), ('ENVIRONMENT-MIB', 'nnenvPwrsupType'), ('ENVIRONMENT-MIB', 'nnenvPwrsupUptime'), ('ENVIRONMENT-MIB', 'nnenvPwrsupDowntime')) if mibBuilder.loadTexts: nnenvPowerSupply2DownNotification.setStatus('current') if mibBuilder.loadTexts: nnenvPowerSupply2DownNotification.setDescription(' An envPowerNotification is sent if the environmental monitoring detects that a power supply has changed status. This notification is sent only if envEnablePowerNotification is set to true. ') nnenv_power_supply2_up_notification = notification_type((1, 3, 6, 1, 4, 1, 562, 73, 1, 1, 1, 3, 3, 0, 6)).setObjects(('ENVIRONMENT-MIB', 'nnenvPwrsupPowerFailCount'), ('ENVIRONMENT-MIB', 'nnenvPwrsupIndex'), ('ENVIRONMENT-MIB', 'nnenvPwrsupInstalled'), ('ENVIRONMENT-MIB', 'nnenvPwrsupStatus'), ('ENVIRONMENT-MIB', 'nnenvPwrsupType'), ('ENVIRONMENT-MIB', 'nnenvPwrsupUptime'), ('ENVIRONMENT-MIB', 'nnenvPwrsupDowntime')) if mibBuilder.loadTexts: nnenvPowerSupply2UpNotification.setStatus('current') if mibBuilder.loadTexts: nnenvPowerSupply2UpNotification.setDescription(' An envPowerNotification is sent if the environmental monitoring detects that a power supply has changed status. This notification is sent only if envEnablePowerNotification is set to true. ') nnenvironement_notification_group = notification_group((1, 3, 6, 1, 4, 1, 562, 73, 1, 1, 1, 3, 4)).setObjects(('ENVIRONMENT-MIB', 'nnenvTemperatureNotification'), ('ENVIRONMENT-MIB', 'nnenvFanNotification'), ('ENVIRONMENT-MIB', 'nnenvPowerSupply1DownNotification'), ('ENVIRONMENT-MIB', 'nnenvPowerSupply1UpNotification'), ('ENVIRONMENT-MIB', 'nnenvPowerSupply2DownNotification'), ('ENVIRONMENT-MIB', 'nnenvPowerSupply2UpNotification')) if getattr(mibBuilder, 'version', (0, 0, 0)) > (4, 4, 0): nnenvironement_notification_group = nnenvironementNotificationGroup.setStatus('current') if mibBuilder.loadTexts: nnenvironementNotificationGroup.setDescription('THE Envrionment MIB Notification Group') mibBuilder.exportSymbols('ENVIRONMENT-MIB', nnenvPowerSupply1UpNotification=nnenvPowerSupply1UpNotification, nnenvEnableTemperatureNotification=nnenvEnableTemperatureNotification, nnenvObjects=nnenvObjects, nnenvPowerSupply1DownNotification=nnenvPowerSupply1DownNotification, nnenvPwrsupDowntime=nnenvPwrsupDowntime, nnenvTraps=nnenvTraps, nnenvPwrsupEntry=nnenvPwrsupEntry, nnenvPwrsupType=nnenvPwrsupType, nnenvEnablePowerNotification=nnenvEnablePowerNotification, nnenvNotifications=nnenvNotifications, nnenvFanNotification=nnenvFanNotification, nnenvEnableFanNotification=nnenvEnableFanNotification, nnenvPwrsupTable=nnenvPwrsupTable, EnvType=EnvType, nnenvFanTable=nnenvFanTable, EnvStatus=EnvStatus, nnenvironementNotificationGroup=nnenvironementNotificationGroup, PYSNMP_MODULE_ID=nnenvironmentMib, nnenvFanUnitIndex=nnenvFanUnitIndex, nnenvironmentMib=nnenvironmentMib, nnenvPwrsupUptime=nnenvPwrsupUptime, nnenvFanState=nnenvFanState, nnenvFanEntry=nnenvFanEntry, EnvState=EnvState, EnvInstalled=EnvInstalled, nnenvTempSensorGroup=nnenvTempSensorGroup, nnenvTemperatureNotification=nnenvTemperatureNotification, nnenvPowerSupply2UpNotification=nnenvPowerSupply2UpNotification, nnenvPowerSupply2DownNotification=nnenvPowerSupply2DownNotification, nnenvTempSensorState=nnenvTempSensorState, nnenvPwrsupPowerFailCount=nnenvPwrsupPowerFailCount, nnenvPwrsupStatus=nnenvPwrsupStatus, nnenvPwrsupIndex=nnenvPwrsupIndex, nnenvNotificationEnables=nnenvNotificationEnables, nnenvTempSensorValue=nnenvTempSensorValue, nnenvPwrsupInstalled=nnenvPwrsupInstalled)
# def combine_all(input): # check1 = False # check2 = False # check3 = False # if len(input) > 0: # if input[0] == 'a': # check1 = True # # main_s = [] # tmp_dict = {} # for item in input: # tmp_dict[item] = "0" # if item not in ['a', 'b']: # return False # # if item == "a": # main_s.append(item) # elif item == "b": # try: # main_s.pop() # except: # return False # # if len(tmp_dict.keys()) == 2: # check2 = True # if len(main_s) == 0: # check3 = True # if check1 and check2 and check3: # return True # # return False def longest_palidrom_substr(input_str): l = 0 r = len(input_str) counter = 0 while counter < r: #print(input_str[counter:r]) if input_str[counter:r] == input_str[counter:r][::-1]: return input_str[counter:r] counter = counter + 1 counter = len(input_str) while counter > l: #print(input_str[l:counter]) if input_str[l:counter] == input_str[l:counter][::-1]: return input_str[l:counter] counter = counter - 1 return None def get_sum_position(nums, target): tmp_dict = {} for i, item in enumerate(nums): tmp_dict[item] = i for i, item in enumerate(nums): op = tmp_dict.get(target-item, None) if op and op != i: return [i, op] return None def findMedianSortedArrays(nums1, nums2): p1 = 0 p2 = 0 op = [] while (p1 < len(nums1) and p2 < len(nums2)): if nums1[p1] < nums2[p2]: op.append(nums1[p1]) p1 += 1 else: op.append(nums2[p2]) p2 += 1 op = op + nums1[p1:] op = op + nums2[p2:] print(op) mid = (len(nums1) + len(nums2)) // 2 if (len(nums1) + len(nums2)) % 2 != 0: return op[mid] else: return (op[mid-1] + op[mid]) / 2 def mergeTwoLists(l1, l2): p1 = 0 p2 = 0 op = [] while (p1 < len(l1) and p2 < len(l2)): if l1[p1] < l2[p2]: op.append(l1[p1]) p1 += 1 else: op.append(l2[p2]) p2 += 1 op = op + l1[p1:] op = op + l2[p2:] return op def reverse(x): if -2**31 <= x <= 2**31 -1 : if x > 0: return int(str(x)[::-1]) else: return int(str(x*-1)[::-1])*-1 return 0 def shift_all_0_left(input_str): input_str = list(input_str) l = 0 r = len(input_str) - 1 while l < r: if input_str[l] == '0': l = l + 1 continue if input_str[r] == '1': r = r - 1 continue input_str[l], input_str[r] = input_str[r], input_str[l] l = l + 1 r = r - 1 return "".join(input_str) def myAtoi(s): s1 = s.rstrip() s2 = s1.lstrip() int_s = int(s2) if -2147483648 <= int_s <= 2147483647: return int_s return 0 def threeSum(nums): op = set() for i in range(0,len(nums)): for j in range(i,len(nums)): for k in range(j,len(nums)): if i !=j and i != k and j != k and (nums[i] + nums[j] + nums[k] == 0): op.add((nums[i], nums[j], nums[k])) return list(op) def letterCombinations(digits): chars_mapping = { 2 : ['a', 'b', 'c'], 3 : ['d','e','f'], 4 : ['g','h','i'], 5 : ['j','k','l'], 6 : ['m','n','o'], 7 : ['p','q','r','s'], 8 : ['t','u','v'], 9 : ['w','x','y','z'] } if len(str(digits)) > 4 or len(str(digits)) <=0: return None else: l_of_l = [] for c in str(digits): l_of_l.append(chars_mapping.get(int(c))) print(l_of_l) def strStr(haystack, needle): needle_len = len(needle) i = 0 k = 0 while i < (len(haystack) - len(needle)): if haystack[i] == needle[k]: print() i += 1
def longest_palidrom_substr(input_str): l = 0 r = len(input_str) counter = 0 while counter < r: if input_str[counter:r] == input_str[counter:r][::-1]: return input_str[counter:r] counter = counter + 1 counter = len(input_str) while counter > l: if input_str[l:counter] == input_str[l:counter][::-1]: return input_str[l:counter] counter = counter - 1 return None def get_sum_position(nums, target): tmp_dict = {} for (i, item) in enumerate(nums): tmp_dict[item] = i for (i, item) in enumerate(nums): op = tmp_dict.get(target - item, None) if op and op != i: return [i, op] return None def find_median_sorted_arrays(nums1, nums2): p1 = 0 p2 = 0 op = [] while p1 < len(nums1) and p2 < len(nums2): if nums1[p1] < nums2[p2]: op.append(nums1[p1]) p1 += 1 else: op.append(nums2[p2]) p2 += 1 op = op + nums1[p1:] op = op + nums2[p2:] print(op) mid = (len(nums1) + len(nums2)) // 2 if (len(nums1) + len(nums2)) % 2 != 0: return op[mid] else: return (op[mid - 1] + op[mid]) / 2 def merge_two_lists(l1, l2): p1 = 0 p2 = 0 op = [] while p1 < len(l1) and p2 < len(l2): if l1[p1] < l2[p2]: op.append(l1[p1]) p1 += 1 else: op.append(l2[p2]) p2 += 1 op = op + l1[p1:] op = op + l2[p2:] return op def reverse(x): if -2 ** 31 <= x <= 2 ** 31 - 1: if x > 0: return int(str(x)[::-1]) else: return int(str(x * -1)[::-1]) * -1 return 0 def shift_all_0_left(input_str): input_str = list(input_str) l = 0 r = len(input_str) - 1 while l < r: if input_str[l] == '0': l = l + 1 continue if input_str[r] == '1': r = r - 1 continue (input_str[l], input_str[r]) = (input_str[r], input_str[l]) l = l + 1 r = r - 1 return ''.join(input_str) def my_atoi(s): s1 = s.rstrip() s2 = s1.lstrip() int_s = int(s2) if -2147483648 <= int_s <= 2147483647: return int_s return 0 def three_sum(nums): op = set() for i in range(0, len(nums)): for j in range(i, len(nums)): for k in range(j, len(nums)): if i != j and i != k and (j != k) and (nums[i] + nums[j] + nums[k] == 0): op.add((nums[i], nums[j], nums[k])) return list(op) def letter_combinations(digits): chars_mapping = {2: ['a', 'b', 'c'], 3: ['d', 'e', 'f'], 4: ['g', 'h', 'i'], 5: ['j', 'k', 'l'], 6: ['m', 'n', 'o'], 7: ['p', 'q', 'r', 's'], 8: ['t', 'u', 'v'], 9: ['w', 'x', 'y', 'z']} if len(str(digits)) > 4 or len(str(digits)) <= 0: return None else: l_of_l = [] for c in str(digits): l_of_l.append(chars_mapping.get(int(c))) print(l_of_l) def str_str(haystack, needle): needle_len = len(needle) i = 0 k = 0 while i < len(haystack) - len(needle): if haystack[i] == needle[k]: print() i += 1
myApp = App("chrome.app") if not myApp.window(): # chrome not open App.open("C:\\Program Files (x86)\\Google\\Chrome\\Application\\chrome.exe") wait(10) myApp.focus() wait(1) wait("1392883544404.png", FOREVER) click("1392883741646.png") type("http://10.112.18.28/testcases/symbol/BoxMarkerSymbol.html\n") wait("1392884154681.png", FOREVER) click("1392882778695.png") if exists("1392882825935.png"): print("create box marker symbol success!") else: print("create box marker symbol fail!") click("1392884525302.png") if exists("1392884539217.png"): print("create box marker symbol(json) success!") else: print("create box marker symbol(json) fail!") doubleClick("1392885884712.png") type("55000") click("1392884721664.png") if exists("1392884749355.png"): print("set extent width success!") else: print("set extent width fail!") doubleClick(find("1392885400212.png").right().find("1392885665897.png")) type("90000") click("1392884721664.png") if exists("1392884874286.png"): print("set extent height success!") else: print("set extent height fail!") doubleClick(find("1392885422517.png").right().find("1392885665897.png")) type("500000") click("1392884721664.png") if exists("1392884956412.png"): print("set extent depth success!") else: print("set extent depth fail!") click("1392884996587.png") if exists("1392885018993.png"): print("set tilt + 30 success!") else: print("set tilt + 30 fail!") click("1392885066449.png") click("1392885066449.png") if exists("1392885097714.png"): print("set tilt - 30 success!") else: print("set tilt - 30 fail!") doubleClick("1392885160730.png") type("145") click("1392885184156.png") if exists("1392885212829.png"): print("set tilt success!") else: print("set tilt fail!") click("1392886744095.png") click("1392886744095.png") click("1392886744095.png") if exists("1392886801194.png"): print("set heading + 30 success!") else: print("set heading + 30 fail!") click("1392886838690.png") click("1392886838690.png") if exists("1392886861619.png"): print("set heading - 30 success!") else: print("set heading - 30 fail!") doubleClick(find("1392887108781.png").left().find("1392887121837.png")) type("90") click("1392887150799.png") if exists("1392887181313.png"): print("set heading success!") else: print("set heading fail!") dragDrop("1392949672422.png","1392949687298.png" ) click("1392887213432.png") click("1392887213432.png") click("1392887213432.png") if exists("1392887260658.png"): print("set up offset success!") else: print("set up offset fail!")
my_app = app('chrome.app') if not myApp.window(): App.open('C:\\Program Files (x86)\\Google\\Chrome\\Application\\chrome.exe') wait(10) myApp.focus() wait(1) wait('1392883544404.png', FOREVER) click('1392883741646.png') type('http://10.112.18.28/testcases/symbol/BoxMarkerSymbol.html\n') wait('1392884154681.png', FOREVER) click('1392882778695.png') if exists('1392882825935.png'): print('create box marker symbol success!') else: print('create box marker symbol fail!') click('1392884525302.png') if exists('1392884539217.png'): print('create box marker symbol(json) success!') else: print('create box marker symbol(json) fail!') double_click('1392885884712.png') type('55000') click('1392884721664.png') if exists('1392884749355.png'): print('set extent width success!') else: print('set extent width fail!') double_click(find('1392885400212.png').right().find('1392885665897.png')) type('90000') click('1392884721664.png') if exists('1392884874286.png'): print('set extent height success!') else: print('set extent height fail!') double_click(find('1392885422517.png').right().find('1392885665897.png')) type('500000') click('1392884721664.png') if exists('1392884956412.png'): print('set extent depth success!') else: print('set extent depth fail!') click('1392884996587.png') if exists('1392885018993.png'): print('set tilt + 30 success!') else: print('set tilt + 30 fail!') click('1392885066449.png') click('1392885066449.png') if exists('1392885097714.png'): print('set tilt - 30 success!') else: print('set tilt - 30 fail!') double_click('1392885160730.png') type('145') click('1392885184156.png') if exists('1392885212829.png'): print('set tilt success!') else: print('set tilt fail!') click('1392886744095.png') click('1392886744095.png') click('1392886744095.png') if exists('1392886801194.png'): print('set heading + 30 success!') else: print('set heading + 30 fail!') click('1392886838690.png') click('1392886838690.png') if exists('1392886861619.png'): print('set heading - 30 success!') else: print('set heading - 30 fail!') double_click(find('1392887108781.png').left().find('1392887121837.png')) type('90') click('1392887150799.png') if exists('1392887181313.png'): print('set heading success!') else: print('set heading fail!') drag_drop('1392949672422.png', '1392949687298.png') click('1392887213432.png') click('1392887213432.png') click('1392887213432.png') if exists('1392887260658.png'): print('set up offset success!') else: print('set up offset fail!')
#!/usr/bin/env python appd_auth = { 'controller': '', 'account': '', 'user': '', 'password': '' } APPD_APP = '' APPD_TIER = ''
appd_auth = {'controller': '', 'account': '', 'user': '', 'password': ''} appd_app = '' appd_tier = ''
print("Hello World!") print ("Hello Again") print("I like typing this.") print("This is fun.") print('Yay! Printing.') print("I'd much rather you 'not'.") print('I "said" do not touch this.') print('this command will print one line') print('this\n command\n will\n print\n multiple\n lines') # print('nevermind') # --Output-- # Hello World! # Hello Again # I like typing this. # This is fun. # Yay! Printing. # I'd much rather you 'not'. # I "said" do not touch this. # this command will print one line # this # command # will # print # multiple # lines
print('Hello World!') print('Hello Again') print('I like typing this.') print('This is fun.') print('Yay! Printing.') print("I'd much rather you 'not'.") print('I "said" do not touch this.') print('this command will print one line') print('this\n command\n will\n print\n multiple\n lines')
# Not runnable end_point = "team/frc254" url = f"https://www.thebluealliance.com/api/v3/{end_point}" "https://www.thebluealliance.com/api/v3/team/frc254"
end_point = 'team/frc254' url = f'https://www.thebluealliance.com/api/v3/{end_point}' 'https://www.thebluealliance.com/api/v3/team/frc254'
class DoublyLinkedListNode: def __init__(self, node_data): self.data = node_data self.next = None self.prev = None def to_str(head): data = [] while head: data.append(str(head.data)) head = head.next return ', '.join(data) def reverse_recursive(head): if head is None or head.next is None: return head new_head = reverse_recursive(head.next) new_head.prev = head head.next.next = head head.next = None return new_head def reverse_iterative(head): if head is None or head.next is None: return head current = head new_head = DoublyLinkedListNode(current.data) new_head_start = new_head current = current.next while current: new = DoublyLinkedListNode(current.data) new.prev = new_head new_head.next = new new_head = new current = current.next return new_head_start if __name__ == '__main__': h = DoublyLinkedListNode(0) h_current = h for x in range(1, 11): n = DoublyLinkedListNode(x*2) n.prev = h_current h_current.next = n h_current = n print(to_str(h)) h = reverse_iterative(h) print(to_str(h))
class Doublylinkedlistnode: def __init__(self, node_data): self.data = node_data self.next = None self.prev = None def to_str(head): data = [] while head: data.append(str(head.data)) head = head.next return ', '.join(data) def reverse_recursive(head): if head is None or head.next is None: return head new_head = reverse_recursive(head.next) new_head.prev = head head.next.next = head head.next = None return new_head def reverse_iterative(head): if head is None or head.next is None: return head current = head new_head = doubly_linked_list_node(current.data) new_head_start = new_head current = current.next while current: new = doubly_linked_list_node(current.data) new.prev = new_head new_head.next = new new_head = new current = current.next return new_head_start if __name__ == '__main__': h = doubly_linked_list_node(0) h_current = h for x in range(1, 11): n = doubly_linked_list_node(x * 2) n.prev = h_current h_current.next = n h_current = n print(to_str(h)) h = reverse_iterative(h) print(to_str(h))
class Piece: def __init__(self, index: int, piece_hash: bytes, piece_length: int, block_length: int): self.index = index self.hash = piece_hash self.piece_length = piece_length self.block_length = block_length self.blocks = [Block(i, i*block_length, block_length) for i in range(piece_length // block_length)] self.blocks.append(Block(len(self.blocks), piece_length - block_length, piece_length % block_length)) @property def completed(self): return all(block.state == Block.Have for block in self.blocks) def __str__(self): attributes = self.__dict__.items() attributes = ', '.join(f'{key}={value}' for key, value in attributes) return f'{self.__class__.__name__}({attributes})' def __repr__(self): return self.__str__() class Block: Missing = 0 Have = 1 Ongoing = 2 def __init__(self, index: int, offset: int, length: int): self.index = index self.offset = offset self.length = length self.state = Block.Missing self.data = bytes(self.length) def __str__(self): attributes = self.__dict__.copy() del attributes['data'] attributes = attributes.items() attributes = ', '.join(f'{key}={value}' for key, value in attributes) return f'{self.__class__.__name__}({attributes})' def __repr__(self): return self.__str__()
class Piece: def __init__(self, index: int, piece_hash: bytes, piece_length: int, block_length: int): self.index = index self.hash = piece_hash self.piece_length = piece_length self.block_length = block_length self.blocks = [block(i, i * block_length, block_length) for i in range(piece_length // block_length)] self.blocks.append(block(len(self.blocks), piece_length - block_length, piece_length % block_length)) @property def completed(self): return all((block.state == Block.Have for block in self.blocks)) def __str__(self): attributes = self.__dict__.items() attributes = ', '.join((f'{key}={value}' for (key, value) in attributes)) return f'{self.__class__.__name__}({attributes})' def __repr__(self): return self.__str__() class Block: missing = 0 have = 1 ongoing = 2 def __init__(self, index: int, offset: int, length: int): self.index = index self.offset = offset self.length = length self.state = Block.Missing self.data = bytes(self.length) def __str__(self): attributes = self.__dict__.copy() del attributes['data'] attributes = attributes.items() attributes = ', '.join((f'{key}={value}' for (key, value) in attributes)) return f'{self.__class__.__name__}({attributes})' def __repr__(self): return self.__str__()
a = list1[0] list1[0] = "def" list1.remove ( 3 ) list1.append ( 4 ) print ( list1 ) del list1[1:2] print ( list1 )
a = list1[0] list1[0] = 'def' list1.remove(3) list1.append(4) print(list1) del list1[1:2] print(list1)
n = int(input()) v = [] trocas = 0 for i in range (n): for j in range (5): #para coletar os elementos do vetor v.append(int(input())) for j in range (5): #para ordenar o vetor for k in range (4): if v[k] > v[k+1]: t = v[k] v[k] = v[k+1] v[k+1] = t trocas = trocas + 1 #para contar quantas trocas esse vetor fez print(trocas) trocas = 0 v = []
n = int(input()) v = [] trocas = 0 for i in range(n): for j in range(5): v.append(int(input())) for j in range(5): for k in range(4): if v[k] > v[k + 1]: t = v[k] v[k] = v[k + 1] v[k + 1] = t trocas = trocas + 1 print(trocas) trocas = 0 v = []
junk_drawer = [3, 4] # Using the list provided, add a pen, a scrap paper, a 7.3 and a True element ____ # ____ # ____ # ____ # What's the length of the list now? # Save it in an object named drawer_length # ____ = ____ # Slice the junk_drawer object to include the element 4 to scrap paper # Save this in an object named cleaned_junk_drawer # ____ = ____ # Next convert it into a set and name it junk_set # ____ = ____.(____) # ____
junk_drawer = [3, 4] ____
# dictionary = {key: value for element in iterable} fruits = ['apple', 'kiwi', 'banana', 'orange', 'apricot'] fruit_dict = {element: len(element) for element in fruits if len(element) > 5} print('\n'.join("{} {}".format(element, leng) for (element, leng) in fruit_dict.items()))
fruits = ['apple', 'kiwi', 'banana', 'orange', 'apricot'] fruit_dict = {element: len(element) for element in fruits if len(element) > 5} print('\n'.join(('{} {}'.format(element, leng) for (element, leng) in fruit_dict.items())))
class QueryOperatorProcessor(object): def __init__(self, dispatcher): self.dispatcher = dispatcher def process(self, child_nodes): raise NotImplementedError() def _process_node(self, node): return self.dispatcher.dispatch(node) def _process_all_nodes(self, nodes): return [self._process_node(node) for node in nodes]
class Queryoperatorprocessor(object): def __init__(self, dispatcher): self.dispatcher = dispatcher def process(self, child_nodes): raise not_implemented_error() def _process_node(self, node): return self.dispatcher.dispatch(node) def _process_all_nodes(self, nodes): return [self._process_node(node) for node in nodes]
# SPDX-License-Identifier: MIT # Copyright (c) 2021 Akumatic # # https://adventofcode.com/2021/day/17 def read_file(filename: str = "input.txt") -> list: with open(f"{__file__.rstrip('code.py')}{filename}", "r") as f: lines = [s[2:].split("..") for s in f.read().strip().replace("target area: ", "").split(", ")] return [(int(lines[0][0]), int(lines[0][1])), (int(lines[1][0]), int(lines[1][1]))] def fire_probe(vel_x, vel_y, goal_x, goal_y) -> tuple: vx, vy = vel_x, vel_y x, y = 0, 0 max_y = 0 while x + vx < goal_x.stop: x += vx y += vy max_y = max(y, max_y) vx += 0 if vx == 0 else -1 if vx > 0 else 1 vy -= 1 if vx == 0 and (x < goal_x.start or y < goal_y.start): break if x in goal_x and y in goal_y: return vel_x, vel_y, max_y return vel_x, vel_y, None def brute_force(vals: list): r_x = range(vals[0][0], vals[0][1] + 1) r_y = range(vals[1][0], vals[1][1] + 1) tmp = [fire_probe(x, y, r_x, r_y) for x in range(vals[0][1] + 1) for y in range(-100, 100)] return [velocity for velocity in tmp if velocity[2] is not None] def part1(velocities: list) -> int: return max(velocities, key=lambda x: x[2])[2] def part2(velocities: list) -> int: return len(velocities) if __name__ == "__main__": vals = read_file() vals = brute_force(vals) print(f"Part 1: {part1(vals)}") print(f"Part 2: {part2(vals)}")
def read_file(filename: str='input.txt') -> list: with open(f"{__file__.rstrip('code.py')}{filename}", 'r') as f: lines = [s[2:].split('..') for s in f.read().strip().replace('target area: ', '').split(', ')] return [(int(lines[0][0]), int(lines[0][1])), (int(lines[1][0]), int(lines[1][1]))] def fire_probe(vel_x, vel_y, goal_x, goal_y) -> tuple: (vx, vy) = (vel_x, vel_y) (x, y) = (0, 0) max_y = 0 while x + vx < goal_x.stop: x += vx y += vy max_y = max(y, max_y) vx += 0 if vx == 0 else -1 if vx > 0 else 1 vy -= 1 if vx == 0 and (x < goal_x.start or y < goal_y.start): break if x in goal_x and y in goal_y: return (vel_x, vel_y, max_y) return (vel_x, vel_y, None) def brute_force(vals: list): r_x = range(vals[0][0], vals[0][1] + 1) r_y = range(vals[1][0], vals[1][1] + 1) tmp = [fire_probe(x, y, r_x, r_y) for x in range(vals[0][1] + 1) for y in range(-100, 100)] return [velocity for velocity in tmp if velocity[2] is not None] def part1(velocities: list) -> int: return max(velocities, key=lambda x: x[2])[2] def part2(velocities: list) -> int: return len(velocities) if __name__ == '__main__': vals = read_file() vals = brute_force(vals) print(f'Part 1: {part1(vals)}') print(f'Part 2: {part2(vals)}')
x = 0; for i in range(1000000): x = x + 1;
x = 0 for i in range(1000000): x = x + 1
N = int(input()) a = list(map(int, input().split())) t = [] for i in range(N): t.append([a[i], i]) t.sort(key=lambda x: x[0]) for i in t[::-1]: print(i[1] + 1)
n = int(input()) a = list(map(int, input().split())) t = [] for i in range(N): t.append([a[i], i]) t.sort(key=lambda x: x[0]) for i in t[::-1]: print(i[1] + 1)
#retomando clase pasada #Estructura de datos ################################# #listas otra_lista = [1, 2, 3, 4 , 5, 6] #Accediendo a los elementos de una lista print(otra_lista[0]) print(otra_lista[-1]) #Slicing print(otra_lista[0:3]) print(otra_lista[3:]) copia_lista = otra_lista copia_lista.append(7) print(otra_lista) print(copia_lista) ################## #estructura de control y de iteracion ####################################### if True: print("Es verdad") semaforo = 'rojo' if semaforo == 'rojo': print('detenido') elif semaforo == 'verde': print('avanza') else: print('detente') print('No esta en la lista') if 1 in otra_lista else print('No esta en la lista') #while while otra_lista != []: elemento_borrado = otra_lista.pop() print(f'Extraje elemento {elemento_borrado}') #interpolacion while copia_lista: elemento_borrado = copia_lista.pop() print('Extraje elemento de copia_lista {}'.format(elemento_borrado)) #interpolacion else: print("No entro en el while:(") #For vocales = 'aeiou' for vocal in vocales: print(vocal) vocales = 'aeiou' for i in range(0, len(vocales)): print(vocales[i]) for n in range(0, 101, 2): print(n) nueva_lista = [0, 1, 2['otra', 'lista',[3, 4, 5]]] print(nueva_lista[3][2][0]) print(isinstance(nueva_lista,list)) print('*' * 5) for i in nueva_lista: if isinstance(i,list)== False: print(i) continue for j in i: if isinstance(j, list)== False: print(j) continue for k in j: print(k) #listas comprimidas pares = [ i for i in range(0, 101, 2) if i % 2==0] print(pares) impares = [ i for i in range(1, 100, 2) if i % 2==0] print(impares) # Function map() animales= ['gato', 'perro', 'oso','leon', 'ballenaa'] print(list(map(str.upper, animales))) ################ #Tuplas ################ una_tupla=(1, 2, 3) print(una_tupla) tupla_comprimida = tuple( x for x in string.ascii.lowercase if x in 'aeiou') print(tupla_comprimida) ################# #Diccionarios ################# mi_diccionario = { 'luis':['perro','gato'], 'daniela':['loro','gato'], 'romina':['camaleon','gato'], } print(mi_diccionario) print(mi_diccionario['daniela']) for key in mi_diccionario.keys(): print(f'key "{key}"') for value in mi_diccionario.values(): print(f'Value "{value}"') ############################ #Funcion ########################### def sum(a, b): print(a+b) def rest(a, b): print(a - b) def division(a, b): print(a / b) def multiplicacion(a, b): print(a * b) sum(5, 5) rest(5, 5) division(5, 5) multiplicacion(5, 5) ######################### #clases y objetos ######################## class Calculadora: def __init__(self) -> None: self.a = a self.b = b def suma(self) -> int: print(self.a + self.b) def __str__(self): return '#### Numeros ###\nA: {self.a}\nB: {self.b}' mi_calculadora = Calculadora(5,5) mi_calculadora.suma pass
otra_lista = [1, 2, 3, 4, 5, 6] print(otra_lista[0]) print(otra_lista[-1]) print(otra_lista[0:3]) print(otra_lista[3:]) copia_lista = otra_lista copia_lista.append(7) print(otra_lista) print(copia_lista) if True: print('Es verdad') semaforo = 'rojo' if semaforo == 'rojo': print('detenido') elif semaforo == 'verde': print('avanza') else: print('detente') print('No esta en la lista') if 1 in otra_lista else print('No esta en la lista') while otra_lista != []: elemento_borrado = otra_lista.pop() print(f'Extraje elemento {elemento_borrado}') while copia_lista: elemento_borrado = copia_lista.pop() print('Extraje elemento de copia_lista {}'.format(elemento_borrado)) else: print('No entro en el while:(') vocales = 'aeiou' for vocal in vocales: print(vocal) vocales = 'aeiou' for i in range(0, len(vocales)): print(vocales[i]) for n in range(0, 101, 2): print(n) nueva_lista = [0, 1, 2['otra', 'lista', [3, 4, 5]]] print(nueva_lista[3][2][0]) print(isinstance(nueva_lista, list)) print('*' * 5) for i in nueva_lista: if isinstance(i, list) == False: print(i) continue for j in i: if isinstance(j, list) == False: print(j) continue for k in j: print(k) pares = [i for i in range(0, 101, 2) if i % 2 == 0] print(pares) impares = [i for i in range(1, 100, 2) if i % 2 == 0] print(impares) animales = ['gato', 'perro', 'oso', 'leon', 'ballenaa'] print(list(map(str.upper, animales))) una_tupla = (1, 2, 3) print(una_tupla) tupla_comprimida = tuple((x for x in string.ascii.lowercase if x in 'aeiou')) print(tupla_comprimida) mi_diccionario = {'luis': ['perro', 'gato'], 'daniela': ['loro', 'gato'], 'romina': ['camaleon', 'gato']} print(mi_diccionario) print(mi_diccionario['daniela']) for key in mi_diccionario.keys(): print(f'key "{key}"') for value in mi_diccionario.values(): print(f'Value "{value}"') def sum(a, b): print(a + b) def rest(a, b): print(a - b) def division(a, b): print(a / b) def multiplicacion(a, b): print(a * b) sum(5, 5) rest(5, 5) division(5, 5) multiplicacion(5, 5) class Calculadora: def __init__(self) -> None: self.a = a self.b = b def suma(self) -> int: print(self.a + self.b) def __str__(self): return '#### Numeros ###\nA: {self.a}\nB: {self.b}' mi_calculadora = calculadora(5, 5) mi_calculadora.suma pass
class Solution: def lengthOfLIS(self, nums: List[int]) -> int: dp = [1]*len(nums) for i in range(1,len(nums)): for j in range(i): if nums[i] > nums[j]: dp[i] = max( dp[i], dp[j]+1 ) return max(dp) class SolutionII: def lengthOfLIS(self, nums: List[int]) -> int: sub = [] for num in nums: i = bisect_left(sub, num) if i == len(sub): sub.append(num) else: sub[i] = num return len(sub)
class Solution: def length_of_lis(self, nums: List[int]) -> int: dp = [1] * len(nums) for i in range(1, len(nums)): for j in range(i): if nums[i] > nums[j]: dp[i] = max(dp[i], dp[j] + 1) return max(dp) class Solutionii: def length_of_lis(self, nums: List[int]) -> int: sub = [] for num in nums: i = bisect_left(sub, num) if i == len(sub): sub.append(num) else: sub[i] = num return len(sub)
def can_make_arithmetic_progression(arr): arr = sorted(arr) prev_diff = arr[1] - arr[0] for i in range(1, len(arr)): difference = arr[i] - arr[i - 1] if not difference == prev_diff: return False prev_diff = difference return True print(can_make_arithmetic_progression([3, 5, 1])) print(can_make_arithmetic_progression([1, 2, 4]))
def can_make_arithmetic_progression(arr): arr = sorted(arr) prev_diff = arr[1] - arr[0] for i in range(1, len(arr)): difference = arr[i] - arr[i - 1] if not difference == prev_diff: return False prev_diff = difference return True print(can_make_arithmetic_progression([3, 5, 1])) print(can_make_arithmetic_progression([1, 2, 4]))
model_status = [ { 'code': 0, 'description': 'Model uploaded'}, { 'code': 1, 'description': 'File csv uploaded'}, { 'code': 2, 'description': 'Send to elm'}, { 'code': 3, 'description': 'Training', 'perc': 0}, { 'code': 4, 'description': 'Done'} ]
model_status = [{'code': 0, 'description': 'Model uploaded'}, {'code': 1, 'description': 'File csv uploaded'}, {'code': 2, 'description': 'Send to elm'}, {'code': 3, 'description': 'Training', 'perc': 0}, {'code': 4, 'description': 'Done'}]
class CmfParseError(Exception): def __init__(self, parseinfo, msg): self.message = '({}:{}) Error: {}'.format( parseinfo.line + 1, parseinfo.pos, msg) def __str__(self): return self.message
class Cmfparseerror(Exception): def __init__(self, parseinfo, msg): self.message = '({}:{}) Error: {}'.format(parseinfo.line + 1, parseinfo.pos, msg) def __str__(self): return self.message
# This is a sample Python script. # Press Shift+F10 to execute it or replace it with your code. # Press Double Shift to search everywhere for classes, files, tool windows, actions, and settings. def Watermelon(i): w =i result = "YES" if w%2 == 0 and w > 2 else "NO" print(result + " " + str(i)) Watermelon(int(input()))
def watermelon(i): w = i result = 'YES' if w % 2 == 0 and w > 2 else 'NO' print(result + ' ' + str(i)) watermelon(int(input()))
matrix = ["1.1 2.2 3.3", "4.4 5.5 6.6", "7.7 8.8 9.9"] def transpose(matrix): return [" ".join(row.split()[i] for row in matrix) for i in range(len(matrix))] print(transpose(matrix))
matrix = ['1.1 2.2 3.3', '4.4 5.5 6.6', '7.7 8.8 9.9'] def transpose(matrix): return [' '.join((row.split()[i] for row in matrix)) for i in range(len(matrix))] print(transpose(matrix))
print('Meta definition') class Meta(type): def __new__(mcs, name, bases, namespace): print('Meta __new__:', mcs, name, namespace) ret = type.__new__(mcs, name, bases, namespace) # class creation print('Meta __new__ ret:', ret) return ret def __init__(cls, name, bases=None, namespace=None): print('Meta __init__:', cls, name, bases, namespace) super(Meta, cls).__init__(name, bases, namespace) # can be suppressed in some cases print('Meta post __init__:', cls, name, bases, namespace) def __call__(cls, *args, **kwargs): print('Meta __call__:', cls, args, kwargs) ret = type.__call__(cls, *args) # class instance creation print('Meta __call__ ret:', ret) print('Meta __call__ ret __dict__:', ret.__dict__) return ret print('\nBase definition') class Base(metaclass=Meta): def __new__(cls, *args, **kwargs): print('Base __new__:', cls, args, kwargs) ret = super(Base, cls).__new__(cls) print('Base __new__ ret:', ret) return ret def __init__(self, *args, **kwargs): print('Base __init__:', self, args, kwargs) def __call__(self, *args, **kwargs): print('Base __call__:', self, args, kwargs) print('\nB definition') class B(Base): prop = True def func(self): pass def __init__(self, p=2, *args): super(B, self).__init__(*args, p=2) self.p = p print('\nCreate B instance') b = B(1, p=2) print('\nCall B instance') b(3, b=4) print('\nCreate Base2 class') Base2 = Meta('Base2', (), {}) print('\nCreate B2 class') B2 = type('B2', (Base2,), {}) # Meta will be used to create B2 class print('\nCreate B2 instance') b2 = B2() print('\nTest B2 class') def B2_call(self, *args, **kwargs): print(self, args, kwargs) B2.__call__ = B2_call b2(1, a=2)
print('Meta definition') class Meta(type): def __new__(mcs, name, bases, namespace): print('Meta __new__:', mcs, name, namespace) ret = type.__new__(mcs, name, bases, namespace) print('Meta __new__ ret:', ret) return ret def __init__(cls, name, bases=None, namespace=None): print('Meta __init__:', cls, name, bases, namespace) super(Meta, cls).__init__(name, bases, namespace) print('Meta post __init__:', cls, name, bases, namespace) def __call__(cls, *args, **kwargs): print('Meta __call__:', cls, args, kwargs) ret = type.__call__(cls, *args) print('Meta __call__ ret:', ret) print('Meta __call__ ret __dict__:', ret.__dict__) return ret print('\nBase definition') class Base(metaclass=Meta): def __new__(cls, *args, **kwargs): print('Base __new__:', cls, args, kwargs) ret = super(Base, cls).__new__(cls) print('Base __new__ ret:', ret) return ret def __init__(self, *args, **kwargs): print('Base __init__:', self, args, kwargs) def __call__(self, *args, **kwargs): print('Base __call__:', self, args, kwargs) print('\nB definition') class B(Base): prop = True def func(self): pass def __init__(self, p=2, *args): super(B, self).__init__(*args, p=2) self.p = p print('\nCreate B instance') b = b(1, p=2) print('\nCall B instance') b(3, b=4) print('\nCreate Base2 class') base2 = meta('Base2', (), {}) print('\nCreate B2 class') b2 = type('B2', (Base2,), {}) print('\nCreate B2 instance') b2 = b2() print('\nTest B2 class') def b2_call(self, *args, **kwargs): print(self, args, kwargs) B2.__call__ = B2_call b2(1, a=2)
print("Input: ",end="") a, b, t = 2020, 2021, int(input()) for i in range(t): n = int(input("\n")) def sum(x, a, b, check, n): if x > n: return if check[x]: return check[x] = True sum(x + a, a, b, check, n) sum(x + b, a, b, check, n) def sumPossible(n, a, b): check = [False] * (n + 1) sum(0, a, b, check, n) return check[n] if sumPossible(n, a, b): print("Output: YES") else: print("Output: NO")
print('Input: ', end='') (a, b, t) = (2020, 2021, int(input())) for i in range(t): n = int(input('\n')) def sum(x, a, b, check, n): if x > n: return if check[x]: return check[x] = True sum(x + a, a, b, check, n) sum(x + b, a, b, check, n) def sum_possible(n, a, b): check = [False] * (n + 1) sum(0, a, b, check, n) return check[n] if sum_possible(n, a, b): print('Output: YES') else: print('Output: NO')
class PROJECT(object): NAME = "leafytracker" DESC = "A set of tools to aggregate Leafy Games' developer posts for PULSAR: Lost Colony." URL = "https://github.com/TomRichter/leafytracker" VERSION = "0.0.0"
class Project(object): name = 'leafytracker' desc = "A set of tools to aggregate Leafy Games' developer posts for PULSAR: Lost Colony." url = 'https://github.com/TomRichter/leafytracker' version = '0.0.0'
a=input().split(" ") b=input().split(" ") A=0 B=0 for i in range(len(a)): num1=int(a[i]) num2=int(b[i]) if(num1>num2): A+=1 elif(num1<num2): B+=1 print(A, B)
a = input().split(' ') b = input().split(' ') a = 0 b = 0 for i in range(len(a)): num1 = int(a[i]) num2 = int(b[i]) if num1 > num2: a += 1 elif num1 < num2: b += 1 print(A, B)
# app config APP_CONFIG=dict( SECRET_KEY="SECRET", WTF_CSRF_SECRET_KEY="SECRET", # Webservice config WS_URL="http://localhost:5058", # ws del modello in locale DATASET_REQ = "/dataset", OPERATIVE_CENTERS_REQ = "/operative-centers", OC_DATE_REQ = "/oc-date", OC_DATA_REQ = "/oc-data", PREDICT_REQ = "/predict", OPERATORS_RANK_REQ = "/ops-rank/", SEND_REAL_Y_REQ = "/store-real-y/", SEND_LOGIN_REQ= "/login", MODELS_REQ = "/models", EVAL_MODELS_REQ = '/eval-models', USE_MODEL_REQ='/use-models', ALGORITHMS_REQ='/algorithms', SETTINGS_REQ = '/settings', DATA_CHARSET ='ISO-8859-1' ) # Application domain config
app_config = dict(SECRET_KEY='SECRET', WTF_CSRF_SECRET_KEY='SECRET', WS_URL='http://localhost:5058', DATASET_REQ='/dataset', OPERATIVE_CENTERS_REQ='/operative-centers', OC_DATE_REQ='/oc-date', OC_DATA_REQ='/oc-data', PREDICT_REQ='/predict', OPERATORS_RANK_REQ='/ops-rank/', SEND_REAL_Y_REQ='/store-real-y/', SEND_LOGIN_REQ='/login', MODELS_REQ='/models', EVAL_MODELS_REQ='/eval-models', USE_MODEL_REQ='/use-models', ALGORITHMS_REQ='/algorithms', SETTINGS_REQ='/settings', DATA_CHARSET='ISO-8859-1')
#encoding:utf-8 subreddit = 'mildlyvagina' t_channel = '@r_mildlyvagina' def send_post(submission, r2t): return r2t.send_simple(submission)
subreddit = 'mildlyvagina' t_channel = '@r_mildlyvagina' def send_post(submission, r2t): return r2t.send_simple(submission)
num1, num2 = list(map(int, input().split())) if num1 < num2: print(num1, num2) else: print(num2, num1)
(num1, num2) = list(map(int, input().split())) if num1 < num2: print(num1, num2) else: print(num2, num1)
def main(): print('Hola, mundo') if __name__ =='__main__': main()
def main(): print('Hola, mundo') if __name__ == '__main__': main()
env = None pg = None surface = None width = None height = None # __pragma__ ('opov') def init(environ): global env, pg, surface, width, height env = environ pg = env['pg'] surface = env['surface'] width = env['width'] height = env['height'] tests = [test_transform_rotate, test_transform_rotozoom, test_transform_scale, test_transform_flip] return tests def test_transform_rotate(): surface.fill((0,0,0)) surface.fill((255,0,0), (0,0,width//2,height)) surf = pg.transform.rotate(surface, 180) assert surf.get_size() == (width, height) assert surf.get_at((5,5)).r == 0 and surf.get_at((width-5,5)).r == 255 def test_transform_rotozoom(): surface.fill((0,0,0)) surface.fill((255,0,0), (0,0,width//2,height)) surf = pg.transform.rotozoom(surface, 180, 2.0) assert int(surf.get_width()/width) == 2 and int(surf.get_height()/height) == 2 assert surf.get_at((5,5)).r == 0 and surf.get_at((width*2-5,5)).r == 255 def test_transform_scale(): surface.fill((0,0,0)) surface.fill((255,0,0), (0,0,width//2,height)) size = (width*2, height*2) surf = pg.transform.scale(surface, size) assert int(surf.get_width()/width) == 2 and int(surf.get_height()/height) == 2 assert surf.get_at((5,5)).r == 255 and surf.get_at((width*2-5,5)).r == 0 surf = pg.transform.smoothscale(surface, size) assert int(surf.get_width()/width) == 2 and int(surf.get_height()/height) == 2 assert surf.get_at((5,5)).r == 255 and surf.get_at((width*2-5,5)).r == 0 surf = pg.transform.scale2x(surface) assert int(surf.get_width()/width) == 2 and int(surf.get_height()/height) == 2 assert surf.get_at((5,5)).r == 255 and surf.get_at((width*2-5,5)).r == 0 def test_transform_flip(): surface.fill((0,0,0)) surface.fill((255,0,0), (0,0,width//2,height)) surf = pg.transform.flip(surface, True, False) assert surf.get_size() == (width, height) assert surf.get_at((5,5)).r == 0 and surf.get_at((width-5,5)).r == 255 surf = pg.transform.flip(surface, False, True) assert surf.get_size() == (width, height) assert surf.get_at((5,5)).r == 255 and surf.get_at((width-5,5)).r == 0 surf = pg.transform.flip(surface, True, True) assert surf.get_size() == (width, height) assert surf.get_at((5,5)).r == 0 and surf.get_at((width-5,5)).r == 255
env = None pg = None surface = None width = None height = None def init(environ): global env, pg, surface, width, height env = environ pg = env['pg'] surface = env['surface'] width = env['width'] height = env['height'] tests = [test_transform_rotate, test_transform_rotozoom, test_transform_scale, test_transform_flip] return tests def test_transform_rotate(): surface.fill((0, 0, 0)) surface.fill((255, 0, 0), (0, 0, width // 2, height)) surf = pg.transform.rotate(surface, 180) assert surf.get_size() == (width, height) assert surf.get_at((5, 5)).r == 0 and surf.get_at((width - 5, 5)).r == 255 def test_transform_rotozoom(): surface.fill((0, 0, 0)) surface.fill((255, 0, 0), (0, 0, width // 2, height)) surf = pg.transform.rotozoom(surface, 180, 2.0) assert int(surf.get_width() / width) == 2 and int(surf.get_height() / height) == 2 assert surf.get_at((5, 5)).r == 0 and surf.get_at((width * 2 - 5, 5)).r == 255 def test_transform_scale(): surface.fill((0, 0, 0)) surface.fill((255, 0, 0), (0, 0, width // 2, height)) size = (width * 2, height * 2) surf = pg.transform.scale(surface, size) assert int(surf.get_width() / width) == 2 and int(surf.get_height() / height) == 2 assert surf.get_at((5, 5)).r == 255 and surf.get_at((width * 2 - 5, 5)).r == 0 surf = pg.transform.smoothscale(surface, size) assert int(surf.get_width() / width) == 2 and int(surf.get_height() / height) == 2 assert surf.get_at((5, 5)).r == 255 and surf.get_at((width * 2 - 5, 5)).r == 0 surf = pg.transform.scale2x(surface) assert int(surf.get_width() / width) == 2 and int(surf.get_height() / height) == 2 assert surf.get_at((5, 5)).r == 255 and surf.get_at((width * 2 - 5, 5)).r == 0 def test_transform_flip(): surface.fill((0, 0, 0)) surface.fill((255, 0, 0), (0, 0, width // 2, height)) surf = pg.transform.flip(surface, True, False) assert surf.get_size() == (width, height) assert surf.get_at((5, 5)).r == 0 and surf.get_at((width - 5, 5)).r == 255 surf = pg.transform.flip(surface, False, True) assert surf.get_size() == (width, height) assert surf.get_at((5, 5)).r == 255 and surf.get_at((width - 5, 5)).r == 0 surf = pg.transform.flip(surface, True, True) assert surf.get_size() == (width, height) assert surf.get_at((5, 5)).r == 0 and surf.get_at((width - 5, 5)).r == 255
__author__ = 'vcaen' class Item(object): def __init__(self, title, short_desc, desc, picture): self.title = title self.short_desc = short_desc self.desc = desc self.picture = picture class Work(Item): def __init__(self, title, short_desc, desc, date_begin, date_end, company, picture): super(Work, self).__init__(title, short_desc, desc, picture) self.date_begin = date_begin self.date_end = date_end self.company = company class Project(Item): def __init__(self, title, short_desc, desc, picture, url): super(Project, self).__init__(title, short_desc, desc, picture) self.url = url class Education(Item): def __init__(self, school, degree, picture, date_begin, date_end, title="", short_desc="", desc=""): super(Education, self).__init__(title, short_desc, desc, picture) self.school = school self.degree = degree self.date_begin = date_begin self.date_end = date_end
__author__ = 'vcaen' class Item(object): def __init__(self, title, short_desc, desc, picture): self.title = title self.short_desc = short_desc self.desc = desc self.picture = picture class Work(Item): def __init__(self, title, short_desc, desc, date_begin, date_end, company, picture): super(Work, self).__init__(title, short_desc, desc, picture) self.date_begin = date_begin self.date_end = date_end self.company = company class Project(Item): def __init__(self, title, short_desc, desc, picture, url): super(Project, self).__init__(title, short_desc, desc, picture) self.url = url class Education(Item): def __init__(self, school, degree, picture, date_begin, date_end, title='', short_desc='', desc=''): super(Education, self).__init__(title, short_desc, desc, picture) self.school = school self.degree = degree self.date_begin = date_begin self.date_end = date_end
# https://leetcode.com/problems/counting-words-with-a-given-prefix/ class Solution: def prefixCount(self, words: List[str], pref: str) -> int: res = 0 for each in words: if len(each) >= len(pref): if each[:len(pref)] == pref: res += 1 return res
class Solution: def prefix_count(self, words: List[str], pref: str) -> int: res = 0 for each in words: if len(each) >= len(pref): if each[:len(pref)] == pref: res += 1 return res
class RollingHash: def __init__(self, text, pattern_size): self.text = text self.pattern_size = pattern_size self.hash = RollingHash.hash_text(text, pattern_size) self.start = 0 self.end = pattern_size self.alphabet = 26 def move_window(self): if self.end <= len(self.text) - 1: self.hash -= (ord(self.text[self.start]) - ord("a") + 1) * self.alphabet ** (self.pattern_size - 1) self.hash *= self.alphabet self.hash += ord(self.text[self.end]) - ord("a") + 1 self.start += 1 self.end += 1 def get_text_window(self): return self.text[self.start:self.end] @staticmethod def hash_text(text, limit, hash=0, alphabet=26): h = hash for i in range(0, limit): h += (ord(text[i]) - ord("a") + 1) * \ (alphabet ** (limit - i - 1)) return h def rabin_karp(pattern, text): res = [] if pattern == "" or text == "" or len(pattern) > len(text): return res pattern_hash = RollingHash.hash_text(pattern, len(pattern)) text_hash = RollingHash(text, len(pattern)) for i in range(0, len(text) - len(pattern) + 1): if text_hash.hash == pattern_hash and text_hash.get_text_window() == pattern: res.append(i) text_hash.move_window() return res
class Rollinghash: def __init__(self, text, pattern_size): self.text = text self.pattern_size = pattern_size self.hash = RollingHash.hash_text(text, pattern_size) self.start = 0 self.end = pattern_size self.alphabet = 26 def move_window(self): if self.end <= len(self.text) - 1: self.hash -= (ord(self.text[self.start]) - ord('a') + 1) * self.alphabet ** (self.pattern_size - 1) self.hash *= self.alphabet self.hash += ord(self.text[self.end]) - ord('a') + 1 self.start += 1 self.end += 1 def get_text_window(self): return self.text[self.start:self.end] @staticmethod def hash_text(text, limit, hash=0, alphabet=26): h = hash for i in range(0, limit): h += (ord(text[i]) - ord('a') + 1) * alphabet ** (limit - i - 1) return h def rabin_karp(pattern, text): res = [] if pattern == '' or text == '' or len(pattern) > len(text): return res pattern_hash = RollingHash.hash_text(pattern, len(pattern)) text_hash = rolling_hash(text, len(pattern)) for i in range(0, len(text) - len(pattern) + 1): if text_hash.hash == pattern_hash and text_hash.get_text_window() == pattern: res.append(i) text_hash.move_window() return res
class ImageAdapter: @staticmethod def to_network_input(dataset): return (dataset - 127.5) / 127.5 @staticmethod def to_image(normalized_images): images = normalized_images * 127.5 + 127.5 return images.astype(int)
class Imageadapter: @staticmethod def to_network_input(dataset): return (dataset - 127.5) / 127.5 @staticmethod def to_image(normalized_images): images = normalized_images * 127.5 + 127.5 return images.astype(int)
BULBASAUR = 0x01 IVYSAUR = 0x02 VENUSAUR = 0x03 CHARMANDER = 0x04 CHARMELEON = 0x05 CHARIZARD = 0x06 SQUIRTLE = 0x07 WARTORTLE = 0x08 BLASTOISE = 0x09 CATERPIE = 0x0a METAPOD = 0x0b BUTTERFREE = 0x0c WEEDLE = 0x0d KAKUNA = 0x0e BEEDRILL = 0x0f PIDGEY = 0x10 PIDGEOTTO = 0x11 PIDGEOT = 0x12 RATTATA = 0x13 RATICATE = 0x14 SPEAROW = 0x15 FEAROW = 0x16 EKANS = 0x17 ARBOK = 0x18 PIKACHU = 0x19 RAICHU = 0x1a SANDSHREW = 0x1b SANDSLASH = 0x1c NIDORAN_F = 0x1d NIDORINA = 0x1e NIDOQUEEN = 0x1f NIDORAN_M = 0x20 NIDORINO = 0x21 NIDOKING = 0x22 CLEFAIRY = 0x23 CLEFABLE = 0x24 VULPIX = 0x25 NINETALES = 0x26 JIGGLYPUFF = 0x27 WIGGLYTUFF = 0x28 ZUBAT = 0x29 GOLBAT = 0x2a ODDISH = 0x2b GLOOM = 0x2c VILEPLUME = 0x2d PARAS = 0x2e PARASECT = 0x2f VENONAT = 0x30 VENOMOTH = 0x31 DIGLETT = 0x32 DUGTRIO = 0x33 MEOWTH = 0x34 PERSIAN = 0x35 PSYDUCK = 0x36 GOLDUCK = 0x37 MANKEY = 0x38 PRIMEAPE = 0x39 GROWLITHE = 0x3a ARCANINE = 0x3b POLIWAG = 0x3c POLIWHIRL = 0x3d POLIWRATH = 0x3e ABRA = 0x3f KADABRA = 0x40 ALAKAZAM = 0x41 MACHOP = 0x42 MACHOKE = 0x43 MACHAMP = 0x44 BELLSPROUT = 0x45 WEEPINBELL = 0x46 VICTREEBEL = 0x47 TENTACOOL = 0x48 TENTACRUEL = 0x49 GEODUDE = 0x4a GRAVELER = 0x4b GOLEM = 0x4c PONYTA = 0x4d RAPIDASH = 0x4e SLOWPOKE = 0x4f SLOWBRO = 0x50 MAGNEMITE = 0x51 MAGNETON = 0x52 FARFETCH_D = 0x53 DODUO = 0x54 DODRIO = 0x55 SEEL = 0x56 DEWGONG = 0x57 GRIMER = 0x58 MUK = 0x59 SHELLDER = 0x5a CLOYSTER = 0x5b GASTLY = 0x5c HAUNTER = 0x5d GENGAR = 0x5e ONIX = 0x5f DROWZEE = 0x60 HYPNO = 0x61 KRABBY = 0x62 KINGLER = 0x63 VOLTORB = 0x64 ELECTRODE = 0x65 EXEGGCUTE = 0x66 EXEGGUTOR = 0x67 CUBONE = 0x68 MAROWAK = 0x69 HITMONLEE = 0x6a HITMONCHAN = 0x6b LICKITUNG = 0x6c KOFFING = 0x6d WEEZING = 0x6e RHYHORN = 0x6f RHYDON = 0x70 CHANSEY = 0x71 TANGELA = 0x72 KANGASKHAN = 0x73 HORSEA = 0x74 SEADRA = 0x75 GOLDEEN = 0x76 SEAKING = 0x77 STARYU = 0x78 STARMIE = 0x79 MR__MIME = 0x7a SCYTHER = 0x7b JYNX = 0x7c ELECTABUZZ = 0x7d MAGMAR = 0x7e PINSIR = 0x7f TAUROS = 0x80 MAGIKARP = 0x81 GYARADOS = 0x82 LAPRAS = 0x83 DITTO = 0x84 EEVEE = 0x85 VAPOREON = 0x86 JOLTEON = 0x87 FLAREON = 0x88 PORYGON = 0x89 OMANYTE = 0x8a OMASTAR = 0x8b KABUTO = 0x8c KABUTOPS = 0x8d AERODACTYL = 0x8e SNORLAX = 0x8f ARTICUNO = 0x90 ZAPDOS = 0x91 MOLTRES = 0x92 DRATINI = 0x93 DRAGONAIR = 0x94 DRAGONITE = 0x95 MEWTWO = 0x96 MEW = 0x97 CHIKORITA = 0x98 BAYLEEF = 0x99 MEGANIUM = 0x9a CYNDAQUIL = 0x9b QUILAVA = 0x9c TYPHLOSION = 0x9d TOTODILE = 0x9e CROCONAW = 0x9f FERALIGATR = 0xa0 SENTRET = 0xa1 FURRET = 0xa2 HOOTHOOT = 0xa3 NOCTOWL = 0xa4 LEDYBA = 0xa5 LEDIAN = 0xa6 SPINARAK = 0xa7 ARIADOS = 0xa8 CROBAT = 0xa9 CHINCHOU = 0xaa LANTURN = 0xab PICHU = 0xac CLEFFA = 0xad IGGLYBUFF = 0xae TOGEPI = 0xaf TOGETIC = 0xb0 NATU = 0xb1 XATU = 0xb2 MAREEP = 0xb3 FLAAFFY = 0xb4 AMPHAROS = 0xb5 BELLOSSOM = 0xb6 MARILL = 0xb7 AZUMARILL = 0xb8 SUDOWOODO = 0xb9 POLITOED = 0xba HOPPIP = 0xbb SKIPLOOM = 0xbc JUMPLUFF = 0xbd AIPOM = 0xbe SUNKERN = 0xbf SUNFLORA = 0xc0 YANMA = 0xc1 WOOPER = 0xc2 QUAGSIRE = 0xc3 ESPEON = 0xc4 UMBREON = 0xc5 MURKROW = 0xc6 SLOWKING = 0xc7 MISDREAVUS = 0xc8 UNOWN = 0xc9 WOBBUFFET = 0xca GIRAFARIG = 0xcb PINECO = 0xcc FORRETRESS = 0xcd DUNSPARCE = 0xce GLIGAR = 0xcf STEELIX = 0xd0 SNUBBULL = 0xd1 GRANBULL = 0xd2 QWILFISH = 0xd3 SCIZOR = 0xd4 SHUCKLE = 0xd5 HERACROSS = 0xd6 SNEASEL = 0xd7 TEDDIURSA = 0xd8 URSARING = 0xd9 SLUGMA = 0xda MAGCARGO = 0xdb SWINUB = 0xdc PILOSWINE = 0xdd CORSOLA = 0xde REMORAID = 0xdf OCTILLERY = 0xe0 DELIBIRD = 0xe1 MANTINE = 0xe2 SKARMORY = 0xe3 HOUNDOUR = 0xe4 HOUNDOOM = 0xe5 KINGDRA = 0xe6 PHANPY = 0xe7 DONPHAN = 0xe8 PORYGON2 = 0xe9 STANTLER = 0xea SMEARGLE = 0xeb TYROGUE = 0xec HITMONTOP = 0xed SMOOCHUM = 0xee ELEKID = 0xef MAGBY = 0xf0 MILTANK = 0xf1 BLISSEY = 0xf2 RAIKOU = 0xf3 ENTEI = 0xf4 SUICUNE = 0xf5 LARVITAR = 0xf6 PUPITAR = 0xf7 TYRANITAR = 0xf8 LUGIA = 0xf9 HO_OH = 0xfa CELEBI = 0xfb MON_FC = 0xfc EGG = 0xfd MON_FE = 0xfe MON_CONSTS = {"BULBASAUR": 0x01,"IVYSAUR": 0x02,"VENUSAUR": 0x03,"CHARMANDER": 0x04,"CHARMELEON": 0x05,"CHARIZARD": 0x06,"SQUIRTLE": 0x07,"WARTORTLE": 0x08,"BLASTOISE": 0x09,"CATERPIE": 0x0a,"METAPOD": 0x0b,"BUTTERFREE": 0x0c,"WEEDLE": 0x0d,"KAKUNA": 0x0e,"BEEDRILL": 0x0f,"PIDGEY": 0x10,"PIDGEOTTO": 0x11,"PIDGEOT": 0x12,"RATTATA": 0x13,"RATICATE": 0x14,"SPEAROW": 0x15,"FEAROW": 0x16,"EKANS": 0x17,"ARBOK": 0x18,"PIKACHU": 0x19,"RAICHU": 0x1a,"SANDSHREW": 0x1b,"SANDSLASH": 0x1c,"NIDORAN_F": 0x1d,"NIDORINA": 0x1e,"NIDOQUEEN": 0x1f,"NIDORAN_M": 0x20,"NIDORINO": 0x21,"NIDOKING": 0x22,"CLEFAIRY": 0x23,"CLEFABLE": 0x24,"VULPIX": 0x25,"NINETALES": 0x26,"JIGGLYPUFF": 0x27,"WIGGLYTUFF": 0x28,"ZUBAT": 0x29,"GOLBAT": 0x2a,"ODDISH": 0x2b,"GLOOM": 0x2c,"VILEPLUME": 0x2d,"PARAS": 0x2e,"PARASECT": 0x2f,"VENONAT": 0x30,"VENOMOTH": 0x31,"DIGLETT": 0x32,"DUGTRIO": 0x33,"MEOWTH": 0x34,"PERSIAN": 0x35,"PSYDUCK": 0x36,"GOLDUCK": 0x37,"MANKEY": 0x38,"PRIMEAPE": 0x39,"GROWLITHE": 0x3a,"ARCANINE": 0x3b,"POLIWAG": 0x3c,"POLIWHIRL": 0x3d,"POLIWRATH": 0x3e,"ABRA": 0x3f,"KADABRA": 0x40,"ALAKAZAM": 0x41,"MACHOP": 0x42,"MACHOKE": 0x43,"MACHAMP": 0x44,"BELLSPROUT": 0x45,"WEEPINBELL": 0x46,"VICTREEBEL": 0x47,"TENTACOOL": 0x48,"TENTACRUEL": 0x49,"GEODUDE": 0x4a,"GRAVELER": 0x4b,"GOLEM": 0x4c,"PONYTA": 0x4d,"RAPIDASH": 0x4e,"SLOWPOKE": 0x4f,"SLOWBRO": 0x50,"MAGNEMITE": 0x51,"MAGNETON": 0x52,"FARFETCH_D": 0x53,"DODUO": 0x54,"DODRIO": 0x55,"SEEL": 0x56,"DEWGONG": 0x57,"GRIMER": 0x58,"MUK": 0x59,"SHELLDER": 0x5a,"CLOYSTER": 0x5b,"GASTLY": 0x5c,"HAUNTER": 0x5d,"GENGAR": 0x5e,"ONIX": 0x5f,"DROWZEE": 0x60,"HYPNO": 0x61,"KRABBY": 0x62,"KINGLER": 0x63,"VOLTORB": 0x64,"ELECTRODE": 0x65,"EXEGGCUTE": 0x66,"EXEGGUTOR": 0x67,"CUBONE": 0x68,"MAROWAK": 0x69,"HITMONLEE": 0x6a,"HITMONCHAN": 0x6b,"LICKITUNG": 0x6c,"KOFFING": 0x6d,"WEEZING": 0x6e,"RHYHORN": 0x6f,"RHYDON": 0x70,"CHANSEY": 0x71,"TANGELA": 0x72,"KANGASKHAN": 0x73,"HORSEA": 0x74,"SEADRA": 0x75,"GOLDEEN": 0x76,"SEAKING": 0x77,"STARYU": 0x78,"STARMIE": 0x79,"MR__MIME": 0x7a,"SCYTHER": 0x7b,"JYNX": 0x7c,"ELECTABUZZ": 0x7d,"MAGMAR": 0x7e,"PINSIR": 0x7f,"TAUROS": 0x80,"MAGIKARP": 0x81,"GYARADOS": 0x82,"LAPRAS": 0x83,"DITTO": 0x84,"EEVEE": 0x85,"VAPOREON": 0x86,"JOLTEON": 0x87,"FLAREON": 0x88,"PORYGON": 0x89,"OMANYTE": 0x8a,"OMASTAR": 0x8b,"KABUTO": 0x8c,"KABUTOPS": 0x8d,"AERODACTYL": 0x8e,"SNORLAX": 0x8f,"ARTICUNO": 0x90,"ZAPDOS": 0x91,"MOLTRES": 0x92,"DRATINI": 0x93,"DRAGONAIR": 0x94,"DRAGONITE": 0x95,"MEWTWO": 0x96,"MEW": 0x97,"CHIKORITA": 0x98,"BAYLEEF": 0x99,"MEGANIUM": 0x9a,"CYNDAQUIL": 0x9b,"QUILAVA": 0x9c,"TYPHLOSION": 0x9d,"TOTODILE": 0x9e,"CROCONAW": 0x9f,"FERALIGATR": 0xa0,"SENTRET": 0xa1,"FURRET": 0xa2,"HOOTHOOT": 0xa3,"NOCTOWL": 0xa4,"LEDYBA": 0xa5,"LEDIAN": 0xa6,"SPINARAK": 0xa7,"ARIADOS": 0xa8,"CROBAT": 0xa9,"CHINCHOU": 0xaa,"LANTURN": 0xab,"PICHU": 0xac,"CLEFFA": 0xad,"IGGLYBUFF": 0xae,"TOGEPI": 0xaf,"TOGETIC": 0xb0,"NATU": 0xb1,"XATU": 0xb2,"MAREEP": 0xb3,"FLAAFFY": 0xb4,"AMPHAROS": 0xb5,"BELLOSSOM": 0xb6,"MARILL": 0xb7,"AZUMARILL": 0xb8,"SUDOWOODO": 0xb9,"POLITOED": 0xba,"HOPPIP": 0xbb,"SKIPLOOM": 0xbc,"JUMPLUFF": 0xbd,"AIPOM": 0xbe,"SUNKERN": 0xbf,"SUNFLORA": 0xc0,"YANMA": 0xc1,"WOOPER": 0xc2,"QUAGSIRE": 0xc3,"ESPEON": 0xc4,"UMBREON": 0xc5,"MURKROW": 0xc6,"SLOWKING": 0xc7,"MISDREAVUS": 0xc8,"UNOWN": 0xc9,"WOBBUFFET": 0xca,"GIRAFARIG": 0xcb,"PINECO": 0xcc,"FORRETRESS": 0xcd,"DUNSPARCE": 0xce,"GLIGAR": 0xcf,"STEELIX": 0xd0,"SNUBBULL": 0xd1,"GRANBULL": 0xd2,"QWILFISH": 0xd3,"SCIZOR": 0xd4,"SHUCKLE": 0xd5,"HERACROSS": 0xd6,"SNEASEL": 0xd7,"TEDDIURSA": 0xd8,"URSARING": 0xd9,"SLUGMA": 0xda,"MAGCARGO": 0xdb,"SWINUB": 0xdc,"PILOSWINE": 0xdd,"CORSOLA": 0xde,"REMORAID": 0xdf,"OCTILLERY": 0xe0,"DELIBIRD": 0xe1,"MANTINE": 0xe2,"SKARMORY": 0xe3,"HOUNDOUR": 0xe4,"HOUNDOOM": 0xe5,"KINGDRA": 0xe6,"PHANPY": 0xe7,"DONPHAN": 0xe8,"PORYGON2": 0xe9,"STANTLER": 0xea,"SMEARGLE": 0xeb,"TYROGUE": 0xec,"HITMONTOP": 0xed,"SMOOCHUM": 0xee,"ELEKID": 0xef,"MAGBY": 0xf0,"MILTANK": 0xf1,"BLISSEY": 0xf2,"RAIKOU": 0xf3,"ENTEI": 0xf4,"SUICUNE": 0xf5,"LARVITAR": 0xf6,"PUPITAR": 0xf7,"TYRANITAR": 0xf8,"LUGIA": 0xf9,"HO_OH": 0xfa,"CELEBI": 0xfb,"MON_FC": 0xfc,"EGG": 0xfd,"MON_FE": 0xfe} MON_CONSTS_REV = {x: y for y, x in MON_CONSTS.items()} EVOLUTION_LINES = {'BULBASAUR': ['BULBASAUR', 'IVYSAUR', 'VENUSAUR'], 'IVYSAUR': ['BULBASAUR', 'IVYSAUR', 'VENUSAUR'], 'VENUSAUR': ['BULBASAUR', 'IVYSAUR', 'VENUSAUR'], 'CHARMANDER': ['CHARMANDER', 'CHARMELEON', 'CHARIZARD'], 'CHARMELEON': ['CHARMANDER', 'CHARMELEON', 'CHARIZARD'], 'CHARIZARD': ['CHARMANDER', 'CHARMELEON', 'CHARIZARD'], 'SQUIRTLE': ['SQUIRTLE', 'WARTORTLE', 'BLASTOISE'], 'WARTORTLE': ['SQUIRTLE', 'WARTORTLE', 'BLASTOISE'], 'BLASTOISE': ['SQUIRTLE', 'WARTORTLE', 'BLASTOISE'], 'CATERPIE': ['CATERPIE', 'METAPOD', 'BUTTERFREE'], 'METAPOD': ['CATERPIE', 'METAPOD', 'BUTTERFREE'], 'BUTTERFREE': ['CATERPIE', 'METAPOD', 'BUTTERFREE'], 'WEEDLE': ['WEEDLE', 'KAKUNA', 'BEEDRILL'], 'KAKUNA': ['WEEDLE', 'KAKUNA', 'BEEDRILL'], 'BEEDRILL': ['WEEDLE', 'KAKUNA', 'BEEDRILL'], 'PIDGEY': ['PIDGEY', 'PIDGEOTTO', 'PIDGEOT'], 'PIDGEOTTO': ['PIDGEY', 'PIDGEOTTO', 'PIDGEOT'], 'PIDGEOT': ['PIDGEY', 'PIDGEOTTO', 'PIDGEOT'], 'RATTATA': ['RATTATA', 'RATICATE'], 'RATICATE': ['RATTATA', 'RATICATE'], 'SPEAROW': ['SPEAROW', 'FEAROW'], 'FEAROW': ['SPEAROW', 'FEAROW'], 'EKANS': ['EKANS', 'ARBOK'], 'ARBOK': ['EKANS', 'ARBOK'], 'PIKACHU': ['PICHU', 'PIKACHU', 'RAICHU'], 'RAICHU': ['PICHU', 'PIKACHU', 'RAICHU'], 'SANDSHREW': ['SANDSHREW', 'SANDSLASH'], 'SANDSLASH': ['SANDSHREW', 'SANDSLASH'], 'NIDORAN_F': ['NIDORAN_F', 'NIDORINA', 'NIDOQUEEN'], 'NIDORINA': ['NIDORAN_F', 'NIDORINA', 'NIDOQUEEN'], 'NIDOQUEEN': ['NIDORAN_F', 'NIDORINA', 'NIDOQUEEN'], 'NIDORAN_M': ['NIDORAN_M', 'NIDORINO', 'NIDOKING'], 'NIDORINO': ['NIDORAN_M', 'NIDORINO', 'NIDOKING'], 'NIDOKING': ['NIDORAN_M', 'NIDORINO', 'NIDOKING'], 'CLEFAIRY': ['CLEFFA', 'CLEFAIRY', 'CLEFABLE'], 'CLEFABLE': ['CLEFFA', 'CLEFAIRY', 'CLEFABLE'], 'VULPIX': ['VULPIX', 'NINETALES'], 'NINETALES': ['VULPIX', 'NINETALES'], 'JIGGLYPUFF': ['IGGLYBUFF', 'JIGGLYPUFF', 'WIGGLYTUFF'], 'WIGGLYTUFF': ['IGGLYBUFF', 'JIGGLYPUFF', 'WIGGLYTUFF'], 'ZUBAT': ['ZUBAT', 'GOLBAT', 'CROBAT'], 'GOLBAT': ['ZUBAT', 'GOLBAT', 'CROBAT'], 'CROBAT': ['ZUBAT', 'GOLBAT', 'CROBAT'], 'ODDISH': ['ODDISH', 'GLOOM', 'VILEPLUME', 'BELLOSSOM'], 'GLOOM': ['ODDISH', 'GLOOM', 'VILEPLUME', 'BELLOSSOM'], 'VILEPLUME': ['ODDISH', 'GLOOM', 'VILEPLUME', 'BELLOSSOM'], 'BELLOSSOM': ['ODDISH', 'GLOOM', 'VILEPLUME', 'BELLOSSOM'], 'PARAS': ['PARAS', 'PARASECT'], 'PARASECT': ['PARAS', 'PARASECT'], 'VENONAT': ['VENONAT', 'VENOMOTH'], 'VENOMOTH': ['VENONAT', 'VENOMOTH'], 'DIGLETT': ['DIGLETT', 'DUGTRIO'], 'DUGTRIO': ['DIGLETT', 'DUGTRIO'], 'MEOWTH': ['MEOWTH', 'PERSIAN'], 'PERSIAN': ['MEOWTH', 'PERSIAN'], 'PSYDUCK': ['PSYDUCK', 'GOLDUCK'], 'GOLDUCK': ['PSYDUCK', 'GOLDUCK'], 'MANKEY': ['MANKEY', 'PRIMEAPE'], 'PRIMEAPE': ['MANKEY', 'PRIMEAPE'], 'GROWLITHE': ['GROWLITHE', 'ARCANINE'], 'ARCANINE': ['GROWLITHE', 'ARCANINE'], 'POLIWAG': ['POLIWAG', 'POLIWHIRL', 'POLIWRATH', 'POLITOED'], 'POLIWHIRL': ['POLIWAG', 'POLIWHIRL', 'POLIWRATH', 'POLITOED'], 'POLIWRATH': ['POLIWAG', 'POLIWHIRL', 'POLIWRATH', 'POLITOED'], 'POLITOED': ['POLIWAG', 'POLIWHIRL', 'POLIWRATH', 'POLITOED'], 'ABRA': ['ABRA', 'KADABRA', 'ALAKAZAM'], 'KADABRA': ['ABRA', 'KADABRA', 'ALAKAZAM'], 'ALAKAZAM': ['ABRA', 'KADABRA', 'ALAKAZAM'], 'MACHOP': ['MACHOP', 'MACHOKE', 'MACHAMP'], 'MACHOKE': ['MACHOP', 'MACHOKE', 'MACHAMP'], 'MACHAMP': ['MACHOP', 'MACHOKE', 'MACHAMP'], 'BELLSPROUT': ['BELLSPROUT', 'WEEPINBELL', 'VICTREEBEL'], 'WEEPINBELL': ['BELLSPROUT', 'WEEPINBELL', 'VICTREEBEL'], 'VICTREEBEL': ['BELLSPROUT', 'WEEPINBELL', 'VICTREEBEL'], 'TENTACOOL': ['TENTACOOL', 'TENTACRUEL'], 'TENTACRUEL': ['TENTACOOL', 'TENTACRUEL'], 'GEODUDE': ['GEODUDE', 'GRAVELER', 'GOLEM'], 'GRAVELER': ['GEODUDE', 'GRAVELER', 'GOLEM'], 'GOLEM': ['GEODUDE', 'GRAVELER', 'GOLEM'], 'PONYTA': ['PONYTA', 'RAPIDASH'], 'RAPIDASH': ['PONYTA', 'RAPIDASH'], 'SLOWPOKE': ['SLOWPOKE', 'SLOWBRO', 'SLOWKING'], 'SLOWBRO': ['SLOWPOKE', 'SLOWBRO', 'SLOWKING'], 'SLOWKING': ['SLOWPOKE', 'SLOWBRO', 'SLOWKING'], 'MAGNEMITE': ['MAGNEMITE', 'MAGNETON'], 'MAGNETON': ['MAGNEMITE', 'MAGNETON'], 'FARFETCH_D': ['FARFETCH_D'], 'DODUO': ['DODUO', 'DODRIO'], 'DODRIO': ['DODUO', 'DODRIO'], 'SEEL': ['SEEL', 'DEWGONG'], 'DEWGONG': ['SEEL', 'DEWGONG'], 'GRIMER': ['GRIMER', 'MUK'], 'MUK': ['GRIMER', 'MUK'], 'SHELLDER': ['SHELLDER', 'CLOYSTER'], 'CLOYSTER': ['SHELLDER', 'CLOYSTER'], 'GASTLY': ['GASTLY', 'HAUNTER', 'GENGAR'], 'HAUNTER': ['GASTLY', 'HAUNTER', 'GENGAR'], 'GENGAR': ['GASTLY', 'HAUNTER', 'GENGAR'], 'ONIX': ['ONIX', 'STEELIX'], 'STEELIX': ['ONIX', 'STEELIX'], 'DROWZEE': ['DROWZEE', 'HYPNO'], 'HYPNO': ['DROWZEE', 'HYPNO'], 'KRABBY': ['KRABBY', 'KINGLER'], 'KINGLER': ['KRABBY', 'KINGLER'], 'VOLTORB': ['VOLTORB', 'ELECTRODE'], 'ELECTRODE': ['VOLTORB', 'ELECTRODE'], 'EXEGGCUTE': ['EXEGGCUTE', 'EXEGGUTOR'], 'EXEGGUTOR': ['EXEGGCUTE', 'EXEGGUTOR'], 'CUBONE': ['CUBONE', 'MAROWAK'], 'MAROWAK': ['CUBONE', 'MAROWAK'], 'HITMONLEE': ['TYROGUE', 'HITMONCHAN', 'HITMONLEE', 'HITMONTOP'], 'HITMONCHAN': ['TYROGUE', 'HITMONCHAN', 'HITMONLEE', 'HITMONTOP'], 'LICKITUNG': ['LICKITUNG'], 'KOFFING': ['KOFFING', 'WEEZING'], 'WEEZING': ['KOFFING', 'WEEZING'], 'RHYHORN': ['RHYHORN', 'RHYDON'], 'RHYDON': ['RHYHORN', 'RHYDON'], 'CHANSEY': ['CHANSEY', 'BLISSEY'], 'BLISSEY': ['CHANSEY', 'BLISSEY'], 'TANGELA': ['TANGELA'], 'KANGASKHAN': ['KANGASKHAN'], 'HORSEA': ['HORSEA', 'SEADRA', 'KINGDRA'], 'SEADRA': ['HORSEA', 'SEADRA', 'KINGDRA'], 'KINGDRA': ['HORSEA', 'SEADRA', 'KINGDRA'], 'GOLDEEN': ['GOLDEEN', 'SEAKING'], 'SEAKING': ['GOLDEEN', 'SEAKING'], 'STARYU': ['STARYU', 'STARMIE'], 'STARMIE': ['STARYU', 'STARMIE'], 'MR__MIME': ['MR__MIME'], 'SCYTHER': ['SCYTHER', 'SCIZOR'], 'SCIZOR': ['SCYTHER', 'SCIZOR'], 'JYNX': ['SMOOCHUM', 'JYNX'], 'ELECTABUZZ': ['ELEKID', 'ELECTABUZZ'], 'MAGMAR': ['MAGBY', 'MAGMAR'], 'PINSIR': ['PINSIR'], 'TAUROS': ['TAUROS'], 'MAGIKARP': ['MAGIKARP', 'GYARADOS'], 'GYARADOS': ['MAGIKARP', 'GYARADOS'], 'LAPRAS': ['LAPRAS'], 'DITTO': ['DITTO'], 'EEVEE': ['EEVEE', 'JOLTEON', 'VAPOREON', 'FLAREON', 'ESPEON', 'UMBREON'], 'JOLTEON': ['EEVEE', 'JOLTEON', 'VAPOREON', 'FLAREON', 'ESPEON', 'UMBREON'], 'VAPOREON': ['EEVEE', 'JOLTEON', 'VAPOREON', 'FLAREON', 'ESPEON', 'UMBREON'], 'FLAREON': ['EEVEE', 'JOLTEON', 'VAPOREON', 'FLAREON', 'ESPEON', 'UMBREON'], 'ESPEON': ['EEVEE', 'JOLTEON', 'VAPOREON', 'FLAREON', 'ESPEON', 'UMBREON'], 'UMBREON': ['EEVEE', 'JOLTEON', 'VAPOREON', 'FLAREON', 'ESPEON', 'UMBREON'], 'PORYGON': ['PORYGON', 'PORYGON2'], 'PORYGON2': ['PORYGON', 'PORYGON2'], 'OMANYTE': ['OMANYTE', 'OMASTAR'], 'OMASTAR': ['OMANYTE', 'OMASTAR'], 'KABUTO': ['KABUTO', 'KABUTOPS'], 'KABUTOPS': ['KABUTO', 'KABUTOPS'], 'AERODACTYL': ['AERODACTYL'], 'SNORLAX': ['SNORLAX'], 'ARTICUNO': ['ARTICUNO'], 'ZAPDOS': ['ZAPDOS'], 'MOLTRES': ['MOLTRES'], 'DRATINI': ['DRATINI', 'DRAGONAIR', 'DRAGONITE'], 'DRAGONAIR': ['DRATINI', 'DRAGONAIR', 'DRAGONITE'], 'DRAGONITE': ['DRATINI', 'DRAGONAIR', 'DRAGONITE'], 'MEWTWO': ['MEWTWO'], 'MEW': ['MEW'], 'CHIKORITA': ['CHIKORITA', 'BAYLEEF', 'MEGANIUM'], 'BAYLEEF': ['CHIKORITA', 'BAYLEEF', 'MEGANIUM'], 'MEGANIUM': ['CHIKORITA', 'BAYLEEF', 'MEGANIUM'], 'CYNDAQUIL': ['CYNDAQUIL', 'QUILAVA', 'TYPHLOSION'], 'QUILAVA': ['CYNDAQUIL', 'QUILAVA', 'TYPHLOSION'], 'TYPHLOSION': ['CYNDAQUIL', 'QUILAVA', 'TYPHLOSION'], 'TOTODILE': ['TOTODILE', 'CROCONAW', 'FERALIGATR'], 'CROCONAW': ['TOTODILE', 'CROCONAW', 'FERALIGATR'], 'FERALIGATR': ['TOTODILE', 'CROCONAW', 'FERALIGATR'], 'SENTRET': ['SENTRET', 'FURRET'], 'FURRET': ['SENTRET', 'FURRET'], 'HOOTHOOT': ['HOOTHOOT', 'NOCTOWL'], 'NOCTOWL': ['HOOTHOOT', 'NOCTOWL'], 'LEDYBA': ['LEDYBA', 'LEDIAN'], 'LEDIAN': ['LEDYBA', 'LEDIAN'], 'SPINARAK': ['SPINARAK', 'ARIADOS'], 'ARIADOS': ['SPINARAK', 'ARIADOS'], 'CHINCHOU': ['CHINCHOU', 'LANTURN'], 'LANTURN': ['CHINCHOU', 'LANTURN'], 'PICHU': ['PICHU', 'PIKACHU', 'RAICHU'], 'CLEFFA': ['CLEFFA', 'CLEFAIRY', 'CLEFABLE'], 'IGGLYBUFF': ['IGGLYBUFF', 'JIGGLYPUFF', 'WIGGLYTUFF'], 'TOGEPI': ['TOGEPI', 'TOGETIC'], 'TOGETIC': ['TOGEPI', 'TOGETIC'], 'NATU': ['NATU', 'XATU'], 'XATU': ['NATU', 'XATU'], 'MAREEP': ['MAREEP', 'FLAAFFY', 'AMPHAROS'], 'FLAAFFY': ['MAREEP', 'FLAAFFY', 'AMPHAROS'], 'AMPHAROS': ['MAREEP', 'FLAAFFY', 'AMPHAROS'], 'MARILL': ['MARILL', 'AZUMARILL'], 'AZUMARILL': ['MARILL', 'AZUMARILL'], 'SUDOWOODO': ['SUDOWOODO'], 'HOPPIP': ['HOPPIP', 'SKIPLOOM', 'JUMPLUFF'], 'SKIPLOOM': ['HOPPIP', 'SKIPLOOM', 'JUMPLUFF'], 'JUMPLUFF': ['HOPPIP', 'SKIPLOOM', 'JUMPLUFF'], 'AIPOM': ['AIPOM'], 'SUNKERN': ['SUNKERN', 'SUNFLORA'], 'SUNFLORA': ['SUNKERN', 'SUNFLORA'], 'YANMA': ['YANMA'], 'WOOPER': ['WOOPER', 'QUAGSIRE'], 'QUAGSIRE': ['WOOPER', 'QUAGSIRE'], 'MURKROW': ['MURKROW'], 'MISDREAVUS': ['MISDREAVUS'], 'UNOWN': ['UNOWN'], 'WOBBUFFET': ['WOBBUFFET'], 'GIRAFARIG': ['GIRAFARIG'], 'PINECO': ['PINECO', 'FORRETRESS'], 'FORRETRESS': ['PINECO', 'FORRETRESS'], 'DUNSPARCE': ['DUNSPARCE'], 'GLIGAR': ['GLIGAR'], 'SNUBBULL': ['SNUBBULL', 'GRANBULL'], 'GRANBULL': ['SNUBBULL', 'GRANBULL'], 'QWILFISH': ['QWILFISH'], 'SHUCKLE': ['SHUCKLE'], 'HERACROSS': ['HERACROSS'], 'SNEASEL': ['SNEASEL'], 'TEDDIURSA': ['TEDDIURSA', 'URSARING'], 'URSARING': ['TEDDIURSA', 'URSARING'], 'SLUGMA': ['SLUGMA', 'MAGCARGO'], 'MAGCARGO': ['SLUGMA', 'MAGCARGO'], 'SWINUB': ['SWINUB', 'PILOSWINE'], 'PILOSWINE': ['SWINUB', 'PILOSWINE'], 'CORSOLA': ['CORSOLA'], 'REMORAID': ['REMORAID', 'OCTILLERY'], 'OCTILLERY': ['REMORAID', 'OCTILLERY'], 'DELIBIRD': ['DELIBIRD'], 'MANTINE': ['MANTINE'], 'SKARMORY': ['SKARMORY'], 'HOUNDOUR': ['HOUNDOUR', 'HOUNDOOM'], 'HOUNDOOM': ['HOUNDOUR', 'HOUNDOOM'], 'PHANPY': ['PHANPY', 'DONPHAN'], 'DONPHAN': ['PHANPY', 'DONPHAN'], 'STANTLER': ['STANTLER'], 'SMEARGLE': ['SMEARGLE'], 'TYROGUE': ['TYROGUE', 'HITMONCHAN', 'HITMONLEE', 'HITMONTOP'], 'HITMONTOP': ['TYROGUE', 'HITMONCHAN', 'HITMONLEE', 'HITMONTOP'], 'SMOOCHUM': ['SMOOCHUM', 'JYNX'], 'ELEKID': ['ELEKID', 'ELECTABUZZ'], 'MAGBY': ['MAGBY', 'MAGMAR'], 'MILTANK': ['MILTANK'], 'RAIKOU': ['RAIKOU'], 'ENTEI': ['ENTEI'], 'SUICUNE': ['SUICUNE'], 'LARVITAR': ['LARVITAR', 'PUPITAR', 'TYRANITAR'], 'PUPITAR': ['LARVITAR', 'PUPITAR', 'TYRANITAR'], 'TYRANITAR': ['LARVITAR', 'PUPITAR', 'TYRANITAR'], 'LUGIA': ['LUGIA'], 'HO_OH': ['HO_OH'], 'CELEBI': ['CELEBI']}
bulbasaur = 1 ivysaur = 2 venusaur = 3 charmander = 4 charmeleon = 5 charizard = 6 squirtle = 7 wartortle = 8 blastoise = 9 caterpie = 10 metapod = 11 butterfree = 12 weedle = 13 kakuna = 14 beedrill = 15 pidgey = 16 pidgeotto = 17 pidgeot = 18 rattata = 19 raticate = 20 spearow = 21 fearow = 22 ekans = 23 arbok = 24 pikachu = 25 raichu = 26 sandshrew = 27 sandslash = 28 nidoran_f = 29 nidorina = 30 nidoqueen = 31 nidoran_m = 32 nidorino = 33 nidoking = 34 clefairy = 35 clefable = 36 vulpix = 37 ninetales = 38 jigglypuff = 39 wigglytuff = 40 zubat = 41 golbat = 42 oddish = 43 gloom = 44 vileplume = 45 paras = 46 parasect = 47 venonat = 48 venomoth = 49 diglett = 50 dugtrio = 51 meowth = 52 persian = 53 psyduck = 54 golduck = 55 mankey = 56 primeape = 57 growlithe = 58 arcanine = 59 poliwag = 60 poliwhirl = 61 poliwrath = 62 abra = 63 kadabra = 64 alakazam = 65 machop = 66 machoke = 67 machamp = 68 bellsprout = 69 weepinbell = 70 victreebel = 71 tentacool = 72 tentacruel = 73 geodude = 74 graveler = 75 golem = 76 ponyta = 77 rapidash = 78 slowpoke = 79 slowbro = 80 magnemite = 81 magneton = 82 farfetch_d = 83 doduo = 84 dodrio = 85 seel = 86 dewgong = 87 grimer = 88 muk = 89 shellder = 90 cloyster = 91 gastly = 92 haunter = 93 gengar = 94 onix = 95 drowzee = 96 hypno = 97 krabby = 98 kingler = 99 voltorb = 100 electrode = 101 exeggcute = 102 exeggutor = 103 cubone = 104 marowak = 105 hitmonlee = 106 hitmonchan = 107 lickitung = 108 koffing = 109 weezing = 110 rhyhorn = 111 rhydon = 112 chansey = 113 tangela = 114 kangaskhan = 115 horsea = 116 seadra = 117 goldeen = 118 seaking = 119 staryu = 120 starmie = 121 mr__mime = 122 scyther = 123 jynx = 124 electabuzz = 125 magmar = 126 pinsir = 127 tauros = 128 magikarp = 129 gyarados = 130 lapras = 131 ditto = 132 eevee = 133 vaporeon = 134 jolteon = 135 flareon = 136 porygon = 137 omanyte = 138 omastar = 139 kabuto = 140 kabutops = 141 aerodactyl = 142 snorlax = 143 articuno = 144 zapdos = 145 moltres = 146 dratini = 147 dragonair = 148 dragonite = 149 mewtwo = 150 mew = 151 chikorita = 152 bayleef = 153 meganium = 154 cyndaquil = 155 quilava = 156 typhlosion = 157 totodile = 158 croconaw = 159 feraligatr = 160 sentret = 161 furret = 162 hoothoot = 163 noctowl = 164 ledyba = 165 ledian = 166 spinarak = 167 ariados = 168 crobat = 169 chinchou = 170 lanturn = 171 pichu = 172 cleffa = 173 igglybuff = 174 togepi = 175 togetic = 176 natu = 177 xatu = 178 mareep = 179 flaaffy = 180 ampharos = 181 bellossom = 182 marill = 183 azumarill = 184 sudowoodo = 185 politoed = 186 hoppip = 187 skiploom = 188 jumpluff = 189 aipom = 190 sunkern = 191 sunflora = 192 yanma = 193 wooper = 194 quagsire = 195 espeon = 196 umbreon = 197 murkrow = 198 slowking = 199 misdreavus = 200 unown = 201 wobbuffet = 202 girafarig = 203 pineco = 204 forretress = 205 dunsparce = 206 gligar = 207 steelix = 208 snubbull = 209 granbull = 210 qwilfish = 211 scizor = 212 shuckle = 213 heracross = 214 sneasel = 215 teddiursa = 216 ursaring = 217 slugma = 218 magcargo = 219 swinub = 220 piloswine = 221 corsola = 222 remoraid = 223 octillery = 224 delibird = 225 mantine = 226 skarmory = 227 houndour = 228 houndoom = 229 kingdra = 230 phanpy = 231 donphan = 232 porygon2 = 233 stantler = 234 smeargle = 235 tyrogue = 236 hitmontop = 237 smoochum = 238 elekid = 239 magby = 240 miltank = 241 blissey = 242 raikou = 243 entei = 244 suicune = 245 larvitar = 246 pupitar = 247 tyranitar = 248 lugia = 249 ho_oh = 250 celebi = 251 mon_fc = 252 egg = 253 mon_fe = 254 mon_consts = {'BULBASAUR': 1, 'IVYSAUR': 2, 'VENUSAUR': 3, 'CHARMANDER': 4, 'CHARMELEON': 5, 'CHARIZARD': 6, 'SQUIRTLE': 7, 'WARTORTLE': 8, 'BLASTOISE': 9, 'CATERPIE': 10, 'METAPOD': 11, 'BUTTERFREE': 12, 'WEEDLE': 13, 'KAKUNA': 14, 'BEEDRILL': 15, 'PIDGEY': 16, 'PIDGEOTTO': 17, 'PIDGEOT': 18, 'RATTATA': 19, 'RATICATE': 20, 'SPEAROW': 21, 'FEAROW': 22, 'EKANS': 23, 'ARBOK': 24, 'PIKACHU': 25, 'RAICHU': 26, 'SANDSHREW': 27, 'SANDSLASH': 28, 'NIDORAN_F': 29, 'NIDORINA': 30, 'NIDOQUEEN': 31, 'NIDORAN_M': 32, 'NIDORINO': 33, 'NIDOKING': 34, 'CLEFAIRY': 35, 'CLEFABLE': 36, 'VULPIX': 37, 'NINETALES': 38, 'JIGGLYPUFF': 39, 'WIGGLYTUFF': 40, 'ZUBAT': 41, 'GOLBAT': 42, 'ODDISH': 43, 'GLOOM': 44, 'VILEPLUME': 45, 'PARAS': 46, 'PARASECT': 47, 'VENONAT': 48, 'VENOMOTH': 49, 'DIGLETT': 50, 'DUGTRIO': 51, 'MEOWTH': 52, 'PERSIAN': 53, 'PSYDUCK': 54, 'GOLDUCK': 55, 'MANKEY': 56, 'PRIMEAPE': 57, 'GROWLITHE': 58, 'ARCANINE': 59, 'POLIWAG': 60, 'POLIWHIRL': 61, 'POLIWRATH': 62, 'ABRA': 63, 'KADABRA': 64, 'ALAKAZAM': 65, 'MACHOP': 66, 'MACHOKE': 67, 'MACHAMP': 68, 'BELLSPROUT': 69, 'WEEPINBELL': 70, 'VICTREEBEL': 71, 'TENTACOOL': 72, 'TENTACRUEL': 73, 'GEODUDE': 74, 'GRAVELER': 75, 'GOLEM': 76, 'PONYTA': 77, 'RAPIDASH': 78, 'SLOWPOKE': 79, 'SLOWBRO': 80, 'MAGNEMITE': 81, 'MAGNETON': 82, 'FARFETCH_D': 83, 'DODUO': 84, 'DODRIO': 85, 'SEEL': 86, 'DEWGONG': 87, 'GRIMER': 88, 'MUK': 89, 'SHELLDER': 90, 'CLOYSTER': 91, 'GASTLY': 92, 'HAUNTER': 93, 'GENGAR': 94, 'ONIX': 95, 'DROWZEE': 96, 'HYPNO': 97, 'KRABBY': 98, 'KINGLER': 99, 'VOLTORB': 100, 'ELECTRODE': 101, 'EXEGGCUTE': 102, 'EXEGGUTOR': 103, 'CUBONE': 104, 'MAROWAK': 105, 'HITMONLEE': 106, 'HITMONCHAN': 107, 'LICKITUNG': 108, 'KOFFING': 109, 'WEEZING': 110, 'RHYHORN': 111, 'RHYDON': 112, 'CHANSEY': 113, 'TANGELA': 114, 'KANGASKHAN': 115, 'HORSEA': 116, 'SEADRA': 117, 'GOLDEEN': 118, 'SEAKING': 119, 'STARYU': 120, 'STARMIE': 121, 'MR__MIME': 122, 'SCYTHER': 123, 'JYNX': 124, 'ELECTABUZZ': 125, 'MAGMAR': 126, 'PINSIR': 127, 'TAUROS': 128, 'MAGIKARP': 129, 'GYARADOS': 130, 'LAPRAS': 131, 'DITTO': 132, 'EEVEE': 133, 'VAPOREON': 134, 'JOLTEON': 135, 'FLAREON': 136, 'PORYGON': 137, 'OMANYTE': 138, 'OMASTAR': 139, 'KABUTO': 140, 'KABUTOPS': 141, 'AERODACTYL': 142, 'SNORLAX': 143, 'ARTICUNO': 144, 'ZAPDOS': 145, 'MOLTRES': 146, 'DRATINI': 147, 'DRAGONAIR': 148, 'DRAGONITE': 149, 'MEWTWO': 150, 'MEW': 151, 'CHIKORITA': 152, 'BAYLEEF': 153, 'MEGANIUM': 154, 'CYNDAQUIL': 155, 'QUILAVA': 156, 'TYPHLOSION': 157, 'TOTODILE': 158, 'CROCONAW': 159, 'FERALIGATR': 160, 'SENTRET': 161, 'FURRET': 162, 'HOOTHOOT': 163, 'NOCTOWL': 164, 'LEDYBA': 165, 'LEDIAN': 166, 'SPINARAK': 167, 'ARIADOS': 168, 'CROBAT': 169, 'CHINCHOU': 170, 'LANTURN': 171, 'PICHU': 172, 'CLEFFA': 173, 'IGGLYBUFF': 174, 'TOGEPI': 175, 'TOGETIC': 176, 'NATU': 177, 'XATU': 178, 'MAREEP': 179, 'FLAAFFY': 180, 'AMPHAROS': 181, 'BELLOSSOM': 182, 'MARILL': 183, 'AZUMARILL': 184, 'SUDOWOODO': 185, 'POLITOED': 186, 'HOPPIP': 187, 'SKIPLOOM': 188, 'JUMPLUFF': 189, 'AIPOM': 190, 'SUNKERN': 191, 'SUNFLORA': 192, 'YANMA': 193, 'WOOPER': 194, 'QUAGSIRE': 195, 'ESPEON': 196, 'UMBREON': 197, 'MURKROW': 198, 'SLOWKING': 199, 'MISDREAVUS': 200, 'UNOWN': 201, 'WOBBUFFET': 202, 'GIRAFARIG': 203, 'PINECO': 204, 'FORRETRESS': 205, 'DUNSPARCE': 206, 'GLIGAR': 207, 'STEELIX': 208, 'SNUBBULL': 209, 'GRANBULL': 210, 'QWILFISH': 211, 'SCIZOR': 212, 'SHUCKLE': 213, 'HERACROSS': 214, 'SNEASEL': 215, 'TEDDIURSA': 216, 'URSARING': 217, 'SLUGMA': 218, 'MAGCARGO': 219, 'SWINUB': 220, 'PILOSWINE': 221, 'CORSOLA': 222, 'REMORAID': 223, 'OCTILLERY': 224, 'DELIBIRD': 225, 'MANTINE': 226, 'SKARMORY': 227, 'HOUNDOUR': 228, 'HOUNDOOM': 229, 'KINGDRA': 230, 'PHANPY': 231, 'DONPHAN': 232, 'PORYGON2': 233, 'STANTLER': 234, 'SMEARGLE': 235, 'TYROGUE': 236, 'HITMONTOP': 237, 'SMOOCHUM': 238, 'ELEKID': 239, 'MAGBY': 240, 'MILTANK': 241, 'BLISSEY': 242, 'RAIKOU': 243, 'ENTEI': 244, 'SUICUNE': 245, 'LARVITAR': 246, 'PUPITAR': 247, 'TYRANITAR': 248, 'LUGIA': 249, 'HO_OH': 250, 'CELEBI': 251, 'MON_FC': 252, 'EGG': 253, 'MON_FE': 254} mon_consts_rev = {x: y for (y, x) in MON_CONSTS.items()} evolution_lines = {'BULBASAUR': ['BULBASAUR', 'IVYSAUR', 'VENUSAUR'], 'IVYSAUR': ['BULBASAUR', 'IVYSAUR', 'VENUSAUR'], 'VENUSAUR': ['BULBASAUR', 'IVYSAUR', 'VENUSAUR'], 'CHARMANDER': ['CHARMANDER', 'CHARMELEON', 'CHARIZARD'], 'CHARMELEON': ['CHARMANDER', 'CHARMELEON', 'CHARIZARD'], 'CHARIZARD': ['CHARMANDER', 'CHARMELEON', 'CHARIZARD'], 'SQUIRTLE': ['SQUIRTLE', 'WARTORTLE', 'BLASTOISE'], 'WARTORTLE': ['SQUIRTLE', 'WARTORTLE', 'BLASTOISE'], 'BLASTOISE': ['SQUIRTLE', 'WARTORTLE', 'BLASTOISE'], 'CATERPIE': ['CATERPIE', 'METAPOD', 'BUTTERFREE'], 'METAPOD': ['CATERPIE', 'METAPOD', 'BUTTERFREE'], 'BUTTERFREE': ['CATERPIE', 'METAPOD', 'BUTTERFREE'], 'WEEDLE': ['WEEDLE', 'KAKUNA', 'BEEDRILL'], 'KAKUNA': ['WEEDLE', 'KAKUNA', 'BEEDRILL'], 'BEEDRILL': ['WEEDLE', 'KAKUNA', 'BEEDRILL'], 'PIDGEY': ['PIDGEY', 'PIDGEOTTO', 'PIDGEOT'], 'PIDGEOTTO': ['PIDGEY', 'PIDGEOTTO', 'PIDGEOT'], 'PIDGEOT': ['PIDGEY', 'PIDGEOTTO', 'PIDGEOT'], 'RATTATA': ['RATTATA', 'RATICATE'], 'RATICATE': ['RATTATA', 'RATICATE'], 'SPEAROW': ['SPEAROW', 'FEAROW'], 'FEAROW': ['SPEAROW', 'FEAROW'], 'EKANS': ['EKANS', 'ARBOK'], 'ARBOK': ['EKANS', 'ARBOK'], 'PIKACHU': ['PICHU', 'PIKACHU', 'RAICHU'], 'RAICHU': ['PICHU', 'PIKACHU', 'RAICHU'], 'SANDSHREW': ['SANDSHREW', 'SANDSLASH'], 'SANDSLASH': ['SANDSHREW', 'SANDSLASH'], 'NIDORAN_F': ['NIDORAN_F', 'NIDORINA', 'NIDOQUEEN'], 'NIDORINA': ['NIDORAN_F', 'NIDORINA', 'NIDOQUEEN'], 'NIDOQUEEN': ['NIDORAN_F', 'NIDORINA', 'NIDOQUEEN'], 'NIDORAN_M': ['NIDORAN_M', 'NIDORINO', 'NIDOKING'], 'NIDORINO': ['NIDORAN_M', 'NIDORINO', 'NIDOKING'], 'NIDOKING': ['NIDORAN_M', 'NIDORINO', 'NIDOKING'], 'CLEFAIRY': ['CLEFFA', 'CLEFAIRY', 'CLEFABLE'], 'CLEFABLE': ['CLEFFA', 'CLEFAIRY', 'CLEFABLE'], 'VULPIX': ['VULPIX', 'NINETALES'], 'NINETALES': ['VULPIX', 'NINETALES'], 'JIGGLYPUFF': ['IGGLYBUFF', 'JIGGLYPUFF', 'WIGGLYTUFF'], 'WIGGLYTUFF': ['IGGLYBUFF', 'JIGGLYPUFF', 'WIGGLYTUFF'], 'ZUBAT': ['ZUBAT', 'GOLBAT', 'CROBAT'], 'GOLBAT': ['ZUBAT', 'GOLBAT', 'CROBAT'], 'CROBAT': ['ZUBAT', 'GOLBAT', 'CROBAT'], 'ODDISH': ['ODDISH', 'GLOOM', 'VILEPLUME', 'BELLOSSOM'], 'GLOOM': ['ODDISH', 'GLOOM', 'VILEPLUME', 'BELLOSSOM'], 'VILEPLUME': ['ODDISH', 'GLOOM', 'VILEPLUME', 'BELLOSSOM'], 'BELLOSSOM': ['ODDISH', 'GLOOM', 'VILEPLUME', 'BELLOSSOM'], 'PARAS': ['PARAS', 'PARASECT'], 'PARASECT': ['PARAS', 'PARASECT'], 'VENONAT': ['VENONAT', 'VENOMOTH'], 'VENOMOTH': ['VENONAT', 'VENOMOTH'], 'DIGLETT': ['DIGLETT', 'DUGTRIO'], 'DUGTRIO': ['DIGLETT', 'DUGTRIO'], 'MEOWTH': ['MEOWTH', 'PERSIAN'], 'PERSIAN': ['MEOWTH', 'PERSIAN'], 'PSYDUCK': ['PSYDUCK', 'GOLDUCK'], 'GOLDUCK': ['PSYDUCK', 'GOLDUCK'], 'MANKEY': ['MANKEY', 'PRIMEAPE'], 'PRIMEAPE': ['MANKEY', 'PRIMEAPE'], 'GROWLITHE': ['GROWLITHE', 'ARCANINE'], 'ARCANINE': ['GROWLITHE', 'ARCANINE'], 'POLIWAG': ['POLIWAG', 'POLIWHIRL', 'POLIWRATH', 'POLITOED'], 'POLIWHIRL': ['POLIWAG', 'POLIWHIRL', 'POLIWRATH', 'POLITOED'], 'POLIWRATH': ['POLIWAG', 'POLIWHIRL', 'POLIWRATH', 'POLITOED'], 'POLITOED': ['POLIWAG', 'POLIWHIRL', 'POLIWRATH', 'POLITOED'], 'ABRA': ['ABRA', 'KADABRA', 'ALAKAZAM'], 'KADABRA': ['ABRA', 'KADABRA', 'ALAKAZAM'], 'ALAKAZAM': ['ABRA', 'KADABRA', 'ALAKAZAM'], 'MACHOP': ['MACHOP', 'MACHOKE', 'MACHAMP'], 'MACHOKE': ['MACHOP', 'MACHOKE', 'MACHAMP'], 'MACHAMP': ['MACHOP', 'MACHOKE', 'MACHAMP'], 'BELLSPROUT': ['BELLSPROUT', 'WEEPINBELL', 'VICTREEBEL'], 'WEEPINBELL': ['BELLSPROUT', 'WEEPINBELL', 'VICTREEBEL'], 'VICTREEBEL': ['BELLSPROUT', 'WEEPINBELL', 'VICTREEBEL'], 'TENTACOOL': ['TENTACOOL', 'TENTACRUEL'], 'TENTACRUEL': ['TENTACOOL', 'TENTACRUEL'], 'GEODUDE': ['GEODUDE', 'GRAVELER', 'GOLEM'], 'GRAVELER': ['GEODUDE', 'GRAVELER', 'GOLEM'], 'GOLEM': ['GEODUDE', 'GRAVELER', 'GOLEM'], 'PONYTA': ['PONYTA', 'RAPIDASH'], 'RAPIDASH': ['PONYTA', 'RAPIDASH'], 'SLOWPOKE': ['SLOWPOKE', 'SLOWBRO', 'SLOWKING'], 'SLOWBRO': ['SLOWPOKE', 'SLOWBRO', 'SLOWKING'], 'SLOWKING': ['SLOWPOKE', 'SLOWBRO', 'SLOWKING'], 'MAGNEMITE': ['MAGNEMITE', 'MAGNETON'], 'MAGNETON': ['MAGNEMITE', 'MAGNETON'], 'FARFETCH_D': ['FARFETCH_D'], 'DODUO': ['DODUO', 'DODRIO'], 'DODRIO': ['DODUO', 'DODRIO'], 'SEEL': ['SEEL', 'DEWGONG'], 'DEWGONG': ['SEEL', 'DEWGONG'], 'GRIMER': ['GRIMER', 'MUK'], 'MUK': ['GRIMER', 'MUK'], 'SHELLDER': ['SHELLDER', 'CLOYSTER'], 'CLOYSTER': ['SHELLDER', 'CLOYSTER'], 'GASTLY': ['GASTLY', 'HAUNTER', 'GENGAR'], 'HAUNTER': ['GASTLY', 'HAUNTER', 'GENGAR'], 'GENGAR': ['GASTLY', 'HAUNTER', 'GENGAR'], 'ONIX': ['ONIX', 'STEELIX'], 'STEELIX': ['ONIX', 'STEELIX'], 'DROWZEE': ['DROWZEE', 'HYPNO'], 'HYPNO': ['DROWZEE', 'HYPNO'], 'KRABBY': ['KRABBY', 'KINGLER'], 'KINGLER': ['KRABBY', 'KINGLER'], 'VOLTORB': ['VOLTORB', 'ELECTRODE'], 'ELECTRODE': ['VOLTORB', 'ELECTRODE'], 'EXEGGCUTE': ['EXEGGCUTE', 'EXEGGUTOR'], 'EXEGGUTOR': ['EXEGGCUTE', 'EXEGGUTOR'], 'CUBONE': ['CUBONE', 'MAROWAK'], 'MAROWAK': ['CUBONE', 'MAROWAK'], 'HITMONLEE': ['TYROGUE', 'HITMONCHAN', 'HITMONLEE', 'HITMONTOP'], 'HITMONCHAN': ['TYROGUE', 'HITMONCHAN', 'HITMONLEE', 'HITMONTOP'], 'LICKITUNG': ['LICKITUNG'], 'KOFFING': ['KOFFING', 'WEEZING'], 'WEEZING': ['KOFFING', 'WEEZING'], 'RHYHORN': ['RHYHORN', 'RHYDON'], 'RHYDON': ['RHYHORN', 'RHYDON'], 'CHANSEY': ['CHANSEY', 'BLISSEY'], 'BLISSEY': ['CHANSEY', 'BLISSEY'], 'TANGELA': ['TANGELA'], 'KANGASKHAN': ['KANGASKHAN'], 'HORSEA': ['HORSEA', 'SEADRA', 'KINGDRA'], 'SEADRA': ['HORSEA', 'SEADRA', 'KINGDRA'], 'KINGDRA': ['HORSEA', 'SEADRA', 'KINGDRA'], 'GOLDEEN': ['GOLDEEN', 'SEAKING'], 'SEAKING': ['GOLDEEN', 'SEAKING'], 'STARYU': ['STARYU', 'STARMIE'], 'STARMIE': ['STARYU', 'STARMIE'], 'MR__MIME': ['MR__MIME'], 'SCYTHER': ['SCYTHER', 'SCIZOR'], 'SCIZOR': ['SCYTHER', 'SCIZOR'], 'JYNX': ['SMOOCHUM', 'JYNX'], 'ELECTABUZZ': ['ELEKID', 'ELECTABUZZ'], 'MAGMAR': ['MAGBY', 'MAGMAR'], 'PINSIR': ['PINSIR'], 'TAUROS': ['TAUROS'], 'MAGIKARP': ['MAGIKARP', 'GYARADOS'], 'GYARADOS': ['MAGIKARP', 'GYARADOS'], 'LAPRAS': ['LAPRAS'], 'DITTO': ['DITTO'], 'EEVEE': ['EEVEE', 'JOLTEON', 'VAPOREON', 'FLAREON', 'ESPEON', 'UMBREON'], 'JOLTEON': ['EEVEE', 'JOLTEON', 'VAPOREON', 'FLAREON', 'ESPEON', 'UMBREON'], 'VAPOREON': ['EEVEE', 'JOLTEON', 'VAPOREON', 'FLAREON', 'ESPEON', 'UMBREON'], 'FLAREON': ['EEVEE', 'JOLTEON', 'VAPOREON', 'FLAREON', 'ESPEON', 'UMBREON'], 'ESPEON': ['EEVEE', 'JOLTEON', 'VAPOREON', 'FLAREON', 'ESPEON', 'UMBREON'], 'UMBREON': ['EEVEE', 'JOLTEON', 'VAPOREON', 'FLAREON', 'ESPEON', 'UMBREON'], 'PORYGON': ['PORYGON', 'PORYGON2'], 'PORYGON2': ['PORYGON', 'PORYGON2'], 'OMANYTE': ['OMANYTE', 'OMASTAR'], 'OMASTAR': ['OMANYTE', 'OMASTAR'], 'KABUTO': ['KABUTO', 'KABUTOPS'], 'KABUTOPS': ['KABUTO', 'KABUTOPS'], 'AERODACTYL': ['AERODACTYL'], 'SNORLAX': ['SNORLAX'], 'ARTICUNO': ['ARTICUNO'], 'ZAPDOS': ['ZAPDOS'], 'MOLTRES': ['MOLTRES'], 'DRATINI': ['DRATINI', 'DRAGONAIR', 'DRAGONITE'], 'DRAGONAIR': ['DRATINI', 'DRAGONAIR', 'DRAGONITE'], 'DRAGONITE': ['DRATINI', 'DRAGONAIR', 'DRAGONITE'], 'MEWTWO': ['MEWTWO'], 'MEW': ['MEW'], 'CHIKORITA': ['CHIKORITA', 'BAYLEEF', 'MEGANIUM'], 'BAYLEEF': ['CHIKORITA', 'BAYLEEF', 'MEGANIUM'], 'MEGANIUM': ['CHIKORITA', 'BAYLEEF', 'MEGANIUM'], 'CYNDAQUIL': ['CYNDAQUIL', 'QUILAVA', 'TYPHLOSION'], 'QUILAVA': ['CYNDAQUIL', 'QUILAVA', 'TYPHLOSION'], 'TYPHLOSION': ['CYNDAQUIL', 'QUILAVA', 'TYPHLOSION'], 'TOTODILE': ['TOTODILE', 'CROCONAW', 'FERALIGATR'], 'CROCONAW': ['TOTODILE', 'CROCONAW', 'FERALIGATR'], 'FERALIGATR': ['TOTODILE', 'CROCONAW', 'FERALIGATR'], 'SENTRET': ['SENTRET', 'FURRET'], 'FURRET': ['SENTRET', 'FURRET'], 'HOOTHOOT': ['HOOTHOOT', 'NOCTOWL'], 'NOCTOWL': ['HOOTHOOT', 'NOCTOWL'], 'LEDYBA': ['LEDYBA', 'LEDIAN'], 'LEDIAN': ['LEDYBA', 'LEDIAN'], 'SPINARAK': ['SPINARAK', 'ARIADOS'], 'ARIADOS': ['SPINARAK', 'ARIADOS'], 'CHINCHOU': ['CHINCHOU', 'LANTURN'], 'LANTURN': ['CHINCHOU', 'LANTURN'], 'PICHU': ['PICHU', 'PIKACHU', 'RAICHU'], 'CLEFFA': ['CLEFFA', 'CLEFAIRY', 'CLEFABLE'], 'IGGLYBUFF': ['IGGLYBUFF', 'JIGGLYPUFF', 'WIGGLYTUFF'], 'TOGEPI': ['TOGEPI', 'TOGETIC'], 'TOGETIC': ['TOGEPI', 'TOGETIC'], 'NATU': ['NATU', 'XATU'], 'XATU': ['NATU', 'XATU'], 'MAREEP': ['MAREEP', 'FLAAFFY', 'AMPHAROS'], 'FLAAFFY': ['MAREEP', 'FLAAFFY', 'AMPHAROS'], 'AMPHAROS': ['MAREEP', 'FLAAFFY', 'AMPHAROS'], 'MARILL': ['MARILL', 'AZUMARILL'], 'AZUMARILL': ['MARILL', 'AZUMARILL'], 'SUDOWOODO': ['SUDOWOODO'], 'HOPPIP': ['HOPPIP', 'SKIPLOOM', 'JUMPLUFF'], 'SKIPLOOM': ['HOPPIP', 'SKIPLOOM', 'JUMPLUFF'], 'JUMPLUFF': ['HOPPIP', 'SKIPLOOM', 'JUMPLUFF'], 'AIPOM': ['AIPOM'], 'SUNKERN': ['SUNKERN', 'SUNFLORA'], 'SUNFLORA': ['SUNKERN', 'SUNFLORA'], 'YANMA': ['YANMA'], 'WOOPER': ['WOOPER', 'QUAGSIRE'], 'QUAGSIRE': ['WOOPER', 'QUAGSIRE'], 'MURKROW': ['MURKROW'], 'MISDREAVUS': ['MISDREAVUS'], 'UNOWN': ['UNOWN'], 'WOBBUFFET': ['WOBBUFFET'], 'GIRAFARIG': ['GIRAFARIG'], 'PINECO': ['PINECO', 'FORRETRESS'], 'FORRETRESS': ['PINECO', 'FORRETRESS'], 'DUNSPARCE': ['DUNSPARCE'], 'GLIGAR': ['GLIGAR'], 'SNUBBULL': ['SNUBBULL', 'GRANBULL'], 'GRANBULL': ['SNUBBULL', 'GRANBULL'], 'QWILFISH': ['QWILFISH'], 'SHUCKLE': ['SHUCKLE'], 'HERACROSS': ['HERACROSS'], 'SNEASEL': ['SNEASEL'], 'TEDDIURSA': ['TEDDIURSA', 'URSARING'], 'URSARING': ['TEDDIURSA', 'URSARING'], 'SLUGMA': ['SLUGMA', 'MAGCARGO'], 'MAGCARGO': ['SLUGMA', 'MAGCARGO'], 'SWINUB': ['SWINUB', 'PILOSWINE'], 'PILOSWINE': ['SWINUB', 'PILOSWINE'], 'CORSOLA': ['CORSOLA'], 'REMORAID': ['REMORAID', 'OCTILLERY'], 'OCTILLERY': ['REMORAID', 'OCTILLERY'], 'DELIBIRD': ['DELIBIRD'], 'MANTINE': ['MANTINE'], 'SKARMORY': ['SKARMORY'], 'HOUNDOUR': ['HOUNDOUR', 'HOUNDOOM'], 'HOUNDOOM': ['HOUNDOUR', 'HOUNDOOM'], 'PHANPY': ['PHANPY', 'DONPHAN'], 'DONPHAN': ['PHANPY', 'DONPHAN'], 'STANTLER': ['STANTLER'], 'SMEARGLE': ['SMEARGLE'], 'TYROGUE': ['TYROGUE', 'HITMONCHAN', 'HITMONLEE', 'HITMONTOP'], 'HITMONTOP': ['TYROGUE', 'HITMONCHAN', 'HITMONLEE', 'HITMONTOP'], 'SMOOCHUM': ['SMOOCHUM', 'JYNX'], 'ELEKID': ['ELEKID', 'ELECTABUZZ'], 'MAGBY': ['MAGBY', 'MAGMAR'], 'MILTANK': ['MILTANK'], 'RAIKOU': ['RAIKOU'], 'ENTEI': ['ENTEI'], 'SUICUNE': ['SUICUNE'], 'LARVITAR': ['LARVITAR', 'PUPITAR', 'TYRANITAR'], 'PUPITAR': ['LARVITAR', 'PUPITAR', 'TYRANITAR'], 'TYRANITAR': ['LARVITAR', 'PUPITAR', 'TYRANITAR'], 'LUGIA': ['LUGIA'], 'HO_OH': ['HO_OH'], 'CELEBI': ['CELEBI']}
input() A = {int(param) for param in input().split()} B = {int(param) for param in input().split()} print(len(A-B)) for i in sorted(A-B): print(i, end = ' ')
input() a = {int(param) for param in input().split()} b = {int(param) for param in input().split()} print(len(A - B)) for i in sorted(A - B): print(i, end=' ')
languages = ['Chamorro', 'Tagalog', 'English', 'russian'] print(languages) languages.append('Spanish') print(languages) languages.insert(0, 'Finish') print(languages) del languages[0] print(languages) popped_language = languages.pop(0) print(languages) print(popped_language) popped_language = languages.pop(0) print(languages) print(popped_language) languages.remove('English') print(languages) fluent_language = 'russian' languages.remove(fluent_language) print(languages) print(fluent_language.title() + " is my fluent language.")
languages = ['Chamorro', 'Tagalog', 'English', 'russian'] print(languages) languages.append('Spanish') print(languages) languages.insert(0, 'Finish') print(languages) del languages[0] print(languages) popped_language = languages.pop(0) print(languages) print(popped_language) popped_language = languages.pop(0) print(languages) print(popped_language) languages.remove('English') print(languages) fluent_language = 'russian' languages.remove(fluent_language) print(languages) print(fluent_language.title() + ' is my fluent language.')
''' Created on Oct 5, 2011 @author: IslamM '''
""" Created on Oct 5, 2011 @author: IslamM """
SOURCES = { "activity.task.error.generic": "CommCareAndroid", "app.handled.error.explanation": "CommCareAndroid", "app.handled.error.title": "CommCareAndroid", "app.key.request.deny": "CommCareAndroid", "app.key.request.grant": "CommCareAndroid", "app.key.request.message": "CommCareAndroid", "app.menu.display.cond.bad.xpath": "CommCareAndroid", "app.menu.display.cond.xpath.err": "CommCareAndroid", "app.storage.missing.button": "CommCareAndroid", "app.storage.missing.message": "CommCareAndroid", "app.storage.missing.title": "CommCareAndroid", "app.workflow.forms.delete": "CommCareAndroid", "app.workflow.forms.fetch": "CommCareAndroid", "app.workflow.forms.open": "CommCareAndroid", "app.workflow.forms.quarantine.report": "CommCareAndroid", "app.workflow.forms.restore": "CommCareAndroid", "app.workflow.forms.scan": "CommCareAndroid", "app.workflow.forms.scan.title.invalid": "CommCareAndroid", "app.workflow.forms.scan.title.valid": "CommCareAndroid", "app.workflow.incomplete.continue": "CommCareAndroid", "app.workflow.incomplete.continue.option.delete": "CommCareAndroid", "app.workflow.incomplete.continue.title": "CommCareAndroid", "app.workflow.incomplete.heading": "CommCareAndroid", "app.workflow.login.lost": "CommCareAndroid", "app.workflow.saved.heading": "CommCareAndroid", "archive.install.bad": "CommCareAndroid", "archive.install.button": "CommCareAndroid", "archive.install.cancelled": "CommCareAndroid", "archive.install.progress": "CommCareAndroid", "archive.install.prompt": "CommCareAndroid", "archive.install.state.done": "CommCareAndroid", "archive.install.state.empty": "CommCareAndroid", "archive.install.state.invalid.path": "CommCareAndroid", "archive.install.state.ready": "CommCareAndroid", "archive.install.title": "CommCareAndroid", "archive.install.unzip": "CommCareAndroid", "bulk.dump.dialog.progress": "CommCareAndroid", "bulk.dump.dialog.title": "CommCareAndroid", "bulk.form.alert.title": "CommCareAndroid", "bulk.form.cancel": "CommCareAndroid", "bulk.form.dump": "CommCareAndroid", "bulk.form.dump.2": "CommCareAndroid", "bulk.form.dump.success": "CommCareAndroid", "bulk.form.end": "CommCareAndroid", "bulk.form.error": "CommCareAndroid", "bulk.form.foldername": "CommCareAndroid", "bulk.form.messages": "CommCareAndroid", "bulk.form.no.unsynced": "CommCareAndroid", "bulk.form.no.unsynced.dump": "CommCareAndroid", "bulk.form.no.unsynced.submit": "CommCareAndroid", "bulk.form.progress": "CommCareAndroid", "bulk.form.prompt": "CommCareAndroid", "bulk.form.sd.emulated": "CommCareAndroid", "bulk.form.sd.unavailable": "CommCareAndroid", "bulk.form.sd.unwritable": "CommCareAndroid", "bulk.form.send.start": "CommCareAndroid", "bulk.form.send.success": "CommCareAndroid", "bulk.form.start": "CommCareAndroid", "bulk.form.submit": "CommCareAndroid", "bulk.form.submit.2": "CommCareAndroid", "bulk.form.warning": "CommCareAndroid", "bulk.send.dialog.progress": "CommCareAndroid", "bulk.send.dialog.title": "CommCareAndroid", "bulk.send.file.error": "CommCareAndroid", "bulk.send.malformed.file": "CommCareAndroid", "bulk.send.transport.error": "CommCareAndroid", "cchq.case": "CommCareAndroid", "connection.task.commcare.html.fail": "CommCareAndroid", "connection.task.internet.fail": "CommCareAndroid", "connection.task.internet.success": "CommCareAndroid", "connection.task.remote.ping.fail": "CommCareAndroid", "connection.task.report.commcare.popup": "CommCareAndroid", "connection.task.success": "CommCareAndroid", "connection.task.unset.posturl": "CommCareAndroid", "connection.test.access.settings": "CommCareAndroid", "connection.test.error.message": "CommCareAndroid", "connection.test.messages": "CommCareAndroid", "connection.test.now.running": "CommCareAndroid", "connection.test.prompt": "CommCareAndroid", "connection.test.report.button.message": "CommCareAndroid", "connection.test.run": "CommCareAndroid", "connection.test.run.title": "CommCareAndroid", "connection.test.update.message": "CommCareAndroid", "demo.mode.warning": "CommCareAndroid", "demo.mode.warning.dismiss": "CommCareAndroid", "demo.mode.warning.title": "CommCareAndroid", "dialog.ok": "CommCareAndroid", "form.entry.processing": "CommCareAndroid", "form.entry.processing.title": "CommCareAndroid", "form.entry.segfault": "CommCareAndroid", "form.record.filter.incomplete": "CommCareAndroid", "form.record.filter.limbo": "CommCareAndroid", "form.record.filter.pending": "CommCareAndroid", "form.record.filter.subandpending": "CommCareAndroid", "form.record.filter.submitted": "CommCareAndroid", "form.record.gone": "CommCareAndroid", "form.record.gone.message": "CommCareAndroid", "form.record.unsent": "CommCareAndroid", "home.forms": "CommCareAndroid", "home.forms.incomplete": "CommCareAndroid", "home.forms.incomplete.indicator": "CommCareAndroid", "home.forms.saved": "CommCareAndroid", "home.logged.in.message": "CommCareAndroid", "home.logged.out": "CommCareAndroid", "home.logout": "CommCareAndroid", "home.logout.demo": "CommCareAndroid", "home.menu.call.log": "CommCareAndroid", "home.menu.change.locale": "CommCareAndroid", "home.menu.connection.diagnostic": "CommCareAndroid", "home.menu.formdump": "CommCareAndroid", "home.menu.settings": "CommCareAndroid", "home.menu.update": "CommCareAndroid", "home.menu.validate": "CommCareAndroid", "home.menu.wifi.direct": "CommCareAndroid", "home.start": "CommCareAndroid", "home.start.demo": "CommCareAndroid", "home.sync": "CommCareAndroid", "home.sync.demo": "CommCareAndroid", "home.sync.indicator": "CommCareAndroid", "home.sync.message.last": "CommCareAndroid", "home.sync.message.last.demo": "CommCareAndroid", "home.sync.message.last.never": "CommCareAndroid", "home.sync.message.unsent.plural": "CommCareAndroid", "home.sync.message.unsent.singular": "CommCareAndroid", "install.bad.ref": "CommCareAndroid", "install.barcode": "CommCareAndroid", "install.button.enter": "CommCareAndroid", "install.button.retry": "CommCareAndroid", "install.button.start": "CommCareAndroid", "install.button.startover": "CommCareAndroid", "install.major.mismatch": "CommCareAndroid", "install.manual": "CommCareAndroid", "install.minor.mismatch": "CommCareAndroid", "install.problem.unexpected": "CommCareAndroid", "install.ready": "CommCareAndroid", "install.version.mismatch": "CommCareAndroid", "key.manage.callout": "CommCareAndroid", "key.manage.legacy.begin": "CommCareAndroid", "key.manage.migrate": "CommCareAndroid", "key.manage.purge": "CommCareAndroid", "key.manage.start": "CommCareAndroid", "key.manage.title": "CommCareAndroid", "login.attempt.badcred": "CommCareAndroid", "login.attempt.fail.auth.detail": "CommCareAndroid", "login.attempt.fail.auth.title": "CommCareAndroid", "login.attempt.fail.changed.action": "CommCareAndroid", "login.attempt.fail.changed.detail": "CommCareAndroid", "login.attempt.fail.changed.title": "CommCareAndroid", "login.button": "CommCareAndroid", "login.menu.demo": "CommCareAndroid", "login.password": "CommCareAndroid", "login.sync": "CommCareAndroid", "login.username": "CommCareAndroid", "main.sync.demo": "CommCareAndroid", "main.sync.demo.has.forms": "CommCareAndroid", "main.sync.demo.no.forms": "CommCareAndroid", "menu.advanced": "CommCareAndroid", "menu.archive": "CommCareAndroid", "menu.basic": "CommCareAndroid", "modules.m0": "CommCareAndroid", "mult.install.bad": "CommCareAndroid", "mult.install.button": "CommCareAndroid", "mult.install.cancelled": "CommCareAndroid", "mult.install.error": "CommCareAndroid", "mult.install.no.browser": "CommCareAndroid", "mult.install.progress": "CommCareAndroid", "mult.install.progress.baddest": "CommCareAndroid", "mult.install.progress.badentry": "CommCareAndroid", "mult.install.progress.errormoving": "CommCareAndroid", "mult.install.prompt": "CommCareAndroid", "mult.install.state.done": "CommCareAndroid", "mult.install.state.empty": "CommCareAndroid", "mult.install.state.invalid.path": "CommCareAndroid", "mult.install.state.ready": "CommCareAndroid", "mult.install.title": "CommCareAndroid", "notification.bad.certificate.action": "CommCareAndroid", "notification.bad.certificate.detail": "CommCareAndroid", "notification.bad.certificate.title": "CommCareAndroid", "notification.case.filter.action": "CommCareAndroid", "notification.case.filter.detail": "CommCareAndroid", "notification.case.filter.title": "CommCareAndroid", "notification.case.predicate.action": "CommCareAndroid", "notification.case.predicate.title": "CommCareAndroid", "notification.credential.mismatch.action": "CommCareAndroid", "notification.credential.mismatch.detail": "CommCareAndroid", "notification.credential.mismatch.title": "CommCareAndroid", "notification.for.details.wrapper": "CommCareAndroid", "notification.formentry.unretrievable.action": "CommCareAndroid", "notification.formentry.unretrievable.detail": "CommCareAndroid", "notification.formentry.unretrievable.title": "CommCareAndroid", "notification.install.badarchive.action": "CommCareAndroid", "notification.install.badarchive.detail": "CommCareAndroid", "notification.install.badarchive.title": "CommCareAndroid", "notification.install.badcert.action": "CommCareAndroid", "notification.install.badcert.detail": "CommCareAndroid", "notification.install.badcert.title": "CommCareAndroid", "notification.install.badreqs.action": "CommCareAndroid", "notification.install.badreqs.detail": "CommCareAndroid", "notification.install.badreqs.title": "CommCareAndroid", "notification.install.badstate.action": "CommCareAndroid", "notification.install.badstate.detail": "CommCareAndroid", "notification.install.badstate.title": "CommCareAndroid", "notification.install.installed.detail": "CommCareAndroid", "notification.install.installed.title": "CommCareAndroid", "notification.install.missing.action": "CommCareAndroid", "notification.install.missing.detail": "CommCareAndroid", "notification.install.missing.title": "CommCareAndroid", "notification.install.missing.withmessage.action": "CommCareAndroid", "notification.install.missing.withmessage.detail": "CommCareAndroid", "notification.install.missing.withmessage.title": "CommCareAndroid", "notification.install.nolocal.action": "CommCareAndroid", "notification.install.nolocal.detail": "CommCareAndroid", "notification.install.nolocal.title": "CommCareAndroid", "notification.install.unknown.detail": "CommCareAndroid", "notification.install.unknown.title": "CommCareAndroid", "notification.install.uptodate.detail": "CommCareAndroid", "notification.install.uptodate.title": "CommCareAndroid", "notification.logger.error.detail": "CommCareAndroid", "notification.logger.error.title": "CommCareAndroid", "notification.logger.serialized.detail": "CommCareAndroid", "notification.logger.serialized.title": "CommCareAndroid", "notification.logger.submitted.detail": "CommCareAndroid", "notification.logger.submitted.title": "CommCareAndroid", "notification.network.timeout.action": "CommCareAndroid", "notification.network.timeout.detail": "CommCareAndroid", "notification.network.timeout.title": "CommCareAndroid", "notification.processing.badstructure.action": "CommCareAndroid", "notification.processing.badstructure.detail": "CommCareAndroid", "notification.processing.badstructure.title": "CommCareAndroid", "notification.processing.nosdcard.action": "CommCareAndroid", "notification.processing.nosdcard.detail": "CommCareAndroid", "notification.processing.nosdcard.title": "CommCareAndroid", "notification.restore.baddata.detail": "CommCareAndroid", "notification.restore.baddata.title": "CommCareAndroid", "notification.restore.nonetwork.detail": "CommCareAndroid", "notification.restore.nonetwork.title": "CommCareAndroid", "notification.restore.remote.error.action": "CommCareAndroid", "notification.restore.remote.error.detail": "CommCareAndroid", "notification.restore.remote.error.title": "CommCareAndroid", "notification.restore.unknown.action": "CommCareAndroid", "notification.restore.unknown.detail": "CommCareAndroid", "notification.restore.unknown.title": "CommCareAndroid", "notification.send.malformed.detail": "CommCareAndroid", "notification.send.malformed.title": "CommCareAndroid", "notification.sending.loggedout.detail": "CommCareAndroid", "notification.sending.loggedout.title": "CommCareAndroid", "notification.sending.quarantine.action": "CommCareAndroid", "notification.sending.quarantine.detail": "CommCareAndroid", "notification.sending.quarantine.title": "CommCareAndroid", "notification.sync.airplane.action": "CommCareAndroid", "notification.sync.airplane.detail": "CommCareAndroid", "notification.sync.airplane.title": "CommCareAndroid", "notifications.prompt.details": "CommCareAndroid", "notifications.prompt.more": "CommCareAndroid", "odk_accept_location": "ODK", "odk_access_error": "ODK", "odk_accuracy": "ODK", "odk_activity_not_found": "ODK", "odk_add_another": "ODK", "odk_add_another_repeat": "ODK", "odk_add_repeat": "ODK", "odk_add_repeat_no": "ODK", "odk_advance": "ODK", "odk_altitude": "ODK", "odk_app_name": "ODK", "odk_app_url": "ODK", "odk_attachment_oversized": "ODK", "odk_audio_file_error": "ODK", "odk_audio_file_invalid": "ODK", "odk_backup": "ODK", "odk_barcode_scanner_error": "ODK", "odk_cancel": "ODK", "odk_cancel_loading_form": "ODK", "odk_cancel_location": "ODK", "odk_cancel_saving_form": "ODK", "odk_cannot_edit_completed_form": "ODK", "odk_capture_audio": "ODK", "odk_capture_image": "ODK", "odk_capture_video": "ODK", "odk_change_font_size": "ODK", "odk_change_formlist_url": "ODK", "odk_change_language": "ODK", "odk_change_password": "ODK", "odk_change_protocol": "ODK", "odk_change_server_url": "ODK", "odk_change_settings": "ODK", "odk_change_splash_path": "ODK", "odk_change_submission_url": "ODK", "odk_change_username": "ODK", "odk_choose_image": "ODK", "odk_choose_sound": "ODK", "odk_choose_video": "ODK", "odk_clear_answer": "ODK", "odk_clear_answer_ask": "ODK", "odk_clear_answer_no": "ODK", "odk_clearanswer_confirm": "ODK", "odk_click_to_web": "ODK", "odk_client": "ODK", "odk_completed_data": "ODK", "odk_data": "ODK", "odk_data_saved_error": "ODK", "odk_data_saved_ok": "ODK", "odk_default_completed": "ODK", "odk_default_completed_summary": "ODK", "odk_default_odk_formlist": "ODK", "odk_default_odk_submission": "ODK", "odk_default_server_url": "ODK", "odk_default_splash_path": "ODK", "odk_delete_confirm": "ODK", "odk_delete_file": "ODK", "odk_delete_no": "ODK", "odk_delete_repeat": "ODK", "odk_delete_repeat_ask": "ODK", "odk_delete_repeat_confirm": "ODK", "odk_delete_repeat_no": "ODK", "odk_delete_yes": "ODK", "odk_discard_answer": "ODK", "odk_discard_group": "ODK", "odk_do_not_change": "ODK", "odk_do_not_exit": "ODK", "odk_do_not_save": "ODK", "odk_download": "ODK", "odk_download_all_successful": "ODK", "odk_download_complete": "ODK", "odk_download_failed_with_error": "ODK", "odk_download_forms_result": "ODK", "odk_downloading_data": "ODK", "odk_edit_prompt": "ODK", "odk_enter": "ODK", "odk_enter_data": "ODK", "odk_enter_data_button": "ODK", "odk_enter_data_description": "ODK", "odk_enter_data_message": "ODK", "odk_entering_repeat": "ODK", "odk_entering_repeat_ask": "ODK", "odk_error_downloading": "ODK", "odk_error_occured": "ODK", "odk_exit": "ODK", "odk_fetching_file": "ODK", "odk_fetching_manifest": "ODK", "odk_file_deleted_error": "ODK", "odk_file_deleted_ok": "ODK", "odk_file_fetch_failed": "ODK", "odk_file_invalid": "ODK", "odk_file_missing": "ODK", "odk_finding_location": "ODK", "odk_finished_disk_scan": "ODK", "odk_first_run": "ODK", "odk_font_size": "ODK", "odk_form": "ODK", "odk_form_download_progress": "ODK", "odk_form_entry_start_hide": "ODK", "odk_form_name": "ODK", "odk_form_renamed": "ODK", "odk_form_scan_finished": "ODK", "odk_form_scan_starting": "ODK", "odk_formlist_url": "ODK", "odk_forms": "ODK", "odk_found_location": "ODK", "odk_general_preferences": "ODK", "odk_get_barcode": "ODK", "odk_get_forms": "ODK", "odk_get_location": "ODK", "odk_getting_location": "ODK", "odk_go_to_location": "ODK", "odk_google_account": "ODK", "odk_google_submission_id_text": "ODK", "odk_intent_callout_button": "ODK", "odk_intent_callout_button_update": "ODK", "odk_invalid_answer_error": "ODK", "odk_jump_to_beginning": "ODK", "odk_jump_to_end": "ODK", "odk_jump_to_previous": "ODK", "odk_keep_changes": "ODK", "odk_latitude": "ODK", "odk_leave_repeat_yes": "ODK", "odk_leaving_repeat": "ODK", "odk_leaving_repeat_ask": "ODK", "odk_list_failed_with_error": "ODK", "odk_load_remote_form_error": "ODK", "odk_loading_form": "ODK", "odk_location_accuracy": "ODK", "odk_location_provider": "ODK", "odk_location_provider_accuracy": "ODK", "odk_longitude": "ODK", "odk_main_menu": "ODK", "odk_main_menu_details": "ODK", "odk_main_menu_message": "ODK", "odk_manage_files": "ODK", "odk_manifest_server_error": "ODK", "odk_manifest_tag_error": "ODK", "odk_mark_finished": "ODK", "odk_no": "ODK", "odk_no_capture": "ODK", "odk_no_connection": "ODK", "odk_no_forms_uploaded": "ODK", "odk_no_gps_message": "ODK", "odk_no_gps_title": "ODK", "odk_no_items_display": "ODK", "odk_no_items_display_forms": "ODK", "odk_no_items_display_instances": "ODK", "odk_no_items_error": "ODK", "odk_no_sd_error": "ODK", "odk_noselect_error": "ODK", "odk_ok": "ODK", "odk_one_capture": "ODK", "odk_open_data_kit": "ODK", "odk_parse_error": "ODK", "odk_parse_legacy_formlist_failed": "ODK", "odk_parse_openrosa_formlist_failed": "ODK", "odk_password": "ODK", "odk_play_audio": "ODK", "odk_play_video": "ODK", "odk_please_wait": "ODK", "odk_please_wait_long": "ODK", "odk_powered_by_odk": "ODK", "odk_preference_form_entry_start_hide": "ODK", "odk_preference_form_entry_start_summary": "ODK", "odk_protocol": "ODK", "odk_provider_disabled_error": "ODK", "odk_quit_application": "ODK", "odk_quit_entry": "ODK", "odk_refresh": "ODK", "odk_replace_audio": "ODK", "odk_replace_barcode": "ODK", "odk_replace_image": "ODK", "odk_replace_location": "ODK", "odk_replace_video": "ODK", "odk_required_answer_error": "ODK", "odk_review": "ODK", "odk_review_data": "ODK", "odk_review_data_button": "ODK", "odk_root_element_error": "ODK", "odk_root_namespace_error": "ODK", "odk_save_all_answers": "ODK", "odk_save_as_error": "ODK", "odk_save_data_message": "ODK", "odk_save_enter_data_description": "ODK", "odk_save_form_as": "ODK", "odk_saved_data": "ODK", "odk_saving_form": "ODK", "odk_select_another_image": "ODK", "odk_select_answer": "ODK", "odk_selected": "ODK", "odk_selected_google_account_text": "ODK", "odk_send": "ODK", "odk_send_data": "ODK", "odk_send_data_button": "ODK", "odk_send_selected_data": "ODK", "odk_sending_items": "ODK", "odk_server_auth_credentials": "ODK", "odk_server_preferences": "ODK", "odk_server_requires_auth": "ODK", "odk_server_url": "ODK", "odk_show_location": "ODK", "odk_show_splash": "ODK", "odk_show_splash_summary": "ODK", "odk_splash_path": "ODK", "odk_submission_url": "ODK", "odk_success": "ODK", "odk_toggle_selected": "ODK", "odk_trigger": "ODK", "odk_upload_all_successful": "ODK", "odk_upload_results": "ODK", "odk_upload_some_failed": "ODK", "odk_uploading_data": "ODK", "odk_url_error": "ODK", "odk_use_odk_default": "ODK", "odk_username": "ODK", "odk_view_hierarchy": "ODK", "odk_xform_parse_error": "ODK", "option.cancel": "CommCareAndroid", "option.no": "CommCareAndroid", "option.yes": "CommCareAndroid", "problem.report.button": "CommCareAndroid", "problem.report.menuitem": "CommCareAndroid", "problem.report.prompt": "CommCareAndroid", "profile.found": "CommCareAndroid", "select.detail.confirm": "CommCareAndroid", "select.detail.title": "CommCareAndroid", "select.list.title": "CommCareAndroid", "select.menu.map": "CommCareAndroid", "select.menu.sort": "CommCareAndroid", "select.placeholder.message": "CommCareAndroid", "select.search.label": "CommCareAndroid", "sync.fail.auth.loggedin": "CommCareAndroid", "sync.fail.bad.data": "CommCareAndroid", "sync.fail.bad.local": "CommCareAndroid", "sync.fail.bad.network": "CommCareAndroid", "sync.fail.timeout": "CommCareAndroid", "sync.fail.unknown": "CommCareAndroid", "sync.fail.unsent": "CommCareAndroid", "sync.process.downloading.progress": "CommCareAndroid", "sync.process.processing": "CommCareAndroid", "sync.progress.authing": "CommCareAndroid", "sync.progress.downloading": "CommCareAndroid", "sync.progress.purge": "CommCareAndroid", "sync.progress.starting": "CommCareAndroid", "sync.progress.submitting": "CommCareAndroid", "sync.progress.submitting.title": "CommCareAndroid", "sync.progress.title": "CommCareAndroid", "sync.recover.needed": "CommCareAndroid", "sync.recover.started": "CommCareAndroid", "sync.success.sent": "CommCareAndroid", "sync.success.sent.singular": "CommCareAndroid", "sync.success.synced": "CommCareAndroid", "title.datum.wrapper": "CommCareAndroid", "update.success.refresh": "CommCareAndroid", "updates.check": "CommCareAndroid", "updates.checking": "CommCareAndroid", "updates.downloaded": "CommCareAndroid", "updates.found": "CommCareAndroid", "updates.resources.initialization": "CommCareAndroid", "updates.resources.profile": "CommCareAndroid", "updates.success": "CommCareAndroid", "updates.title": "CommCareAndroid", "upgrade.button.retry": "CommCareAndroid", "upgrade.button.startover": "CommCareAndroid", "verification.checking": "CommCareAndroid", "verification.fail.message": "CommCareAndroid", "verification.progress": "CommCareAndroid", "verification.title": "CommCareAndroid", "verify.checking": "CommCareAndroid", "verify.progress": "CommCareAndroid", "verify.title": "CommCareAndroid", "version.id.long": "CommCareAndroid", "version.id.short": "CommCareAndroid", "wifi.direct.base.folder": "CommCareAndroid", "wifi.direct.receive.forms": "CommCareAndroid", "wifi.direct.submit.forms": "CommCareAndroid", "wifi.direct.submit.missing": "CommCareAndroid", "wifi.direct.transfer.forms": "CommCareAndroid", "activity.adduser.adduser": "JavaRosa", "activity.adduser.problem": "JavaRosa", "activity.adduser.problem.emptyuser": "JavaRosa", "activity.adduser.problem.mismatchingpasswords": "JavaRosa", "activity.adduser.problem.nametaken": "JavaRosa", "activity.locationcapture.Accuracy": "JavaRosa", "activity.locationcapture.Altitude": "JavaRosa", "activity.locationcapture.capturelocation": "JavaRosa", "activity.locationcapture.capturelocationhint": "JavaRosa", "activity.locationcapture.capturelocationhint": "JavaRosa", "activity.locationcapture.fixfailed": "JavaRosa", "activity.locationcapture.fixobtained": "JavaRosa", "activity.locationcapture.GPSNotAvailable": "JavaRosa", "activity.locationcapture.Latitude": "JavaRosa", "activity.locationcapture.LocationError": "JavaRosa", "activity.locationcapture.Longitude": "JavaRosa", "activity.locationcapture.readyforcapture": "JavaRosa", "activity.locationcapture.waitingforfix": "JavaRosa", "activity.login.demomode.intro": "CommCareJava", "activity.login.demomode.intro": "JavaRosa", "activity.login.loginincorrect": "JavaRosa", "activity.login.tryagain": "JavaRosa", "af": "JavaRosa", "button.Next": "JavaRosa", "button.No": "JavaRosa", "button.Yes": "JavaRosa", "case.date.opened": "JavaRosa", "case.id": "JavaRosa", "case.name": "JavaRosa", "case.status": "JavaRosa", "command.back": "JavaRosa", "command.call": "JavaRosa", "command.cancel": "JavaRosa", "command.exit": "JavaRosa", "command.language": "JavaRosa", "command.next": "JavaRosa", "command.ok": "JavaRosa", "command.retry": "JavaRosa", "command.save": "JavaRosa", "command.saveexit": "JavaRosa", "command.select": "JavaRosa", "commcare.badversion": "CommCareJava", "commcare.fail": "CommCareJava", "commcare.fail.sendlogs": "CommCareJava", "commcare.firstload": "CommCareJava", "commcare.install.oom": "CommCareJava", "commcare.menu.count.wrapper": "CommCareJava", "commcare.noupgrade.version": "CommCareJava", "commcare.numwrapper": "CommCareJava", "commcare.review": "CommCareJava", "commcare.review.icon": "CommCareJava", "commcare.startup.oom": "CommCareJava", "commcare.tools.network": "CommCareJava", "commcare.tools.permissions": "CommCareJava", "commcare.tools.title": "CommCareJava", "commcare.tools.validate": "CommCareJava", "date.nago": "JavaRosa", "date.nfromnow": "JavaRosa", "date.today": "JavaRosa", "date.tomorrow": "JavaRosa", "date.twoago": "JavaRosa", "date.unknown": "JavaRosa", "date.yesterday": "JavaRosa", "debug.log": "JavaRosa", "en": "JavaRosa", "entity.command.sort": "JavaRosa", "entity.detail.title": "JavaRosa", "entity.find": "JavaRosa", "entity.nodata": "JavaRosa", "entity.nomatch": "JavaRosa", "entity.sort.title": "JavaRosa", "entity.title.layout": "JavaRosa", "es": "JavaRosa", "form.entry.badnum": "JavaRosa", "form.entry.badnum.dec": "JavaRosa", "form.entry.badnum.int": "JavaRosa", "form.entry.badnum.long": "JavaRosa", "form.entry.constraint.msg": "JavaRosa", "form.login.login": "JavaRosa", "form.login.password": "JavaRosa", "form.login.username": "JavaRosa", "form.user.confirmpassword": "JavaRosa", "form.user.fillinboth": "JavaRosa", "form.user.giveadmin": "JavaRosa", "form.user.name": "JavaRosa", "form.user.password": "JavaRosa", "form.user.userid": "JavaRosa", "formentry.invalid.input": "JavaRosa", "formview.repeat.addNew": "JavaRosa", "fra": "JavaRosa", "home.change.user": "CommCareJava", "home.data.restore": "CommCareJava", "home.demo.reset": "CommCareJava", "home.setttings": "CommCareJava", "home.updates": "CommCareJava", "home.user.edit": "CommCareJava", "home.user.new": "CommCareJava", "homescreen.title": "CommCareJava", "icon.demo.path": "JavaRosa", "icon.login.path": "JavaRosa", "id": "CommCareJava", "install.bad": "CommCareJava", "install.verify": "CommCareJava", "intro.restore": "CommCareJava", "intro.start": "CommCareJava", "intro.text": "CommCareJava", "intro.title": "CommCareJava", "loading.screen.message": "JavaRosa", "loading.screen.title": "JavaRosa", "locale.name.en": "CommCareJava", "locale.name.sw": "CommCareJava", "log.submit.full": "JavaRosa", "log.submit.never": "JavaRosa", "log.submit.next.daily": "JavaRosa", "log.submit.next.weekly": "JavaRosa", "log.submit.nigthly": "JavaRosa", "log.submit.short": "JavaRosa", "log.submit.url": "JavaRosa", "log.submit.weekly": "JavaRosa", "login.title": "CommCareJava", "menu.Back": "JavaRosa", "menu.Capture": "JavaRosa", "menu.Demo": "JavaRosa", "menu.Exit": "JavaRosa", "menu.Login": "JavaRosa", "menu.Next": "JavaRosa", "menu.ok": "JavaRosa", "menu.retry": "JavaRosa", "menu.Save": "JavaRosa", "menu.SaveAndExit": "JavaRosa", "menu.send.all": "CommCareJava", "menu.send.all.val": "CommCareJava", "menu.send.later": "JavaRosa", "menu.SendLater": "JavaRosa", "menu.SendNow": "JavaRosa", "menu.SendToNewServer": "JavaRosa", "menu.Settings": "JavaRosa", "menu.sync": "CommCareJava", "menu.sync.last": "CommCareJava", "menu.sync.prompt": "CommCareJava", "menu.sync.unsent.mult": "CommCareJava", "menu.sync.unsent.one": "CommCareJava", "menu.Tools": "JavaRosa", "menu.ViewAnswers": "JavaRosa", "message.delete": "JavaRosa", "message.details": "JavaRosa", "message.log": "JavaRosa", "message.permissions": "CommCareJava", "message.send.unsent": "JavaRosa", "message.timesync": "CommCareJava", "network.test.begin.image": "CommCareJava", "network.test.begin.message": "CommCareJava", "network.test.connected.image": "CommCareJava", "network.test.connected.message": "CommCareJava", "network.test.connecting.image": "CommCareJava", "network.test.connecting.message": "CommCareJava", "network.test.content.image": "CommCareJava", "network.test.content.message": "CommCareJava", "network.test.details": "CommCareJava", "network.test.details.title": "CommCareJava", "network.test.failed.image": "CommCareJava", "network.test.failed.message": "CommCareJava", "network.test.response.message": "CommCareJava", "network.test.title": "CommCareJava", "no": "JavaRosa", "node.select.filtering": "CommCareJava", "plussign": "JavaRosa", "polish.command.back": "JavaRosa", "polish.command.cancel": "JavaRosa", "polish.command.clear": "JavaRosa", "polish.command.delete": "JavaRosa", "polish.command.entersymbol": "JavaRosa", "polish.command.exit": "JavaRosa", "polish.command.followlink": "JavaRosa", "polish.command.hide": "JavaRosa", "polish.command.mark": "JavaRosa", "polish.command.ok": "JavaRosa", "polish.command.options": "JavaRosa", "polish.command.select": "JavaRosa", "polish.command.submit": "JavaRosa", "polish.command.unmark": "JavaRosa", "polish.date.select": "CommCareJava", "polish.date.select": "JavaRosa", "polish.rss.command.followlink": "JavaRosa", "polish.rss.command.select": "JavaRosa", "polish.TextField.charactersKey0": "JavaRosa", "polish.TextField.charactersKey1": "JavaRosa", "polish.TextField.charactersKey2": "JavaRosa", "polish.TextField.charactersKey3": "JavaRosa", "polish.TextField.charactersKey4": "JavaRosa", "polish.TextField.charactersKey5": "JavaRosa", "polish.TextField.charactersKey6": "JavaRosa", "polish.TextField.charactersKey7": "JavaRosa", "polish.TextField.charactersKey8": "JavaRosa", "polish.TextField.charactersKey9": "JavaRosa", "polish.title.input": "JavaRosa", "pt": "JavaRosa", "question.SendNow": "JavaRosa", "repeat.message.multiple": "JavaRosa", "repeat.message.single": "JavaRosa", "repeat.repitition": "JavaRosa", "restore.bad.db": "CommCareJava", "restore.badcredentials": "CommCareJava", "restore.baddownload": "CommCareJava", "restore.badserver": "CommCareJava", "restore.bypass.clean": "CommCareJava", "restore.bypass.clean.success": "CommCareJava", "restore.bypass.cleanfail": "CommCareJava", "restore.bypass.fail": "CommCareJava", "restore.bypass.instructions": "CommCareJava", "restore.bypass.start": "CommCareJava", "restore.db.busy": "CommCareJava", "restore.downloaded": "CommCareJava", "restore.fail": "CommCareJava", "restore.fail.credentials": "CommCareJava", "restore.fail.download": "CommCareJava", "restore.fail.message": "CommCareJava", "restore.fail.nointernet": "CommCareJava", "restore.fail.other": "CommCareJava", "restore.fail.retry": "CommCareJava", "restore.fail.technical": "CommCareJava", "restore.fail.transport": "CommCareJava", "restore.fail.view": "CommCareJava", "restore.fetch": "CommCareJava", "restore.finished": "CommCareJava", "restore.key.continue": "CommCareJava", "restore.login.instructions": "CommCareJava", "restore.message.connection.failed": "CommCareJava", "restore.message.connectionmade": "CommCareJava", "restore.message.startdownload": "CommCareJava", "restore.nocache": "CommCareJava", "restore.noserveruri": "CommCareJava", "restore.recover.fail": "CommCareJava", "restore.recover.needcache": "CommCareJava", "restore.recover.send": "CommCareJava", "restore.recovery.wipe": "CommCareJava", "restore.retry": "CommCareJava", "restore.starting": "CommCareJava", "restore.success": "CommCareJava", "restore.success.partial": "CommCareJava", "restore.ui.bounded": "CommCareJava", "restore.ui.unbounded": "CommCareJava", "restore.user.exists": "CommCareJava", "review.date": "CommCareJava", "review.title": "CommCareJava", "review.type": "CommCareJava", "review.type.unknown": "CommCareJava", "send.unsent.icon": "CommCareJava", "sending.message.send": "JavaRosa", "sending.status.didnotunderstand": "CommCareJava", "sending.status.error": "JavaRosa", "sending.status.failed": "JavaRosa", "sending.status.failures": "JavaRosa", "sending.status.going": "JavaRosa", "sending.status.long": "JavaRosa", "sending.status.multi": "JavaRosa", "sending.status.none": "JavaRosa", "sending.status.problem.datasafe": "CommCareJava", "sending.status.success": "JavaRosa", "sending.status.success": "JavaRosa", "sending.status.title": "JavaRosa", "sending.view.done": "JavaRosa", "sending.view.done.title": "JavaRosa", "sending.view.later": "JavaRosa", "sending.view.now": "JavaRosa", "sending.view.submit": "JavaRosa", "sending.view.when": "JavaRosa", "server.sync.icon.normal": "CommCareJava", "server.sync.icon.warn": "CommCareJava", "settings.language": "JavaRosa", "splashscreen": "JavaRosa", "sw": "JavaRosa", "sync.cancelled": "CommCareJava", "sync.cancelled.sending": "CommCareJava", "sync.done.closed": "CommCareJava", "sync.done.new": "CommCareJava", "sync.done.noupdate": "CommCareJava", "sync.done.updated": "CommCareJava", "sync.done.updates": "CommCareJava", "sync.pull.admin": "CommCareJava", "sync.pull.demo": "CommCareJava", "sync.pull.fail": "CommCareJava", "sync.send.fail": "CommCareJava", "sync.unsent.cancel": "CommCareJava", "update.fail.generic": "CommCareJava", "update.fail.network": "CommCareJava", "update.fail.network.retry": "CommCareJava", "update.header": "CommCareJava", "update.retrying": "CommCareJava", "user.create.header": "JavaRosa", "user.entity.admin": "JavaRosa", "user.entity.demo": "JavaRosa", "user.entity.name": "JavaRosa", "user.entity.normal": "JavaRosa", "user.entity.type": "JavaRosa", "user.entity.unknown": "JavaRosa", "user.entity.username": "JavaRosa", "user.registration.attempt": "JavaRosa", "user.registration.badresponse": "JavaRosa", "user.registration.failmessage": "JavaRosa", "user.registration.success": "JavaRosa", "user.registration.title": "JavaRosa", "validation.start": "CommCareJava", "validation.success": "CommCareJava", "video.playback.bottom": "JavaRosa", "video.playback.hashkey.path": "JavaRosa", "video.playback.top": "JavaRosa", "view.sending.RequiredQuestion": "JavaRosa", "xpath.fail.runtime": "CommCareJava", "yes": "JavaRosa", "zh": "JavaRosa" }
sources = {'activity.task.error.generic': 'CommCareAndroid', 'app.handled.error.explanation': 'CommCareAndroid', 'app.handled.error.title': 'CommCareAndroid', 'app.key.request.deny': 'CommCareAndroid', 'app.key.request.grant': 'CommCareAndroid', 'app.key.request.message': 'CommCareAndroid', 'app.menu.display.cond.bad.xpath': 'CommCareAndroid', 'app.menu.display.cond.xpath.err': 'CommCareAndroid', 'app.storage.missing.button': 'CommCareAndroid', 'app.storage.missing.message': 'CommCareAndroid', 'app.storage.missing.title': 'CommCareAndroid', 'app.workflow.forms.delete': 'CommCareAndroid', 'app.workflow.forms.fetch': 'CommCareAndroid', 'app.workflow.forms.open': 'CommCareAndroid', 'app.workflow.forms.quarantine.report': 'CommCareAndroid', 'app.workflow.forms.restore': 'CommCareAndroid', 'app.workflow.forms.scan': 'CommCareAndroid', 'app.workflow.forms.scan.title.invalid': 'CommCareAndroid', 'app.workflow.forms.scan.title.valid': 'CommCareAndroid', 'app.workflow.incomplete.continue': 'CommCareAndroid', 'app.workflow.incomplete.continue.option.delete': 'CommCareAndroid', 'app.workflow.incomplete.continue.title': 'CommCareAndroid', 'app.workflow.incomplete.heading': 'CommCareAndroid', 'app.workflow.login.lost': 'CommCareAndroid', 'app.workflow.saved.heading': 'CommCareAndroid', 'archive.install.bad': 'CommCareAndroid', 'archive.install.button': 'CommCareAndroid', 'archive.install.cancelled': 'CommCareAndroid', 'archive.install.progress': 'CommCareAndroid', 'archive.install.prompt': 'CommCareAndroid', 'archive.install.state.done': 'CommCareAndroid', 'archive.install.state.empty': 'CommCareAndroid', 'archive.install.state.invalid.path': 'CommCareAndroid', 'archive.install.state.ready': 'CommCareAndroid', 'archive.install.title': 'CommCareAndroid', 'archive.install.unzip': 'CommCareAndroid', 'bulk.dump.dialog.progress': 'CommCareAndroid', 'bulk.dump.dialog.title': 'CommCareAndroid', 'bulk.form.alert.title': 'CommCareAndroid', 'bulk.form.cancel': 'CommCareAndroid', 'bulk.form.dump': 'CommCareAndroid', 'bulk.form.dump.2': 'CommCareAndroid', 'bulk.form.dump.success': 'CommCareAndroid', 'bulk.form.end': 'CommCareAndroid', 'bulk.form.error': 'CommCareAndroid', 'bulk.form.foldername': 'CommCareAndroid', 'bulk.form.messages': 'CommCareAndroid', 'bulk.form.no.unsynced': 'CommCareAndroid', 'bulk.form.no.unsynced.dump': 'CommCareAndroid', 'bulk.form.no.unsynced.submit': 'CommCareAndroid', 'bulk.form.progress': 'CommCareAndroid', 'bulk.form.prompt': 'CommCareAndroid', 'bulk.form.sd.emulated': 'CommCareAndroid', 'bulk.form.sd.unavailable': 'CommCareAndroid', 'bulk.form.sd.unwritable': 'CommCareAndroid', 'bulk.form.send.start': 'CommCareAndroid', 'bulk.form.send.success': 'CommCareAndroid', 'bulk.form.start': 'CommCareAndroid', 'bulk.form.submit': 'CommCareAndroid', 'bulk.form.submit.2': 'CommCareAndroid', 'bulk.form.warning': 'CommCareAndroid', 'bulk.send.dialog.progress': 'CommCareAndroid', 'bulk.send.dialog.title': 'CommCareAndroid', 'bulk.send.file.error': 'CommCareAndroid', 'bulk.send.malformed.file': 'CommCareAndroid', 'bulk.send.transport.error': 'CommCareAndroid', 'cchq.case': 'CommCareAndroid', 'connection.task.commcare.html.fail': 'CommCareAndroid', 'connection.task.internet.fail': 'CommCareAndroid', 'connection.task.internet.success': 'CommCareAndroid', 'connection.task.remote.ping.fail': 'CommCareAndroid', 'connection.task.report.commcare.popup': 'CommCareAndroid', 'connection.task.success': 'CommCareAndroid', 'connection.task.unset.posturl': 'CommCareAndroid', 'connection.test.access.settings': 'CommCareAndroid', 'connection.test.error.message': 'CommCareAndroid', 'connection.test.messages': 'CommCareAndroid', 'connection.test.now.running': 'CommCareAndroid', 'connection.test.prompt': 'CommCareAndroid', 'connection.test.report.button.message': 'CommCareAndroid', 'connection.test.run': 'CommCareAndroid', 'connection.test.run.title': 'CommCareAndroid', 'connection.test.update.message': 'CommCareAndroid', 'demo.mode.warning': 'CommCareAndroid', 'demo.mode.warning.dismiss': 'CommCareAndroid', 'demo.mode.warning.title': 'CommCareAndroid', 'dialog.ok': 'CommCareAndroid', 'form.entry.processing': 'CommCareAndroid', 'form.entry.processing.title': 'CommCareAndroid', 'form.entry.segfault': 'CommCareAndroid', 'form.record.filter.incomplete': 'CommCareAndroid', 'form.record.filter.limbo': 'CommCareAndroid', 'form.record.filter.pending': 'CommCareAndroid', 'form.record.filter.subandpending': 'CommCareAndroid', 'form.record.filter.submitted': 'CommCareAndroid', 'form.record.gone': 'CommCareAndroid', 'form.record.gone.message': 'CommCareAndroid', 'form.record.unsent': 'CommCareAndroid', 'home.forms': 'CommCareAndroid', 'home.forms.incomplete': 'CommCareAndroid', 'home.forms.incomplete.indicator': 'CommCareAndroid', 'home.forms.saved': 'CommCareAndroid', 'home.logged.in.message': 'CommCareAndroid', 'home.logged.out': 'CommCareAndroid', 'home.logout': 'CommCareAndroid', 'home.logout.demo': 'CommCareAndroid', 'home.menu.call.log': 'CommCareAndroid', 'home.menu.change.locale': 'CommCareAndroid', 'home.menu.connection.diagnostic': 'CommCareAndroid', 'home.menu.formdump': 'CommCareAndroid', 'home.menu.settings': 'CommCareAndroid', 'home.menu.update': 'CommCareAndroid', 'home.menu.validate': 'CommCareAndroid', 'home.menu.wifi.direct': 'CommCareAndroid', 'home.start': 'CommCareAndroid', 'home.start.demo': 'CommCareAndroid', 'home.sync': 'CommCareAndroid', 'home.sync.demo': 'CommCareAndroid', 'home.sync.indicator': 'CommCareAndroid', 'home.sync.message.last': 'CommCareAndroid', 'home.sync.message.last.demo': 'CommCareAndroid', 'home.sync.message.last.never': 'CommCareAndroid', 'home.sync.message.unsent.plural': 'CommCareAndroid', 'home.sync.message.unsent.singular': 'CommCareAndroid', 'install.bad.ref': 'CommCareAndroid', 'install.barcode': 'CommCareAndroid', 'install.button.enter': 'CommCareAndroid', 'install.button.retry': 'CommCareAndroid', 'install.button.start': 'CommCareAndroid', 'install.button.startover': 'CommCareAndroid', 'install.major.mismatch': 'CommCareAndroid', 'install.manual': 'CommCareAndroid', 'install.minor.mismatch': 'CommCareAndroid', 'install.problem.unexpected': 'CommCareAndroid', 'install.ready': 'CommCareAndroid', 'install.version.mismatch': 'CommCareAndroid', 'key.manage.callout': 'CommCareAndroid', 'key.manage.legacy.begin': 'CommCareAndroid', 'key.manage.migrate': 'CommCareAndroid', 'key.manage.purge': 'CommCareAndroid', 'key.manage.start': 'CommCareAndroid', 'key.manage.title': 'CommCareAndroid', 'login.attempt.badcred': 'CommCareAndroid', 'login.attempt.fail.auth.detail': 'CommCareAndroid', 'login.attempt.fail.auth.title': 'CommCareAndroid', 'login.attempt.fail.changed.action': 'CommCareAndroid', 'login.attempt.fail.changed.detail': 'CommCareAndroid', 'login.attempt.fail.changed.title': 'CommCareAndroid', 'login.button': 'CommCareAndroid', 'login.menu.demo': 'CommCareAndroid', 'login.password': 'CommCareAndroid', 'login.sync': 'CommCareAndroid', 'login.username': 'CommCareAndroid', 'main.sync.demo': 'CommCareAndroid', 'main.sync.demo.has.forms': 'CommCareAndroid', 'main.sync.demo.no.forms': 'CommCareAndroid', 'menu.advanced': 'CommCareAndroid', 'menu.archive': 'CommCareAndroid', 'menu.basic': 'CommCareAndroid', 'modules.m0': 'CommCareAndroid', 'mult.install.bad': 'CommCareAndroid', 'mult.install.button': 'CommCareAndroid', 'mult.install.cancelled': 'CommCareAndroid', 'mult.install.error': 'CommCareAndroid', 'mult.install.no.browser': 'CommCareAndroid', 'mult.install.progress': 'CommCareAndroid', 'mult.install.progress.baddest': 'CommCareAndroid', 'mult.install.progress.badentry': 'CommCareAndroid', 'mult.install.progress.errormoving': 'CommCareAndroid', 'mult.install.prompt': 'CommCareAndroid', 'mult.install.state.done': 'CommCareAndroid', 'mult.install.state.empty': 'CommCareAndroid', 'mult.install.state.invalid.path': 'CommCareAndroid', 'mult.install.state.ready': 'CommCareAndroid', 'mult.install.title': 'CommCareAndroid', 'notification.bad.certificate.action': 'CommCareAndroid', 'notification.bad.certificate.detail': 'CommCareAndroid', 'notification.bad.certificate.title': 'CommCareAndroid', 'notification.case.filter.action': 'CommCareAndroid', 'notification.case.filter.detail': 'CommCareAndroid', 'notification.case.filter.title': 'CommCareAndroid', 'notification.case.predicate.action': 'CommCareAndroid', 'notification.case.predicate.title': 'CommCareAndroid', 'notification.credential.mismatch.action': 'CommCareAndroid', 'notification.credential.mismatch.detail': 'CommCareAndroid', 'notification.credential.mismatch.title': 'CommCareAndroid', 'notification.for.details.wrapper': 'CommCareAndroid', 'notification.formentry.unretrievable.action': 'CommCareAndroid', 'notification.formentry.unretrievable.detail': 'CommCareAndroid', 'notification.formentry.unretrievable.title': 'CommCareAndroid', 'notification.install.badarchive.action': 'CommCareAndroid', 'notification.install.badarchive.detail': 'CommCareAndroid', 'notification.install.badarchive.title': 'CommCareAndroid', 'notification.install.badcert.action': 'CommCareAndroid', 'notification.install.badcert.detail': 'CommCareAndroid', 'notification.install.badcert.title': 'CommCareAndroid', 'notification.install.badreqs.action': 'CommCareAndroid', 'notification.install.badreqs.detail': 'CommCareAndroid', 'notification.install.badreqs.title': 'CommCareAndroid', 'notification.install.badstate.action': 'CommCareAndroid', 'notification.install.badstate.detail': 'CommCareAndroid', 'notification.install.badstate.title': 'CommCareAndroid', 'notification.install.installed.detail': 'CommCareAndroid', 'notification.install.installed.title': 'CommCareAndroid', 'notification.install.missing.action': 'CommCareAndroid', 'notification.install.missing.detail': 'CommCareAndroid', 'notification.install.missing.title': 'CommCareAndroid', 'notification.install.missing.withmessage.action': 'CommCareAndroid', 'notification.install.missing.withmessage.detail': 'CommCareAndroid', 'notification.install.missing.withmessage.title': 'CommCareAndroid', 'notification.install.nolocal.action': 'CommCareAndroid', 'notification.install.nolocal.detail': 'CommCareAndroid', 'notification.install.nolocal.title': 'CommCareAndroid', 'notification.install.unknown.detail': 'CommCareAndroid', 'notification.install.unknown.title': 'CommCareAndroid', 'notification.install.uptodate.detail': 'CommCareAndroid', 'notification.install.uptodate.title': 'CommCareAndroid', 'notification.logger.error.detail': 'CommCareAndroid', 'notification.logger.error.title': 'CommCareAndroid', 'notification.logger.serialized.detail': 'CommCareAndroid', 'notification.logger.serialized.title': 'CommCareAndroid', 'notification.logger.submitted.detail': 'CommCareAndroid', 'notification.logger.submitted.title': 'CommCareAndroid', 'notification.network.timeout.action': 'CommCareAndroid', 'notification.network.timeout.detail': 'CommCareAndroid', 'notification.network.timeout.title': 'CommCareAndroid', 'notification.processing.badstructure.action': 'CommCareAndroid', 'notification.processing.badstructure.detail': 'CommCareAndroid', 'notification.processing.badstructure.title': 'CommCareAndroid', 'notification.processing.nosdcard.action': 'CommCareAndroid', 'notification.processing.nosdcard.detail': 'CommCareAndroid', 'notification.processing.nosdcard.title': 'CommCareAndroid', 'notification.restore.baddata.detail': 'CommCareAndroid', 'notification.restore.baddata.title': 'CommCareAndroid', 'notification.restore.nonetwork.detail': 'CommCareAndroid', 'notification.restore.nonetwork.title': 'CommCareAndroid', 'notification.restore.remote.error.action': 'CommCareAndroid', 'notification.restore.remote.error.detail': 'CommCareAndroid', 'notification.restore.remote.error.title': 'CommCareAndroid', 'notification.restore.unknown.action': 'CommCareAndroid', 'notification.restore.unknown.detail': 'CommCareAndroid', 'notification.restore.unknown.title': 'CommCareAndroid', 'notification.send.malformed.detail': 'CommCareAndroid', 'notification.send.malformed.title': 'CommCareAndroid', 'notification.sending.loggedout.detail': 'CommCareAndroid', 'notification.sending.loggedout.title': 'CommCareAndroid', 'notification.sending.quarantine.action': 'CommCareAndroid', 'notification.sending.quarantine.detail': 'CommCareAndroid', 'notification.sending.quarantine.title': 'CommCareAndroid', 'notification.sync.airplane.action': 'CommCareAndroid', 'notification.sync.airplane.detail': 'CommCareAndroid', 'notification.sync.airplane.title': 'CommCareAndroid', 'notifications.prompt.details': 'CommCareAndroid', 'notifications.prompt.more': 'CommCareAndroid', 'odk_accept_location': 'ODK', 'odk_access_error': 'ODK', 'odk_accuracy': 'ODK', 'odk_activity_not_found': 'ODK', 'odk_add_another': 'ODK', 'odk_add_another_repeat': 'ODK', 'odk_add_repeat': 'ODK', 'odk_add_repeat_no': 'ODK', 'odk_advance': 'ODK', 'odk_altitude': 'ODK', 'odk_app_name': 'ODK', 'odk_app_url': 'ODK', 'odk_attachment_oversized': 'ODK', 'odk_audio_file_error': 'ODK', 'odk_audio_file_invalid': 'ODK', 'odk_backup': 'ODK', 'odk_barcode_scanner_error': 'ODK', 'odk_cancel': 'ODK', 'odk_cancel_loading_form': 'ODK', 'odk_cancel_location': 'ODK', 'odk_cancel_saving_form': 'ODK', 'odk_cannot_edit_completed_form': 'ODK', 'odk_capture_audio': 'ODK', 'odk_capture_image': 'ODK', 'odk_capture_video': 'ODK', 'odk_change_font_size': 'ODK', 'odk_change_formlist_url': 'ODK', 'odk_change_language': 'ODK', 'odk_change_password': 'ODK', 'odk_change_protocol': 'ODK', 'odk_change_server_url': 'ODK', 'odk_change_settings': 'ODK', 'odk_change_splash_path': 'ODK', 'odk_change_submission_url': 'ODK', 'odk_change_username': 'ODK', 'odk_choose_image': 'ODK', 'odk_choose_sound': 'ODK', 'odk_choose_video': 'ODK', 'odk_clear_answer': 'ODK', 'odk_clear_answer_ask': 'ODK', 'odk_clear_answer_no': 'ODK', 'odk_clearanswer_confirm': 'ODK', 'odk_click_to_web': 'ODK', 'odk_client': 'ODK', 'odk_completed_data': 'ODK', 'odk_data': 'ODK', 'odk_data_saved_error': 'ODK', 'odk_data_saved_ok': 'ODK', 'odk_default_completed': 'ODK', 'odk_default_completed_summary': 'ODK', 'odk_default_odk_formlist': 'ODK', 'odk_default_odk_submission': 'ODK', 'odk_default_server_url': 'ODK', 'odk_default_splash_path': 'ODK', 'odk_delete_confirm': 'ODK', 'odk_delete_file': 'ODK', 'odk_delete_no': 'ODK', 'odk_delete_repeat': 'ODK', 'odk_delete_repeat_ask': 'ODK', 'odk_delete_repeat_confirm': 'ODK', 'odk_delete_repeat_no': 'ODK', 'odk_delete_yes': 'ODK', 'odk_discard_answer': 'ODK', 'odk_discard_group': 'ODK', 'odk_do_not_change': 'ODK', 'odk_do_not_exit': 'ODK', 'odk_do_not_save': 'ODK', 'odk_download': 'ODK', 'odk_download_all_successful': 'ODK', 'odk_download_complete': 'ODK', 'odk_download_failed_with_error': 'ODK', 'odk_download_forms_result': 'ODK', 'odk_downloading_data': 'ODK', 'odk_edit_prompt': 'ODK', 'odk_enter': 'ODK', 'odk_enter_data': 'ODK', 'odk_enter_data_button': 'ODK', 'odk_enter_data_description': 'ODK', 'odk_enter_data_message': 'ODK', 'odk_entering_repeat': 'ODK', 'odk_entering_repeat_ask': 'ODK', 'odk_error_downloading': 'ODK', 'odk_error_occured': 'ODK', 'odk_exit': 'ODK', 'odk_fetching_file': 'ODK', 'odk_fetching_manifest': 'ODK', 'odk_file_deleted_error': 'ODK', 'odk_file_deleted_ok': 'ODK', 'odk_file_fetch_failed': 'ODK', 'odk_file_invalid': 'ODK', 'odk_file_missing': 'ODK', 'odk_finding_location': 'ODK', 'odk_finished_disk_scan': 'ODK', 'odk_first_run': 'ODK', 'odk_font_size': 'ODK', 'odk_form': 'ODK', 'odk_form_download_progress': 'ODK', 'odk_form_entry_start_hide': 'ODK', 'odk_form_name': 'ODK', 'odk_form_renamed': 'ODK', 'odk_form_scan_finished': 'ODK', 'odk_form_scan_starting': 'ODK', 'odk_formlist_url': 'ODK', 'odk_forms': 'ODK', 'odk_found_location': 'ODK', 'odk_general_preferences': 'ODK', 'odk_get_barcode': 'ODK', 'odk_get_forms': 'ODK', 'odk_get_location': 'ODK', 'odk_getting_location': 'ODK', 'odk_go_to_location': 'ODK', 'odk_google_account': 'ODK', 'odk_google_submission_id_text': 'ODK', 'odk_intent_callout_button': 'ODK', 'odk_intent_callout_button_update': 'ODK', 'odk_invalid_answer_error': 'ODK', 'odk_jump_to_beginning': 'ODK', 'odk_jump_to_end': 'ODK', 'odk_jump_to_previous': 'ODK', 'odk_keep_changes': 'ODK', 'odk_latitude': 'ODK', 'odk_leave_repeat_yes': 'ODK', 'odk_leaving_repeat': 'ODK', 'odk_leaving_repeat_ask': 'ODK', 'odk_list_failed_with_error': 'ODK', 'odk_load_remote_form_error': 'ODK', 'odk_loading_form': 'ODK', 'odk_location_accuracy': 'ODK', 'odk_location_provider': 'ODK', 'odk_location_provider_accuracy': 'ODK', 'odk_longitude': 'ODK', 'odk_main_menu': 'ODK', 'odk_main_menu_details': 'ODK', 'odk_main_menu_message': 'ODK', 'odk_manage_files': 'ODK', 'odk_manifest_server_error': 'ODK', 'odk_manifest_tag_error': 'ODK', 'odk_mark_finished': 'ODK', 'odk_no': 'ODK', 'odk_no_capture': 'ODK', 'odk_no_connection': 'ODK', 'odk_no_forms_uploaded': 'ODK', 'odk_no_gps_message': 'ODK', 'odk_no_gps_title': 'ODK', 'odk_no_items_display': 'ODK', 'odk_no_items_display_forms': 'ODK', 'odk_no_items_display_instances': 'ODK', 'odk_no_items_error': 'ODK', 'odk_no_sd_error': 'ODK', 'odk_noselect_error': 'ODK', 'odk_ok': 'ODK', 'odk_one_capture': 'ODK', 'odk_open_data_kit': 'ODK', 'odk_parse_error': 'ODK', 'odk_parse_legacy_formlist_failed': 'ODK', 'odk_parse_openrosa_formlist_failed': 'ODK', 'odk_password': 'ODK', 'odk_play_audio': 'ODK', 'odk_play_video': 'ODK', 'odk_please_wait': 'ODK', 'odk_please_wait_long': 'ODK', 'odk_powered_by_odk': 'ODK', 'odk_preference_form_entry_start_hide': 'ODK', 'odk_preference_form_entry_start_summary': 'ODK', 'odk_protocol': 'ODK', 'odk_provider_disabled_error': 'ODK', 'odk_quit_application': 'ODK', 'odk_quit_entry': 'ODK', 'odk_refresh': 'ODK', 'odk_replace_audio': 'ODK', 'odk_replace_barcode': 'ODK', 'odk_replace_image': 'ODK', 'odk_replace_location': 'ODK', 'odk_replace_video': 'ODK', 'odk_required_answer_error': 'ODK', 'odk_review': 'ODK', 'odk_review_data': 'ODK', 'odk_review_data_button': 'ODK', 'odk_root_element_error': 'ODK', 'odk_root_namespace_error': 'ODK', 'odk_save_all_answers': 'ODK', 'odk_save_as_error': 'ODK', 'odk_save_data_message': 'ODK', 'odk_save_enter_data_description': 'ODK', 'odk_save_form_as': 'ODK', 'odk_saved_data': 'ODK', 'odk_saving_form': 'ODK', 'odk_select_another_image': 'ODK', 'odk_select_answer': 'ODK', 'odk_selected': 'ODK', 'odk_selected_google_account_text': 'ODK', 'odk_send': 'ODK', 'odk_send_data': 'ODK', 'odk_send_data_button': 'ODK', 'odk_send_selected_data': 'ODK', 'odk_sending_items': 'ODK', 'odk_server_auth_credentials': 'ODK', 'odk_server_preferences': 'ODK', 'odk_server_requires_auth': 'ODK', 'odk_server_url': 'ODK', 'odk_show_location': 'ODK', 'odk_show_splash': 'ODK', 'odk_show_splash_summary': 'ODK', 'odk_splash_path': 'ODK', 'odk_submission_url': 'ODK', 'odk_success': 'ODK', 'odk_toggle_selected': 'ODK', 'odk_trigger': 'ODK', 'odk_upload_all_successful': 'ODK', 'odk_upload_results': 'ODK', 'odk_upload_some_failed': 'ODK', 'odk_uploading_data': 'ODK', 'odk_url_error': 'ODK', 'odk_use_odk_default': 'ODK', 'odk_username': 'ODK', 'odk_view_hierarchy': 'ODK', 'odk_xform_parse_error': 'ODK', 'option.cancel': 'CommCareAndroid', 'option.no': 'CommCareAndroid', 'option.yes': 'CommCareAndroid', 'problem.report.button': 'CommCareAndroid', 'problem.report.menuitem': 'CommCareAndroid', 'problem.report.prompt': 'CommCareAndroid', 'profile.found': 'CommCareAndroid', 'select.detail.confirm': 'CommCareAndroid', 'select.detail.title': 'CommCareAndroid', 'select.list.title': 'CommCareAndroid', 'select.menu.map': 'CommCareAndroid', 'select.menu.sort': 'CommCareAndroid', 'select.placeholder.message': 'CommCareAndroid', 'select.search.label': 'CommCareAndroid', 'sync.fail.auth.loggedin': 'CommCareAndroid', 'sync.fail.bad.data': 'CommCareAndroid', 'sync.fail.bad.local': 'CommCareAndroid', 'sync.fail.bad.network': 'CommCareAndroid', 'sync.fail.timeout': 'CommCareAndroid', 'sync.fail.unknown': 'CommCareAndroid', 'sync.fail.unsent': 'CommCareAndroid', 'sync.process.downloading.progress': 'CommCareAndroid', 'sync.process.processing': 'CommCareAndroid', 'sync.progress.authing': 'CommCareAndroid', 'sync.progress.downloading': 'CommCareAndroid', 'sync.progress.purge': 'CommCareAndroid', 'sync.progress.starting': 'CommCareAndroid', 'sync.progress.submitting': 'CommCareAndroid', 'sync.progress.submitting.title': 'CommCareAndroid', 'sync.progress.title': 'CommCareAndroid', 'sync.recover.needed': 'CommCareAndroid', 'sync.recover.started': 'CommCareAndroid', 'sync.success.sent': 'CommCareAndroid', 'sync.success.sent.singular': 'CommCareAndroid', 'sync.success.synced': 'CommCareAndroid', 'title.datum.wrapper': 'CommCareAndroid', 'update.success.refresh': 'CommCareAndroid', 'updates.check': 'CommCareAndroid', 'updates.checking': 'CommCareAndroid', 'updates.downloaded': 'CommCareAndroid', 'updates.found': 'CommCareAndroid', 'updates.resources.initialization': 'CommCareAndroid', 'updates.resources.profile': 'CommCareAndroid', 'updates.success': 'CommCareAndroid', 'updates.title': 'CommCareAndroid', 'upgrade.button.retry': 'CommCareAndroid', 'upgrade.button.startover': 'CommCareAndroid', 'verification.checking': 'CommCareAndroid', 'verification.fail.message': 'CommCareAndroid', 'verification.progress': 'CommCareAndroid', 'verification.title': 'CommCareAndroid', 'verify.checking': 'CommCareAndroid', 'verify.progress': 'CommCareAndroid', 'verify.title': 'CommCareAndroid', 'version.id.long': 'CommCareAndroid', 'version.id.short': 'CommCareAndroid', 'wifi.direct.base.folder': 'CommCareAndroid', 'wifi.direct.receive.forms': 'CommCareAndroid', 'wifi.direct.submit.forms': 'CommCareAndroid', 'wifi.direct.submit.missing': 'CommCareAndroid', 'wifi.direct.transfer.forms': 'CommCareAndroid', 'activity.adduser.adduser': 'JavaRosa', 'activity.adduser.problem': 'JavaRosa', 'activity.adduser.problem.emptyuser': 'JavaRosa', 'activity.adduser.problem.mismatchingpasswords': 'JavaRosa', 'activity.adduser.problem.nametaken': 'JavaRosa', 'activity.locationcapture.Accuracy': 'JavaRosa', 'activity.locationcapture.Altitude': 'JavaRosa', 'activity.locationcapture.capturelocation': 'JavaRosa', 'activity.locationcapture.capturelocationhint': 'JavaRosa', 'activity.locationcapture.capturelocationhint': 'JavaRosa', 'activity.locationcapture.fixfailed': 'JavaRosa', 'activity.locationcapture.fixobtained': 'JavaRosa', 'activity.locationcapture.GPSNotAvailable': 'JavaRosa', 'activity.locationcapture.Latitude': 'JavaRosa', 'activity.locationcapture.LocationError': 'JavaRosa', 'activity.locationcapture.Longitude': 'JavaRosa', 'activity.locationcapture.readyforcapture': 'JavaRosa', 'activity.locationcapture.waitingforfix': 'JavaRosa', 'activity.login.demomode.intro': 'CommCareJava', 'activity.login.demomode.intro': 'JavaRosa', 'activity.login.loginincorrect': 'JavaRosa', 'activity.login.tryagain': 'JavaRosa', 'af': 'JavaRosa', 'button.Next': 'JavaRosa', 'button.No': 'JavaRosa', 'button.Yes': 'JavaRosa', 'case.date.opened': 'JavaRosa', 'case.id': 'JavaRosa', 'case.name': 'JavaRosa', 'case.status': 'JavaRosa', 'command.back': 'JavaRosa', 'command.call': 'JavaRosa', 'command.cancel': 'JavaRosa', 'command.exit': 'JavaRosa', 'command.language': 'JavaRosa', 'command.next': 'JavaRosa', 'command.ok': 'JavaRosa', 'command.retry': 'JavaRosa', 'command.save': 'JavaRosa', 'command.saveexit': 'JavaRosa', 'command.select': 'JavaRosa', 'commcare.badversion': 'CommCareJava', 'commcare.fail': 'CommCareJava', 'commcare.fail.sendlogs': 'CommCareJava', 'commcare.firstload': 'CommCareJava', 'commcare.install.oom': 'CommCareJava', 'commcare.menu.count.wrapper': 'CommCareJava', 'commcare.noupgrade.version': 'CommCareJava', 'commcare.numwrapper': 'CommCareJava', 'commcare.review': 'CommCareJava', 'commcare.review.icon': 'CommCareJava', 'commcare.startup.oom': 'CommCareJava', 'commcare.tools.network': 'CommCareJava', 'commcare.tools.permissions': 'CommCareJava', 'commcare.tools.title': 'CommCareJava', 'commcare.tools.validate': 'CommCareJava', 'date.nago': 'JavaRosa', 'date.nfromnow': 'JavaRosa', 'date.today': 'JavaRosa', 'date.tomorrow': 'JavaRosa', 'date.twoago': 'JavaRosa', 'date.unknown': 'JavaRosa', 'date.yesterday': 'JavaRosa', 'debug.log': 'JavaRosa', 'en': 'JavaRosa', 'entity.command.sort': 'JavaRosa', 'entity.detail.title': 'JavaRosa', 'entity.find': 'JavaRosa', 'entity.nodata': 'JavaRosa', 'entity.nomatch': 'JavaRosa', 'entity.sort.title': 'JavaRosa', 'entity.title.layout': 'JavaRosa', 'es': 'JavaRosa', 'form.entry.badnum': 'JavaRosa', 'form.entry.badnum.dec': 'JavaRosa', 'form.entry.badnum.int': 'JavaRosa', 'form.entry.badnum.long': 'JavaRosa', 'form.entry.constraint.msg': 'JavaRosa', 'form.login.login': 'JavaRosa', 'form.login.password': 'JavaRosa', 'form.login.username': 'JavaRosa', 'form.user.confirmpassword': 'JavaRosa', 'form.user.fillinboth': 'JavaRosa', 'form.user.giveadmin': 'JavaRosa', 'form.user.name': 'JavaRosa', 'form.user.password': 'JavaRosa', 'form.user.userid': 'JavaRosa', 'formentry.invalid.input': 'JavaRosa', 'formview.repeat.addNew': 'JavaRosa', 'fra': 'JavaRosa', 'home.change.user': 'CommCareJava', 'home.data.restore': 'CommCareJava', 'home.demo.reset': 'CommCareJava', 'home.setttings': 'CommCareJava', 'home.updates': 'CommCareJava', 'home.user.edit': 'CommCareJava', 'home.user.new': 'CommCareJava', 'homescreen.title': 'CommCareJava', 'icon.demo.path': 'JavaRosa', 'icon.login.path': 'JavaRosa', 'id': 'CommCareJava', 'install.bad': 'CommCareJava', 'install.verify': 'CommCareJava', 'intro.restore': 'CommCareJava', 'intro.start': 'CommCareJava', 'intro.text': 'CommCareJava', 'intro.title': 'CommCareJava', 'loading.screen.message': 'JavaRosa', 'loading.screen.title': 'JavaRosa', 'locale.name.en': 'CommCareJava', 'locale.name.sw': 'CommCareJava', 'log.submit.full': 'JavaRosa', 'log.submit.never': 'JavaRosa', 'log.submit.next.daily': 'JavaRosa', 'log.submit.next.weekly': 'JavaRosa', 'log.submit.nigthly': 'JavaRosa', 'log.submit.short': 'JavaRosa', 'log.submit.url': 'JavaRosa', 'log.submit.weekly': 'JavaRosa', 'login.title': 'CommCareJava', 'menu.Back': 'JavaRosa', 'menu.Capture': 'JavaRosa', 'menu.Demo': 'JavaRosa', 'menu.Exit': 'JavaRosa', 'menu.Login': 'JavaRosa', 'menu.Next': 'JavaRosa', 'menu.ok': 'JavaRosa', 'menu.retry': 'JavaRosa', 'menu.Save': 'JavaRosa', 'menu.SaveAndExit': 'JavaRosa', 'menu.send.all': 'CommCareJava', 'menu.send.all.val': 'CommCareJava', 'menu.send.later': 'JavaRosa', 'menu.SendLater': 'JavaRosa', 'menu.SendNow': 'JavaRosa', 'menu.SendToNewServer': 'JavaRosa', 'menu.Settings': 'JavaRosa', 'menu.sync': 'CommCareJava', 'menu.sync.last': 'CommCareJava', 'menu.sync.prompt': 'CommCareJava', 'menu.sync.unsent.mult': 'CommCareJava', 'menu.sync.unsent.one': 'CommCareJava', 'menu.Tools': 'JavaRosa', 'menu.ViewAnswers': 'JavaRosa', 'message.delete': 'JavaRosa', 'message.details': 'JavaRosa', 'message.log': 'JavaRosa', 'message.permissions': 'CommCareJava', 'message.send.unsent': 'JavaRosa', 'message.timesync': 'CommCareJava', 'network.test.begin.image': 'CommCareJava', 'network.test.begin.message': 'CommCareJava', 'network.test.connected.image': 'CommCareJava', 'network.test.connected.message': 'CommCareJava', 'network.test.connecting.image': 'CommCareJava', 'network.test.connecting.message': 'CommCareJava', 'network.test.content.image': 'CommCareJava', 'network.test.content.message': 'CommCareJava', 'network.test.details': 'CommCareJava', 'network.test.details.title': 'CommCareJava', 'network.test.failed.image': 'CommCareJava', 'network.test.failed.message': 'CommCareJava', 'network.test.response.message': 'CommCareJava', 'network.test.title': 'CommCareJava', 'no': 'JavaRosa', 'node.select.filtering': 'CommCareJava', 'plussign': 'JavaRosa', 'polish.command.back': 'JavaRosa', 'polish.command.cancel': 'JavaRosa', 'polish.command.clear': 'JavaRosa', 'polish.command.delete': 'JavaRosa', 'polish.command.entersymbol': 'JavaRosa', 'polish.command.exit': 'JavaRosa', 'polish.command.followlink': 'JavaRosa', 'polish.command.hide': 'JavaRosa', 'polish.command.mark': 'JavaRosa', 'polish.command.ok': 'JavaRosa', 'polish.command.options': 'JavaRosa', 'polish.command.select': 'JavaRosa', 'polish.command.submit': 'JavaRosa', 'polish.command.unmark': 'JavaRosa', 'polish.date.select': 'CommCareJava', 'polish.date.select': 'JavaRosa', 'polish.rss.command.followlink': 'JavaRosa', 'polish.rss.command.select': 'JavaRosa', 'polish.TextField.charactersKey0': 'JavaRosa', 'polish.TextField.charactersKey1': 'JavaRosa', 'polish.TextField.charactersKey2': 'JavaRosa', 'polish.TextField.charactersKey3': 'JavaRosa', 'polish.TextField.charactersKey4': 'JavaRosa', 'polish.TextField.charactersKey5': 'JavaRosa', 'polish.TextField.charactersKey6': 'JavaRosa', 'polish.TextField.charactersKey7': 'JavaRosa', 'polish.TextField.charactersKey8': 'JavaRosa', 'polish.TextField.charactersKey9': 'JavaRosa', 'polish.title.input': 'JavaRosa', 'pt': 'JavaRosa', 'question.SendNow': 'JavaRosa', 'repeat.message.multiple': 'JavaRosa', 'repeat.message.single': 'JavaRosa', 'repeat.repitition': 'JavaRosa', 'restore.bad.db': 'CommCareJava', 'restore.badcredentials': 'CommCareJava', 'restore.baddownload': 'CommCareJava', 'restore.badserver': 'CommCareJava', 'restore.bypass.clean': 'CommCareJava', 'restore.bypass.clean.success': 'CommCareJava', 'restore.bypass.cleanfail': 'CommCareJava', 'restore.bypass.fail': 'CommCareJava', 'restore.bypass.instructions': 'CommCareJava', 'restore.bypass.start': 'CommCareJava', 'restore.db.busy': 'CommCareJava', 'restore.downloaded': 'CommCareJava', 'restore.fail': 'CommCareJava', 'restore.fail.credentials': 'CommCareJava', 'restore.fail.download': 'CommCareJava', 'restore.fail.message': 'CommCareJava', 'restore.fail.nointernet': 'CommCareJava', 'restore.fail.other': 'CommCareJava', 'restore.fail.retry': 'CommCareJava', 'restore.fail.technical': 'CommCareJava', 'restore.fail.transport': 'CommCareJava', 'restore.fail.view': 'CommCareJava', 'restore.fetch': 'CommCareJava', 'restore.finished': 'CommCareJava', 'restore.key.continue': 'CommCareJava', 'restore.login.instructions': 'CommCareJava', 'restore.message.connection.failed': 'CommCareJava', 'restore.message.connectionmade': 'CommCareJava', 'restore.message.startdownload': 'CommCareJava', 'restore.nocache': 'CommCareJava', 'restore.noserveruri': 'CommCareJava', 'restore.recover.fail': 'CommCareJava', 'restore.recover.needcache': 'CommCareJava', 'restore.recover.send': 'CommCareJava', 'restore.recovery.wipe': 'CommCareJava', 'restore.retry': 'CommCareJava', 'restore.starting': 'CommCareJava', 'restore.success': 'CommCareJava', 'restore.success.partial': 'CommCareJava', 'restore.ui.bounded': 'CommCareJava', 'restore.ui.unbounded': 'CommCareJava', 'restore.user.exists': 'CommCareJava', 'review.date': 'CommCareJava', 'review.title': 'CommCareJava', 'review.type': 'CommCareJava', 'review.type.unknown': 'CommCareJava', 'send.unsent.icon': 'CommCareJava', 'sending.message.send': 'JavaRosa', 'sending.status.didnotunderstand': 'CommCareJava', 'sending.status.error': 'JavaRosa', 'sending.status.failed': 'JavaRosa', 'sending.status.failures': 'JavaRosa', 'sending.status.going': 'JavaRosa', 'sending.status.long': 'JavaRosa', 'sending.status.multi': 'JavaRosa', 'sending.status.none': 'JavaRosa', 'sending.status.problem.datasafe': 'CommCareJava', 'sending.status.success': 'JavaRosa', 'sending.status.success': 'JavaRosa', 'sending.status.title': 'JavaRosa', 'sending.view.done': 'JavaRosa', 'sending.view.done.title': 'JavaRosa', 'sending.view.later': 'JavaRosa', 'sending.view.now': 'JavaRosa', 'sending.view.submit': 'JavaRosa', 'sending.view.when': 'JavaRosa', 'server.sync.icon.normal': 'CommCareJava', 'server.sync.icon.warn': 'CommCareJava', 'settings.language': 'JavaRosa', 'splashscreen': 'JavaRosa', 'sw': 'JavaRosa', 'sync.cancelled': 'CommCareJava', 'sync.cancelled.sending': 'CommCareJava', 'sync.done.closed': 'CommCareJava', 'sync.done.new': 'CommCareJava', 'sync.done.noupdate': 'CommCareJava', 'sync.done.updated': 'CommCareJava', 'sync.done.updates': 'CommCareJava', 'sync.pull.admin': 'CommCareJava', 'sync.pull.demo': 'CommCareJava', 'sync.pull.fail': 'CommCareJava', 'sync.send.fail': 'CommCareJava', 'sync.unsent.cancel': 'CommCareJava', 'update.fail.generic': 'CommCareJava', 'update.fail.network': 'CommCareJava', 'update.fail.network.retry': 'CommCareJava', 'update.header': 'CommCareJava', 'update.retrying': 'CommCareJava', 'user.create.header': 'JavaRosa', 'user.entity.admin': 'JavaRosa', 'user.entity.demo': 'JavaRosa', 'user.entity.name': 'JavaRosa', 'user.entity.normal': 'JavaRosa', 'user.entity.type': 'JavaRosa', 'user.entity.unknown': 'JavaRosa', 'user.entity.username': 'JavaRosa', 'user.registration.attempt': 'JavaRosa', 'user.registration.badresponse': 'JavaRosa', 'user.registration.failmessage': 'JavaRosa', 'user.registration.success': 'JavaRosa', 'user.registration.title': 'JavaRosa', 'validation.start': 'CommCareJava', 'validation.success': 'CommCareJava', 'video.playback.bottom': 'JavaRosa', 'video.playback.hashkey.path': 'JavaRosa', 'video.playback.top': 'JavaRosa', 'view.sending.RequiredQuestion': 'JavaRosa', 'xpath.fail.runtime': 'CommCareJava', 'yes': 'JavaRosa', 'zh': 'JavaRosa'}
class Solution: def hasPathSum(self, root: Optional[TreeNode], targetSum: int) -> bool: if root is None: return False targetSum -= root.val if targetSum == 0: if (root.left is None) and (root.right is None): return True return self.hasPathSum(root.left, targetSum) or self.hasPathSum(root.right, targetSum)
class Solution: def has_path_sum(self, root: Optional[TreeNode], targetSum: int) -> bool: if root is None: return False target_sum -= root.val if targetSum == 0: if root.left is None and root.right is None: return True return self.hasPathSum(root.left, targetSum) or self.hasPathSum(root.right, targetSum)
# -*- coding: utf-8 -*- # @Author: jpch89 # @Email: jpch89@outlook.com # @Date: 2018-06-27 23:59:30 # @Last Modified by: jpch89 # @Last Modified time: 2018-06-28 00:02:38 formatter = '{} {} {} {}' print(formatter.format(1, 2, 3, 4)) print(formatter.format("one", "two", "three", "four")) print(formatter.format(True, False, False, True)) print(formatter.format(formatter, formatter, formatter, formatter)) print(formatter.format( "Try your", "Own text here", "Maybe a peom", "Or a song about fear" ))
formatter = '{} {} {} {}' print(formatter.format(1, 2, 3, 4)) print(formatter.format('one', 'two', 'three', 'four')) print(formatter.format(True, False, False, True)) print(formatter.format(formatter, formatter, formatter, formatter)) print(formatter.format('Try your', 'Own text here', 'Maybe a peom', 'Or a song about fear'))
'''2. Write a Python program to compute the similarity between two lists. Sample data: ["red", "orange", "green", "blue", "white"], ["black", "yellow", "green", "blue"] Expected Output: Color1-Color2: ['white', 'orange', 'red'] Color2-Color1: ['black', 'yellow'] ''' def find_similiarity(list1, list2): list3 = list(set(list1) - set(list2)) list4 = list(set(list2) - set(list1)) return list3, list4 print(find_similiarity(["red", "orange", "green", "blue", "white"], ["black", "yellow", "green", "blue"]))
"""2. Write a Python program to compute the similarity between two lists. Sample data: ["red", "orange", "green", "blue", "white"], ["black", "yellow", "green", "blue"] Expected Output: Color1-Color2: ['white', 'orange', 'red'] Color2-Color1: ['black', 'yellow'] """ def find_similiarity(list1, list2): list3 = list(set(list1) - set(list2)) list4 = list(set(list2) - set(list1)) return (list3, list4) print(find_similiarity(['red', 'orange', 'green', 'blue', 'white'], ['black', 'yellow', 'green', 'blue']))
def get_client_ip(request): client_ip = request.META.get('REMOTE_ADDR', '') return client_ip
def get_client_ip(request): client_ip = request.META.get('REMOTE_ADDR', '') return client_ip
url = "https://customerportal.supermicro.com/Customer/ContentPages/CustOrders.aspx" orderType = "//select[@id='ContentPlaceHolder1_ddlSearchType']" fromDate = "//input[@id='ContentPlaceHolder1_txtFrom']" customerId = "//select[@id='ContentPlaceHolder1_ddlCustomerID']" searchIcon = "//a[@id='linkSearch']" orderTable = "//table[contains(@id,'ContentPlaceHolder1')]" pageCount = "(//tr[@class='gridPager']/td/table/tbody/tr/td)" selectPage = "(//tr[@class='gridPager']/td/table/tbody/tr/td)[{}]" soldToAddress = "//td[@class='InfoCell AddressCell ']/div/div/div[{}]" shipToAddress = "//td[@class='InfoCell AddressCell']/div/div/div[{}]" esd = "//td[@class='InfoCell ETACell']" message = "//td[@class='InfoCell CommentsCell']" orderItem = "//div[contains(@id,'panelOrdItemList')]/div/a" orderItemHeaders = "//table[contains(@id,'gvOrdDetails')]/tbody/tr[1]/th" orderItemRows = "//table[contains(@id,'gvOrdDetails')]/tbody/tr" orderItemRowsValue = "//table[contains(@id,'gvOrdDetails')]/tbody/tr[{}]/td[{}]" orderItemHeadersValue = "//table[contains(@id,'gvOrdDetails')]/tbody/tr[1]/th[{}]" closeOrderTableRowCount = "//table[@id='ContentPlaceHolder1_gvCloseOrd']/tbody//tr" closeOrderSalesOrder = "//table[@id='ContentPlaceHolder1_gvCloseOrd']/tbody//tr[{}]/td[1]" closeOrderOrderData = "//table[@id='ContentPlaceHolder1_gvCloseOrd']/tbody//tr[{}]/td[2]" closeOrderCustomerPO = "//table[@id='ContentPlaceHolder1_gvCloseOrd']/tbody//tr[{}]/td[3]" closeOrderAssemblyType = "//table[@id='ContentPlaceHolder1_gvCloseOrd']/tbody//tr[{}]/td[4]" closeOrderOrderDetailsButton = "//table[@id='ContentPlaceHolder1_gvCloseOrd']/tbody//tr[{}]/td[6]/a" closeOrderOrderStatus = "//table[@id='ContentPlaceHolder1_ClosedOrdInfo_gvOrdHeader']//tr[2]/td[6]" openOrderTableRowCount = "//table[@id='ContentPlaceHolder1_gvOpenOrd']/tbody//tr" openOrderSoldToId = "//table[@id='ContentPlaceHolder1_gvOpenOrd']/tbody//tr[{}]/td[1]" openOrderSalesOrder = "//table[@id='ContentPlaceHolder1_gvOpenOrd']/tbody//tr[{}]/td[2]" openOrderCustomerPO = "//table[@id='ContentPlaceHolder1_gvOpenOrd']/tbody//tr[{}]/td[3]" openOrderShipToParty = "//table[@id='ContentPlaceHolder1_gvOpenOrd']/tbody//tr[{}]/td[4]" openOrderShipToCountry = "//table[@id='ContentPlaceHolder1_gvOpenOrd']/tbody//tr[{}]/td[5]/div" openOrderCreatedTime = "//table[@id='ContentPlaceHolder1_gvOpenOrd']/tbody//tr[{}]/td[6]" openOrderOrderDetailsButton = "//table[@id='ContentPlaceHolder1_gvOpenOrd']/tbody//tr[{}]/td[7]/a" openOrderAssemblyType = "//table[@id='ContentPlaceHolder1_gvOrdHeader']/tbody//tr[2]/td[2]" openOrderOrderStatus = "//table[@id='ContentPlaceHolder1_gvOrdHeader']/tbody//tr[2]/td[6]"
url = 'https://customerportal.supermicro.com/Customer/ContentPages/CustOrders.aspx' order_type = "//select[@id='ContentPlaceHolder1_ddlSearchType']" from_date = "//input[@id='ContentPlaceHolder1_txtFrom']" customer_id = "//select[@id='ContentPlaceHolder1_ddlCustomerID']" search_icon = "//a[@id='linkSearch']" order_table = "//table[contains(@id,'ContentPlaceHolder1')]" page_count = "(//tr[@class='gridPager']/td/table/tbody/tr/td)" select_page = "(//tr[@class='gridPager']/td/table/tbody/tr/td)[{}]" sold_to_address = "//td[@class='InfoCell AddressCell ']/div/div/div[{}]" ship_to_address = "//td[@class='InfoCell AddressCell']/div/div/div[{}]" esd = "//td[@class='InfoCell ETACell']" message = "//td[@class='InfoCell CommentsCell']" order_item = "//div[contains(@id,'panelOrdItemList')]/div/a" order_item_headers = "//table[contains(@id,'gvOrdDetails')]/tbody/tr[1]/th" order_item_rows = "//table[contains(@id,'gvOrdDetails')]/tbody/tr" order_item_rows_value = "//table[contains(@id,'gvOrdDetails')]/tbody/tr[{}]/td[{}]" order_item_headers_value = "//table[contains(@id,'gvOrdDetails')]/tbody/tr[1]/th[{}]" close_order_table_row_count = "//table[@id='ContentPlaceHolder1_gvCloseOrd']/tbody//tr" close_order_sales_order = "//table[@id='ContentPlaceHolder1_gvCloseOrd']/tbody//tr[{}]/td[1]" close_order_order_data = "//table[@id='ContentPlaceHolder1_gvCloseOrd']/tbody//tr[{}]/td[2]" close_order_customer_po = "//table[@id='ContentPlaceHolder1_gvCloseOrd']/tbody//tr[{}]/td[3]" close_order_assembly_type = "//table[@id='ContentPlaceHolder1_gvCloseOrd']/tbody//tr[{}]/td[4]" close_order_order_details_button = "//table[@id='ContentPlaceHolder1_gvCloseOrd']/tbody//tr[{}]/td[6]/a" close_order_order_status = "//table[@id='ContentPlaceHolder1_ClosedOrdInfo_gvOrdHeader']//tr[2]/td[6]" open_order_table_row_count = "//table[@id='ContentPlaceHolder1_gvOpenOrd']/tbody//tr" open_order_sold_to_id = "//table[@id='ContentPlaceHolder1_gvOpenOrd']/tbody//tr[{}]/td[1]" open_order_sales_order = "//table[@id='ContentPlaceHolder1_gvOpenOrd']/tbody//tr[{}]/td[2]" open_order_customer_po = "//table[@id='ContentPlaceHolder1_gvOpenOrd']/tbody//tr[{}]/td[3]" open_order_ship_to_party = "//table[@id='ContentPlaceHolder1_gvOpenOrd']/tbody//tr[{}]/td[4]" open_order_ship_to_country = "//table[@id='ContentPlaceHolder1_gvOpenOrd']/tbody//tr[{}]/td[5]/div" open_order_created_time = "//table[@id='ContentPlaceHolder1_gvOpenOrd']/tbody//tr[{}]/td[6]" open_order_order_details_button = "//table[@id='ContentPlaceHolder1_gvOpenOrd']/tbody//tr[{}]/td[7]/a" open_order_assembly_type = "//table[@id='ContentPlaceHolder1_gvOrdHeader']/tbody//tr[2]/td[2]" open_order_order_status = "//table[@id='ContentPlaceHolder1_gvOrdHeader']/tbody//tr[2]/td[6]"
class Solution: def corpFlightBookings(self, bookings: List[List[int]], n: int) -> List[int]: dp = [0]*n for i,j,k in bookings: dp[i-1]+=k if j!=n: dp[j]-=k for i in range(1,n): dp[i]+=dp[i-1] return dp
class Solution: def corp_flight_bookings(self, bookings: List[List[int]], n: int) -> List[int]: dp = [0] * n for (i, j, k) in bookings: dp[i - 1] += k if j != n: dp[j] -= k for i in range(1, n): dp[i] += dp[i - 1] return dp
def buildFibonacciSequence(items): actual = 0 next = 1 sequence = [] for index in range(items): sequence.append(actual) actual, next = next, actual+next return sequence
def build_fibonacci_sequence(items): actual = 0 next = 1 sequence = [] for index in range(items): sequence.append(actual) (actual, next) = (next, actual + next) return sequence
class Animation: def __init__(self, sprites, time_interval): self.sprites = tuple(sprites) self.time_interval = time_interval self.index = 0 self.time = 0 def restart_at(self, index): self.time = 0 self.index = index % len(self.sprites) def update(self, dt): self.time += dt if self.time >= self.time_interval: self.time = self.time - self.time_interval self.index = (self.index + 1) % len(self.sprites) return self.sprites[self.index] class OneTimeAnimation: def __init__(self, sprites, time_interval): self.sprites = tuple(sprites) self.time_interval = time_interval self.index = 0 self.time = 0 self.dead = False def restart_at(self, index): self.time = 0 self.index = index % len(self.sprites) def update(self, dt): if self.dead: return None self.time += dt if self.time >= self.time_interval: self.time = self.time - self.time_interval self.index += 1 if self.index >= len(self.sprites) - 1: self.dead = True return self.sprites[self.index] class ConditionalAnimation: def __init__(self, sprites, condition): self.sprites = sprites self.condition = condition def update(self, argument): return self.sprites[self.condition(argument)]
class Animation: def __init__(self, sprites, time_interval): self.sprites = tuple(sprites) self.time_interval = time_interval self.index = 0 self.time = 0 def restart_at(self, index): self.time = 0 self.index = index % len(self.sprites) def update(self, dt): self.time += dt if self.time >= self.time_interval: self.time = self.time - self.time_interval self.index = (self.index + 1) % len(self.sprites) return self.sprites[self.index] class Onetimeanimation: def __init__(self, sprites, time_interval): self.sprites = tuple(sprites) self.time_interval = time_interval self.index = 0 self.time = 0 self.dead = False def restart_at(self, index): self.time = 0 self.index = index % len(self.sprites) def update(self, dt): if self.dead: return None self.time += dt if self.time >= self.time_interval: self.time = self.time - self.time_interval self.index += 1 if self.index >= len(self.sprites) - 1: self.dead = True return self.sprites[self.index] class Conditionalanimation: def __init__(self, sprites, condition): self.sprites = sprites self.condition = condition def update(self, argument): return self.sprites[self.condition(argument)]
NoOfLines=int(input()) for Row in range(0,NoOfLines): for Column in range(0,NoOfLines): if(Row%2==0 and Column+1==NoOfLines)or(Row%2==1 and Column==0): print("%2d"%(Row+2),end=" ") else: print("%2d"%(Row+1),end=" ") else: print(end="\n") #second code NoOfLines=int(input()) for Row in range(1,NoOfLines+1): for Column in range(1,NoOfLines+1): if(Row%2==1 and Column==NoOfLines)or(Row%2==0 and Column==1): print("%2d"%(Row+1),end=" ") else: print("%2d"%(Row),end=" ") else: print(end="\n")
no_of_lines = int(input()) for row in range(0, NoOfLines): for column in range(0, NoOfLines): if Row % 2 == 0 and Column + 1 == NoOfLines or (Row % 2 == 1 and Column == 0): print('%2d' % (Row + 2), end=' ') else: print('%2d' % (Row + 1), end=' ') else: print(end='\n') no_of_lines = int(input()) for row in range(1, NoOfLines + 1): for column in range(1, NoOfLines + 1): if Row % 2 == 1 and Column == NoOfLines or (Row % 2 == 0 and Column == 1): print('%2d' % (Row + 1), end=' ') else: print('%2d' % Row, end=' ') else: print(end='\n')
# --------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. # --------------------------------------------------------- def get_workspace_dependent_resource_location(location): if location == "centraluseuap": return "eastus" return location
def get_workspace_dependent_resource_location(location): if location == 'centraluseuap': return 'eastus' return location
# 1.5 One Away # There are three types of edits that can be performed on strings: # insert a character, remove a character, or replace a character. # Given two strings, write a function to check if they are one edit (or zero edits) away. def one_away(string_1, string_2): if string_1 == string_2: return True # Check if inserting a character creates equality if one_insert_away(string_1, string_2): return True # Check if removing a character creates equality if one_removal_away(string_1, string_2): return True # Check if replaceing a character creates equality if one_replacement_away(string_1, string_2): return True return False def one_insert_away(string_1, string_2): if (len(string_1) + 1) != len(string_2): return False index_1 = 0 index_2 = 0 for i in range(len(string_1)): if string_1[index_1] != string_2[index_2]: index_2 += 1 if index_2 - index_1 > 1: return False else: index_1 += 1 index_2 += 1 return True def one_removal_away(string_1, string_2): if (len(string_1) - 1) != len(string_2): return False index_1 = 0 index_2 = 0 for i in range(len(string_2)): if string_1[index_1] != string_2[index_2]: index_1 += 1 if index_1 - index_2 > 1: return False else: index_1 += 1 index_2 += 1 return True def one_replacement_away(string_1, string_2): if len(string_1) != len(string_2): return False replaced = False for i in range(len(string_2)): if string_1[i] != string_2[i]: if replaced: return False replaced = True return True print(one_away('hello', 'hello')) # True print(one_away('hell', 'hello')) # True print(one_away('hello', 'hell')) # True print(one_away('hello', 'heldo')) # True print(one_away('h', 'hello')) # False
def one_away(string_1, string_2): if string_1 == string_2: return True if one_insert_away(string_1, string_2): return True if one_removal_away(string_1, string_2): return True if one_replacement_away(string_1, string_2): return True return False def one_insert_away(string_1, string_2): if len(string_1) + 1 != len(string_2): return False index_1 = 0 index_2 = 0 for i in range(len(string_1)): if string_1[index_1] != string_2[index_2]: index_2 += 1 if index_2 - index_1 > 1: return False else: index_1 += 1 index_2 += 1 return True def one_removal_away(string_1, string_2): if len(string_1) - 1 != len(string_2): return False index_1 = 0 index_2 = 0 for i in range(len(string_2)): if string_1[index_1] != string_2[index_2]: index_1 += 1 if index_1 - index_2 > 1: return False else: index_1 += 1 index_2 += 1 return True def one_replacement_away(string_1, string_2): if len(string_1) != len(string_2): return False replaced = False for i in range(len(string_2)): if string_1[i] != string_2[i]: if replaced: return False replaced = True return True print(one_away('hello', 'hello')) print(one_away('hell', 'hello')) print(one_away('hello', 'hell')) print(one_away('hello', 'heldo')) print(one_away('h', 'hello'))
def permune(orignal, chosen): if not orignal: print(chosen) else: for i in range(len(orignal)): c=orignal[i] chosen+=c lt=list(orignal) lt.pop(i) orignal=''.join(lt) permune(orignal,chosen) orignal=orignal[:i]+c+orignal[i:] chosen=chosen[:len(chosen)-1] permune('lit','')
def permune(orignal, chosen): if not orignal: print(chosen) else: for i in range(len(orignal)): c = orignal[i] chosen += c lt = list(orignal) lt.pop(i) orignal = ''.join(lt) permune(orignal, chosen) orignal = orignal[:i] + c + orignal[i:] chosen = chosen[:len(chosen) - 1] permune('lit', '')
entity_id = 'sensor.next_train_to_wim' attributes = hass.states.get(entity_id).attributes my_early_train_current_status = hass.states.get('sensor.my_early_train').state scheduled = False # Check if train scheduled for train in attributes['next_trains']: if train['scheduled'] == '07:15': scheduled = True if train['status'] != my_early_train_current_status: hass.states.set('sensor.my_early_train', train['status']) if not scheduled: hass.states.set('sensor.my_early_train', 'No data') # check no data
entity_id = 'sensor.next_train_to_wim' attributes = hass.states.get(entity_id).attributes my_early_train_current_status = hass.states.get('sensor.my_early_train').state scheduled = False for train in attributes['next_trains']: if train['scheduled'] == '07:15': scheduled = True if train['status'] != my_early_train_current_status: hass.states.set('sensor.my_early_train', train['status']) if not scheduled: hass.states.set('sensor.my_early_train', 'No data')
class Node: def __init__(self,key=None,val=None,nxt=None,prev=None): self.key = key self.val = val self.nxt = nxt self.prev = prev class DLL: def __init__(self): self.head = Node() self.tail = Node() self.head.nxt = self.tail self.tail.prev = self.head def pop(self): return self.delete(self.tail.prev) def delete(self,node): node.prev.nxt = node.nxt node.nxt.prev = node.prev return node def appendleft(self,node): node.nxt = self.head.nxt node.prev = self.head self.head.nxt.prev = node self.head.nxt = node return node class LRUCache: def __init__(self, capacity): self.maps = dict() self.dll = DLL() self.capacity = capacity def get(self, key): if key not in self.maps: return -1 self.dll.appendleft(self.dll.delete(self.maps[key])) return self.maps[key].val def set(self, key, val): if key not in self.maps: if len(self.maps) == self.capacity: self.maps.pop(self.dll.pop().key) self.maps[key] = self.dll.appendleft(Node(key,val)) else: self.get(key) self.maps[key].val = val
class Node: def __init__(self, key=None, val=None, nxt=None, prev=None): self.key = key self.val = val self.nxt = nxt self.prev = prev class Dll: def __init__(self): self.head = node() self.tail = node() self.head.nxt = self.tail self.tail.prev = self.head def pop(self): return self.delete(self.tail.prev) def delete(self, node): node.prev.nxt = node.nxt node.nxt.prev = node.prev return node def appendleft(self, node): node.nxt = self.head.nxt node.prev = self.head self.head.nxt.prev = node self.head.nxt = node return node class Lrucache: def __init__(self, capacity): self.maps = dict() self.dll = dll() self.capacity = capacity def get(self, key): if key not in self.maps: return -1 self.dll.appendleft(self.dll.delete(self.maps[key])) return self.maps[key].val def set(self, key, val): if key not in self.maps: if len(self.maps) == self.capacity: self.maps.pop(self.dll.pop().key) self.maps[key] = self.dll.appendleft(node(key, val)) else: self.get(key) self.maps[key].val = val