content
stringlengths
7
1.05M
fixed_cases
stringlengths
1
1.28M
def urlopen(): pass usocket = None
def urlopen(): pass usocket = None
def LABELS(): LABELS1 = { "1": "speed limit 30 (prohibitory)", "0": "speed limit 20 (prohibitory)", "2": "speed limit 50 (prohibitory)", "3": "speed limit 60 (prohibitory)", "4": "speed limit 70 (prohibitory)", "5": "speed limit 80 (prohibitory)", "6": "restriction ends 80 (other)", "7": "speed limit 100 (prohibitory)", "8": "speed limit 120 (prohibitory)", "9": "no overtaking (prohibitory)", "10": "no overtaking (trucks) (prohibitory)", "11": "priority at next intersection (danger)", "12": "priority road (other)", "13": "give way (other)", "14": "stop (other)", "15": "no traffic both ways (prohibitory)", "16": "no trucks (prohibitory)", "17": "no entry (other)", "18": "danger (danger)", "19": "bend left (danger)", "20": "bend right (danger)", "21": "bend (danger)", "22": "uneven road (danger)", "23": "slippery road (danger)", "24": "road narrows (danger)", "25": "construction (danger)", "26": "traffic signal (danger)", "27": "pedestrian crossing (danger)", "28": "school crossing (danger)", "29": "cycles crossing (danger)", "30": "snow (danger)", "31": "animals (danger)", "32": "restriction ends (other)", "33": "go right (mandatory)", "34": "go left (mandatory)", "35": "go straight (mandatory)", "36": "go right or straight (mandatory)", "37": "go left or straight (mandatory)", "38": "keep right (mandatory)", "39": "keep left (mandatory)", "40": "roundabout (mandatory)", "41": "restriction ends (overtaking) (other)", "42": "restriction ends (overtaking (trucks)) (other)" } return LABELS1
def labels(): labels1 = {'1': 'speed limit 30 (prohibitory)', '0': 'speed limit 20 (prohibitory)', '2': 'speed limit 50 (prohibitory)', '3': 'speed limit 60 (prohibitory)', '4': 'speed limit 70 (prohibitory)', '5': 'speed limit 80 (prohibitory)', '6': 'restriction ends 80 (other)', '7': 'speed limit 100 (prohibitory)', '8': 'speed limit 120 (prohibitory)', '9': 'no overtaking (prohibitory)', '10': 'no overtaking (trucks) (prohibitory)', '11': 'priority at next intersection (danger)', '12': 'priority road (other)', '13': 'give way (other)', '14': 'stop (other)', '15': 'no traffic both ways (prohibitory)', '16': 'no trucks (prohibitory)', '17': 'no entry (other)', '18': 'danger (danger)', '19': 'bend left (danger)', '20': 'bend right (danger)', '21': 'bend (danger)', '22': 'uneven road (danger)', '23': 'slippery road (danger)', '24': 'road narrows (danger)', '25': 'construction (danger)', '26': 'traffic signal (danger)', '27': 'pedestrian crossing (danger)', '28': 'school crossing (danger)', '29': 'cycles crossing (danger)', '30': 'snow (danger)', '31': 'animals (danger)', '32': 'restriction ends (other)', '33': 'go right (mandatory)', '34': 'go left (mandatory)', '35': 'go straight (mandatory)', '36': 'go right or straight (mandatory)', '37': 'go left or straight (mandatory)', '38': 'keep right (mandatory)', '39': 'keep left (mandatory)', '40': 'roundabout (mandatory)', '41': 'restriction ends (overtaking) (other)', '42': 'restriction ends (overtaking (trucks)) (other)'} return LABELS1
""" Name: Srinivas Jakkula CIS 41A Spring 2020 Unit G Take-Home Assignment """ def part1(): max_pop = 0 max_state = "" file_obj = open("States.txt", "r") for line in file_obj: line_list = line.split() pop = int(line_list[2]) if line_list[1] == "Midwest" and pop > max_pop: max_pop = pop max_state = line_list[0] print(f"Highest population state in the Midwest is: {max_state} {max_pop}") file_obj.close() def part2_and_part3(): d = {} f = open("USPresidents.txt") for line in f: (state_name, president_name) = line.split() if state_name not in d: d[state_name] = [president_name] else: d[state_name].append(president_name) f.close() # for k, v in d.items(): # print(k, v) max_presidents = max(d, key=lambda k: len(d[k])) print(f"The state with the most presidents is {max_presidents} with {len(d[max_presidents])} presidents:") for president_name in d[max_presidents]: print(president_name) print() d1 = {} for k, v in d.items(): d1[k] = len(v) # for k, v in d1.items(): # print(k, v) most_pop_states = {"CA", "TX", "FL", "NY", "IL", "PA", "OH", "GA", "NC", "MI"} new_set = {(k, d1.get(k, 0)) for k in most_pop_states if d1.get(k, 0) != 0} print(f"{len(new_set)} of the {len(most_pop_states)} high populations states have had presidents born in them:") for s, no_of_pre in sorted(new_set): print(s, no_of_pre) def main(): # print("Part 1 output") part1() print() # print("Part 2 output") part2_and_part3() if __name__ == "__main__": main() ''' Execution results: /usr/bin/python3 /Users/jakkus/PycharmProjects/CIS41A/CIS41A_UNITG_TAKEHOME_ASSIGNMENT_1.py Highest population state in the Midwest is: IL 12802000 The state with the most presidents is VA with 8 presidents: George_Washington James_Madison James_Monroe John_Tyler Thomas_Jefferson William_Henry_Harrison Woodrow_Wilson Zachary_Taylor 8 of the 10 high populations states have had presidents born in them: CA 1 GA 1 IL 1 NC 2 NY 5 OH 7 PA 1 TX 2 Process finished with exit code 0 '''
""" Name: Srinivas Jakkula CIS 41A Spring 2020 Unit G Take-Home Assignment """ def part1(): max_pop = 0 max_state = '' file_obj = open('States.txt', 'r') for line in file_obj: line_list = line.split() pop = int(line_list[2]) if line_list[1] == 'Midwest' and pop > max_pop: max_pop = pop max_state = line_list[0] print(f'Highest population state in the Midwest is: {max_state} {max_pop}') file_obj.close() def part2_and_part3(): d = {} f = open('USPresidents.txt') for line in f: (state_name, president_name) = line.split() if state_name not in d: d[state_name] = [president_name] else: d[state_name].append(president_name) f.close() max_presidents = max(d, key=lambda k: len(d[k])) print(f'The state with the most presidents is {max_presidents} with {len(d[max_presidents])} presidents:') for president_name in d[max_presidents]: print(president_name) print() d1 = {} for (k, v) in d.items(): d1[k] = len(v) most_pop_states = {'CA', 'TX', 'FL', 'NY', 'IL', 'PA', 'OH', 'GA', 'NC', 'MI'} new_set = {(k, d1.get(k, 0)) for k in most_pop_states if d1.get(k, 0) != 0} print(f'{len(new_set)} of the {len(most_pop_states)} high populations states have had presidents born in them:') for (s, no_of_pre) in sorted(new_set): print(s, no_of_pre) def main(): part1() print() part2_and_part3() if __name__ == '__main__': main() '\nExecution results:\n\n/usr/bin/python3 /Users/jakkus/PycharmProjects/CIS41A/CIS41A_UNITG_TAKEHOME_ASSIGNMENT_1.py\nHighest population state in the Midwest is: IL 12802000\n\nThe state with the most presidents is VA with 8 presidents:\nGeorge_Washington\nJames_Madison\nJames_Monroe\nJohn_Tyler\nThomas_Jefferson\nWilliam_Henry_Harrison\nWoodrow_Wilson\nZachary_Taylor\n\n8 of the 10 high populations states have had presidents born in them:\nCA 1\nGA 1\nIL 1\nNC 2\nNY 5\nOH 7\nPA 1\nTX 2\n\nProcess finished with exit code 0\n\n'
""" This module contains heuristic search algorithm implemtations, like A*. The ``lib.search.graph.Graph`` is supposed to be used as a bases for these implementations. """
""" This module contains heuristic search algorithm implemtations, like A*. The ``lib.search.graph.Graph`` is supposed to be used as a bases for these implementations. """
"""Application base, containing global templates.""" default_app_config = 'pontoon.base.apps.BaseConfig' MOZILLA_REPOS = ( 'ssh://hg.mozilla.org/users/m_owca.info/firefox-beta/', 'ssh://hg.mozilla.org/users/m_owca.info/firefox-for-android-beta/', 'ssh://hg.mozilla.org/users/m_owca.info/thunderbird-beta/', 'ssh://hg.mozilla.org/users/m_owca.info/lightning-beta/', 'ssh://hg.mozilla.org/users/m_owca.info/seamonkey-beta/', 'ssh://hg.mozilla.org/users/m_owca.info/firefox-aurora/', 'ssh://hg.mozilla.org/users/m_owca.info/firefox-for-android-aurora/', 'ssh://hg.mozilla.org/users/m_owca.info/thunderbird-aurora/', 'ssh://hg.mozilla.org/users/m_owca.info/lightning-aurora/', 'ssh://hg.mozilla.org/users/m_owca.info/seamonkey-aurora/', )
"""Application base, containing global templates.""" default_app_config = 'pontoon.base.apps.BaseConfig' mozilla_repos = ('ssh://hg.mozilla.org/users/m_owca.info/firefox-beta/', 'ssh://hg.mozilla.org/users/m_owca.info/firefox-for-android-beta/', 'ssh://hg.mozilla.org/users/m_owca.info/thunderbird-beta/', 'ssh://hg.mozilla.org/users/m_owca.info/lightning-beta/', 'ssh://hg.mozilla.org/users/m_owca.info/seamonkey-beta/', 'ssh://hg.mozilla.org/users/m_owca.info/firefox-aurora/', 'ssh://hg.mozilla.org/users/m_owca.info/firefox-for-android-aurora/', 'ssh://hg.mozilla.org/users/m_owca.info/thunderbird-aurora/', 'ssh://hg.mozilla.org/users/m_owca.info/lightning-aurora/', 'ssh://hg.mozilla.org/users/m_owca.info/seamonkey-aurora/')
def reverse(x: int): """ takes in integer and output it's reverse """ result = 0 if x < 0: x = x*(-1) a = -1 else: a = 1 while x > 0: carry = x%10 result = result*10+carry x = x//10 result = result*a if result < -2**31 or result > (2**31-1): return 0 return result print(reverse(12548963))
def reverse(x: int): """ takes in integer and output it's reverse """ result = 0 if x < 0: x = x * -1 a = -1 else: a = 1 while x > 0: carry = x % 10 result = result * 10 + carry x = x // 10 result = result * a if result < -2 ** 31 or result > 2 ** 31 - 1: return 0 return result print(reverse(12548963))
SKIP = 2 driver.add_pipeline('Create', [ Filter(Service, CreateService), CreateCounter(), Filter(Message, [UnitCreated]), Timer('unit creation intervals', SKIP) ]) units_per_level = Counter('units ordered per level', LinearOrderExtended, lambda entry: entry[Size]) timing_freq = Timer('timing unit decision intervals', SKIP) driver.add_pipeline('Ordering', [ Filter(Message, [NewTimingUnit, LinearOrderExtended]), units_per_level, Filter(Message, NewTimingUnit), timing_freq, TXPS(units_per_level, timing_freq) ]) driver.add_pipeline('Latency', [ Filter(Message, [UnitCreated, OwnUnitOrdered]), Delay('Ordering latency', [UnitCreated], OwnUnitOrdered, lambda entry: entry[Height], SKIP), ])
skip = 2 driver.add_pipeline('Create', [filter(Service, CreateService), create_counter(), filter(Message, [UnitCreated]), timer('unit creation intervals', SKIP)]) units_per_level = counter('units ordered per level', LinearOrderExtended, lambda entry: entry[Size]) timing_freq = timer('timing unit decision intervals', SKIP) driver.add_pipeline('Ordering', [filter(Message, [NewTimingUnit, LinearOrderExtended]), units_per_level, filter(Message, NewTimingUnit), timing_freq, txps(units_per_level, timing_freq)]) driver.add_pipeline('Latency', [filter(Message, [UnitCreated, OwnUnitOrdered]), delay('Ordering latency', [UnitCreated], OwnUnitOrdered, lambda entry: entry[Height], SKIP)])
# super() deep dive # mechanism of super() # super() can also take two parameter: # the first is the subclass, the second is an object that is an instance of # that subclass class Rectangle: def __init__(self, length, width): self.length = length self.width = width def area(self): return self.length * self.width def perimeter(self): return 2 * self.length * self.width class Square(Rectangle): def __init__(self, length): super(Square, self).__init__(length, length) # class Cube(Square): # def surface_area(self): # face_area = super(Square, self).area() # return face_area * 6 # def volume(self): # face_area = super(Square, self).area() # return face_area * self.length sq = Square(10) print(sq.area(), sq.perimeter(), sep="\n") # cu = Cube(20) # print(cu.volume(), cu.surface_area(), sep="\n") # the above example setting Square as the subclass argument to super(), instead # of Cube. This causes super() to start searching for a matching method. # super() in multiple inheritance class Triangle: def __init__(self, base, height): self.base = base self.height = height def area(self): return 0.5 * self.base * self.height class RightPyramid(Triangle, Square): def __init__(self, base, slant_height): self.base = base self.slant_height = slant_height super().__init__(self.base) # the right way to calculate area() def area(self): base_area = super().area() perimeter = super().perimeter() return 0.5 * perimeter * self.slant_height + base_area # pyramid = RightPyramid(2, 4) # print(pyramid.area()) # AttributeError here. because the method resolution order # MRO # MRO tells Python how to search for inherited methods. # this comes in handy when you're using super() because the MRO tells you # exactly wher Python will look for a method you're calling with super() and in # what order print(RightPyramid.__mro__) # super() will be searched first in RightPyramid, then in Triangle, then in # Square, then in Rectangle. if nothing is found, in object from which all # classes originate # Multiple inheritance alternative - mixin class VolumeMixin: def volume(self): return self.area() * self.height class Cube(VolumeMixin, Square): def __init__(self, length): super().__init__(length) self.height = length def face_area(self): return super().area() def surface_area(self): return super().area() * 6 test = Cube(10) print(test.area(), test.face_area(), test.surface_area(), test.volume(), sep="\n")
class Rectangle: def __init__(self, length, width): self.length = length self.width = width def area(self): return self.length * self.width def perimeter(self): return 2 * self.length * self.width class Square(Rectangle): def __init__(self, length): super(Square, self).__init__(length, length) sq = square(10) print(sq.area(), sq.perimeter(), sep='\n') class Triangle: def __init__(self, base, height): self.base = base self.height = height def area(self): return 0.5 * self.base * self.height class Rightpyramid(Triangle, Square): def __init__(self, base, slant_height): self.base = base self.slant_height = slant_height super().__init__(self.base) def area(self): base_area = super().area() perimeter = super().perimeter() return 0.5 * perimeter * self.slant_height + base_area print(RightPyramid.__mro__) class Volumemixin: def volume(self): return self.area() * self.height class Cube(VolumeMixin, Square): def __init__(self, length): super().__init__(length) self.height = length def face_area(self): return super().area() def surface_area(self): return super().area() * 6 test = cube(10) print(test.area(), test.face_area(), test.surface_area(), test.volume(), sep='\n')
#create list List = [1,2,3,4] Tuple = (8,1,2011) print("Size of list:", List.__sizeof__()) print("Size of tuple:", Tuple.__sizeof__())
list = [1, 2, 3, 4] tuple = (8, 1, 2011) print('Size of list:', List.__sizeof__()) print('Size of tuple:', Tuple.__sizeof__())
def categorize(biblio, root, directory_keyname, category_keyname): skip_len = len(root) + 1 for book in biblio: directory = book[directory_keyname] structure = directory[skip_len:] category = structure.split('\\') book[category_keyname] = category
def categorize(biblio, root, directory_keyname, category_keyname): skip_len = len(root) + 1 for book in biblio: directory = book[directory_keyname] structure = directory[skip_len:] category = structure.split('\\') book[category_keyname] = category
name, age = "Harikrishnan", 25 username = "hari94codes" print ('Hello!') print("Name: {}\nAge: {}\nUsername: {}".format(name, age, username))
(name, age) = ('Harikrishnan', 25) username = 'hari94codes' print('Hello!') print('Name: {}\nAge: {}\nUsername: {}'.format(name, age, username))
wsHub = { "endPoint": "ws://192.168.0.163:8080/", "onConnection": "hubConnected", "onReceived": "receivedNote", } wsHassio = { "endPoint": "ws://192.168.0.163:8123/api/websocket", "onConnection": "hassioConnected", "onReceived": "receivedNotice", } wsClient = wsHub ttyBridge = { "onReceived": None, "onConnection": None, "connection" : { 'port' : '/dev/pts/0', 'speed' : 115200, 'timeout' : None, 'parity' : 'N', #None 'xonxoff' : 0, 'rtscts' : 0, } } posixBridge = { 'osCommand' : '/smartRemote/nodes/ttyNode/runPosix.sh', } noteFilter = { 'zone': 'masterBedroom' } hassioEvents = { "event_type": "notePublished", "access_token": "eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJpc3MiOiI1NmVhNzU3ODkzMDE0MTMzOTJhOTZiYmY3MTZiOWYyOCIsImlhdCI6MTYxNDc1NzQ2OSwiZXhwIjoxOTMwMTE3NDY5fQ.K2WwAh_9OjXZP5ciIcJ4lXYiLcSgLGrC6AgTPeIp8BY" ''' Note: send hassio script events with the following format service: script.publish_note data: note: {'title': 'notePubished event', 'content': {'controlWord': 'Ok', 'zone': 'livingRoom'}} 'controlWord' = Specify a control word to send the desired key press 'zone' = Specify the zone this node is running in. ***Review the ./zones directory for supported zones and control words ''' }
ws_hub = {'endPoint': 'ws://192.168.0.163:8080/', 'onConnection': 'hubConnected', 'onReceived': 'receivedNote'} ws_hassio = {'endPoint': 'ws://192.168.0.163:8123/api/websocket', 'onConnection': 'hassioConnected', 'onReceived': 'receivedNotice'} ws_client = wsHub tty_bridge = {'onReceived': None, 'onConnection': None, 'connection': {'port': '/dev/pts/0', 'speed': 115200, 'timeout': None, 'parity': 'N', 'xonxoff': 0, 'rtscts': 0}} posix_bridge = {'osCommand': '/smartRemote/nodes/ttyNode/runPosix.sh'} note_filter = {'zone': 'masterBedroom'} hassio_events = {'event_type': 'notePublished', 'access_token': "eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJpc3MiOiI1NmVhNzU3ODkzMDE0MTMzOTJhOTZiYmY3MTZiOWYyOCIsImlhdCI6MTYxNDc1NzQ2OSwiZXhwIjoxOTMwMTE3NDY5fQ.K2WwAh_9OjXZP5ciIcJ4lXYiLcSgLGrC6AgTPeIp8BY\n Note: send hassio script events with the following format\n \n service: script.publish_note\n data:\n note: {'title': 'notePubished event', 'content': {'controlWord': 'Ok', 'zone': 'livingRoom'}}\n\n 'controlWord' = Specify a control word to send the desired key press\n 'zone' = Specify the zone this node is running in.\n ***Review the ./zones directory for supported zones and control words\n "}
def divide1(x, y): try: # Floor Division : Gives only Fractional Part as Answer result = x // y print("Yeah ! Your answer is :", result) except ZeroDivisionError: print("Sorry ! You are dividing by zero ") def divide2(x, y): try: print(f'{x}/{y} is {x / y}') except ZeroDivisionError as e: print(e) else: print("divide() function worked fine.") finally: print("close all the resources here")
def divide1(x, y): try: result = x // y print('Yeah ! Your answer is :', result) except ZeroDivisionError: print('Sorry ! You are dividing by zero ') def divide2(x, y): try: print(f'{x}/{y} is {x / y}') except ZeroDivisionError as e: print(e) else: print('divide() function worked fine.') finally: print('close all the resources here')
class Solution: def removeDuplicates(self, nums: List[int]) -> int: # base case if len(nums) <= 1: return len(nums) count = 1 j = 1 for i in range(len(nums) - 1): while j < len(nums): if nums[i] == nums[j]: j += 1 else: nums[i+1] = nums[j] count += 1 j += 1 break return count
class Solution: def remove_duplicates(self, nums: List[int]) -> int: if len(nums) <= 1: return len(nums) count = 1 j = 1 for i in range(len(nums) - 1): while j < len(nums): if nums[i] == nums[j]: j += 1 else: nums[i + 1] = nums[j] count += 1 j += 1 break return count
class Unit(object): def __init__(self): pass def __str__(self): pass class Seconds(Unit): def __init__(self): super().__init__() def __str__(self): return "(s)"
class Unit(object): def __init__(self): pass def __str__(self): pass class Seconds(Unit): def __init__(self): super().__init__() def __str__(self): return '(s)'
# write a python program to add two numbers num1 = 1.5 num2 = 6.3 sum = num1 + num2 print(f'Sum: {sum}') # write a python function to add two user provided numbers and return the sum def add_two_numbers(num1, num2): sum = num1 + num2 return sum # write a program to find and print the largest among three numbers num1 = 10 num2 = 12 num3 = 14 if (num1 >= num2) and (num1 >= num3): largest = num1 elif (num2 >= num1) and (num2 >= num3): largest = num2 else: largest = num3 print(f'largest:{largest}')
num1 = 1.5 num2 = 6.3 sum = num1 + num2 print(f'Sum: {sum}') def add_two_numbers(num1, num2): sum = num1 + num2 return sum num1 = 10 num2 = 12 num3 = 14 if num1 >= num2 and num1 >= num3: largest = num1 elif num2 >= num1 and num2 >= num3: largest = num2 else: largest = num3 print(f'largest:{largest}')
# Databricks notebook source # MAGIC %md-sandbox # MAGIC # MAGIC <div style="text-align: center; line-height: 0; padding-top: 9px;"> # MAGIC <img src="https://databricks.com/wp-content/uploads/2018/03/db-academy-rgb-1200px.png" alt="Databricks Learning" style="width: 600px"> # MAGIC </div> # COMMAND ---------- # MAGIC %run ../../Includes/classroom-setup-dlt-demo # COMMAND ---------- # MAGIC %md # MAGIC If you have not previously configured this DLT pipeline successfully, the following cell prints out two values that will be used during the configuration steps that follow. # COMMAND ---------- print(f"Target: {DA.db_name}") print(f"Storage location: {DA.paths.storage_location}") # COMMAND ---------- # MAGIC %md # MAGIC ## Create and configure a pipeline # MAGIC # MAGIC The instructions below refer to the same pipeline created during the previous code along for DLT; if you successfully configured this notebook previously, you should not need to reconfigure this pipeline now. # MAGIC # MAGIC # MAGIC Steps: # MAGIC 1. Click the **Jobs** button on the sidebar, # MAGIC 1. Select the **Delta Live Tables** tab. # MAGIC 1. Click **Create Pipeline**. # MAGIC 1. Fill in a **Pipeline Name** of your choosing. # MAGIC 1. For **Notebook Libraries**, use the navigator to locate and select the companion notebook called **2 - DLT Job**. # MAGIC 1. In the **Target** field, specify the database name printed out next to **Target** in the cell above. (This should follow the pattern **`dbacademy_<username>_dlt_demo`**) # MAGIC 1. In the **Storage location** field, copy the directory as printed above. # MAGIC 1. For **Pipeline Mode**, select **Triggered** # MAGIC 1. Uncheck the **Enable autoscaling** box, and set the number of workers to 1., # MAGIC 1. Click **Create**. # COMMAND ---------- # MAGIC %md-sandbox # MAGIC &copy; 2022 Databricks, Inc. All rights reserved.<br/> # MAGIC Apache, Apache Spark, Spark and the Spark logo are trademarks of the <a href="https://www.apache.org/">Apache Software Foundation</a>.<br/> # MAGIC <br/> # MAGIC <a href="https://databricks.com/privacy-policy">Privacy Policy</a> | <a href="https://databricks.com/terms-of-use">Terms of Use</a> | <a href="https://help.databricks.com/">Support</a>
print(f'Target: {DA.db_name}') print(f'Storage location: {DA.paths.storage_location}')
followers = {} while True: command = input().split(": ") if command[0] == "Log out": break username = command[1] if command[0] == "New follower": if username not in followers: followers[username] = (0, 0) elif command[0] == "Like": count = int(command[2]) if username not in followers: followers[username] = (count, 0) else: followers[username] = ((followers[username])[0] + count, (followers[username])[1]) elif command[0] == "Comment": if username not in followers: followers[username] = (0, 1) else: followers[username] = ((followers[username])[0], (followers[username])[1] + 1) elif command[0] == "Blocked": if username not in followers: print(f"{username} doesn't exist.") else: del followers[username] print(f"{len(followers)} followers") for k, v in sorted(followers.items(), key=lambda item: item[1][0], reverse=True): print(f"{k}: {v[0] + v[1]}")
followers = {} while True: command = input().split(': ') if command[0] == 'Log out': break username = command[1] if command[0] == 'New follower': if username not in followers: followers[username] = (0, 0) elif command[0] == 'Like': count = int(command[2]) if username not in followers: followers[username] = (count, 0) else: followers[username] = (followers[username][0] + count, followers[username][1]) elif command[0] == 'Comment': if username not in followers: followers[username] = (0, 1) else: followers[username] = (followers[username][0], followers[username][1] + 1) elif command[0] == 'Blocked': if username not in followers: print(f"{username} doesn't exist.") else: del followers[username] print(f'{len(followers)} followers') for (k, v) in sorted(followers.items(), key=lambda item: item[1][0], reverse=True): print(f'{k}: {v[0] + v[1]}')
BIRD = [212, 4] REPTILE = [358, 4] MOLLUSCS = [52, 4] CHEPHALOPODS = [136, 5] MAMMAL = [359, 4] RODENTS = [1459, 5] FISSIPEDIA = [732, 5] MUSTELIDAE = [5307, 6] # badgers, weasels, martens, ferrets, minks and wolverines CANIDAE = [9701, 6] # domestic dogs, wolves, foxes, jackals, coyotes, CANIS = [5219142, 7] # Dogs and wolves CANIS_LUPUS = [5219173, 8] # Dogs and wolves VULPES = [5219234, 7] # Foxes FELIDAE = [9703, 6] # Cats FELIS = [2435022, 7] # Familiar domestic cat and its closest wild relatives LEOPARDUS = [2434918, 7] # Familiar domestic cat and its closest wild relatives PANTHERA = [2435194, 7] # Familiar domestic cat and its closest wild relatives PRIMATES = [798, 5] OLD_WORLD_MONKEYS = [9622, 6] MAN_LIKE_PRIMATES = [5483, 6] HOMINOIDS = [2436435, 7] DOLPHIN_WHALES = [733, 5] ODD_TOED_UNGULATES = [795, 5] EQUIDAE = [795, 6] AMPHISBAENIANS = [715, 5] # Snakes, geckos, lizards RAY_FINNED_FISHES = [204, 5] CARTILAGENOUS_FISHES = [121, 5] INSECTS = [216, 4] ARACHNIDS = [367, 4] CNIDARIANS = [43, 4] # Jellyfish BEINGS = [ BIRD, REPTILE, MOLLUSCS, CHEPHALOPODS, MAMMAL, RODENTS, FISSIPEDIA, MUSTELIDAE, CANIDAE, CANIS, VULPES, FELIDAE, FELIS, LEOPARDUS, PANTHERA, PRIMATES, OLD_WORLD_MONKEYS, MAN_LIKE_PRIMATES, HOMINOIDS, DOLPHIN_WHALES, ODD_TOED_UNGULATES, EQUIDAE, AMPHISBAENIANS, RAY_FINNED_FISHES, CARTILAGENOUS_FISHES, INSECTS, ARACHNIDS, CNIDARIANS ]
bird = [212, 4] reptile = [358, 4] molluscs = [52, 4] chephalopods = [136, 5] mammal = [359, 4] rodents = [1459, 5] fissipedia = [732, 5] mustelidae = [5307, 6] canidae = [9701, 6] canis = [5219142, 7] canis_lupus = [5219173, 8] vulpes = [5219234, 7] felidae = [9703, 6] felis = [2435022, 7] leopardus = [2434918, 7] panthera = [2435194, 7] primates = [798, 5] old_world_monkeys = [9622, 6] man_like_primates = [5483, 6] hominoids = [2436435, 7] dolphin_whales = [733, 5] odd_toed_ungulates = [795, 5] equidae = [795, 6] amphisbaenians = [715, 5] ray_finned_fishes = [204, 5] cartilagenous_fishes = [121, 5] insects = [216, 4] arachnids = [367, 4] cnidarians = [43, 4] beings = [BIRD, REPTILE, MOLLUSCS, CHEPHALOPODS, MAMMAL, RODENTS, FISSIPEDIA, MUSTELIDAE, CANIDAE, CANIS, VULPES, FELIDAE, FELIS, LEOPARDUS, PANTHERA, PRIMATES, OLD_WORLD_MONKEYS, MAN_LIKE_PRIMATES, HOMINOIDS, DOLPHIN_WHALES, ODD_TOED_UNGULATES, EQUIDAE, AMPHISBAENIANS, RAY_FINNED_FISHES, CARTILAGENOUS_FISHES, INSECTS, ARACHNIDS, CNIDARIANS]
""" Data format for unit commitment problem """ IG = 1 PG = 2
""" Data format for unit commitment problem """ ig = 1 pg = 2
# Copyright 2015-2017 Cisco Systems, Inc. # All rights reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); you may # not use this file except in compliance with the License. You may obtain # a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software # distributed under the License is distributed on an "AS IS" BASIS, WITHOUT # WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the # License for the specific language governing permissions and limitations # under the License. """RFC 2858 subsequent address family numbers""" SAFNUM_UNICAST = 1 SAFNUM_MULCAST = 2 SAFNUM_UNIMULC = 3 SAFNUM_MPLS_LABEL = 4 # rfc3107 SAFNUM_MCAST_VPN = 5 # draft-ietf-l3vpn-2547bis-mcast-bgp-08.txt SAFNUM_ENCAPSULATION = 7 # rfc5512 SAFNUM_TUNNEL = 64 # draft-nalawade-kapoor-tunnel-safi-02.txt SAFNUM_VPLS = 65 SAFNUM_MDT = 66 # rfc6037 SAFNUM_EVPN = 70 # RFC 7432 SAFNUM_BGPLS = 71 SAFNUM_SRTE = 73 SAFNUM_LAB_VPNUNICAST = 128 # Draft-rosen-rfc2547bis-03 SAFNUM_LAB_VPNMULCAST = 129 SAFNUM_LAB_VPNUNIMULC = 130 SAFNUM_ROUTE_TARGET = 132 # RFC 4684 Constrained Route Distribution for BGP/MPLS IP VPN SAFNUM_FSPEC_RULE = 133 # RFC 5575 BGP flow spec SAFI SAFNUM_FSPEC_VPN_RULE = 134 # RFC 5575 BGP flow spec SAFI VPN
"""RFC 2858 subsequent address family numbers""" safnum_unicast = 1 safnum_mulcast = 2 safnum_unimulc = 3 safnum_mpls_label = 4 safnum_mcast_vpn = 5 safnum_encapsulation = 7 safnum_tunnel = 64 safnum_vpls = 65 safnum_mdt = 66 safnum_evpn = 70 safnum_bgpls = 71 safnum_srte = 73 safnum_lab_vpnunicast = 128 safnum_lab_vpnmulcast = 129 safnum_lab_vpnunimulc = 130 safnum_route_target = 132 safnum_fspec_rule = 133 safnum_fspec_vpn_rule = 134
"""Helper functions for small things done in many places.""" def dot_join(*args): """Join the args together.""" return '.'.join(args)
"""Helper functions for small things done in many places.""" def dot_join(*args): """Join the args together.""" return '.'.join(args)
NAMESPACE_FILE = '/var/run/secrets/kubernetes.io/serviceaccount/namespace' def get_k8s_namespace(): with open(NAMESPACE_FILE, 'r') as f: return f.read()
namespace_file = '/var/run/secrets/kubernetes.io/serviceaccount/namespace' def get_k8s_namespace(): with open(NAMESPACE_FILE, 'r') as f: return f.read()
# PySNMP SMI module. Autogenerated from smidump -f python TOKEN-RING-RMON-MIB # by libsmi2pysnmp-0.1.3 at Mon Apr 2 20:39:46 2012, # Python version sys.version_info(major=2, minor=7, micro=2, releaselevel='final', serial=0) # Imports ( Integer, ObjectIdentifier, OctetString, ) = mibBuilder.importSymbols("ASN1", "Integer", "ObjectIdentifier", "OctetString") ( NamedValues, ) = mibBuilder.importSymbols("ASN1-ENUMERATION", "NamedValues") ( ConstraintsIntersection, ConstraintsUnion, SingleValueConstraint, ValueRangeConstraint, ValueSizeConstraint, ) = mibBuilder.importSymbols("ASN1-REFINEMENT", "ConstraintsIntersection", "ConstraintsUnion", "SingleValueConstraint", "ValueRangeConstraint", "ValueSizeConstraint") ( EntryStatus, OwnerString, history, rmon, statistics, ) = mibBuilder.importSymbols("RFC1271-MIB", "EntryStatus", "OwnerString", "history", "rmon", "statistics") ( Bits, Counter32, Integer32, Integer32, MibIdentifier, MibScalar, MibTable, MibTableRow, MibTableColumn, TimeTicks, TimeTicks, ) = mibBuilder.importSymbols("SNMPv2-SMI", "Bits", "Counter32", "Integer32", "Integer32", "MibIdentifier", "MibScalar", "MibTable", "MibTableRow", "MibTableColumn", "TimeTicks", "TimeTicks") # Types class MacAddress(OctetString): subtypeSpec = OctetString.subtypeSpec+ValueSizeConstraint(6,6) fixedLength = 6 class TimeInterval(Integer32): pass # Objects tokenRingMLStatsTable = MibTable((1, 3, 6, 1, 2, 1, 16, 1, 2)) if mibBuilder.loadTexts: tokenRingMLStatsTable.setDescription("A list of Mac-Layer Token Ring statistics\nentries.") tokenRingMLStatsEntry = MibTableRow((1, 3, 6, 1, 2, 1, 16, 1, 2, 1)).setIndexNames((0, "TOKEN-RING-RMON-MIB", "tokenRingMLStatsIndex")) if mibBuilder.loadTexts: tokenRingMLStatsEntry.setDescription("A collection of Mac-Layer statistics kept for a\nparticular Token Ring interface.") tokenRingMLStatsIndex = MibTableColumn((1, 3, 6, 1, 2, 1, 16, 1, 2, 1, 1), Integer32().subtype(subtypeSpec=ValueRangeConstraint(1, 65535))).setMaxAccess("readonly") if mibBuilder.loadTexts: tokenRingMLStatsIndex.setDescription("The value of this object uniquely identifies this\ntokenRingMLStats entry.") tokenRingMLStatsDataSource = MibTableColumn((1, 3, 6, 1, 2, 1, 16, 1, 2, 1, 2), ObjectIdentifier()).setMaxAccess("readwrite") if mibBuilder.loadTexts: tokenRingMLStatsDataSource.setDescription("This object identifies the source of the data\nthat this tokenRingMLStats entry is configured to\nanalyze. This source can be any tokenRing\ninterface on this device. In order to identify a\nparticular interface, this object shall identify\nthe instance of the ifIndex object, defined in\nMIB-II [3], for the desired interface. For\nexample, if an entry were to receive data from\ninterface #1, this object would be set to\nifIndex.1.\n\nThe statistics in this group reflect all error\nreports on the local network segment attached to\nthe identified interface.\n\nThis object may not be modified if the associated\ntokenRingMLStatsStatus object is equal to\nvalid(1).") tokenRingMLStatsDropEvents = MibTableColumn((1, 3, 6, 1, 2, 1, 16, 1, 2, 1, 3), Counter32()).setMaxAccess("readonly") if mibBuilder.loadTexts: tokenRingMLStatsDropEvents.setDescription("The total number of events in which packets were\ndropped by the probe due to lack of resources.\nNote that this number is not necessarily the\nnumber of packets dropped; it is just the number\nof times this condition has been detected. This\nvalue is the same as the corresponding\ntokenRingPStatsDropEvents.") tokenRingMLStatsMacOctets = MibTableColumn((1, 3, 6, 1, 2, 1, 16, 1, 2, 1, 4), Counter32()).setMaxAccess("readonly") if mibBuilder.loadTexts: tokenRingMLStatsMacOctets.setDescription("The total number of octets of data in MAC packets\n(excluding those that were not good frames)\nreceived on the network (excluding framing bits\nbut including FCS octets).") tokenRingMLStatsMacPkts = MibTableColumn((1, 3, 6, 1, 2, 1, 16, 1, 2, 1, 5), Counter32()).setMaxAccess("readonly") if mibBuilder.loadTexts: tokenRingMLStatsMacPkts.setDescription("The total number of MAC packets (excluding\npackets that were not good frames) received.") tokenRingMLStatsRingPurgeEvents = MibTableColumn((1, 3, 6, 1, 2, 1, 16, 1, 2, 1, 6), Counter32()).setMaxAccess("readonly") if mibBuilder.loadTexts: tokenRingMLStatsRingPurgeEvents.setDescription("The total number of times that the ring enters\nthe ring purge state from normal ring state. The\nring purge state that comes in response to the\nclaim token or beacon state is not counted.") tokenRingMLStatsRingPurgePkts = MibTableColumn((1, 3, 6, 1, 2, 1, 16, 1, 2, 1, 7), Counter32()).setMaxAccess("readonly") if mibBuilder.loadTexts: tokenRingMLStatsRingPurgePkts.setDescription("The total number of ring purge MAC packets\ndetected by probe.") tokenRingMLStatsBeaconEvents = MibTableColumn((1, 3, 6, 1, 2, 1, 16, 1, 2, 1, 8), Counter32()).setMaxAccess("readonly") if mibBuilder.loadTexts: tokenRingMLStatsBeaconEvents.setDescription("The total number of times that the ring enters a\nbeaconing state (beaconFrameStreamingState,\nbeaconBitStreamingState,\nbeaconSetRecoveryModeState, or\nbeaconRingSignalLossState) from a non-beaconing\nstate. Note that a change of the source address\nof the beacon packet does not constitute a new\nbeacon event.") tokenRingMLStatsBeaconTime = MibTableColumn((1, 3, 6, 1, 2, 1, 16, 1, 2, 1, 9), TimeInterval()).setMaxAccess("readonly") if mibBuilder.loadTexts: tokenRingMLStatsBeaconTime.setDescription("The total amount of time that the ring has been\nin the beaconing state.") tokenRingMLStatsBeaconPkts = MibTableColumn((1, 3, 6, 1, 2, 1, 16, 1, 2, 1, 10), Counter32()).setMaxAccess("readonly") if mibBuilder.loadTexts: tokenRingMLStatsBeaconPkts.setDescription("The total number of beacon MAC packets detected\nby the probe.") tokenRingMLStatsClaimTokenEvents = MibTableColumn((1, 3, 6, 1, 2, 1, 16, 1, 2, 1, 11), Counter32()).setMaxAccess("readonly") if mibBuilder.loadTexts: tokenRingMLStatsClaimTokenEvents.setDescription("The total number of times that the ring enters\nthe claim token state from normal ring state or\nring purge state. The claim token state that\ncomes in response to a beacon state is not\ncounted.") tokenRingMLStatsClaimTokenPkts = MibTableColumn((1, 3, 6, 1, 2, 1, 16, 1, 2, 1, 12), Counter32()).setMaxAccess("readonly") if mibBuilder.loadTexts: tokenRingMLStatsClaimTokenPkts.setDescription("The total number of claim token MAC packets\ndetected by the probe.") tokenRingMLStatsNAUNChanges = MibTableColumn((1, 3, 6, 1, 2, 1, 16, 1, 2, 1, 13), Counter32()).setMaxAccess("readonly") if mibBuilder.loadTexts: tokenRingMLStatsNAUNChanges.setDescription("The total number of NAUN changes detected by the\nprobe.") tokenRingMLStatsLineErrors = MibTableColumn((1, 3, 6, 1, 2, 1, 16, 1, 2, 1, 14), Counter32()).setMaxAccess("readonly") if mibBuilder.loadTexts: tokenRingMLStatsLineErrors.setDescription("The total number of line errors reported in error\nreporting packets detected by the probe.") tokenRingMLStatsInternalErrors = MibTableColumn((1, 3, 6, 1, 2, 1, 16, 1, 2, 1, 15), Counter32()).setMaxAccess("readonly") if mibBuilder.loadTexts: tokenRingMLStatsInternalErrors.setDescription("The total number of adapter internal errors\nreported in error reporting packets detected by\nthe probe.") tokenRingMLStatsBurstErrors = MibTableColumn((1, 3, 6, 1, 2, 1, 16, 1, 2, 1, 16), Counter32()).setMaxAccess("readonly") if mibBuilder.loadTexts: tokenRingMLStatsBurstErrors.setDescription("The total number of burst errors reported in\nerror reporting packets detected by the probe.") tokenRingMLStatsACErrors = MibTableColumn((1, 3, 6, 1, 2, 1, 16, 1, 2, 1, 17), Counter32()).setMaxAccess("readonly") if mibBuilder.loadTexts: tokenRingMLStatsACErrors.setDescription("The total number of AC (Address Copied) errors\nreported in error reporting packets detected by\nthe probe.") tokenRingMLStatsAbortErrors = MibTableColumn((1, 3, 6, 1, 2, 1, 16, 1, 2, 1, 18), Counter32()).setMaxAccess("readonly") if mibBuilder.loadTexts: tokenRingMLStatsAbortErrors.setDescription("The total number of abort delimiters reported in\nerror reporting packets detected by the probe.") tokenRingMLStatsLostFrameErrors = MibTableColumn((1, 3, 6, 1, 2, 1, 16, 1, 2, 1, 19), Counter32()).setMaxAccess("readonly") if mibBuilder.loadTexts: tokenRingMLStatsLostFrameErrors.setDescription("The total number of lost frame errors reported in\nerror reporting packets detected by the probe.") tokenRingMLStatsCongestionErrors = MibTableColumn((1, 3, 6, 1, 2, 1, 16, 1, 2, 1, 20), Counter32()).setMaxAccess("readonly") if mibBuilder.loadTexts: tokenRingMLStatsCongestionErrors.setDescription("The total number of receive congestion errors\nreported in error reporting packets detected by\nthe probe.") tokenRingMLStatsFrameCopiedErrors = MibTableColumn((1, 3, 6, 1, 2, 1, 16, 1, 2, 1, 21), Counter32()).setMaxAccess("readonly") if mibBuilder.loadTexts: tokenRingMLStatsFrameCopiedErrors.setDescription("The total number of frame copied errors reported\nin error reporting packets detected by the probe.") tokenRingMLStatsFrequencyErrors = MibTableColumn((1, 3, 6, 1, 2, 1, 16, 1, 2, 1, 22), Counter32()).setMaxAccess("readonly") if mibBuilder.loadTexts: tokenRingMLStatsFrequencyErrors.setDescription("The total number of frequency errors reported in\nerror reporting packets detected by the probe.") tokenRingMLStatsTokenErrors = MibTableColumn((1, 3, 6, 1, 2, 1, 16, 1, 2, 1, 23), Counter32()).setMaxAccess("readonly") if mibBuilder.loadTexts: tokenRingMLStatsTokenErrors.setDescription("The total number of token errors reported in\nerror reporting packets detected by the probe.") tokenRingMLStatsSoftErrorReports = MibTableColumn((1, 3, 6, 1, 2, 1, 16, 1, 2, 1, 24), Counter32()).setMaxAccess("readonly") if mibBuilder.loadTexts: tokenRingMLStatsSoftErrorReports.setDescription("The total number of soft error report frames\ndetected by the probe.") tokenRingMLStatsRingPollEvents = MibTableColumn((1, 3, 6, 1, 2, 1, 16, 1, 2, 1, 25), Counter32()).setMaxAccess("readonly") if mibBuilder.loadTexts: tokenRingMLStatsRingPollEvents.setDescription("The total number of ring poll events detected by\nthe probe (i.e. the number of ring polls initiated\nby the active monitor that were detected).") tokenRingMLStatsOwner = MibTableColumn((1, 3, 6, 1, 2, 1, 16, 1, 2, 1, 26), OwnerString()).setMaxAccess("readwrite") if mibBuilder.loadTexts: tokenRingMLStatsOwner.setDescription("The base_entity that configured this entry and is\ntherefore using the resources assigned to it.") tokenRingMLStatsStatus = MibTableColumn((1, 3, 6, 1, 2, 1, 16, 1, 2, 1, 27), EntryStatus()).setMaxAccess("readwrite") if mibBuilder.loadTexts: tokenRingMLStatsStatus.setDescription("The status of this tokenRingMLStats entry.") tokenRingPStatsTable = MibTable((1, 3, 6, 1, 2, 1, 16, 1, 3)) if mibBuilder.loadTexts: tokenRingPStatsTable.setDescription("A list of promiscuous Token Ring statistics\nentries.") tokenRingPStatsEntry = MibTableRow((1, 3, 6, 1, 2, 1, 16, 1, 3, 1)).setIndexNames((0, "TOKEN-RING-RMON-MIB", "tokenRingPStatsIndex")) if mibBuilder.loadTexts: tokenRingPStatsEntry.setDescription("A collection of promiscuous statistics kept for\nnon-MAC packets on a particular Token Ring\ninterface.") tokenRingPStatsIndex = MibTableColumn((1, 3, 6, 1, 2, 1, 16, 1, 3, 1, 1), Integer32().subtype(subtypeSpec=ValueRangeConstraint(1, 65535))).setMaxAccess("readonly") if mibBuilder.loadTexts: tokenRingPStatsIndex.setDescription("The value of this object uniquely identifies this\ntokenRingPStats entry.") tokenRingPStatsDataSource = MibTableColumn((1, 3, 6, 1, 2, 1, 16, 1, 3, 1, 2), ObjectIdentifier()).setMaxAccess("readwrite") if mibBuilder.loadTexts: tokenRingPStatsDataSource.setDescription("This object identifies the source of the data\nthat this tokenRingPStats entry is configured to\nanalyze. This source can be any tokenRing\ninterface on this device. In order to identify a\nparticular interface, this object shall identify\nthe instance of the ifIndex object, defined in\nMIB-II [3], for the desired interface. For\nexample, if an entry were to receive data from\ninterface #1, this object would be set to\nifIndex.1.\n\nThe statistics in this group reflect all non-MAC\npackets on the local network segment attached to\nthe identified interface.\n\nThis object may not be modified if the associated\ntokenRingPStatsStatus object is equal to\nvalid(1).") tokenRingPStatsDropEvents = MibTableColumn((1, 3, 6, 1, 2, 1, 16, 1, 3, 1, 3), Counter32()).setMaxAccess("readonly") if mibBuilder.loadTexts: tokenRingPStatsDropEvents.setDescription("The total number of events in which packets were\ndropped by the probe due to lack of resources.\nNote that this number is not necessarily the\nnumber of packets dropped; it is just the number\nof times this condition has been detected. This\nvalue is the same as the corresponding\ntokenRingMLStatsDropEvents") tokenRingPStatsDataOctets = MibTableColumn((1, 3, 6, 1, 2, 1, 16, 1, 3, 1, 4), Counter32()).setMaxAccess("readonly") if mibBuilder.loadTexts: tokenRingPStatsDataOctets.setDescription("The total number of octets of data in good frames\nreceived on the network (excluding framing bits\nbut including FCS octets) in non-MAC packets.") tokenRingPStatsDataPkts = MibTableColumn((1, 3, 6, 1, 2, 1, 16, 1, 3, 1, 5), Counter32()).setMaxAccess("readonly") if mibBuilder.loadTexts: tokenRingPStatsDataPkts.setDescription("The total number of non-MAC packets in good\nframes. received.") tokenRingPStatsDataBroadcastPkts = MibTableColumn((1, 3, 6, 1, 2, 1, 16, 1, 3, 1, 6), Counter32()).setMaxAccess("readonly") if mibBuilder.loadTexts: tokenRingPStatsDataBroadcastPkts.setDescription("The total number of good non-MAC frames received\nthat were directed to an LLC broadcast address\n(0xFFFFFFFFFFFF or 0xC000FFFFFFFF).") tokenRingPStatsDataMulticastPkts = MibTableColumn((1, 3, 6, 1, 2, 1, 16, 1, 3, 1, 7), Counter32()).setMaxAccess("readonly") if mibBuilder.loadTexts: tokenRingPStatsDataMulticastPkts.setDescription("The total number of good non-MAC frames received\nthat were directed to a local or global multicast\nor functional address. Note that this number does\nnot include packets directed to the broadcast\naddress.") tokenRingPStatsDataPkts18to63Octets = MibTableColumn((1, 3, 6, 1, 2, 1, 16, 1, 3, 1, 8), Counter32()).setMaxAccess("readonly") if mibBuilder.loadTexts: tokenRingPStatsDataPkts18to63Octets.setDescription("The total number of good non-MAC frames received\nthat were between 18 and 63 octets in length\ninclusive, excluding framing bits but including\nFCS octets.") tokenRingPStatsDataPkts64to127Octets = MibTableColumn((1, 3, 6, 1, 2, 1, 16, 1, 3, 1, 9), Counter32()).setMaxAccess("readonly") if mibBuilder.loadTexts: tokenRingPStatsDataPkts64to127Octets.setDescription("The total number of good non-MAC frames received\nthat were between 64 and 127 octets in length\ninclusive, excluding framing bits but including\nFCS octets.") tokenRingPStatsDataPkts128to255Octets = MibTableColumn((1, 3, 6, 1, 2, 1, 16, 1, 3, 1, 10), Counter32()).setMaxAccess("readonly") if mibBuilder.loadTexts: tokenRingPStatsDataPkts128to255Octets.setDescription("The total number of good non-MAC frames received\nthat were between 128 and 255 octets in length\ninclusive, excluding framing bits but including\nFCS octets.") tokenRingPStatsDataPkts256to511Octets = MibTableColumn((1, 3, 6, 1, 2, 1, 16, 1, 3, 1, 11), Counter32()).setMaxAccess("readonly") if mibBuilder.loadTexts: tokenRingPStatsDataPkts256to511Octets.setDescription("The total number of good non-MAC frames received\nthat were between 256 and 511 octets in length\ninclusive, excluding framing bits but including\nFCS octets.") tokenRingPStatsDataPkts512to1023Octets = MibTableColumn((1, 3, 6, 1, 2, 1, 16, 1, 3, 1, 12), Counter32()).setMaxAccess("readonly") if mibBuilder.loadTexts: tokenRingPStatsDataPkts512to1023Octets.setDescription("The total number of good non-MAC frames received\nthat were between 512 and 1023 octets in length\ninclusive, excluding framing bits but including\nFCS octets.") tokenRingPStatsDataPkts1024to2047Octets = MibTableColumn((1, 3, 6, 1, 2, 1, 16, 1, 3, 1, 13), Counter32()).setMaxAccess("readonly") if mibBuilder.loadTexts: tokenRingPStatsDataPkts1024to2047Octets.setDescription("The total number of good non-MAC frames received\nthat were between 1024 and 2047 octets in length\ninclusive, excluding framing bits but including\nFCS octets.") tokenRingPStatsDataPkts2048to4095Octets = MibTableColumn((1, 3, 6, 1, 2, 1, 16, 1, 3, 1, 14), Counter32()).setMaxAccess("readonly") if mibBuilder.loadTexts: tokenRingPStatsDataPkts2048to4095Octets.setDescription("The total number of good non-MAC frames received\nthat were between 2048 and 4095 octets in length\ninclusive, excluding framing bits but including\nFCS octets.") tokenRingPStatsDataPkts4096to8191Octets = MibTableColumn((1, 3, 6, 1, 2, 1, 16, 1, 3, 1, 15), Counter32()).setMaxAccess("readonly") if mibBuilder.loadTexts: tokenRingPStatsDataPkts4096to8191Octets.setDescription("The total number of good non-MAC frames received\nthat were between 4096 and 8191 octets in length\ninclusive, excluding framing bits but including\nFCS octets.") tokenRingPStatsDataPkts8192to18000Octets = MibTableColumn((1, 3, 6, 1, 2, 1, 16, 1, 3, 1, 16), Counter32()).setMaxAccess("readonly") if mibBuilder.loadTexts: tokenRingPStatsDataPkts8192to18000Octets.setDescription("The total number of good non-MAC frames received\nthat were between 8192 and 18000 octets in length\ninclusive, excluding framing bits but including\nFCS octets.") tokenRingPStatsDataPktsGreaterThan18000Octets = MibTableColumn((1, 3, 6, 1, 2, 1, 16, 1, 3, 1, 17), Counter32()).setMaxAccess("readonly") if mibBuilder.loadTexts: tokenRingPStatsDataPktsGreaterThan18000Octets.setDescription("The total number of good non-MAC frames received\nthat were greater than 18000 octets in length,\nexcluding framing bits but including FCS octets.") tokenRingPStatsOwner = MibTableColumn((1, 3, 6, 1, 2, 1, 16, 1, 3, 1, 18), OwnerString()).setMaxAccess("readwrite") if mibBuilder.loadTexts: tokenRingPStatsOwner.setDescription("The base_entity that configured this entry and is\ntherefore using the resources assigned to it.") tokenRingPStatsStatus = MibTableColumn((1, 3, 6, 1, 2, 1, 16, 1, 3, 1, 19), EntryStatus()).setMaxAccess("readwrite") if mibBuilder.loadTexts: tokenRingPStatsStatus.setDescription("The status of this tokenRingPStats entry.") tokenRingMLHistoryTable = MibTable((1, 3, 6, 1, 2, 1, 16, 2, 3)) if mibBuilder.loadTexts: tokenRingMLHistoryTable.setDescription("A list of Mac-Layer Token Ring statistics\nentries.") tokenRingMLHistoryEntry = MibTableRow((1, 3, 6, 1, 2, 1, 16, 2, 3, 1)).setIndexNames((0, "TOKEN-RING-RMON-MIB", "tokenRingMLHistoryIndex"), (0, "TOKEN-RING-RMON-MIB", "tokenRingMLHistorySampleIndex")) if mibBuilder.loadTexts: tokenRingMLHistoryEntry.setDescription("A collection of Mac-Layer statistics kept for a\nparticular Token Ring interface.") tokenRingMLHistoryIndex = MibTableColumn((1, 3, 6, 1, 2, 1, 16, 2, 3, 1, 1), Integer32().subtype(subtypeSpec=ValueRangeConstraint(1, 65535))).setMaxAccess("readonly") if mibBuilder.loadTexts: tokenRingMLHistoryIndex.setDescription("The history of which this entry is a part. The\nhistory identified by a particular value of this\nindex is the same history as identified by the\nsame value of historyControlIndex.") tokenRingMLHistorySampleIndex = MibTableColumn((1, 3, 6, 1, 2, 1, 16, 2, 3, 1, 2), Integer32()).setMaxAccess("readonly") if mibBuilder.loadTexts: tokenRingMLHistorySampleIndex.setDescription("An index that uniquely identifies the particular\nMac-Layer sample this entry represents among all\nMac-Layer samples associated with the same\nhistoryControlEntry. This index starts at 1 and\nincreases by one as each new sample is taken.") tokenRingMLHistoryIntervalStart = MibTableColumn((1, 3, 6, 1, 2, 1, 16, 2, 3, 1, 3), TimeTicks()).setMaxAccess("readonly") if mibBuilder.loadTexts: tokenRingMLHistoryIntervalStart.setDescription("The value of sysUpTime at the start of the\ninterval over which this sample was measured. If\nthe probe keeps track of the time of day, it\nshould start the first sample of the history at a\ntime such that when the next hour of the day\nbegins, a sample is started at that instant. Note\nthat following this rule may require the probe to\ndelay collecting the first sample of the history,\nas each sample must be of the same interval. Also\nnote that the sample which is currently being\ncollected is not accessible in this table until\nthe end of its interval.") tokenRingMLHistoryDropEvents = MibTableColumn((1, 3, 6, 1, 2, 1, 16, 2, 3, 1, 4), Counter32()).setMaxAccess("readonly") if mibBuilder.loadTexts: tokenRingMLHistoryDropEvents.setDescription("The total number of events in which packets were\ndropped by the probe due to lack of resources\nduring this sampling interval. Note that this\nnumber is not necessarily the number of packets\ndropped, it is just the number of times this\ncondition has been detected.") tokenRingMLHistoryMacOctets = MibTableColumn((1, 3, 6, 1, 2, 1, 16, 2, 3, 1, 5), Counter32()).setMaxAccess("readonly") if mibBuilder.loadTexts: tokenRingMLHistoryMacOctets.setDescription("The total number of octets of data in MAC packets\n(excluding those that were not good frames)\nreceived on the network during this sampling\ninterval (excluding framing bits but including FCS\noctets).") tokenRingMLHistoryMacPkts = MibTableColumn((1, 3, 6, 1, 2, 1, 16, 2, 3, 1, 6), Counter32()).setMaxAccess("readonly") if mibBuilder.loadTexts: tokenRingMLHistoryMacPkts.setDescription("The total number of MAC packets (excluding those\nthat were not good frames) received during this\nsampling interval.") tokenRingMLHistoryRingPurgeEvents = MibTableColumn((1, 3, 6, 1, 2, 1, 16, 2, 3, 1, 7), Counter32()).setMaxAccess("readonly") if mibBuilder.loadTexts: tokenRingMLHistoryRingPurgeEvents.setDescription("The total number of times that the ring entered\nthe ring purge state from normal ring state during\nthis sampling interval. The ring purge state that\ncomes from the claim token or beacon state is not\ncounted.") tokenRingMLHistoryRingPurgePkts = MibTableColumn((1, 3, 6, 1, 2, 1, 16, 2, 3, 1, 8), Counter32()).setMaxAccess("readonly") if mibBuilder.loadTexts: tokenRingMLHistoryRingPurgePkts.setDescription("The total number of Ring Purge MAC packets\ndetected by the probe during this sampling\ninterval.") tokenRingMLHistoryBeaconEvents = MibTableColumn((1, 3, 6, 1, 2, 1, 16, 2, 3, 1, 9), Counter32()).setMaxAccess("readonly") if mibBuilder.loadTexts: tokenRingMLHistoryBeaconEvents.setDescription("The total number of times that the ring enters a\nbeaconing state (beaconFrameStreamingState,\nbeaconBitStreamingState,\nbeaconSetRecoveryModeState, or\nbeaconRingSignalLossState) during this sampling\ninterval. Note that a change of the source\naddress of the beacon packet does not constitute a\nnew beacon event.") tokenRingMLHistoryBeaconTime = MibTableColumn((1, 3, 6, 1, 2, 1, 16, 2, 3, 1, 10), TimeInterval()).setMaxAccess("readonly") if mibBuilder.loadTexts: tokenRingMLHistoryBeaconTime.setDescription("The amount of time that the ring has been in the\nbeaconing state during this sampling interval.") tokenRingMLHistoryBeaconPkts = MibTableColumn((1, 3, 6, 1, 2, 1, 16, 2, 3, 1, 11), Counter32()).setMaxAccess("readonly") if mibBuilder.loadTexts: tokenRingMLHistoryBeaconPkts.setDescription("The total number of beacon MAC packets detected\nby the probe during this sampling interval.") tokenRingMLHistoryClaimTokenEvents = MibTableColumn((1, 3, 6, 1, 2, 1, 16, 2, 3, 1, 12), Counter32()).setMaxAccess("readonly") if mibBuilder.loadTexts: tokenRingMLHistoryClaimTokenEvents.setDescription("The total number of times that the ring enters\nthe claim token state from normal ring state or\nring purge state during this sampling interval.\nThe claim token state that comes from the beacon\nstate is not counted.") tokenRingMLHistoryClaimTokenPkts = MibTableColumn((1, 3, 6, 1, 2, 1, 16, 2, 3, 1, 13), Counter32()).setMaxAccess("readonly") if mibBuilder.loadTexts: tokenRingMLHistoryClaimTokenPkts.setDescription("The total number of claim token MAC packets\ndetected by the probe during this sampling\ninterval.") tokenRingMLHistoryNAUNChanges = MibTableColumn((1, 3, 6, 1, 2, 1, 16, 2, 3, 1, 14), Counter32()).setMaxAccess("readonly") if mibBuilder.loadTexts: tokenRingMLHistoryNAUNChanges.setDescription("The total number of NAUN changes detected by the\nprobe during this sampling interval.") tokenRingMLHistoryLineErrors = MibTableColumn((1, 3, 6, 1, 2, 1, 16, 2, 3, 1, 15), Counter32()).setMaxAccess("readonly") if mibBuilder.loadTexts: tokenRingMLHistoryLineErrors.setDescription("The total number of line errors reported in error\nreporting packets detected by the probe during\nthis sampling interval.") tokenRingMLHistoryInternalErrors = MibTableColumn((1, 3, 6, 1, 2, 1, 16, 2, 3, 1, 16), Counter32()).setMaxAccess("readonly") if mibBuilder.loadTexts: tokenRingMLHistoryInternalErrors.setDescription("The total number of adapter internal errors\nreported in error reporting packets detected by\nthe probe during this sampling interval.") tokenRingMLHistoryBurstErrors = MibTableColumn((1, 3, 6, 1, 2, 1, 16, 2, 3, 1, 17), Counter32()).setMaxAccess("readonly") if mibBuilder.loadTexts: tokenRingMLHistoryBurstErrors.setDescription("The total number of burst errors reported in\nerror reporting packets detected by the probe\nduring this sampling interval.") tokenRingMLHistoryACErrors = MibTableColumn((1, 3, 6, 1, 2, 1, 16, 2, 3, 1, 18), Counter32()).setMaxAccess("readonly") if mibBuilder.loadTexts: tokenRingMLHistoryACErrors.setDescription("The total number of AC (Address Copied) errors\nreported in error reporting packets detected by\nthe probe during this sampling interval.") tokenRingMLHistoryAbortErrors = MibTableColumn((1, 3, 6, 1, 2, 1, 16, 2, 3, 1, 19), Counter32()).setMaxAccess("readonly") if mibBuilder.loadTexts: tokenRingMLHistoryAbortErrors.setDescription("The total number of abort delimiters reported in\nerror reporting packets detected by the probe\nduring this sampling interval.") tokenRingMLHistoryLostFrameErrors = MibTableColumn((1, 3, 6, 1, 2, 1, 16, 2, 3, 1, 20), Counter32()).setMaxAccess("readonly") if mibBuilder.loadTexts: tokenRingMLHistoryLostFrameErrors.setDescription("The total number of lost frame errors reported in\nerror reporting packets detected by the probe\nduring this sampling interval.") tokenRingMLHistoryCongestionErrors = MibTableColumn((1, 3, 6, 1, 2, 1, 16, 2, 3, 1, 21), Counter32()).setMaxAccess("readonly") if mibBuilder.loadTexts: tokenRingMLHistoryCongestionErrors.setDescription("The total number of receive congestion errors\nreported in error reporting packets detected by\nthe probe during this sampling interval.") tokenRingMLHistoryFrameCopiedErrors = MibTableColumn((1, 3, 6, 1, 2, 1, 16, 2, 3, 1, 22), Counter32()).setMaxAccess("readonly") if mibBuilder.loadTexts: tokenRingMLHistoryFrameCopiedErrors.setDescription("The total number of frame copied errors reported\nin error reporting packets detected by the probe\nduring this sampling interval.") tokenRingMLHistoryFrequencyErrors = MibTableColumn((1, 3, 6, 1, 2, 1, 16, 2, 3, 1, 23), Counter32()).setMaxAccess("readonly") if mibBuilder.loadTexts: tokenRingMLHistoryFrequencyErrors.setDescription("The total number of frequency errors reported in\nerror reporting packets detected by the probe\nduring this sampling interval.") tokenRingMLHistoryTokenErrors = MibTableColumn((1, 3, 6, 1, 2, 1, 16, 2, 3, 1, 24), Counter32()).setMaxAccess("readonly") if mibBuilder.loadTexts: tokenRingMLHistoryTokenErrors.setDescription("The total number of token errors reported in\nerror reporting packets detected by the probe\nduring this sampling interval.") tokenRingMLHistorySoftErrorReports = MibTableColumn((1, 3, 6, 1, 2, 1, 16, 2, 3, 1, 25), Counter32()).setMaxAccess("readonly") if mibBuilder.loadTexts: tokenRingMLHistorySoftErrorReports.setDescription("The total number of soft error report frames\ndetected by the probe during this sampling\ninterval.") tokenRingMLHistoryRingPollEvents = MibTableColumn((1, 3, 6, 1, 2, 1, 16, 2, 3, 1, 26), Counter32()).setMaxAccess("readonly") if mibBuilder.loadTexts: tokenRingMLHistoryRingPollEvents.setDescription("The total number of ring poll events detected by\nthe probe during this sampling interval.") tokenRingMLHistoryActiveStations = MibTableColumn((1, 3, 6, 1, 2, 1, 16, 2, 3, 1, 27), Integer32()).setMaxAccess("readonly") if mibBuilder.loadTexts: tokenRingMLHistoryActiveStations.setDescription("The maximum number of active stations on the ring\ndetected by the probe during this sampling\ninterval.") tokenRingPHistoryTable = MibTable((1, 3, 6, 1, 2, 1, 16, 2, 4)) if mibBuilder.loadTexts: tokenRingPHistoryTable.setDescription("A list of promiscuous Token Ring statistics\nentries.") tokenRingPHistoryEntry = MibTableRow((1, 3, 6, 1, 2, 1, 16, 2, 4, 1)).setIndexNames((0, "TOKEN-RING-RMON-MIB", "tokenRingPHistoryIndex"), (0, "TOKEN-RING-RMON-MIB", "tokenRingPHistorySampleIndex")) if mibBuilder.loadTexts: tokenRingPHistoryEntry.setDescription("A collection of promiscuous statistics kept for a\nparticular Token Ring interface.") tokenRingPHistoryIndex = MibTableColumn((1, 3, 6, 1, 2, 1, 16, 2, 4, 1, 1), Integer32().subtype(subtypeSpec=ValueRangeConstraint(1, 65535))).setMaxAccess("readonly") if mibBuilder.loadTexts: tokenRingPHistoryIndex.setDescription("The history of which this entry is a part. The\nhistory identified by a particular value of this\nindex is the same history as identified by the\nsame value of historyControlIndex.") tokenRingPHistorySampleIndex = MibTableColumn((1, 3, 6, 1, 2, 1, 16, 2, 4, 1, 2), Integer32()).setMaxAccess("readonly") if mibBuilder.loadTexts: tokenRingPHistorySampleIndex.setDescription("An index that uniquely identifies the particular\nsample this entry represents among all samples\nassociated with the same historyControlEntry.\nThis index starts at 1 and increases by one as\neach new sample is taken.") tokenRingPHistoryIntervalStart = MibTableColumn((1, 3, 6, 1, 2, 1, 16, 2, 4, 1, 3), TimeTicks()).setMaxAccess("readonly") if mibBuilder.loadTexts: tokenRingPHistoryIntervalStart.setDescription("The value of sysUpTime at the start of the\ninterval over which this sample was measured. If\nthe probe keeps track of the time of day, it\nshould start the first sample of the history at a\ntime such that when the next hour of the day\nbegins, a sample is started at that instant. Note\nthat following this rule may require the probe to\ndelay collecting the first sample of the history,\nas each sample must be of the same interval. Also\nnote that the sample which is currently being\ncollected is not accessible in this table until\nthe end of its interval.") tokenRingPHistoryDropEvents = MibTableColumn((1, 3, 6, 1, 2, 1, 16, 2, 4, 1, 4), Counter32()).setMaxAccess("readonly") if mibBuilder.loadTexts: tokenRingPHistoryDropEvents.setDescription("The total number of events in which packets were\ndropped by the probe due to lack of resources\nduring this sampling interval. Note that this\nnumber is not necessarily the number of packets\ndropped, it is just the number of times this\ncondition has been detected.") tokenRingPHistoryDataOctets = MibTableColumn((1, 3, 6, 1, 2, 1, 16, 2, 4, 1, 5), Counter32()).setMaxAccess("readonly") if mibBuilder.loadTexts: tokenRingPHistoryDataOctets.setDescription("The total number of octets of data in good frames\nreceived on the network (excluding framing bits\nbut including FCS octets) in non-MAC packets\nduring this sampling interval.") tokenRingPHistoryDataPkts = MibTableColumn((1, 3, 6, 1, 2, 1, 16, 2, 4, 1, 6), Counter32()).setMaxAccess("readonly") if mibBuilder.loadTexts: tokenRingPHistoryDataPkts.setDescription("The total number of good non-MAC frames received\nduring this sampling interval.") tokenRingPHistoryDataBroadcastPkts = MibTableColumn((1, 3, 6, 1, 2, 1, 16, 2, 4, 1, 7), Counter32()).setMaxAccess("readonly") if mibBuilder.loadTexts: tokenRingPHistoryDataBroadcastPkts.setDescription("The total number of good non-MAC frames received\nduring this sampling interval that were directed\nto an LLC broadcast address (0xFFFFFFFFFFFF or\n0xC000FFFFFFFF).") tokenRingPHistoryDataMulticastPkts = MibTableColumn((1, 3, 6, 1, 2, 1, 16, 2, 4, 1, 8), Counter32()).setMaxAccess("readonly") if mibBuilder.loadTexts: tokenRingPHistoryDataMulticastPkts.setDescription("The total number of good non-MAC frames received\nduring this sampling interval that were directed\nto a local or global multicast or functional\naddress. Note that this number does not include\npackets directed to the broadcast address.") tokenRingPHistoryDataPkts18to63Octets = MibTableColumn((1, 3, 6, 1, 2, 1, 16, 2, 4, 1, 9), Counter32()).setMaxAccess("readonly") if mibBuilder.loadTexts: tokenRingPHistoryDataPkts18to63Octets.setDescription("The total number of good non-MAC frames received\nduring this sampling interval that were between 18\nand 63 octets in length inclusive, excluding\nframing bits but including FCS octets.") tokenRingPHistoryDataPkts64to127Octets = MibTableColumn((1, 3, 6, 1, 2, 1, 16, 2, 4, 1, 10), Counter32()).setMaxAccess("readonly") if mibBuilder.loadTexts: tokenRingPHistoryDataPkts64to127Octets.setDescription("The total number of good non-MAC frames received\nduring this sampling interval that were between 64\nand 127 octets in length inclusive, excluding\nframing bits but including FCS octets.") tokenRingPHistoryDataPkts128to255Octets = MibTableColumn((1, 3, 6, 1, 2, 1, 16, 2, 4, 1, 11), Counter32()).setMaxAccess("readonly") if mibBuilder.loadTexts: tokenRingPHistoryDataPkts128to255Octets.setDescription("The total number of good non-MAC frames received\nduring this sampling interval that were between\n128 and 255 octets in length inclusive, excluding\nframing bits but including FCS octets.") tokenRingPHistoryDataPkts256to511Octets = MibTableColumn((1, 3, 6, 1, 2, 1, 16, 2, 4, 1, 12), Counter32()).setMaxAccess("readonly") if mibBuilder.loadTexts: tokenRingPHistoryDataPkts256to511Octets.setDescription("The total number of good non-MAC frames received\nduring this sampling interval that were between\n256 and 511 octets in length inclusive, excluding\nframing bits but including FCS octets.") tokenRingPHistoryDataPkts512to1023Octets = MibTableColumn((1, 3, 6, 1, 2, 1, 16, 2, 4, 1, 13), Counter32()).setMaxAccess("readonly") if mibBuilder.loadTexts: tokenRingPHistoryDataPkts512to1023Octets.setDescription("The total number of good non-MAC frames received\nduring this sampling interval that were between\n512 and 1023 octets in length inclusive, excluding\nframing bits but including FCS octets.") tokenRingPHistoryDataPkts1024to2047Octets = MibTableColumn((1, 3, 6, 1, 2, 1, 16, 2, 4, 1, 14), Counter32()).setMaxAccess("readonly") if mibBuilder.loadTexts: tokenRingPHistoryDataPkts1024to2047Octets.setDescription("The total number of good non-MAC frames received\nduring this sampling interval that were between\n1024 and 2047 octets in length inclusive,\nexcluding framing bits but including FCS octets.") tokenRingPHistoryDataPkts2048to4095Octets = MibTableColumn((1, 3, 6, 1, 2, 1, 16, 2, 4, 1, 15), Counter32()).setMaxAccess("readonly") if mibBuilder.loadTexts: tokenRingPHistoryDataPkts2048to4095Octets.setDescription("The total number of good non-MAC frames received\nduring this sampling interval that were between\n2048 and 4095 octets in length inclusive,\nexcluding framing bits but including FCS octets.") tokenRingPHistoryDataPkts4096to8191Octets = MibTableColumn((1, 3, 6, 1, 2, 1, 16, 2, 4, 1, 16), Counter32()).setMaxAccess("readonly") if mibBuilder.loadTexts: tokenRingPHistoryDataPkts4096to8191Octets.setDescription("The total number of good non-MAC frames received\nduring this sampling interval that were between\n4096 and 8191 octets in length inclusive,\nexcluding framing bits but including FCS octets.") tokenRingPHistoryDataPkts8192to18000Octets = MibTableColumn((1, 3, 6, 1, 2, 1, 16, 2, 4, 1, 17), Counter32()).setMaxAccess("readonly") if mibBuilder.loadTexts: tokenRingPHistoryDataPkts8192to18000Octets.setDescription("The total number of good non-MAC frames received\nduring this sampling interval that were between\n8192 and 18000 octets in length inclusive,\nexcluding framing bits but including FCS octets.") tokenRingPHistoryDataPktsGreaterThan18000Octets = MibTableColumn((1, 3, 6, 1, 2, 1, 16, 2, 4, 1, 18), Counter32()).setMaxAccess("readonly") if mibBuilder.loadTexts: tokenRingPHistoryDataPktsGreaterThan18000Octets.setDescription("The total number of good non-MAC frames received\nduring this sampling interval that were greater\nthan 18000 octets in length, excluding framing\nbits but including FCS octets.") tokenRing = MibIdentifier((1, 3, 6, 1, 2, 1, 16, 10)) ringStationControlTable = MibTable((1, 3, 6, 1, 2, 1, 16, 10, 1)) if mibBuilder.loadTexts: ringStationControlTable.setDescription("A list of ringStation table control entries.") ringStationControlEntry = MibTableRow((1, 3, 6, 1, 2, 1, 16, 10, 1, 1)).setIndexNames((0, "TOKEN-RING-RMON-MIB", "ringStationControlIfIndex")) if mibBuilder.loadTexts: ringStationControlEntry.setDescription("A list of parameters that set up the discovery of\nstations on a particular interface and the\ncollection of statistics about these stations.") ringStationControlIfIndex = MibTableColumn((1, 3, 6, 1, 2, 1, 16, 10, 1, 1, 1), Integer32().subtype(subtypeSpec=ValueRangeConstraint(1, 65535))).setMaxAccess("readonly") if mibBuilder.loadTexts: ringStationControlIfIndex.setDescription("The value of this object uniquely identifies the\ninterface on this remote network monitoring device\nfrom which ringStation data is collected. The\ninterface identified by a particular value of this\nobject is the same interface as identified by the\nsame value of the ifIndex object, defined in MIB-\nII [3].") ringStationControlTableSize = MibTableColumn((1, 3, 6, 1, 2, 1, 16, 10, 1, 1, 2), Integer32()).setMaxAccess("readonly") if mibBuilder.loadTexts: ringStationControlTableSize.setDescription("The number of ringStationEntries in the\nringStationTable associated with this\nringStationControlEntry.") ringStationControlActiveStations = MibTableColumn((1, 3, 6, 1, 2, 1, 16, 10, 1, 1, 3), Integer32()).setMaxAccess("readonly") if mibBuilder.loadTexts: ringStationControlActiveStations.setDescription("The number of active ringStationEntries in the\nringStationTable associated with this\nringStationControlEntry.") ringStationControlRingState = MibTableColumn((1, 3, 6, 1, 2, 1, 16, 10, 1, 1, 4), Integer().subtype(subtypeSpec=SingleValueConstraint(3,5,2,7,4,6,1,)).subtype(namedValues=NamedValues(("normalOperation", 1), ("ringPurgeState", 2), ("claimTokenState", 3), ("beaconFrameStreamingState", 4), ("beaconBitStreamingState", 5), ("beaconRingSignalLossState", 6), ("beaconSetRecoveryModeState", 7), ))).setMaxAccess("readonly") if mibBuilder.loadTexts: ringStationControlRingState.setDescription("The current status of this ring.") ringStationControlBeaconSender = MibTableColumn((1, 3, 6, 1, 2, 1, 16, 10, 1, 1, 5), MacAddress()).setMaxAccess("readonly") if mibBuilder.loadTexts: ringStationControlBeaconSender.setDescription("The address of the sender of the last beacon\nframe received by the probe on this ring. If no\nbeacon frames have been received, this object\nshall be equal to six octets of zero.") ringStationControlBeaconNAUN = MibTableColumn((1, 3, 6, 1, 2, 1, 16, 10, 1, 1, 6), MacAddress()).setMaxAccess("readonly") if mibBuilder.loadTexts: ringStationControlBeaconNAUN.setDescription("The address of the NAUN in the last beacon frame\nreceived by the probe on this ring. If no beacon\nframes have been received, this object shall be\nequal to six octets of zero.") ringStationControlActiveMonitor = MibTableColumn((1, 3, 6, 1, 2, 1, 16, 10, 1, 1, 7), MacAddress()).setMaxAccess("readonly") if mibBuilder.loadTexts: ringStationControlActiveMonitor.setDescription("The address of the Active Monitor on this\nsegment. If this address is unknown, this object\nshall be equal to six octets of zero.") ringStationControlOrderChanges = MibTableColumn((1, 3, 6, 1, 2, 1, 16, 10, 1, 1, 8), Counter32()).setMaxAccess("readonly") if mibBuilder.loadTexts: ringStationControlOrderChanges.setDescription("The number of add and delete events in the\nringStationOrderTable optionally associated with\nthis ringStationControlEntry.") ringStationControlOwner = MibTableColumn((1, 3, 6, 1, 2, 1, 16, 10, 1, 1, 9), OwnerString()).setMaxAccess("readwrite") if mibBuilder.loadTexts: ringStationControlOwner.setDescription("The base_entity that configured this entry and is\ntherefore using the resources assigned to it.") ringStationControlStatus = MibTableColumn((1, 3, 6, 1, 2, 1, 16, 10, 1, 1, 10), EntryStatus()).setMaxAccess("readwrite") if mibBuilder.loadTexts: ringStationControlStatus.setDescription("The status of this ringStationControl entry.\n\nIf this object is not equal to valid(1), all\nassociated entries in the ringStationTable shall\nbe deleted by the agent.") ringStationTable = MibTable((1, 3, 6, 1, 2, 1, 16, 10, 2)) if mibBuilder.loadTexts: ringStationTable.setDescription("A list of ring station entries. An entry will\nexist for each station that is now or has\npreviously been detected as physically present on\nthis ring.") ringStationEntry = MibTableRow((1, 3, 6, 1, 2, 1, 16, 10, 2, 1)).setIndexNames((0, "TOKEN-RING-RMON-MIB", "ringStationIfIndex"), (0, "TOKEN-RING-RMON-MIB", "ringStationMacAddress")) if mibBuilder.loadTexts: ringStationEntry.setDescription("A collection of statistics for a particular\nstation that has been discovered on a ring\nmonitored by this device.") ringStationIfIndex = MibTableColumn((1, 3, 6, 1, 2, 1, 16, 10, 2, 1, 1), Integer32()).setMaxAccess("readonly") if mibBuilder.loadTexts: ringStationIfIndex.setDescription("The value of this object uniquely identifies the\ninterface on this remote network monitoring device\non which this station was detected. The interface\nidentified by a particular value of this object is\nthe same interface as identified by the same value\nof the ifIndex object, defined in MIB-II [3].") ringStationMacAddress = MibTableColumn((1, 3, 6, 1, 2, 1, 16, 10, 2, 1, 2), MacAddress()).setMaxAccess("readonly") if mibBuilder.loadTexts: ringStationMacAddress.setDescription("The physical address of this station.") ringStationLastNAUN = MibTableColumn((1, 3, 6, 1, 2, 1, 16, 10, 2, 1, 3), MacAddress()).setMaxAccess("readonly") if mibBuilder.loadTexts: ringStationLastNAUN.setDescription("The physical address of last known NAUN of this\nstation.") ringStationStationStatus = MibTableColumn((1, 3, 6, 1, 2, 1, 16, 10, 2, 1, 4), Integer().subtype(subtypeSpec=SingleValueConstraint(1,3,2,)).subtype(namedValues=NamedValues(("active", 1), ("inactive", 2), ("forcedRemoval", 3), ))).setMaxAccess("readonly") if mibBuilder.loadTexts: ringStationStationStatus.setDescription("The status of this station on the ring.") ringStationLastEnterTime = MibTableColumn((1, 3, 6, 1, 2, 1, 16, 10, 2, 1, 5), TimeTicks()).setMaxAccess("readonly") if mibBuilder.loadTexts: ringStationLastEnterTime.setDescription("The value of sysUpTime at the time this station\nlast entered the ring. If the time is unknown,\nthis value shall be zero.") ringStationLastExitTime = MibTableColumn((1, 3, 6, 1, 2, 1, 16, 10, 2, 1, 6), TimeTicks()).setMaxAccess("readonly") if mibBuilder.loadTexts: ringStationLastExitTime.setDescription("The value of sysUpTime at the time the probe\ndetected that this station last exited the ring.\nIf the time is unknown, this value shall be zero.") ringStationDuplicateAddresses = MibTableColumn((1, 3, 6, 1, 2, 1, 16, 10, 2, 1, 7), Counter32()).setMaxAccess("readonly") if mibBuilder.loadTexts: ringStationDuplicateAddresses.setDescription("The number of times this station experienced a\nduplicate address error.") ringStationInLineErrors = MibTableColumn((1, 3, 6, 1, 2, 1, 16, 10, 2, 1, 8), Counter32()).setMaxAccess("readonly") if mibBuilder.loadTexts: ringStationInLineErrors.setDescription("The total number of line errors reported by this\nstation in error reporting packets detected by the\nprobe.") ringStationOutLineErrors = MibTableColumn((1, 3, 6, 1, 2, 1, 16, 10, 2, 1, 9), Counter32()).setMaxAccess("readonly") if mibBuilder.loadTexts: ringStationOutLineErrors.setDescription("The total number of line errors reported in error\nreporting packets sent by the nearest active\ndownstream neighbor of this station and detected\nby the probe.") ringStationInternalErrors = MibTableColumn((1, 3, 6, 1, 2, 1, 16, 10, 2, 1, 10), Counter32()).setMaxAccess("readonly") if mibBuilder.loadTexts: ringStationInternalErrors.setDescription("The total number of adapter internal errors\nreported by this station in error reporting\npackets detected by the probe.") ringStationInBurstErrors = MibTableColumn((1, 3, 6, 1, 2, 1, 16, 10, 2, 1, 11), Counter32()).setMaxAccess("readonly") if mibBuilder.loadTexts: ringStationInBurstErrors.setDescription("The total number of burst errors reported by this\nstation in error reporting packets detected by the\nprobe.") ringStationOutBurstErrors = MibTableColumn((1, 3, 6, 1, 2, 1, 16, 10, 2, 1, 12), Counter32()).setMaxAccess("readonly") if mibBuilder.loadTexts: ringStationOutBurstErrors.setDescription("The total number of burst errors reported in\nerror reporting packets sent by the nearest active\ndownstream neighbor of this station and detected\nby the probe.") ringStationACErrors = MibTableColumn((1, 3, 6, 1, 2, 1, 16, 10, 2, 1, 13), Counter32()).setMaxAccess("readonly") if mibBuilder.loadTexts: ringStationACErrors.setDescription("The total number of AC (Address Copied) errors\nreported in error reporting packets sent by the\nnearest active downstream neighbor of this station\nand detected by the probe.") ringStationAbortErrors = MibTableColumn((1, 3, 6, 1, 2, 1, 16, 10, 2, 1, 14), Counter32()).setMaxAccess("readonly") if mibBuilder.loadTexts: ringStationAbortErrors.setDescription("The total number of abort delimiters reported by\nthis station in error reporting packets detected\nby the probe.") ringStationLostFrameErrors = MibTableColumn((1, 3, 6, 1, 2, 1, 16, 10, 2, 1, 15), Counter32()).setMaxAccess("readonly") if mibBuilder.loadTexts: ringStationLostFrameErrors.setDescription("The total number of lost frame errors reported by\nthis station in error reporting packets detected\nby the probe.") ringStationCongestionErrors = MibTableColumn((1, 3, 6, 1, 2, 1, 16, 10, 2, 1, 16), Counter32()).setMaxAccess("readonly") if mibBuilder.loadTexts: ringStationCongestionErrors.setDescription("The total number of receive congestion errors\nreported by this station in error reporting\npackets detected by the probe.") ringStationFrameCopiedErrors = MibTableColumn((1, 3, 6, 1, 2, 1, 16, 10, 2, 1, 17), Counter32()).setMaxAccess("readonly") if mibBuilder.loadTexts: ringStationFrameCopiedErrors.setDescription("The total number of frame copied errors reported\nby this station in error reporting packets\ndetected by the probe.") ringStationFrequencyErrors = MibTableColumn((1, 3, 6, 1, 2, 1, 16, 10, 2, 1, 18), Counter32()).setMaxAccess("readonly") if mibBuilder.loadTexts: ringStationFrequencyErrors.setDescription("The total number of frequency errors reported by\nthis station in error reporting packets detected\nby the probe.") ringStationTokenErrors = MibTableColumn((1, 3, 6, 1, 2, 1, 16, 10, 2, 1, 19), Counter32()).setMaxAccess("readonly") if mibBuilder.loadTexts: ringStationTokenErrors.setDescription("The total number of token errors reported by this\nstation in error reporting frames detected by the\nprobe.") ringStationInBeaconErrors = MibTableColumn((1, 3, 6, 1, 2, 1, 16, 10, 2, 1, 20), Counter32()).setMaxAccess("readonly") if mibBuilder.loadTexts: ringStationInBeaconErrors.setDescription("The total number of beacon frames sent by this\nstation and detected by the probe.") ringStationOutBeaconErrors = MibTableColumn((1, 3, 6, 1, 2, 1, 16, 10, 2, 1, 21), Counter32()).setMaxAccess("readonly") if mibBuilder.loadTexts: ringStationOutBeaconErrors.setDescription("The total number of beacon frames detected by the\nprobe that name this station as the NAUN.") ringStationInsertions = MibTableColumn((1, 3, 6, 1, 2, 1, 16, 10, 2, 1, 22), Counter32()).setMaxAccess("readonly") if mibBuilder.loadTexts: ringStationInsertions.setDescription("The number of times the probe detected this\nstation inserting onto the ring.") ringStationOrderTable = MibTable((1, 3, 6, 1, 2, 1, 16, 10, 3)) if mibBuilder.loadTexts: ringStationOrderTable.setDescription("A list of ring station entries for stations in\nthe ring poll, ordered by their ring-order.") ringStationOrderEntry = MibTableRow((1, 3, 6, 1, 2, 1, 16, 10, 3, 1)).setIndexNames((0, "TOKEN-RING-RMON-MIB", "ringStationOrderIfIndex"), (0, "TOKEN-RING-RMON-MIB", "ringStationOrderOrderIndex")) if mibBuilder.loadTexts: ringStationOrderEntry.setDescription("A collection of statistics for a particular\nstation that is active on a ring monitored by this\ndevice. This table will contain information for\nevery interface that has a\nringStationControlStatus equal to valid.") ringStationOrderIfIndex = MibTableColumn((1, 3, 6, 1, 2, 1, 16, 10, 3, 1, 1), Integer32()).setMaxAccess("readonly") if mibBuilder.loadTexts: ringStationOrderIfIndex.setDescription("The value of this object uniquely identifies the\ninterface on this remote network monitoring device\non which this station was detected. The interface\nidentified by a particular value of this object is\nthe same interface as identified by the same value\nof the ifIndex object, defined in MIB-II [3].") ringStationOrderOrderIndex = MibTableColumn((1, 3, 6, 1, 2, 1, 16, 10, 3, 1, 2), Integer32()).setMaxAccess("readonly") if mibBuilder.loadTexts: ringStationOrderOrderIndex.setDescription("This index denotes the location of this station\nwith respect to other stations on the ring. This\nindex is one more than the number of hops\ndownstream that this station is from the rmon\nprobe. The rmon probe itself gets the value one.") ringStationOrderMacAddress = MibTableColumn((1, 3, 6, 1, 2, 1, 16, 10, 3, 1, 3), MacAddress()).setMaxAccess("readonly") if mibBuilder.loadTexts: ringStationOrderMacAddress.setDescription("The physical address of this station.") ringStationConfigControlTable = MibTable((1, 3, 6, 1, 2, 1, 16, 10, 4)) if mibBuilder.loadTexts: ringStationConfigControlTable.setDescription("A list of ring station configuration control\nentries.") ringStationConfigControlEntry = MibTableRow((1, 3, 6, 1, 2, 1, 16, 10, 4, 1)).setIndexNames((0, "TOKEN-RING-RMON-MIB", "ringStationConfigControlIfIndex"), (0, "TOKEN-RING-RMON-MIB", "ringStationConfigControlMacAddress")) if mibBuilder.loadTexts: ringStationConfigControlEntry.setDescription("This entry controls active management of stations\nby the probe. One entry exists in this table for\neach active station in the ringStationTable.") ringStationConfigControlIfIndex = MibTableColumn((1, 3, 6, 1, 2, 1, 16, 10, 4, 1, 1), Integer32()).setMaxAccess("readonly") if mibBuilder.loadTexts: ringStationConfigControlIfIndex.setDescription("The value of this object uniquely identifies the\ninterface on this remote network monitoring device\non which this station was detected. The interface\nidentified by a particular value of this object is\nthe same interface as identified by the same value\nof the ifIndex object, defined in MIB-II [3].") ringStationConfigControlMacAddress = MibTableColumn((1, 3, 6, 1, 2, 1, 16, 10, 4, 1, 2), MacAddress()).setMaxAccess("readonly") if mibBuilder.loadTexts: ringStationConfigControlMacAddress.setDescription("The physical address of this station.") ringStationConfigControlRemove = MibTableColumn((1, 3, 6, 1, 2, 1, 16, 10, 4, 1, 3), Integer().subtype(subtypeSpec=SingleValueConstraint(2,1,)).subtype(namedValues=NamedValues(("stable", 1), ("removing", 2), ))).setMaxAccess("readwrite") if mibBuilder.loadTexts: ringStationConfigControlRemove.setDescription("Setting this object to `removing(2)' causes a\nRemove Station MAC frame to be sent. The agent\nwill set this object to `stable(1)' after\nprocessing the request.") ringStationConfigControlUpdateStats = MibTableColumn((1, 3, 6, 1, 2, 1, 16, 10, 4, 1, 4), Integer().subtype(subtypeSpec=SingleValueConstraint(1,2,)).subtype(namedValues=NamedValues(("stable", 1), ("updating", 2), ))).setMaxAccess("readwrite") if mibBuilder.loadTexts: ringStationConfigControlUpdateStats.setDescription("Setting this object to `updating(2)' causes the\nconfiguration information associate with this\nentry to be updated. The agent will set this\nobject to `stable(1)' after processing the\nrequest.") ringStationConfigTable = MibTable((1, 3, 6, 1, 2, 1, 16, 10, 5)) if mibBuilder.loadTexts: ringStationConfigTable.setDescription("A list of configuration entries for stations on a\nring monitored by this probe.") ringStationConfigEntry = MibTableRow((1, 3, 6, 1, 2, 1, 16, 10, 5, 1)).setIndexNames((0, "TOKEN-RING-RMON-MIB", "ringStationConfigIfIndex"), (0, "TOKEN-RING-RMON-MIB", "ringStationConfigMacAddress")) if mibBuilder.loadTexts: ringStationConfigEntry.setDescription("A collection of statistics for a particular\nstation that has been discovered on a ring\nmonitored by this probe.") ringStationConfigIfIndex = MibTableColumn((1, 3, 6, 1, 2, 1, 16, 10, 5, 1, 1), Integer32()).setMaxAccess("readonly") if mibBuilder.loadTexts: ringStationConfigIfIndex.setDescription("The value of this object uniquely identifies the\ninterface on this remote network monitoring device\non which this station was detected. The interface\nidentified by a particular value of this object is\nthe same interface as identified by the same value\nof the ifIndex object, defined in MIB-II [3].") ringStationConfigMacAddress = MibTableColumn((1, 3, 6, 1, 2, 1, 16, 10, 5, 1, 2), MacAddress()).setMaxAccess("readonly") if mibBuilder.loadTexts: ringStationConfigMacAddress.setDescription("The physical address of this station.") ringStationConfigUpdateTime = MibTableColumn((1, 3, 6, 1, 2, 1, 16, 10, 5, 1, 3), TimeTicks()).setMaxAccess("readonly") if mibBuilder.loadTexts: ringStationConfigUpdateTime.setDescription("The value of sysUpTime at the time this\nconfiguration information was last updated\n(completely).") ringStationConfigLocation = MibTableColumn((1, 3, 6, 1, 2, 1, 16, 10, 5, 1, 4), OctetString().subtype(subtypeSpec=ValueSizeConstraint(4, 4)).setFixedLength(4)).setMaxAccess("readonly") if mibBuilder.loadTexts: ringStationConfigLocation.setDescription("The assigned physical location of this station.") ringStationConfigMicrocode = MibTableColumn((1, 3, 6, 1, 2, 1, 16, 10, 5, 1, 5), OctetString().subtype(subtypeSpec=ValueSizeConstraint(10, 10)).setFixedLength(10)).setMaxAccess("readonly") if mibBuilder.loadTexts: ringStationConfigMicrocode.setDescription("The microcode EC level of this station.") ringStationConfigGroupAddress = MibTableColumn((1, 3, 6, 1, 2, 1, 16, 10, 5, 1, 6), OctetString().subtype(subtypeSpec=ValueSizeConstraint(4, 4)).setFixedLength(4)).setMaxAccess("readonly") if mibBuilder.loadTexts: ringStationConfigGroupAddress.setDescription("The low-order 4 octets of the group address\nrecognized by this station.") ringStationConfigFunctionalAddress = MibTableColumn((1, 3, 6, 1, 2, 1, 16, 10, 5, 1, 7), OctetString().subtype(subtypeSpec=ValueSizeConstraint(4, 4)).setFixedLength(4)).setMaxAccess("readonly") if mibBuilder.loadTexts: ringStationConfigFunctionalAddress.setDescription("the functional addresses recognized by this\nstation.") sourceRoutingStatsTable = MibTable((1, 3, 6, 1, 2, 1, 16, 10, 6)) if mibBuilder.loadTexts: sourceRoutingStatsTable.setDescription("A list of source routing statistics entries.") sourceRoutingStatsEntry = MibTableRow((1, 3, 6, 1, 2, 1, 16, 10, 6, 1)).setIndexNames((0, "TOKEN-RING-RMON-MIB", "sourceRoutingStatsIfIndex")) if mibBuilder.loadTexts: sourceRoutingStatsEntry.setDescription("A collection of source routing statistics kept\nfor a particular Token Ring interface.") sourceRoutingStatsIfIndex = MibTableColumn((1, 3, 6, 1, 2, 1, 16, 10, 6, 1, 1), Integer32()).setMaxAccess("readonly") if mibBuilder.loadTexts: sourceRoutingStatsIfIndex.setDescription("The value of this object uniquely identifies the\ninterface on this remote network monitoring device\non which source routing statistics will be\ndetected. The interface identified by a\nparticular value of this object is the same\ninterface as identified by the same value of the\nifIndex object, defined in MIB-II [3].") sourceRoutingStatsRingNumber = MibTableColumn((1, 3, 6, 1, 2, 1, 16, 10, 6, 1, 2), Integer32()).setMaxAccess("readonly") if mibBuilder.loadTexts: sourceRoutingStatsRingNumber.setDescription("The ring number of the ring monitored by this\nentry. When any object in this entry is created,\nthe probe will attempt to discover the ring\nnumber. Only after the ring number is discovered\nwill this object be created. After creating an\nobject in this entry, the management station\nshould poll this object to detect when it is\ncreated. Only after this object is created can\nthe management station set the\nsourceRoutingStatsStatus entry to valid(1).") sourceRoutingStatsInFrames = MibTableColumn((1, 3, 6, 1, 2, 1, 16, 10, 6, 1, 3), Counter32()).setMaxAccess("readonly") if mibBuilder.loadTexts: sourceRoutingStatsInFrames.setDescription("The count of frames sent into this ring from\nanother ring.") sourceRoutingStatsOutFrames = MibTableColumn((1, 3, 6, 1, 2, 1, 16, 10, 6, 1, 4), Counter32()).setMaxAccess("readonly") if mibBuilder.loadTexts: sourceRoutingStatsOutFrames.setDescription("The count of frames sent from this ring to\nanother ring.") sourceRoutingStatsThroughFrames = MibTableColumn((1, 3, 6, 1, 2, 1, 16, 10, 6, 1, 5), Counter32()).setMaxAccess("readonly") if mibBuilder.loadTexts: sourceRoutingStatsThroughFrames.setDescription("The count of frames sent from another ring,\nthrough this ring, to another ring.") sourceRoutingStatsAllRoutesBroadcastFrames = MibTableColumn((1, 3, 6, 1, 2, 1, 16, 10, 6, 1, 6), Counter32()).setMaxAccess("readonly") if mibBuilder.loadTexts: sourceRoutingStatsAllRoutesBroadcastFrames.setDescription("The total number of good frames received that\nwere All Routes Broadcast.") sourceRoutingStatsSingleRouteBroadcastFrames = MibTableColumn((1, 3, 6, 1, 2, 1, 16, 10, 6, 1, 7), Counter32()).setMaxAccess("readonly") if mibBuilder.loadTexts: sourceRoutingStatsSingleRouteBroadcastFrames.setDescription("The total number of good frames received that\nwere Single Route Broadcast.") sourceRoutingStatsInOctets = MibTableColumn((1, 3, 6, 1, 2, 1, 16, 10, 6, 1, 8), Counter32()).setMaxAccess("readonly") if mibBuilder.loadTexts: sourceRoutingStatsInOctets.setDescription("The count of octets in good frames sent into this\nring from another ring.") sourceRoutingStatsOutOctets = MibTableColumn((1, 3, 6, 1, 2, 1, 16, 10, 6, 1, 9), Counter32()).setMaxAccess("readonly") if mibBuilder.loadTexts: sourceRoutingStatsOutOctets.setDescription("The count of octets in good frames sent from this\nring to another ring.") sourceRoutingStatsThroughOctets = MibTableColumn((1, 3, 6, 1, 2, 1, 16, 10, 6, 1, 10), Counter32()).setMaxAccess("readonly") if mibBuilder.loadTexts: sourceRoutingStatsThroughOctets.setDescription("The count of octets in good frames sent another\nring, through this ring, to another ring.") sourceRoutingStatsAllRoutesBroadcastOctets = MibTableColumn((1, 3, 6, 1, 2, 1, 16, 10, 6, 1, 11), Counter32()).setMaxAccess("readonly") if mibBuilder.loadTexts: sourceRoutingStatsAllRoutesBroadcastOctets.setDescription("The total number of octets in good frames\nreceived that were All Routes Broadcast.") sourceRoutingStatsSingleRoutesBroadcastOctets = MibTableColumn((1, 3, 6, 1, 2, 1, 16, 10, 6, 1, 12), Counter32()).setMaxAccess("readonly") if mibBuilder.loadTexts: sourceRoutingStatsSingleRoutesBroadcastOctets.setDescription("The total number of octets in good frames\nreceived that were Single Route Broadcast.") sourceRoutingStatsLocalLLCFrames = MibTableColumn((1, 3, 6, 1, 2, 1, 16, 10, 6, 1, 13), Counter32()).setMaxAccess("readonly") if mibBuilder.loadTexts: sourceRoutingStatsLocalLLCFrames.setDescription("The total number of frames received who had no\nRIF field (or had a RIF field that only included\nthe local ring's number) and were not All Route\nBroadcast Frames.") sourceRoutingStats1HopFrames = MibTableColumn((1, 3, 6, 1, 2, 1, 16, 10, 6, 1, 14), Counter32()).setMaxAccess("readonly") if mibBuilder.loadTexts: sourceRoutingStats1HopFrames.setDescription("The total number of frames received whose route\nhad 1 hop, were not All Route Broadcast Frames,\nand whose source or destination were on this ring\n(i.e. frames that had a RIF field and had this\nring number in the first or last entry of the RIF\nfield).") sourceRoutingStats2HopsFrames = MibTableColumn((1, 3, 6, 1, 2, 1, 16, 10, 6, 1, 15), Counter32()).setMaxAccess("readonly") if mibBuilder.loadTexts: sourceRoutingStats2HopsFrames.setDescription("The total number of frames received whose route\nhad 2 hops, were not All Route Broadcast Frames,\nand whose source or destination were on this ring\n(i.e. frames that had a RIF field and had this\nring number in the first or last entry of the RIF\nfield).") sourceRoutingStats3HopsFrames = MibTableColumn((1, 3, 6, 1, 2, 1, 16, 10, 6, 1, 16), Counter32()).setMaxAccess("readonly") if mibBuilder.loadTexts: sourceRoutingStats3HopsFrames.setDescription("The total number of frames received whose route\nhad 3 hops, were not All Route Broadcast Frames,\nand whose source or destination were on this ring\n(i.e. frames that had a RIF field and had this\nring number in the first or last entry of the RIF\nfield).") sourceRoutingStats4HopsFrames = MibTableColumn((1, 3, 6, 1, 2, 1, 16, 10, 6, 1, 17), Counter32()).setMaxAccess("readonly") if mibBuilder.loadTexts: sourceRoutingStats4HopsFrames.setDescription("The total number of frames received whose route\nhad 4 hops, were not All Route Broadcast Frames,\nand whose source or destination were on this ring\n(i.e. frames that had a RIF field and had this\nring number in the first or last entry of the RIF\nfield).") sourceRoutingStats5HopsFrames = MibTableColumn((1, 3, 6, 1, 2, 1, 16, 10, 6, 1, 18), Counter32()).setMaxAccess("readonly") if mibBuilder.loadTexts: sourceRoutingStats5HopsFrames.setDescription("The total number of frames received whose route\nhad 5 hops, were not All Route Broadcast Frames,\nand whose source or destination were on this ring\n(i.e. frames that had a RIF field and had this\nring number in the first or last entry of the RIF\nfield).") sourceRoutingStats6HopsFrames = MibTableColumn((1, 3, 6, 1, 2, 1, 16, 10, 6, 1, 19), Counter32()).setMaxAccess("readonly") if mibBuilder.loadTexts: sourceRoutingStats6HopsFrames.setDescription("The total number of frames received whose route\nhad 6 hops, were not All Route Broadcast Frames,\nand whose source or destination were on this ring\n(i.e. frames that had a RIF field and had this\nring number in the first or last entry of the RIF\nfield).") sourceRoutingStats7HopsFrames = MibTableColumn((1, 3, 6, 1, 2, 1, 16, 10, 6, 1, 20), Counter32()).setMaxAccess("readonly") if mibBuilder.loadTexts: sourceRoutingStats7HopsFrames.setDescription("The total number of frames received whose route\nhad 7 hops, were not All Route Broadcast Frames,\nand whose source or destination were on this ring\n(i.e. frames that had a RIF field and had this\nring number in the first or last entry of the RIF\nfield).") sourceRoutingStats8HopsFrames = MibTableColumn((1, 3, 6, 1, 2, 1, 16, 10, 6, 1, 21), Counter32()).setMaxAccess("readonly") if mibBuilder.loadTexts: sourceRoutingStats8HopsFrames.setDescription("The total number of frames received whose route\nhad 8 hops, were not All Route Broadcast Frames,\nand whose source or destination were on this ring\n(i.e. frames that had a RIF field and had this\nring number in the first or last entry of the RIF\nfield).") sourceRoutingStatsMoreThan8HopsFrames = MibTableColumn((1, 3, 6, 1, 2, 1, 16, 10, 6, 1, 22), Counter32()).setMaxAccess("readonly") if mibBuilder.loadTexts: sourceRoutingStatsMoreThan8HopsFrames.setDescription("The total number of frames received whose route\nhad more than 8 hops, were not All Route Broadcast\nFrames, and whose source or destination were on\nthis ring (i.e. frames that had a RIF field and\nhad this ring number in the first or last entry of\nthe RIF field).") sourceRoutingStatsOwner = MibTableColumn((1, 3, 6, 1, 2, 1, 16, 10, 6, 1, 23), OwnerString()).setMaxAccess("readwrite") if mibBuilder.loadTexts: sourceRoutingStatsOwner.setDescription("The base_entity that configured this entry and is\ntherefore using the resources assigned to it.") sourceRoutingStatsStatus = MibTableColumn((1, 3, 6, 1, 2, 1, 16, 10, 6, 1, 24), EntryStatus()).setMaxAccess("readwrite") if mibBuilder.loadTexts: sourceRoutingStatsStatus.setDescription("The status of this sourceRoutingStats entry.") # Augmentions # Exports # Types mibBuilder.exportSymbols("TOKEN-RING-RMON-MIB", MacAddress=MacAddress, TimeInterval=TimeInterval) # Objects mibBuilder.exportSymbols("TOKEN-RING-RMON-MIB", tokenRingMLStatsTable=tokenRingMLStatsTable, tokenRingMLStatsEntry=tokenRingMLStatsEntry, tokenRingMLStatsIndex=tokenRingMLStatsIndex, tokenRingMLStatsDataSource=tokenRingMLStatsDataSource, tokenRingMLStatsDropEvents=tokenRingMLStatsDropEvents, tokenRingMLStatsMacOctets=tokenRingMLStatsMacOctets, tokenRingMLStatsMacPkts=tokenRingMLStatsMacPkts, tokenRingMLStatsRingPurgeEvents=tokenRingMLStatsRingPurgeEvents, tokenRingMLStatsRingPurgePkts=tokenRingMLStatsRingPurgePkts, tokenRingMLStatsBeaconEvents=tokenRingMLStatsBeaconEvents, tokenRingMLStatsBeaconTime=tokenRingMLStatsBeaconTime, tokenRingMLStatsBeaconPkts=tokenRingMLStatsBeaconPkts, tokenRingMLStatsClaimTokenEvents=tokenRingMLStatsClaimTokenEvents, tokenRingMLStatsClaimTokenPkts=tokenRingMLStatsClaimTokenPkts, tokenRingMLStatsNAUNChanges=tokenRingMLStatsNAUNChanges, tokenRingMLStatsLineErrors=tokenRingMLStatsLineErrors, tokenRingMLStatsInternalErrors=tokenRingMLStatsInternalErrors, tokenRingMLStatsBurstErrors=tokenRingMLStatsBurstErrors, tokenRingMLStatsACErrors=tokenRingMLStatsACErrors, tokenRingMLStatsAbortErrors=tokenRingMLStatsAbortErrors, tokenRingMLStatsLostFrameErrors=tokenRingMLStatsLostFrameErrors, tokenRingMLStatsCongestionErrors=tokenRingMLStatsCongestionErrors, tokenRingMLStatsFrameCopiedErrors=tokenRingMLStatsFrameCopiedErrors, tokenRingMLStatsFrequencyErrors=tokenRingMLStatsFrequencyErrors, tokenRingMLStatsTokenErrors=tokenRingMLStatsTokenErrors, tokenRingMLStatsSoftErrorReports=tokenRingMLStatsSoftErrorReports, tokenRingMLStatsRingPollEvents=tokenRingMLStatsRingPollEvents, tokenRingMLStatsOwner=tokenRingMLStatsOwner, tokenRingMLStatsStatus=tokenRingMLStatsStatus, tokenRingPStatsTable=tokenRingPStatsTable, tokenRingPStatsEntry=tokenRingPStatsEntry, tokenRingPStatsIndex=tokenRingPStatsIndex, tokenRingPStatsDataSource=tokenRingPStatsDataSource, tokenRingPStatsDropEvents=tokenRingPStatsDropEvents, tokenRingPStatsDataOctets=tokenRingPStatsDataOctets, tokenRingPStatsDataPkts=tokenRingPStatsDataPkts, tokenRingPStatsDataBroadcastPkts=tokenRingPStatsDataBroadcastPkts, tokenRingPStatsDataMulticastPkts=tokenRingPStatsDataMulticastPkts, tokenRingPStatsDataPkts18to63Octets=tokenRingPStatsDataPkts18to63Octets, tokenRingPStatsDataPkts64to127Octets=tokenRingPStatsDataPkts64to127Octets, tokenRingPStatsDataPkts128to255Octets=tokenRingPStatsDataPkts128to255Octets, tokenRingPStatsDataPkts256to511Octets=tokenRingPStatsDataPkts256to511Octets, tokenRingPStatsDataPkts512to1023Octets=tokenRingPStatsDataPkts512to1023Octets, tokenRingPStatsDataPkts1024to2047Octets=tokenRingPStatsDataPkts1024to2047Octets, tokenRingPStatsDataPkts2048to4095Octets=tokenRingPStatsDataPkts2048to4095Octets, tokenRingPStatsDataPkts4096to8191Octets=tokenRingPStatsDataPkts4096to8191Octets, tokenRingPStatsDataPkts8192to18000Octets=tokenRingPStatsDataPkts8192to18000Octets, tokenRingPStatsDataPktsGreaterThan18000Octets=tokenRingPStatsDataPktsGreaterThan18000Octets, tokenRingPStatsOwner=tokenRingPStatsOwner, tokenRingPStatsStatus=tokenRingPStatsStatus, tokenRingMLHistoryTable=tokenRingMLHistoryTable, tokenRingMLHistoryEntry=tokenRingMLHistoryEntry, tokenRingMLHistoryIndex=tokenRingMLHistoryIndex, tokenRingMLHistorySampleIndex=tokenRingMLHistorySampleIndex, tokenRingMLHistoryIntervalStart=tokenRingMLHistoryIntervalStart, tokenRingMLHistoryDropEvents=tokenRingMLHistoryDropEvents, tokenRingMLHistoryMacOctets=tokenRingMLHistoryMacOctets, tokenRingMLHistoryMacPkts=tokenRingMLHistoryMacPkts, tokenRingMLHistoryRingPurgeEvents=tokenRingMLHistoryRingPurgeEvents, tokenRingMLHistoryRingPurgePkts=tokenRingMLHistoryRingPurgePkts, tokenRingMLHistoryBeaconEvents=tokenRingMLHistoryBeaconEvents, tokenRingMLHistoryBeaconTime=tokenRingMLHistoryBeaconTime, tokenRingMLHistoryBeaconPkts=tokenRingMLHistoryBeaconPkts, tokenRingMLHistoryClaimTokenEvents=tokenRingMLHistoryClaimTokenEvents, tokenRingMLHistoryClaimTokenPkts=tokenRingMLHistoryClaimTokenPkts, tokenRingMLHistoryNAUNChanges=tokenRingMLHistoryNAUNChanges, tokenRingMLHistoryLineErrors=tokenRingMLHistoryLineErrors, tokenRingMLHistoryInternalErrors=tokenRingMLHistoryInternalErrors, tokenRingMLHistoryBurstErrors=tokenRingMLHistoryBurstErrors, tokenRingMLHistoryACErrors=tokenRingMLHistoryACErrors, tokenRingMLHistoryAbortErrors=tokenRingMLHistoryAbortErrors, tokenRingMLHistoryLostFrameErrors=tokenRingMLHistoryLostFrameErrors, tokenRingMLHistoryCongestionErrors=tokenRingMLHistoryCongestionErrors, tokenRingMLHistoryFrameCopiedErrors=tokenRingMLHistoryFrameCopiedErrors, tokenRingMLHistoryFrequencyErrors=tokenRingMLHistoryFrequencyErrors, tokenRingMLHistoryTokenErrors=tokenRingMLHistoryTokenErrors, tokenRingMLHistorySoftErrorReports=tokenRingMLHistorySoftErrorReports, tokenRingMLHistoryRingPollEvents=tokenRingMLHistoryRingPollEvents, tokenRingMLHistoryActiveStations=tokenRingMLHistoryActiveStations, tokenRingPHistoryTable=tokenRingPHistoryTable, tokenRingPHistoryEntry=tokenRingPHistoryEntry, tokenRingPHistoryIndex=tokenRingPHistoryIndex, tokenRingPHistorySampleIndex=tokenRingPHistorySampleIndex, tokenRingPHistoryIntervalStart=tokenRingPHistoryIntervalStart, tokenRingPHistoryDropEvents=tokenRingPHistoryDropEvents, tokenRingPHistoryDataOctets=tokenRingPHistoryDataOctets, tokenRingPHistoryDataPkts=tokenRingPHistoryDataPkts, tokenRingPHistoryDataBroadcastPkts=tokenRingPHistoryDataBroadcastPkts, tokenRingPHistoryDataMulticastPkts=tokenRingPHistoryDataMulticastPkts, tokenRingPHistoryDataPkts18to63Octets=tokenRingPHistoryDataPkts18to63Octets, tokenRingPHistoryDataPkts64to127Octets=tokenRingPHistoryDataPkts64to127Octets, tokenRingPHistoryDataPkts128to255Octets=tokenRingPHistoryDataPkts128to255Octets, tokenRingPHistoryDataPkts256to511Octets=tokenRingPHistoryDataPkts256to511Octets, tokenRingPHistoryDataPkts512to1023Octets=tokenRingPHistoryDataPkts512to1023Octets, tokenRingPHistoryDataPkts1024to2047Octets=tokenRingPHistoryDataPkts1024to2047Octets, tokenRingPHistoryDataPkts2048to4095Octets=tokenRingPHistoryDataPkts2048to4095Octets, tokenRingPHistoryDataPkts4096to8191Octets=tokenRingPHistoryDataPkts4096to8191Octets, tokenRingPHistoryDataPkts8192to18000Octets=tokenRingPHistoryDataPkts8192to18000Octets, tokenRingPHistoryDataPktsGreaterThan18000Octets=tokenRingPHistoryDataPktsGreaterThan18000Octets, tokenRing=tokenRing, ringStationControlTable=ringStationControlTable, ringStationControlEntry=ringStationControlEntry, ringStationControlIfIndex=ringStationControlIfIndex, ringStationControlTableSize=ringStationControlTableSize, ringStationControlActiveStations=ringStationControlActiveStations, ringStationControlRingState=ringStationControlRingState, ringStationControlBeaconSender=ringStationControlBeaconSender, ringStationControlBeaconNAUN=ringStationControlBeaconNAUN, ringStationControlActiveMonitor=ringStationControlActiveMonitor, ringStationControlOrderChanges=ringStationControlOrderChanges, ringStationControlOwner=ringStationControlOwner, ringStationControlStatus=ringStationControlStatus, ringStationTable=ringStationTable, ringStationEntry=ringStationEntry, ringStationIfIndex=ringStationIfIndex, ringStationMacAddress=ringStationMacAddress, ringStationLastNAUN=ringStationLastNAUN, ringStationStationStatus=ringStationStationStatus, ringStationLastEnterTime=ringStationLastEnterTime, ringStationLastExitTime=ringStationLastExitTime, ringStationDuplicateAddresses=ringStationDuplicateAddresses, ringStationInLineErrors=ringStationInLineErrors, ringStationOutLineErrors=ringStationOutLineErrors, ringStationInternalErrors=ringStationInternalErrors, ringStationInBurstErrors=ringStationInBurstErrors, ringStationOutBurstErrors=ringStationOutBurstErrors) mibBuilder.exportSymbols("TOKEN-RING-RMON-MIB", ringStationACErrors=ringStationACErrors, ringStationAbortErrors=ringStationAbortErrors, ringStationLostFrameErrors=ringStationLostFrameErrors, ringStationCongestionErrors=ringStationCongestionErrors, ringStationFrameCopiedErrors=ringStationFrameCopiedErrors, ringStationFrequencyErrors=ringStationFrequencyErrors, ringStationTokenErrors=ringStationTokenErrors, ringStationInBeaconErrors=ringStationInBeaconErrors, ringStationOutBeaconErrors=ringStationOutBeaconErrors, ringStationInsertions=ringStationInsertions, ringStationOrderTable=ringStationOrderTable, ringStationOrderEntry=ringStationOrderEntry, ringStationOrderIfIndex=ringStationOrderIfIndex, ringStationOrderOrderIndex=ringStationOrderOrderIndex, ringStationOrderMacAddress=ringStationOrderMacAddress, ringStationConfigControlTable=ringStationConfigControlTable, ringStationConfigControlEntry=ringStationConfigControlEntry, ringStationConfigControlIfIndex=ringStationConfigControlIfIndex, ringStationConfigControlMacAddress=ringStationConfigControlMacAddress, ringStationConfigControlRemove=ringStationConfigControlRemove, ringStationConfigControlUpdateStats=ringStationConfigControlUpdateStats, ringStationConfigTable=ringStationConfigTable, ringStationConfigEntry=ringStationConfigEntry, ringStationConfigIfIndex=ringStationConfigIfIndex, ringStationConfigMacAddress=ringStationConfigMacAddress, ringStationConfigUpdateTime=ringStationConfigUpdateTime, ringStationConfigLocation=ringStationConfigLocation, ringStationConfigMicrocode=ringStationConfigMicrocode, ringStationConfigGroupAddress=ringStationConfigGroupAddress, ringStationConfigFunctionalAddress=ringStationConfigFunctionalAddress, sourceRoutingStatsTable=sourceRoutingStatsTable, sourceRoutingStatsEntry=sourceRoutingStatsEntry, sourceRoutingStatsIfIndex=sourceRoutingStatsIfIndex, sourceRoutingStatsRingNumber=sourceRoutingStatsRingNumber, sourceRoutingStatsInFrames=sourceRoutingStatsInFrames, sourceRoutingStatsOutFrames=sourceRoutingStatsOutFrames, sourceRoutingStatsThroughFrames=sourceRoutingStatsThroughFrames, sourceRoutingStatsAllRoutesBroadcastFrames=sourceRoutingStatsAllRoutesBroadcastFrames, sourceRoutingStatsSingleRouteBroadcastFrames=sourceRoutingStatsSingleRouteBroadcastFrames, sourceRoutingStatsInOctets=sourceRoutingStatsInOctets, sourceRoutingStatsOutOctets=sourceRoutingStatsOutOctets, sourceRoutingStatsThroughOctets=sourceRoutingStatsThroughOctets, sourceRoutingStatsAllRoutesBroadcastOctets=sourceRoutingStatsAllRoutesBroadcastOctets, sourceRoutingStatsSingleRoutesBroadcastOctets=sourceRoutingStatsSingleRoutesBroadcastOctets, sourceRoutingStatsLocalLLCFrames=sourceRoutingStatsLocalLLCFrames, sourceRoutingStats1HopFrames=sourceRoutingStats1HopFrames, sourceRoutingStats2HopsFrames=sourceRoutingStats2HopsFrames, sourceRoutingStats3HopsFrames=sourceRoutingStats3HopsFrames, sourceRoutingStats4HopsFrames=sourceRoutingStats4HopsFrames, sourceRoutingStats5HopsFrames=sourceRoutingStats5HopsFrames, sourceRoutingStats6HopsFrames=sourceRoutingStats6HopsFrames, sourceRoutingStats7HopsFrames=sourceRoutingStats7HopsFrames, sourceRoutingStats8HopsFrames=sourceRoutingStats8HopsFrames, sourceRoutingStatsMoreThan8HopsFrames=sourceRoutingStatsMoreThan8HopsFrames, sourceRoutingStatsOwner=sourceRoutingStatsOwner, sourceRoutingStatsStatus=sourceRoutingStatsStatus)
(integer, object_identifier, octet_string) = mibBuilder.importSymbols('ASN1', 'Integer', 'ObjectIdentifier', 'OctetString') (named_values,) = mibBuilder.importSymbols('ASN1-ENUMERATION', 'NamedValues') (constraints_intersection, constraints_union, single_value_constraint, value_range_constraint, value_size_constraint) = mibBuilder.importSymbols('ASN1-REFINEMENT', 'ConstraintsIntersection', 'ConstraintsUnion', 'SingleValueConstraint', 'ValueRangeConstraint', 'ValueSizeConstraint') (entry_status, owner_string, history, rmon, statistics) = mibBuilder.importSymbols('RFC1271-MIB', 'EntryStatus', 'OwnerString', 'history', 'rmon', 'statistics') (bits, counter32, integer32, integer32, mib_identifier, mib_scalar, mib_table, mib_table_row, mib_table_column, time_ticks, time_ticks) = mibBuilder.importSymbols('SNMPv2-SMI', 'Bits', 'Counter32', 'Integer32', 'Integer32', 'MibIdentifier', 'MibScalar', 'MibTable', 'MibTableRow', 'MibTableColumn', 'TimeTicks', 'TimeTicks') class Macaddress(OctetString): subtype_spec = OctetString.subtypeSpec + value_size_constraint(6, 6) fixed_length = 6 class Timeinterval(Integer32): pass token_ring_ml_stats_table = mib_table((1, 3, 6, 1, 2, 1, 16, 1, 2)) if mibBuilder.loadTexts: tokenRingMLStatsTable.setDescription('A list of Mac-Layer Token Ring statistics\nentries.') token_ring_ml_stats_entry = mib_table_row((1, 3, 6, 1, 2, 1, 16, 1, 2, 1)).setIndexNames((0, 'TOKEN-RING-RMON-MIB', 'tokenRingMLStatsIndex')) if mibBuilder.loadTexts: tokenRingMLStatsEntry.setDescription('A collection of Mac-Layer statistics kept for a\nparticular Token Ring interface.') token_ring_ml_stats_index = mib_table_column((1, 3, 6, 1, 2, 1, 16, 1, 2, 1, 1), integer32().subtype(subtypeSpec=value_range_constraint(1, 65535))).setMaxAccess('readonly') if mibBuilder.loadTexts: tokenRingMLStatsIndex.setDescription('The value of this object uniquely identifies this\ntokenRingMLStats entry.') token_ring_ml_stats_data_source = mib_table_column((1, 3, 6, 1, 2, 1, 16, 1, 2, 1, 2), object_identifier()).setMaxAccess('readwrite') if mibBuilder.loadTexts: tokenRingMLStatsDataSource.setDescription('This object identifies the source of the data\nthat this tokenRingMLStats entry is configured to\nanalyze. This source can be any tokenRing\ninterface on this device. In order to identify a\nparticular interface, this object shall identify\nthe instance of the ifIndex object, defined in\nMIB-II [3], for the desired interface. For\nexample, if an entry were to receive data from\ninterface #1, this object would be set to\nifIndex.1.\n\nThe statistics in this group reflect all error\nreports on the local network segment attached to\nthe identified interface.\n\nThis object may not be modified if the associated\ntokenRingMLStatsStatus object is equal to\nvalid(1).') token_ring_ml_stats_drop_events = mib_table_column((1, 3, 6, 1, 2, 1, 16, 1, 2, 1, 3), counter32()).setMaxAccess('readonly') if mibBuilder.loadTexts: tokenRingMLStatsDropEvents.setDescription('The total number of events in which packets were\ndropped by the probe due to lack of resources.\nNote that this number is not necessarily the\nnumber of packets dropped; it is just the number\nof times this condition has been detected. This\nvalue is the same as the corresponding\ntokenRingPStatsDropEvents.') token_ring_ml_stats_mac_octets = mib_table_column((1, 3, 6, 1, 2, 1, 16, 1, 2, 1, 4), counter32()).setMaxAccess('readonly') if mibBuilder.loadTexts: tokenRingMLStatsMacOctets.setDescription('The total number of octets of data in MAC packets\n(excluding those that were not good frames)\nreceived on the network (excluding framing bits\nbut including FCS octets).') token_ring_ml_stats_mac_pkts = mib_table_column((1, 3, 6, 1, 2, 1, 16, 1, 2, 1, 5), counter32()).setMaxAccess('readonly') if mibBuilder.loadTexts: tokenRingMLStatsMacPkts.setDescription('The total number of MAC packets (excluding\npackets that were not good frames) received.') token_ring_ml_stats_ring_purge_events = mib_table_column((1, 3, 6, 1, 2, 1, 16, 1, 2, 1, 6), counter32()).setMaxAccess('readonly') if mibBuilder.loadTexts: tokenRingMLStatsRingPurgeEvents.setDescription('The total number of times that the ring enters\nthe ring purge state from normal ring state. The\nring purge state that comes in response to the\nclaim token or beacon state is not counted.') token_ring_ml_stats_ring_purge_pkts = mib_table_column((1, 3, 6, 1, 2, 1, 16, 1, 2, 1, 7), counter32()).setMaxAccess('readonly') if mibBuilder.loadTexts: tokenRingMLStatsRingPurgePkts.setDescription('The total number of ring purge MAC packets\ndetected by probe.') token_ring_ml_stats_beacon_events = mib_table_column((1, 3, 6, 1, 2, 1, 16, 1, 2, 1, 8), counter32()).setMaxAccess('readonly') if mibBuilder.loadTexts: tokenRingMLStatsBeaconEvents.setDescription('The total number of times that the ring enters a\nbeaconing state (beaconFrameStreamingState,\nbeaconBitStreamingState,\nbeaconSetRecoveryModeState, or\nbeaconRingSignalLossState) from a non-beaconing\nstate. Note that a change of the source address\nof the beacon packet does not constitute a new\nbeacon event.') token_ring_ml_stats_beacon_time = mib_table_column((1, 3, 6, 1, 2, 1, 16, 1, 2, 1, 9), time_interval()).setMaxAccess('readonly') if mibBuilder.loadTexts: tokenRingMLStatsBeaconTime.setDescription('The total amount of time that the ring has been\nin the beaconing state.') token_ring_ml_stats_beacon_pkts = mib_table_column((1, 3, 6, 1, 2, 1, 16, 1, 2, 1, 10), counter32()).setMaxAccess('readonly') if mibBuilder.loadTexts: tokenRingMLStatsBeaconPkts.setDescription('The total number of beacon MAC packets detected\nby the probe.') token_ring_ml_stats_claim_token_events = mib_table_column((1, 3, 6, 1, 2, 1, 16, 1, 2, 1, 11), counter32()).setMaxAccess('readonly') if mibBuilder.loadTexts: tokenRingMLStatsClaimTokenEvents.setDescription('The total number of times that the ring enters\nthe claim token state from normal ring state or\nring purge state. The claim token state that\ncomes in response to a beacon state is not\ncounted.') token_ring_ml_stats_claim_token_pkts = mib_table_column((1, 3, 6, 1, 2, 1, 16, 1, 2, 1, 12), counter32()).setMaxAccess('readonly') if mibBuilder.loadTexts: tokenRingMLStatsClaimTokenPkts.setDescription('The total number of claim token MAC packets\ndetected by the probe.') token_ring_ml_stats_naun_changes = mib_table_column((1, 3, 6, 1, 2, 1, 16, 1, 2, 1, 13), counter32()).setMaxAccess('readonly') if mibBuilder.loadTexts: tokenRingMLStatsNAUNChanges.setDescription('The total number of NAUN changes detected by the\nprobe.') token_ring_ml_stats_line_errors = mib_table_column((1, 3, 6, 1, 2, 1, 16, 1, 2, 1, 14), counter32()).setMaxAccess('readonly') if mibBuilder.loadTexts: tokenRingMLStatsLineErrors.setDescription('The total number of line errors reported in error\nreporting packets detected by the probe.') token_ring_ml_stats_internal_errors = mib_table_column((1, 3, 6, 1, 2, 1, 16, 1, 2, 1, 15), counter32()).setMaxAccess('readonly') if mibBuilder.loadTexts: tokenRingMLStatsInternalErrors.setDescription('The total number of adapter internal errors\nreported in error reporting packets detected by\nthe probe.') token_ring_ml_stats_burst_errors = mib_table_column((1, 3, 6, 1, 2, 1, 16, 1, 2, 1, 16), counter32()).setMaxAccess('readonly') if mibBuilder.loadTexts: tokenRingMLStatsBurstErrors.setDescription('The total number of burst errors reported in\nerror reporting packets detected by the probe.') token_ring_ml_stats_ac_errors = mib_table_column((1, 3, 6, 1, 2, 1, 16, 1, 2, 1, 17), counter32()).setMaxAccess('readonly') if mibBuilder.loadTexts: tokenRingMLStatsACErrors.setDescription('The total number of AC (Address Copied) errors\nreported in error reporting packets detected by\nthe probe.') token_ring_ml_stats_abort_errors = mib_table_column((1, 3, 6, 1, 2, 1, 16, 1, 2, 1, 18), counter32()).setMaxAccess('readonly') if mibBuilder.loadTexts: tokenRingMLStatsAbortErrors.setDescription('The total number of abort delimiters reported in\nerror reporting packets detected by the probe.') token_ring_ml_stats_lost_frame_errors = mib_table_column((1, 3, 6, 1, 2, 1, 16, 1, 2, 1, 19), counter32()).setMaxAccess('readonly') if mibBuilder.loadTexts: tokenRingMLStatsLostFrameErrors.setDescription('The total number of lost frame errors reported in\nerror reporting packets detected by the probe.') token_ring_ml_stats_congestion_errors = mib_table_column((1, 3, 6, 1, 2, 1, 16, 1, 2, 1, 20), counter32()).setMaxAccess('readonly') if mibBuilder.loadTexts: tokenRingMLStatsCongestionErrors.setDescription('The total number of receive congestion errors\nreported in error reporting packets detected by\nthe probe.') token_ring_ml_stats_frame_copied_errors = mib_table_column((1, 3, 6, 1, 2, 1, 16, 1, 2, 1, 21), counter32()).setMaxAccess('readonly') if mibBuilder.loadTexts: tokenRingMLStatsFrameCopiedErrors.setDescription('The total number of frame copied errors reported\nin error reporting packets detected by the probe.') token_ring_ml_stats_frequency_errors = mib_table_column((1, 3, 6, 1, 2, 1, 16, 1, 2, 1, 22), counter32()).setMaxAccess('readonly') if mibBuilder.loadTexts: tokenRingMLStatsFrequencyErrors.setDescription('The total number of frequency errors reported in\nerror reporting packets detected by the probe.') token_ring_ml_stats_token_errors = mib_table_column((1, 3, 6, 1, 2, 1, 16, 1, 2, 1, 23), counter32()).setMaxAccess('readonly') if mibBuilder.loadTexts: tokenRingMLStatsTokenErrors.setDescription('The total number of token errors reported in\nerror reporting packets detected by the probe.') token_ring_ml_stats_soft_error_reports = mib_table_column((1, 3, 6, 1, 2, 1, 16, 1, 2, 1, 24), counter32()).setMaxAccess('readonly') if mibBuilder.loadTexts: tokenRingMLStatsSoftErrorReports.setDescription('The total number of soft error report frames\ndetected by the probe.') token_ring_ml_stats_ring_poll_events = mib_table_column((1, 3, 6, 1, 2, 1, 16, 1, 2, 1, 25), counter32()).setMaxAccess('readonly') if mibBuilder.loadTexts: tokenRingMLStatsRingPollEvents.setDescription('The total number of ring poll events detected by\nthe probe (i.e. the number of ring polls initiated\nby the active monitor that were detected).') token_ring_ml_stats_owner = mib_table_column((1, 3, 6, 1, 2, 1, 16, 1, 2, 1, 26), owner_string()).setMaxAccess('readwrite') if mibBuilder.loadTexts: tokenRingMLStatsOwner.setDescription('The base_entity that configured this entry and is\ntherefore using the resources assigned to it.') token_ring_ml_stats_status = mib_table_column((1, 3, 6, 1, 2, 1, 16, 1, 2, 1, 27), entry_status()).setMaxAccess('readwrite') if mibBuilder.loadTexts: tokenRingMLStatsStatus.setDescription('The status of this tokenRingMLStats entry.') token_ring_p_stats_table = mib_table((1, 3, 6, 1, 2, 1, 16, 1, 3)) if mibBuilder.loadTexts: tokenRingPStatsTable.setDescription('A list of promiscuous Token Ring statistics\nentries.') token_ring_p_stats_entry = mib_table_row((1, 3, 6, 1, 2, 1, 16, 1, 3, 1)).setIndexNames((0, 'TOKEN-RING-RMON-MIB', 'tokenRingPStatsIndex')) if mibBuilder.loadTexts: tokenRingPStatsEntry.setDescription('A collection of promiscuous statistics kept for\nnon-MAC packets on a particular Token Ring\ninterface.') token_ring_p_stats_index = mib_table_column((1, 3, 6, 1, 2, 1, 16, 1, 3, 1, 1), integer32().subtype(subtypeSpec=value_range_constraint(1, 65535))).setMaxAccess('readonly') if mibBuilder.loadTexts: tokenRingPStatsIndex.setDescription('The value of this object uniquely identifies this\ntokenRingPStats entry.') token_ring_p_stats_data_source = mib_table_column((1, 3, 6, 1, 2, 1, 16, 1, 3, 1, 2), object_identifier()).setMaxAccess('readwrite') if mibBuilder.loadTexts: tokenRingPStatsDataSource.setDescription('This object identifies the source of the data\nthat this tokenRingPStats entry is configured to\nanalyze. This source can be any tokenRing\ninterface on this device. In order to identify a\nparticular interface, this object shall identify\nthe instance of the ifIndex object, defined in\nMIB-II [3], for the desired interface. For\nexample, if an entry were to receive data from\ninterface #1, this object would be set to\nifIndex.1.\n\nThe statistics in this group reflect all non-MAC\npackets on the local network segment attached to\nthe identified interface.\n\nThis object may not be modified if the associated\ntokenRingPStatsStatus object is equal to\nvalid(1).') token_ring_p_stats_drop_events = mib_table_column((1, 3, 6, 1, 2, 1, 16, 1, 3, 1, 3), counter32()).setMaxAccess('readonly') if mibBuilder.loadTexts: tokenRingPStatsDropEvents.setDescription('The total number of events in which packets were\ndropped by the probe due to lack of resources.\nNote that this number is not necessarily the\nnumber of packets dropped; it is just the number\nof times this condition has been detected. This\nvalue is the same as the corresponding\ntokenRingMLStatsDropEvents') token_ring_p_stats_data_octets = mib_table_column((1, 3, 6, 1, 2, 1, 16, 1, 3, 1, 4), counter32()).setMaxAccess('readonly') if mibBuilder.loadTexts: tokenRingPStatsDataOctets.setDescription('The total number of octets of data in good frames\nreceived on the network (excluding framing bits\nbut including FCS octets) in non-MAC packets.') token_ring_p_stats_data_pkts = mib_table_column((1, 3, 6, 1, 2, 1, 16, 1, 3, 1, 5), counter32()).setMaxAccess('readonly') if mibBuilder.loadTexts: tokenRingPStatsDataPkts.setDescription('The total number of non-MAC packets in good\nframes. received.') token_ring_p_stats_data_broadcast_pkts = mib_table_column((1, 3, 6, 1, 2, 1, 16, 1, 3, 1, 6), counter32()).setMaxAccess('readonly') if mibBuilder.loadTexts: tokenRingPStatsDataBroadcastPkts.setDescription('The total number of good non-MAC frames received\nthat were directed to an LLC broadcast address\n(0xFFFFFFFFFFFF or 0xC000FFFFFFFF).') token_ring_p_stats_data_multicast_pkts = mib_table_column((1, 3, 6, 1, 2, 1, 16, 1, 3, 1, 7), counter32()).setMaxAccess('readonly') if mibBuilder.loadTexts: tokenRingPStatsDataMulticastPkts.setDescription('The total number of good non-MAC frames received\nthat were directed to a local or global multicast\nor functional address. Note that this number does\nnot include packets directed to the broadcast\naddress.') token_ring_p_stats_data_pkts18to63_octets = mib_table_column((1, 3, 6, 1, 2, 1, 16, 1, 3, 1, 8), counter32()).setMaxAccess('readonly') if mibBuilder.loadTexts: tokenRingPStatsDataPkts18to63Octets.setDescription('The total number of good non-MAC frames received\nthat were between 18 and 63 octets in length\ninclusive, excluding framing bits but including\nFCS octets.') token_ring_p_stats_data_pkts64to127_octets = mib_table_column((1, 3, 6, 1, 2, 1, 16, 1, 3, 1, 9), counter32()).setMaxAccess('readonly') if mibBuilder.loadTexts: tokenRingPStatsDataPkts64to127Octets.setDescription('The total number of good non-MAC frames received\nthat were between 64 and 127 octets in length\ninclusive, excluding framing bits but including\nFCS octets.') token_ring_p_stats_data_pkts128to255_octets = mib_table_column((1, 3, 6, 1, 2, 1, 16, 1, 3, 1, 10), counter32()).setMaxAccess('readonly') if mibBuilder.loadTexts: tokenRingPStatsDataPkts128to255Octets.setDescription('The total number of good non-MAC frames received\nthat were between 128 and 255 octets in length\ninclusive, excluding framing bits but including\nFCS octets.') token_ring_p_stats_data_pkts256to511_octets = mib_table_column((1, 3, 6, 1, 2, 1, 16, 1, 3, 1, 11), counter32()).setMaxAccess('readonly') if mibBuilder.loadTexts: tokenRingPStatsDataPkts256to511Octets.setDescription('The total number of good non-MAC frames received\nthat were between 256 and 511 octets in length\ninclusive, excluding framing bits but including\nFCS octets.') token_ring_p_stats_data_pkts512to1023_octets = mib_table_column((1, 3, 6, 1, 2, 1, 16, 1, 3, 1, 12), counter32()).setMaxAccess('readonly') if mibBuilder.loadTexts: tokenRingPStatsDataPkts512to1023Octets.setDescription('The total number of good non-MAC frames received\nthat were between 512 and 1023 octets in length\ninclusive, excluding framing bits but including\nFCS octets.') token_ring_p_stats_data_pkts1024to2047_octets = mib_table_column((1, 3, 6, 1, 2, 1, 16, 1, 3, 1, 13), counter32()).setMaxAccess('readonly') if mibBuilder.loadTexts: tokenRingPStatsDataPkts1024to2047Octets.setDescription('The total number of good non-MAC frames received\nthat were between 1024 and 2047 octets in length\ninclusive, excluding framing bits but including\nFCS octets.') token_ring_p_stats_data_pkts2048to4095_octets = mib_table_column((1, 3, 6, 1, 2, 1, 16, 1, 3, 1, 14), counter32()).setMaxAccess('readonly') if mibBuilder.loadTexts: tokenRingPStatsDataPkts2048to4095Octets.setDescription('The total number of good non-MAC frames received\nthat were between 2048 and 4095 octets in length\ninclusive, excluding framing bits but including\nFCS octets.') token_ring_p_stats_data_pkts4096to8191_octets = mib_table_column((1, 3, 6, 1, 2, 1, 16, 1, 3, 1, 15), counter32()).setMaxAccess('readonly') if mibBuilder.loadTexts: tokenRingPStatsDataPkts4096to8191Octets.setDescription('The total number of good non-MAC frames received\nthat were between 4096 and 8191 octets in length\ninclusive, excluding framing bits but including\nFCS octets.') token_ring_p_stats_data_pkts8192to18000_octets = mib_table_column((1, 3, 6, 1, 2, 1, 16, 1, 3, 1, 16), counter32()).setMaxAccess('readonly') if mibBuilder.loadTexts: tokenRingPStatsDataPkts8192to18000Octets.setDescription('The total number of good non-MAC frames received\nthat were between 8192 and 18000 octets in length\ninclusive, excluding framing bits but including\nFCS octets.') token_ring_p_stats_data_pkts_greater_than18000_octets = mib_table_column((1, 3, 6, 1, 2, 1, 16, 1, 3, 1, 17), counter32()).setMaxAccess('readonly') if mibBuilder.loadTexts: tokenRingPStatsDataPktsGreaterThan18000Octets.setDescription('The total number of good non-MAC frames received\nthat were greater than 18000 octets in length,\nexcluding framing bits but including FCS octets.') token_ring_p_stats_owner = mib_table_column((1, 3, 6, 1, 2, 1, 16, 1, 3, 1, 18), owner_string()).setMaxAccess('readwrite') if mibBuilder.loadTexts: tokenRingPStatsOwner.setDescription('The base_entity that configured this entry and is\ntherefore using the resources assigned to it.') token_ring_p_stats_status = mib_table_column((1, 3, 6, 1, 2, 1, 16, 1, 3, 1, 19), entry_status()).setMaxAccess('readwrite') if mibBuilder.loadTexts: tokenRingPStatsStatus.setDescription('The status of this tokenRingPStats entry.') token_ring_ml_history_table = mib_table((1, 3, 6, 1, 2, 1, 16, 2, 3)) if mibBuilder.loadTexts: tokenRingMLHistoryTable.setDescription('A list of Mac-Layer Token Ring statistics\nentries.') token_ring_ml_history_entry = mib_table_row((1, 3, 6, 1, 2, 1, 16, 2, 3, 1)).setIndexNames((0, 'TOKEN-RING-RMON-MIB', 'tokenRingMLHistoryIndex'), (0, 'TOKEN-RING-RMON-MIB', 'tokenRingMLHistorySampleIndex')) if mibBuilder.loadTexts: tokenRingMLHistoryEntry.setDescription('A collection of Mac-Layer statistics kept for a\nparticular Token Ring interface.') token_ring_ml_history_index = mib_table_column((1, 3, 6, 1, 2, 1, 16, 2, 3, 1, 1), integer32().subtype(subtypeSpec=value_range_constraint(1, 65535))).setMaxAccess('readonly') if mibBuilder.loadTexts: tokenRingMLHistoryIndex.setDescription('The history of which this entry is a part. The\nhistory identified by a particular value of this\nindex is the same history as identified by the\nsame value of historyControlIndex.') token_ring_ml_history_sample_index = mib_table_column((1, 3, 6, 1, 2, 1, 16, 2, 3, 1, 2), integer32()).setMaxAccess('readonly') if mibBuilder.loadTexts: tokenRingMLHistorySampleIndex.setDescription('An index that uniquely identifies the particular\nMac-Layer sample this entry represents among all\nMac-Layer samples associated with the same\nhistoryControlEntry. This index starts at 1 and\nincreases by one as each new sample is taken.') token_ring_ml_history_interval_start = mib_table_column((1, 3, 6, 1, 2, 1, 16, 2, 3, 1, 3), time_ticks()).setMaxAccess('readonly') if mibBuilder.loadTexts: tokenRingMLHistoryIntervalStart.setDescription('The value of sysUpTime at the start of the\ninterval over which this sample was measured. If\nthe probe keeps track of the time of day, it\nshould start the first sample of the history at a\ntime such that when the next hour of the day\nbegins, a sample is started at that instant. Note\nthat following this rule may require the probe to\ndelay collecting the first sample of the history,\nas each sample must be of the same interval. Also\nnote that the sample which is currently being\ncollected is not accessible in this table until\nthe end of its interval.') token_ring_ml_history_drop_events = mib_table_column((1, 3, 6, 1, 2, 1, 16, 2, 3, 1, 4), counter32()).setMaxAccess('readonly') if mibBuilder.loadTexts: tokenRingMLHistoryDropEvents.setDescription('The total number of events in which packets were\ndropped by the probe due to lack of resources\nduring this sampling interval. Note that this\nnumber is not necessarily the number of packets\ndropped, it is just the number of times this\ncondition has been detected.') token_ring_ml_history_mac_octets = mib_table_column((1, 3, 6, 1, 2, 1, 16, 2, 3, 1, 5), counter32()).setMaxAccess('readonly') if mibBuilder.loadTexts: tokenRingMLHistoryMacOctets.setDescription('The total number of octets of data in MAC packets\n(excluding those that were not good frames)\nreceived on the network during this sampling\ninterval (excluding framing bits but including FCS\noctets).') token_ring_ml_history_mac_pkts = mib_table_column((1, 3, 6, 1, 2, 1, 16, 2, 3, 1, 6), counter32()).setMaxAccess('readonly') if mibBuilder.loadTexts: tokenRingMLHistoryMacPkts.setDescription('The total number of MAC packets (excluding those\nthat were not good frames) received during this\nsampling interval.') token_ring_ml_history_ring_purge_events = mib_table_column((1, 3, 6, 1, 2, 1, 16, 2, 3, 1, 7), counter32()).setMaxAccess('readonly') if mibBuilder.loadTexts: tokenRingMLHistoryRingPurgeEvents.setDescription('The total number of times that the ring entered\nthe ring purge state from normal ring state during\nthis sampling interval. The ring purge state that\ncomes from the claim token or beacon state is not\ncounted.') token_ring_ml_history_ring_purge_pkts = mib_table_column((1, 3, 6, 1, 2, 1, 16, 2, 3, 1, 8), counter32()).setMaxAccess('readonly') if mibBuilder.loadTexts: tokenRingMLHistoryRingPurgePkts.setDescription('The total number of Ring Purge MAC packets\ndetected by the probe during this sampling\ninterval.') token_ring_ml_history_beacon_events = mib_table_column((1, 3, 6, 1, 2, 1, 16, 2, 3, 1, 9), counter32()).setMaxAccess('readonly') if mibBuilder.loadTexts: tokenRingMLHistoryBeaconEvents.setDescription('The total number of times that the ring enters a\nbeaconing state (beaconFrameStreamingState,\nbeaconBitStreamingState,\nbeaconSetRecoveryModeState, or\nbeaconRingSignalLossState) during this sampling\ninterval. Note that a change of the source\naddress of the beacon packet does not constitute a\nnew beacon event.') token_ring_ml_history_beacon_time = mib_table_column((1, 3, 6, 1, 2, 1, 16, 2, 3, 1, 10), time_interval()).setMaxAccess('readonly') if mibBuilder.loadTexts: tokenRingMLHistoryBeaconTime.setDescription('The amount of time that the ring has been in the\nbeaconing state during this sampling interval.') token_ring_ml_history_beacon_pkts = mib_table_column((1, 3, 6, 1, 2, 1, 16, 2, 3, 1, 11), counter32()).setMaxAccess('readonly') if mibBuilder.loadTexts: tokenRingMLHistoryBeaconPkts.setDescription('The total number of beacon MAC packets detected\nby the probe during this sampling interval.') token_ring_ml_history_claim_token_events = mib_table_column((1, 3, 6, 1, 2, 1, 16, 2, 3, 1, 12), counter32()).setMaxAccess('readonly') if mibBuilder.loadTexts: tokenRingMLHistoryClaimTokenEvents.setDescription('The total number of times that the ring enters\nthe claim token state from normal ring state or\nring purge state during this sampling interval.\nThe claim token state that comes from the beacon\nstate is not counted.') token_ring_ml_history_claim_token_pkts = mib_table_column((1, 3, 6, 1, 2, 1, 16, 2, 3, 1, 13), counter32()).setMaxAccess('readonly') if mibBuilder.loadTexts: tokenRingMLHistoryClaimTokenPkts.setDescription('The total number of claim token MAC packets\ndetected by the probe during this sampling\ninterval.') token_ring_ml_history_naun_changes = mib_table_column((1, 3, 6, 1, 2, 1, 16, 2, 3, 1, 14), counter32()).setMaxAccess('readonly') if mibBuilder.loadTexts: tokenRingMLHistoryNAUNChanges.setDescription('The total number of NAUN changes detected by the\nprobe during this sampling interval.') token_ring_ml_history_line_errors = mib_table_column((1, 3, 6, 1, 2, 1, 16, 2, 3, 1, 15), counter32()).setMaxAccess('readonly') if mibBuilder.loadTexts: tokenRingMLHistoryLineErrors.setDescription('The total number of line errors reported in error\nreporting packets detected by the probe during\nthis sampling interval.') token_ring_ml_history_internal_errors = mib_table_column((1, 3, 6, 1, 2, 1, 16, 2, 3, 1, 16), counter32()).setMaxAccess('readonly') if mibBuilder.loadTexts: tokenRingMLHistoryInternalErrors.setDescription('The total number of adapter internal errors\nreported in error reporting packets detected by\nthe probe during this sampling interval.') token_ring_ml_history_burst_errors = mib_table_column((1, 3, 6, 1, 2, 1, 16, 2, 3, 1, 17), counter32()).setMaxAccess('readonly') if mibBuilder.loadTexts: tokenRingMLHistoryBurstErrors.setDescription('The total number of burst errors reported in\nerror reporting packets detected by the probe\nduring this sampling interval.') token_ring_ml_history_ac_errors = mib_table_column((1, 3, 6, 1, 2, 1, 16, 2, 3, 1, 18), counter32()).setMaxAccess('readonly') if mibBuilder.loadTexts: tokenRingMLHistoryACErrors.setDescription('The total number of AC (Address Copied) errors\nreported in error reporting packets detected by\nthe probe during this sampling interval.') token_ring_ml_history_abort_errors = mib_table_column((1, 3, 6, 1, 2, 1, 16, 2, 3, 1, 19), counter32()).setMaxAccess('readonly') if mibBuilder.loadTexts: tokenRingMLHistoryAbortErrors.setDescription('The total number of abort delimiters reported in\nerror reporting packets detected by the probe\nduring this sampling interval.') token_ring_ml_history_lost_frame_errors = mib_table_column((1, 3, 6, 1, 2, 1, 16, 2, 3, 1, 20), counter32()).setMaxAccess('readonly') if mibBuilder.loadTexts: tokenRingMLHistoryLostFrameErrors.setDescription('The total number of lost frame errors reported in\nerror reporting packets detected by the probe\nduring this sampling interval.') token_ring_ml_history_congestion_errors = mib_table_column((1, 3, 6, 1, 2, 1, 16, 2, 3, 1, 21), counter32()).setMaxAccess('readonly') if mibBuilder.loadTexts: tokenRingMLHistoryCongestionErrors.setDescription('The total number of receive congestion errors\nreported in error reporting packets detected by\nthe probe during this sampling interval.') token_ring_ml_history_frame_copied_errors = mib_table_column((1, 3, 6, 1, 2, 1, 16, 2, 3, 1, 22), counter32()).setMaxAccess('readonly') if mibBuilder.loadTexts: tokenRingMLHistoryFrameCopiedErrors.setDescription('The total number of frame copied errors reported\nin error reporting packets detected by the probe\nduring this sampling interval.') token_ring_ml_history_frequency_errors = mib_table_column((1, 3, 6, 1, 2, 1, 16, 2, 3, 1, 23), counter32()).setMaxAccess('readonly') if mibBuilder.loadTexts: tokenRingMLHistoryFrequencyErrors.setDescription('The total number of frequency errors reported in\nerror reporting packets detected by the probe\nduring this sampling interval.') token_ring_ml_history_token_errors = mib_table_column((1, 3, 6, 1, 2, 1, 16, 2, 3, 1, 24), counter32()).setMaxAccess('readonly') if mibBuilder.loadTexts: tokenRingMLHistoryTokenErrors.setDescription('The total number of token errors reported in\nerror reporting packets detected by the probe\nduring this sampling interval.') token_ring_ml_history_soft_error_reports = mib_table_column((1, 3, 6, 1, 2, 1, 16, 2, 3, 1, 25), counter32()).setMaxAccess('readonly') if mibBuilder.loadTexts: tokenRingMLHistorySoftErrorReports.setDescription('The total number of soft error report frames\ndetected by the probe during this sampling\ninterval.') token_ring_ml_history_ring_poll_events = mib_table_column((1, 3, 6, 1, 2, 1, 16, 2, 3, 1, 26), counter32()).setMaxAccess('readonly') if mibBuilder.loadTexts: tokenRingMLHistoryRingPollEvents.setDescription('The total number of ring poll events detected by\nthe probe during this sampling interval.') token_ring_ml_history_active_stations = mib_table_column((1, 3, 6, 1, 2, 1, 16, 2, 3, 1, 27), integer32()).setMaxAccess('readonly') if mibBuilder.loadTexts: tokenRingMLHistoryActiveStations.setDescription('The maximum number of active stations on the ring\ndetected by the probe during this sampling\ninterval.') token_ring_p_history_table = mib_table((1, 3, 6, 1, 2, 1, 16, 2, 4)) if mibBuilder.loadTexts: tokenRingPHistoryTable.setDescription('A list of promiscuous Token Ring statistics\nentries.') token_ring_p_history_entry = mib_table_row((1, 3, 6, 1, 2, 1, 16, 2, 4, 1)).setIndexNames((0, 'TOKEN-RING-RMON-MIB', 'tokenRingPHistoryIndex'), (0, 'TOKEN-RING-RMON-MIB', 'tokenRingPHistorySampleIndex')) if mibBuilder.loadTexts: tokenRingPHistoryEntry.setDescription('A collection of promiscuous statistics kept for a\nparticular Token Ring interface.') token_ring_p_history_index = mib_table_column((1, 3, 6, 1, 2, 1, 16, 2, 4, 1, 1), integer32().subtype(subtypeSpec=value_range_constraint(1, 65535))).setMaxAccess('readonly') if mibBuilder.loadTexts: tokenRingPHistoryIndex.setDescription('The history of which this entry is a part. The\nhistory identified by a particular value of this\nindex is the same history as identified by the\nsame value of historyControlIndex.') token_ring_p_history_sample_index = mib_table_column((1, 3, 6, 1, 2, 1, 16, 2, 4, 1, 2), integer32()).setMaxAccess('readonly') if mibBuilder.loadTexts: tokenRingPHistorySampleIndex.setDescription('An index that uniquely identifies the particular\nsample this entry represents among all samples\nassociated with the same historyControlEntry.\nThis index starts at 1 and increases by one as\neach new sample is taken.') token_ring_p_history_interval_start = mib_table_column((1, 3, 6, 1, 2, 1, 16, 2, 4, 1, 3), time_ticks()).setMaxAccess('readonly') if mibBuilder.loadTexts: tokenRingPHistoryIntervalStart.setDescription('The value of sysUpTime at the start of the\ninterval over which this sample was measured. If\nthe probe keeps track of the time of day, it\nshould start the first sample of the history at a\ntime such that when the next hour of the day\nbegins, a sample is started at that instant. Note\nthat following this rule may require the probe to\ndelay collecting the first sample of the history,\nas each sample must be of the same interval. Also\nnote that the sample which is currently being\ncollected is not accessible in this table until\nthe end of its interval.') token_ring_p_history_drop_events = mib_table_column((1, 3, 6, 1, 2, 1, 16, 2, 4, 1, 4), counter32()).setMaxAccess('readonly') if mibBuilder.loadTexts: tokenRingPHistoryDropEvents.setDescription('The total number of events in which packets were\ndropped by the probe due to lack of resources\nduring this sampling interval. Note that this\nnumber is not necessarily the number of packets\ndropped, it is just the number of times this\ncondition has been detected.') token_ring_p_history_data_octets = mib_table_column((1, 3, 6, 1, 2, 1, 16, 2, 4, 1, 5), counter32()).setMaxAccess('readonly') if mibBuilder.loadTexts: tokenRingPHistoryDataOctets.setDescription('The total number of octets of data in good frames\nreceived on the network (excluding framing bits\nbut including FCS octets) in non-MAC packets\nduring this sampling interval.') token_ring_p_history_data_pkts = mib_table_column((1, 3, 6, 1, 2, 1, 16, 2, 4, 1, 6), counter32()).setMaxAccess('readonly') if mibBuilder.loadTexts: tokenRingPHistoryDataPkts.setDescription('The total number of good non-MAC frames received\nduring this sampling interval.') token_ring_p_history_data_broadcast_pkts = mib_table_column((1, 3, 6, 1, 2, 1, 16, 2, 4, 1, 7), counter32()).setMaxAccess('readonly') if mibBuilder.loadTexts: tokenRingPHistoryDataBroadcastPkts.setDescription('The total number of good non-MAC frames received\nduring this sampling interval that were directed\nto an LLC broadcast address (0xFFFFFFFFFFFF or\n0xC000FFFFFFFF).') token_ring_p_history_data_multicast_pkts = mib_table_column((1, 3, 6, 1, 2, 1, 16, 2, 4, 1, 8), counter32()).setMaxAccess('readonly') if mibBuilder.loadTexts: tokenRingPHistoryDataMulticastPkts.setDescription('The total number of good non-MAC frames received\nduring this sampling interval that were directed\nto a local or global multicast or functional\naddress. Note that this number does not include\npackets directed to the broadcast address.') token_ring_p_history_data_pkts18to63_octets = mib_table_column((1, 3, 6, 1, 2, 1, 16, 2, 4, 1, 9), counter32()).setMaxAccess('readonly') if mibBuilder.loadTexts: tokenRingPHistoryDataPkts18to63Octets.setDescription('The total number of good non-MAC frames received\nduring this sampling interval that were between 18\nand 63 octets in length inclusive, excluding\nframing bits but including FCS octets.') token_ring_p_history_data_pkts64to127_octets = mib_table_column((1, 3, 6, 1, 2, 1, 16, 2, 4, 1, 10), counter32()).setMaxAccess('readonly') if mibBuilder.loadTexts: tokenRingPHistoryDataPkts64to127Octets.setDescription('The total number of good non-MAC frames received\nduring this sampling interval that were between 64\nand 127 octets in length inclusive, excluding\nframing bits but including FCS octets.') token_ring_p_history_data_pkts128to255_octets = mib_table_column((1, 3, 6, 1, 2, 1, 16, 2, 4, 1, 11), counter32()).setMaxAccess('readonly') if mibBuilder.loadTexts: tokenRingPHistoryDataPkts128to255Octets.setDescription('The total number of good non-MAC frames received\nduring this sampling interval that were between\n128 and 255 octets in length inclusive, excluding\nframing bits but including FCS octets.') token_ring_p_history_data_pkts256to511_octets = mib_table_column((1, 3, 6, 1, 2, 1, 16, 2, 4, 1, 12), counter32()).setMaxAccess('readonly') if mibBuilder.loadTexts: tokenRingPHistoryDataPkts256to511Octets.setDescription('The total number of good non-MAC frames received\nduring this sampling interval that were between\n256 and 511 octets in length inclusive, excluding\nframing bits but including FCS octets.') token_ring_p_history_data_pkts512to1023_octets = mib_table_column((1, 3, 6, 1, 2, 1, 16, 2, 4, 1, 13), counter32()).setMaxAccess('readonly') if mibBuilder.loadTexts: tokenRingPHistoryDataPkts512to1023Octets.setDescription('The total number of good non-MAC frames received\nduring this sampling interval that were between\n512 and 1023 octets in length inclusive, excluding\nframing bits but including FCS octets.') token_ring_p_history_data_pkts1024to2047_octets = mib_table_column((1, 3, 6, 1, 2, 1, 16, 2, 4, 1, 14), counter32()).setMaxAccess('readonly') if mibBuilder.loadTexts: tokenRingPHistoryDataPkts1024to2047Octets.setDescription('The total number of good non-MAC frames received\nduring this sampling interval that were between\n1024 and 2047 octets in length inclusive,\nexcluding framing bits but including FCS octets.') token_ring_p_history_data_pkts2048to4095_octets = mib_table_column((1, 3, 6, 1, 2, 1, 16, 2, 4, 1, 15), counter32()).setMaxAccess('readonly') if mibBuilder.loadTexts: tokenRingPHistoryDataPkts2048to4095Octets.setDescription('The total number of good non-MAC frames received\nduring this sampling interval that were between\n2048 and 4095 octets in length inclusive,\nexcluding framing bits but including FCS octets.') token_ring_p_history_data_pkts4096to8191_octets = mib_table_column((1, 3, 6, 1, 2, 1, 16, 2, 4, 1, 16), counter32()).setMaxAccess('readonly') if mibBuilder.loadTexts: tokenRingPHistoryDataPkts4096to8191Octets.setDescription('The total number of good non-MAC frames received\nduring this sampling interval that were between\n4096 and 8191 octets in length inclusive,\nexcluding framing bits but including FCS octets.') token_ring_p_history_data_pkts8192to18000_octets = mib_table_column((1, 3, 6, 1, 2, 1, 16, 2, 4, 1, 17), counter32()).setMaxAccess('readonly') if mibBuilder.loadTexts: tokenRingPHistoryDataPkts8192to18000Octets.setDescription('The total number of good non-MAC frames received\nduring this sampling interval that were between\n8192 and 18000 octets in length inclusive,\nexcluding framing bits but including FCS octets.') token_ring_p_history_data_pkts_greater_than18000_octets = mib_table_column((1, 3, 6, 1, 2, 1, 16, 2, 4, 1, 18), counter32()).setMaxAccess('readonly') if mibBuilder.loadTexts: tokenRingPHistoryDataPktsGreaterThan18000Octets.setDescription('The total number of good non-MAC frames received\nduring this sampling interval that were greater\nthan 18000 octets in length, excluding framing\nbits but including FCS octets.') token_ring = mib_identifier((1, 3, 6, 1, 2, 1, 16, 10)) ring_station_control_table = mib_table((1, 3, 6, 1, 2, 1, 16, 10, 1)) if mibBuilder.loadTexts: ringStationControlTable.setDescription('A list of ringStation table control entries.') ring_station_control_entry = mib_table_row((1, 3, 6, 1, 2, 1, 16, 10, 1, 1)).setIndexNames((0, 'TOKEN-RING-RMON-MIB', 'ringStationControlIfIndex')) if mibBuilder.loadTexts: ringStationControlEntry.setDescription('A list of parameters that set up the discovery of\nstations on a particular interface and the\ncollection of statistics about these stations.') ring_station_control_if_index = mib_table_column((1, 3, 6, 1, 2, 1, 16, 10, 1, 1, 1), integer32().subtype(subtypeSpec=value_range_constraint(1, 65535))).setMaxAccess('readonly') if mibBuilder.loadTexts: ringStationControlIfIndex.setDescription('The value of this object uniquely identifies the\ninterface on this remote network monitoring device\nfrom which ringStation data is collected. The\ninterface identified by a particular value of this\nobject is the same interface as identified by the\nsame value of the ifIndex object, defined in MIB-\nII [3].') ring_station_control_table_size = mib_table_column((1, 3, 6, 1, 2, 1, 16, 10, 1, 1, 2), integer32()).setMaxAccess('readonly') if mibBuilder.loadTexts: ringStationControlTableSize.setDescription('The number of ringStationEntries in the\nringStationTable associated with this\nringStationControlEntry.') ring_station_control_active_stations = mib_table_column((1, 3, 6, 1, 2, 1, 16, 10, 1, 1, 3), integer32()).setMaxAccess('readonly') if mibBuilder.loadTexts: ringStationControlActiveStations.setDescription('The number of active ringStationEntries in the\nringStationTable associated with this\nringStationControlEntry.') ring_station_control_ring_state = mib_table_column((1, 3, 6, 1, 2, 1, 16, 10, 1, 1, 4), integer().subtype(subtypeSpec=single_value_constraint(3, 5, 2, 7, 4, 6, 1)).subtype(namedValues=named_values(('normalOperation', 1), ('ringPurgeState', 2), ('claimTokenState', 3), ('beaconFrameStreamingState', 4), ('beaconBitStreamingState', 5), ('beaconRingSignalLossState', 6), ('beaconSetRecoveryModeState', 7)))).setMaxAccess('readonly') if mibBuilder.loadTexts: ringStationControlRingState.setDescription('The current status of this ring.') ring_station_control_beacon_sender = mib_table_column((1, 3, 6, 1, 2, 1, 16, 10, 1, 1, 5), mac_address()).setMaxAccess('readonly') if mibBuilder.loadTexts: ringStationControlBeaconSender.setDescription('The address of the sender of the last beacon\nframe received by the probe on this ring. If no\nbeacon frames have been received, this object\nshall be equal to six octets of zero.') ring_station_control_beacon_naun = mib_table_column((1, 3, 6, 1, 2, 1, 16, 10, 1, 1, 6), mac_address()).setMaxAccess('readonly') if mibBuilder.loadTexts: ringStationControlBeaconNAUN.setDescription('The address of the NAUN in the last beacon frame\nreceived by the probe on this ring. If no beacon\nframes have been received, this object shall be\nequal to six octets of zero.') ring_station_control_active_monitor = mib_table_column((1, 3, 6, 1, 2, 1, 16, 10, 1, 1, 7), mac_address()).setMaxAccess('readonly') if mibBuilder.loadTexts: ringStationControlActiveMonitor.setDescription('The address of the Active Monitor on this\nsegment. If this address is unknown, this object\nshall be equal to six octets of zero.') ring_station_control_order_changes = mib_table_column((1, 3, 6, 1, 2, 1, 16, 10, 1, 1, 8), counter32()).setMaxAccess('readonly') if mibBuilder.loadTexts: ringStationControlOrderChanges.setDescription('The number of add and delete events in the\nringStationOrderTable optionally associated with\nthis ringStationControlEntry.') ring_station_control_owner = mib_table_column((1, 3, 6, 1, 2, 1, 16, 10, 1, 1, 9), owner_string()).setMaxAccess('readwrite') if mibBuilder.loadTexts: ringStationControlOwner.setDescription('The base_entity that configured this entry and is\ntherefore using the resources assigned to it.') ring_station_control_status = mib_table_column((1, 3, 6, 1, 2, 1, 16, 10, 1, 1, 10), entry_status()).setMaxAccess('readwrite') if mibBuilder.loadTexts: ringStationControlStatus.setDescription('The status of this ringStationControl entry.\n\nIf this object is not equal to valid(1), all\nassociated entries in the ringStationTable shall\nbe deleted by the agent.') ring_station_table = mib_table((1, 3, 6, 1, 2, 1, 16, 10, 2)) if mibBuilder.loadTexts: ringStationTable.setDescription('A list of ring station entries. An entry will\nexist for each station that is now or has\npreviously been detected as physically present on\nthis ring.') ring_station_entry = mib_table_row((1, 3, 6, 1, 2, 1, 16, 10, 2, 1)).setIndexNames((0, 'TOKEN-RING-RMON-MIB', 'ringStationIfIndex'), (0, 'TOKEN-RING-RMON-MIB', 'ringStationMacAddress')) if mibBuilder.loadTexts: ringStationEntry.setDescription('A collection of statistics for a particular\nstation that has been discovered on a ring\nmonitored by this device.') ring_station_if_index = mib_table_column((1, 3, 6, 1, 2, 1, 16, 10, 2, 1, 1), integer32()).setMaxAccess('readonly') if mibBuilder.loadTexts: ringStationIfIndex.setDescription('The value of this object uniquely identifies the\ninterface on this remote network monitoring device\non which this station was detected. The interface\nidentified by a particular value of this object is\nthe same interface as identified by the same value\nof the ifIndex object, defined in MIB-II [3].') ring_station_mac_address = mib_table_column((1, 3, 6, 1, 2, 1, 16, 10, 2, 1, 2), mac_address()).setMaxAccess('readonly') if mibBuilder.loadTexts: ringStationMacAddress.setDescription('The physical address of this station.') ring_station_last_naun = mib_table_column((1, 3, 6, 1, 2, 1, 16, 10, 2, 1, 3), mac_address()).setMaxAccess('readonly') if mibBuilder.loadTexts: ringStationLastNAUN.setDescription('The physical address of last known NAUN of this\nstation.') ring_station_station_status = mib_table_column((1, 3, 6, 1, 2, 1, 16, 10, 2, 1, 4), integer().subtype(subtypeSpec=single_value_constraint(1, 3, 2)).subtype(namedValues=named_values(('active', 1), ('inactive', 2), ('forcedRemoval', 3)))).setMaxAccess('readonly') if mibBuilder.loadTexts: ringStationStationStatus.setDescription('The status of this station on the ring.') ring_station_last_enter_time = mib_table_column((1, 3, 6, 1, 2, 1, 16, 10, 2, 1, 5), time_ticks()).setMaxAccess('readonly') if mibBuilder.loadTexts: ringStationLastEnterTime.setDescription('The value of sysUpTime at the time this station\nlast entered the ring. If the time is unknown,\nthis value shall be zero.') ring_station_last_exit_time = mib_table_column((1, 3, 6, 1, 2, 1, 16, 10, 2, 1, 6), time_ticks()).setMaxAccess('readonly') if mibBuilder.loadTexts: ringStationLastExitTime.setDescription('The value of sysUpTime at the time the probe\ndetected that this station last exited the ring.\nIf the time is unknown, this value shall be zero.') ring_station_duplicate_addresses = mib_table_column((1, 3, 6, 1, 2, 1, 16, 10, 2, 1, 7), counter32()).setMaxAccess('readonly') if mibBuilder.loadTexts: ringStationDuplicateAddresses.setDescription('The number of times this station experienced a\nduplicate address error.') ring_station_in_line_errors = mib_table_column((1, 3, 6, 1, 2, 1, 16, 10, 2, 1, 8), counter32()).setMaxAccess('readonly') if mibBuilder.loadTexts: ringStationInLineErrors.setDescription('The total number of line errors reported by this\nstation in error reporting packets detected by the\nprobe.') ring_station_out_line_errors = mib_table_column((1, 3, 6, 1, 2, 1, 16, 10, 2, 1, 9), counter32()).setMaxAccess('readonly') if mibBuilder.loadTexts: ringStationOutLineErrors.setDescription('The total number of line errors reported in error\nreporting packets sent by the nearest active\ndownstream neighbor of this station and detected\nby the probe.') ring_station_internal_errors = mib_table_column((1, 3, 6, 1, 2, 1, 16, 10, 2, 1, 10), counter32()).setMaxAccess('readonly') if mibBuilder.loadTexts: ringStationInternalErrors.setDescription('The total number of adapter internal errors\nreported by this station in error reporting\npackets detected by the probe.') ring_station_in_burst_errors = mib_table_column((1, 3, 6, 1, 2, 1, 16, 10, 2, 1, 11), counter32()).setMaxAccess('readonly') if mibBuilder.loadTexts: ringStationInBurstErrors.setDescription('The total number of burst errors reported by this\nstation in error reporting packets detected by the\nprobe.') ring_station_out_burst_errors = mib_table_column((1, 3, 6, 1, 2, 1, 16, 10, 2, 1, 12), counter32()).setMaxAccess('readonly') if mibBuilder.loadTexts: ringStationOutBurstErrors.setDescription('The total number of burst errors reported in\nerror reporting packets sent by the nearest active\ndownstream neighbor of this station and detected\nby the probe.') ring_station_ac_errors = mib_table_column((1, 3, 6, 1, 2, 1, 16, 10, 2, 1, 13), counter32()).setMaxAccess('readonly') if mibBuilder.loadTexts: ringStationACErrors.setDescription('The total number of AC (Address Copied) errors\nreported in error reporting packets sent by the\nnearest active downstream neighbor of this station\nand detected by the probe.') ring_station_abort_errors = mib_table_column((1, 3, 6, 1, 2, 1, 16, 10, 2, 1, 14), counter32()).setMaxAccess('readonly') if mibBuilder.loadTexts: ringStationAbortErrors.setDescription('The total number of abort delimiters reported by\nthis station in error reporting packets detected\nby the probe.') ring_station_lost_frame_errors = mib_table_column((1, 3, 6, 1, 2, 1, 16, 10, 2, 1, 15), counter32()).setMaxAccess('readonly') if mibBuilder.loadTexts: ringStationLostFrameErrors.setDescription('The total number of lost frame errors reported by\nthis station in error reporting packets detected\nby the probe.') ring_station_congestion_errors = mib_table_column((1, 3, 6, 1, 2, 1, 16, 10, 2, 1, 16), counter32()).setMaxAccess('readonly') if mibBuilder.loadTexts: ringStationCongestionErrors.setDescription('The total number of receive congestion errors\nreported by this station in error reporting\npackets detected by the probe.') ring_station_frame_copied_errors = mib_table_column((1, 3, 6, 1, 2, 1, 16, 10, 2, 1, 17), counter32()).setMaxAccess('readonly') if mibBuilder.loadTexts: ringStationFrameCopiedErrors.setDescription('The total number of frame copied errors reported\nby this station in error reporting packets\ndetected by the probe.') ring_station_frequency_errors = mib_table_column((1, 3, 6, 1, 2, 1, 16, 10, 2, 1, 18), counter32()).setMaxAccess('readonly') if mibBuilder.loadTexts: ringStationFrequencyErrors.setDescription('The total number of frequency errors reported by\nthis station in error reporting packets detected\nby the probe.') ring_station_token_errors = mib_table_column((1, 3, 6, 1, 2, 1, 16, 10, 2, 1, 19), counter32()).setMaxAccess('readonly') if mibBuilder.loadTexts: ringStationTokenErrors.setDescription('The total number of token errors reported by this\nstation in error reporting frames detected by the\nprobe.') ring_station_in_beacon_errors = mib_table_column((1, 3, 6, 1, 2, 1, 16, 10, 2, 1, 20), counter32()).setMaxAccess('readonly') if mibBuilder.loadTexts: ringStationInBeaconErrors.setDescription('The total number of beacon frames sent by this\nstation and detected by the probe.') ring_station_out_beacon_errors = mib_table_column((1, 3, 6, 1, 2, 1, 16, 10, 2, 1, 21), counter32()).setMaxAccess('readonly') if mibBuilder.loadTexts: ringStationOutBeaconErrors.setDescription('The total number of beacon frames detected by the\nprobe that name this station as the NAUN.') ring_station_insertions = mib_table_column((1, 3, 6, 1, 2, 1, 16, 10, 2, 1, 22), counter32()).setMaxAccess('readonly') if mibBuilder.loadTexts: ringStationInsertions.setDescription('The number of times the probe detected this\nstation inserting onto the ring.') ring_station_order_table = mib_table((1, 3, 6, 1, 2, 1, 16, 10, 3)) if mibBuilder.loadTexts: ringStationOrderTable.setDescription('A list of ring station entries for stations in\nthe ring poll, ordered by their ring-order.') ring_station_order_entry = mib_table_row((1, 3, 6, 1, 2, 1, 16, 10, 3, 1)).setIndexNames((0, 'TOKEN-RING-RMON-MIB', 'ringStationOrderIfIndex'), (0, 'TOKEN-RING-RMON-MIB', 'ringStationOrderOrderIndex')) if mibBuilder.loadTexts: ringStationOrderEntry.setDescription('A collection of statistics for a particular\nstation that is active on a ring monitored by this\ndevice. This table will contain information for\nevery interface that has a\nringStationControlStatus equal to valid.') ring_station_order_if_index = mib_table_column((1, 3, 6, 1, 2, 1, 16, 10, 3, 1, 1), integer32()).setMaxAccess('readonly') if mibBuilder.loadTexts: ringStationOrderIfIndex.setDescription('The value of this object uniquely identifies the\ninterface on this remote network monitoring device\non which this station was detected. The interface\nidentified by a particular value of this object is\nthe same interface as identified by the same value\nof the ifIndex object, defined in MIB-II [3].') ring_station_order_order_index = mib_table_column((1, 3, 6, 1, 2, 1, 16, 10, 3, 1, 2), integer32()).setMaxAccess('readonly') if mibBuilder.loadTexts: ringStationOrderOrderIndex.setDescription('This index denotes the location of this station\nwith respect to other stations on the ring. This\nindex is one more than the number of hops\ndownstream that this station is from the rmon\nprobe. The rmon probe itself gets the value one.') ring_station_order_mac_address = mib_table_column((1, 3, 6, 1, 2, 1, 16, 10, 3, 1, 3), mac_address()).setMaxAccess('readonly') if mibBuilder.loadTexts: ringStationOrderMacAddress.setDescription('The physical address of this station.') ring_station_config_control_table = mib_table((1, 3, 6, 1, 2, 1, 16, 10, 4)) if mibBuilder.loadTexts: ringStationConfigControlTable.setDescription('A list of ring station configuration control\nentries.') ring_station_config_control_entry = mib_table_row((1, 3, 6, 1, 2, 1, 16, 10, 4, 1)).setIndexNames((0, 'TOKEN-RING-RMON-MIB', 'ringStationConfigControlIfIndex'), (0, 'TOKEN-RING-RMON-MIB', 'ringStationConfigControlMacAddress')) if mibBuilder.loadTexts: ringStationConfigControlEntry.setDescription('This entry controls active management of stations\nby the probe. One entry exists in this table for\neach active station in the ringStationTable.') ring_station_config_control_if_index = mib_table_column((1, 3, 6, 1, 2, 1, 16, 10, 4, 1, 1), integer32()).setMaxAccess('readonly') if mibBuilder.loadTexts: ringStationConfigControlIfIndex.setDescription('The value of this object uniquely identifies the\ninterface on this remote network monitoring device\non which this station was detected. The interface\nidentified by a particular value of this object is\nthe same interface as identified by the same value\nof the ifIndex object, defined in MIB-II [3].') ring_station_config_control_mac_address = mib_table_column((1, 3, 6, 1, 2, 1, 16, 10, 4, 1, 2), mac_address()).setMaxAccess('readonly') if mibBuilder.loadTexts: ringStationConfigControlMacAddress.setDescription('The physical address of this station.') ring_station_config_control_remove = mib_table_column((1, 3, 6, 1, 2, 1, 16, 10, 4, 1, 3), integer().subtype(subtypeSpec=single_value_constraint(2, 1)).subtype(namedValues=named_values(('stable', 1), ('removing', 2)))).setMaxAccess('readwrite') if mibBuilder.loadTexts: ringStationConfigControlRemove.setDescription("Setting this object to `removing(2)' causes a\nRemove Station MAC frame to be sent. The agent\nwill set this object to `stable(1)' after\nprocessing the request.") ring_station_config_control_update_stats = mib_table_column((1, 3, 6, 1, 2, 1, 16, 10, 4, 1, 4), integer().subtype(subtypeSpec=single_value_constraint(1, 2)).subtype(namedValues=named_values(('stable', 1), ('updating', 2)))).setMaxAccess('readwrite') if mibBuilder.loadTexts: ringStationConfigControlUpdateStats.setDescription("Setting this object to `updating(2)' causes the\nconfiguration information associate with this\nentry to be updated. The agent will set this\nobject to `stable(1)' after processing the\nrequest.") ring_station_config_table = mib_table((1, 3, 6, 1, 2, 1, 16, 10, 5)) if mibBuilder.loadTexts: ringStationConfigTable.setDescription('A list of configuration entries for stations on a\nring monitored by this probe.') ring_station_config_entry = mib_table_row((1, 3, 6, 1, 2, 1, 16, 10, 5, 1)).setIndexNames((0, 'TOKEN-RING-RMON-MIB', 'ringStationConfigIfIndex'), (0, 'TOKEN-RING-RMON-MIB', 'ringStationConfigMacAddress')) if mibBuilder.loadTexts: ringStationConfigEntry.setDescription('A collection of statistics for a particular\nstation that has been discovered on a ring\nmonitored by this probe.') ring_station_config_if_index = mib_table_column((1, 3, 6, 1, 2, 1, 16, 10, 5, 1, 1), integer32()).setMaxAccess('readonly') if mibBuilder.loadTexts: ringStationConfigIfIndex.setDescription('The value of this object uniquely identifies the\ninterface on this remote network monitoring device\non which this station was detected. The interface\nidentified by a particular value of this object is\nthe same interface as identified by the same value\nof the ifIndex object, defined in MIB-II [3].') ring_station_config_mac_address = mib_table_column((1, 3, 6, 1, 2, 1, 16, 10, 5, 1, 2), mac_address()).setMaxAccess('readonly') if mibBuilder.loadTexts: ringStationConfigMacAddress.setDescription('The physical address of this station.') ring_station_config_update_time = mib_table_column((1, 3, 6, 1, 2, 1, 16, 10, 5, 1, 3), time_ticks()).setMaxAccess('readonly') if mibBuilder.loadTexts: ringStationConfigUpdateTime.setDescription('The value of sysUpTime at the time this\nconfiguration information was last updated\n(completely).') ring_station_config_location = mib_table_column((1, 3, 6, 1, 2, 1, 16, 10, 5, 1, 4), octet_string().subtype(subtypeSpec=value_size_constraint(4, 4)).setFixedLength(4)).setMaxAccess('readonly') if mibBuilder.loadTexts: ringStationConfigLocation.setDescription('The assigned physical location of this station.') ring_station_config_microcode = mib_table_column((1, 3, 6, 1, 2, 1, 16, 10, 5, 1, 5), octet_string().subtype(subtypeSpec=value_size_constraint(10, 10)).setFixedLength(10)).setMaxAccess('readonly') if mibBuilder.loadTexts: ringStationConfigMicrocode.setDescription('The microcode EC level of this station.') ring_station_config_group_address = mib_table_column((1, 3, 6, 1, 2, 1, 16, 10, 5, 1, 6), octet_string().subtype(subtypeSpec=value_size_constraint(4, 4)).setFixedLength(4)).setMaxAccess('readonly') if mibBuilder.loadTexts: ringStationConfigGroupAddress.setDescription('The low-order 4 octets of the group address\nrecognized by this station.') ring_station_config_functional_address = mib_table_column((1, 3, 6, 1, 2, 1, 16, 10, 5, 1, 7), octet_string().subtype(subtypeSpec=value_size_constraint(4, 4)).setFixedLength(4)).setMaxAccess('readonly') if mibBuilder.loadTexts: ringStationConfigFunctionalAddress.setDescription('the functional addresses recognized by this\nstation.') source_routing_stats_table = mib_table((1, 3, 6, 1, 2, 1, 16, 10, 6)) if mibBuilder.loadTexts: sourceRoutingStatsTable.setDescription('A list of source routing statistics entries.') source_routing_stats_entry = mib_table_row((1, 3, 6, 1, 2, 1, 16, 10, 6, 1)).setIndexNames((0, 'TOKEN-RING-RMON-MIB', 'sourceRoutingStatsIfIndex')) if mibBuilder.loadTexts: sourceRoutingStatsEntry.setDescription('A collection of source routing statistics kept\nfor a particular Token Ring interface.') source_routing_stats_if_index = mib_table_column((1, 3, 6, 1, 2, 1, 16, 10, 6, 1, 1), integer32()).setMaxAccess('readonly') if mibBuilder.loadTexts: sourceRoutingStatsIfIndex.setDescription('The value of this object uniquely identifies the\ninterface on this remote network monitoring device\non which source routing statistics will be\ndetected. The interface identified by a\nparticular value of this object is the same\ninterface as identified by the same value of the\nifIndex object, defined in MIB-II [3].') source_routing_stats_ring_number = mib_table_column((1, 3, 6, 1, 2, 1, 16, 10, 6, 1, 2), integer32()).setMaxAccess('readonly') if mibBuilder.loadTexts: sourceRoutingStatsRingNumber.setDescription('The ring number of the ring monitored by this\nentry. When any object in this entry is created,\nthe probe will attempt to discover the ring\nnumber. Only after the ring number is discovered\nwill this object be created. After creating an\nobject in this entry, the management station\nshould poll this object to detect when it is\ncreated. Only after this object is created can\nthe management station set the\nsourceRoutingStatsStatus entry to valid(1).') source_routing_stats_in_frames = mib_table_column((1, 3, 6, 1, 2, 1, 16, 10, 6, 1, 3), counter32()).setMaxAccess('readonly') if mibBuilder.loadTexts: sourceRoutingStatsInFrames.setDescription('The count of frames sent into this ring from\nanother ring.') source_routing_stats_out_frames = mib_table_column((1, 3, 6, 1, 2, 1, 16, 10, 6, 1, 4), counter32()).setMaxAccess('readonly') if mibBuilder.loadTexts: sourceRoutingStatsOutFrames.setDescription('The count of frames sent from this ring to\nanother ring.') source_routing_stats_through_frames = mib_table_column((1, 3, 6, 1, 2, 1, 16, 10, 6, 1, 5), counter32()).setMaxAccess('readonly') if mibBuilder.loadTexts: sourceRoutingStatsThroughFrames.setDescription('The count of frames sent from another ring,\nthrough this ring, to another ring.') source_routing_stats_all_routes_broadcast_frames = mib_table_column((1, 3, 6, 1, 2, 1, 16, 10, 6, 1, 6), counter32()).setMaxAccess('readonly') if mibBuilder.loadTexts: sourceRoutingStatsAllRoutesBroadcastFrames.setDescription('The total number of good frames received that\nwere All Routes Broadcast.') source_routing_stats_single_route_broadcast_frames = mib_table_column((1, 3, 6, 1, 2, 1, 16, 10, 6, 1, 7), counter32()).setMaxAccess('readonly') if mibBuilder.loadTexts: sourceRoutingStatsSingleRouteBroadcastFrames.setDescription('The total number of good frames received that\nwere Single Route Broadcast.') source_routing_stats_in_octets = mib_table_column((1, 3, 6, 1, 2, 1, 16, 10, 6, 1, 8), counter32()).setMaxAccess('readonly') if mibBuilder.loadTexts: sourceRoutingStatsInOctets.setDescription('The count of octets in good frames sent into this\nring from another ring.') source_routing_stats_out_octets = mib_table_column((1, 3, 6, 1, 2, 1, 16, 10, 6, 1, 9), counter32()).setMaxAccess('readonly') if mibBuilder.loadTexts: sourceRoutingStatsOutOctets.setDescription('The count of octets in good frames sent from this\nring to another ring.') source_routing_stats_through_octets = mib_table_column((1, 3, 6, 1, 2, 1, 16, 10, 6, 1, 10), counter32()).setMaxAccess('readonly') if mibBuilder.loadTexts: sourceRoutingStatsThroughOctets.setDescription('The count of octets in good frames sent another\nring, through this ring, to another ring.') source_routing_stats_all_routes_broadcast_octets = mib_table_column((1, 3, 6, 1, 2, 1, 16, 10, 6, 1, 11), counter32()).setMaxAccess('readonly') if mibBuilder.loadTexts: sourceRoutingStatsAllRoutesBroadcastOctets.setDescription('The total number of octets in good frames\nreceived that were All Routes Broadcast.') source_routing_stats_single_routes_broadcast_octets = mib_table_column((1, 3, 6, 1, 2, 1, 16, 10, 6, 1, 12), counter32()).setMaxAccess('readonly') if mibBuilder.loadTexts: sourceRoutingStatsSingleRoutesBroadcastOctets.setDescription('The total number of octets in good frames\nreceived that were Single Route Broadcast.') source_routing_stats_local_llc_frames = mib_table_column((1, 3, 6, 1, 2, 1, 16, 10, 6, 1, 13), counter32()).setMaxAccess('readonly') if mibBuilder.loadTexts: sourceRoutingStatsLocalLLCFrames.setDescription("The total number of frames received who had no\nRIF field (or had a RIF field that only included\nthe local ring's number) and were not All Route\nBroadcast Frames.") source_routing_stats1_hop_frames = mib_table_column((1, 3, 6, 1, 2, 1, 16, 10, 6, 1, 14), counter32()).setMaxAccess('readonly') if mibBuilder.loadTexts: sourceRoutingStats1HopFrames.setDescription('The total number of frames received whose route\nhad 1 hop, were not All Route Broadcast Frames,\nand whose source or destination were on this ring\n(i.e. frames that had a RIF field and had this\nring number in the first or last entry of the RIF\nfield).') source_routing_stats2_hops_frames = mib_table_column((1, 3, 6, 1, 2, 1, 16, 10, 6, 1, 15), counter32()).setMaxAccess('readonly') if mibBuilder.loadTexts: sourceRoutingStats2HopsFrames.setDescription('The total number of frames received whose route\nhad 2 hops, were not All Route Broadcast Frames,\nand whose source or destination were on this ring\n(i.e. frames that had a RIF field and had this\nring number in the first or last entry of the RIF\nfield).') source_routing_stats3_hops_frames = mib_table_column((1, 3, 6, 1, 2, 1, 16, 10, 6, 1, 16), counter32()).setMaxAccess('readonly') if mibBuilder.loadTexts: sourceRoutingStats3HopsFrames.setDescription('The total number of frames received whose route\nhad 3 hops, were not All Route Broadcast Frames,\nand whose source or destination were on this ring\n(i.e. frames that had a RIF field and had this\nring number in the first or last entry of the RIF\nfield).') source_routing_stats4_hops_frames = mib_table_column((1, 3, 6, 1, 2, 1, 16, 10, 6, 1, 17), counter32()).setMaxAccess('readonly') if mibBuilder.loadTexts: sourceRoutingStats4HopsFrames.setDescription('The total number of frames received whose route\nhad 4 hops, were not All Route Broadcast Frames,\nand whose source or destination were on this ring\n(i.e. frames that had a RIF field and had this\nring number in the first or last entry of the RIF\nfield).') source_routing_stats5_hops_frames = mib_table_column((1, 3, 6, 1, 2, 1, 16, 10, 6, 1, 18), counter32()).setMaxAccess('readonly') if mibBuilder.loadTexts: sourceRoutingStats5HopsFrames.setDescription('The total number of frames received whose route\nhad 5 hops, were not All Route Broadcast Frames,\nand whose source or destination were on this ring\n(i.e. frames that had a RIF field and had this\nring number in the first or last entry of the RIF\nfield).') source_routing_stats6_hops_frames = mib_table_column((1, 3, 6, 1, 2, 1, 16, 10, 6, 1, 19), counter32()).setMaxAccess('readonly') if mibBuilder.loadTexts: sourceRoutingStats6HopsFrames.setDescription('The total number of frames received whose route\nhad 6 hops, were not All Route Broadcast Frames,\nand whose source or destination were on this ring\n(i.e. frames that had a RIF field and had this\nring number in the first or last entry of the RIF\nfield).') source_routing_stats7_hops_frames = mib_table_column((1, 3, 6, 1, 2, 1, 16, 10, 6, 1, 20), counter32()).setMaxAccess('readonly') if mibBuilder.loadTexts: sourceRoutingStats7HopsFrames.setDescription('The total number of frames received whose route\nhad 7 hops, were not All Route Broadcast Frames,\nand whose source or destination were on this ring\n(i.e. frames that had a RIF field and had this\nring number in the first or last entry of the RIF\nfield).') source_routing_stats8_hops_frames = mib_table_column((1, 3, 6, 1, 2, 1, 16, 10, 6, 1, 21), counter32()).setMaxAccess('readonly') if mibBuilder.loadTexts: sourceRoutingStats8HopsFrames.setDescription('The total number of frames received whose route\nhad 8 hops, were not All Route Broadcast Frames,\nand whose source or destination were on this ring\n(i.e. frames that had a RIF field and had this\nring number in the first or last entry of the RIF\nfield).') source_routing_stats_more_than8_hops_frames = mib_table_column((1, 3, 6, 1, 2, 1, 16, 10, 6, 1, 22), counter32()).setMaxAccess('readonly') if mibBuilder.loadTexts: sourceRoutingStatsMoreThan8HopsFrames.setDescription('The total number of frames received whose route\nhad more than 8 hops, were not All Route Broadcast\nFrames, and whose source or destination were on\nthis ring (i.e. frames that had a RIF field and\nhad this ring number in the first or last entry of\nthe RIF field).') source_routing_stats_owner = mib_table_column((1, 3, 6, 1, 2, 1, 16, 10, 6, 1, 23), owner_string()).setMaxAccess('readwrite') if mibBuilder.loadTexts: sourceRoutingStatsOwner.setDescription('The base_entity that configured this entry and is\ntherefore using the resources assigned to it.') source_routing_stats_status = mib_table_column((1, 3, 6, 1, 2, 1, 16, 10, 6, 1, 24), entry_status()).setMaxAccess('readwrite') if mibBuilder.loadTexts: sourceRoutingStatsStatus.setDescription('The status of this sourceRoutingStats entry.') mibBuilder.exportSymbols('TOKEN-RING-RMON-MIB', MacAddress=MacAddress, TimeInterval=TimeInterval) mibBuilder.exportSymbols('TOKEN-RING-RMON-MIB', tokenRingMLStatsTable=tokenRingMLStatsTable, tokenRingMLStatsEntry=tokenRingMLStatsEntry, tokenRingMLStatsIndex=tokenRingMLStatsIndex, tokenRingMLStatsDataSource=tokenRingMLStatsDataSource, tokenRingMLStatsDropEvents=tokenRingMLStatsDropEvents, tokenRingMLStatsMacOctets=tokenRingMLStatsMacOctets, tokenRingMLStatsMacPkts=tokenRingMLStatsMacPkts, tokenRingMLStatsRingPurgeEvents=tokenRingMLStatsRingPurgeEvents, tokenRingMLStatsRingPurgePkts=tokenRingMLStatsRingPurgePkts, tokenRingMLStatsBeaconEvents=tokenRingMLStatsBeaconEvents, tokenRingMLStatsBeaconTime=tokenRingMLStatsBeaconTime, tokenRingMLStatsBeaconPkts=tokenRingMLStatsBeaconPkts, tokenRingMLStatsClaimTokenEvents=tokenRingMLStatsClaimTokenEvents, tokenRingMLStatsClaimTokenPkts=tokenRingMLStatsClaimTokenPkts, tokenRingMLStatsNAUNChanges=tokenRingMLStatsNAUNChanges, tokenRingMLStatsLineErrors=tokenRingMLStatsLineErrors, tokenRingMLStatsInternalErrors=tokenRingMLStatsInternalErrors, tokenRingMLStatsBurstErrors=tokenRingMLStatsBurstErrors, tokenRingMLStatsACErrors=tokenRingMLStatsACErrors, tokenRingMLStatsAbortErrors=tokenRingMLStatsAbortErrors, tokenRingMLStatsLostFrameErrors=tokenRingMLStatsLostFrameErrors, tokenRingMLStatsCongestionErrors=tokenRingMLStatsCongestionErrors, tokenRingMLStatsFrameCopiedErrors=tokenRingMLStatsFrameCopiedErrors, tokenRingMLStatsFrequencyErrors=tokenRingMLStatsFrequencyErrors, tokenRingMLStatsTokenErrors=tokenRingMLStatsTokenErrors, tokenRingMLStatsSoftErrorReports=tokenRingMLStatsSoftErrorReports, tokenRingMLStatsRingPollEvents=tokenRingMLStatsRingPollEvents, tokenRingMLStatsOwner=tokenRingMLStatsOwner, tokenRingMLStatsStatus=tokenRingMLStatsStatus, tokenRingPStatsTable=tokenRingPStatsTable, tokenRingPStatsEntry=tokenRingPStatsEntry, tokenRingPStatsIndex=tokenRingPStatsIndex, tokenRingPStatsDataSource=tokenRingPStatsDataSource, tokenRingPStatsDropEvents=tokenRingPStatsDropEvents, tokenRingPStatsDataOctets=tokenRingPStatsDataOctets, tokenRingPStatsDataPkts=tokenRingPStatsDataPkts, tokenRingPStatsDataBroadcastPkts=tokenRingPStatsDataBroadcastPkts, tokenRingPStatsDataMulticastPkts=tokenRingPStatsDataMulticastPkts, tokenRingPStatsDataPkts18to63Octets=tokenRingPStatsDataPkts18to63Octets, tokenRingPStatsDataPkts64to127Octets=tokenRingPStatsDataPkts64to127Octets, tokenRingPStatsDataPkts128to255Octets=tokenRingPStatsDataPkts128to255Octets, tokenRingPStatsDataPkts256to511Octets=tokenRingPStatsDataPkts256to511Octets, tokenRingPStatsDataPkts512to1023Octets=tokenRingPStatsDataPkts512to1023Octets, tokenRingPStatsDataPkts1024to2047Octets=tokenRingPStatsDataPkts1024to2047Octets, tokenRingPStatsDataPkts2048to4095Octets=tokenRingPStatsDataPkts2048to4095Octets, tokenRingPStatsDataPkts4096to8191Octets=tokenRingPStatsDataPkts4096to8191Octets, tokenRingPStatsDataPkts8192to18000Octets=tokenRingPStatsDataPkts8192to18000Octets, tokenRingPStatsDataPktsGreaterThan18000Octets=tokenRingPStatsDataPktsGreaterThan18000Octets, tokenRingPStatsOwner=tokenRingPStatsOwner, tokenRingPStatsStatus=tokenRingPStatsStatus, tokenRingMLHistoryTable=tokenRingMLHistoryTable, tokenRingMLHistoryEntry=tokenRingMLHistoryEntry, tokenRingMLHistoryIndex=tokenRingMLHistoryIndex, tokenRingMLHistorySampleIndex=tokenRingMLHistorySampleIndex, tokenRingMLHistoryIntervalStart=tokenRingMLHistoryIntervalStart, tokenRingMLHistoryDropEvents=tokenRingMLHistoryDropEvents, tokenRingMLHistoryMacOctets=tokenRingMLHistoryMacOctets, tokenRingMLHistoryMacPkts=tokenRingMLHistoryMacPkts, tokenRingMLHistoryRingPurgeEvents=tokenRingMLHistoryRingPurgeEvents, tokenRingMLHistoryRingPurgePkts=tokenRingMLHistoryRingPurgePkts, tokenRingMLHistoryBeaconEvents=tokenRingMLHistoryBeaconEvents, tokenRingMLHistoryBeaconTime=tokenRingMLHistoryBeaconTime, tokenRingMLHistoryBeaconPkts=tokenRingMLHistoryBeaconPkts, tokenRingMLHistoryClaimTokenEvents=tokenRingMLHistoryClaimTokenEvents, tokenRingMLHistoryClaimTokenPkts=tokenRingMLHistoryClaimTokenPkts, tokenRingMLHistoryNAUNChanges=tokenRingMLHistoryNAUNChanges, tokenRingMLHistoryLineErrors=tokenRingMLHistoryLineErrors, tokenRingMLHistoryInternalErrors=tokenRingMLHistoryInternalErrors, tokenRingMLHistoryBurstErrors=tokenRingMLHistoryBurstErrors, tokenRingMLHistoryACErrors=tokenRingMLHistoryACErrors, tokenRingMLHistoryAbortErrors=tokenRingMLHistoryAbortErrors, tokenRingMLHistoryLostFrameErrors=tokenRingMLHistoryLostFrameErrors, tokenRingMLHistoryCongestionErrors=tokenRingMLHistoryCongestionErrors, tokenRingMLHistoryFrameCopiedErrors=tokenRingMLHistoryFrameCopiedErrors, tokenRingMLHistoryFrequencyErrors=tokenRingMLHistoryFrequencyErrors, tokenRingMLHistoryTokenErrors=tokenRingMLHistoryTokenErrors, tokenRingMLHistorySoftErrorReports=tokenRingMLHistorySoftErrorReports, tokenRingMLHistoryRingPollEvents=tokenRingMLHistoryRingPollEvents, tokenRingMLHistoryActiveStations=tokenRingMLHistoryActiveStations, tokenRingPHistoryTable=tokenRingPHistoryTable, tokenRingPHistoryEntry=tokenRingPHistoryEntry, tokenRingPHistoryIndex=tokenRingPHistoryIndex, tokenRingPHistorySampleIndex=tokenRingPHistorySampleIndex, tokenRingPHistoryIntervalStart=tokenRingPHistoryIntervalStart, tokenRingPHistoryDropEvents=tokenRingPHistoryDropEvents, tokenRingPHistoryDataOctets=tokenRingPHistoryDataOctets, tokenRingPHistoryDataPkts=tokenRingPHistoryDataPkts, tokenRingPHistoryDataBroadcastPkts=tokenRingPHistoryDataBroadcastPkts, tokenRingPHistoryDataMulticastPkts=tokenRingPHistoryDataMulticastPkts, tokenRingPHistoryDataPkts18to63Octets=tokenRingPHistoryDataPkts18to63Octets, tokenRingPHistoryDataPkts64to127Octets=tokenRingPHistoryDataPkts64to127Octets, tokenRingPHistoryDataPkts128to255Octets=tokenRingPHistoryDataPkts128to255Octets, tokenRingPHistoryDataPkts256to511Octets=tokenRingPHistoryDataPkts256to511Octets, tokenRingPHistoryDataPkts512to1023Octets=tokenRingPHistoryDataPkts512to1023Octets, tokenRingPHistoryDataPkts1024to2047Octets=tokenRingPHistoryDataPkts1024to2047Octets, tokenRingPHistoryDataPkts2048to4095Octets=tokenRingPHistoryDataPkts2048to4095Octets, tokenRingPHistoryDataPkts4096to8191Octets=tokenRingPHistoryDataPkts4096to8191Octets, tokenRingPHistoryDataPkts8192to18000Octets=tokenRingPHistoryDataPkts8192to18000Octets, tokenRingPHistoryDataPktsGreaterThan18000Octets=tokenRingPHistoryDataPktsGreaterThan18000Octets, tokenRing=tokenRing, ringStationControlTable=ringStationControlTable, ringStationControlEntry=ringStationControlEntry, ringStationControlIfIndex=ringStationControlIfIndex, ringStationControlTableSize=ringStationControlTableSize, ringStationControlActiveStations=ringStationControlActiveStations, ringStationControlRingState=ringStationControlRingState, ringStationControlBeaconSender=ringStationControlBeaconSender, ringStationControlBeaconNAUN=ringStationControlBeaconNAUN, ringStationControlActiveMonitor=ringStationControlActiveMonitor, ringStationControlOrderChanges=ringStationControlOrderChanges, ringStationControlOwner=ringStationControlOwner, ringStationControlStatus=ringStationControlStatus, ringStationTable=ringStationTable, ringStationEntry=ringStationEntry, ringStationIfIndex=ringStationIfIndex, ringStationMacAddress=ringStationMacAddress, ringStationLastNAUN=ringStationLastNAUN, ringStationStationStatus=ringStationStationStatus, ringStationLastEnterTime=ringStationLastEnterTime, ringStationLastExitTime=ringStationLastExitTime, ringStationDuplicateAddresses=ringStationDuplicateAddresses, ringStationInLineErrors=ringStationInLineErrors, ringStationOutLineErrors=ringStationOutLineErrors, ringStationInternalErrors=ringStationInternalErrors, ringStationInBurstErrors=ringStationInBurstErrors, ringStationOutBurstErrors=ringStationOutBurstErrors) mibBuilder.exportSymbols('TOKEN-RING-RMON-MIB', ringStationACErrors=ringStationACErrors, ringStationAbortErrors=ringStationAbortErrors, ringStationLostFrameErrors=ringStationLostFrameErrors, ringStationCongestionErrors=ringStationCongestionErrors, ringStationFrameCopiedErrors=ringStationFrameCopiedErrors, ringStationFrequencyErrors=ringStationFrequencyErrors, ringStationTokenErrors=ringStationTokenErrors, ringStationInBeaconErrors=ringStationInBeaconErrors, ringStationOutBeaconErrors=ringStationOutBeaconErrors, ringStationInsertions=ringStationInsertions, ringStationOrderTable=ringStationOrderTable, ringStationOrderEntry=ringStationOrderEntry, ringStationOrderIfIndex=ringStationOrderIfIndex, ringStationOrderOrderIndex=ringStationOrderOrderIndex, ringStationOrderMacAddress=ringStationOrderMacAddress, ringStationConfigControlTable=ringStationConfigControlTable, ringStationConfigControlEntry=ringStationConfigControlEntry, ringStationConfigControlIfIndex=ringStationConfigControlIfIndex, ringStationConfigControlMacAddress=ringStationConfigControlMacAddress, ringStationConfigControlRemove=ringStationConfigControlRemove, ringStationConfigControlUpdateStats=ringStationConfigControlUpdateStats, ringStationConfigTable=ringStationConfigTable, ringStationConfigEntry=ringStationConfigEntry, ringStationConfigIfIndex=ringStationConfigIfIndex, ringStationConfigMacAddress=ringStationConfigMacAddress, ringStationConfigUpdateTime=ringStationConfigUpdateTime, ringStationConfigLocation=ringStationConfigLocation, ringStationConfigMicrocode=ringStationConfigMicrocode, ringStationConfigGroupAddress=ringStationConfigGroupAddress, ringStationConfigFunctionalAddress=ringStationConfigFunctionalAddress, sourceRoutingStatsTable=sourceRoutingStatsTable, sourceRoutingStatsEntry=sourceRoutingStatsEntry, sourceRoutingStatsIfIndex=sourceRoutingStatsIfIndex, sourceRoutingStatsRingNumber=sourceRoutingStatsRingNumber, sourceRoutingStatsInFrames=sourceRoutingStatsInFrames, sourceRoutingStatsOutFrames=sourceRoutingStatsOutFrames, sourceRoutingStatsThroughFrames=sourceRoutingStatsThroughFrames, sourceRoutingStatsAllRoutesBroadcastFrames=sourceRoutingStatsAllRoutesBroadcastFrames, sourceRoutingStatsSingleRouteBroadcastFrames=sourceRoutingStatsSingleRouteBroadcastFrames, sourceRoutingStatsInOctets=sourceRoutingStatsInOctets, sourceRoutingStatsOutOctets=sourceRoutingStatsOutOctets, sourceRoutingStatsThroughOctets=sourceRoutingStatsThroughOctets, sourceRoutingStatsAllRoutesBroadcastOctets=sourceRoutingStatsAllRoutesBroadcastOctets, sourceRoutingStatsSingleRoutesBroadcastOctets=sourceRoutingStatsSingleRoutesBroadcastOctets, sourceRoutingStatsLocalLLCFrames=sourceRoutingStatsLocalLLCFrames, sourceRoutingStats1HopFrames=sourceRoutingStats1HopFrames, sourceRoutingStats2HopsFrames=sourceRoutingStats2HopsFrames, sourceRoutingStats3HopsFrames=sourceRoutingStats3HopsFrames, sourceRoutingStats4HopsFrames=sourceRoutingStats4HopsFrames, sourceRoutingStats5HopsFrames=sourceRoutingStats5HopsFrames, sourceRoutingStats6HopsFrames=sourceRoutingStats6HopsFrames, sourceRoutingStats7HopsFrames=sourceRoutingStats7HopsFrames, sourceRoutingStats8HopsFrames=sourceRoutingStats8HopsFrames, sourceRoutingStatsMoreThan8HopsFrames=sourceRoutingStatsMoreThan8HopsFrames, sourceRoutingStatsOwner=sourceRoutingStatsOwner, sourceRoutingStatsStatus=sourceRoutingStatsStatus)
#Body """ Compare two linked list head could be None as well for empty list Node is defined as class Node(object): def __init__(self, data=None, next_node=None): self.data = data self.next = next_node return back the head of the linked list in the below method. """ class Node(object): def __init__(self, data=None, next_node=None): self.data = data self.next = next_node def CompareLists(headA, headB): if headA and headB: while headA and headB: dataA = headA.data dataB = headB.data #print dataA, dataB, headA.next, headB.next if dataA != dataB or (not headA.next and headB.next) or (headA.next and not headB.next): return 0 else: headA = headA.next headB = headB.next return 1 elif headA or headB: return 0
""" Compare two linked list head could be None as well for empty list Node is defined as class Node(object): def __init__(self, data=None, next_node=None): self.data = data self.next = next_node return back the head of the linked list in the below method. """ class Node(object): def __init__(self, data=None, next_node=None): self.data = data self.next = next_node def compare_lists(headA, headB): if headA and headB: while headA and headB: data_a = headA.data data_b = headB.data if dataA != dataB or (not headA.next and headB.next) or (headA.next and (not headB.next)): return 0 else: head_a = headA.next head_b = headB.next return 1 elif headA or headB: return 0
HOST = "0.0.0.0" PORT = 8140 # https://docs.sqlalchemy.org/en/14/dialects/postgresql.html POSTGRESQL_URL = "postgresql+asyncpg://imgsmlr:imgsmlr-123456@127.0.0.1:5400/imgsmlr" SQL_DEBUG = False SEARCH_LIMIT = 50 SEARCH_SIMR_THRESHOLD = 4.5
host = '0.0.0.0' port = 8140 postgresql_url = 'postgresql+asyncpg://imgsmlr:imgsmlr-123456@127.0.0.1:5400/imgsmlr' sql_debug = False search_limit = 50 search_simr_threshold = 4.5
# Copyright (c) 2018 PrimeVR # Distributed under the MIT software license, see the accompanying # file LICENSE or http://www.opensource.org/licenses/mit-license.php def united_bitcoin_qualification(span): ubtc_start = 494000 ubtc_end = 502315 if not span['defunded']: return None if (span['defunded']['block'] < ubtc_end and span['defunded']['block'] > ubtc_start): return span['defunded']['value'] return None UNITED_BITCOIN = { 'id': 'united-bitcoin', 'qualification': united_bitcoin_qualification, }
def united_bitcoin_qualification(span): ubtc_start = 494000 ubtc_end = 502315 if not span['defunded']: return None if span['defunded']['block'] < ubtc_end and span['defunded']['block'] > ubtc_start: return span['defunded']['value'] return None united_bitcoin = {'id': 'united-bitcoin', 'qualification': united_bitcoin_qualification}
""" Profile ../profile-datasets-py/div83/010.py file automaticaly created by prof_gen.py script """ self["ID"] = "../profile-datasets-py/div83/010.py" self["Q"] = numpy.array([ 2.095776, 2.465104, 3.1296 , 3.963974, 5.003875, 5.921015, 6.371809, 6.473068, 6.457728, 6.408619, 6.31879 , 6.221031, 6.186012, 6.208811, 6.248791, 6.249351, 6.238571, 6.208811, 6.148072, 6.044683, 5.886575, 5.628238, 5.349561, 5.054794, 4.733978, 4.362401, 3.939184, 3.492948, 3.046111, 2.642203, 2.323985, 2.093356, 1.938136, 1.855297, 1.823937, 1.825827, 1.847347, 1.870697, 1.873936, 1.853107, 1.814007, 1.790617, 1.804607, 1.857837, 1.941866, 2.129285, 2.500164, 2.836112, 3.006931, 3.12847 , 3.21225 , 3.262739, 3.303259, 3.347139, 3.362529, 3.373449, 3.415948, 3.515398, 3.662857, 3.802286, 3.875425, 3.993384, 5.670948, 10.0286 , 15.87335 , 21.89402 , 27.33565 , 32.30636 , 37.82687 , 45.09077 , 53.92039 , 64.31746 , 76.55004 , 91.06231 , 108.4872 , 128.7134 , 148.5269 , 161.091 , 160.1943 , 140.2593 , 110.2268 , 91.40125 , 89.92581 , 103.0884 , 133.1153 , 181.622 , 253.6816 , 347.6251 , 439.19 , 468.0418 , 165.9215 , 160.9761 , 156.2436 , 151.711 , 147.3693 , 143.2085 , 139.2176 , 135.3897 , 131.7156 , 128.1876 , 124.7984 ]) self["P"] = numpy.array([ 5.00000000e-03, 1.61000000e-02, 3.84000000e-02, 7.69000000e-02, 1.37000000e-01, 2.24400000e-01, 3.45400000e-01, 5.06400000e-01, 7.14000000e-01, 9.75300000e-01, 1.29720000e+00, 1.68720000e+00, 2.15260000e+00, 2.70090000e+00, 3.33980000e+00, 4.07700000e+00, 4.92040000e+00, 5.87760000e+00, 6.95670000e+00, 8.16550000e+00, 9.51190000e+00, 1.10038000e+01, 1.26492000e+01, 1.44559000e+01, 1.64318000e+01, 1.85847000e+01, 2.09224000e+01, 2.34526000e+01, 2.61829000e+01, 2.91210000e+01, 3.22744000e+01, 3.56505000e+01, 3.92566000e+01, 4.31001000e+01, 4.71882000e+01, 5.15278000e+01, 5.61260000e+01, 6.09895000e+01, 6.61253000e+01, 7.15398000e+01, 7.72396000e+01, 8.32310000e+01, 8.95204000e+01, 9.61138000e+01, 1.03017000e+02, 1.10237000e+02, 1.17778000e+02, 1.25646000e+02, 1.33846000e+02, 1.42385000e+02, 1.51266000e+02, 1.60496000e+02, 1.70078000e+02, 1.80018000e+02, 1.90320000e+02, 2.00989000e+02, 2.12028000e+02, 2.23442000e+02, 2.35234000e+02, 2.47408000e+02, 2.59969000e+02, 2.72919000e+02, 2.86262000e+02, 3.00000000e+02, 3.14137000e+02, 3.28675000e+02, 3.43618000e+02, 3.58966000e+02, 3.74724000e+02, 3.90893000e+02, 4.07474000e+02, 4.24470000e+02, 4.41882000e+02, 4.59712000e+02, 4.77961000e+02, 4.96630000e+02, 5.15720000e+02, 5.35232000e+02, 5.55167000e+02, 5.75525000e+02, 5.96306000e+02, 6.17511000e+02, 6.39140000e+02, 6.61192000e+02, 6.83667000e+02, 7.06565000e+02, 7.29886000e+02, 7.53628000e+02, 7.77790000e+02, 8.02371000e+02, 8.27371000e+02, 8.52788000e+02, 8.78620000e+02, 9.04866000e+02, 9.31524000e+02, 9.58591000e+02, 9.86067000e+02, 1.01395000e+03, 1.04223000e+03, 1.07092000e+03, 1.10000000e+03]) self["CO2"] = numpy.array([ 373.3942, 373.3941, 373.3938, 373.3935, 373.3921, 373.3918, 373.3946, 373.4036, 373.4146, 373.4426, 373.4896, 373.5487, 373.6167, 373.7457, 373.8797, 373.9647, 373.9937, 373.9477, 373.8447, 373.7057, 373.5698, 373.4619, 373.359 , 373.2451, 373.1282, 373.0064, 372.9185, 372.8307, 372.7759, 372.719 , 372.6741, 372.6262, 372.6273, 372.6313, 372.6903, 372.7783, 372.8793, 373.0013, 373.1303, 373.2973, 373.4763, 373.7093, 374.0053, 374.3173, 374.6923, 375.0842, 375.5021, 375.9429, 376.3999, 376.8598, 377.3388, 377.8728, 378.4337, 378.9727, 379.4857, 379.9377, 380.1537, 380.3697, 380.4166, 380.4656, 380.4875, 380.5065, 380.5098, 380.5082, 380.497 , 380.4827, 380.4586, 380.4307, 380.3936, 380.3518, 380.3065, 380.2585, 380.2139, 380.1684, 380.1278, 380.0871, 380.0505, 380.0208, 379.9991, 379.9867, 379.9801, 379.9713, 379.9658, 379.9588, 379.9484, 379.939 , 379.9266, 379.9019, 379.8731, 379.8501, 379.9549, 379.9488, 379.9446, 379.9423, 379.943 , 379.9446, 379.9461, 379.9476, 379.9489, 379.9503, 379.9516]) self["CO"] = numpy.array([ 0.6800446 , 0.6740193 , 0.6620749 , 0.6419505 , 0.6117519 , 0.5703516 , 0.3488468 , 0.0930345 , 0.08980432, 0.07642571, 0.05501905, 0.03542598, 0.02273726, 0.0167016 , 0.01458811, 0.01381391, 0.01293702, 0.01186053, 0.01089353, 0.01022694, 0.01013334, 0.01029874, 0.01054954, 0.01068985, 0.01095735, 0.01133045, 0.01198095, 0.01272726, 0.01303036, 0.01325816, 0.01226177, 0.01127788, 0.01024268, 0.00924114, 0.00879343, 0.0085742 , 0.00847924, 0.00867004, 0.00887618, 0.00923515, 0.009644 , 0.01013538, 0.01072998, 0.01139158, 0.01216398, 0.01302787, 0.01413626, 0.01550166, 0.01705575, 0.01879384, 0.02078993, 0.02289143, 0.02525062, 0.02788281, 0.0308218 , 0.03392959, 0.03658498, 0.03948956, 0.04125235, 0.04315494, 0.04419713, 0.04516932, 0.04572824, 0.04618014, 0.04645236, 0.04665698, 0.04677772, 0.04686359, 0.04688663, 0.04688609, 0.04686017, 0.04682749, 0.04676122, 0.04669305, 0.04663384, 0.0465858 , 0.04655648, 0.0465376 , 0.04652345, 0.04650948, 0.04649977, 0.04649525, 0.04650932, 0.0465258 , 0.0465483 , 0.04657384, 0.04658478, 0.04656421, 0.04653585, 0.04651032, 0.04650158, 0.04647112, 0.04638355, 0.0461135 , 0.04584094, 0.04556567, 0.04528799, 0.04500801, 0.04472571, 0.0444411 , 0.04415449]) self["T"] = numpy.array([ 203.241, 210.063, 221.314, 233.602, 248.271, 261.577, 272.444, 278.371, 278.595, 275.594, 270.871, 263.75 , 255.163, 246.655, 238.909, 231.799, 223.896, 217.482, 212.546, 208.833, 205.703, 202.946, 200.522, 198.582, 197.057, 195.619, 194.223, 193.349, 192.952, 192.888, 192.912, 192.728, 192.467, 192.507, 192.821, 193.133, 193.235, 193.199, 193.315, 193.791, 194.586, 195.302, 195.506, 195.217, 195.025, 195.515, 196.602, 197.901, 199.067, 199.978, 200.682, 201.276, 201.715, 201.971, 202.121, 202.333, 202.75 , 203.402, 204.24 , 205.206, 206.259, 207.357, 208.502, 209.714, 211.033, 212.487, 214.102, 215.888, 217.825, 219.839, 221.862, 223.857, 225.812, 227.74 , 229.66 , 231.591, 233.507, 235.332, 236.977, 238.377, 239.532, 240.469, 241.198, 241.739, 242.134, 242.467, 242.864, 243.459, 244.284, 244.883, 235.445, 235.445, 235.445, 235.445, 235.445, 235.445, 235.445, 235.445, 235.445, 235.445, 235.445]) self["N2O"] = numpy.array([ 0.00583999, 0.00408999, 0.00279999, 0.00175999, 0.0009 , 0.00056 , 0.00063 , 0.00079999, 0.00124999, 0.00144999, 0.00156999, 0.00246999, 0.00394998, 0.00493997, 0.00592996, 0.00703996, 0.00885994, 0.01220992, 0.01505991, 0.01560991, 0.01611991, 0.01919989, 0.02343987, 0.02749986, 0.03770982, 0.04834979, 0.05858977, 0.07489974, 0.09278972, 0.1100597 , 0.1265997 , 0.1419997 , 0.1569097 , 0.1713697 , 0.1990496 , 0.2246096 , 0.2487395 , 0.2694695 , 0.2866995 , 0.3030394 , 0.3120394 , 0.3152494 , 0.3152494 , 0.3152494 , 0.3152494 , 0.3152493 , 0.3152492 , 0.3152491 , 0.3152491 , 0.315249 , 0.315249 , 0.315249 , 0.315249 , 0.3152489 , 0.3152489 , 0.3152489 , 0.3152489 , 0.3152489 , 0.3152488 , 0.3152488 , 0.3152488 , 0.3152487 , 0.3152482 , 0.3152468 , 0.315245 , 0.3152431 , 0.3152414 , 0.3152398 , 0.3152381 , 0.3152358 , 0.315233 , 0.3152297 , 0.3152259 , 0.3152213 , 0.3152158 , 0.3152094 , 0.3152032 , 0.3151992 , 0.3151995 , 0.3152058 , 0.3152153 , 0.3152212 , 0.3152217 , 0.3152175 , 0.315208 , 0.3151927 , 0.31517 , 0.3151404 , 0.3151115 , 0.3151024 , 0.3151977 , 0.3151993 , 0.3152007 , 0.3152022 , 0.3152035 , 0.3152049 , 0.3152061 , 0.3152073 , 0.3152085 , 0.3152096 , 0.3152107 ]) self["O3"] = numpy.array([ 0.2179525 , 0.4427619 , 0.8307214 , 1.071126 , 1.107014 , 1.216323 , 1.368551 , 1.55042 , 1.820048 , 2.190766 , 2.597004 , 3.080251 , 3.613488 , 4.076185 , 4.354673 , 4.374823 , 4.346653 , 4.222944 , 4.203744 , 4.306514 , 4.427884 , 4.416705 , 3.941799 , 3.148064 , 2.18333 , 1.231965 , 0.8361127 , 0.6320258 , 0.5055445 , 0.4207969 , 0.3808471 , 0.3781902 , 0.4033912 , 0.4428782 , 0.5194611 , 0.6209939 , 0.7014897 , 0.7363626 , 0.7527296 , 0.7644786 , 0.7908336 , 0.8463225 , 0.8622094 , 0.8290295 , 0.8426624 , 0.9682409 , 1.023447 , 1.010207 , 0.9170352 , 0.8022415 , 0.6979588 , 0.603872 , 0.5141203 , 0.4301826 , 0.3550448 , 0.288998 , 0.2315552 , 0.1832504 , 0.1449635 , 0.1162426 , 0.09470863, 0.07739049, 0.06345754, 0.05288787, 0.04548268, 0.04070251, 0.03783687, 0.03619263, 0.03520797, 0.03466834, 0.03440574, 0.0342611 , 0.03404529, 0.03356474, 0.03271215, 0.03201058, 0.03181097, 0.03218072, 0.03339005, 0.03605744, 0.04019977, 0.04384289, 0.04488666, 0.04469889, 0.04549454, 0.0456743 , 0.04436904, 0.0434255 , 0.04298391, 0.04331422, 0.03472694, 0.03472711, 0.03472727, 0.03472743, 0.03472758, 0.03472773, 0.03472786, 0.034728 , 0.03472813, 0.03472825, 0.03472837]) self["CH4"] = numpy.array([ 0.3025104 , 0.2017365 , 0.1268286 , 0.09570632, 0.207944 , 0.2542325 , 0.2679163 , 0.2839972 , 0.311439 , 0.3420878 , 0.3823386 , 0.4305423 , 0.483456 , 0.5286897 , 0.5675275 , 0.5945863 , 0.6171152 , 0.6321481 , 0.64319 , 0.6320972 , 0.6215293 , 0.6218035 , 0.6272516 , 0.6324708 , 0.6670328 , 0.7040839 , 0.7397381 , 0.8120262 , 0.8943883 , 0.9500525 , 1.009798 , 1.073758 , 1.142078 , 1.196758 , 1.249428 , 1.299148 , 1.344888 , 1.385477 , 1.407137 , 1.429967 , 1.454007 , 1.479277 , 1.505797 , 1.544097 , 1.579537 , 1.616597 , 1.646126 , 1.670465 , 1.692875 , 1.702655 , 1.712824 , 1.716834 , 1.719454 , 1.721334 , 1.722394 , 1.723464 , 1.724494 , 1.725554 , 1.725644 , 1.725753 , 1.725553 , 1.725293 , 1.72479 , 1.724173 , 1.723753 , 1.723452 , 1.723333 , 1.723354 , 1.723415 , 1.723502 , 1.723607 , 1.723709 , 1.723718 , 1.723693 , 1.723523 , 1.723298 , 1.722944 , 1.722572 , 1.722194 , 1.721858 , 1.72152 , 1.721163 , 1.720755 , 1.720323 , 1.719891 , 1.719478 , 1.719064 , 1.718602 , 1.718255 , 1.718115 , 1.718565 , 1.718523 , 1.718491 , 1.718469 , 1.718467 , 1.718464 , 1.718471 , 1.718477 , 1.718484 , 1.71849 , 1.718496 ]) self["CTP"] = 500.0 self["CFRACTION"] = 0.0 self["IDG"] = 0 self["ISH"] = 0 self["ELEVATION"] = 0.0 self["S2M"]["T"] = 235.445 self["S2M"]["Q"] = 124.79842341 self["S2M"]["O"] = 0.0347283654138 self["S2M"]["P"] = 813.02338 self["S2M"]["U"] = 0.0 self["S2M"]["V"] = 0.0 self["S2M"]["WFETC"] = 100000.0 self["SKIN"]["SURFTYPE"] = 0 self["SKIN"]["WATERTYPE"] = 1 self["SKIN"]["T"] = 235.445 self["SKIN"]["SALINITY"] = 35.0 self["SKIN"]["FOAM_FRACTION"] = 0.0 self["SKIN"]["FASTEM"] = numpy.array([ 3. , 5. , 15. , 0.1, 0.3]) self["ZENANGLE"] = 0.0 self["AZANGLE"] = 0.0 self["SUNZENANGLE"] = 0.0 self["SUNAZANGLE"] = 0.0 self["LATITUDE"] = -66.896 self["GAS_UNITS"] = 2 self["BE"] = 0.0 self["COSBK"] = 0.0 self["DATE"] = numpy.array([2006, 9, 1]) self["TIME"] = numpy.array([0, 0, 0])
""" Profile ../profile-datasets-py/div83/010.py file automaticaly created by prof_gen.py script """ self['ID'] = '../profile-datasets-py/div83/010.py' self['Q'] = numpy.array([2.095776, 2.465104, 3.1296, 3.963974, 5.003875, 5.921015, 6.371809, 6.473068, 6.457728, 6.408619, 6.31879, 6.221031, 6.186012, 6.208811, 6.248791, 6.249351, 6.238571, 6.208811, 6.148072, 6.044683, 5.886575, 5.628238, 5.349561, 5.054794, 4.733978, 4.362401, 3.939184, 3.492948, 3.046111, 2.642203, 2.323985, 2.093356, 1.938136, 1.855297, 1.823937, 1.825827, 1.847347, 1.870697, 1.873936, 1.853107, 1.814007, 1.790617, 1.804607, 1.857837, 1.941866, 2.129285, 2.500164, 2.836112, 3.006931, 3.12847, 3.21225, 3.262739, 3.303259, 3.347139, 3.362529, 3.373449, 3.415948, 3.515398, 3.662857, 3.802286, 3.875425, 3.993384, 5.670948, 10.0286, 15.87335, 21.89402, 27.33565, 32.30636, 37.82687, 45.09077, 53.92039, 64.31746, 76.55004, 91.06231, 108.4872, 128.7134, 148.5269, 161.091, 160.1943, 140.2593, 110.2268, 91.40125, 89.92581, 103.0884, 133.1153, 181.622, 253.6816, 347.6251, 439.19, 468.0418, 165.9215, 160.9761, 156.2436, 151.711, 147.3693, 143.2085, 139.2176, 135.3897, 131.7156, 128.1876, 124.7984]) self['P'] = numpy.array([0.005, 0.0161, 0.0384, 0.0769, 0.137, 0.2244, 0.3454, 0.5064, 0.714, 0.9753, 1.2972, 1.6872, 2.1526, 2.7009, 3.3398, 4.077, 4.9204, 5.8776, 6.9567, 8.1655, 9.5119, 11.0038, 12.6492, 14.4559, 16.4318, 18.5847, 20.9224, 23.4526, 26.1829, 29.121, 32.2744, 35.6505, 39.2566, 43.1001, 47.1882, 51.5278, 56.126, 60.9895, 66.1253, 71.5398, 77.2396, 83.231, 89.5204, 96.1138, 103.017, 110.237, 117.778, 125.646, 133.846, 142.385, 151.266, 160.496, 170.078, 180.018, 190.32, 200.989, 212.028, 223.442, 235.234, 247.408, 259.969, 272.919, 286.262, 300.0, 314.137, 328.675, 343.618, 358.966, 374.724, 390.893, 407.474, 424.47, 441.882, 459.712, 477.961, 496.63, 515.72, 535.232, 555.167, 575.525, 596.306, 617.511, 639.14, 661.192, 683.667, 706.565, 729.886, 753.628, 777.79, 802.371, 827.371, 852.788, 878.62, 904.866, 931.524, 958.591, 986.067, 1013.95, 1042.23, 1070.92, 1100.0]) self['CO2'] = numpy.array([373.3942, 373.3941, 373.3938, 373.3935, 373.3921, 373.3918, 373.3946, 373.4036, 373.4146, 373.4426, 373.4896, 373.5487, 373.6167, 373.7457, 373.8797, 373.9647, 373.9937, 373.9477, 373.8447, 373.7057, 373.5698, 373.4619, 373.359, 373.2451, 373.1282, 373.0064, 372.9185, 372.8307, 372.7759, 372.719, 372.6741, 372.6262, 372.6273, 372.6313, 372.6903, 372.7783, 372.8793, 373.0013, 373.1303, 373.2973, 373.4763, 373.7093, 374.0053, 374.3173, 374.6923, 375.0842, 375.5021, 375.9429, 376.3999, 376.8598, 377.3388, 377.8728, 378.4337, 378.9727, 379.4857, 379.9377, 380.1537, 380.3697, 380.4166, 380.4656, 380.4875, 380.5065, 380.5098, 380.5082, 380.497, 380.4827, 380.4586, 380.4307, 380.3936, 380.3518, 380.3065, 380.2585, 380.2139, 380.1684, 380.1278, 380.0871, 380.0505, 380.0208, 379.9991, 379.9867, 379.9801, 379.9713, 379.9658, 379.9588, 379.9484, 379.939, 379.9266, 379.9019, 379.8731, 379.8501, 379.9549, 379.9488, 379.9446, 379.9423, 379.943, 379.9446, 379.9461, 379.9476, 379.9489, 379.9503, 379.9516]) self['CO'] = numpy.array([0.6800446, 0.6740193, 0.6620749, 0.6419505, 0.6117519, 0.5703516, 0.3488468, 0.0930345, 0.08980432, 0.07642571, 0.05501905, 0.03542598, 0.02273726, 0.0167016, 0.01458811, 0.01381391, 0.01293702, 0.01186053, 0.01089353, 0.01022694, 0.01013334, 0.01029874, 0.01054954, 0.01068985, 0.01095735, 0.01133045, 0.01198095, 0.01272726, 0.01303036, 0.01325816, 0.01226177, 0.01127788, 0.01024268, 0.00924114, 0.00879343, 0.0085742, 0.00847924, 0.00867004, 0.00887618, 0.00923515, 0.009644, 0.01013538, 0.01072998, 0.01139158, 0.01216398, 0.01302787, 0.01413626, 0.01550166, 0.01705575, 0.01879384, 0.02078993, 0.02289143, 0.02525062, 0.02788281, 0.0308218, 0.03392959, 0.03658498, 0.03948956, 0.04125235, 0.04315494, 0.04419713, 0.04516932, 0.04572824, 0.04618014, 0.04645236, 0.04665698, 0.04677772, 0.04686359, 0.04688663, 0.04688609, 0.04686017, 0.04682749, 0.04676122, 0.04669305, 0.04663384, 0.0465858, 0.04655648, 0.0465376, 0.04652345, 0.04650948, 0.04649977, 0.04649525, 0.04650932, 0.0465258, 0.0465483, 0.04657384, 0.04658478, 0.04656421, 0.04653585, 0.04651032, 0.04650158, 0.04647112, 0.04638355, 0.0461135, 0.04584094, 0.04556567, 0.04528799, 0.04500801, 0.04472571, 0.0444411, 0.04415449]) self['T'] = numpy.array([203.241, 210.063, 221.314, 233.602, 248.271, 261.577, 272.444, 278.371, 278.595, 275.594, 270.871, 263.75, 255.163, 246.655, 238.909, 231.799, 223.896, 217.482, 212.546, 208.833, 205.703, 202.946, 200.522, 198.582, 197.057, 195.619, 194.223, 193.349, 192.952, 192.888, 192.912, 192.728, 192.467, 192.507, 192.821, 193.133, 193.235, 193.199, 193.315, 193.791, 194.586, 195.302, 195.506, 195.217, 195.025, 195.515, 196.602, 197.901, 199.067, 199.978, 200.682, 201.276, 201.715, 201.971, 202.121, 202.333, 202.75, 203.402, 204.24, 205.206, 206.259, 207.357, 208.502, 209.714, 211.033, 212.487, 214.102, 215.888, 217.825, 219.839, 221.862, 223.857, 225.812, 227.74, 229.66, 231.591, 233.507, 235.332, 236.977, 238.377, 239.532, 240.469, 241.198, 241.739, 242.134, 242.467, 242.864, 243.459, 244.284, 244.883, 235.445, 235.445, 235.445, 235.445, 235.445, 235.445, 235.445, 235.445, 235.445, 235.445, 235.445]) self['N2O'] = numpy.array([0.00583999, 0.00408999, 0.00279999, 0.00175999, 0.0009, 0.00056, 0.00063, 0.00079999, 0.00124999, 0.00144999, 0.00156999, 0.00246999, 0.00394998, 0.00493997, 0.00592996, 0.00703996, 0.00885994, 0.01220992, 0.01505991, 0.01560991, 0.01611991, 0.01919989, 0.02343987, 0.02749986, 0.03770982, 0.04834979, 0.05858977, 0.07489974, 0.09278972, 0.1100597, 0.1265997, 0.1419997, 0.1569097, 0.1713697, 0.1990496, 0.2246096, 0.2487395, 0.2694695, 0.2866995, 0.3030394, 0.3120394, 0.3152494, 0.3152494, 0.3152494, 0.3152494, 0.3152493, 0.3152492, 0.3152491, 0.3152491, 0.315249, 0.315249, 0.315249, 0.315249, 0.3152489, 0.3152489, 0.3152489, 0.3152489, 0.3152489, 0.3152488, 0.3152488, 0.3152488, 0.3152487, 0.3152482, 0.3152468, 0.315245, 0.3152431, 0.3152414, 0.3152398, 0.3152381, 0.3152358, 0.315233, 0.3152297, 0.3152259, 0.3152213, 0.3152158, 0.3152094, 0.3152032, 0.3151992, 0.3151995, 0.3152058, 0.3152153, 0.3152212, 0.3152217, 0.3152175, 0.315208, 0.3151927, 0.31517, 0.3151404, 0.3151115, 0.3151024, 0.3151977, 0.3151993, 0.3152007, 0.3152022, 0.3152035, 0.3152049, 0.3152061, 0.3152073, 0.3152085, 0.3152096, 0.3152107]) self['O3'] = numpy.array([0.2179525, 0.4427619, 0.8307214, 1.071126, 1.107014, 1.216323, 1.368551, 1.55042, 1.820048, 2.190766, 2.597004, 3.080251, 3.613488, 4.076185, 4.354673, 4.374823, 4.346653, 4.222944, 4.203744, 4.306514, 4.427884, 4.416705, 3.941799, 3.148064, 2.18333, 1.231965, 0.8361127, 0.6320258, 0.5055445, 0.4207969, 0.3808471, 0.3781902, 0.4033912, 0.4428782, 0.5194611, 0.6209939, 0.7014897, 0.7363626, 0.7527296, 0.7644786, 0.7908336, 0.8463225, 0.8622094, 0.8290295, 0.8426624, 0.9682409, 1.023447, 1.010207, 0.9170352, 0.8022415, 0.6979588, 0.603872, 0.5141203, 0.4301826, 0.3550448, 0.288998, 0.2315552, 0.1832504, 0.1449635, 0.1162426, 0.09470863, 0.07739049, 0.06345754, 0.05288787, 0.04548268, 0.04070251, 0.03783687, 0.03619263, 0.03520797, 0.03466834, 0.03440574, 0.0342611, 0.03404529, 0.03356474, 0.03271215, 0.03201058, 0.03181097, 0.03218072, 0.03339005, 0.03605744, 0.04019977, 0.04384289, 0.04488666, 0.04469889, 0.04549454, 0.0456743, 0.04436904, 0.0434255, 0.04298391, 0.04331422, 0.03472694, 0.03472711, 0.03472727, 0.03472743, 0.03472758, 0.03472773, 0.03472786, 0.034728, 0.03472813, 0.03472825, 0.03472837]) self['CH4'] = numpy.array([0.3025104, 0.2017365, 0.1268286, 0.09570632, 0.207944, 0.2542325, 0.2679163, 0.2839972, 0.311439, 0.3420878, 0.3823386, 0.4305423, 0.483456, 0.5286897, 0.5675275, 0.5945863, 0.6171152, 0.6321481, 0.64319, 0.6320972, 0.6215293, 0.6218035, 0.6272516, 0.6324708, 0.6670328, 0.7040839, 0.7397381, 0.8120262, 0.8943883, 0.9500525, 1.009798, 1.073758, 1.142078, 1.196758, 1.249428, 1.299148, 1.344888, 1.385477, 1.407137, 1.429967, 1.454007, 1.479277, 1.505797, 1.544097, 1.579537, 1.616597, 1.646126, 1.670465, 1.692875, 1.702655, 1.712824, 1.716834, 1.719454, 1.721334, 1.722394, 1.723464, 1.724494, 1.725554, 1.725644, 1.725753, 1.725553, 1.725293, 1.72479, 1.724173, 1.723753, 1.723452, 1.723333, 1.723354, 1.723415, 1.723502, 1.723607, 1.723709, 1.723718, 1.723693, 1.723523, 1.723298, 1.722944, 1.722572, 1.722194, 1.721858, 1.72152, 1.721163, 1.720755, 1.720323, 1.719891, 1.719478, 1.719064, 1.718602, 1.718255, 1.718115, 1.718565, 1.718523, 1.718491, 1.718469, 1.718467, 1.718464, 1.718471, 1.718477, 1.718484, 1.71849, 1.718496]) self['CTP'] = 500.0 self['CFRACTION'] = 0.0 self['IDG'] = 0 self['ISH'] = 0 self['ELEVATION'] = 0.0 self['S2M']['T'] = 235.445 self['S2M']['Q'] = 124.79842341 self['S2M']['O'] = 0.0347283654138 self['S2M']['P'] = 813.02338 self['S2M']['U'] = 0.0 self['S2M']['V'] = 0.0 self['S2M']['WFETC'] = 100000.0 self['SKIN']['SURFTYPE'] = 0 self['SKIN']['WATERTYPE'] = 1 self['SKIN']['T'] = 235.445 self['SKIN']['SALINITY'] = 35.0 self['SKIN']['FOAM_FRACTION'] = 0.0 self['SKIN']['FASTEM'] = numpy.array([3.0, 5.0, 15.0, 0.1, 0.3]) self['ZENANGLE'] = 0.0 self['AZANGLE'] = 0.0 self['SUNZENANGLE'] = 0.0 self['SUNAZANGLE'] = 0.0 self['LATITUDE'] = -66.896 self['GAS_UNITS'] = 2 self['BE'] = 0.0 self['COSBK'] = 0.0 self['DATE'] = numpy.array([2006, 9, 1]) self['TIME'] = numpy.array([0, 0, 0])
class Protocol: def __init__(self, data): self.iniciator = data.get('iniciator', {}) self.responder = data.get('responder', {})
class Protocol: def __init__(self, data): self.iniciator = data.get('iniciator', {}) self.responder = data.get('responder', {})
N = int(input()) t_list = [int(input()) for _ in range(N)] if N == 1: print(t_list[0]) exit() ans = float("inf") for bit in range(2 ** N): one = 0 zero = 0 for j in range(N): if 1 & bit >> j: one += t_list[j] else: zero += t_list[j] ans = min(ans, max(one, zero)) print(ans)
n = int(input()) t_list = [int(input()) for _ in range(N)] if N == 1: print(t_list[0]) exit() ans = float('inf') for bit in range(2 ** N): one = 0 zero = 0 for j in range(N): if 1 & bit >> j: one += t_list[j] else: zero += t_list[j] ans = min(ans, max(one, zero)) print(ans)
""" This script is used for course notes. Author: Erick Marin Date: 11/28/2020 """ # Creating a file object and assigning a variable. file = open("Course_2/Week_2/spider.txt") # The operating system checks that we have permissions to access that file and # then gives our code a file descriptor. This is a token generated by the OS # that allows programs to do more operations with the file. This file # descriptor is stored as an attribute of the files object. The file object # gives us a bunch of methods that we can use to operate with the file. print(file.readline()) # each time we call the readline method, the file object updates the current # position in the file. So it keeps moving forward. We can also call the read # method, which reads from the current position until the end of the file # instead of just one line. print(file.readline()) # The read method starts reading from wherever we currently are in the file. # But instead of just one line, it reads all the way through to the files end. print(file.read()) # Then we close the file. Open-use-close pattern. file.close() # To help us remember to close the file after at the we're done using it, # Python lets us create a block of code by using the keyword "with". When we # use a "with" block, Python will automatically close the file. So we don't # need to remember to do that ourselves. with open("Course_2/Week_2/spider.txt") as file: print(file.readline())
""" This script is used for course notes. Author: Erick Marin Date: 11/28/2020 """ file = open('Course_2/Week_2/spider.txt') print(file.readline()) print(file.readline()) print(file.read()) file.close() with open('Course_2/Week_2/spider.txt') as file: print(file.readline())
# This controls how frequently the whole batch is iterated over vs only # {QUICK_EVAL_PERCENT} of the data QUICK_EVAL_FREQUENCY = 0 QUICK_EVAL_PERCENT = 0.05 QUICK_EVAL_TRAIN_PERCENT = 0.025 def train( device, model, manifold, dimension, data, optimizer, loss_params, n_epochs, eval_every, sample_neighbors_every, lr_scheduler, shared_params, thread_number, feature_manifold, conformal_loss_params, tensorboard_watch={}, eval_data=None ): batch_num = 0 reporter = MemReporter() for epoch in range(1, n_epochs + 1): batch_losses = [] if conformal_loss_params is not None: batch_conf_losses = [] t_start = timeit.default_timer() if (epoch - 1) % sample_neighbors_every == 0 and thread_number == 0: optimizer.zero_grad() inputs = None graph_dists = None conf_loss = None loss = None # import gc; gc.collect() # torch.cuda.empty_cache() with torch.no_grad(): model.to(device) nns = data.refresh_manifold_nn(model.get_embedding_matrix(), manifold, return_nns=True) if eval_data is not None: eval_data.refresh_manifold_nn(model.get_embedding_matrix(), manifold, manifold_nns=nns) if epoch > 1: syn_acc, sem_acc = embed_eval.eval_analogy(model, manifold, nns) write_tensorboard('add_scalar', ['syn_acc', syn_acc, epoch - 1]) write_tensorboard('add_scalar', ['sem_acc', sem_acc, epoch - 1]) # import gc; gc.collect() # torch.cuda.empty_cache() data_iterator = tqdm(data) if thread_number == 0 else data for batch in data_iterator: if batch_num % eval_every == 0 and thread_number == 0: mean_loss = 0 # float(np.mean(batch_losses)) use to eval every batch setting this to zero as its only used for printing output savable_model = model.get_savable_model() save_data = { 'epoch': epoch } if data.features is not None: save_data["features"] = data.features if model.get_additional_embeddings() is not None: save_data[ "additional_embeddings_state_dict"] = model.get_additional_embeddings().state_dict() if hasattr(model, "main_deltas"): save_data["main_deltas_state_dict"] = model.main_deltas.state_dict() if hasattr(model, "additional_deltas"): save_data[ "additional_deltas_state_dict"] = model.additional_deltas.state_dict() save_data["deltas"] = model.deltas save_data.update(shared_params) path = save_model(savable_model, save_data) elapsed = 0 # Used to eval every batch setting this to zero as its only used for printing output # embed_eval.eval_wordsim_benchmarks(model, manifold, device=device, iteration=batch_num) if eval_data is not None: with torch.no_grad(): hitsat10 = 0 rank_sum = 0 rec_rank_sum = 0 num_ranks = 0 if QUICK_EVAL_FREQUENCY > 0 and batch_num % ( eval_every * QUICK_EVAL_FREQUENCY) == 0: eval_data.data_fraction = 1 total_eval = True else: eval_data.data_fraction = QUICK_EVAL_PERCENT total_eval = False eval_data.compute_train_ranks = False for eval_batch in tqdm(eval_data): inputs, graph_dists = eval_batch inputs = inputs.to(device) graph_dists = graph_dists.to(device) input_embeddings = model(inputs) sample_vertices = input_embeddings.narrow(1, 1, input_embeddings.size(1) - 1) main_vertices = input_embeddings.narrow(1, 0, 1).expand_as( sample_vertices) manifold_dists = manifold.dist(main_vertices, sample_vertices) sorted_indices = manifold_dists.argsort(dim=-1) manifold_dists_sorted = torch.gather(manifold_dists, -1, sorted_indices) n_neighbors = (graph_dists < 2).sum(dim=-1) batch_nums, neighbor_ranks = ( sorted_indices < n_neighbors.unsqueeze(1)).nonzero( as_tuple=True) neighbor_ranks += 1 adjust_indices = torch.arange(n_neighbors.max()) neighbor_adjustements = torch.cat( [adjust_indices[:n_neighbors[i]] for i in range(n_neighbors.size(0))]) neighbor_ranks -= neighbor_adjustements.to(device) neighbor_ranks = neighbor_ranks.float() rec_ranks = 1 / neighbor_ranks hitsat10 += (neighbor_ranks <= 10).sum().cpu().numpy() rank_sum += neighbor_ranks.sum().cpu().numpy() rec_rank_sum += rec_ranks.sum().cpu().numpy() num_ranks += neighbor_ranks.size(0) mean_rank = rank_sum / num_ranks mean_rec_rank = rec_rank_sum / num_ranks hitsat10 = hitsat10 / num_ranks postfix = "_approx" if total_eval: postfix = "" write_tensorboard('add_scalar', [f'mean_rank{postfix}', mean_rank, batch_num]) write_tensorboard('add_scalar', [f'mean_rec_rank{postfix}', mean_rec_rank, batch_num]) write_tensorboard('add_scalar', [f'hitsat10{postfix}', hitsat10, batch_num]) if eval_data.is_eval: hitsat10 = 0 rank_sum = 0 rec_rank_sum = 0 num_ranks = 0 eval_data.data_fraction = QUICK_EVAL_TRAIN_PERCENT eval_data.compute_train_ranks = True for eval_batch in tqdm(eval_data): inputs, graph_dists = eval_batch inputs = inputs.to(device) graph_dists = graph_dists.to(device) input_embeddings = model(inputs) sample_vertices = input_embeddings.narrow(1, 1, input_embeddings.size( 1) - 1) main_vertices = input_embeddings.narrow(1, 0, 1).expand_as( sample_vertices) manifold_dists = manifold.dist(main_vertices, sample_vertices) sorted_indices = manifold_dists.argsort(dim=-1) manifold_dists_sorted = torch.gather(manifold_dists, -1, sorted_indices) n_neighbors = (graph_dists < 2).sum(dim=-1) batch_nums, neighbor_ranks = ( sorted_indices < n_neighbors.unsqueeze(1)).nonzero( as_tuple=True) neighbor_ranks += 1 adjust_indices = torch.arange(n_neighbors.max()) neighbor_adjustements = torch.cat( [adjust_indices[:n_neighbors[i]] for i in range(n_neighbors.size(0))]) neighbor_ranks -= neighbor_adjustements.to(device) neighbor_ranks = neighbor_ranks.float() rec_ranks = 1 / neighbor_ranks hitsat10 += (neighbor_ranks <= 10).sum().cpu().numpy() rank_sum += neighbor_ranks.sum().cpu().numpy() rec_rank_sum += rec_ranks.sum().cpu().numpy() num_ranks += neighbor_ranks.size(0) mean_rank = rank_sum / num_ranks mean_rec_rank = rec_rank_sum / num_ranks hitsat10 = hitsat10 / num_ranks write_tensorboard('add_scalar', [f'mean_rank_train', mean_rank, batch_num]) write_tensorboard('add_scalar', [f'mean_rec_rank_train', mean_rec_rank, batch_num]) write_tensorboard('add_scalar', [f'hitsat10_train', hitsat10, batch_num]) del manifold_dists, manifold_dists_sorted, sample_vertices, main_vertices, input_embeddings # import gc;gc.collect() # torch.cuda.empty_cache() print(model) reporter.report() conf_loss = None delta_loss = None inputs, graph_dists = batch inputs = inputs.to(device) graph_dists = graph_dists.to(device) optimizer.zero_grad() rand_val = random.random() optimizing_model = False if hasattr(model, "get_additional_embeddings"): if rand_val > .6: optimizing_model = False optimizing_deltas = False # model.deltas = True for p in model.parameters(): p.requires_grad = False for p in model.get_additional_embeddings().parameters(): p.requires_grad = True if model.deltas: for p in model.main_deltas.parameters(): p.requires_grad = False if hasattr(model, "additional_deltas"): for p in model.additional_deltas.parameters(): p.requires_grad = False # elif rand_val > 0.3: elif rand_val > 0: optimizing_model = True optimizing_deltas = False # model.deltas = True for p in model.parameters(): p.requires_grad = True for p in model.get_additional_embeddings().parameters(): p.requires_grad = False if model.deltas: for p in model.main_deltas.parameters(): p.requires_grad = False if hasattr(model, "additional_deltas"): for p in model.additional_deltas.parameters(): p.requires_grad = False else: optimizing_model = False optimizing_deltas = True model.deltas = True for p in model.parameters(): p.requires_grad = False for p in model.get_additional_embeddings().parameters(): p.requires_grad = False if model.deltas: for p in model.main_deltas.parameters(): p.requires_grad = True if hasattr(model, "additional_deltas"): for p in model.additional_deltas.parameters(): p.requires_grad = True loss = 0.01 * manifold_dist_loss_relu_sum(model, inputs, graph_dists, manifold, **loss_params) loss.backward() loss_grad_norm = optimizer.step() batch_losses.append(loss.cpu().detach().numpy()) del loss # import gc;gc.collect() # torch.cuda.empty_cache() if optimizing_model and hasattr(model, 'embedding_model') and conformal_loss_params is not None and epoch % \ conformal_loss_params["update_every"] == 0: optimizer.zero_grad() main_inputs = inputs.narrow(1, 0, 1).squeeze(1).clone().detach() perm = torch.randperm(main_inputs.size(0)) idx = perm[:conformal_loss_params["num_samples"]] main_inputs = main_inputs[idx] # model.deltas = False conf_loss = 0.5 * metric_loss(model, main_inputs, feature_manifold, manifold, dimension, isometric=conformal_loss_params["isometric"], random_samples=conformal_loss_params[ "random_samples"], random_init=conformal_loss_params["random_init"]) conf_loss.backward() conf_loss_grad_norm = optimizer.step() batch_conf_losses.append(conf_loss.cpu().detach().numpy()) if thread_number == 0: write_tensorboard('add_scalar', ['minibatch_conf_loss', float(batch_conf_losses[-1]), batch_num]) write_tensorboard('add_scalar', ['conf_loss_gradient_norm', conf_loss_grad_norm, batch_num]) del conf_loss # import gc;gc.collect() # torch.cuda.empty_cache() # model.deltas = True if hasattr(model, 'main_deltas') and optimizing_deltas: main_inputs = inputs.view(inputs.shape[0], -1) vals = model.main_deltas( model.index_map[main_inputs][model.index_map[main_inputs] >= 0]) mean_deltas = torch.mean(torch.norm(vals, dim=-1)) delta_loss = 0.03 * torch.sum(torch.norm(vals, dim=-1) ** 2) ''' total_loss = None if conformal_loss_params is not None and conf_loss is not None: total_loss = (1 - conformal_loss_params["weight"]) * loss + conformal_loss_params["weight"] * conf_loss if delta_loss is not None: # total_loss += delta_loss pass total_loss.backward() else: if conformal_loss_params is not None: scaled_loss = (1 - conformal_loss_params["weight"]) * loss else: scaled_loss = loss if delta_loss is not None: scaled_loss += delta_loss scaled_loss.backward() ''' if thread_number == 0: write_tensorboard('add_scalar', ['minibatch_loss', float(batch_losses[-1]), batch_num]) write_tensorboard('add_scalar', ['gradient_norm', loss_grad_norm, batch_num]) ''' if total_loss is not None: write_tensorboard('add_scalar', ['minibatch_total_loss', total_loss.cpu().detach().numpy(), batch_num]) ''' if delta_loss is not None: write_tensorboard('add_scalar', ['minibatch_delta_loss', delta_loss.cpu().detach().numpy(), batch_num]) write_tensorboard('add_scalar', ['minibatch_delta_mean', mean_deltas.cpu().detach().numpy(), batch_num]) for name, value in tensorboard_watch.items(): write_tensorboard('add_scalar', [name, value.cpu().detach().numpy(), batch_num]) elapsed = timeit.default_timer() - t_start batch_num += 1 mean_loss = float(np.mean(batch_losses)) if thread_number == 0: if conformal_loss_params is not None and len(batch_conf_losses) > 0: mean_conf_loss = float(np.mean(batch_conf_losses)) metric_loss_type = "isometric" if conformal_loss_params[ "isometric"] else "conformal" write_tensorboard('add_scalar', [f'batch_{metric_loss_type}_loss', mean_conf_loss, epoch]) write_tensorboard('add_scalar', ['batch_loss', mean_loss, epoch]) write_tensorboard('add_scalar', ['learning_rate', lr_scheduler.get_lr()[0], epoch]) lr_scheduler.step()
quick_eval_frequency = 0 quick_eval_percent = 0.05 quick_eval_train_percent = 0.025 def train(device, model, manifold, dimension, data, optimizer, loss_params, n_epochs, eval_every, sample_neighbors_every, lr_scheduler, shared_params, thread_number, feature_manifold, conformal_loss_params, tensorboard_watch={}, eval_data=None): batch_num = 0 reporter = mem_reporter() for epoch in range(1, n_epochs + 1): batch_losses = [] if conformal_loss_params is not None: batch_conf_losses = [] t_start = timeit.default_timer() if (epoch - 1) % sample_neighbors_every == 0 and thread_number == 0: optimizer.zero_grad() inputs = None graph_dists = None conf_loss = None loss = None with torch.no_grad(): model.to(device) nns = data.refresh_manifold_nn(model.get_embedding_matrix(), manifold, return_nns=True) if eval_data is not None: eval_data.refresh_manifold_nn(model.get_embedding_matrix(), manifold, manifold_nns=nns) if epoch > 1: (syn_acc, sem_acc) = embed_eval.eval_analogy(model, manifold, nns) write_tensorboard('add_scalar', ['syn_acc', syn_acc, epoch - 1]) write_tensorboard('add_scalar', ['sem_acc', sem_acc, epoch - 1]) data_iterator = tqdm(data) if thread_number == 0 else data for batch in data_iterator: if batch_num % eval_every == 0 and thread_number == 0: mean_loss = 0 savable_model = model.get_savable_model() save_data = {'epoch': epoch} if data.features is not None: save_data['features'] = data.features if model.get_additional_embeddings() is not None: save_data['additional_embeddings_state_dict'] = model.get_additional_embeddings().state_dict() if hasattr(model, 'main_deltas'): save_data['main_deltas_state_dict'] = model.main_deltas.state_dict() if hasattr(model, 'additional_deltas'): save_data['additional_deltas_state_dict'] = model.additional_deltas.state_dict() save_data['deltas'] = model.deltas save_data.update(shared_params) path = save_model(savable_model, save_data) elapsed = 0 if eval_data is not None: with torch.no_grad(): hitsat10 = 0 rank_sum = 0 rec_rank_sum = 0 num_ranks = 0 if QUICK_EVAL_FREQUENCY > 0 and batch_num % (eval_every * QUICK_EVAL_FREQUENCY) == 0: eval_data.data_fraction = 1 total_eval = True else: eval_data.data_fraction = QUICK_EVAL_PERCENT total_eval = False eval_data.compute_train_ranks = False for eval_batch in tqdm(eval_data): (inputs, graph_dists) = eval_batch inputs = inputs.to(device) graph_dists = graph_dists.to(device) input_embeddings = model(inputs) sample_vertices = input_embeddings.narrow(1, 1, input_embeddings.size(1) - 1) main_vertices = input_embeddings.narrow(1, 0, 1).expand_as(sample_vertices) manifold_dists = manifold.dist(main_vertices, sample_vertices) sorted_indices = manifold_dists.argsort(dim=-1) manifold_dists_sorted = torch.gather(manifold_dists, -1, sorted_indices) n_neighbors = (graph_dists < 2).sum(dim=-1) (batch_nums, neighbor_ranks) = (sorted_indices < n_neighbors.unsqueeze(1)).nonzero(as_tuple=True) neighbor_ranks += 1 adjust_indices = torch.arange(n_neighbors.max()) neighbor_adjustements = torch.cat([adjust_indices[:n_neighbors[i]] for i in range(n_neighbors.size(0))]) neighbor_ranks -= neighbor_adjustements.to(device) neighbor_ranks = neighbor_ranks.float() rec_ranks = 1 / neighbor_ranks hitsat10 += (neighbor_ranks <= 10).sum().cpu().numpy() rank_sum += neighbor_ranks.sum().cpu().numpy() rec_rank_sum += rec_ranks.sum().cpu().numpy() num_ranks += neighbor_ranks.size(0) mean_rank = rank_sum / num_ranks mean_rec_rank = rec_rank_sum / num_ranks hitsat10 = hitsat10 / num_ranks postfix = '_approx' if total_eval: postfix = '' write_tensorboard('add_scalar', [f'mean_rank{postfix}', mean_rank, batch_num]) write_tensorboard('add_scalar', [f'mean_rec_rank{postfix}', mean_rec_rank, batch_num]) write_tensorboard('add_scalar', [f'hitsat10{postfix}', hitsat10, batch_num]) if eval_data.is_eval: hitsat10 = 0 rank_sum = 0 rec_rank_sum = 0 num_ranks = 0 eval_data.data_fraction = QUICK_EVAL_TRAIN_PERCENT eval_data.compute_train_ranks = True for eval_batch in tqdm(eval_data): (inputs, graph_dists) = eval_batch inputs = inputs.to(device) graph_dists = graph_dists.to(device) input_embeddings = model(inputs) sample_vertices = input_embeddings.narrow(1, 1, input_embeddings.size(1) - 1) main_vertices = input_embeddings.narrow(1, 0, 1).expand_as(sample_vertices) manifold_dists = manifold.dist(main_vertices, sample_vertices) sorted_indices = manifold_dists.argsort(dim=-1) manifold_dists_sorted = torch.gather(manifold_dists, -1, sorted_indices) n_neighbors = (graph_dists < 2).sum(dim=-1) (batch_nums, neighbor_ranks) = (sorted_indices < n_neighbors.unsqueeze(1)).nonzero(as_tuple=True) neighbor_ranks += 1 adjust_indices = torch.arange(n_neighbors.max()) neighbor_adjustements = torch.cat([adjust_indices[:n_neighbors[i]] for i in range(n_neighbors.size(0))]) neighbor_ranks -= neighbor_adjustements.to(device) neighbor_ranks = neighbor_ranks.float() rec_ranks = 1 / neighbor_ranks hitsat10 += (neighbor_ranks <= 10).sum().cpu().numpy() rank_sum += neighbor_ranks.sum().cpu().numpy() rec_rank_sum += rec_ranks.sum().cpu().numpy() num_ranks += neighbor_ranks.size(0) mean_rank = rank_sum / num_ranks mean_rec_rank = rec_rank_sum / num_ranks hitsat10 = hitsat10 / num_ranks write_tensorboard('add_scalar', [f'mean_rank_train', mean_rank, batch_num]) write_tensorboard('add_scalar', [f'mean_rec_rank_train', mean_rec_rank, batch_num]) write_tensorboard('add_scalar', [f'hitsat10_train', hitsat10, batch_num]) del manifold_dists, manifold_dists_sorted, sample_vertices, main_vertices, input_embeddings print(model) reporter.report() conf_loss = None delta_loss = None (inputs, graph_dists) = batch inputs = inputs.to(device) graph_dists = graph_dists.to(device) optimizer.zero_grad() rand_val = random.random() optimizing_model = False if hasattr(model, 'get_additional_embeddings'): if rand_val > 0.6: optimizing_model = False optimizing_deltas = False for p in model.parameters(): p.requires_grad = False for p in model.get_additional_embeddings().parameters(): p.requires_grad = True if model.deltas: for p in model.main_deltas.parameters(): p.requires_grad = False if hasattr(model, 'additional_deltas'): for p in model.additional_deltas.parameters(): p.requires_grad = False elif rand_val > 0: optimizing_model = True optimizing_deltas = False for p in model.parameters(): p.requires_grad = True for p in model.get_additional_embeddings().parameters(): p.requires_grad = False if model.deltas: for p in model.main_deltas.parameters(): p.requires_grad = False if hasattr(model, 'additional_deltas'): for p in model.additional_deltas.parameters(): p.requires_grad = False else: optimizing_model = False optimizing_deltas = True model.deltas = True for p in model.parameters(): p.requires_grad = False for p in model.get_additional_embeddings().parameters(): p.requires_grad = False if model.deltas: for p in model.main_deltas.parameters(): p.requires_grad = True if hasattr(model, 'additional_deltas'): for p in model.additional_deltas.parameters(): p.requires_grad = True loss = 0.01 * manifold_dist_loss_relu_sum(model, inputs, graph_dists, manifold, **loss_params) loss.backward() loss_grad_norm = optimizer.step() batch_losses.append(loss.cpu().detach().numpy()) del loss if optimizing_model and hasattr(model, 'embedding_model') and (conformal_loss_params is not None) and (epoch % conformal_loss_params['update_every'] == 0): optimizer.zero_grad() main_inputs = inputs.narrow(1, 0, 1).squeeze(1).clone().detach() perm = torch.randperm(main_inputs.size(0)) idx = perm[:conformal_loss_params['num_samples']] main_inputs = main_inputs[idx] conf_loss = 0.5 * metric_loss(model, main_inputs, feature_manifold, manifold, dimension, isometric=conformal_loss_params['isometric'], random_samples=conformal_loss_params['random_samples'], random_init=conformal_loss_params['random_init']) conf_loss.backward() conf_loss_grad_norm = optimizer.step() batch_conf_losses.append(conf_loss.cpu().detach().numpy()) if thread_number == 0: write_tensorboard('add_scalar', ['minibatch_conf_loss', float(batch_conf_losses[-1]), batch_num]) write_tensorboard('add_scalar', ['conf_loss_gradient_norm', conf_loss_grad_norm, batch_num]) del conf_loss if hasattr(model, 'main_deltas') and optimizing_deltas: main_inputs = inputs.view(inputs.shape[0], -1) vals = model.main_deltas(model.index_map[main_inputs][model.index_map[main_inputs] >= 0]) mean_deltas = torch.mean(torch.norm(vals, dim=-1)) delta_loss = 0.03 * torch.sum(torch.norm(vals, dim=-1) ** 2) '\n total_loss = None\n if conformal_loss_params is not None and conf_loss is not None:\n total_loss = (1 - conformal_loss_params["weight"]) * loss + conformal_loss_params["weight"] * conf_loss\n if delta_loss is not None:\n # total_loss += delta_loss\n pass\n total_loss.backward()\n else:\n if conformal_loss_params is not None:\n scaled_loss = (1 - conformal_loss_params["weight"]) * loss\n else:\n scaled_loss = loss\n\n if delta_loss is not None:\n scaled_loss += delta_loss\n scaled_loss.backward()\n ' if thread_number == 0: write_tensorboard('add_scalar', ['minibatch_loss', float(batch_losses[-1]), batch_num]) write_tensorboard('add_scalar', ['gradient_norm', loss_grad_norm, batch_num]) "\n if total_loss is not None:\n write_tensorboard('add_scalar', ['minibatch_total_loss', total_loss.cpu().detach().numpy(), batch_num])\n " if delta_loss is not None: write_tensorboard('add_scalar', ['minibatch_delta_loss', delta_loss.cpu().detach().numpy(), batch_num]) write_tensorboard('add_scalar', ['minibatch_delta_mean', mean_deltas.cpu().detach().numpy(), batch_num]) for (name, value) in tensorboard_watch.items(): write_tensorboard('add_scalar', [name, value.cpu().detach().numpy(), batch_num]) elapsed = timeit.default_timer() - t_start batch_num += 1 mean_loss = float(np.mean(batch_losses)) if thread_number == 0: if conformal_loss_params is not None and len(batch_conf_losses) > 0: mean_conf_loss = float(np.mean(batch_conf_losses)) metric_loss_type = 'isometric' if conformal_loss_params['isometric'] else 'conformal' write_tensorboard('add_scalar', [f'batch_{metric_loss_type}_loss', mean_conf_loss, epoch]) write_tensorboard('add_scalar', ['batch_loss', mean_loss, epoch]) write_tensorboard('add_scalar', ['learning_rate', lr_scheduler.get_lr()[0], epoch]) lr_scheduler.step()
class MyClass: def __init__(self, value): self.__value = value def __int__(self): return int(self.__value) c = MyClass(1.23) print(int(c))
class Myclass: def __init__(self, value): self.__value = value def __int__(self): return int(self.__value) c = my_class(1.23) print(int(c))
# AUTOGENERATED BY NBDEV! DO NOT EDIT! __all__ = ["index", "modules", "custom_doc_links", "git_url"] index = {"component_save_data_fixture": "tst.components.ipynb", "column_transformer_data_fixture": "tst.compose.ipynb", "multi_split_data_fixture": "tst.compose.ipynb", "test_pipeline_find_last_fitted_model_seq_others": "tst.compose.ipynb", "test_pipeline_find_last_fitted_model_parallel_2": "tst.compose.ipynb", "test_data_conversion_sequential_parallel_column_transformer": "tst.compose.ipynb", "example_people_data_fixture": "tst.nbdev_utils.ipynb", "Splitter": "blocks.ipynb", "test_splitter": "blocks.ipynb", "DoubleKFoldBase": "blocks.ipynb", "SingleKFold": "blocks.ipynb", "test_single_kfold": "blocks.ipynb", "FixedDoubleKFold": "blocks.ipynb", "test_fixed_double_kfold": "blocks.ipynb", "SkSplitGenerator": "blocks.ipynb", "test_sksplit_generator": "blocks.ipynb", "PandasEvaluator": "blocks.ipynb", "test_pandas_evaluator": "blocks.ipynb", "OneHotEncoder": "preprocessing.ipynb", "test_one_hot_encoder": "preprocessing.ipynb", "WindowGenerator": "preprocessing.ipynb", "generate_input_for_window_generator": "data_conversion.ipynb", "test_window_generator": "preprocessing.ipynb", "WindowAggregator": "preprocessing.ipynb", "test_window_aggregator": "preprocessing.ipynb", "path_results": "config.bt_defaults.ipynb", "path_models": "config.bt_defaults.ipynb", "path_data": "config.bt_defaults.ipynb", "file_format": "config.bt_defaults.ipynb", "verbose": "config.bt_defaults.ipynb", "name_logger": "config.bt_defaults.ipynb", "save_splits": "config.bt_defaults.ipynb", "group": "config.bt_defaults.ipynb", "error_if_present": "config.bt_defaults.ipynb", "overwrite_field": "config.bt_defaults.ipynb", "mode_logger": "config.bt_defaults.ipynb", "separate_labels": "config.bt_defaults.ipynb", "warning_if_nick_name_exists": "config.bt_defaults.ipynb", "propagate": "config.bt_defaults.ipynb", "path_session_folder": "config.bt_defaults.ipynb", "session_filename": "config.bt_defaults.ipynb", "path_logger_folder": "config.bt_defaults.ipynb", "logger_filename": "config.bt_defaults.ipynb", "logger_null_filename": "config.bt_defaults.ipynb", "stdout_logger": "config.bt_defaults.ipynb", "null_name_logger": "config.bt_defaults.ipynb", "Component": "components.ipynb", "test_component_config": "components.ipynb", "test_component_store_attrs": "components.ipynb", "test_component_aliases": "components.ipynb", "test_component_predict": "components.ipynb", "test_component_multiple_inputs": "components.ipynb", "TransformWithFitApply": "components.ipynb", "TransformWithoutFitApply": "components.ipynb", "test_component_fit_apply": "components.ipynb", "MyDataConverter": "components.ipynb", "TransformWithFitApplyDC": "components.ipynb", "test_component_validation_test": "components.ipynb", "TransformWithoutFitApply2": "components.ipynb", "TransformWithFitApply2": "components.ipynb", "component_save_data": "components.ipynb", "test_component_save_load": "components.ipynb", "Transform1": "compose.ipynb", "test_component_run_depend_on_existence": "components.ipynb", "test_component_logger": "components.ipynb", "test_component_data_converter": "components.ipynb", "test_component_data_io": "components.ipynb", "test_component_equal": "components.ipynb", "test_set_paths": "components.ipynb", "TransformWithoutFit": "components.ipynb", "TransformWithFitApplyOnly": "components.ipynb", "test_determine_fit_function": "components.ipynb", "test_use_fit_from_loaded_estimator": "components.ipynb", "test_direct_methods": "components.ipynb", "test_pass_apply": "components.ipynb", "test_get_specific_data_io_parameters_for_component": "components.ipynb", "test_get_specific_data_io_parameters": "components.ipynb", "test_standard_converter_in_component": "components.ipynb", "test_set_suffix": "compose.ipynb", "SamplingComponent": "components.ipynb", "test_sampling_component": "components.ipynb", "SklearnComponent": "components.ipynb", "PickleSaverComponent": "components.ipynb", "test_sklearn_component": "components.ipynb", "NoSaverComponent": "components.ipynb", "test_no_saver_component": "components.ipynb", "OneClassSklearnComponent": "components.ipynb", "get_data_for_one_class": "components.ipynb", "test_one_class_sklearn_component": "components.ipynb", "PandasComponent": "components.ipynb", "test_pandas_component": "components.ipynb", "MultiComponent": "compose.ipynb", "SimpleMultiComponent": "compose.ipynb", "test_multi_comp_io": "compose.ipynb", "test_multi_comp_desc": "compose.ipynb", "test_athena_pipeline_training": "compose.ipynb", "test_gather_and_save_info": "compose.ipynb", "test_multi_comp_hierarchy": "compose.ipynb", "test_multi_comp_profiling": "compose.ipynb", "test_multi_comp_all_equal": "compose.ipynb", "test_multi_component_setters": "compose.ipynb", "test_show_result_statistics": "compose.ipynb", "test_pass_components": "compose.ipynb", "test_chain_folders": "compose.ipynb", "test_set_root": "compose.ipynb", "test_set_root_2": "compose.ipynb", "test_pass_functions_to_multi_component": "compose.ipynb", "Pipeline": "compose.ipynb", "Sequential": "compose.ipynb", "Transform2": "compose.ipynb", "SimplePipeline": "compose.ipynb", "test_pipeline_fit_apply": "compose.ipynb", "test_pipeline_fit_apply_bis": "compose.ipynb", "test_pipeline_new_comp": "compose.ipynb", "test_pipeline_set_comp": "compose.ipynb", "test_pipeline_load_estimator": "compose.ipynb", "build_pipeline_construct_diagram_1": "compose.ipynb", "build_pipeline_construct_diagram_2": "compose.ipynb", "test_construct_diagram": "compose.ipynb", "test_show_summary": "compose.ipynb", "test_multi_comp_profiling2": "compose.ipynb", "make_pipeline": "compose.ipynb", "test_make_pipeline": "compose.ipynb", "pipeline_factory": "compose.ipynb", "test_pipeline_factory": "compose.ipynb", "PandasPipeline": "compose.ipynb", "PandasTransformWithLabels1": "compose.ipynb", "PandasTransformWithLabels2": "compose.ipynb", "SimplePandasPipeline": "compose.ipynb", "TransformWithLabels1": "compose.ipynb", "TransformWithLabels2": "compose.ipynb", "SimplePandasPipelineNoPandasComponent": "compose.ipynb", "test_pandas_pipeline": "compose.ipynb", "Parallel": "compose.ipynb", "test_parallel": "compose.ipynb", "test_pipeline_find_last_result": "compose.ipynb", "test_pipeline_find_last_result_parallel1": "compose.ipynb", "test_pipeline_find_last_result_parallel2": "compose.ipynb", "test_pipeline_find_last_result_parallel3": "compose.ipynb", "test_pipeline_find_last_fitted_model_seq": "compose.ipynb", "test_pipeline_find_last_fitted_model_parallel": "compose.ipynb", "test_pipeline_find_last_fitted_model_parallel_remove": "compose.ipynb", "MultiModality": "compose.ipynb", "TransformM": "compose.ipynb", "test_multi_modality": "compose.ipynb", "ColumnSelector": "compose.ipynb", "test_column_selector": "compose.ipynb", "Concat": "compose.ipynb", "test_concat": "compose.ipynb", "ColumnTransformer": "compose.ipynb", "Identity": "compose.ipynb", "test_identity": "compose.ipynb", "make_column_transformer_pipelines": "compose.ipynb", "make_column_transformer": "compose.ipynb", "column_transformer_data": "compose.ipynb", "test_make_column_transformer": "compose.ipynb", "test_make_column_transformer_passthrough": "compose.ipynb", "test_make_column_transformer_remainder": "compose.ipynb", "test_make_column_transformer_descendants": "compose.ipynb", "test_make_column_transformer_fit_transform": "compose.ipynb", "MultiSplitComponent": "compose.ipynb", "MultiSplitDict": "compose.ipynb", "multi_split_data": "compose.ipynb", "test_multi_split_transform": "compose.ipynb", "test_multi_split_fit": "compose.ipynb", "test_multi_split_chain": "compose.ipynb", "test_multi_split_io": "compose.ipynb", "test_multi_split_non_dict": "compose.ipynb", "test_multi_split_non_dict_bis": "compose.ipynb", "MultiSplitDFColumn": "compose.ipynb", "multi_split_data_df_column": "compose.ipynb", "test_multi_split_df_column_transform": "compose.ipynb", "test_multi_split_df_column_fit": "compose.ipynb", "ParallelInstances": "compose.ipynb", "CrossValidator": "compose.ipynb", "test_cross_validator_1": "compose.ipynb", "test_cross_validator_2": "compose.ipynb", "test_cross_validator_3": "compose.ipynb", "DataConverter": "data_conversion.ipynb", "test_data_converter_functions": "data_conversion.ipynb", "NoConverter": "data_conversion.ipynb", "test_no_converter": "data_conversion.ipynb", "GenericConverter": "data_conversion.ipynb", "test_generic_converter": "data_conversion.ipynb", "StandardConverter": "data_conversion.ipynb", "test_standard_converter": "data_conversion.ipynb", "PandasConverter": "data_conversion.ipynb", "test_pandas_converter": "data_conversion.ipynb", "Window2Dto3Dconverter": "data_conversion.ipynb", "test_window2d_to_3d_converter": "data_conversion.ipynb", "data_converter_factory": "data_conversion.ipynb", "test_data_converter_factory": "data_conversion.ipynb", "save_csv": "utils.ipynb", "save_parquet": "utils.ipynb", "save_multi_index_parquet": "utils.ipynb", "save_keras_model": "utils.ipynb", "save_csv_gz": "utils.ipynb", "read_csv": "utils.ipynb", "read_csv_gz": "utils.ipynb", "load_keras_model": "utils.ipynb", "estimator2io": "utils.ipynb", "result2io": "utils.ipynb", "DataIO": "utils.ipynb", "DummyComponent": "utils.ipynb", "test_data_io_folder": "utils.ipynb", "dummy_component": "utils.ipynb", "test_data_io_chaining": "utils.ipynb", "PandasIO": "utils.ipynb", "PickleIO": "utils.ipynb", "SklearnIO": "utils.ipynb", "NoSaverIO": "utils.ipynb", "data_io_factory": "utils.ipynb", "test_data_io_factory": "utils.ipynb", "ModelPlotter": "utils.ipynb", "Profiler": "utils.ipynb", "test_profiler": "utils.ipynb", "Comparator": "utils.ipynb", "MyTransformComparator": "utils.ipynb", "test_comparator": "utils.ipynb", "test_comparator2": "utils.ipynb", "camel_to_snake": "utils.ipynb", "snake_to_camel": "utils.ipynb", "DataSet": "datasets.ipynb", "MyDataSet": "datasets.ipynb", "test_dataset": "datasets.ipynb", "dsblocks_install_git_hooks": "cli.ipynb", "main_dsblocks_install_git_hooks": "cli.ipynb", "test_dsblocks_install_git_hooks": "cli.ipynb", "SumXY": "dummies.ipynb", "DummyEstimator": "dummies.ipynb", "Intermediate": "dummies.ipynb", "Higher": "dummies.ipynb", "Sum1": "dummies.ipynb", "Multiply10": "dummies.ipynb", "NewParallel": "dummies.ipynb", "MinMaxClass": "dummies.ipynb", "Min10": "dummies.ipynb", "Max10": "dummies.ipynb", "make_pipe_fit1": "dummies.ipynb", "make_pipe_fit2": "dummies.ipynb", "make_pipe1": "dummies.ipynb", "make_pipe2": "dummies.ipynb", "Min10direct": "dummies.ipynb", "Max10direct": "dummies.ipynb", "Sum1direct": "dummies.ipynb", "Multiply10direct": "dummies.ipynb", "MaxOfPositiveWithSeparateLabels": "dummies.ipynb", "MinOfPositiveWithoutSeparateLabels": "dummies.ipynb", "DataSource": "dummies.ipynb", "subtract_xy": "dummies.ipynb", "DummyClassifier": "dummies.ipynb", "test_dummy_classifier": "dummies.ipynb", "cd_root": "nbdev_utils.ipynb", "nbdev_setup": "nbdev_utils.ipynb", "TestRunner": "nbdev_utils.ipynb", "example_people_data": "nbdev_utils.ipynb", "myf": "nbdev_utils.ipynb", "my_first_test": "nbdev_utils.ipynb", "second_fails": "nbdev_utils.ipynb", "third_fails": "nbdev_utils.ipynb", "test_test_runner": "nbdev_utils.ipynb", "test_test_runner_two_tests": "nbdev_utils.ipynb", "test_test_runner_two_targets": "nbdev_utils.ipynb", "test_cd_root": "nbdev_utils.ipynb", "test_nbdev_setup": "nbdev_utils.ipynb", "md": "nbdev_utils.ipynb", "replace_imports": "nbdev_utils.ipynb", "nbdev_build_test": "nbdev_utils.ipynb", "create_fake_tests": "nbdev_utils.ipynb", "test_nbdev_build_test": "nbdev_utils.ipynb", "json_load": "utils.ipynb", "json_dump": "utils.ipynb", "make_reproducible": "utils.ipynb", "test_make_reproducible": "utils.ipynb", "get_logging_level": "utils.ipynb", "delete_logger": "utils.ipynb", "set_logger": "utils.ipynb", "set_empty_logger": "utils.ipynb", "set_verbosity": "utils.ipynb", "test_set_logger": "utils.ipynb", "remove_previous_results": "utils.ipynb", "set_tf_loglevel": "utils.ipynb", "test_set_tf_loglevel": "utils.ipynb", "get_top_function": "utils.ipynb", "test_get_top_function": "utils.ipynb", "check_last_part": "utils.ipynb", "test_check_last_part": "utils.ipynb", "argnames": "utils.ipynb", "store_attr": "utils.ipynb", "test_store_attr": "utils.ipynb", "get_specific_dict_param": "utils.ipynb", "obtain_class_specific_attrs": "utils.ipynb", "get_hierarchy_level": "utils.ipynb", "test_get_hierarchy": "utils.ipynb", "replace_attr_and_store": "utils.ipynb", "test_replace_attr_and_store": "utils.ipynb", "test_replace_attr_and_store_no_rec": "utils.ipynb"} modules = ["tests/blocks/test_blocks.py", "tests/blocks/test_preprocessing.py", "tests/core/test_components.py", "tests/core/test_compose.py", "tests/core/test_data_conversion.py", "tests/core/test_utils.py", "tests/datasets/test_datasets.py", "tests/utils/test_cli.py", "tests/utils/test_dummies.py", "tests/utils/test_nbdev_utils.py", "tests/utils/test_utils.py", "blocks/blocks.py", "blocks/preprocessing.py", "config/bt_defaults.py", "core/components.py", "core/compose.py", "core/data_conversion.py", "core/utils.py", "datasets/datasets.py", "utils/cli.py", "utils/dummies.py", "utils/nbdev_utils.py", "utils/utils.py"] doc_url = "https://Jaume-JCI.github.io/" git_url = "https://github.com/Jaume-JCI/ds-blocks/tree/main/" def custom_doc_links(name): return None
__all__ = ['index', 'modules', 'custom_doc_links', 'git_url'] index = {'component_save_data_fixture': 'tst.components.ipynb', 'column_transformer_data_fixture': 'tst.compose.ipynb', 'multi_split_data_fixture': 'tst.compose.ipynb', 'test_pipeline_find_last_fitted_model_seq_others': 'tst.compose.ipynb', 'test_pipeline_find_last_fitted_model_parallel_2': 'tst.compose.ipynb', 'test_data_conversion_sequential_parallel_column_transformer': 'tst.compose.ipynb', 'example_people_data_fixture': 'tst.nbdev_utils.ipynb', 'Splitter': 'blocks.ipynb', 'test_splitter': 'blocks.ipynb', 'DoubleKFoldBase': 'blocks.ipynb', 'SingleKFold': 'blocks.ipynb', 'test_single_kfold': 'blocks.ipynb', 'FixedDoubleKFold': 'blocks.ipynb', 'test_fixed_double_kfold': 'blocks.ipynb', 'SkSplitGenerator': 'blocks.ipynb', 'test_sksplit_generator': 'blocks.ipynb', 'PandasEvaluator': 'blocks.ipynb', 'test_pandas_evaluator': 'blocks.ipynb', 'OneHotEncoder': 'preprocessing.ipynb', 'test_one_hot_encoder': 'preprocessing.ipynb', 'WindowGenerator': 'preprocessing.ipynb', 'generate_input_for_window_generator': 'data_conversion.ipynb', 'test_window_generator': 'preprocessing.ipynb', 'WindowAggregator': 'preprocessing.ipynb', 'test_window_aggregator': 'preprocessing.ipynb', 'path_results': 'config.bt_defaults.ipynb', 'path_models': 'config.bt_defaults.ipynb', 'path_data': 'config.bt_defaults.ipynb', 'file_format': 'config.bt_defaults.ipynb', 'verbose': 'config.bt_defaults.ipynb', 'name_logger': 'config.bt_defaults.ipynb', 'save_splits': 'config.bt_defaults.ipynb', 'group': 'config.bt_defaults.ipynb', 'error_if_present': 'config.bt_defaults.ipynb', 'overwrite_field': 'config.bt_defaults.ipynb', 'mode_logger': 'config.bt_defaults.ipynb', 'separate_labels': 'config.bt_defaults.ipynb', 'warning_if_nick_name_exists': 'config.bt_defaults.ipynb', 'propagate': 'config.bt_defaults.ipynb', 'path_session_folder': 'config.bt_defaults.ipynb', 'session_filename': 'config.bt_defaults.ipynb', 'path_logger_folder': 'config.bt_defaults.ipynb', 'logger_filename': 'config.bt_defaults.ipynb', 'logger_null_filename': 'config.bt_defaults.ipynb', 'stdout_logger': 'config.bt_defaults.ipynb', 'null_name_logger': 'config.bt_defaults.ipynb', 'Component': 'components.ipynb', 'test_component_config': 'components.ipynb', 'test_component_store_attrs': 'components.ipynb', 'test_component_aliases': 'components.ipynb', 'test_component_predict': 'components.ipynb', 'test_component_multiple_inputs': 'components.ipynb', 'TransformWithFitApply': 'components.ipynb', 'TransformWithoutFitApply': 'components.ipynb', 'test_component_fit_apply': 'components.ipynb', 'MyDataConverter': 'components.ipynb', 'TransformWithFitApplyDC': 'components.ipynb', 'test_component_validation_test': 'components.ipynb', 'TransformWithoutFitApply2': 'components.ipynb', 'TransformWithFitApply2': 'components.ipynb', 'component_save_data': 'components.ipynb', 'test_component_save_load': 'components.ipynb', 'Transform1': 'compose.ipynb', 'test_component_run_depend_on_existence': 'components.ipynb', 'test_component_logger': 'components.ipynb', 'test_component_data_converter': 'components.ipynb', 'test_component_data_io': 'components.ipynb', 'test_component_equal': 'components.ipynb', 'test_set_paths': 'components.ipynb', 'TransformWithoutFit': 'components.ipynb', 'TransformWithFitApplyOnly': 'components.ipynb', 'test_determine_fit_function': 'components.ipynb', 'test_use_fit_from_loaded_estimator': 'components.ipynb', 'test_direct_methods': 'components.ipynb', 'test_pass_apply': 'components.ipynb', 'test_get_specific_data_io_parameters_for_component': 'components.ipynb', 'test_get_specific_data_io_parameters': 'components.ipynb', 'test_standard_converter_in_component': 'components.ipynb', 'test_set_suffix': 'compose.ipynb', 'SamplingComponent': 'components.ipynb', 'test_sampling_component': 'components.ipynb', 'SklearnComponent': 'components.ipynb', 'PickleSaverComponent': 'components.ipynb', 'test_sklearn_component': 'components.ipynb', 'NoSaverComponent': 'components.ipynb', 'test_no_saver_component': 'components.ipynb', 'OneClassSklearnComponent': 'components.ipynb', 'get_data_for_one_class': 'components.ipynb', 'test_one_class_sklearn_component': 'components.ipynb', 'PandasComponent': 'components.ipynb', 'test_pandas_component': 'components.ipynb', 'MultiComponent': 'compose.ipynb', 'SimpleMultiComponent': 'compose.ipynb', 'test_multi_comp_io': 'compose.ipynb', 'test_multi_comp_desc': 'compose.ipynb', 'test_athena_pipeline_training': 'compose.ipynb', 'test_gather_and_save_info': 'compose.ipynb', 'test_multi_comp_hierarchy': 'compose.ipynb', 'test_multi_comp_profiling': 'compose.ipynb', 'test_multi_comp_all_equal': 'compose.ipynb', 'test_multi_component_setters': 'compose.ipynb', 'test_show_result_statistics': 'compose.ipynb', 'test_pass_components': 'compose.ipynb', 'test_chain_folders': 'compose.ipynb', 'test_set_root': 'compose.ipynb', 'test_set_root_2': 'compose.ipynb', 'test_pass_functions_to_multi_component': 'compose.ipynb', 'Pipeline': 'compose.ipynb', 'Sequential': 'compose.ipynb', 'Transform2': 'compose.ipynb', 'SimplePipeline': 'compose.ipynb', 'test_pipeline_fit_apply': 'compose.ipynb', 'test_pipeline_fit_apply_bis': 'compose.ipynb', 'test_pipeline_new_comp': 'compose.ipynb', 'test_pipeline_set_comp': 'compose.ipynb', 'test_pipeline_load_estimator': 'compose.ipynb', 'build_pipeline_construct_diagram_1': 'compose.ipynb', 'build_pipeline_construct_diagram_2': 'compose.ipynb', 'test_construct_diagram': 'compose.ipynb', 'test_show_summary': 'compose.ipynb', 'test_multi_comp_profiling2': 'compose.ipynb', 'make_pipeline': 'compose.ipynb', 'test_make_pipeline': 'compose.ipynb', 'pipeline_factory': 'compose.ipynb', 'test_pipeline_factory': 'compose.ipynb', 'PandasPipeline': 'compose.ipynb', 'PandasTransformWithLabels1': 'compose.ipynb', 'PandasTransformWithLabels2': 'compose.ipynb', 'SimplePandasPipeline': 'compose.ipynb', 'TransformWithLabels1': 'compose.ipynb', 'TransformWithLabels2': 'compose.ipynb', 'SimplePandasPipelineNoPandasComponent': 'compose.ipynb', 'test_pandas_pipeline': 'compose.ipynb', 'Parallel': 'compose.ipynb', 'test_parallel': 'compose.ipynb', 'test_pipeline_find_last_result': 'compose.ipynb', 'test_pipeline_find_last_result_parallel1': 'compose.ipynb', 'test_pipeline_find_last_result_parallel2': 'compose.ipynb', 'test_pipeline_find_last_result_parallel3': 'compose.ipynb', 'test_pipeline_find_last_fitted_model_seq': 'compose.ipynb', 'test_pipeline_find_last_fitted_model_parallel': 'compose.ipynb', 'test_pipeline_find_last_fitted_model_parallel_remove': 'compose.ipynb', 'MultiModality': 'compose.ipynb', 'TransformM': 'compose.ipynb', 'test_multi_modality': 'compose.ipynb', 'ColumnSelector': 'compose.ipynb', 'test_column_selector': 'compose.ipynb', 'Concat': 'compose.ipynb', 'test_concat': 'compose.ipynb', 'ColumnTransformer': 'compose.ipynb', 'Identity': 'compose.ipynb', 'test_identity': 'compose.ipynb', 'make_column_transformer_pipelines': 'compose.ipynb', 'make_column_transformer': 'compose.ipynb', 'column_transformer_data': 'compose.ipynb', 'test_make_column_transformer': 'compose.ipynb', 'test_make_column_transformer_passthrough': 'compose.ipynb', 'test_make_column_transformer_remainder': 'compose.ipynb', 'test_make_column_transformer_descendants': 'compose.ipynb', 'test_make_column_transformer_fit_transform': 'compose.ipynb', 'MultiSplitComponent': 'compose.ipynb', 'MultiSplitDict': 'compose.ipynb', 'multi_split_data': 'compose.ipynb', 'test_multi_split_transform': 'compose.ipynb', 'test_multi_split_fit': 'compose.ipynb', 'test_multi_split_chain': 'compose.ipynb', 'test_multi_split_io': 'compose.ipynb', 'test_multi_split_non_dict': 'compose.ipynb', 'test_multi_split_non_dict_bis': 'compose.ipynb', 'MultiSplitDFColumn': 'compose.ipynb', 'multi_split_data_df_column': 'compose.ipynb', 'test_multi_split_df_column_transform': 'compose.ipynb', 'test_multi_split_df_column_fit': 'compose.ipynb', 'ParallelInstances': 'compose.ipynb', 'CrossValidator': 'compose.ipynb', 'test_cross_validator_1': 'compose.ipynb', 'test_cross_validator_2': 'compose.ipynb', 'test_cross_validator_3': 'compose.ipynb', 'DataConverter': 'data_conversion.ipynb', 'test_data_converter_functions': 'data_conversion.ipynb', 'NoConverter': 'data_conversion.ipynb', 'test_no_converter': 'data_conversion.ipynb', 'GenericConverter': 'data_conversion.ipynb', 'test_generic_converter': 'data_conversion.ipynb', 'StandardConverter': 'data_conversion.ipynb', 'test_standard_converter': 'data_conversion.ipynb', 'PandasConverter': 'data_conversion.ipynb', 'test_pandas_converter': 'data_conversion.ipynb', 'Window2Dto3Dconverter': 'data_conversion.ipynb', 'test_window2d_to_3d_converter': 'data_conversion.ipynb', 'data_converter_factory': 'data_conversion.ipynb', 'test_data_converter_factory': 'data_conversion.ipynb', 'save_csv': 'utils.ipynb', 'save_parquet': 'utils.ipynb', 'save_multi_index_parquet': 'utils.ipynb', 'save_keras_model': 'utils.ipynb', 'save_csv_gz': 'utils.ipynb', 'read_csv': 'utils.ipynb', 'read_csv_gz': 'utils.ipynb', 'load_keras_model': 'utils.ipynb', 'estimator2io': 'utils.ipynb', 'result2io': 'utils.ipynb', 'DataIO': 'utils.ipynb', 'DummyComponent': 'utils.ipynb', 'test_data_io_folder': 'utils.ipynb', 'dummy_component': 'utils.ipynb', 'test_data_io_chaining': 'utils.ipynb', 'PandasIO': 'utils.ipynb', 'PickleIO': 'utils.ipynb', 'SklearnIO': 'utils.ipynb', 'NoSaverIO': 'utils.ipynb', 'data_io_factory': 'utils.ipynb', 'test_data_io_factory': 'utils.ipynb', 'ModelPlotter': 'utils.ipynb', 'Profiler': 'utils.ipynb', 'test_profiler': 'utils.ipynb', 'Comparator': 'utils.ipynb', 'MyTransformComparator': 'utils.ipynb', 'test_comparator': 'utils.ipynb', 'test_comparator2': 'utils.ipynb', 'camel_to_snake': 'utils.ipynb', 'snake_to_camel': 'utils.ipynb', 'DataSet': 'datasets.ipynb', 'MyDataSet': 'datasets.ipynb', 'test_dataset': 'datasets.ipynb', 'dsblocks_install_git_hooks': 'cli.ipynb', 'main_dsblocks_install_git_hooks': 'cli.ipynb', 'test_dsblocks_install_git_hooks': 'cli.ipynb', 'SumXY': 'dummies.ipynb', 'DummyEstimator': 'dummies.ipynb', 'Intermediate': 'dummies.ipynb', 'Higher': 'dummies.ipynb', 'Sum1': 'dummies.ipynb', 'Multiply10': 'dummies.ipynb', 'NewParallel': 'dummies.ipynb', 'MinMaxClass': 'dummies.ipynb', 'Min10': 'dummies.ipynb', 'Max10': 'dummies.ipynb', 'make_pipe_fit1': 'dummies.ipynb', 'make_pipe_fit2': 'dummies.ipynb', 'make_pipe1': 'dummies.ipynb', 'make_pipe2': 'dummies.ipynb', 'Min10direct': 'dummies.ipynb', 'Max10direct': 'dummies.ipynb', 'Sum1direct': 'dummies.ipynb', 'Multiply10direct': 'dummies.ipynb', 'MaxOfPositiveWithSeparateLabels': 'dummies.ipynb', 'MinOfPositiveWithoutSeparateLabels': 'dummies.ipynb', 'DataSource': 'dummies.ipynb', 'subtract_xy': 'dummies.ipynb', 'DummyClassifier': 'dummies.ipynb', 'test_dummy_classifier': 'dummies.ipynb', 'cd_root': 'nbdev_utils.ipynb', 'nbdev_setup': 'nbdev_utils.ipynb', 'TestRunner': 'nbdev_utils.ipynb', 'example_people_data': 'nbdev_utils.ipynb', 'myf': 'nbdev_utils.ipynb', 'my_first_test': 'nbdev_utils.ipynb', 'second_fails': 'nbdev_utils.ipynb', 'third_fails': 'nbdev_utils.ipynb', 'test_test_runner': 'nbdev_utils.ipynb', 'test_test_runner_two_tests': 'nbdev_utils.ipynb', 'test_test_runner_two_targets': 'nbdev_utils.ipynb', 'test_cd_root': 'nbdev_utils.ipynb', 'test_nbdev_setup': 'nbdev_utils.ipynb', 'md': 'nbdev_utils.ipynb', 'replace_imports': 'nbdev_utils.ipynb', 'nbdev_build_test': 'nbdev_utils.ipynb', 'create_fake_tests': 'nbdev_utils.ipynb', 'test_nbdev_build_test': 'nbdev_utils.ipynb', 'json_load': 'utils.ipynb', 'json_dump': 'utils.ipynb', 'make_reproducible': 'utils.ipynb', 'test_make_reproducible': 'utils.ipynb', 'get_logging_level': 'utils.ipynb', 'delete_logger': 'utils.ipynb', 'set_logger': 'utils.ipynb', 'set_empty_logger': 'utils.ipynb', 'set_verbosity': 'utils.ipynb', 'test_set_logger': 'utils.ipynb', 'remove_previous_results': 'utils.ipynb', 'set_tf_loglevel': 'utils.ipynb', 'test_set_tf_loglevel': 'utils.ipynb', 'get_top_function': 'utils.ipynb', 'test_get_top_function': 'utils.ipynb', 'check_last_part': 'utils.ipynb', 'test_check_last_part': 'utils.ipynb', 'argnames': 'utils.ipynb', 'store_attr': 'utils.ipynb', 'test_store_attr': 'utils.ipynb', 'get_specific_dict_param': 'utils.ipynb', 'obtain_class_specific_attrs': 'utils.ipynb', 'get_hierarchy_level': 'utils.ipynb', 'test_get_hierarchy': 'utils.ipynb', 'replace_attr_and_store': 'utils.ipynb', 'test_replace_attr_and_store': 'utils.ipynb', 'test_replace_attr_and_store_no_rec': 'utils.ipynb'} modules = ['tests/blocks/test_blocks.py', 'tests/blocks/test_preprocessing.py', 'tests/core/test_components.py', 'tests/core/test_compose.py', 'tests/core/test_data_conversion.py', 'tests/core/test_utils.py', 'tests/datasets/test_datasets.py', 'tests/utils/test_cli.py', 'tests/utils/test_dummies.py', 'tests/utils/test_nbdev_utils.py', 'tests/utils/test_utils.py', 'blocks/blocks.py', 'blocks/preprocessing.py', 'config/bt_defaults.py', 'core/components.py', 'core/compose.py', 'core/data_conversion.py', 'core/utils.py', 'datasets/datasets.py', 'utils/cli.py', 'utils/dummies.py', 'utils/nbdev_utils.py', 'utils/utils.py'] doc_url = 'https://Jaume-JCI.github.io/' git_url = 'https://github.com/Jaume-JCI/ds-blocks/tree/main/' def custom_doc_links(name): return None
def solution(): data = open(r'inputs\day13.in').readlines() print('Part 1 result: ' + str(part1(data))) print('Part 2 result: ' + str(part2(data))) def part1(data): # build out the grid and instructions from our data grid, fold_instructions = build_grid_and_instructions(data) # run the first fold only grid = fold(grid, fold_instructions[0]) # the length of the grid is our answer return len(grid) def part2(data): # build out the grid and instructions from our data grid, fold_instructions = build_grid_and_instructions(data) # loop through every fold instruction, running it for i in range(len(fold_instructions)): instr = fold_instructions[i] grid = fold(grid, instr) # get the max x and y values X = max([x for (x,y) in grid.keys()]) + 1 Y = max([y for (x,y) in grid.keys()]) + 1 # print out the word by looping through the grid printing one row at a time ans = '' for y in range(Y): for x in range(X): ans += ('x' if (x,y) in grid else ' ') print(ans) ans = '' return 'Read above' def build_grid_and_instructions(data): grid = {} fold_instructions = [] for line in data: line = line.strip() # ignore the blank lines if line == '': continue if line.startswith('fold'): # split on the equals sign a, b = line.split('=') # now, split the first piece on the comma and take the third element, this is our axis a = a.split(' ')[2] # add the instruction as a tuple to our fold_instructions list, for example fold along y=3 would be ('y', 3) fold_instructions.append((a, b)) else: # split on the comma and cast both to ints x, y = [int(x) for x in line.strip().split(',')] # set that spot in our grid to be true grid[(x, y)] = True # return the grid & instructions return grid, fold_instructions def fold(grid, instruction): grid2 = {} # the line we want to fold along fold_line = int(instruction[1]) if instruction[0] == 'x': for (x, y) in grid: # if our x value is less than the fold line, we leave it alone, and copy the same location to the new grid if x < fold_line: grid2[(x, y)] = True else: # otherwise, we need the new location to be flipped across the fold line, # so its new x value is the fold line minus the distance between the fold line and the current x value # i.e. an x of 7 folded over 5 would get moved to x = 3 grid2[((fold_line - (x - fold_line), y))] = True else: # if it isn't x, it must be y assert instruction[0] == 'y' for (x, y) in grid: # if our y value is less than the fold line, we leave it alone, and copy the same location to the new grid if y < fold_line: grid2[(x, y)] = True else: # otherwise, we need the new location to be flipped across the fold line, # same logic as above, but with y instead grid2[((x, fold_line - (y - fold_line)))] = True # return the new grid return grid2 solution()
def solution(): data = open('inputs\\day13.in').readlines() print('Part 1 result: ' + str(part1(data))) print('Part 2 result: ' + str(part2(data))) def part1(data): (grid, fold_instructions) = build_grid_and_instructions(data) grid = fold(grid, fold_instructions[0]) return len(grid) def part2(data): (grid, fold_instructions) = build_grid_and_instructions(data) for i in range(len(fold_instructions)): instr = fold_instructions[i] grid = fold(grid, instr) x = max([x for (x, y) in grid.keys()]) + 1 y = max([y for (x, y) in grid.keys()]) + 1 ans = '' for y in range(Y): for x in range(X): ans += 'x' if (x, y) in grid else ' ' print(ans) ans = '' return 'Read above' def build_grid_and_instructions(data): grid = {} fold_instructions = [] for line in data: line = line.strip() if line == '': continue if line.startswith('fold'): (a, b) = line.split('=') a = a.split(' ')[2] fold_instructions.append((a, b)) else: (x, y) = [int(x) for x in line.strip().split(',')] grid[x, y] = True return (grid, fold_instructions) def fold(grid, instruction): grid2 = {} fold_line = int(instruction[1]) if instruction[0] == 'x': for (x, y) in grid: if x < fold_line: grid2[x, y] = True else: grid2[fold_line - (x - fold_line), y] = True else: assert instruction[0] == 'y' for (x, y) in grid: if y < fold_line: grid2[x, y] = True else: grid2[x, fold_line - (y - fold_line)] = True return grid2 solution()
cappacity = 0 lines = int(input()) for i in range(0, lines): water = int(input()) if cappacity + water > 255: print("Insufficient capacity!") continue else: cappacity += water print(cappacity)
cappacity = 0 lines = int(input()) for i in range(0, lines): water = int(input()) if cappacity + water > 255: print('Insufficient capacity!') continue else: cappacity += water print(cappacity)
# Write your code here def query(arr, x, l, r, k): for i in range(l-1,r): if arr[i] == x: k -= 1 if k == 0: print(i+1) return print(-1) return def update(arr, ind, value): arr[ind-1] = value n,x = map(int, input().split()) arr = list(map(int, input().split())) Q = int(input()) for q in range(Q): s = input().split() if s[0] == '1': l,r,k = int(s[1]), int(s[2]), int(s[3]) query(arr, x, l, r, k) else: ind, value = int(s[1]), int(s[2]) update(arr, ind, value)
def query(arr, x, l, r, k): for i in range(l - 1, r): if arr[i] == x: k -= 1 if k == 0: print(i + 1) return print(-1) return def update(arr, ind, value): arr[ind - 1] = value (n, x) = map(int, input().split()) arr = list(map(int, input().split())) q = int(input()) for q in range(Q): s = input().split() if s[0] == '1': (l, r, k) = (int(s[1]), int(s[2]), int(s[3])) query(arr, x, l, r, k) else: (ind, value) = (int(s[1]), int(s[2])) update(arr, ind, value)
""" makers ====== Auxjad's leaf making classes. """
""" makers ====== Auxjad's leaf making classes. """
def foo(a, b): a = a + b print(a, b) def bar(x): x += 1 print(x+1) x = x + 1 return x def multi( a, b, c=12): pass if a is None: print(123) if a == b and \ True: print(bla) class A: def bar(self, aa): print(aa)
def foo(a, b): a = a + b print(a, b) def bar(x): x += 1 print(x + 1) x = x + 1 return x def multi(a, b, c=12): pass if a is None: print(123) if a == b and True: print(bla) class A: def bar(self, aa): print(aa)
def part_one(data_input: list) -> int: frequency = 0 for line in data_input: frequency += int(line) return frequency def part_two(data_input: list) -> int: change_after_iteration = sum(data_input) if not change_after_iteration: return change_after_iteration best_n_repetition = float("inf") frequency = 0 first_row = [] for elem in data_input: first_row.append(frequency + elem) frequency += elem for elem in first_row: for rep in first_row: if (rep - elem) % change_after_iteration == 0 and best_n_repetition > ( rep - elem) / change_after_iteration and rep - elem > 0: best_n_repetition = (rep - elem) / change_after_iteration frequency = rep return frequency
def part_one(data_input: list) -> int: frequency = 0 for line in data_input: frequency += int(line) return frequency def part_two(data_input: list) -> int: change_after_iteration = sum(data_input) if not change_after_iteration: return change_after_iteration best_n_repetition = float('inf') frequency = 0 first_row = [] for elem in data_input: first_row.append(frequency + elem) frequency += elem for elem in first_row: for rep in first_row: if (rep - elem) % change_after_iteration == 0 and best_n_repetition > (rep - elem) / change_after_iteration and (rep - elem > 0): best_n_repetition = (rep - elem) / change_after_iteration frequency = rep return frequency
''' This is the 5th problem on Day 3 based on if else and if statements In this problem, we are going to build a love calculator which shall calculate compatibility between 2 people if score < 10 or score > 90, we have to print Your score is this, you go together like coke and mentos if score >=40 and score <= 50 we have to print Your score is this, you are alright together else print your score is this ''' ''' The following function calculates the love compatibility between 2 people Don\'t have to take this value seriously ;-). It is meant to be a fun project and created for the general understanding of if-elif-else and basic for loops This function takes 2 names as input. Then it counts the number of times the letters of the word TRUE occur in the 2 names. Let that be count_true Secondly, it counts the number of times the letters of the word LOVE occur in the 2 names. Let that be count_love Finally, the result is created by putting count_true in ten's place and count_love in unit's place For example:- name1 = Luis name2 = Gerard count_true = 4 count_love = 2 Result = 42 ''' def loveCalculator(): name1 = input("Enter your name: ").lower() name2 = input("Enter your loved one\'s name: ").lower() count_true = 0 count_love = 0 for s in name1: if s in 'true': count_true += 1 if s in 'love': count_love += 1 for s in name2: if s in 'true': count_true += 1 if s in 'love': count_love += 1 score = (count_true*10) + count_love if score < 10 or score > 90: print(f"Your score is {score}, you go together like coke and mentos") elif score >= 40 and score <= 50: print(f"Your score is {score}, you are alright together") else: print(f"Your score is {score}") if __name__ == "__main__": loveCalculator()
""" This is the 5th problem on Day 3 based on if else and if statements In this problem, we are going to build a love calculator which shall calculate compatibility between 2 people if score < 10 or score > 90, we have to print Your score is this, you go together like coke and mentos if score >=40 and score <= 50 we have to print Your score is this, you are alright together else print your score is this """ "\nThe following function calculates the love compatibility between 2 people\n\nDon't have to take this value seriously ;-). It is meant to be a fun project and created for the general understanding of if-elif-else and basic for loops\n\nThis function takes 2 names as input. \n\nThen it counts the number of times the letters of the word TRUE occur in the 2 names. Let that be count_true\nSecondly, it counts the number of times the letters of the word LOVE occur in the 2 names. Let that be count_love\n\nFinally, the result is created by putting count_true in ten's place and count_love in unit's place\n\nFor example:-\n\nname1 = Luis\nname2 = Gerard\n\ncount_true = 4\ncount_love = 2\n\nResult = 42\n" def love_calculator(): name1 = input('Enter your name: ').lower() name2 = input("Enter your loved one's name: ").lower() count_true = 0 count_love = 0 for s in name1: if s in 'true': count_true += 1 if s in 'love': count_love += 1 for s in name2: if s in 'true': count_true += 1 if s in 'love': count_love += 1 score = count_true * 10 + count_love if score < 10 or score > 90: print(f'Your score is {score}, you go together like coke and mentos') elif score >= 40 and score <= 50: print(f'Your score is {score}, you are alright together') else: print(f'Your score is {score}') if __name__ == '__main__': love_calculator()
"""merge 886b65 and f94174 Revision ID: 99822318096d Revises: f94174183e7e, 886b65e82e3e Create Date: 2020-10-29 15:54:09.623122 """ # revision identifiers, used by Alembic. revision = '99822318096d' down_revision = ('f94174183e7e', '886b65e82e3e') branch_labels = None depends_on = None def upgrade(): pass def downgrade(): pass
"""merge 886b65 and f94174 Revision ID: 99822318096d Revises: f94174183e7e, 886b65e82e3e Create Date: 2020-10-29 15:54:09.623122 """ revision = '99822318096d' down_revision = ('f94174183e7e', '886b65e82e3e') branch_labels = None depends_on = None def upgrade(): pass def downgrade(): pass
# learn about boolean #a=True #b=False a=not True b=not False print(a) print(b)
a = not True b = not False print(a) print(b)
def affiche_table(liste): ... def construit_table(largeur, hauteur): tab = [[],[]] for nb in range(largeur): tab[0].append(nb+1) for nb in range(hauteur): tab[1].append(nb+1) for line in hauteur: tab.append([]) return tab
def affiche_table(liste): ... def construit_table(largeur, hauteur): tab = [[], []] for nb in range(largeur): tab[0].append(nb + 1) for nb in range(hauteur): tab[1].append(nb + 1) for line in hauteur: tab.append([]) return tab
name = "Gary" number = len(name) * 3 print("Hello {}, your lucky number is {}".format(name, number))
name = 'Gary' number = len(name) * 3 print('Hello {}, your lucky number is {}'.format(name, number))
# DP N = int(input()) A = [list(map(int, input().split())) for _ in range(2)] b = [[0] * N for _ in range(2)] b[0][0] = A[0][0] for i in range(1, N): b[0][i] = b[0][i - 1] + A[0][i] b[1][0] = b[0][0] + A[1][0] for i in range(1, N): b[1][i] = max(b[1][i - 1], b[0][i]) + A[1][i] print(b[1][N - 1])
n = int(input()) a = [list(map(int, input().split())) for _ in range(2)] b = [[0] * N for _ in range(2)] b[0][0] = A[0][0] for i in range(1, N): b[0][i] = b[0][i - 1] + A[0][i] b[1][0] = b[0][0] + A[1][0] for i in range(1, N): b[1][i] = max(b[1][i - 1], b[0][i]) + A[1][i] print(b[1][N - 1])
class Solution: def missingNumber(self, nums: List[int]) -> int: ideal_sum = 0 actual_sum = 0 for i in range(0, len(nums)): ideal_sum += i actual_sum += nums[i] ideal_sum += len(nums) return ideal_sum - actual_sum
class Solution: def missing_number(self, nums: List[int]) -> int: ideal_sum = 0 actual_sum = 0 for i in range(0, len(nums)): ideal_sum += i actual_sum += nums[i] ideal_sum += len(nums) return ideal_sum - actual_sum
class TokenType: ID = 'ID' STRING = 'STRING' NUMBER = 'NUMBER' REGEX = 'REGEX' COMMA = 'COMMA' L_BRACKET = 'LEFT BRACKET' R_BRACKET = 'RIGHT BRACKET' COLON = 'COLON' SEMICOLON = 'SEMICOLON' NEW_LINE = 'NEW LINE' TAB = 'TAB' class Token: def __init__(self, token_type, lexme, source_index): self.token_type = token_type self.lexme = lexme self.source_index = source_index def __str__(self): if (self.token_type == TokenType.NEW_LINE or self.token_type == TokenType.TAB): return self.token_type + "\t\t" + str(self.source_index) return self.token_type + "\t" + self.lexme + "\t" + str(self.source_index)
class Tokentype: id = 'ID' string = 'STRING' number = 'NUMBER' regex = 'REGEX' comma = 'COMMA' l_bracket = 'LEFT BRACKET' r_bracket = 'RIGHT BRACKET' colon = 'COLON' semicolon = 'SEMICOLON' new_line = 'NEW LINE' tab = 'TAB' class Token: def __init__(self, token_type, lexme, source_index): self.token_type = token_type self.lexme = lexme self.source_index = source_index def __str__(self): if self.token_type == TokenType.NEW_LINE or self.token_type == TokenType.TAB: return self.token_type + '\t\t' + str(self.source_index) return self.token_type + '\t' + self.lexme + '\t' + str(self.source_index)
array = list(input().split(",")) def find_single(array): for item in array: if array.count(item) == 1: return item print(find_single(array))
array = list(input().split(',')) def find_single(array): for item in array: if array.count(item) == 1: return item print(find_single(array))
n = int(input()) height = list(map(int,input().strip(" ").split())) distinct = set(height) average = sum(distinct)/len(distinct) print(average)
n = int(input()) height = list(map(int, input().strip(' ').split())) distinct = set(height) average = sum(distinct) / len(distinct) print(average)
# Write your solution for 1.4 here! def is_prime(x): a=0 for i in range(2,x): if x%i==0: a+=1 if a==1: return(False) print("False") else: return(True) print("True") is_prime(13) is_prime(4)
def is_prime(x): a = 0 for i in range(2, x): if x % i == 0: a += 1 if a == 1: return False print('False') else: return True print('True') is_prime(13) is_prime(4)
def runner_cli(augury, args): assert args.cmd == 'runner' paths = { 'status': set_status, 'config': get_config, 'artifacts': add_artifacts, } paths[args.runner_cmd](augury, args) def set_status(augury, args): if args.status: print(augury.set_runner_status(args.status)) else: print(augury.get_runner_status()) def get_config(augury, args): print(augury.fetch_config()) def add_artifacts(augury, args): print(augury.add_artifacts(args.input)) def create_parser(parser): runner = parser.add_parser('runner') subparsers = runner.add_subparsers(dest='runner_cmd') subparsers.required = True status = subparsers.add_parser('status') status.add_argument('-s', '--status', help='status text to set') status.add_argument('-e', '--error', help='error message') config = subparsers.add_parser('config') artifacts = subparsers.add_parser('artifacts') artifacts.add_argument('input', nargs='+', help='list of files to mark as artifacts')
def runner_cli(augury, args): assert args.cmd == 'runner' paths = {'status': set_status, 'config': get_config, 'artifacts': add_artifacts} paths[args.runner_cmd](augury, args) def set_status(augury, args): if args.status: print(augury.set_runner_status(args.status)) else: print(augury.get_runner_status()) def get_config(augury, args): print(augury.fetch_config()) def add_artifacts(augury, args): print(augury.add_artifacts(args.input)) def create_parser(parser): runner = parser.add_parser('runner') subparsers = runner.add_subparsers(dest='runner_cmd') subparsers.required = True status = subparsers.add_parser('status') status.add_argument('-s', '--status', help='status text to set') status.add_argument('-e', '--error', help='error message') config = subparsers.add_parser('config') artifacts = subparsers.add_parser('artifacts') artifacts.add_argument('input', nargs='+', help='list of files to mark as artifacts')
locit_settings = { 'scaling': 'none' } coral_settings = { 'scaling': 'none' # needs to be none with separate test set! } pwmstl_settings = { 'mu': 0.1, 'rho': 1.0, 'beta1': 10.0, 'beta2': 10.0, 'kernel': 'linear', 'max_alpha': 10.0, 'tau_lambda': 1.0 }
locit_settings = {'scaling': 'none'} coral_settings = {'scaling': 'none'} pwmstl_settings = {'mu': 0.1, 'rho': 1.0, 'beta1': 10.0, 'beta2': 10.0, 'kernel': 'linear', 'max_alpha': 10.0, 'tau_lambda': 1.0}
# # Copyright 2022 Duncan Rose # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software # distributed under the License is distributed on an "AS IS" BASIS, # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. # See the License for the specific language governing permissions and # limitations under the License. # FILL = 8080 # Go with DUIM's 100 screens class SpaceReq(): def __init__(self, minx, desx, maxx, miny, desy, maxy): self._xmax = _fill_or(maxx) self._xmin = _fill_or(minx) self._xpref = _fill_or(desx) self._ymax = _fill_or(maxy) self._ymin = _fill_or(miny) self._ypref = _fill_or(desy) def __repr__(self): return "SpaceReq([{},{},{}], [{},{},{}])".format( self.x_min() if self.x_min() < FILL else "FILL", self.x_preferred() if self.x_preferred() < FILL else "FILL", self.x_max() if self.x_max() < FILL else "FILL", self.y_min() if self.y_min() < FILL else "FILL", self.y_preferred() if self.y_preferred() < FILL else "FILL", self.y_max() if self.y_max() < FILL else "FILL") def x_max(self): return self._xmax def x_preferred(self): return self._xpref def x_min(self): return self._xmin def y_max(self): return self._ymax def y_preferred(self): return self._ypref def y_min(self): return self._ymin def _fill_or(n): return n if n < FILL else FILL def combine_spacereqs(sr1, sr2, xcombiners, ycombiners): min_x = _fill_or(xcombiners[0](sr1._xmin, sr2._xmin)) pref_x = _fill_or(xcombiners[1](sr1._xpref, sr2._xpref)) max_x = _fill_or(xcombiners[2](sr1._xmax, sr2._xmax)) min_y = _fill_or(ycombiners[0](sr1._ymin, sr2._ymin)) pref_y = _fill_or(ycombiners[1](sr1._ypref, sr2._ypref)) max_y = _fill_or(ycombiners[2](sr1._ymax, sr2._ymax)) return SpaceReq(min_x, pref_x, max_x, min_y, pref_y, max_y)
fill = 8080 class Spacereq: def __init__(self, minx, desx, maxx, miny, desy, maxy): self._xmax = _fill_or(maxx) self._xmin = _fill_or(minx) self._xpref = _fill_or(desx) self._ymax = _fill_or(maxy) self._ymin = _fill_or(miny) self._ypref = _fill_or(desy) def __repr__(self): return 'SpaceReq([{},{},{}], [{},{},{}])'.format(self.x_min() if self.x_min() < FILL else 'FILL', self.x_preferred() if self.x_preferred() < FILL else 'FILL', self.x_max() if self.x_max() < FILL else 'FILL', self.y_min() if self.y_min() < FILL else 'FILL', self.y_preferred() if self.y_preferred() < FILL else 'FILL', self.y_max() if self.y_max() < FILL else 'FILL') def x_max(self): return self._xmax def x_preferred(self): return self._xpref def x_min(self): return self._xmin def y_max(self): return self._ymax def y_preferred(self): return self._ypref def y_min(self): return self._ymin def _fill_or(n): return n if n < FILL else FILL def combine_spacereqs(sr1, sr2, xcombiners, ycombiners): min_x = _fill_or(xcombiners[0](sr1._xmin, sr2._xmin)) pref_x = _fill_or(xcombiners[1](sr1._xpref, sr2._xpref)) max_x = _fill_or(xcombiners[2](sr1._xmax, sr2._xmax)) min_y = _fill_or(ycombiners[0](sr1._ymin, sr2._ymin)) pref_y = _fill_or(ycombiners[1](sr1._ypref, sr2._ypref)) max_y = _fill_or(ycombiners[2](sr1._ymax, sr2._ymax)) return space_req(min_x, pref_x, max_x, min_y, pref_y, max_y)
errors = { 'NotFound': { 'status': 404, }, 'BadRequest': { 'status': 400, }, 'MethodNotAllowed': { 'status': 405, } }
errors = {'NotFound': {'status': 404}, 'BadRequest': {'status': 400}, 'MethodNotAllowed': {'status': 405}}
# Copyright (c) 2019-2020 Intel Corporation # # Permission is hereby granted, free of charge, to any person obtaining a copy # of this software and associated documentation files (the "Software"), to deal # in the Software without restriction, including without limitation the rights # to use, copy, modify, merge, publish, distribute, sublicense, and/or sell # copies of the Software, and to permit persons to whom the Software is # furnished to do so, subject to the following conditions: # # The above copyright notice and this permission notice shall be included in all # copies or substantial portions of the Software. # # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR # IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, # FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE # AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER # LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, # OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE # SOFTWARE. INSTALL = ['libva', 'libva-utils', 'gmmlib', 'ffmpeg', 'metrics-calc-lite', 'media-driver', 'mediasdk'] TEST_SCRIPT_PATH = infra_path / 'driver_tests' TEST_ENV = { 'MFX_HOME': '/opt/intel/mediasdk', 'LD_LIBRARY_PATH': '/opt/intel/mediasdk/lib64', 'LIBVA_DRIVERS_PATH': '/opt/intel/msdk_driver/lib64', 'LIBVA_DRIVER_NAME': 'iHD' } DRIVER_TESTS = [ 'CABA1_SVA_B', 'CABA1_Sony_D', 'avc_cbr_001', 'avc_cqp_001', 'scale_001' ] ARTIFACTS_LAYOUT = { str(options['LOGS_DIR']): 'logs', str(infra_path / 'ted/results'): 'mediasdk', str(infra_path / 'smoke_test' / 'hevc_fei_tests_res.log'): 'hevc_fei_tests.log' } action(f'Create temp dir for driver tests', work_dir=TEST_SCRIPT_PATH, cmd=f'mkdir -p temp', verbose=True) for test_id in DRIVER_TESTS: action(f'Run media-driver test {test_id}', work_dir=TEST_SCRIPT_PATH, cmd=f'python3 run_test.py {test_id}', env=TEST_ENV, verbose=True) action(f'Run MediaSDK TED test', work_dir=infra_path, cmd=f'python3 ted/ted.py', env=TEST_ENV, verbose=True) action(f'Run MediaSDK fei test', work_dir=infra_path, cmd=f'python3 smoke_test/hevc_fei_smoke_test.py', env=TEST_ENV, verbose=True)
install = ['libva', 'libva-utils', 'gmmlib', 'ffmpeg', 'metrics-calc-lite', 'media-driver', 'mediasdk'] test_script_path = infra_path / 'driver_tests' test_env = {'MFX_HOME': '/opt/intel/mediasdk', 'LD_LIBRARY_PATH': '/opt/intel/mediasdk/lib64', 'LIBVA_DRIVERS_PATH': '/opt/intel/msdk_driver/lib64', 'LIBVA_DRIVER_NAME': 'iHD'} driver_tests = ['CABA1_SVA_B', 'CABA1_Sony_D', 'avc_cbr_001', 'avc_cqp_001', 'scale_001'] artifacts_layout = {str(options['LOGS_DIR']): 'logs', str(infra_path / 'ted/results'): 'mediasdk', str(infra_path / 'smoke_test' / 'hevc_fei_tests_res.log'): 'hevc_fei_tests.log'} action(f'Create temp dir for driver tests', work_dir=TEST_SCRIPT_PATH, cmd=f'mkdir -p temp', verbose=True) for test_id in DRIVER_TESTS: action(f'Run media-driver test {test_id}', work_dir=TEST_SCRIPT_PATH, cmd=f'python3 run_test.py {test_id}', env=TEST_ENV, verbose=True) action(f'Run MediaSDK TED test', work_dir=infra_path, cmd=f'python3 ted/ted.py', env=TEST_ENV, verbose=True) action(f'Run MediaSDK fei test', work_dir=infra_path, cmd=f'python3 smoke_test/hevc_fei_smoke_test.py', env=TEST_ENV, verbose=True)
# This is my first Python Project using Project Euler. # Find the sum of all the multiples of 3 or 5 below 1000. # The easy and efficient way # (1 + 2 + 3 + .... n) = 1/2 n(n+1) print(0.5*((333*1002)+(199*1000)-(66*1005))) # The second way # I am defining a function to sum up all of the multiples of 3 and 5. # I did not finish it because it did not work. def sum(): # The multiples have to below 1000, they are between 1 and 1000 (including 1) Number = range(1, 1000) # In order to tell if the numbers are multiples of a number, you use modular arithmetic. You divide all # the numbers by the number and see if the remainder is 0. The symbol is %. def Multiple_of_3(): for x in Number: y = x / 3 print(y) if type(y) == int: print(x) else: pass Multiple_of_3() sum() # A third way I found on Project Euler Website that works. a = range(1000) count = 0 for i in a: if i%3 !=0 and i%5 !=0:continue count += i print('sum:',count)
print(0.5 * (333 * 1002 + 199 * 1000 - 66 * 1005)) def sum(): number = range(1, 1000) def multiple_of_3(): for x in Number: y = x / 3 print(y) if type(y) == int: print(x) else: pass multiple_of_3() sum() a = range(1000) count = 0 for i in a: if i % 3 != 0 and i % 5 != 0: continue count += i print('sum:', count)
""" Adds the even valued numbers of the fibonacci series below limit Author: Juan Rios """ def fibonacci_sum(limit): a = 1 b = 2 sum = 0 while (b<limit): if (b%2==0): sum += b temp = b b += a a = temp return sum if __name__ == "__main__": limit = 4000000 print('The sum of even-valued fibonnaci terms below {0} is {1}'.format(limit, fibonacci_sum(limit)))
""" Adds the even valued numbers of the fibonacci series below limit Author: Juan Rios """ def fibonacci_sum(limit): a = 1 b = 2 sum = 0 while b < limit: if b % 2 == 0: sum += b temp = b b += a a = temp return sum if __name__ == '__main__': limit = 4000000 print('The sum of even-valued fibonnaci terms below {0} is {1}'.format(limit, fibonacci_sum(limit)))
''' File: __init__.py Project: src File Created: Sunday, 28th February 2021 3:03:13 am Author: Sparsh Dutta (sparsh.dtt@gmail.com) ----- Last Modified: Sunday, 28th February 2021 3:03:13 am Modified By: Sparsh Dutta (sparsh.dtt@gmail.com>) ----- Copyright 2021 Sparsh Dutta '''
""" File: __init__.py Project: src File Created: Sunday, 28th February 2021 3:03:13 am Author: Sparsh Dutta (sparsh.dtt@gmail.com) ----- Last Modified: Sunday, 28th February 2021 3:03:13 am Modified By: Sparsh Dutta (sparsh.dtt@gmail.com>) ----- Copyright 2021 Sparsh Dutta """
""":mod:`Stock` -- Provides an interface for Neopets stocks .. module:: Stock :synopsis: Provides an interface for Neopets stocks .. moduleauthor:: Kelly McBride <kemcbride28@gmail.com> """ def clean_numeric(string_value): # Clean commas cleaned = string_value.replace(',', '') # Clean percent signs cleaned = cleaned.replace('%', '') return cleaned class Stock: """ An class representing a Neopets stock Attributes ticker open current price qty || volume % change company -- maybe null chg -- maybe null paid -- maybe null mkt value -- maybe null """ def __init__(self, data): """ Initialized with data from an HTML row """ # Required Data self.ticker = data['ticker'].split()[0] self.volume = int(clean_numeric(data.get('volume', data.get('qty', '')))) self.open_price = int(clean_numeric(data['open'])) self.curr_price = int(clean_numeric(data.get('curr'))) self.percent_change = float(clean_numeric(data['change'])) / 100. # Optional Data self.company = data.get('company', '') self.absolute_change = data.get('chg') self.paid = data.get('paid') self.mkt_value = data.get('mkt value')
""":mod:`Stock` -- Provides an interface for Neopets stocks .. module:: Stock :synopsis: Provides an interface for Neopets stocks .. moduleauthor:: Kelly McBride <kemcbride28@gmail.com> """ def clean_numeric(string_value): cleaned = string_value.replace(',', '') cleaned = cleaned.replace('%', '') return cleaned class Stock: """ An class representing a Neopets stock Attributes ticker open current price qty || volume % change company -- maybe null chg -- maybe null paid -- maybe null mkt value -- maybe null """ def __init__(self, data): """ Initialized with data from an HTML row """ self.ticker = data['ticker'].split()[0] self.volume = int(clean_numeric(data.get('volume', data.get('qty', '')))) self.open_price = int(clean_numeric(data['open'])) self.curr_price = int(clean_numeric(data.get('curr'))) self.percent_change = float(clean_numeric(data['change'])) / 100.0 self.company = data.get('company', '') self.absolute_change = data.get('chg') self.paid = data.get('paid') self.mkt_value = data.get('mkt value')
jpg1 = 0 jpg2 = 0 img1 = 0 img2 = 0 def setup(): global jpg1, jpg2 background(100) smooth() size(1200, 700) noStroke() jpg1 = loadImage ('br1.jpg') jpg2 = loadImage ('bread1.gif') def draw(): global jpg1, jpg2 if ( frameCount == 1): image (jpg1 ,0 ,0) val1 = int (random (0, 150)) val2 = int (random (0, 150)) img1 = jpg1.get(mouseX+val1, 0, 20, height) img2 = jpg1.get(mouseX+val2, 0, 5, height) blendMode (SUBTRACT) tint (255, 20) image (img1, mouseX+val1, random(0, height )) blendMode ( BLEND ) noTint() image (img2, mouseX-val2, 0) image (jpg2, 0, 0) def keyPressed(): if key == 's': saveFrame( "myProcessing" + str(frameCount) + ".jpg ")
jpg1 = 0 jpg2 = 0 img1 = 0 img2 = 0 def setup(): global jpg1, jpg2 background(100) smooth() size(1200, 700) no_stroke() jpg1 = load_image('br1.jpg') jpg2 = load_image('bread1.gif') def draw(): global jpg1, jpg2 if frameCount == 1: image(jpg1, 0, 0) val1 = int(random(0, 150)) val2 = int(random(0, 150)) img1 = jpg1.get(mouseX + val1, 0, 20, height) img2 = jpg1.get(mouseX + val2, 0, 5, height) blend_mode(SUBTRACT) tint(255, 20) image(img1, mouseX + val1, random(0, height)) blend_mode(BLEND) no_tint() image(img2, mouseX - val2, 0) image(jpg2, 0, 0) def key_pressed(): if key == 's': save_frame('myProcessing' + str(frameCount) + '.jpg ')
def slices(series, length): if len(series) <= 0 or length <= 0: raise ValueError("invalid arguments.") if length > len(series): raise ValueError(f"Cannot get {length} digit series from a {len(series)} digit string.") resultList = [] diff = len(series) - length +1 for i in range (diff): resultList.append(series[i:i+length]) return resultList
def slices(series, length): if len(series) <= 0 or length <= 0: raise value_error('invalid arguments.') if length > len(series): raise value_error(f'Cannot get {length} digit series from a {len(series)} digit string.') result_list = [] diff = len(series) - length + 1 for i in range(diff): resultList.append(series[i:i + length]) return resultList
#!/usr/bin/env python3 # -*- coding: utf-8 -*- """ Created on Sun Mar 10 19:48:36 2019 @author: dvdgmf """ class MeteorologicalDiagnosis: def __init__(self, obs, pred): self.tptn = self.get_TPTN(obs, pred) self.tn = self.tptn.count('TN') self.tp = self.tptn.count('TP') self.fn = self.tptn.count('FN') self.fp = self.tptn.count('FP') @staticmethod def get_TPTN(obs, pred): if len(obs) == len(pred): if all(O in [0, 1] for O in obs) and all(P in [0, 1] for P in pred): output_list = [] test = { (0, 0): "TN", (1, 1): "TP", (0, 1): "FN", (1, 0): "FP" } for O, P in zip(obs, pred): output_list.append(test.get((O, P))) return output_list else: print('Invalid values present in Y-Observed and/or Y-Predicted.' 'Only binary values 0 and 1 are supported!') else: print('Invalid list size. Y-Observed and Y-Predicted must match!') def metrics(self): val_accuracy = self.tryMetrics(self.accuracy) val_bias = self.tryMetrics(self.bias) val_pod = self.tryMetrics(self.pod) val_pofd = self.tryMetrics(self.pofd) val_far = self.tryMetrics(self.far) val_csi = self.tryMetrics(self.csi) val_ph = self.tryMetrics(self.ph) val_ets = self.tryMetrics(self.ets) val_hss = self.tryMetrics(self.hss) val_hkd = self.tryMetrics(self.hkd) return val_accuracy, val_bias, val_pod, val_pofd, val_far, val_csi, val_ph, val_ets, val_hss, val_hkd def tryMetrics(self, fx): tptn = self.tptn tn = self.tn tp = self.tp fn = self.fn fp = self.fp try: result = fx(tptn, tn, tp, fn, fp) return result except ZeroDivisionError as e: pass print('ZeroDivisionError:', e) return None except TypeError as e: pass print('TypeError:', e) return None def accuracy(self, tptn,tn,tp,fn,fp): return (tp + tn) / len(tptn) def bias(self, tptn,tn,tp,fn,fp): return (tp + fp) / (tp + fn) def pod(self, tptn,tn,tp,fn,fp): return tp / (tp + fn) def pofd(self, tptn,tn,tp,fn,fp): return fp / (fp + tn) def far(self, tptn,tn,tp,fn,fp): return fp / (tp + fp) def csi(self, tptn,tn,tp,fn,fp): return tp / (tp + fp + fn) def ph(self, tptn,tn,tp,fn,fp): return ((tp + tn) * (tp + fp)) / (tp + tn + fp + fn) def ets(self, tptn,tn,tp,fn,fp): val_ph = self.tryMetrics(self.ph) return (tp - val_ph) / (tp + fp + fn - val_ph) def hss(self, tptn,tn,tp,fn,fp): return ((tp * tn) - (fp * fn)) / ((((tp + fn) * (fn + tn)) + ((tp + fp) * (fp + tn))) / 2) def hkd(self, tptn,tn,tp,fn,fp): val_pod = self.tryMetrics(self.pod) val_pofd = self.tryMetrics(self.pofd) return val_pod - val_pofd # --------------------------------------------- if __name__ == '__main__': obs = [0, 1, 1, 0, 0, 0, 1, 1, 0, 1, 0, 1, 0, 0, 1, 1, 0, 0, 1] pred = [0, 1, 0, 0, 1, 0, 1, 1, 0, 0, 1, 1, 0, 1, 0, 1, 0, 1, 1] mozao_tools = MeteorologicalDiagnosis(obs, pred) val_accuracy, val_bias, val_pod, val_pofd, val_far, val_csi, val_ph, val_ets, val_hss, val_hkd = mozao_tools.metrics() print('metrics:\n accuracy: {}\n bias: {}\n pod: {}\n pofd: {}\n far: {}' '\n csi: {}\n ph: {}\n ets: {}\n hss: {}\n hkd: {}\n'.format(val_accuracy, val_bias, val_pod, val_pofd, val_far, val_csi, val_ph, val_ets, val_hss, val_hkd))
""" Created on Sun Mar 10 19:48:36 2019 @author: dvdgmf """ class Meteorologicaldiagnosis: def __init__(self, obs, pred): self.tptn = self.get_TPTN(obs, pred) self.tn = self.tptn.count('TN') self.tp = self.tptn.count('TP') self.fn = self.tptn.count('FN') self.fp = self.tptn.count('FP') @staticmethod def get_tptn(obs, pred): if len(obs) == len(pred): if all((O in [0, 1] for o in obs)) and all((P in [0, 1] for p in pred)): output_list = [] test = {(0, 0): 'TN', (1, 1): 'TP', (0, 1): 'FN', (1, 0): 'FP'} for (o, p) in zip(obs, pred): output_list.append(test.get((O, P))) return output_list else: print('Invalid values present in Y-Observed and/or Y-Predicted.Only binary values 0 and 1 are supported!') else: print('Invalid list size. Y-Observed and Y-Predicted must match!') def metrics(self): val_accuracy = self.tryMetrics(self.accuracy) val_bias = self.tryMetrics(self.bias) val_pod = self.tryMetrics(self.pod) val_pofd = self.tryMetrics(self.pofd) val_far = self.tryMetrics(self.far) val_csi = self.tryMetrics(self.csi) val_ph = self.tryMetrics(self.ph) val_ets = self.tryMetrics(self.ets) val_hss = self.tryMetrics(self.hss) val_hkd = self.tryMetrics(self.hkd) return (val_accuracy, val_bias, val_pod, val_pofd, val_far, val_csi, val_ph, val_ets, val_hss, val_hkd) def try_metrics(self, fx): tptn = self.tptn tn = self.tn tp = self.tp fn = self.fn fp = self.fp try: result = fx(tptn, tn, tp, fn, fp) return result except ZeroDivisionError as e: pass print('ZeroDivisionError:', e) return None except TypeError as e: pass print('TypeError:', e) return None def accuracy(self, tptn, tn, tp, fn, fp): return (tp + tn) / len(tptn) def bias(self, tptn, tn, tp, fn, fp): return (tp + fp) / (tp + fn) def pod(self, tptn, tn, tp, fn, fp): return tp / (tp + fn) def pofd(self, tptn, tn, tp, fn, fp): return fp / (fp + tn) def far(self, tptn, tn, tp, fn, fp): return fp / (tp + fp) def csi(self, tptn, tn, tp, fn, fp): return tp / (tp + fp + fn) def ph(self, tptn, tn, tp, fn, fp): return (tp + tn) * (tp + fp) / (tp + tn + fp + fn) def ets(self, tptn, tn, tp, fn, fp): val_ph = self.tryMetrics(self.ph) return (tp - val_ph) / (tp + fp + fn - val_ph) def hss(self, tptn, tn, tp, fn, fp): return (tp * tn - fp * fn) / (((tp + fn) * (fn + tn) + (tp + fp) * (fp + tn)) / 2) def hkd(self, tptn, tn, tp, fn, fp): val_pod = self.tryMetrics(self.pod) val_pofd = self.tryMetrics(self.pofd) return val_pod - val_pofd if __name__ == '__main__': obs = [0, 1, 1, 0, 0, 0, 1, 1, 0, 1, 0, 1, 0, 0, 1, 1, 0, 0, 1] pred = [0, 1, 0, 0, 1, 0, 1, 1, 0, 0, 1, 1, 0, 1, 0, 1, 0, 1, 1] mozao_tools = meteorological_diagnosis(obs, pred) (val_accuracy, val_bias, val_pod, val_pofd, val_far, val_csi, val_ph, val_ets, val_hss, val_hkd) = mozao_tools.metrics() print('metrics:\n accuracy: {}\n bias: {}\n pod: {}\n pofd: {}\n far: {}\n csi: {}\n ph: {}\n ets: {}\n hss: {}\n hkd: {}\n'.format(val_accuracy, val_bias, val_pod, val_pofd, val_far, val_csi, val_ph, val_ets, val_hss, val_hkd))
""" .. module:: base_geometry :platform: Unix, Windows :synopsis: Base classes for geometry """ def validate_knot(knot): """ Confirm a knot is in the range [0, 1] Parameters ---------- knot : float Parameter to verify Returns ------- bool Whether or not the knot is valid """ return (0.0 <= knot <= 1.0)
""" .. module:: base_geometry :platform: Unix, Windows :synopsis: Base classes for geometry """ def validate_knot(knot): """ Confirm a knot is in the range [0, 1] Parameters ---------- knot : float Parameter to verify Returns ------- bool Whether or not the knot is valid """ return 0.0 <= knot <= 1.0
class Solution: def removeDuplicates(self, nums): """ :type nums: List[int] :rtype: int """ if not nums: return 0 if len(nums) == 1: return 1 idx = 1 for n in nums[2:]: if n > nums[idx - 1]: idx += 1 nums[idx] = n return idx + 1
class Solution: def remove_duplicates(self, nums): """ :type nums: List[int] :rtype: int """ if not nums: return 0 if len(nums) == 1: return 1 idx = 1 for n in nums[2:]: if n > nums[idx - 1]: idx += 1 nums[idx] = n return idx + 1
class Solution: def gameOfLife(self, board: List[List[int]]) -> None: """ Do not return anything, modify board in-place instead. """
class Solution: def game_of_life(self, board: List[List[int]]) -> None: """ Do not return anything, modify board in-place instead. """
# parsetab.py # This file is automatically generated. Do not edit. # pylint: disable=W,C,R _tabversion = '3.10' _lr_method = 'LALR' _lr_signature = 'AND ASSIGN COMMA DEF DIFF DIVIDE ELIF ELSE EQ FALSE FLOAT FOR GET GT ID IF IN INTEGER LBRACE LBRACKET LET LPAREN LT MINUS MINUSMINUS MULTIPLY NOT OR PLUS PLUSPLUS RBRACE RBRACKET RPAREN SEMI STRING TRUE WHILEcode : code sent\n\t\t\t\t| sent\n\t\t\t\t| emptysent : statement\n\t\t\t\t| instruction SEMIinstruction : assign\n\t\t\t\t\t | functionstatement : function_definition\n\t\t\t\t\t | for_statement\n\t\t\t\t\t | if_statement\n\t\t\t\t\t | while_statementfor_statement : FOR LPAREN for_valid_expr COMMA for_valid_expr COMMA for_valid_iter RPAREN LBRACE code RBRACE\n\t\t\t\t\t \t | FOR LPAREN ID IN ID RPAREN LBRACE code RBRACEfor_valid_expr : expr_num\n\t\t\t\t\t\t | expr_arithmfor_valid_iter : PLUS\n\t\t\t\t\t\t | PLUSPLUS\n\t\t\t\t\t\t | MINUS\n\t\t\t\t\t\t | MINUSMINUSif_statement : IF LPAREN logic_list RPAREN LBRACE code RBRACE\n\t\t\t \t\t\t| IF LPAREN logic_list RPAREN LBRACE code RBRACE elif_sent\n\t\t\t \t\t\t| IF LPAREN logic_list RPAREN LBRACE code RBRACE ELSE LBRACE code RBRACE\n\t\t\t \t\t\t| IF LPAREN logic_list RPAREN LBRACE code RBRACE elif_sent ELSE LBRACE code RBRACEelif_sent : ELIF LPAREN logic_list RPAREN LBRACE code RBRACE elif_sent\n\t\t\t\t\t | emptywhile_statement : WHILE LPAREN logic_list RPAREN LBRACE code RBRACEfunction_definition : DEF ID LPAREN RPAREN LBRACE code RBRACEassign : ID ASSIGN expr_type\n\t\t\t\t | ID ASSIGN expr_arithm\n\t\t\t\t | ID ASSIGN logic_list\n\t\t\t\t | ID ASSIGN expr_listassign : ID ASSIGN functionfunction : ID LPAREN list RPARENlist : list COMMA ID\n\t\t\t\t| list COMMA function\n\t\t\t\t| function\n\t\t\t\t| IDlist : list COMMA expr_type\n\t\t\t\t| expr_type\n\t\t\t\t| emptylist : list COMMA expr_arithm\n\t\t\t\t| list COMMA logic_list\n\t\t\t\t| expr_arithm\n\t\t\t\t| logic_listlogic_list : LPAREN logic_list RPARENlogic_list : logic_list AND logic_list\n\t\t\t\t\t | logic_list OR logic_list\n\t\t\t\t\t | expr_boolexpr_bool : expr_bool EQ expr_bool\n\t\t\t\t\t | expr_bool LT expr_bool\n\t\t\t\t\t | expr_bool LET expr_bool\n\t\t\t\t\t | expr_bool GT expr_bool\n\t\t\t\t\t | expr_bool GET expr_bool\n\t\t\t\t\t | expr_bool DIFF expr_bool\n\t\t\t\t\t | NOT expr_boolexpr_bool : functionexpr_bool : expr_type\n\t\t\t\t\t | expr_arithmexpr_arithm : LPAREN expr_arithm RPARENexpr_arithm : expr_arithm PLUS expr_arithm\n\t\t\t\t\t | expr_arithm MINUS expr_arithm\n\t\t\t\t\t | expr_arithm MULTIPLY expr_arithm\n\t\t\t\t\t | expr_arithm DIVIDE expr_arithm\n\t\t\t\t\t | MINUS expr_arithmexpr_arithm : ID\n\t\t\t\t\t | functionexpr_arithm : expr_typefunction : sent_index_listsent_index_list : sent_index_list LBRACKET ID RBRACKET\n\t\t\t\t\t\t | ID LBRACKET ID RBRACKETsent_index_list : sent_index_list LBRACKET INTEGER RBRACKET\n\t\t\t\t\t\t | ID LBRACKET INTEGER RBRACKETexpr_list : LBRACKET expr_inside_list RBRACKETexpr_inside_list : expr_inside_list COMMA expr_type\n\t\t\t\t\t\t\t| expr_inside_list COMMA expr_bool\n\t\t\t\t\t\t\t| expr_type\n\t\t\t\t\t\t\t| expr_bool\n\t\t\t\t\t\t\t| emptyexpr_type : expr_num\n\t\t\t\t\t | expr_stringexpr_bool : TRUEexpr_bool : FALSEexpr_num : FLOAT\n\t\t\t\t\t| INTEGERexpr_string : STRINGempty :' _lr_action_items = {'DEF':([0,1,2,3,4,6,7,8,9,18,19,106,130,131,132,137,138,139,145,146,147,149,150,153,154,155,157,159,160,161,163,164,165,167,168,169,170,171,],[12,12,-2,-3,-4,-8,-9,-10,-11,-1,-5,12,12,12,12,12,12,-27,12,-20,-26,12,-21,-25,12,-13,12,12,12,12,-12,12,-22,-23,12,12,-86,-24,]),'FOR':([0,1,2,3,4,6,7,8,9,18,19,106,130,131,132,137,138,139,145,146,147,149,150,153,154,155,157,159,160,161,163,164,165,167,168,169,170,171,],[14,14,-2,-3,-4,-8,-9,-10,-11,-1,-5,14,14,14,14,14,14,-27,14,-20,-26,14,-21,-25,14,-13,14,14,14,14,-12,14,-22,-23,14,14,-86,-24,]),'IF':([0,1,2,3,4,6,7,8,9,18,19,106,130,131,132,137,138,139,145,146,147,149,150,153,154,155,157,159,160,161,163,164,165,167,168,169,170,171,],[15,15,-2,-3,-4,-8,-9,-10,-11,-1,-5,15,15,15,15,15,15,-27,15,-20,-26,15,-21,-25,15,-13,15,15,15,15,-12,15,-22,-23,15,15,-86,-24,]),'WHILE':([0,1,2,3,4,6,7,8,9,18,19,106,130,131,132,137,138,139,145,146,147,149,150,153,154,155,157,159,160,161,163,164,165,167,168,169,170,171,],[16,16,-2,-3,-4,-8,-9,-10,-11,-1,-5,16,16,16,16,16,16,-27,16,-20,-26,16,-21,-25,16,-13,16,16,16,16,-12,16,-22,-23,16,16,-86,-24,]),'ID':([0,1,2,3,4,6,7,8,9,12,18,19,21,22,23,24,25,26,27,37,38,40,44,56,63,73,74,75,76,77,78,84,85,86,87,88,89,96,100,101,106,122,130,131,132,137,138,139,145,146,147,149,150,153,154,155,157,158,159,160,161,163,164,165,167,168,169,170,171,],[13,13,-2,-3,-4,-8,-9,-10,-11,20,-1,-5,29,47,54,58,68,68,70,29,29,68,68,29,29,29,29,29,29,68,68,68,68,68,68,68,68,123,29,129,13,68,13,13,13,13,13,-27,13,-20,-26,13,-21,-25,13,-13,13,68,13,13,13,-12,13,-22,-23,13,13,-86,-24,]),'$end':([0,1,2,3,4,6,7,8,9,18,19,139,146,147,150,153,155,163,165,167,170,171,],[-86,0,-2,-3,-4,-8,-9,-10,-11,-1,-5,-27,-20,-26,-21,-25,-13,-12,-22,-23,-86,-24,]),'RBRACE':([2,3,4,6,7,8,9,18,19,106,130,131,132,137,138,139,145,146,147,149,150,153,154,155,157,159,160,161,163,164,165,167,168,169,170,171,],[-2,-3,-4,-8,-9,-10,-11,-1,-5,-86,-86,-86,139,146,147,-27,-86,-20,-26,155,-21,-25,-86,-13,-86,163,-86,165,-12,167,-22,-23,-86,170,-86,-24,]),'SEMI':([5,10,11,17,29,30,31,32,33,34,35,36,39,41,42,43,45,46,61,62,65,66,67,68,83,94,95,97,98,104,105,107,108,109,110,111,112,113,114,115,116,117,118,119,120,121,],[19,-6,-7,-68,-65,-28,-29,-30,-31,-32,-79,-80,-48,-83,-84,-85,-81,-82,-66,-67,-56,-57,-58,-65,-64,-55,-33,-70,-72,-69,-71,-60,-61,-62,-63,-46,-47,-59,-45,-49,-50,-51,-52,-53,-54,-73,]),'ASSIGN':([13,],[21,]),'LPAREN':([13,14,15,16,20,21,22,24,25,26,29,37,38,40,44,47,56,58,63,68,73,74,75,76,77,78,84,85,86,87,88,89,96,100,122,123,152,158,],[22,24,25,26,28,37,37,56,63,63,22,37,56,56,56,22,56,22,63,22,56,56,56,56,63,63,56,56,56,56,56,56,37,56,56,22,158,63,]),'LBRACKET':([13,17,21,29,47,58,68,97,98,104,105,123,],[23,27,40,23,23,23,23,-70,-72,-69,-71,23,]),'PLUS':([17,29,30,31,34,35,36,41,42,43,47,49,50,52,58,59,60,61,62,65,66,67,68,79,81,82,83,91,95,97,98,99,104,105,107,108,109,110,113,123,124,125,126,133,135,],[-68,-65,-67,73,-66,-79,-80,-83,-84,-85,-65,-66,-67,73,-65,-79,73,-66,-67,-66,-67,73,-65,73,-66,-67,73,-67,-33,-70,-72,73,-69,-71,73,73,73,73,-59,-65,-66,-67,73,-67,141,]),'MINUS':([17,21,22,24,25,26,29,30,31,34,35,36,37,38,40,41,42,43,44,47,49,50,52,56,58,59,60,61,62,63,65,66,67,68,73,74,75,76,77,78,79,81,82,83,84,85,86,87,88,89,91,95,96,97,98,99,100,104,105,107,108,109,110,113,122,123,124,125,126,133,135,158,],[-68,38,38,38,38,38,-65,-67,74,-66,-79,-80,38,38,38,-83,-84,-85,38,-65,-66,-67,74,38,-65,-79,74,-66,-67,38,-66,-67,74,-65,38,38,38,38,38,38,74,-66,-67,74,38,38,38,38,38,38,-67,-33,38,-70,-72,74,38,-69,-71,74,74,74,74,-59,38,-65,-66,-67,74,-67,143,38,]),'MULTIPLY':([17,29,30,31,34,35,36,41,42,43,47,49,50,52,58,59,60,61,62,65,66,67,68,79,81,82,83,91,95,97,98,99,104,105,107,108,109,110,113,123,124,125,126,133,],[-68,-65,-67,75,-66,-79,-80,-83,-84,-85,-65,-66,-67,75,-65,-79,75,-66,-67,-66,-67,75,-65,75,-66,-67,75,-67,-33,-70,-72,75,-69,-71,75,75,75,75,-59,-65,-66,-67,75,-67,]),'DIVIDE':([17,29,30,31,34,35,36,41,42,43,47,49,50,52,58,59,60,61,62,65,66,67,68,79,81,82,83,91,95,97,98,99,104,105,107,108,109,110,113,123,124,125,126,133,],[-68,-65,-67,76,-66,-79,-80,-83,-84,-85,-65,-66,-67,76,-65,-79,76,-66,-67,-66,-67,76,-65,76,-66,-67,76,-67,-33,-70,-72,76,-69,-71,76,76,76,76,-59,-65,-66,-67,76,-67,]),'EQ':([17,29,30,31,34,35,36,39,41,42,43,45,46,47,49,50,52,61,62,65,66,67,68,79,81,82,83,91,92,94,95,97,98,104,105,107,108,109,110,113,115,116,117,118,119,120,123,124,125,126,133,134,],[-68,-65,-57,-58,-56,-79,-80,84,-83,-84,-85,-81,-82,-65,-56,-57,-58,-66,-67,-56,-57,-58,-65,-58,-56,-57,-64,-57,84,84,-33,-70,-72,-69,-71,-60,-61,-62,-63,-59,84,84,84,84,84,84,-65,-56,-57,-58,-57,84,]),'LT':([17,29,30,31,34,35,36,39,41,42,43,45,46,47,49,50,52,61,62,65,66,67,68,79,81,82,83,91,92,94,95,97,98,104,105,107,108,109,110,113,115,116,117,118,119,120,123,124,125,126,133,134,],[-68,-65,-57,-58,-56,-79,-80,85,-83,-84,-85,-81,-82,-65,-56,-57,-58,-66,-67,-56,-57,-58,-65,-58,-56,-57,-64,-57,85,85,-33,-70,-72,-69,-71,-60,-61,-62,-63,-59,85,85,85,85,85,85,-65,-56,-57,-58,-57,85,]),'LET':([17,29,30,31,34,35,36,39,41,42,43,45,46,47,49,50,52,61,62,65,66,67,68,79,81,82,83,91,92,94,95,97,98,104,105,107,108,109,110,113,115,116,117,118,119,120,123,124,125,126,133,134,],[-68,-65,-57,-58,-56,-79,-80,86,-83,-84,-85,-81,-82,-65,-56,-57,-58,-66,-67,-56,-57,-58,-65,-58,-56,-57,-64,-57,86,86,-33,-70,-72,-69,-71,-60,-61,-62,-63,-59,86,86,86,86,86,86,-65,-56,-57,-58,-57,86,]),'GT':([17,29,30,31,34,35,36,39,41,42,43,45,46,47,49,50,52,61,62,65,66,67,68,79,81,82,83,91,92,94,95,97,98,104,105,107,108,109,110,113,115,116,117,118,119,120,123,124,125,126,133,134,],[-68,-65,-57,-58,-56,-79,-80,87,-83,-84,-85,-81,-82,-65,-56,-57,-58,-66,-67,-56,-57,-58,-65,-58,-56,-57,-64,-57,87,87,-33,-70,-72,-69,-71,-60,-61,-62,-63,-59,87,87,87,87,87,87,-65,-56,-57,-58,-57,87,]),'GET':([17,29,30,31,34,35,36,39,41,42,43,45,46,47,49,50,52,61,62,65,66,67,68,79,81,82,83,91,92,94,95,97,98,104,105,107,108,109,110,113,115,116,117,118,119,120,123,124,125,126,133,134,],[-68,-65,-57,-58,-56,-79,-80,88,-83,-84,-85,-81,-82,-65,-56,-57,-58,-66,-67,-56,-57,-58,-65,-58,-56,-57,-64,-57,88,88,-33,-70,-72,-69,-71,-60,-61,-62,-63,-59,88,88,88,88,88,88,-65,-56,-57,-58,-57,88,]),'DIFF':([17,29,30,31,34,35,36,39,41,42,43,45,46,47,49,50,52,61,62,65,66,67,68,79,81,82,83,91,92,94,95,97,98,104,105,107,108,109,110,113,115,116,117,118,119,120,123,124,125,126,133,134,],[-68,-65,-57,-58,-56,-79,-80,89,-83,-84,-85,-81,-82,-65,-56,-57,-58,-66,-67,-56,-57,-58,-65,-58,-56,-57,-64,-57,89,89,-33,-70,-72,-69,-71,-60,-61,-62,-63,-59,89,89,89,89,89,89,-65,-56,-57,-58,-57,89,]),'AND':([17,29,30,31,32,34,35,36,39,41,42,43,45,46,47,49,50,52,53,61,62,64,65,66,67,68,69,79,80,81,82,83,94,95,97,98,104,105,107,108,109,110,111,112,113,114,115,116,117,118,119,120,123,124,125,126,127,162,],[-68,-65,-57,-58,77,-56,-79,-80,-48,-83,-84,-85,-81,-82,-65,-56,-57,-58,77,-66,-67,77,-56,-57,-58,-65,77,-58,77,-56,-57,-64,-55,-33,-70,-72,-69,-71,-60,-61,-62,-63,77,77,-59,-45,-49,-50,-51,-52,-53,-54,-65,-56,-57,-58,77,77,]),'OR':([17,29,30,31,32,34,35,36,39,41,42,43,45,46,47,49,50,52,53,61,62,64,65,66,67,68,69,79,80,81,82,83,94,95,97,98,104,105,107,108,109,110,111,112,113,114,115,116,117,118,119,120,123,124,125,126,127,162,],[-68,-65,-57,-58,78,-56,-79,-80,-48,-83,-84,-85,-81,-82,-65,-56,-57,-58,78,-66,-67,78,-56,-57,-58,-65,78,-58,78,-56,-57,-64,-55,-33,-70,-72,-69,-71,-60,-61,-62,-63,78,78,-59,-45,-49,-50,-51,-52,-53,-54,-65,-56,-57,-58,78,78,]),'RPAREN':([17,22,28,29,35,36,39,41,42,43,45,46,47,48,49,50,51,52,53,61,62,64,65,66,67,68,69,79,80,81,82,83,94,95,97,98,99,104,105,107,108,109,110,111,112,113,114,115,116,117,118,119,120,123,124,125,126,127,129,140,141,142,143,144,162,],[-68,-86,72,-65,-79,-80,-48,-83,-84,-85,-81,-82,-37,95,-36,-39,-40,-43,-44,-66,-67,102,-56,-57,-58,-65,103,113,114,-56,-57,-64,-55,-33,-70,-72,113,-69,-71,-60,-61,-62,-63,-46,-47,-59,-45,-49,-50,-51,-52,-53,-54,-34,-35,-38,-41,-42,136,148,-16,-17,-18,-19,166,]),'COMMA':([17,22,29,35,36,39,40,41,42,43,45,46,47,48,49,50,51,52,53,57,58,59,60,61,62,65,66,67,68,83,90,91,92,93,94,95,97,98,104,105,107,108,109,110,111,112,113,114,115,116,117,118,119,120,123,124,125,126,127,128,133,134,],[-68,-86,-65,-79,-80,-48,-86,-83,-84,-85,-81,-82,-37,96,-36,-39,-40,-43,-44,100,-65,-14,-15,-66,-67,-56,-57,-58,-65,-64,122,-57,-77,-78,-55,-33,-70,-72,-69,-71,-60,-61,-62,-63,-46,-47,-59,-45,-49,-50,-51,-52,-53,-54,-34,-35,-38,-41,-42,135,-57,-75,]),'RBRACKET':([17,29,35,36,40,41,42,43,45,46,54,55,61,62,65,66,67,68,70,71,83,90,91,92,93,94,95,97,98,104,105,107,108,109,110,113,115,116,117,118,119,120,133,134,],[-68,-65,-79,-80,-86,-83,-84,-85,-81,-82,97,98,-66,-67,-56,-57,-58,-65,104,105,-64,121,-57,-77,-78,-55,-33,-70,-72,-69,-71,-60,-61,-62,-63,-59,-49,-50,-51,-52,-53,-54,-57,-75,]),'FLOAT':([21,22,24,25,26,37,38,40,44,56,63,73,74,75,76,77,78,84,85,86,87,88,89,96,100,122,158,],[41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,]),'INTEGER':([21,22,23,24,25,26,27,37,38,40,44,56,63,73,74,75,76,77,78,84,85,86,87,88,89,96,100,122,158,],[42,42,55,42,42,42,71,42,42,42,42,42,42,42,42,42,42,42,42,42,42,42,42,42,42,42,42,42,42,]),'STRING':([21,22,24,25,26,37,38,40,44,56,63,73,74,75,76,77,78,84,85,86,87,88,89,96,100,122,158,],[43,43,43,43,43,43,43,43,43,43,43,43,43,43,43,43,43,43,43,43,43,43,43,43,43,43,43,]),'NOT':([21,22,25,26,37,40,44,63,77,78,84,85,86,87,88,89,96,122,158,],[44,44,44,44,44,44,44,44,44,44,44,44,44,44,44,44,44,44,44,]),'TRUE':([21,22,25,26,37,40,44,63,77,78,84,85,86,87,88,89,96,122,158,],[45,45,45,45,45,45,45,45,45,45,45,45,45,45,45,45,45,45,45,]),'FALSE':([21,22,25,26,37,40,44,63,77,78,84,85,86,87,88,89,96,122,158,],[46,46,46,46,46,46,46,46,46,46,46,46,46,46,46,46,46,46,46,]),'IN':([58,],[101,]),'LBRACE':([72,102,103,136,148,151,156,166,],[106,130,131,145,154,157,160,168,]),'PLUSPLUS':([135,],[142,]),'MINUSMINUS':([135,],[144,]),'ELSE':([146,150,153,170,171,],[151,156,-25,-86,-24,]),'ELIF':([146,170,],[152,152,]),} _lr_action = {} for _k, _v in _lr_action_items.items(): for _x,_y in zip(_v[0],_v[1]): if not _x in _lr_action: _lr_action[_x] = {} _lr_action[_x][_k] = _y del _lr_action_items _lr_goto_items = {'code':([0,106,130,131,145,154,157,160,168,],[1,132,137,138,149,159,161,164,169,]),'sent':([0,1,106,130,131,132,137,138,145,149,154,157,159,160,161,164,168,169,],[2,18,2,2,2,18,18,18,2,18,2,2,18,2,18,18,2,18,]),'empty':([0,22,40,106,130,131,145,146,154,157,160,168,170,],[3,51,93,3,3,3,3,153,3,3,3,3,153,]),'statement':([0,1,106,130,131,132,137,138,145,149,154,157,159,160,161,164,168,169,],[4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,]),'instruction':([0,1,106,130,131,132,137,138,145,149,154,157,159,160,161,164,168,169,],[5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,]),'function_definition':([0,1,106,130,131,132,137,138,145,149,154,157,159,160,161,164,168,169,],[6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,]),'for_statement':([0,1,106,130,131,132,137,138,145,149,154,157,159,160,161,164,168,169,],[7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,]),'if_statement':([0,1,106,130,131,132,137,138,145,149,154,157,159,160,161,164,168,169,],[8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,]),'while_statement':([0,1,106,130,131,132,137,138,145,149,154,157,159,160,161,164,168,169,],[9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,]),'assign':([0,1,106,130,131,132,137,138,145,149,154,157,159,160,161,164,168,169,],[10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,]),'function':([0,1,21,22,24,25,26,37,38,40,44,56,63,73,74,75,76,77,78,84,85,86,87,88,89,96,100,106,122,130,131,132,137,138,145,149,154,157,158,159,160,161,164,168,169,],[11,11,34,49,61,65,65,81,61,65,65,61,81,61,61,61,61,65,65,65,65,65,65,65,65,124,61,11,65,11,11,11,11,11,11,11,11,11,65,11,11,11,11,11,11,]),'sent_index_list':([0,1,21,22,24,25,26,37,38,40,44,56,63,73,74,75,76,77,78,84,85,86,87,88,89,96,100,106,122,130,131,132,137,138,145,149,154,157,158,159,160,161,164,168,169,],[17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,]),'expr_type':([21,22,24,25,26,37,38,40,44,56,63,73,74,75,76,77,78,84,85,86,87,88,89,96,100,122,158,],[30,50,62,66,66,82,62,91,66,62,82,62,62,62,62,66,66,66,66,66,66,66,66,125,62,133,66,]),'expr_arithm':([21,22,24,25,26,37,38,40,44,56,63,73,74,75,76,77,78,84,85,86,87,88,89,96,100,122,158,],[31,52,60,67,67,79,83,67,67,99,79,107,108,109,110,67,67,67,67,67,67,67,67,126,60,67,67,]),'logic_list':([21,22,25,26,37,63,77,78,96,158,],[32,53,64,69,80,80,111,112,127,162,]),'expr_list':([21,],[33,]),'expr_num':([21,22,24,25,26,37,38,40,44,56,63,73,74,75,76,77,78,84,85,86,87,88,89,96,100,122,158,],[35,35,59,35,35,35,35,35,35,35,35,35,35,35,35,35,35,35,35,35,35,35,35,35,59,35,35,]),'expr_string':([21,22,24,25,26,37,38,40,44,56,63,73,74,75,76,77,78,84,85,86,87,88,89,96,100,122,158,],[36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,]),'expr_bool':([21,22,25,26,37,40,44,63,77,78,84,85,86,87,88,89,96,122,158,],[39,39,39,39,39,92,94,39,39,39,115,116,117,118,119,120,39,134,39,]),'list':([22,],[48,]),'for_valid_expr':([24,100,],[57,128,]),'expr_inside_list':([40,],[90,]),'for_valid_iter':([135,],[140,]),'elif_sent':([146,170,],[150,171,]),} _lr_goto = {} for _k, _v in _lr_goto_items.items(): for _x, _y in zip(_v[0], _v[1]): if not _x in _lr_goto: _lr_goto[_x] = {} _lr_goto[_x][_k] = _y del _lr_goto_items _lr_productions = [ ("S' -> code","S'",1,None,None,None), ('code -> code sent','code',2,'p_code','nbz_parser.py',41), ('code -> sent','code',1,'p_code','nbz_parser.py',42), ('code -> empty','code',1,'p_code','nbz_parser.py',43), ('sent -> statement','sent',1,'p_sent','nbz_parser.py',54), ('sent -> instruction SEMI','sent',2,'p_sent','nbz_parser.py',55), ('instruction -> assign','instruction',1,'p_instruction','nbz_parser.py',59), ('instruction -> function','instruction',1,'p_instruction','nbz_parser.py',60), ('statement -> function_definition','statement',1,'p_statement','nbz_parser.py',64), ('statement -> for_statement','statement',1,'p_statement','nbz_parser.py',65), ('statement -> if_statement','statement',1,'p_statement','nbz_parser.py',66), ('statement -> while_statement','statement',1,'p_statement','nbz_parser.py',67), ('for_statement -> FOR LPAREN for_valid_expr COMMA for_valid_expr COMMA for_valid_iter RPAREN LBRACE code RBRACE','for_statement',11,'p_sent_for_flow_int','nbz_parser.py',71), ('for_statement -> FOR LPAREN ID IN ID RPAREN LBRACE code RBRACE','for_statement',9,'p_sent_for_flow_int','nbz_parser.py',72), ('for_valid_expr -> expr_num','for_valid_expr',1,'p_for_valid_expressions_num','nbz_parser.py',85), ('for_valid_expr -> expr_arithm','for_valid_expr',1,'p_for_valid_expressions_num','nbz_parser.py',86), ('for_valid_iter -> PLUS','for_valid_iter',1,'p_for_valid_iterators','nbz_parser.py',90), ('for_valid_iter -> PLUSPLUS','for_valid_iter',1,'p_for_valid_iterators','nbz_parser.py',91), ('for_valid_iter -> MINUS','for_valid_iter',1,'p_for_valid_iterators','nbz_parser.py',92), ('for_valid_iter -> MINUSMINUS','for_valid_iter',1,'p_for_valid_iterators','nbz_parser.py',93), ('if_statement -> IF LPAREN logic_list RPAREN LBRACE code RBRACE','if_statement',7,'p_sent_if_flow','nbz_parser.py',97), ('if_statement -> IF LPAREN logic_list RPAREN LBRACE code RBRACE elif_sent','if_statement',8,'p_sent_if_flow','nbz_parser.py',98), ('if_statement -> IF LPAREN logic_list RPAREN LBRACE code RBRACE ELSE LBRACE code RBRACE','if_statement',11,'p_sent_if_flow','nbz_parser.py',99), ('if_statement -> IF LPAREN logic_list RPAREN LBRACE code RBRACE elif_sent ELSE LBRACE code RBRACE','if_statement',12,'p_sent_if_flow','nbz_parser.py',100), ('elif_sent -> ELIF LPAREN logic_list RPAREN LBRACE code RBRACE elif_sent','elif_sent',8,'p_sent_elif_flow','nbz_parser.py',130), ('elif_sent -> empty','elif_sent',1,'p_sent_elif_flow','nbz_parser.py',131), ('while_statement -> WHILE LPAREN logic_list RPAREN LBRACE code RBRACE','while_statement',7,'p_sent_while_flow','nbz_parser.py',141), ('function_definition -> DEF ID LPAREN RPAREN LBRACE code RBRACE','function_definition',7,'p_function_definition','nbz_parser.py',148), ('assign -> ID ASSIGN expr_type','assign',3,'p_assign_expr','nbz_parser.py',156), ('assign -> ID ASSIGN expr_arithm','assign',3,'p_assign_expr','nbz_parser.py',157), ('assign -> ID ASSIGN logic_list','assign',3,'p_assign_expr','nbz_parser.py',158), ('assign -> ID ASSIGN expr_list','assign',3,'p_assign_expr','nbz_parser.py',159), ('assign -> ID ASSIGN function','assign',3,'p_assign_func','nbz_parser.py',165), ('function -> ID LPAREN list RPAREN','function',4,'p_expr_funcs','nbz_parser.py',172), ('list -> list COMMA ID','list',3,'p_list_var','nbz_parser.py',182), ('list -> list COMMA function','list',3,'p_list_var','nbz_parser.py',183), ('list -> function','list',1,'p_list_var','nbz_parser.py',184), ('list -> ID','list',1,'p_list_var','nbz_parser.py',185), ('list -> list COMMA expr_type','list',3,'p_list_value','nbz_parser.py',224), ('list -> expr_type','list',1,'p_list_value','nbz_parser.py',225), ('list -> empty','list',1,'p_list_value','nbz_parser.py',226), ('list -> list COMMA expr_arithm','list',3,'p_list_expression','nbz_parser.py',237), ('list -> list COMMA logic_list','list',3,'p_list_expression','nbz_parser.py',238), ('list -> expr_arithm','list',1,'p_list_expression','nbz_parser.py',239), ('list -> logic_list','list',1,'p_list_expression','nbz_parser.py',240), ('logic_list -> LPAREN logic_list RPAREN','logic_list',3,'p_group_logic_list','nbz_parser.py',248), ('logic_list -> logic_list AND logic_list','logic_list',3,'p_logic_list','nbz_parser.py',252), ('logic_list -> logic_list OR logic_list','logic_list',3,'p_logic_list','nbz_parser.py',253), ('logic_list -> expr_bool','logic_list',1,'p_logic_list','nbz_parser.py',254), ('expr_bool -> expr_bool EQ expr_bool','expr_bool',3,'p_expr_logical','nbz_parser.py',264), ('expr_bool -> expr_bool LT expr_bool','expr_bool',3,'p_expr_logical','nbz_parser.py',265), ('expr_bool -> expr_bool LET expr_bool','expr_bool',3,'p_expr_logical','nbz_parser.py',266), ('expr_bool -> expr_bool GT expr_bool','expr_bool',3,'p_expr_logical','nbz_parser.py',267), ('expr_bool -> expr_bool GET expr_bool','expr_bool',3,'p_expr_logical','nbz_parser.py',268), ('expr_bool -> expr_bool DIFF expr_bool','expr_bool',3,'p_expr_logical','nbz_parser.py',269), ('expr_bool -> NOT expr_bool','expr_bool',2,'p_expr_logical','nbz_parser.py',270), ('expr_bool -> function','expr_bool',1,'p_logic_valid_var','nbz_parser.py',287), ('expr_bool -> expr_type','expr_bool',1,'p_logic_valid_type','nbz_parser.py',297), ('expr_bool -> expr_arithm','expr_bool',1,'p_logic_valid_type','nbz_parser.py',298), ('expr_arithm -> LPAREN expr_arithm RPAREN','expr_arithm',3,'p_group_expr_arithmethic','nbz_parser.py',302), ('expr_arithm -> expr_arithm PLUS expr_arithm','expr_arithm',3,'p_expr_aritmethic','nbz_parser.py',306), ('expr_arithm -> expr_arithm MINUS expr_arithm','expr_arithm',3,'p_expr_aritmethic','nbz_parser.py',307), ('expr_arithm -> expr_arithm MULTIPLY expr_arithm','expr_arithm',3,'p_expr_aritmethic','nbz_parser.py',308), ('expr_arithm -> expr_arithm DIVIDE expr_arithm','expr_arithm',3,'p_expr_aritmethic','nbz_parser.py',309), ('expr_arithm -> MINUS expr_arithm','expr_arithm',2,'p_expr_aritmethic','nbz_parser.py',310), ('expr_arithm -> ID','expr_arithm',1,'p_arithm_valid_var','nbz_parser.py',323), ('expr_arithm -> function','expr_arithm',1,'p_arithm_valid_var','nbz_parser.py',324), ('expr_arithm -> expr_type','expr_arithm',1,'p_arithm_valid_num','nbz_parser.py',343), ('function -> sent_index_list','function',1,'p_sent_index_list','nbz_parser.py',347), ('sent_index_list -> sent_index_list LBRACKET ID RBRACKET','sent_index_list',4,'p_index_list_var','nbz_parser.py',351), ('sent_index_list -> ID LBRACKET ID RBRACKET','sent_index_list',4,'p_index_list_var','nbz_parser.py',352), ('sent_index_list -> sent_index_list LBRACKET INTEGER RBRACKET','sent_index_list',4,'p_index_list_value','nbz_parser.py',378), ('sent_index_list -> ID LBRACKET INTEGER RBRACKET','sent_index_list',4,'p_index_list_value','nbz_parser.py',379), ('expr_list -> LBRACKET expr_inside_list RBRACKET','expr_list',3,'p_expr_list','nbz_parser.py',393), ('expr_inside_list -> expr_inside_list COMMA expr_type','expr_inside_list',3,'p_list_expr_inside_list','nbz_parser.py',397), ('expr_inside_list -> expr_inside_list COMMA expr_bool','expr_inside_list',3,'p_list_expr_inside_list','nbz_parser.py',398), ('expr_inside_list -> expr_type','expr_inside_list',1,'p_list_expr_inside_list','nbz_parser.py',399), ('expr_inside_list -> expr_bool','expr_inside_list',1,'p_list_expr_inside_list','nbz_parser.py',400), ('expr_inside_list -> empty','expr_inside_list',1,'p_list_expr_inside_list','nbz_parser.py',401), ('expr_type -> expr_num','expr_type',1,'p_expr_type','nbz_parser.py',412), ('expr_type -> expr_string','expr_type',1,'p_expr_type','nbz_parser.py',413), ('expr_bool -> TRUE','expr_bool',1,'p_expr_bool_true','nbz_parser.py',417), ('expr_bool -> FALSE','expr_bool',1,'p_expr_bool_false','nbz_parser.py',421), ('expr_num -> FLOAT','expr_num',1,'p_expr_number','nbz_parser.py',425), ('expr_num -> INTEGER','expr_num',1,'p_expr_number','nbz_parser.py',426), ('expr_string -> STRING','expr_string',1,'p_expr_string','nbz_parser.py',430), ('empty -> <empty>','empty',0,'p_empty','nbz_parser.py',435), ]
_tabversion = '3.10' _lr_method = 'LALR' _lr_signature = 'AND ASSIGN COMMA DEF DIFF DIVIDE ELIF ELSE EQ FALSE FLOAT FOR GET GT ID IF IN INTEGER LBRACE LBRACKET LET LPAREN LT MINUS MINUSMINUS MULTIPLY NOT OR PLUS PLUSPLUS RBRACE RBRACKET RPAREN SEMI STRING TRUE WHILEcode : code sent\n\t\t\t\t| sent\n\t\t\t\t| emptysent : statement\n\t\t\t\t| instruction SEMIinstruction : assign\n\t\t\t\t\t | functionstatement : function_definition\n\t\t\t\t\t | for_statement\n\t\t\t\t\t | if_statement\n\t\t\t\t\t | while_statementfor_statement : FOR LPAREN for_valid_expr COMMA for_valid_expr COMMA for_valid_iter RPAREN LBRACE code RBRACE\n\t\t\t\t\t \t | FOR LPAREN ID IN ID RPAREN LBRACE code RBRACEfor_valid_expr : expr_num\n\t\t\t\t\t\t | expr_arithmfor_valid_iter : PLUS\n\t\t\t\t\t\t | PLUSPLUS\n\t\t\t\t\t\t | MINUS\n\t\t\t\t\t\t | MINUSMINUSif_statement : IF LPAREN logic_list RPAREN LBRACE code RBRACE\n\t\t\t \t\t\t| IF LPAREN logic_list RPAREN LBRACE code RBRACE elif_sent\n\t\t\t \t\t\t| IF LPAREN logic_list RPAREN LBRACE code RBRACE ELSE LBRACE code RBRACE\n\t\t\t \t\t\t| IF LPAREN logic_list RPAREN LBRACE code RBRACE elif_sent ELSE LBRACE code RBRACEelif_sent : ELIF LPAREN logic_list RPAREN LBRACE code RBRACE elif_sent\n\t\t\t\t\t | emptywhile_statement : WHILE LPAREN logic_list RPAREN LBRACE code RBRACEfunction_definition : DEF ID LPAREN RPAREN LBRACE code RBRACEassign : ID ASSIGN expr_type\n\t\t\t\t | ID ASSIGN expr_arithm\n\t\t\t\t | ID ASSIGN logic_list\n\t\t\t\t | ID ASSIGN expr_listassign : ID ASSIGN functionfunction : ID LPAREN list RPARENlist : list COMMA ID\n\t\t\t\t| list COMMA function\n\t\t\t\t| function\n\t\t\t\t| IDlist : list COMMA expr_type\n\t\t\t\t| expr_type\n\t\t\t\t| emptylist : list COMMA expr_arithm\n\t\t\t\t| list COMMA logic_list\n\t\t\t\t| expr_arithm\n\t\t\t\t| logic_listlogic_list : LPAREN logic_list RPARENlogic_list : logic_list AND logic_list\n\t\t\t\t\t | logic_list OR logic_list\n\t\t\t\t\t | expr_boolexpr_bool : expr_bool EQ expr_bool\n\t\t\t\t\t | expr_bool LT expr_bool\n\t\t\t\t\t | expr_bool LET expr_bool\n\t\t\t\t\t | expr_bool GT expr_bool\n\t\t\t\t\t | expr_bool GET expr_bool\n\t\t\t\t\t | expr_bool DIFF expr_bool\n\t\t\t\t\t | NOT expr_boolexpr_bool : functionexpr_bool : expr_type\n\t\t\t\t\t | expr_arithmexpr_arithm : LPAREN expr_arithm RPARENexpr_arithm : expr_arithm PLUS expr_arithm\n\t\t\t\t\t | expr_arithm MINUS expr_arithm\n\t\t\t\t\t | expr_arithm MULTIPLY expr_arithm\n\t\t\t\t\t | expr_arithm DIVIDE expr_arithm\n\t\t\t\t\t | MINUS expr_arithmexpr_arithm : ID\n\t\t\t\t\t | functionexpr_arithm : expr_typefunction : sent_index_listsent_index_list : sent_index_list LBRACKET ID RBRACKET\n\t\t\t\t\t\t | ID LBRACKET ID RBRACKETsent_index_list : sent_index_list LBRACKET INTEGER RBRACKET\n\t\t\t\t\t\t | ID LBRACKET INTEGER RBRACKETexpr_list : LBRACKET expr_inside_list RBRACKETexpr_inside_list : expr_inside_list COMMA expr_type\n\t\t\t\t\t\t\t| expr_inside_list COMMA expr_bool\n\t\t\t\t\t\t\t| expr_type\n\t\t\t\t\t\t\t| expr_bool\n\t\t\t\t\t\t\t| emptyexpr_type : expr_num\n\t\t\t\t\t | expr_stringexpr_bool : TRUEexpr_bool : FALSEexpr_num : FLOAT\n\t\t\t\t\t| INTEGERexpr_string : STRINGempty :' _lr_action_items = {'DEF': ([0, 1, 2, 3, 4, 6, 7, 8, 9, 18, 19, 106, 130, 131, 132, 137, 138, 139, 145, 146, 147, 149, 150, 153, 154, 155, 157, 159, 160, 161, 163, 164, 165, 167, 168, 169, 170, 171], [12, 12, -2, -3, -4, -8, -9, -10, -11, -1, -5, 12, 12, 12, 12, 12, 12, -27, 12, -20, -26, 12, -21, -25, 12, -13, 12, 12, 12, 12, -12, 12, -22, -23, 12, 12, -86, -24]), 'FOR': ([0, 1, 2, 3, 4, 6, 7, 8, 9, 18, 19, 106, 130, 131, 132, 137, 138, 139, 145, 146, 147, 149, 150, 153, 154, 155, 157, 159, 160, 161, 163, 164, 165, 167, 168, 169, 170, 171], [14, 14, -2, -3, -4, -8, -9, -10, -11, -1, -5, 14, 14, 14, 14, 14, 14, -27, 14, -20, -26, 14, -21, -25, 14, -13, 14, 14, 14, 14, -12, 14, -22, -23, 14, 14, -86, -24]), 'IF': ([0, 1, 2, 3, 4, 6, 7, 8, 9, 18, 19, 106, 130, 131, 132, 137, 138, 139, 145, 146, 147, 149, 150, 153, 154, 155, 157, 159, 160, 161, 163, 164, 165, 167, 168, 169, 170, 171], [15, 15, -2, -3, -4, -8, -9, -10, -11, -1, -5, 15, 15, 15, 15, 15, 15, -27, 15, -20, -26, 15, -21, -25, 15, -13, 15, 15, 15, 15, -12, 15, -22, -23, 15, 15, -86, -24]), 'WHILE': ([0, 1, 2, 3, 4, 6, 7, 8, 9, 18, 19, 106, 130, 131, 132, 137, 138, 139, 145, 146, 147, 149, 150, 153, 154, 155, 157, 159, 160, 161, 163, 164, 165, 167, 168, 169, 170, 171], [16, 16, -2, -3, -4, -8, -9, -10, -11, -1, -5, 16, 16, 16, 16, 16, 16, -27, 16, -20, -26, 16, -21, -25, 16, -13, 16, 16, 16, 16, -12, 16, -22, -23, 16, 16, -86, -24]), 'ID': ([0, 1, 2, 3, 4, 6, 7, 8, 9, 12, 18, 19, 21, 22, 23, 24, 25, 26, 27, 37, 38, 40, 44, 56, 63, 73, 74, 75, 76, 77, 78, 84, 85, 86, 87, 88, 89, 96, 100, 101, 106, 122, 130, 131, 132, 137, 138, 139, 145, 146, 147, 149, 150, 153, 154, 155, 157, 158, 159, 160, 161, 163, 164, 165, 167, 168, 169, 170, 171], [13, 13, -2, -3, -4, -8, -9, -10, -11, 20, -1, -5, 29, 47, 54, 58, 68, 68, 70, 29, 29, 68, 68, 29, 29, 29, 29, 29, 29, 68, 68, 68, 68, 68, 68, 68, 68, 123, 29, 129, 13, 68, 13, 13, 13, 13, 13, -27, 13, -20, -26, 13, -21, -25, 13, -13, 13, 68, 13, 13, 13, -12, 13, -22, -23, 13, 13, -86, -24]), '$end': ([0, 1, 2, 3, 4, 6, 7, 8, 9, 18, 19, 139, 146, 147, 150, 153, 155, 163, 165, 167, 170, 171], [-86, 0, -2, -3, -4, -8, -9, -10, -11, -1, -5, -27, -20, -26, -21, -25, -13, -12, -22, -23, -86, -24]), 'RBRACE': ([2, 3, 4, 6, 7, 8, 9, 18, 19, 106, 130, 131, 132, 137, 138, 139, 145, 146, 147, 149, 150, 153, 154, 155, 157, 159, 160, 161, 163, 164, 165, 167, 168, 169, 170, 171], [-2, -3, -4, -8, -9, -10, -11, -1, -5, -86, -86, -86, 139, 146, 147, -27, -86, -20, -26, 155, -21, -25, -86, -13, -86, 163, -86, 165, -12, 167, -22, -23, -86, 170, -86, -24]), 'SEMI': ([5, 10, 11, 17, 29, 30, 31, 32, 33, 34, 35, 36, 39, 41, 42, 43, 45, 46, 61, 62, 65, 66, 67, 68, 83, 94, 95, 97, 98, 104, 105, 107, 108, 109, 110, 111, 112, 113, 114, 115, 116, 117, 118, 119, 120, 121], [19, -6, -7, -68, -65, -28, -29, -30, -31, -32, -79, -80, -48, -83, -84, -85, -81, -82, -66, -67, -56, -57, -58, -65, -64, -55, -33, -70, -72, -69, -71, -60, -61, -62, -63, -46, -47, -59, -45, -49, -50, -51, -52, -53, -54, -73]), 'ASSIGN': ([13], [21]), 'LPAREN': ([13, 14, 15, 16, 20, 21, 22, 24, 25, 26, 29, 37, 38, 40, 44, 47, 56, 58, 63, 68, 73, 74, 75, 76, 77, 78, 84, 85, 86, 87, 88, 89, 96, 100, 122, 123, 152, 158], [22, 24, 25, 26, 28, 37, 37, 56, 63, 63, 22, 37, 56, 56, 56, 22, 56, 22, 63, 22, 56, 56, 56, 56, 63, 63, 56, 56, 56, 56, 56, 56, 37, 56, 56, 22, 158, 63]), 'LBRACKET': ([13, 17, 21, 29, 47, 58, 68, 97, 98, 104, 105, 123], [23, 27, 40, 23, 23, 23, 23, -70, -72, -69, -71, 23]), 'PLUS': ([17, 29, 30, 31, 34, 35, 36, 41, 42, 43, 47, 49, 50, 52, 58, 59, 60, 61, 62, 65, 66, 67, 68, 79, 81, 82, 83, 91, 95, 97, 98, 99, 104, 105, 107, 108, 109, 110, 113, 123, 124, 125, 126, 133, 135], [-68, -65, -67, 73, -66, -79, -80, -83, -84, -85, -65, -66, -67, 73, -65, -79, 73, -66, -67, -66, -67, 73, -65, 73, -66, -67, 73, -67, -33, -70, -72, 73, -69, -71, 73, 73, 73, 73, -59, -65, -66, -67, 73, -67, 141]), 'MINUS': ([17, 21, 22, 24, 25, 26, 29, 30, 31, 34, 35, 36, 37, 38, 40, 41, 42, 43, 44, 47, 49, 50, 52, 56, 58, 59, 60, 61, 62, 63, 65, 66, 67, 68, 73, 74, 75, 76, 77, 78, 79, 81, 82, 83, 84, 85, 86, 87, 88, 89, 91, 95, 96, 97, 98, 99, 100, 104, 105, 107, 108, 109, 110, 113, 122, 123, 124, 125, 126, 133, 135, 158], [-68, 38, 38, 38, 38, 38, -65, -67, 74, -66, -79, -80, 38, 38, 38, -83, -84, -85, 38, -65, -66, -67, 74, 38, -65, -79, 74, -66, -67, 38, -66, -67, 74, -65, 38, 38, 38, 38, 38, 38, 74, -66, -67, 74, 38, 38, 38, 38, 38, 38, -67, -33, 38, -70, -72, 74, 38, -69, -71, 74, 74, 74, 74, -59, 38, -65, -66, -67, 74, -67, 143, 38]), 'MULTIPLY': ([17, 29, 30, 31, 34, 35, 36, 41, 42, 43, 47, 49, 50, 52, 58, 59, 60, 61, 62, 65, 66, 67, 68, 79, 81, 82, 83, 91, 95, 97, 98, 99, 104, 105, 107, 108, 109, 110, 113, 123, 124, 125, 126, 133], [-68, -65, -67, 75, -66, -79, -80, -83, -84, -85, -65, -66, -67, 75, -65, -79, 75, -66, -67, -66, -67, 75, -65, 75, -66, -67, 75, -67, -33, -70, -72, 75, -69, -71, 75, 75, 75, 75, -59, -65, -66, -67, 75, -67]), 'DIVIDE': ([17, 29, 30, 31, 34, 35, 36, 41, 42, 43, 47, 49, 50, 52, 58, 59, 60, 61, 62, 65, 66, 67, 68, 79, 81, 82, 83, 91, 95, 97, 98, 99, 104, 105, 107, 108, 109, 110, 113, 123, 124, 125, 126, 133], [-68, -65, -67, 76, -66, -79, -80, -83, -84, -85, -65, -66, -67, 76, -65, -79, 76, -66, -67, -66, -67, 76, -65, 76, -66, -67, 76, -67, -33, -70, -72, 76, -69, -71, 76, 76, 76, 76, -59, -65, -66, -67, 76, -67]), 'EQ': ([17, 29, 30, 31, 34, 35, 36, 39, 41, 42, 43, 45, 46, 47, 49, 50, 52, 61, 62, 65, 66, 67, 68, 79, 81, 82, 83, 91, 92, 94, 95, 97, 98, 104, 105, 107, 108, 109, 110, 113, 115, 116, 117, 118, 119, 120, 123, 124, 125, 126, 133, 134], [-68, -65, -57, -58, -56, -79, -80, 84, -83, -84, -85, -81, -82, -65, -56, -57, -58, -66, -67, -56, -57, -58, -65, -58, -56, -57, -64, -57, 84, 84, -33, -70, -72, -69, -71, -60, -61, -62, -63, -59, 84, 84, 84, 84, 84, 84, -65, -56, -57, -58, -57, 84]), 'LT': ([17, 29, 30, 31, 34, 35, 36, 39, 41, 42, 43, 45, 46, 47, 49, 50, 52, 61, 62, 65, 66, 67, 68, 79, 81, 82, 83, 91, 92, 94, 95, 97, 98, 104, 105, 107, 108, 109, 110, 113, 115, 116, 117, 118, 119, 120, 123, 124, 125, 126, 133, 134], [-68, -65, -57, -58, -56, -79, -80, 85, -83, -84, -85, -81, -82, -65, -56, -57, -58, -66, -67, -56, -57, -58, -65, -58, -56, -57, -64, -57, 85, 85, -33, -70, -72, -69, -71, -60, -61, -62, -63, -59, 85, 85, 85, 85, 85, 85, -65, -56, -57, -58, -57, 85]), 'LET': ([17, 29, 30, 31, 34, 35, 36, 39, 41, 42, 43, 45, 46, 47, 49, 50, 52, 61, 62, 65, 66, 67, 68, 79, 81, 82, 83, 91, 92, 94, 95, 97, 98, 104, 105, 107, 108, 109, 110, 113, 115, 116, 117, 118, 119, 120, 123, 124, 125, 126, 133, 134], [-68, -65, -57, -58, -56, -79, -80, 86, -83, -84, -85, -81, -82, -65, -56, -57, -58, -66, -67, -56, -57, -58, -65, -58, -56, -57, -64, -57, 86, 86, -33, -70, -72, -69, -71, -60, -61, -62, -63, -59, 86, 86, 86, 86, 86, 86, -65, -56, -57, -58, -57, 86]), 'GT': ([17, 29, 30, 31, 34, 35, 36, 39, 41, 42, 43, 45, 46, 47, 49, 50, 52, 61, 62, 65, 66, 67, 68, 79, 81, 82, 83, 91, 92, 94, 95, 97, 98, 104, 105, 107, 108, 109, 110, 113, 115, 116, 117, 118, 119, 120, 123, 124, 125, 126, 133, 134], [-68, -65, -57, -58, -56, -79, -80, 87, -83, -84, -85, -81, -82, -65, -56, -57, -58, -66, -67, -56, -57, -58, -65, -58, -56, -57, -64, -57, 87, 87, -33, -70, -72, -69, -71, -60, -61, -62, -63, -59, 87, 87, 87, 87, 87, 87, -65, -56, -57, -58, -57, 87]), 'GET': ([17, 29, 30, 31, 34, 35, 36, 39, 41, 42, 43, 45, 46, 47, 49, 50, 52, 61, 62, 65, 66, 67, 68, 79, 81, 82, 83, 91, 92, 94, 95, 97, 98, 104, 105, 107, 108, 109, 110, 113, 115, 116, 117, 118, 119, 120, 123, 124, 125, 126, 133, 134], [-68, -65, -57, -58, -56, -79, -80, 88, -83, -84, -85, -81, -82, -65, -56, -57, -58, -66, -67, -56, -57, -58, -65, -58, -56, -57, -64, -57, 88, 88, -33, -70, -72, -69, -71, -60, -61, -62, -63, -59, 88, 88, 88, 88, 88, 88, -65, -56, -57, -58, -57, 88]), 'DIFF': ([17, 29, 30, 31, 34, 35, 36, 39, 41, 42, 43, 45, 46, 47, 49, 50, 52, 61, 62, 65, 66, 67, 68, 79, 81, 82, 83, 91, 92, 94, 95, 97, 98, 104, 105, 107, 108, 109, 110, 113, 115, 116, 117, 118, 119, 120, 123, 124, 125, 126, 133, 134], [-68, -65, -57, -58, -56, -79, -80, 89, -83, -84, -85, -81, -82, -65, -56, -57, -58, -66, -67, -56, -57, -58, -65, -58, -56, -57, -64, -57, 89, 89, -33, -70, -72, -69, -71, -60, -61, -62, -63, -59, 89, 89, 89, 89, 89, 89, -65, -56, -57, -58, -57, 89]), 'AND': ([17, 29, 30, 31, 32, 34, 35, 36, 39, 41, 42, 43, 45, 46, 47, 49, 50, 52, 53, 61, 62, 64, 65, 66, 67, 68, 69, 79, 80, 81, 82, 83, 94, 95, 97, 98, 104, 105, 107, 108, 109, 110, 111, 112, 113, 114, 115, 116, 117, 118, 119, 120, 123, 124, 125, 126, 127, 162], [-68, -65, -57, -58, 77, -56, -79, -80, -48, -83, -84, -85, -81, -82, -65, -56, -57, -58, 77, -66, -67, 77, -56, -57, -58, -65, 77, -58, 77, -56, -57, -64, -55, -33, -70, -72, -69, -71, -60, -61, -62, -63, 77, 77, -59, -45, -49, -50, -51, -52, -53, -54, -65, -56, -57, -58, 77, 77]), 'OR': ([17, 29, 30, 31, 32, 34, 35, 36, 39, 41, 42, 43, 45, 46, 47, 49, 50, 52, 53, 61, 62, 64, 65, 66, 67, 68, 69, 79, 80, 81, 82, 83, 94, 95, 97, 98, 104, 105, 107, 108, 109, 110, 111, 112, 113, 114, 115, 116, 117, 118, 119, 120, 123, 124, 125, 126, 127, 162], [-68, -65, -57, -58, 78, -56, -79, -80, -48, -83, -84, -85, -81, -82, -65, -56, -57, -58, 78, -66, -67, 78, -56, -57, -58, -65, 78, -58, 78, -56, -57, -64, -55, -33, -70, -72, -69, -71, -60, -61, -62, -63, 78, 78, -59, -45, -49, -50, -51, -52, -53, -54, -65, -56, -57, -58, 78, 78]), 'RPAREN': ([17, 22, 28, 29, 35, 36, 39, 41, 42, 43, 45, 46, 47, 48, 49, 50, 51, 52, 53, 61, 62, 64, 65, 66, 67, 68, 69, 79, 80, 81, 82, 83, 94, 95, 97, 98, 99, 104, 105, 107, 108, 109, 110, 111, 112, 113, 114, 115, 116, 117, 118, 119, 120, 123, 124, 125, 126, 127, 129, 140, 141, 142, 143, 144, 162], [-68, -86, 72, -65, -79, -80, -48, -83, -84, -85, -81, -82, -37, 95, -36, -39, -40, -43, -44, -66, -67, 102, -56, -57, -58, -65, 103, 113, 114, -56, -57, -64, -55, -33, -70, -72, 113, -69, -71, -60, -61, -62, -63, -46, -47, -59, -45, -49, -50, -51, -52, -53, -54, -34, -35, -38, -41, -42, 136, 148, -16, -17, -18, -19, 166]), 'COMMA': ([17, 22, 29, 35, 36, 39, 40, 41, 42, 43, 45, 46, 47, 48, 49, 50, 51, 52, 53, 57, 58, 59, 60, 61, 62, 65, 66, 67, 68, 83, 90, 91, 92, 93, 94, 95, 97, 98, 104, 105, 107, 108, 109, 110, 111, 112, 113, 114, 115, 116, 117, 118, 119, 120, 123, 124, 125, 126, 127, 128, 133, 134], [-68, -86, -65, -79, -80, -48, -86, -83, -84, -85, -81, -82, -37, 96, -36, -39, -40, -43, -44, 100, -65, -14, -15, -66, -67, -56, -57, -58, -65, -64, 122, -57, -77, -78, -55, -33, -70, -72, -69, -71, -60, -61, -62, -63, -46, -47, -59, -45, -49, -50, -51, -52, -53, -54, -34, -35, -38, -41, -42, 135, -57, -75]), 'RBRACKET': ([17, 29, 35, 36, 40, 41, 42, 43, 45, 46, 54, 55, 61, 62, 65, 66, 67, 68, 70, 71, 83, 90, 91, 92, 93, 94, 95, 97, 98, 104, 105, 107, 108, 109, 110, 113, 115, 116, 117, 118, 119, 120, 133, 134], [-68, -65, -79, -80, -86, -83, -84, -85, -81, -82, 97, 98, -66, -67, -56, -57, -58, -65, 104, 105, -64, 121, -57, -77, -78, -55, -33, -70, -72, -69, -71, -60, -61, -62, -63, -59, -49, -50, -51, -52, -53, -54, -57, -75]), 'FLOAT': ([21, 22, 24, 25, 26, 37, 38, 40, 44, 56, 63, 73, 74, 75, 76, 77, 78, 84, 85, 86, 87, 88, 89, 96, 100, 122, 158], [41, 41, 41, 41, 41, 41, 41, 41, 41, 41, 41, 41, 41, 41, 41, 41, 41, 41, 41, 41, 41, 41, 41, 41, 41, 41, 41]), 'INTEGER': ([21, 22, 23, 24, 25, 26, 27, 37, 38, 40, 44, 56, 63, 73, 74, 75, 76, 77, 78, 84, 85, 86, 87, 88, 89, 96, 100, 122, 158], [42, 42, 55, 42, 42, 42, 71, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42]), 'STRING': ([21, 22, 24, 25, 26, 37, 38, 40, 44, 56, 63, 73, 74, 75, 76, 77, 78, 84, 85, 86, 87, 88, 89, 96, 100, 122, 158], [43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43]), 'NOT': ([21, 22, 25, 26, 37, 40, 44, 63, 77, 78, 84, 85, 86, 87, 88, 89, 96, 122, 158], [44, 44, 44, 44, 44, 44, 44, 44, 44, 44, 44, 44, 44, 44, 44, 44, 44, 44, 44]), 'TRUE': ([21, 22, 25, 26, 37, 40, 44, 63, 77, 78, 84, 85, 86, 87, 88, 89, 96, 122, 158], [45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45]), 'FALSE': ([21, 22, 25, 26, 37, 40, 44, 63, 77, 78, 84, 85, 86, 87, 88, 89, 96, 122, 158], [46, 46, 46, 46, 46, 46, 46, 46, 46, 46, 46, 46, 46, 46, 46, 46, 46, 46, 46]), 'IN': ([58], [101]), 'LBRACE': ([72, 102, 103, 136, 148, 151, 156, 166], [106, 130, 131, 145, 154, 157, 160, 168]), 'PLUSPLUS': ([135], [142]), 'MINUSMINUS': ([135], [144]), 'ELSE': ([146, 150, 153, 170, 171], [151, 156, -25, -86, -24]), 'ELIF': ([146, 170], [152, 152])} _lr_action = {} for (_k, _v) in _lr_action_items.items(): for (_x, _y) in zip(_v[0], _v[1]): if not _x in _lr_action: _lr_action[_x] = {} _lr_action[_x][_k] = _y del _lr_action_items _lr_goto_items = {'code': ([0, 106, 130, 131, 145, 154, 157, 160, 168], [1, 132, 137, 138, 149, 159, 161, 164, 169]), 'sent': ([0, 1, 106, 130, 131, 132, 137, 138, 145, 149, 154, 157, 159, 160, 161, 164, 168, 169], [2, 18, 2, 2, 2, 18, 18, 18, 2, 18, 2, 2, 18, 2, 18, 18, 2, 18]), 'empty': ([0, 22, 40, 106, 130, 131, 145, 146, 154, 157, 160, 168, 170], [3, 51, 93, 3, 3, 3, 3, 153, 3, 3, 3, 3, 153]), 'statement': ([0, 1, 106, 130, 131, 132, 137, 138, 145, 149, 154, 157, 159, 160, 161, 164, 168, 169], [4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4]), 'instruction': ([0, 1, 106, 130, 131, 132, 137, 138, 145, 149, 154, 157, 159, 160, 161, 164, 168, 169], [5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5]), 'function_definition': ([0, 1, 106, 130, 131, 132, 137, 138, 145, 149, 154, 157, 159, 160, 161, 164, 168, 169], [6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6]), 'for_statement': ([0, 1, 106, 130, 131, 132, 137, 138, 145, 149, 154, 157, 159, 160, 161, 164, 168, 169], [7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7]), 'if_statement': ([0, 1, 106, 130, 131, 132, 137, 138, 145, 149, 154, 157, 159, 160, 161, 164, 168, 169], [8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8]), 'while_statement': ([0, 1, 106, 130, 131, 132, 137, 138, 145, 149, 154, 157, 159, 160, 161, 164, 168, 169], [9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9]), 'assign': ([0, 1, 106, 130, 131, 132, 137, 138, 145, 149, 154, 157, 159, 160, 161, 164, 168, 169], [10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10]), 'function': ([0, 1, 21, 22, 24, 25, 26, 37, 38, 40, 44, 56, 63, 73, 74, 75, 76, 77, 78, 84, 85, 86, 87, 88, 89, 96, 100, 106, 122, 130, 131, 132, 137, 138, 145, 149, 154, 157, 158, 159, 160, 161, 164, 168, 169], [11, 11, 34, 49, 61, 65, 65, 81, 61, 65, 65, 61, 81, 61, 61, 61, 61, 65, 65, 65, 65, 65, 65, 65, 65, 124, 61, 11, 65, 11, 11, 11, 11, 11, 11, 11, 11, 11, 65, 11, 11, 11, 11, 11, 11]), 'sent_index_list': ([0, 1, 21, 22, 24, 25, 26, 37, 38, 40, 44, 56, 63, 73, 74, 75, 76, 77, 78, 84, 85, 86, 87, 88, 89, 96, 100, 106, 122, 130, 131, 132, 137, 138, 145, 149, 154, 157, 158, 159, 160, 161, 164, 168, 169], [17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17]), 'expr_type': ([21, 22, 24, 25, 26, 37, 38, 40, 44, 56, 63, 73, 74, 75, 76, 77, 78, 84, 85, 86, 87, 88, 89, 96, 100, 122, 158], [30, 50, 62, 66, 66, 82, 62, 91, 66, 62, 82, 62, 62, 62, 62, 66, 66, 66, 66, 66, 66, 66, 66, 125, 62, 133, 66]), 'expr_arithm': ([21, 22, 24, 25, 26, 37, 38, 40, 44, 56, 63, 73, 74, 75, 76, 77, 78, 84, 85, 86, 87, 88, 89, 96, 100, 122, 158], [31, 52, 60, 67, 67, 79, 83, 67, 67, 99, 79, 107, 108, 109, 110, 67, 67, 67, 67, 67, 67, 67, 67, 126, 60, 67, 67]), 'logic_list': ([21, 22, 25, 26, 37, 63, 77, 78, 96, 158], [32, 53, 64, 69, 80, 80, 111, 112, 127, 162]), 'expr_list': ([21], [33]), 'expr_num': ([21, 22, 24, 25, 26, 37, 38, 40, 44, 56, 63, 73, 74, 75, 76, 77, 78, 84, 85, 86, 87, 88, 89, 96, 100, 122, 158], [35, 35, 59, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 59, 35, 35]), 'expr_string': ([21, 22, 24, 25, 26, 37, 38, 40, 44, 56, 63, 73, 74, 75, 76, 77, 78, 84, 85, 86, 87, 88, 89, 96, 100, 122, 158], [36, 36, 36, 36, 36, 36, 36, 36, 36, 36, 36, 36, 36, 36, 36, 36, 36, 36, 36, 36, 36, 36, 36, 36, 36, 36, 36]), 'expr_bool': ([21, 22, 25, 26, 37, 40, 44, 63, 77, 78, 84, 85, 86, 87, 88, 89, 96, 122, 158], [39, 39, 39, 39, 39, 92, 94, 39, 39, 39, 115, 116, 117, 118, 119, 120, 39, 134, 39]), 'list': ([22], [48]), 'for_valid_expr': ([24, 100], [57, 128]), 'expr_inside_list': ([40], [90]), 'for_valid_iter': ([135], [140]), 'elif_sent': ([146, 170], [150, 171])} _lr_goto = {} for (_k, _v) in _lr_goto_items.items(): for (_x, _y) in zip(_v[0], _v[1]): if not _x in _lr_goto: _lr_goto[_x] = {} _lr_goto[_x][_k] = _y del _lr_goto_items _lr_productions = [("S' -> code", "S'", 1, None, None, None), ('code -> code sent', 'code', 2, 'p_code', 'nbz_parser.py', 41), ('code -> sent', 'code', 1, 'p_code', 'nbz_parser.py', 42), ('code -> empty', 'code', 1, 'p_code', 'nbz_parser.py', 43), ('sent -> statement', 'sent', 1, 'p_sent', 'nbz_parser.py', 54), ('sent -> instruction SEMI', 'sent', 2, 'p_sent', 'nbz_parser.py', 55), ('instruction -> assign', 'instruction', 1, 'p_instruction', 'nbz_parser.py', 59), ('instruction -> function', 'instruction', 1, 'p_instruction', 'nbz_parser.py', 60), ('statement -> function_definition', 'statement', 1, 'p_statement', 'nbz_parser.py', 64), ('statement -> for_statement', 'statement', 1, 'p_statement', 'nbz_parser.py', 65), ('statement -> if_statement', 'statement', 1, 'p_statement', 'nbz_parser.py', 66), ('statement -> while_statement', 'statement', 1, 'p_statement', 'nbz_parser.py', 67), ('for_statement -> FOR LPAREN for_valid_expr COMMA for_valid_expr COMMA for_valid_iter RPAREN LBRACE code RBRACE', 'for_statement', 11, 'p_sent_for_flow_int', 'nbz_parser.py', 71), ('for_statement -> FOR LPAREN ID IN ID RPAREN LBRACE code RBRACE', 'for_statement', 9, 'p_sent_for_flow_int', 'nbz_parser.py', 72), ('for_valid_expr -> expr_num', 'for_valid_expr', 1, 'p_for_valid_expressions_num', 'nbz_parser.py', 85), ('for_valid_expr -> expr_arithm', 'for_valid_expr', 1, 'p_for_valid_expressions_num', 'nbz_parser.py', 86), ('for_valid_iter -> PLUS', 'for_valid_iter', 1, 'p_for_valid_iterators', 'nbz_parser.py', 90), ('for_valid_iter -> PLUSPLUS', 'for_valid_iter', 1, 'p_for_valid_iterators', 'nbz_parser.py', 91), ('for_valid_iter -> MINUS', 'for_valid_iter', 1, 'p_for_valid_iterators', 'nbz_parser.py', 92), ('for_valid_iter -> MINUSMINUS', 'for_valid_iter', 1, 'p_for_valid_iterators', 'nbz_parser.py', 93), ('if_statement -> IF LPAREN logic_list RPAREN LBRACE code RBRACE', 'if_statement', 7, 'p_sent_if_flow', 'nbz_parser.py', 97), ('if_statement -> IF LPAREN logic_list RPAREN LBRACE code RBRACE elif_sent', 'if_statement', 8, 'p_sent_if_flow', 'nbz_parser.py', 98), ('if_statement -> IF LPAREN logic_list RPAREN LBRACE code RBRACE ELSE LBRACE code RBRACE', 'if_statement', 11, 'p_sent_if_flow', 'nbz_parser.py', 99), ('if_statement -> IF LPAREN logic_list RPAREN LBRACE code RBRACE elif_sent ELSE LBRACE code RBRACE', 'if_statement', 12, 'p_sent_if_flow', 'nbz_parser.py', 100), ('elif_sent -> ELIF LPAREN logic_list RPAREN LBRACE code RBRACE elif_sent', 'elif_sent', 8, 'p_sent_elif_flow', 'nbz_parser.py', 130), ('elif_sent -> empty', 'elif_sent', 1, 'p_sent_elif_flow', 'nbz_parser.py', 131), ('while_statement -> WHILE LPAREN logic_list RPAREN LBRACE code RBRACE', 'while_statement', 7, 'p_sent_while_flow', 'nbz_parser.py', 141), ('function_definition -> DEF ID LPAREN RPAREN LBRACE code RBRACE', 'function_definition', 7, 'p_function_definition', 'nbz_parser.py', 148), ('assign -> ID ASSIGN expr_type', 'assign', 3, 'p_assign_expr', 'nbz_parser.py', 156), ('assign -> ID ASSIGN expr_arithm', 'assign', 3, 'p_assign_expr', 'nbz_parser.py', 157), ('assign -> ID ASSIGN logic_list', 'assign', 3, 'p_assign_expr', 'nbz_parser.py', 158), ('assign -> ID ASSIGN expr_list', 'assign', 3, 'p_assign_expr', 'nbz_parser.py', 159), ('assign -> ID ASSIGN function', 'assign', 3, 'p_assign_func', 'nbz_parser.py', 165), ('function -> ID LPAREN list RPAREN', 'function', 4, 'p_expr_funcs', 'nbz_parser.py', 172), ('list -> list COMMA ID', 'list', 3, 'p_list_var', 'nbz_parser.py', 182), ('list -> list COMMA function', 'list', 3, 'p_list_var', 'nbz_parser.py', 183), ('list -> function', 'list', 1, 'p_list_var', 'nbz_parser.py', 184), ('list -> ID', 'list', 1, 'p_list_var', 'nbz_parser.py', 185), ('list -> list COMMA expr_type', 'list', 3, 'p_list_value', 'nbz_parser.py', 224), ('list -> expr_type', 'list', 1, 'p_list_value', 'nbz_parser.py', 225), ('list -> empty', 'list', 1, 'p_list_value', 'nbz_parser.py', 226), ('list -> list COMMA expr_arithm', 'list', 3, 'p_list_expression', 'nbz_parser.py', 237), ('list -> list COMMA logic_list', 'list', 3, 'p_list_expression', 'nbz_parser.py', 238), ('list -> expr_arithm', 'list', 1, 'p_list_expression', 'nbz_parser.py', 239), ('list -> logic_list', 'list', 1, 'p_list_expression', 'nbz_parser.py', 240), ('logic_list -> LPAREN logic_list RPAREN', 'logic_list', 3, 'p_group_logic_list', 'nbz_parser.py', 248), ('logic_list -> logic_list AND logic_list', 'logic_list', 3, 'p_logic_list', 'nbz_parser.py', 252), ('logic_list -> logic_list OR logic_list', 'logic_list', 3, 'p_logic_list', 'nbz_parser.py', 253), ('logic_list -> expr_bool', 'logic_list', 1, 'p_logic_list', 'nbz_parser.py', 254), ('expr_bool -> expr_bool EQ expr_bool', 'expr_bool', 3, 'p_expr_logical', 'nbz_parser.py', 264), ('expr_bool -> expr_bool LT expr_bool', 'expr_bool', 3, 'p_expr_logical', 'nbz_parser.py', 265), ('expr_bool -> expr_bool LET expr_bool', 'expr_bool', 3, 'p_expr_logical', 'nbz_parser.py', 266), ('expr_bool -> expr_bool GT expr_bool', 'expr_bool', 3, 'p_expr_logical', 'nbz_parser.py', 267), ('expr_bool -> expr_bool GET expr_bool', 'expr_bool', 3, 'p_expr_logical', 'nbz_parser.py', 268), ('expr_bool -> expr_bool DIFF expr_bool', 'expr_bool', 3, 'p_expr_logical', 'nbz_parser.py', 269), ('expr_bool -> NOT expr_bool', 'expr_bool', 2, 'p_expr_logical', 'nbz_parser.py', 270), ('expr_bool -> function', 'expr_bool', 1, 'p_logic_valid_var', 'nbz_parser.py', 287), ('expr_bool -> expr_type', 'expr_bool', 1, 'p_logic_valid_type', 'nbz_parser.py', 297), ('expr_bool -> expr_arithm', 'expr_bool', 1, 'p_logic_valid_type', 'nbz_parser.py', 298), ('expr_arithm -> LPAREN expr_arithm RPAREN', 'expr_arithm', 3, 'p_group_expr_arithmethic', 'nbz_parser.py', 302), ('expr_arithm -> expr_arithm PLUS expr_arithm', 'expr_arithm', 3, 'p_expr_aritmethic', 'nbz_parser.py', 306), ('expr_arithm -> expr_arithm MINUS expr_arithm', 'expr_arithm', 3, 'p_expr_aritmethic', 'nbz_parser.py', 307), ('expr_arithm -> expr_arithm MULTIPLY expr_arithm', 'expr_arithm', 3, 'p_expr_aritmethic', 'nbz_parser.py', 308), ('expr_arithm -> expr_arithm DIVIDE expr_arithm', 'expr_arithm', 3, 'p_expr_aritmethic', 'nbz_parser.py', 309), ('expr_arithm -> MINUS expr_arithm', 'expr_arithm', 2, 'p_expr_aritmethic', 'nbz_parser.py', 310), ('expr_arithm -> ID', 'expr_arithm', 1, 'p_arithm_valid_var', 'nbz_parser.py', 323), ('expr_arithm -> function', 'expr_arithm', 1, 'p_arithm_valid_var', 'nbz_parser.py', 324), ('expr_arithm -> expr_type', 'expr_arithm', 1, 'p_arithm_valid_num', 'nbz_parser.py', 343), ('function -> sent_index_list', 'function', 1, 'p_sent_index_list', 'nbz_parser.py', 347), ('sent_index_list -> sent_index_list LBRACKET ID RBRACKET', 'sent_index_list', 4, 'p_index_list_var', 'nbz_parser.py', 351), ('sent_index_list -> ID LBRACKET ID RBRACKET', 'sent_index_list', 4, 'p_index_list_var', 'nbz_parser.py', 352), ('sent_index_list -> sent_index_list LBRACKET INTEGER RBRACKET', 'sent_index_list', 4, 'p_index_list_value', 'nbz_parser.py', 378), ('sent_index_list -> ID LBRACKET INTEGER RBRACKET', 'sent_index_list', 4, 'p_index_list_value', 'nbz_parser.py', 379), ('expr_list -> LBRACKET expr_inside_list RBRACKET', 'expr_list', 3, 'p_expr_list', 'nbz_parser.py', 393), ('expr_inside_list -> expr_inside_list COMMA expr_type', 'expr_inside_list', 3, 'p_list_expr_inside_list', 'nbz_parser.py', 397), ('expr_inside_list -> expr_inside_list COMMA expr_bool', 'expr_inside_list', 3, 'p_list_expr_inside_list', 'nbz_parser.py', 398), ('expr_inside_list -> expr_type', 'expr_inside_list', 1, 'p_list_expr_inside_list', 'nbz_parser.py', 399), ('expr_inside_list -> expr_bool', 'expr_inside_list', 1, 'p_list_expr_inside_list', 'nbz_parser.py', 400), ('expr_inside_list -> empty', 'expr_inside_list', 1, 'p_list_expr_inside_list', 'nbz_parser.py', 401), ('expr_type -> expr_num', 'expr_type', 1, 'p_expr_type', 'nbz_parser.py', 412), ('expr_type -> expr_string', 'expr_type', 1, 'p_expr_type', 'nbz_parser.py', 413), ('expr_bool -> TRUE', 'expr_bool', 1, 'p_expr_bool_true', 'nbz_parser.py', 417), ('expr_bool -> FALSE', 'expr_bool', 1, 'p_expr_bool_false', 'nbz_parser.py', 421), ('expr_num -> FLOAT', 'expr_num', 1, 'p_expr_number', 'nbz_parser.py', 425), ('expr_num -> INTEGER', 'expr_num', 1, 'p_expr_number', 'nbz_parser.py', 426), ('expr_string -> STRING', 'expr_string', 1, 'p_expr_string', 'nbz_parser.py', 430), ('empty -> <empty>', 'empty', 0, 'p_empty', 'nbz_parser.py', 435)]
# To create a variable character_name = "Jin" character_age = "99" print(character_name + " is " + character_age + " years old.") # reassigning the variable character_name = "mochi" print(character_name + " is " + character_age + " years old.") print("jin\nacademy") print(len(character_name)) # to create a new line \n, to escape \ # to create a upper case # string.upper() # to create a lower case # string.lower() # to check if its upper case # string.isupper() # len is a length of the string # chaining works for python # to get a specific character # index starts from 0 my_character = "mochi" print(my_character[3]) # to check what position the character is in print(my_character.index("h")) # to change the character my_phrase = "animal kingdom" print(my_phrase.replace("animal", "vegetable"))
character_name = 'Jin' character_age = '99' print(character_name + ' is ' + character_age + ' years old.') character_name = 'mochi' print(character_name + ' is ' + character_age + ' years old.') print('jin\nacademy') print(len(character_name)) my_character = 'mochi' print(my_character[3]) print(my_character.index('h')) my_phrase = 'animal kingdom' print(my_phrase.replace('animal', 'vegetable'))
def gimme5(): return 5 def gimme3(): return 3
def gimme5(): return 5 def gimme3(): return 3
class Solution: def maxArea(self, height): """ :type height: List[int] :rtype: int """ p1 = 0 p2 = len(height) - 1 ret = 0 while p1 < p2: ret = max(min(height[p1], height[p2]) * (p2 - p1), ret) if height[p2] > height[p1]: p1 += 1 else: p2 -= 1 return ret
class Solution: def max_area(self, height): """ :type height: List[int] :rtype: int """ p1 = 0 p2 = len(height) - 1 ret = 0 while p1 < p2: ret = max(min(height[p1], height[p2]) * (p2 - p1), ret) if height[p2] > height[p1]: p1 += 1 else: p2 -= 1 return ret
def sqrt_approx(num): i = 0 minsq = 0 maxsq = 0 while i <= num: if i * i <= num: minsq = i if i * i >= num: maxsq = i break i = i + 1 return minsq, maxsq for i in range(0, 26): print(i, sqrt_approx(i))
def sqrt_approx(num): i = 0 minsq = 0 maxsq = 0 while i <= num: if i * i <= num: minsq = i if i * i >= num: maxsq = i break i = i + 1 return (minsq, maxsq) for i in range(0, 26): print(i, sqrt_approx(i))
# # PySNMP MIB module Wellfleet-IPEX-MIB (http://snmplabs.com/pysmi) # ASN.1 source file:///Users/davwang4/Dev/mibs.snmplabs.com/asn1/Wellfleet-IPEX-MIB # Produced by pysmi-0.3.4 at Wed May 1 15:40:34 2019 # On host DAVWANG4-M-1475 platform Darwin version 18.5.0 by user davwang4 # Using Python version 3.7.3 (default, Mar 27 2019, 09:23:15) # ObjectIdentifier, Integer, OctetString = mibBuilder.importSymbols("ASN1", "ObjectIdentifier", "Integer", "OctetString") NamedValues, = mibBuilder.importSymbols("ASN1-ENUMERATION", "NamedValues") ValueRangeConstraint, ValueSizeConstraint, SingleValueConstraint, ConstraintsIntersection, ConstraintsUnion = mibBuilder.importSymbols("ASN1-REFINEMENT", "ValueRangeConstraint", "ValueSizeConstraint", "SingleValueConstraint", "ConstraintsIntersection", "ConstraintsUnion") NotificationGroup, ModuleCompliance = mibBuilder.importSymbols("SNMPv2-CONF", "NotificationGroup", "ModuleCompliance") Unsigned32, NotificationType, ObjectIdentity, IpAddress, Counter64, Gauge32, Counter32, MibScalar, MibTable, MibTableRow, MibTableColumn, TimeTicks, Bits, Integer32, ModuleIdentity, iso, MibIdentifier = mibBuilder.importSymbols("SNMPv2-SMI", "Unsigned32", "NotificationType", "ObjectIdentity", "IpAddress", "Counter64", "Gauge32", "Counter32", "MibScalar", "MibTable", "MibTableRow", "MibTableColumn", "TimeTicks", "Bits", "Integer32", "ModuleIdentity", "iso", "MibIdentifier") DisplayString, TextualConvention = mibBuilder.importSymbols("SNMPv2-TC", "DisplayString", "TextualConvention") wfIpexGroup, = mibBuilder.importSymbols("Wellfleet-COMMON-MIB", "wfIpexGroup") wfIpex = MibIdentifier((1, 3, 6, 1, 4, 1, 18, 3, 5, 15, 1)) wfIpexDelete = MibScalar((1, 3, 6, 1, 4, 1, 18, 3, 5, 15, 1, 1), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2))).clone(namedValues=NamedValues(("created", 1), ("deleted", 2))).clone('created')).setMaxAccess("readwrite") if mibBuilder.loadTexts: wfIpexDelete.setStatus('mandatory') if mibBuilder.loadTexts: wfIpexDelete.setDescription('Create/Delete parameter. Default is created. Users perform an SNMP SET operation on this object in order to create/delete IPEX.') wfIpexDisable = MibScalar((1, 3, 6, 1, 4, 1, 18, 3, 5, 15, 1, 2), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2))).clone(namedValues=NamedValues(("enabled", 1), ("disabled", 2))).clone('enabled')).setMaxAccess("readwrite") if mibBuilder.loadTexts: wfIpexDisable.setStatus('mandatory') if mibBuilder.loadTexts: wfIpexDisable.setDescription('Enable/Disable parameter. Default is enabled. Users perform an SNMP SET operation on this object in order to enable/disable IPEX.') wfIpexState = MibScalar((1, 3, 6, 1, 4, 1, 18, 3, 5, 15, 1, 3), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2, 3, 4))).clone(namedValues=NamedValues(("up", 1), ("down", 2), ("init", 3), ("notpresent", 4))).clone('down')).setMaxAccess("readonly") if mibBuilder.loadTexts: wfIpexState.setStatus('mandatory') if mibBuilder.loadTexts: wfIpexState.setDescription('The current state of IPEX.') wfIpexMaxMessageSize = MibScalar((1, 3, 6, 1, 4, 1, 18, 3, 5, 15, 1, 4), Integer32().subtype(subtypeSpec=ValueRangeConstraint(16, 4096)).clone(1600)).setMaxAccess("readwrite") if mibBuilder.loadTexts: wfIpexMaxMessageSize.setStatus('mandatory') if mibBuilder.loadTexts: wfIpexMaxMessageSize.setDescription('The maximum client message size that IPEX accepts. The size is in bytes.') wfIpexInsCalledDte = MibScalar((1, 3, 6, 1, 4, 1, 18, 3, 5, 15, 1, 5), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2))).clone(namedValues=NamedValues(("enabled", 1), ("disabled", 2))).clone('disabled')).setMaxAccess("readwrite") if mibBuilder.loadTexts: wfIpexInsCalledDte.setStatus('mandatory') if mibBuilder.loadTexts: wfIpexInsCalledDte.setDescription('Enable/Disable parameter. Default is disabled. Users perform an SNMP SET operation on this object in order to enable/disable the support for inserting Called DTE address.') wfIpexInsCallingDte = MibScalar((1, 3, 6, 1, 4, 1, 18, 3, 5, 15, 1, 6), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2))).clone(namedValues=NamedValues(("enabled", 1), ("disabled", 2))).clone('disabled')).setMaxAccess("readwrite") if mibBuilder.loadTexts: wfIpexInsCallingDte.setStatus('mandatory') if mibBuilder.loadTexts: wfIpexInsCallingDte.setDescription('Enable/disable the support for transmitting the calling DTE address over TCP tunnel. This changes the IPEX control message header format and hence this attribute should be enabled (only for 11.02 or up) on both ends (local & remote routers) for proper operation. This attribute applies only to End_to_End mode.') wfIpexTcpRequestLimit = MibScalar((1, 3, 6, 1, 4, 1, 18, 3, 5, 15, 1, 7), Integer32().subtype(subtypeSpec=ValueRangeConstraint(0, 1000)).clone(25)).setMaxAccess("readwrite") if mibBuilder.loadTexts: wfIpexTcpRequestLimit.setStatus('mandatory') if mibBuilder.loadTexts: wfIpexTcpRequestLimit.setDescription('The maximum number of TCP requests IPEX can have pending with TCP. Any addition requests will be queued until the number of pending requests fall below the limit.') wfIpexTcpRequestCheck = MibScalar((1, 3, 6, 1, 4, 1, 18, 3, 5, 15, 1, 8), Integer32().subtype(subtypeSpec=ValueRangeConstraint(0, 30000)).clone(1000)).setMaxAccess("readwrite") if mibBuilder.loadTexts: wfIpexTcpRequestCheck.setStatus('mandatory') if mibBuilder.loadTexts: wfIpexTcpRequestCheck.setDescription('When IPEX has queued TCP requests, the time period (in milliseconds) between checking if the number of pending TCP requests have fallen below wfIpexTcpRequestLimit.') wfIpexSendResetRequestOnTCPUp = MibScalar((1, 3, 6, 1, 4, 1, 18, 3, 5, 15, 1, 9), Integer32().clone(9)).setMaxAccess("readwrite") if mibBuilder.loadTexts: wfIpexSendResetRequestOnTCPUp.setStatus('mandatory') if mibBuilder.loadTexts: wfIpexSendResetRequestOnTCPUp.setDescription('Default(cause code) is 0x09 and PVC_TCP sends out the Reset Request with the cause code = 0x09 and TCP_PVC Router does not send the Reset Request when TCP is up. If the value is changed from the default cause code(0x09) then IPEX Gateway will send out the Reset Request with this value when network is operational. TCP_PVC will also send the Reset Request with this cause code when TCP connection is up.') wfIpexTranslateNetworkOutOfOrder = MibScalar((1, 3, 6, 1, 4, 1, 18, 3, 5, 15, 1, 10), Integer32().clone(29)).setMaxAccess("readwrite") if mibBuilder.loadTexts: wfIpexTranslateNetworkOutOfOrder.setStatus('mandatory') if mibBuilder.loadTexts: wfIpexTranslateNetworkOutOfOrder.setDescription('Default is 0x1d(29): Network out of order. If the value is changed from the default cause code = 0x1d then the IPEX Gateway will send the Reset Request with cause code specified when the network is out of order.') wfIpexTcpUseIpAddress = MibScalar((1, 3, 6, 1, 4, 1, 18, 3, 5, 15, 1, 11), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2))).clone(namedValues=NamedValues(("enabled", 1), ("disabled", 2))).clone('disabled')).setMaxAccess("readwrite") if mibBuilder.loadTexts: wfIpexTcpUseIpAddress.setStatus('mandatory') if mibBuilder.loadTexts: wfIpexTcpUseIpAddress.setDescription('Enable/Disable parameter. Default is disabled. If set to Enabled, the IP address used for a TCP connection will be the coresponding address for the circuit.') wfIpexBobEnabled = MibScalar((1, 3, 6, 1, 4, 1, 18, 3, 5, 15, 1, 12), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2))).clone(namedValues=NamedValues(("disabled", 1), ("enabled", 2))).clone('disabled')).setMaxAccess("readwrite") if mibBuilder.loadTexts: wfIpexBobEnabled.setStatus('mandatory') if mibBuilder.loadTexts: wfIpexBobEnabled.setDescription('This attribute will indicate whether IPEX supports Bank Of Bahrain enhancement. If it is enabled, only calling DTE will be send in ASCII format in user defined area of message header, if header type is full.') wfIpexBobTimeout = MibScalar((1, 3, 6, 1, 4, 1, 18, 3, 5, 15, 1, 13), Integer32().subtype(subtypeSpec=ValueRangeConstraint(0, 30000)).clone(15000)).setMaxAccess("readwrite") if mibBuilder.loadTexts: wfIpexBobTimeout.setStatus('mandatory') if mibBuilder.loadTexts: wfIpexBobTimeout.setDescription('This attribute will indicate the timeout in milliseconds, after which DEVICE UP message is to be send to BOB mainserver from router, as long as this service supports BOB functionality.') wfIpexMaxAuditIp = MibScalar((1, 3, 6, 1, 4, 1, 18, 3, 5, 15, 1, 14), Integer32().clone(25)).setMaxAccess("readwrite") if mibBuilder.loadTexts: wfIpexMaxAuditIp.setStatus('mandatory') if mibBuilder.loadTexts: wfIpexMaxAuditIp.setDescription("Default is 25. Specify the maximum of IP address and TCP port pairs that IPEX Audit gate can hold in its internal table when IPEX PVC-TCP Gateway is in TCP Retry Mode. Audit gate puts new ip address and TCP port pair to the internal table when it tries TCP connection. IPEX Audit gate will be re-trying TCP connections until the table is filled up. Once it is full then it won't re-try new TCP connections. Setting zero causes IPEX audit gate to try TCP connections without examining the IP address and TCP port pairs had already tried out or not.") wfIpexSessionInstanceIdOffsetForSvc = MibScalar((1, 3, 6, 1, 4, 1, 18, 3, 5, 15, 1, 15), Integer32()).setMaxAccess("readwrite") if mibBuilder.loadTexts: wfIpexSessionInstanceIdOffsetForSvc.setStatus('mandatory') if mibBuilder.loadTexts: wfIpexSessionInstanceIdOffsetForSvc.setDescription('Default is 0. Specify the offset value for wfIpexSessionEntry when instances for SVC are created. For example, when it is set to 1023, instance ID for wfIpexSessionEntry for SVC connections will be wfIpexSessionEntry.*.3.1024 and the next one will be wfIpexSessionEntry.*.3.1025 and so on. This MIB object is introduced not to assign same instance ID to PVC and SVC when SVCs and PVCs are configured with single circuit. Because wfIpexSessionEntry for PVCs are based on the LCNs and the ones for SVCs are based on the order of each SVC being created, there would be the cases that same instance IDs are assigned to both SVC and PVC and it will cause the router to fault. It needs to be set to the value which is greater than the maximum LCN of the PVC connections when PVCs and SVCs co-exist on a single circuit.') wfIpexMappingTable = MibTable((1, 3, 6, 1, 4, 1, 18, 3, 5, 15, 2), ) if mibBuilder.loadTexts: wfIpexMappingTable.setStatus('mandatory') if mibBuilder.loadTexts: wfIpexMappingTable.setDescription('A table which contains the list of mappings between TCP connections and X.25 connections. This is the configuration table in which each entry sets up the association between a TCP port number and a X.25 DTE address or connection. inst_id[] = wfIpexMappingSrcConnCct wfIpexMappingSrcConnType wfIpexMappingID') wfIpexMappingEntry = MibTableRow((1, 3, 6, 1, 4, 1, 18, 3, 5, 15, 2, 1), ).setIndexNames((0, "Wellfleet-IPEX-MIB", "wfIpexMappingSrcConnCct"), (0, "Wellfleet-IPEX-MIB", "wfIpexMappingSrcConnType"), (0, "Wellfleet-IPEX-MIB", "wfIpexMappingID1"), (0, "Wellfleet-IPEX-MIB", "wfIpexMappingID2")) if mibBuilder.loadTexts: wfIpexMappingEntry.setStatus('mandatory') if mibBuilder.loadTexts: wfIpexMappingEntry.setDescription('An entry in wfIpexMappingTable.') wfIpexMappingDelete = MibTableColumn((1, 3, 6, 1, 4, 1, 18, 3, 5, 15, 2, 1, 1), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2))).clone(namedValues=NamedValues(("created", 1), ("deleted", 2))).clone('created')).setMaxAccess("readwrite") if mibBuilder.loadTexts: wfIpexMappingDelete.setStatus('mandatory') if mibBuilder.loadTexts: wfIpexMappingDelete.setDescription('Create/Delete attribute. Default is created. Users perform an SNMP SET operation on this object in order to create/delete a translation mapping record.') wfIpexMappingDisable = MibTableColumn((1, 3, 6, 1, 4, 1, 18, 3, 5, 15, 2, 1, 2), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2))).clone(namedValues=NamedValues(("enabled", 1), ("disabled", 2))).clone('enabled')).setMaxAccess("readwrite") if mibBuilder.loadTexts: wfIpexMappingDisable.setStatus('mandatory') if mibBuilder.loadTexts: wfIpexMappingDisable.setDescription('Enables or Disables this Mapping entry. Setting this attribute to DISABLED will disconnect all active Sessions pertaining to this Mapping entry') wfIpexMappingSrcConnCct = MibTableColumn((1, 3, 6, 1, 4, 1, 18, 3, 5, 15, 2, 1, 3), Integer32()).setMaxAccess("readonly") if mibBuilder.loadTexts: wfIpexMappingSrcConnCct.setStatus('mandatory') if mibBuilder.loadTexts: wfIpexMappingSrcConnCct.setDescription('The circuit from which the connection attempt is received that initiates a translation session.') wfIpexMappingSrcConnType = MibTableColumn((1, 3, 6, 1, 4, 1, 18, 3, 5, 15, 2, 1, 4), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2, 4, 8, 16))).clone(namedValues=NamedValues(("pvc", 1), ("svc", 2), ("dcesvc", 4), ("lapb", 8), ("tcp", 16)))).setMaxAccess("readonly") if mibBuilder.loadTexts: wfIpexMappingSrcConnType.setStatus('mandatory') if mibBuilder.loadTexts: wfIpexMappingSrcConnType.setDescription('Defines the type of original connection attempt. Whether it is a PVC, SVC, DCE_SVC, LAPB or TCP') wfIpexMappingID1 = MibTableColumn((1, 3, 6, 1, 4, 1, 18, 3, 5, 15, 2, 1, 5), Integer32()).setMaxAccess("readonly") if mibBuilder.loadTexts: wfIpexMappingID1.setStatus('mandatory') if mibBuilder.loadTexts: wfIpexMappingID1.setDescription('The translation mapping identifier which identifies the remote connection of the translation session. This is an identifier that is available from the incoming connection attempt. The meaning of this object (wfIpexMappingID1) and the next object (wfIpexMappingID2) is dependent on the value of wfIpexMappingSrcConnType. SrcConnType ID1 ID2 --------------------------------------------------- pvc(1) LCN value 0 (Null) svc(2) 0 Called X.121 Address dcesvc(4) 0 0 (Null) lapb(8) 0 0 (Null) tcp(16) Port Number 0 (Null) ') wfIpexMappingID2 = MibTableColumn((1, 3, 6, 1, 4, 1, 18, 3, 5, 15, 2, 1, 6), OctetString()).setMaxAccess("readonly") if mibBuilder.loadTexts: wfIpexMappingID2.setStatus('mandatory') if mibBuilder.loadTexts: wfIpexMappingID2.setDescription('(See description for wfIpexMappingID1 above)') wfIpexMappingDstConnCct = MibTableColumn((1, 3, 6, 1, 4, 1, 18, 3, 5, 15, 2, 1, 7), Integer32()).setMaxAccess("readwrite") if mibBuilder.loadTexts: wfIpexMappingDstConnCct.setStatus('mandatory') if mibBuilder.loadTexts: wfIpexMappingDstConnCct.setDescription('The circuit from which the connection to the destination is to be established to set up a translation session.') wfIpexMappingDstConnType = MibTableColumn((1, 3, 6, 1, 4, 1, 18, 3, 5, 15, 2, 1, 8), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2, 4, 8, 16))).clone(namedValues=NamedValues(("pvc", 1), ("svc", 2), ("dcesvc", 4), ("lapb", 8), ("tcp", 16))).clone('pvc')).setMaxAccess("readwrite") if mibBuilder.loadTexts: wfIpexMappingDstConnType.setStatus('mandatory') if mibBuilder.loadTexts: wfIpexMappingDstConnType.setDescription('Defines type of connection at the destination end. Whether it is a PVC, SVC, DCE_SVC, LAPB or TCP') wfIpexMappingLocalDTEAddr = MibTableColumn((1, 3, 6, 1, 4, 1, 18, 3, 5, 15, 2, 1, 9), DisplayString()).setMaxAccess("readwrite") if mibBuilder.loadTexts: wfIpexMappingLocalDTEAddr.setStatus('mandatory') if mibBuilder.loadTexts: wfIpexMappingLocalDTEAddr.setDescription('The Local DTE address (identifies the X.121 address of the X.25 interface on the IPEX). This attribute is only used in the case of a SVC connection initiated from the IPEX to the terminal') wfIpexMappingRemoteDTEAddr = MibTableColumn((1, 3, 6, 1, 4, 1, 18, 3, 5, 15, 2, 1, 10), DisplayString()).setMaxAccess("readwrite") if mibBuilder.loadTexts: wfIpexMappingRemoteDTEAddr.setStatus('mandatory') if mibBuilder.loadTexts: wfIpexMappingRemoteDTEAddr.setDescription('The Remote DTE address (identifies the X.121 address of the X.25 interface on the terminal). This attribute is only used in the case of a SVC connection initiated from the IPEX to the terminal') wfIpexMappingPvcLcn = MibTableColumn((1, 3, 6, 1, 4, 1, 18, 3, 5, 15, 2, 1, 11), Integer32().subtype(subtypeSpec=ValueRangeConstraint(1, 4095)).clone(1)).setMaxAccess("readwrite") if mibBuilder.loadTexts: wfIpexMappingPvcLcn.setStatus('mandatory') if mibBuilder.loadTexts: wfIpexMappingPvcLcn.setDescription('The LCN of the PVC connection from the IPEX to the terminal (identifies the channel to be used to reset the PVC connection. This attribute * is only used in the case of a PVC connection initiated from the IPEX to the terminal') wfIpexMappingRemoteIpAddr = MibTableColumn((1, 3, 6, 1, 4, 1, 18, 3, 5, 15, 2, 1, 12), IpAddress()).setMaxAccess("readwrite") if mibBuilder.loadTexts: wfIpexMappingRemoteIpAddr.setStatus('mandatory') if mibBuilder.loadTexts: wfIpexMappingRemoteIpAddr.setDescription('The IP address of the remote host with which this translation session is established. This attribute is only used in the case of a TCP connection initiated from the IPEX to a host') wfIpexMappingRemoteTcpPort = MibTableColumn((1, 3, 6, 1, 4, 1, 18, 3, 5, 15, 2, 1, 13), Integer32()).setMaxAccess("readwrite") if mibBuilder.loadTexts: wfIpexMappingRemoteTcpPort.setStatus('mandatory') if mibBuilder.loadTexts: wfIpexMappingRemoteTcpPort.setDescription('The remote TCP port number in the host to be used to establish a TCP connection from the IPEX to the host server. This attribute is only used in the case of a TCP connection initiated from the IPEX to a host') wfIpexMappingQueueSize = MibTableColumn((1, 3, 6, 1, 4, 1, 18, 3, 5, 15, 2, 1, 14), Integer32().subtype(subtypeSpec=ValueRangeConstraint(16, 8192)).clone(8192)).setMaxAccess("readwrite") if mibBuilder.loadTexts: wfIpexMappingQueueSize.setStatus('mandatory') if mibBuilder.loadTexts: wfIpexMappingQueueSize.setDescription('The size of the IPEX queues used for transfering data between TCP and X.25. The size is in bytes.') wfIpexMappingSlotNumber = MibTableColumn((1, 3, 6, 1, 4, 1, 18, 3, 5, 15, 2, 1, 15), Integer32().subtype(subtypeSpec=ValueRangeConstraint(1, 13))).setMaxAccess("readwrite") if mibBuilder.loadTexts: wfIpexMappingSlotNumber.setStatus('mandatory') if mibBuilder.loadTexts: wfIpexMappingSlotNumber.setDescription('The slot of the access (X.25 or LAPB) circuit on which the X.25 or LAPB connections will be established.') wfIpexMappingCtrlMode = MibTableColumn((1, 3, 6, 1, 4, 1, 18, 3, 5, 15, 2, 1, 16), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2, 3))).clone(namedValues=NamedValues(("local", 1), ("end2end", 2), ("gateway", 3))).clone('end2end')).setMaxAccess("readwrite") if mibBuilder.loadTexts: wfIpexMappingCtrlMode.setStatus('mandatory') if mibBuilder.loadTexts: wfIpexMappingCtrlMode.setDescription('Local mode configuration terminates X.25 at the router interface. The end2end mode configuration allows X.25 signalling and data to operate between two remote X.25 networks, using the router to translate both call control and data over a TCP/IP network. The gateway mode terminates X.25 at the router interface, but allows the user to configure 3 message header types at the TCP application layer. These header values are described in wfIpexMappingMsgHdrType.') wfIpexMappingX25CUDF = MibTableColumn((1, 3, 6, 1, 4, 1, 18, 3, 5, 15, 2, 1, 17), OctetString()).setMaxAccess("readwrite") if mibBuilder.loadTexts: wfIpexMappingX25CUDF.setStatus('mandatory') if mibBuilder.loadTexts: wfIpexMappingX25CUDF.setDescription('The X.25 Call User Data field (CUDF) in a X.25 Call Request packet header. This attribute is only used in the case of a SVC connection initiated from the IPEX to the terminal. It is used as the network layer protocol identifier of the X.25 connection.') wfIpexMappingIdleTimer = MibTableColumn((1, 3, 6, 1, 4, 1, 18, 3, 5, 15, 2, 1, 18), Integer32().subtype(subtypeSpec=ValueRangeConstraint(0, 86400)).clone(120)).setMaxAccess("readwrite") if mibBuilder.loadTexts: wfIpexMappingIdleTimer.setStatus('mandatory') if mibBuilder.loadTexts: wfIpexMappingIdleTimer.setDescription('Idle session timeout period, in seconds. If an established TCP connection remains inactive for this interval, KEEPALIVE messages will be sent to the peer (if the Keepalive Timer is non-zero). Setting the Idle Timer to zero disables the keepalive feature.') wfIpexMappingKeepaliveTimer = MibTableColumn((1, 3, 6, 1, 4, 1, 18, 3, 5, 15, 2, 1, 19), Integer32().subtype(subtypeSpec=ValueRangeConstraint(0, 600)).clone(3)).setMaxAccess("readwrite") if mibBuilder.loadTexts: wfIpexMappingKeepaliveTimer.setStatus('mandatory') if mibBuilder.loadTexts: wfIpexMappingKeepaliveTimer.setDescription('KEEPALIVE retransmit timeout period, in seconds. This is the interval at which unacknowledged KEEPALIVE messages will be retransmitted. If the Idle Timer is set to zero, this timer ignored. If the Idle Timer is non-zero and this timer IS zero, no KEEPALIVEs are sent and the session is terminated upon expiration of the Idle Timer.') wfIpexMappingKeepaliveRetries = MibTableColumn((1, 3, 6, 1, 4, 1, 18, 3, 5, 15, 2, 1, 20), Integer32().subtype(subtypeSpec=ValueRangeConstraint(0, 99)).clone(5)).setMaxAccess("readwrite") if mibBuilder.loadTexts: wfIpexMappingKeepaliveRetries.setStatus('mandatory') if mibBuilder.loadTexts: wfIpexMappingKeepaliveRetries.setDescription('Number of unacknowledged KEEPALIVE messages retransmitted before the TCP session is terminated. If this count is set to zero, only one KEEPALIVE message will be sent.') wfIpexMappingTrace = MibTableColumn((1, 3, 6, 1, 4, 1, 18, 3, 5, 15, 2, 1, 21), Integer32()).setMaxAccess("readwrite") if mibBuilder.loadTexts: wfIpexMappingTrace.setStatus('mandatory') if mibBuilder.loadTexts: wfIpexMappingTrace.setDescription('This object is a bitmask, setting the low order bit enables tracing of IPEX internal events. Setting other individual bit postions disable logging of internal IPEX events. Values may be added together to disable multiple message groups. Hex Dec Value Value Message/Event --------------------------------------------------------- 0x0001 1 Enable IPEX tracing. 0x0002 2 Data packets from IPEX to X.25. 0x0004 4 Data packets from X.25 to IPEX. 0x0008 8 Window updates from X.25. 0x0010 16 Data from TCP to IPEX. 0x0020 32 Window updates from TCP. 0x0040 64 Window requests from TCP.') wfIpexMappingMsgHdrType = MibTableColumn((1, 3, 6, 1, 4, 1, 18, 3, 5, 15, 2, 1, 22), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2, 3, 4))).clone(namedValues=NamedValues(("none", 1), ("short", 2), ("long", 3), ("full", 4))).clone('full')).setMaxAccess("readwrite") if mibBuilder.loadTexts: wfIpexMappingMsgHdrType.setStatus('mandatory') if mibBuilder.loadTexts: wfIpexMappingMsgHdrType.setDescription('This attribute enables the Message Boundary Protocol. When enabled, this bit is used to mark the boundary of TCP application data that is consistent with Gateway Operation. The first three message header types are used only with wfIpexMappingCtlMode in gateway mode. The default value is used with wfIpexMappingCtlMode in the local or end2end mode of operation. NONE = Msg Boundary Protocol is off, no msg header. SHORT = Msg header condtains a 2-Byte length field. LONG = Msg header contains a 1-Byte type, 1-Byte version, and a 2-Byte length fields. FULL = Msg Header contains a 2-Byte length1 field, 1-Byte Version field, 1-Byte Type field and, a 1-Byte length2 field') wfIpexMappingRemoteBackupIp = MibTableColumn((1, 3, 6, 1, 4, 1, 18, 3, 5, 15, 2, 1, 23), IpAddress()).setMaxAccess("readwrite") if mibBuilder.loadTexts: wfIpexMappingRemoteBackupIp.setStatus('mandatory') if mibBuilder.loadTexts: wfIpexMappingRemoteBackupIp.setDescription('The IP address of the remote host with which this translation session is established. This attribute is only used in the case of a TCP connection with the primary remote IP address (wfIpexMappingRemoteIpAddr) failed.') wfIpexMappingXlateCallingX121 = MibTableColumn((1, 3, 6, 1, 4, 1, 18, 3, 5, 15, 2, 1, 24), DisplayString()).setMaxAccess("readwrite") if mibBuilder.loadTexts: wfIpexMappingXlateCallingX121.setStatus('mandatory') if mibBuilder.loadTexts: wfIpexMappingXlateCallingX121.setDescription('If this attribute is configured then insert this X.121 addr as the calling addr in the Call request pkt.') wfIpexMappingTcpMaxRetry = MibTableColumn((1, 3, 6, 1, 4, 1, 18, 3, 5, 15, 2, 1, 25), Integer32().subtype(subtypeSpec=ValueRangeConstraint(0, 16384))).setMaxAccess("readwrite") if mibBuilder.loadTexts: wfIpexMappingTcpMaxRetry.setStatus('mandatory') if mibBuilder.loadTexts: wfIpexMappingTcpMaxRetry.setDescription('The maximum number of attempts that PVC-TCP will make to re-establish the connection to the remote peer. The TCP Retry takes place every 15 seconds hence default setting will perform the TCP Retry forever.') wfIpexMappingCfgLocalIpAddr = MibTableColumn((1, 3, 6, 1, 4, 1, 18, 3, 5, 15, 2, 1, 26), IpAddress()).setMaxAccess("readwrite") if mibBuilder.loadTexts: wfIpexMappingCfgLocalIpAddr.setStatus('mandatory') if mibBuilder.loadTexts: wfIpexMappingCfgLocalIpAddr.setDescription('The IP address on the router to use as the source of the TCP session. This attribute is only used in the case of a TCP connection initiated from the IPEX to a host') wfIpexMappingRemoteBackupTcpPort = MibTableColumn((1, 3, 6, 1, 4, 1, 18, 3, 5, 15, 2, 1, 27), Integer32()).setMaxAccess("readwrite") if mibBuilder.loadTexts: wfIpexMappingRemoteBackupTcpPort.setStatus('mandatory') if mibBuilder.loadTexts: wfIpexMappingRemoteBackupTcpPort.setDescription('The TCP port of the remote host with which this translation session is established. This attribute is only used in the case of a TCP connection with the primary remote IP address (wfIpexMappingRemoteIpAddr) failed.') wfIpexSessionTable = MibTable((1, 3, 6, 1, 4, 1, 18, 3, 5, 15, 3), ) if mibBuilder.loadTexts: wfIpexSessionTable.setStatus('mandatory') if mibBuilder.loadTexts: wfIpexSessionTable.setDescription('A table that contains the information about the current active IPEX translation sessions. The status and statistics information related to each translation session is provided here. inst_id[] = wfIpexSessionIndex') wfIpexSessionEntry = MibTableRow((1, 3, 6, 1, 4, 1, 18, 3, 5, 15, 3, 1), ).setIndexNames((0, "Wellfleet-IPEX-MIB", "wfIpexSessionSrcConnCct"), (0, "Wellfleet-IPEX-MIB", "wfIpexSessionIndex")) if mibBuilder.loadTexts: wfIpexSessionEntry.setStatus('mandatory') if mibBuilder.loadTexts: wfIpexSessionEntry.setDescription('An entry in wfIpexSession.') wfIpexSessionState = MibTableColumn((1, 3, 6, 1, 4, 1, 18, 3, 5, 15, 3, 1, 1), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2, 3, 4, 5))).clone(namedValues=NamedValues(("x25up", 1), ("tcpup", 2), ("ccestab", 3), ("notconn", 4), ("lapbup", 5))).clone('notconn')).setMaxAccess("readonly") if mibBuilder.loadTexts: wfIpexSessionState.setStatus('mandatory') if mibBuilder.loadTexts: wfIpexSessionState.setDescription('The IPEX state of this translation session. These are the steady states of the IPEX state machine. Transition states are not reflected.') wfIpexSessionSrcConnCct = MibTableColumn((1, 3, 6, 1, 4, 1, 18, 3, 5, 15, 3, 1, 2), Integer32()).setMaxAccess("readonly") if mibBuilder.loadTexts: wfIpexSessionSrcConnCct.setStatus('mandatory') if mibBuilder.loadTexts: wfIpexSessionSrcConnCct.setDescription('The circuit from which the original connection attempt is received that initiated a translation session.') wfIpexSessionIndex = MibTableColumn((1, 3, 6, 1, 4, 1, 18, 3, 5, 15, 3, 1, 3), Integer32()).setMaxAccess("readonly") if mibBuilder.loadTexts: wfIpexSessionIndex.setStatus('mandatory') if mibBuilder.loadTexts: wfIpexSessionIndex.setDescription('The index of this translation session') wfIpexSessionSrcConnType = MibTableColumn((1, 3, 6, 1, 4, 1, 18, 3, 5, 15, 3, 1, 4), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2, 4, 8, 16))).clone(namedValues=NamedValues(("pvc", 1), ("svc", 2), ("dcesvc", 4), ("lapb", 8), ("tcp", 16)))).setMaxAccess("readonly") if mibBuilder.loadTexts: wfIpexSessionSrcConnType.setStatus('mandatory') if mibBuilder.loadTexts: wfIpexSessionSrcConnType.setDescription('Defines type of original connection attempt. Whether it is a PVC, SVC, DCE_SVC, LAPB or TCP') wfIpexSessionDstConnCct = MibTableColumn((1, 3, 6, 1, 4, 1, 18, 3, 5, 15, 3, 1, 5), Integer32()).setMaxAccess("readonly") if mibBuilder.loadTexts: wfIpexSessionDstConnCct.setStatus('mandatory') if mibBuilder.loadTexts: wfIpexSessionDstConnCct.setDescription('The circuit from which the connection at the destination to be established to set up a translation session.') wfIpexSessionDstConnType = MibTableColumn((1, 3, 6, 1, 4, 1, 18, 3, 5, 15, 3, 1, 6), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2, 4, 8, 16))).clone(namedValues=NamedValues(("pvc", 1), ("svc", 2), ("dcesvc", 4), ("lapb", 8), ("tcp", 16))).clone('pvc')).setMaxAccess("readonly") if mibBuilder.loadTexts: wfIpexSessionDstConnType.setStatus('mandatory') if mibBuilder.loadTexts: wfIpexSessionDstConnType.setDescription('Defines type of connection at the destination end. Whether it is a PVC, SVC, DCE_SVC, LAPB or TCP') wfIpexSessionLocalDTEAddr = MibTableColumn((1, 3, 6, 1, 4, 1, 18, 3, 5, 15, 3, 1, 7), DisplayString()).setMaxAccess("readonly") if mibBuilder.loadTexts: wfIpexSessionLocalDTEAddr.setStatus('mandatory') if mibBuilder.loadTexts: wfIpexSessionLocalDTEAddr.setDescription('The Local DTE address (identifies the X.121 address of the X.25 interface on the IPEX). This attribute is only used in the case of a SVC connection initiated from the IPEX to the terminal') wfIpexSessionRemoteDTEAddr = MibTableColumn((1, 3, 6, 1, 4, 1, 18, 3, 5, 15, 3, 1, 8), DisplayString()).setMaxAccess("readonly") if mibBuilder.loadTexts: wfIpexSessionRemoteDTEAddr.setStatus('mandatory') if mibBuilder.loadTexts: wfIpexSessionRemoteDTEAddr.setDescription('The Remote DTE address (identifies the X.121 address of the X.25 interface on the terminal). This attribute is only used in the case of a SVC connection initiated from the IPEX to the terminal') wfIpexSessionLCN = MibTableColumn((1, 3, 6, 1, 4, 1, 18, 3, 5, 15, 3, 1, 9), Integer32().subtype(subtypeSpec=ValueRangeConstraint(1, 255)).clone(1)).setMaxAccess("readonly") if mibBuilder.loadTexts: wfIpexSessionLCN.setStatus('mandatory') if mibBuilder.loadTexts: wfIpexSessionLCN.setDescription('The LCN of the PVC (identifies the channel to be used to establish a PVC connection from the IPEX to the terminal') wfIpexSessionLocalIpAddr = MibTableColumn((1, 3, 6, 1, 4, 1, 18, 3, 5, 15, 3, 1, 10), IpAddress()).setMaxAccess("readonly") if mibBuilder.loadTexts: wfIpexSessionLocalIpAddr.setStatus('mandatory') if mibBuilder.loadTexts: wfIpexSessionLocalIpAddr.setDescription('The IP address of an interface on the IPEX to be used to establish a TCP connection with the host server. This attribute is only used in the case of a TCP connection initiated from the IPEX to a host') wfIpexSessionLocalTcpPort = MibTableColumn((1, 3, 6, 1, 4, 1, 18, 3, 5, 15, 3, 1, 11), Integer32()).setMaxAccess("readonly") if mibBuilder.loadTexts: wfIpexSessionLocalTcpPort.setStatus('mandatory') if mibBuilder.loadTexts: wfIpexSessionLocalTcpPort.setDescription('The local TCP port number in the IPEX to be used to establish a TCP connection to the host server This attribute is only used in the case of a TCP connection initiated from the IPEX to a host') wfIpexSessionRemoteIpAddr = MibTableColumn((1, 3, 6, 1, 4, 1, 18, 3, 5, 15, 3, 1, 12), IpAddress()).setMaxAccess("readonly") if mibBuilder.loadTexts: wfIpexSessionRemoteIpAddr.setStatus('mandatory') if mibBuilder.loadTexts: wfIpexSessionRemoteIpAddr.setDescription('The IP address of the remote host with which this translation session is established. This attribute is only used in the case of a TCP connection initiated from the IPEX to a host') wfIpexSessionRemoteTcpPort = MibTableColumn((1, 3, 6, 1, 4, 1, 18, 3, 5, 15, 3, 1, 13), Integer32()).setMaxAccess("readonly") if mibBuilder.loadTexts: wfIpexSessionRemoteTcpPort.setStatus('mandatory') if mibBuilder.loadTexts: wfIpexSessionRemoteTcpPort.setDescription('The remote TCP port number in the host to be used to establish a TCP connection from the IPEX to the host server. This attribute is only used in the case of a TCP connection initiated from the IPEX to a host') wfIpexSessionQueueSize = MibTableColumn((1, 3, 6, 1, 4, 1, 18, 3, 5, 15, 3, 1, 14), Integer32()).setMaxAccess("readonly") if mibBuilder.loadTexts: wfIpexSessionQueueSize.setStatus('mandatory') if mibBuilder.loadTexts: wfIpexSessionQueueSize.setDescription('The size of the IPEX queues used for transfering data between IPEX and TCP. The size is in bytes.') mibBuilder.exportSymbols("Wellfleet-IPEX-MIB", wfIpexSessionInstanceIdOffsetForSvc=wfIpexSessionInstanceIdOffsetForSvc, wfIpexMappingLocalDTEAddr=wfIpexMappingLocalDTEAddr, wfIpexSessionEntry=wfIpexSessionEntry, wfIpexMappingXlateCallingX121=wfIpexMappingXlateCallingX121, wfIpexMappingDisable=wfIpexMappingDisable, wfIpexMappingQueueSize=wfIpexMappingQueueSize, wfIpexMappingMsgHdrType=wfIpexMappingMsgHdrType, wfIpexMappingDstConnCct=wfIpexMappingDstConnCct, wfIpexSessionRemoteTcpPort=wfIpexSessionRemoteTcpPort, wfIpexBobEnabled=wfIpexBobEnabled, wfIpexDelete=wfIpexDelete, wfIpexMappingCfgLocalIpAddr=wfIpexMappingCfgLocalIpAddr, wfIpexMappingX25CUDF=wfIpexMappingX25CUDF, wfIpexSessionState=wfIpexSessionState, wfIpexTcpUseIpAddress=wfIpexTcpUseIpAddress, wfIpexMappingID2=wfIpexMappingID2, wfIpexMappingID1=wfIpexMappingID1, wfIpexSessionSrcConnCct=wfIpexSessionSrcConnCct, wfIpexMappingSlotNumber=wfIpexMappingSlotNumber, wfIpexDisable=wfIpexDisable, wfIpexSessionDstConnCct=wfIpexSessionDstConnCct, wfIpexInsCalledDte=wfIpexInsCalledDte, wfIpexMappingRemoteBackupIp=wfIpexMappingRemoteBackupIp, wfIpexMappingKeepaliveTimer=wfIpexMappingKeepaliveTimer, wfIpexMaxAuditIp=wfIpexMaxAuditIp, wfIpexMappingTable=wfIpexMappingTable, wfIpexSessionSrcConnType=wfIpexSessionSrcConnType, wfIpexMappingKeepaliveRetries=wfIpexMappingKeepaliveRetries, wfIpexSessionTable=wfIpexSessionTable, wfIpexSessionLocalIpAddr=wfIpexSessionLocalIpAddr, wfIpexMappingDstConnType=wfIpexMappingDstConnType, wfIpexMappingTcpMaxRetry=wfIpexMappingTcpMaxRetry, wfIpexInsCallingDte=wfIpexInsCallingDte, wfIpexSendResetRequestOnTCPUp=wfIpexSendResetRequestOnTCPUp, wfIpexSessionDstConnType=wfIpexSessionDstConnType, wfIpexMappingRemoteBackupTcpPort=wfIpexMappingRemoteBackupTcpPort, wfIpexTcpRequestCheck=wfIpexTcpRequestCheck, wfIpexState=wfIpexState, wfIpex=wfIpex, wfIpexMappingSrcConnType=wfIpexMappingSrcConnType, wfIpexMappingIdleTimer=wfIpexMappingIdleTimer, wfIpexSessionIndex=wfIpexSessionIndex, wfIpexSessionLocalDTEAddr=wfIpexSessionLocalDTEAddr, wfIpexSessionRemoteIpAddr=wfIpexSessionRemoteIpAddr, wfIpexTcpRequestLimit=wfIpexTcpRequestLimit, wfIpexMappingRemoteIpAddr=wfIpexMappingRemoteIpAddr, wfIpexSessionLocalTcpPort=wfIpexSessionLocalTcpPort, wfIpexMappingCtrlMode=wfIpexMappingCtrlMode, wfIpexMappingRemoteTcpPort=wfIpexMappingRemoteTcpPort, wfIpexSessionQueueSize=wfIpexSessionQueueSize, wfIpexMappingSrcConnCct=wfIpexMappingSrcConnCct, wfIpexTranslateNetworkOutOfOrder=wfIpexTranslateNetworkOutOfOrder, wfIpexMappingRemoteDTEAddr=wfIpexMappingRemoteDTEAddr, wfIpexMappingTrace=wfIpexMappingTrace, wfIpexSessionRemoteDTEAddr=wfIpexSessionRemoteDTEAddr, wfIpexMappingEntry=wfIpexMappingEntry, wfIpexMappingPvcLcn=wfIpexMappingPvcLcn, wfIpexBobTimeout=wfIpexBobTimeout, wfIpexSessionLCN=wfIpexSessionLCN, wfIpexMaxMessageSize=wfIpexMaxMessageSize, wfIpexMappingDelete=wfIpexMappingDelete)
(object_identifier, integer, octet_string) = mibBuilder.importSymbols('ASN1', 'ObjectIdentifier', 'Integer', 'OctetString') (named_values,) = mibBuilder.importSymbols('ASN1-ENUMERATION', 'NamedValues') (value_range_constraint, value_size_constraint, single_value_constraint, constraints_intersection, constraints_union) = mibBuilder.importSymbols('ASN1-REFINEMENT', 'ValueRangeConstraint', 'ValueSizeConstraint', 'SingleValueConstraint', 'ConstraintsIntersection', 'ConstraintsUnion') (notification_group, module_compliance) = mibBuilder.importSymbols('SNMPv2-CONF', 'NotificationGroup', 'ModuleCompliance') (unsigned32, notification_type, object_identity, ip_address, counter64, gauge32, counter32, mib_scalar, mib_table, mib_table_row, mib_table_column, time_ticks, bits, integer32, module_identity, iso, mib_identifier) = mibBuilder.importSymbols('SNMPv2-SMI', 'Unsigned32', 'NotificationType', 'ObjectIdentity', 'IpAddress', 'Counter64', 'Gauge32', 'Counter32', 'MibScalar', 'MibTable', 'MibTableRow', 'MibTableColumn', 'TimeTicks', 'Bits', 'Integer32', 'ModuleIdentity', 'iso', 'MibIdentifier') (display_string, textual_convention) = mibBuilder.importSymbols('SNMPv2-TC', 'DisplayString', 'TextualConvention') (wf_ipex_group,) = mibBuilder.importSymbols('Wellfleet-COMMON-MIB', 'wfIpexGroup') wf_ipex = mib_identifier((1, 3, 6, 1, 4, 1, 18, 3, 5, 15, 1)) wf_ipex_delete = mib_scalar((1, 3, 6, 1, 4, 1, 18, 3, 5, 15, 1, 1), integer32().subtype(subtypeSpec=constraints_union(single_value_constraint(1, 2))).clone(namedValues=named_values(('created', 1), ('deleted', 2))).clone('created')).setMaxAccess('readwrite') if mibBuilder.loadTexts: wfIpexDelete.setStatus('mandatory') if mibBuilder.loadTexts: wfIpexDelete.setDescription('Create/Delete parameter. Default is created. Users perform an SNMP SET operation on this object in order to create/delete IPEX.') wf_ipex_disable = mib_scalar((1, 3, 6, 1, 4, 1, 18, 3, 5, 15, 1, 2), integer32().subtype(subtypeSpec=constraints_union(single_value_constraint(1, 2))).clone(namedValues=named_values(('enabled', 1), ('disabled', 2))).clone('enabled')).setMaxAccess('readwrite') if mibBuilder.loadTexts: wfIpexDisable.setStatus('mandatory') if mibBuilder.loadTexts: wfIpexDisable.setDescription('Enable/Disable parameter. Default is enabled. Users perform an SNMP SET operation on this object in order to enable/disable IPEX.') wf_ipex_state = mib_scalar((1, 3, 6, 1, 4, 1, 18, 3, 5, 15, 1, 3), integer32().subtype(subtypeSpec=constraints_union(single_value_constraint(1, 2, 3, 4))).clone(namedValues=named_values(('up', 1), ('down', 2), ('init', 3), ('notpresent', 4))).clone('down')).setMaxAccess('readonly') if mibBuilder.loadTexts: wfIpexState.setStatus('mandatory') if mibBuilder.loadTexts: wfIpexState.setDescription('The current state of IPEX.') wf_ipex_max_message_size = mib_scalar((1, 3, 6, 1, 4, 1, 18, 3, 5, 15, 1, 4), integer32().subtype(subtypeSpec=value_range_constraint(16, 4096)).clone(1600)).setMaxAccess('readwrite') if mibBuilder.loadTexts: wfIpexMaxMessageSize.setStatus('mandatory') if mibBuilder.loadTexts: wfIpexMaxMessageSize.setDescription('The maximum client message size that IPEX accepts. The size is in bytes.') wf_ipex_ins_called_dte = mib_scalar((1, 3, 6, 1, 4, 1, 18, 3, 5, 15, 1, 5), integer32().subtype(subtypeSpec=constraints_union(single_value_constraint(1, 2))).clone(namedValues=named_values(('enabled', 1), ('disabled', 2))).clone('disabled')).setMaxAccess('readwrite') if mibBuilder.loadTexts: wfIpexInsCalledDte.setStatus('mandatory') if mibBuilder.loadTexts: wfIpexInsCalledDte.setDescription('Enable/Disable parameter. Default is disabled. Users perform an SNMP SET operation on this object in order to enable/disable the support for inserting Called DTE address.') wf_ipex_ins_calling_dte = mib_scalar((1, 3, 6, 1, 4, 1, 18, 3, 5, 15, 1, 6), integer32().subtype(subtypeSpec=constraints_union(single_value_constraint(1, 2))).clone(namedValues=named_values(('enabled', 1), ('disabled', 2))).clone('disabled')).setMaxAccess('readwrite') if mibBuilder.loadTexts: wfIpexInsCallingDte.setStatus('mandatory') if mibBuilder.loadTexts: wfIpexInsCallingDte.setDescription('Enable/disable the support for transmitting the calling DTE address over TCP tunnel. This changes the IPEX control message header format and hence this attribute should be enabled (only for 11.02 or up) on both ends (local & remote routers) for proper operation. This attribute applies only to End_to_End mode.') wf_ipex_tcp_request_limit = mib_scalar((1, 3, 6, 1, 4, 1, 18, 3, 5, 15, 1, 7), integer32().subtype(subtypeSpec=value_range_constraint(0, 1000)).clone(25)).setMaxAccess('readwrite') if mibBuilder.loadTexts: wfIpexTcpRequestLimit.setStatus('mandatory') if mibBuilder.loadTexts: wfIpexTcpRequestLimit.setDescription('The maximum number of TCP requests IPEX can have pending with TCP. Any addition requests will be queued until the number of pending requests fall below the limit.') wf_ipex_tcp_request_check = mib_scalar((1, 3, 6, 1, 4, 1, 18, 3, 5, 15, 1, 8), integer32().subtype(subtypeSpec=value_range_constraint(0, 30000)).clone(1000)).setMaxAccess('readwrite') if mibBuilder.loadTexts: wfIpexTcpRequestCheck.setStatus('mandatory') if mibBuilder.loadTexts: wfIpexTcpRequestCheck.setDescription('When IPEX has queued TCP requests, the time period (in milliseconds) between checking if the number of pending TCP requests have fallen below wfIpexTcpRequestLimit.') wf_ipex_send_reset_request_on_tcp_up = mib_scalar((1, 3, 6, 1, 4, 1, 18, 3, 5, 15, 1, 9), integer32().clone(9)).setMaxAccess('readwrite') if mibBuilder.loadTexts: wfIpexSendResetRequestOnTCPUp.setStatus('mandatory') if mibBuilder.loadTexts: wfIpexSendResetRequestOnTCPUp.setDescription('Default(cause code) is 0x09 and PVC_TCP sends out the Reset Request with the cause code = 0x09 and TCP_PVC Router does not send the Reset Request when TCP is up. If the value is changed from the default cause code(0x09) then IPEX Gateway will send out the Reset Request with this value when network is operational. TCP_PVC will also send the Reset Request with this cause code when TCP connection is up.') wf_ipex_translate_network_out_of_order = mib_scalar((1, 3, 6, 1, 4, 1, 18, 3, 5, 15, 1, 10), integer32().clone(29)).setMaxAccess('readwrite') if mibBuilder.loadTexts: wfIpexTranslateNetworkOutOfOrder.setStatus('mandatory') if mibBuilder.loadTexts: wfIpexTranslateNetworkOutOfOrder.setDescription('Default is 0x1d(29): Network out of order. If the value is changed from the default cause code = 0x1d then the IPEX Gateway will send the Reset Request with cause code specified when the network is out of order.') wf_ipex_tcp_use_ip_address = mib_scalar((1, 3, 6, 1, 4, 1, 18, 3, 5, 15, 1, 11), integer32().subtype(subtypeSpec=constraints_union(single_value_constraint(1, 2))).clone(namedValues=named_values(('enabled', 1), ('disabled', 2))).clone('disabled')).setMaxAccess('readwrite') if mibBuilder.loadTexts: wfIpexTcpUseIpAddress.setStatus('mandatory') if mibBuilder.loadTexts: wfIpexTcpUseIpAddress.setDescription('Enable/Disable parameter. Default is disabled. If set to Enabled, the IP address used for a TCP connection will be the coresponding address for the circuit.') wf_ipex_bob_enabled = mib_scalar((1, 3, 6, 1, 4, 1, 18, 3, 5, 15, 1, 12), integer32().subtype(subtypeSpec=constraints_union(single_value_constraint(1, 2))).clone(namedValues=named_values(('disabled', 1), ('enabled', 2))).clone('disabled')).setMaxAccess('readwrite') if mibBuilder.loadTexts: wfIpexBobEnabled.setStatus('mandatory') if mibBuilder.loadTexts: wfIpexBobEnabled.setDescription('This attribute will indicate whether IPEX supports Bank Of Bahrain enhancement. If it is enabled, only calling DTE will be send in ASCII format in user defined area of message header, if header type is full.') wf_ipex_bob_timeout = mib_scalar((1, 3, 6, 1, 4, 1, 18, 3, 5, 15, 1, 13), integer32().subtype(subtypeSpec=value_range_constraint(0, 30000)).clone(15000)).setMaxAccess('readwrite') if mibBuilder.loadTexts: wfIpexBobTimeout.setStatus('mandatory') if mibBuilder.loadTexts: wfIpexBobTimeout.setDescription('This attribute will indicate the timeout in milliseconds, after which DEVICE UP message is to be send to BOB mainserver from router, as long as this service supports BOB functionality.') wf_ipex_max_audit_ip = mib_scalar((1, 3, 6, 1, 4, 1, 18, 3, 5, 15, 1, 14), integer32().clone(25)).setMaxAccess('readwrite') if mibBuilder.loadTexts: wfIpexMaxAuditIp.setStatus('mandatory') if mibBuilder.loadTexts: wfIpexMaxAuditIp.setDescription("Default is 25. Specify the maximum of IP address and TCP port pairs that IPEX Audit gate can hold in its internal table when IPEX PVC-TCP Gateway is in TCP Retry Mode. Audit gate puts new ip address and TCP port pair to the internal table when it tries TCP connection. IPEX Audit gate will be re-trying TCP connections until the table is filled up. Once it is full then it won't re-try new TCP connections. Setting zero causes IPEX audit gate to try TCP connections without examining the IP address and TCP port pairs had already tried out or not.") wf_ipex_session_instance_id_offset_for_svc = mib_scalar((1, 3, 6, 1, 4, 1, 18, 3, 5, 15, 1, 15), integer32()).setMaxAccess('readwrite') if mibBuilder.loadTexts: wfIpexSessionInstanceIdOffsetForSvc.setStatus('mandatory') if mibBuilder.loadTexts: wfIpexSessionInstanceIdOffsetForSvc.setDescription('Default is 0. Specify the offset value for wfIpexSessionEntry when instances for SVC are created. For example, when it is set to 1023, instance ID for wfIpexSessionEntry for SVC connections will be wfIpexSessionEntry.*.3.1024 and the next one will be wfIpexSessionEntry.*.3.1025 and so on. This MIB object is introduced not to assign same instance ID to PVC and SVC when SVCs and PVCs are configured with single circuit. Because wfIpexSessionEntry for PVCs are based on the LCNs and the ones for SVCs are based on the order of each SVC being created, there would be the cases that same instance IDs are assigned to both SVC and PVC and it will cause the router to fault. It needs to be set to the value which is greater than the maximum LCN of the PVC connections when PVCs and SVCs co-exist on a single circuit.') wf_ipex_mapping_table = mib_table((1, 3, 6, 1, 4, 1, 18, 3, 5, 15, 2)) if mibBuilder.loadTexts: wfIpexMappingTable.setStatus('mandatory') if mibBuilder.loadTexts: wfIpexMappingTable.setDescription('A table which contains the list of mappings between TCP connections and X.25 connections. This is the configuration table in which each entry sets up the association between a TCP port number and a X.25 DTE address or connection. inst_id[] = wfIpexMappingSrcConnCct wfIpexMappingSrcConnType wfIpexMappingID') wf_ipex_mapping_entry = mib_table_row((1, 3, 6, 1, 4, 1, 18, 3, 5, 15, 2, 1)).setIndexNames((0, 'Wellfleet-IPEX-MIB', 'wfIpexMappingSrcConnCct'), (0, 'Wellfleet-IPEX-MIB', 'wfIpexMappingSrcConnType'), (0, 'Wellfleet-IPEX-MIB', 'wfIpexMappingID1'), (0, 'Wellfleet-IPEX-MIB', 'wfIpexMappingID2')) if mibBuilder.loadTexts: wfIpexMappingEntry.setStatus('mandatory') if mibBuilder.loadTexts: wfIpexMappingEntry.setDescription('An entry in wfIpexMappingTable.') wf_ipex_mapping_delete = mib_table_column((1, 3, 6, 1, 4, 1, 18, 3, 5, 15, 2, 1, 1), integer32().subtype(subtypeSpec=constraints_union(single_value_constraint(1, 2))).clone(namedValues=named_values(('created', 1), ('deleted', 2))).clone('created')).setMaxAccess('readwrite') if mibBuilder.loadTexts: wfIpexMappingDelete.setStatus('mandatory') if mibBuilder.loadTexts: wfIpexMappingDelete.setDescription('Create/Delete attribute. Default is created. Users perform an SNMP SET operation on this object in order to create/delete a translation mapping record.') wf_ipex_mapping_disable = mib_table_column((1, 3, 6, 1, 4, 1, 18, 3, 5, 15, 2, 1, 2), integer32().subtype(subtypeSpec=constraints_union(single_value_constraint(1, 2))).clone(namedValues=named_values(('enabled', 1), ('disabled', 2))).clone('enabled')).setMaxAccess('readwrite') if mibBuilder.loadTexts: wfIpexMappingDisable.setStatus('mandatory') if mibBuilder.loadTexts: wfIpexMappingDisable.setDescription('Enables or Disables this Mapping entry. Setting this attribute to DISABLED will disconnect all active Sessions pertaining to this Mapping entry') wf_ipex_mapping_src_conn_cct = mib_table_column((1, 3, 6, 1, 4, 1, 18, 3, 5, 15, 2, 1, 3), integer32()).setMaxAccess('readonly') if mibBuilder.loadTexts: wfIpexMappingSrcConnCct.setStatus('mandatory') if mibBuilder.loadTexts: wfIpexMappingSrcConnCct.setDescription('The circuit from which the connection attempt is received that initiates a translation session.') wf_ipex_mapping_src_conn_type = mib_table_column((1, 3, 6, 1, 4, 1, 18, 3, 5, 15, 2, 1, 4), integer32().subtype(subtypeSpec=constraints_union(single_value_constraint(1, 2, 4, 8, 16))).clone(namedValues=named_values(('pvc', 1), ('svc', 2), ('dcesvc', 4), ('lapb', 8), ('tcp', 16)))).setMaxAccess('readonly') if mibBuilder.loadTexts: wfIpexMappingSrcConnType.setStatus('mandatory') if mibBuilder.loadTexts: wfIpexMappingSrcConnType.setDescription('Defines the type of original connection attempt. Whether it is a PVC, SVC, DCE_SVC, LAPB or TCP') wf_ipex_mapping_id1 = mib_table_column((1, 3, 6, 1, 4, 1, 18, 3, 5, 15, 2, 1, 5), integer32()).setMaxAccess('readonly') if mibBuilder.loadTexts: wfIpexMappingID1.setStatus('mandatory') if mibBuilder.loadTexts: wfIpexMappingID1.setDescription('The translation mapping identifier which identifies the remote connection of the translation session. This is an identifier that is available from the incoming connection attempt. The meaning of this object (wfIpexMappingID1) and the next object (wfIpexMappingID2) is dependent on the value of wfIpexMappingSrcConnType. SrcConnType ID1 ID2 --------------------------------------------------- pvc(1) LCN value 0 (Null) svc(2) 0 Called X.121 Address dcesvc(4) 0 0 (Null) lapb(8) 0 0 (Null) tcp(16) Port Number 0 (Null) ') wf_ipex_mapping_id2 = mib_table_column((1, 3, 6, 1, 4, 1, 18, 3, 5, 15, 2, 1, 6), octet_string()).setMaxAccess('readonly') if mibBuilder.loadTexts: wfIpexMappingID2.setStatus('mandatory') if mibBuilder.loadTexts: wfIpexMappingID2.setDescription('(See description for wfIpexMappingID1 above)') wf_ipex_mapping_dst_conn_cct = mib_table_column((1, 3, 6, 1, 4, 1, 18, 3, 5, 15, 2, 1, 7), integer32()).setMaxAccess('readwrite') if mibBuilder.loadTexts: wfIpexMappingDstConnCct.setStatus('mandatory') if mibBuilder.loadTexts: wfIpexMappingDstConnCct.setDescription('The circuit from which the connection to the destination is to be established to set up a translation session.') wf_ipex_mapping_dst_conn_type = mib_table_column((1, 3, 6, 1, 4, 1, 18, 3, 5, 15, 2, 1, 8), integer32().subtype(subtypeSpec=constraints_union(single_value_constraint(1, 2, 4, 8, 16))).clone(namedValues=named_values(('pvc', 1), ('svc', 2), ('dcesvc', 4), ('lapb', 8), ('tcp', 16))).clone('pvc')).setMaxAccess('readwrite') if mibBuilder.loadTexts: wfIpexMappingDstConnType.setStatus('mandatory') if mibBuilder.loadTexts: wfIpexMappingDstConnType.setDescription('Defines type of connection at the destination end. Whether it is a PVC, SVC, DCE_SVC, LAPB or TCP') wf_ipex_mapping_local_dte_addr = mib_table_column((1, 3, 6, 1, 4, 1, 18, 3, 5, 15, 2, 1, 9), display_string()).setMaxAccess('readwrite') if mibBuilder.loadTexts: wfIpexMappingLocalDTEAddr.setStatus('mandatory') if mibBuilder.loadTexts: wfIpexMappingLocalDTEAddr.setDescription('The Local DTE address (identifies the X.121 address of the X.25 interface on the IPEX). This attribute is only used in the case of a SVC connection initiated from the IPEX to the terminal') wf_ipex_mapping_remote_dte_addr = mib_table_column((1, 3, 6, 1, 4, 1, 18, 3, 5, 15, 2, 1, 10), display_string()).setMaxAccess('readwrite') if mibBuilder.loadTexts: wfIpexMappingRemoteDTEAddr.setStatus('mandatory') if mibBuilder.loadTexts: wfIpexMappingRemoteDTEAddr.setDescription('The Remote DTE address (identifies the X.121 address of the X.25 interface on the terminal). This attribute is only used in the case of a SVC connection initiated from the IPEX to the terminal') wf_ipex_mapping_pvc_lcn = mib_table_column((1, 3, 6, 1, 4, 1, 18, 3, 5, 15, 2, 1, 11), integer32().subtype(subtypeSpec=value_range_constraint(1, 4095)).clone(1)).setMaxAccess('readwrite') if mibBuilder.loadTexts: wfIpexMappingPvcLcn.setStatus('mandatory') if mibBuilder.loadTexts: wfIpexMappingPvcLcn.setDescription('The LCN of the PVC connection from the IPEX to the terminal (identifies the channel to be used to reset the PVC connection. This attribute * is only used in the case of a PVC connection initiated from the IPEX to the terminal') wf_ipex_mapping_remote_ip_addr = mib_table_column((1, 3, 6, 1, 4, 1, 18, 3, 5, 15, 2, 1, 12), ip_address()).setMaxAccess('readwrite') if mibBuilder.loadTexts: wfIpexMappingRemoteIpAddr.setStatus('mandatory') if mibBuilder.loadTexts: wfIpexMappingRemoteIpAddr.setDescription('The IP address of the remote host with which this translation session is established. This attribute is only used in the case of a TCP connection initiated from the IPEX to a host') wf_ipex_mapping_remote_tcp_port = mib_table_column((1, 3, 6, 1, 4, 1, 18, 3, 5, 15, 2, 1, 13), integer32()).setMaxAccess('readwrite') if mibBuilder.loadTexts: wfIpexMappingRemoteTcpPort.setStatus('mandatory') if mibBuilder.loadTexts: wfIpexMappingRemoteTcpPort.setDescription('The remote TCP port number in the host to be used to establish a TCP connection from the IPEX to the host server. This attribute is only used in the case of a TCP connection initiated from the IPEX to a host') wf_ipex_mapping_queue_size = mib_table_column((1, 3, 6, 1, 4, 1, 18, 3, 5, 15, 2, 1, 14), integer32().subtype(subtypeSpec=value_range_constraint(16, 8192)).clone(8192)).setMaxAccess('readwrite') if mibBuilder.loadTexts: wfIpexMappingQueueSize.setStatus('mandatory') if mibBuilder.loadTexts: wfIpexMappingQueueSize.setDescription('The size of the IPEX queues used for transfering data between TCP and X.25. The size is in bytes.') wf_ipex_mapping_slot_number = mib_table_column((1, 3, 6, 1, 4, 1, 18, 3, 5, 15, 2, 1, 15), integer32().subtype(subtypeSpec=value_range_constraint(1, 13))).setMaxAccess('readwrite') if mibBuilder.loadTexts: wfIpexMappingSlotNumber.setStatus('mandatory') if mibBuilder.loadTexts: wfIpexMappingSlotNumber.setDescription('The slot of the access (X.25 or LAPB) circuit on which the X.25 or LAPB connections will be established.') wf_ipex_mapping_ctrl_mode = mib_table_column((1, 3, 6, 1, 4, 1, 18, 3, 5, 15, 2, 1, 16), integer32().subtype(subtypeSpec=constraints_union(single_value_constraint(1, 2, 3))).clone(namedValues=named_values(('local', 1), ('end2end', 2), ('gateway', 3))).clone('end2end')).setMaxAccess('readwrite') if mibBuilder.loadTexts: wfIpexMappingCtrlMode.setStatus('mandatory') if mibBuilder.loadTexts: wfIpexMappingCtrlMode.setDescription('Local mode configuration terminates X.25 at the router interface. The end2end mode configuration allows X.25 signalling and data to operate between two remote X.25 networks, using the router to translate both call control and data over a TCP/IP network. The gateway mode terminates X.25 at the router interface, but allows the user to configure 3 message header types at the TCP application layer. These header values are described in wfIpexMappingMsgHdrType.') wf_ipex_mapping_x25_cudf = mib_table_column((1, 3, 6, 1, 4, 1, 18, 3, 5, 15, 2, 1, 17), octet_string()).setMaxAccess('readwrite') if mibBuilder.loadTexts: wfIpexMappingX25CUDF.setStatus('mandatory') if mibBuilder.loadTexts: wfIpexMappingX25CUDF.setDescription('The X.25 Call User Data field (CUDF) in a X.25 Call Request packet header. This attribute is only used in the case of a SVC connection initiated from the IPEX to the terminal. It is used as the network layer protocol identifier of the X.25 connection.') wf_ipex_mapping_idle_timer = mib_table_column((1, 3, 6, 1, 4, 1, 18, 3, 5, 15, 2, 1, 18), integer32().subtype(subtypeSpec=value_range_constraint(0, 86400)).clone(120)).setMaxAccess('readwrite') if mibBuilder.loadTexts: wfIpexMappingIdleTimer.setStatus('mandatory') if mibBuilder.loadTexts: wfIpexMappingIdleTimer.setDescription('Idle session timeout period, in seconds. If an established TCP connection remains inactive for this interval, KEEPALIVE messages will be sent to the peer (if the Keepalive Timer is non-zero). Setting the Idle Timer to zero disables the keepalive feature.') wf_ipex_mapping_keepalive_timer = mib_table_column((1, 3, 6, 1, 4, 1, 18, 3, 5, 15, 2, 1, 19), integer32().subtype(subtypeSpec=value_range_constraint(0, 600)).clone(3)).setMaxAccess('readwrite') if mibBuilder.loadTexts: wfIpexMappingKeepaliveTimer.setStatus('mandatory') if mibBuilder.loadTexts: wfIpexMappingKeepaliveTimer.setDescription('KEEPALIVE retransmit timeout period, in seconds. This is the interval at which unacknowledged KEEPALIVE messages will be retransmitted. If the Idle Timer is set to zero, this timer ignored. If the Idle Timer is non-zero and this timer IS zero, no KEEPALIVEs are sent and the session is terminated upon expiration of the Idle Timer.') wf_ipex_mapping_keepalive_retries = mib_table_column((1, 3, 6, 1, 4, 1, 18, 3, 5, 15, 2, 1, 20), integer32().subtype(subtypeSpec=value_range_constraint(0, 99)).clone(5)).setMaxAccess('readwrite') if mibBuilder.loadTexts: wfIpexMappingKeepaliveRetries.setStatus('mandatory') if mibBuilder.loadTexts: wfIpexMappingKeepaliveRetries.setDescription('Number of unacknowledged KEEPALIVE messages retransmitted before the TCP session is terminated. If this count is set to zero, only one KEEPALIVE message will be sent.') wf_ipex_mapping_trace = mib_table_column((1, 3, 6, 1, 4, 1, 18, 3, 5, 15, 2, 1, 21), integer32()).setMaxAccess('readwrite') if mibBuilder.loadTexts: wfIpexMappingTrace.setStatus('mandatory') if mibBuilder.loadTexts: wfIpexMappingTrace.setDescription('This object is a bitmask, setting the low order bit enables tracing of IPEX internal events. Setting other individual bit postions disable logging of internal IPEX events. Values may be added together to disable multiple message groups. Hex Dec Value Value Message/Event --------------------------------------------------------- 0x0001 1 Enable IPEX tracing. 0x0002 2 Data packets from IPEX to X.25. 0x0004 4 Data packets from X.25 to IPEX. 0x0008 8 Window updates from X.25. 0x0010 16 Data from TCP to IPEX. 0x0020 32 Window updates from TCP. 0x0040 64 Window requests from TCP.') wf_ipex_mapping_msg_hdr_type = mib_table_column((1, 3, 6, 1, 4, 1, 18, 3, 5, 15, 2, 1, 22), integer32().subtype(subtypeSpec=constraints_union(single_value_constraint(1, 2, 3, 4))).clone(namedValues=named_values(('none', 1), ('short', 2), ('long', 3), ('full', 4))).clone('full')).setMaxAccess('readwrite') if mibBuilder.loadTexts: wfIpexMappingMsgHdrType.setStatus('mandatory') if mibBuilder.loadTexts: wfIpexMappingMsgHdrType.setDescription('This attribute enables the Message Boundary Protocol. When enabled, this bit is used to mark the boundary of TCP application data that is consistent with Gateway Operation. The first three message header types are used only with wfIpexMappingCtlMode in gateway mode. The default value is used with wfIpexMappingCtlMode in the local or end2end mode of operation. NONE = Msg Boundary Protocol is off, no msg header. SHORT = Msg header condtains a 2-Byte length field. LONG = Msg header contains a 1-Byte type, 1-Byte version, and a 2-Byte length fields. FULL = Msg Header contains a 2-Byte length1 field, 1-Byte Version field, 1-Byte Type field and, a 1-Byte length2 field') wf_ipex_mapping_remote_backup_ip = mib_table_column((1, 3, 6, 1, 4, 1, 18, 3, 5, 15, 2, 1, 23), ip_address()).setMaxAccess('readwrite') if mibBuilder.loadTexts: wfIpexMappingRemoteBackupIp.setStatus('mandatory') if mibBuilder.loadTexts: wfIpexMappingRemoteBackupIp.setDescription('The IP address of the remote host with which this translation session is established. This attribute is only used in the case of a TCP connection with the primary remote IP address (wfIpexMappingRemoteIpAddr) failed.') wf_ipex_mapping_xlate_calling_x121 = mib_table_column((1, 3, 6, 1, 4, 1, 18, 3, 5, 15, 2, 1, 24), display_string()).setMaxAccess('readwrite') if mibBuilder.loadTexts: wfIpexMappingXlateCallingX121.setStatus('mandatory') if mibBuilder.loadTexts: wfIpexMappingXlateCallingX121.setDescription('If this attribute is configured then insert this X.121 addr as the calling addr in the Call request pkt.') wf_ipex_mapping_tcp_max_retry = mib_table_column((1, 3, 6, 1, 4, 1, 18, 3, 5, 15, 2, 1, 25), integer32().subtype(subtypeSpec=value_range_constraint(0, 16384))).setMaxAccess('readwrite') if mibBuilder.loadTexts: wfIpexMappingTcpMaxRetry.setStatus('mandatory') if mibBuilder.loadTexts: wfIpexMappingTcpMaxRetry.setDescription('The maximum number of attempts that PVC-TCP will make to re-establish the connection to the remote peer. The TCP Retry takes place every 15 seconds hence default setting will perform the TCP Retry forever.') wf_ipex_mapping_cfg_local_ip_addr = mib_table_column((1, 3, 6, 1, 4, 1, 18, 3, 5, 15, 2, 1, 26), ip_address()).setMaxAccess('readwrite') if mibBuilder.loadTexts: wfIpexMappingCfgLocalIpAddr.setStatus('mandatory') if mibBuilder.loadTexts: wfIpexMappingCfgLocalIpAddr.setDescription('The IP address on the router to use as the source of the TCP session. This attribute is only used in the case of a TCP connection initiated from the IPEX to a host') wf_ipex_mapping_remote_backup_tcp_port = mib_table_column((1, 3, 6, 1, 4, 1, 18, 3, 5, 15, 2, 1, 27), integer32()).setMaxAccess('readwrite') if mibBuilder.loadTexts: wfIpexMappingRemoteBackupTcpPort.setStatus('mandatory') if mibBuilder.loadTexts: wfIpexMappingRemoteBackupTcpPort.setDescription('The TCP port of the remote host with which this translation session is established. This attribute is only used in the case of a TCP connection with the primary remote IP address (wfIpexMappingRemoteIpAddr) failed.') wf_ipex_session_table = mib_table((1, 3, 6, 1, 4, 1, 18, 3, 5, 15, 3)) if mibBuilder.loadTexts: wfIpexSessionTable.setStatus('mandatory') if mibBuilder.loadTexts: wfIpexSessionTable.setDescription('A table that contains the information about the current active IPEX translation sessions. The status and statistics information related to each translation session is provided here. inst_id[] = wfIpexSessionIndex') wf_ipex_session_entry = mib_table_row((1, 3, 6, 1, 4, 1, 18, 3, 5, 15, 3, 1)).setIndexNames((0, 'Wellfleet-IPEX-MIB', 'wfIpexSessionSrcConnCct'), (0, 'Wellfleet-IPEX-MIB', 'wfIpexSessionIndex')) if mibBuilder.loadTexts: wfIpexSessionEntry.setStatus('mandatory') if mibBuilder.loadTexts: wfIpexSessionEntry.setDescription('An entry in wfIpexSession.') wf_ipex_session_state = mib_table_column((1, 3, 6, 1, 4, 1, 18, 3, 5, 15, 3, 1, 1), integer32().subtype(subtypeSpec=constraints_union(single_value_constraint(1, 2, 3, 4, 5))).clone(namedValues=named_values(('x25up', 1), ('tcpup', 2), ('ccestab', 3), ('notconn', 4), ('lapbup', 5))).clone('notconn')).setMaxAccess('readonly') if mibBuilder.loadTexts: wfIpexSessionState.setStatus('mandatory') if mibBuilder.loadTexts: wfIpexSessionState.setDescription('The IPEX state of this translation session. These are the steady states of the IPEX state machine. Transition states are not reflected.') wf_ipex_session_src_conn_cct = mib_table_column((1, 3, 6, 1, 4, 1, 18, 3, 5, 15, 3, 1, 2), integer32()).setMaxAccess('readonly') if mibBuilder.loadTexts: wfIpexSessionSrcConnCct.setStatus('mandatory') if mibBuilder.loadTexts: wfIpexSessionSrcConnCct.setDescription('The circuit from which the original connection attempt is received that initiated a translation session.') wf_ipex_session_index = mib_table_column((1, 3, 6, 1, 4, 1, 18, 3, 5, 15, 3, 1, 3), integer32()).setMaxAccess('readonly') if mibBuilder.loadTexts: wfIpexSessionIndex.setStatus('mandatory') if mibBuilder.loadTexts: wfIpexSessionIndex.setDescription('The index of this translation session') wf_ipex_session_src_conn_type = mib_table_column((1, 3, 6, 1, 4, 1, 18, 3, 5, 15, 3, 1, 4), integer32().subtype(subtypeSpec=constraints_union(single_value_constraint(1, 2, 4, 8, 16))).clone(namedValues=named_values(('pvc', 1), ('svc', 2), ('dcesvc', 4), ('lapb', 8), ('tcp', 16)))).setMaxAccess('readonly') if mibBuilder.loadTexts: wfIpexSessionSrcConnType.setStatus('mandatory') if mibBuilder.loadTexts: wfIpexSessionSrcConnType.setDescription('Defines type of original connection attempt. Whether it is a PVC, SVC, DCE_SVC, LAPB or TCP') wf_ipex_session_dst_conn_cct = mib_table_column((1, 3, 6, 1, 4, 1, 18, 3, 5, 15, 3, 1, 5), integer32()).setMaxAccess('readonly') if mibBuilder.loadTexts: wfIpexSessionDstConnCct.setStatus('mandatory') if mibBuilder.loadTexts: wfIpexSessionDstConnCct.setDescription('The circuit from which the connection at the destination to be established to set up a translation session.') wf_ipex_session_dst_conn_type = mib_table_column((1, 3, 6, 1, 4, 1, 18, 3, 5, 15, 3, 1, 6), integer32().subtype(subtypeSpec=constraints_union(single_value_constraint(1, 2, 4, 8, 16))).clone(namedValues=named_values(('pvc', 1), ('svc', 2), ('dcesvc', 4), ('lapb', 8), ('tcp', 16))).clone('pvc')).setMaxAccess('readonly') if mibBuilder.loadTexts: wfIpexSessionDstConnType.setStatus('mandatory') if mibBuilder.loadTexts: wfIpexSessionDstConnType.setDescription('Defines type of connection at the destination end. Whether it is a PVC, SVC, DCE_SVC, LAPB or TCP') wf_ipex_session_local_dte_addr = mib_table_column((1, 3, 6, 1, 4, 1, 18, 3, 5, 15, 3, 1, 7), display_string()).setMaxAccess('readonly') if mibBuilder.loadTexts: wfIpexSessionLocalDTEAddr.setStatus('mandatory') if mibBuilder.loadTexts: wfIpexSessionLocalDTEAddr.setDescription('The Local DTE address (identifies the X.121 address of the X.25 interface on the IPEX). This attribute is only used in the case of a SVC connection initiated from the IPEX to the terminal') wf_ipex_session_remote_dte_addr = mib_table_column((1, 3, 6, 1, 4, 1, 18, 3, 5, 15, 3, 1, 8), display_string()).setMaxAccess('readonly') if mibBuilder.loadTexts: wfIpexSessionRemoteDTEAddr.setStatus('mandatory') if mibBuilder.loadTexts: wfIpexSessionRemoteDTEAddr.setDescription('The Remote DTE address (identifies the X.121 address of the X.25 interface on the terminal). This attribute is only used in the case of a SVC connection initiated from the IPEX to the terminal') wf_ipex_session_lcn = mib_table_column((1, 3, 6, 1, 4, 1, 18, 3, 5, 15, 3, 1, 9), integer32().subtype(subtypeSpec=value_range_constraint(1, 255)).clone(1)).setMaxAccess('readonly') if mibBuilder.loadTexts: wfIpexSessionLCN.setStatus('mandatory') if mibBuilder.loadTexts: wfIpexSessionLCN.setDescription('The LCN of the PVC (identifies the channel to be used to establish a PVC connection from the IPEX to the terminal') wf_ipex_session_local_ip_addr = mib_table_column((1, 3, 6, 1, 4, 1, 18, 3, 5, 15, 3, 1, 10), ip_address()).setMaxAccess('readonly') if mibBuilder.loadTexts: wfIpexSessionLocalIpAddr.setStatus('mandatory') if mibBuilder.loadTexts: wfIpexSessionLocalIpAddr.setDescription('The IP address of an interface on the IPEX to be used to establish a TCP connection with the host server. This attribute is only used in the case of a TCP connection initiated from the IPEX to a host') wf_ipex_session_local_tcp_port = mib_table_column((1, 3, 6, 1, 4, 1, 18, 3, 5, 15, 3, 1, 11), integer32()).setMaxAccess('readonly') if mibBuilder.loadTexts: wfIpexSessionLocalTcpPort.setStatus('mandatory') if mibBuilder.loadTexts: wfIpexSessionLocalTcpPort.setDescription('The local TCP port number in the IPEX to be used to establish a TCP connection to the host server This attribute is only used in the case of a TCP connection initiated from the IPEX to a host') wf_ipex_session_remote_ip_addr = mib_table_column((1, 3, 6, 1, 4, 1, 18, 3, 5, 15, 3, 1, 12), ip_address()).setMaxAccess('readonly') if mibBuilder.loadTexts: wfIpexSessionRemoteIpAddr.setStatus('mandatory') if mibBuilder.loadTexts: wfIpexSessionRemoteIpAddr.setDescription('The IP address of the remote host with which this translation session is established. This attribute is only used in the case of a TCP connection initiated from the IPEX to a host') wf_ipex_session_remote_tcp_port = mib_table_column((1, 3, 6, 1, 4, 1, 18, 3, 5, 15, 3, 1, 13), integer32()).setMaxAccess('readonly') if mibBuilder.loadTexts: wfIpexSessionRemoteTcpPort.setStatus('mandatory') if mibBuilder.loadTexts: wfIpexSessionRemoteTcpPort.setDescription('The remote TCP port number in the host to be used to establish a TCP connection from the IPEX to the host server. This attribute is only used in the case of a TCP connection initiated from the IPEX to a host') wf_ipex_session_queue_size = mib_table_column((1, 3, 6, 1, 4, 1, 18, 3, 5, 15, 3, 1, 14), integer32()).setMaxAccess('readonly') if mibBuilder.loadTexts: wfIpexSessionQueueSize.setStatus('mandatory') if mibBuilder.loadTexts: wfIpexSessionQueueSize.setDescription('The size of the IPEX queues used for transfering data between IPEX and TCP. The size is in bytes.') mibBuilder.exportSymbols('Wellfleet-IPEX-MIB', wfIpexSessionInstanceIdOffsetForSvc=wfIpexSessionInstanceIdOffsetForSvc, wfIpexMappingLocalDTEAddr=wfIpexMappingLocalDTEAddr, wfIpexSessionEntry=wfIpexSessionEntry, wfIpexMappingXlateCallingX121=wfIpexMappingXlateCallingX121, wfIpexMappingDisable=wfIpexMappingDisable, wfIpexMappingQueueSize=wfIpexMappingQueueSize, wfIpexMappingMsgHdrType=wfIpexMappingMsgHdrType, wfIpexMappingDstConnCct=wfIpexMappingDstConnCct, wfIpexSessionRemoteTcpPort=wfIpexSessionRemoteTcpPort, wfIpexBobEnabled=wfIpexBobEnabled, wfIpexDelete=wfIpexDelete, wfIpexMappingCfgLocalIpAddr=wfIpexMappingCfgLocalIpAddr, wfIpexMappingX25CUDF=wfIpexMappingX25CUDF, wfIpexSessionState=wfIpexSessionState, wfIpexTcpUseIpAddress=wfIpexTcpUseIpAddress, wfIpexMappingID2=wfIpexMappingID2, wfIpexMappingID1=wfIpexMappingID1, wfIpexSessionSrcConnCct=wfIpexSessionSrcConnCct, wfIpexMappingSlotNumber=wfIpexMappingSlotNumber, wfIpexDisable=wfIpexDisable, wfIpexSessionDstConnCct=wfIpexSessionDstConnCct, wfIpexInsCalledDte=wfIpexInsCalledDte, wfIpexMappingRemoteBackupIp=wfIpexMappingRemoteBackupIp, wfIpexMappingKeepaliveTimer=wfIpexMappingKeepaliveTimer, wfIpexMaxAuditIp=wfIpexMaxAuditIp, wfIpexMappingTable=wfIpexMappingTable, wfIpexSessionSrcConnType=wfIpexSessionSrcConnType, wfIpexMappingKeepaliveRetries=wfIpexMappingKeepaliveRetries, wfIpexSessionTable=wfIpexSessionTable, wfIpexSessionLocalIpAddr=wfIpexSessionLocalIpAddr, wfIpexMappingDstConnType=wfIpexMappingDstConnType, wfIpexMappingTcpMaxRetry=wfIpexMappingTcpMaxRetry, wfIpexInsCallingDte=wfIpexInsCallingDte, wfIpexSendResetRequestOnTCPUp=wfIpexSendResetRequestOnTCPUp, wfIpexSessionDstConnType=wfIpexSessionDstConnType, wfIpexMappingRemoteBackupTcpPort=wfIpexMappingRemoteBackupTcpPort, wfIpexTcpRequestCheck=wfIpexTcpRequestCheck, wfIpexState=wfIpexState, wfIpex=wfIpex, wfIpexMappingSrcConnType=wfIpexMappingSrcConnType, wfIpexMappingIdleTimer=wfIpexMappingIdleTimer, wfIpexSessionIndex=wfIpexSessionIndex, wfIpexSessionLocalDTEAddr=wfIpexSessionLocalDTEAddr, wfIpexSessionRemoteIpAddr=wfIpexSessionRemoteIpAddr, wfIpexTcpRequestLimit=wfIpexTcpRequestLimit, wfIpexMappingRemoteIpAddr=wfIpexMappingRemoteIpAddr, wfIpexSessionLocalTcpPort=wfIpexSessionLocalTcpPort, wfIpexMappingCtrlMode=wfIpexMappingCtrlMode, wfIpexMappingRemoteTcpPort=wfIpexMappingRemoteTcpPort, wfIpexSessionQueueSize=wfIpexSessionQueueSize, wfIpexMappingSrcConnCct=wfIpexMappingSrcConnCct, wfIpexTranslateNetworkOutOfOrder=wfIpexTranslateNetworkOutOfOrder, wfIpexMappingRemoteDTEAddr=wfIpexMappingRemoteDTEAddr, wfIpexMappingTrace=wfIpexMappingTrace, wfIpexSessionRemoteDTEAddr=wfIpexSessionRemoteDTEAddr, wfIpexMappingEntry=wfIpexMappingEntry, wfIpexMappingPvcLcn=wfIpexMappingPvcLcn, wfIpexBobTimeout=wfIpexBobTimeout, wfIpexSessionLCN=wfIpexSessionLCN, wfIpexMaxMessageSize=wfIpexMaxMessageSize, wfIpexMappingDelete=wfIpexMappingDelete)
## lists7.py def main(): pals = ['Bob','Rob','Fred','Amy','Sarah'] pals2 = pals ## both variables refer to SAME LIST pals.remove('Fred') print(pals2) ### crude pals3 = [] for p in pals: pals3.append(p) print(pals3) ### crude dump del pals[0] ### deletes Bob print(pals) main()
def main(): pals = ['Bob', 'Rob', 'Fred', 'Amy', 'Sarah'] pals2 = pals pals.remove('Fred') print(pals2) pals3 = [] for p in pals: pals3.append(p) print(pals3) del pals[0] print(pals) main()
""" 1. The oscillations start getting larger and larger which could in the end become uncontrollable 2. Looking at the shape of the spiral """
""" 1. The oscillations start getting larger and larger which could in the end become uncontrollable 2. Looking at the shape of the spiral """
""" Definition of ParentTreeNode: class ParentTreeNode: def __init__(self, val): self.val = val self.parent, self.left, self.right = None, None, None """ class Solution: """ @param: root: The root of the tree @param: A: node in the tree @param: B: node in the tree @return: The lowest common ancestor of A and B sa = {4} b = {7, 4} """ def lowestCommonAncestorII(self, root, A, B): # write your code here if not root or root == A or root == B: return root sa = set() sa.add(A) while A: sa.add(A.parent) A = A.parent while B: if B in sa: return B B = B.parent def lowestCommonAncestorII_height(self, root, A, B): # write your code here ha = self.height(A) hb = self.height(B) while ha > hb: A = A.parent ha -= 1 while hb > ha: B = B.parent hb -= 1 while A != B: A = A.parent B = B.parent return A def height(self, node): h = 0 while node: h += 1 node = node.parent return h
""" Definition of ParentTreeNode: class ParentTreeNode: def __init__(self, val): self.val = val self.parent, self.left, self.right = None, None, None """ class Solution: """ @param: root: The root of the tree @param: A: node in the tree @param: B: node in the tree @return: The lowest common ancestor of A and B sa = {4} b = {7, 4} """ def lowest_common_ancestor_ii(self, root, A, B): if not root or root == A or root == B: return root sa = set() sa.add(A) while A: sa.add(A.parent) a = A.parent while B: if B in sa: return B b = B.parent def lowest_common_ancestor_ii_height(self, root, A, B): ha = self.height(A) hb = self.height(B) while ha > hb: a = A.parent ha -= 1 while hb > ha: b = B.parent hb -= 1 while A != B: a = A.parent b = B.parent return A def height(self, node): h = 0 while node: h += 1 node = node.parent return h
# Copyright 2021 John Millikin and the rust-fuse contributors. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software # distributed under the License is distributed on an "AS IS" BASIS, # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. # See the License for the specific language governing permissions and # limitations under the License. # # SPDX-License-Identifier: Apache-2.0 _CHECKSUMS = { "v5.2.0/pc-bios/edk2-x86_64-code.fd.bz2": "8d9af6d88f51cfb6732a2542fefa50e7d5adb81aa12d0b79342e1bc905a368f1", } _BUILD = """ filegroup( name = "qemu", srcs = glob( ["**/*"], exclude = ["BUILD.bazel", "WORKSPACE"], ), visibility = ["//visibility:public"], ) """ def _qemu_repository(ctx): ctx.file("WORKSPACE", "workspace(name = {})\n".format(repr(ctx.name))) ctx.file("BUILD.bazel", _BUILD) edk2_filename = "v{}/pc-bios/edk2-x86_64-code.fd.bz2".format(ctx.attr.version) ctx.download( url = ["https://github.com/qemu/qemu/raw/" + edk2_filename], output = "pc-bios/edk2-x86_64-code.fd.bz2", sha256 = _CHECKSUMS[edk2_filename], ) ctx.execute(["bzip2", "-d", "pc-bios/edk2-x86_64-code.fd.bz2"]) qemu_repository = repository_rule( implementation = _qemu_repository, attrs = { "version": attr.string( mandatory = True, values = [ "5.2.0", ], ), } )
_checksums = {'v5.2.0/pc-bios/edk2-x86_64-code.fd.bz2': '8d9af6d88f51cfb6732a2542fefa50e7d5adb81aa12d0b79342e1bc905a368f1'} _build = '\nfilegroup(\n name = "qemu",\n srcs = glob(\n ["**/*"],\n exclude = ["BUILD.bazel", "WORKSPACE"],\n ),\n visibility = ["//visibility:public"],\n)\n' def _qemu_repository(ctx): ctx.file('WORKSPACE', 'workspace(name = {})\n'.format(repr(ctx.name))) ctx.file('BUILD.bazel', _BUILD) edk2_filename = 'v{}/pc-bios/edk2-x86_64-code.fd.bz2'.format(ctx.attr.version) ctx.download(url=['https://github.com/qemu/qemu/raw/' + edk2_filename], output='pc-bios/edk2-x86_64-code.fd.bz2', sha256=_CHECKSUMS[edk2_filename]) ctx.execute(['bzip2', '-d', 'pc-bios/edk2-x86_64-code.fd.bz2']) qemu_repository = repository_rule(implementation=_qemu_repository, attrs={'version': attr.string(mandatory=True, values=['5.2.0'])})
class fcf(object): nr_cortes = None coef_vf = None termo_i = None estagio = None def __init__(self, estagio): self.nr_cortes = 0 self.coef_vf = [] self.termo_i = [] self.estagio = estagio def add_corte(self, coeficientes, constante, volume, nr_estagios): coeficientes = -(1/nr_estagios)*coeficientes for i in range(0,len(volume)): if coeficientes[i] > 0: coeficientes[i] = 0 constante = constante/nr_estagios for i in range(0,len(volume)): constante = constante - volume[i]*coeficientes[i] self.coef_vf.append(coeficientes) self.termo_i.append(constante) self.nr_cortes = self.nr_cortes+1 def get_fcf(self, vf, alpha): rest_cortes = [] if self.nr_cortes == 0: return rest_cortes else: for icor in range(0,self.nr_cortes): funcao = self.termo_i[icor] for i in range(0,len(vf)): funcao = funcao + self.coef_vf[icor][i]*vf[i] rest_cortes.append( alpha >= funcao) return rest_cortes
class Fcf(object): nr_cortes = None coef_vf = None termo_i = None estagio = None def __init__(self, estagio): self.nr_cortes = 0 self.coef_vf = [] self.termo_i = [] self.estagio = estagio def add_corte(self, coeficientes, constante, volume, nr_estagios): coeficientes = -(1 / nr_estagios) * coeficientes for i in range(0, len(volume)): if coeficientes[i] > 0: coeficientes[i] = 0 constante = constante / nr_estagios for i in range(0, len(volume)): constante = constante - volume[i] * coeficientes[i] self.coef_vf.append(coeficientes) self.termo_i.append(constante) self.nr_cortes = self.nr_cortes + 1 def get_fcf(self, vf, alpha): rest_cortes = [] if self.nr_cortes == 0: return rest_cortes else: for icor in range(0, self.nr_cortes): funcao = self.termo_i[icor] for i in range(0, len(vf)): funcao = funcao + self.coef_vf[icor][i] * vf[i] rest_cortes.append(alpha >= funcao) return rest_cortes
def Neighbors(row: int, col: int, data: list) -> list: adjacents = [] for i in range(row - 1, row + 2): for j in range(col - 1, col + 2): if i == row and j == col or i < 0 or i >= len(data) or j < 0 or j >= len(data[0]): continue adjacents.append((i, j)) return adjacents def flash(i: int, j: int, flashed: dict, data: list): flashed[(i, j)] = True neighbors = Neighbors(i, j, data) for x, y in neighbors: data[x][y] += 1 for x, y in neighbors: if data[x][y] > 9 and (x,y) not in flashed: flashed[(x,y)] = True flash(x, y, flashed, data) def partOneTwo(data: list, partOne: bool) -> int: numFlashes = step = 0 while True: flashed = {} for row in range(len(data)): for col in range(len(data[0])): data[row][col] += 1 if data[row][col] > 9 and (row, col) not in flashed: flash(row, col, flashed, data) for row in range(len(data)): for col in range(len(data[0])): if data[row][col] > 9: data[row][col] = 0 step += 1 numFlashes += len(flashed) if step == 100 and partOne: return numFlashes if len(data) * len(data[0]) == len(flashed): break return step def main() -> None: with open("day_11/input.txt") as file: data = [[int(value) for value in list(line)] for line in file.read().strip().split('\n')] print(f'Result <PartOne>: {partOneTwo(data, True)}') # print(f'Result <PartTwo>: {partOneTwo(data, False)}') if __name__ == '__main__': main()
def neighbors(row: int, col: int, data: list) -> list: adjacents = [] for i in range(row - 1, row + 2): for j in range(col - 1, col + 2): if i == row and j == col or i < 0 or i >= len(data) or (j < 0) or (j >= len(data[0])): continue adjacents.append((i, j)) return adjacents def flash(i: int, j: int, flashed: dict, data: list): flashed[i, j] = True neighbors = neighbors(i, j, data) for (x, y) in neighbors: data[x][y] += 1 for (x, y) in neighbors: if data[x][y] > 9 and (x, y) not in flashed: flashed[x, y] = True flash(x, y, flashed, data) def part_one_two(data: list, partOne: bool) -> int: num_flashes = step = 0 while True: flashed = {} for row in range(len(data)): for col in range(len(data[0])): data[row][col] += 1 if data[row][col] > 9 and (row, col) not in flashed: flash(row, col, flashed, data) for row in range(len(data)): for col in range(len(data[0])): if data[row][col] > 9: data[row][col] = 0 step += 1 num_flashes += len(flashed) if step == 100 and partOne: return numFlashes if len(data) * len(data[0]) == len(flashed): break return step def main() -> None: with open('day_11/input.txt') as file: data = [[int(value) for value in list(line)] for line in file.read().strip().split('\n')] print(f'Result <PartOne>: {part_one_two(data, True)}') if __name__ == '__main__': main()
class QuadraticEquation(object): def __init__(self, a1, a2, c, eq=0): """ :param a1: X**2 Square index. :param a2: X Meddule index. :param c: C Constants :param eq: Mostly equal to zero """ self.a1 = a1 if self.a1 == 0: raise Exception("Not a Quatratic Equation") self.a2 = a2 self.c = c self.eq = eq if self.eq: self.c = self.c - self.eq def solve(self): m = self.a1 * self.c sol = [] m2 = m // 2 if m < 0: lt = [j for j in range(m2, m2 * (-1)) if j != 0] else: lt = range(1, m2) for i in lt: if m % i == 0: j = m / i if self.a2 == i + j: sol.append((i, int(j))) return sol
class Quadraticequation(object): def __init__(self, a1, a2, c, eq=0): """ :param a1: X**2 Square index. :param a2: X Meddule index. :param c: C Constants :param eq: Mostly equal to zero """ self.a1 = a1 if self.a1 == 0: raise exception('Not a Quatratic Equation') self.a2 = a2 self.c = c self.eq = eq if self.eq: self.c = self.c - self.eq def solve(self): m = self.a1 * self.c sol = [] m2 = m // 2 if m < 0: lt = [j for j in range(m2, m2 * -1) if j != 0] else: lt = range(1, m2) for i in lt: if m % i == 0: j = m / i if self.a2 == i + j: sol.append((i, int(j))) return sol
# Decorator for triggers # A trigger is an event that we can watch. # We expect it to return True if the event has happened and False if not. # If it has 'required_arg_types', then the trigger will request those arguments in the console # and will be passed them at runtime. class Trigger(): def __init__(self, name, description, required_arg_types=[], generated_arg_types=[]): self.trigger = True self.tname = name self.tdesc = description self.treqs = required_arg_types self.tgen = generated_arg_types def __call__(self, f): f.trigger = self.trigger f.tname = self.tname f.tdesc = self.tdesc f.treqs = self.treqs f.tgen = self.tgen return f # Decorator for actions # An action is a method that we should be able to call to perform some arbitrary thing. # they can be put into the requested parameters of a trigger to generate something, but this # will cause them to run every check of the trigger -- which may or may not be ideal. # An Action can also have required arguments, which would be requested in the console and # passed at runtime # Actions will most typically be called as a result of an event trigger returning True. IE # Person arriving home code triggers -> Turn on lights action class Action(): def __init__(self, name, description, required_arg_types=[], generated_arg_types=[]): self.action = True self.aname = name self.adesc = description self.areqs = required_arg_types self.agen = generated_arg_types def __call__(self, f): f.action = self.action f.aname = self.aname f.adesc = self.adesc f.areqs = self.areqs f.agen = self.agen return f # Decorator for any actions that must be run before Suave is opened. This can be where background services # are started, models are loaded, or files are created. # They are optional, but will be called before any flow when Suave first launches. class Prelaunch(): def __init__(self): self.prelaunch = True def __call__(self, f): f.prelaunch = self.prelaunch return f
class Trigger: def __init__(self, name, description, required_arg_types=[], generated_arg_types=[]): self.trigger = True self.tname = name self.tdesc = description self.treqs = required_arg_types self.tgen = generated_arg_types def __call__(self, f): f.trigger = self.trigger f.tname = self.tname f.tdesc = self.tdesc f.treqs = self.treqs f.tgen = self.tgen return f class Action: def __init__(self, name, description, required_arg_types=[], generated_arg_types=[]): self.action = True self.aname = name self.adesc = description self.areqs = required_arg_types self.agen = generated_arg_types def __call__(self, f): f.action = self.action f.aname = self.aname f.adesc = self.adesc f.areqs = self.areqs f.agen = self.agen return f class Prelaunch: def __init__(self): self.prelaunch = True def __call__(self, f): f.prelaunch = self.prelaunch return f
# Convert 1024 to binary print(bin(1024)) print(hex(1024)) # 2 palce round of 5.23222 print(round(5.23222,2)) # check if every letter in str is lowercase s='hello how are you Mary,are you feeling okay' print(s.islower()) # how many time w showup s = 'twywywtwywbwhsjhwuwshshwuwwwjdjdid' print(s.count('w')) # find element that is not in set2 set1={2,3,1,5,6,8} set2={3,1,7,5,6,8} print(set1.difference(set2)) # find all element that are in either set print(set1.union(set2)) # create a dict of multiple2 0 to 8 a={x:x**3 for x in range(5)} print(a) # reverse list list1=[1,2,3,4] list1.reverse() print(list1) # sort list list2=[3,4,2,5,1] list2.sort() print(list2)
print(bin(1024)) print(hex(1024)) print(round(5.23222, 2)) s = 'hello how are you Mary,are you feeling okay' print(s.islower()) s = 'twywywtwywbwhsjhwuwshshwuwwwjdjdid' print(s.count('w')) set1 = {2, 3, 1, 5, 6, 8} set2 = {3, 1, 7, 5, 6, 8} print(set1.difference(set2)) print(set1.union(set2)) a = {x: x ** 3 for x in range(5)} print(a) list1 = [1, 2, 3, 4] list1.reverse() print(list1) list2 = [3, 4, 2, 5, 1] list2.sort() print(list2)
# Stats for each item in the game # 0-attack, 1-defense, 2-price, 3-type, 4-Pclass, 5-HP, 6-count, 7-lvl Items = {'sword': list((10, 0, 10, 'weapon', 'swordsman', 0, 0, 1)), 'bronze sword': list((15, 0, 15, 'weapon', 'swordsman', 0, 0, 5)), 'iron sword': list((20, 0, 20, 'weapon', 'swordsman', 0, 0, 10)), 'steel sword': list((25, 0, 25, 'weapon', 'swordsman', 0, 0, 15)), 'long sword': list((30, 0, 30, 'weapon', 'swordsman', 0, 0, 20)), 'broad sword': list((40, 0, 50, 'weapon', 'swordsman', 0, 0, 25)), 'damascus sword': list((55, 0, 100, 'weapon', 'swordsman', 0, 0, 30)), 'Enchanted long sword': list((70, 0, 150, 'weapon', 'swordsman', 0, 0, 35)), 'diamond sword': list((100, 0, 250, 'weapon', 'swordsman', 0, 0, 40)), 'great sword': list((120, 0, 300, 'weapon', 'swordsman', 0, 0, 45)), 'Death sword': list((180, 0, 400, 'weapon', 'swordsman', 0, 0, 50)), 'fire sword': list((250, 0, 600, 'weapon', 'swordsman', 0, 0, 55)), 'ice sword': list((275, 0, 650, 'weapon', 'swordsman', 0, 0, 60)), 'Elemental sword': list((340, 0, 800, 'weapon', 'swordsman', 0, 0, 65)), 'sword of ifrit': list((375, 0, 1000, 'weapon', 'swordsman', 0, 0, 70)), 'RA\'s sword': list((400, 0, 1500, 'weapon', 'swordsman', 0, 0, 75)), 'sword of swords': list((425, 0, 1800, 'weapon', 'swordsman', 0, 0, 80)), 'Excalibur': list((475, 0, 2500, 'weapon', 'swordsman', 0, 0, 85)), 'elder sword': list((500, 0, 3000, 'weapon', 'swordsman', 0, 0, 90)), 'Enchanted ancient sword': list((550, 0, 4000, 'weapon', 'swordsman', 0, 0, 95)), 'Dragon sword': list((600, 0, 5000, 'weapon', 'swordsman', 0, 0, 100)), 'wand': list((5, 0, 2, 'weapon', 'wizard', 0, 0, 1)), 'mace': list((7, 0, 5, 'weapon', 'wizard', 0, 0, 5)), 'staff': list((10, 0, 8, 'weapon', 'wizard', 0, 0, 10)), 'dagger': list((7, 0, 5, 'weapon', 'rouge', 0, 0, 1)), 'bronze dagger': list((10, 0, 9, 'weapon', 'rouge', 0, 0, 5)), 'iron dagger': list((15, 0, 11, 'weapon', 'rouge', 0, 0, 10)), 'bronze armor': list((0, 10, 10, 'armor', 'swordsman', 0, 0, 1)), 'iron armor': list((0, 15, 15, 'armor', 'swordsman', 0, 0, 5)), 'steel armor': list((0, 25, 20, 'armor', 'swordsman', 0, 0, 10)), 'gold armor': list((0, 45, 35, 'armor', 'swordsman', 10, 0, 15)), 'damascus armor': list((0, 60, 55, 'armor', 'swordsman', 0, 0, 20)), 'cloth armor': list((0, 5, 2, 'armor', 'wizard', 5, 0, 1)), 'hard cloth armor': list((0, 7, 5, 'armor', 'rouge', 0, 0, 1)), 'potion': list((0, 0, 20, 'item', 'healer', 20, 0, 1)), 'Hyper Potion': list((0, 0, 50, 'item', 'healer', 50, 0, 20))}
items = {'sword': list((10, 0, 10, 'weapon', 'swordsman', 0, 0, 1)), 'bronze sword': list((15, 0, 15, 'weapon', 'swordsman', 0, 0, 5)), 'iron sword': list((20, 0, 20, 'weapon', 'swordsman', 0, 0, 10)), 'steel sword': list((25, 0, 25, 'weapon', 'swordsman', 0, 0, 15)), 'long sword': list((30, 0, 30, 'weapon', 'swordsman', 0, 0, 20)), 'broad sword': list((40, 0, 50, 'weapon', 'swordsman', 0, 0, 25)), 'damascus sword': list((55, 0, 100, 'weapon', 'swordsman', 0, 0, 30)), 'Enchanted long sword': list((70, 0, 150, 'weapon', 'swordsman', 0, 0, 35)), 'diamond sword': list((100, 0, 250, 'weapon', 'swordsman', 0, 0, 40)), 'great sword': list((120, 0, 300, 'weapon', 'swordsman', 0, 0, 45)), 'Death sword': list((180, 0, 400, 'weapon', 'swordsman', 0, 0, 50)), 'fire sword': list((250, 0, 600, 'weapon', 'swordsman', 0, 0, 55)), 'ice sword': list((275, 0, 650, 'weapon', 'swordsman', 0, 0, 60)), 'Elemental sword': list((340, 0, 800, 'weapon', 'swordsman', 0, 0, 65)), 'sword of ifrit': list((375, 0, 1000, 'weapon', 'swordsman', 0, 0, 70)), "RA's sword": list((400, 0, 1500, 'weapon', 'swordsman', 0, 0, 75)), 'sword of swords': list((425, 0, 1800, 'weapon', 'swordsman', 0, 0, 80)), 'Excalibur': list((475, 0, 2500, 'weapon', 'swordsman', 0, 0, 85)), 'elder sword': list((500, 0, 3000, 'weapon', 'swordsman', 0, 0, 90)), 'Enchanted ancient sword': list((550, 0, 4000, 'weapon', 'swordsman', 0, 0, 95)), 'Dragon sword': list((600, 0, 5000, 'weapon', 'swordsman', 0, 0, 100)), 'wand': list((5, 0, 2, 'weapon', 'wizard', 0, 0, 1)), 'mace': list((7, 0, 5, 'weapon', 'wizard', 0, 0, 5)), 'staff': list((10, 0, 8, 'weapon', 'wizard', 0, 0, 10)), 'dagger': list((7, 0, 5, 'weapon', 'rouge', 0, 0, 1)), 'bronze dagger': list((10, 0, 9, 'weapon', 'rouge', 0, 0, 5)), 'iron dagger': list((15, 0, 11, 'weapon', 'rouge', 0, 0, 10)), 'bronze armor': list((0, 10, 10, 'armor', 'swordsman', 0, 0, 1)), 'iron armor': list((0, 15, 15, 'armor', 'swordsman', 0, 0, 5)), 'steel armor': list((0, 25, 20, 'armor', 'swordsman', 0, 0, 10)), 'gold armor': list((0, 45, 35, 'armor', 'swordsman', 10, 0, 15)), 'damascus armor': list((0, 60, 55, 'armor', 'swordsman', 0, 0, 20)), 'cloth armor': list((0, 5, 2, 'armor', 'wizard', 5, 0, 1)), 'hard cloth armor': list((0, 7, 5, 'armor', 'rouge', 0, 0, 1)), 'potion': list((0, 0, 20, 'item', 'healer', 20, 0, 1)), 'Hyper Potion': list((0, 0, 50, 'item', 'healer', 50, 0, 20))}
# Definition for a binary tree node. # class TreeNode: # def __init__(self, val=0, left=None, right=None): # self.val = val # self.left = left # self.right = right class Solution: def isSubtree(self, s: TreeNode, t: TreeNode) -> bool: def rec(s,t): if s is None and t is None: return True if s is None or t is None: return False return s.val==t.val and rec(s.left,t.left) and rec(s.right,t.right) return s is not None and (rec(s,t) or self.isSubtree(s.left,t) or self .isSubtree(s.right,t))
class Solution: def is_subtree(self, s: TreeNode, t: TreeNode) -> bool: def rec(s, t): if s is None and t is None: return True if s is None or t is None: return False return s.val == t.val and rec(s.left, t.left) and rec(s.right, t.right) return s is not None and (rec(s, t) or self.isSubtree(s.left, t) or self.isSubtree(s.right, t))
def f(a, b, c): return (a, b, c) ___assertEqual(f(*[0, 1, 2]), (0, 1, 2)) ___assertEqual(f(*"abc"), ('a', 'b', 'c')) ___assertEqual(f(*range(3)), (0, 1, 2))
def f(a, b, c): return (a, b, c) ___assert_equal(f(*[0, 1, 2]), (0, 1, 2)) ___assert_equal(f(*'abc'), ('a', 'b', 'c')) ___assert_equal(f(*range(3)), (0, 1, 2))
def is_leap(year): leap = False # Write your logic here if year%4 == 0 and year%100 != 0: leap = True elif year%400 == 0: leap = True return leap year = int(input("Enter the year")) print(is_leap(year))
def is_leap(year): leap = False if year % 4 == 0 and year % 100 != 0: leap = True elif year % 400 == 0: leap = True return leap year = int(input('Enter the year')) print(is_leap(year))
floor_lenght = float(input()) tile_wight = float(input()) tile_lenght = float(input()) bench_wight = float(input()) bench_lenght = float(input()) speed = 0.2 bench_area = bench_lenght * bench_wight tile_area = (tile_wight * tile_lenght) floor_area = floor_lenght * floor_lenght - bench_area print("%.2f" % (floor_area/tile_area)) print("%.2f" % (floor_area/tile_area*speed))
floor_lenght = float(input()) tile_wight = float(input()) tile_lenght = float(input()) bench_wight = float(input()) bench_lenght = float(input()) speed = 0.2 bench_area = bench_lenght * bench_wight tile_area = tile_wight * tile_lenght floor_area = floor_lenght * floor_lenght - bench_area print('%.2f' % (floor_area / tile_area)) print('%.2f' % (floor_area / tile_area * speed))
print("give me two numbers, and I'll divide them.") print("enter 'q' to quit.") while True: first_number = input("\nFirst Number:") if first_number == 'q': break second_number = input("\nSecond Number:") if second_number == 'q': break try: answer = int(first_number)/int(second_number) except ZeroDivisionError: print("you can't divide by zero!") else: print(answer)
print("give me two numbers, and I'll divide them.") print("enter 'q' to quit.") while True: first_number = input('\nFirst Number:') if first_number == 'q': break second_number = input('\nSecond Number:') if second_number == 'q': break try: answer = int(first_number) / int(second_number) except ZeroDivisionError: print("you can't divide by zero!") else: print(answer)
def convert_adjacent_matrix_to_adjacent_list(graph: list, vertices: list) -> dict: result_graph = {} for v in vertices: result_graph[v] = [] rows, cols = len(graph), len(graph[0]) for i in range(rows): for j in range(cols): if graph[i][j] == 1: result_graph[vertices[i]].append(vertices[j]) return result_graph if __name__ == "__main__": graph_adj_matrix = [ [0,1,1,0,0,0], [1,0,0,1,1,0], [1,0,0,0,0,1], [0,1,0,0,0,0], [0,1,0,0,0,1], [0,0,1,0,1,0] ] print(convert_adjacent_matrix_to_adjacent_list(graph_adj_matrix, ["A","B","C","D","E","F"]))
def convert_adjacent_matrix_to_adjacent_list(graph: list, vertices: list) -> dict: result_graph = {} for v in vertices: result_graph[v] = [] (rows, cols) = (len(graph), len(graph[0])) for i in range(rows): for j in range(cols): if graph[i][j] == 1: result_graph[vertices[i]].append(vertices[j]) return result_graph if __name__ == '__main__': graph_adj_matrix = [[0, 1, 1, 0, 0, 0], [1, 0, 0, 1, 1, 0], [1, 0, 0, 0, 0, 1], [0, 1, 0, 0, 0, 0], [0, 1, 0, 0, 0, 1], [0, 0, 1, 0, 1, 0]] print(convert_adjacent_matrix_to_adjacent_list(graph_adj_matrix, ['A', 'B', 'C', 'D', 'E', 'F']))
class Settlement: def __init__(self, node: int = None, tx: float = 0, ty: float = 0, tz: float = 0, rx: float = 0, ry: float = 0, rz: float = 0 ) -> None: """Creates an instance of the SkyCiv Settlement class. Args: node (int): The ID of the node at which the settlement is applied. tx (float, optional): Settlement displacement in the global x-axis. Defaults to None. ty (float, optional): Settlement displacement in the global y-axis. Defaults to None. tz (float, optional): Settlement displacement in the global z-axis. Defaults to None. rx (float, optional): Settlement rotation about the global x-axis. Defaults to None. ry (float, optional): Settlement rotation about the global y-axis. Defaults to None. rz (float, optional): Settlement rotation about the global z-axis. Defaults to None. """ self.node = node self.tx = tx self.ty = ty self.tz = tz self.rx = rx self.ry = ry self.rz = rz
class Settlement: def __init__(self, node: int=None, tx: float=0, ty: float=0, tz: float=0, rx: float=0, ry: float=0, rz: float=0) -> None: """Creates an instance of the SkyCiv Settlement class. Args: node (int): The ID of the node at which the settlement is applied. tx (float, optional): Settlement displacement in the global x-axis. Defaults to None. ty (float, optional): Settlement displacement in the global y-axis. Defaults to None. tz (float, optional): Settlement displacement in the global z-axis. Defaults to None. rx (float, optional): Settlement rotation about the global x-axis. Defaults to None. ry (float, optional): Settlement rotation about the global y-axis. Defaults to None. rz (float, optional): Settlement rotation about the global z-axis. Defaults to None. """ self.node = node self.tx = tx self.ty = ty self.tz = tz self.rx = rx self.ry = ry self.rz = rz
ANDHRA_TRACK_DIR = '/Users/jalend15/PycharmProjects/electoral_rolls/andhra/andhra_pdfs' ANDHRA_PDF_ENGLISH_DIR = '/Users/jalend15/PycharmProjects/electoral_rolls/andhra/andhra_pdfs/english' ANDHRA_PDF_TELUGU_DIR = '/Users/jalend15/PycharmProjects/electoral_rolls/andhra/andhra_pdfs/telugu'
andhra_track_dir = '/Users/jalend15/PycharmProjects/electoral_rolls/andhra/andhra_pdfs' andhra_pdf_english_dir = '/Users/jalend15/PycharmProjects/electoral_rolls/andhra/andhra_pdfs/english' andhra_pdf_telugu_dir = '/Users/jalend15/PycharmProjects/electoral_rolls/andhra/andhra_pdfs/telugu'
class shapes: Count_Cylinder=0 Count_Cone=0 def __init__(self,rad,height): self.rad=rad self.height=height def disp(self): return self.rad+","+self.height class Cone(shapes): def __init__(self,rad,height): shapes.__init__(self,rad,height) self.slen=pow((pow(self.rad,2)+pow(self.height,2)),0.5) self.Vol=(3.141592*pow(self.rad,2)*self.height)/3 self.SA=3.141592*self.rad*self.slen shapes.Count_Cone=shapes.Count_Cone+1 def disp2(self): return self.Vol,self.SA,shapes.Count_Cone class Cylinder(shapes): def __init__(self,rad,height): shapes.__init__(self,rad,height) self.Vol=3.141592*pow(self.rad,2)*self.height self.SA=3.141592*(self.rad*self.height+2*self.rad) shapes.Count_Cylinder=shapes.Count_Cylinder+1 def disp3(self): return self.Vol,self.SA,shapes.Count_Cylinder rad=float(input("enter the radius:")) height=float(input("enter the height:")) s1=Cone(rad,height) s2=Cylinder(rad,height) s3=Cylinder(rad,height) print("Volume & Total Surface Area of Cone:") print(s1.disp2()) print("Volume & Total Surface Area of Cylinder:") print(s2.disp3()) print(s3.disp3())
class Shapes: count__cylinder = 0 count__cone = 0 def __init__(self, rad, height): self.rad = rad self.height = height def disp(self): return self.rad + ',' + self.height class Cone(shapes): def __init__(self, rad, height): shapes.__init__(self, rad, height) self.slen = pow(pow(self.rad, 2) + pow(self.height, 2), 0.5) self.Vol = 3.141592 * pow(self.rad, 2) * self.height / 3 self.SA = 3.141592 * self.rad * self.slen shapes.Count_Cone = shapes.Count_Cone + 1 def disp2(self): return (self.Vol, self.SA, shapes.Count_Cone) class Cylinder(shapes): def __init__(self, rad, height): shapes.__init__(self, rad, height) self.Vol = 3.141592 * pow(self.rad, 2) * self.height self.SA = 3.141592 * (self.rad * self.height + 2 * self.rad) shapes.Count_Cylinder = shapes.Count_Cylinder + 1 def disp3(self): return (self.Vol, self.SA, shapes.Count_Cylinder) rad = float(input('enter the radius:')) height = float(input('enter the height:')) s1 = cone(rad, height) s2 = cylinder(rad, height) s3 = cylinder(rad, height) print('Volume & Total Surface Area of Cone:') print(s1.disp2()) print('Volume & Total Surface Area of Cylinder:') print(s2.disp3()) print(s3.disp3())
# Definition for a binary tree node. # class TreeNode: # def __init__(self, x): # self.val = x # self.left = None # self.right = None class Solution(object): def verticalTraversal(self, root): result = collections.defaultdict(list) stack = [(root, 0)] while stack: new_stack = [] cur_result = collections.defaultdict(list) for node, level in stack: cur_result[level].append(node.val) if node.left: new_stack.append((node.left, level - 1)) if node.right: new_stack.append((node.right, level + 1)) for i in cur_result: result[i].extend(sorted(cur_result[i])) stack = new_stack return [result[i] for i in sorted(result)]
class Solution(object): def vertical_traversal(self, root): result = collections.defaultdict(list) stack = [(root, 0)] while stack: new_stack = [] cur_result = collections.defaultdict(list) for (node, level) in stack: cur_result[level].append(node.val) if node.left: new_stack.append((node.left, level - 1)) if node.right: new_stack.append((node.right, level + 1)) for i in cur_result: result[i].extend(sorted(cur_result[i])) stack = new_stack return [result[i] for i in sorted(result)]
""" <+$FILENAME$+> Copyright (c) <+$YEAR$+> Idiap Research Institute, http://www.idiap.ch/ Written by Weipeng He <weipeng.he@idiap.ch> """
""" <+$FILENAME$+> Copyright (c) <+$YEAR$+> Idiap Research Institute, http://www.idiap.ch/ Written by Weipeng He <weipeng.he@idiap.ch> """
def metodoBloqueioMovimento(x, y, mapaAtual, direcao, item_select): if x > -1 and x < 750 and y >-1 and y < 560: if mapaAtual == 1: if direcao == 'direita': if y < 330 and y > 200: if (x+10>350 or x+10<270): return True else: return False else: return True if direcao == 'esquerda': if y < 330 and y > 200: if (x-10>350 or x-10<270): return True else: return False else: return True if direcao == 'cima': if x > 250 and x < 350: if (y-10<200 or y-10>310): return True else: return False else: return True if direcao == 'baixo': if x > 250 and x < 350: if (y-10<200 or y-10>310): return True else: return False else: return True if mapaAtual == 2: if y<340 and y>210 and direcao != "direita" and x<400: if x> 130: return True else: return False if y<310 and y>180 and direcao != "esquerda" and x>400: if x< 550: return True else: return False else: return True if mapaAtual == 3: if item_select >=2 and direcao == 'cima': return True if item_select < 3 and direcao == 'baixo': return True else: return False else: return False
def metodo_bloqueio_movimento(x, y, mapaAtual, direcao, item_select): if x > -1 and x < 750 and (y > -1) and (y < 560): if mapaAtual == 1: if direcao == 'direita': if y < 330 and y > 200: if x + 10 > 350 or x + 10 < 270: return True else: return False else: return True if direcao == 'esquerda': if y < 330 and y > 200: if x - 10 > 350 or x - 10 < 270: return True else: return False else: return True if direcao == 'cima': if x > 250 and x < 350: if y - 10 < 200 or y - 10 > 310: return True else: return False else: return True if direcao == 'baixo': if x > 250 and x < 350: if y - 10 < 200 or y - 10 > 310: return True else: return False else: return True if mapaAtual == 2: if y < 340 and y > 210 and (direcao != 'direita') and (x < 400): if x > 130: return True else: return False if y < 310 and y > 180 and (direcao != 'esquerda') and (x > 400): if x < 550: return True else: return False else: return True if mapaAtual == 3: if item_select >= 2 and direcao == 'cima': return True if item_select < 3 and direcao == 'baixo': return True else: return False else: return False
class Team: def __init__(self, dmg=0, heal=0, cast=0, kills=0): self.dmg = dmg self.heal = heal self.casts = cast self.kills = kills class Teamfight: """Used to store data of a Teamfight in a Match""" def __init__(self): # Player is in teamfight self.is_in = False self.result = "" self.players = [] self.radiant_team = Team() self.dire_team = Team() class TMFPlayer: """Used to store data of a Player in a Teamfight""" def __init__(self): self.hero_id = 0 self.side = "" self.was_in = False self.ability_uses = 0 self.item_uses = 0 self.kills = 0 self.deaths = 0 self.buyback = False self.damage = 0 self.healing = 0 self.gold_delta = 0 self.xp_delta = 0
class Team: def __init__(self, dmg=0, heal=0, cast=0, kills=0): self.dmg = dmg self.heal = heal self.casts = cast self.kills = kills class Teamfight: """Used to store data of a Teamfight in a Match""" def __init__(self): self.is_in = False self.result = '' self.players = [] self.radiant_team = team() self.dire_team = team() class Tmfplayer: """Used to store data of a Player in a Teamfight""" def __init__(self): self.hero_id = 0 self.side = '' self.was_in = False self.ability_uses = 0 self.item_uses = 0 self.kills = 0 self.deaths = 0 self.buyback = False self.damage = 0 self.healing = 0 self.gold_delta = 0 self.xp_delta = 0
def fun(n): if n%2==0: return '.' return '*' l=[[fun(j) for j in range(5)] for i in range(5)] print(l)
def fun(n): if n % 2 == 0: return '.' return '*' l = [[fun(j) for j in range(5)] for i in range(5)] print(l)
''' The MIT License (MIT) Copyright (c) 2016 WavyCloud Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. ''' def can_paginate(operation_name=None): """ Check if an operation can be paginated. :type operation_name: string :param operation_name: The operation name. This is the same name\nas the method name on the client. For example, if the\nmethod name is create_foo, and you\'d normally invoke the\noperation as client.create_foo(**kwargs), if the\ncreate_foo operation can be paginated, you can use the\ncall client.get_paginator('create_foo'). """ pass def close_tunnel(tunnelId=None, delete=None): """ Closes a tunnel identified by the unique tunnel id. When a CloseTunnel request is received, we close the WebSocket connections between the client and proxy server so no data can be transmitted. See also: AWS API Documentation Exceptions :example: response = client.close_tunnel( tunnelId='string', delete=True|False ) :type tunnelId: string :param tunnelId: [REQUIRED]\nThe ID of the tunnel to close.\n :type delete: boolean :param delete: When set to true, AWS IoT Secure Tunneling deletes the tunnel data immediately. :rtype: dict ReturnsResponse Syntax {} Response Structure (dict) -- Exceptions IoTSecureTunneling.Client.exceptions.ResourceNotFoundException :return: {} :returns: (dict) -- """ pass def describe_tunnel(tunnelId=None): """ Gets information about a tunnel identified by the unique tunnel id. See also: AWS API Documentation Exceptions :example: response = client.describe_tunnel( tunnelId='string' ) :type tunnelId: string :param tunnelId: [REQUIRED]\nThe tunnel to describe.\n :rtype: dict ReturnsResponse Syntax{ 'tunnel': { 'tunnelId': 'string', 'tunnelArn': 'string', 'status': 'OPEN'|'CLOSED', 'sourceConnectionState': { 'status': 'CONNECTED'|'DISCONNECTED', 'lastUpdatedAt': datetime(2015, 1, 1) }, 'destinationConnectionState': { 'status': 'CONNECTED'|'DISCONNECTED', 'lastUpdatedAt': datetime(2015, 1, 1) }, 'description': 'string', 'destinationConfig': { 'thingName': 'string', 'services': [ 'string', ] }, 'timeoutConfig': { 'maxLifetimeTimeoutMinutes': 123 }, 'tags': [ { 'key': 'string', 'value': 'string' }, ], 'createdAt': datetime(2015, 1, 1), 'lastUpdatedAt': datetime(2015, 1, 1) } } Response Structure (dict) -- tunnel (dict) --The tunnel being described. tunnelId (string) --A unique alpha-numeric ID that identifies a tunnel. tunnelArn (string) --The Amazon Resource Name (ARN) of a tunnel. The tunnel ARN format is arn:aws:tunnel:<region>:<account-id>:tunnel/<tunnel-id> status (string) --The status of a tunnel. Valid values are: Open and Closed. sourceConnectionState (dict) --The connection state of the source application. status (string) --The connection status of the tunnel. Valid values are CONNECTED and DISCONNECTED . lastUpdatedAt (datetime) --The last time the connection status was updated. destinationConnectionState (dict) --The connection state of the destination application. status (string) --The connection status of the tunnel. Valid values are CONNECTED and DISCONNECTED . lastUpdatedAt (datetime) --The last time the connection status was updated. description (string) --A description of the tunnel. destinationConfig (dict) --The destination configuration that specifies the thing name of the destination device and a service name that the local proxy uses to connect to the destination application. thingName (string) --The name of the IoT thing to which you want to connect. services (list) --A list of service names that identity the target application. Currently, you can only specify a single name. The AWS IoT client running on the destination device reads this value and uses it to look up a port or an IP address and a port. The AWS IoT client instantiates the local proxy which uses this information to connect to the destination application. (string) -- timeoutConfig (dict) --Timeout configuration for the tunnel. maxLifetimeTimeoutMinutes (integer) --The maximum amount of time (in minutes) a tunnel can remain open. If not specified, maxLifetimeTimeoutMinutes defaults to 720 minutes. Valid values are from 1 minute to 12 hours (720 minutes) tags (list) --A list of tag metadata associated with the secure tunnel. (dict) --An arbitary key/value pair used to add searchable metadata to secure tunnel resources. key (string) --The key of the tag. value (string) --The value of the tag. createdAt (datetime) --The time when the tunnel was created. lastUpdatedAt (datetime) --The last time the tunnel was updated. Exceptions IoTSecureTunneling.Client.exceptions.ResourceNotFoundException :return: { 'tunnel': { 'tunnelId': 'string', 'tunnelArn': 'string', 'status': 'OPEN'|'CLOSED', 'sourceConnectionState': { 'status': 'CONNECTED'|'DISCONNECTED', 'lastUpdatedAt': datetime(2015, 1, 1) }, 'destinationConnectionState': { 'status': 'CONNECTED'|'DISCONNECTED', 'lastUpdatedAt': datetime(2015, 1, 1) }, 'description': 'string', 'destinationConfig': { 'thingName': 'string', 'services': [ 'string', ] }, 'timeoutConfig': { 'maxLifetimeTimeoutMinutes': 123 }, 'tags': [ { 'key': 'string', 'value': 'string' }, ], 'createdAt': datetime(2015, 1, 1), 'lastUpdatedAt': datetime(2015, 1, 1) } } :returns: IoTSecureTunneling.Client.exceptions.ResourceNotFoundException """ pass def generate_presigned_url(ClientMethod=None, Params=None, ExpiresIn=None, HttpMethod=None): """ Generate a presigned url given a client, its method, and arguments :type ClientMethod: string :param ClientMethod: The client method to presign for :type Params: dict :param Params: The parameters normally passed to\nClientMethod. :type ExpiresIn: int :param ExpiresIn: The number of seconds the presigned url is valid\nfor. By default it expires in an hour (3600 seconds) :type HttpMethod: string :param HttpMethod: The http method to use on the generated url. By\ndefault, the http method is whatever is used in the method\'s model. """ pass def get_paginator(operation_name=None): """ Create a paginator for an operation. :type operation_name: string :param operation_name: The operation name. This is the same name\nas the method name on the client. For example, if the\nmethod name is create_foo, and you\'d normally invoke the\noperation as client.create_foo(**kwargs), if the\ncreate_foo operation can be paginated, you can use the\ncall client.get_paginator('create_foo'). :rtype: L{botocore.paginate.Paginator} ReturnsA paginator object. """ pass def get_waiter(waiter_name=None): """ Returns an object that can wait for some condition. :type waiter_name: str :param waiter_name: The name of the waiter to get. See the waiters\nsection of the service docs for a list of available waiters. :rtype: botocore.waiter.Waiter """ pass def list_tags_for_resource(resourceArn=None): """ Lists the tags for the specified resource. See also: AWS API Documentation Exceptions :example: response = client.list_tags_for_resource( resourceArn='string' ) :type resourceArn: string :param resourceArn: [REQUIRED]\nThe resource ARN.\n :rtype: dict ReturnsResponse Syntax{ 'tags': [ { 'key': 'string', 'value': 'string' }, ] } Response Structure (dict) -- tags (list) --The tags for the specified resource. (dict) --An arbitary key/value pair used to add searchable metadata to secure tunnel resources. key (string) --The key of the tag. value (string) --The value of the tag. Exceptions IoTSecureTunneling.Client.exceptions.ResourceNotFoundException :return: { 'tags': [ { 'key': 'string', 'value': 'string' }, ] } """ pass def list_tunnels(thingName=None, maxResults=None, nextToken=None): """ List all tunnels for an AWS account. Tunnels are listed by creation time in descending order, newer tunnels will be listed before older tunnels. See also: AWS API Documentation :example: response = client.list_tunnels( thingName='string', maxResults=123, nextToken='string' ) :type thingName: string :param thingName: The name of the IoT thing associated with the destination device. :type maxResults: integer :param maxResults: The maximum number of results to return at once. :type nextToken: string :param nextToken: A token to retrieve the next set of results. :rtype: dict ReturnsResponse Syntax { 'tunnelSummaries': [ { 'tunnelId': 'string', 'tunnelArn': 'string', 'status': 'OPEN'|'CLOSED', 'description': 'string', 'createdAt': datetime(2015, 1, 1), 'lastUpdatedAt': datetime(2015, 1, 1) }, ], 'nextToken': 'string' } Response Structure (dict) -- tunnelSummaries (list) -- A short description of the tunnels in an AWS account. (dict) -- Information about the tunnel. tunnelId (string) -- The unique alpha-numeric identifier for the tunnel. tunnelArn (string) -- The Amazon Resource Name of the tunnel. The tunnel ARN format is arn:aws:tunnel:<region>:<account-id>:tunnel/<tunnel-id> status (string) -- The status of a tunnel. Valid values are: Open and Closed. description (string) -- A description of the tunnel. createdAt (datetime) -- The time the tunnel was created. lastUpdatedAt (datetime) -- The time the tunnel was last updated. nextToken (string) -- A token to used to retrieve the next set of results. :return: { 'tunnelSummaries': [ { 'tunnelId': 'string', 'tunnelArn': 'string', 'status': 'OPEN'|'CLOSED', 'description': 'string', 'createdAt': datetime(2015, 1, 1), 'lastUpdatedAt': datetime(2015, 1, 1) }, ], 'nextToken': 'string' } """ pass def open_tunnel(description=None, tags=None, destinationConfig=None, timeoutConfig=None): """ Creates a new tunnel, and returns two client access tokens for clients to use to connect to the AWS IoT Secure Tunneling proxy server. . See also: AWS API Documentation Exceptions :example: response = client.open_tunnel( description='string', tags=[ { 'key': 'string', 'value': 'string' }, ], destinationConfig={ 'thingName': 'string', 'services': [ 'string', ] }, timeoutConfig={ 'maxLifetimeTimeoutMinutes': 123 } ) :type description: string :param description: A short text description of the tunnel. :type tags: list :param tags: A collection of tag metadata.\n\n(dict) --An arbitary key/value pair used to add searchable metadata to secure tunnel resources.\n\nkey (string) -- [REQUIRED]The key of the tag.\n\nvalue (string) -- [REQUIRED]The value of the tag.\n\n\n\n\n :type destinationConfig: dict :param destinationConfig: The destination configuration for the OpenTunnel request.\n\nthingName (string) -- [REQUIRED]The name of the IoT thing to which you want to connect.\n\nservices (list) -- [REQUIRED]A list of service names that identity the target application. Currently, you can only specify a single name. The AWS IoT client running on the destination device reads this value and uses it to look up a port or an IP address and a port. The AWS IoT client instantiates the local proxy which uses this information to connect to the destination application.\n\n(string) --\n\n\n\n :type timeoutConfig: dict :param timeoutConfig: Timeout configuration for a tunnel.\n\nmaxLifetimeTimeoutMinutes (integer) --The maximum amount of time (in minutes) a tunnel can remain open. If not specified, maxLifetimeTimeoutMinutes defaults to 720 minutes. Valid values are from 1 minute to 12 hours (720 minutes)\n\n\n :rtype: dict ReturnsResponse Syntax { 'tunnelId': 'string', 'tunnelArn': 'string', 'sourceAccessToken': 'string', 'destinationAccessToken': 'string' } Response Structure (dict) -- tunnelId (string) -- A unique alpha-numeric tunnel ID. tunnelArn (string) -- The Amazon Resource Name for the tunnel. The tunnel ARN format is arn:aws:tunnel:<region>:<account-id>:tunnel/<tunnel-id> sourceAccessToken (string) -- The access token the source local proxy uses to connect to AWS IoT Secure Tunneling. destinationAccessToken (string) -- The access token the destination local proxy uses to connect to AWS IoT Secure Tunneling. Exceptions IoTSecureTunneling.Client.exceptions.LimitExceededException :return: { 'tunnelId': 'string', 'tunnelArn': 'string', 'sourceAccessToken': 'string', 'destinationAccessToken': 'string' } :returns: IoTSecureTunneling.Client.exceptions.LimitExceededException """ pass def tag_resource(resourceArn=None, tags=None): """ A resource tag. See also: AWS API Documentation Exceptions :example: response = client.tag_resource( resourceArn='string', tags=[ { 'key': 'string', 'value': 'string' }, ] ) :type resourceArn: string :param resourceArn: [REQUIRED]\nThe ARN of the resource.\n :type tags: list :param tags: [REQUIRED]\nThe tags for the resource.\n\n(dict) --An arbitary key/value pair used to add searchable metadata to secure tunnel resources.\n\nkey (string) -- [REQUIRED]The key of the tag.\n\nvalue (string) -- [REQUIRED]The value of the tag.\n\n\n\n\n :rtype: dict ReturnsResponse Syntax {} Response Structure (dict) -- Exceptions IoTSecureTunneling.Client.exceptions.ResourceNotFoundException :return: {} :returns: (dict) -- """ pass def untag_resource(resourceArn=None, tagKeys=None): """ Removes a tag from a resource. See also: AWS API Documentation Exceptions :example: response = client.untag_resource( resourceArn='string', tagKeys=[ 'string', ] ) :type resourceArn: string :param resourceArn: [REQUIRED]\nThe resource ARN.\n :type tagKeys: list :param tagKeys: [REQUIRED]\nThe keys of the tags to remove.\n\n(string) --\n\n :rtype: dict ReturnsResponse Syntax {} Response Structure (dict) -- Exceptions IoTSecureTunneling.Client.exceptions.ResourceNotFoundException :return: {} :returns: (dict) -- """ pass
""" The MIT License (MIT) Copyright (c) 2016 WavyCloud Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. """ def can_paginate(operation_name=None): """ Check if an operation can be paginated. :type operation_name: string :param operation_name: The operation name. This is the same name as the method name on the client. For example, if the method name is create_foo, and you'd normally invoke the operation as client.create_foo(**kwargs), if the create_foo operation can be paginated, you can use the call client.get_paginator('create_foo'). """ pass def close_tunnel(tunnelId=None, delete=None): """ Closes a tunnel identified by the unique tunnel id. When a CloseTunnel request is received, we close the WebSocket connections between the client and proxy server so no data can be transmitted. See also: AWS API Documentation Exceptions :example: response = client.close_tunnel( tunnelId='string', delete=True|False ) :type tunnelId: string :param tunnelId: [REQUIRED] The ID of the tunnel to close. :type delete: boolean :param delete: When set to true, AWS IoT Secure Tunneling deletes the tunnel data immediately. :rtype: dict ReturnsResponse Syntax {} Response Structure (dict) -- Exceptions IoTSecureTunneling.Client.exceptions.ResourceNotFoundException :return: {} :returns: (dict) -- """ pass def describe_tunnel(tunnelId=None): """ Gets information about a tunnel identified by the unique tunnel id. See also: AWS API Documentation Exceptions :example: response = client.describe_tunnel( tunnelId='string' ) :type tunnelId: string :param tunnelId: [REQUIRED] The tunnel to describe. :rtype: dict ReturnsResponse Syntax{ 'tunnel': { 'tunnelId': 'string', 'tunnelArn': 'string', 'status': 'OPEN'|'CLOSED', 'sourceConnectionState': { 'status': 'CONNECTED'|'DISCONNECTED', 'lastUpdatedAt': datetime(2015, 1, 1) }, 'destinationConnectionState': { 'status': 'CONNECTED'|'DISCONNECTED', 'lastUpdatedAt': datetime(2015, 1, 1) }, 'description': 'string', 'destinationConfig': { 'thingName': 'string', 'services': [ 'string', ] }, 'timeoutConfig': { 'maxLifetimeTimeoutMinutes': 123 }, 'tags': [ { 'key': 'string', 'value': 'string' }, ], 'createdAt': datetime(2015, 1, 1), 'lastUpdatedAt': datetime(2015, 1, 1) } } Response Structure (dict) -- tunnel (dict) --The tunnel being described. tunnelId (string) --A unique alpha-numeric ID that identifies a tunnel. tunnelArn (string) --The Amazon Resource Name (ARN) of a tunnel. The tunnel ARN format is arn:aws:tunnel:<region>:<account-id>:tunnel/<tunnel-id> status (string) --The status of a tunnel. Valid values are: Open and Closed. sourceConnectionState (dict) --The connection state of the source application. status (string) --The connection status of the tunnel. Valid values are CONNECTED and DISCONNECTED . lastUpdatedAt (datetime) --The last time the connection status was updated. destinationConnectionState (dict) --The connection state of the destination application. status (string) --The connection status of the tunnel. Valid values are CONNECTED and DISCONNECTED . lastUpdatedAt (datetime) --The last time the connection status was updated. description (string) --A description of the tunnel. destinationConfig (dict) --The destination configuration that specifies the thing name of the destination device and a service name that the local proxy uses to connect to the destination application. thingName (string) --The name of the IoT thing to which you want to connect. services (list) --A list of service names that identity the target application. Currently, you can only specify a single name. The AWS IoT client running on the destination device reads this value and uses it to look up a port or an IP address and a port. The AWS IoT client instantiates the local proxy which uses this information to connect to the destination application. (string) -- timeoutConfig (dict) --Timeout configuration for the tunnel. maxLifetimeTimeoutMinutes (integer) --The maximum amount of time (in minutes) a tunnel can remain open. If not specified, maxLifetimeTimeoutMinutes defaults to 720 minutes. Valid values are from 1 minute to 12 hours (720 minutes) tags (list) --A list of tag metadata associated with the secure tunnel. (dict) --An arbitary key/value pair used to add searchable metadata to secure tunnel resources. key (string) --The key of the tag. value (string) --The value of the tag. createdAt (datetime) --The time when the tunnel was created. lastUpdatedAt (datetime) --The last time the tunnel was updated. Exceptions IoTSecureTunneling.Client.exceptions.ResourceNotFoundException :return: { 'tunnel': { 'tunnelId': 'string', 'tunnelArn': 'string', 'status': 'OPEN'|'CLOSED', 'sourceConnectionState': { 'status': 'CONNECTED'|'DISCONNECTED', 'lastUpdatedAt': datetime(2015, 1, 1) }, 'destinationConnectionState': { 'status': 'CONNECTED'|'DISCONNECTED', 'lastUpdatedAt': datetime(2015, 1, 1) }, 'description': 'string', 'destinationConfig': { 'thingName': 'string', 'services': [ 'string', ] }, 'timeoutConfig': { 'maxLifetimeTimeoutMinutes': 123 }, 'tags': [ { 'key': 'string', 'value': 'string' }, ], 'createdAt': datetime(2015, 1, 1), 'lastUpdatedAt': datetime(2015, 1, 1) } } :returns: IoTSecureTunneling.Client.exceptions.ResourceNotFoundException """ pass def generate_presigned_url(ClientMethod=None, Params=None, ExpiresIn=None, HttpMethod=None): """ Generate a presigned url given a client, its method, and arguments :type ClientMethod: string :param ClientMethod: The client method to presign for :type Params: dict :param Params: The parameters normally passed to ClientMethod. :type ExpiresIn: int :param ExpiresIn: The number of seconds the presigned url is valid for. By default it expires in an hour (3600 seconds) :type HttpMethod: string :param HttpMethod: The http method to use on the generated url. By default, the http method is whatever is used in the method's model. """ pass def get_paginator(operation_name=None): """ Create a paginator for an operation. :type operation_name: string :param operation_name: The operation name. This is the same name as the method name on the client. For example, if the method name is create_foo, and you'd normally invoke the operation as client.create_foo(**kwargs), if the create_foo operation can be paginated, you can use the call client.get_paginator('create_foo'). :rtype: L{botocore.paginate.Paginator} ReturnsA paginator object. """ pass def get_waiter(waiter_name=None): """ Returns an object that can wait for some condition. :type waiter_name: str :param waiter_name: The name of the waiter to get. See the waiters section of the service docs for a list of available waiters. :rtype: botocore.waiter.Waiter """ pass def list_tags_for_resource(resourceArn=None): """ Lists the tags for the specified resource. See also: AWS API Documentation Exceptions :example: response = client.list_tags_for_resource( resourceArn='string' ) :type resourceArn: string :param resourceArn: [REQUIRED] The resource ARN. :rtype: dict ReturnsResponse Syntax{ 'tags': [ { 'key': 'string', 'value': 'string' }, ] } Response Structure (dict) -- tags (list) --The tags for the specified resource. (dict) --An arbitary key/value pair used to add searchable metadata to secure tunnel resources. key (string) --The key of the tag. value (string) --The value of the tag. Exceptions IoTSecureTunneling.Client.exceptions.ResourceNotFoundException :return: { 'tags': [ { 'key': 'string', 'value': 'string' }, ] } """ pass def list_tunnels(thingName=None, maxResults=None, nextToken=None): """ List all tunnels for an AWS account. Tunnels are listed by creation time in descending order, newer tunnels will be listed before older tunnels. See also: AWS API Documentation :example: response = client.list_tunnels( thingName='string', maxResults=123, nextToken='string' ) :type thingName: string :param thingName: The name of the IoT thing associated with the destination device. :type maxResults: integer :param maxResults: The maximum number of results to return at once. :type nextToken: string :param nextToken: A token to retrieve the next set of results. :rtype: dict ReturnsResponse Syntax { 'tunnelSummaries': [ { 'tunnelId': 'string', 'tunnelArn': 'string', 'status': 'OPEN'|'CLOSED', 'description': 'string', 'createdAt': datetime(2015, 1, 1), 'lastUpdatedAt': datetime(2015, 1, 1) }, ], 'nextToken': 'string' } Response Structure (dict) -- tunnelSummaries (list) -- A short description of the tunnels in an AWS account. (dict) -- Information about the tunnel. tunnelId (string) -- The unique alpha-numeric identifier for the tunnel. tunnelArn (string) -- The Amazon Resource Name of the tunnel. The tunnel ARN format is arn:aws:tunnel:<region>:<account-id>:tunnel/<tunnel-id> status (string) -- The status of a tunnel. Valid values are: Open and Closed. description (string) -- A description of the tunnel. createdAt (datetime) -- The time the tunnel was created. lastUpdatedAt (datetime) -- The time the tunnel was last updated. nextToken (string) -- A token to used to retrieve the next set of results. :return: { 'tunnelSummaries': [ { 'tunnelId': 'string', 'tunnelArn': 'string', 'status': 'OPEN'|'CLOSED', 'description': 'string', 'createdAt': datetime(2015, 1, 1), 'lastUpdatedAt': datetime(2015, 1, 1) }, ], 'nextToken': 'string' } """ pass def open_tunnel(description=None, tags=None, destinationConfig=None, timeoutConfig=None): """ Creates a new tunnel, and returns two client access tokens for clients to use to connect to the AWS IoT Secure Tunneling proxy server. . See also: AWS API Documentation Exceptions :example: response = client.open_tunnel( description='string', tags=[ { 'key': 'string', 'value': 'string' }, ], destinationConfig={ 'thingName': 'string', 'services': [ 'string', ] }, timeoutConfig={ 'maxLifetimeTimeoutMinutes': 123 } ) :type description: string :param description: A short text description of the tunnel. :type tags: list :param tags: A collection of tag metadata. (dict) --An arbitary key/value pair used to add searchable metadata to secure tunnel resources. key (string) -- [REQUIRED]The key of the tag. value (string) -- [REQUIRED]The value of the tag. :type destinationConfig: dict :param destinationConfig: The destination configuration for the OpenTunnel request. thingName (string) -- [REQUIRED]The name of the IoT thing to which you want to connect. services (list) -- [REQUIRED]A list of service names that identity the target application. Currently, you can only specify a single name. The AWS IoT client running on the destination device reads this value and uses it to look up a port or an IP address and a port. The AWS IoT client instantiates the local proxy which uses this information to connect to the destination application. (string) -- :type timeoutConfig: dict :param timeoutConfig: Timeout configuration for a tunnel. maxLifetimeTimeoutMinutes (integer) --The maximum amount of time (in minutes) a tunnel can remain open. If not specified, maxLifetimeTimeoutMinutes defaults to 720 minutes. Valid values are from 1 minute to 12 hours (720 minutes) :rtype: dict ReturnsResponse Syntax { 'tunnelId': 'string', 'tunnelArn': 'string', 'sourceAccessToken': 'string', 'destinationAccessToken': 'string' } Response Structure (dict) -- tunnelId (string) -- A unique alpha-numeric tunnel ID. tunnelArn (string) -- The Amazon Resource Name for the tunnel. The tunnel ARN format is arn:aws:tunnel:<region>:<account-id>:tunnel/<tunnel-id> sourceAccessToken (string) -- The access token the source local proxy uses to connect to AWS IoT Secure Tunneling. destinationAccessToken (string) -- The access token the destination local proxy uses to connect to AWS IoT Secure Tunneling. Exceptions IoTSecureTunneling.Client.exceptions.LimitExceededException :return: { 'tunnelId': 'string', 'tunnelArn': 'string', 'sourceAccessToken': 'string', 'destinationAccessToken': 'string' } :returns: IoTSecureTunneling.Client.exceptions.LimitExceededException """ pass def tag_resource(resourceArn=None, tags=None): """ A resource tag. See also: AWS API Documentation Exceptions :example: response = client.tag_resource( resourceArn='string', tags=[ { 'key': 'string', 'value': 'string' }, ] ) :type resourceArn: string :param resourceArn: [REQUIRED] The ARN of the resource. :type tags: list :param tags: [REQUIRED] The tags for the resource. (dict) --An arbitary key/value pair used to add searchable metadata to secure tunnel resources. key (string) -- [REQUIRED]The key of the tag. value (string) -- [REQUIRED]The value of the tag. :rtype: dict ReturnsResponse Syntax {} Response Structure (dict) -- Exceptions IoTSecureTunneling.Client.exceptions.ResourceNotFoundException :return: {} :returns: (dict) -- """ pass def untag_resource(resourceArn=None, tagKeys=None): """ Removes a tag from a resource. See also: AWS API Documentation Exceptions :example: response = client.untag_resource( resourceArn='string', tagKeys=[ 'string', ] ) :type resourceArn: string :param resourceArn: [REQUIRED] The resource ARN. :type tagKeys: list :param tagKeys: [REQUIRED] The keys of the tags to remove. (string) -- :rtype: dict ReturnsResponse Syntax {} Response Structure (dict) -- Exceptions IoTSecureTunneling.Client.exceptions.ResourceNotFoundException :return: {} :returns: (dict) -- """ pass
""" A class for delayed evaluation """ class Delayed(object): """A delayed evaluation tree. """ def __init__(self, function, *args, **kwargs): self.function = function self.args = args self.kwargs = kwargs def __str__(self): return '({}, {}, {})'.format(self.function, self.args, self.kwargs) def __repr__(self): return '({}, {}, {})'.format(self.function, self.args, self.kwargs) def __call__(self): return self.evaluate() def call(self, f): """Apply a function to this expression """ return Delayed(f, self) def evaluate(self): """Evaluate this tree """ return self.function( *(a.evaluate() if isinstance(a, Delayed) else a for a in self.args), **self.kwargs ) def map_functions(self, f): """Apply ``f`` to every function in the tree """ return Delayed( f(self.function), *(a.map_functions(f) if isinstance(a, Delayed) else a for a in self.args), **self.kwargs ) def map_args(self, f): """Apply ``f`` to every argument in the tree """ return Delayed( self.function, *(a.map_args(f) if isinstance(a, Delayed) else f(a) for a in self.args), **self.kwargs )
""" A class for delayed evaluation """ class Delayed(object): """A delayed evaluation tree. """ def __init__(self, function, *args, **kwargs): self.function = function self.args = args self.kwargs = kwargs def __str__(self): return '({}, {}, {})'.format(self.function, self.args, self.kwargs) def __repr__(self): return '({}, {}, {})'.format(self.function, self.args, self.kwargs) def __call__(self): return self.evaluate() def call(self, f): """Apply a function to this expression """ return delayed(f, self) def evaluate(self): """Evaluate this tree """ return self.function(*(a.evaluate() if isinstance(a, Delayed) else a for a in self.args), **self.kwargs) def map_functions(self, f): """Apply ``f`` to every function in the tree """ return delayed(f(self.function), *(a.map_functions(f) if isinstance(a, Delayed) else a for a in self.args), **self.kwargs) def map_args(self, f): """Apply ``f`` to every argument in the tree """ return delayed(self.function, *(a.map_args(f) if isinstance(a, Delayed) else f(a) for a in self.args), **self.kwargs)
class Stack: """A class that implements a stack. Stack is a LIFO data structure where each new item is settled on top compared to others. Requires O(n) memory to store items and O(n) time to search an item. Requires O(1) time to push and to pop an item.""" def __init__(self) -> None: """Constructs all the necessary attributes. stack: list a storage for items, skeleton of stack""" self.stack = [] def push(self, item) -> None: """Inserts an item at the top of the stack.""" self.stack.insert(0, item) def pop(self) -> None: """Removes an item from the top of the stack.""" del self.stack[0] def is_empty(self) -> bool: """Checks if stack is empty.""" return len(self.stack) == 0 def print_stack(self) -> None: """Prints stack in the command line.""" for item in self.stack: if item != self.stack[len(self.stack) - 1]: print(item, end=", ") else: print(item) if __name__ == '__main__': stack = Stack() for i in range(10): stack.push(i) stack.print_stack() stack.pop() stack.print_stack()
class Stack: """A class that implements a stack. Stack is a LIFO data structure where each new item is settled on top compared to others. Requires O(n) memory to store items and O(n) time to search an item. Requires O(1) time to push and to pop an item.""" def __init__(self) -> None: """Constructs all the necessary attributes. stack: list a storage for items, skeleton of stack""" self.stack = [] def push(self, item) -> None: """Inserts an item at the top of the stack.""" self.stack.insert(0, item) def pop(self) -> None: """Removes an item from the top of the stack.""" del self.stack[0] def is_empty(self) -> bool: """Checks if stack is empty.""" return len(self.stack) == 0 def print_stack(self) -> None: """Prints stack in the command line.""" for item in self.stack: if item != self.stack[len(self.stack) - 1]: print(item, end=', ') else: print(item) if __name__ == '__main__': stack = stack() for i in range(10): stack.push(i) stack.print_stack() stack.pop() stack.print_stack()
class Work: __id = None __artist = None __artist_name = None __name = None __created = None __description = None __tags = [] __forks = 0 __likes = 0 __allow_download = False __allow_sketch = False __allow_fork = False __address = None def set_address(self, address): self.__address = address return def set_id(self, id): self.__id = id return def set_artist(self, artist): self.__artist = artist return def set_artist_name(self, artist_name): self.__artist_name = artist_name return def set_name(self, name): self.__name = name return def set_created(self, created): self.__created = created return def set_description(self, description): self.__description = description return def set_tags(self, tags): self.__tags = tags return def set_forks(self, forks): self.__forks = forks return def set_likes(self, likes): self.__likes = likes return def set_allow_download(self, allow_download): self.__allow_download = allow_download return def set_allow_sketch(self, allow_sketch): self.__allow_sketch = allow_sketch return def set_allow_fork(self, allow_fork): self.__allow_fork = allow_fork return def get_id(self): return self.__id def get_artist(self): return self.__artist def get_artist_name(self): return self.__artist_name def get_name(self): return self.__name def get_created(self): return self.__created def get_description(self): return self.__description def get_tags(self): return self.__tags def get_forks(self): return self.__forks def get_likes(self): return self.__likes def get_allow_download(self): return self.__allow_download def get_allow_sketch(self): return self.__allow_sketch def get_allow_fork(self): return self.__allow_fork def get_address(self): return self.__address
class Work: __id = None __artist = None __artist_name = None __name = None __created = None __description = None __tags = [] __forks = 0 __likes = 0 __allow_download = False __allow_sketch = False __allow_fork = False __address = None def set_address(self, address): self.__address = address return def set_id(self, id): self.__id = id return def set_artist(self, artist): self.__artist = artist return def set_artist_name(self, artist_name): self.__artist_name = artist_name return def set_name(self, name): self.__name = name return def set_created(self, created): self.__created = created return def set_description(self, description): self.__description = description return def set_tags(self, tags): self.__tags = tags return def set_forks(self, forks): self.__forks = forks return def set_likes(self, likes): self.__likes = likes return def set_allow_download(self, allow_download): self.__allow_download = allow_download return def set_allow_sketch(self, allow_sketch): self.__allow_sketch = allow_sketch return def set_allow_fork(self, allow_fork): self.__allow_fork = allow_fork return def get_id(self): return self.__id def get_artist(self): return self.__artist def get_artist_name(self): return self.__artist_name def get_name(self): return self.__name def get_created(self): return self.__created def get_description(self): return self.__description def get_tags(self): return self.__tags def get_forks(self): return self.__forks def get_likes(self): return self.__likes def get_allow_download(self): return self.__allow_download def get_allow_sketch(self): return self.__allow_sketch def get_allow_fork(self): return self.__allow_fork def get_address(self): return self.__address