content
stringlengths
7
1.05M
fixed_cases
stringlengths
1
1.28M
print('Digite seu nome:') nome = input() print('Digite sua idade:') idade = int(input()) podeVotar = idade>=16 print(nome,'tem',idade,'anos:',podeVotar)
print('Digite seu nome:') nome = input() print('Digite sua idade:') idade = int(input()) pode_votar = idade >= 16 print(nome, 'tem', idade, 'anos:', podeVotar)
OK = '+OK\r\n' def reply(v): ''' formats the value as a redis reply ''' return '$%s\r\n%s\r\n' % (len(v), v)
ok = '+OK\r\n' def reply(v): """ formats the value as a redis reply """ return '$%s\r\n%s\r\n' % (len(v), v)
lost_fights = int(input()) helmet_price = float(input()) sword_price = float(input()) shield_price = float(input()) armor_price = float(input()) shield_repair_count = 0 total_cost = 0 for i in range(1, lost_fights+1): if i % 2 == 0: total_cost += helmet_price if i % 3 == 0: total_cost += sword_price if i % 2 == 0 and i % 3 == 0: total_cost += shield_price shield_repair_count += 1 if shield_repair_count == 2: total_cost += armor_price shield_repair_count = 0 print(f'Gladiator expenses: {total_cost:.2f} aureus')
lost_fights = int(input()) helmet_price = float(input()) sword_price = float(input()) shield_price = float(input()) armor_price = float(input()) shield_repair_count = 0 total_cost = 0 for i in range(1, lost_fights + 1): if i % 2 == 0: total_cost += helmet_price if i % 3 == 0: total_cost += sword_price if i % 2 == 0 and i % 3 == 0: total_cost += shield_price shield_repair_count += 1 if shield_repair_count == 2: total_cost += armor_price shield_repair_count = 0 print(f'Gladiator expenses: {total_cost:.2f} aureus')
def end_other(a, b): a = a.lower() b = b.lower() if a[-(len(b)):] == b or a == b[-(len(a)):]: return True return False
def end_other(a, b): a = a.lower() b = b.lower() if a[-len(b):] == b or a == b[-len(a):]: return True return False
class PermissionBackend(object): supports_object_permissions = True supports_anonymous_user = True def authenticate(self, **kwargs): # always return a None user return None def has_perm(self, user, perm, obj=None): if user.is_anonymous(): return False if perm in ["forums.add_forumthread", "forums.add_forumreply"]: return True
class Permissionbackend(object): supports_object_permissions = True supports_anonymous_user = True def authenticate(self, **kwargs): return None def has_perm(self, user, perm, obj=None): if user.is_anonymous(): return False if perm in ['forums.add_forumthread', 'forums.add_forumreply']: return True
class A: def m(): pass def f(): pass
class A: def m(): pass def f(): pass
# -*- encoding: utf-8 -*- class KlotskiBoardException(Exception): def __init__(self, piece, kind_message): message = "Wrong board configuration: {} '{}'".format(kind_message, piece) super().__init__(message) class WrongPieceValue(KlotskiBoardException): def __init__(self, x): super().__init__(x, "wrong piece value") class PieceAlreadyInPlace(KlotskiBoardException): def __init__(self, x): super().__init__(x, "piece already in place") class ProblematicPiece(KlotskiBoardException): def __init__(self, x): super().__init__(x, "check piece") class MissingPiece(KlotskiBoardException): def __init__(self, x): super().__init__(x, "missing piece, current pieces are:")
class Klotskiboardexception(Exception): def __init__(self, piece, kind_message): message = "Wrong board configuration: {} '{}'".format(kind_message, piece) super().__init__(message) class Wrongpiecevalue(KlotskiBoardException): def __init__(self, x): super().__init__(x, 'wrong piece value') class Piecealreadyinplace(KlotskiBoardException): def __init__(self, x): super().__init__(x, 'piece already in place') class Problematicpiece(KlotskiBoardException): def __init__(self, x): super().__init__(x, 'check piece') class Missingpiece(KlotskiBoardException): def __init__(self, x): super().__init__(x, 'missing piece, current pieces are:')
''' A curious problem that involves 'rotating' a number and solving a number of contraints Author: Daniel Haberstock Date: 05/26/2018 Sources used: https://stackoverflow.com/questions/19463556/string-contains-any-character-in-group ''' def rotate(x): # split up the integer into a list of single digit strings splitx = [i for i in str(x)] # reverse it since we are always doing 1/2 rotations splitx.reverse() # initialize the final solution string y = '' # loop through the list of digits # we only need to rotate 6/9 since they are the only number that will flip for digit in splitx: if digit == "6": y += "9" elif digit == "9": y +="6" else: y += digit return int(y) # now to solve the riddle # we need to define our rotate assumption which is to say that if the # number contains a letter 2,3,4,5,7 it is not allowed to be part of the solution # 1. 100 <= x <= 999 --> for x in range(100, 1000) # 2. rotate(x) + 129 = x --> if rotate(x) + 129 == x # 3. rotate(x - 9) = x - 9 --> rotate(x - 9) == x - 9 # we know if both 2. and 3. are true then we found a solution rotateAssumption = True for x in range(100, 1000): if rotateAssumption: if any(num in str(x) for num in "23457"): continue if rotate(x) + 129 == x and rotate(x - 9) == x - 9: print("I found the number: ", x)
""" A curious problem that involves 'rotating' a number and solving a number of contraints Author: Daniel Haberstock Date: 05/26/2018 Sources used: https://stackoverflow.com/questions/19463556/string-contains-any-character-in-group """ def rotate(x): splitx = [i for i in str(x)] splitx.reverse() y = '' for digit in splitx: if digit == '6': y += '9' elif digit == '9': y += '6' else: y += digit return int(y) rotate_assumption = True for x in range(100, 1000): if rotateAssumption: if any((num in str(x) for num in '23457')): continue if rotate(x) + 129 == x and rotate(x - 9) == x - 9: print('I found the number: ', x)
S = input() ans = ( 'YES' if S.count('x') <= 7 else 'NO' ) print(ans)
s = input() ans = 'YES' if S.count('x') <= 7 else 'NO' print(ans)
{ "targets": [ { "target_name": "node-hide-console-window", "sources": [ "node-hide-console-window.cc" ] } ] }
{'targets': [{'target_name': 'node-hide-console-window', 'sources': ['node-hide-console-window.cc']}]}
class Node(): left = None right = None def __init__(self, element): self.element = element def __str__(self): return "\t\t{}\n{}\t\t{}".format(self.element, self.left, self.right) class BinaryTree(): head = None def __init__(self, head): self.head = Node(head) def __str__(self): return self.head.__str__() def insert(self, element, node=None): if not node: node = self.head if node.element > element: if node.left == None: node.left = Node(element) else: self.insert(element, node.left) else: if node.right == None: node.right = Node(element) else: self.insert(element, node.right) def find(self, element): node = self.head while node: if node.element == element: return node elif node.element > element: node = node.left else: node = node.right return None def min(self, node=None): if not node: node = self.head while node.left != None: node = node.left return node def max(self, node=None): if not node: node = self.head while node.right != None: node = node.right return node def remove(self, element, node=None): if not node: node = self.head def removeNode(node): if element > node.element: node.right = removeNode(node.right) return node elif element < node.element: node.left = removeNode(node.left) return node else: if node.left and node.right: minRightElement = self.min(node.right).element node.right = self.remove(minRightElement, node.right) node.element = minRightElement return node elif node.left: return node.left elif node.right: return node.right else: return None node = removeNode(node) return node def maxHeight(self): def nodeHeight(node): if not node: return 0 left = 1 + nodeHeight(node.left) right = 1 + nodeHeight(node.right) return max(left, right) return nodeHeight(self.head) def minHeight(self): def nodeHeight(node): if not node: return 0 left = 1 + nodeHeight(node.left) right = 1 + nodeHeight(node.right) return min(left, right) return nodeHeight(self.head) def preOrder(self): def traverse(node): result = [] if not node: return result result.append(node.element) result.extend(traverse(node.left)) result.extend(traverse(node.right)) return result return traverse(self.head) def inOrder(self): def traverse(node): result = [] if not node: return result result.extend(traverse(node.left)) result.append(node.element) result.extend(traverse(node.right)) return result return traverse(self.head) def postOrder(self): def traverse(node): result = [] if not node: return result result.extend(traverse(node.left)) result.extend(traverse(node.right)) result.append(node.element) return result return traverse(self.head) def levelOrder(self): queue = [] result = [] node = self.head while node: result.append(node.element) if node.left: queue.append(node.left) if node.right: queue.append(node.right) node = None if len(queue) > 0: node = queue.pop(0) return result bt = BinaryTree(25) nodes = [15,50,10,22,4,12,18,24,35,70,31,44,66,90] for node in nodes: bt.insert(node) print(bt.inOrder()) print("===") print(bt.preOrder()) print("===") print(bt.postOrder()) print("===") print(bt.levelOrder()) # print(bt.find(7)) # print(bt.find(5)) # print(bt.min()) # print(bt.max()) # bt.remove(2) # print(bt.find(2)) print(bt) bt.remove(4) print("===") print(bt)
class Node: left = None right = None def __init__(self, element): self.element = element def __str__(self): return '\t\t{}\n{}\t\t{}'.format(self.element, self.left, self.right) class Binarytree: head = None def __init__(self, head): self.head = node(head) def __str__(self): return self.head.__str__() def insert(self, element, node=None): if not node: node = self.head if node.element > element: if node.left == None: node.left = node(element) else: self.insert(element, node.left) elif node.right == None: node.right = node(element) else: self.insert(element, node.right) def find(self, element): node = self.head while node: if node.element == element: return node elif node.element > element: node = node.left else: node = node.right return None def min(self, node=None): if not node: node = self.head while node.left != None: node = node.left return node def max(self, node=None): if not node: node = self.head while node.right != None: node = node.right return node def remove(self, element, node=None): if not node: node = self.head def remove_node(node): if element > node.element: node.right = remove_node(node.right) return node elif element < node.element: node.left = remove_node(node.left) return node elif node.left and node.right: min_right_element = self.min(node.right).element node.right = self.remove(minRightElement, node.right) node.element = minRightElement return node elif node.left: return node.left elif node.right: return node.right else: return None node = remove_node(node) return node def max_height(self): def node_height(node): if not node: return 0 left = 1 + node_height(node.left) right = 1 + node_height(node.right) return max(left, right) return node_height(self.head) def min_height(self): def node_height(node): if not node: return 0 left = 1 + node_height(node.left) right = 1 + node_height(node.right) return min(left, right) return node_height(self.head) def pre_order(self): def traverse(node): result = [] if not node: return result result.append(node.element) result.extend(traverse(node.left)) result.extend(traverse(node.right)) return result return traverse(self.head) def in_order(self): def traverse(node): result = [] if not node: return result result.extend(traverse(node.left)) result.append(node.element) result.extend(traverse(node.right)) return result return traverse(self.head) def post_order(self): def traverse(node): result = [] if not node: return result result.extend(traverse(node.left)) result.extend(traverse(node.right)) result.append(node.element) return result return traverse(self.head) def level_order(self): queue = [] result = [] node = self.head while node: result.append(node.element) if node.left: queue.append(node.left) if node.right: queue.append(node.right) node = None if len(queue) > 0: node = queue.pop(0) return result bt = binary_tree(25) nodes = [15, 50, 10, 22, 4, 12, 18, 24, 35, 70, 31, 44, 66, 90] for node in nodes: bt.insert(node) print(bt.inOrder()) print('===') print(bt.preOrder()) print('===') print(bt.postOrder()) print('===') print(bt.levelOrder()) print(bt) bt.remove(4) print('===') print(bt)
# n=int(input()) # n2=input() # ar=str(n2) # ar=ar.split() # pair={} # total=0 # for i in ar: # if i not in pair: # pair[i]=1 # else: # pair[i]+=1 # for j in pair: # store=pair[j]//2 # total+=store # print (total) n=int(input("number of socks :")) ar=input("colors of socks :").split() pair={} total=0 for i in ar: if i not in pair: pair[i]=1 else: pair[i]+=1 for j in pair: store=pair[j]//2 total+=store print (total)
n = int(input('number of socks :')) ar = input('colors of socks :').split() pair = {} total = 0 for i in ar: if i not in pair: pair[i] = 1 else: pair[i] += 1 for j in pair: store = pair[j] // 2 total += store print(total)
class Solution: def trap(self, height: List[int]) -> int: lmax,rmax = 0,0 l,r = 0,len(height)-1 ans = 0 while l<r: if height[l]<height[r]: if height[l]>=lmax: lmax = height[l] else: ans+=lmax-height[l] l+=1 else: if height[r]>=rmax: rmax= height[r] else: ans+=rmax-height[r] r-=1 return ans
class Solution: def trap(self, height: List[int]) -> int: (lmax, rmax) = (0, 0) (l, r) = (0, len(height) - 1) ans = 0 while l < r: if height[l] < height[r]: if height[l] >= lmax: lmax = height[l] else: ans += lmax - height[l] l += 1 else: if height[r] >= rmax: rmax = height[r] else: ans += rmax - height[r] r -= 1 return ans
lanjut = 'Y' kumpulan_luas_segitiga = [] while lanjut == 'Y': alas = float(input("Masukkan panjang alas (cm) : ")) tinggi = float(input("Masukkan tinggi segitiga (cm) : ")) luas = alas * tinggi * 0.5 # / 2 print("Luas segitiganya adalah :", luas) kumpulan_luas_segitiga.append(luas) lanjut = input("\nMau lanjut lagi?") if lanjut == 'Y': continue else: print("Terima kasih telah menggunakan program kami\n" + "Berikut adalah segitiga yang telah dihitung\n", kumpulan_luas_segitiga)
lanjut = 'Y' kumpulan_luas_segitiga = [] while lanjut == 'Y': alas = float(input('Masukkan panjang alas (cm) : ')) tinggi = float(input('Masukkan tinggi segitiga (cm) : ')) luas = alas * tinggi * 0.5 print('Luas segitiganya adalah :', luas) kumpulan_luas_segitiga.append(luas) lanjut = input('\nMau lanjut lagi?') if lanjut == 'Y': continue else: print('Terima kasih telah menggunakan program kami\n' + 'Berikut adalah segitiga yang telah dihitung\n', kumpulan_luas_segitiga)
class StringFormatter(object): def __init__(self): pass def justify(self, text, width=21): ''' Inserts spaces between ':' and the remaining of the text to make sure 'text' is 'width' characters in length. ''' if len(text) < width: index = text.find(':') + 1 if index > 0: return text[:index] + (' ' * (width - len(text))) + text[index:] return text
class Stringformatter(object): def __init__(self): pass def justify(self, text, width=21): """ Inserts spaces between ':' and the remaining of the text to make sure 'text' is 'width' characters in length. """ if len(text) < width: index = text.find(':') + 1 if index > 0: return text[:index] + ' ' * (width - len(text)) + text[index:] return text
input_str = "12233221" middle_size = int(round(len(input_str) / 2) ) print(f"middle_size: {middle_size}") end_index = -1 start_index = 0 while start_index < middle_size: char_from_start = input_str[start_index] char_from_end = input_str[end_index] end_index = end_index - 1 start_index = start_index + 1 if(char_from_end == char_from_start): continue else: print(f"input string {input_str} is not a palindrome") break else: print(f"input string {input_str} is a palindrome")
input_str = '12233221' middle_size = int(round(len(input_str) / 2)) print(f'middle_size: {middle_size}') end_index = -1 start_index = 0 while start_index < middle_size: char_from_start = input_str[start_index] char_from_end = input_str[end_index] end_index = end_index - 1 start_index = start_index + 1 if char_from_end == char_from_start: continue else: print(f'input string {input_str} is not a palindrome') break else: print(f'input string {input_str} is a palindrome')
def main(self): def handler(message): if message["channel"] == "/service/player" and message.get("data") and message["data"].get("id") == 5: self._emit("GameReset") self.handlers["gameReset"] = handler
def main(self): def handler(message): if message['channel'] == '/service/player' and message.get('data') and (message['data'].get('id') == 5): self._emit('GameReset') self.handlers['gameReset'] = handler
# MQTT certificates CA_CERT = "./../keys/ca/ca.crt" CLIENT_CERT = "./../keys/client/client.crt" CLIENT_KEY = "./../keys/client/client.key" TLS_VERSION = 2 # MQTT broker options TOPIC_NAME = "sensors/Temp" HOSTNAME = "mqtt.sandyuraz.com" PORT = 8883 # MQTT user options CLIENT_ID = "sandissa-secret-me" USERNAME = "kitty" PASSWORD = None # MQTT publish/subscribe options QOS_PUBLISH = 2 QOS_SUBSCRIBE = 2
ca_cert = './../keys/ca/ca.crt' client_cert = './../keys/client/client.crt' client_key = './../keys/client/client.key' tls_version = 2 topic_name = 'sensors/Temp' hostname = 'mqtt.sandyuraz.com' port = 8883 client_id = 'sandissa-secret-me' username = 'kitty' password = None qos_publish = 2 qos_subscribe = 2
x,y = input().split() a = int(x) b = int(y) if a < b and (b-a) == 1: print("Dr. Chaz will have " + str(b-a) + " piece of chicken left over!") elif a < b: print("Dr. Chaz will have " + str(b - a) + " pieces of chicken left over!") elif a > b and (a-b) == 1: print("Dr. Chaz needs " + str(a - b) + " more piece of chicken!") else: print("Dr. Chaz needs " + str(a-b) + " more pieces of chicken!")
(x, y) = input().split() a = int(x) b = int(y) if a < b and b - a == 1: print('Dr. Chaz will have ' + str(b - a) + ' piece of chicken left over!') elif a < b: print('Dr. Chaz will have ' + str(b - a) + ' pieces of chicken left over!') elif a > b and a - b == 1: print('Dr. Chaz needs ' + str(a - b) + ' more piece of chicken!') else: print('Dr. Chaz needs ' + str(a - b) + ' more pieces of chicken!')
n=int(input()) sh=5 li=0 cum=0 for i in range(n): li = sh // 2 sh=(li*3) cum+=li print(cum)
n = int(input()) sh = 5 li = 0 cum = 0 for i in range(n): li = sh // 2 sh = li * 3 cum += li print(cum)
n=1 s=0 while(n<50): cn=n mdx=0 mposfl=0 pos=0 nod=0 while(cn>0): ld=cn%10 nod=nod+1 if(ld>mdx): mdx=ld mposfl=pos cn=cn/10 pos=pos+1 apos=nod-mposfl i=0 sr=0 while(n>0): if(i==apos): continue else: sr=sr+(n%10) n=n/10 if(sr==mdx): print(mdx) n=n+1 n=n+1
n = 1 s = 0 while n < 50: cn = n mdx = 0 mposfl = 0 pos = 0 nod = 0 while cn > 0: ld = cn % 10 nod = nod + 1 if ld > mdx: mdx = ld mposfl = pos cn = cn / 10 pos = pos + 1 apos = nod - mposfl i = 0 sr = 0 while n > 0: if i == apos: continue else: sr = sr + n % 10 n = n / 10 if sr == mdx: print(mdx) n = n + 1 n = n + 1
class Solution: def romanToInt(self, s: str) -> int: num = {'I': 1, 'V': 5, 'X': 10, 'L': 50, 'C': 100, 'D': 500, 'M': 1000} val, pre = 0, 0 for key in s: n = num[key] if key in num else 0 val += -pre if n > pre else pre pre = n val += pre return val
class Solution: def roman_to_int(self, s: str) -> int: num = {'I': 1, 'V': 5, 'X': 10, 'L': 50, 'C': 100, 'D': 500, 'M': 1000} (val, pre) = (0, 0) for key in s: n = num[key] if key in num else 0 val += -pre if n > pre else pre pre = n val += pre return val
lb = { "loadBalancer": { "name": "mani-test-lb", "port": 80, "protocol": "HTTP", "virtualIps": [ { "type": "PUBLIC" } ] } } nodes = { "nodes": [ { "address": "10.2.2.3", "port": 80, "condition": "ENABLED", "type":"PRIMARY" } ] } metadata = { "metadata": [ { "key":"color", "value":"red" } ] } config = { "name": "lbaas", "description": "Racksapce Load Balancer", "uriprefix": { "regex": "/v1.0/\d+/", "env": "LB_URI_PREFIX" }, "headers": { "X-Auth-Token": {"env": "RS_AUTH_TOKEN"}, "Content-Type": "application/json" }, "tempfile": "/tmp/lb_req.json", "resources": { "loadbalancers/?$": { "templates": {"default": lb}, "aliases": { "name": "loadBalancer.name" }, "help": "Load balancers" }, "loadBalancers/[\d\-]+/?$": { "post": nodes }, "loadBalancers/[\d\-]+/nodes/?$": { "templates": {"default": nodes}, "help": "Load balancer's nodes. Format: loadBalancers/<load balancer ID>/nodes" }, "loadBalancers/[\d\-]+/nodes/[\d\-]+/?$": { "help": "Load balancer's node. Format: loadBalancers/<load balancer ID>/nodes/<nodeID>" }, "loadBalancers/[\d\-]+/metadata/?$": { "templates": {"default": metadata}, "help": "Load balancer's metadata. Format: loadBalancers/<load balancer ID>/metadata" } } }
lb = {'loadBalancer': {'name': 'mani-test-lb', 'port': 80, 'protocol': 'HTTP', 'virtualIps': [{'type': 'PUBLIC'}]}} nodes = {'nodes': [{'address': '10.2.2.3', 'port': 80, 'condition': 'ENABLED', 'type': 'PRIMARY'}]} metadata = {'metadata': [{'key': 'color', 'value': 'red'}]} config = {'name': 'lbaas', 'description': 'Racksapce Load Balancer', 'uriprefix': {'regex': '/v1.0/\\d+/', 'env': 'LB_URI_PREFIX'}, 'headers': {'X-Auth-Token': {'env': 'RS_AUTH_TOKEN'}, 'Content-Type': 'application/json'}, 'tempfile': '/tmp/lb_req.json', 'resources': {'loadbalancers/?$': {'templates': {'default': lb}, 'aliases': {'name': 'loadBalancer.name'}, 'help': 'Load balancers'}, 'loadBalancers/[\\d\\-]+/?$': {'post': nodes}, 'loadBalancers/[\\d\\-]+/nodes/?$': {'templates': {'default': nodes}, 'help': "Load balancer's nodes. Format: loadBalancers/<load balancer ID>/nodes"}, 'loadBalancers/[\\d\\-]+/nodes/[\\d\\-]+/?$': {'help': "Load balancer's node. Format: loadBalancers/<load balancer ID>/nodes/<nodeID>"}, 'loadBalancers/[\\d\\-]+/metadata/?$': {'templates': {'default': metadata}, 'help': "Load balancer's metadata. Format: loadBalancers/<load balancer ID>/metadata"}}}
def includeme(config): config.add_static_view('js', 'static/js', cache_max_age=3600) config.add_static_view('css', 'static/css', cache_max_age=3600) config.add_static_view('static', 'static', cache_max_age=3600) config.add_static_view('dz', 'static/dropzone', cache_max_age=3600) config.add_route('add-image', '/api/1.0/add-image') config.add_route('image-upload', '/upload') config.add_route('login', '/login') config.add_route('home', '/')
def includeme(config): config.add_static_view('js', 'static/js', cache_max_age=3600) config.add_static_view('css', 'static/css', cache_max_age=3600) config.add_static_view('static', 'static', cache_max_age=3600) config.add_static_view('dz', 'static/dropzone', cache_max_age=3600) config.add_route('add-image', '/api/1.0/add-image') config.add_route('image-upload', '/upload') config.add_route('login', '/login') config.add_route('home', '/')
def last_minute_enhancements(nodes): count = 0 current_node = 0 for node in nodes: if node > current_node: count += 1 current_node = node elif node == current_node: count += 1 current_node = node + 1 return count if __name__ == "__main__": num_test = int(input()) for i in range(num_test): num_node = int(input()) nodes = [int(i) for i in input().split()] print(last_minute_enhancements(nodes))
def last_minute_enhancements(nodes): count = 0 current_node = 0 for node in nodes: if node > current_node: count += 1 current_node = node elif node == current_node: count += 1 current_node = node + 1 return count if __name__ == '__main__': num_test = int(input()) for i in range(num_test): num_node = int(input()) nodes = [int(i) for i in input().split()] print(last_minute_enhancements(nodes))
# Opencast server address and credentials for api user OPENCAST_URL = 'OPENCAST_URL' OPENCAST_USER = 'OPENCAST_API_USER' OPENCAST_PASSWD = 'OPENCAST_PASSWORD_USER' # Timezone for the messages and from the XML file MESSAGES_TIMEZONE = 'Europe/Berlin' # Capture agent Klips dictionary # # Here you have to put the dictionary that links the room name # with the name of the capture agent registered in opencast. # # Example: # CAPTURE_AGENT_DICT = {'Room 12C, Building E' : 'agent1', # 'room2' : 'agent2', # 'room3' : 'agent3'} # CAPTURE_AGENT_DICT = {}
opencast_url = 'OPENCAST_URL' opencast_user = 'OPENCAST_API_USER' opencast_passwd = 'OPENCAST_PASSWORD_USER' messages_timezone = 'Europe/Berlin' capture_agent_dict = {}
# # PySNMP MIB module NHRP-MIB (http://snmplabs.com/pysmi) # ASN.1 source file:///Users/davwang4/Dev/mibs.snmplabs.com/asn1/NHRP-MIB # Produced by pysmi-0.3.4 at Mon Apr 29 17:51:40 2019 # On host DAVWANG4-M-1475 platform Darwin version 18.5.0 by user davwang4 # Using Python version 3.7.3 (default, Mar 27 2019, 09:23:15) # ObjectIdentifier, OctetString, Integer = mibBuilder.importSymbols("ASN1", "ObjectIdentifier", "OctetString", "Integer") NamedValues, = mibBuilder.importSymbols("ASN1-ENUMERATION", "NamedValues") SingleValueConstraint, ConstraintsUnion, ValueSizeConstraint, ConstraintsIntersection, ValueRangeConstraint = mibBuilder.importSymbols("ASN1-REFINEMENT", "SingleValueConstraint", "ConstraintsUnion", "ValueSizeConstraint", "ConstraintsIntersection", "ValueRangeConstraint") AddressFamilyNumbers, = mibBuilder.importSymbols("IANA-ADDRESS-FAMILY-NUMBERS-MIB", "AddressFamilyNumbers") ifIndex, = mibBuilder.importSymbols("IF-MIB", "ifIndex") ObjectGroup, ModuleCompliance, NotificationGroup = mibBuilder.importSymbols("SNMPv2-CONF", "ObjectGroup", "ModuleCompliance", "NotificationGroup") Counter64, MibIdentifier, Counter32, Integer32, Unsigned32, iso, MibScalar, MibTable, MibTableRow, MibTableColumn, Bits, NotificationType, IpAddress, ObjectIdentity, mib_2, TimeTicks, ModuleIdentity, Gauge32 = mibBuilder.importSymbols("SNMPv2-SMI", "Counter64", "MibIdentifier", "Counter32", "Integer32", "Unsigned32", "iso", "MibScalar", "MibTable", "MibTableRow", "MibTableColumn", "Bits", "NotificationType", "IpAddress", "ObjectIdentity", "mib-2", "TimeTicks", "ModuleIdentity", "Gauge32") StorageType, TextualConvention, RowStatus, TimeStamp, TruthValue, DisplayString = mibBuilder.importSymbols("SNMPv2-TC", "StorageType", "TextualConvention", "RowStatus", "TimeStamp", "TruthValue", "DisplayString") nhrpMIB = ModuleIdentity((1, 3, 6, 1, 2, 1, 71)) nhrpMIB.setRevisions(('1999-08-26 00:00',)) if mibBuilder.loadTexts: nhrpMIB.setLastUpdated('9908260000Z') if mibBuilder.loadTexts: nhrpMIB.setOrganization('Internetworking Over NBMA (ion) Working Group') class NhrpGenAddr(TextualConvention, OctetString): status = 'current' subtypeSpec = OctetString.subtypeSpec + ValueSizeConstraint(0, 64) nhrpObjects = MibIdentifier((1, 3, 6, 1, 2, 1, 71, 1)) nhrpGeneralObjects = MibIdentifier((1, 3, 6, 1, 2, 1, 71, 1, 1)) nhrpNextIndex = MibScalar((1, 3, 6, 1, 2, 1, 71, 1, 1, 1), Unsigned32()).setMaxAccess("readonly") if mibBuilder.loadTexts: nhrpNextIndex.setStatus('current') nhrpCacheTable = MibTable((1, 3, 6, 1, 2, 1, 71, 1, 1, 2), ) if mibBuilder.loadTexts: nhrpCacheTable.setStatus('current') nhrpCacheEntry = MibTableRow((1, 3, 6, 1, 2, 1, 71, 1, 1, 2, 1), ).setIndexNames((0, "NHRP-MIB", "nhrpCacheInternetworkAddrType"), (0, "NHRP-MIB", "nhrpCacheInternetworkAddr"), (0, "IF-MIB", "ifIndex"), (0, "NHRP-MIB", "nhrpCacheIndex")) if mibBuilder.loadTexts: nhrpCacheEntry.setStatus('current') nhrpCacheInternetworkAddrType = MibTableColumn((1, 3, 6, 1, 2, 1, 71, 1, 1, 2, 1, 1), AddressFamilyNumbers()) if mibBuilder.loadTexts: nhrpCacheInternetworkAddrType.setStatus('current') nhrpCacheInternetworkAddr = MibTableColumn((1, 3, 6, 1, 2, 1, 71, 1, 1, 2, 1, 2), NhrpGenAddr()) if mibBuilder.loadTexts: nhrpCacheInternetworkAddr.setStatus('current') nhrpCacheIndex = MibTableColumn((1, 3, 6, 1, 2, 1, 71, 1, 1, 2, 1, 3), Unsigned32().subtype(subtypeSpec=ValueRangeConstraint(1, 4294967295))) if mibBuilder.loadTexts: nhrpCacheIndex.setStatus('current') nhrpCachePrefixLength = MibTableColumn((1, 3, 6, 1, 2, 1, 71, 1, 1, 2, 1, 4), Integer32().subtype(subtypeSpec=ValueRangeConstraint(0, 255))).setMaxAccess("readonly") if mibBuilder.loadTexts: nhrpCachePrefixLength.setStatus('current') nhrpCacheNextHopInternetworkAddr = MibTableColumn((1, 3, 6, 1, 2, 1, 71, 1, 1, 2, 1, 5), NhrpGenAddr()).setMaxAccess("readcreate") if mibBuilder.loadTexts: nhrpCacheNextHopInternetworkAddr.setStatus('current') nhrpCacheNbmaAddrType = MibTableColumn((1, 3, 6, 1, 2, 1, 71, 1, 1, 2, 1, 6), AddressFamilyNumbers()).setMaxAccess("readcreate") if mibBuilder.loadTexts: nhrpCacheNbmaAddrType.setStatus('current') nhrpCacheNbmaAddr = MibTableColumn((1, 3, 6, 1, 2, 1, 71, 1, 1, 2, 1, 7), NhrpGenAddr()).setMaxAccess("readcreate") if mibBuilder.loadTexts: nhrpCacheNbmaAddr.setStatus('current') nhrpCacheNbmaSubaddr = MibTableColumn((1, 3, 6, 1, 2, 1, 71, 1, 1, 2, 1, 8), NhrpGenAddr()).setMaxAccess("readcreate") if mibBuilder.loadTexts: nhrpCacheNbmaSubaddr.setStatus('current') nhrpCacheType = MibTableColumn((1, 3, 6, 1, 2, 1, 71, 1, 1, 2, 1, 9), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2, 3, 4, 5, 6, 7, 8))).clone(namedValues=NamedValues(("other", 1), ("register", 2), ("resolveAuthoritative", 3), ("resoveNonauthoritative", 4), ("transit", 5), ("administrativelyAdded", 6), ("atmarp", 7), ("scsp", 8)))).setMaxAccess("readcreate") if mibBuilder.loadTexts: nhrpCacheType.setStatus('current') nhrpCacheState = MibTableColumn((1, 3, 6, 1, 2, 1, 71, 1, 1, 2, 1, 10), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2, 3))).clone(namedValues=NamedValues(("incomplete", 1), ("ackReply", 2), ("nakReply", 3)))).setMaxAccess("readonly") if mibBuilder.loadTexts: nhrpCacheState.setStatus('current') nhrpCacheHoldingTimeValid = MibTableColumn((1, 3, 6, 1, 2, 1, 71, 1, 1, 2, 1, 11), TruthValue()).setMaxAccess("readonly") if mibBuilder.loadTexts: nhrpCacheHoldingTimeValid.setStatus('current') nhrpCacheHoldingTime = MibTableColumn((1, 3, 6, 1, 2, 1, 71, 1, 1, 2, 1, 12), Unsigned32().subtype(subtypeSpec=ValueRangeConstraint(0, 65535))).setUnits('seconds').setMaxAccess("readonly") if mibBuilder.loadTexts: nhrpCacheHoldingTime.setStatus('current') nhrpCacheNegotiatedMtu = MibTableColumn((1, 3, 6, 1, 2, 1, 71, 1, 1, 2, 1, 13), Integer32().subtype(subtypeSpec=ValueRangeConstraint(0, 65535))).setMaxAccess("readonly") if mibBuilder.loadTexts: nhrpCacheNegotiatedMtu.setStatus('current') nhrpCachePreference = MibTableColumn((1, 3, 6, 1, 2, 1, 71, 1, 1, 2, 1, 14), Integer32().subtype(subtypeSpec=ValueRangeConstraint(0, 255))).setMaxAccess("readcreate") if mibBuilder.loadTexts: nhrpCachePreference.setStatus('current') nhrpCacheStorageType = MibTableColumn((1, 3, 6, 1, 2, 1, 71, 1, 1, 2, 1, 15), StorageType().clone('nonVolatile')).setMaxAccess("readcreate") if mibBuilder.loadTexts: nhrpCacheStorageType.setStatus('current') nhrpCacheRowStatus = MibTableColumn((1, 3, 6, 1, 2, 1, 71, 1, 1, 2, 1, 16), RowStatus()).setMaxAccess("readcreate") if mibBuilder.loadTexts: nhrpCacheRowStatus.setStatus('current') nhrpPurgeReqTable = MibTable((1, 3, 6, 1, 2, 1, 71, 1, 1, 3), ) if mibBuilder.loadTexts: nhrpPurgeReqTable.setStatus('current') nhrpPurgeReqEntry = MibTableRow((1, 3, 6, 1, 2, 1, 71, 1, 1, 3, 1), ).setIndexNames((0, "NHRP-MIB", "nhrpPurgeIndex")) if mibBuilder.loadTexts: nhrpPurgeReqEntry.setStatus('current') nhrpPurgeIndex = MibTableColumn((1, 3, 6, 1, 2, 1, 71, 1, 1, 3, 1, 1), Unsigned32().subtype(subtypeSpec=ValueRangeConstraint(1, 4294967295))) if mibBuilder.loadTexts: nhrpPurgeIndex.setStatus('current') nhrpPurgeCacheIdentifier = MibTableColumn((1, 3, 6, 1, 2, 1, 71, 1, 1, 3, 1, 2), Unsigned32().subtype(subtypeSpec=ValueRangeConstraint(1, 4294967295))).setMaxAccess("readcreate") if mibBuilder.loadTexts: nhrpPurgeCacheIdentifier.setStatus('current') nhrpPurgePrefixLength = MibTableColumn((1, 3, 6, 1, 2, 1, 71, 1, 1, 3, 1, 3), Integer32().subtype(subtypeSpec=ValueRangeConstraint(0, 255))).setMaxAccess("readonly") if mibBuilder.loadTexts: nhrpPurgePrefixLength.setStatus('current') nhrpPurgeRequestID = MibTableColumn((1, 3, 6, 1, 2, 1, 71, 1, 1, 3, 1, 4), Unsigned32()).setMaxAccess("readcreate") if mibBuilder.loadTexts: nhrpPurgeRequestID.setStatus('current') nhrpPurgeReplyExpected = MibTableColumn((1, 3, 6, 1, 2, 1, 71, 1, 1, 3, 1, 5), TruthValue()).setMaxAccess("readcreate") if mibBuilder.loadTexts: nhrpPurgeReplyExpected.setStatus('current') nhrpPurgeRowStatus = MibTableColumn((1, 3, 6, 1, 2, 1, 71, 1, 1, 3, 1, 6), RowStatus()).setMaxAccess("readcreate") if mibBuilder.loadTexts: nhrpPurgeRowStatus.setStatus('current') nhrpClientObjects = MibIdentifier((1, 3, 6, 1, 2, 1, 71, 1, 2)) nhrpClientTable = MibTable((1, 3, 6, 1, 2, 1, 71, 1, 2, 1), ) if mibBuilder.loadTexts: nhrpClientTable.setStatus('current') nhrpClientEntry = MibTableRow((1, 3, 6, 1, 2, 1, 71, 1, 2, 1, 1), ).setIndexNames((0, "NHRP-MIB", "nhrpClientIndex")) if mibBuilder.loadTexts: nhrpClientEntry.setStatus('current') nhrpClientIndex = MibTableColumn((1, 3, 6, 1, 2, 1, 71, 1, 2, 1, 1, 1), Unsigned32().subtype(subtypeSpec=ValueRangeConstraint(1, 4294967295))) if mibBuilder.loadTexts: nhrpClientIndex.setStatus('current') nhrpClientInternetworkAddrType = MibTableColumn((1, 3, 6, 1, 2, 1, 71, 1, 2, 1, 1, 2), AddressFamilyNumbers()).setMaxAccess("readcreate") if mibBuilder.loadTexts: nhrpClientInternetworkAddrType.setStatus('current') nhrpClientInternetworkAddr = MibTableColumn((1, 3, 6, 1, 2, 1, 71, 1, 2, 1, 1, 3), NhrpGenAddr()).setMaxAccess("readcreate") if mibBuilder.loadTexts: nhrpClientInternetworkAddr.setStatus('current') nhrpClientNbmaAddrType = MibTableColumn((1, 3, 6, 1, 2, 1, 71, 1, 2, 1, 1, 4), AddressFamilyNumbers()).setMaxAccess("readcreate") if mibBuilder.loadTexts: nhrpClientNbmaAddrType.setStatus('current') nhrpClientNbmaAddr = MibTableColumn((1, 3, 6, 1, 2, 1, 71, 1, 2, 1, 1, 5), NhrpGenAddr()).setMaxAccess("readcreate") if mibBuilder.loadTexts: nhrpClientNbmaAddr.setStatus('current') nhrpClientNbmaSubaddr = MibTableColumn((1, 3, 6, 1, 2, 1, 71, 1, 2, 1, 1, 6), NhrpGenAddr()).setMaxAccess("readcreate") if mibBuilder.loadTexts: nhrpClientNbmaSubaddr.setStatus('current') nhrpClientInitialRequestTimeout = MibTableColumn((1, 3, 6, 1, 2, 1, 71, 1, 2, 1, 1, 7), Integer32().subtype(subtypeSpec=ValueRangeConstraint(1, 900)).clone(10)).setUnits('seconds').setMaxAccess("readcreate") if mibBuilder.loadTexts: nhrpClientInitialRequestTimeout.setStatus('current') nhrpClientRegistrationRequestRetries = MibTableColumn((1, 3, 6, 1, 2, 1, 71, 1, 2, 1, 1, 8), Integer32().subtype(subtypeSpec=ValueRangeConstraint(0, 65535)).clone(3)).setMaxAccess("readcreate") if mibBuilder.loadTexts: nhrpClientRegistrationRequestRetries.setStatus('current') nhrpClientResolutionRequestRetries = MibTableColumn((1, 3, 6, 1, 2, 1, 71, 1, 2, 1, 1, 9), Integer32().subtype(subtypeSpec=ValueRangeConstraint(0, 65535)).clone(3)).setMaxAccess("readcreate") if mibBuilder.loadTexts: nhrpClientResolutionRequestRetries.setStatus('current') nhrpClientPurgeRequestRetries = MibTableColumn((1, 3, 6, 1, 2, 1, 71, 1, 2, 1, 1, 10), Integer32().subtype(subtypeSpec=ValueRangeConstraint(0, 65535)).clone(3)).setMaxAccess("readcreate") if mibBuilder.loadTexts: nhrpClientPurgeRequestRetries.setStatus('current') nhrpClientDefaultMtu = MibTableColumn((1, 3, 6, 1, 2, 1, 71, 1, 2, 1, 1, 11), Unsigned32().subtype(subtypeSpec=ValueRangeConstraint(0, 65535)).clone(9180)).setMaxAccess("readcreate") if mibBuilder.loadTexts: nhrpClientDefaultMtu.setStatus('current') nhrpClientHoldTime = MibTableColumn((1, 3, 6, 1, 2, 1, 71, 1, 2, 1, 1, 12), Unsigned32().subtype(subtypeSpec=ValueRangeConstraint(0, 65535)).clone(900)).setUnits('seconds').setMaxAccess("readcreate") if mibBuilder.loadTexts: nhrpClientHoldTime.setStatus('current') nhrpClientRequestID = MibTableColumn((1, 3, 6, 1, 2, 1, 71, 1, 2, 1, 1, 13), Unsigned32()).setMaxAccess("readcreate") if mibBuilder.loadTexts: nhrpClientRequestID.setStatus('current') nhrpClientStorageType = MibTableColumn((1, 3, 6, 1, 2, 1, 71, 1, 2, 1, 1, 14), StorageType().clone('nonVolatile')).setMaxAccess("readcreate") if mibBuilder.loadTexts: nhrpClientStorageType.setStatus('current') nhrpClientRowStatus = MibTableColumn((1, 3, 6, 1, 2, 1, 71, 1, 2, 1, 1, 15), RowStatus()).setMaxAccess("readcreate") if mibBuilder.loadTexts: nhrpClientRowStatus.setStatus('current') nhrpClientRegistrationTable = MibTable((1, 3, 6, 1, 2, 1, 71, 1, 2, 2), ) if mibBuilder.loadTexts: nhrpClientRegistrationTable.setStatus('current') nhrpClientRegistrationEntry = MibTableRow((1, 3, 6, 1, 2, 1, 71, 1, 2, 2, 1), ).setIndexNames((0, "NHRP-MIB", "nhrpClientIndex"), (0, "NHRP-MIB", "nhrpClientRegIndex")) if mibBuilder.loadTexts: nhrpClientRegistrationEntry.setStatus('current') nhrpClientRegIndex = MibTableColumn((1, 3, 6, 1, 2, 1, 71, 1, 2, 2, 1, 1), Unsigned32().subtype(subtypeSpec=ValueRangeConstraint(1, 4294967295))) if mibBuilder.loadTexts: nhrpClientRegIndex.setStatus('current') nhrpClientRegUniqueness = MibTableColumn((1, 3, 6, 1, 2, 1, 71, 1, 2, 2, 1, 2), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2))).clone(namedValues=NamedValues(("requestUnique", 1), ("requestNotUnique", 2)))).setMaxAccess("readcreate") if mibBuilder.loadTexts: nhrpClientRegUniqueness.setStatus('current') nhrpClientRegState = MibTableColumn((1, 3, 6, 1, 2, 1, 71, 1, 2, 2, 1, 3), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2, 3, 4))).clone(namedValues=NamedValues(("other", 1), ("registering", 2), ("ackRegisterReply", 3), ("nakRegisterReply", 4)))).setMaxAccess("readonly") if mibBuilder.loadTexts: nhrpClientRegState.setStatus('current') nhrpClientRegRowStatus = MibTableColumn((1, 3, 6, 1, 2, 1, 71, 1, 2, 2, 1, 4), RowStatus()).setMaxAccess("readcreate") if mibBuilder.loadTexts: nhrpClientRegRowStatus.setStatus('current') nhrpClientNhsTable = MibTable((1, 3, 6, 1, 2, 1, 71, 1, 2, 3), ) if mibBuilder.loadTexts: nhrpClientNhsTable.setStatus('current') nhrpClientNhsEntry = MibTableRow((1, 3, 6, 1, 2, 1, 71, 1, 2, 3, 1), ).setIndexNames((0, "NHRP-MIB", "nhrpClientIndex"), (0, "NHRP-MIB", "nhrpClientNhsIndex")) if mibBuilder.loadTexts: nhrpClientNhsEntry.setStatus('current') nhrpClientNhsIndex = MibTableColumn((1, 3, 6, 1, 2, 1, 71, 1, 2, 3, 1, 1), Unsigned32().subtype(subtypeSpec=ValueRangeConstraint(1, 4294967295))) if mibBuilder.loadTexts: nhrpClientNhsIndex.setStatus('current') nhrpClientNhsInternetworkAddrType = MibTableColumn((1, 3, 6, 1, 2, 1, 71, 1, 2, 3, 1, 2), AddressFamilyNumbers()).setMaxAccess("readcreate") if mibBuilder.loadTexts: nhrpClientNhsInternetworkAddrType.setStatus('current') nhrpClientNhsInternetworkAddr = MibTableColumn((1, 3, 6, 1, 2, 1, 71, 1, 2, 3, 1, 3), NhrpGenAddr()).setMaxAccess("readcreate") if mibBuilder.loadTexts: nhrpClientNhsInternetworkAddr.setStatus('current') nhrpClientNhsNbmaAddrType = MibTableColumn((1, 3, 6, 1, 2, 1, 71, 1, 2, 3, 1, 4), AddressFamilyNumbers()).setMaxAccess("readcreate") if mibBuilder.loadTexts: nhrpClientNhsNbmaAddrType.setStatus('current') nhrpClientNhsNbmaAddr = MibTableColumn((1, 3, 6, 1, 2, 1, 71, 1, 2, 3, 1, 5), NhrpGenAddr()).setMaxAccess("readcreate") if mibBuilder.loadTexts: nhrpClientNhsNbmaAddr.setStatus('current') nhrpClientNhsNbmaSubaddr = MibTableColumn((1, 3, 6, 1, 2, 1, 71, 1, 2, 3, 1, 6), NhrpGenAddr()).setMaxAccess("readcreate") if mibBuilder.loadTexts: nhrpClientNhsNbmaSubaddr.setStatus('current') nhrpClientNhsInUse = MibTableColumn((1, 3, 6, 1, 2, 1, 71, 1, 2, 3, 1, 7), TruthValue()).setMaxAccess("readonly") if mibBuilder.loadTexts: nhrpClientNhsInUse.setStatus('current') nhrpClientNhsRowStatus = MibTableColumn((1, 3, 6, 1, 2, 1, 71, 1, 2, 3, 1, 8), RowStatus()).setMaxAccess("readcreate") if mibBuilder.loadTexts: nhrpClientNhsRowStatus.setStatus('current') nhrpClientStatTable = MibTable((1, 3, 6, 1, 2, 1, 71, 1, 2, 4), ) if mibBuilder.loadTexts: nhrpClientStatTable.setStatus('current') nhrpClientStatEntry = MibTableRow((1, 3, 6, 1, 2, 1, 71, 1, 2, 4, 1), ).setIndexNames((0, "NHRP-MIB", "nhrpClientIndex")) if mibBuilder.loadTexts: nhrpClientStatEntry.setStatus('current') nhrpClientStatTxResolveReq = MibTableColumn((1, 3, 6, 1, 2, 1, 71, 1, 2, 4, 1, 1), Counter32()).setMaxAccess("readonly") if mibBuilder.loadTexts: nhrpClientStatTxResolveReq.setStatus('current') nhrpClientStatRxResolveReplyAck = MibTableColumn((1, 3, 6, 1, 2, 1, 71, 1, 2, 4, 1, 2), Counter32()).setMaxAccess("readonly") if mibBuilder.loadTexts: nhrpClientStatRxResolveReplyAck.setStatus('current') nhrpClientStatRxResolveReplyNakProhibited = MibTableColumn((1, 3, 6, 1, 2, 1, 71, 1, 2, 4, 1, 3), Counter32()).setMaxAccess("readonly") if mibBuilder.loadTexts: nhrpClientStatRxResolveReplyNakProhibited.setStatus('current') nhrpClientStatRxResolveReplyNakInsufResources = MibTableColumn((1, 3, 6, 1, 2, 1, 71, 1, 2, 4, 1, 4), Counter32()).setMaxAccess("readonly") if mibBuilder.loadTexts: nhrpClientStatRxResolveReplyNakInsufResources.setStatus('current') nhrpClientStatRxResolveReplyNakNoBinding = MibTableColumn((1, 3, 6, 1, 2, 1, 71, 1, 2, 4, 1, 5), Counter32()).setMaxAccess("readonly") if mibBuilder.loadTexts: nhrpClientStatRxResolveReplyNakNoBinding.setStatus('current') nhrpClientStatRxResolveReplyNakNotUnique = MibTableColumn((1, 3, 6, 1, 2, 1, 71, 1, 2, 4, 1, 6), Counter32()).setMaxAccess("readonly") if mibBuilder.loadTexts: nhrpClientStatRxResolveReplyNakNotUnique.setStatus('current') nhrpClientStatTxRegisterReq = MibTableColumn((1, 3, 6, 1, 2, 1, 71, 1, 2, 4, 1, 7), Counter32()).setMaxAccess("readonly") if mibBuilder.loadTexts: nhrpClientStatTxRegisterReq.setStatus('current') nhrpClientStatRxRegisterAck = MibTableColumn((1, 3, 6, 1, 2, 1, 71, 1, 2, 4, 1, 8), Counter32()).setMaxAccess("readonly") if mibBuilder.loadTexts: nhrpClientStatRxRegisterAck.setStatus('current') nhrpClientStatRxRegisterNakProhibited = MibTableColumn((1, 3, 6, 1, 2, 1, 71, 1, 2, 4, 1, 9), Counter32()).setMaxAccess("readonly") if mibBuilder.loadTexts: nhrpClientStatRxRegisterNakProhibited.setStatus('current') nhrpClientStatRxRegisterNakInsufResources = MibTableColumn((1, 3, 6, 1, 2, 1, 71, 1, 2, 4, 1, 10), Counter32()).setMaxAccess("readonly") if mibBuilder.loadTexts: nhrpClientStatRxRegisterNakInsufResources.setStatus('current') nhrpClientStatRxRegisterNakAlreadyReg = MibTableColumn((1, 3, 6, 1, 2, 1, 71, 1, 2, 4, 1, 11), Counter32()).setMaxAccess("readonly") if mibBuilder.loadTexts: nhrpClientStatRxRegisterNakAlreadyReg.setStatus('current') nhrpClientStatRxPurgeReq = MibTableColumn((1, 3, 6, 1, 2, 1, 71, 1, 2, 4, 1, 12), Counter32()).setMaxAccess("readonly") if mibBuilder.loadTexts: nhrpClientStatRxPurgeReq.setStatus('current') nhrpClientStatTxPurgeReq = MibTableColumn((1, 3, 6, 1, 2, 1, 71, 1, 2, 4, 1, 13), Counter32()).setMaxAccess("readonly") if mibBuilder.loadTexts: nhrpClientStatTxPurgeReq.setStatus('current') nhrpClientStatRxPurgeReply = MibTableColumn((1, 3, 6, 1, 2, 1, 71, 1, 2, 4, 1, 14), Counter32()).setMaxAccess("readonly") if mibBuilder.loadTexts: nhrpClientStatRxPurgeReply.setStatus('current') nhrpClientStatTxPurgeReply = MibTableColumn((1, 3, 6, 1, 2, 1, 71, 1, 2, 4, 1, 15), Counter32()).setMaxAccess("readonly") if mibBuilder.loadTexts: nhrpClientStatTxPurgeReply.setStatus('current') nhrpClientStatTxErrorIndication = MibTableColumn((1, 3, 6, 1, 2, 1, 71, 1, 2, 4, 1, 16), Counter32()).setMaxAccess("readonly") if mibBuilder.loadTexts: nhrpClientStatTxErrorIndication.setStatus('current') nhrpClientStatRxErrUnrecognizedExtension = MibTableColumn((1, 3, 6, 1, 2, 1, 71, 1, 2, 4, 1, 17), Counter32()).setMaxAccess("readonly") if mibBuilder.loadTexts: nhrpClientStatRxErrUnrecognizedExtension.setStatus('current') nhrpClientStatRxErrLoopDetected = MibTableColumn((1, 3, 6, 1, 2, 1, 71, 1, 2, 4, 1, 18), Counter32()).setMaxAccess("readonly") if mibBuilder.loadTexts: nhrpClientStatRxErrLoopDetected.setStatus('current') nhrpClientStatRxErrProtoAddrUnreachable = MibTableColumn((1, 3, 6, 1, 2, 1, 71, 1, 2, 4, 1, 19), Counter32()).setMaxAccess("readonly") if mibBuilder.loadTexts: nhrpClientStatRxErrProtoAddrUnreachable.setStatus('current') nhrpClientStatRxErrProtoError = MibTableColumn((1, 3, 6, 1, 2, 1, 71, 1, 2, 4, 1, 20), Counter32()).setMaxAccess("readonly") if mibBuilder.loadTexts: nhrpClientStatRxErrProtoError.setStatus('current') nhrpClientStatRxErrSduSizeExceeded = MibTableColumn((1, 3, 6, 1, 2, 1, 71, 1, 2, 4, 1, 21), Counter32()).setMaxAccess("readonly") if mibBuilder.loadTexts: nhrpClientStatRxErrSduSizeExceeded.setStatus('current') nhrpClientStatRxErrInvalidExtension = MibTableColumn((1, 3, 6, 1, 2, 1, 71, 1, 2, 4, 1, 22), Counter32()).setMaxAccess("readonly") if mibBuilder.loadTexts: nhrpClientStatRxErrInvalidExtension.setStatus('current') nhrpClientStatRxErrAuthenticationFailure = MibTableColumn((1, 3, 6, 1, 2, 1, 71, 1, 2, 4, 1, 23), Counter32()).setMaxAccess("readonly") if mibBuilder.loadTexts: nhrpClientStatRxErrAuthenticationFailure.setStatus('current') nhrpClientStatRxErrHopCountExceeded = MibTableColumn((1, 3, 6, 1, 2, 1, 71, 1, 2, 4, 1, 24), Counter32()).setMaxAccess("readonly") if mibBuilder.loadTexts: nhrpClientStatRxErrHopCountExceeded.setStatus('current') nhrpClientStatDiscontinuityTime = MibTableColumn((1, 3, 6, 1, 2, 1, 71, 1, 2, 4, 1, 25), TimeStamp()).setMaxAccess("readonly") if mibBuilder.loadTexts: nhrpClientStatDiscontinuityTime.setStatus('current') nhrpServerObjects = MibIdentifier((1, 3, 6, 1, 2, 1, 71, 1, 3)) nhrpServerTable = MibTable((1, 3, 6, 1, 2, 1, 71, 1, 3, 1), ) if mibBuilder.loadTexts: nhrpServerTable.setStatus('current') nhrpServerEntry = MibTableRow((1, 3, 6, 1, 2, 1, 71, 1, 3, 1, 1), ).setIndexNames((0, "NHRP-MIB", "nhrpServerIndex")) if mibBuilder.loadTexts: nhrpServerEntry.setStatus('current') nhrpServerIndex = MibTableColumn((1, 3, 6, 1, 2, 1, 71, 1, 3, 1, 1, 1), Unsigned32().subtype(subtypeSpec=ValueRangeConstraint(1, 4294967295))) if mibBuilder.loadTexts: nhrpServerIndex.setStatus('current') nhrpServerInternetworkAddrType = MibTableColumn((1, 3, 6, 1, 2, 1, 71, 1, 3, 1, 1, 2), AddressFamilyNumbers()).setMaxAccess("readcreate") if mibBuilder.loadTexts: nhrpServerInternetworkAddrType.setStatus('current') nhrpServerInternetworkAddr = MibTableColumn((1, 3, 6, 1, 2, 1, 71, 1, 3, 1, 1, 3), NhrpGenAddr()).setMaxAccess("readcreate") if mibBuilder.loadTexts: nhrpServerInternetworkAddr.setStatus('current') nhrpServerNbmaAddrType = MibTableColumn((1, 3, 6, 1, 2, 1, 71, 1, 3, 1, 1, 4), AddressFamilyNumbers()).setMaxAccess("readcreate") if mibBuilder.loadTexts: nhrpServerNbmaAddrType.setStatus('current') nhrpServerNbmaAddr = MibTableColumn((1, 3, 6, 1, 2, 1, 71, 1, 3, 1, 1, 5), NhrpGenAddr()).setMaxAccess("readcreate") if mibBuilder.loadTexts: nhrpServerNbmaAddr.setStatus('current') nhrpServerNbmaSubaddr = MibTableColumn((1, 3, 6, 1, 2, 1, 71, 1, 3, 1, 1, 6), NhrpGenAddr()).setMaxAccess("readcreate") if mibBuilder.loadTexts: nhrpServerNbmaSubaddr.setStatus('current') nhrpServerStorageType = MibTableColumn((1, 3, 6, 1, 2, 1, 71, 1, 3, 1, 1, 7), StorageType().clone('nonVolatile')).setMaxAccess("readcreate") if mibBuilder.loadTexts: nhrpServerStorageType.setStatus('current') nhrpServerRowStatus = MibTableColumn((1, 3, 6, 1, 2, 1, 71, 1, 3, 1, 1, 8), RowStatus()).setMaxAccess("readcreate") if mibBuilder.loadTexts: nhrpServerRowStatus.setStatus('current') nhrpServerCacheTable = MibTable((1, 3, 6, 1, 2, 1, 71, 1, 3, 2), ) if mibBuilder.loadTexts: nhrpServerCacheTable.setStatus('current') nhrpServerCacheEntry = MibTableRow((1, 3, 6, 1, 2, 1, 71, 1, 3, 2, 1), ).setIndexNames((0, "NHRP-MIB", "nhrpCacheInternetworkAddrType"), (0, "NHRP-MIB", "nhrpCacheInternetworkAddr"), (0, "IF-MIB", "ifIndex"), (0, "NHRP-MIB", "nhrpCacheIndex")) if mibBuilder.loadTexts: nhrpServerCacheEntry.setStatus('current') nhrpServerCacheAuthoritative = MibTableColumn((1, 3, 6, 1, 2, 1, 71, 1, 3, 2, 1, 1), TruthValue()).setMaxAccess("readonly") if mibBuilder.loadTexts: nhrpServerCacheAuthoritative.setStatus('current') nhrpServerCacheUniqueness = MibTableColumn((1, 3, 6, 1, 2, 1, 71, 1, 3, 2, 1, 2), TruthValue()).setMaxAccess("readcreate") if mibBuilder.loadTexts: nhrpServerCacheUniqueness.setStatus('current') nhrpServerNhcTable = MibTable((1, 3, 6, 1, 2, 1, 71, 1, 3, 3), ) if mibBuilder.loadTexts: nhrpServerNhcTable.setStatus('current') nhrpServerNhcEntry = MibTableRow((1, 3, 6, 1, 2, 1, 71, 1, 3, 3, 1), ).setIndexNames((0, "NHRP-MIB", "nhrpServerIndex"), (0, "NHRP-MIB", "nhrpServerNhcIndex")) if mibBuilder.loadTexts: nhrpServerNhcEntry.setStatus('current') nhrpServerNhcIndex = MibTableColumn((1, 3, 6, 1, 2, 1, 71, 1, 3, 3, 1, 1), Unsigned32().subtype(subtypeSpec=ValueRangeConstraint(1, 4294967295))) if mibBuilder.loadTexts: nhrpServerNhcIndex.setStatus('current') nhrpServerNhcPrefixLength = MibTableColumn((1, 3, 6, 1, 2, 1, 71, 1, 3, 3, 1, 2), Integer32().subtype(subtypeSpec=ValueRangeConstraint(0, 255))).setMaxAccess("readcreate") if mibBuilder.loadTexts: nhrpServerNhcPrefixLength.setStatus('current') nhrpServerNhcInternetworkAddrType = MibTableColumn((1, 3, 6, 1, 2, 1, 71, 1, 3, 3, 1, 3), AddressFamilyNumbers()).setMaxAccess("readcreate") if mibBuilder.loadTexts: nhrpServerNhcInternetworkAddrType.setStatus('current') nhrpServerNhcInternetworkAddr = MibTableColumn((1, 3, 6, 1, 2, 1, 71, 1, 3, 3, 1, 4), NhrpGenAddr()).setMaxAccess("readcreate") if mibBuilder.loadTexts: nhrpServerNhcInternetworkAddr.setStatus('current') nhrpServerNhcNbmaAddrType = MibTableColumn((1, 3, 6, 1, 2, 1, 71, 1, 3, 3, 1, 5), AddressFamilyNumbers()).setMaxAccess("readcreate") if mibBuilder.loadTexts: nhrpServerNhcNbmaAddrType.setStatus('current') nhrpServerNhcNbmaAddr = MibTableColumn((1, 3, 6, 1, 2, 1, 71, 1, 3, 3, 1, 6), NhrpGenAddr()).setMaxAccess("readcreate") if mibBuilder.loadTexts: nhrpServerNhcNbmaAddr.setStatus('current') nhrpServerNhcNbmaSubaddr = MibTableColumn((1, 3, 6, 1, 2, 1, 71, 1, 3, 3, 1, 7), NhrpGenAddr()).setMaxAccess("readcreate") if mibBuilder.loadTexts: nhrpServerNhcNbmaSubaddr.setStatus('current') nhrpServerNhcInUse = MibTableColumn((1, 3, 6, 1, 2, 1, 71, 1, 3, 3, 1, 8), TruthValue()).setMaxAccess("readonly") if mibBuilder.loadTexts: nhrpServerNhcInUse.setStatus('current') nhrpServerNhcRowStatus = MibTableColumn((1, 3, 6, 1, 2, 1, 71, 1, 3, 3, 1, 9), RowStatus()).setMaxAccess("readcreate") if mibBuilder.loadTexts: nhrpServerNhcRowStatus.setStatus('current') nhrpServerStatTable = MibTable((1, 3, 6, 1, 2, 1, 71, 1, 3, 4), ) if mibBuilder.loadTexts: nhrpServerStatTable.setStatus('current') nhrpServerStatEntry = MibTableRow((1, 3, 6, 1, 2, 1, 71, 1, 3, 4, 1), ).setIndexNames((0, "NHRP-MIB", "nhrpServerIndex")) if mibBuilder.loadTexts: nhrpServerStatEntry.setStatus('current') nhrpServerStatRxResolveReq = MibTableColumn((1, 3, 6, 1, 2, 1, 71, 1, 3, 4, 1, 1), Counter32()).setMaxAccess("readonly") if mibBuilder.loadTexts: nhrpServerStatRxResolveReq.setStatus('current') nhrpServerStatTxResolveReplyAck = MibTableColumn((1, 3, 6, 1, 2, 1, 71, 1, 3, 4, 1, 2), Counter32()).setMaxAccess("readonly") if mibBuilder.loadTexts: nhrpServerStatTxResolveReplyAck.setStatus('current') nhrpServerStatTxResolveReplyNakProhibited = MibTableColumn((1, 3, 6, 1, 2, 1, 71, 1, 3, 4, 1, 3), Counter32()).setMaxAccess("readonly") if mibBuilder.loadTexts: nhrpServerStatTxResolveReplyNakProhibited.setStatus('current') nhrpServerStatTxResolveReplyNakInsufResources = MibTableColumn((1, 3, 6, 1, 2, 1, 71, 1, 3, 4, 1, 4), Counter32()).setMaxAccess("readonly") if mibBuilder.loadTexts: nhrpServerStatTxResolveReplyNakInsufResources.setStatus('current') nhrpServerStatTxResolveReplyNakNoBinding = MibTableColumn((1, 3, 6, 1, 2, 1, 71, 1, 3, 4, 1, 5), Counter32()).setMaxAccess("readonly") if mibBuilder.loadTexts: nhrpServerStatTxResolveReplyNakNoBinding.setStatus('current') nhrpServerStatTxResolveReplyNakNotUnique = MibTableColumn((1, 3, 6, 1, 2, 1, 71, 1, 3, 4, 1, 6), Counter32()).setMaxAccess("readonly") if mibBuilder.loadTexts: nhrpServerStatTxResolveReplyNakNotUnique.setStatus('current') nhrpServerStatRxRegisterReq = MibTableColumn((1, 3, 6, 1, 2, 1, 71, 1, 3, 4, 1, 7), Counter32()).setMaxAccess("readonly") if mibBuilder.loadTexts: nhrpServerStatRxRegisterReq.setStatus('current') nhrpServerStatTxRegisterAck = MibTableColumn((1, 3, 6, 1, 2, 1, 71, 1, 3, 4, 1, 8), Counter32()).setMaxAccess("readonly") if mibBuilder.loadTexts: nhrpServerStatTxRegisterAck.setStatus('current') nhrpServerStatTxRegisterNakProhibited = MibTableColumn((1, 3, 6, 1, 2, 1, 71, 1, 3, 4, 1, 9), Counter32()).setMaxAccess("readonly") if mibBuilder.loadTexts: nhrpServerStatTxRegisterNakProhibited.setStatus('current') nhrpServerStatTxRegisterNakInsufResources = MibTableColumn((1, 3, 6, 1, 2, 1, 71, 1, 3, 4, 1, 10), Counter32()).setMaxAccess("readonly") if mibBuilder.loadTexts: nhrpServerStatTxRegisterNakInsufResources.setStatus('current') nhrpServerStatTxRegisterNakAlreadyReg = MibTableColumn((1, 3, 6, 1, 2, 1, 71, 1, 3, 4, 1, 11), Counter32()).setMaxAccess("readonly") if mibBuilder.loadTexts: nhrpServerStatTxRegisterNakAlreadyReg.setStatus('current') nhrpServerStatRxPurgeReq = MibTableColumn((1, 3, 6, 1, 2, 1, 71, 1, 3, 4, 1, 12), Counter32()).setMaxAccess("readonly") if mibBuilder.loadTexts: nhrpServerStatRxPurgeReq.setStatus('current') nhrpServerStatTxPurgeReq = MibTableColumn((1, 3, 6, 1, 2, 1, 71, 1, 3, 4, 1, 13), Counter32()).setMaxAccess("readonly") if mibBuilder.loadTexts: nhrpServerStatTxPurgeReq.setStatus('current') nhrpServerStatRxPurgeReply = MibTableColumn((1, 3, 6, 1, 2, 1, 71, 1, 3, 4, 1, 14), Counter32()).setMaxAccess("readonly") if mibBuilder.loadTexts: nhrpServerStatRxPurgeReply.setStatus('current') nhrpServerStatTxPurgeReply = MibTableColumn((1, 3, 6, 1, 2, 1, 71, 1, 3, 4, 1, 15), Counter32()).setMaxAccess("readonly") if mibBuilder.loadTexts: nhrpServerStatTxPurgeReply.setStatus('current') nhrpServerStatRxErrUnrecognizedExtension = MibTableColumn((1, 3, 6, 1, 2, 1, 71, 1, 3, 4, 1, 16), Counter32()).setMaxAccess("readonly") if mibBuilder.loadTexts: nhrpServerStatRxErrUnrecognizedExtension.setStatus('current') nhrpServerStatRxErrLoopDetected = MibTableColumn((1, 3, 6, 1, 2, 1, 71, 1, 3, 4, 1, 17), Counter32()).setMaxAccess("readonly") if mibBuilder.loadTexts: nhrpServerStatRxErrLoopDetected.setStatus('current') nhrpServerStatRxErrProtoAddrUnreachable = MibTableColumn((1, 3, 6, 1, 2, 1, 71, 1, 3, 4, 1, 18), Counter32()).setMaxAccess("readonly") if mibBuilder.loadTexts: nhrpServerStatRxErrProtoAddrUnreachable.setStatus('current') nhrpServerStatRxErrProtoError = MibTableColumn((1, 3, 6, 1, 2, 1, 71, 1, 3, 4, 1, 19), Counter32()).setMaxAccess("readonly") if mibBuilder.loadTexts: nhrpServerStatRxErrProtoError.setStatus('current') nhrpServerStatRxErrSduSizeExceeded = MibTableColumn((1, 3, 6, 1, 2, 1, 71, 1, 3, 4, 1, 20), Counter32()).setMaxAccess("readonly") if mibBuilder.loadTexts: nhrpServerStatRxErrSduSizeExceeded.setStatus('current') nhrpServerStatRxErrInvalidExtension = MibTableColumn((1, 3, 6, 1, 2, 1, 71, 1, 3, 4, 1, 21), Counter32()).setMaxAccess("readonly") if mibBuilder.loadTexts: nhrpServerStatRxErrInvalidExtension.setStatus('current') nhrpServerStatRxErrInvalidResReplyReceived = MibTableColumn((1, 3, 6, 1, 2, 1, 71, 1, 3, 4, 1, 22), Counter32()).setMaxAccess("readonly") if mibBuilder.loadTexts: nhrpServerStatRxErrInvalidResReplyReceived.setStatus('current') nhrpServerStatRxErrAuthenticationFailure = MibTableColumn((1, 3, 6, 1, 2, 1, 71, 1, 3, 4, 1, 23), Counter32()).setMaxAccess("readonly") if mibBuilder.loadTexts: nhrpServerStatRxErrAuthenticationFailure.setStatus('current') nhrpServerStatRxErrHopCountExceeded = MibTableColumn((1, 3, 6, 1, 2, 1, 71, 1, 3, 4, 1, 24), Counter32()).setMaxAccess("readonly") if mibBuilder.loadTexts: nhrpServerStatRxErrHopCountExceeded.setStatus('current') nhrpServerStatTxErrUnrecognizedExtension = MibTableColumn((1, 3, 6, 1, 2, 1, 71, 1, 3, 4, 1, 25), Counter32()).setMaxAccess("readonly") if mibBuilder.loadTexts: nhrpServerStatTxErrUnrecognizedExtension.setStatus('current') nhrpServerStatTxErrLoopDetected = MibTableColumn((1, 3, 6, 1, 2, 1, 71, 1, 3, 4, 1, 26), Counter32()).setMaxAccess("readonly") if mibBuilder.loadTexts: nhrpServerStatTxErrLoopDetected.setStatus('current') nhrpServerStatTxErrProtoAddrUnreachable = MibTableColumn((1, 3, 6, 1, 2, 1, 71, 1, 3, 4, 1, 27), Counter32()).setMaxAccess("readonly") if mibBuilder.loadTexts: nhrpServerStatTxErrProtoAddrUnreachable.setStatus('current') nhrpServerStatTxErrProtoError = MibTableColumn((1, 3, 6, 1, 2, 1, 71, 1, 3, 4, 1, 28), Counter32()).setMaxAccess("readonly") if mibBuilder.loadTexts: nhrpServerStatTxErrProtoError.setStatus('current') nhrpServerStatTxErrSduSizeExceeded = MibTableColumn((1, 3, 6, 1, 2, 1, 71, 1, 3, 4, 1, 29), Counter32()).setMaxAccess("readonly") if mibBuilder.loadTexts: nhrpServerStatTxErrSduSizeExceeded.setStatus('current') nhrpServerStatTxErrInvalidExtension = MibTableColumn((1, 3, 6, 1, 2, 1, 71, 1, 3, 4, 1, 30), Counter32()).setMaxAccess("readonly") if mibBuilder.loadTexts: nhrpServerStatTxErrInvalidExtension.setStatus('current') nhrpServerStatTxErrAuthenticationFailure = MibTableColumn((1, 3, 6, 1, 2, 1, 71, 1, 3, 4, 1, 31), Counter32()).setMaxAccess("readonly") if mibBuilder.loadTexts: nhrpServerStatTxErrAuthenticationFailure.setStatus('current') nhrpServerStatTxErrHopCountExceeded = MibTableColumn((1, 3, 6, 1, 2, 1, 71, 1, 3, 4, 1, 32), Counter32()).setMaxAccess("readonly") if mibBuilder.loadTexts: nhrpServerStatTxErrHopCountExceeded.setStatus('current') nhrpServerStatFwResolveReq = MibTableColumn((1, 3, 6, 1, 2, 1, 71, 1, 3, 4, 1, 33), Counter32()).setMaxAccess("readonly") if mibBuilder.loadTexts: nhrpServerStatFwResolveReq.setStatus('current') nhrpServerStatFwResolveReply = MibTableColumn((1, 3, 6, 1, 2, 1, 71, 1, 3, 4, 1, 34), Counter32()).setMaxAccess("readonly") if mibBuilder.loadTexts: nhrpServerStatFwResolveReply.setStatus('current') nhrpServerStatFwRegisterReq = MibTableColumn((1, 3, 6, 1, 2, 1, 71, 1, 3, 4, 1, 35), Counter32()).setMaxAccess("readonly") if mibBuilder.loadTexts: nhrpServerStatFwRegisterReq.setStatus('current') nhrpServerStatFwRegisterReply = MibTableColumn((1, 3, 6, 1, 2, 1, 71, 1, 3, 4, 1, 36), Counter32()).setMaxAccess("readonly") if mibBuilder.loadTexts: nhrpServerStatFwRegisterReply.setStatus('current') nhrpServerStatFwPurgeReq = MibTableColumn((1, 3, 6, 1, 2, 1, 71, 1, 3, 4, 1, 37), Counter32()).setMaxAccess("readonly") if mibBuilder.loadTexts: nhrpServerStatFwPurgeReq.setStatus('current') nhrpServerStatFwPurgeReply = MibTableColumn((1, 3, 6, 1, 2, 1, 71, 1, 3, 4, 1, 38), Counter32()).setMaxAccess("readonly") if mibBuilder.loadTexts: nhrpServerStatFwPurgeReply.setStatus('current') nhrpServerStatFwErrorIndication = MibTableColumn((1, 3, 6, 1, 2, 1, 71, 1, 3, 4, 1, 39), Counter32()).setMaxAccess("readonly") if mibBuilder.loadTexts: nhrpServerStatFwErrorIndication.setStatus('current') nhrpServerStatDiscontinuityTime = MibTableColumn((1, 3, 6, 1, 2, 1, 71, 1, 3, 4, 1, 40), TimeStamp()).setMaxAccess("readonly") if mibBuilder.loadTexts: nhrpServerStatDiscontinuityTime.setStatus('current') nhrpConformance = MibIdentifier((1, 3, 6, 1, 2, 1, 71, 2)) nhrpCompliances = MibIdentifier((1, 3, 6, 1, 2, 1, 71, 2, 1)) nhrpGroups = MibIdentifier((1, 3, 6, 1, 2, 1, 71, 2, 2)) nhrpModuleCompliance = ModuleCompliance((1, 3, 6, 1, 2, 1, 71, 2, 1, 1)).setObjects(("NHRP-MIB", "nhrpGeneralGroup"), ("NHRP-MIB", "nhrpClientGroup"), ("NHRP-MIB", "nhrpServerGroup")) if getattr(mibBuilder, 'version', (0, 0, 0)) > (4, 4, 0): nhrpModuleCompliance = nhrpModuleCompliance.setStatus('current') nhrpGeneralGroup = ObjectGroup((1, 3, 6, 1, 2, 1, 71, 2, 2, 1)).setObjects(("NHRP-MIB", "nhrpNextIndex"), ("NHRP-MIB", "nhrpCachePrefixLength"), ("NHRP-MIB", "nhrpCacheNextHopInternetworkAddr"), ("NHRP-MIB", "nhrpCacheNbmaAddrType"), ("NHRP-MIB", "nhrpCacheNbmaAddr"), ("NHRP-MIB", "nhrpCacheNbmaSubaddr"), ("NHRP-MIB", "nhrpCacheType"), ("NHRP-MIB", "nhrpCacheState"), ("NHRP-MIB", "nhrpCacheHoldingTimeValid"), ("NHRP-MIB", "nhrpCacheHoldingTime"), ("NHRP-MIB", "nhrpCacheNegotiatedMtu"), ("NHRP-MIB", "nhrpCachePreference"), ("NHRP-MIB", "nhrpCacheStorageType"), ("NHRP-MIB", "nhrpCacheRowStatus"), ("NHRP-MIB", "nhrpPurgeCacheIdentifier"), ("NHRP-MIB", "nhrpPurgePrefixLength"), ("NHRP-MIB", "nhrpPurgeRequestID"), ("NHRP-MIB", "nhrpPurgeReplyExpected"), ("NHRP-MIB", "nhrpPurgeRowStatus")) if getattr(mibBuilder, 'version', (0, 0, 0)) > (4, 4, 0): nhrpGeneralGroup = nhrpGeneralGroup.setStatus('current') nhrpClientGroup = ObjectGroup((1, 3, 6, 1, 2, 1, 71, 2, 2, 2)).setObjects(("NHRP-MIB", "nhrpClientInternetworkAddrType"), ("NHRP-MIB", "nhrpClientInternetworkAddr"), ("NHRP-MIB", "nhrpClientNbmaAddrType"), ("NHRP-MIB", "nhrpClientNbmaAddr"), ("NHRP-MIB", "nhrpClientNbmaSubaddr"), ("NHRP-MIB", "nhrpClientInitialRequestTimeout"), ("NHRP-MIB", "nhrpClientRegistrationRequestRetries"), ("NHRP-MIB", "nhrpClientResolutionRequestRetries"), ("NHRP-MIB", "nhrpClientPurgeRequestRetries"), ("NHRP-MIB", "nhrpClientDefaultMtu"), ("NHRP-MIB", "nhrpClientHoldTime"), ("NHRP-MIB", "nhrpClientRequestID"), ("NHRP-MIB", "nhrpClientStorageType"), ("NHRP-MIB", "nhrpClientRowStatus"), ("NHRP-MIB", "nhrpClientRegUniqueness"), ("NHRP-MIB", "nhrpClientRegState"), ("NHRP-MIB", "nhrpClientRegRowStatus"), ("NHRP-MIB", "nhrpClientNhsInternetworkAddrType"), ("NHRP-MIB", "nhrpClientNhsInternetworkAddr"), ("NHRP-MIB", "nhrpClientNhsNbmaAddrType"), ("NHRP-MIB", "nhrpClientNhsNbmaAddr"), ("NHRP-MIB", "nhrpClientNhsNbmaSubaddr"), ("NHRP-MIB", "nhrpClientNhsInUse"), ("NHRP-MIB", "nhrpClientNhsRowStatus"), ("NHRP-MIB", "nhrpClientStatTxResolveReq"), ("NHRP-MIB", "nhrpClientStatRxResolveReplyAck"), ("NHRP-MIB", "nhrpClientStatRxResolveReplyNakProhibited"), ("NHRP-MIB", "nhrpClientStatRxResolveReplyNakInsufResources"), ("NHRP-MIB", "nhrpClientStatRxResolveReplyNakNoBinding"), ("NHRP-MIB", "nhrpClientStatRxResolveReplyNakNotUnique"), ("NHRP-MIB", "nhrpClientStatTxRegisterReq"), ("NHRP-MIB", "nhrpClientStatRxRegisterAck"), ("NHRP-MIB", "nhrpClientStatRxRegisterNakProhibited"), ("NHRP-MIB", "nhrpClientStatRxRegisterNakInsufResources"), ("NHRP-MIB", "nhrpClientStatRxRegisterNakAlreadyReg"), ("NHRP-MIB", "nhrpClientStatRxPurgeReq"), ("NHRP-MIB", "nhrpClientStatTxPurgeReq"), ("NHRP-MIB", "nhrpClientStatRxPurgeReply"), ("NHRP-MIB", "nhrpClientStatTxPurgeReply"), ("NHRP-MIB", "nhrpClientStatTxErrorIndication"), ("NHRP-MIB", "nhrpClientStatRxErrUnrecognizedExtension"), ("NHRP-MIB", "nhrpClientStatRxErrLoopDetected"), ("NHRP-MIB", "nhrpClientStatRxErrProtoAddrUnreachable"), ("NHRP-MIB", "nhrpClientStatRxErrProtoError"), ("NHRP-MIB", "nhrpClientStatRxErrSduSizeExceeded"), ("NHRP-MIB", "nhrpClientStatRxErrInvalidExtension"), ("NHRP-MIB", "nhrpClientStatRxErrAuthenticationFailure"), ("NHRP-MIB", "nhrpClientStatRxErrHopCountExceeded"), ("NHRP-MIB", "nhrpClientStatDiscontinuityTime")) if getattr(mibBuilder, 'version', (0, 0, 0)) > (4, 4, 0): nhrpClientGroup = nhrpClientGroup.setStatus('current') nhrpServerGroup = ObjectGroup((1, 3, 6, 1, 2, 1, 71, 2, 2, 3)).setObjects(("NHRP-MIB", "nhrpServerInternetworkAddrType"), ("NHRP-MIB", "nhrpServerInternetworkAddr"), ("NHRP-MIB", "nhrpServerNbmaAddrType"), ("NHRP-MIB", "nhrpServerNbmaAddr"), ("NHRP-MIB", "nhrpServerNbmaSubaddr"), ("NHRP-MIB", "nhrpServerStorageType"), ("NHRP-MIB", "nhrpServerRowStatus"), ("NHRP-MIB", "nhrpServerCacheAuthoritative"), ("NHRP-MIB", "nhrpServerCacheUniqueness"), ("NHRP-MIB", "nhrpServerNhcPrefixLength"), ("NHRP-MIB", "nhrpServerNhcInternetworkAddrType"), ("NHRP-MIB", "nhrpServerNhcInternetworkAddr"), ("NHRP-MIB", "nhrpServerNhcNbmaAddrType"), ("NHRP-MIB", "nhrpServerNhcNbmaAddr"), ("NHRP-MIB", "nhrpServerNhcNbmaSubaddr"), ("NHRP-MIB", "nhrpServerNhcInUse"), ("NHRP-MIB", "nhrpServerNhcRowStatus"), ("NHRP-MIB", "nhrpServerStatRxResolveReq"), ("NHRP-MIB", "nhrpServerStatTxResolveReplyAck"), ("NHRP-MIB", "nhrpServerStatTxResolveReplyNakProhibited"), ("NHRP-MIB", "nhrpServerStatTxResolveReplyNakInsufResources"), ("NHRP-MIB", "nhrpServerStatTxResolveReplyNakNoBinding"), ("NHRP-MIB", "nhrpServerStatTxResolveReplyNakNotUnique"), ("NHRP-MIB", "nhrpServerStatRxRegisterReq"), ("NHRP-MIB", "nhrpServerStatTxRegisterAck"), ("NHRP-MIB", "nhrpServerStatTxRegisterNakProhibited"), ("NHRP-MIB", "nhrpServerStatTxRegisterNakInsufResources"), ("NHRP-MIB", "nhrpServerStatTxRegisterNakAlreadyReg"), ("NHRP-MIB", "nhrpServerStatRxPurgeReq"), ("NHRP-MIB", "nhrpServerStatTxPurgeReq"), ("NHRP-MIB", "nhrpServerStatRxPurgeReply"), ("NHRP-MIB", "nhrpServerStatTxPurgeReply"), ("NHRP-MIB", "nhrpServerStatRxErrUnrecognizedExtension"), ("NHRP-MIB", "nhrpServerStatRxErrLoopDetected"), ("NHRP-MIB", "nhrpServerStatRxErrProtoAddrUnreachable"), ("NHRP-MIB", "nhrpServerStatRxErrProtoError"), ("NHRP-MIB", "nhrpServerStatRxErrSduSizeExceeded"), ("NHRP-MIB", "nhrpServerStatRxErrInvalidExtension"), ("NHRP-MIB", "nhrpServerStatRxErrInvalidResReplyReceived"), ("NHRP-MIB", "nhrpServerStatRxErrAuthenticationFailure"), ("NHRP-MIB", "nhrpServerStatRxErrHopCountExceeded"), ("NHRP-MIB", "nhrpServerStatTxErrUnrecognizedExtension"), ("NHRP-MIB", "nhrpServerStatTxErrLoopDetected"), ("NHRP-MIB", "nhrpServerStatTxErrProtoAddrUnreachable"), ("NHRP-MIB", "nhrpServerStatTxErrProtoError"), ("NHRP-MIB", "nhrpServerStatTxErrSduSizeExceeded"), ("NHRP-MIB", "nhrpServerStatTxErrInvalidExtension"), ("NHRP-MIB", "nhrpServerStatTxErrAuthenticationFailure"), ("NHRP-MIB", "nhrpServerStatTxErrHopCountExceeded"), ("NHRP-MIB", "nhrpServerStatFwResolveReq"), ("NHRP-MIB", "nhrpServerStatFwResolveReply"), ("NHRP-MIB", "nhrpServerStatFwRegisterReq"), ("NHRP-MIB", "nhrpServerStatFwRegisterReply"), ("NHRP-MIB", "nhrpServerStatFwPurgeReq"), ("NHRP-MIB", "nhrpServerStatFwPurgeReply"), ("NHRP-MIB", "nhrpServerStatFwErrorIndication"), ("NHRP-MIB", "nhrpServerStatDiscontinuityTime")) if getattr(mibBuilder, 'version', (0, 0, 0)) > (4, 4, 0): nhrpServerGroup = nhrpServerGroup.setStatus('current') mibBuilder.exportSymbols("NHRP-MIB", nhrpClientStatTxErrorIndication=nhrpClientStatTxErrorIndication, nhrpClientStatRxResolveReplyNakNoBinding=nhrpClientStatRxResolveReplyNakNoBinding, nhrpClientStatRxResolveReplyAck=nhrpClientStatRxResolveReplyAck, nhrpCacheNbmaSubaddr=nhrpCacheNbmaSubaddr, nhrpPurgeCacheIdentifier=nhrpPurgeCacheIdentifier, nhrpClientPurgeRequestRetries=nhrpClientPurgeRequestRetries, nhrpServerStatTxResolveReplyAck=nhrpServerStatTxResolveReplyAck, nhrpServerStatTxPurgeReply=nhrpServerStatTxPurgeReply, nhrpServerStatFwResolveReq=nhrpServerStatFwResolveReq, nhrpCacheInternetworkAddrType=nhrpCacheInternetworkAddrType, nhrpClientNhsEntry=nhrpClientNhsEntry, nhrpServerObjects=nhrpServerObjects, nhrpServerStatFwErrorIndication=nhrpServerStatFwErrorIndication, nhrpGeneralObjects=nhrpGeneralObjects, nhrpServerStorageType=nhrpServerStorageType, nhrpClientStatRxErrInvalidExtension=nhrpClientStatRxErrInvalidExtension, nhrpClientRegUniqueness=nhrpClientRegUniqueness, nhrpClientStatRxErrUnrecognizedExtension=nhrpClientStatRxErrUnrecognizedExtension, nhrpCacheInternetworkAddr=nhrpCacheInternetworkAddr, nhrpServerStatFwPurgeReply=nhrpServerStatFwPurgeReply, nhrpCacheNextHopInternetworkAddr=nhrpCacheNextHopInternetworkAddr, nhrpClientInternetworkAddr=nhrpClientInternetworkAddr, nhrpServerStatRxRegisterReq=nhrpServerStatRxRegisterReq, nhrpCacheTable=nhrpCacheTable, nhrpServerStatDiscontinuityTime=nhrpServerStatDiscontinuityTime, nhrpServerStatEntry=nhrpServerStatEntry, nhrpServerStatTxRegisterNakAlreadyReg=nhrpServerStatTxRegisterNakAlreadyReg, nhrpPurgeIndex=nhrpPurgeIndex, nhrpClientStatRxPurgeReq=nhrpClientStatRxPurgeReq, nhrpServerNbmaAddr=nhrpServerNbmaAddr, nhrpClientNhsIndex=nhrpClientNhsIndex, nhrpServerNhcIndex=nhrpServerNhcIndex, nhrpServerStatRxPurgeReply=nhrpServerStatRxPurgeReply, nhrpServerNbmaSubaddr=nhrpServerNbmaSubaddr, nhrpClientStatRxResolveReplyNakNotUnique=nhrpClientStatRxResolveReplyNakNotUnique, nhrpServerStatFwPurgeReq=nhrpServerStatFwPurgeReq, nhrpConformance=nhrpConformance, nhrpNextIndex=nhrpNextIndex, nhrpClientNhsNbmaSubaddr=nhrpClientNhsNbmaSubaddr, nhrpServerNhcTable=nhrpServerNhcTable, nhrpServerStatTxResolveReplyNakNotUnique=nhrpServerStatTxResolveReplyNakNotUnique, nhrpClientRegState=nhrpClientRegState, nhrpClientResolutionRequestRetries=nhrpClientResolutionRequestRetries, nhrpCacheState=nhrpCacheState, nhrpClientStatRxResolveReplyNakInsufResources=nhrpClientStatRxResolveReplyNakInsufResources, nhrpServerStatRxErrInvalidExtension=nhrpServerStatRxErrInvalidExtension, nhrpServerStatRxErrHopCountExceeded=nhrpServerStatRxErrHopCountExceeded, nhrpServerStatFwResolveReply=nhrpServerStatFwResolveReply, nhrpCacheStorageType=nhrpCacheStorageType, PYSNMP_MODULE_ID=nhrpMIB, nhrpCacheHoldingTime=nhrpCacheHoldingTime, nhrpClientStatRxRegisterAck=nhrpClientStatRxRegisterAck, nhrpClientStatTxResolveReq=nhrpClientStatTxResolveReq, nhrpServerNhcNbmaSubaddr=nhrpServerNhcNbmaSubaddr, nhrpServerStatFwRegisterReply=nhrpServerStatFwRegisterReply, nhrpServerTable=nhrpServerTable, nhrpServerCacheAuthoritative=nhrpServerCacheAuthoritative, nhrpServerStatTxRegisterAck=nhrpServerStatTxRegisterAck, nhrpClientNhsTable=nhrpClientNhsTable, nhrpMIB=nhrpMIB, nhrpClientStatRxErrSduSizeExceeded=nhrpClientStatRxErrSduSizeExceeded, nhrpServerStatTxErrProtoAddrUnreachable=nhrpServerStatTxErrProtoAddrUnreachable, nhrpClientStatDiscontinuityTime=nhrpClientStatDiscontinuityTime, nhrpServerStatTxErrHopCountExceeded=nhrpServerStatTxErrHopCountExceeded, nhrpClientTable=nhrpClientTable, nhrpServerInternetworkAddr=nhrpServerInternetworkAddr, nhrpClientStatRxErrProtoAddrUnreachable=nhrpClientStatRxErrProtoAddrUnreachable, nhrpServerRowStatus=nhrpServerRowStatus, nhrpServerStatTxResolveReplyNakProhibited=nhrpServerStatTxResolveReplyNakProhibited, nhrpServerStatTxResolveReplyNakNoBinding=nhrpServerStatTxResolveReplyNakNoBinding, nhrpCacheRowStatus=nhrpCacheRowStatus, nhrpServerStatRxErrAuthenticationFailure=nhrpServerStatRxErrAuthenticationFailure, nhrpClientNhsInternetworkAddr=nhrpClientNhsInternetworkAddr, nhrpClientInternetworkAddrType=nhrpClientInternetworkAddrType, nhrpServerNhcNbmaAddr=nhrpServerNhcNbmaAddr, nhrpServerStatTxErrLoopDetected=nhrpServerStatTxErrLoopDetected, nhrpServerEntry=nhrpServerEntry, nhrpClientRegistrationEntry=nhrpClientRegistrationEntry, nhrpClientNhsNbmaAddrType=nhrpClientNhsNbmaAddrType, nhrpServerStatRxErrProtoAddrUnreachable=nhrpServerStatRxErrProtoAddrUnreachable, nhrpServerIndex=nhrpServerIndex, nhrpServerStatRxErrInvalidResReplyReceived=nhrpServerStatRxErrInvalidResReplyReceived, nhrpClientNbmaSubaddr=nhrpClientNbmaSubaddr, nhrpClientNhsNbmaAddr=nhrpClientNhsNbmaAddr, NhrpGenAddr=NhrpGenAddr, nhrpClientStatTxPurgeReply=nhrpClientStatTxPurgeReply, nhrpClientStatTable=nhrpClientStatTable, nhrpServerStatRxErrSduSizeExceeded=nhrpServerStatRxErrSduSizeExceeded, nhrpClientRegRowStatus=nhrpClientRegRowStatus, nhrpClientRequestID=nhrpClientRequestID, nhrpServerCacheUniqueness=nhrpServerCacheUniqueness, nhrpClientStatRxErrLoopDetected=nhrpClientStatRxErrLoopDetected, nhrpClientStatRxRegisterNakInsufResources=nhrpClientStatRxRegisterNakInsufResources, nhrpServerStatRxPurgeReq=nhrpServerStatRxPurgeReq, nhrpServerStatRxErrLoopDetected=nhrpServerStatRxErrLoopDetected, nhrpCacheIndex=nhrpCacheIndex, nhrpPurgeRequestID=nhrpPurgeRequestID, nhrpServerStatTxErrProtoError=nhrpServerStatTxErrProtoError, nhrpCompliances=nhrpCompliances, nhrpCacheNbmaAddrType=nhrpCacheNbmaAddrType, nhrpServerStatTxErrUnrecognizedExtension=nhrpServerStatTxErrUnrecognizedExtension, nhrpObjects=nhrpObjects, nhrpClientStatRxRegisterNakAlreadyReg=nhrpClientStatRxRegisterNakAlreadyReg, nhrpClientStatRxRegisterNakProhibited=nhrpClientStatRxRegisterNakProhibited, nhrpClientNbmaAddrType=nhrpClientNbmaAddrType, nhrpServerStatTxRegisterNakProhibited=nhrpServerStatTxRegisterNakProhibited, nhrpServerCacheTable=nhrpServerCacheTable, nhrpClientStatRxPurgeReply=nhrpClientStatRxPurgeReply, nhrpServerStatTxErrAuthenticationFailure=nhrpServerStatTxErrAuthenticationFailure, nhrpServerNhcInUse=nhrpServerNhcInUse, nhrpServerNhcNbmaAddrType=nhrpServerNhcNbmaAddrType, nhrpPurgeReqEntry=nhrpPurgeReqEntry, nhrpClientRegistrationRequestRetries=nhrpClientRegistrationRequestRetries, nhrpClientEntry=nhrpClientEntry, nhrpClientStatRxErrProtoError=nhrpClientStatRxErrProtoError, nhrpClientObjects=nhrpClientObjects, nhrpClientRowStatus=nhrpClientRowStatus, nhrpClientHoldTime=nhrpClientHoldTime, nhrpCacheType=nhrpCacheType, nhrpServerStatTxRegisterNakInsufResources=nhrpServerStatTxRegisterNakInsufResources, nhrpCacheEntry=nhrpCacheEntry, nhrpCachePreference=nhrpCachePreference, nhrpServerNhcInternetworkAddr=nhrpServerNhcInternetworkAddr, nhrpClientRegistrationTable=nhrpClientRegistrationTable, nhrpServerStatTxPurgeReq=nhrpServerStatTxPurgeReq, nhrpServerStatTxErrInvalidExtension=nhrpServerStatTxErrInvalidExtension, nhrpPurgeRowStatus=nhrpPurgeRowStatus, nhrpModuleCompliance=nhrpModuleCompliance, nhrpPurgePrefixLength=nhrpPurgePrefixLength, nhrpPurgeReqTable=nhrpPurgeReqTable, nhrpGeneralGroup=nhrpGeneralGroup, nhrpClientStatRxErrAuthenticationFailure=nhrpClientStatRxErrAuthenticationFailure, nhrpServerCacheEntry=nhrpServerCacheEntry, nhrpClientNbmaAddr=nhrpClientNbmaAddr, nhrpServerStatRxErrProtoError=nhrpServerStatRxErrProtoError, nhrpClientNhsInUse=nhrpClientNhsInUse, nhrpClientStatTxRegisterReq=nhrpClientStatTxRegisterReq, nhrpServerNhcEntry=nhrpServerNhcEntry, nhrpServerGroup=nhrpServerGroup, nhrpClientNhsInternetworkAddrType=nhrpClientNhsInternetworkAddrType, nhrpServerNhcPrefixLength=nhrpServerNhcPrefixLength, nhrpServerStatTxResolveReplyNakInsufResources=nhrpServerStatTxResolveReplyNakInsufResources, nhrpCachePrefixLength=nhrpCachePrefixLength, nhrpClientStatTxPurgeReq=nhrpClientStatTxPurgeReq, nhrpClientStorageType=nhrpClientStorageType, nhrpServerStatTable=nhrpServerStatTable, nhrpCacheNegotiatedMtu=nhrpCacheNegotiatedMtu, nhrpServerStatRxResolveReq=nhrpServerStatRxResolveReq, nhrpClientGroup=nhrpClientGroup, nhrpClientStatRxErrHopCountExceeded=nhrpClientStatRxErrHopCountExceeded, nhrpClientIndex=nhrpClientIndex, nhrpServerStatRxErrUnrecognizedExtension=nhrpServerStatRxErrUnrecognizedExtension, nhrpCacheNbmaAddr=nhrpCacheNbmaAddr, nhrpCacheHoldingTimeValid=nhrpCacheHoldingTimeValid, nhrpClientInitialRequestTimeout=nhrpClientInitialRequestTimeout, nhrpGroups=nhrpGroups, nhrpServerNhcInternetworkAddrType=nhrpServerNhcInternetworkAddrType, nhrpServerStatTxErrSduSizeExceeded=nhrpServerStatTxErrSduSizeExceeded, nhrpClientRegIndex=nhrpClientRegIndex, nhrpClientStatRxResolveReplyNakProhibited=nhrpClientStatRxResolveReplyNakProhibited, nhrpServerStatFwRegisterReq=nhrpServerStatFwRegisterReq, nhrpPurgeReplyExpected=nhrpPurgeReplyExpected, nhrpServerNhcRowStatus=nhrpServerNhcRowStatus, nhrpClientStatEntry=nhrpClientStatEntry, nhrpClientNhsRowStatus=nhrpClientNhsRowStatus, nhrpClientDefaultMtu=nhrpClientDefaultMtu, nhrpServerInternetworkAddrType=nhrpServerInternetworkAddrType, nhrpServerNbmaAddrType=nhrpServerNbmaAddrType)
(object_identifier, octet_string, integer) = mibBuilder.importSymbols('ASN1', 'ObjectIdentifier', 'OctetString', 'Integer') (named_values,) = mibBuilder.importSymbols('ASN1-ENUMERATION', 'NamedValues') (single_value_constraint, constraints_union, value_size_constraint, constraints_intersection, value_range_constraint) = mibBuilder.importSymbols('ASN1-REFINEMENT', 'SingleValueConstraint', 'ConstraintsUnion', 'ValueSizeConstraint', 'ConstraintsIntersection', 'ValueRangeConstraint') (address_family_numbers,) = mibBuilder.importSymbols('IANA-ADDRESS-FAMILY-NUMBERS-MIB', 'AddressFamilyNumbers') (if_index,) = mibBuilder.importSymbols('IF-MIB', 'ifIndex') (object_group, module_compliance, notification_group) = mibBuilder.importSymbols('SNMPv2-CONF', 'ObjectGroup', 'ModuleCompliance', 'NotificationGroup') (counter64, mib_identifier, counter32, integer32, unsigned32, iso, mib_scalar, mib_table, mib_table_row, mib_table_column, bits, notification_type, ip_address, object_identity, mib_2, time_ticks, module_identity, gauge32) = mibBuilder.importSymbols('SNMPv2-SMI', 'Counter64', 'MibIdentifier', 'Counter32', 'Integer32', 'Unsigned32', 'iso', 'MibScalar', 'MibTable', 'MibTableRow', 'MibTableColumn', 'Bits', 'NotificationType', 'IpAddress', 'ObjectIdentity', 'mib-2', 'TimeTicks', 'ModuleIdentity', 'Gauge32') (storage_type, textual_convention, row_status, time_stamp, truth_value, display_string) = mibBuilder.importSymbols('SNMPv2-TC', 'StorageType', 'TextualConvention', 'RowStatus', 'TimeStamp', 'TruthValue', 'DisplayString') nhrp_mib = module_identity((1, 3, 6, 1, 2, 1, 71)) nhrpMIB.setRevisions(('1999-08-26 00:00',)) if mibBuilder.loadTexts: nhrpMIB.setLastUpdated('9908260000Z') if mibBuilder.loadTexts: nhrpMIB.setOrganization('Internetworking Over NBMA (ion) Working Group') class Nhrpgenaddr(TextualConvention, OctetString): status = 'current' subtype_spec = OctetString.subtypeSpec + value_size_constraint(0, 64) nhrp_objects = mib_identifier((1, 3, 6, 1, 2, 1, 71, 1)) nhrp_general_objects = mib_identifier((1, 3, 6, 1, 2, 1, 71, 1, 1)) nhrp_next_index = mib_scalar((1, 3, 6, 1, 2, 1, 71, 1, 1, 1), unsigned32()).setMaxAccess('readonly') if mibBuilder.loadTexts: nhrpNextIndex.setStatus('current') nhrp_cache_table = mib_table((1, 3, 6, 1, 2, 1, 71, 1, 1, 2)) if mibBuilder.loadTexts: nhrpCacheTable.setStatus('current') nhrp_cache_entry = mib_table_row((1, 3, 6, 1, 2, 1, 71, 1, 1, 2, 1)).setIndexNames((0, 'NHRP-MIB', 'nhrpCacheInternetworkAddrType'), (0, 'NHRP-MIB', 'nhrpCacheInternetworkAddr'), (0, 'IF-MIB', 'ifIndex'), (0, 'NHRP-MIB', 'nhrpCacheIndex')) if mibBuilder.loadTexts: nhrpCacheEntry.setStatus('current') nhrp_cache_internetwork_addr_type = mib_table_column((1, 3, 6, 1, 2, 1, 71, 1, 1, 2, 1, 1), address_family_numbers()) if mibBuilder.loadTexts: nhrpCacheInternetworkAddrType.setStatus('current') nhrp_cache_internetwork_addr = mib_table_column((1, 3, 6, 1, 2, 1, 71, 1, 1, 2, 1, 2), nhrp_gen_addr()) if mibBuilder.loadTexts: nhrpCacheInternetworkAddr.setStatus('current') nhrp_cache_index = mib_table_column((1, 3, 6, 1, 2, 1, 71, 1, 1, 2, 1, 3), unsigned32().subtype(subtypeSpec=value_range_constraint(1, 4294967295))) if mibBuilder.loadTexts: nhrpCacheIndex.setStatus('current') nhrp_cache_prefix_length = mib_table_column((1, 3, 6, 1, 2, 1, 71, 1, 1, 2, 1, 4), integer32().subtype(subtypeSpec=value_range_constraint(0, 255))).setMaxAccess('readonly') if mibBuilder.loadTexts: nhrpCachePrefixLength.setStatus('current') nhrp_cache_next_hop_internetwork_addr = mib_table_column((1, 3, 6, 1, 2, 1, 71, 1, 1, 2, 1, 5), nhrp_gen_addr()).setMaxAccess('readcreate') if mibBuilder.loadTexts: nhrpCacheNextHopInternetworkAddr.setStatus('current') nhrp_cache_nbma_addr_type = mib_table_column((1, 3, 6, 1, 2, 1, 71, 1, 1, 2, 1, 6), address_family_numbers()).setMaxAccess('readcreate') if mibBuilder.loadTexts: nhrpCacheNbmaAddrType.setStatus('current') nhrp_cache_nbma_addr = mib_table_column((1, 3, 6, 1, 2, 1, 71, 1, 1, 2, 1, 7), nhrp_gen_addr()).setMaxAccess('readcreate') if mibBuilder.loadTexts: nhrpCacheNbmaAddr.setStatus('current') nhrp_cache_nbma_subaddr = mib_table_column((1, 3, 6, 1, 2, 1, 71, 1, 1, 2, 1, 8), nhrp_gen_addr()).setMaxAccess('readcreate') if mibBuilder.loadTexts: nhrpCacheNbmaSubaddr.setStatus('current') nhrp_cache_type = mib_table_column((1, 3, 6, 1, 2, 1, 71, 1, 1, 2, 1, 9), integer32().subtype(subtypeSpec=constraints_union(single_value_constraint(1, 2, 3, 4, 5, 6, 7, 8))).clone(namedValues=named_values(('other', 1), ('register', 2), ('resolveAuthoritative', 3), ('resoveNonauthoritative', 4), ('transit', 5), ('administrativelyAdded', 6), ('atmarp', 7), ('scsp', 8)))).setMaxAccess('readcreate') if mibBuilder.loadTexts: nhrpCacheType.setStatus('current') nhrp_cache_state = mib_table_column((1, 3, 6, 1, 2, 1, 71, 1, 1, 2, 1, 10), integer32().subtype(subtypeSpec=constraints_union(single_value_constraint(1, 2, 3))).clone(namedValues=named_values(('incomplete', 1), ('ackReply', 2), ('nakReply', 3)))).setMaxAccess('readonly') if mibBuilder.loadTexts: nhrpCacheState.setStatus('current') nhrp_cache_holding_time_valid = mib_table_column((1, 3, 6, 1, 2, 1, 71, 1, 1, 2, 1, 11), truth_value()).setMaxAccess('readonly') if mibBuilder.loadTexts: nhrpCacheHoldingTimeValid.setStatus('current') nhrp_cache_holding_time = mib_table_column((1, 3, 6, 1, 2, 1, 71, 1, 1, 2, 1, 12), unsigned32().subtype(subtypeSpec=value_range_constraint(0, 65535))).setUnits('seconds').setMaxAccess('readonly') if mibBuilder.loadTexts: nhrpCacheHoldingTime.setStatus('current') nhrp_cache_negotiated_mtu = mib_table_column((1, 3, 6, 1, 2, 1, 71, 1, 1, 2, 1, 13), integer32().subtype(subtypeSpec=value_range_constraint(0, 65535))).setMaxAccess('readonly') if mibBuilder.loadTexts: nhrpCacheNegotiatedMtu.setStatus('current') nhrp_cache_preference = mib_table_column((1, 3, 6, 1, 2, 1, 71, 1, 1, 2, 1, 14), integer32().subtype(subtypeSpec=value_range_constraint(0, 255))).setMaxAccess('readcreate') if mibBuilder.loadTexts: nhrpCachePreference.setStatus('current') nhrp_cache_storage_type = mib_table_column((1, 3, 6, 1, 2, 1, 71, 1, 1, 2, 1, 15), storage_type().clone('nonVolatile')).setMaxAccess('readcreate') if mibBuilder.loadTexts: nhrpCacheStorageType.setStatus('current') nhrp_cache_row_status = mib_table_column((1, 3, 6, 1, 2, 1, 71, 1, 1, 2, 1, 16), row_status()).setMaxAccess('readcreate') if mibBuilder.loadTexts: nhrpCacheRowStatus.setStatus('current') nhrp_purge_req_table = mib_table((1, 3, 6, 1, 2, 1, 71, 1, 1, 3)) if mibBuilder.loadTexts: nhrpPurgeReqTable.setStatus('current') nhrp_purge_req_entry = mib_table_row((1, 3, 6, 1, 2, 1, 71, 1, 1, 3, 1)).setIndexNames((0, 'NHRP-MIB', 'nhrpPurgeIndex')) if mibBuilder.loadTexts: nhrpPurgeReqEntry.setStatus('current') nhrp_purge_index = mib_table_column((1, 3, 6, 1, 2, 1, 71, 1, 1, 3, 1, 1), unsigned32().subtype(subtypeSpec=value_range_constraint(1, 4294967295))) if mibBuilder.loadTexts: nhrpPurgeIndex.setStatus('current') nhrp_purge_cache_identifier = mib_table_column((1, 3, 6, 1, 2, 1, 71, 1, 1, 3, 1, 2), unsigned32().subtype(subtypeSpec=value_range_constraint(1, 4294967295))).setMaxAccess('readcreate') if mibBuilder.loadTexts: nhrpPurgeCacheIdentifier.setStatus('current') nhrp_purge_prefix_length = mib_table_column((1, 3, 6, 1, 2, 1, 71, 1, 1, 3, 1, 3), integer32().subtype(subtypeSpec=value_range_constraint(0, 255))).setMaxAccess('readonly') if mibBuilder.loadTexts: nhrpPurgePrefixLength.setStatus('current') nhrp_purge_request_id = mib_table_column((1, 3, 6, 1, 2, 1, 71, 1, 1, 3, 1, 4), unsigned32()).setMaxAccess('readcreate') if mibBuilder.loadTexts: nhrpPurgeRequestID.setStatus('current') nhrp_purge_reply_expected = mib_table_column((1, 3, 6, 1, 2, 1, 71, 1, 1, 3, 1, 5), truth_value()).setMaxAccess('readcreate') if mibBuilder.loadTexts: nhrpPurgeReplyExpected.setStatus('current') nhrp_purge_row_status = mib_table_column((1, 3, 6, 1, 2, 1, 71, 1, 1, 3, 1, 6), row_status()).setMaxAccess('readcreate') if mibBuilder.loadTexts: nhrpPurgeRowStatus.setStatus('current') nhrp_client_objects = mib_identifier((1, 3, 6, 1, 2, 1, 71, 1, 2)) nhrp_client_table = mib_table((1, 3, 6, 1, 2, 1, 71, 1, 2, 1)) if mibBuilder.loadTexts: nhrpClientTable.setStatus('current') nhrp_client_entry = mib_table_row((1, 3, 6, 1, 2, 1, 71, 1, 2, 1, 1)).setIndexNames((0, 'NHRP-MIB', 'nhrpClientIndex')) if mibBuilder.loadTexts: nhrpClientEntry.setStatus('current') nhrp_client_index = mib_table_column((1, 3, 6, 1, 2, 1, 71, 1, 2, 1, 1, 1), unsigned32().subtype(subtypeSpec=value_range_constraint(1, 4294967295))) if mibBuilder.loadTexts: nhrpClientIndex.setStatus('current') nhrp_client_internetwork_addr_type = mib_table_column((1, 3, 6, 1, 2, 1, 71, 1, 2, 1, 1, 2), address_family_numbers()).setMaxAccess('readcreate') if mibBuilder.loadTexts: nhrpClientInternetworkAddrType.setStatus('current') nhrp_client_internetwork_addr = mib_table_column((1, 3, 6, 1, 2, 1, 71, 1, 2, 1, 1, 3), nhrp_gen_addr()).setMaxAccess('readcreate') if mibBuilder.loadTexts: nhrpClientInternetworkAddr.setStatus('current') nhrp_client_nbma_addr_type = mib_table_column((1, 3, 6, 1, 2, 1, 71, 1, 2, 1, 1, 4), address_family_numbers()).setMaxAccess('readcreate') if mibBuilder.loadTexts: nhrpClientNbmaAddrType.setStatus('current') nhrp_client_nbma_addr = mib_table_column((1, 3, 6, 1, 2, 1, 71, 1, 2, 1, 1, 5), nhrp_gen_addr()).setMaxAccess('readcreate') if mibBuilder.loadTexts: nhrpClientNbmaAddr.setStatus('current') nhrp_client_nbma_subaddr = mib_table_column((1, 3, 6, 1, 2, 1, 71, 1, 2, 1, 1, 6), nhrp_gen_addr()).setMaxAccess('readcreate') if mibBuilder.loadTexts: nhrpClientNbmaSubaddr.setStatus('current') nhrp_client_initial_request_timeout = mib_table_column((1, 3, 6, 1, 2, 1, 71, 1, 2, 1, 1, 7), integer32().subtype(subtypeSpec=value_range_constraint(1, 900)).clone(10)).setUnits('seconds').setMaxAccess('readcreate') if mibBuilder.loadTexts: nhrpClientInitialRequestTimeout.setStatus('current') nhrp_client_registration_request_retries = mib_table_column((1, 3, 6, 1, 2, 1, 71, 1, 2, 1, 1, 8), integer32().subtype(subtypeSpec=value_range_constraint(0, 65535)).clone(3)).setMaxAccess('readcreate') if mibBuilder.loadTexts: nhrpClientRegistrationRequestRetries.setStatus('current') nhrp_client_resolution_request_retries = mib_table_column((1, 3, 6, 1, 2, 1, 71, 1, 2, 1, 1, 9), integer32().subtype(subtypeSpec=value_range_constraint(0, 65535)).clone(3)).setMaxAccess('readcreate') if mibBuilder.loadTexts: nhrpClientResolutionRequestRetries.setStatus('current') nhrp_client_purge_request_retries = mib_table_column((1, 3, 6, 1, 2, 1, 71, 1, 2, 1, 1, 10), integer32().subtype(subtypeSpec=value_range_constraint(0, 65535)).clone(3)).setMaxAccess('readcreate') if mibBuilder.loadTexts: nhrpClientPurgeRequestRetries.setStatus('current') nhrp_client_default_mtu = mib_table_column((1, 3, 6, 1, 2, 1, 71, 1, 2, 1, 1, 11), unsigned32().subtype(subtypeSpec=value_range_constraint(0, 65535)).clone(9180)).setMaxAccess('readcreate') if mibBuilder.loadTexts: nhrpClientDefaultMtu.setStatus('current') nhrp_client_hold_time = mib_table_column((1, 3, 6, 1, 2, 1, 71, 1, 2, 1, 1, 12), unsigned32().subtype(subtypeSpec=value_range_constraint(0, 65535)).clone(900)).setUnits('seconds').setMaxAccess('readcreate') if mibBuilder.loadTexts: nhrpClientHoldTime.setStatus('current') nhrp_client_request_id = mib_table_column((1, 3, 6, 1, 2, 1, 71, 1, 2, 1, 1, 13), unsigned32()).setMaxAccess('readcreate') if mibBuilder.loadTexts: nhrpClientRequestID.setStatus('current') nhrp_client_storage_type = mib_table_column((1, 3, 6, 1, 2, 1, 71, 1, 2, 1, 1, 14), storage_type().clone('nonVolatile')).setMaxAccess('readcreate') if mibBuilder.loadTexts: nhrpClientStorageType.setStatus('current') nhrp_client_row_status = mib_table_column((1, 3, 6, 1, 2, 1, 71, 1, 2, 1, 1, 15), row_status()).setMaxAccess('readcreate') if mibBuilder.loadTexts: nhrpClientRowStatus.setStatus('current') nhrp_client_registration_table = mib_table((1, 3, 6, 1, 2, 1, 71, 1, 2, 2)) if mibBuilder.loadTexts: nhrpClientRegistrationTable.setStatus('current') nhrp_client_registration_entry = mib_table_row((1, 3, 6, 1, 2, 1, 71, 1, 2, 2, 1)).setIndexNames((0, 'NHRP-MIB', 'nhrpClientIndex'), (0, 'NHRP-MIB', 'nhrpClientRegIndex')) if mibBuilder.loadTexts: nhrpClientRegistrationEntry.setStatus('current') nhrp_client_reg_index = mib_table_column((1, 3, 6, 1, 2, 1, 71, 1, 2, 2, 1, 1), unsigned32().subtype(subtypeSpec=value_range_constraint(1, 4294967295))) if mibBuilder.loadTexts: nhrpClientRegIndex.setStatus('current') nhrp_client_reg_uniqueness = mib_table_column((1, 3, 6, 1, 2, 1, 71, 1, 2, 2, 1, 2), integer32().subtype(subtypeSpec=constraints_union(single_value_constraint(1, 2))).clone(namedValues=named_values(('requestUnique', 1), ('requestNotUnique', 2)))).setMaxAccess('readcreate') if mibBuilder.loadTexts: nhrpClientRegUniqueness.setStatus('current') nhrp_client_reg_state = mib_table_column((1, 3, 6, 1, 2, 1, 71, 1, 2, 2, 1, 3), integer32().subtype(subtypeSpec=constraints_union(single_value_constraint(1, 2, 3, 4))).clone(namedValues=named_values(('other', 1), ('registering', 2), ('ackRegisterReply', 3), ('nakRegisterReply', 4)))).setMaxAccess('readonly') if mibBuilder.loadTexts: nhrpClientRegState.setStatus('current') nhrp_client_reg_row_status = mib_table_column((1, 3, 6, 1, 2, 1, 71, 1, 2, 2, 1, 4), row_status()).setMaxAccess('readcreate') if mibBuilder.loadTexts: nhrpClientRegRowStatus.setStatus('current') nhrp_client_nhs_table = mib_table((1, 3, 6, 1, 2, 1, 71, 1, 2, 3)) if mibBuilder.loadTexts: nhrpClientNhsTable.setStatus('current') nhrp_client_nhs_entry = mib_table_row((1, 3, 6, 1, 2, 1, 71, 1, 2, 3, 1)).setIndexNames((0, 'NHRP-MIB', 'nhrpClientIndex'), (0, 'NHRP-MIB', 'nhrpClientNhsIndex')) if mibBuilder.loadTexts: nhrpClientNhsEntry.setStatus('current') nhrp_client_nhs_index = mib_table_column((1, 3, 6, 1, 2, 1, 71, 1, 2, 3, 1, 1), unsigned32().subtype(subtypeSpec=value_range_constraint(1, 4294967295))) if mibBuilder.loadTexts: nhrpClientNhsIndex.setStatus('current') nhrp_client_nhs_internetwork_addr_type = mib_table_column((1, 3, 6, 1, 2, 1, 71, 1, 2, 3, 1, 2), address_family_numbers()).setMaxAccess('readcreate') if mibBuilder.loadTexts: nhrpClientNhsInternetworkAddrType.setStatus('current') nhrp_client_nhs_internetwork_addr = mib_table_column((1, 3, 6, 1, 2, 1, 71, 1, 2, 3, 1, 3), nhrp_gen_addr()).setMaxAccess('readcreate') if mibBuilder.loadTexts: nhrpClientNhsInternetworkAddr.setStatus('current') nhrp_client_nhs_nbma_addr_type = mib_table_column((1, 3, 6, 1, 2, 1, 71, 1, 2, 3, 1, 4), address_family_numbers()).setMaxAccess('readcreate') if mibBuilder.loadTexts: nhrpClientNhsNbmaAddrType.setStatus('current') nhrp_client_nhs_nbma_addr = mib_table_column((1, 3, 6, 1, 2, 1, 71, 1, 2, 3, 1, 5), nhrp_gen_addr()).setMaxAccess('readcreate') if mibBuilder.loadTexts: nhrpClientNhsNbmaAddr.setStatus('current') nhrp_client_nhs_nbma_subaddr = mib_table_column((1, 3, 6, 1, 2, 1, 71, 1, 2, 3, 1, 6), nhrp_gen_addr()).setMaxAccess('readcreate') if mibBuilder.loadTexts: nhrpClientNhsNbmaSubaddr.setStatus('current') nhrp_client_nhs_in_use = mib_table_column((1, 3, 6, 1, 2, 1, 71, 1, 2, 3, 1, 7), truth_value()).setMaxAccess('readonly') if mibBuilder.loadTexts: nhrpClientNhsInUse.setStatus('current') nhrp_client_nhs_row_status = mib_table_column((1, 3, 6, 1, 2, 1, 71, 1, 2, 3, 1, 8), row_status()).setMaxAccess('readcreate') if mibBuilder.loadTexts: nhrpClientNhsRowStatus.setStatus('current') nhrp_client_stat_table = mib_table((1, 3, 6, 1, 2, 1, 71, 1, 2, 4)) if mibBuilder.loadTexts: nhrpClientStatTable.setStatus('current') nhrp_client_stat_entry = mib_table_row((1, 3, 6, 1, 2, 1, 71, 1, 2, 4, 1)).setIndexNames((0, 'NHRP-MIB', 'nhrpClientIndex')) if mibBuilder.loadTexts: nhrpClientStatEntry.setStatus('current') nhrp_client_stat_tx_resolve_req = mib_table_column((1, 3, 6, 1, 2, 1, 71, 1, 2, 4, 1, 1), counter32()).setMaxAccess('readonly') if mibBuilder.loadTexts: nhrpClientStatTxResolveReq.setStatus('current') nhrp_client_stat_rx_resolve_reply_ack = mib_table_column((1, 3, 6, 1, 2, 1, 71, 1, 2, 4, 1, 2), counter32()).setMaxAccess('readonly') if mibBuilder.loadTexts: nhrpClientStatRxResolveReplyAck.setStatus('current') nhrp_client_stat_rx_resolve_reply_nak_prohibited = mib_table_column((1, 3, 6, 1, 2, 1, 71, 1, 2, 4, 1, 3), counter32()).setMaxAccess('readonly') if mibBuilder.loadTexts: nhrpClientStatRxResolveReplyNakProhibited.setStatus('current') nhrp_client_stat_rx_resolve_reply_nak_insuf_resources = mib_table_column((1, 3, 6, 1, 2, 1, 71, 1, 2, 4, 1, 4), counter32()).setMaxAccess('readonly') if mibBuilder.loadTexts: nhrpClientStatRxResolveReplyNakInsufResources.setStatus('current') nhrp_client_stat_rx_resolve_reply_nak_no_binding = mib_table_column((1, 3, 6, 1, 2, 1, 71, 1, 2, 4, 1, 5), counter32()).setMaxAccess('readonly') if mibBuilder.loadTexts: nhrpClientStatRxResolveReplyNakNoBinding.setStatus('current') nhrp_client_stat_rx_resolve_reply_nak_not_unique = mib_table_column((1, 3, 6, 1, 2, 1, 71, 1, 2, 4, 1, 6), counter32()).setMaxAccess('readonly') if mibBuilder.loadTexts: nhrpClientStatRxResolveReplyNakNotUnique.setStatus('current') nhrp_client_stat_tx_register_req = mib_table_column((1, 3, 6, 1, 2, 1, 71, 1, 2, 4, 1, 7), counter32()).setMaxAccess('readonly') if mibBuilder.loadTexts: nhrpClientStatTxRegisterReq.setStatus('current') nhrp_client_stat_rx_register_ack = mib_table_column((1, 3, 6, 1, 2, 1, 71, 1, 2, 4, 1, 8), counter32()).setMaxAccess('readonly') if mibBuilder.loadTexts: nhrpClientStatRxRegisterAck.setStatus('current') nhrp_client_stat_rx_register_nak_prohibited = mib_table_column((1, 3, 6, 1, 2, 1, 71, 1, 2, 4, 1, 9), counter32()).setMaxAccess('readonly') if mibBuilder.loadTexts: nhrpClientStatRxRegisterNakProhibited.setStatus('current') nhrp_client_stat_rx_register_nak_insuf_resources = mib_table_column((1, 3, 6, 1, 2, 1, 71, 1, 2, 4, 1, 10), counter32()).setMaxAccess('readonly') if mibBuilder.loadTexts: nhrpClientStatRxRegisterNakInsufResources.setStatus('current') nhrp_client_stat_rx_register_nak_already_reg = mib_table_column((1, 3, 6, 1, 2, 1, 71, 1, 2, 4, 1, 11), counter32()).setMaxAccess('readonly') if mibBuilder.loadTexts: nhrpClientStatRxRegisterNakAlreadyReg.setStatus('current') nhrp_client_stat_rx_purge_req = mib_table_column((1, 3, 6, 1, 2, 1, 71, 1, 2, 4, 1, 12), counter32()).setMaxAccess('readonly') if mibBuilder.loadTexts: nhrpClientStatRxPurgeReq.setStatus('current') nhrp_client_stat_tx_purge_req = mib_table_column((1, 3, 6, 1, 2, 1, 71, 1, 2, 4, 1, 13), counter32()).setMaxAccess('readonly') if mibBuilder.loadTexts: nhrpClientStatTxPurgeReq.setStatus('current') nhrp_client_stat_rx_purge_reply = mib_table_column((1, 3, 6, 1, 2, 1, 71, 1, 2, 4, 1, 14), counter32()).setMaxAccess('readonly') if mibBuilder.loadTexts: nhrpClientStatRxPurgeReply.setStatus('current') nhrp_client_stat_tx_purge_reply = mib_table_column((1, 3, 6, 1, 2, 1, 71, 1, 2, 4, 1, 15), counter32()).setMaxAccess('readonly') if mibBuilder.loadTexts: nhrpClientStatTxPurgeReply.setStatus('current') nhrp_client_stat_tx_error_indication = mib_table_column((1, 3, 6, 1, 2, 1, 71, 1, 2, 4, 1, 16), counter32()).setMaxAccess('readonly') if mibBuilder.loadTexts: nhrpClientStatTxErrorIndication.setStatus('current') nhrp_client_stat_rx_err_unrecognized_extension = mib_table_column((1, 3, 6, 1, 2, 1, 71, 1, 2, 4, 1, 17), counter32()).setMaxAccess('readonly') if mibBuilder.loadTexts: nhrpClientStatRxErrUnrecognizedExtension.setStatus('current') nhrp_client_stat_rx_err_loop_detected = mib_table_column((1, 3, 6, 1, 2, 1, 71, 1, 2, 4, 1, 18), counter32()).setMaxAccess('readonly') if mibBuilder.loadTexts: nhrpClientStatRxErrLoopDetected.setStatus('current') nhrp_client_stat_rx_err_proto_addr_unreachable = mib_table_column((1, 3, 6, 1, 2, 1, 71, 1, 2, 4, 1, 19), counter32()).setMaxAccess('readonly') if mibBuilder.loadTexts: nhrpClientStatRxErrProtoAddrUnreachable.setStatus('current') nhrp_client_stat_rx_err_proto_error = mib_table_column((1, 3, 6, 1, 2, 1, 71, 1, 2, 4, 1, 20), counter32()).setMaxAccess('readonly') if mibBuilder.loadTexts: nhrpClientStatRxErrProtoError.setStatus('current') nhrp_client_stat_rx_err_sdu_size_exceeded = mib_table_column((1, 3, 6, 1, 2, 1, 71, 1, 2, 4, 1, 21), counter32()).setMaxAccess('readonly') if mibBuilder.loadTexts: nhrpClientStatRxErrSduSizeExceeded.setStatus('current') nhrp_client_stat_rx_err_invalid_extension = mib_table_column((1, 3, 6, 1, 2, 1, 71, 1, 2, 4, 1, 22), counter32()).setMaxAccess('readonly') if mibBuilder.loadTexts: nhrpClientStatRxErrInvalidExtension.setStatus('current') nhrp_client_stat_rx_err_authentication_failure = mib_table_column((1, 3, 6, 1, 2, 1, 71, 1, 2, 4, 1, 23), counter32()).setMaxAccess('readonly') if mibBuilder.loadTexts: nhrpClientStatRxErrAuthenticationFailure.setStatus('current') nhrp_client_stat_rx_err_hop_count_exceeded = mib_table_column((1, 3, 6, 1, 2, 1, 71, 1, 2, 4, 1, 24), counter32()).setMaxAccess('readonly') if mibBuilder.loadTexts: nhrpClientStatRxErrHopCountExceeded.setStatus('current') nhrp_client_stat_discontinuity_time = mib_table_column((1, 3, 6, 1, 2, 1, 71, 1, 2, 4, 1, 25), time_stamp()).setMaxAccess('readonly') if mibBuilder.loadTexts: nhrpClientStatDiscontinuityTime.setStatus('current') nhrp_server_objects = mib_identifier((1, 3, 6, 1, 2, 1, 71, 1, 3)) nhrp_server_table = mib_table((1, 3, 6, 1, 2, 1, 71, 1, 3, 1)) if mibBuilder.loadTexts: nhrpServerTable.setStatus('current') nhrp_server_entry = mib_table_row((1, 3, 6, 1, 2, 1, 71, 1, 3, 1, 1)).setIndexNames((0, 'NHRP-MIB', 'nhrpServerIndex')) if mibBuilder.loadTexts: nhrpServerEntry.setStatus('current') nhrp_server_index = mib_table_column((1, 3, 6, 1, 2, 1, 71, 1, 3, 1, 1, 1), unsigned32().subtype(subtypeSpec=value_range_constraint(1, 4294967295))) if mibBuilder.loadTexts: nhrpServerIndex.setStatus('current') nhrp_server_internetwork_addr_type = mib_table_column((1, 3, 6, 1, 2, 1, 71, 1, 3, 1, 1, 2), address_family_numbers()).setMaxAccess('readcreate') if mibBuilder.loadTexts: nhrpServerInternetworkAddrType.setStatus('current') nhrp_server_internetwork_addr = mib_table_column((1, 3, 6, 1, 2, 1, 71, 1, 3, 1, 1, 3), nhrp_gen_addr()).setMaxAccess('readcreate') if mibBuilder.loadTexts: nhrpServerInternetworkAddr.setStatus('current') nhrp_server_nbma_addr_type = mib_table_column((1, 3, 6, 1, 2, 1, 71, 1, 3, 1, 1, 4), address_family_numbers()).setMaxAccess('readcreate') if mibBuilder.loadTexts: nhrpServerNbmaAddrType.setStatus('current') nhrp_server_nbma_addr = mib_table_column((1, 3, 6, 1, 2, 1, 71, 1, 3, 1, 1, 5), nhrp_gen_addr()).setMaxAccess('readcreate') if mibBuilder.loadTexts: nhrpServerNbmaAddr.setStatus('current') nhrp_server_nbma_subaddr = mib_table_column((1, 3, 6, 1, 2, 1, 71, 1, 3, 1, 1, 6), nhrp_gen_addr()).setMaxAccess('readcreate') if mibBuilder.loadTexts: nhrpServerNbmaSubaddr.setStatus('current') nhrp_server_storage_type = mib_table_column((1, 3, 6, 1, 2, 1, 71, 1, 3, 1, 1, 7), storage_type().clone('nonVolatile')).setMaxAccess('readcreate') if mibBuilder.loadTexts: nhrpServerStorageType.setStatus('current') nhrp_server_row_status = mib_table_column((1, 3, 6, 1, 2, 1, 71, 1, 3, 1, 1, 8), row_status()).setMaxAccess('readcreate') if mibBuilder.loadTexts: nhrpServerRowStatus.setStatus('current') nhrp_server_cache_table = mib_table((1, 3, 6, 1, 2, 1, 71, 1, 3, 2)) if mibBuilder.loadTexts: nhrpServerCacheTable.setStatus('current') nhrp_server_cache_entry = mib_table_row((1, 3, 6, 1, 2, 1, 71, 1, 3, 2, 1)).setIndexNames((0, 'NHRP-MIB', 'nhrpCacheInternetworkAddrType'), (0, 'NHRP-MIB', 'nhrpCacheInternetworkAddr'), (0, 'IF-MIB', 'ifIndex'), (0, 'NHRP-MIB', 'nhrpCacheIndex')) if mibBuilder.loadTexts: nhrpServerCacheEntry.setStatus('current') nhrp_server_cache_authoritative = mib_table_column((1, 3, 6, 1, 2, 1, 71, 1, 3, 2, 1, 1), truth_value()).setMaxAccess('readonly') if mibBuilder.loadTexts: nhrpServerCacheAuthoritative.setStatus('current') nhrp_server_cache_uniqueness = mib_table_column((1, 3, 6, 1, 2, 1, 71, 1, 3, 2, 1, 2), truth_value()).setMaxAccess('readcreate') if mibBuilder.loadTexts: nhrpServerCacheUniqueness.setStatus('current') nhrp_server_nhc_table = mib_table((1, 3, 6, 1, 2, 1, 71, 1, 3, 3)) if mibBuilder.loadTexts: nhrpServerNhcTable.setStatus('current') nhrp_server_nhc_entry = mib_table_row((1, 3, 6, 1, 2, 1, 71, 1, 3, 3, 1)).setIndexNames((0, 'NHRP-MIB', 'nhrpServerIndex'), (0, 'NHRP-MIB', 'nhrpServerNhcIndex')) if mibBuilder.loadTexts: nhrpServerNhcEntry.setStatus('current') nhrp_server_nhc_index = mib_table_column((1, 3, 6, 1, 2, 1, 71, 1, 3, 3, 1, 1), unsigned32().subtype(subtypeSpec=value_range_constraint(1, 4294967295))) if mibBuilder.loadTexts: nhrpServerNhcIndex.setStatus('current') nhrp_server_nhc_prefix_length = mib_table_column((1, 3, 6, 1, 2, 1, 71, 1, 3, 3, 1, 2), integer32().subtype(subtypeSpec=value_range_constraint(0, 255))).setMaxAccess('readcreate') if mibBuilder.loadTexts: nhrpServerNhcPrefixLength.setStatus('current') nhrp_server_nhc_internetwork_addr_type = mib_table_column((1, 3, 6, 1, 2, 1, 71, 1, 3, 3, 1, 3), address_family_numbers()).setMaxAccess('readcreate') if mibBuilder.loadTexts: nhrpServerNhcInternetworkAddrType.setStatus('current') nhrp_server_nhc_internetwork_addr = mib_table_column((1, 3, 6, 1, 2, 1, 71, 1, 3, 3, 1, 4), nhrp_gen_addr()).setMaxAccess('readcreate') if mibBuilder.loadTexts: nhrpServerNhcInternetworkAddr.setStatus('current') nhrp_server_nhc_nbma_addr_type = mib_table_column((1, 3, 6, 1, 2, 1, 71, 1, 3, 3, 1, 5), address_family_numbers()).setMaxAccess('readcreate') if mibBuilder.loadTexts: nhrpServerNhcNbmaAddrType.setStatus('current') nhrp_server_nhc_nbma_addr = mib_table_column((1, 3, 6, 1, 2, 1, 71, 1, 3, 3, 1, 6), nhrp_gen_addr()).setMaxAccess('readcreate') if mibBuilder.loadTexts: nhrpServerNhcNbmaAddr.setStatus('current') nhrp_server_nhc_nbma_subaddr = mib_table_column((1, 3, 6, 1, 2, 1, 71, 1, 3, 3, 1, 7), nhrp_gen_addr()).setMaxAccess('readcreate') if mibBuilder.loadTexts: nhrpServerNhcNbmaSubaddr.setStatus('current') nhrp_server_nhc_in_use = mib_table_column((1, 3, 6, 1, 2, 1, 71, 1, 3, 3, 1, 8), truth_value()).setMaxAccess('readonly') if mibBuilder.loadTexts: nhrpServerNhcInUse.setStatus('current') nhrp_server_nhc_row_status = mib_table_column((1, 3, 6, 1, 2, 1, 71, 1, 3, 3, 1, 9), row_status()).setMaxAccess('readcreate') if mibBuilder.loadTexts: nhrpServerNhcRowStatus.setStatus('current') nhrp_server_stat_table = mib_table((1, 3, 6, 1, 2, 1, 71, 1, 3, 4)) if mibBuilder.loadTexts: nhrpServerStatTable.setStatus('current') nhrp_server_stat_entry = mib_table_row((1, 3, 6, 1, 2, 1, 71, 1, 3, 4, 1)).setIndexNames((0, 'NHRP-MIB', 'nhrpServerIndex')) if mibBuilder.loadTexts: nhrpServerStatEntry.setStatus('current') nhrp_server_stat_rx_resolve_req = mib_table_column((1, 3, 6, 1, 2, 1, 71, 1, 3, 4, 1, 1), counter32()).setMaxAccess('readonly') if mibBuilder.loadTexts: nhrpServerStatRxResolveReq.setStatus('current') nhrp_server_stat_tx_resolve_reply_ack = mib_table_column((1, 3, 6, 1, 2, 1, 71, 1, 3, 4, 1, 2), counter32()).setMaxAccess('readonly') if mibBuilder.loadTexts: nhrpServerStatTxResolveReplyAck.setStatus('current') nhrp_server_stat_tx_resolve_reply_nak_prohibited = mib_table_column((1, 3, 6, 1, 2, 1, 71, 1, 3, 4, 1, 3), counter32()).setMaxAccess('readonly') if mibBuilder.loadTexts: nhrpServerStatTxResolveReplyNakProhibited.setStatus('current') nhrp_server_stat_tx_resolve_reply_nak_insuf_resources = mib_table_column((1, 3, 6, 1, 2, 1, 71, 1, 3, 4, 1, 4), counter32()).setMaxAccess('readonly') if mibBuilder.loadTexts: nhrpServerStatTxResolveReplyNakInsufResources.setStatus('current') nhrp_server_stat_tx_resolve_reply_nak_no_binding = mib_table_column((1, 3, 6, 1, 2, 1, 71, 1, 3, 4, 1, 5), counter32()).setMaxAccess('readonly') if mibBuilder.loadTexts: nhrpServerStatTxResolveReplyNakNoBinding.setStatus('current') nhrp_server_stat_tx_resolve_reply_nak_not_unique = mib_table_column((1, 3, 6, 1, 2, 1, 71, 1, 3, 4, 1, 6), counter32()).setMaxAccess('readonly') if mibBuilder.loadTexts: nhrpServerStatTxResolveReplyNakNotUnique.setStatus('current') nhrp_server_stat_rx_register_req = mib_table_column((1, 3, 6, 1, 2, 1, 71, 1, 3, 4, 1, 7), counter32()).setMaxAccess('readonly') if mibBuilder.loadTexts: nhrpServerStatRxRegisterReq.setStatus('current') nhrp_server_stat_tx_register_ack = mib_table_column((1, 3, 6, 1, 2, 1, 71, 1, 3, 4, 1, 8), counter32()).setMaxAccess('readonly') if mibBuilder.loadTexts: nhrpServerStatTxRegisterAck.setStatus('current') nhrp_server_stat_tx_register_nak_prohibited = mib_table_column((1, 3, 6, 1, 2, 1, 71, 1, 3, 4, 1, 9), counter32()).setMaxAccess('readonly') if mibBuilder.loadTexts: nhrpServerStatTxRegisterNakProhibited.setStatus('current') nhrp_server_stat_tx_register_nak_insuf_resources = mib_table_column((1, 3, 6, 1, 2, 1, 71, 1, 3, 4, 1, 10), counter32()).setMaxAccess('readonly') if mibBuilder.loadTexts: nhrpServerStatTxRegisterNakInsufResources.setStatus('current') nhrp_server_stat_tx_register_nak_already_reg = mib_table_column((1, 3, 6, 1, 2, 1, 71, 1, 3, 4, 1, 11), counter32()).setMaxAccess('readonly') if mibBuilder.loadTexts: nhrpServerStatTxRegisterNakAlreadyReg.setStatus('current') nhrp_server_stat_rx_purge_req = mib_table_column((1, 3, 6, 1, 2, 1, 71, 1, 3, 4, 1, 12), counter32()).setMaxAccess('readonly') if mibBuilder.loadTexts: nhrpServerStatRxPurgeReq.setStatus('current') nhrp_server_stat_tx_purge_req = mib_table_column((1, 3, 6, 1, 2, 1, 71, 1, 3, 4, 1, 13), counter32()).setMaxAccess('readonly') if mibBuilder.loadTexts: nhrpServerStatTxPurgeReq.setStatus('current') nhrp_server_stat_rx_purge_reply = mib_table_column((1, 3, 6, 1, 2, 1, 71, 1, 3, 4, 1, 14), counter32()).setMaxAccess('readonly') if mibBuilder.loadTexts: nhrpServerStatRxPurgeReply.setStatus('current') nhrp_server_stat_tx_purge_reply = mib_table_column((1, 3, 6, 1, 2, 1, 71, 1, 3, 4, 1, 15), counter32()).setMaxAccess('readonly') if mibBuilder.loadTexts: nhrpServerStatTxPurgeReply.setStatus('current') nhrp_server_stat_rx_err_unrecognized_extension = mib_table_column((1, 3, 6, 1, 2, 1, 71, 1, 3, 4, 1, 16), counter32()).setMaxAccess('readonly') if mibBuilder.loadTexts: nhrpServerStatRxErrUnrecognizedExtension.setStatus('current') nhrp_server_stat_rx_err_loop_detected = mib_table_column((1, 3, 6, 1, 2, 1, 71, 1, 3, 4, 1, 17), counter32()).setMaxAccess('readonly') if mibBuilder.loadTexts: nhrpServerStatRxErrLoopDetected.setStatus('current') nhrp_server_stat_rx_err_proto_addr_unreachable = mib_table_column((1, 3, 6, 1, 2, 1, 71, 1, 3, 4, 1, 18), counter32()).setMaxAccess('readonly') if mibBuilder.loadTexts: nhrpServerStatRxErrProtoAddrUnreachable.setStatus('current') nhrp_server_stat_rx_err_proto_error = mib_table_column((1, 3, 6, 1, 2, 1, 71, 1, 3, 4, 1, 19), counter32()).setMaxAccess('readonly') if mibBuilder.loadTexts: nhrpServerStatRxErrProtoError.setStatus('current') nhrp_server_stat_rx_err_sdu_size_exceeded = mib_table_column((1, 3, 6, 1, 2, 1, 71, 1, 3, 4, 1, 20), counter32()).setMaxAccess('readonly') if mibBuilder.loadTexts: nhrpServerStatRxErrSduSizeExceeded.setStatus('current') nhrp_server_stat_rx_err_invalid_extension = mib_table_column((1, 3, 6, 1, 2, 1, 71, 1, 3, 4, 1, 21), counter32()).setMaxAccess('readonly') if mibBuilder.loadTexts: nhrpServerStatRxErrInvalidExtension.setStatus('current') nhrp_server_stat_rx_err_invalid_res_reply_received = mib_table_column((1, 3, 6, 1, 2, 1, 71, 1, 3, 4, 1, 22), counter32()).setMaxAccess('readonly') if mibBuilder.loadTexts: nhrpServerStatRxErrInvalidResReplyReceived.setStatus('current') nhrp_server_stat_rx_err_authentication_failure = mib_table_column((1, 3, 6, 1, 2, 1, 71, 1, 3, 4, 1, 23), counter32()).setMaxAccess('readonly') if mibBuilder.loadTexts: nhrpServerStatRxErrAuthenticationFailure.setStatus('current') nhrp_server_stat_rx_err_hop_count_exceeded = mib_table_column((1, 3, 6, 1, 2, 1, 71, 1, 3, 4, 1, 24), counter32()).setMaxAccess('readonly') if mibBuilder.loadTexts: nhrpServerStatRxErrHopCountExceeded.setStatus('current') nhrp_server_stat_tx_err_unrecognized_extension = mib_table_column((1, 3, 6, 1, 2, 1, 71, 1, 3, 4, 1, 25), counter32()).setMaxAccess('readonly') if mibBuilder.loadTexts: nhrpServerStatTxErrUnrecognizedExtension.setStatus('current') nhrp_server_stat_tx_err_loop_detected = mib_table_column((1, 3, 6, 1, 2, 1, 71, 1, 3, 4, 1, 26), counter32()).setMaxAccess('readonly') if mibBuilder.loadTexts: nhrpServerStatTxErrLoopDetected.setStatus('current') nhrp_server_stat_tx_err_proto_addr_unreachable = mib_table_column((1, 3, 6, 1, 2, 1, 71, 1, 3, 4, 1, 27), counter32()).setMaxAccess('readonly') if mibBuilder.loadTexts: nhrpServerStatTxErrProtoAddrUnreachable.setStatus('current') nhrp_server_stat_tx_err_proto_error = mib_table_column((1, 3, 6, 1, 2, 1, 71, 1, 3, 4, 1, 28), counter32()).setMaxAccess('readonly') if mibBuilder.loadTexts: nhrpServerStatTxErrProtoError.setStatus('current') nhrp_server_stat_tx_err_sdu_size_exceeded = mib_table_column((1, 3, 6, 1, 2, 1, 71, 1, 3, 4, 1, 29), counter32()).setMaxAccess('readonly') if mibBuilder.loadTexts: nhrpServerStatTxErrSduSizeExceeded.setStatus('current') nhrp_server_stat_tx_err_invalid_extension = mib_table_column((1, 3, 6, 1, 2, 1, 71, 1, 3, 4, 1, 30), counter32()).setMaxAccess('readonly') if mibBuilder.loadTexts: nhrpServerStatTxErrInvalidExtension.setStatus('current') nhrp_server_stat_tx_err_authentication_failure = mib_table_column((1, 3, 6, 1, 2, 1, 71, 1, 3, 4, 1, 31), counter32()).setMaxAccess('readonly') if mibBuilder.loadTexts: nhrpServerStatTxErrAuthenticationFailure.setStatus('current') nhrp_server_stat_tx_err_hop_count_exceeded = mib_table_column((1, 3, 6, 1, 2, 1, 71, 1, 3, 4, 1, 32), counter32()).setMaxAccess('readonly') if mibBuilder.loadTexts: nhrpServerStatTxErrHopCountExceeded.setStatus('current') nhrp_server_stat_fw_resolve_req = mib_table_column((1, 3, 6, 1, 2, 1, 71, 1, 3, 4, 1, 33), counter32()).setMaxAccess('readonly') if mibBuilder.loadTexts: nhrpServerStatFwResolveReq.setStatus('current') nhrp_server_stat_fw_resolve_reply = mib_table_column((1, 3, 6, 1, 2, 1, 71, 1, 3, 4, 1, 34), counter32()).setMaxAccess('readonly') if mibBuilder.loadTexts: nhrpServerStatFwResolveReply.setStatus('current') nhrp_server_stat_fw_register_req = mib_table_column((1, 3, 6, 1, 2, 1, 71, 1, 3, 4, 1, 35), counter32()).setMaxAccess('readonly') if mibBuilder.loadTexts: nhrpServerStatFwRegisterReq.setStatus('current') nhrp_server_stat_fw_register_reply = mib_table_column((1, 3, 6, 1, 2, 1, 71, 1, 3, 4, 1, 36), counter32()).setMaxAccess('readonly') if mibBuilder.loadTexts: nhrpServerStatFwRegisterReply.setStatus('current') nhrp_server_stat_fw_purge_req = mib_table_column((1, 3, 6, 1, 2, 1, 71, 1, 3, 4, 1, 37), counter32()).setMaxAccess('readonly') if mibBuilder.loadTexts: nhrpServerStatFwPurgeReq.setStatus('current') nhrp_server_stat_fw_purge_reply = mib_table_column((1, 3, 6, 1, 2, 1, 71, 1, 3, 4, 1, 38), counter32()).setMaxAccess('readonly') if mibBuilder.loadTexts: nhrpServerStatFwPurgeReply.setStatus('current') nhrp_server_stat_fw_error_indication = mib_table_column((1, 3, 6, 1, 2, 1, 71, 1, 3, 4, 1, 39), counter32()).setMaxAccess('readonly') if mibBuilder.loadTexts: nhrpServerStatFwErrorIndication.setStatus('current') nhrp_server_stat_discontinuity_time = mib_table_column((1, 3, 6, 1, 2, 1, 71, 1, 3, 4, 1, 40), time_stamp()).setMaxAccess('readonly') if mibBuilder.loadTexts: nhrpServerStatDiscontinuityTime.setStatus('current') nhrp_conformance = mib_identifier((1, 3, 6, 1, 2, 1, 71, 2)) nhrp_compliances = mib_identifier((1, 3, 6, 1, 2, 1, 71, 2, 1)) nhrp_groups = mib_identifier((1, 3, 6, 1, 2, 1, 71, 2, 2)) nhrp_module_compliance = module_compliance((1, 3, 6, 1, 2, 1, 71, 2, 1, 1)).setObjects(('NHRP-MIB', 'nhrpGeneralGroup'), ('NHRP-MIB', 'nhrpClientGroup'), ('NHRP-MIB', 'nhrpServerGroup')) if getattr(mibBuilder, 'version', (0, 0, 0)) > (4, 4, 0): nhrp_module_compliance = nhrpModuleCompliance.setStatus('current') nhrp_general_group = object_group((1, 3, 6, 1, 2, 1, 71, 2, 2, 1)).setObjects(('NHRP-MIB', 'nhrpNextIndex'), ('NHRP-MIB', 'nhrpCachePrefixLength'), ('NHRP-MIB', 'nhrpCacheNextHopInternetworkAddr'), ('NHRP-MIB', 'nhrpCacheNbmaAddrType'), ('NHRP-MIB', 'nhrpCacheNbmaAddr'), ('NHRP-MIB', 'nhrpCacheNbmaSubaddr'), ('NHRP-MIB', 'nhrpCacheType'), ('NHRP-MIB', 'nhrpCacheState'), ('NHRP-MIB', 'nhrpCacheHoldingTimeValid'), ('NHRP-MIB', 'nhrpCacheHoldingTime'), ('NHRP-MIB', 'nhrpCacheNegotiatedMtu'), ('NHRP-MIB', 'nhrpCachePreference'), ('NHRP-MIB', 'nhrpCacheStorageType'), ('NHRP-MIB', 'nhrpCacheRowStatus'), ('NHRP-MIB', 'nhrpPurgeCacheIdentifier'), ('NHRP-MIB', 'nhrpPurgePrefixLength'), ('NHRP-MIB', 'nhrpPurgeRequestID'), ('NHRP-MIB', 'nhrpPurgeReplyExpected'), ('NHRP-MIB', 'nhrpPurgeRowStatus')) if getattr(mibBuilder, 'version', (0, 0, 0)) > (4, 4, 0): nhrp_general_group = nhrpGeneralGroup.setStatus('current') nhrp_client_group = object_group((1, 3, 6, 1, 2, 1, 71, 2, 2, 2)).setObjects(('NHRP-MIB', 'nhrpClientInternetworkAddrType'), ('NHRP-MIB', 'nhrpClientInternetworkAddr'), ('NHRP-MIB', 'nhrpClientNbmaAddrType'), ('NHRP-MIB', 'nhrpClientNbmaAddr'), ('NHRP-MIB', 'nhrpClientNbmaSubaddr'), ('NHRP-MIB', 'nhrpClientInitialRequestTimeout'), ('NHRP-MIB', 'nhrpClientRegistrationRequestRetries'), ('NHRP-MIB', 'nhrpClientResolutionRequestRetries'), ('NHRP-MIB', 'nhrpClientPurgeRequestRetries'), ('NHRP-MIB', 'nhrpClientDefaultMtu'), ('NHRP-MIB', 'nhrpClientHoldTime'), ('NHRP-MIB', 'nhrpClientRequestID'), ('NHRP-MIB', 'nhrpClientStorageType'), ('NHRP-MIB', 'nhrpClientRowStatus'), ('NHRP-MIB', 'nhrpClientRegUniqueness'), ('NHRP-MIB', 'nhrpClientRegState'), ('NHRP-MIB', 'nhrpClientRegRowStatus'), ('NHRP-MIB', 'nhrpClientNhsInternetworkAddrType'), ('NHRP-MIB', 'nhrpClientNhsInternetworkAddr'), ('NHRP-MIB', 'nhrpClientNhsNbmaAddrType'), ('NHRP-MIB', 'nhrpClientNhsNbmaAddr'), ('NHRP-MIB', 'nhrpClientNhsNbmaSubaddr'), ('NHRP-MIB', 'nhrpClientNhsInUse'), ('NHRP-MIB', 'nhrpClientNhsRowStatus'), ('NHRP-MIB', 'nhrpClientStatTxResolveReq'), ('NHRP-MIB', 'nhrpClientStatRxResolveReplyAck'), ('NHRP-MIB', 'nhrpClientStatRxResolveReplyNakProhibited'), ('NHRP-MIB', 'nhrpClientStatRxResolveReplyNakInsufResources'), ('NHRP-MIB', 'nhrpClientStatRxResolveReplyNakNoBinding'), ('NHRP-MIB', 'nhrpClientStatRxResolveReplyNakNotUnique'), ('NHRP-MIB', 'nhrpClientStatTxRegisterReq'), ('NHRP-MIB', 'nhrpClientStatRxRegisterAck'), ('NHRP-MIB', 'nhrpClientStatRxRegisterNakProhibited'), ('NHRP-MIB', 'nhrpClientStatRxRegisterNakInsufResources'), ('NHRP-MIB', 'nhrpClientStatRxRegisterNakAlreadyReg'), ('NHRP-MIB', 'nhrpClientStatRxPurgeReq'), ('NHRP-MIB', 'nhrpClientStatTxPurgeReq'), ('NHRP-MIB', 'nhrpClientStatRxPurgeReply'), ('NHRP-MIB', 'nhrpClientStatTxPurgeReply'), ('NHRP-MIB', 'nhrpClientStatTxErrorIndication'), ('NHRP-MIB', 'nhrpClientStatRxErrUnrecognizedExtension'), ('NHRP-MIB', 'nhrpClientStatRxErrLoopDetected'), ('NHRP-MIB', 'nhrpClientStatRxErrProtoAddrUnreachable'), ('NHRP-MIB', 'nhrpClientStatRxErrProtoError'), ('NHRP-MIB', 'nhrpClientStatRxErrSduSizeExceeded'), ('NHRP-MIB', 'nhrpClientStatRxErrInvalidExtension'), ('NHRP-MIB', 'nhrpClientStatRxErrAuthenticationFailure'), ('NHRP-MIB', 'nhrpClientStatRxErrHopCountExceeded'), ('NHRP-MIB', 'nhrpClientStatDiscontinuityTime')) if getattr(mibBuilder, 'version', (0, 0, 0)) > (4, 4, 0): nhrp_client_group = nhrpClientGroup.setStatus('current') nhrp_server_group = object_group((1, 3, 6, 1, 2, 1, 71, 2, 2, 3)).setObjects(('NHRP-MIB', 'nhrpServerInternetworkAddrType'), ('NHRP-MIB', 'nhrpServerInternetworkAddr'), ('NHRP-MIB', 'nhrpServerNbmaAddrType'), ('NHRP-MIB', 'nhrpServerNbmaAddr'), ('NHRP-MIB', 'nhrpServerNbmaSubaddr'), ('NHRP-MIB', 'nhrpServerStorageType'), ('NHRP-MIB', 'nhrpServerRowStatus'), ('NHRP-MIB', 'nhrpServerCacheAuthoritative'), ('NHRP-MIB', 'nhrpServerCacheUniqueness'), ('NHRP-MIB', 'nhrpServerNhcPrefixLength'), ('NHRP-MIB', 'nhrpServerNhcInternetworkAddrType'), ('NHRP-MIB', 'nhrpServerNhcInternetworkAddr'), ('NHRP-MIB', 'nhrpServerNhcNbmaAddrType'), ('NHRP-MIB', 'nhrpServerNhcNbmaAddr'), ('NHRP-MIB', 'nhrpServerNhcNbmaSubaddr'), ('NHRP-MIB', 'nhrpServerNhcInUse'), ('NHRP-MIB', 'nhrpServerNhcRowStatus'), ('NHRP-MIB', 'nhrpServerStatRxResolveReq'), ('NHRP-MIB', 'nhrpServerStatTxResolveReplyAck'), ('NHRP-MIB', 'nhrpServerStatTxResolveReplyNakProhibited'), ('NHRP-MIB', 'nhrpServerStatTxResolveReplyNakInsufResources'), ('NHRP-MIB', 'nhrpServerStatTxResolveReplyNakNoBinding'), ('NHRP-MIB', 'nhrpServerStatTxResolveReplyNakNotUnique'), ('NHRP-MIB', 'nhrpServerStatRxRegisterReq'), ('NHRP-MIB', 'nhrpServerStatTxRegisterAck'), ('NHRP-MIB', 'nhrpServerStatTxRegisterNakProhibited'), ('NHRP-MIB', 'nhrpServerStatTxRegisterNakInsufResources'), ('NHRP-MIB', 'nhrpServerStatTxRegisterNakAlreadyReg'), ('NHRP-MIB', 'nhrpServerStatRxPurgeReq'), ('NHRP-MIB', 'nhrpServerStatTxPurgeReq'), ('NHRP-MIB', 'nhrpServerStatRxPurgeReply'), ('NHRP-MIB', 'nhrpServerStatTxPurgeReply'), ('NHRP-MIB', 'nhrpServerStatRxErrUnrecognizedExtension'), ('NHRP-MIB', 'nhrpServerStatRxErrLoopDetected'), ('NHRP-MIB', 'nhrpServerStatRxErrProtoAddrUnreachable'), ('NHRP-MIB', 'nhrpServerStatRxErrProtoError'), ('NHRP-MIB', 'nhrpServerStatRxErrSduSizeExceeded'), ('NHRP-MIB', 'nhrpServerStatRxErrInvalidExtension'), ('NHRP-MIB', 'nhrpServerStatRxErrInvalidResReplyReceived'), ('NHRP-MIB', 'nhrpServerStatRxErrAuthenticationFailure'), ('NHRP-MIB', 'nhrpServerStatRxErrHopCountExceeded'), ('NHRP-MIB', 'nhrpServerStatTxErrUnrecognizedExtension'), ('NHRP-MIB', 'nhrpServerStatTxErrLoopDetected'), ('NHRP-MIB', 'nhrpServerStatTxErrProtoAddrUnreachable'), ('NHRP-MIB', 'nhrpServerStatTxErrProtoError'), ('NHRP-MIB', 'nhrpServerStatTxErrSduSizeExceeded'), ('NHRP-MIB', 'nhrpServerStatTxErrInvalidExtension'), ('NHRP-MIB', 'nhrpServerStatTxErrAuthenticationFailure'), ('NHRP-MIB', 'nhrpServerStatTxErrHopCountExceeded'), ('NHRP-MIB', 'nhrpServerStatFwResolveReq'), ('NHRP-MIB', 'nhrpServerStatFwResolveReply'), ('NHRP-MIB', 'nhrpServerStatFwRegisterReq'), ('NHRP-MIB', 'nhrpServerStatFwRegisterReply'), ('NHRP-MIB', 'nhrpServerStatFwPurgeReq'), ('NHRP-MIB', 'nhrpServerStatFwPurgeReply'), ('NHRP-MIB', 'nhrpServerStatFwErrorIndication'), ('NHRP-MIB', 'nhrpServerStatDiscontinuityTime')) if getattr(mibBuilder, 'version', (0, 0, 0)) > (4, 4, 0): nhrp_server_group = nhrpServerGroup.setStatus('current') mibBuilder.exportSymbols('NHRP-MIB', nhrpClientStatTxErrorIndication=nhrpClientStatTxErrorIndication, nhrpClientStatRxResolveReplyNakNoBinding=nhrpClientStatRxResolveReplyNakNoBinding, nhrpClientStatRxResolveReplyAck=nhrpClientStatRxResolveReplyAck, nhrpCacheNbmaSubaddr=nhrpCacheNbmaSubaddr, nhrpPurgeCacheIdentifier=nhrpPurgeCacheIdentifier, nhrpClientPurgeRequestRetries=nhrpClientPurgeRequestRetries, nhrpServerStatTxResolveReplyAck=nhrpServerStatTxResolveReplyAck, nhrpServerStatTxPurgeReply=nhrpServerStatTxPurgeReply, nhrpServerStatFwResolveReq=nhrpServerStatFwResolveReq, nhrpCacheInternetworkAddrType=nhrpCacheInternetworkAddrType, nhrpClientNhsEntry=nhrpClientNhsEntry, nhrpServerObjects=nhrpServerObjects, nhrpServerStatFwErrorIndication=nhrpServerStatFwErrorIndication, nhrpGeneralObjects=nhrpGeneralObjects, nhrpServerStorageType=nhrpServerStorageType, nhrpClientStatRxErrInvalidExtension=nhrpClientStatRxErrInvalidExtension, nhrpClientRegUniqueness=nhrpClientRegUniqueness, nhrpClientStatRxErrUnrecognizedExtension=nhrpClientStatRxErrUnrecognizedExtension, nhrpCacheInternetworkAddr=nhrpCacheInternetworkAddr, nhrpServerStatFwPurgeReply=nhrpServerStatFwPurgeReply, nhrpCacheNextHopInternetworkAddr=nhrpCacheNextHopInternetworkAddr, nhrpClientInternetworkAddr=nhrpClientInternetworkAddr, nhrpServerStatRxRegisterReq=nhrpServerStatRxRegisterReq, nhrpCacheTable=nhrpCacheTable, nhrpServerStatDiscontinuityTime=nhrpServerStatDiscontinuityTime, nhrpServerStatEntry=nhrpServerStatEntry, nhrpServerStatTxRegisterNakAlreadyReg=nhrpServerStatTxRegisterNakAlreadyReg, nhrpPurgeIndex=nhrpPurgeIndex, nhrpClientStatRxPurgeReq=nhrpClientStatRxPurgeReq, nhrpServerNbmaAddr=nhrpServerNbmaAddr, nhrpClientNhsIndex=nhrpClientNhsIndex, nhrpServerNhcIndex=nhrpServerNhcIndex, nhrpServerStatRxPurgeReply=nhrpServerStatRxPurgeReply, nhrpServerNbmaSubaddr=nhrpServerNbmaSubaddr, nhrpClientStatRxResolveReplyNakNotUnique=nhrpClientStatRxResolveReplyNakNotUnique, nhrpServerStatFwPurgeReq=nhrpServerStatFwPurgeReq, nhrpConformance=nhrpConformance, nhrpNextIndex=nhrpNextIndex, nhrpClientNhsNbmaSubaddr=nhrpClientNhsNbmaSubaddr, nhrpServerNhcTable=nhrpServerNhcTable, nhrpServerStatTxResolveReplyNakNotUnique=nhrpServerStatTxResolveReplyNakNotUnique, nhrpClientRegState=nhrpClientRegState, nhrpClientResolutionRequestRetries=nhrpClientResolutionRequestRetries, nhrpCacheState=nhrpCacheState, nhrpClientStatRxResolveReplyNakInsufResources=nhrpClientStatRxResolveReplyNakInsufResources, nhrpServerStatRxErrInvalidExtension=nhrpServerStatRxErrInvalidExtension, nhrpServerStatRxErrHopCountExceeded=nhrpServerStatRxErrHopCountExceeded, nhrpServerStatFwResolveReply=nhrpServerStatFwResolveReply, nhrpCacheStorageType=nhrpCacheStorageType, PYSNMP_MODULE_ID=nhrpMIB, nhrpCacheHoldingTime=nhrpCacheHoldingTime, nhrpClientStatRxRegisterAck=nhrpClientStatRxRegisterAck, nhrpClientStatTxResolveReq=nhrpClientStatTxResolveReq, nhrpServerNhcNbmaSubaddr=nhrpServerNhcNbmaSubaddr, nhrpServerStatFwRegisterReply=nhrpServerStatFwRegisterReply, nhrpServerTable=nhrpServerTable, nhrpServerCacheAuthoritative=nhrpServerCacheAuthoritative, nhrpServerStatTxRegisterAck=nhrpServerStatTxRegisterAck, nhrpClientNhsTable=nhrpClientNhsTable, nhrpMIB=nhrpMIB, nhrpClientStatRxErrSduSizeExceeded=nhrpClientStatRxErrSduSizeExceeded, nhrpServerStatTxErrProtoAddrUnreachable=nhrpServerStatTxErrProtoAddrUnreachable, nhrpClientStatDiscontinuityTime=nhrpClientStatDiscontinuityTime, nhrpServerStatTxErrHopCountExceeded=nhrpServerStatTxErrHopCountExceeded, nhrpClientTable=nhrpClientTable, nhrpServerInternetworkAddr=nhrpServerInternetworkAddr, nhrpClientStatRxErrProtoAddrUnreachable=nhrpClientStatRxErrProtoAddrUnreachable, nhrpServerRowStatus=nhrpServerRowStatus, nhrpServerStatTxResolveReplyNakProhibited=nhrpServerStatTxResolveReplyNakProhibited, nhrpServerStatTxResolveReplyNakNoBinding=nhrpServerStatTxResolveReplyNakNoBinding, nhrpCacheRowStatus=nhrpCacheRowStatus, nhrpServerStatRxErrAuthenticationFailure=nhrpServerStatRxErrAuthenticationFailure, nhrpClientNhsInternetworkAddr=nhrpClientNhsInternetworkAddr, nhrpClientInternetworkAddrType=nhrpClientInternetworkAddrType, nhrpServerNhcNbmaAddr=nhrpServerNhcNbmaAddr, nhrpServerStatTxErrLoopDetected=nhrpServerStatTxErrLoopDetected, nhrpServerEntry=nhrpServerEntry, nhrpClientRegistrationEntry=nhrpClientRegistrationEntry, nhrpClientNhsNbmaAddrType=nhrpClientNhsNbmaAddrType, nhrpServerStatRxErrProtoAddrUnreachable=nhrpServerStatRxErrProtoAddrUnreachable, nhrpServerIndex=nhrpServerIndex, nhrpServerStatRxErrInvalidResReplyReceived=nhrpServerStatRxErrInvalidResReplyReceived, nhrpClientNbmaSubaddr=nhrpClientNbmaSubaddr, nhrpClientNhsNbmaAddr=nhrpClientNhsNbmaAddr, NhrpGenAddr=NhrpGenAddr, nhrpClientStatTxPurgeReply=nhrpClientStatTxPurgeReply, nhrpClientStatTable=nhrpClientStatTable, nhrpServerStatRxErrSduSizeExceeded=nhrpServerStatRxErrSduSizeExceeded, nhrpClientRegRowStatus=nhrpClientRegRowStatus, nhrpClientRequestID=nhrpClientRequestID, nhrpServerCacheUniqueness=nhrpServerCacheUniqueness, nhrpClientStatRxErrLoopDetected=nhrpClientStatRxErrLoopDetected, nhrpClientStatRxRegisterNakInsufResources=nhrpClientStatRxRegisterNakInsufResources, nhrpServerStatRxPurgeReq=nhrpServerStatRxPurgeReq, nhrpServerStatRxErrLoopDetected=nhrpServerStatRxErrLoopDetected, nhrpCacheIndex=nhrpCacheIndex, nhrpPurgeRequestID=nhrpPurgeRequestID, nhrpServerStatTxErrProtoError=nhrpServerStatTxErrProtoError, nhrpCompliances=nhrpCompliances, nhrpCacheNbmaAddrType=nhrpCacheNbmaAddrType, nhrpServerStatTxErrUnrecognizedExtension=nhrpServerStatTxErrUnrecognizedExtension, nhrpObjects=nhrpObjects, nhrpClientStatRxRegisterNakAlreadyReg=nhrpClientStatRxRegisterNakAlreadyReg, nhrpClientStatRxRegisterNakProhibited=nhrpClientStatRxRegisterNakProhibited, nhrpClientNbmaAddrType=nhrpClientNbmaAddrType, nhrpServerStatTxRegisterNakProhibited=nhrpServerStatTxRegisterNakProhibited, nhrpServerCacheTable=nhrpServerCacheTable, nhrpClientStatRxPurgeReply=nhrpClientStatRxPurgeReply, nhrpServerStatTxErrAuthenticationFailure=nhrpServerStatTxErrAuthenticationFailure, nhrpServerNhcInUse=nhrpServerNhcInUse, nhrpServerNhcNbmaAddrType=nhrpServerNhcNbmaAddrType, nhrpPurgeReqEntry=nhrpPurgeReqEntry, nhrpClientRegistrationRequestRetries=nhrpClientRegistrationRequestRetries, nhrpClientEntry=nhrpClientEntry, nhrpClientStatRxErrProtoError=nhrpClientStatRxErrProtoError, nhrpClientObjects=nhrpClientObjects, nhrpClientRowStatus=nhrpClientRowStatus, nhrpClientHoldTime=nhrpClientHoldTime, nhrpCacheType=nhrpCacheType, nhrpServerStatTxRegisterNakInsufResources=nhrpServerStatTxRegisterNakInsufResources, nhrpCacheEntry=nhrpCacheEntry, nhrpCachePreference=nhrpCachePreference, nhrpServerNhcInternetworkAddr=nhrpServerNhcInternetworkAddr, nhrpClientRegistrationTable=nhrpClientRegistrationTable, nhrpServerStatTxPurgeReq=nhrpServerStatTxPurgeReq, nhrpServerStatTxErrInvalidExtension=nhrpServerStatTxErrInvalidExtension, nhrpPurgeRowStatus=nhrpPurgeRowStatus, nhrpModuleCompliance=nhrpModuleCompliance, nhrpPurgePrefixLength=nhrpPurgePrefixLength, nhrpPurgeReqTable=nhrpPurgeReqTable, nhrpGeneralGroup=nhrpGeneralGroup, nhrpClientStatRxErrAuthenticationFailure=nhrpClientStatRxErrAuthenticationFailure, nhrpServerCacheEntry=nhrpServerCacheEntry, nhrpClientNbmaAddr=nhrpClientNbmaAddr, nhrpServerStatRxErrProtoError=nhrpServerStatRxErrProtoError, nhrpClientNhsInUse=nhrpClientNhsInUse, nhrpClientStatTxRegisterReq=nhrpClientStatTxRegisterReq, nhrpServerNhcEntry=nhrpServerNhcEntry, nhrpServerGroup=nhrpServerGroup, nhrpClientNhsInternetworkAddrType=nhrpClientNhsInternetworkAddrType, nhrpServerNhcPrefixLength=nhrpServerNhcPrefixLength, nhrpServerStatTxResolveReplyNakInsufResources=nhrpServerStatTxResolveReplyNakInsufResources, nhrpCachePrefixLength=nhrpCachePrefixLength, nhrpClientStatTxPurgeReq=nhrpClientStatTxPurgeReq, nhrpClientStorageType=nhrpClientStorageType, nhrpServerStatTable=nhrpServerStatTable, nhrpCacheNegotiatedMtu=nhrpCacheNegotiatedMtu, nhrpServerStatRxResolveReq=nhrpServerStatRxResolveReq, nhrpClientGroup=nhrpClientGroup, nhrpClientStatRxErrHopCountExceeded=nhrpClientStatRxErrHopCountExceeded, nhrpClientIndex=nhrpClientIndex, nhrpServerStatRxErrUnrecognizedExtension=nhrpServerStatRxErrUnrecognizedExtension, nhrpCacheNbmaAddr=nhrpCacheNbmaAddr, nhrpCacheHoldingTimeValid=nhrpCacheHoldingTimeValid, nhrpClientInitialRequestTimeout=nhrpClientInitialRequestTimeout, nhrpGroups=nhrpGroups, nhrpServerNhcInternetworkAddrType=nhrpServerNhcInternetworkAddrType, nhrpServerStatTxErrSduSizeExceeded=nhrpServerStatTxErrSduSizeExceeded, nhrpClientRegIndex=nhrpClientRegIndex, nhrpClientStatRxResolveReplyNakProhibited=nhrpClientStatRxResolveReplyNakProhibited, nhrpServerStatFwRegisterReq=nhrpServerStatFwRegisterReq, nhrpPurgeReplyExpected=nhrpPurgeReplyExpected, nhrpServerNhcRowStatus=nhrpServerNhcRowStatus, nhrpClientStatEntry=nhrpClientStatEntry, nhrpClientNhsRowStatus=nhrpClientNhsRowStatus, nhrpClientDefaultMtu=nhrpClientDefaultMtu, nhrpServerInternetworkAddrType=nhrpServerInternetworkAddrType, nhrpServerNbmaAddrType=nhrpServerNbmaAddrType)
env_name = 'BreakoutDeterministic-v4' input_shape = [84, 84, 4] output_size = 4 ''' env_name = 'SeaquestDeterministic-v4' input_shape = [84, 84, 4] output_size = 18 ''' ''' env_name = 'PongDeterministic-v4 input_shape = [84, 84, 4] output_size = 6 '''
env_name = 'BreakoutDeterministic-v4' input_shape = [84, 84, 4] output_size = 4 "\nenv_name = 'SeaquestDeterministic-v4'\ninput_shape = [84, 84, 4]\noutput_size = 18\n" "\nenv_name = 'PongDeterministic-v4\ninput_shape = [84, 84, 4]\noutput_size = 6\n"
# Leetcode 200. Number of Islands # # Link: https://leetcode.com/problems/number-of-islands/ # Difficulty: Medium # Solution using BFS and visited set. # Complexity: # O(M*N) time | where M and N represent the rows and cols of the input matrix # O(M*N) space | where M and N represent the rows and cols of the input matrix class Solution: def numIslands(self, grid: List[List[str]]) -> int: ROWS, COLS = len(grid), len(grid[0]) DIRECTIONS = ((0,1), (0,-1), (1,0), (-1,0)) count = 0 visited = set() def bfs(r, c): q = deque() q.append((r,c)) while q: r, c = q.popleft() for dr, dc in DIRECTIONS: newR, newC = r + dr, c + dc if (newR in range(ROWS) and newC in range(COLS) and (newR, newC) not in visited): visited.add((newR, newC)) if grid[newR][newC] == "1": q.append((newR, newC)) for r in range(ROWS): for c in range(COLS): if (r,c) not in visited and grid[r][c] == "1": count += 1 bfs(r, c) return count # Solution using DFS and changing grid values instead of visited set. # Complexity: # O(M*N) time | where M and N represent the rows and cols of the input matrix # O(1) space class Solution: def numIslands(self, grid: List[List[str]]) -> int: ROWS, COLS = len(grid), len(grid[0]) DIRECTIONS = ((0,1), (0,-1), (1,0), (-1,0)) count = 0 def dfs(r, c): stack = [(r, c)] while stack: r, c = stack.pop() grid[r][c] = '0' for dr, dc in DIRECTIONS: newR, newC = r + dr, c + dc if (newR in range(ROWS) and newC in range(COLS) and grid[newR][newC] == '1'): stack.append((newR, newC)) for r in range(ROWS): for c in range(COLS): if grid[r][c] == '1': dfs(r, c) count += 1 return count
class Solution: def num_islands(self, grid: List[List[str]]) -> int: (rows, cols) = (len(grid), len(grid[0])) directions = ((0, 1), (0, -1), (1, 0), (-1, 0)) count = 0 visited = set() def bfs(r, c): q = deque() q.append((r, c)) while q: (r, c) = q.popleft() for (dr, dc) in DIRECTIONS: (new_r, new_c) = (r + dr, c + dc) if newR in range(ROWS) and newC in range(COLS) and ((newR, newC) not in visited): visited.add((newR, newC)) if grid[newR][newC] == '1': q.append((newR, newC)) for r in range(ROWS): for c in range(COLS): if (r, c) not in visited and grid[r][c] == '1': count += 1 bfs(r, c) return count class Solution: def num_islands(self, grid: List[List[str]]) -> int: (rows, cols) = (len(grid), len(grid[0])) directions = ((0, 1), (0, -1), (1, 0), (-1, 0)) count = 0 def dfs(r, c): stack = [(r, c)] while stack: (r, c) = stack.pop() grid[r][c] = '0' for (dr, dc) in DIRECTIONS: (new_r, new_c) = (r + dr, c + dc) if newR in range(ROWS) and newC in range(COLS) and (grid[newR][newC] == '1'): stack.append((newR, newC)) for r in range(ROWS): for c in range(COLS): if grid[r][c] == '1': dfs(r, c) count += 1 return count
BUNDLES = [ #! if api: 'flask_unchained.bundles.api', #! endif #! if mail: 'flask_unchained.bundles.mail', #! endif #! if celery: 'flask_unchained.bundles.celery', # move before mail to send emails synchronously #! endif #! if oauth: 'flask_unchained.bundles.oauth', #! endif #! if security or oauth: 'flask_unchained.bundles.security', #! endif #! if security or session: 'flask_unchained.bundles.session', #! endif #! if security or sqlalchemy: 'flask_unchained.bundles.sqlalchemy', #! endif #! if webpack: 'flask_unchained.bundles.webpack', #! endif #! if any(set(requirements) - {'dev', 'docs'}): #! endif 'app', # your app bundle *must* be last ]
bundles = ['flask_unchained.bundles.api', 'flask_unchained.bundles.mail', 'flask_unchained.bundles.celery', 'flask_unchained.bundles.oauth', 'flask_unchained.bundles.security', 'flask_unchained.bundles.session', 'flask_unchained.bundles.sqlalchemy', 'flask_unchained.bundles.webpack', 'app']
class RequestFailedError(Exception): pass class DOIFormatIncorrect(Exception): pass
class Requestfailederror(Exception): pass class Doiformatincorrect(Exception): pass
N, M, P, Q = map(int, input().split()) result = (N // (M * (12 + Q))) * 12 N %= M * (12 + Q) if N <= M * (P - 1): result += (N + (M - 1)) // M else: result += P - 1 N -= M * (P - 1) if N <= 2 * M * Q: result += (N + (2 * M - 1)) // (2 * M) else: result += Q N -= 2 * M * Q result += (N + (M - 1)) // M print(result)
(n, m, p, q) = map(int, input().split()) result = N // (M * (12 + Q)) * 12 n %= M * (12 + Q) if N <= M * (P - 1): result += (N + (M - 1)) // M else: result += P - 1 n -= M * (P - 1) if N <= 2 * M * Q: result += (N + (2 * M - 1)) // (2 * M) else: result += Q n -= 2 * M * Q result += (N + (M - 1)) // M print(result)
# This is a line comment ''' This is a block comment ''' def main(): print("Hello world!\n"); main()
""" This is a block comment """ def main(): print('Hello world!\n') main()
# global progViewWidth ProgEntryFieldW=10 ProgButX=160 progViewWidth=60 stopProgButX=200 comportlabelx=270 comPortEntryFieldX=390 comPortEntryFieldw=12 comPortButx=495 calibration_entryjoinx=520 calibration_entrydhx=745 calibration_joinx=600 calibration_alphax=800 calibrate_buttoncol2x=210 tab1_instructionbuttonw=16 jogbuttonwidth=1 manualprogramentryx=650 manualprogramentryw=50
prog_entry_field_w = 10 prog_but_x = 160 prog_view_width = 60 stop_prog_but_x = 200 comportlabelx = 270 com_port_entry_field_x = 390 com_port_entry_fieldw = 12 com_port_butx = 495 calibration_entryjoinx = 520 calibration_entrydhx = 745 calibration_joinx = 600 calibration_alphax = 800 calibrate_buttoncol2x = 210 tab1_instructionbuttonw = 16 jogbuttonwidth = 1 manualprogramentryx = 650 manualprogramentryw = 50
######################################################################### # # # C R A N F I E L D U N I V E R S I T Y # # 2 0 1 9 / 2 0 2 0 # # # # MSc in Aerospace Computational Engineering # # # # Group Design Project # # # # Driver File for the OpenFoam Automated Tool Chain # # Flow Past Cylinder Test Case # # # #-----------------------------------------------------------------------# # # # Main Contributors: # # Vadim Maltsev (Email: [email protected]) # # Samali Liyanage (Email: [email protected]) # # Elias Farah (Email: [email protected]) # # Supervisor: # # Dr. Tom-Robin Teschner (Email: [email protected] ) # # # ######################################################################### class genCuttingPlaneFile: #fileName: name of the singleGraph file #planeName: name given to plane #point: the point given as a string in the form (x0 y0 z0) #normal: the normal given as a string in the form (x1 y1 z1) #fields: the fields taken for plotting given in the form (U p) def __init__(self, fileName, planeName, point, normal, fields): self.fileName = fileName self.planeName = planeName self.point = point self.normal = normal self.fields = fields def writeCuttingPlaneFile(self): cuttingPlaneFile = open("cuttingPlane"+str(self.fileName), "w") cuttingPlaneFile.write("/*--------------------------------*-C++-*------------------------------*\\") cuttingPlaneFile.write("\n| ========== | |") cuttingPlaneFile.write("\n| \\\\ / F ield | OpenFoam: The Open Source CFD Tooolbox |") cuttingPlaneFile.write("\n| \\\\ / O peration | Version: check the installation |") cuttingPlaneFile.write("\n| \\\\ / A nd | Website: www.openfoam.com |") cuttingPlaneFile.write("\n| \\\\/ M anipulation | |") cuttingPlaneFile.write("\n\\*---------------------------------------------------------------------*/") cuttingPlaneFile.write("\n\ncuttingPlane"+str(self.fileName)+"\n{") cuttingPlaneFile.write("\n type surfaces;") cuttingPlaneFile.write("\n libs (\"libsampling.so\");") cuttingPlaneFile.write("\n writeControl writeTime;") cuttingPlaneFile.write("\n surfaceFormat vtk;") cuttingPlaneFile.write("\n fields "+str(self.fields)+";") cuttingPlaneFile.write("\n interpolationScheme cellPoint;") cuttingPlaneFile.write("\n surfaces") cuttingPlaneFile.write("\n (") cuttingPlaneFile.write("\n "+str(self.planeName)) cuttingPlaneFile.write("\n {") cuttingPlaneFile.write("\n type cuttingPlane;") cuttingPlaneFile.write("\n planeType pointAndNormal;") cuttingPlaneFile.write("\n pointAndNormalDict") cuttingPlaneFile.write("\n {") cuttingPlaneFile.write("\n point "+str(self.point)+";") cuttingPlaneFile.write("\n normal "+str(self.normal)+";") cuttingPlaneFile.write("\n }") cuttingPlaneFile.write("\n interpolate true;") cuttingPlaneFile.write("\n }") cuttingPlaneFile.write("\n );") cuttingPlaneFile.write("\n}") cuttingPlaneFile.write("\n\n// ******************************************************************* //")
class Gencuttingplanefile: def __init__(self, fileName, planeName, point, normal, fields): self.fileName = fileName self.planeName = planeName self.point = point self.normal = normal self.fields = fields def write_cutting_plane_file(self): cutting_plane_file = open('cuttingPlane' + str(self.fileName), 'w') cuttingPlaneFile.write('/*--------------------------------*-C++-*------------------------------*\\') cuttingPlaneFile.write('\n| ========== | |') cuttingPlaneFile.write('\n| \\\\ / F ield | OpenFoam: The Open Source CFD Tooolbox |') cuttingPlaneFile.write('\n| \\\\ / O peration | Version: check the installation |') cuttingPlaneFile.write('\n| \\\\ / A nd | Website: www.openfoam.com |') cuttingPlaneFile.write('\n| \\\\/ M anipulation | |') cuttingPlaneFile.write('\n\\*---------------------------------------------------------------------*/') cuttingPlaneFile.write('\n\ncuttingPlane' + str(self.fileName) + '\n{') cuttingPlaneFile.write('\n\ttype\t\t\tsurfaces;') cuttingPlaneFile.write('\n\tlibs\t\t\t("libsampling.so");') cuttingPlaneFile.write('\n\twriteControl\t\twriteTime;') cuttingPlaneFile.write('\n\tsurfaceFormat\t\tvtk;') cuttingPlaneFile.write('\n\tfields\t\t\t' + str(self.fields) + ';') cuttingPlaneFile.write('\n\tinterpolationScheme\tcellPoint;') cuttingPlaneFile.write('\n\tsurfaces') cuttingPlaneFile.write('\n\t(') cuttingPlaneFile.write('\n\t\t' + str(self.planeName)) cuttingPlaneFile.write('\n\t\t{') cuttingPlaneFile.write('\n\t\t\ttype\t\tcuttingPlane;') cuttingPlaneFile.write('\n\t\t\tplaneType\tpointAndNormal;') cuttingPlaneFile.write('\n\t\t\tpointAndNormalDict') cuttingPlaneFile.write('\n\t\t\t{') cuttingPlaneFile.write('\n\t\t\t\tpoint\t' + str(self.point) + ';') cuttingPlaneFile.write('\n\t\t\t\tnormal\t' + str(self.normal) + ';') cuttingPlaneFile.write('\n\t\t\t}') cuttingPlaneFile.write('\n\t\t\tinterpolate\ttrue;') cuttingPlaneFile.write('\n\t\t}') cuttingPlaneFile.write('\n\t);') cuttingPlaneFile.write('\n}') cuttingPlaneFile.write('\n\n// ******************************************************************* //')
# Strings with apostrophes and new lines # If you want to include apostrophes in your string, # it's easiest to wrap it in double quotes. niceday = "It's a nice day!" print(niceday)
niceday = "It's a nice day!" print(niceday)
#encoding:utf-8 subreddit = 'chessmemes' t_channel = '@chessmemesenglish' def send_post(submission, r2t): return r2t.send_simple(submission)
subreddit = 'chessmemes' t_channel = '@chessmemesenglish' def send_post(submission, r2t): return r2t.send_simple(submission)
def decodeRules(string): rules = [] # Remove comments while string.find('%') != -1: subStringBeforeComment = string[:string.find('%')] subStringAfterComment = string[string.find('%'):] if subStringAfterComment.find('\n') != -1: string = subStringBeforeComment + subStringAfterComment[subStringAfterComment.find('\n')+1:] else: string = subStringBeforeComment # Remove whitespaces and endlines string = "".join(string.split()) # Split in single rules while len(string) > 0: rule = "" if string.startswith(':~'): rule = string[:string.find(']')+1] string = string[string.find(']')+1:] else: posToCut = -1 posQMark = string.find('?') posDot = string.find('.') if posQMark != -1 and posDot != -1: if posQMark < posDot: posToCut = posQMark else: posToCut = posDot elif posDot != -1: posToCut = posDot elif posQMark != -1: posToCut = posQMark else: posToCut = len(string)-1 rule = string[:posToCut+1] string = string[posToCut+1:] #print(rule) if len(rule) > 0: rules.append(rule) return sorted(rules) def checker(actualOutput, actualError): global output expectedRules = decodeRules(output) actualRules = decodeRules(actualOutput) #print(expectedRules) #print(actualRules) if expectedRules != actualRules: reportFailure(expectedRules, actualRules) else: reportSuccess(expectedRules, actualRules)
def decode_rules(string): rules = [] while string.find('%') != -1: sub_string_before_comment = string[:string.find('%')] sub_string_after_comment = string[string.find('%'):] if subStringAfterComment.find('\n') != -1: string = subStringBeforeComment + subStringAfterComment[subStringAfterComment.find('\n') + 1:] else: string = subStringBeforeComment string = ''.join(string.split()) while len(string) > 0: rule = '' if string.startswith(':~'): rule = string[:string.find(']') + 1] string = string[string.find(']') + 1:] else: pos_to_cut = -1 pos_q_mark = string.find('?') pos_dot = string.find('.') if posQMark != -1 and posDot != -1: if posQMark < posDot: pos_to_cut = posQMark else: pos_to_cut = posDot elif posDot != -1: pos_to_cut = posDot elif posQMark != -1: pos_to_cut = posQMark else: pos_to_cut = len(string) - 1 rule = string[:posToCut + 1] string = string[posToCut + 1:] if len(rule) > 0: rules.append(rule) return sorted(rules) def checker(actualOutput, actualError): global output expected_rules = decode_rules(output) actual_rules = decode_rules(actualOutput) if expectedRules != actualRules: report_failure(expectedRules, actualRules) else: report_success(expectedRules, actualRules)
APPLICATION_ID = "vvMc0yrmqU1kbU2nOieYTQGV0QzzfVQg4kHhQWWL" REST_API_KEY = "waZK2MtE4TMszpU0mYSbkB9VmgLdLxfYf8XCuN7D" MASTER_KEY = "YPyRj37OFlUjHmmpE8YY3pfbZs7FqnBngxX4tezk" TWILIO_SID = "AC5e947e28bfef48a9859c33fec7278ee8" TWILIO_AUTH_TOKEN = "02c707399042a867303928beb261e990"
application_id = 'vvMc0yrmqU1kbU2nOieYTQGV0QzzfVQg4kHhQWWL' rest_api_key = 'waZK2MtE4TMszpU0mYSbkB9VmgLdLxfYf8XCuN7D' master_key = 'YPyRj37OFlUjHmmpE8YY3pfbZs7FqnBngxX4tezk' twilio_sid = 'AC5e947e28bfef48a9859c33fec7278ee8' twilio_auth_token = '02c707399042a867303928beb261e990'
#Assume hot dogs come in packages of 10, and hot dog buns come in packages of 8. hotdogs_perpack = 10 hotdogs_bunsperpack = 8 #program should ask the user for the number of people attending the cookout and the number of hot dogs each person will be given. ppl_attending = int(input('Enter the number of people attending the cookout: ')) hotdogs_pp = int(input('Enter the number of hot dogs for each person: ')) #calculations hotdog_total = ppl_attending * hotdogs_pp hotdog_packs_needed = hotdog_total / hotdogs_perpack hotdog_bun_packs_needed = hotdog_total / hotdogs_bunsperpack hotdogs_leftover = hotdog_total / hotdogs_perpack hotdog_buns_leftover = hotdog_total / hotdogs_bunsperpack if hotdogs_leftover: hotdog_packs_needed += 1 hotdogs_leftover = hotdogs_perpack - hotdogs_leftover if hotdog_buns_leftover: hotdog_bun_packs_needed += 1 hotdog_buns_leftover = hotdogs_bunsperpack - hotdog_buns_leftover #The minimum number of packages of hot dogs required print('Minimum packages of hot dogs needed: ', hotdog_packs_needed) #The minimum number of packages of hot dog buns required print('Minimum packages of hot dog buns needed: ', hotdog_bun_packs_needed) #The number of hot dogs that will be left over print('Hot dogs left over: ', hotdogs_leftover) #The number of hot dog buns that will be left over print('Hot dog buns left over: ', hotdog_buns_leftover)
hotdogs_perpack = 10 hotdogs_bunsperpack = 8 ppl_attending = int(input('Enter the number of people attending the cookout: ')) hotdogs_pp = int(input('Enter the number of hot dogs for each person: ')) hotdog_total = ppl_attending * hotdogs_pp hotdog_packs_needed = hotdog_total / hotdogs_perpack hotdog_bun_packs_needed = hotdog_total / hotdogs_bunsperpack hotdogs_leftover = hotdog_total / hotdogs_perpack hotdog_buns_leftover = hotdog_total / hotdogs_bunsperpack if hotdogs_leftover: hotdog_packs_needed += 1 hotdogs_leftover = hotdogs_perpack - hotdogs_leftover if hotdog_buns_leftover: hotdog_bun_packs_needed += 1 hotdog_buns_leftover = hotdogs_bunsperpack - hotdog_buns_leftover print('Minimum packages of hot dogs needed: ', hotdog_packs_needed) print('Minimum packages of hot dog buns needed: ', hotdog_bun_packs_needed) print('Hot dogs left over: ', hotdogs_leftover) print('Hot dog buns left over: ', hotdog_buns_leftover)
DATABASES = { 'default': { 'ENGINE': 'django.db.backends.sqlite3', 'NAME': 'solo-tests.db', } } INSTALLED_APPS = ( 'solo', 'solo.tests', ) SECRET_KEY = 'any-key' CACHES = { 'default': { 'BACKEND': 'django.core.cache.backends.locmem.LocMemCache', 'LOCATION': '127.0.0.1:11211', }, } SOLO_CACHE = 'default'
databases = {'default': {'ENGINE': 'django.db.backends.sqlite3', 'NAME': 'solo-tests.db'}} installed_apps = ('solo', 'solo.tests') secret_key = 'any-key' caches = {'default': {'BACKEND': 'django.core.cache.backends.locmem.LocMemCache', 'LOCATION': '127.0.0.1:11211'}} solo_cache = 'default'
#Author : 5hifaT #Github : https://github.com/jspw #Gists : https://gist.github.com/jspw #linkedin : https://www.linkedin.com/in/mehedi-hasan-shifat-2b10a4172/ #Stackoverflow : https://stackoverflow.com/story/jspw #Dev community : https://dev.to/mhshifat def binary_search(ar, value): start = 0 end = len(ar)-1 while(start <= end): mid = (start+end)//2 # print("start : {},end : {},mid {}".format(start, end, mid), end=" ") if(ar[mid] == value): return mid if(ar[mid] > value): end = mid-1 else: start = mid+1 return -1 def main(): for _ in range(int(input())): l = list(map(int,input().split())) value = int(input()) check = False for i in range(0,len(l)) : if l[i] == value: print("{} found at {}".format(value,i),end="\n") check=True if(check == False): print("{} not found".format(value),end="\n") if __name__ == "__main__": main()
def binary_search(ar, value): start = 0 end = len(ar) - 1 while start <= end: mid = (start + end) // 2 if ar[mid] == value: return mid if ar[mid] > value: end = mid - 1 else: start = mid + 1 return -1 def main(): for _ in range(int(input())): l = list(map(int, input().split())) value = int(input()) check = False for i in range(0, len(l)): if l[i] == value: print('{} found at {}'.format(value, i), end='\n') check = True if check == False: print('{} not found'.format(value), end='\n') if __name__ == '__main__': main()
###exercicio 76 produtos = ('lapis', 1.5, 'borracha', 2.00, 'caderno', 15.00, 'livro', 50.00, 'mochila', 75.00) print ('='*60) print ('{:^60}'.format('Lista de produtos')) print ('='*60) for c in range (0, len(produtos), 2): print ('{:<50}R$ {:>7}'.format(produtos[c], produtos[c+1])) print ('-'*60)
produtos = ('lapis', 1.5, 'borracha', 2.0, 'caderno', 15.0, 'livro', 50.0, 'mochila', 75.0) print('=' * 60) print('{:^60}'.format('Lista de produtos')) print('=' * 60) for c in range(0, len(produtos), 2): print('{:<50}R$ {:>7}'.format(produtos[c], produtos[c + 1])) print('-' * 60)
# Programacion orientada a objetos (POO o OOP) # Definir una clase (molde para crear mas objetos de ese tipo) # (Coche) con caracteristicas similares class Coche: # Atributos o propiedades (variables) # caracteristicas del coche color = "Rojo" marca = "Ferrari" modelo = "Aventador" velocidad = 300 caballaje = 500 plazas = 2 # Metodos, son acciones que hace el objeto (coche) (Conocidas como funciones) def setColor(self, color): self.color = color def getColor(self): return self.color def setModelo(self, modelo): self.modelo = modelo def getModelo(self): return self.modelo def acelerar(self): self.velocidad += 1 def frenar(self): self.velocidad -= 1 def getVelocidad(self): return self.velocidad # fin definicion clase # Crear objeto // Instanciar clase coche = Coche() coche.setColor("Amarillo") coche.setModelo("Murcielago") print("COCHE 1:") print(coche.marca, coche.getModelo(), coche.getColor() ) print("Velocidad actual: ", coche.getVelocidad() ) coche.acelerar() coche.acelerar() coche.acelerar() coche.acelerar() coche.frenar() print("Velocidad nueva: ", coche.velocidad ) # Crear mas objetos. coche2 = Coche() coche2.setColor("Verde") coche2.setModelo("Gallardo") print("------------------------------") print("COCHE 2:") print(coche2.marca, coche2.getModelo(), coche2.getColor() ) print("Velocidad actual: ", coche2.getVelocidad() ) print(type(coche2))
class Coche: color = 'Rojo' marca = 'Ferrari' modelo = 'Aventador' velocidad = 300 caballaje = 500 plazas = 2 def set_color(self, color): self.color = color def get_color(self): return self.color def set_modelo(self, modelo): self.modelo = modelo def get_modelo(self): return self.modelo def acelerar(self): self.velocidad += 1 def frenar(self): self.velocidad -= 1 def get_velocidad(self): return self.velocidad coche = coche() coche.setColor('Amarillo') coche.setModelo('Murcielago') print('COCHE 1:') print(coche.marca, coche.getModelo(), coche.getColor()) print('Velocidad actual: ', coche.getVelocidad()) coche.acelerar() coche.acelerar() coche.acelerar() coche.acelerar() coche.frenar() print('Velocidad nueva: ', coche.velocidad) coche2 = coche() coche2.setColor('Verde') coche2.setModelo('Gallardo') print('------------------------------') print('COCHE 2:') print(coche2.marca, coche2.getModelo(), coche2.getColor()) print('Velocidad actual: ', coche2.getVelocidad()) print(type(coche2))
class Solution: def calculate(self, s: str) -> int: stacks = [[0, 1]] val = "" sign = 1 for i, ch in enumerate(s): if ch == ' ': continue if ch == '(': stacks[-1][-1] = sign stacks.append([0, 1]) sign = 1 elif ch in "+-": if val: stacks[-1][0] += sign * int(val) val = "" sign = 1 if ch == '+' else -1 elif ch == ')': if val: stacks[-1][0] += sign * int(val) val = "" sign = 1 top = stacks.pop()[0] stacks[-1][0] += stacks[-1][1] * top else: val += ch if val: stacks[-1][0] += sign * int(val) return stacks[-1][0]
class Solution: def calculate(self, s: str) -> int: stacks = [[0, 1]] val = '' sign = 1 for (i, ch) in enumerate(s): if ch == ' ': continue if ch == '(': stacks[-1][-1] = sign stacks.append([0, 1]) sign = 1 elif ch in '+-': if val: stacks[-1][0] += sign * int(val) val = '' sign = 1 if ch == '+' else -1 elif ch == ')': if val: stacks[-1][0] += sign * int(val) val = '' sign = 1 top = stacks.pop()[0] stacks[-1][0] += stacks[-1][1] * top else: val += ch if val: stacks[-1][0] += sign * int(val) return stacks[-1][0]
# -*- coding: utf-8 -*- urls = ( "/", "Home", )
urls = ('/', 'Home')
#!/usr/bin/env python3 BUS = 'http://m.bus.go.kr/mBus/bus/' SUBWAY = 'http://m.bus.go.kr/mBus/subway/' PATH = 'http://m.bus.go.kr/mBus/path/' all_bus_routes = BUS + 'getBusRouteList.bms' bus_route_search = all_bus_routes + '?strSrch={0}' bus_route_by_id = BUS + 'getRouteInfo.bms?busRouteId={0}' all_low_bus_routes = BUS + 'getLowBusRoute.bms' low_bus_route_search = all_low_bus_routes + 'strSrch={0}' all_night_bus_routes = BUS + 'getNBusRoute.bms' night_bus_route_search = all_night_bus_routes + 'strSrch={0}' all_airport_bus_routes = BUS + 'getAirBusRoute.bms' bus_routes_by_type = BUS + 'getRttpRoute.bms?strSrch={0}&stRttp={1}' route_path_by_id = BUS + 'getRoutePath.bms?busRouteId={0}' route_path_detailed_by_id = BUS + 'getStaionByRoute.bms?busRouteId={0}' route_path_realtime_by_id = BUS + 'getRttpRouteAndPos.bms?busRouteId={0}' low_route_path_realtime_by_id = BUS + 'getLowRouteAndPos.bms?busRouteId={0}' bus_arrival_info_by_route = BUS + 'getArrInfoByRouteAll.bms?busRouteId={0}' bus_arrival_info_by_route_and_station = BUS + 'getArrInfoByRoute.bms?busRouteId={0}&stId={1}&ord=1' bus_stations_by_position = BUS + 'getStationByPos.bms?tmX={0}&tmY={1}&radius={2}' routes_by_position = BUS + 'getNearRouteByPos.bms?tmX={0}&tmY={1}&radius={2}' bus_stations_by_name = BUS + 'getStationByName.bms?stSrch={0}' low_bus_stations_by_name = BUS + 'getLowStationByName.bms?stSrch={0}' routes_by_bus_station = BUS + 'getRouteByStation.bms?arsId={0}' arrival_info_by_bus_station = BUS + 'getStationByUid.bms?arsId{0}' low_arrival_info_by_bus_station = BUS + 'getLowStationByUid.bms?arsId{0}' operating_times_by_bus_station_and_route = BUS + 'getBustimeByStation.bms?arsId={0}&busRouteId={1}' bus_position_by_route = BUS + 'getBusPosByRtid.bms?busRouteId={0}' low_bus_position_by_route = BUS + 'getLowBusPosByRtid.bms?busRouteId={0}' bus_position_by_id = BUS + 'getBusPosByVehId.bms?vehId={0}' closest_station_by_position = PATH + 'getNearStationByPos.bms?tmX={0}&tmY={1}&radius={2}' location_by_name = PATH + 'getLocationInfo.bms?stSrch={0}' path_by_bus = PATH + 'getPathInfoByBus.bms?startX={0}&startY={1}&endX={2}&endY={3}' path_by_subway = PATH + 'getPathInfoBySubway.bms?startX={0}&startY={1}&endX={2}&endY={3}' path_by_bus_and_subway = PATH + 'getPathInfoByBusNSub.bms?startX={0}&startY={1}&endX={2}&endY={3}' all_subway_stations = SUBWAY + 'getStatnByNm.bms' subway_stations_by_name = all_subway_stations + '?statnNm={0}' subway_stations_by_route = SUBWAY + 'getStatnByRoute.bms?subwayId={0}' subway_arrival_info_by_route_and_station = SUBWAY + 'getArvlByInfo.bms?subwayId={0}&statnId={1}' subway_station_by_route_and_id = SUBWAY + 'getStatnById.bms?subwayId={0}&statnId={1}' subway_timetable_by_route_and_station = SUBWAY + 'getPlanyByStatn.bms?subwayId={0}&statnId={1}&tabType={2}' first_and_last_subway_by_route_and_station = SUBWAY + 'getLastcarByStatn.bms?subwayId={0}&statnId={1}' bus_stations_by_subway_station = SUBWAY + 'getBusByStation.bms?statnId={0}' subway_entrance_info_by_station = SUBWAY + 'getEntrcByInfo.bms?statnId={0}' subway_station_position_by_id = SUBWAY + 'getStatnByIdPos.bms?statnId={0}' train_info_by_subway_route_and_station = SUBWAY + 'getStatnTrainInfo.bms?subwayId={0}&statnId={1}'
bus = 'http://m.bus.go.kr/mBus/bus/' subway = 'http://m.bus.go.kr/mBus/subway/' path = 'http://m.bus.go.kr/mBus/path/' all_bus_routes = BUS + 'getBusRouteList.bms' bus_route_search = all_bus_routes + '?strSrch={0}' bus_route_by_id = BUS + 'getRouteInfo.bms?busRouteId={0}' all_low_bus_routes = BUS + 'getLowBusRoute.bms' low_bus_route_search = all_low_bus_routes + 'strSrch={0}' all_night_bus_routes = BUS + 'getNBusRoute.bms' night_bus_route_search = all_night_bus_routes + 'strSrch={0}' all_airport_bus_routes = BUS + 'getAirBusRoute.bms' bus_routes_by_type = BUS + 'getRttpRoute.bms?strSrch={0}&stRttp={1}' route_path_by_id = BUS + 'getRoutePath.bms?busRouteId={0}' route_path_detailed_by_id = BUS + 'getStaionByRoute.bms?busRouteId={0}' route_path_realtime_by_id = BUS + 'getRttpRouteAndPos.bms?busRouteId={0}' low_route_path_realtime_by_id = BUS + 'getLowRouteAndPos.bms?busRouteId={0}' bus_arrival_info_by_route = BUS + 'getArrInfoByRouteAll.bms?busRouteId={0}' bus_arrival_info_by_route_and_station = BUS + 'getArrInfoByRoute.bms?busRouteId={0}&stId={1}&ord=1' bus_stations_by_position = BUS + 'getStationByPos.bms?tmX={0}&tmY={1}&radius={2}' routes_by_position = BUS + 'getNearRouteByPos.bms?tmX={0}&tmY={1}&radius={2}' bus_stations_by_name = BUS + 'getStationByName.bms?stSrch={0}' low_bus_stations_by_name = BUS + 'getLowStationByName.bms?stSrch={0}' routes_by_bus_station = BUS + 'getRouteByStation.bms?arsId={0}' arrival_info_by_bus_station = BUS + 'getStationByUid.bms?arsId{0}' low_arrival_info_by_bus_station = BUS + 'getLowStationByUid.bms?arsId{0}' operating_times_by_bus_station_and_route = BUS + 'getBustimeByStation.bms?arsId={0}&busRouteId={1}' bus_position_by_route = BUS + 'getBusPosByRtid.bms?busRouteId={0}' low_bus_position_by_route = BUS + 'getLowBusPosByRtid.bms?busRouteId={0}' bus_position_by_id = BUS + 'getBusPosByVehId.bms?vehId={0}' closest_station_by_position = PATH + 'getNearStationByPos.bms?tmX={0}&tmY={1}&radius={2}' location_by_name = PATH + 'getLocationInfo.bms?stSrch={0}' path_by_bus = PATH + 'getPathInfoByBus.bms?startX={0}&startY={1}&endX={2}&endY={3}' path_by_subway = PATH + 'getPathInfoBySubway.bms?startX={0}&startY={1}&endX={2}&endY={3}' path_by_bus_and_subway = PATH + 'getPathInfoByBusNSub.bms?startX={0}&startY={1}&endX={2}&endY={3}' all_subway_stations = SUBWAY + 'getStatnByNm.bms' subway_stations_by_name = all_subway_stations + '?statnNm={0}' subway_stations_by_route = SUBWAY + 'getStatnByRoute.bms?subwayId={0}' subway_arrival_info_by_route_and_station = SUBWAY + 'getArvlByInfo.bms?subwayId={0}&statnId={1}' subway_station_by_route_and_id = SUBWAY + 'getStatnById.bms?subwayId={0}&statnId={1}' subway_timetable_by_route_and_station = SUBWAY + 'getPlanyByStatn.bms?subwayId={0}&statnId={1}&tabType={2}' first_and_last_subway_by_route_and_station = SUBWAY + 'getLastcarByStatn.bms?subwayId={0}&statnId={1}' bus_stations_by_subway_station = SUBWAY + 'getBusByStation.bms?statnId={0}' subway_entrance_info_by_station = SUBWAY + 'getEntrcByInfo.bms?statnId={0}' subway_station_position_by_id = SUBWAY + 'getStatnByIdPos.bms?statnId={0}' train_info_by_subway_route_and_station = SUBWAY + 'getStatnTrainInfo.bms?subwayId={0}&statnId={1}'
def config_record_on_account(request,account_id): pass def config_record_on_channel(request, channel_id): pass
def config_record_on_account(request, account_id): pass def config_record_on_channel(request, channel_id): pass
def gen_primes(): current_number = 2 primes = [] while True: is_prime = True for prime in primes: if prime*prime > current_number: ## This is saying it's a prime if prime * prime > current_testing_number # print("Caught here") break # I'd love to see the original proof to this if current_number % prime == 0: # if divisable by a known prime, then it's not a prime is_prime = False break if is_prime: primes.append(current_number) yield current_number current_number += 1 # primes: 2, 3, 5, 7, 11 # not p : 4, 6, 8, 9, 10 x = 2 for p in gen_primes(): if x > 10001: print(p) break x += 1
def gen_primes(): current_number = 2 primes = [] while True: is_prime = True for prime in primes: if prime * prime > current_number: break if current_number % prime == 0: is_prime = False break if is_prime: primes.append(current_number) yield current_number current_number += 1 x = 2 for p in gen_primes(): if x > 10001: print(p) break x += 1
def isPrime(x): for i in range(2,x): if x%i == 0: return False return True def findPrime(beginning, finish): for j in range(beginning,finish): if isPrime(j): return j def encrypt(): print("Provide two integers") x = int(input()) y = int(input()) prime1 = findPrime(x,y) print("Provide two more integers") x = int(input()) y = int(input()) prime2 = findPrime(x,y) return prime1*prime2 print(encrypt(), encrypt()) # print("What is the number?") # x=int(input()) # if isPrime(x): # print(f"The number {x} is prime!") # else: # print("The number was not prime!")
def is_prime(x): for i in range(2, x): if x % i == 0: return False return True def find_prime(beginning, finish): for j in range(beginning, finish): if is_prime(j): return j def encrypt(): print('Provide two integers') x = int(input()) y = int(input()) prime1 = find_prime(x, y) print('Provide two more integers') x = int(input()) y = int(input()) prime2 = find_prime(x, y) return prime1 * prime2 print(encrypt(), encrypt())
# Gegeven zijn twee lijsten: lijst1 en lijst2 # Zoek alle elementen die beide lijsten gemeenschappelijk hebben # Stop deze elementen in een nieuwe lijst # Print de lijst met gemeenschappelijke elementen lijst1 = [1, 45, 65, 24, 87, 45, 23, 24, 56] lijst2 = [10, 76, 34, 1, 56, 22, 33, 77, 1]
lijst1 = [1, 45, 65, 24, 87, 45, 23, 24, 56] lijst2 = [10, 76, 34, 1, 56, 22, 33, 77, 1]
class iterator: def __init__(self,data): self.data=data self.index=-2 def __iter__(self): return self def __next__(self): if self.index>=len(self.data): raise StopIteration self.index+=2 return self.data[self.index] liczby=iterator([0,1,2,3,4,5,6,7]) print(next(liczby),end=', ') print(next(liczby),end=', ') print(next(liczby),end=', ') print(next(liczby))
class Iterator: def __init__(self, data): self.data = data self.index = -2 def __iter__(self): return self def __next__(self): if self.index >= len(self.data): raise StopIteration self.index += 2 return self.data[self.index] liczby = iterator([0, 1, 2, 3, 4, 5, 6, 7]) print(next(liczby), end=', ') print(next(liczby), end=', ') print(next(liczby), end=', ') print(next(liczby))
class RemovedInWagtail21Warning(DeprecationWarning): pass removed_in_next_version_warning = RemovedInWagtail21Warning class RemovedInWagtail22Warning(PendingDeprecationWarning): pass
class Removedinwagtail21Warning(DeprecationWarning): pass removed_in_next_version_warning = RemovedInWagtail21Warning class Removedinwagtail22Warning(PendingDeprecationWarning): pass
arr = list(map(int, input().split())) n = int(input()) for i in range(len(arr)): one = arr[i] for j in range(i+1,len(arr)): two = arr[j] s = one + two if s == n: print(f'{one} {two}')
arr = list(map(int, input().split())) n = int(input()) for i in range(len(arr)): one = arr[i] for j in range(i + 1, len(arr)): two = arr[j] s = one + two if s == n: print(f'{one} {two}')
def format(string): ''' Formats the docstring. ''' # reStructuredText formatting? # Remove all \n and replace all spaces with a single space string = ' '.join(list(filter(None, string.replace('\n', ' ').split(' ')))) return string class DocString: def __init__(self, string): self.string = format(string) def __str__(self): return self.string def __add__(self, other): return str(self) + other def __radd__(self, other): return other + str(self)
def format(string): """ Formats the docstring. """ string = ' '.join(list(filter(None, string.replace('\n', ' ').split(' ')))) return string class Docstring: def __init__(self, string): self.string = format(string) def __str__(self): return self.string def __add__(self, other): return str(self) + other def __radd__(self, other): return other + str(self)
class Solution: def longestCommonPrefix(self, strs): if strs == []: return "" ans = "" for i, ch in enumerate(strs[0]): # iterate over the characters of first word for j, s in enumerate(strs): # iterate over the list of words if i >= len(strs[j]) or ch != s[i]: # IF the first word is longer return ans # OR the characters do not match return answer string ans += ch # ELSE add the current character to answer return ans # all words are identical or longer than first obj = Solution() l = ["flower","flow","flight", "flipped"] print("List of Words: {}" .format(l)) print("Answer: {}" .format(obj.longestCommonPrefix(l)))
class Solution: def longest_common_prefix(self, strs): if strs == []: return '' ans = '' for (i, ch) in enumerate(strs[0]): for (j, s) in enumerate(strs): if i >= len(strs[j]) or ch != s[i]: return ans ans += ch return ans obj = solution() l = ['flower', 'flow', 'flight', 'flipped'] print('List of Words: {}'.format(l)) print('Answer: {}'.format(obj.longestCommonPrefix(l)))
# ---------------- User Configuration Settings for speed-cam.py --------------------------------- # Ver 8.4 speed-cam.py webcam720 Stream Variable Configuration Settings ####################################### # speed-cam.py plugin settings ####################################### # Calibration Settings # =================== cal_obj_px = 310 # Length of a calibration object in pixels cal_obj_mm = 4330.0 # Length of the calibration object in millimetres # Motion Event Settings # --------------------- MIN_AREA = 100 # Default= 100 Exclude all contours less than or equal to this sq-px Area x_diff_max = 200 # Default= 200 Exclude if max px away >= last motion event x pos x_diff_min = 1 # Default= 1 Exclude if min px away <= last event x pos track_timeout = 0.0 # Default= 0.0 Optional seconds to wait after track End (Avoid dual tracking) event_timeout = 0.4 # Default= 0.4 seconds to wait for next motion event before starting new track log_data_to_CSV = True # Default= True True= Save log data as CSV comma separated values # Camera Settings # --------------- WEBCAM = True # Default= False False=PiCamera True=USB WebCamera # Web Camera Settings # ------------------- WEBCAM_SRC = 0 # Default= 0 USB opencv connection number WEBCAM_WIDTH = 1280 # Default= 1280 USB Webcam Image width WEBCAM_HEIGHT = 720 # Default= 720 USB Webcam Image height # Camera Image Settings # --------------------- image_font_size = 20 # Default= 20 Font text height in px for text on images image_bigger = 1 # Default= 1 Resize saved speed image by value # ---------------------------------------------- End of User Variables -----------------------------------------------------
cal_obj_px = 310 cal_obj_mm = 4330.0 min_area = 100 x_diff_max = 200 x_diff_min = 1 track_timeout = 0.0 event_timeout = 0.4 log_data_to_csv = True webcam = True webcam_src = 0 webcam_width = 1280 webcam_height = 720 image_font_size = 20 image_bigger = 1
def busca(lista, elemento): for i in range(len(lista)): if lista[i] == elemento: return i return False o = busca([0,7,8,5,10], 10) print(o)
def busca(lista, elemento): for i in range(len(lista)): if lista[i] == elemento: return i return False o = busca([0, 7, 8, 5, 10], 10) print(o)
gem3 = ( (79, ("ING")), ) gem2 = ( (5, ("TH")), (41, ("EO")), (79, ("NG")), (83, ("OE")), (101, ("AE")), (107, ("IA", "IO")), (109, ("EA")), ) gem = ( (2, ("F")), (3, ("U", "V")), (7, ("O")), (11, ("R")), (13, ("C", "K")), (17, ("G")), (19, ("W")), (23, ("H")), (29, ("N")), (31, ("I")), (37, ("J")), (43, ("P")), (47, ("X")), (53, ("S", "Z")), (59, ("T")), (61, ("B")), (67, ("E")), (71, ("M")), (73, ("L")), (89, ("D")), (97, ("A")), (103, ("Y")), ) def enc_2(c, arr): for g in arr: if c.upper() in g[1]: return g[0] def enc(s): sum = 0 i = 0 while i < len(s): if i < len(s) - 2: c = s[i] + s[i + 1] + s[i + 2] o = enc_2(c, gem3) if o > 0: print("{0}, {1}".format(c, o)) sum += o i += 3 continue if i < len(s) - 1: c = s[i] + s[i + 1] o = enc_2(c, gem2) if o > 0: print("{0}, {1}".format(c, o)) sum += o i += 2 continue o = enc_2(s[i], gem) if o > 0: print("{0}, {1}".format(s[i], o)) sum += o i += 1 return sum sum = 0 for line in ["Like the instar, tunneling to the surface", "We must shed our own circumferences;", "Find the divinity within and emerge." ]: o = enc(line) print(o) if sum == 0: sum = o else: sum *= o print(sum)
gem3 = ((79, 'ING'),) gem2 = ((5, 'TH'), (41, 'EO'), (79, 'NG'), (83, 'OE'), (101, 'AE'), (107, ('IA', 'IO')), (109, 'EA')) gem = ((2, 'F'), (3, ('U', 'V')), (7, 'O'), (11, 'R'), (13, ('C', 'K')), (17, 'G'), (19, 'W'), (23, 'H'), (29, 'N'), (31, 'I'), (37, 'J'), (43, 'P'), (47, 'X'), (53, ('S', 'Z')), (59, 'T'), (61, 'B'), (67, 'E'), (71, 'M'), (73, 'L'), (89, 'D'), (97, 'A'), (103, 'Y')) def enc_2(c, arr): for g in arr: if c.upper() in g[1]: return g[0] def enc(s): sum = 0 i = 0 while i < len(s): if i < len(s) - 2: c = s[i] + s[i + 1] + s[i + 2] o = enc_2(c, gem3) if o > 0: print('{0}, {1}'.format(c, o)) sum += o i += 3 continue if i < len(s) - 1: c = s[i] + s[i + 1] o = enc_2(c, gem2) if o > 0: print('{0}, {1}'.format(c, o)) sum += o i += 2 continue o = enc_2(s[i], gem) if o > 0: print('{0}, {1}'.format(s[i], o)) sum += o i += 1 return sum sum = 0 for line in ['Like the instar, tunneling to the surface', 'We must shed our own circumferences;', 'Find the divinity within and emerge.']: o = enc(line) print(o) if sum == 0: sum = o else: sum *= o print(sum)
def part_1(data): blah = {'n': (0, 1), 'ne': (1, 0), 'se': (1, -1), 's': (0, -1), 'sw': (-1, 0), 'nw': (-1, 1)} x, y = 0, 0 for step in data.split(","): x, y = x + blah[step][0], y + blah[step][1] distance = (abs(x) + abs(y) + abs(-x-y)) // 2 return distance def part_2(data): blah = {'n': (0, 1), 'ne': (1, 0), 'se': (1, -1), 's': (0, -1), 'sw': (-1, 0), 'nw': (-1, 1)} x, y = 0, 0 max_distance = 0 for step in data.split(','): x, y = x + blah[step][0], y + blah[step][1] distance = (abs(x) + abs(y) + abs(-x-y)) // 2 max_distance = max(max_distance, distance) return max_distance if __name__ == '__main__': with open('day_11_input.txt') as f: inp = f.readlines()[0] print("Part 1 answer: " + str(part_1(inp))) print("Part 2 answer: " + str(part_2(inp)))
def part_1(data): blah = {'n': (0, 1), 'ne': (1, 0), 'se': (1, -1), 's': (0, -1), 'sw': (-1, 0), 'nw': (-1, 1)} (x, y) = (0, 0) for step in data.split(','): (x, y) = (x + blah[step][0], y + blah[step][1]) distance = (abs(x) + abs(y) + abs(-x - y)) // 2 return distance def part_2(data): blah = {'n': (0, 1), 'ne': (1, 0), 'se': (1, -1), 's': (0, -1), 'sw': (-1, 0), 'nw': (-1, 1)} (x, y) = (0, 0) max_distance = 0 for step in data.split(','): (x, y) = (x + blah[step][0], y + blah[step][1]) distance = (abs(x) + abs(y) + abs(-x - y)) // 2 max_distance = max(max_distance, distance) return max_distance if __name__ == '__main__': with open('day_11_input.txt') as f: inp = f.readlines()[0] print('Part 1 answer: ' + str(part_1(inp))) print('Part 2 answer: ' + str(part_2(inp)))
#!/bin/zsh class Person: def __init__(self, name, age): mysillyobject.name = name mysillyobject.age = age def myfunc(abc): print("Hello my name is " + abc.name) p1 = Person("John", 36) p1.myfunc()
class Person: def __init__(self, name, age): mysillyobject.name = name mysillyobject.age = age def myfunc(abc): print('Hello my name is ' + abc.name) p1 = person('John', 36) p1.myfunc()
def TrimmedMean(UpCoverage): nonzero_count = 0 for i in range(1,50): if (UpCoverage[-i]>0): nonzero_count += 1 total = 0 count=0 for cov in UpCoverage: if(cov>0): total += cov count += 1 trimMean = 0 if nonzero_count > 0 and count >20: #if count >20: trimMean = total/count; return trimMean
def trimmed_mean(UpCoverage): nonzero_count = 0 for i in range(1, 50): if UpCoverage[-i] > 0: nonzero_count += 1 total = 0 count = 0 for cov in UpCoverage: if cov > 0: total += cov count += 1 trim_mean = 0 if nonzero_count > 0 and count > 20: trim_mean = total / count return trimMean
N = int(input()) gradeReal = list(map(int, input().split())) M = max(gradeReal) gradeNew = 0 for i in gradeReal: gradeNew += (i / M * 100) print(gradeNew / N)
n = int(input()) grade_real = list(map(int, input().split())) m = max(gradeReal) grade_new = 0 for i in gradeReal: grade_new += i / M * 100 print(gradeNew / N)
universalSet={23,32,12,45,56,67,7,89,80,96} subSetList=[{23,32,12,45},{32,12,45,56},{56,67,7,89},{80,96},{12,45,56,67,7,89},{7,89,80,96},{89,80,96}] def getMinSubSetList(universalSet,subSetList): SetDs=[[i,len(i)] for i in subSetList] tempSet=set() setList=[] while(len(universalSet)!=0): print("\n++++++++++++++++++++++++++++++++\n") SetDs=sorted(SetDs,key=lambda x :x[1]) print("@@@@@@\n",SetDs,"\n@@@@@@@@@@@@|\n") tmpSet=SetDs.pop()[0] print(tmpSet) setList.append(tmpSet) tempSet=tempSet.union(tmpSet) print(tempSet) universalSet.difference_update(tempSet) SetDsi=SetDs SetDs=[] for elem in SetDsi: tmp=len(elem[0])-len(elem[0].intersection(tempSet)) print("#############\n",elem[0],tempSet,elem[1],tmp,universalSet,"\n############") SetDs.append([elem[0],tmp]) print("\n########DSI\n",SetDs,"\n########\n") return setList print(getMinSubSetList(universalSet,subSetList))
universal_set = {23, 32, 12, 45, 56, 67, 7, 89, 80, 96} sub_set_list = [{23, 32, 12, 45}, {32, 12, 45, 56}, {56, 67, 7, 89}, {80, 96}, {12, 45, 56, 67, 7, 89}, {7, 89, 80, 96}, {89, 80, 96}] def get_min_sub_set_list(universalSet, subSetList): set_ds = [[i, len(i)] for i in subSetList] temp_set = set() set_list = [] while len(universalSet) != 0: print('\n++++++++++++++++++++++++++++++++\n') set_ds = sorted(SetDs, key=lambda x: x[1]) print('@@@@@@\n', SetDs, '\n@@@@@@@@@@@@|\n') tmp_set = SetDs.pop()[0] print(tmpSet) setList.append(tmpSet) temp_set = tempSet.union(tmpSet) print(tempSet) universalSet.difference_update(tempSet) set_dsi = SetDs set_ds = [] for elem in SetDsi: tmp = len(elem[0]) - len(elem[0].intersection(tempSet)) print('#############\n', elem[0], tempSet, elem[1], tmp, universalSet, '\n############') SetDs.append([elem[0], tmp]) print('\n########DSI\n', SetDs, '\n########\n') return setList print(get_min_sub_set_list(universalSet, subSetList))
class RMCError(Exception): def __init__(self, message): Exception.__init__(self, message) self.__line_number=None def set_line_number(self, new_line_number): self.__line_number=new_line_number def get_line_number(self): return self.__line_number #operations throws RMCError if not successful #throws also for +1, +2 and so on (but also -1) def asNonnegInt(literal, must_be_positive=False, lit_name="unknown"): condition="positive" if must_be_positive else "nonnegative" if not literal.isdigit(): raise RMCError(lit_name+" must be a "+condition+" integer, found "+literal) res=int(literal) if must_be_positive and res==0: raise RMCError(lit_name+" must be a "+condition+" integer, found "+literal) return res
class Rmcerror(Exception): def __init__(self, message): Exception.__init__(self, message) self.__line_number = None def set_line_number(self, new_line_number): self.__line_number = new_line_number def get_line_number(self): return self.__line_number def as_nonneg_int(literal, must_be_positive=False, lit_name='unknown'): condition = 'positive' if must_be_positive else 'nonnegative' if not literal.isdigit(): raise rmc_error(lit_name + ' must be a ' + condition + ' integer, found ' + literal) res = int(literal) if must_be_positive and res == 0: raise rmc_error(lit_name + ' must be a ' + condition + ' integer, found ' + literal) return res
TO_BIN = {'0': '0000', '1': '0001', '2': '0010', '3': '0011', '4': '0100', '5': '0101', '6': '0110', '7': '0111', '8': '1000', '9': '1001', 'a': '1010', 'b': '1011', 'c': '1100', 'd': '1101', 'e': '1110', 'f': '1111'} TO_HEX = {v: k for k, v in TO_BIN.iteritems()} def hex_to_bin(hex_string): return ''.join(TO_BIN[a] for a in hex_string.lower()).lstrip('0') or '0' # return '{:b}'.format(int(hex_string, 16)) def bin_to_hex(binary_string): length = len(binary_string) q, r = divmod(length, 4) if r > 0: length = 4 * (q + 1) binary_string = binary_string.zfill(length) return ''.join(TO_HEX[binary_string[a:a + 4]] for a in xrange(0, length, 4)).lstrip('0') or '0' # return '{:x}'.format(int(binary_string, 2))
to_bin = {'0': '0000', '1': '0001', '2': '0010', '3': '0011', '4': '0100', '5': '0101', '6': '0110', '7': '0111', '8': '1000', '9': '1001', 'a': '1010', 'b': '1011', 'c': '1100', 'd': '1101', 'e': '1110', 'f': '1111'} to_hex = {v: k for (k, v) in TO_BIN.iteritems()} def hex_to_bin(hex_string): return ''.join((TO_BIN[a] for a in hex_string.lower())).lstrip('0') or '0' def bin_to_hex(binary_string): length = len(binary_string) (q, r) = divmod(length, 4) if r > 0: length = 4 * (q + 1) binary_string = binary_string.zfill(length) return ''.join((TO_HEX[binary_string[a:a + 4]] for a in xrange(0, length, 4))).lstrip('0') or '0'
def table(positionsList): print("\n\t Tic-Tac-Toe") print("\t~~~~~~~~~~~~~~~~~") print("\t|| {} || {} || {} ||".format(positionsList[0], positionsList[1], positionsList[2])) print("\t|| {} || {} || {} ||".format(positionsList[3], positionsList[4], positionsList[5])) print("\t|| {} || {} || {} ||".format(positionsList[6], positionsList[7], positionsList[8])) print("\t~~~~~~~~~~~~~~~~~") def playerMove(playerLetter, positionsList): while True: playerPos = int(input("{}: Where would you like to place your piece (1-9): ".format(playerLetter))) if playerPos > 0 and playerPos < 10: if positionsList[playerPos - 1] == "_": return playerPos else: print("That position is already chosen. Try another spot.") else: print("That is not a right option. Try a number between (1-9).") def placePlayerTable(playerLetter, playerPos, positionsList): positionsList[playerPos - 1] = playerLetter def winner(pLet, posList): return ((posList[0] == pLet and posList[1] == pLet and posList[2] == pLet) or (posList[3] == pLet and posList[4] == pLet and posList[5] == pLet) or (posList[6] == pLet and posList[7] == pLet and posList[8] == pLet) or (posList[0] == pLet and posList[3] == pLet and posList[6] == pLet) or (posList[1] == pLet and posList[4] == pLet and posList[7] == pLet) or (posList[2] == pLet and posList[5] == pLet and posList[8] == pLet) or (posList[0] == pLet and posList[4] == pLet and posList[8] == pLet) or (posList[2] == pLet and posList[4] == pLet and posList[6] == pLet)) listGame = ["_"]*9 exampleTab = ["1", "2", "3", "4", "5", "6", "7", "8", "9"] player1 = "X" player2 = "O" table(exampleTab) table(listGame) while True: #player 1 move = playerMove(player1, listGame) placePlayerTable(player1, move, listGame) table(exampleTab) table(listGame) if winner(player1, listGame): print("Player 1 wins!") break elif "_" not in listGame: print("Was a tie!") break #player 2 move = playerMove(player2, listGame) placePlayerTable(player2, move, listGame) table(exampleTab) table(listGame) if winner(player2, listGame): print("Player 2 wins!") break
def table(positionsList): print('\n\t Tic-Tac-Toe') print('\t~~~~~~~~~~~~~~~~~') print('\t|| {} || {} || {} ||'.format(positionsList[0], positionsList[1], positionsList[2])) print('\t|| {} || {} || {} ||'.format(positionsList[3], positionsList[4], positionsList[5])) print('\t|| {} || {} || {} ||'.format(positionsList[6], positionsList[7], positionsList[8])) print('\t~~~~~~~~~~~~~~~~~') def player_move(playerLetter, positionsList): while True: player_pos = int(input('{}: Where would you like to place your piece (1-9): '.format(playerLetter))) if playerPos > 0 and playerPos < 10: if positionsList[playerPos - 1] == '_': return playerPos else: print('That position is already chosen. Try another spot.') else: print('That is not a right option. Try a number between (1-9).') def place_player_table(playerLetter, playerPos, positionsList): positionsList[playerPos - 1] = playerLetter def winner(pLet, posList): return posList[0] == pLet and posList[1] == pLet and (posList[2] == pLet) or (posList[3] == pLet and posList[4] == pLet and (posList[5] == pLet)) or (posList[6] == pLet and posList[7] == pLet and (posList[8] == pLet)) or (posList[0] == pLet and posList[3] == pLet and (posList[6] == pLet)) or (posList[1] == pLet and posList[4] == pLet and (posList[7] == pLet)) or (posList[2] == pLet and posList[5] == pLet and (posList[8] == pLet)) or (posList[0] == pLet and posList[4] == pLet and (posList[8] == pLet)) or (posList[2] == pLet and posList[4] == pLet and (posList[6] == pLet)) list_game = ['_'] * 9 example_tab = ['1', '2', '3', '4', '5', '6', '7', '8', '9'] player1 = 'X' player2 = 'O' table(exampleTab) table(listGame) while True: move = player_move(player1, listGame) place_player_table(player1, move, listGame) table(exampleTab) table(listGame) if winner(player1, listGame): print('Player 1 wins!') break elif '_' not in listGame: print('Was a tie!') break move = player_move(player2, listGame) place_player_table(player2, move, listGame) table(exampleTab) table(listGame) if winner(player2, listGame): print('Player 2 wins!') break
def Spline(*points): assert len(points) >= 2 return _SplineEval(points, _SplineNormal(points)) def Spline1(points, s0, sn): assert len(points) >= 2 points = tuple(points) s0 = float(s0) sn = float(sn) return _SplineEval(points, _SplineFirstDeriv(points, s0, sn)) def _IPolyMult(prod, poly): if not prod: return if not poly: prod[:] = [] return for i in xrange(len(poly)-1): prod.append(0) for i in xrange(len(prod)-1, -1, -1): for j in xrange(len(poly)): if j == 0: prod[i] = poly[j]*prod[i] elif i >= j: prod[i] += poly[j]*prod[i-j] def _IPolyAdd(sum, poly): for i in xrange(len(poly)): if i == len(sum): sum.append(poly[i]) else: sum[i] += poly[i] def _PolyCompose(f, g): sum = [] for i in xrange(len(f) - 1, -1, -1): _IPolyMult(sum, g) _IPolyAdd(sum, [f[i]]) return sum def _PolyEval(f, x): sum = 0 for i in xrange(len(f) - 1, -1, -1): sum = sum*x + f[i] return sum def _IPoly3Fit(poly3, x, y): actual = _PolyEval(poly3, x) poly3[3] = float(y - actual) / x**3 def _Poly3Shift(poly3, x): result = _PolyCompose(poly3, [x, 1.0]) result[3] = 0.0 return result def _Spline(points, x, x2): assert points cubic = [float(points[0][1]), x, x2, 0.0] result = [] for i in xrange(len(points)-1): xdiff = float(points[i+1][0]-points[i][0]) _IPoly3Fit(cubic, xdiff, float(points[i+1][1])) result.append(cubic) cubic = _Poly3Shift(cubic, xdiff) result.append(cubic) return result def _SplineNormal(points): splines0 = _Spline(points, 0.0, 0.0) splines1 = _Spline(points, 1.0, 0.0) plen = len(points) end2nd0 = splines0[plen-1][2] end2nd1 = splines1[plen-1][2] start1st = -end2nd0 / (end2nd1-end2nd0) return _Spline(points, start1st, 0.0) def _SplineFirstDeriv(points, s0, sn): splines0 = _Spline(points, s0, 0.0) splines1 = _Spline(points, s0, 1.0) plen = len(points) end1st0 = splines0[plen-1][1] end1st1 = splines1[plen-1][1] start2nd = (sn - end1st0) / (end1st1 - end1st0) return _Spline(points, s0, start2nd) class _SplineEval(object): def __init__(self, points, splines): self._points = points self._splines = splines def __call__(self, x): plen = len(self._points) assert x >= self._points[0][0] assert x <= self._points[plen-1][0] first = 0 last = plen-1 while first + 1 < last: mid = (first + last) / 2 if x >= self._points[mid][0]: first = mid else: last = mid return _PolyEval(self._splines[first], x - self._points[first][0])
def spline(*points): assert len(points) >= 2 return __spline_eval(points, __spline_normal(points)) def spline1(points, s0, sn): assert len(points) >= 2 points = tuple(points) s0 = float(s0) sn = float(sn) return __spline_eval(points, __spline_first_deriv(points, s0, sn)) def _i_poly_mult(prod, poly): if not prod: return if not poly: prod[:] = [] return for i in xrange(len(poly) - 1): prod.append(0) for i in xrange(len(prod) - 1, -1, -1): for j in xrange(len(poly)): if j == 0: prod[i] = poly[j] * prod[i] elif i >= j: prod[i] += poly[j] * prod[i - j] def _i_poly_add(sum, poly): for i in xrange(len(poly)): if i == len(sum): sum.append(poly[i]) else: sum[i] += poly[i] def __poly_compose(f, g): sum = [] for i in xrange(len(f) - 1, -1, -1): _i_poly_mult(sum, g) _i_poly_add(sum, [f[i]]) return sum def __poly_eval(f, x): sum = 0 for i in xrange(len(f) - 1, -1, -1): sum = sum * x + f[i] return sum def _i_poly3_fit(poly3, x, y): actual = __poly_eval(poly3, x) poly3[3] = float(y - actual) / x ** 3 def __poly3_shift(poly3, x): result = __poly_compose(poly3, [x, 1.0]) result[3] = 0.0 return result def __spline(points, x, x2): assert points cubic = [float(points[0][1]), x, x2, 0.0] result = [] for i in xrange(len(points) - 1): xdiff = float(points[i + 1][0] - points[i][0]) _i_poly3_fit(cubic, xdiff, float(points[i + 1][1])) result.append(cubic) cubic = __poly3_shift(cubic, xdiff) result.append(cubic) return result def __spline_normal(points): splines0 = __spline(points, 0.0, 0.0) splines1 = __spline(points, 1.0, 0.0) plen = len(points) end2nd0 = splines0[plen - 1][2] end2nd1 = splines1[plen - 1][2] start1st = -end2nd0 / (end2nd1 - end2nd0) return __spline(points, start1st, 0.0) def __spline_first_deriv(points, s0, sn): splines0 = __spline(points, s0, 0.0) splines1 = __spline(points, s0, 1.0) plen = len(points) end1st0 = splines0[plen - 1][1] end1st1 = splines1[plen - 1][1] start2nd = (sn - end1st0) / (end1st1 - end1st0) return __spline(points, s0, start2nd) class _Splineeval(object): def __init__(self, points, splines): self._points = points self._splines = splines def __call__(self, x): plen = len(self._points) assert x >= self._points[0][0] assert x <= self._points[plen - 1][0] first = 0 last = plen - 1 while first + 1 < last: mid = (first + last) / 2 if x >= self._points[mid][0]: first = mid else: last = mid return __poly_eval(self._splines[first], x - self._points[first][0])
def find_missing_number(c): b = max(c) d = min(c + [0]) if min(c) == 1 else min(c) v = set(range(d, b)) - set(c) return list(v)[0] if v != set() else None print(find_missing_number([1, 3, 2, 4])) print(find_missing_number([0, 2, 3, 4, 5])) print(find_missing_number([9, 7, 5, 8]))
def find_missing_number(c): b = max(c) d = min(c + [0]) if min(c) == 1 else min(c) v = set(range(d, b)) - set(c) return list(v)[0] if v != set() else None print(find_missing_number([1, 3, 2, 4])) print(find_missing_number([0, 2, 3, 4, 5])) print(find_missing_number([9, 7, 5, 8]))
load("@bazel_skylib//lib:dicts.bzl", "dicts") # load("//ocaml:providers.bzl", "CcDepsProvider") load("//ocaml/_functions:module_naming.bzl", "file_to_lib_name") ## see: https://github.com/bazelbuild/bazel/blob/master/src/main/starlark/builtins_bzl/common/cc/cc_import.bzl ## does this still apply? # "Library outputs of cc_library shouldn't be relied on, and should be considered as a implementation detail and are toolchain dependent (e.g. if you're using gold linker, we don't produce .a libs at all and use lib-groups instead, also linkstatic=0 on cc_test is something that might change in the future). Ideally you should wait for cc_shared_library (https://docs.google.com/document/d/1d4SPgVX-OTCiEK_l24DNWiFlT14XS5ZxD7XhttFbvrI/edit#heading=h.jwrigiapdkr2) or use cc_binary(name="libfoo.so", linkshared=1) with the hack you mentioned in the meantime. The actual location of shared library dependencies should be available from Skyalrk. Eventually." ## src: https://github.com/bazelbuild/bazel/issues/4218 ## DefaultInfo.files will be empty for cc_import deps, so in ## that case use CcInfo. ## For cc_library, DefaultInfo.files will contain the ## generated files (usually .a, .so, unless linkstatic is set) ## At the end we'll have one CcInfo whose entire depset will go ## on cmd line. This includes indirect deps like the .a files ## in @//ocaml/csdk and @rules_ocaml//cfg/lib/ctypes. ######################### def dump_library_to_link(ctx, idx, lib): print(" alwayslink[{i}]: {al}".format(i=idx, al = lib.alwayslink)) flds = ["static_library", "pic_static_library", "interface_library", "dynamic_library",] for fld in flds: if hasattr(lib, fld): if getattr(lib, fld): print(" lib[{i}].{f}: {p}".format( i=idx, f=fld, p=getattr(lib,fld).path)) else: print(" lib[{i}].{f} == None".format(i=idx, f=fld)) # if lib.dynamic_library: # print(" lib[{i}].dynamic_library: {lib}".format( # i=idx, lib=lib.dynamic_library.path)) # else: # print(" lib[{i}].dynamic_library == None".format(i=idx)) ######################### def dump_CcInfo(ctx, cc_info): # dep): # print("DUMP_CCINFO for %s" % ctx.label) # print("CcInfo dep: {d}".format(d = dep)) # dfiles = dep[DefaultInfo].files.to_list() # if len(dfiles) > 0: # for f in dfiles: # print(" %s" % f) ## ASSUMPTION: all files in DefaultInfo are also in CcInfo # print("dep[CcInfo].linking_context:") # cc_info = dep[CcInfo] compilation_ctx = cc_info.compilation_context linking_ctx = cc_info.linking_context linker_inputs = linking_ctx.linker_inputs.to_list() # print("linker_inputs count: %s" % len(linker_inputs)) lidx = 0 for linput in linker_inputs: # print(" linker_input[{i}]".format(i=lidx)) # print(" linkflags[{i}]: {f}".format(i=lidx, f= linput.user_link_flags)) libs = linput.libraries # print(" libs count: %s" % len(libs)) if len(libs) > 0: i = 0 for lib in linput.libraries: dump_library_to_link(ctx, i, lib) i = i+1 lidx = lidx + 1 # else: # for dep in dfiles: # print(" Default f: %s" % dep) ################################################################ ## to be called from {ocaml,ppx}_executable ## tasks: ## - construct args ## - construct inputs_depset ## - extract runfiles def link_ccdeps(ctx, default_linkmode, # platform default args, ccInfo): # print("link_ccdeps %s" % ctx.label) inputs_list = [] runfiles = [] compilation_ctx = ccInfo.compilation_context linking_ctx = ccInfo.linking_context linker_inputs = linking_ctx.linker_inputs.to_list() for linput in linker_inputs: libs = linput.libraries if len(libs) > 0: for lib in libs: if lib.pic_static_library: inputs_list.append(lib.pic_static_library) args.add(lib.pic_static_library.path) if lib.static_library: inputs_list.append(lib.static_library) args.add(lib.static_library.path) if lib.dynamic_library: inputs_list.append(lib.dynamic_library) args.add("-ccopt", "-L" + lib.dynamic_library.dirname) args.add("-cclib", lib.dynamic_library.path) return [inputs_list, runfiles] ################################################################ def x(ctx, cc_deps_dict, default_linkmode, args, includes, cclib_deps, cc_runfiles): dfiles = dep[DefaultInfo].files.to_list() # print("dep[DefaultInfo].files count: %s" % len(dfiles)) if len(dfiles) > 0: for f in dfiles: print(" %s" % f) # print("dep[CcInfo].linking_context:") cc_info = dep[CcInfo] compilation_ctx = cc_info.compilation_context linking_ctx = cc_info.linking_context linker_inputs = linking_ctx.linker_inputs.to_list() # print("linker_inputs count: %s" % len(linker_inputs)) # for linput in linker_inputs: # print("NEW LINKER_INPUT") # print(" LINKFLAGS: %s" % linput.user_link_flags) # print(" LINKLIB[0]: %s" % linput.libraries[0].static_library.path) ## ?filter on prefix for e.g. csdk: example/ocaml # for lib in linput.libraries: # print(" LINKLIB: %s" % lib.static_library.path) # else: # for dep in dfiles: # print(" Default f: %s" % dep) ## FIXME: static v. dynamic linking of cc libs in bytecode mode # see https://caml.inria.fr/pub/docs/manual-ocaml/intfc.html#ss%3Adynlink-c-code # default linkmode for toolchain is determined by platform # see @rules_ocaml//cfg/toolchain:BUILD.bazel, ocaml/_toolchains/*.bzl # dynamic linking does not currently work on the mac - ocamlrun # wants a file named 'dllfoo.so', which rust cannot produce. to # support this we would need to rename the file using install_name_tool # for macos linkmode is dynamic, so we need to override this for bytecode mode debug = False # if ctx.attr._rule == "ocaml_executable": # debug = True if debug: print("EXEC _handle_cc_deps %s" % ctx.label) print("CC_DEPS_DICT: %s" % cc_deps_dict) # first dedup ccdeps = {} for ccdict in cclib_deps: for [dep, linkmode] in ccdict.items(): if dep in ccdeps.keys(): if debug: print("CCDEP DUP? %s" % dep) else: ccdeps.update({dep: linkmode}) for [dep, linkmode] in cc_deps_dict.items(): if debug: print("CCLIB DEP: ") print(dep) if linkmode == "default": if debug: print("DEFAULT LINKMODE: %s" % default_linkmode) for depfile in dep.files.to_list(): if default_linkmode == "static": if (depfile.extension == "a"): args.add(depfile) cclib_deps.append(depfile) includes.append(depfile.dirname) else: for depfile in dep.files.to_list(): if (depfile.extension == "so"): libname = file_to_lib_name(depfile) args.add("-ccopt", "-L" + depfile.dirname) args.add("-cclib", "-l" + libname) cclib_deps.append(depfile) elif (depfile.extension == "dylib"): libname = file_to_lib_name(depfile) args.add("-cclib", "-l" + libname) args.add("-ccopt", "-L" + depfile.dirname) cclib_deps.append(depfile) cc_runfiles.append(dep.files) elif linkmode == "static": if debug: print("STATIC lib: %s:" % dep) for depfile in dep.files.to_list(): if (depfile.extension == "a"): args.add(depfile) cclib_deps.append(depfile) includes.append(depfile.dirname) elif linkmode == "static-linkall": if debug: print("STATIC LINKALL lib: %s:" % dep) for depfile in dep.files.to_list(): if (depfile.extension == "a"): cclib_deps.append(depfile) includes.append(depfile.dirname) if ctx.toolchains["@rules_ocaml//ocaml:toolchain"].cc_toolchain == "clang": args.add("-ccopt", "-Wl,-force_load,{path}".format(path = depfile.path)) elif ctx.toolchains["@rules_ocaml//ocaml:toolchain"].cc_toolchain == "gcc": libname = file_to_lib_name(depfile) args.add("-ccopt", "-L{dir}".format(dir=depfile.dirname)) args.add("-ccopt", "-Wl,--push-state,-whole-archive") args.add("-ccopt", "-l{lib}".format(lib=libname)) args.add("-ccopt", "-Wl,--pop-state") else: fail("NO CC") elif linkmode == "dynamic": if debug: print("DYNAMIC lib: %s" % dep) for depfile in dep.files.to_list(): if (depfile.extension == "so"): libname = file_to_lib_name(depfile) print("so LIBNAME: %s" % libname) args.add("-ccopt", "-L" + depfile.dirname) args.add("-cclib", "-l" + libname) cclib_deps.append(depfile) elif (depfile.extension == "dylib"): libname = file_to_lib_name(depfile) print("LIBNAME: %s:" % libname) args.add("-cclib", "-l" + libname) args.add("-ccopt", "-L" + depfile.dirname) cclib_deps.append(depfile) cc_runfiles.append(dep.files) ################################################################ ## returns: ## depset to be added to action_inputs ## updated args ## a CcDepsProvider containing cclibs dictionary {dep: linkmode} ## a depset containing ccdeps files, for OutputGroups ## FIXME: what about cc_runfiles? # def handle_ccdeps(ctx, # # for_pack, # default_linkmode, # in # # cc_deps_dict, ## list of dicts # args, ## in/out # # includes, # # cclib_deps, # # cc_runfiles): # ): # debug = False # ## steps: # ## 1. accumulate all ccdep dictionaries = direct + indirect # ## a. remove duplicate dict entries? # ## 2. construct action_inputs list # ## 3. derive cmd line args # ## 4. construct CcDepsProvider # # 1. accumulate # # a. direct cc deps # direct_ccdeps_maps_list = [] # if hasattr(ctx.attr, "cc_deps"): # direct_ccdeps_maps_list = [ctx.attr.cc_deps] # ## FIXME: ctx.attr._cc_deps is a label_flag attr, cannot be a dict # # all_ccdeps_maps_list.update(ctx.attr._cc_deps) # # print("CCDEPS DIRECT: %s" % direct_ccdeps_maps_list) # # b. indirect cc deps # all_deps = [] # if hasattr(ctx.attr, "deps"): # all_deps.extend(ctx.attr.deps) # if hasattr(ctx.attr, "_deps"): # all_deps.append(ctx.attr._deps) # if hasattr(ctx.attr, "deps_deferred"): # all_deps.extend(ctx.attr.deps_deferred) # if hasattr(ctx.attr, "sig"): # all_deps.append(ctx.attr.sig) # ## for ocaml_library # if hasattr(ctx.attr, "modules"): # all_deps.extend(ctx.attr.modules) # ## for ocaml_ns_library # if hasattr(ctx.attr, "submodules"): # all_deps.extend(ctx.attr.submodules) # ## [ocaml/ppx]_executable # if hasattr(ctx.attr, "main"): # all_deps.append(ctx.attr.main) # indirect_ccdeps_maps_list = [] # for dep in all_deps: # if None == dep: continue # e.g. attr.sig may be missing # if CcDepsProvider in dep: # if dep[CcDepsProvider].ccdeps_map: # skip empty maps # indirect_ccdeps_maps_list.append(dep[CcDepsProvider].ccdeps_map) # # print("CCDEPS INDIRECT: %s" % indirect_ccdeps_maps_list) # ## depsets cannot contain dictionaries so we use a list # all_ccdeps_maps_list = direct_ccdeps_maps_list + indirect_ccdeps_maps_list # ## now merge the maps and remove duplicate entries # all_ccdeps_map = {} # merged ccdeps maps # for ccdeps_map in all_ccdeps_maps_list: # # print("CCDEPS_MAP ITEM: %s" % ccdeps_map) # for [ccdep, cclinkmode] in ccdeps_map.items(): # if ccdep in all_ccdeps_map: # if cclinkmode == all_ccdeps_map[ccdep]: # ## duplicate # # print("Removing duplicate ccdep: {k}: {v}".format( # # k = ccdep, v = cclinkmode # # )) # continue # else: # # duplicate key, different linkmode # fail("CCDEP: duplicate dep {dep} with different linkmodes: {lm1}, {lm2}".format( # dep = dep, # lm1 = all_ccdeps_map[ccdep], # lm2 = cclinkmode # )) # else: # ## accum # all_ccdeps_map.update({ccdep: cclinkmode}) # ## end: accumulate # # print("ALLCCDEPS: %s" % all_ccdeps_map) # # print("ALLCCDEPS KEYS: %s" % all_ccdeps_map.keys()) # # 2. derive action inputs # action_inputs_ccdep_filelist = [] # for tgt in all_ccdeps_map.keys(): # action_inputs_ccdep_filelist.extend(tgt.files.to_list()) # # print("ACTION_INPUTS_ccdep_filelist: %s" % action_inputs_ccdep_filelist) # ## 3. derive cmd line args # ## FIXME: static v. dynamic linking of cc libs in bytecode mode # # see https://caml.inria.fr/pub/docs/manual-ocaml/intfc.html#ss%3Adynlink-c-code # # default linkmode for toolchain is determined by platform # # see @rules_ocaml//cfg/toolchain:BUILD.bazel, ocaml/_toolchains/*.bzl # # dynamic linking does not currently work on the mac - ocamlrun # # wants a file named 'dllfoo.so', which rust cannot produce. to # # support this we would need to rename the file using install_name_tool # # for macos linkmode is dynamic, so we need to override this for bytecode mode # cc_runfiles = [] # FIXME? # debug = True # ## FIXME: always pass -fvisibility=hidden? see https://stackoverflow.com/questions/9894961/strange-warnings-from-the-linker-ld # for [dep, linkmode] in all_ccdeps_map.items(): # if debug: # print("CCLIB DEP: ") # print(dep) # for f in dep.files.to_list(): # print(" f: %s" % f) # if CcInfo in dep: # print(" CcInfo: %s" % dep[CcInfo]) # if linkmode == "default": # if debug: print("DEFAULT LINKMODE: %s" % default_linkmode) # for depfile in dep.files.to_list(): # if default_linkmode == "static": # if (depfile.extension == "a"): # args.add(depfile) # # cclib_deps.append(depfile) # # includes.append(depfile.dirname) # else: # for depfile in dep.files.to_list(): # if debug: # print("DEPFILE dir: %s" % depfile.dirname) # print("DEPFILE path: %s" % depfile.path) # if (depfile.extension == "so"): # libname = file_to_lib_name(depfile) # args.add("-ccopt", "-L" + depfile.dirname) # args.add("-cclib", "-l" + libname) # # cclib_deps.append(depfile) # elif (depfile.extension == "dylib"): # libname = file_to_lib_name(depfile) # args.add("-cclib", "-l" + libname) # args.add("-ccopt", "-L" + depfile.dirname) # # cclib_deps.append(depfile) # cc_runfiles.append(dep.files) # elif linkmode == "static": # if debug: # print("STATIC LINK: %s:" % dep) # lctx = dep[CcInfo].linking_context # for linputs in lctx.linker_inputs.to_list(): # for lib in linputs.libraries: # print(" LINKLIB: %s" % lib.static_library) # for depfile in dep.files.to_list(): # if debug: # print(" LIB: %s" % depfile) # fail("xxxx") # if (depfile.extension == "a"): # # for .a files we do not need --cclib etc. just # # add directly to command line: # args.add(depfile) # elif linkmode == "static-linkall": # if debug: # print("STATIC LINKALL lib: %s:" % dep) # for depfile in dep.files.to_list(): # if (depfile.extension == "a"): # # cclib_deps.append(depfile) # # includes.append(depfile.dirname) # if ctx.toolchains["@rules_ocaml//ocaml:toolchain"].cc_toolchain == "clang": # args.add("-ccopt", "-Wl,-force_load,{path}".format(path = depfile.path)) # elif ctx.toolchains["@rules_ocaml//ocaml:toolchain"].cc_toolchain == "gcc": # libname = file_to_lib_name(depfile) # args.add("-ccopt", "-L{dir}".format(dir=depfile.dirname)) # args.add("-ccopt", "-Wl,--push-state,-whole-archive") # args.add("-ccopt", "-l{lib}".format(lib=libname)) # args.add("-ccopt", "-Wl,--pop-state") # else: # fail("NO CC") # elif linkmode == "dynamic": # if debug: # print("DYNAMIC lib: %s" % dep) # for depfile in dep.files.to_list(): # if (depfile.extension == "so"): # libname = file_to_lib_name(depfile) # if debug: # print("so LIBNAME: %s" % libname) # print("so dir: %s" % depfile.dirname) # args.add("-ccopt", "-L" + depfile.dirname) # args.add("-cclib", "-l" + libname) # # cclib_deps.append(depfile) # elif (depfile.extension == "dylib"): # libname = file_to_lib_name(depfile) # if debug: # print("LIBNAME: %s:" % libname) # args.add("-cclib", "-l" + libname) # args.add("-ccopt", "-L" + depfile.dirname) # # cclib_deps.append(depfile) # cc_runfiles.append(dep.files) # ## end: derive cmd options # ## now derive CcDepsProvider: # # for OutputGroups: use action_inputs_ccdep_filelist # ccDepsProvider = CcDepsProvider( # ccdeps_map = all_ccdeps_map # ) # return [action_inputs_ccdep_filelist, ccDepsProvider]
load('@bazel_skylib//lib:dicts.bzl', 'dicts') load('//ocaml/_functions:module_naming.bzl', 'file_to_lib_name') def dump_library_to_link(ctx, idx, lib): print(' alwayslink[{i}]: {al}'.format(i=idx, al=lib.alwayslink)) flds = ['static_library', 'pic_static_library', 'interface_library', 'dynamic_library'] for fld in flds: if hasattr(lib, fld): if getattr(lib, fld): print(' lib[{i}].{f}: {p}'.format(i=idx, f=fld, p=getattr(lib, fld).path)) else: print(' lib[{i}].{f} == None'.format(i=idx, f=fld)) def dump__cc_info(ctx, cc_info): compilation_ctx = cc_info.compilation_context linking_ctx = cc_info.linking_context linker_inputs = linking_ctx.linker_inputs.to_list() lidx = 0 for linput in linker_inputs: libs = linput.libraries if len(libs) > 0: i = 0 for lib in linput.libraries: dump_library_to_link(ctx, i, lib) i = i + 1 lidx = lidx + 1 def link_ccdeps(ctx, default_linkmode, args, ccInfo): inputs_list = [] runfiles = [] compilation_ctx = ccInfo.compilation_context linking_ctx = ccInfo.linking_context linker_inputs = linking_ctx.linker_inputs.to_list() for linput in linker_inputs: libs = linput.libraries if len(libs) > 0: for lib in libs: if lib.pic_static_library: inputs_list.append(lib.pic_static_library) args.add(lib.pic_static_library.path) if lib.static_library: inputs_list.append(lib.static_library) args.add(lib.static_library.path) if lib.dynamic_library: inputs_list.append(lib.dynamic_library) args.add('-ccopt', '-L' + lib.dynamic_library.dirname) args.add('-cclib', lib.dynamic_library.path) return [inputs_list, runfiles] def x(ctx, cc_deps_dict, default_linkmode, args, includes, cclib_deps, cc_runfiles): dfiles = dep[DefaultInfo].files.to_list() if len(dfiles) > 0: for f in dfiles: print(' %s' % f) cc_info = dep[CcInfo] compilation_ctx = cc_info.compilation_context linking_ctx = cc_info.linking_context linker_inputs = linking_ctx.linker_inputs.to_list() debug = False if debug: print('EXEC _handle_cc_deps %s' % ctx.label) print('CC_DEPS_DICT: %s' % cc_deps_dict) ccdeps = {} for ccdict in cclib_deps: for [dep, linkmode] in ccdict.items(): if dep in ccdeps.keys(): if debug: print('CCDEP DUP? %s' % dep) else: ccdeps.update({dep: linkmode}) for [dep, linkmode] in cc_deps_dict.items(): if debug: print('CCLIB DEP: ') print(dep) if linkmode == 'default': if debug: print('DEFAULT LINKMODE: %s' % default_linkmode) for depfile in dep.files.to_list(): if default_linkmode == 'static': if depfile.extension == 'a': args.add(depfile) cclib_deps.append(depfile) includes.append(depfile.dirname) else: for depfile in dep.files.to_list(): if depfile.extension == 'so': libname = file_to_lib_name(depfile) args.add('-ccopt', '-L' + depfile.dirname) args.add('-cclib', '-l' + libname) cclib_deps.append(depfile) elif depfile.extension == 'dylib': libname = file_to_lib_name(depfile) args.add('-cclib', '-l' + libname) args.add('-ccopt', '-L' + depfile.dirname) cclib_deps.append(depfile) cc_runfiles.append(dep.files) elif linkmode == 'static': if debug: print('STATIC lib: %s:' % dep) for depfile in dep.files.to_list(): if depfile.extension == 'a': args.add(depfile) cclib_deps.append(depfile) includes.append(depfile.dirname) elif linkmode == 'static-linkall': if debug: print('STATIC LINKALL lib: %s:' % dep) for depfile in dep.files.to_list(): if depfile.extension == 'a': cclib_deps.append(depfile) includes.append(depfile.dirname) if ctx.toolchains['@rules_ocaml//ocaml:toolchain'].cc_toolchain == 'clang': args.add('-ccopt', '-Wl,-force_load,{path}'.format(path=depfile.path)) elif ctx.toolchains['@rules_ocaml//ocaml:toolchain'].cc_toolchain == 'gcc': libname = file_to_lib_name(depfile) args.add('-ccopt', '-L{dir}'.format(dir=depfile.dirname)) args.add('-ccopt', '-Wl,--push-state,-whole-archive') args.add('-ccopt', '-l{lib}'.format(lib=libname)) args.add('-ccopt', '-Wl,--pop-state') else: fail('NO CC') elif linkmode == 'dynamic': if debug: print('DYNAMIC lib: %s' % dep) for depfile in dep.files.to_list(): if depfile.extension == 'so': libname = file_to_lib_name(depfile) print('so LIBNAME: %s' % libname) args.add('-ccopt', '-L' + depfile.dirname) args.add('-cclib', '-l' + libname) cclib_deps.append(depfile) elif depfile.extension == 'dylib': libname = file_to_lib_name(depfile) print('LIBNAME: %s:' % libname) args.add('-cclib', '-l' + libname) args.add('-ccopt', '-L' + depfile.dirname) cclib_deps.append(depfile) cc_runfiles.append(dep.files)
''' Created on Jan 22, 2013 @author: sesuskic ''' __all__ = ["ch_flt"] def ch_flt(filter_k): chflt_coe_list = { 1 : [-3, -4, 1, 15, 30, 27, -4, -55, -87, -49, 81, 271, 442, 511], # 305k BW (decim-8*3) original PRO2 # 1: [13 17 -8 -15 14 20 -27 -23 48 27 -94 -29 303 511 ]'; # 464k BW (decim-8*3, fil-1) for EZR2 tracking # 1: [9 -6 -26 -35 -13 29 50 13 -64 -101 -15 192 415 511]'; # 378k BW (decim-8*3, fil-3) for EZR2 tracking # 1: [-16 -9 8 34 51 38 -9 -69 -96 -44 95 284 447 511 ]'; # 302k BW (decim-8*3, fil-5) for EZR2 tracking 2 : [ 0, 3, 12, 22, 23, 5, -34, -72, -75, -11, 127, 304, 452, 511], 3 : [ 4, 10, 17, 18, 5, -22, -55, -71, -47, 33, 160, 304, 417, 460], 4 : [ 3, 7, 8, 2, -14, -37, -57, -56, -18, 63, 175, 294, 385, 418], 5 : [ 3, 3, 0, -10, -26, -42, -50, -35, 11, 88, 186, 283, 356, 382], 6 : [ 1, -2, -9, -20, -33, -42, -37, -12, 37, 109, 192, 271, 327, 347], 7 : [-3, -10, -19, -29, -36, -36, -20, 12, 63, 127, 195, 256, 299, 313], 8 : [-5, -10, -18, -24, -26, -20, -1, 33, 80, 136, 194, 244, 279, 291], 9 : [-4, -8, -14, -17, -17, -8, 11, 43, 85, 134, 185, 228, 257, 268], 10 : [-4, -7, -10, -12, -9, 1, 21, 51, 89, 134, 177, 215, 240, 249], 11 : [-3, -6, -7, -7, -2, 10, 30, 58, 93, 132, 170, 202, 223, 231], #11: [2 13 26 50 83 126 179 240 304 367 424 469 498 508 ]'; # for ETSI class-1 169MHz 12.5k channel 12 : [-3, -3, -3, -1, 6, 19, 39, 65, 97, 130, 163, 190, 208, 214], 13 : [-2, -1, 0, 5, 14, 27, 47, 71, 99, 128, 156, 178, 193, 198], 14 : [-1, 2, 5, 2, 22, 37, 55, 77, 101, 125, 147, 165, 176, 180], 15 : [ 2, 6, 11, 20, 31, 46, 63, 82, 102, 121, 138, 151, 160, 162] } return [x+2**10 for x in chflt_coe_list.get(filter_k, chflt_coe_list[1])][::-1]
""" Created on Jan 22, 2013 @author: sesuskic """ __all__ = ['ch_flt'] def ch_flt(filter_k): chflt_coe_list = {1: [-3, -4, 1, 15, 30, 27, -4, -55, -87, -49, 81, 271, 442, 511], 2: [0, 3, 12, 22, 23, 5, -34, -72, -75, -11, 127, 304, 452, 511], 3: [4, 10, 17, 18, 5, -22, -55, -71, -47, 33, 160, 304, 417, 460], 4: [3, 7, 8, 2, -14, -37, -57, -56, -18, 63, 175, 294, 385, 418], 5: [3, 3, 0, -10, -26, -42, -50, -35, 11, 88, 186, 283, 356, 382], 6: [1, -2, -9, -20, -33, -42, -37, -12, 37, 109, 192, 271, 327, 347], 7: [-3, -10, -19, -29, -36, -36, -20, 12, 63, 127, 195, 256, 299, 313], 8: [-5, -10, -18, -24, -26, -20, -1, 33, 80, 136, 194, 244, 279, 291], 9: [-4, -8, -14, -17, -17, -8, 11, 43, 85, 134, 185, 228, 257, 268], 10: [-4, -7, -10, -12, -9, 1, 21, 51, 89, 134, 177, 215, 240, 249], 11: [-3, -6, -7, -7, -2, 10, 30, 58, 93, 132, 170, 202, 223, 231], 12: [-3, -3, -3, -1, 6, 19, 39, 65, 97, 130, 163, 190, 208, 214], 13: [-2, -1, 0, 5, 14, 27, 47, 71, 99, 128, 156, 178, 193, 198], 14: [-1, 2, 5, 2, 22, 37, 55, 77, 101, 125, 147, 165, 176, 180], 15: [2, 6, 11, 20, 31, 46, 63, 82, 102, 121, 138, 151, 160, 162]} return [x + 2 ** 10 for x in chflt_coe_list.get(filter_k, chflt_coe_list[1])][::-1]
N = int(input()) A = [0] + [int(a) for a in input().split()] B = [0] + [int(a) for a in input().split()] C = [0] + [int(a) for a in input().split()] previous = -1 satisfaction = 0 for a in A[1:]: satisfaction += B[a] if previous == a-1: satisfaction += C[a-1] previous = a print(satisfaction)
n = int(input()) a = [0] + [int(a) for a in input().split()] b = [0] + [int(a) for a in input().split()] c = [0] + [int(a) for a in input().split()] previous = -1 satisfaction = 0 for a in A[1:]: satisfaction += B[a] if previous == a - 1: satisfaction += C[a - 1] previous = a print(satisfaction)
#!/usr/bin/python # Filename: ex_for_before.py print('Hello') print('Hello') print('Hello') print('Hello') print('Hello')
print('Hello') print('Hello') print('Hello') print('Hello') print('Hello')
class Solution: def smallestRange(self, nums: List[List[int]]) -> List[int]: lo, hi = -100000, 100000 pq = [(lst[0], i, 1) for i, lst in enumerate(nums)] heapq.heapify(pq) right = max(lst[0] for lst in nums) while len(pq) == len(nums): mn, idx, nxt = heapq.heappop(pq) if right - mn < hi - lo: lo = mn hi = right if nxt < len(nums[idx]): right = max(right, nums[idx][nxt]) heapq.heappush(pq, (nums[idx][nxt], idx, nxt + 1)) return [lo, hi]
class Solution: def smallest_range(self, nums: List[List[int]]) -> List[int]: (lo, hi) = (-100000, 100000) pq = [(lst[0], i, 1) for (i, lst) in enumerate(nums)] heapq.heapify(pq) right = max((lst[0] for lst in nums)) while len(pq) == len(nums): (mn, idx, nxt) = heapq.heappop(pq) if right - mn < hi - lo: lo = mn hi = right if nxt < len(nums[idx]): right = max(right, nums[idx][nxt]) heapq.heappush(pq, (nums[idx][nxt], idx, nxt + 1)) return [lo, hi]
# Copyright (C) 2021 Anthony Harrison # SPDX-License-Identifier: MIT VERSION: str = "0.1"
version: str = '0.1'
NEGATIVE_CONSTRUCTS = set([ "ain't", "can't", "cannot" "don't" "isn't" "mustn't", "needn't", "neither", "never", "no", "nobody", "none", "nothing", "nowhere" "shan't", "shouldn't", "wasn't" "weren't", "won't" ]) URLS = r'(https?:\/\/(?:www\.|(?!www))[a-zA-Z0-9][a-zA-Z0-9-]+' \ '[a-zA-Z0-9]\.[^\s]{2,}|www\.[a-zA-Z0-9][a-zA-Z0-9-]+' \ '[a-zA-Z0-9]\.[^\s]{2,}|https?:\/\/(?:www\.|(?!www))[a-zA-Z0-9]\.' \ '[^\s]{2,}|www\.[a-zA-Z0-9]\.[^\s]{2,})' POSITIVE_EMOTICONS = set([ ':-)', ':)', ':-]', ':-3', ':3', ':^)', '8-)', '8)', '=]', '=)', ':-D', ':D', ':-))' ]) NEGATIVE_EMOTICONS = set([ ':-(', ':(', ':-c', ':c', ':<', ':[', ':''-(', ':-[', ':-||', '>:[', ':{', '>:(', ':-|', ':|', ':/', ':-/', ':\'', '>:/', ':S' ])
negative_constructs = set(["ain't", "can't", "cannotdon'tisn'tmustn't", "needn't", 'neither', 'never', 'no', 'nobody', 'none', 'nothing', "nowhereshan't", "shouldn't", "wasn'tweren't", "won't"]) urls = '(https?:\\/\\/(?:www\\.|(?!www))[a-zA-Z0-9][a-zA-Z0-9-]+[a-zA-Z0-9]\\.[^\\s]{2,}|www\\.[a-zA-Z0-9][a-zA-Z0-9-]+[a-zA-Z0-9]\\.[^\\s]{2,}|https?:\\/\\/(?:www\\.|(?!www))[a-zA-Z0-9]\\.[^\\s]{2,}|www\\.[a-zA-Z0-9]\\.[^\\s]{2,})' positive_emoticons = set([':-)', ':)', ':-]', ':-3', ':3', ':^)', '8-)', '8)', '=]', '=)', ':-D', ':D', ':-))']) negative_emoticons = set([':-(', ':(', ':-c', ':c', ':<', ':[', ':-(', ':-[', ':-||', '>:[', ':{', '>:(', ':-|', ':|', ':/', ':-/', ":'", '>:/', ':S'])
class Configuration: port = 5672 security_mechanisms = 'PLAIN' version_major = 0 version_minor = 9 amqp_version = (0, 0, 9, 1) secure_response = '' client_properties = {'client': 'amqpsfw:0.1'} server_properties = {'server': 'amqpsfw:0.1'} secure_challenge = 'tratata'
class Configuration: port = 5672 security_mechanisms = 'PLAIN' version_major = 0 version_minor = 9 amqp_version = (0, 0, 9, 1) secure_response = '' client_properties = {'client': 'amqpsfw:0.1'} server_properties = {'server': 'amqpsfw:0.1'} secure_challenge = 'tratata'
# -*- coding: utf-8 -*- class MissingSender(Exception): pass class WrongSenderSecret(Exception): pass class NotAllowed(Exception): pass class MissingProject(Exception): pass class MissingAction(Exception): pass
class Missingsender(Exception): pass class Wrongsendersecret(Exception): pass class Notallowed(Exception): pass class Missingproject(Exception): pass class Missingaction(Exception): pass
# O(j +d) Time and space def topologicalSort(jobs, deps): # We will use a class to define the graph: jobGraph = createJobGraph(jobs, deps) # Helper function: return getOrderedJobs(jobGraph) def getOrderedJobs(jobGraph): orderedJobs = [] # In this case, we need to take the nodes with NO prereqs nodesWithNoPrereqs = list(filter(lambda node: node.numbOfPrereqs == 0, jobGraph.nodes)) # so long as we have a list with elements of no prereqs, we append it directly to ordered jobs, # AND remove the deps while len(nodesWithNoPrereqs): node = nodesWithNoPrereqs.pop() orderedJobs.append(node.jobs) removeDeps(node, nodesWithNoPrereqs) # here, we know for a fact that we will have at least one node where the num of dependecies is zero # therefore if any of the nodes have a truthy value, return graphHasEdges = any(node.numbOfPrereqs for node in jobGraph.nodes) return [] if graphHasEdges else orderedJobs def removeDeps(node, nodesWithNoPrereqs): # remove the deps of the current node, since we are deleting it while len(node.deps): dep = node.deps.pop() # same technique; we pop the deps and do -1 to all of them until finished dep.numbOfPrereqs -= 1 if dep.numbOfPrereqs == 0: nodesWithNoPrereqs.append(dep) def createJobGraph(jobs, deps): # initialize graph with: list of JobNodes and a dictionary that maps the the jobNode with a job graph = JobGraph(jobs) # (x,y) -> y depends on x, so we use this approach now, and using the addDep the pre-reqs of x is +1 for job, deps in deps: #add a prereq in the job seen graph.addDep(job, deps) return graph class JobGraph: # IMPORTANT: Job is the element itself; the Node contains more info, such as prereqs, if visited or not, etc. def __init__(self,jobs): self.nodes = [] # will contain the graph itself, with the edges and dependencies self.graph = {} # will map values to other values, map jobs to their nodes # basically graph lists {1: <JobNode 1>, 2: <JobNode 2>,...} and node=[<JobNode 1>, <JobNode 2>...] for job in jobs: # for each job [1,2,...] we will add the nodes , which contains the info of the job and pre-requisites # from a JobNode object. self.addNode(job) def addNode(self, job): self.graph[job] = JobNode(job) self.nodes.append(self.graph[job]) def addDep(self, job, dep): # get the node from job; get the node that reference to the prereq and simply append the latter to the job prereq field. jobNode = self.getNode(job) depNode = self.getNode(dep) jobNode.deps.append(depNode) # include the new prereq number depNode.numbOfPrereqs += 1 def getNode(self, job): if job not in self.graph: self.addNode(job) # the method simply serves a lookup dictionary # and returns a JobNode object return self.graph[job] class JobNode: def __init__(self, job): self.jobs = job # now, we use dependencies instead of pre-reqs (is an inversion of what we had before) self.deps = [] # we define the number of pre-reqs of the current Node self.numbOfPrereqs = 0
def topological_sort(jobs, deps): job_graph = create_job_graph(jobs, deps) return get_ordered_jobs(jobGraph) def get_ordered_jobs(jobGraph): ordered_jobs = [] nodes_with_no_prereqs = list(filter(lambda node: node.numbOfPrereqs == 0, jobGraph.nodes)) while len(nodesWithNoPrereqs): node = nodesWithNoPrereqs.pop() orderedJobs.append(node.jobs) remove_deps(node, nodesWithNoPrereqs) graph_has_edges = any((node.numbOfPrereqs for node in jobGraph.nodes)) return [] if graphHasEdges else orderedJobs def remove_deps(node, nodesWithNoPrereqs): while len(node.deps): dep = node.deps.pop() dep.numbOfPrereqs -= 1 if dep.numbOfPrereqs == 0: nodesWithNoPrereqs.append(dep) def create_job_graph(jobs, deps): graph = job_graph(jobs) for (job, deps) in deps: graph.addDep(job, deps) return graph class Jobgraph: def __init__(self, jobs): self.nodes = [] self.graph = {} for job in jobs: self.addNode(job) def add_node(self, job): self.graph[job] = job_node(job) self.nodes.append(self.graph[job]) def add_dep(self, job, dep): job_node = self.getNode(job) dep_node = self.getNode(dep) jobNode.deps.append(depNode) depNode.numbOfPrereqs += 1 def get_node(self, job): if job not in self.graph: self.addNode(job) return self.graph[job] class Jobnode: def __init__(self, job): self.jobs = job self.deps = [] self.numbOfPrereqs = 0
mystr = "Anupam" newstr = "" # Iterating the loop in backward direction. # for char in mystr[::-1]: for char in reversed(mystr): newstr = newstr + char print(newstr)
mystr = 'Anupam' newstr = '' for char in reversed(mystr): newstr = newstr + char print(newstr)
# # PySNMP MIB module F3-TIMEZONE-MIB (http://snmplabs.com/pysmi) # ASN.1 source file:///Users/davwang4/Dev/mibs.snmplabs.com/asn1/F3-TIMEZONE-MIB # Produced by pysmi-0.3.4 at Wed May 1 13:11:37 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) # fsp150cm, = mibBuilder.importSymbols("ADVA-MIB", "fsp150cm") OctetString, Integer, ObjectIdentifier = mibBuilder.importSymbols("ASN1", "OctetString", "Integer", "ObjectIdentifier") NamedValues, = mibBuilder.importSymbols("ASN1-ENUMERATION", "NamedValues") SingleValueConstraint, ConstraintsUnion, ValueSizeConstraint, ConstraintsIntersection, ValueRangeConstraint = mibBuilder.importSymbols("ASN1-REFINEMENT", "SingleValueConstraint", "ConstraintsUnion", "ValueSizeConstraint", "ConstraintsIntersection", "ValueRangeConstraint") NotificationGroup, ModuleCompliance, ObjectGroup = mibBuilder.importSymbols("SNMPv2-CONF", "NotificationGroup", "ModuleCompliance", "ObjectGroup") ObjectIdentity, NotificationType, Counter64, MibIdentifier, MibScalar, MibTable, MibTableRow, MibTableColumn, TimeTicks, Unsigned32, IpAddress, Gauge32, Bits, ModuleIdentity, Counter32, Integer32, iso = mibBuilder.importSymbols("SNMPv2-SMI", "ObjectIdentity", "NotificationType", "Counter64", "MibIdentifier", "MibScalar", "MibTable", "MibTableRow", "MibTableColumn", "TimeTicks", "Unsigned32", "IpAddress", "Gauge32", "Bits", "ModuleIdentity", "Counter32", "Integer32", "iso") TextualConvention, TruthValue, DisplayString = mibBuilder.importSymbols("SNMPv2-TC", "TextualConvention", "TruthValue", "DisplayString") f3TimeZoneMIB = ModuleIdentity((1, 3, 6, 1, 4, 1, 2544, 1, 12, 32)) f3TimeZoneMIB.setRevisions(('2014-06-05 00:00',)) if getattr(mibBuilder, 'version', (0, 0, 0)) > (4, 4, 0): if mibBuilder.loadTexts: f3TimeZoneMIB.setRevisionsDescriptions((' Notes from release 201406050000Z, (1) MIB version ready for release FSP150CC 6.5.CC.',)) if mibBuilder.loadTexts: f3TimeZoneMIB.setLastUpdated('201406050000Z') if mibBuilder.loadTexts: f3TimeZoneMIB.setOrganization('ADVA Optical Networking') if mibBuilder.loadTexts: f3TimeZoneMIB.setContactInfo(' Michal Pawlowski ADVA Optical Networking, Inc. Tel: +48 58 7716 416 E-mail: [email protected] Postal: ul. Slaska 35/37 81-310 Gdynia, Poland') if mibBuilder.loadTexts: f3TimeZoneMIB.setDescription('This module defines the Time Zone MIB definitions used by the F3 (FSP150CM/CC) product lines. Copyright (C) ADVA Optical Networking.') f3TimeZoneConfigObjects = MibIdentifier((1, 3, 6, 1, 4, 1, 2544, 1, 12, 32, 1)) f3TimeZoneConformance = MibIdentifier((1, 3, 6, 1, 4, 1, 2544, 1, 12, 32, 2)) class MonthOfYear(TextualConvention, Integer32): description = 'Month of year.' status = 'current' subtypeSpec = Integer32.subtypeSpec + ConstraintsUnion(SingleValueConstraint(1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12)) namedValues = NamedValues(("january", 1), ("february", 2), ("march", 3), ("april", 4), ("may", 5), ("june", 6), ("july", 7), ("august", 8), ("september", 9), ("october", 10), ("november", 11), ("december", 12)) f3TimeZoneUtcOffset = MibScalar((1, 3, 6, 1, 4, 1, 2544, 1, 12, 32, 1, 1), DisplayString()).setMaxAccess("readwrite") if mibBuilder.loadTexts: f3TimeZoneUtcOffset.setStatus('current') if mibBuilder.loadTexts: f3TimeZoneUtcOffset.setDescription('This object provides the ability to set UTC offset.') f3TimeZoneDstControlEnabled = MibScalar((1, 3, 6, 1, 4, 1, 2544, 1, 12, 32, 1, 2), TruthValue()).setMaxAccess("readwrite") if mibBuilder.loadTexts: f3TimeZoneDstControlEnabled.setStatus('current') if mibBuilder.loadTexts: f3TimeZoneDstControlEnabled.setDescription('This object provides the ability to toggle DST functionality.') f3TimeZoneDstUtcOffset = MibScalar((1, 3, 6, 1, 4, 1, 2544, 1, 12, 32, 1, 3), DisplayString()).setMaxAccess("readwrite") if mibBuilder.loadTexts: f3TimeZoneDstUtcOffset.setStatus('current') if mibBuilder.loadTexts: f3TimeZoneDstUtcOffset.setDescription('This object provides the ability to set DST Offset which is the Daylight Savings Time offset from Local Time.') f3TimeZoneDstStartMonth = MibScalar((1, 3, 6, 1, 4, 1, 2544, 1, 12, 32, 1, 4), MonthOfYear()).setMaxAccess("readwrite") if mibBuilder.loadTexts: f3TimeZoneDstStartMonth.setStatus('current') if mibBuilder.loadTexts: f3TimeZoneDstStartMonth.setDescription('This object provides the ability to set DST start month.') f3TimeZoneDstStartDay = MibScalar((1, 3, 6, 1, 4, 1, 2544, 1, 12, 32, 1, 5), DisplayString()).setMaxAccess("readwrite") if mibBuilder.loadTexts: f3TimeZoneDstStartDay.setStatus('current') if mibBuilder.loadTexts: f3TimeZoneDstStartDay.setDescription('This object provides the ability to set DST start day.') f3TimeZoneDstStartTime = MibScalar((1, 3, 6, 1, 4, 1, 2544, 1, 12, 32, 1, 6), DisplayString()).setMaxAccess("readwrite") if mibBuilder.loadTexts: f3TimeZoneDstStartTime.setStatus('current') if mibBuilder.loadTexts: f3TimeZoneDstStartTime.setDescription('This object provides the ability to set DST start time.') f3TimeZoneDstEndMonth = MibScalar((1, 3, 6, 1, 4, 1, 2544, 1, 12, 32, 1, 7), MonthOfYear()).setMaxAccess("readwrite") if mibBuilder.loadTexts: f3TimeZoneDstEndMonth.setStatus('current') if mibBuilder.loadTexts: f3TimeZoneDstEndMonth.setDescription('This object provides the ability to set DST end month.') f3TimeZoneDstEndDay = MibScalar((1, 3, 6, 1, 4, 1, 2544, 1, 12, 32, 1, 8), DisplayString()).setMaxAccess("readwrite") if mibBuilder.loadTexts: f3TimeZoneDstEndDay.setStatus('current') if mibBuilder.loadTexts: f3TimeZoneDstEndDay.setDescription('This object provides the ability to set DST end day.') f3TimeZoneDstEndTime = MibScalar((1, 3, 6, 1, 4, 1, 2544, 1, 12, 32, 1, 9), DisplayString()).setMaxAccess("readwrite") if mibBuilder.loadTexts: f3TimeZoneDstEndTime.setStatus('current') if mibBuilder.loadTexts: f3TimeZoneDstEndTime.setDescription('This object provides the ability to set DST end time.') f3TimeZoneCompliances = MibIdentifier((1, 3, 6, 1, 4, 1, 2544, 1, 12, 32, 2, 1)) f3TimeZoneGroups = MibIdentifier((1, 3, 6, 1, 4, 1, 2544, 1, 12, 32, 2, 2)) f3TimeZoneCompliance = ModuleCompliance((1, 3, 6, 1, 4, 1, 2544, 1, 12, 32, 2, 1, 1)).setObjects(("F3-TIMEZONE-MIB", "f3TimeZoneConfigGroup")) if getattr(mibBuilder, 'version', (0, 0, 0)) > (4, 4, 0): f3TimeZoneCompliance = f3TimeZoneCompliance.setStatus('current') if mibBuilder.loadTexts: f3TimeZoneCompliance.setDescription('Describes the requirements for conformance to the F3-TIMEZONE-MIB compliance.') f3TimeZoneConfigGroup = ObjectGroup((1, 3, 6, 1, 4, 1, 2544, 1, 12, 32, 2, 2, 1)).setObjects(("F3-TIMEZONE-MIB", "f3TimeZoneUtcOffset"), ("F3-TIMEZONE-MIB", "f3TimeZoneDstControlEnabled"), ("F3-TIMEZONE-MIB", "f3TimeZoneDstUtcOffset"), ("F3-TIMEZONE-MIB", "f3TimeZoneDstStartMonth"), ("F3-TIMEZONE-MIB", "f3TimeZoneDstStartDay"), ("F3-TIMEZONE-MIB", "f3TimeZoneDstStartTime"), ("F3-TIMEZONE-MIB", "f3TimeZoneDstEndMonth"), ("F3-TIMEZONE-MIB", "f3TimeZoneDstEndDay"), ("F3-TIMEZONE-MIB", "f3TimeZoneDstEndTime")) if getattr(mibBuilder, 'version', (0, 0, 0)) > (4, 4, 0): f3TimeZoneConfigGroup = f3TimeZoneConfigGroup.setStatus('current') if mibBuilder.loadTexts: f3TimeZoneConfigGroup.setDescription('A collection of objects used to manage the Time Zone.') mibBuilder.exportSymbols("F3-TIMEZONE-MIB", f3TimeZoneDstControlEnabled=f3TimeZoneDstControlEnabled, f3TimeZoneDstStartMonth=f3TimeZoneDstStartMonth, MonthOfYear=MonthOfYear, f3TimeZoneDstStartDay=f3TimeZoneDstStartDay, PYSNMP_MODULE_ID=f3TimeZoneMIB, f3TimeZoneUtcOffset=f3TimeZoneUtcOffset, f3TimeZoneDstUtcOffset=f3TimeZoneDstUtcOffset, f3TimeZoneDstEndDay=f3TimeZoneDstEndDay, f3TimeZoneCompliances=f3TimeZoneCompliances, f3TimeZoneGroups=f3TimeZoneGroups, f3TimeZoneCompliance=f3TimeZoneCompliance, f3TimeZoneDstEndTime=f3TimeZoneDstEndTime, f3TimeZoneConfigObjects=f3TimeZoneConfigObjects, f3TimeZoneDstEndMonth=f3TimeZoneDstEndMonth, f3TimeZoneConfigGroup=f3TimeZoneConfigGroup, f3TimeZoneDstStartTime=f3TimeZoneDstStartTime, f3TimeZoneConformance=f3TimeZoneConformance, f3TimeZoneMIB=f3TimeZoneMIB)
(fsp150cm,) = mibBuilder.importSymbols('ADVA-MIB', 'fsp150cm') (octet_string, integer, object_identifier) = mibBuilder.importSymbols('ASN1', 'OctetString', 'Integer', 'ObjectIdentifier') (named_values,) = mibBuilder.importSymbols('ASN1-ENUMERATION', 'NamedValues') (single_value_constraint, constraints_union, value_size_constraint, constraints_intersection, value_range_constraint) = mibBuilder.importSymbols('ASN1-REFINEMENT', 'SingleValueConstraint', 'ConstraintsUnion', 'ValueSizeConstraint', 'ConstraintsIntersection', 'ValueRangeConstraint') (notification_group, module_compliance, object_group) = mibBuilder.importSymbols('SNMPv2-CONF', 'NotificationGroup', 'ModuleCompliance', 'ObjectGroup') (object_identity, notification_type, counter64, mib_identifier, mib_scalar, mib_table, mib_table_row, mib_table_column, time_ticks, unsigned32, ip_address, gauge32, bits, module_identity, counter32, integer32, iso) = mibBuilder.importSymbols('SNMPv2-SMI', 'ObjectIdentity', 'NotificationType', 'Counter64', 'MibIdentifier', 'MibScalar', 'MibTable', 'MibTableRow', 'MibTableColumn', 'TimeTicks', 'Unsigned32', 'IpAddress', 'Gauge32', 'Bits', 'ModuleIdentity', 'Counter32', 'Integer32', 'iso') (textual_convention, truth_value, display_string) = mibBuilder.importSymbols('SNMPv2-TC', 'TextualConvention', 'TruthValue', 'DisplayString') f3_time_zone_mib = module_identity((1, 3, 6, 1, 4, 1, 2544, 1, 12, 32)) f3TimeZoneMIB.setRevisions(('2014-06-05 00:00',)) if getattr(mibBuilder, 'version', (0, 0, 0)) > (4, 4, 0): if mibBuilder.loadTexts: f3TimeZoneMIB.setRevisionsDescriptions((' Notes from release 201406050000Z, (1) MIB version ready for release FSP150CC 6.5.CC.',)) if mibBuilder.loadTexts: f3TimeZoneMIB.setLastUpdated('201406050000Z') if mibBuilder.loadTexts: f3TimeZoneMIB.setOrganization('ADVA Optical Networking') if mibBuilder.loadTexts: f3TimeZoneMIB.setContactInfo(' Michal Pawlowski ADVA Optical Networking, Inc. Tel: +48 58 7716 416 E-mail: [email protected] Postal: ul. Slaska 35/37 81-310 Gdynia, Poland') if mibBuilder.loadTexts: f3TimeZoneMIB.setDescription('This module defines the Time Zone MIB definitions used by the F3 (FSP150CM/CC) product lines. Copyright (C) ADVA Optical Networking.') f3_time_zone_config_objects = mib_identifier((1, 3, 6, 1, 4, 1, 2544, 1, 12, 32, 1)) f3_time_zone_conformance = mib_identifier((1, 3, 6, 1, 4, 1, 2544, 1, 12, 32, 2)) class Monthofyear(TextualConvention, Integer32): description = 'Month of year.' status = 'current' subtype_spec = Integer32.subtypeSpec + constraints_union(single_value_constraint(1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12)) named_values = named_values(('january', 1), ('february', 2), ('march', 3), ('april', 4), ('may', 5), ('june', 6), ('july', 7), ('august', 8), ('september', 9), ('october', 10), ('november', 11), ('december', 12)) f3_time_zone_utc_offset = mib_scalar((1, 3, 6, 1, 4, 1, 2544, 1, 12, 32, 1, 1), display_string()).setMaxAccess('readwrite') if mibBuilder.loadTexts: f3TimeZoneUtcOffset.setStatus('current') if mibBuilder.loadTexts: f3TimeZoneUtcOffset.setDescription('This object provides the ability to set UTC offset.') f3_time_zone_dst_control_enabled = mib_scalar((1, 3, 6, 1, 4, 1, 2544, 1, 12, 32, 1, 2), truth_value()).setMaxAccess('readwrite') if mibBuilder.loadTexts: f3TimeZoneDstControlEnabled.setStatus('current') if mibBuilder.loadTexts: f3TimeZoneDstControlEnabled.setDescription('This object provides the ability to toggle DST functionality.') f3_time_zone_dst_utc_offset = mib_scalar((1, 3, 6, 1, 4, 1, 2544, 1, 12, 32, 1, 3), display_string()).setMaxAccess('readwrite') if mibBuilder.loadTexts: f3TimeZoneDstUtcOffset.setStatus('current') if mibBuilder.loadTexts: f3TimeZoneDstUtcOffset.setDescription('This object provides the ability to set DST Offset which is the Daylight Savings Time offset from Local Time.') f3_time_zone_dst_start_month = mib_scalar((1, 3, 6, 1, 4, 1, 2544, 1, 12, 32, 1, 4), month_of_year()).setMaxAccess('readwrite') if mibBuilder.loadTexts: f3TimeZoneDstStartMonth.setStatus('current') if mibBuilder.loadTexts: f3TimeZoneDstStartMonth.setDescription('This object provides the ability to set DST start month.') f3_time_zone_dst_start_day = mib_scalar((1, 3, 6, 1, 4, 1, 2544, 1, 12, 32, 1, 5), display_string()).setMaxAccess('readwrite') if mibBuilder.loadTexts: f3TimeZoneDstStartDay.setStatus('current') if mibBuilder.loadTexts: f3TimeZoneDstStartDay.setDescription('This object provides the ability to set DST start day.') f3_time_zone_dst_start_time = mib_scalar((1, 3, 6, 1, 4, 1, 2544, 1, 12, 32, 1, 6), display_string()).setMaxAccess('readwrite') if mibBuilder.loadTexts: f3TimeZoneDstStartTime.setStatus('current') if mibBuilder.loadTexts: f3TimeZoneDstStartTime.setDescription('This object provides the ability to set DST start time.') f3_time_zone_dst_end_month = mib_scalar((1, 3, 6, 1, 4, 1, 2544, 1, 12, 32, 1, 7), month_of_year()).setMaxAccess('readwrite') if mibBuilder.loadTexts: f3TimeZoneDstEndMonth.setStatus('current') if mibBuilder.loadTexts: f3TimeZoneDstEndMonth.setDescription('This object provides the ability to set DST end month.') f3_time_zone_dst_end_day = mib_scalar((1, 3, 6, 1, 4, 1, 2544, 1, 12, 32, 1, 8), display_string()).setMaxAccess('readwrite') if mibBuilder.loadTexts: f3TimeZoneDstEndDay.setStatus('current') if mibBuilder.loadTexts: f3TimeZoneDstEndDay.setDescription('This object provides the ability to set DST end day.') f3_time_zone_dst_end_time = mib_scalar((1, 3, 6, 1, 4, 1, 2544, 1, 12, 32, 1, 9), display_string()).setMaxAccess('readwrite') if mibBuilder.loadTexts: f3TimeZoneDstEndTime.setStatus('current') if mibBuilder.loadTexts: f3TimeZoneDstEndTime.setDescription('This object provides the ability to set DST end time.') f3_time_zone_compliances = mib_identifier((1, 3, 6, 1, 4, 1, 2544, 1, 12, 32, 2, 1)) f3_time_zone_groups = mib_identifier((1, 3, 6, 1, 4, 1, 2544, 1, 12, 32, 2, 2)) f3_time_zone_compliance = module_compliance((1, 3, 6, 1, 4, 1, 2544, 1, 12, 32, 2, 1, 1)).setObjects(('F3-TIMEZONE-MIB', 'f3TimeZoneConfigGroup')) if getattr(mibBuilder, 'version', (0, 0, 0)) > (4, 4, 0): f3_time_zone_compliance = f3TimeZoneCompliance.setStatus('current') if mibBuilder.loadTexts: f3TimeZoneCompliance.setDescription('Describes the requirements for conformance to the F3-TIMEZONE-MIB compliance.') f3_time_zone_config_group = object_group((1, 3, 6, 1, 4, 1, 2544, 1, 12, 32, 2, 2, 1)).setObjects(('F3-TIMEZONE-MIB', 'f3TimeZoneUtcOffset'), ('F3-TIMEZONE-MIB', 'f3TimeZoneDstControlEnabled'), ('F3-TIMEZONE-MIB', 'f3TimeZoneDstUtcOffset'), ('F3-TIMEZONE-MIB', 'f3TimeZoneDstStartMonth'), ('F3-TIMEZONE-MIB', 'f3TimeZoneDstStartDay'), ('F3-TIMEZONE-MIB', 'f3TimeZoneDstStartTime'), ('F3-TIMEZONE-MIB', 'f3TimeZoneDstEndMonth'), ('F3-TIMEZONE-MIB', 'f3TimeZoneDstEndDay'), ('F3-TIMEZONE-MIB', 'f3TimeZoneDstEndTime')) if getattr(mibBuilder, 'version', (0, 0, 0)) > (4, 4, 0): f3_time_zone_config_group = f3TimeZoneConfigGroup.setStatus('current') if mibBuilder.loadTexts: f3TimeZoneConfigGroup.setDescription('A collection of objects used to manage the Time Zone.') mibBuilder.exportSymbols('F3-TIMEZONE-MIB', f3TimeZoneDstControlEnabled=f3TimeZoneDstControlEnabled, f3TimeZoneDstStartMonth=f3TimeZoneDstStartMonth, MonthOfYear=MonthOfYear, f3TimeZoneDstStartDay=f3TimeZoneDstStartDay, PYSNMP_MODULE_ID=f3TimeZoneMIB, f3TimeZoneUtcOffset=f3TimeZoneUtcOffset, f3TimeZoneDstUtcOffset=f3TimeZoneDstUtcOffset, f3TimeZoneDstEndDay=f3TimeZoneDstEndDay, f3TimeZoneCompliances=f3TimeZoneCompliances, f3TimeZoneGroups=f3TimeZoneGroups, f3TimeZoneCompliance=f3TimeZoneCompliance, f3TimeZoneDstEndTime=f3TimeZoneDstEndTime, f3TimeZoneConfigObjects=f3TimeZoneConfigObjects, f3TimeZoneDstEndMonth=f3TimeZoneDstEndMonth, f3TimeZoneConfigGroup=f3TimeZoneConfigGroup, f3TimeZoneDstStartTime=f3TimeZoneDstStartTime, f3TimeZoneConformance=f3TimeZoneConformance, f3TimeZoneMIB=f3TimeZoneMIB)
def setup (): size (500, 500) smooth () background(255) strokeWeight(30) noLoop () def draw (): stroke(20) line(50*1,200,150+50*0,300) line(50*2,200,150+50*1,300) line(50*3,200,150+50*2,300)
def setup(): size(500, 500) smooth() background(255) stroke_weight(30) no_loop() def draw(): stroke(20) line(50 * 1, 200, 150 + 50 * 0, 300) line(50 * 2, 200, 150 + 50 * 1, 300) line(50 * 3, 200, 150 + 50 * 2, 300)
def validate_pin(pin): if (len(pin) == 4 or len(pin) == 6) and pin.isdigit(): return True else: return False
def validate_pin(pin): if (len(pin) == 4 or len(pin) == 6) and pin.isdigit(): return True else: return False
def moveElementToEnd(array, toMove): # Write your code here. left = 0 right = len(array) - 1 while left < right: if array[right] == toMove: right -= 1 elif array[left] != toMove: left += 1 elif array[left] == toMove: array[left], array[right] = array[right], array[left] left += 1 right -= 1 return array
def move_element_to_end(array, toMove): left = 0 right = len(array) - 1 while left < right: if array[right] == toMove: right -= 1 elif array[left] != toMove: left += 1 elif array[left] == toMove: (array[left], array[right]) = (array[right], array[left]) left += 1 right -= 1 return array
people = [ {"name": "Harry", "house":"Gryffibdor"}, {"name": "Ron", "house":"Ravenclaw"}, {"name": "Hermione", "house":"Gryffibdor"} ] # def f(person): # return person["house"] people.sort(key=lambda person: person["house"]) print(people)
people = [{'name': 'Harry', 'house': 'Gryffibdor'}, {'name': 'Ron', 'house': 'Ravenclaw'}, {'name': 'Hermione', 'house': 'Gryffibdor'}] people.sort(key=lambda person: person['house']) print(people)
#!/usr/bin/env python # -*- coding: utf-8 -*- PIXEL_ON = '#' PIXEL_OFF = '.' GROWTH_PER_ITERATION = 3 ITERATIONS_PART_ONE = 2 ITERATIONS_PART_TWO = 50 def filter_to_integer(image, x, y, default_value): # The image enhancement algorithm describes how to enhance an image by simultaneously # converting all pixels in the input image into an output image. Each pixel of the # output image is determined by looking at a 3x3 square of pixels centered on the # corresponding input image pixel. integer = 0 for y_local in range(y - 1, y + 2): for x_local in range(x - 1, x + 2): # These nine input pixels are combined into a single binary number # that is used as an index in the image enhancement algorithm string. integer <<= 1 if image.get((x_local, y_local), default_value) == PIXEL_ON: integer += 1 return integer def run_filter(i, default_value): # Scan a 3x3 area for each pixel in the image we're going to generate. # Because our filter is sneaky and lights up infinite pixels sometimes, # we'll provide a default value for what we expect in the image if we # don't get a hit. new_image = {} for x in range(0 - (GROWTH_PER_ITERATION * iteration), image_size_x + (GROWTH_PER_ITERATION * iteration) + 1): for y in range(0 - (GROWTH_PER_ITERATION * iteration), image_size_y + (GROWTH_PER_ITERATION * iteration) + 1): filter_index = filter_to_integer(i, x, y, default_value) new_image[(x, y)] = enhancement_algo[filter_index] return new_image def lit_pixels(image): pixel_count = 0 for pixel in image: if image[pixel] == PIXEL_ON: pixel_count += 1 return pixel_count # Parse the ocean trench map file with open('day20_input.txt') as f: lines = [line.rstrip('\n') for line in f] # The first section is the image enhancement algorithm. It is normally given on a single line, # but it has been wrapped to multiple lines in this example for legibility. enhancement_algo = lines[0] # The second section is the input image, a two-dimensional grid of light pixels (#) and dark pixels (.). input_image = lines[2:] image = {} for y in range(len(input_image)): for x in range(len(input_image[y])): if input_image[y][x] == PIXEL_ON: image[(x, y)] = input_image[y][x] image_size_x = x image_size_y = y iteration = 1 while iteration <= ITERATIONS_PART_TWO: # The puzzle input very subtly deviates from the example given in the puzzle description: # Any 3x3 region with no lit pixels will be lit in the next iteration, meaning an infinite # number will be lit on odd ticks, and then be unlit on the subsequent (even) tick. # # To handle this, the filter only examines an area 3 pixels larger in every dimension # than the existing image. We then know on the next tick that every pixel should default # to "lit" if it's not in the given image. image_with_infinite_pixels_lit = run_filter(image, default_value=PIXEL_OFF) iteration += 1 # Run the same filter, but now defaulting to "lit" out to infinity. image = run_filter(image_with_infinite_pixels_lit, default_value=PIXEL_ON) iteration += 1 # Start with the original input image and apply the image enhancement algorithm twice, being careful to account # for the infinite size of the images. How many pixels are lit in the resulting image? if iteration - 1 == ITERATIONS_PART_ONE: print('Part One: {0} pixels are lit after {1} image enhancement algorithms.'.format(lit_pixels(image), ITERATIONS_PART_ONE)) # Start again with the original input image and apply the image enhancement algorithm 50 times. # How many pixels are lit in the resulting image? print('Part Two: {0} pixels are lit after {1} image enhancement algorithms.'.format(lit_pixels(image), ITERATIONS_PART_TWO))
pixel_on = '#' pixel_off = '.' growth_per_iteration = 3 iterations_part_one = 2 iterations_part_two = 50 def filter_to_integer(image, x, y, default_value): integer = 0 for y_local in range(y - 1, y + 2): for x_local in range(x - 1, x + 2): integer <<= 1 if image.get((x_local, y_local), default_value) == PIXEL_ON: integer += 1 return integer def run_filter(i, default_value): new_image = {} for x in range(0 - GROWTH_PER_ITERATION * iteration, image_size_x + GROWTH_PER_ITERATION * iteration + 1): for y in range(0 - GROWTH_PER_ITERATION * iteration, image_size_y + GROWTH_PER_ITERATION * iteration + 1): filter_index = filter_to_integer(i, x, y, default_value) new_image[x, y] = enhancement_algo[filter_index] return new_image def lit_pixels(image): pixel_count = 0 for pixel in image: if image[pixel] == PIXEL_ON: pixel_count += 1 return pixel_count with open('day20_input.txt') as f: lines = [line.rstrip('\n') for line in f] enhancement_algo = lines[0] input_image = lines[2:] image = {} for y in range(len(input_image)): for x in range(len(input_image[y])): if input_image[y][x] == PIXEL_ON: image[x, y] = input_image[y][x] image_size_x = x image_size_y = y iteration = 1 while iteration <= ITERATIONS_PART_TWO: image_with_infinite_pixels_lit = run_filter(image, default_value=PIXEL_OFF) iteration += 1 image = run_filter(image_with_infinite_pixels_lit, default_value=PIXEL_ON) iteration += 1 if iteration - 1 == ITERATIONS_PART_ONE: print('Part One: {0} pixels are lit after {1} image enhancement algorithms.'.format(lit_pixels(image), ITERATIONS_PART_ONE)) print('Part Two: {0} pixels are lit after {1} image enhancement algorithms.'.format(lit_pixels(image), ITERATIONS_PART_TWO))
# FIBONACCI PROBLEM # Write a function 'fib(N)' that takes in a number as an argument. # The function should return the nth number of the Fibonnaci sequence. # # The 0th number of sequence is 0. # The 1st number of sequence is 1. # # To generate the next number of the sequence,we sum the previous two. # # N : 0, 1, 2, 3, 4, 5, 6, 7, ... # fib(N): 0, 1, 1, 2, 3, 5, 8, 13, ... # -------------------------------------- # A Brute force implementation # Time Complexity: O(2^N) # Space Complexity: O(N) def fib_brute(N): # Base conditions if N == 0: return 0 elif N == 1: return 1 # Recursive call return fib_brute(N - 1) + fib_brute(N - 2) # -------------------------------------- # A DP implementation # Time Complexity: O(N) # Space Complexity: O(N) def fib_dp(N, cache = {}): # First check if fib(N) present in cache if N in cache: return cache[N] # Base conditions if N == 0: return 0 elif N == 1: return 1 # Make the Recursive call, save it in cache # and then return the value from cache cache[N] = fib_dp(N - 1, cache) + fib_dp(N - 2, cache) return cache[N] if __name__ == "__main__": print(fib_brute(7)) # Output must be 13. print(fib_dp(50)) # Output must be 12586269025.
def fib_brute(N): if N == 0: return 0 elif N == 1: return 1 return fib_brute(N - 1) + fib_brute(N - 2) def fib_dp(N, cache={}): if N in cache: return cache[N] if N == 0: return 0 elif N == 1: return 1 cache[N] = fib_dp(N - 1, cache) + fib_dp(N - 2, cache) return cache[N] if __name__ == '__main__': print(fib_brute(7)) print(fib_dp(50))
#lg1009 def exp(n): ans = 1 for i in range(2, n + 1): ans *= i pass return ans pass n = int(input()) tot = 0 for i in range(1, n + 1): tot += exp(i) pass print(tot)
def exp(n): ans = 1 for i in range(2, n + 1): ans *= i pass return ans pass n = int(input()) tot = 0 for i in range(1, n + 1): tot += exp(i) pass print(tot)
''' Problem Description: ------------------ The program takes a file name from the user and reads the contents of the file in reverse order. ''' print(__doc__,end="") print('-'*25) fileName=input('Enter file name: ') print('-'*40) print('Contents of text in reversed order are: ') for line in reversed(list(open(fileName))): print(line.rstrip())
""" Problem Description: ------------------ The program takes a file name from the user and reads the contents of the file in reverse order. """ print(__doc__, end='') print('-' * 25) file_name = input('Enter file name: ') print('-' * 40) print('Contents of text in reversed order are: ') for line in reversed(list(open(fileName))): print(line.rstrip())
class Solution: def mergeTwoLists(self, list1: Optional[ListNode], list2: Optional[ListNode]) -> Optional[ListNode]: if not list1 or not list2: return list1 if list1 else list2 if list1.val > list2.val: list1, list2 = list2, list1 list1.next = self.mergeTwoLists(list1.next, list2) return list1
class Solution: def merge_two_lists(self, list1: Optional[ListNode], list2: Optional[ListNode]) -> Optional[ListNode]: if not list1 or not list2: return list1 if list1 else list2 if list1.val > list2.val: (list1, list2) = (list2, list1) list1.next = self.mergeTwoLists(list1.next, list2) return list1
#exercicio 97 def escreva(txt): c = len(txt) print ('-'*c) print (txt) print ('-'*c) escreva (' Exercicio97 ') escreva (' resolvido ')
def escreva(txt): c = len(txt) print('-' * c) print(txt) print('-' * c) escreva(' Exercicio97 ') escreva(' resolvido ')
class Elemento: dado = None anterior = None proximo = None def __init__(self, dado, anterior=None, proximo=None): self.dado = dado self.anterior = anterior self.proximo = proximo class Lista: cabeca = None cauda = None def __init__(self, elemento): self.cabeca = elemento self.cauda = elemento def inserir_no_meio(self, elemento, posicao): contador = 0 elemento_atual = self.cabeca while (contador != posicao): elemento_atual = elemento_atual.proximo contador += 1 elemento.proximo = elemento_atual elemento_atual.anterior.proximo = elemento elemento_atual.anterior = elemento def inserir_no_fim(self, elemento): elemento.anterior = self.cauda self.cauda.proximo = elemento self.cauda = elemento def inserir_no_inicio(self, elemento): elemento.proximo = self.cabeca self.cabeca.anterior = elemento self.cabeca = elemento
class Elemento: dado = None anterior = None proximo = None def __init__(self, dado, anterior=None, proximo=None): self.dado = dado self.anterior = anterior self.proximo = proximo class Lista: cabeca = None cauda = None def __init__(self, elemento): self.cabeca = elemento self.cauda = elemento def inserir_no_meio(self, elemento, posicao): contador = 0 elemento_atual = self.cabeca while contador != posicao: elemento_atual = elemento_atual.proximo contador += 1 elemento.proximo = elemento_atual elemento_atual.anterior.proximo = elemento elemento_atual.anterior = elemento def inserir_no_fim(self, elemento): elemento.anterior = self.cauda self.cauda.proximo = elemento self.cauda = elemento def inserir_no_inicio(self, elemento): elemento.proximo = self.cabeca self.cabeca.anterior = elemento self.cabeca = elemento
hexN = '0x41ba0320' print(hexN) hexP = hexN[2:] print (hexP[0:2]) print (hexP[2:4]) print (hexP[4:6]) print (hexP[6:8]) print(hexP) print("{}.{}.{}.{}".format(hexP[0:2],hexP[2:4],hexP[4:6],hexP[6:8]))
hex_n = '0x41ba0320' print(hexN) hex_p = hexN[2:] print(hexP[0:2]) print(hexP[2:4]) print(hexP[4:6]) print(hexP[6:8]) print(hexP) print('{}.{}.{}.{}'.format(hexP[0:2], hexP[2:4], hexP[4:6], hexP[6:8]))
# print('Hello, what is your name?') will type out the text in the () print('Hello, what is your name?') # name = input() means that the name you typed is the answer to the question. name = input() # print('your name is '+name) will print the sentence plus the name you put in at name = input(). print('Your name is '+name)
print('Hello, what is your name?') name = input() print('Your name is ' + name)
n,k = map(int,input().split()) l = list(map(int,input().split())) l.append("fake") idx=0 ans=[l[0]] s=set(l) for i in range(1,n*k+1): if i not in s: ans.append(i) if len(ans)==n: print(*ans) idx+=1 ans=[l[idx]]
(n, k) = map(int, input().split()) l = list(map(int, input().split())) l.append('fake') idx = 0 ans = [l[0]] s = set(l) for i in range(1, n * k + 1): if i not in s: ans.append(i) if len(ans) == n: print(*ans) idx += 1 ans = [l[idx]]
class Solution: def maxValue(self, grid: List[List[int]]) -> int: if not grid: return 0 m, n = len(grid), len(grid[0]) dp = [0] * n for idx, _ in enumerate(grid[0]): if idx == 0: dp[idx] = _ else: dp[idx] = _ + dp[idx - 1] for i in range(1, m): for j in range(n): if j == 0: dp[j] += grid[i][j] else: dp[j] = max(dp[j - 1], dp[j]) + grid[i][j] return dp[-1]
class Solution: def max_value(self, grid: List[List[int]]) -> int: if not grid: return 0 (m, n) = (len(grid), len(grid[0])) dp = [0] * n for (idx, _) in enumerate(grid[0]): if idx == 0: dp[idx] = _ else: dp[idx] = _ + dp[idx - 1] for i in range(1, m): for j in range(n): if j == 0: dp[j] += grid[i][j] else: dp[j] = max(dp[j - 1], dp[j]) + grid[i][j] return dp[-1]
def yes_no_query(): result = input("[y/n | yes/no]") result = result.lower() if result == 'y' or result == 'yes': return True elif result == 'n' or result == 'no': return False else: print("[Please Enter yes or no]") return yes_no_query() def do_discussion(): # todo: implement speaking stack # todo: add handling for motion to table # todo: add handling for call to question pass def do_motion(motion_text, motion_maker): print(f"Motion is {motion_text}") print("[confirm summary of motion is correct with motion maker and note taker]") input("[Press any key to continue...]") print("Do I have a second?") seconded = yes_no_query() if not seconded: return { "motion text": motion_text, "motion maker": motion_maker, "seconded": seconded } print("Do I hear any questions or opposition") discussion = yes_no_query() if discussion: do_discussion() # todo confirm input type, warning on incorrect input and ask again yay = input("Those in favor: ") nay = input("Those opposed: ") abstain = input("Those abstaining: ") print("[confirm vote tally with note taker]") input("[Press any key to continue...]") return { "motion text": motion_text, "motion maker": motion_maker, "seconded": seconded, "result": (yay, nay, abstain) }
def yes_no_query(): result = input('[y/n | yes/no]') result = result.lower() if result == 'y' or result == 'yes': return True elif result == 'n' or result == 'no': return False else: print('[Please Enter yes or no]') return yes_no_query() def do_discussion(): pass def do_motion(motion_text, motion_maker): print(f'Motion is {motion_text}') print('[confirm summary of motion is correct with motion maker and note taker]') input('[Press any key to continue...]') print('Do I have a second?') seconded = yes_no_query() if not seconded: return {'motion text': motion_text, 'motion maker': motion_maker, 'seconded': seconded} print('Do I hear any questions or opposition') discussion = yes_no_query() if discussion: do_discussion() yay = input('Those in favor: ') nay = input('Those opposed: ') abstain = input('Those abstaining: ') print('[confirm vote tally with note taker]') input('[Press any key to continue...]') return {'motion text': motion_text, 'motion maker': motion_maker, 'seconded': seconded, 'result': (yay, nay, abstain)}
load( "//rules/common:private/utils.bzl", _action_singlejar = "action_singlejar", ) # # PHASE: binary_deployjar # # Writes the optional deploy jar that includes all of the dependencies # def phase_binary_deployjar(ctx, g): main_class = None if getattr(ctx.attr, "main_class", ""): main_class = ctx.attr.main_class _action_singlejar( ctx, inputs = depset( [ctx.outputs.jar], transitive = [g.javainfo.java_info.transitive_runtime_jars], ), main_class = main_class, output = ctx.outputs.deploy_jar, progress_message = "scala deployable %s" % ctx.label, compression = True, )
load('//rules/common:private/utils.bzl', _action_singlejar='action_singlejar') def phase_binary_deployjar(ctx, g): main_class = None if getattr(ctx.attr, 'main_class', ''): main_class = ctx.attr.main_class _action_singlejar(ctx, inputs=depset([ctx.outputs.jar], transitive=[g.javainfo.java_info.transitive_runtime_jars]), main_class=main_class, output=ctx.outputs.deploy_jar, progress_message='scala deployable %s' % ctx.label, compression=True)
def find_pattern(given): total = len(given) pattern = given[0] to_compare = len(pattern) for i in range(1, total): for j in range(to_compare): if given[i][j] != pattern[j]: pattern = pattern[:j] + '?' + pattern[j + 1:] return pattern if __name__ == '__main__': n = int(input()) test_case = [input() for _ in range(n)] # print(test_case) print(find_pattern(test_case))
def find_pattern(given): total = len(given) pattern = given[0] to_compare = len(pattern) for i in range(1, total): for j in range(to_compare): if given[i][j] != pattern[j]: pattern = pattern[:j] + '?' + pattern[j + 1:] return pattern if __name__ == '__main__': n = int(input()) test_case = [input() for _ in range(n)] print(find_pattern(test_case))
x = float(input()) n = int(input()) def expo(x, n): num = 1 den = 1 sumi = 1 if n == 1: return 1 for cnt in range(1, n): num *= x den *= cnt sumi += num / den return sumi print("{:.3f}".format(expo(x, n) ))
x = float(input()) n = int(input()) def expo(x, n): num = 1 den = 1 sumi = 1 if n == 1: return 1 for cnt in range(1, n): num *= x den *= cnt sumi += num / den return sumi print('{:.3f}'.format(expo(x, n)))