content
stringlengths
7
1.05M
fixed_cases
stringlengths
1
1.28M
def generate(n, diff, left, right): if n > 9: return if n and (2 * abs(diff) <= n): if n == 1: generate(n - 1, diff, left, "0" + right) generate(n - 1, diff, left, "1" + right) if left != "": generate(n - 2, diff, left + "0", right + "0") generate(n - 2, diff - 1, left + "0", right + "1") generate(n - 2, diff, left + "1", right + "1") generate(n - 2, diff + 1, left + "1", right + "0") if n == 0 and diff == 0: print(left + right) generate(int(input()), 0, "", "")
def generate(n, diff, left, right): if n > 9: return if n and 2 * abs(diff) <= n: if n == 1: generate(n - 1, diff, left, '0' + right) generate(n - 1, diff, left, '1' + right) if left != '': generate(n - 2, diff, left + '0', right + '0') generate(n - 2, diff - 1, left + '0', right + '1') generate(n - 2, diff, left + '1', right + '1') generate(n - 2, diff + 1, left + '1', right + '0') if n == 0 and diff == 0: print(left + right) generate(int(input()), 0, '', '')
#!/usr/bin/python3 # coding=utf-8 class LoopNotFoundError(Exception): def __init__(self, message): super().__init__(message)
class Loopnotfounderror(Exception): def __init__(self, message): super().__init__(message)
class Solution: def balancedStringSplit(self, s: str) -> int: l=0 r=1 k=0 while r<len(s)+1: print(s[l:r]) if s[l:r].count("L") == s[l:r].count("R"): k=k+1 l=r r=r+1 r=r+1 return k
class Solution: def balanced_string_split(self, s: str) -> int: l = 0 r = 1 k = 0 while r < len(s) + 1: print(s[l:r]) if s[l:r].count('L') == s[l:r].count('R'): k = k + 1 l = r r = r + 1 r = r + 1 return k
def for_c(): """ Lower case Alphabet letter 'c' pattern using Python for loop""" for row in range(4): for col in range(4): if col==0 and row%3!=0 or col>0 and row%3==0: print('*', end = ' ') else: print(' ', end = ' ') print() def while_c(): """ Lower case Alphabet letter 'c' patter using Python while loop""" row = 0 while row<4: col = 0 while col<4: if col==0 and row%3!=0 or col>0 and row%3==0: print('*', end = ' ') else: print(' ', end = ' ') col += 1 print() row += 1
def for_c(): """ Lower case Alphabet letter 'c' pattern using Python for loop""" for row in range(4): for col in range(4): if col == 0 and row % 3 != 0 or (col > 0 and row % 3 == 0): print('*', end=' ') else: print(' ', end=' ') print() def while_c(): """ Lower case Alphabet letter 'c' patter using Python while loop""" row = 0 while row < 4: col = 0 while col < 4: if col == 0 and row % 3 != 0 or (col > 0 and row % 3 == 0): print('*', end=' ') else: print(' ', end=' ') col += 1 print() row += 1
class Solution: def climbStairs(self, n: int) -> int: dp = [0] * (n + 1) dp[0] = 1 weights = [1, 2] for i in range(n + 1): for j in weights: if i >= j: dp[i] += dp[i-j] return dp[n]
class Solution: def climb_stairs(self, n: int) -> int: dp = [0] * (n + 1) dp[0] = 1 weights = [1, 2] for i in range(n + 1): for j in weights: if i >= j: dp[i] += dp[i - j] return dp[n]
def _first_available(color_list): """ (https://en.wikipedia.org/wiki/Greedy_coloring) Return smallest non-negative integer not in the given list of colors. :param color_list: List of neighboring nodes colors :type color_list: list of int :rtype: int """ color_set = set(color_list) count = 0 while True: if count not in color_set: return count count += 1 def get_heuristic(G): """ Greedy colouring heuristic (explanation and code: https://en.wikipedia.org/wiki/Greedy_coloring) :param G: an :py:class:`~graphilp.imports.ilpgraph.ILPGraph` :return: two dictionaries: {color_1:[list_of_color_1_nodes], ...} and {node_1:color_of_node_1, ...} """ nodes = G.G.nodes() node_to_col = {} col_to_node = {} for node in nodes: neighbor_colors = [node_to_col.get(neigh_node) for neigh_node in G.G.neighbors(node)] node_color = _first_available(neighbor_colors) node_to_col[node] = node_color if node_color not in col_to_node: col_to_node[node_color] = [node] else: col_to_node.get(node_color).append(node) return col_to_node, node_to_col
def _first_available(color_list): """ (https://en.wikipedia.org/wiki/Greedy_coloring) Return smallest non-negative integer not in the given list of colors. :param color_list: List of neighboring nodes colors :type color_list: list of int :rtype: int """ color_set = set(color_list) count = 0 while True: if count not in color_set: return count count += 1 def get_heuristic(G): """ Greedy colouring heuristic (explanation and code: https://en.wikipedia.org/wiki/Greedy_coloring) :param G: an :py:class:`~graphilp.imports.ilpgraph.ILPGraph` :return: two dictionaries: {color_1:[list_of_color_1_nodes], ...} and {node_1:color_of_node_1, ...} """ nodes = G.G.nodes() node_to_col = {} col_to_node = {} for node in nodes: neighbor_colors = [node_to_col.get(neigh_node) for neigh_node in G.G.neighbors(node)] node_color = _first_available(neighbor_colors) node_to_col[node] = node_color if node_color not in col_to_node: col_to_node[node_color] = [node] else: col_to_node.get(node_color).append(node) return (col_to_node, node_to_col)
class Solution: def permuteUnique(self, nums: List[int]) -> List[List[int]]: marked = [False] * len(nums) ans = [] self.dfs(sorted(nums), marked, [], ans) return ans def dfs(self, nums, marked, path, ans): if len(path) == len(nums): ans.append(list(path)) return for i in range(len(nums)): if i > 0 and nums[i] == nums[i-1] and not marked[i-1]: continue if marked[i]: continue marked[i] = True path.append(nums[i]) self.dfs(nums, marked, path, ans) marked[i] = False path.pop()
class Solution: def permute_unique(self, nums: List[int]) -> List[List[int]]: marked = [False] * len(nums) ans = [] self.dfs(sorted(nums), marked, [], ans) return ans def dfs(self, nums, marked, path, ans): if len(path) == len(nums): ans.append(list(path)) return for i in range(len(nums)): if i > 0 and nums[i] == nums[i - 1] and (not marked[i - 1]): continue if marked[i]: continue marked[i] = True path.append(nums[i]) self.dfs(nums, marked, path, ans) marked[i] = False path.pop()
def hasFront(arr,r,c,i,j): if(i-1 >= 0): return arr[i-1][j] == arr[i][j] return False def hasBack(arr,r,c,i,j): if(i+1 < r): return arr[i+1][j] == arr[i][j] return False def hasLR(arr,r,c,i,j): if(j+1 < c): if(arr[i][j+1] == arr[i][j]): return True if(j-1 >= 0): if(arr[i][j-1] == arr[i][j]): return True return False def hasDiagonal(arr,r,c,i,j): if(i-1 >=0 and j-1 >=0): if(arr[i-1][j-1] == arr[i][j]): return True if(i+1 < r and j+1 < c): if(arr[i+1][j+1] == arr[i][j]): return True if(i-1 >=0 and j+1 < c): if(arr[i-1][j+1] == arr[i][j]): return True if(i+1 < r and j-1 >= 0): if(arr[i+1][j-1] == arr[i][j]): return True return False r = int(input('Enter # of rows:')) c = int(input('Enter # of columns:')) print('-Enter the student arrangement-') arr = [] for _ in range(r): arr.append([e for e in input().split()]) result = [] for _ in range(r): result.append([0.0 for i in range(c)]) for i in range(r): for j in range(c): if(hasFront(arr,r,c,i,j)): result[i][j] += 0.3 if(hasBack(arr,r,c,i,j)): result[i][j] += 0.2 if(hasLR(arr,r,c,i,j)): result[i][j] += 0.2 if(hasDiagonal(arr,r,c,i,j)): result[i][j] += 0.025 for e in result: print(e)
def has_front(arr, r, c, i, j): if i - 1 >= 0: return arr[i - 1][j] == arr[i][j] return False def has_back(arr, r, c, i, j): if i + 1 < r: return arr[i + 1][j] == arr[i][j] return False def has_lr(arr, r, c, i, j): if j + 1 < c: if arr[i][j + 1] == arr[i][j]: return True if j - 1 >= 0: if arr[i][j - 1] == arr[i][j]: return True return False def has_diagonal(arr, r, c, i, j): if i - 1 >= 0 and j - 1 >= 0: if arr[i - 1][j - 1] == arr[i][j]: return True if i + 1 < r and j + 1 < c: if arr[i + 1][j + 1] == arr[i][j]: return True if i - 1 >= 0 and j + 1 < c: if arr[i - 1][j + 1] == arr[i][j]: return True if i + 1 < r and j - 1 >= 0: if arr[i + 1][j - 1] == arr[i][j]: return True return False r = int(input('Enter # of rows:')) c = int(input('Enter # of columns:')) print('-Enter the student arrangement-') arr = [] for _ in range(r): arr.append([e for e in input().split()]) result = [] for _ in range(r): result.append([0.0 for i in range(c)]) for i in range(r): for j in range(c): if has_front(arr, r, c, i, j): result[i][j] += 0.3 if has_back(arr, r, c, i, j): result[i][j] += 0.2 if has_lr(arr, r, c, i, j): result[i][j] += 0.2 if has_diagonal(arr, r, c, i, j): result[i][j] += 0.025 for e in result: print(e)
__author__ = 'Xavier Bruhiere' __copyright__ = 'Xavier Bruhiere' __licence__ = 'Apache 2.0' __version__ = '0.0.2'
__author__ = 'Xavier Bruhiere' __copyright__ = 'Xavier Bruhiere' __licence__ = 'Apache 2.0' __version__ = '0.0.2'
class Sim: def __init__(self, fish: list[int]): self.fish = fish def step(self): fish = self.fish for i in range(len(self.fish)): if fish[i] == 0: fish.append(8) fish[i] = 7 fish[i] -= 1 if __name__ == "__main__": with open("input.txt") as file: raw_input_data = file.read() with open("example.txt") as file: raw_example_data = file.read() # A variable used to choose which one of the two to use # Example data is used to see if the code works use_example_data = False if use_example_data: raw_data = raw_example_data else: raw_data = raw_input_data data = [int(fish) for fish in raw_data.split(",")] simulation = Sim(data) for i in range(80): simulation.step() print("Total: {}".format(len(simulation.fish)))
class Sim: def __init__(self, fish: list[int]): self.fish = fish def step(self): fish = self.fish for i in range(len(self.fish)): if fish[i] == 0: fish.append(8) fish[i] = 7 fish[i] -= 1 if __name__ == '__main__': with open('input.txt') as file: raw_input_data = file.read() with open('example.txt') as file: raw_example_data = file.read() use_example_data = False if use_example_data: raw_data = raw_example_data else: raw_data = raw_input_data data = [int(fish) for fish in raw_data.split(',')] simulation = sim(data) for i in range(80): simulation.step() print('Total: {}'.format(len(simulation.fish)))
""" 1 3 5 1 3 3 5 | arr[L..R] > s | L R --------------- l r -------- """ n, r = [int(x) for x in input().split()] arr = [int(x) for x in input().split()] def two_pointer(arr,k): l = 0 N = len(arr) count = 0 for r in range(N): while arr[r] - arr[l] > k: l += 1 count += l return count ans = two_pointer(arr, r) print(ans)
""" 1 3 5 1 3 3 5 | arr[L..R] > s | L R --------------- l r -------- """ (n, r) = [int(x) for x in input().split()] arr = [int(x) for x in input().split()] def two_pointer(arr, k): l = 0 n = len(arr) count = 0 for r in range(N): while arr[r] - arr[l] > k: l += 1 count += l return count ans = two_pointer(arr, r) print(ans)
# Uses python3 def get_change_naive(m): count = m // 10 m %= 10 count += m // 5 m %= 5 count += m // 1 return count def get_change_greedy(m): #write your code here change, count = 0, 0 coins = [1, 5, 10] index = len(coins) - 1 while change < m: while (change <= m and (m - change) >= coins[index]): change += coins[index] count += 1 index -= 1 return count if __name__ == '__main__': m = int(input()) print(get_change_greedy(m))
def get_change_naive(m): count = m // 10 m %= 10 count += m // 5 m %= 5 count += m // 1 return count def get_change_greedy(m): (change, count) = (0, 0) coins = [1, 5, 10] index = len(coins) - 1 while change < m: while change <= m and m - change >= coins[index]: change += coins[index] count += 1 index -= 1 return count if __name__ == '__main__': m = int(input()) print(get_change_greedy(m))
""" :mod:`refcount` =============== A simple library for providing a reference counter with optional acquire/release callbacks as well as access protection to reference counted values. .. moduleauthor:: Paul Mundt <paul.mundt@adaptant.io> """ # pylint: disable=unnecessary-pass class UnderflowException(Exception): """ Reference counter underflow exception, raised on counter underflow. >>> from refcount import Refcounter >>> ref = Refcounter() >>> ref.dec() >>> ref.usecount 0 >>> ref.dec() # doctest: +IGNORE_EXCEPTION_DETAIL Traceback (most recent call last): refcount.UnderflowException: refcount underflow """ pass class Refcounter: """ Provides a reference counter with an optional release callback that is triggered when the last user drops off. """ def __init__(self, usecount=1, acquire=None, release=None): """ Initialize a reference counter :param usecount: Initial refcount value :type usecount: int :param acquire: A callback function that is called when a reference count goes above 0 :type acquire: function, optional :param release: A callback function that is called when the reference count drops to 0 :type release: function, optional """ self._usecount = usecount self._acquire = acquire self._release = release def add(self, value): """ Add to a reference count If the reference count becomes higher than 0, the acquire callback (if provided) will be automatically triggered. >>> from refcount import Refcounter >>> ref = Refcounter() >>> ref.add(2) >>> ref.usecount 3 :param value: Amount to add :type value: int """ if self._usecount == 0 and self._acquire: self._usecount += value self._acquire() else: self._usecount += value def add_not_zero(self, value): """ Add to a reference count unless it is 0 >>> from refcount import Refcounter >>> ref = Refcounter() >>> ref.dec() >>> ref.usecount 0 >>> ref.add_not_zero(2) False :param value: Amount to add :type value: int :return: False if refcount is 0, True otherwise """ if self._usecount == 0: return False self.add(value) return True def inc(self): """ Increment reference count by 1 If the reference count becomes higher than 0, the acquire callback (if provided) will be automatically triggered. >>> from refcount import Refcounter >>> ref = Refcounter() >>> ref.usecount 1 >>> ref.inc() >>> ref.usecount 2 """ self.add(1) def inc_not_zero(self): """ Increment a reference by 1 unless it is 0 >>> from refcount import Refcounter >>> ref = Refcounter() >>> ref.dec() >>> ref.usecount 0 >>> ref.inc_not_zero() False :return: False if refcount is 0, True otherwise """ if self._usecount == 0: return False self.inc() return True def sub(self, value): """ Subtract from a reference count >>> from refcount import Refcounter >>> ref = Refcounter(usecount=3) >>> ref.usecount 3 >>> ref.sub(2) >>> ref.usecount 1 If the reference count drops to 0, the release callback (if provided) will be automatically triggered. :param value: Amount to subtract :type value: int :raises UnderflowException: refcount underflow """ if self._usecount - value < 0: raise UnderflowException('refcount underflow') self._usecount -= value if self._usecount == 0 and self._release is not None: self._release() def sub_and_test(self, value): """ Subtract reference count and test if the reference count is 0 This can be used by code that wishes to implement a cleanup path triggered only when the reference count drops to 0. If the reference count drops to 0, the release callback (if provided) will be automatically triggered. >>> from refcount import Refcounter >>> ref = Refcounter() >>> ref.inc() >>> if ref.sub_and_test(2): ... print('reference count is now 0') reference count is now 0 :param value: Amount to subtract :type value: int :return: True if reference count is 0, otherwise False :rtype: bool :raises UnderflowException: refcount underflow """ self.sub(value) return self._usecount == 0 def dec(self): """ Decrement reference count by 1 If the reference count drops to 0, the release callback (if provided) will be automatically triggered. >>> from refcount import Refcounter >>> def refcount_released(): ... print('no more users') >>> ref = Refcounter(release=refcount_released) >>> ref.inc() >>> ref.dec() >>> ref.dec() no more users :raises UnderflowException: refcount underflow """ self.sub(1) def dec_and_test(self): """ Decrement reference count and test if the reference count is 0 This can be used by code that wishes to implement a cleanup path triggered only when the reference count drops to 0. If the reference count drops to 0, the release callback (if provided) will be automatically triggered. >>> from refcount import Refcounter >>> ref = Refcounter() >>> if ref.dec_and_test(): ... print('reference count is now 0') reference count is now 0 :return: True if reference count is 0, otherwise False :rtype: bool :raises UnderflowException: refcount underflow """ self.dec() return self._usecount == 0 @property def usecount(self): """ Read/write the reference count >>> from refcount import Refcounter >>> ref = Refcounter() >>> ref.usecount 1 >>> ref.inc() >>> ref.usecount 2 >>> ref.usecount = 4 >>> ref.usecount 4 :return: Current reference count :rtype: int """ return self._usecount @usecount.setter def usecount(self, value): self._usecount = value class RefcountedValue(Refcounter): """ Provides access protection to a reference counted value. Allows the reference counting for a value to be arbitrarily incremented and decremented, permitting access to the protected value so long as a valid reference count is held. Once the reference count has dropped to 0, continued references will raise a NameError exception. A release callback method may optionally be provided, and will be called as soon as the last remaining reference is dropped. """ def __init__(self, value, usecount=1, acquire=None, release=None): """ Initialize a reference counted value :param value: The protected reference counted value :type value: Any :param usecount: Initial refcount value :type usecount: int :param acquire: A callback function that is called when a reference count goes above 0 :type acquire: function, optional :param release: A callback function that is called when the reference count drops to 0 :type release: function, optional """ self._value = value super().__init__(usecount=usecount, acquire=acquire, release=release) @property def value(self): """ Reference count protected value Allows access to the protected value as long as a valid reference count is held. >>> from refcount import RefcountedValue >>> ref = RefcountedValue(value=True) >>> ref.value True >>> ref.dec() >>> ref.value # doctest: +IGNORE_EXCEPTION_DETAIL Traceback (most recent call last): NameError: Value referenced with no reference count :return: value :raises NameError: Value referenced with no reference count """ if self._usecount == 0: raise NameError('Value referenced with no reference count') return self._value @value.setter def value(self, value): if self._usecount == 0: raise NameError('Value referenced with no reference count') self._value = value
""" :mod:`refcount` =============== A simple library for providing a reference counter with optional acquire/release callbacks as well as access protection to reference counted values. .. moduleauthor:: Paul Mundt <paul.mundt@adaptant.io> """ class Underflowexception(Exception): """ Reference counter underflow exception, raised on counter underflow. >>> from refcount import Refcounter >>> ref = Refcounter() >>> ref.dec() >>> ref.usecount 0 >>> ref.dec() # doctest: +IGNORE_EXCEPTION_DETAIL Traceback (most recent call last): refcount.UnderflowException: refcount underflow """ pass class Refcounter: """ Provides a reference counter with an optional release callback that is triggered when the last user drops off. """ def __init__(self, usecount=1, acquire=None, release=None): """ Initialize a reference counter :param usecount: Initial refcount value :type usecount: int :param acquire: A callback function that is called when a reference count goes above 0 :type acquire: function, optional :param release: A callback function that is called when the reference count drops to 0 :type release: function, optional """ self._usecount = usecount self._acquire = acquire self._release = release def add(self, value): """ Add to a reference count If the reference count becomes higher than 0, the acquire callback (if provided) will be automatically triggered. >>> from refcount import Refcounter >>> ref = Refcounter() >>> ref.add(2) >>> ref.usecount 3 :param value: Amount to add :type value: int """ if self._usecount == 0 and self._acquire: self._usecount += value self._acquire() else: self._usecount += value def add_not_zero(self, value): """ Add to a reference count unless it is 0 >>> from refcount import Refcounter >>> ref = Refcounter() >>> ref.dec() >>> ref.usecount 0 >>> ref.add_not_zero(2) False :param value: Amount to add :type value: int :return: False if refcount is 0, True otherwise """ if self._usecount == 0: return False self.add(value) return True def inc(self): """ Increment reference count by 1 If the reference count becomes higher than 0, the acquire callback (if provided) will be automatically triggered. >>> from refcount import Refcounter >>> ref = Refcounter() >>> ref.usecount 1 >>> ref.inc() >>> ref.usecount 2 """ self.add(1) def inc_not_zero(self): """ Increment a reference by 1 unless it is 0 >>> from refcount import Refcounter >>> ref = Refcounter() >>> ref.dec() >>> ref.usecount 0 >>> ref.inc_not_zero() False :return: False if refcount is 0, True otherwise """ if self._usecount == 0: return False self.inc() return True def sub(self, value): """ Subtract from a reference count >>> from refcount import Refcounter >>> ref = Refcounter(usecount=3) >>> ref.usecount 3 >>> ref.sub(2) >>> ref.usecount 1 If the reference count drops to 0, the release callback (if provided) will be automatically triggered. :param value: Amount to subtract :type value: int :raises UnderflowException: refcount underflow """ if self._usecount - value < 0: raise underflow_exception('refcount underflow') self._usecount -= value if self._usecount == 0 and self._release is not None: self._release() def sub_and_test(self, value): """ Subtract reference count and test if the reference count is 0 This can be used by code that wishes to implement a cleanup path triggered only when the reference count drops to 0. If the reference count drops to 0, the release callback (if provided) will be automatically triggered. >>> from refcount import Refcounter >>> ref = Refcounter() >>> ref.inc() >>> if ref.sub_and_test(2): ... print('reference count is now 0') reference count is now 0 :param value: Amount to subtract :type value: int :return: True if reference count is 0, otherwise False :rtype: bool :raises UnderflowException: refcount underflow """ self.sub(value) return self._usecount == 0 def dec(self): """ Decrement reference count by 1 If the reference count drops to 0, the release callback (if provided) will be automatically triggered. >>> from refcount import Refcounter >>> def refcount_released(): ... print('no more users') >>> ref = Refcounter(release=refcount_released) >>> ref.inc() >>> ref.dec() >>> ref.dec() no more users :raises UnderflowException: refcount underflow """ self.sub(1) def dec_and_test(self): """ Decrement reference count and test if the reference count is 0 This can be used by code that wishes to implement a cleanup path triggered only when the reference count drops to 0. If the reference count drops to 0, the release callback (if provided) will be automatically triggered. >>> from refcount import Refcounter >>> ref = Refcounter() >>> if ref.dec_and_test(): ... print('reference count is now 0') reference count is now 0 :return: True if reference count is 0, otherwise False :rtype: bool :raises UnderflowException: refcount underflow """ self.dec() return self._usecount == 0 @property def usecount(self): """ Read/write the reference count >>> from refcount import Refcounter >>> ref = Refcounter() >>> ref.usecount 1 >>> ref.inc() >>> ref.usecount 2 >>> ref.usecount = 4 >>> ref.usecount 4 :return: Current reference count :rtype: int """ return self._usecount @usecount.setter def usecount(self, value): self._usecount = value class Refcountedvalue(Refcounter): """ Provides access protection to a reference counted value. Allows the reference counting for a value to be arbitrarily incremented and decremented, permitting access to the protected value so long as a valid reference count is held. Once the reference count has dropped to 0, continued references will raise a NameError exception. A release callback method may optionally be provided, and will be called as soon as the last remaining reference is dropped. """ def __init__(self, value, usecount=1, acquire=None, release=None): """ Initialize a reference counted value :param value: The protected reference counted value :type value: Any :param usecount: Initial refcount value :type usecount: int :param acquire: A callback function that is called when a reference count goes above 0 :type acquire: function, optional :param release: A callback function that is called when the reference count drops to 0 :type release: function, optional """ self._value = value super().__init__(usecount=usecount, acquire=acquire, release=release) @property def value(self): """ Reference count protected value Allows access to the protected value as long as a valid reference count is held. >>> from refcount import RefcountedValue >>> ref = RefcountedValue(value=True) >>> ref.value True >>> ref.dec() >>> ref.value # doctest: +IGNORE_EXCEPTION_DETAIL Traceback (most recent call last): NameError: Value referenced with no reference count :return: value :raises NameError: Value referenced with no reference count """ if self._usecount == 0: raise name_error('Value referenced with no reference count') return self._value @value.setter def value(self, value): if self._usecount == 0: raise name_error('Value referenced with no reference count') self._value = value
class Solution: def rangeSumBST(self, root, L, R): return self.inorder(root, 0, L, R) def inorder(self,root, value, L, R): if root: value = self.inorder(root.left, value, L, R) if root.val >= L and root.val <= R: value += root.val value = self.inorder(root.right, value, L, R) return value
class Solution: def range_sum_bst(self, root, L, R): return self.inorder(root, 0, L, R) def inorder(self, root, value, L, R): if root: value = self.inorder(root.left, value, L, R) if root.val >= L and root.val <= R: value += root.val value = self.inorder(root.right, value, L, R) return value
# def make_multiple(n): # def multiply(x): # print(f'{x} * {n} is ', x * n) # return multiply # times_three = make_multiple(3) # times_five = make_multiple(5) # del make_multiple # times_three(10) # == make_multiple(3)(10) # print('Closure of make_multiple', make_multiple.__closure__) # print('Closure of times_three', times_three.__closure__[0].cell_contents) # print('Closure of times_five', times_five.__closure__) # times_five(100) # times_five(10) # times_three(20) def add_discount(promo=100): print('In function that returns decorator') def inner(func): print('In decorator') def discounted(user, money): print('closure for: ', func.__name__) return func(user, money * (promo / 100)) # return value is the return value of `func` return discounted # return value is closure return inner # return value is decorator # decorator = add_discount(promo=20) # print('after add_discount return value') # pay_phone = decorator(pay_phone) # @shano @add_discount(promo=20) def pay_phone(user, money): print('phone', user, money) # @add_discount() # def pay_net(user, money): # print('net', user, money) print('Before pay_phone is called') pay_phone('marto', 100) # pay_net('marto', 100)
def add_discount(promo=100): print('In function that returns decorator') def inner(func): print('In decorator') def discounted(user, money): print('closure for: ', func.__name__) return func(user, money * (promo / 100)) return discounted return inner @add_discount(promo=20) def pay_phone(user, money): print('phone', user, money) print('Before pay_phone is called') pay_phone('marto', 100)
class Levenshtein: """ The Levenshtein distance between two strings: source, target Methods: constructor(source, target, costs): initialises data attributes and calculates distances and backtrace distance(): returns the minimum edit distance for the two strings edit_ops(): returns a list of operations to perform on source to transform into target print_distance_matrix(): print out the distance matrix print_edit_ops(): print out the edit operations Data attributes: source: source string target: target string costs: a tuple or a list with three integers (i, d, s) where i defines the costs for a insertion d defines the costs for a deletion s defines the costs for a substitution D: distance matrix edits: operations to perform on source to transform into target Usage: >>> l = Levenshtein("hello", "world", costs=(2,2,1)) >>> min_distance = l.distance() >>> operations = l.edit_ops() >>> print(l.print_distance_matrix()) - - w o r l d - 0 2 4 6 8 10 h 2 1 3 5 7 9 e 4 3 2 4 6 8 l 6 5 4 3 4 6 l 8 7 6 5 3 5 o 10 9 7 7 5 4 >>> print(l.print_edit_ops()) Type i j -------------------- Substitution 0 0 Substitution 1 1 Substitution 2 2 Match 3 3 Substitution 4 4 """ def __init__(self, source, target, costs=(1, 1, 1)): self.source = source self.target = target self.costs = costs self.D = self.__edit_distance() self.edits = self.__backtrace() def __backtrace(self): """ Trace back through the cost matrix to generate the list of edits """ # Find out indices of bottom-right most cell in matrix i, j = len(self.source), len(self.target) # Assign costs insertion_cost, deletion_cost, substitution_cost = self.costs # Distance matrix D = self.D # Declare list of edit operations edits = list() # While we don't reach the top-leftmost cell while not (i == 0 and j == 0): # Find out cost of current cell current_cost = D[i][j] if (i != 0 and j != 0) and current_cost == D[i - 1][j - 1]: # Same letter i, j = i - 1, j - 1 edits.append({"type": "Match", "i": i, "j": j}) elif (i != 0 and j != 0) and current_cost == D[i - 1][ j - 1 ] + substitution_cost: # Previous cell is diagonally opposite i, j = i - 1, j - 1 edits.append({"type": "Substitution", "i": i, "j": j}) elif i != 0 and current_cost == D[i - 1][j] + deletion_cost: # Previous cell is above current cell i, j = i - 1, j edits.append({"type": "Deletion", "i": i, "j": j}) elif j != 0 and current_cost == D[i][j - 1] + insertion_cost: # Previous cell is on the left of current cell i, j = i, j - 1 edits.append({"type": "Insertion", "i": i, "j": j}) # Reverse the backtrace of operations edits.reverse() return edits def __edit_distance(self): """ Calculates every cell of distance matrix """ # Calculate number of rows and columns in distance matrix rows = len(self.source) + 1 cols = len(self.target) + 1 # Assign costs insertion_cost, deletion_cost, substitution_cost = self.costs # Declaring distance matrix D = [[0 for i in range(cols)] for j in range(rows)] # Initialising first row for i in range(rows): D[i][0] = i * deletion_cost # Initialising first column for j in range(cols): D[0][j] = j * insertion_cost # Fill the rest of the matrix for i in range(1, rows): for j in range(1, cols): if self.source[i - 1] == self.target[j - 1]: # Same character D[i][j] = D[i - 1][j - 1] else: # Different character # Accounting for the cost of operation insertion = D[i][j - 1] + insertion_cost deletion = D[i - 1][j] + deletion_cost substitution = D[i - 1][j - 1] + substitution_cost # Choosing the best option and filling the cell D[i][j] = min(insertion, deletion, substitution) # Return distance matrix return D def distance(self): """ Returns bottom-rightmost entry of distance matrix """ return self.D[-1][-1] def edit_ops(self): """ Returns list of edit operations """ return self.edits def print_distance_matrix(self): """ Pretty prints the distance matrix """ rows = len(self.source) + 1 cols = len(self.target) + 1 first_row = "--" + self.target first_column = "-" + self.source for i in first_row: print("%2c " % i, end="") print() for i in range(0, rows): print("%2c " % (first_column[i]), end="") for j in range(0, cols): print("%2d " % (self.D[i][j]), end="") print() def print_edit_ops(self): """ Pretty prints the edit operations """ print("%-13s %2s %2s" % ("Type", "i", "j")) print("-" * 20) for op in self.edits: print("%-13s %2d %2d\n" % (op["type"], op["i"], op["j"]), end="")
class Levenshtein: """ The Levenshtein distance between two strings: source, target Methods: constructor(source, target, costs): initialises data attributes and calculates distances and backtrace distance(): returns the minimum edit distance for the two strings edit_ops(): returns a list of operations to perform on source to transform into target print_distance_matrix(): print out the distance matrix print_edit_ops(): print out the edit operations Data attributes: source: source string target: target string costs: a tuple or a list with three integers (i, d, s) where i defines the costs for a insertion d defines the costs for a deletion s defines the costs for a substitution D: distance matrix edits: operations to perform on source to transform into target Usage: >>> l = Levenshtein("hello", "world", costs=(2,2,1)) >>> min_distance = l.distance() >>> operations = l.edit_ops() >>> print(l.print_distance_matrix()) - - w o r l d - 0 2 4 6 8 10 h 2 1 3 5 7 9 e 4 3 2 4 6 8 l 6 5 4 3 4 6 l 8 7 6 5 3 5 o 10 9 7 7 5 4 >>> print(l.print_edit_ops()) Type i j -------------------- Substitution 0 0 Substitution 1 1 Substitution 2 2 Match 3 3 Substitution 4 4 """ def __init__(self, source, target, costs=(1, 1, 1)): self.source = source self.target = target self.costs = costs self.D = self.__edit_distance() self.edits = self.__backtrace() def __backtrace(self): """ Trace back through the cost matrix to generate the list of edits """ (i, j) = (len(self.source), len(self.target)) (insertion_cost, deletion_cost, substitution_cost) = self.costs d = self.D edits = list() while not (i == 0 and j == 0): current_cost = D[i][j] if (i != 0 and j != 0) and current_cost == D[i - 1][j - 1]: (i, j) = (i - 1, j - 1) edits.append({'type': 'Match', 'i': i, 'j': j}) elif (i != 0 and j != 0) and current_cost == D[i - 1][j - 1] + substitution_cost: (i, j) = (i - 1, j - 1) edits.append({'type': 'Substitution', 'i': i, 'j': j}) elif i != 0 and current_cost == D[i - 1][j] + deletion_cost: (i, j) = (i - 1, j) edits.append({'type': 'Deletion', 'i': i, 'j': j}) elif j != 0 and current_cost == D[i][j - 1] + insertion_cost: (i, j) = (i, j - 1) edits.append({'type': 'Insertion', 'i': i, 'j': j}) edits.reverse() return edits def __edit_distance(self): """ Calculates every cell of distance matrix """ rows = len(self.source) + 1 cols = len(self.target) + 1 (insertion_cost, deletion_cost, substitution_cost) = self.costs d = [[0 for i in range(cols)] for j in range(rows)] for i in range(rows): D[i][0] = i * deletion_cost for j in range(cols): D[0][j] = j * insertion_cost for i in range(1, rows): for j in range(1, cols): if self.source[i - 1] == self.target[j - 1]: D[i][j] = D[i - 1][j - 1] else: insertion = D[i][j - 1] + insertion_cost deletion = D[i - 1][j] + deletion_cost substitution = D[i - 1][j - 1] + substitution_cost D[i][j] = min(insertion, deletion, substitution) return D def distance(self): """ Returns bottom-rightmost entry of distance matrix """ return self.D[-1][-1] def edit_ops(self): """ Returns list of edit operations """ return self.edits def print_distance_matrix(self): """ Pretty prints the distance matrix """ rows = len(self.source) + 1 cols = len(self.target) + 1 first_row = '--' + self.target first_column = '-' + self.source for i in first_row: print('%2c ' % i, end='') print() for i in range(0, rows): print('%2c ' % first_column[i], end='') for j in range(0, cols): print('%2d ' % self.D[i][j], end='') print() def print_edit_ops(self): """ Pretty prints the edit operations """ print('%-13s %2s %2s' % ('Type', 'i', 'j')) print('-' * 20) for op in self.edits: print('%-13s %2d %2d\n' % (op['type'], op['i'], op['j']), end='')
# encoding: utf-8 # module apt_inst # from /usr/lib/python3/dist-packages/apt_inst.cpython-35m-x86_64-linux-gnu.so # by generator 1.145 """ Functions for working with ar/tar archives and .deb packages. This module provides useful classes and functions to work with archives, modelled after the 'TarFile' class in the 'tarfile' module. """ # no imports # no functions # classes class ArArchive(object): """ ArArchive(file: str/int/file) Represent an archive in the 4.4 BSD ar format, which is used for e.g. deb packages. The parameter 'file' may be a string specifying the path of a file, or a file-like object providing the fileno() method. It may also be an int specifying a file descriptor (returned by e.g. os.open()). The recommended way of using it is to pass in the path to the file. """ def extract(self, name, target=None): # real signature unknown; restored from __doc__ """ extract(name: str[, target: str]) -> bool Extract the member given by 'name' into the directory given by 'target'. If the extraction fails, raise OSError. In case of success, return True if the file owner could be set or False if this was not possible. If the requested member does not exist, raise LookupError. """ return False def extractall(self, target=None): # real signature unknown; restored from __doc__ """ extractall([target: str]) -> bool Extract all archive contents into the directory given by 'target'. If the extraction fails, raise an error. Otherwise, return True if the owner could be set or False if the owner could not be changed. """ return False def extractdata(self, name): # real signature unknown; restored from __doc__ """ extractdata(name: str) -> bytes Return the contents of the member, as a bytes object. Raise LookupError if there is no ArMember with the given name. """ return b"" def getmember(self, name): # real signature unknown; restored from __doc__ """ getmember(name: str) -> ArMember Return an ArMember object for the member given by 'name'. Raise LookupError if there is no ArMember with the given name. """ return ArMember def getmembers(self): # real signature unknown; restored from __doc__ """ getmembers() -> list Return a list of all members in the archive. """ return [] def getnames(self): # real signature unknown; restored from __doc__ """ getnames() -> list Return a list of the names of all members in the archive. """ return [] def gettar(self, name, comp): # real signature unknown; restored from __doc__ """ gettar(name: str, comp: str) -> TarFile Return a TarFile object for the member given by 'name' which will be decompressed using the compression algorithm given by 'comp'. This is almost equal to: member = arfile.getmember(name) tarfile = TarFile(file, member.start, member.size, 'gzip')' It just opens a new TarFile on the given position in the stream. """ return TarFile def __contains__(self, *args, **kwargs): # real signature unknown """ Return key in self. """ pass def __getitem__(self, *args, **kwargs): # real signature unknown """ Return self[key]. """ pass def __init__(self, file, *args, **kwargs): # real signature unknown; NOTE: unreliably restored from __doc__ pass def __iter__(self, *args, **kwargs): # real signature unknown """ Implement iter(self). """ pass @staticmethod # known case of __new__ def __new__(*args, **kwargs): # real signature unknown """ Create and return a new object. See help(type) for accurate signature. """ pass class ArMember(object): """ Represent a single file within an AR archive. For Debian packages this can be e.g. control.tar.gz. This class provides information about this file, such as the mode and size. """ def __init__(self, *args, **kwargs): # real signature unknown pass def __repr__(self, *args, **kwargs): # real signature unknown """ Return repr(self). """ pass gid = property(lambda self: object(), lambda self, v: None, lambda self: None) # default """The group id of the owner.""" mode = property(lambda self: object(), lambda self, v: None, lambda self: None) # default """The mode of the file.""" mtime = property(lambda self: object(), lambda self, v: None, lambda self: None) # default """Last time of modification.""" name = property(lambda self: object(), lambda self, v: None, lambda self: None) # default """The name of the file.""" size = property(lambda self: object(), lambda self, v: None, lambda self: None) # default """The size of the files.""" start = property(lambda self: object(), lambda self, v: None, lambda self: None) # default """The offset in the archive where the file starts.""" uid = property(lambda self: object(), lambda self, v: None, lambda self: None) # default """The user ID of the owner.""" class DebFile(ArArchive): """ DebFile(file: str/int/file) A DebFile object represents a file in the .deb package format. The parameter 'file' may be a string specifying the path of a file, or a file-like object providing the fileno() method. It may also be an int specifying a file descriptor (returned by e.g. os.open()). The recommended way of using it is to pass in the path to the file. It differs from ArArchive by providing the members 'control', 'data' and 'version' for accessing the control.tar.gz, data.tar.$compression (all apt compression methods are supported), and debian-binary members in the archive. """ def __init__(self, file, *args, **kwargs): # real signature unknown; NOTE: unreliably restored from __doc__ pass @staticmethod # known case of __new__ def __new__(*args, **kwargs): # real signature unknown """ Create and return a new object. See help(type) for accurate signature. """ pass control = property(lambda self: object(), lambda self, v: None, lambda self: None) # default """The TarFile object associated with the control.tar.gz member.""" data = property(lambda self: object(), lambda self, v: None, lambda self: None) # default """The TarFile object associated with the data.tar.$compression member. All apt compression methods are supported. """ debian_binary = property(lambda self: object(), lambda self, v: None, lambda self: None) # default """The package version, as contained in debian-binary.""" class TarFile(object): """ TarFile(file: str/int/file[, min: int, max: int, comp: str]) The parameter 'file' may be a string specifying the path of a file, or a file-like object providing the fileno() method. It may also be an int specifying a file descriptor (returned by e.g. os.open()). The parameter 'min' describes the offset in the file where the archive begins and the parameter 'max' is the size of the archive. The compression of the archive is set by the parameter 'comp'. It can be set to any program supporting the -d switch, the default being gzip. """ def extractall(self, rootdir=None): # real signature unknown; restored from __doc__ """ extractall([rootdir: str]) -> True Extract the archive in the current directory. The argument 'rootdir' can be used to change the target directory. """ return False def extractdata(self, member): # real signature unknown; restored from __doc__ """ extractdata(member: str) -> bytes Return the contents of the member, as a bytes object. Raise LookupError if there is no member with the given name. """ return b"" def go(self, callback, member=None): # real signature unknown; restored from __doc__ """ go(callback: callable[, member: str]) -> True Go through the archive and call the callable 'callback' for each member with 2 arguments. The first argument is the TarMember and the second one is the data, as bytes. The optional parameter 'member' can be used to specify the member for which to call the callback. If not specified, it will be called for all members. If specified and not found, LookupError will be raised. """ return False def __init__(self, file, *args, **kwargs): # real signature unknown; NOTE: unreliably restored from __doc__ pass @staticmethod # known case of __new__ def __new__(*args, **kwargs): # real signature unknown """ Create and return a new object. See help(type) for accurate signature. """ pass def __repr__(self, *args, **kwargs): # real signature unknown """ Return repr(self). """ pass class TarMember(object): """ Represent a single member of a 'tar' archive. This class, which has been modelled after 'tarfile.TarInfo', represents information about a given member in an archive. """ def isblk(self, *args, **kwargs): # real signature unknown """ Determine whether the member is a block device. """ pass def ischr(self, *args, **kwargs): # real signature unknown """ Determine whether the member is a character device. """ pass def isdev(self, *args, **kwargs): # real signature unknown """ Determine whether the member is a device (block, character or FIFO). """ pass def isdir(self, *args, **kwargs): # real signature unknown """ Determine whether the member is a directory. """ pass def isfifo(self, *args, **kwargs): # real signature unknown """ Determine whether the member is a FIFO. """ pass def isfile(self, *args, **kwargs): # real signature unknown """ Determine whether the member is a regular file. """ pass def islnk(self, *args, **kwargs): # real signature unknown """ Determine whether the member is a hardlink. """ pass def isreg(self, *args, **kwargs): # real signature unknown """ Determine whether the member is a regular file, same as isfile(). """ pass def issym(self, *args, **kwargs): # real signature unknown """ Determine whether the member is a symbolic link. """ pass def __init__(self, *args, **kwargs): # real signature unknown pass def __repr__(self, *args, **kwargs): # real signature unknown """ Return repr(self). """ pass gid = property(lambda self: object(), lambda self, v: None, lambda self: None) # default """The owner's group ID.""" linkname = property(lambda self: object(), lambda self, v: None, lambda self: None) # default """The target of the link.""" major = property(lambda self: object(), lambda self, v: None, lambda self: None) # default """The major ID of the device.""" minor = property(lambda self: object(), lambda self, v: None, lambda self: None) # default """The minor ID of the device.""" mode = property(lambda self: object(), lambda self, v: None, lambda self: None) # default """The mode (permissions).""" mtime = property(lambda self: object(), lambda self, v: None, lambda self: None) # default """Last time of modification.""" name = property(lambda self: object(), lambda self, v: None, lambda self: None) # default """The name of the file.""" size = property(lambda self: object(), lambda self, v: None, lambda self: None) # default """The size of the file.""" uid = property(lambda self: object(), lambda self, v: None, lambda self: None) # default """The owner's user ID.""" # variables with complex values __loader__ = None # (!) real value is '' __spec__ = None # (!) real value is ''
""" Functions for working with ar/tar archives and .deb packages. This module provides useful classes and functions to work with archives, modelled after the 'TarFile' class in the 'tarfile' module. """ class Ararchive(object): """ ArArchive(file: str/int/file) Represent an archive in the 4.4 BSD ar format, which is used for e.g. deb packages. The parameter 'file' may be a string specifying the path of a file, or a file-like object providing the fileno() method. It may also be an int specifying a file descriptor (returned by e.g. os.open()). The recommended way of using it is to pass in the path to the file. """ def extract(self, name, target=None): """ extract(name: str[, target: str]) -> bool Extract the member given by 'name' into the directory given by 'target'. If the extraction fails, raise OSError. In case of success, return True if the file owner could be set or False if this was not possible. If the requested member does not exist, raise LookupError. """ return False def extractall(self, target=None): """ extractall([target: str]) -> bool Extract all archive contents into the directory given by 'target'. If the extraction fails, raise an error. Otherwise, return True if the owner could be set or False if the owner could not be changed. """ return False def extractdata(self, name): """ extractdata(name: str) -> bytes Return the contents of the member, as a bytes object. Raise LookupError if there is no ArMember with the given name. """ return b'' def getmember(self, name): """ getmember(name: str) -> ArMember Return an ArMember object for the member given by 'name'. Raise LookupError if there is no ArMember with the given name. """ return ArMember def getmembers(self): """ getmembers() -> list Return a list of all members in the archive. """ return [] def getnames(self): """ getnames() -> list Return a list of the names of all members in the archive. """ return [] def gettar(self, name, comp): """ gettar(name: str, comp: str) -> TarFile Return a TarFile object for the member given by 'name' which will be decompressed using the compression algorithm given by 'comp'. This is almost equal to: member = arfile.getmember(name) tarfile = TarFile(file, member.start, member.size, 'gzip')' It just opens a new TarFile on the given position in the stream. """ return TarFile def __contains__(self, *args, **kwargs): """ Return key in self. """ pass def __getitem__(self, *args, **kwargs): """ Return self[key]. """ pass def __init__(self, file, *args, **kwargs): pass def __iter__(self, *args, **kwargs): """ Implement iter(self). """ pass @staticmethod def __new__(*args, **kwargs): """ Create and return a new object. See help(type) for accurate signature. """ pass class Armember(object): """ Represent a single file within an AR archive. For Debian packages this can be e.g. control.tar.gz. This class provides information about this file, such as the mode and size. """ def __init__(self, *args, **kwargs): pass def __repr__(self, *args, **kwargs): """ Return repr(self). """ pass gid = property(lambda self: object(), lambda self, v: None, lambda self: None) 'The group id of the owner.' mode = property(lambda self: object(), lambda self, v: None, lambda self: None) 'The mode of the file.' mtime = property(lambda self: object(), lambda self, v: None, lambda self: None) 'Last time of modification.' name = property(lambda self: object(), lambda self, v: None, lambda self: None) 'The name of the file.' size = property(lambda self: object(), lambda self, v: None, lambda self: None) 'The size of the files.' start = property(lambda self: object(), lambda self, v: None, lambda self: None) 'The offset in the archive where the file starts.' uid = property(lambda self: object(), lambda self, v: None, lambda self: None) 'The user ID of the owner.' class Debfile(ArArchive): """ DebFile(file: str/int/file) A DebFile object represents a file in the .deb package format. The parameter 'file' may be a string specifying the path of a file, or a file-like object providing the fileno() method. It may also be an int specifying a file descriptor (returned by e.g. os.open()). The recommended way of using it is to pass in the path to the file. It differs from ArArchive by providing the members 'control', 'data' and 'version' for accessing the control.tar.gz, data.tar.$compression (all apt compression methods are supported), and debian-binary members in the archive. """ def __init__(self, file, *args, **kwargs): pass @staticmethod def __new__(*args, **kwargs): """ Create and return a new object. See help(type) for accurate signature. """ pass control = property(lambda self: object(), lambda self, v: None, lambda self: None) 'The TarFile object associated with the control.tar.gz member.' data = property(lambda self: object(), lambda self, v: None, lambda self: None) 'The TarFile object associated with the data.tar.$compression member. All apt compression methods are supported. ' debian_binary = property(lambda self: object(), lambda self, v: None, lambda self: None) 'The package version, as contained in debian-binary.' class Tarfile(object): """ TarFile(file: str/int/file[, min: int, max: int, comp: str]) The parameter 'file' may be a string specifying the path of a file, or a file-like object providing the fileno() method. It may also be an int specifying a file descriptor (returned by e.g. os.open()). The parameter 'min' describes the offset in the file where the archive begins and the parameter 'max' is the size of the archive. The compression of the archive is set by the parameter 'comp'. It can be set to any program supporting the -d switch, the default being gzip. """ def extractall(self, rootdir=None): """ extractall([rootdir: str]) -> True Extract the archive in the current directory. The argument 'rootdir' can be used to change the target directory. """ return False def extractdata(self, member): """ extractdata(member: str) -> bytes Return the contents of the member, as a bytes object. Raise LookupError if there is no member with the given name. """ return b'' def go(self, callback, member=None): """ go(callback: callable[, member: str]) -> True Go through the archive and call the callable 'callback' for each member with 2 arguments. The first argument is the TarMember and the second one is the data, as bytes. The optional parameter 'member' can be used to specify the member for which to call the callback. If not specified, it will be called for all members. If specified and not found, LookupError will be raised. """ return False def __init__(self, file, *args, **kwargs): pass @staticmethod def __new__(*args, **kwargs): """ Create and return a new object. See help(type) for accurate signature. """ pass def __repr__(self, *args, **kwargs): """ Return repr(self). """ pass class Tarmember(object): """ Represent a single member of a 'tar' archive. This class, which has been modelled after 'tarfile.TarInfo', represents information about a given member in an archive. """ def isblk(self, *args, **kwargs): """ Determine whether the member is a block device. """ pass def ischr(self, *args, **kwargs): """ Determine whether the member is a character device. """ pass def isdev(self, *args, **kwargs): """ Determine whether the member is a device (block, character or FIFO). """ pass def isdir(self, *args, **kwargs): """ Determine whether the member is a directory. """ pass def isfifo(self, *args, **kwargs): """ Determine whether the member is a FIFO. """ pass def isfile(self, *args, **kwargs): """ Determine whether the member is a regular file. """ pass def islnk(self, *args, **kwargs): """ Determine whether the member is a hardlink. """ pass def isreg(self, *args, **kwargs): """ Determine whether the member is a regular file, same as isfile(). """ pass def issym(self, *args, **kwargs): """ Determine whether the member is a symbolic link. """ pass def __init__(self, *args, **kwargs): pass def __repr__(self, *args, **kwargs): """ Return repr(self). """ pass gid = property(lambda self: object(), lambda self, v: None, lambda self: None) "The owner's group ID." linkname = property(lambda self: object(), lambda self, v: None, lambda self: None) 'The target of the link.' major = property(lambda self: object(), lambda self, v: None, lambda self: None) 'The major ID of the device.' minor = property(lambda self: object(), lambda self, v: None, lambda self: None) 'The minor ID of the device.' mode = property(lambda self: object(), lambda self, v: None, lambda self: None) 'The mode (permissions).' mtime = property(lambda self: object(), lambda self, v: None, lambda self: None) 'Last time of modification.' name = property(lambda self: object(), lambda self, v: None, lambda self: None) 'The name of the file.' size = property(lambda self: object(), lambda self, v: None, lambda self: None) 'The size of the file.' uid = property(lambda self: object(), lambda self, v: None, lambda self: None) "The owner's user ID." __loader__ = None __spec__ = None
# Support code class Node: def __init__(self, val: int = 0, left: 'Node' = None, right: 'Node' = None, next: 'Node' = None): self.val = val self.left = left self.right = right self.next = next # Problem code def connect(root): if not root: return None connect_helper(root.left, root.right) return root def connect_helper(node1, node2): if not node1 or not node2: return node1.next = node2 connect_helper(node1.left, node1.right) connect_helper(node1.right, node2.left) connect_helper(node2.left, node2.right)
class Node: def __init__(self, val: int=0, left: 'Node'=None, right: 'Node'=None, next: 'Node'=None): self.val = val self.left = left self.right = right self.next = next def connect(root): if not root: return None connect_helper(root.left, root.right) return root def connect_helper(node1, node2): if not node1 or not node2: return node1.next = node2 connect_helper(node1.left, node1.right) connect_helper(node1.right, node2.left) connect_helper(node2.left, node2.right)
def parse(): with open('day09/input.txt') as f: lines = f.readlines() arr = [] for line in lines: a = [] for c in line.strip(): a.append(int(c)) arr.append(a) return arr arr = parse() h = len(arr) w = len(arr[0]) def wave(xx: int, yy: int) -> int: n = 0 q = [ [yy, xx] ] while len(q) > 0: y, x = q.pop(0) if arr[y][x] == -1: continue arr[y][x] = -1 n += 1 if x > 0 and arr[y][x-1] != 9 and arr[y][x-1] != -1: q.append([y, x-1]) if y > 0 and arr[y-1][x] != 9 and arr[y-1][x] != -1: q.append([y-1, x]) if x < w-1 and arr[y][x+1] != 9 and arr[y][x+1] != -1: q.append([y, x+1]) if y < h-1 and arr[y+1][x] != 9 and arr[y+1][x] != -1: q.append([y+1, x]) return n basins = [] for y in range(h): for x in range(w): if arr[y][x] != -1 and arr[y][x] != 9: size = wave(x, y) basins.append(size) basins = sorted(basins, reverse=True) product = 1 for i in range(3): product *= basins[i] print(product)
def parse(): with open('day09/input.txt') as f: lines = f.readlines() arr = [] for line in lines: a = [] for c in line.strip(): a.append(int(c)) arr.append(a) return arr arr = parse() h = len(arr) w = len(arr[0]) def wave(xx: int, yy: int) -> int: n = 0 q = [[yy, xx]] while len(q) > 0: (y, x) = q.pop(0) if arr[y][x] == -1: continue arr[y][x] = -1 n += 1 if x > 0 and arr[y][x - 1] != 9 and (arr[y][x - 1] != -1): q.append([y, x - 1]) if y > 0 and arr[y - 1][x] != 9 and (arr[y - 1][x] != -1): q.append([y - 1, x]) if x < w - 1 and arr[y][x + 1] != 9 and (arr[y][x + 1] != -1): q.append([y, x + 1]) if y < h - 1 and arr[y + 1][x] != 9 and (arr[y + 1][x] != -1): q.append([y + 1, x]) return n basins = [] for y in range(h): for x in range(w): if arr[y][x] != -1 and arr[y][x] != 9: size = wave(x, y) basins.append(size) basins = sorted(basins, reverse=True) product = 1 for i in range(3): product *= basins[i] print(product)
n = float(input('massa da substancia em gramas: ')) meiavida = n tempo = 0 while meiavida >= 0.05: meiavida *= 0.5 tempo +=50 print('para q a substancia de massa {}g atinja 0.05g , levou {:.0f}s'.format(n,tempo))
n = float(input('massa da substancia em gramas: ')) meiavida = n tempo = 0 while meiavida >= 0.05: meiavida *= 0.5 tempo += 50 print('para q a substancia de massa {}g atinja 0.05g , levou {:.0f}s'.format(n, tempo))
# # PySNMP MIB module Juniper-DISMAN-EVENT-MIB (http://snmplabs.com/pysmi) # ASN.1 source file:///Users/davwang4/Dev/mibs.snmplabs.com/asn1/Juniper-DISMAN-EVENT-MIB # Produced by pysmi-0.3.4 at Mon Apr 29 19:51:24 2019 # On host DAVWANG4-M-1475 platform Darwin version 18.5.0 by user davwang4 # Using Python version 3.7.3 (default, Mar 27 2019, 09:23:15) # ObjectIdentifier, OctetString, Integer = mibBuilder.importSymbols("ASN1", "ObjectIdentifier", "OctetString", "Integer") NamedValues, = mibBuilder.importSymbols("ASN1-ENUMERATION", "NamedValues") ValueRangeConstraint, ConstraintsIntersection, ConstraintsUnion, ValueSizeConstraint, SingleValueConstraint = mibBuilder.importSymbols("ASN1-REFINEMENT", "ValueRangeConstraint", "ConstraintsIntersection", "ConstraintsUnion", "ValueSizeConstraint", "SingleValueConstraint") mteTriggerEntry, = mibBuilder.importSymbols("DISMAN-EVENT-MIB", "mteTriggerEntry") juniMibs, = mibBuilder.importSymbols("Juniper-MIBs", "juniMibs") NotificationGroup, ModuleCompliance, ObjectGroup = mibBuilder.importSymbols("SNMPv2-CONF", "NotificationGroup", "ModuleCompliance", "ObjectGroup") Gauge32, Unsigned32, ModuleIdentity, iso, Counter32, TimeTicks, ObjectIdentity, Integer32, MibIdentifier, Counter64, IpAddress, Bits, MibScalar, MibTable, MibTableRow, MibTableColumn, NotificationType = mibBuilder.importSymbols("SNMPv2-SMI", "Gauge32", "Unsigned32", "ModuleIdentity", "iso", "Counter32", "TimeTicks", "ObjectIdentity", "Integer32", "MibIdentifier", "Counter64", "IpAddress", "Bits", "MibScalar", "MibTable", "MibTableRow", "MibTableColumn", "NotificationType") TextualConvention, DisplayString = mibBuilder.importSymbols("SNMPv2-TC", "TextualConvention", "DisplayString") juniDismanEventMIB = ModuleIdentity((1, 3, 6, 1, 4, 1, 4874, 2, 2, 66)) juniDismanEventMIB.setRevisions(('2003-10-30 15:35',)) if mibBuilder.loadTexts: juniDismanEventMIB.setLastUpdated('200310301535Z') if mibBuilder.loadTexts: juniDismanEventMIB.setOrganization('Juniper Networks, Inc.') juniDismanEventMIBObjects = MibIdentifier((1, 3, 6, 1, 4, 1, 4874, 2, 2, 66, 1)) juniMteTrigger = MibIdentifier((1, 3, 6, 1, 4, 1, 4874, 2, 2, 66, 1, 1)) juniMteTriggerTable = MibTable((1, 3, 6, 1, 4, 1, 4874, 2, 2, 66, 1, 1, 1), ) if mibBuilder.loadTexts: juniMteTriggerTable.setStatus('current') juniMteTriggerEntry = MibTableRow((1, 3, 6, 1, 4, 1, 4874, 2, 2, 66, 1, 1, 1, 1), ) mteTriggerEntry.registerAugmentions(("Juniper-DISMAN-EVENT-MIB", "juniMteTriggerEntry")) juniMteTriggerEntry.setIndexNames(*mteTriggerEntry.getIndexNames()) if mibBuilder.loadTexts: juniMteTriggerEntry.setStatus('current') juniMteTriggerContextNameLimit = MibTableColumn((1, 3, 6, 1, 4, 1, 4874, 2, 2, 66, 1, 1, 1, 1, 2), Unsigned32()).setMaxAccess("readcreate") if mibBuilder.loadTexts: juniMteTriggerContextNameLimit.setStatus('current') juniDismanEventMIBNotificationPrefix = MibIdentifier((1, 3, 6, 1, 4, 1, 4874, 2, 2, 66, 2)) juniDismanEventMIBNotificationObjects = MibIdentifier((1, 3, 6, 1, 4, 1, 4874, 2, 2, 66, 2, 1)) juniMteExistenceTestResult = MibScalar((1, 3, 6, 1, 4, 1, 4874, 2, 2, 66, 2, 1, 1), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(0, 1, 2))).clone(namedValues=NamedValues(("present", 0), ("absent", 1), ("changed", 2)))).setMaxAccess("accessiblefornotify") if mibBuilder.loadTexts: juniMteExistenceTestResult.setStatus('current') juniDismanEventConformance = MibIdentifier((1, 3, 6, 1, 4, 1, 4874, 2, 2, 66, 3)) juniDismanEventCompliances = MibIdentifier((1, 3, 6, 1, 4, 1, 4874, 2, 2, 66, 3, 1)) juniDismanEventGroups = MibIdentifier((1, 3, 6, 1, 4, 1, 4874, 2, 2, 66, 3, 2)) juniDismanEventCompliance = ModuleCompliance((1, 3, 6, 1, 4, 1, 4874, 2, 2, 66, 3, 1, 1)).setObjects(("Juniper-DISMAN-EVENT-MIB", "juniMteTriggerTableGroup")) if getattr(mibBuilder, 'version', (0, 0, 0)) > (4, 4, 0): juniDismanEventCompliance = juniDismanEventCompliance.setStatus('current') juniMteTriggerTableGroup = ObjectGroup((1, 3, 6, 1, 4, 1, 4874, 2, 2, 66, 3, 2, 1)).setObjects(("Juniper-DISMAN-EVENT-MIB", "juniMteTriggerContextNameLimit"), ("Juniper-DISMAN-EVENT-MIB", "juniMteExistenceTestResult")) if getattr(mibBuilder, 'version', (0, 0, 0)) > (4, 4, 0): juniMteTriggerTableGroup = juniMteTriggerTableGroup.setStatus('current') mibBuilder.exportSymbols("Juniper-DISMAN-EVENT-MIB", juniMteTriggerTable=juniMteTriggerTable, juniDismanEventMIBNotificationPrefix=juniDismanEventMIBNotificationPrefix, juniMteTrigger=juniMteTrigger, juniDismanEventGroups=juniDismanEventGroups, juniDismanEventCompliances=juniDismanEventCompliances, juniDismanEventCompliance=juniDismanEventCompliance, juniDismanEventMIBNotificationObjects=juniDismanEventMIBNotificationObjects, juniDismanEventConformance=juniDismanEventConformance, juniMteTriggerEntry=juniMteTriggerEntry, juniDismanEventMIB=juniDismanEventMIB, juniMteTriggerContextNameLimit=juniMteTriggerContextNameLimit, PYSNMP_MODULE_ID=juniDismanEventMIB, juniDismanEventMIBObjects=juniDismanEventMIBObjects, juniMteExistenceTestResult=juniMteExistenceTestResult, juniMteTriggerTableGroup=juniMteTriggerTableGroup)
(object_identifier, octet_string, integer) = mibBuilder.importSymbols('ASN1', 'ObjectIdentifier', 'OctetString', 'Integer') (named_values,) = mibBuilder.importSymbols('ASN1-ENUMERATION', 'NamedValues') (value_range_constraint, constraints_intersection, constraints_union, value_size_constraint, single_value_constraint) = mibBuilder.importSymbols('ASN1-REFINEMENT', 'ValueRangeConstraint', 'ConstraintsIntersection', 'ConstraintsUnion', 'ValueSizeConstraint', 'SingleValueConstraint') (mte_trigger_entry,) = mibBuilder.importSymbols('DISMAN-EVENT-MIB', 'mteTriggerEntry') (juni_mibs,) = mibBuilder.importSymbols('Juniper-MIBs', 'juniMibs') (notification_group, module_compliance, object_group) = mibBuilder.importSymbols('SNMPv2-CONF', 'NotificationGroup', 'ModuleCompliance', 'ObjectGroup') (gauge32, unsigned32, module_identity, iso, counter32, time_ticks, object_identity, integer32, mib_identifier, counter64, ip_address, bits, mib_scalar, mib_table, mib_table_row, mib_table_column, notification_type) = mibBuilder.importSymbols('SNMPv2-SMI', 'Gauge32', 'Unsigned32', 'ModuleIdentity', 'iso', 'Counter32', 'TimeTicks', 'ObjectIdentity', 'Integer32', 'MibIdentifier', 'Counter64', 'IpAddress', 'Bits', 'MibScalar', 'MibTable', 'MibTableRow', 'MibTableColumn', 'NotificationType') (textual_convention, display_string) = mibBuilder.importSymbols('SNMPv2-TC', 'TextualConvention', 'DisplayString') juni_disman_event_mib = module_identity((1, 3, 6, 1, 4, 1, 4874, 2, 2, 66)) juniDismanEventMIB.setRevisions(('2003-10-30 15:35',)) if mibBuilder.loadTexts: juniDismanEventMIB.setLastUpdated('200310301535Z') if mibBuilder.loadTexts: juniDismanEventMIB.setOrganization('Juniper Networks, Inc.') juni_disman_event_mib_objects = mib_identifier((1, 3, 6, 1, 4, 1, 4874, 2, 2, 66, 1)) juni_mte_trigger = mib_identifier((1, 3, 6, 1, 4, 1, 4874, 2, 2, 66, 1, 1)) juni_mte_trigger_table = mib_table((1, 3, 6, 1, 4, 1, 4874, 2, 2, 66, 1, 1, 1)) if mibBuilder.loadTexts: juniMteTriggerTable.setStatus('current') juni_mte_trigger_entry = mib_table_row((1, 3, 6, 1, 4, 1, 4874, 2, 2, 66, 1, 1, 1, 1)) mteTriggerEntry.registerAugmentions(('Juniper-DISMAN-EVENT-MIB', 'juniMteTriggerEntry')) juniMteTriggerEntry.setIndexNames(*mteTriggerEntry.getIndexNames()) if mibBuilder.loadTexts: juniMteTriggerEntry.setStatus('current') juni_mte_trigger_context_name_limit = mib_table_column((1, 3, 6, 1, 4, 1, 4874, 2, 2, 66, 1, 1, 1, 1, 2), unsigned32()).setMaxAccess('readcreate') if mibBuilder.loadTexts: juniMteTriggerContextNameLimit.setStatus('current') juni_disman_event_mib_notification_prefix = mib_identifier((1, 3, 6, 1, 4, 1, 4874, 2, 2, 66, 2)) juni_disman_event_mib_notification_objects = mib_identifier((1, 3, 6, 1, 4, 1, 4874, 2, 2, 66, 2, 1)) juni_mte_existence_test_result = mib_scalar((1, 3, 6, 1, 4, 1, 4874, 2, 2, 66, 2, 1, 1), integer32().subtype(subtypeSpec=constraints_union(single_value_constraint(0, 1, 2))).clone(namedValues=named_values(('present', 0), ('absent', 1), ('changed', 2)))).setMaxAccess('accessiblefornotify') if mibBuilder.loadTexts: juniMteExistenceTestResult.setStatus('current') juni_disman_event_conformance = mib_identifier((1, 3, 6, 1, 4, 1, 4874, 2, 2, 66, 3)) juni_disman_event_compliances = mib_identifier((1, 3, 6, 1, 4, 1, 4874, 2, 2, 66, 3, 1)) juni_disman_event_groups = mib_identifier((1, 3, 6, 1, 4, 1, 4874, 2, 2, 66, 3, 2)) juni_disman_event_compliance = module_compliance((1, 3, 6, 1, 4, 1, 4874, 2, 2, 66, 3, 1, 1)).setObjects(('Juniper-DISMAN-EVENT-MIB', 'juniMteTriggerTableGroup')) if getattr(mibBuilder, 'version', (0, 0, 0)) > (4, 4, 0): juni_disman_event_compliance = juniDismanEventCompliance.setStatus('current') juni_mte_trigger_table_group = object_group((1, 3, 6, 1, 4, 1, 4874, 2, 2, 66, 3, 2, 1)).setObjects(('Juniper-DISMAN-EVENT-MIB', 'juniMteTriggerContextNameLimit'), ('Juniper-DISMAN-EVENT-MIB', 'juniMteExistenceTestResult')) if getattr(mibBuilder, 'version', (0, 0, 0)) > (4, 4, 0): juni_mte_trigger_table_group = juniMteTriggerTableGroup.setStatus('current') mibBuilder.exportSymbols('Juniper-DISMAN-EVENT-MIB', juniMteTriggerTable=juniMteTriggerTable, juniDismanEventMIBNotificationPrefix=juniDismanEventMIBNotificationPrefix, juniMteTrigger=juniMteTrigger, juniDismanEventGroups=juniDismanEventGroups, juniDismanEventCompliances=juniDismanEventCompliances, juniDismanEventCompliance=juniDismanEventCompliance, juniDismanEventMIBNotificationObjects=juniDismanEventMIBNotificationObjects, juniDismanEventConformance=juniDismanEventConformance, juniMteTriggerEntry=juniMteTriggerEntry, juniDismanEventMIB=juniDismanEventMIB, juniMteTriggerContextNameLimit=juniMteTriggerContextNameLimit, PYSNMP_MODULE_ID=juniDismanEventMIB, juniDismanEventMIBObjects=juniDismanEventMIBObjects, juniMteExistenceTestResult=juniMteExistenceTestResult, juniMteTriggerTableGroup=juniMteTriggerTableGroup)
class Tape(object): blank_symbol = " " def __init__(self, tape_string=""): self.__tape = dict((enumerate(tape_string))) # last line is equivalent to the following three lines: # self.__tape = {} # for i in range(len(tape_string)): # self.__tape[i] = input[i] def __str__(self): s = "" min_used_index = min(self.__tape.keys()) max_used_index = max(self.__tape.keys()) for i in range(min_used_index, max_used_index): s += self.__tape[i] return s def __getitem__(self, index): if index in self.__tape: return self.__tape[index] else: return Tape.blank_symbol def __setitem__(self, pos, char): self.__tape[pos] = char class TuringMachine(object): def __init__(self, tape="", blank_symbol=" ", initial_state="", final_states=None, transition_function=None): self.__tape = Tape(tape) self.__head_position = 0 self.__blank_symbol = blank_symbol self.__current_state = initial_state if transition_function == None: self.__transition_function = {} else: self.__transition_function = transition_function if final_states == None: self.__final_states = set() else: self.__final_states = set(final_states) def get_tape(self): return str(self.__tape) def step(self): char_under_head = self.__tape[self.__head_position] x = (self.__current_state, char_under_head) if x in self.__transition_function: y = self.__transition_function[x] self.__tape[self.__head_position] = y[1] if y[2] == "R": self.__head_position += 1 elif y[2] == "L": self.__head_position -= 1 self.__current_state = y[0] def final(self): if self.__current_state in self.__final_states: return True else: return False
class Tape(object): blank_symbol = ' ' def __init__(self, tape_string=''): self.__tape = dict(enumerate(tape_string)) def __str__(self): s = '' min_used_index = min(self.__tape.keys()) max_used_index = max(self.__tape.keys()) for i in range(min_used_index, max_used_index): s += self.__tape[i] return s def __getitem__(self, index): if index in self.__tape: return self.__tape[index] else: return Tape.blank_symbol def __setitem__(self, pos, char): self.__tape[pos] = char class Turingmachine(object): def __init__(self, tape='', blank_symbol=' ', initial_state='', final_states=None, transition_function=None): self.__tape = tape(tape) self.__head_position = 0 self.__blank_symbol = blank_symbol self.__current_state = initial_state if transition_function == None: self.__transition_function = {} else: self.__transition_function = transition_function if final_states == None: self.__final_states = set() else: self.__final_states = set(final_states) def get_tape(self): return str(self.__tape) def step(self): char_under_head = self.__tape[self.__head_position] x = (self.__current_state, char_under_head) if x in self.__transition_function: y = self.__transition_function[x] self.__tape[self.__head_position] = y[1] if y[2] == 'R': self.__head_position += 1 elif y[2] == 'L': self.__head_position -= 1 self.__current_state = y[0] def final(self): if self.__current_state in self.__final_states: return True else: return False
sunny = [ " \\ | / ", " - O - ", " / | \\ " ] partial_clouds = [ " \\ /( ) ", " - O( )", " / ( ) ", ] clouds = [ " ( )()_ ", " ( ) ", " ( )() " ] night = [ " . * ", " * . O ", " . . * . " ] drizzle = [ " ' ' '", " ' ' ' ", "' ' '" ] rain = [ " ' '' ' ' ", " '' ' ' ' ", " ' ' '' ' " ] thunderstorm = [ " ''_/ _/' ", " ' / _/' '", " /_/'' '' " ] chaos = [ " c__ ''' '", " ' '' c___", " c__ ' 'c_" ] snow = [ " * '* ' * ", " '* ' * ' ", " *' * ' * " ] fog = [ " -- _ -- ", " -__-- - ", " - _--__ " ] wind = [ " c__ -- _ ", " -- _-c__ ", " c --___c " ]
sunny = [' \\ | / ', ' - O - ', ' / | \\ '] partial_clouds = [' \\ /( ) ', ' - O( )', ' / ( ) '] clouds = [' ( )()_ ', ' ( ) ', ' ( )() '] night = [' . * ', ' * . O ', ' . . * . '] drizzle = [" ' ' '", " ' ' ' ", "' ' '"] rain = [" ' '' ' ' ", " '' ' ' ' ", " ' ' '' ' "] thunderstorm = [" ''_/ _/' ", " ' / _/' '", " /_/'' '' "] chaos = [" c__ ''' '", " ' '' c___", " c__ ' 'c_"] snow = [" * '* ' * ", " '* ' * ' ", " *' * ' * "] fog = [' -- _ -- ', ' -__-- - ', ' - _--__ '] wind = [' c__ -- _ ', ' -- _-c__ ', ' c --___c ']
# File type alias FileType = str # Constants IMAGE: FileType = "IMAGE" AUDIO: FileType = "AUDIO"
file_type = str image: FileType = 'IMAGE' audio: FileType = 'AUDIO'
a=10 b=5 print(a+b) print("addition")
a = 10 b = 5 print(a + b) print('addition')
# system functions for the effects of time on a player def raise_hunger(db, messenger, object): print('HUNGER for {0}'.format(object['entity'])) if object['hunger'] >= 9: # player is going to die, so let's just skip the database # TODO: don't do this, and let an event driven system pick up players who have gotten too hungry username = object['entity'] db.set_component_for_entity('player_state', {'location': '0;0', 'hunger': 0}, username) db.set_component_for_entity('inventory', {}, username) return [ messenger.plain_text('You have died of hunger!', username), messenger.plain_text('You have lost everything in your inventory!', username), messenger.plain_text('You have been resurrected at The Origin!', username) ] db.increment_property_of_component('player_state', object['entity'], 'hunger', 1) if 2 <= object['hunger'] < 3: return [messenger.plain_text('You begin to feel hungry', object['entity'])] if 4 <= object['hunger'] < 5: return [messenger.plain_text('You hunger is giving way to hangriness', object['entity'])] if 6 <= object['hunger'] < 7: return [messenger.plain_text('Your hunger hurts, making anything but eating mentally difficult', object['entity'])] if 8 <= object['hunger'] < 9: return [messenger.plain_text('You are about to die of hunger! Eat, NOW!', object['entity'])] return []
def raise_hunger(db, messenger, object): print('HUNGER for {0}'.format(object['entity'])) if object['hunger'] >= 9: username = object['entity'] db.set_component_for_entity('player_state', {'location': '0;0', 'hunger': 0}, username) db.set_component_for_entity('inventory', {}, username) return [messenger.plain_text('You have died of hunger!', username), messenger.plain_text('You have lost everything in your inventory!', username), messenger.plain_text('You have been resurrected at The Origin!', username)] db.increment_property_of_component('player_state', object['entity'], 'hunger', 1) if 2 <= object['hunger'] < 3: return [messenger.plain_text('You begin to feel hungry', object['entity'])] if 4 <= object['hunger'] < 5: return [messenger.plain_text('You hunger is giving way to hangriness', object['entity'])] if 6 <= object['hunger'] < 7: return [messenger.plain_text('Your hunger hurts, making anything but eating mentally difficult', object['entity'])] if 8 <= object['hunger'] < 9: return [messenger.plain_text('You are about to die of hunger! Eat, NOW!', object['entity'])] return []
DOMAIN = 'https://example.com' # (route, [querie string keys]) # queries must be emtpy list if it has no query strings. ROUTES = [ ('/exercise', ['page', 'date']), ('/homework', ['date']), ] # { query string key: [query string values ]} QUERIES = { 'page': [1, 2, 3, 4, 5, 6, 7, 8, 9, 10], 'date': ['2019-01-01', '2019-04-03', '2019-04-08', '2019-05-06'] }
domain = 'https://example.com' routes = [('/exercise', ['page', 'date']), ('/homework', ['date'])] queries = {'page': [1, 2, 3, 4, 5, 6, 7, 8, 9, 10], 'date': ['2019-01-01', '2019-04-03', '2019-04-08', '2019-05-06']}
## use memoization to implement dynamic programming...!!! def solve(i,arr,dp): ## parameter(index of array, input array, define dp table..) if i <= -1: return 0 if dp[i] != -1: return dp[i] ## recursive calls op1 = arr[i] + solve(i-2,arr,dp) op2 = solve(i-1,arr,dp) ## get maximum from both recursive calls...!!!! dp[i] = max(op1,op2) return dp[i] ## main function for calling and return value...!!! def findmaxsum(arr,n): dp = [-1]*(n) ## pass value from the last index of array.. solve(n-1,arr,dp) return dp[n-1] ## Driver code...!!! if __name__ == "__main__": n = int(input()) arr = list(map(int,input().split())) print("maximum sum robber can get from houses-->",findmaxsum(arr,n)) """ sample input... 6 5 5 10 100 10 5 """
def solve(i, arr, dp): if i <= -1: return 0 if dp[i] != -1: return dp[i] op1 = arr[i] + solve(i - 2, arr, dp) op2 = solve(i - 1, arr, dp) dp[i] = max(op1, op2) return dp[i] def findmaxsum(arr, n): dp = [-1] * n solve(n - 1, arr, dp) return dp[n - 1] if __name__ == '__main__': n = int(input()) arr = list(map(int, input().split())) print('maximum sum robber can get from houses-->', findmaxsum(arr, n)) '\nsample input...\n6\n5 5 10 100 10 5\n'
class Solution: def validUtf8(self, data: List[int]) -> bool: p = 0 while p < len(data): b = self._get_binary(data[p]) one = 0 for c in b: if c == '1': one += 1 else: break if one == 0: p += 1 continue if p + one - 1 >= len(data) or one > 4 or one == 1: return False if not self._validate(data[p+1:p+one]): return False p += one return True def _validate(self, seq): for s in seq: b = self._get_binary(s) if b[:2] != '10': return False return True def _get_binary(self, num): b = bin(num)[2:] return '0' * (8 - len(b)) + b
class Solution: def valid_utf8(self, data: List[int]) -> bool: p = 0 while p < len(data): b = self._get_binary(data[p]) one = 0 for c in b: if c == '1': one += 1 else: break if one == 0: p += 1 continue if p + one - 1 >= len(data) or one > 4 or one == 1: return False if not self._validate(data[p + 1:p + one]): return False p += one return True def _validate(self, seq): for s in seq: b = self._get_binary(s) if b[:2] != '10': return False return True def _get_binary(self, num): b = bin(num)[2:] return '0' * (8 - len(b)) + b
def largest_palindrome_product(): values = { "first": 0, "second": 0, "product": 0 } for first in range(1000): for second in range(1000): product = first * second product_string = str(product) if product_string == product_string[::-1]: if first + second > values["first"] + values["second"]: values = { "first": first, "second": second, "product": product } return values["product"] print(largest_palindrome_product())
def largest_palindrome_product(): values = {'first': 0, 'second': 0, 'product': 0} for first in range(1000): for second in range(1000): product = first * second product_string = str(product) if product_string == product_string[::-1]: if first + second > values['first'] + values['second']: values = {'first': first, 'second': second, 'product': product} return values['product'] print(largest_palindrome_product())
# Copyright 2003 by Bartek Wilczynski. All rights reserved. # This code is part of the Biopython distribution and governed by its # license. Please see the LICENSE file that should have been included # as part of this package. """ Parser and code for dealing with the standalone version of AlignAce, a motif search program. It also includes a very simple interface to CompareACE tool. http://atlas.med.harvard.edu/ """
""" Parser and code for dealing with the standalone version of AlignAce, a motif search program. It also includes a very simple interface to CompareACE tool. http://atlas.med.harvard.edu/ """
tmp = max(x, y) x = min(x, y) y = tmp tmp = max(y, z) y = min(y, z) z = tmp tmp = max(x, y) x = min(x, y) y = tmp
tmp = max(x, y) x = min(x, y) y = tmp tmp = max(y, z) y = min(y, z) z = tmp tmp = max(x, y) x = min(x, y) y = tmp
def fib(n, k, a=0, b=1): if n == 0: return 1 if n == 1: return b return fib(n - 1, k, b * k, a + b) print(fib(31, 2))
def fib(n, k, a=0, b=1): if n == 0: return 1 if n == 1: return b return fib(n - 1, k, b * k, a + b) print(fib(31, 2))
#We need to calculate all multiples of 3 and 5 that are lesser than given number N #My initial attempt wasnt great so i took help from this wonderful article https://medium.com/@TheZaki/project-euler-1-multiples-of-3-and-5-c24cb64071b0 : N = 10 def sum(n, k): d = n // k return k * (d * (d+1)) // 2 def test(n): return sum(n, 3) + sum(n, 5) - sum(n, 15) print(test(N-1))
n = 10 def sum(n, k): d = n // k return k * (d * (d + 1)) // 2 def test(n): return sum(n, 3) + sum(n, 5) - sum(n, 15) print(test(N - 1))
# # PySNMP MIB module HPN-ICF-IPSEC-MONITOR-V2-MIB (http://snmplabs.com/pysmi) # ASN.1 source file:///Users/davwang4/Dev/mibs.snmplabs.com/asn1/HPN-ICF-IPSEC-MONITOR-V2-MIB # Produced by pysmi-0.3.4 at Mon Apr 29 19:27:11 2019 # On host DAVWANG4-M-1475 platform Darwin version 18.5.0 by user davwang4 # Using Python version 3.7.3 (default, Mar 27 2019, 09:23:15) # ObjectIdentifier, OctetString, Integer = mibBuilder.importSymbols("ASN1", "ObjectIdentifier", "OctetString", "Integer") NamedValues, = mibBuilder.importSymbols("ASN1-ENUMERATION", "NamedValues") ConstraintsIntersection, SingleValueConstraint, ConstraintsUnion, ValueRangeConstraint, ValueSizeConstraint = mibBuilder.importSymbols("ASN1-REFINEMENT", "ConstraintsIntersection", "SingleValueConstraint", "ConstraintsUnion", "ValueRangeConstraint", "ValueSizeConstraint") hpnicfCommon, = mibBuilder.importSymbols("HPN-ICF-OID-MIB", "hpnicfCommon") InterfaceIndex, ifIndex = mibBuilder.importSymbols("IF-MIB", "InterfaceIndex", "ifIndex") InetAddressType, InetAddress = mibBuilder.importSymbols("INET-ADDRESS-MIB", "InetAddressType", "InetAddress") ModuleCompliance, NotificationGroup, ObjectGroup = mibBuilder.importSymbols("SNMPv2-CONF", "ModuleCompliance", "NotificationGroup", "ObjectGroup") TimeTicks, Gauge32, NotificationType, Unsigned32, MibIdentifier, ModuleIdentity, Bits, Counter64, Integer32, IpAddress, Counter32, iso, ObjectIdentity, MibScalar, MibTable, MibTableRow, MibTableColumn = mibBuilder.importSymbols("SNMPv2-SMI", "TimeTicks", "Gauge32", "NotificationType", "Unsigned32", "MibIdentifier", "ModuleIdentity", "Bits", "Counter64", "Integer32", "IpAddress", "Counter32", "iso", "ObjectIdentity", "MibScalar", "MibTable", "MibTableRow", "MibTableColumn") TextualConvention, DisplayString, TruthValue = mibBuilder.importSymbols("SNMPv2-TC", "TextualConvention", "DisplayString", "TruthValue") hpnicfIPsecMonitorV2 = ModuleIdentity((1, 3, 6, 1, 4, 1, 11, 2, 14, 11, 15, 2, 126)) hpnicfIPsecMonitorV2.setRevisions(('2012-06-27 00:00',)) if mibBuilder.loadTexts: hpnicfIPsecMonitorV2.setLastUpdated('201206270000Z') if mibBuilder.loadTexts: hpnicfIPsecMonitorV2.setOrganization('') class HpnicfIPsecDiffHellmanGrpV2(TextualConvention, Integer32): status = 'current' subtypeSpec = Integer32.subtypeSpec + ConstraintsUnion(SingleValueConstraint(0, 1, 2, 5, 14, 24, 2147483647)) namedValues = NamedValues(("none", 0), ("dhGroup1", 1), ("dhGroup2", 2), ("dhGroup5", 5), ("dhGroup14", 14), ("dhGroup24", 24), ("invalidGroup", 2147483647)) class HpnicfIPsecEncapModeV2(TextualConvention, Integer32): status = 'current' subtypeSpec = Integer32.subtypeSpec + ConstraintsUnion(SingleValueConstraint(1, 2, 2147483647)) namedValues = NamedValues(("tunnel", 1), ("transport", 2), ("invalidMode", 2147483647)) class HpnicfIPsecEncryptAlgoV2(TextualConvention, Integer32): status = 'current' subtypeSpec = Integer32.subtypeSpec + ConstraintsUnion(SingleValueConstraint(0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 2147483647)) namedValues = NamedValues(("none", 0), ("desCbc", 1), ("ideaCbc", 2), ("blowfishCbc", 3), ("rc5R16B64Cbc", 4), ("tripleDesCbc", 5), ("castCbc", 6), ("aesCbc", 7), ("nsaCbc", 8), ("aesCbc128", 9), ("aesCbc192", 10), ("aesCbc256", 11), ("aesCtr", 12), ("aesCamelliaCbc", 13), ("rc4", 14), ("invalidAlg", 2147483647)) class HpnicfIPsecAuthAlgoV2(TextualConvention, Integer32): status = 'current' subtypeSpec = Integer32.subtypeSpec + ConstraintsUnion(SingleValueConstraint(0, 1, 2, 3, 4, 5, 2147483647)) namedValues = NamedValues(("none", 0), ("md5", 1), ("sha1", 2), ("sha256", 3), ("sha384", 4), ("sha512", 5), ("invalidAlg", 2147483647)) class HpnicfIPsecSaProtocolV2(TextualConvention, Integer32): status = 'current' subtypeSpec = Integer32.subtypeSpec + ConstraintsUnion(SingleValueConstraint(0, 2, 3, 4)) namedValues = NamedValues(("reserved", 0), ("ah", 2), ("esp", 3), ("ipcomp", 4)) class HpnicfIPsecIDTypeV2(TextualConvention, Integer32): status = 'current' subtypeSpec = Integer32.subtypeSpec + ConstraintsUnion(SingleValueConstraint(0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11)) namedValues = NamedValues(("reserved", 0), ("ipv4Addr", 1), ("fqdn", 2), ("userFqdn", 3), ("ipv4AddrSubnet", 4), ("ipv6Addr", 5), ("ipv6AddrSubnet", 6), ("ipv4AddrRange", 7), ("ipv6AddrRange", 8), ("derAsn1Dn", 9), ("derAsn1Gn", 10), ("keyId", 11)) class HpnicfIPsecTrafficTypeV2(TextualConvention, Integer32): status = 'current' subtypeSpec = Integer32.subtypeSpec + ConstraintsUnion(SingleValueConstraint(1, 4, 5, 6, 7, 8)) namedValues = NamedValues(("ipv4Addr", 1), ("ipv4AddrSubnet", 4), ("ipv6Addr", 5), ("ipv6AddrSubnet", 6), ("ipv4AddrRange", 7), ("ipv6AddrRange", 8)) class HpnicfIPsecNegoTypeV2(TextualConvention, Integer32): status = 'current' subtypeSpec = Integer32.subtypeSpec + ConstraintsUnion(SingleValueConstraint(1, 2, 2147483647)) namedValues = NamedValues(("ike", 1), ("manual", 2), ("invalidType", 2147483647)) class HpnicfIPsecTunnelStateV2(TextualConvention, Integer32): status = 'current' subtypeSpec = Integer32.subtypeSpec + ConstraintsUnion(SingleValueConstraint(1, 2)) namedValues = NamedValues(("active", 1), ("timeout", 2)) hpnicfIPsecObjectsV2 = MibIdentifier((1, 3, 6, 1, 4, 1, 11, 2, 14, 11, 15, 2, 126, 1)) hpnicfIPsecScalarObjectsV2 = MibIdentifier((1, 3, 6, 1, 4, 1, 11, 2, 14, 11, 15, 2, 126, 1, 1)) hpnicfIPsecMIBVersion = MibScalar((1, 3, 6, 1, 4, 1, 11, 2, 14, 11, 15, 2, 126, 1, 1, 1), DisplayString()).setMaxAccess("readonly") if mibBuilder.loadTexts: hpnicfIPsecMIBVersion.setStatus('current') hpnicfIPsecTunnelV2Table = MibTable((1, 3, 6, 1, 4, 1, 11, 2, 14, 11, 15, 2, 126, 1, 2), ) if mibBuilder.loadTexts: hpnicfIPsecTunnelV2Table.setStatus('current') hpnicfIPsecTunnelV2Entry = MibTableRow((1, 3, 6, 1, 4, 1, 11, 2, 14, 11, 15, 2, 126, 1, 2, 1), ).setIndexNames((0, "HPN-ICF-IPSEC-MONITOR-V2-MIB", "hpnicfIPsecTunIndexV2")) if mibBuilder.loadTexts: hpnicfIPsecTunnelV2Entry.setStatus('current') hpnicfIPsecTunIndexV2 = MibTableColumn((1, 3, 6, 1, 4, 1, 11, 2, 14, 11, 15, 2, 126, 1, 2, 1, 1), Integer32().subtype(subtypeSpec=ValueRangeConstraint(1, 2147483647))).setMaxAccess("accessiblefornotify") if mibBuilder.loadTexts: hpnicfIPsecTunIndexV2.setStatus('current') hpnicfIPsecTunIfIndexV2 = MibTableColumn((1, 3, 6, 1, 4, 1, 11, 2, 14, 11, 15, 2, 126, 1, 2, 1, 2), InterfaceIndex()).setMaxAccess("readonly") if mibBuilder.loadTexts: hpnicfIPsecTunIfIndexV2.setStatus('current') hpnicfIPsecTunIKETunnelIndexV2 = MibTableColumn((1, 3, 6, 1, 4, 1, 11, 2, 14, 11, 15, 2, 126, 1, 2, 1, 3), Integer32().subtype(subtypeSpec=ValueRangeConstraint(1, 2147483647))).setMaxAccess("readonly") if mibBuilder.loadTexts: hpnicfIPsecTunIKETunnelIndexV2.setStatus('current') hpnicfIPsecTunIKETunLocalIDTypeV2 = MibTableColumn((1, 3, 6, 1, 4, 1, 11, 2, 14, 11, 15, 2, 126, 1, 2, 1, 4), HpnicfIPsecIDTypeV2()).setMaxAccess("readonly") if mibBuilder.loadTexts: hpnicfIPsecTunIKETunLocalIDTypeV2.setStatus('current') hpnicfIPsecTunIKETunLocalIDVal1V2 = MibTableColumn((1, 3, 6, 1, 4, 1, 11, 2, 14, 11, 15, 2, 126, 1, 2, 1, 5), DisplayString()).setMaxAccess("readonly") if mibBuilder.loadTexts: hpnicfIPsecTunIKETunLocalIDVal1V2.setStatus('current') hpnicfIPsecTunIKETunLocalIDVal2V2 = MibTableColumn((1, 3, 6, 1, 4, 1, 11, 2, 14, 11, 15, 2, 126, 1, 2, 1, 6), DisplayString()).setMaxAccess("readonly") if mibBuilder.loadTexts: hpnicfIPsecTunIKETunLocalIDVal2V2.setStatus('current') hpnicfIPsecTunIKETunRemoteIDTypeV2 = MibTableColumn((1, 3, 6, 1, 4, 1, 11, 2, 14, 11, 15, 2, 126, 1, 2, 1, 7), HpnicfIPsecIDTypeV2()).setMaxAccess("readonly") if mibBuilder.loadTexts: hpnicfIPsecTunIKETunRemoteIDTypeV2.setStatus('current') hpnicfIPsecTunIKETunRemoteIDVal1V2 = MibTableColumn((1, 3, 6, 1, 4, 1, 11, 2, 14, 11, 15, 2, 126, 1, 2, 1, 8), DisplayString()).setMaxAccess("readonly") if mibBuilder.loadTexts: hpnicfIPsecTunIKETunRemoteIDVal1V2.setStatus('current') hpnicfIPsecTunIKETunRemoteIDVal2V2 = MibTableColumn((1, 3, 6, 1, 4, 1, 11, 2, 14, 11, 15, 2, 126, 1, 2, 1, 9), DisplayString()).setMaxAccess("readonly") if mibBuilder.loadTexts: hpnicfIPsecTunIKETunRemoteIDVal2V2.setStatus('current') hpnicfIPsecTunLocalAddrTypeV2 = MibTableColumn((1, 3, 6, 1, 4, 1, 11, 2, 14, 11, 15, 2, 126, 1, 2, 1, 10), InetAddressType()).setMaxAccess("readonly") if mibBuilder.loadTexts: hpnicfIPsecTunLocalAddrTypeV2.setStatus('current') hpnicfIPsecTunLocalAddrV2 = MibTableColumn((1, 3, 6, 1, 4, 1, 11, 2, 14, 11, 15, 2, 126, 1, 2, 1, 11), InetAddress()).setMaxAccess("readonly") if mibBuilder.loadTexts: hpnicfIPsecTunLocalAddrV2.setStatus('current') hpnicfIPsecTunRemoteAddrTypeV2 = MibTableColumn((1, 3, 6, 1, 4, 1, 11, 2, 14, 11, 15, 2, 126, 1, 2, 1, 12), InetAddressType()).setMaxAccess("readonly") if mibBuilder.loadTexts: hpnicfIPsecTunRemoteAddrTypeV2.setStatus('current') hpnicfIPsecTunRemoteAddrV2 = MibTableColumn((1, 3, 6, 1, 4, 1, 11, 2, 14, 11, 15, 2, 126, 1, 2, 1, 13), InetAddress()).setMaxAccess("readonly") if mibBuilder.loadTexts: hpnicfIPsecTunRemoteAddrV2.setStatus('current') hpnicfIPsecTunKeyTypeV2 = MibTableColumn((1, 3, 6, 1, 4, 1, 11, 2, 14, 11, 15, 2, 126, 1, 2, 1, 14), HpnicfIPsecNegoTypeV2()).setMaxAccess("readonly") if mibBuilder.loadTexts: hpnicfIPsecTunKeyTypeV2.setStatus('current') hpnicfIPsecTunEncapModeV2 = MibTableColumn((1, 3, 6, 1, 4, 1, 11, 2, 14, 11, 15, 2, 126, 1, 2, 1, 15), HpnicfIPsecEncapModeV2()).setMaxAccess("readonly") if mibBuilder.loadTexts: hpnicfIPsecTunEncapModeV2.setStatus('current') hpnicfIPsecTunInitiatorV2 = MibTableColumn((1, 3, 6, 1, 4, 1, 11, 2, 14, 11, 15, 2, 126, 1, 2, 1, 16), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2, 2147483647))).clone(namedValues=NamedValues(("local", 1), ("remote", 2), ("none", 2147483647)))).setMaxAccess("readonly") if mibBuilder.loadTexts: hpnicfIPsecTunInitiatorV2.setStatus('current') hpnicfIPsecTunLifeSizeV2 = MibTableColumn((1, 3, 6, 1, 4, 1, 11, 2, 14, 11, 15, 2, 126, 1, 2, 1, 17), Gauge32()).setMaxAccess("readonly") if mibBuilder.loadTexts: hpnicfIPsecTunLifeSizeV2.setStatus('current') hpnicfIPsecTunLifeTimeV2 = MibTableColumn((1, 3, 6, 1, 4, 1, 11, 2, 14, 11, 15, 2, 126, 1, 2, 1, 18), Integer32().subtype(subtypeSpec=ValueRangeConstraint(1, 2147483647))).setMaxAccess("readonly") if mibBuilder.loadTexts: hpnicfIPsecTunLifeTimeV2.setStatus('current') hpnicfIPsecTunRemainTimeV2 = MibTableColumn((1, 3, 6, 1, 4, 1, 11, 2, 14, 11, 15, 2, 126, 1, 2, 1, 19), Integer32().subtype(subtypeSpec=ValueRangeConstraint(0, 2147483647))).setMaxAccess("readonly") if mibBuilder.loadTexts: hpnicfIPsecTunRemainTimeV2.setStatus('current') hpnicfIPsecTunActiveTimeV2 = MibTableColumn((1, 3, 6, 1, 4, 1, 11, 2, 14, 11, 15, 2, 126, 1, 2, 1, 20), Integer32().subtype(subtypeSpec=ValueRangeConstraint(0, 2147483647))).setMaxAccess("readonly") if mibBuilder.loadTexts: hpnicfIPsecTunActiveTimeV2.setStatus('current') hpnicfIPsecTunRemainSizeV2 = MibTableColumn((1, 3, 6, 1, 4, 1, 11, 2, 14, 11, 15, 2, 126, 1, 2, 1, 21), Gauge32()).setMaxAccess("readonly") if mibBuilder.loadTexts: hpnicfIPsecTunRemainSizeV2.setStatus('current') hpnicfIPsecTunTotalRefreshesV2 = MibTableColumn((1, 3, 6, 1, 4, 1, 11, 2, 14, 11, 15, 2, 126, 1, 2, 1, 22), Counter32()).setMaxAccess("readonly") if mibBuilder.loadTexts: hpnicfIPsecTunTotalRefreshesV2.setStatus('current') hpnicfIPsecTunCurrentSaInstancesV2 = MibTableColumn((1, 3, 6, 1, 4, 1, 11, 2, 14, 11, 15, 2, 126, 1, 2, 1, 23), Gauge32()).setMaxAccess("readonly") if mibBuilder.loadTexts: hpnicfIPsecTunCurrentSaInstancesV2.setStatus('current') hpnicfIPsecTunInSaEncryptAlgoV2 = MibTableColumn((1, 3, 6, 1, 4, 1, 11, 2, 14, 11, 15, 2, 126, 1, 2, 1, 24), HpnicfIPsecEncryptAlgoV2()).setMaxAccess("readonly") if mibBuilder.loadTexts: hpnicfIPsecTunInSaEncryptAlgoV2.setStatus('current') hpnicfIPsecTunInSaAhAuthAlgoV2 = MibTableColumn((1, 3, 6, 1, 4, 1, 11, 2, 14, 11, 15, 2, 126, 1, 2, 1, 25), HpnicfIPsecAuthAlgoV2()).setMaxAccess("readonly") if mibBuilder.loadTexts: hpnicfIPsecTunInSaAhAuthAlgoV2.setStatus('current') hpnicfIPsecTunInSaEspAuthAlgoV2 = MibTableColumn((1, 3, 6, 1, 4, 1, 11, 2, 14, 11, 15, 2, 126, 1, 2, 1, 26), HpnicfIPsecAuthAlgoV2()).setMaxAccess("readonly") if mibBuilder.loadTexts: hpnicfIPsecTunInSaEspAuthAlgoV2.setStatus('current') hpnicfIPsecTunDiffHellmanGrpV2 = MibTableColumn((1, 3, 6, 1, 4, 1, 11, 2, 14, 11, 15, 2, 126, 1, 2, 1, 27), HpnicfIPsecDiffHellmanGrpV2()).setMaxAccess("readonly") if mibBuilder.loadTexts: hpnicfIPsecTunDiffHellmanGrpV2.setStatus('current') hpnicfIPsecTunOutSaEncryptAlgoV2 = MibTableColumn((1, 3, 6, 1, 4, 1, 11, 2, 14, 11, 15, 2, 126, 1, 2, 1, 28), HpnicfIPsecEncryptAlgoV2()).setMaxAccess("readonly") if mibBuilder.loadTexts: hpnicfIPsecTunOutSaEncryptAlgoV2.setStatus('current') hpnicfIPsecTunOutSaAhAuthAlgoV2 = MibTableColumn((1, 3, 6, 1, 4, 1, 11, 2, 14, 11, 15, 2, 126, 1, 2, 1, 29), HpnicfIPsecAuthAlgoV2()).setMaxAccess("readonly") if mibBuilder.loadTexts: hpnicfIPsecTunOutSaAhAuthAlgoV2.setStatus('current') hpnicfIPsecTunOutSaEspAuthAlgoV2 = MibTableColumn((1, 3, 6, 1, 4, 1, 11, 2, 14, 11, 15, 2, 126, 1, 2, 1, 30), HpnicfIPsecAuthAlgoV2()).setMaxAccess("readonly") if mibBuilder.loadTexts: hpnicfIPsecTunOutSaEspAuthAlgoV2.setStatus('current') hpnicfIPsecTunPolicyNameV2 = MibTableColumn((1, 3, 6, 1, 4, 1, 11, 2, 14, 11, 15, 2, 126, 1, 2, 1, 31), DisplayString()).setMaxAccess("readonly") if mibBuilder.loadTexts: hpnicfIPsecTunPolicyNameV2.setStatus('current') hpnicfIPsecTunPolicyNumV2 = MibTableColumn((1, 3, 6, 1, 4, 1, 11, 2, 14, 11, 15, 2, 126, 1, 2, 1, 32), Integer32().subtype(subtypeSpec=ValueRangeConstraint(1, 2147483647))).setMaxAccess("readonly") if mibBuilder.loadTexts: hpnicfIPsecTunPolicyNumV2.setStatus('current') hpnicfIPsecTunStatusV2 = MibTableColumn((1, 3, 6, 1, 4, 1, 11, 2, 14, 11, 15, 2, 126, 1, 2, 1, 33), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2, 3, 4))).clone(namedValues=NamedValues(("initial", 1), ("ready", 2), ("rekeyed", 3), ("closed", 4)))).setMaxAccess("readonly") if mibBuilder.loadTexts: hpnicfIPsecTunStatusV2.setStatus('current') hpnicfIPsecTunnelStatV2Table = MibTable((1, 3, 6, 1, 4, 1, 11, 2, 14, 11, 15, 2, 126, 1, 3), ) if mibBuilder.loadTexts: hpnicfIPsecTunnelStatV2Table.setStatus('current') hpnicfIPsecTunnelStatV2Entry = MibTableRow((1, 3, 6, 1, 4, 1, 11, 2, 14, 11, 15, 2, 126, 1, 3, 1), ).setIndexNames((0, "HPN-ICF-IPSEC-MONITOR-V2-MIB", "hpnicfIPsecTunIndexV2")) if mibBuilder.loadTexts: hpnicfIPsecTunnelStatV2Entry.setStatus('current') hpnicfIPsecTunInOctetsV2 = MibTableColumn((1, 3, 6, 1, 4, 1, 11, 2, 14, 11, 15, 2, 126, 1, 3, 1, 1), Counter64()).setMaxAccess("readonly") if mibBuilder.loadTexts: hpnicfIPsecTunInOctetsV2.setStatus('current') hpnicfIPsecTunInDecompOctetsV2 = MibTableColumn((1, 3, 6, 1, 4, 1, 11, 2, 14, 11, 15, 2, 126, 1, 3, 1, 2), Counter64()).setMaxAccess("readonly") if mibBuilder.loadTexts: hpnicfIPsecTunInDecompOctetsV2.setStatus('current') hpnicfIPsecTunInPktsV2 = MibTableColumn((1, 3, 6, 1, 4, 1, 11, 2, 14, 11, 15, 2, 126, 1, 3, 1, 3), Counter64()).setMaxAccess("readonly") if mibBuilder.loadTexts: hpnicfIPsecTunInPktsV2.setStatus('current') hpnicfIPsecTunInDropPktsV2 = MibTableColumn((1, 3, 6, 1, 4, 1, 11, 2, 14, 11, 15, 2, 126, 1, 3, 1, 4), Counter64()).setMaxAccess("readonly") if mibBuilder.loadTexts: hpnicfIPsecTunInDropPktsV2.setStatus('current') hpnicfIPsecTunInReplayDropPktsV2 = MibTableColumn((1, 3, 6, 1, 4, 1, 11, 2, 14, 11, 15, 2, 126, 1, 3, 1, 5), Counter64()).setMaxAccess("readonly") if mibBuilder.loadTexts: hpnicfIPsecTunInReplayDropPktsV2.setStatus('current') hpnicfIPsecTunInAuthFailsV2 = MibTableColumn((1, 3, 6, 1, 4, 1, 11, 2, 14, 11, 15, 2, 126, 1, 3, 1, 6), Counter64()).setMaxAccess("readonly") if mibBuilder.loadTexts: hpnicfIPsecTunInAuthFailsV2.setStatus('current') hpnicfIPsecTunInDecryptFailsV2 = MibTableColumn((1, 3, 6, 1, 4, 1, 11, 2, 14, 11, 15, 2, 126, 1, 3, 1, 7), Counter64()).setMaxAccess("readonly") if mibBuilder.loadTexts: hpnicfIPsecTunInDecryptFailsV2.setStatus('current') hpnicfIPsecTunOutOctetsV2 = MibTableColumn((1, 3, 6, 1, 4, 1, 11, 2, 14, 11, 15, 2, 126, 1, 3, 1, 8), Counter64()).setMaxAccess("readonly") if mibBuilder.loadTexts: hpnicfIPsecTunOutOctetsV2.setStatus('current') hpnicfIPsecTunOutUncompOctetsV2 = MibTableColumn((1, 3, 6, 1, 4, 1, 11, 2, 14, 11, 15, 2, 126, 1, 3, 1, 9), Counter64()).setMaxAccess("readonly") if mibBuilder.loadTexts: hpnicfIPsecTunOutUncompOctetsV2.setStatus('current') hpnicfIPsecTunOutPktsV2 = MibTableColumn((1, 3, 6, 1, 4, 1, 11, 2, 14, 11, 15, 2, 126, 1, 3, 1, 10), Counter64()).setMaxAccess("readonly") if mibBuilder.loadTexts: hpnicfIPsecTunOutPktsV2.setStatus('current') hpnicfIPsecTunOutDropPktsV2 = MibTableColumn((1, 3, 6, 1, 4, 1, 11, 2, 14, 11, 15, 2, 126, 1, 3, 1, 11), Counter64()).setMaxAccess("readonly") if mibBuilder.loadTexts: hpnicfIPsecTunOutDropPktsV2.setStatus('current') hpnicfIPsecTunOutEncryptFailsV2 = MibTableColumn((1, 3, 6, 1, 4, 1, 11, 2, 14, 11, 15, 2, 126, 1, 3, 1, 12), Counter64()).setMaxAccess("readonly") if mibBuilder.loadTexts: hpnicfIPsecTunOutEncryptFailsV2.setStatus('current') hpnicfIPsecTunNoMemoryDropPktsV2 = MibTableColumn((1, 3, 6, 1, 4, 1, 11, 2, 14, 11, 15, 2, 126, 1, 3, 1, 13), Counter64()).setMaxAccess("readonly") if mibBuilder.loadTexts: hpnicfIPsecTunNoMemoryDropPktsV2.setStatus('current') hpnicfIPsecTunQueueFullDropPktsV2 = MibTableColumn((1, 3, 6, 1, 4, 1, 11, 2, 14, 11, 15, 2, 126, 1, 3, 1, 14), Counter64()).setMaxAccess("readonly") if mibBuilder.loadTexts: hpnicfIPsecTunQueueFullDropPktsV2.setStatus('current') hpnicfIPsecTunInvalidLenDropPktsV2 = MibTableColumn((1, 3, 6, 1, 4, 1, 11, 2, 14, 11, 15, 2, 126, 1, 3, 1, 15), Counter64()).setMaxAccess("readonly") if mibBuilder.loadTexts: hpnicfIPsecTunInvalidLenDropPktsV2.setStatus('current') hpnicfIPsecTunTooLongDropPktsV2 = MibTableColumn((1, 3, 6, 1, 4, 1, 11, 2, 14, 11, 15, 2, 126, 1, 3, 1, 16), Counter64()).setMaxAccess("readonly") if mibBuilder.loadTexts: hpnicfIPsecTunTooLongDropPktsV2.setStatus('current') hpnicfIPsecTunInvalidSaDropPktsV2 = MibTableColumn((1, 3, 6, 1, 4, 1, 11, 2, 14, 11, 15, 2, 126, 1, 3, 1, 17), Counter64()).setMaxAccess("readonly") if mibBuilder.loadTexts: hpnicfIPsecTunInvalidSaDropPktsV2.setStatus('current') hpnicfIPsecSaV2Table = MibTable((1, 3, 6, 1, 4, 1, 11, 2, 14, 11, 15, 2, 126, 1, 4), ) if mibBuilder.loadTexts: hpnicfIPsecSaV2Table.setStatus('current') hpnicfIPsecSaV2Entry = MibTableRow((1, 3, 6, 1, 4, 1, 11, 2, 14, 11, 15, 2, 126, 1, 4, 1), ).setIndexNames((0, "HPN-ICF-IPSEC-MONITOR-V2-MIB", "hpnicfIPsecTunIndexV2"), (0, "HPN-ICF-IPSEC-MONITOR-V2-MIB", "hpnicfIPsecSaIndexV2")) if mibBuilder.loadTexts: hpnicfIPsecSaV2Entry.setStatus('current') hpnicfIPsecSaIndexV2 = MibTableColumn((1, 3, 6, 1, 4, 1, 11, 2, 14, 11, 15, 2, 126, 1, 4, 1, 1), Integer32().subtype(subtypeSpec=ValueRangeConstraint(1, 2147483647))).setMaxAccess("accessiblefornotify") if mibBuilder.loadTexts: hpnicfIPsecSaIndexV2.setStatus('current') hpnicfIPsecSaDirectionV2 = MibTableColumn((1, 3, 6, 1, 4, 1, 11, 2, 14, 11, 15, 2, 126, 1, 4, 1, 2), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2))).clone(namedValues=NamedValues(("in", 1), ("out", 2)))).setMaxAccess("readonly") if mibBuilder.loadTexts: hpnicfIPsecSaDirectionV2.setStatus('current') hpnicfIPsecSaSpiValueV2 = MibTableColumn((1, 3, 6, 1, 4, 1, 11, 2, 14, 11, 15, 2, 126, 1, 4, 1, 3), Unsigned32().subtype(subtypeSpec=ValueRangeConstraint(1, 4294967295))).setMaxAccess("readonly") if mibBuilder.loadTexts: hpnicfIPsecSaSpiValueV2.setStatus('current') hpnicfIPsecSaSecProtocolV2 = MibTableColumn((1, 3, 6, 1, 4, 1, 11, 2, 14, 11, 15, 2, 126, 1, 4, 1, 4), HpnicfIPsecSaProtocolV2()).setMaxAccess("readonly") if mibBuilder.loadTexts: hpnicfIPsecSaSecProtocolV2.setStatus('current') hpnicfIPsecSaEncryptAlgoV2 = MibTableColumn((1, 3, 6, 1, 4, 1, 11, 2, 14, 11, 15, 2, 126, 1, 4, 1, 5), HpnicfIPsecEncryptAlgoV2()).setMaxAccess("readonly") if mibBuilder.loadTexts: hpnicfIPsecSaEncryptAlgoV2.setStatus('current') hpnicfIPsecSaAuthAlgoV2 = MibTableColumn((1, 3, 6, 1, 4, 1, 11, 2, 14, 11, 15, 2, 126, 1, 4, 1, 6), HpnicfIPsecAuthAlgoV2()).setMaxAccess("readonly") if mibBuilder.loadTexts: hpnicfIPsecSaAuthAlgoV2.setStatus('current') hpnicfIPsecSaStatusV2 = MibTableColumn((1, 3, 6, 1, 4, 1, 11, 2, 14, 11, 15, 2, 126, 1, 4, 1, 7), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2))).clone(namedValues=NamedValues(("active", 1), ("expiring", 2)))).setMaxAccess("readonly") if mibBuilder.loadTexts: hpnicfIPsecSaStatusV2.setStatus('current') hpnicfIPsecTrafficV2Table = MibTable((1, 3, 6, 1, 4, 1, 11, 2, 14, 11, 15, 2, 126, 1, 5), ) if mibBuilder.loadTexts: hpnicfIPsecTrafficV2Table.setStatus('current') hpnicfIPsecTrafficV2Entry = MibTableRow((1, 3, 6, 1, 4, 1, 11, 2, 14, 11, 15, 2, 126, 1, 5, 1), ).setIndexNames((0, "HPN-ICF-IPSEC-MONITOR-V2-MIB", "hpnicfIPsecTunIndexV2")) if mibBuilder.loadTexts: hpnicfIPsecTrafficV2Entry.setStatus('current') hpnicfIPsecTrafficLocalTypeV2 = MibTableColumn((1, 3, 6, 1, 4, 1, 11, 2, 14, 11, 15, 2, 126, 1, 5, 1, 1), HpnicfIPsecTrafficTypeV2()).setMaxAccess("readonly") if mibBuilder.loadTexts: hpnicfIPsecTrafficLocalTypeV2.setStatus('current') hpnicfIPsecTrafficLocalAddr1TypeV2 = MibTableColumn((1, 3, 6, 1, 4, 1, 11, 2, 14, 11, 15, 2, 126, 1, 5, 1, 2), InetAddressType()).setMaxAccess("readonly") if mibBuilder.loadTexts: hpnicfIPsecTrafficLocalAddr1TypeV2.setStatus('current') hpnicfIPsecTrafficLocalAddr1V2 = MibTableColumn((1, 3, 6, 1, 4, 1, 11, 2, 14, 11, 15, 2, 126, 1, 5, 1, 3), InetAddress()).setMaxAccess("readonly") if mibBuilder.loadTexts: hpnicfIPsecTrafficLocalAddr1V2.setStatus('current') hpnicfIPsecTrafficLocalAddr2TypeV2 = MibTableColumn((1, 3, 6, 1, 4, 1, 11, 2, 14, 11, 15, 2, 126, 1, 5, 1, 4), InetAddressType()).setMaxAccess("readonly") if mibBuilder.loadTexts: hpnicfIPsecTrafficLocalAddr2TypeV2.setStatus('current') hpnicfIPsecTrafficLocalAddr2V2 = MibTableColumn((1, 3, 6, 1, 4, 1, 11, 2, 14, 11, 15, 2, 126, 1, 5, 1, 5), InetAddress()).setMaxAccess("readonly") if mibBuilder.loadTexts: hpnicfIPsecTrafficLocalAddr2V2.setStatus('current') hpnicfIPsecTrafficLocalProtocol1V2 = MibTableColumn((1, 3, 6, 1, 4, 1, 11, 2, 14, 11, 15, 2, 126, 1, 5, 1, 6), Integer32().subtype(subtypeSpec=ValueRangeConstraint(0, 255))).setMaxAccess("readonly") if mibBuilder.loadTexts: hpnicfIPsecTrafficLocalProtocol1V2.setStatus('current') hpnicfIPsecTrafficLocalProtocol2V2 = MibTableColumn((1, 3, 6, 1, 4, 1, 11, 2, 14, 11, 15, 2, 126, 1, 5, 1, 7), Integer32().subtype(subtypeSpec=ValueRangeConstraint(0, 255))).setMaxAccess("readonly") if mibBuilder.loadTexts: hpnicfIPsecTrafficLocalProtocol2V2.setStatus('current') hpnicfIPsecTrafficLocalPort1V2 = MibTableColumn((1, 3, 6, 1, 4, 1, 11, 2, 14, 11, 15, 2, 126, 1, 5, 1, 8), Integer32().subtype(subtypeSpec=ValueRangeConstraint(0, 65535))).setMaxAccess("readonly") if mibBuilder.loadTexts: hpnicfIPsecTrafficLocalPort1V2.setStatus('current') hpnicfIPsecTrafficLocalPort2V2 = MibTableColumn((1, 3, 6, 1, 4, 1, 11, 2, 14, 11, 15, 2, 126, 1, 5, 1, 9), Integer32().subtype(subtypeSpec=ValueRangeConstraint(0, 65535))).setMaxAccess("readonly") if mibBuilder.loadTexts: hpnicfIPsecTrafficLocalPort2V2.setStatus('current') hpnicfIPsecTrafficRemoteTypeV2 = MibTableColumn((1, 3, 6, 1, 4, 1, 11, 2, 14, 11, 15, 2, 126, 1, 5, 1, 10), HpnicfIPsecTrafficTypeV2()).setMaxAccess("readonly") if mibBuilder.loadTexts: hpnicfIPsecTrafficRemoteTypeV2.setStatus('current') hpnicfIPsecTrafficRemAddr1TypeV2 = MibTableColumn((1, 3, 6, 1, 4, 1, 11, 2, 14, 11, 15, 2, 126, 1, 5, 1, 11), InetAddressType()).setMaxAccess("readonly") if mibBuilder.loadTexts: hpnicfIPsecTrafficRemAddr1TypeV2.setStatus('current') hpnicfIPsecTrafficRemAddr1V2 = MibTableColumn((1, 3, 6, 1, 4, 1, 11, 2, 14, 11, 15, 2, 126, 1, 5, 1, 12), InetAddress()).setMaxAccess("readonly") if mibBuilder.loadTexts: hpnicfIPsecTrafficRemAddr1V2.setStatus('current') hpnicfIPsecTrafficRemAddr2TypeV2 = MibTableColumn((1, 3, 6, 1, 4, 1, 11, 2, 14, 11, 15, 2, 126, 1, 5, 1, 13), InetAddressType()).setMaxAccess("readonly") if mibBuilder.loadTexts: hpnicfIPsecTrafficRemAddr2TypeV2.setStatus('current') hpnicfIPsecTrafficRemAddr2V2 = MibTableColumn((1, 3, 6, 1, 4, 1, 11, 2, 14, 11, 15, 2, 126, 1, 5, 1, 14), InetAddress()).setMaxAccess("readonly") if mibBuilder.loadTexts: hpnicfIPsecTrafficRemAddr2V2.setStatus('current') hpnicfIPsecTrafficRemoPro1V2 = MibTableColumn((1, 3, 6, 1, 4, 1, 11, 2, 14, 11, 15, 2, 126, 1, 5, 1, 15), Integer32().subtype(subtypeSpec=ValueRangeConstraint(0, 255))).setMaxAccess("readonly") if mibBuilder.loadTexts: hpnicfIPsecTrafficRemoPro1V2.setStatus('current') hpnicfIPsecTrafficRemoPro2V2 = MibTableColumn((1, 3, 6, 1, 4, 1, 11, 2, 14, 11, 15, 2, 126, 1, 5, 1, 16), Integer32().subtype(subtypeSpec=ValueRangeConstraint(0, 255))).setMaxAccess("readonly") if mibBuilder.loadTexts: hpnicfIPsecTrafficRemoPro2V2.setStatus('current') hpnicfIPsecTrafficRemPort1V2 = MibTableColumn((1, 3, 6, 1, 4, 1, 11, 2, 14, 11, 15, 2, 126, 1, 5, 1, 17), Integer32().subtype(subtypeSpec=ValueRangeConstraint(0, 65535))).setMaxAccess("readonly") if mibBuilder.loadTexts: hpnicfIPsecTrafficRemPort1V2.setStatus('current') hpnicfIPsecTrafficRemPort2V2 = MibTableColumn((1, 3, 6, 1, 4, 1, 11, 2, 14, 11, 15, 2, 126, 1, 5, 1, 18), Integer32().subtype(subtypeSpec=ValueRangeConstraint(0, 65535))).setMaxAccess("readonly") if mibBuilder.loadTexts: hpnicfIPsecTrafficRemPort2V2.setStatus('current') hpnicfIPsecGlobalStatsV2 = MibIdentifier((1, 3, 6, 1, 4, 1, 11, 2, 14, 11, 15, 2, 126, 1, 6)) hpnicfIPsecGlobalActiveTunnelsV2 = MibScalar((1, 3, 6, 1, 4, 1, 11, 2, 14, 11, 15, 2, 126, 1, 6, 1), Gauge32()).setMaxAccess("readonly") if mibBuilder.loadTexts: hpnicfIPsecGlobalActiveTunnelsV2.setStatus('current') hpnicfIPsecGlobalActiveSasV2 = MibScalar((1, 3, 6, 1, 4, 1, 11, 2, 14, 11, 15, 2, 126, 1, 6, 2), Gauge32()).setMaxAccess("readonly") if mibBuilder.loadTexts: hpnicfIPsecGlobalActiveSasV2.setStatus('current') hpnicfIPsecGlobalInOctetsV2 = MibScalar((1, 3, 6, 1, 4, 1, 11, 2, 14, 11, 15, 2, 126, 1, 6, 3), Counter64()).setMaxAccess("readonly") if mibBuilder.loadTexts: hpnicfIPsecGlobalInOctetsV2.setStatus('current') hpnicfIPsecGlobalInDecompOctetsV2 = MibScalar((1, 3, 6, 1, 4, 1, 11, 2, 14, 11, 15, 2, 126, 1, 6, 4), Counter64()).setMaxAccess("readonly") if mibBuilder.loadTexts: hpnicfIPsecGlobalInDecompOctetsV2.setStatus('current') hpnicfIPsecGlobalInPktsV2 = MibScalar((1, 3, 6, 1, 4, 1, 11, 2, 14, 11, 15, 2, 126, 1, 6, 5), Counter64()).setMaxAccess("readonly") if mibBuilder.loadTexts: hpnicfIPsecGlobalInPktsV2.setStatus('current') hpnicfIPsecGlobalInDropsV2 = MibScalar((1, 3, 6, 1, 4, 1, 11, 2, 14, 11, 15, 2, 126, 1, 6, 6), Counter64()).setMaxAccess("readonly") if mibBuilder.loadTexts: hpnicfIPsecGlobalInDropsV2.setStatus('current') hpnicfIPsecGlobalInReplayDropsV2 = MibScalar((1, 3, 6, 1, 4, 1, 11, 2, 14, 11, 15, 2, 126, 1, 6, 7), Counter64()).setMaxAccess("readonly") if mibBuilder.loadTexts: hpnicfIPsecGlobalInReplayDropsV2.setStatus('current') hpnicfIPsecGlobalInAuthFailsV2 = MibScalar((1, 3, 6, 1, 4, 1, 11, 2, 14, 11, 15, 2, 126, 1, 6, 8), Counter64()).setMaxAccess("readonly") if mibBuilder.loadTexts: hpnicfIPsecGlobalInAuthFailsV2.setStatus('current') hpnicfIPsecGlobalInDecryptFailsV2 = MibScalar((1, 3, 6, 1, 4, 1, 11, 2, 14, 11, 15, 2, 126, 1, 6, 9), Counter64()).setMaxAccess("readonly") if mibBuilder.loadTexts: hpnicfIPsecGlobalInDecryptFailsV2.setStatus('current') hpnicfIPsecGlobalOutOctetsV2 = MibScalar((1, 3, 6, 1, 4, 1, 11, 2, 14, 11, 15, 2, 126, 1, 6, 10), Counter64()).setMaxAccess("readonly") if mibBuilder.loadTexts: hpnicfIPsecGlobalOutOctetsV2.setStatus('current') hpnicfIPsecGlobalOutUncompOctetsV2 = MibScalar((1, 3, 6, 1, 4, 1, 11, 2, 14, 11, 15, 2, 126, 1, 6, 11), Counter64()).setMaxAccess("readonly") if mibBuilder.loadTexts: hpnicfIPsecGlobalOutUncompOctetsV2.setStatus('current') hpnicfIPsecGlobalOutPktsV2 = MibScalar((1, 3, 6, 1, 4, 1, 11, 2, 14, 11, 15, 2, 126, 1, 6, 12), Counter64()).setMaxAccess("readonly") if mibBuilder.loadTexts: hpnicfIPsecGlobalOutPktsV2.setStatus('current') hpnicfIPsecGlobalOutDropsV2 = MibScalar((1, 3, 6, 1, 4, 1, 11, 2, 14, 11, 15, 2, 126, 1, 6, 13), Counter64()).setMaxAccess("readonly") if mibBuilder.loadTexts: hpnicfIPsecGlobalOutDropsV2.setStatus('current') hpnicfIPsecGlobalOutEncryptFailsV2 = MibScalar((1, 3, 6, 1, 4, 1, 11, 2, 14, 11, 15, 2, 126, 1, 6, 14), Counter64()).setMaxAccess("readonly") if mibBuilder.loadTexts: hpnicfIPsecGlobalOutEncryptFailsV2.setStatus('current') hpnicfIPsecGlobalNoMemoryDropsV2 = MibScalar((1, 3, 6, 1, 4, 1, 11, 2, 14, 11, 15, 2, 126, 1, 6, 15), Counter64()).setMaxAccess("readonly") if mibBuilder.loadTexts: hpnicfIPsecGlobalNoMemoryDropsV2.setStatus('current') hpnicfIPsecGlobalNoFindSaDropsV2 = MibScalar((1, 3, 6, 1, 4, 1, 11, 2, 14, 11, 15, 2, 126, 1, 6, 16), Counter64()).setMaxAccess("readonly") if mibBuilder.loadTexts: hpnicfIPsecGlobalNoFindSaDropsV2.setStatus('current') hpnicfIPsecGlobalQueueFullDropsV2 = MibScalar((1, 3, 6, 1, 4, 1, 11, 2, 14, 11, 15, 2, 126, 1, 6, 17), Counter64()).setMaxAccess("readonly") if mibBuilder.loadTexts: hpnicfIPsecGlobalQueueFullDropsV2.setStatus('current') hpnicfIPsecGlobalInvalidLenDropsV2 = MibScalar((1, 3, 6, 1, 4, 1, 11, 2, 14, 11, 15, 2, 126, 1, 6, 18), Counter64()).setMaxAccess("readonly") if mibBuilder.loadTexts: hpnicfIPsecGlobalInvalidLenDropsV2.setStatus('current') hpnicfIPsecGlobalTooLongDropsV2 = MibScalar((1, 3, 6, 1, 4, 1, 11, 2, 14, 11, 15, 2, 126, 1, 6, 19), Counter64()).setMaxAccess("readonly") if mibBuilder.loadTexts: hpnicfIPsecGlobalTooLongDropsV2.setStatus('current') hpnicfIPsecGlobalInvalidSaDropsV2 = MibScalar((1, 3, 6, 1, 4, 1, 11, 2, 14, 11, 15, 2, 126, 1, 6, 20), Counter64()).setMaxAccess("readonly") if mibBuilder.loadTexts: hpnicfIPsecGlobalInvalidSaDropsV2.setStatus('current') hpnicfIPsecTrapObjectV2 = MibIdentifier((1, 3, 6, 1, 4, 1, 11, 2, 14, 11, 15, 2, 126, 1, 7)) hpnicfIPsecPolicyNameV2 = MibScalar((1, 3, 6, 1, 4, 1, 11, 2, 14, 11, 15, 2, 126, 1, 7, 1), DisplayString()).setMaxAccess("accessiblefornotify") if mibBuilder.loadTexts: hpnicfIPsecPolicyNameV2.setStatus('current') hpnicfIPsecPolicySeqNumV2 = MibScalar((1, 3, 6, 1, 4, 1, 11, 2, 14, 11, 15, 2, 126, 1, 7, 2), Integer32()).setMaxAccess("accessiblefornotify") if mibBuilder.loadTexts: hpnicfIPsecPolicySeqNumV2.setStatus('current') hpnicfIPsecPolicySizeV2 = MibScalar((1, 3, 6, 1, 4, 1, 11, 2, 14, 11, 15, 2, 126, 1, 7, 3), Integer32()).setMaxAccess("accessiblefornotify") if mibBuilder.loadTexts: hpnicfIPsecPolicySizeV2.setStatus('current') hpnicfIPsecTrapCntlV2 = MibIdentifier((1, 3, 6, 1, 4, 1, 11, 2, 14, 11, 15, 2, 126, 1, 8)) hpnicfIPsecTrapGlobalCntlV2 = MibScalar((1, 3, 6, 1, 4, 1, 11, 2, 14, 11, 15, 2, 126, 1, 8, 1), TruthValue()).setMaxAccess("readwrite") if mibBuilder.loadTexts: hpnicfIPsecTrapGlobalCntlV2.setStatus('current') hpnicfIPsecTunnelStartTrapCntlV2 = MibScalar((1, 3, 6, 1, 4, 1, 11, 2, 14, 11, 15, 2, 126, 1, 8, 2), TruthValue()).setMaxAccess("readwrite") if mibBuilder.loadTexts: hpnicfIPsecTunnelStartTrapCntlV2.setStatus('current') hpnicfIPsecTunnelStopTrapCntlV2 = MibScalar((1, 3, 6, 1, 4, 1, 11, 2, 14, 11, 15, 2, 126, 1, 8, 3), TruthValue()).setMaxAccess("readwrite") if mibBuilder.loadTexts: hpnicfIPsecTunnelStopTrapCntlV2.setStatus('current') hpnicfIPsecNoSaTrapCntlV2 = MibScalar((1, 3, 6, 1, 4, 1, 11, 2, 14, 11, 15, 2, 126, 1, 8, 4), TruthValue()).setMaxAccess("readwrite") if mibBuilder.loadTexts: hpnicfIPsecNoSaTrapCntlV2.setStatus('current') hpnicfIPsecAuthFailureTrapCntlV2 = MibScalar((1, 3, 6, 1, 4, 1, 11, 2, 14, 11, 15, 2, 126, 1, 8, 5), TruthValue()).setMaxAccess("readwrite") if mibBuilder.loadTexts: hpnicfIPsecAuthFailureTrapCntlV2.setStatus('current') hpnicfIPsecEncryFailureTrapCntlV2 = MibScalar((1, 3, 6, 1, 4, 1, 11, 2, 14, 11, 15, 2, 126, 1, 8, 6), TruthValue()).setMaxAccess("readwrite") if mibBuilder.loadTexts: hpnicfIPsecEncryFailureTrapCntlV2.setStatus('current') hpnicfIPsecDecryFailureTrapCntlV2 = MibScalar((1, 3, 6, 1, 4, 1, 11, 2, 14, 11, 15, 2, 126, 1, 8, 7), TruthValue()).setMaxAccess("readwrite") if mibBuilder.loadTexts: hpnicfIPsecDecryFailureTrapCntlV2.setStatus('current') hpnicfIPsecInvalidSaTrapCntlV2 = MibScalar((1, 3, 6, 1, 4, 1, 11, 2, 14, 11, 15, 2, 126, 1, 8, 8), TruthValue()).setMaxAccess("readwrite") if mibBuilder.loadTexts: hpnicfIPsecInvalidSaTrapCntlV2.setStatus('current') hpnicfIPsecPolicyAddTrapCntlV2 = MibScalar((1, 3, 6, 1, 4, 1, 11, 2, 14, 11, 15, 2, 126, 1, 8, 9), TruthValue()).setMaxAccess("readwrite") if mibBuilder.loadTexts: hpnicfIPsecPolicyAddTrapCntlV2.setStatus('current') hpnicfIPsecPolicyDelTrapCntlV2 = MibScalar((1, 3, 6, 1, 4, 1, 11, 2, 14, 11, 15, 2, 126, 1, 8, 10), TruthValue()).setMaxAccess("readwrite") if mibBuilder.loadTexts: hpnicfIPsecPolicyDelTrapCntlV2.setStatus('current') hpnicfIPsecPolicyAttachTrapCntlV2 = MibScalar((1, 3, 6, 1, 4, 1, 11, 2, 14, 11, 15, 2, 126, 1, 8, 11), TruthValue()).setMaxAccess("readwrite") if mibBuilder.loadTexts: hpnicfIPsecPolicyAttachTrapCntlV2.setStatus('current') hpnicfIPsecPolicyDetachTrapCntlV2 = MibScalar((1, 3, 6, 1, 4, 1, 11, 2, 14, 11, 15, 2, 126, 1, 8, 12), TruthValue()).setMaxAccess("readwrite") if mibBuilder.loadTexts: hpnicfIPsecPolicyDetachTrapCntlV2.setStatus('current') hpnicfIPsecTrapV2 = MibIdentifier((1, 3, 6, 1, 4, 1, 11, 2, 14, 11, 15, 2, 126, 1, 9)) hpnicfIPsecNotificationsV2 = MibIdentifier((1, 3, 6, 1, 4, 1, 11, 2, 14, 11, 15, 2, 126, 1, 9, 0)) hpnicfIPsecTunnelStartV2 = NotificationType((1, 3, 6, 1, 4, 1, 11, 2, 14, 11, 15, 2, 126, 1, 9, 0, 1)).setObjects(("HPN-ICF-IPSEC-MONITOR-V2-MIB", "hpnicfIPsecTunIndexV2"), ("HPN-ICF-IPSEC-MONITOR-V2-MIB", "hpnicfIPsecTunLocalAddrTypeV2"), ("HPN-ICF-IPSEC-MONITOR-V2-MIB", "hpnicfIPsecTunLocalAddrV2"), ("HPN-ICF-IPSEC-MONITOR-V2-MIB", "hpnicfIPsecTunRemoteAddrTypeV2"), ("HPN-ICF-IPSEC-MONITOR-V2-MIB", "hpnicfIPsecTunRemoteAddrV2"), ("HPN-ICF-IPSEC-MONITOR-V2-MIB", "hpnicfIPsecTunLifeTimeV2"), ("HPN-ICF-IPSEC-MONITOR-V2-MIB", "hpnicfIPsecTunLifeSizeV2")) if mibBuilder.loadTexts: hpnicfIPsecTunnelStartV2.setStatus('current') hpnicfIPsecTunnelStopV2 = NotificationType((1, 3, 6, 1, 4, 1, 11, 2, 14, 11, 15, 2, 126, 1, 9, 0, 2)).setObjects(("HPN-ICF-IPSEC-MONITOR-V2-MIB", "hpnicfIPsecTunIndexV2"), ("HPN-ICF-IPSEC-MONITOR-V2-MIB", "hpnicfIPsecTunLocalAddrTypeV2"), ("HPN-ICF-IPSEC-MONITOR-V2-MIB", "hpnicfIPsecTunLocalAddrV2"), ("HPN-ICF-IPSEC-MONITOR-V2-MIB", "hpnicfIPsecTunRemoteAddrTypeV2"), ("HPN-ICF-IPSEC-MONITOR-V2-MIB", "hpnicfIPsecTunRemoteAddrV2"), ("HPN-ICF-IPSEC-MONITOR-V2-MIB", "hpnicfIPsecTunActiveTimeV2")) if mibBuilder.loadTexts: hpnicfIPsecTunnelStopV2.setStatus('current') hpnicfIPsecNoSaFailureV2 = NotificationType((1, 3, 6, 1, 4, 1, 11, 2, 14, 11, 15, 2, 126, 1, 9, 0, 3)).setObjects(("HPN-ICF-IPSEC-MONITOR-V2-MIB", "hpnicfIPsecTunIndexV2"), ("HPN-ICF-IPSEC-MONITOR-V2-MIB", "hpnicfIPsecTunLocalAddrTypeV2"), ("HPN-ICF-IPSEC-MONITOR-V2-MIB", "hpnicfIPsecTunLocalAddrV2"), ("HPN-ICF-IPSEC-MONITOR-V2-MIB", "hpnicfIPsecTunRemoteAddrTypeV2"), ("HPN-ICF-IPSEC-MONITOR-V2-MIB", "hpnicfIPsecTunRemoteAddrV2")) if mibBuilder.loadTexts: hpnicfIPsecNoSaFailureV2.setStatus('current') hpnicfIPsecAuthFailFailureV2 = NotificationType((1, 3, 6, 1, 4, 1, 11, 2, 14, 11, 15, 2, 126, 1, 9, 0, 4)).setObjects(("HPN-ICF-IPSEC-MONITOR-V2-MIB", "hpnicfIPsecTunIndexV2"), ("HPN-ICF-IPSEC-MONITOR-V2-MIB", "hpnicfIPsecTunLocalAddrTypeV2"), ("HPN-ICF-IPSEC-MONITOR-V2-MIB", "hpnicfIPsecTunLocalAddrV2"), ("HPN-ICF-IPSEC-MONITOR-V2-MIB", "hpnicfIPsecTunRemoteAddrTypeV2"), ("HPN-ICF-IPSEC-MONITOR-V2-MIB", "hpnicfIPsecTunRemoteAddrV2")) if mibBuilder.loadTexts: hpnicfIPsecAuthFailFailureV2.setStatus('current') hpnicfIPsecEncryFailFailureV2 = NotificationType((1, 3, 6, 1, 4, 1, 11, 2, 14, 11, 15, 2, 126, 1, 9, 0, 5)).setObjects(("HPN-ICF-IPSEC-MONITOR-V2-MIB", "hpnicfIPsecTunIndexV2"), ("HPN-ICF-IPSEC-MONITOR-V2-MIB", "hpnicfIPsecTunLocalAddrTypeV2"), ("HPN-ICF-IPSEC-MONITOR-V2-MIB", "hpnicfIPsecTunLocalAddrV2"), ("HPN-ICF-IPSEC-MONITOR-V2-MIB", "hpnicfIPsecTunRemoteAddrTypeV2"), ("HPN-ICF-IPSEC-MONITOR-V2-MIB", "hpnicfIPsecTunRemoteAddrV2")) if mibBuilder.loadTexts: hpnicfIPsecEncryFailFailureV2.setStatus('current') hpnicfIPsecDecryFailFailureV2 = NotificationType((1, 3, 6, 1, 4, 1, 11, 2, 14, 11, 15, 2, 126, 1, 9, 0, 6)).setObjects(("HPN-ICF-IPSEC-MONITOR-V2-MIB", "hpnicfIPsecTunIndexV2"), ("HPN-ICF-IPSEC-MONITOR-V2-MIB", "hpnicfIPsecTunLocalAddrTypeV2"), ("HPN-ICF-IPSEC-MONITOR-V2-MIB", "hpnicfIPsecTunLocalAddrV2"), ("HPN-ICF-IPSEC-MONITOR-V2-MIB", "hpnicfIPsecTunRemoteAddrTypeV2"), ("HPN-ICF-IPSEC-MONITOR-V2-MIB", "hpnicfIPsecTunRemoteAddrV2")) if mibBuilder.loadTexts: hpnicfIPsecDecryFailFailureV2.setStatus('current') hpnicfIPsecInvalidSaFailureV2 = NotificationType((1, 3, 6, 1, 4, 1, 11, 2, 14, 11, 15, 2, 126, 1, 9, 0, 7)).setObjects(("HPN-ICF-IPSEC-MONITOR-V2-MIB", "hpnicfIPsecTunIndexV2"), ("HPN-ICF-IPSEC-MONITOR-V2-MIB", "hpnicfIPsecSaIndexV2"), ("HPN-ICF-IPSEC-MONITOR-V2-MIB", "hpnicfIPsecTunLocalAddrTypeV2"), ("HPN-ICF-IPSEC-MONITOR-V2-MIB", "hpnicfIPsecTunLocalAddrV2"), ("HPN-ICF-IPSEC-MONITOR-V2-MIB", "hpnicfIPsecTunRemoteAddrTypeV2"), ("HPN-ICF-IPSEC-MONITOR-V2-MIB", "hpnicfIPsecTunRemoteAddrV2"), ("HPN-ICF-IPSEC-MONITOR-V2-MIB", "hpnicfIPsecSaSpiValueV2")) if mibBuilder.loadTexts: hpnicfIPsecInvalidSaFailureV2.setStatus('current') hpnicfIPsecPolicyAddV2 = NotificationType((1, 3, 6, 1, 4, 1, 11, 2, 14, 11, 15, 2, 126, 1, 9, 0, 8)).setObjects(("HPN-ICF-IPSEC-MONITOR-V2-MIB", "hpnicfIPsecPolicyNameV2"), ("HPN-ICF-IPSEC-MONITOR-V2-MIB", "hpnicfIPsecPolicySeqNumV2"), ("HPN-ICF-IPSEC-MONITOR-V2-MIB", "hpnicfIPsecPolicySizeV2")) if mibBuilder.loadTexts: hpnicfIPsecPolicyAddV2.setStatus('current') hpnicfIPsecPolicyDelV2 = NotificationType((1, 3, 6, 1, 4, 1, 11, 2, 14, 11, 15, 2, 126, 1, 9, 0, 9)).setObjects(("HPN-ICF-IPSEC-MONITOR-V2-MIB", "hpnicfIPsecPolicyNameV2"), ("HPN-ICF-IPSEC-MONITOR-V2-MIB", "hpnicfIPsecPolicySeqNumV2"), ("HPN-ICF-IPSEC-MONITOR-V2-MIB", "hpnicfIPsecPolicySizeV2")) if mibBuilder.loadTexts: hpnicfIPsecPolicyDelV2.setStatus('current') hpnicfIPsecPolicyAttachV2 = NotificationType((1, 3, 6, 1, 4, 1, 11, 2, 14, 11, 15, 2, 126, 1, 9, 0, 10)).setObjects(("HPN-ICF-IPSEC-MONITOR-V2-MIB", "hpnicfIPsecPolicyNameV2"), ("HPN-ICF-IPSEC-MONITOR-V2-MIB", "hpnicfIPsecPolicySizeV2"), ("IF-MIB", "ifIndex")) if mibBuilder.loadTexts: hpnicfIPsecPolicyAttachV2.setStatus('current') hpnicfIPsecPolicyDetachV2 = NotificationType((1, 3, 6, 1, 4, 1, 11, 2, 14, 11, 15, 2, 126, 1, 9, 0, 11)).setObjects(("HPN-ICF-IPSEC-MONITOR-V2-MIB", "hpnicfIPsecPolicyNameV2"), ("HPN-ICF-IPSEC-MONITOR-V2-MIB", "hpnicfIPsecPolicySizeV2"), ("IF-MIB", "ifIndex")) if mibBuilder.loadTexts: hpnicfIPsecPolicyDetachV2.setStatus('current') hpnicfIPsecConformanceV2 = MibIdentifier((1, 3, 6, 1, 4, 1, 11, 2, 14, 11, 15, 2, 126, 2)) hpnicfIPsecCompliancesV2 = MibIdentifier((1, 3, 6, 1, 4, 1, 11, 2, 14, 11, 15, 2, 126, 2, 1)) hpnicfIPsecGroupsV2 = MibIdentifier((1, 3, 6, 1, 4, 1, 11, 2, 14, 11, 15, 2, 126, 2, 2)) hpnicfIPsecComplianceV2 = ModuleCompliance((1, 3, 6, 1, 4, 1, 11, 2, 14, 11, 15, 2, 126, 2, 1, 1)).setObjects(("HPN-ICF-IPSEC-MONITOR-V2-MIB", "hpnicfIPsecScalarObjectsGroupV2"), ("HPN-ICF-IPSEC-MONITOR-V2-MIB", "hpnicfIPsecTunnelTableGroupV2"), ("HPN-ICF-IPSEC-MONITOR-V2-MIB", "hpnicfIPsecTunnelStatGroupV2"), ("HPN-ICF-IPSEC-MONITOR-V2-MIB", "hpnicfIPsecSaGroupV2"), ("HPN-ICF-IPSEC-MONITOR-V2-MIB", "hpnicfIPsecTrafficTableGroupV2"), ("HPN-ICF-IPSEC-MONITOR-V2-MIB", "hpnicfIPsecGlobalStatsGroupV2"), ("HPN-ICF-IPSEC-MONITOR-V2-MIB", "hpnicfIPsecTrapObjectGroupV2"), ("HPN-ICF-IPSEC-MONITOR-V2-MIB", "hpnicfIPsecTrapCntlGroupV2"), ("HPN-ICF-IPSEC-MONITOR-V2-MIB", "hpnicfIPsecTrapGroupV2")) if getattr(mibBuilder, 'version', (0, 0, 0)) > (4, 4, 0): hpnicfIPsecComplianceV2 = hpnicfIPsecComplianceV2.setStatus('current') hpnicfIPsecScalarObjectsGroupV2 = ObjectGroup((1, 3, 6, 1, 4, 1, 11, 2, 14, 11, 15, 2, 126, 2, 2, 1)).setObjects(("HPN-ICF-IPSEC-MONITOR-V2-MIB", "hpnicfIPsecMIBVersion")) if getattr(mibBuilder, 'version', (0, 0, 0)) > (4, 4, 0): hpnicfIPsecScalarObjectsGroupV2 = hpnicfIPsecScalarObjectsGroupV2.setStatus('current') hpnicfIPsecTunnelTableGroupV2 = ObjectGroup((1, 3, 6, 1, 4, 1, 11, 2, 14, 11, 15, 2, 126, 2, 2, 2)).setObjects(("HPN-ICF-IPSEC-MONITOR-V2-MIB", "hpnicfIPsecTunIfIndexV2"), ("HPN-ICF-IPSEC-MONITOR-V2-MIB", "hpnicfIPsecTunIKETunnelIndexV2"), ("HPN-ICF-IPSEC-MONITOR-V2-MIB", "hpnicfIPsecTunIKETunLocalIDTypeV2"), ("HPN-ICF-IPSEC-MONITOR-V2-MIB", "hpnicfIPsecTunIKETunLocalIDVal1V2"), ("HPN-ICF-IPSEC-MONITOR-V2-MIB", "hpnicfIPsecTunIKETunLocalIDVal2V2"), ("HPN-ICF-IPSEC-MONITOR-V2-MIB", "hpnicfIPsecTunIKETunRemoteIDTypeV2"), ("HPN-ICF-IPSEC-MONITOR-V2-MIB", "hpnicfIPsecTunIKETunRemoteIDVal1V2"), ("HPN-ICF-IPSEC-MONITOR-V2-MIB", "hpnicfIPsecTunIKETunRemoteIDVal2V2"), ("HPN-ICF-IPSEC-MONITOR-V2-MIB", "hpnicfIPsecTunLocalAddrTypeV2"), ("HPN-ICF-IPSEC-MONITOR-V2-MIB", "hpnicfIPsecTunLocalAddrV2"), ("HPN-ICF-IPSEC-MONITOR-V2-MIB", "hpnicfIPsecTunRemoteAddrTypeV2"), ("HPN-ICF-IPSEC-MONITOR-V2-MIB", "hpnicfIPsecTunRemoteAddrV2"), ("HPN-ICF-IPSEC-MONITOR-V2-MIB", "hpnicfIPsecTunKeyTypeV2"), ("HPN-ICF-IPSEC-MONITOR-V2-MIB", "hpnicfIPsecTunEncapModeV2"), ("HPN-ICF-IPSEC-MONITOR-V2-MIB", "hpnicfIPsecTunInitiatorV2"), ("HPN-ICF-IPSEC-MONITOR-V2-MIB", "hpnicfIPsecTunLifeSizeV2"), ("HPN-ICF-IPSEC-MONITOR-V2-MIB", "hpnicfIPsecTunLifeTimeV2"), ("HPN-ICF-IPSEC-MONITOR-V2-MIB", "hpnicfIPsecTunRemainTimeV2"), ("HPN-ICF-IPSEC-MONITOR-V2-MIB", "hpnicfIPsecTunActiveTimeV2"), ("HPN-ICF-IPSEC-MONITOR-V2-MIB", "hpnicfIPsecTunRemainSizeV2"), ("HPN-ICF-IPSEC-MONITOR-V2-MIB", "hpnicfIPsecTunTotalRefreshesV2"), ("HPN-ICF-IPSEC-MONITOR-V2-MIB", "hpnicfIPsecTunCurrentSaInstancesV2"), ("HPN-ICF-IPSEC-MONITOR-V2-MIB", "hpnicfIPsecTunInSaEncryptAlgoV2"), ("HPN-ICF-IPSEC-MONITOR-V2-MIB", "hpnicfIPsecTunInSaAhAuthAlgoV2"), ("HPN-ICF-IPSEC-MONITOR-V2-MIB", "hpnicfIPsecTunInSaEspAuthAlgoV2"), ("HPN-ICF-IPSEC-MONITOR-V2-MIB", "hpnicfIPsecTunDiffHellmanGrpV2"), ("HPN-ICF-IPSEC-MONITOR-V2-MIB", "hpnicfIPsecTunOutSaEncryptAlgoV2"), ("HPN-ICF-IPSEC-MONITOR-V2-MIB", "hpnicfIPsecTunOutSaAhAuthAlgoV2"), ("HPN-ICF-IPSEC-MONITOR-V2-MIB", "hpnicfIPsecTunOutSaEspAuthAlgoV2"), ("HPN-ICF-IPSEC-MONITOR-V2-MIB", "hpnicfIPsecTunPolicyNameV2"), ("HPN-ICF-IPSEC-MONITOR-V2-MIB", "hpnicfIPsecTunPolicyNumV2"), ("HPN-ICF-IPSEC-MONITOR-V2-MIB", "hpnicfIPsecTunStatusV2")) if getattr(mibBuilder, 'version', (0, 0, 0)) > (4, 4, 0): hpnicfIPsecTunnelTableGroupV2 = hpnicfIPsecTunnelTableGroupV2.setStatus('current') hpnicfIPsecTunnelStatGroupV2 = ObjectGroup((1, 3, 6, 1, 4, 1, 11, 2, 14, 11, 15, 2, 126, 2, 2, 3)).setObjects(("HPN-ICF-IPSEC-MONITOR-V2-MIB", "hpnicfIPsecTunInOctetsV2"), ("HPN-ICF-IPSEC-MONITOR-V2-MIB", "hpnicfIPsecTunInDecompOctetsV2"), ("HPN-ICF-IPSEC-MONITOR-V2-MIB", "hpnicfIPsecTunInPktsV2"), ("HPN-ICF-IPSEC-MONITOR-V2-MIB", "hpnicfIPsecTunInDropPktsV2"), ("HPN-ICF-IPSEC-MONITOR-V2-MIB", "hpnicfIPsecTunInReplayDropPktsV2"), ("HPN-ICF-IPSEC-MONITOR-V2-MIB", "hpnicfIPsecTunInAuthFailsV2"), ("HPN-ICF-IPSEC-MONITOR-V2-MIB", "hpnicfIPsecTunInDecryptFailsV2"), ("HPN-ICF-IPSEC-MONITOR-V2-MIB", "hpnicfIPsecTunOutOctetsV2"), ("HPN-ICF-IPSEC-MONITOR-V2-MIB", "hpnicfIPsecTunOutUncompOctetsV2"), ("HPN-ICF-IPSEC-MONITOR-V2-MIB", "hpnicfIPsecTunOutPktsV2"), ("HPN-ICF-IPSEC-MONITOR-V2-MIB", "hpnicfIPsecTunOutDropPktsV2"), ("HPN-ICF-IPSEC-MONITOR-V2-MIB", "hpnicfIPsecTunOutEncryptFailsV2"), ("HPN-ICF-IPSEC-MONITOR-V2-MIB", "hpnicfIPsecTunNoMemoryDropPktsV2"), ("HPN-ICF-IPSEC-MONITOR-V2-MIB", "hpnicfIPsecTunQueueFullDropPktsV2"), ("HPN-ICF-IPSEC-MONITOR-V2-MIB", "hpnicfIPsecTunInvalidLenDropPktsV2"), ("HPN-ICF-IPSEC-MONITOR-V2-MIB", "hpnicfIPsecTunTooLongDropPktsV2"), ("HPN-ICF-IPSEC-MONITOR-V2-MIB", "hpnicfIPsecTunInvalidSaDropPktsV2")) if getattr(mibBuilder, 'version', (0, 0, 0)) > (4, 4, 0): hpnicfIPsecTunnelStatGroupV2 = hpnicfIPsecTunnelStatGroupV2.setStatus('current') hpnicfIPsecSaGroupV2 = ObjectGroup((1, 3, 6, 1, 4, 1, 11, 2, 14, 11, 15, 2, 126, 2, 2, 4)).setObjects(("HPN-ICF-IPSEC-MONITOR-V2-MIB", "hpnicfIPsecSaDirectionV2"), ("HPN-ICF-IPSEC-MONITOR-V2-MIB", "hpnicfIPsecSaSpiValueV2"), ("HPN-ICF-IPSEC-MONITOR-V2-MIB", "hpnicfIPsecSaSecProtocolV2"), ("HPN-ICF-IPSEC-MONITOR-V2-MIB", "hpnicfIPsecSaEncryptAlgoV2"), ("HPN-ICF-IPSEC-MONITOR-V2-MIB", "hpnicfIPsecSaAuthAlgoV2"), ("HPN-ICF-IPSEC-MONITOR-V2-MIB", "hpnicfIPsecSaStatusV2")) if getattr(mibBuilder, 'version', (0, 0, 0)) > (4, 4, 0): hpnicfIPsecSaGroupV2 = hpnicfIPsecSaGroupV2.setStatus('current') hpnicfIPsecTrafficTableGroupV2 = ObjectGroup((1, 3, 6, 1, 4, 1, 11, 2, 14, 11, 15, 2, 126, 2, 2, 5)).setObjects(("HPN-ICF-IPSEC-MONITOR-V2-MIB", "hpnicfIPsecTrafficLocalTypeV2"), ("HPN-ICF-IPSEC-MONITOR-V2-MIB", "hpnicfIPsecTrafficLocalAddr1TypeV2"), ("HPN-ICF-IPSEC-MONITOR-V2-MIB", "hpnicfIPsecTrafficLocalAddr1V2"), ("HPN-ICF-IPSEC-MONITOR-V2-MIB", "hpnicfIPsecTrafficLocalAddr2TypeV2"), ("HPN-ICF-IPSEC-MONITOR-V2-MIB", "hpnicfIPsecTrafficLocalAddr2V2"), ("HPN-ICF-IPSEC-MONITOR-V2-MIB", "hpnicfIPsecTrafficLocalProtocol1V2"), ("HPN-ICF-IPSEC-MONITOR-V2-MIB", "hpnicfIPsecTrafficLocalProtocol2V2"), ("HPN-ICF-IPSEC-MONITOR-V2-MIB", "hpnicfIPsecTrafficLocalPort1V2"), ("HPN-ICF-IPSEC-MONITOR-V2-MIB", "hpnicfIPsecTrafficLocalPort2V2"), ("HPN-ICF-IPSEC-MONITOR-V2-MIB", "hpnicfIPsecTrafficRemoteTypeV2"), ("HPN-ICF-IPSEC-MONITOR-V2-MIB", "hpnicfIPsecTrafficRemAddr1TypeV2"), ("HPN-ICF-IPSEC-MONITOR-V2-MIB", "hpnicfIPsecTrafficRemAddr1V2"), ("HPN-ICF-IPSEC-MONITOR-V2-MIB", "hpnicfIPsecTrafficRemAddr2TypeV2"), ("HPN-ICF-IPSEC-MONITOR-V2-MIB", "hpnicfIPsecTrafficRemAddr2V2"), ("HPN-ICF-IPSEC-MONITOR-V2-MIB", "hpnicfIPsecTrafficRemoPro1V2"), ("HPN-ICF-IPSEC-MONITOR-V2-MIB", "hpnicfIPsecTrafficRemoPro2V2"), ("HPN-ICF-IPSEC-MONITOR-V2-MIB", "hpnicfIPsecTrafficRemPort1V2"), ("HPN-ICF-IPSEC-MONITOR-V2-MIB", "hpnicfIPsecTrafficRemPort2V2")) if getattr(mibBuilder, 'version', (0, 0, 0)) > (4, 4, 0): hpnicfIPsecTrafficTableGroupV2 = hpnicfIPsecTrafficTableGroupV2.setStatus('current') hpnicfIPsecGlobalStatsGroupV2 = ObjectGroup((1, 3, 6, 1, 4, 1, 11, 2, 14, 11, 15, 2, 126, 2, 2, 6)).setObjects(("HPN-ICF-IPSEC-MONITOR-V2-MIB", "hpnicfIPsecGlobalActiveTunnelsV2"), ("HPN-ICF-IPSEC-MONITOR-V2-MIB", "hpnicfIPsecGlobalActiveSasV2"), ("HPN-ICF-IPSEC-MONITOR-V2-MIB", "hpnicfIPsecGlobalInOctetsV2"), ("HPN-ICF-IPSEC-MONITOR-V2-MIB", "hpnicfIPsecGlobalInDecompOctetsV2"), ("HPN-ICF-IPSEC-MONITOR-V2-MIB", "hpnicfIPsecGlobalInPktsV2"), ("HPN-ICF-IPSEC-MONITOR-V2-MIB", "hpnicfIPsecGlobalInDropsV2"), ("HPN-ICF-IPSEC-MONITOR-V2-MIB", "hpnicfIPsecGlobalInReplayDropsV2"), ("HPN-ICF-IPSEC-MONITOR-V2-MIB", "hpnicfIPsecGlobalInAuthFailsV2"), ("HPN-ICF-IPSEC-MONITOR-V2-MIB", "hpnicfIPsecGlobalInDecryptFailsV2"), ("HPN-ICF-IPSEC-MONITOR-V2-MIB", "hpnicfIPsecGlobalOutOctetsV2"), ("HPN-ICF-IPSEC-MONITOR-V2-MIB", "hpnicfIPsecGlobalOutUncompOctetsV2"), ("HPN-ICF-IPSEC-MONITOR-V2-MIB", "hpnicfIPsecGlobalOutPktsV2"), ("HPN-ICF-IPSEC-MONITOR-V2-MIB", "hpnicfIPsecGlobalOutDropsV2"), ("HPN-ICF-IPSEC-MONITOR-V2-MIB", "hpnicfIPsecGlobalOutEncryptFailsV2"), ("HPN-ICF-IPSEC-MONITOR-V2-MIB", "hpnicfIPsecGlobalNoMemoryDropsV2"), ("HPN-ICF-IPSEC-MONITOR-V2-MIB", "hpnicfIPsecGlobalNoFindSaDropsV2"), ("HPN-ICF-IPSEC-MONITOR-V2-MIB", "hpnicfIPsecGlobalQueueFullDropsV2"), ("HPN-ICF-IPSEC-MONITOR-V2-MIB", "hpnicfIPsecGlobalInvalidLenDropsV2"), ("HPN-ICF-IPSEC-MONITOR-V2-MIB", "hpnicfIPsecGlobalTooLongDropsV2"), ("HPN-ICF-IPSEC-MONITOR-V2-MIB", "hpnicfIPsecGlobalInvalidSaDropsV2")) if getattr(mibBuilder, 'version', (0, 0, 0)) > (4, 4, 0): hpnicfIPsecGlobalStatsGroupV2 = hpnicfIPsecGlobalStatsGroupV2.setStatus('current') hpnicfIPsecTrapObjectGroupV2 = ObjectGroup((1, 3, 6, 1, 4, 1, 11, 2, 14, 11, 15, 2, 126, 2, 2, 7)).setObjects(("HPN-ICF-IPSEC-MONITOR-V2-MIB", "hpnicfIPsecPolicyNameV2"), ("HPN-ICF-IPSEC-MONITOR-V2-MIB", "hpnicfIPsecPolicySeqNumV2"), ("HPN-ICF-IPSEC-MONITOR-V2-MIB", "hpnicfIPsecPolicySizeV2")) if getattr(mibBuilder, 'version', (0, 0, 0)) > (4, 4, 0): hpnicfIPsecTrapObjectGroupV2 = hpnicfIPsecTrapObjectGroupV2.setStatus('current') hpnicfIPsecTrapCntlGroupV2 = ObjectGroup((1, 3, 6, 1, 4, 1, 11, 2, 14, 11, 15, 2, 126, 2, 2, 8)).setObjects(("HPN-ICF-IPSEC-MONITOR-V2-MIB", "hpnicfIPsecTrapGlobalCntlV2"), ("HPN-ICF-IPSEC-MONITOR-V2-MIB", "hpnicfIPsecTunnelStartTrapCntlV2"), ("HPN-ICF-IPSEC-MONITOR-V2-MIB", "hpnicfIPsecTunnelStopTrapCntlV2"), ("HPN-ICF-IPSEC-MONITOR-V2-MIB", "hpnicfIPsecNoSaTrapCntlV2"), ("HPN-ICF-IPSEC-MONITOR-V2-MIB", "hpnicfIPsecAuthFailureTrapCntlV2"), ("HPN-ICF-IPSEC-MONITOR-V2-MIB", "hpnicfIPsecEncryFailureTrapCntlV2"), ("HPN-ICF-IPSEC-MONITOR-V2-MIB", "hpnicfIPsecDecryFailureTrapCntlV2"), ("HPN-ICF-IPSEC-MONITOR-V2-MIB", "hpnicfIPsecInvalidSaTrapCntlV2"), ("HPN-ICF-IPSEC-MONITOR-V2-MIB", "hpnicfIPsecPolicyAddTrapCntlV2"), ("HPN-ICF-IPSEC-MONITOR-V2-MIB", "hpnicfIPsecPolicyDelTrapCntlV2"), ("HPN-ICF-IPSEC-MONITOR-V2-MIB", "hpnicfIPsecPolicyAttachTrapCntlV2"), ("HPN-ICF-IPSEC-MONITOR-V2-MIB", "hpnicfIPsecPolicyDetachTrapCntlV2")) if getattr(mibBuilder, 'version', (0, 0, 0)) > (4, 4, 0): hpnicfIPsecTrapCntlGroupV2 = hpnicfIPsecTrapCntlGroupV2.setStatus('current') hpnicfIPsecTrapGroupV2 = NotificationGroup((1, 3, 6, 1, 4, 1, 11, 2, 14, 11, 15, 2, 126, 2, 2, 9)).setObjects(("HPN-ICF-IPSEC-MONITOR-V2-MIB", "hpnicfIPsecTunnelStartV2"), ("HPN-ICF-IPSEC-MONITOR-V2-MIB", "hpnicfIPsecTunnelStopV2"), ("HPN-ICF-IPSEC-MONITOR-V2-MIB", "hpnicfIPsecNoSaFailureV2"), ("HPN-ICF-IPSEC-MONITOR-V2-MIB", "hpnicfIPsecAuthFailFailureV2"), ("HPN-ICF-IPSEC-MONITOR-V2-MIB", "hpnicfIPsecEncryFailFailureV2"), ("HPN-ICF-IPSEC-MONITOR-V2-MIB", "hpnicfIPsecDecryFailFailureV2"), ("HPN-ICF-IPSEC-MONITOR-V2-MIB", "hpnicfIPsecInvalidSaFailureV2"), ("HPN-ICF-IPSEC-MONITOR-V2-MIB", "hpnicfIPsecPolicyAddV2"), ("HPN-ICF-IPSEC-MONITOR-V2-MIB", "hpnicfIPsecPolicyDelV2"), ("HPN-ICF-IPSEC-MONITOR-V2-MIB", "hpnicfIPsecPolicyAttachV2"), ("HPN-ICF-IPSEC-MONITOR-V2-MIB", "hpnicfIPsecPolicyDetachV2")) if getattr(mibBuilder, 'version', (0, 0, 0)) > (4, 4, 0): hpnicfIPsecTrapGroupV2 = hpnicfIPsecTrapGroupV2.setStatus('current') mibBuilder.exportSymbols("HPN-ICF-IPSEC-MONITOR-V2-MIB", HpnicfIPsecSaProtocolV2=HpnicfIPsecSaProtocolV2, hpnicfIPsecTunInReplayDropPktsV2=hpnicfIPsecTunInReplayDropPktsV2, hpnicfIPsecTunnelStatV2Entry=hpnicfIPsecTunnelStatV2Entry, hpnicfIPsecTunTooLongDropPktsV2=hpnicfIPsecTunTooLongDropPktsV2, hpnicfIPsecTunnelTableGroupV2=hpnicfIPsecTunnelTableGroupV2, hpnicfIPsecTrafficRemoteTypeV2=hpnicfIPsecTrafficRemoteTypeV2, HpnicfIPsecAuthAlgoV2=HpnicfIPsecAuthAlgoV2, hpnicfIPsecTunOutPktsV2=hpnicfIPsecTunOutPktsV2, hpnicfIPsecNoSaFailureV2=hpnicfIPsecNoSaFailureV2, hpnicfIPsecEncryFailFailureV2=hpnicfIPsecEncryFailFailureV2, hpnicfIPsecTrafficLocalAddr2TypeV2=hpnicfIPsecTrafficLocalAddr2TypeV2, hpnicfIPsecSaDirectionV2=hpnicfIPsecSaDirectionV2, hpnicfIPsecTunTotalRefreshesV2=hpnicfIPsecTunTotalRefreshesV2, hpnicfIPsecTrafficLocalAddr2V2=hpnicfIPsecTrafficLocalAddr2V2, hpnicfIPsecPolicyAddV2=hpnicfIPsecPolicyAddV2, hpnicfIPsecSaAuthAlgoV2=hpnicfIPsecSaAuthAlgoV2, hpnicfIPsecGlobalOutPktsV2=hpnicfIPsecGlobalOutPktsV2, hpnicfIPsecTunNoMemoryDropPktsV2=hpnicfIPsecTunNoMemoryDropPktsV2, hpnicfIPsecTunLocalAddrTypeV2=hpnicfIPsecTunLocalAddrTypeV2, hpnicfIPsecDecryFailFailureV2=hpnicfIPsecDecryFailFailureV2, hpnicfIPsecSaGroupV2=hpnicfIPsecSaGroupV2, hpnicfIPsecTunOutUncompOctetsV2=hpnicfIPsecTunOutUncompOctetsV2, hpnicfIPsecTunInDecryptFailsV2=hpnicfIPsecTunInDecryptFailsV2, hpnicfIPsecTunInSaEspAuthAlgoV2=hpnicfIPsecTunInSaEspAuthAlgoV2, hpnicfIPsecGlobalInPktsV2=hpnicfIPsecGlobalInPktsV2, hpnicfIPsecGlobalOutEncryptFailsV2=hpnicfIPsecGlobalOutEncryptFailsV2, hpnicfIPsecGroupsV2=hpnicfIPsecGroupsV2, hpnicfIPsecPolicyNameV2=hpnicfIPsecPolicyNameV2, hpnicfIPsecTrafficRemAddr1TypeV2=hpnicfIPsecTrafficRemAddr1TypeV2, hpnicfIPsecTrafficRemPort1V2=hpnicfIPsecTrafficRemPort1V2, hpnicfIPsecMIBVersion=hpnicfIPsecMIBVersion, hpnicfIPsecTunIndexV2=hpnicfIPsecTunIndexV2, hpnicfIPsecTunnelStartV2=hpnicfIPsecTunnelStartV2, hpnicfIPsecGlobalInvalidSaDropsV2=hpnicfIPsecGlobalInvalidSaDropsV2, hpnicfIPsecTunRemainSizeV2=hpnicfIPsecTunRemainSizeV2, hpnicfIPsecTrafficRemAddr2TypeV2=hpnicfIPsecTrafficRemAddr2TypeV2, hpnicfIPsecTunInAuthFailsV2=hpnicfIPsecTunInAuthFailsV2, hpnicfIPsecGlobalTooLongDropsV2=hpnicfIPsecGlobalTooLongDropsV2, hpnicfIPsecInvalidSaTrapCntlV2=hpnicfIPsecInvalidSaTrapCntlV2, hpnicfIPsecTrafficRemPort2V2=hpnicfIPsecTrafficRemPort2V2, hpnicfIPsecGlobalInAuthFailsV2=hpnicfIPsecGlobalInAuthFailsV2, hpnicfIPsecTunOutDropPktsV2=hpnicfIPsecTunOutDropPktsV2, hpnicfIPsecPolicyAttachTrapCntlV2=hpnicfIPsecPolicyAttachTrapCntlV2, hpnicfIPsecTunDiffHellmanGrpV2=hpnicfIPsecTunDiffHellmanGrpV2, hpnicfIPsecTrafficLocalProtocol1V2=hpnicfIPsecTrafficLocalProtocol1V2, hpnicfIPsecTunnelV2Table=hpnicfIPsecTunnelV2Table, hpnicfIPsecTrapGroupV2=hpnicfIPsecTrapGroupV2, hpnicfIPsecTrafficRemAddr2V2=hpnicfIPsecTrafficRemAddr2V2, hpnicfIPsecTunQueueFullDropPktsV2=hpnicfIPsecTunQueueFullDropPktsV2, hpnicfIPsecTunKeyTypeV2=hpnicfIPsecTunKeyTypeV2, hpnicfIPsecTunInvalidSaDropPktsV2=hpnicfIPsecTunInvalidSaDropPktsV2, hpnicfIPsecGlobalOutUncompOctetsV2=hpnicfIPsecGlobalOutUncompOctetsV2, hpnicfIPsecTrafficTableGroupV2=hpnicfIPsecTrafficTableGroupV2, hpnicfIPsecTrafficRemoPro1V2=hpnicfIPsecTrafficRemoPro1V2, hpnicfIPsecTunPolicyNameV2=hpnicfIPsecTunPolicyNameV2, hpnicfIPsecTunInOctetsV2=hpnicfIPsecTunInOctetsV2, HpnicfIPsecDiffHellmanGrpV2=HpnicfIPsecDiffHellmanGrpV2, hpnicfIPsecSaIndexV2=hpnicfIPsecSaIndexV2, PYSNMP_MODULE_ID=hpnicfIPsecMonitorV2, hpnicfIPsecTunIfIndexV2=hpnicfIPsecTunIfIndexV2, hpnicfIPsecSaSecProtocolV2=hpnicfIPsecSaSecProtocolV2, hpnicfIPsecTunIKETunLocalIDVal1V2=hpnicfIPsecTunIKETunLocalIDVal1V2, hpnicfIPsecSaEncryptAlgoV2=hpnicfIPsecSaEncryptAlgoV2, hpnicfIPsecPolicySeqNumV2=hpnicfIPsecPolicySeqNumV2, hpnicfIPsecTunOutSaEncryptAlgoV2=hpnicfIPsecTunOutSaEncryptAlgoV2, hpnicfIPsecComplianceV2=hpnicfIPsecComplianceV2, hpnicfIPsecTunOutOctetsV2=hpnicfIPsecTunOutOctetsV2, hpnicfIPsecGlobalOutOctetsV2=hpnicfIPsecGlobalOutOctetsV2, hpnicfIPsecEncryFailureTrapCntlV2=hpnicfIPsecEncryFailureTrapCntlV2, hpnicfIPsecTunInDecompOctetsV2=hpnicfIPsecTunInDecompOctetsV2, hpnicfIPsecPolicyAttachV2=hpnicfIPsecPolicyAttachV2, hpnicfIPsecGlobalInOctetsV2=hpnicfIPsecGlobalInOctetsV2, hpnicfIPsecGlobalInReplayDropsV2=hpnicfIPsecGlobalInReplayDropsV2, hpnicfIPsecTunInSaEncryptAlgoV2=hpnicfIPsecTunInSaEncryptAlgoV2, hpnicfIPsecGlobalNoMemoryDropsV2=hpnicfIPsecGlobalNoMemoryDropsV2, hpnicfIPsecTrafficLocalAddr1V2=hpnicfIPsecTrafficLocalAddr1V2, hpnicfIPsecTrafficLocalAddr1TypeV2=hpnicfIPsecTrafficLocalAddr1TypeV2, hpnicfIPsecTunIKETunRemoteIDVal2V2=hpnicfIPsecTunIKETunRemoteIDVal2V2, hpnicfIPsecTunCurrentSaInstancesV2=hpnicfIPsecTunCurrentSaInstancesV2, hpnicfIPsecGlobalInDropsV2=hpnicfIPsecGlobalInDropsV2, hpnicfIPsecPolicyDelV2=hpnicfIPsecPolicyDelV2, hpnicfIPsecTrafficLocalPort1V2=hpnicfIPsecTrafficLocalPort1V2, hpnicfIPsecTunInvalidLenDropPktsV2=hpnicfIPsecTunInvalidLenDropPktsV2, hpnicfIPsecPolicyAddTrapCntlV2=hpnicfIPsecPolicyAddTrapCntlV2, hpnicfIPsecTrapV2=hpnicfIPsecTrapV2, hpnicfIPsecMonitorV2=hpnicfIPsecMonitorV2, hpnicfIPsecTrafficV2Table=hpnicfIPsecTrafficV2Table, hpnicfIPsecTunOutEncryptFailsV2=hpnicfIPsecTunOutEncryptFailsV2, hpnicfIPsecTrafficLocalTypeV2=hpnicfIPsecTrafficLocalTypeV2, hpnicfIPsecTrapObjectV2=hpnicfIPsecTrapObjectV2, hpnicfIPsecPolicyDetachV2=hpnicfIPsecPolicyDetachV2, hpnicfIPsecGlobalInvalidLenDropsV2=hpnicfIPsecGlobalInvalidLenDropsV2, hpnicfIPsecTunInSaAhAuthAlgoV2=hpnicfIPsecTunInSaAhAuthAlgoV2, hpnicfIPsecSaV2Table=hpnicfIPsecSaV2Table, hpnicfIPsecPolicySizeV2=hpnicfIPsecPolicySizeV2, hpnicfIPsecTunIKETunRemoteIDTypeV2=hpnicfIPsecTunIKETunRemoteIDTypeV2, hpnicfIPsecAuthFailureTrapCntlV2=hpnicfIPsecAuthFailureTrapCntlV2, hpnicfIPsecTunIKETunRemoteIDVal1V2=hpnicfIPsecTunIKETunRemoteIDVal1V2, hpnicfIPsecObjectsV2=hpnicfIPsecObjectsV2, hpnicfIPsecGlobalActiveSasV2=hpnicfIPsecGlobalActiveSasV2, hpnicfIPsecTunLifeSizeV2=hpnicfIPsecTunLifeSizeV2, hpnicfIPsecTrafficLocalProtocol2V2=hpnicfIPsecTrafficLocalProtocol2V2, hpnicfIPsecGlobalInDecompOctetsV2=hpnicfIPsecGlobalInDecompOctetsV2, hpnicfIPsecTrafficV2Entry=hpnicfIPsecTrafficV2Entry, HpnicfIPsecIDTypeV2=HpnicfIPsecIDTypeV2, hpnicfIPsecTunStatusV2=hpnicfIPsecTunStatusV2, hpnicfIPsecCompliancesV2=hpnicfIPsecCompliancesV2, HpnicfIPsecEncryptAlgoV2=HpnicfIPsecEncryptAlgoV2, hpnicfIPsecTrafficRemoPro2V2=hpnicfIPsecTrafficRemoPro2V2, hpnicfIPsecTrafficRemAddr1V2=hpnicfIPsecTrafficRemAddr1V2, hpnicfIPsecPolicyDelTrapCntlV2=hpnicfIPsecPolicyDelTrapCntlV2, hpnicfIPsecTunOutSaAhAuthAlgoV2=hpnicfIPsecTunOutSaAhAuthAlgoV2, hpnicfIPsecSaStatusV2=hpnicfIPsecSaStatusV2, hpnicfIPsecGlobalOutDropsV2=hpnicfIPsecGlobalOutDropsV2, hpnicfIPsecTunRemoteAddrTypeV2=hpnicfIPsecTunRemoteAddrTypeV2, hpnicfIPsecTrapObjectGroupV2=hpnicfIPsecTrapObjectGroupV2, hpnicfIPsecTunEncapModeV2=hpnicfIPsecTunEncapModeV2, hpnicfIPsecTunnelStatGroupV2=hpnicfIPsecTunnelStatGroupV2, hpnicfIPsecTunLifeTimeV2=hpnicfIPsecTunLifeTimeV2, hpnicfIPsecTunnelStopTrapCntlV2=hpnicfIPsecTunnelStopTrapCntlV2, hpnicfIPsecPolicyDetachTrapCntlV2=hpnicfIPsecPolicyDetachTrapCntlV2, hpnicfIPsecTunOutSaEspAuthAlgoV2=hpnicfIPsecTunOutSaEspAuthAlgoV2, HpnicfIPsecTrafficTypeV2=HpnicfIPsecTrafficTypeV2, hpnicfIPsecTunInitiatorV2=hpnicfIPsecTunInitiatorV2, hpnicfIPsecTunInPktsV2=hpnicfIPsecTunInPktsV2, hpnicfIPsecSaV2Entry=hpnicfIPsecSaV2Entry, hpnicfIPsecTunIKETunLocalIDVal2V2=hpnicfIPsecTunIKETunLocalIDVal2V2, hpnicfIPsecGlobalActiveTunnelsV2=hpnicfIPsecGlobalActiveTunnelsV2, hpnicfIPsecAuthFailFailureV2=hpnicfIPsecAuthFailFailureV2, hpnicfIPsecTunnelStatV2Table=hpnicfIPsecTunnelStatV2Table, hpnicfIPsecTunPolicyNumV2=hpnicfIPsecTunPolicyNumV2, hpnicfIPsecGlobalQueueFullDropsV2=hpnicfIPsecGlobalQueueFullDropsV2, HpnicfIPsecNegoTypeV2=HpnicfIPsecNegoTypeV2, hpnicfIPsecInvalidSaFailureV2=hpnicfIPsecInvalidSaFailureV2, hpnicfIPsecGlobalStatsGroupV2=hpnicfIPsecGlobalStatsGroupV2, hpnicfIPsecTunnelV2Entry=hpnicfIPsecTunnelV2Entry, hpnicfIPsecTunRemoteAddrV2=hpnicfIPsecTunRemoteAddrV2, HpnicfIPsecTunnelStateV2=HpnicfIPsecTunnelStateV2, hpnicfIPsecSaSpiValueV2=hpnicfIPsecSaSpiValueV2, hpnicfIPsecTunIKETunnelIndexV2=hpnicfIPsecTunIKETunnelIndexV2, hpnicfIPsecNoSaTrapCntlV2=hpnicfIPsecNoSaTrapCntlV2, hpnicfIPsecScalarObjectsGroupV2=hpnicfIPsecScalarObjectsGroupV2, hpnicfIPsecConformanceV2=hpnicfIPsecConformanceV2, hpnicfIPsecNotificationsV2=hpnicfIPsecNotificationsV2, HpnicfIPsecEncapModeV2=HpnicfIPsecEncapModeV2, hpnicfIPsecGlobalInDecryptFailsV2=hpnicfIPsecGlobalInDecryptFailsV2, hpnicfIPsecTrapCntlV2=hpnicfIPsecTrapCntlV2, hpnicfIPsecTunInDropPktsV2=hpnicfIPsecTunInDropPktsV2, hpnicfIPsecTunActiveTimeV2=hpnicfIPsecTunActiveTimeV2, hpnicfIPsecTrafficLocalPort2V2=hpnicfIPsecTrafficLocalPort2V2, hpnicfIPsecDecryFailureTrapCntlV2=hpnicfIPsecDecryFailureTrapCntlV2, hpnicfIPsecTrapGlobalCntlV2=hpnicfIPsecTrapGlobalCntlV2, hpnicfIPsecTunRemainTimeV2=hpnicfIPsecTunRemainTimeV2, hpnicfIPsecTrapCntlGroupV2=hpnicfIPsecTrapCntlGroupV2, hpnicfIPsecScalarObjectsV2=hpnicfIPsecScalarObjectsV2, hpnicfIPsecTunLocalAddrV2=hpnicfIPsecTunLocalAddrV2, hpnicfIPsecGlobalStatsV2=hpnicfIPsecGlobalStatsV2, hpnicfIPsecTunnelStartTrapCntlV2=hpnicfIPsecTunnelStartTrapCntlV2, hpnicfIPsecGlobalNoFindSaDropsV2=hpnicfIPsecGlobalNoFindSaDropsV2, hpnicfIPsecTunIKETunLocalIDTypeV2=hpnicfIPsecTunIKETunLocalIDTypeV2, hpnicfIPsecTunnelStopV2=hpnicfIPsecTunnelStopV2)
(object_identifier, octet_string, integer) = mibBuilder.importSymbols('ASN1', 'ObjectIdentifier', 'OctetString', 'Integer') (named_values,) = mibBuilder.importSymbols('ASN1-ENUMERATION', 'NamedValues') (constraints_intersection, single_value_constraint, constraints_union, value_range_constraint, value_size_constraint) = mibBuilder.importSymbols('ASN1-REFINEMENT', 'ConstraintsIntersection', 'SingleValueConstraint', 'ConstraintsUnion', 'ValueRangeConstraint', 'ValueSizeConstraint') (hpnicf_common,) = mibBuilder.importSymbols('HPN-ICF-OID-MIB', 'hpnicfCommon') (interface_index, if_index) = mibBuilder.importSymbols('IF-MIB', 'InterfaceIndex', 'ifIndex') (inet_address_type, inet_address) = mibBuilder.importSymbols('INET-ADDRESS-MIB', 'InetAddressType', 'InetAddress') (module_compliance, notification_group, object_group) = mibBuilder.importSymbols('SNMPv2-CONF', 'ModuleCompliance', 'NotificationGroup', 'ObjectGroup') (time_ticks, gauge32, notification_type, unsigned32, mib_identifier, module_identity, bits, counter64, integer32, ip_address, counter32, iso, object_identity, mib_scalar, mib_table, mib_table_row, mib_table_column) = mibBuilder.importSymbols('SNMPv2-SMI', 'TimeTicks', 'Gauge32', 'NotificationType', 'Unsigned32', 'MibIdentifier', 'ModuleIdentity', 'Bits', 'Counter64', 'Integer32', 'IpAddress', 'Counter32', 'iso', 'ObjectIdentity', 'MibScalar', 'MibTable', 'MibTableRow', 'MibTableColumn') (textual_convention, display_string, truth_value) = mibBuilder.importSymbols('SNMPv2-TC', 'TextualConvention', 'DisplayString', 'TruthValue') hpnicf_i_psec_monitor_v2 = module_identity((1, 3, 6, 1, 4, 1, 11, 2, 14, 11, 15, 2, 126)) hpnicfIPsecMonitorV2.setRevisions(('2012-06-27 00:00',)) if mibBuilder.loadTexts: hpnicfIPsecMonitorV2.setLastUpdated('201206270000Z') if mibBuilder.loadTexts: hpnicfIPsecMonitorV2.setOrganization('') class Hpnicfipsecdiffhellmangrpv2(TextualConvention, Integer32): status = 'current' subtype_spec = Integer32.subtypeSpec + constraints_union(single_value_constraint(0, 1, 2, 5, 14, 24, 2147483647)) named_values = named_values(('none', 0), ('dhGroup1', 1), ('dhGroup2', 2), ('dhGroup5', 5), ('dhGroup14', 14), ('dhGroup24', 24), ('invalidGroup', 2147483647)) class Hpnicfipsecencapmodev2(TextualConvention, Integer32): status = 'current' subtype_spec = Integer32.subtypeSpec + constraints_union(single_value_constraint(1, 2, 2147483647)) named_values = named_values(('tunnel', 1), ('transport', 2), ('invalidMode', 2147483647)) class Hpnicfipsecencryptalgov2(TextualConvention, Integer32): status = 'current' subtype_spec = Integer32.subtypeSpec + constraints_union(single_value_constraint(0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 2147483647)) named_values = named_values(('none', 0), ('desCbc', 1), ('ideaCbc', 2), ('blowfishCbc', 3), ('rc5R16B64Cbc', 4), ('tripleDesCbc', 5), ('castCbc', 6), ('aesCbc', 7), ('nsaCbc', 8), ('aesCbc128', 9), ('aesCbc192', 10), ('aesCbc256', 11), ('aesCtr', 12), ('aesCamelliaCbc', 13), ('rc4', 14), ('invalidAlg', 2147483647)) class Hpnicfipsecauthalgov2(TextualConvention, Integer32): status = 'current' subtype_spec = Integer32.subtypeSpec + constraints_union(single_value_constraint(0, 1, 2, 3, 4, 5, 2147483647)) named_values = named_values(('none', 0), ('md5', 1), ('sha1', 2), ('sha256', 3), ('sha384', 4), ('sha512', 5), ('invalidAlg', 2147483647)) class Hpnicfipsecsaprotocolv2(TextualConvention, Integer32): status = 'current' subtype_spec = Integer32.subtypeSpec + constraints_union(single_value_constraint(0, 2, 3, 4)) named_values = named_values(('reserved', 0), ('ah', 2), ('esp', 3), ('ipcomp', 4)) class Hpnicfipsecidtypev2(TextualConvention, Integer32): status = 'current' subtype_spec = Integer32.subtypeSpec + constraints_union(single_value_constraint(0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11)) named_values = named_values(('reserved', 0), ('ipv4Addr', 1), ('fqdn', 2), ('userFqdn', 3), ('ipv4AddrSubnet', 4), ('ipv6Addr', 5), ('ipv6AddrSubnet', 6), ('ipv4AddrRange', 7), ('ipv6AddrRange', 8), ('derAsn1Dn', 9), ('derAsn1Gn', 10), ('keyId', 11)) class Hpnicfipsectraffictypev2(TextualConvention, Integer32): status = 'current' subtype_spec = Integer32.subtypeSpec + constraints_union(single_value_constraint(1, 4, 5, 6, 7, 8)) named_values = named_values(('ipv4Addr', 1), ('ipv4AddrSubnet', 4), ('ipv6Addr', 5), ('ipv6AddrSubnet', 6), ('ipv4AddrRange', 7), ('ipv6AddrRange', 8)) class Hpnicfipsecnegotypev2(TextualConvention, Integer32): status = 'current' subtype_spec = Integer32.subtypeSpec + constraints_union(single_value_constraint(1, 2, 2147483647)) named_values = named_values(('ike', 1), ('manual', 2), ('invalidType', 2147483647)) class Hpnicfipsectunnelstatev2(TextualConvention, Integer32): status = 'current' subtype_spec = Integer32.subtypeSpec + constraints_union(single_value_constraint(1, 2)) named_values = named_values(('active', 1), ('timeout', 2)) hpnicf_i_psec_objects_v2 = mib_identifier((1, 3, 6, 1, 4, 1, 11, 2, 14, 11, 15, 2, 126, 1)) hpnicf_i_psec_scalar_objects_v2 = mib_identifier((1, 3, 6, 1, 4, 1, 11, 2, 14, 11, 15, 2, 126, 1, 1)) hpnicf_i_psec_mib_version = mib_scalar((1, 3, 6, 1, 4, 1, 11, 2, 14, 11, 15, 2, 126, 1, 1, 1), display_string()).setMaxAccess('readonly') if mibBuilder.loadTexts: hpnicfIPsecMIBVersion.setStatus('current') hpnicf_i_psec_tunnel_v2_table = mib_table((1, 3, 6, 1, 4, 1, 11, 2, 14, 11, 15, 2, 126, 1, 2)) if mibBuilder.loadTexts: hpnicfIPsecTunnelV2Table.setStatus('current') hpnicf_i_psec_tunnel_v2_entry = mib_table_row((1, 3, 6, 1, 4, 1, 11, 2, 14, 11, 15, 2, 126, 1, 2, 1)).setIndexNames((0, 'HPN-ICF-IPSEC-MONITOR-V2-MIB', 'hpnicfIPsecTunIndexV2')) if mibBuilder.loadTexts: hpnicfIPsecTunnelV2Entry.setStatus('current') hpnicf_i_psec_tun_index_v2 = mib_table_column((1, 3, 6, 1, 4, 1, 11, 2, 14, 11, 15, 2, 126, 1, 2, 1, 1), integer32().subtype(subtypeSpec=value_range_constraint(1, 2147483647))).setMaxAccess('accessiblefornotify') if mibBuilder.loadTexts: hpnicfIPsecTunIndexV2.setStatus('current') hpnicf_i_psec_tun_if_index_v2 = mib_table_column((1, 3, 6, 1, 4, 1, 11, 2, 14, 11, 15, 2, 126, 1, 2, 1, 2), interface_index()).setMaxAccess('readonly') if mibBuilder.loadTexts: hpnicfIPsecTunIfIndexV2.setStatus('current') hpnicf_i_psec_tun_ike_tunnel_index_v2 = mib_table_column((1, 3, 6, 1, 4, 1, 11, 2, 14, 11, 15, 2, 126, 1, 2, 1, 3), integer32().subtype(subtypeSpec=value_range_constraint(1, 2147483647))).setMaxAccess('readonly') if mibBuilder.loadTexts: hpnicfIPsecTunIKETunnelIndexV2.setStatus('current') hpnicf_i_psec_tun_ike_tun_local_id_type_v2 = mib_table_column((1, 3, 6, 1, 4, 1, 11, 2, 14, 11, 15, 2, 126, 1, 2, 1, 4), hpnicf_i_psec_id_type_v2()).setMaxAccess('readonly') if mibBuilder.loadTexts: hpnicfIPsecTunIKETunLocalIDTypeV2.setStatus('current') hpnicf_i_psec_tun_ike_tun_local_id_val1_v2 = mib_table_column((1, 3, 6, 1, 4, 1, 11, 2, 14, 11, 15, 2, 126, 1, 2, 1, 5), display_string()).setMaxAccess('readonly') if mibBuilder.loadTexts: hpnicfIPsecTunIKETunLocalIDVal1V2.setStatus('current') hpnicf_i_psec_tun_ike_tun_local_id_val2_v2 = mib_table_column((1, 3, 6, 1, 4, 1, 11, 2, 14, 11, 15, 2, 126, 1, 2, 1, 6), display_string()).setMaxAccess('readonly') if mibBuilder.loadTexts: hpnicfIPsecTunIKETunLocalIDVal2V2.setStatus('current') hpnicf_i_psec_tun_ike_tun_remote_id_type_v2 = mib_table_column((1, 3, 6, 1, 4, 1, 11, 2, 14, 11, 15, 2, 126, 1, 2, 1, 7), hpnicf_i_psec_id_type_v2()).setMaxAccess('readonly') if mibBuilder.loadTexts: hpnicfIPsecTunIKETunRemoteIDTypeV2.setStatus('current') hpnicf_i_psec_tun_ike_tun_remote_id_val1_v2 = mib_table_column((1, 3, 6, 1, 4, 1, 11, 2, 14, 11, 15, 2, 126, 1, 2, 1, 8), display_string()).setMaxAccess('readonly') if mibBuilder.loadTexts: hpnicfIPsecTunIKETunRemoteIDVal1V2.setStatus('current') hpnicf_i_psec_tun_ike_tun_remote_id_val2_v2 = mib_table_column((1, 3, 6, 1, 4, 1, 11, 2, 14, 11, 15, 2, 126, 1, 2, 1, 9), display_string()).setMaxAccess('readonly') if mibBuilder.loadTexts: hpnicfIPsecTunIKETunRemoteIDVal2V2.setStatus('current') hpnicf_i_psec_tun_local_addr_type_v2 = mib_table_column((1, 3, 6, 1, 4, 1, 11, 2, 14, 11, 15, 2, 126, 1, 2, 1, 10), inet_address_type()).setMaxAccess('readonly') if mibBuilder.loadTexts: hpnicfIPsecTunLocalAddrTypeV2.setStatus('current') hpnicf_i_psec_tun_local_addr_v2 = mib_table_column((1, 3, 6, 1, 4, 1, 11, 2, 14, 11, 15, 2, 126, 1, 2, 1, 11), inet_address()).setMaxAccess('readonly') if mibBuilder.loadTexts: hpnicfIPsecTunLocalAddrV2.setStatus('current') hpnicf_i_psec_tun_remote_addr_type_v2 = mib_table_column((1, 3, 6, 1, 4, 1, 11, 2, 14, 11, 15, 2, 126, 1, 2, 1, 12), inet_address_type()).setMaxAccess('readonly') if mibBuilder.loadTexts: hpnicfIPsecTunRemoteAddrTypeV2.setStatus('current') hpnicf_i_psec_tun_remote_addr_v2 = mib_table_column((1, 3, 6, 1, 4, 1, 11, 2, 14, 11, 15, 2, 126, 1, 2, 1, 13), inet_address()).setMaxAccess('readonly') if mibBuilder.loadTexts: hpnicfIPsecTunRemoteAddrV2.setStatus('current') hpnicf_i_psec_tun_key_type_v2 = mib_table_column((1, 3, 6, 1, 4, 1, 11, 2, 14, 11, 15, 2, 126, 1, 2, 1, 14), hpnicf_i_psec_nego_type_v2()).setMaxAccess('readonly') if mibBuilder.loadTexts: hpnicfIPsecTunKeyTypeV2.setStatus('current') hpnicf_i_psec_tun_encap_mode_v2 = mib_table_column((1, 3, 6, 1, 4, 1, 11, 2, 14, 11, 15, 2, 126, 1, 2, 1, 15), hpnicf_i_psec_encap_mode_v2()).setMaxAccess('readonly') if mibBuilder.loadTexts: hpnicfIPsecTunEncapModeV2.setStatus('current') hpnicf_i_psec_tun_initiator_v2 = mib_table_column((1, 3, 6, 1, 4, 1, 11, 2, 14, 11, 15, 2, 126, 1, 2, 1, 16), integer32().subtype(subtypeSpec=constraints_union(single_value_constraint(1, 2, 2147483647))).clone(namedValues=named_values(('local', 1), ('remote', 2), ('none', 2147483647)))).setMaxAccess('readonly') if mibBuilder.loadTexts: hpnicfIPsecTunInitiatorV2.setStatus('current') hpnicf_i_psec_tun_life_size_v2 = mib_table_column((1, 3, 6, 1, 4, 1, 11, 2, 14, 11, 15, 2, 126, 1, 2, 1, 17), gauge32()).setMaxAccess('readonly') if mibBuilder.loadTexts: hpnicfIPsecTunLifeSizeV2.setStatus('current') hpnicf_i_psec_tun_life_time_v2 = mib_table_column((1, 3, 6, 1, 4, 1, 11, 2, 14, 11, 15, 2, 126, 1, 2, 1, 18), integer32().subtype(subtypeSpec=value_range_constraint(1, 2147483647))).setMaxAccess('readonly') if mibBuilder.loadTexts: hpnicfIPsecTunLifeTimeV2.setStatus('current') hpnicf_i_psec_tun_remain_time_v2 = mib_table_column((1, 3, 6, 1, 4, 1, 11, 2, 14, 11, 15, 2, 126, 1, 2, 1, 19), integer32().subtype(subtypeSpec=value_range_constraint(0, 2147483647))).setMaxAccess('readonly') if mibBuilder.loadTexts: hpnicfIPsecTunRemainTimeV2.setStatus('current') hpnicf_i_psec_tun_active_time_v2 = mib_table_column((1, 3, 6, 1, 4, 1, 11, 2, 14, 11, 15, 2, 126, 1, 2, 1, 20), integer32().subtype(subtypeSpec=value_range_constraint(0, 2147483647))).setMaxAccess('readonly') if mibBuilder.loadTexts: hpnicfIPsecTunActiveTimeV2.setStatus('current') hpnicf_i_psec_tun_remain_size_v2 = mib_table_column((1, 3, 6, 1, 4, 1, 11, 2, 14, 11, 15, 2, 126, 1, 2, 1, 21), gauge32()).setMaxAccess('readonly') if mibBuilder.loadTexts: hpnicfIPsecTunRemainSizeV2.setStatus('current') hpnicf_i_psec_tun_total_refreshes_v2 = mib_table_column((1, 3, 6, 1, 4, 1, 11, 2, 14, 11, 15, 2, 126, 1, 2, 1, 22), counter32()).setMaxAccess('readonly') if mibBuilder.loadTexts: hpnicfIPsecTunTotalRefreshesV2.setStatus('current') hpnicf_i_psec_tun_current_sa_instances_v2 = mib_table_column((1, 3, 6, 1, 4, 1, 11, 2, 14, 11, 15, 2, 126, 1, 2, 1, 23), gauge32()).setMaxAccess('readonly') if mibBuilder.loadTexts: hpnicfIPsecTunCurrentSaInstancesV2.setStatus('current') hpnicf_i_psec_tun_in_sa_encrypt_algo_v2 = mib_table_column((1, 3, 6, 1, 4, 1, 11, 2, 14, 11, 15, 2, 126, 1, 2, 1, 24), hpnicf_i_psec_encrypt_algo_v2()).setMaxAccess('readonly') if mibBuilder.loadTexts: hpnicfIPsecTunInSaEncryptAlgoV2.setStatus('current') hpnicf_i_psec_tun_in_sa_ah_auth_algo_v2 = mib_table_column((1, 3, 6, 1, 4, 1, 11, 2, 14, 11, 15, 2, 126, 1, 2, 1, 25), hpnicf_i_psec_auth_algo_v2()).setMaxAccess('readonly') if mibBuilder.loadTexts: hpnicfIPsecTunInSaAhAuthAlgoV2.setStatus('current') hpnicf_i_psec_tun_in_sa_esp_auth_algo_v2 = mib_table_column((1, 3, 6, 1, 4, 1, 11, 2, 14, 11, 15, 2, 126, 1, 2, 1, 26), hpnicf_i_psec_auth_algo_v2()).setMaxAccess('readonly') if mibBuilder.loadTexts: hpnicfIPsecTunInSaEspAuthAlgoV2.setStatus('current') hpnicf_i_psec_tun_diff_hellman_grp_v2 = mib_table_column((1, 3, 6, 1, 4, 1, 11, 2, 14, 11, 15, 2, 126, 1, 2, 1, 27), hpnicf_i_psec_diff_hellman_grp_v2()).setMaxAccess('readonly') if mibBuilder.loadTexts: hpnicfIPsecTunDiffHellmanGrpV2.setStatus('current') hpnicf_i_psec_tun_out_sa_encrypt_algo_v2 = mib_table_column((1, 3, 6, 1, 4, 1, 11, 2, 14, 11, 15, 2, 126, 1, 2, 1, 28), hpnicf_i_psec_encrypt_algo_v2()).setMaxAccess('readonly') if mibBuilder.loadTexts: hpnicfIPsecTunOutSaEncryptAlgoV2.setStatus('current') hpnicf_i_psec_tun_out_sa_ah_auth_algo_v2 = mib_table_column((1, 3, 6, 1, 4, 1, 11, 2, 14, 11, 15, 2, 126, 1, 2, 1, 29), hpnicf_i_psec_auth_algo_v2()).setMaxAccess('readonly') if mibBuilder.loadTexts: hpnicfIPsecTunOutSaAhAuthAlgoV2.setStatus('current') hpnicf_i_psec_tun_out_sa_esp_auth_algo_v2 = mib_table_column((1, 3, 6, 1, 4, 1, 11, 2, 14, 11, 15, 2, 126, 1, 2, 1, 30), hpnicf_i_psec_auth_algo_v2()).setMaxAccess('readonly') if mibBuilder.loadTexts: hpnicfIPsecTunOutSaEspAuthAlgoV2.setStatus('current') hpnicf_i_psec_tun_policy_name_v2 = mib_table_column((1, 3, 6, 1, 4, 1, 11, 2, 14, 11, 15, 2, 126, 1, 2, 1, 31), display_string()).setMaxAccess('readonly') if mibBuilder.loadTexts: hpnicfIPsecTunPolicyNameV2.setStatus('current') hpnicf_i_psec_tun_policy_num_v2 = mib_table_column((1, 3, 6, 1, 4, 1, 11, 2, 14, 11, 15, 2, 126, 1, 2, 1, 32), integer32().subtype(subtypeSpec=value_range_constraint(1, 2147483647))).setMaxAccess('readonly') if mibBuilder.loadTexts: hpnicfIPsecTunPolicyNumV2.setStatus('current') hpnicf_i_psec_tun_status_v2 = mib_table_column((1, 3, 6, 1, 4, 1, 11, 2, 14, 11, 15, 2, 126, 1, 2, 1, 33), integer32().subtype(subtypeSpec=constraints_union(single_value_constraint(1, 2, 3, 4))).clone(namedValues=named_values(('initial', 1), ('ready', 2), ('rekeyed', 3), ('closed', 4)))).setMaxAccess('readonly') if mibBuilder.loadTexts: hpnicfIPsecTunStatusV2.setStatus('current') hpnicf_i_psec_tunnel_stat_v2_table = mib_table((1, 3, 6, 1, 4, 1, 11, 2, 14, 11, 15, 2, 126, 1, 3)) if mibBuilder.loadTexts: hpnicfIPsecTunnelStatV2Table.setStatus('current') hpnicf_i_psec_tunnel_stat_v2_entry = mib_table_row((1, 3, 6, 1, 4, 1, 11, 2, 14, 11, 15, 2, 126, 1, 3, 1)).setIndexNames((0, 'HPN-ICF-IPSEC-MONITOR-V2-MIB', 'hpnicfIPsecTunIndexV2')) if mibBuilder.loadTexts: hpnicfIPsecTunnelStatV2Entry.setStatus('current') hpnicf_i_psec_tun_in_octets_v2 = mib_table_column((1, 3, 6, 1, 4, 1, 11, 2, 14, 11, 15, 2, 126, 1, 3, 1, 1), counter64()).setMaxAccess('readonly') if mibBuilder.loadTexts: hpnicfIPsecTunInOctetsV2.setStatus('current') hpnicf_i_psec_tun_in_decomp_octets_v2 = mib_table_column((1, 3, 6, 1, 4, 1, 11, 2, 14, 11, 15, 2, 126, 1, 3, 1, 2), counter64()).setMaxAccess('readonly') if mibBuilder.loadTexts: hpnicfIPsecTunInDecompOctetsV2.setStatus('current') hpnicf_i_psec_tun_in_pkts_v2 = mib_table_column((1, 3, 6, 1, 4, 1, 11, 2, 14, 11, 15, 2, 126, 1, 3, 1, 3), counter64()).setMaxAccess('readonly') if mibBuilder.loadTexts: hpnicfIPsecTunInPktsV2.setStatus('current') hpnicf_i_psec_tun_in_drop_pkts_v2 = mib_table_column((1, 3, 6, 1, 4, 1, 11, 2, 14, 11, 15, 2, 126, 1, 3, 1, 4), counter64()).setMaxAccess('readonly') if mibBuilder.loadTexts: hpnicfIPsecTunInDropPktsV2.setStatus('current') hpnicf_i_psec_tun_in_replay_drop_pkts_v2 = mib_table_column((1, 3, 6, 1, 4, 1, 11, 2, 14, 11, 15, 2, 126, 1, 3, 1, 5), counter64()).setMaxAccess('readonly') if mibBuilder.loadTexts: hpnicfIPsecTunInReplayDropPktsV2.setStatus('current') hpnicf_i_psec_tun_in_auth_fails_v2 = mib_table_column((1, 3, 6, 1, 4, 1, 11, 2, 14, 11, 15, 2, 126, 1, 3, 1, 6), counter64()).setMaxAccess('readonly') if mibBuilder.loadTexts: hpnicfIPsecTunInAuthFailsV2.setStatus('current') hpnicf_i_psec_tun_in_decrypt_fails_v2 = mib_table_column((1, 3, 6, 1, 4, 1, 11, 2, 14, 11, 15, 2, 126, 1, 3, 1, 7), counter64()).setMaxAccess('readonly') if mibBuilder.loadTexts: hpnicfIPsecTunInDecryptFailsV2.setStatus('current') hpnicf_i_psec_tun_out_octets_v2 = mib_table_column((1, 3, 6, 1, 4, 1, 11, 2, 14, 11, 15, 2, 126, 1, 3, 1, 8), counter64()).setMaxAccess('readonly') if mibBuilder.loadTexts: hpnicfIPsecTunOutOctetsV2.setStatus('current') hpnicf_i_psec_tun_out_uncomp_octets_v2 = mib_table_column((1, 3, 6, 1, 4, 1, 11, 2, 14, 11, 15, 2, 126, 1, 3, 1, 9), counter64()).setMaxAccess('readonly') if mibBuilder.loadTexts: hpnicfIPsecTunOutUncompOctetsV2.setStatus('current') hpnicf_i_psec_tun_out_pkts_v2 = mib_table_column((1, 3, 6, 1, 4, 1, 11, 2, 14, 11, 15, 2, 126, 1, 3, 1, 10), counter64()).setMaxAccess('readonly') if mibBuilder.loadTexts: hpnicfIPsecTunOutPktsV2.setStatus('current') hpnicf_i_psec_tun_out_drop_pkts_v2 = mib_table_column((1, 3, 6, 1, 4, 1, 11, 2, 14, 11, 15, 2, 126, 1, 3, 1, 11), counter64()).setMaxAccess('readonly') if mibBuilder.loadTexts: hpnicfIPsecTunOutDropPktsV2.setStatus('current') hpnicf_i_psec_tun_out_encrypt_fails_v2 = mib_table_column((1, 3, 6, 1, 4, 1, 11, 2, 14, 11, 15, 2, 126, 1, 3, 1, 12), counter64()).setMaxAccess('readonly') if mibBuilder.loadTexts: hpnicfIPsecTunOutEncryptFailsV2.setStatus('current') hpnicf_i_psec_tun_no_memory_drop_pkts_v2 = mib_table_column((1, 3, 6, 1, 4, 1, 11, 2, 14, 11, 15, 2, 126, 1, 3, 1, 13), counter64()).setMaxAccess('readonly') if mibBuilder.loadTexts: hpnicfIPsecTunNoMemoryDropPktsV2.setStatus('current') hpnicf_i_psec_tun_queue_full_drop_pkts_v2 = mib_table_column((1, 3, 6, 1, 4, 1, 11, 2, 14, 11, 15, 2, 126, 1, 3, 1, 14), counter64()).setMaxAccess('readonly') if mibBuilder.loadTexts: hpnicfIPsecTunQueueFullDropPktsV2.setStatus('current') hpnicf_i_psec_tun_invalid_len_drop_pkts_v2 = mib_table_column((1, 3, 6, 1, 4, 1, 11, 2, 14, 11, 15, 2, 126, 1, 3, 1, 15), counter64()).setMaxAccess('readonly') if mibBuilder.loadTexts: hpnicfIPsecTunInvalidLenDropPktsV2.setStatus('current') hpnicf_i_psec_tun_too_long_drop_pkts_v2 = mib_table_column((1, 3, 6, 1, 4, 1, 11, 2, 14, 11, 15, 2, 126, 1, 3, 1, 16), counter64()).setMaxAccess('readonly') if mibBuilder.loadTexts: hpnicfIPsecTunTooLongDropPktsV2.setStatus('current') hpnicf_i_psec_tun_invalid_sa_drop_pkts_v2 = mib_table_column((1, 3, 6, 1, 4, 1, 11, 2, 14, 11, 15, 2, 126, 1, 3, 1, 17), counter64()).setMaxAccess('readonly') if mibBuilder.loadTexts: hpnicfIPsecTunInvalidSaDropPktsV2.setStatus('current') hpnicf_i_psec_sa_v2_table = mib_table((1, 3, 6, 1, 4, 1, 11, 2, 14, 11, 15, 2, 126, 1, 4)) if mibBuilder.loadTexts: hpnicfIPsecSaV2Table.setStatus('current') hpnicf_i_psec_sa_v2_entry = mib_table_row((1, 3, 6, 1, 4, 1, 11, 2, 14, 11, 15, 2, 126, 1, 4, 1)).setIndexNames((0, 'HPN-ICF-IPSEC-MONITOR-V2-MIB', 'hpnicfIPsecTunIndexV2'), (0, 'HPN-ICF-IPSEC-MONITOR-V2-MIB', 'hpnicfIPsecSaIndexV2')) if mibBuilder.loadTexts: hpnicfIPsecSaV2Entry.setStatus('current') hpnicf_i_psec_sa_index_v2 = mib_table_column((1, 3, 6, 1, 4, 1, 11, 2, 14, 11, 15, 2, 126, 1, 4, 1, 1), integer32().subtype(subtypeSpec=value_range_constraint(1, 2147483647))).setMaxAccess('accessiblefornotify') if mibBuilder.loadTexts: hpnicfIPsecSaIndexV2.setStatus('current') hpnicf_i_psec_sa_direction_v2 = mib_table_column((1, 3, 6, 1, 4, 1, 11, 2, 14, 11, 15, 2, 126, 1, 4, 1, 2), integer32().subtype(subtypeSpec=constraints_union(single_value_constraint(1, 2))).clone(namedValues=named_values(('in', 1), ('out', 2)))).setMaxAccess('readonly') if mibBuilder.loadTexts: hpnicfIPsecSaDirectionV2.setStatus('current') hpnicf_i_psec_sa_spi_value_v2 = mib_table_column((1, 3, 6, 1, 4, 1, 11, 2, 14, 11, 15, 2, 126, 1, 4, 1, 3), unsigned32().subtype(subtypeSpec=value_range_constraint(1, 4294967295))).setMaxAccess('readonly') if mibBuilder.loadTexts: hpnicfIPsecSaSpiValueV2.setStatus('current') hpnicf_i_psec_sa_sec_protocol_v2 = mib_table_column((1, 3, 6, 1, 4, 1, 11, 2, 14, 11, 15, 2, 126, 1, 4, 1, 4), hpnicf_i_psec_sa_protocol_v2()).setMaxAccess('readonly') if mibBuilder.loadTexts: hpnicfIPsecSaSecProtocolV2.setStatus('current') hpnicf_i_psec_sa_encrypt_algo_v2 = mib_table_column((1, 3, 6, 1, 4, 1, 11, 2, 14, 11, 15, 2, 126, 1, 4, 1, 5), hpnicf_i_psec_encrypt_algo_v2()).setMaxAccess('readonly') if mibBuilder.loadTexts: hpnicfIPsecSaEncryptAlgoV2.setStatus('current') hpnicf_i_psec_sa_auth_algo_v2 = mib_table_column((1, 3, 6, 1, 4, 1, 11, 2, 14, 11, 15, 2, 126, 1, 4, 1, 6), hpnicf_i_psec_auth_algo_v2()).setMaxAccess('readonly') if mibBuilder.loadTexts: hpnicfIPsecSaAuthAlgoV2.setStatus('current') hpnicf_i_psec_sa_status_v2 = mib_table_column((1, 3, 6, 1, 4, 1, 11, 2, 14, 11, 15, 2, 126, 1, 4, 1, 7), integer32().subtype(subtypeSpec=constraints_union(single_value_constraint(1, 2))).clone(namedValues=named_values(('active', 1), ('expiring', 2)))).setMaxAccess('readonly') if mibBuilder.loadTexts: hpnicfIPsecSaStatusV2.setStatus('current') hpnicf_i_psec_traffic_v2_table = mib_table((1, 3, 6, 1, 4, 1, 11, 2, 14, 11, 15, 2, 126, 1, 5)) if mibBuilder.loadTexts: hpnicfIPsecTrafficV2Table.setStatus('current') hpnicf_i_psec_traffic_v2_entry = mib_table_row((1, 3, 6, 1, 4, 1, 11, 2, 14, 11, 15, 2, 126, 1, 5, 1)).setIndexNames((0, 'HPN-ICF-IPSEC-MONITOR-V2-MIB', 'hpnicfIPsecTunIndexV2')) if mibBuilder.loadTexts: hpnicfIPsecTrafficV2Entry.setStatus('current') hpnicf_i_psec_traffic_local_type_v2 = mib_table_column((1, 3, 6, 1, 4, 1, 11, 2, 14, 11, 15, 2, 126, 1, 5, 1, 1), hpnicf_i_psec_traffic_type_v2()).setMaxAccess('readonly') if mibBuilder.loadTexts: hpnicfIPsecTrafficLocalTypeV2.setStatus('current') hpnicf_i_psec_traffic_local_addr1_type_v2 = mib_table_column((1, 3, 6, 1, 4, 1, 11, 2, 14, 11, 15, 2, 126, 1, 5, 1, 2), inet_address_type()).setMaxAccess('readonly') if mibBuilder.loadTexts: hpnicfIPsecTrafficLocalAddr1TypeV2.setStatus('current') hpnicf_i_psec_traffic_local_addr1_v2 = mib_table_column((1, 3, 6, 1, 4, 1, 11, 2, 14, 11, 15, 2, 126, 1, 5, 1, 3), inet_address()).setMaxAccess('readonly') if mibBuilder.loadTexts: hpnicfIPsecTrafficLocalAddr1V2.setStatus('current') hpnicf_i_psec_traffic_local_addr2_type_v2 = mib_table_column((1, 3, 6, 1, 4, 1, 11, 2, 14, 11, 15, 2, 126, 1, 5, 1, 4), inet_address_type()).setMaxAccess('readonly') if mibBuilder.loadTexts: hpnicfIPsecTrafficLocalAddr2TypeV2.setStatus('current') hpnicf_i_psec_traffic_local_addr2_v2 = mib_table_column((1, 3, 6, 1, 4, 1, 11, 2, 14, 11, 15, 2, 126, 1, 5, 1, 5), inet_address()).setMaxAccess('readonly') if mibBuilder.loadTexts: hpnicfIPsecTrafficLocalAddr2V2.setStatus('current') hpnicf_i_psec_traffic_local_protocol1_v2 = mib_table_column((1, 3, 6, 1, 4, 1, 11, 2, 14, 11, 15, 2, 126, 1, 5, 1, 6), integer32().subtype(subtypeSpec=value_range_constraint(0, 255))).setMaxAccess('readonly') if mibBuilder.loadTexts: hpnicfIPsecTrafficLocalProtocol1V2.setStatus('current') hpnicf_i_psec_traffic_local_protocol2_v2 = mib_table_column((1, 3, 6, 1, 4, 1, 11, 2, 14, 11, 15, 2, 126, 1, 5, 1, 7), integer32().subtype(subtypeSpec=value_range_constraint(0, 255))).setMaxAccess('readonly') if mibBuilder.loadTexts: hpnicfIPsecTrafficLocalProtocol2V2.setStatus('current') hpnicf_i_psec_traffic_local_port1_v2 = mib_table_column((1, 3, 6, 1, 4, 1, 11, 2, 14, 11, 15, 2, 126, 1, 5, 1, 8), integer32().subtype(subtypeSpec=value_range_constraint(0, 65535))).setMaxAccess('readonly') if mibBuilder.loadTexts: hpnicfIPsecTrafficLocalPort1V2.setStatus('current') hpnicf_i_psec_traffic_local_port2_v2 = mib_table_column((1, 3, 6, 1, 4, 1, 11, 2, 14, 11, 15, 2, 126, 1, 5, 1, 9), integer32().subtype(subtypeSpec=value_range_constraint(0, 65535))).setMaxAccess('readonly') if mibBuilder.loadTexts: hpnicfIPsecTrafficLocalPort2V2.setStatus('current') hpnicf_i_psec_traffic_remote_type_v2 = mib_table_column((1, 3, 6, 1, 4, 1, 11, 2, 14, 11, 15, 2, 126, 1, 5, 1, 10), hpnicf_i_psec_traffic_type_v2()).setMaxAccess('readonly') if mibBuilder.loadTexts: hpnicfIPsecTrafficRemoteTypeV2.setStatus('current') hpnicf_i_psec_traffic_rem_addr1_type_v2 = mib_table_column((1, 3, 6, 1, 4, 1, 11, 2, 14, 11, 15, 2, 126, 1, 5, 1, 11), inet_address_type()).setMaxAccess('readonly') if mibBuilder.loadTexts: hpnicfIPsecTrafficRemAddr1TypeV2.setStatus('current') hpnicf_i_psec_traffic_rem_addr1_v2 = mib_table_column((1, 3, 6, 1, 4, 1, 11, 2, 14, 11, 15, 2, 126, 1, 5, 1, 12), inet_address()).setMaxAccess('readonly') if mibBuilder.loadTexts: hpnicfIPsecTrafficRemAddr1V2.setStatus('current') hpnicf_i_psec_traffic_rem_addr2_type_v2 = mib_table_column((1, 3, 6, 1, 4, 1, 11, 2, 14, 11, 15, 2, 126, 1, 5, 1, 13), inet_address_type()).setMaxAccess('readonly') if mibBuilder.loadTexts: hpnicfIPsecTrafficRemAddr2TypeV2.setStatus('current') hpnicf_i_psec_traffic_rem_addr2_v2 = mib_table_column((1, 3, 6, 1, 4, 1, 11, 2, 14, 11, 15, 2, 126, 1, 5, 1, 14), inet_address()).setMaxAccess('readonly') if mibBuilder.loadTexts: hpnicfIPsecTrafficRemAddr2V2.setStatus('current') hpnicf_i_psec_traffic_remo_pro1_v2 = mib_table_column((1, 3, 6, 1, 4, 1, 11, 2, 14, 11, 15, 2, 126, 1, 5, 1, 15), integer32().subtype(subtypeSpec=value_range_constraint(0, 255))).setMaxAccess('readonly') if mibBuilder.loadTexts: hpnicfIPsecTrafficRemoPro1V2.setStatus('current') hpnicf_i_psec_traffic_remo_pro2_v2 = mib_table_column((1, 3, 6, 1, 4, 1, 11, 2, 14, 11, 15, 2, 126, 1, 5, 1, 16), integer32().subtype(subtypeSpec=value_range_constraint(0, 255))).setMaxAccess('readonly') if mibBuilder.loadTexts: hpnicfIPsecTrafficRemoPro2V2.setStatus('current') hpnicf_i_psec_traffic_rem_port1_v2 = mib_table_column((1, 3, 6, 1, 4, 1, 11, 2, 14, 11, 15, 2, 126, 1, 5, 1, 17), integer32().subtype(subtypeSpec=value_range_constraint(0, 65535))).setMaxAccess('readonly') if mibBuilder.loadTexts: hpnicfIPsecTrafficRemPort1V2.setStatus('current') hpnicf_i_psec_traffic_rem_port2_v2 = mib_table_column((1, 3, 6, 1, 4, 1, 11, 2, 14, 11, 15, 2, 126, 1, 5, 1, 18), integer32().subtype(subtypeSpec=value_range_constraint(0, 65535))).setMaxAccess('readonly') if mibBuilder.loadTexts: hpnicfIPsecTrafficRemPort2V2.setStatus('current') hpnicf_i_psec_global_stats_v2 = mib_identifier((1, 3, 6, 1, 4, 1, 11, 2, 14, 11, 15, 2, 126, 1, 6)) hpnicf_i_psec_global_active_tunnels_v2 = mib_scalar((1, 3, 6, 1, 4, 1, 11, 2, 14, 11, 15, 2, 126, 1, 6, 1), gauge32()).setMaxAccess('readonly') if mibBuilder.loadTexts: hpnicfIPsecGlobalActiveTunnelsV2.setStatus('current') hpnicf_i_psec_global_active_sas_v2 = mib_scalar((1, 3, 6, 1, 4, 1, 11, 2, 14, 11, 15, 2, 126, 1, 6, 2), gauge32()).setMaxAccess('readonly') if mibBuilder.loadTexts: hpnicfIPsecGlobalActiveSasV2.setStatus('current') hpnicf_i_psec_global_in_octets_v2 = mib_scalar((1, 3, 6, 1, 4, 1, 11, 2, 14, 11, 15, 2, 126, 1, 6, 3), counter64()).setMaxAccess('readonly') if mibBuilder.loadTexts: hpnicfIPsecGlobalInOctetsV2.setStatus('current') hpnicf_i_psec_global_in_decomp_octets_v2 = mib_scalar((1, 3, 6, 1, 4, 1, 11, 2, 14, 11, 15, 2, 126, 1, 6, 4), counter64()).setMaxAccess('readonly') if mibBuilder.loadTexts: hpnicfIPsecGlobalInDecompOctetsV2.setStatus('current') hpnicf_i_psec_global_in_pkts_v2 = mib_scalar((1, 3, 6, 1, 4, 1, 11, 2, 14, 11, 15, 2, 126, 1, 6, 5), counter64()).setMaxAccess('readonly') if mibBuilder.loadTexts: hpnicfIPsecGlobalInPktsV2.setStatus('current') hpnicf_i_psec_global_in_drops_v2 = mib_scalar((1, 3, 6, 1, 4, 1, 11, 2, 14, 11, 15, 2, 126, 1, 6, 6), counter64()).setMaxAccess('readonly') if mibBuilder.loadTexts: hpnicfIPsecGlobalInDropsV2.setStatus('current') hpnicf_i_psec_global_in_replay_drops_v2 = mib_scalar((1, 3, 6, 1, 4, 1, 11, 2, 14, 11, 15, 2, 126, 1, 6, 7), counter64()).setMaxAccess('readonly') if mibBuilder.loadTexts: hpnicfIPsecGlobalInReplayDropsV2.setStatus('current') hpnicf_i_psec_global_in_auth_fails_v2 = mib_scalar((1, 3, 6, 1, 4, 1, 11, 2, 14, 11, 15, 2, 126, 1, 6, 8), counter64()).setMaxAccess('readonly') if mibBuilder.loadTexts: hpnicfIPsecGlobalInAuthFailsV2.setStatus('current') hpnicf_i_psec_global_in_decrypt_fails_v2 = mib_scalar((1, 3, 6, 1, 4, 1, 11, 2, 14, 11, 15, 2, 126, 1, 6, 9), counter64()).setMaxAccess('readonly') if mibBuilder.loadTexts: hpnicfIPsecGlobalInDecryptFailsV2.setStatus('current') hpnicf_i_psec_global_out_octets_v2 = mib_scalar((1, 3, 6, 1, 4, 1, 11, 2, 14, 11, 15, 2, 126, 1, 6, 10), counter64()).setMaxAccess('readonly') if mibBuilder.loadTexts: hpnicfIPsecGlobalOutOctetsV2.setStatus('current') hpnicf_i_psec_global_out_uncomp_octets_v2 = mib_scalar((1, 3, 6, 1, 4, 1, 11, 2, 14, 11, 15, 2, 126, 1, 6, 11), counter64()).setMaxAccess('readonly') if mibBuilder.loadTexts: hpnicfIPsecGlobalOutUncompOctetsV2.setStatus('current') hpnicf_i_psec_global_out_pkts_v2 = mib_scalar((1, 3, 6, 1, 4, 1, 11, 2, 14, 11, 15, 2, 126, 1, 6, 12), counter64()).setMaxAccess('readonly') if mibBuilder.loadTexts: hpnicfIPsecGlobalOutPktsV2.setStatus('current') hpnicf_i_psec_global_out_drops_v2 = mib_scalar((1, 3, 6, 1, 4, 1, 11, 2, 14, 11, 15, 2, 126, 1, 6, 13), counter64()).setMaxAccess('readonly') if mibBuilder.loadTexts: hpnicfIPsecGlobalOutDropsV2.setStatus('current') hpnicf_i_psec_global_out_encrypt_fails_v2 = mib_scalar((1, 3, 6, 1, 4, 1, 11, 2, 14, 11, 15, 2, 126, 1, 6, 14), counter64()).setMaxAccess('readonly') if mibBuilder.loadTexts: hpnicfIPsecGlobalOutEncryptFailsV2.setStatus('current') hpnicf_i_psec_global_no_memory_drops_v2 = mib_scalar((1, 3, 6, 1, 4, 1, 11, 2, 14, 11, 15, 2, 126, 1, 6, 15), counter64()).setMaxAccess('readonly') if mibBuilder.loadTexts: hpnicfIPsecGlobalNoMemoryDropsV2.setStatus('current') hpnicf_i_psec_global_no_find_sa_drops_v2 = mib_scalar((1, 3, 6, 1, 4, 1, 11, 2, 14, 11, 15, 2, 126, 1, 6, 16), counter64()).setMaxAccess('readonly') if mibBuilder.loadTexts: hpnicfIPsecGlobalNoFindSaDropsV2.setStatus('current') hpnicf_i_psec_global_queue_full_drops_v2 = mib_scalar((1, 3, 6, 1, 4, 1, 11, 2, 14, 11, 15, 2, 126, 1, 6, 17), counter64()).setMaxAccess('readonly') if mibBuilder.loadTexts: hpnicfIPsecGlobalQueueFullDropsV2.setStatus('current') hpnicf_i_psec_global_invalid_len_drops_v2 = mib_scalar((1, 3, 6, 1, 4, 1, 11, 2, 14, 11, 15, 2, 126, 1, 6, 18), counter64()).setMaxAccess('readonly') if mibBuilder.loadTexts: hpnicfIPsecGlobalInvalidLenDropsV2.setStatus('current') hpnicf_i_psec_global_too_long_drops_v2 = mib_scalar((1, 3, 6, 1, 4, 1, 11, 2, 14, 11, 15, 2, 126, 1, 6, 19), counter64()).setMaxAccess('readonly') if mibBuilder.loadTexts: hpnicfIPsecGlobalTooLongDropsV2.setStatus('current') hpnicf_i_psec_global_invalid_sa_drops_v2 = mib_scalar((1, 3, 6, 1, 4, 1, 11, 2, 14, 11, 15, 2, 126, 1, 6, 20), counter64()).setMaxAccess('readonly') if mibBuilder.loadTexts: hpnicfIPsecGlobalInvalidSaDropsV2.setStatus('current') hpnicf_i_psec_trap_object_v2 = mib_identifier((1, 3, 6, 1, 4, 1, 11, 2, 14, 11, 15, 2, 126, 1, 7)) hpnicf_i_psec_policy_name_v2 = mib_scalar((1, 3, 6, 1, 4, 1, 11, 2, 14, 11, 15, 2, 126, 1, 7, 1), display_string()).setMaxAccess('accessiblefornotify') if mibBuilder.loadTexts: hpnicfIPsecPolicyNameV2.setStatus('current') hpnicf_i_psec_policy_seq_num_v2 = mib_scalar((1, 3, 6, 1, 4, 1, 11, 2, 14, 11, 15, 2, 126, 1, 7, 2), integer32()).setMaxAccess('accessiblefornotify') if mibBuilder.loadTexts: hpnicfIPsecPolicySeqNumV2.setStatus('current') hpnicf_i_psec_policy_size_v2 = mib_scalar((1, 3, 6, 1, 4, 1, 11, 2, 14, 11, 15, 2, 126, 1, 7, 3), integer32()).setMaxAccess('accessiblefornotify') if mibBuilder.loadTexts: hpnicfIPsecPolicySizeV2.setStatus('current') hpnicf_i_psec_trap_cntl_v2 = mib_identifier((1, 3, 6, 1, 4, 1, 11, 2, 14, 11, 15, 2, 126, 1, 8)) hpnicf_i_psec_trap_global_cntl_v2 = mib_scalar((1, 3, 6, 1, 4, 1, 11, 2, 14, 11, 15, 2, 126, 1, 8, 1), truth_value()).setMaxAccess('readwrite') if mibBuilder.loadTexts: hpnicfIPsecTrapGlobalCntlV2.setStatus('current') hpnicf_i_psec_tunnel_start_trap_cntl_v2 = mib_scalar((1, 3, 6, 1, 4, 1, 11, 2, 14, 11, 15, 2, 126, 1, 8, 2), truth_value()).setMaxAccess('readwrite') if mibBuilder.loadTexts: hpnicfIPsecTunnelStartTrapCntlV2.setStatus('current') hpnicf_i_psec_tunnel_stop_trap_cntl_v2 = mib_scalar((1, 3, 6, 1, 4, 1, 11, 2, 14, 11, 15, 2, 126, 1, 8, 3), truth_value()).setMaxAccess('readwrite') if mibBuilder.loadTexts: hpnicfIPsecTunnelStopTrapCntlV2.setStatus('current') hpnicf_i_psec_no_sa_trap_cntl_v2 = mib_scalar((1, 3, 6, 1, 4, 1, 11, 2, 14, 11, 15, 2, 126, 1, 8, 4), truth_value()).setMaxAccess('readwrite') if mibBuilder.loadTexts: hpnicfIPsecNoSaTrapCntlV2.setStatus('current') hpnicf_i_psec_auth_failure_trap_cntl_v2 = mib_scalar((1, 3, 6, 1, 4, 1, 11, 2, 14, 11, 15, 2, 126, 1, 8, 5), truth_value()).setMaxAccess('readwrite') if mibBuilder.loadTexts: hpnicfIPsecAuthFailureTrapCntlV2.setStatus('current') hpnicf_i_psec_encry_failure_trap_cntl_v2 = mib_scalar((1, 3, 6, 1, 4, 1, 11, 2, 14, 11, 15, 2, 126, 1, 8, 6), truth_value()).setMaxAccess('readwrite') if mibBuilder.loadTexts: hpnicfIPsecEncryFailureTrapCntlV2.setStatus('current') hpnicf_i_psec_decry_failure_trap_cntl_v2 = mib_scalar((1, 3, 6, 1, 4, 1, 11, 2, 14, 11, 15, 2, 126, 1, 8, 7), truth_value()).setMaxAccess('readwrite') if mibBuilder.loadTexts: hpnicfIPsecDecryFailureTrapCntlV2.setStatus('current') hpnicf_i_psec_invalid_sa_trap_cntl_v2 = mib_scalar((1, 3, 6, 1, 4, 1, 11, 2, 14, 11, 15, 2, 126, 1, 8, 8), truth_value()).setMaxAccess('readwrite') if mibBuilder.loadTexts: hpnicfIPsecInvalidSaTrapCntlV2.setStatus('current') hpnicf_i_psec_policy_add_trap_cntl_v2 = mib_scalar((1, 3, 6, 1, 4, 1, 11, 2, 14, 11, 15, 2, 126, 1, 8, 9), truth_value()).setMaxAccess('readwrite') if mibBuilder.loadTexts: hpnicfIPsecPolicyAddTrapCntlV2.setStatus('current') hpnicf_i_psec_policy_del_trap_cntl_v2 = mib_scalar((1, 3, 6, 1, 4, 1, 11, 2, 14, 11, 15, 2, 126, 1, 8, 10), truth_value()).setMaxAccess('readwrite') if mibBuilder.loadTexts: hpnicfIPsecPolicyDelTrapCntlV2.setStatus('current') hpnicf_i_psec_policy_attach_trap_cntl_v2 = mib_scalar((1, 3, 6, 1, 4, 1, 11, 2, 14, 11, 15, 2, 126, 1, 8, 11), truth_value()).setMaxAccess('readwrite') if mibBuilder.loadTexts: hpnicfIPsecPolicyAttachTrapCntlV2.setStatus('current') hpnicf_i_psec_policy_detach_trap_cntl_v2 = mib_scalar((1, 3, 6, 1, 4, 1, 11, 2, 14, 11, 15, 2, 126, 1, 8, 12), truth_value()).setMaxAccess('readwrite') if mibBuilder.loadTexts: hpnicfIPsecPolicyDetachTrapCntlV2.setStatus('current') hpnicf_i_psec_trap_v2 = mib_identifier((1, 3, 6, 1, 4, 1, 11, 2, 14, 11, 15, 2, 126, 1, 9)) hpnicf_i_psec_notifications_v2 = mib_identifier((1, 3, 6, 1, 4, 1, 11, 2, 14, 11, 15, 2, 126, 1, 9, 0)) hpnicf_i_psec_tunnel_start_v2 = notification_type((1, 3, 6, 1, 4, 1, 11, 2, 14, 11, 15, 2, 126, 1, 9, 0, 1)).setObjects(('HPN-ICF-IPSEC-MONITOR-V2-MIB', 'hpnicfIPsecTunIndexV2'), ('HPN-ICF-IPSEC-MONITOR-V2-MIB', 'hpnicfIPsecTunLocalAddrTypeV2'), ('HPN-ICF-IPSEC-MONITOR-V2-MIB', 'hpnicfIPsecTunLocalAddrV2'), ('HPN-ICF-IPSEC-MONITOR-V2-MIB', 'hpnicfIPsecTunRemoteAddrTypeV2'), ('HPN-ICF-IPSEC-MONITOR-V2-MIB', 'hpnicfIPsecTunRemoteAddrV2'), ('HPN-ICF-IPSEC-MONITOR-V2-MIB', 'hpnicfIPsecTunLifeTimeV2'), ('HPN-ICF-IPSEC-MONITOR-V2-MIB', 'hpnicfIPsecTunLifeSizeV2')) if mibBuilder.loadTexts: hpnicfIPsecTunnelStartV2.setStatus('current') hpnicf_i_psec_tunnel_stop_v2 = notification_type((1, 3, 6, 1, 4, 1, 11, 2, 14, 11, 15, 2, 126, 1, 9, 0, 2)).setObjects(('HPN-ICF-IPSEC-MONITOR-V2-MIB', 'hpnicfIPsecTunIndexV2'), ('HPN-ICF-IPSEC-MONITOR-V2-MIB', 'hpnicfIPsecTunLocalAddrTypeV2'), ('HPN-ICF-IPSEC-MONITOR-V2-MIB', 'hpnicfIPsecTunLocalAddrV2'), ('HPN-ICF-IPSEC-MONITOR-V2-MIB', 'hpnicfIPsecTunRemoteAddrTypeV2'), ('HPN-ICF-IPSEC-MONITOR-V2-MIB', 'hpnicfIPsecTunRemoteAddrV2'), ('HPN-ICF-IPSEC-MONITOR-V2-MIB', 'hpnicfIPsecTunActiveTimeV2')) if mibBuilder.loadTexts: hpnicfIPsecTunnelStopV2.setStatus('current') hpnicf_i_psec_no_sa_failure_v2 = notification_type((1, 3, 6, 1, 4, 1, 11, 2, 14, 11, 15, 2, 126, 1, 9, 0, 3)).setObjects(('HPN-ICF-IPSEC-MONITOR-V2-MIB', 'hpnicfIPsecTunIndexV2'), ('HPN-ICF-IPSEC-MONITOR-V2-MIB', 'hpnicfIPsecTunLocalAddrTypeV2'), ('HPN-ICF-IPSEC-MONITOR-V2-MIB', 'hpnicfIPsecTunLocalAddrV2'), ('HPN-ICF-IPSEC-MONITOR-V2-MIB', 'hpnicfIPsecTunRemoteAddrTypeV2'), ('HPN-ICF-IPSEC-MONITOR-V2-MIB', 'hpnicfIPsecTunRemoteAddrV2')) if mibBuilder.loadTexts: hpnicfIPsecNoSaFailureV2.setStatus('current') hpnicf_i_psec_auth_fail_failure_v2 = notification_type((1, 3, 6, 1, 4, 1, 11, 2, 14, 11, 15, 2, 126, 1, 9, 0, 4)).setObjects(('HPN-ICF-IPSEC-MONITOR-V2-MIB', 'hpnicfIPsecTunIndexV2'), ('HPN-ICF-IPSEC-MONITOR-V2-MIB', 'hpnicfIPsecTunLocalAddrTypeV2'), ('HPN-ICF-IPSEC-MONITOR-V2-MIB', 'hpnicfIPsecTunLocalAddrV2'), ('HPN-ICF-IPSEC-MONITOR-V2-MIB', 'hpnicfIPsecTunRemoteAddrTypeV2'), ('HPN-ICF-IPSEC-MONITOR-V2-MIB', 'hpnicfIPsecTunRemoteAddrV2')) if mibBuilder.loadTexts: hpnicfIPsecAuthFailFailureV2.setStatus('current') hpnicf_i_psec_encry_fail_failure_v2 = notification_type((1, 3, 6, 1, 4, 1, 11, 2, 14, 11, 15, 2, 126, 1, 9, 0, 5)).setObjects(('HPN-ICF-IPSEC-MONITOR-V2-MIB', 'hpnicfIPsecTunIndexV2'), ('HPN-ICF-IPSEC-MONITOR-V2-MIB', 'hpnicfIPsecTunLocalAddrTypeV2'), ('HPN-ICF-IPSEC-MONITOR-V2-MIB', 'hpnicfIPsecTunLocalAddrV2'), ('HPN-ICF-IPSEC-MONITOR-V2-MIB', 'hpnicfIPsecTunRemoteAddrTypeV2'), ('HPN-ICF-IPSEC-MONITOR-V2-MIB', 'hpnicfIPsecTunRemoteAddrV2')) if mibBuilder.loadTexts: hpnicfIPsecEncryFailFailureV2.setStatus('current') hpnicf_i_psec_decry_fail_failure_v2 = notification_type((1, 3, 6, 1, 4, 1, 11, 2, 14, 11, 15, 2, 126, 1, 9, 0, 6)).setObjects(('HPN-ICF-IPSEC-MONITOR-V2-MIB', 'hpnicfIPsecTunIndexV2'), ('HPN-ICF-IPSEC-MONITOR-V2-MIB', 'hpnicfIPsecTunLocalAddrTypeV2'), ('HPN-ICF-IPSEC-MONITOR-V2-MIB', 'hpnicfIPsecTunLocalAddrV2'), ('HPN-ICF-IPSEC-MONITOR-V2-MIB', 'hpnicfIPsecTunRemoteAddrTypeV2'), ('HPN-ICF-IPSEC-MONITOR-V2-MIB', 'hpnicfIPsecTunRemoteAddrV2')) if mibBuilder.loadTexts: hpnicfIPsecDecryFailFailureV2.setStatus('current') hpnicf_i_psec_invalid_sa_failure_v2 = notification_type((1, 3, 6, 1, 4, 1, 11, 2, 14, 11, 15, 2, 126, 1, 9, 0, 7)).setObjects(('HPN-ICF-IPSEC-MONITOR-V2-MIB', 'hpnicfIPsecTunIndexV2'), ('HPN-ICF-IPSEC-MONITOR-V2-MIB', 'hpnicfIPsecSaIndexV2'), ('HPN-ICF-IPSEC-MONITOR-V2-MIB', 'hpnicfIPsecTunLocalAddrTypeV2'), ('HPN-ICF-IPSEC-MONITOR-V2-MIB', 'hpnicfIPsecTunLocalAddrV2'), ('HPN-ICF-IPSEC-MONITOR-V2-MIB', 'hpnicfIPsecTunRemoteAddrTypeV2'), ('HPN-ICF-IPSEC-MONITOR-V2-MIB', 'hpnicfIPsecTunRemoteAddrV2'), ('HPN-ICF-IPSEC-MONITOR-V2-MIB', 'hpnicfIPsecSaSpiValueV2')) if mibBuilder.loadTexts: hpnicfIPsecInvalidSaFailureV2.setStatus('current') hpnicf_i_psec_policy_add_v2 = notification_type((1, 3, 6, 1, 4, 1, 11, 2, 14, 11, 15, 2, 126, 1, 9, 0, 8)).setObjects(('HPN-ICF-IPSEC-MONITOR-V2-MIB', 'hpnicfIPsecPolicyNameV2'), ('HPN-ICF-IPSEC-MONITOR-V2-MIB', 'hpnicfIPsecPolicySeqNumV2'), ('HPN-ICF-IPSEC-MONITOR-V2-MIB', 'hpnicfIPsecPolicySizeV2')) if mibBuilder.loadTexts: hpnicfIPsecPolicyAddV2.setStatus('current') hpnicf_i_psec_policy_del_v2 = notification_type((1, 3, 6, 1, 4, 1, 11, 2, 14, 11, 15, 2, 126, 1, 9, 0, 9)).setObjects(('HPN-ICF-IPSEC-MONITOR-V2-MIB', 'hpnicfIPsecPolicyNameV2'), ('HPN-ICF-IPSEC-MONITOR-V2-MIB', 'hpnicfIPsecPolicySeqNumV2'), ('HPN-ICF-IPSEC-MONITOR-V2-MIB', 'hpnicfIPsecPolicySizeV2')) if mibBuilder.loadTexts: hpnicfIPsecPolicyDelV2.setStatus('current') hpnicf_i_psec_policy_attach_v2 = notification_type((1, 3, 6, 1, 4, 1, 11, 2, 14, 11, 15, 2, 126, 1, 9, 0, 10)).setObjects(('HPN-ICF-IPSEC-MONITOR-V2-MIB', 'hpnicfIPsecPolicyNameV2'), ('HPN-ICF-IPSEC-MONITOR-V2-MIB', 'hpnicfIPsecPolicySizeV2'), ('IF-MIB', 'ifIndex')) if mibBuilder.loadTexts: hpnicfIPsecPolicyAttachV2.setStatus('current') hpnicf_i_psec_policy_detach_v2 = notification_type((1, 3, 6, 1, 4, 1, 11, 2, 14, 11, 15, 2, 126, 1, 9, 0, 11)).setObjects(('HPN-ICF-IPSEC-MONITOR-V2-MIB', 'hpnicfIPsecPolicyNameV2'), ('HPN-ICF-IPSEC-MONITOR-V2-MIB', 'hpnicfIPsecPolicySizeV2'), ('IF-MIB', 'ifIndex')) if mibBuilder.loadTexts: hpnicfIPsecPolicyDetachV2.setStatus('current') hpnicf_i_psec_conformance_v2 = mib_identifier((1, 3, 6, 1, 4, 1, 11, 2, 14, 11, 15, 2, 126, 2)) hpnicf_i_psec_compliances_v2 = mib_identifier((1, 3, 6, 1, 4, 1, 11, 2, 14, 11, 15, 2, 126, 2, 1)) hpnicf_i_psec_groups_v2 = mib_identifier((1, 3, 6, 1, 4, 1, 11, 2, 14, 11, 15, 2, 126, 2, 2)) hpnicf_i_psec_compliance_v2 = module_compliance((1, 3, 6, 1, 4, 1, 11, 2, 14, 11, 15, 2, 126, 2, 1, 1)).setObjects(('HPN-ICF-IPSEC-MONITOR-V2-MIB', 'hpnicfIPsecScalarObjectsGroupV2'), ('HPN-ICF-IPSEC-MONITOR-V2-MIB', 'hpnicfIPsecTunnelTableGroupV2'), ('HPN-ICF-IPSEC-MONITOR-V2-MIB', 'hpnicfIPsecTunnelStatGroupV2'), ('HPN-ICF-IPSEC-MONITOR-V2-MIB', 'hpnicfIPsecSaGroupV2'), ('HPN-ICF-IPSEC-MONITOR-V2-MIB', 'hpnicfIPsecTrafficTableGroupV2'), ('HPN-ICF-IPSEC-MONITOR-V2-MIB', 'hpnicfIPsecGlobalStatsGroupV2'), ('HPN-ICF-IPSEC-MONITOR-V2-MIB', 'hpnicfIPsecTrapObjectGroupV2'), ('HPN-ICF-IPSEC-MONITOR-V2-MIB', 'hpnicfIPsecTrapCntlGroupV2'), ('HPN-ICF-IPSEC-MONITOR-V2-MIB', 'hpnicfIPsecTrapGroupV2')) if getattr(mibBuilder, 'version', (0, 0, 0)) > (4, 4, 0): hpnicf_i_psec_compliance_v2 = hpnicfIPsecComplianceV2.setStatus('current') hpnicf_i_psec_scalar_objects_group_v2 = object_group((1, 3, 6, 1, 4, 1, 11, 2, 14, 11, 15, 2, 126, 2, 2, 1)).setObjects(('HPN-ICF-IPSEC-MONITOR-V2-MIB', 'hpnicfIPsecMIBVersion')) if getattr(mibBuilder, 'version', (0, 0, 0)) > (4, 4, 0): hpnicf_i_psec_scalar_objects_group_v2 = hpnicfIPsecScalarObjectsGroupV2.setStatus('current') hpnicf_i_psec_tunnel_table_group_v2 = object_group((1, 3, 6, 1, 4, 1, 11, 2, 14, 11, 15, 2, 126, 2, 2, 2)).setObjects(('HPN-ICF-IPSEC-MONITOR-V2-MIB', 'hpnicfIPsecTunIfIndexV2'), ('HPN-ICF-IPSEC-MONITOR-V2-MIB', 'hpnicfIPsecTunIKETunnelIndexV2'), ('HPN-ICF-IPSEC-MONITOR-V2-MIB', 'hpnicfIPsecTunIKETunLocalIDTypeV2'), ('HPN-ICF-IPSEC-MONITOR-V2-MIB', 'hpnicfIPsecTunIKETunLocalIDVal1V2'), ('HPN-ICF-IPSEC-MONITOR-V2-MIB', 'hpnicfIPsecTunIKETunLocalIDVal2V2'), ('HPN-ICF-IPSEC-MONITOR-V2-MIB', 'hpnicfIPsecTunIKETunRemoteIDTypeV2'), ('HPN-ICF-IPSEC-MONITOR-V2-MIB', 'hpnicfIPsecTunIKETunRemoteIDVal1V2'), ('HPN-ICF-IPSEC-MONITOR-V2-MIB', 'hpnicfIPsecTunIKETunRemoteIDVal2V2'), ('HPN-ICF-IPSEC-MONITOR-V2-MIB', 'hpnicfIPsecTunLocalAddrTypeV2'), ('HPN-ICF-IPSEC-MONITOR-V2-MIB', 'hpnicfIPsecTunLocalAddrV2'), ('HPN-ICF-IPSEC-MONITOR-V2-MIB', 'hpnicfIPsecTunRemoteAddrTypeV2'), ('HPN-ICF-IPSEC-MONITOR-V2-MIB', 'hpnicfIPsecTunRemoteAddrV2'), ('HPN-ICF-IPSEC-MONITOR-V2-MIB', 'hpnicfIPsecTunKeyTypeV2'), ('HPN-ICF-IPSEC-MONITOR-V2-MIB', 'hpnicfIPsecTunEncapModeV2'), ('HPN-ICF-IPSEC-MONITOR-V2-MIB', 'hpnicfIPsecTunInitiatorV2'), ('HPN-ICF-IPSEC-MONITOR-V2-MIB', 'hpnicfIPsecTunLifeSizeV2'), ('HPN-ICF-IPSEC-MONITOR-V2-MIB', 'hpnicfIPsecTunLifeTimeV2'), ('HPN-ICF-IPSEC-MONITOR-V2-MIB', 'hpnicfIPsecTunRemainTimeV2'), ('HPN-ICF-IPSEC-MONITOR-V2-MIB', 'hpnicfIPsecTunActiveTimeV2'), ('HPN-ICF-IPSEC-MONITOR-V2-MIB', 'hpnicfIPsecTunRemainSizeV2'), ('HPN-ICF-IPSEC-MONITOR-V2-MIB', 'hpnicfIPsecTunTotalRefreshesV2'), ('HPN-ICF-IPSEC-MONITOR-V2-MIB', 'hpnicfIPsecTunCurrentSaInstancesV2'), ('HPN-ICF-IPSEC-MONITOR-V2-MIB', 'hpnicfIPsecTunInSaEncryptAlgoV2'), ('HPN-ICF-IPSEC-MONITOR-V2-MIB', 'hpnicfIPsecTunInSaAhAuthAlgoV2'), ('HPN-ICF-IPSEC-MONITOR-V2-MIB', 'hpnicfIPsecTunInSaEspAuthAlgoV2'), ('HPN-ICF-IPSEC-MONITOR-V2-MIB', 'hpnicfIPsecTunDiffHellmanGrpV2'), ('HPN-ICF-IPSEC-MONITOR-V2-MIB', 'hpnicfIPsecTunOutSaEncryptAlgoV2'), ('HPN-ICF-IPSEC-MONITOR-V2-MIB', 'hpnicfIPsecTunOutSaAhAuthAlgoV2'), ('HPN-ICF-IPSEC-MONITOR-V2-MIB', 'hpnicfIPsecTunOutSaEspAuthAlgoV2'), ('HPN-ICF-IPSEC-MONITOR-V2-MIB', 'hpnicfIPsecTunPolicyNameV2'), ('HPN-ICF-IPSEC-MONITOR-V2-MIB', 'hpnicfIPsecTunPolicyNumV2'), ('HPN-ICF-IPSEC-MONITOR-V2-MIB', 'hpnicfIPsecTunStatusV2')) if getattr(mibBuilder, 'version', (0, 0, 0)) > (4, 4, 0): hpnicf_i_psec_tunnel_table_group_v2 = hpnicfIPsecTunnelTableGroupV2.setStatus('current') hpnicf_i_psec_tunnel_stat_group_v2 = object_group((1, 3, 6, 1, 4, 1, 11, 2, 14, 11, 15, 2, 126, 2, 2, 3)).setObjects(('HPN-ICF-IPSEC-MONITOR-V2-MIB', 'hpnicfIPsecTunInOctetsV2'), ('HPN-ICF-IPSEC-MONITOR-V2-MIB', 'hpnicfIPsecTunInDecompOctetsV2'), ('HPN-ICF-IPSEC-MONITOR-V2-MIB', 'hpnicfIPsecTunInPktsV2'), ('HPN-ICF-IPSEC-MONITOR-V2-MIB', 'hpnicfIPsecTunInDropPktsV2'), ('HPN-ICF-IPSEC-MONITOR-V2-MIB', 'hpnicfIPsecTunInReplayDropPktsV2'), ('HPN-ICF-IPSEC-MONITOR-V2-MIB', 'hpnicfIPsecTunInAuthFailsV2'), ('HPN-ICF-IPSEC-MONITOR-V2-MIB', 'hpnicfIPsecTunInDecryptFailsV2'), ('HPN-ICF-IPSEC-MONITOR-V2-MIB', 'hpnicfIPsecTunOutOctetsV2'), ('HPN-ICF-IPSEC-MONITOR-V2-MIB', 'hpnicfIPsecTunOutUncompOctetsV2'), ('HPN-ICF-IPSEC-MONITOR-V2-MIB', 'hpnicfIPsecTunOutPktsV2'), ('HPN-ICF-IPSEC-MONITOR-V2-MIB', 'hpnicfIPsecTunOutDropPktsV2'), ('HPN-ICF-IPSEC-MONITOR-V2-MIB', 'hpnicfIPsecTunOutEncryptFailsV2'), ('HPN-ICF-IPSEC-MONITOR-V2-MIB', 'hpnicfIPsecTunNoMemoryDropPktsV2'), ('HPN-ICF-IPSEC-MONITOR-V2-MIB', 'hpnicfIPsecTunQueueFullDropPktsV2'), ('HPN-ICF-IPSEC-MONITOR-V2-MIB', 'hpnicfIPsecTunInvalidLenDropPktsV2'), ('HPN-ICF-IPSEC-MONITOR-V2-MIB', 'hpnicfIPsecTunTooLongDropPktsV2'), ('HPN-ICF-IPSEC-MONITOR-V2-MIB', 'hpnicfIPsecTunInvalidSaDropPktsV2')) if getattr(mibBuilder, 'version', (0, 0, 0)) > (4, 4, 0): hpnicf_i_psec_tunnel_stat_group_v2 = hpnicfIPsecTunnelStatGroupV2.setStatus('current') hpnicf_i_psec_sa_group_v2 = object_group((1, 3, 6, 1, 4, 1, 11, 2, 14, 11, 15, 2, 126, 2, 2, 4)).setObjects(('HPN-ICF-IPSEC-MONITOR-V2-MIB', 'hpnicfIPsecSaDirectionV2'), ('HPN-ICF-IPSEC-MONITOR-V2-MIB', 'hpnicfIPsecSaSpiValueV2'), ('HPN-ICF-IPSEC-MONITOR-V2-MIB', 'hpnicfIPsecSaSecProtocolV2'), ('HPN-ICF-IPSEC-MONITOR-V2-MIB', 'hpnicfIPsecSaEncryptAlgoV2'), ('HPN-ICF-IPSEC-MONITOR-V2-MIB', 'hpnicfIPsecSaAuthAlgoV2'), ('HPN-ICF-IPSEC-MONITOR-V2-MIB', 'hpnicfIPsecSaStatusV2')) if getattr(mibBuilder, 'version', (0, 0, 0)) > (4, 4, 0): hpnicf_i_psec_sa_group_v2 = hpnicfIPsecSaGroupV2.setStatus('current') hpnicf_i_psec_traffic_table_group_v2 = object_group((1, 3, 6, 1, 4, 1, 11, 2, 14, 11, 15, 2, 126, 2, 2, 5)).setObjects(('HPN-ICF-IPSEC-MONITOR-V2-MIB', 'hpnicfIPsecTrafficLocalTypeV2'), ('HPN-ICF-IPSEC-MONITOR-V2-MIB', 'hpnicfIPsecTrafficLocalAddr1TypeV2'), ('HPN-ICF-IPSEC-MONITOR-V2-MIB', 'hpnicfIPsecTrafficLocalAddr1V2'), ('HPN-ICF-IPSEC-MONITOR-V2-MIB', 'hpnicfIPsecTrafficLocalAddr2TypeV2'), ('HPN-ICF-IPSEC-MONITOR-V2-MIB', 'hpnicfIPsecTrafficLocalAddr2V2'), ('HPN-ICF-IPSEC-MONITOR-V2-MIB', 'hpnicfIPsecTrafficLocalProtocol1V2'), ('HPN-ICF-IPSEC-MONITOR-V2-MIB', 'hpnicfIPsecTrafficLocalProtocol2V2'), ('HPN-ICF-IPSEC-MONITOR-V2-MIB', 'hpnicfIPsecTrafficLocalPort1V2'), ('HPN-ICF-IPSEC-MONITOR-V2-MIB', 'hpnicfIPsecTrafficLocalPort2V2'), ('HPN-ICF-IPSEC-MONITOR-V2-MIB', 'hpnicfIPsecTrafficRemoteTypeV2'), ('HPN-ICF-IPSEC-MONITOR-V2-MIB', 'hpnicfIPsecTrafficRemAddr1TypeV2'), ('HPN-ICF-IPSEC-MONITOR-V2-MIB', 'hpnicfIPsecTrafficRemAddr1V2'), ('HPN-ICF-IPSEC-MONITOR-V2-MIB', 'hpnicfIPsecTrafficRemAddr2TypeV2'), ('HPN-ICF-IPSEC-MONITOR-V2-MIB', 'hpnicfIPsecTrafficRemAddr2V2'), ('HPN-ICF-IPSEC-MONITOR-V2-MIB', 'hpnicfIPsecTrafficRemoPro1V2'), ('HPN-ICF-IPSEC-MONITOR-V2-MIB', 'hpnicfIPsecTrafficRemoPro2V2'), ('HPN-ICF-IPSEC-MONITOR-V2-MIB', 'hpnicfIPsecTrafficRemPort1V2'), ('HPN-ICF-IPSEC-MONITOR-V2-MIB', 'hpnicfIPsecTrafficRemPort2V2')) if getattr(mibBuilder, 'version', (0, 0, 0)) > (4, 4, 0): hpnicf_i_psec_traffic_table_group_v2 = hpnicfIPsecTrafficTableGroupV2.setStatus('current') hpnicf_i_psec_global_stats_group_v2 = object_group((1, 3, 6, 1, 4, 1, 11, 2, 14, 11, 15, 2, 126, 2, 2, 6)).setObjects(('HPN-ICF-IPSEC-MONITOR-V2-MIB', 'hpnicfIPsecGlobalActiveTunnelsV2'), ('HPN-ICF-IPSEC-MONITOR-V2-MIB', 'hpnicfIPsecGlobalActiveSasV2'), ('HPN-ICF-IPSEC-MONITOR-V2-MIB', 'hpnicfIPsecGlobalInOctetsV2'), ('HPN-ICF-IPSEC-MONITOR-V2-MIB', 'hpnicfIPsecGlobalInDecompOctetsV2'), ('HPN-ICF-IPSEC-MONITOR-V2-MIB', 'hpnicfIPsecGlobalInPktsV2'), ('HPN-ICF-IPSEC-MONITOR-V2-MIB', 'hpnicfIPsecGlobalInDropsV2'), ('HPN-ICF-IPSEC-MONITOR-V2-MIB', 'hpnicfIPsecGlobalInReplayDropsV2'), ('HPN-ICF-IPSEC-MONITOR-V2-MIB', 'hpnicfIPsecGlobalInAuthFailsV2'), ('HPN-ICF-IPSEC-MONITOR-V2-MIB', 'hpnicfIPsecGlobalInDecryptFailsV2'), ('HPN-ICF-IPSEC-MONITOR-V2-MIB', 'hpnicfIPsecGlobalOutOctetsV2'), ('HPN-ICF-IPSEC-MONITOR-V2-MIB', 'hpnicfIPsecGlobalOutUncompOctetsV2'), ('HPN-ICF-IPSEC-MONITOR-V2-MIB', 'hpnicfIPsecGlobalOutPktsV2'), ('HPN-ICF-IPSEC-MONITOR-V2-MIB', 'hpnicfIPsecGlobalOutDropsV2'), ('HPN-ICF-IPSEC-MONITOR-V2-MIB', 'hpnicfIPsecGlobalOutEncryptFailsV2'), ('HPN-ICF-IPSEC-MONITOR-V2-MIB', 'hpnicfIPsecGlobalNoMemoryDropsV2'), ('HPN-ICF-IPSEC-MONITOR-V2-MIB', 'hpnicfIPsecGlobalNoFindSaDropsV2'), ('HPN-ICF-IPSEC-MONITOR-V2-MIB', 'hpnicfIPsecGlobalQueueFullDropsV2'), ('HPN-ICF-IPSEC-MONITOR-V2-MIB', 'hpnicfIPsecGlobalInvalidLenDropsV2'), ('HPN-ICF-IPSEC-MONITOR-V2-MIB', 'hpnicfIPsecGlobalTooLongDropsV2'), ('HPN-ICF-IPSEC-MONITOR-V2-MIB', 'hpnicfIPsecGlobalInvalidSaDropsV2')) if getattr(mibBuilder, 'version', (0, 0, 0)) > (4, 4, 0): hpnicf_i_psec_global_stats_group_v2 = hpnicfIPsecGlobalStatsGroupV2.setStatus('current') hpnicf_i_psec_trap_object_group_v2 = object_group((1, 3, 6, 1, 4, 1, 11, 2, 14, 11, 15, 2, 126, 2, 2, 7)).setObjects(('HPN-ICF-IPSEC-MONITOR-V2-MIB', 'hpnicfIPsecPolicyNameV2'), ('HPN-ICF-IPSEC-MONITOR-V2-MIB', 'hpnicfIPsecPolicySeqNumV2'), ('HPN-ICF-IPSEC-MONITOR-V2-MIB', 'hpnicfIPsecPolicySizeV2')) if getattr(mibBuilder, 'version', (0, 0, 0)) > (4, 4, 0): hpnicf_i_psec_trap_object_group_v2 = hpnicfIPsecTrapObjectGroupV2.setStatus('current') hpnicf_i_psec_trap_cntl_group_v2 = object_group((1, 3, 6, 1, 4, 1, 11, 2, 14, 11, 15, 2, 126, 2, 2, 8)).setObjects(('HPN-ICF-IPSEC-MONITOR-V2-MIB', 'hpnicfIPsecTrapGlobalCntlV2'), ('HPN-ICF-IPSEC-MONITOR-V2-MIB', 'hpnicfIPsecTunnelStartTrapCntlV2'), ('HPN-ICF-IPSEC-MONITOR-V2-MIB', 'hpnicfIPsecTunnelStopTrapCntlV2'), ('HPN-ICF-IPSEC-MONITOR-V2-MIB', 'hpnicfIPsecNoSaTrapCntlV2'), ('HPN-ICF-IPSEC-MONITOR-V2-MIB', 'hpnicfIPsecAuthFailureTrapCntlV2'), ('HPN-ICF-IPSEC-MONITOR-V2-MIB', 'hpnicfIPsecEncryFailureTrapCntlV2'), ('HPN-ICF-IPSEC-MONITOR-V2-MIB', 'hpnicfIPsecDecryFailureTrapCntlV2'), ('HPN-ICF-IPSEC-MONITOR-V2-MIB', 'hpnicfIPsecInvalidSaTrapCntlV2'), ('HPN-ICF-IPSEC-MONITOR-V2-MIB', 'hpnicfIPsecPolicyAddTrapCntlV2'), ('HPN-ICF-IPSEC-MONITOR-V2-MIB', 'hpnicfIPsecPolicyDelTrapCntlV2'), ('HPN-ICF-IPSEC-MONITOR-V2-MIB', 'hpnicfIPsecPolicyAttachTrapCntlV2'), ('HPN-ICF-IPSEC-MONITOR-V2-MIB', 'hpnicfIPsecPolicyDetachTrapCntlV2')) if getattr(mibBuilder, 'version', (0, 0, 0)) > (4, 4, 0): hpnicf_i_psec_trap_cntl_group_v2 = hpnicfIPsecTrapCntlGroupV2.setStatus('current') hpnicf_i_psec_trap_group_v2 = notification_group((1, 3, 6, 1, 4, 1, 11, 2, 14, 11, 15, 2, 126, 2, 2, 9)).setObjects(('HPN-ICF-IPSEC-MONITOR-V2-MIB', 'hpnicfIPsecTunnelStartV2'), ('HPN-ICF-IPSEC-MONITOR-V2-MIB', 'hpnicfIPsecTunnelStopV2'), ('HPN-ICF-IPSEC-MONITOR-V2-MIB', 'hpnicfIPsecNoSaFailureV2'), ('HPN-ICF-IPSEC-MONITOR-V2-MIB', 'hpnicfIPsecAuthFailFailureV2'), ('HPN-ICF-IPSEC-MONITOR-V2-MIB', 'hpnicfIPsecEncryFailFailureV2'), ('HPN-ICF-IPSEC-MONITOR-V2-MIB', 'hpnicfIPsecDecryFailFailureV2'), ('HPN-ICF-IPSEC-MONITOR-V2-MIB', 'hpnicfIPsecInvalidSaFailureV2'), ('HPN-ICF-IPSEC-MONITOR-V2-MIB', 'hpnicfIPsecPolicyAddV2'), ('HPN-ICF-IPSEC-MONITOR-V2-MIB', 'hpnicfIPsecPolicyDelV2'), ('HPN-ICF-IPSEC-MONITOR-V2-MIB', 'hpnicfIPsecPolicyAttachV2'), ('HPN-ICF-IPSEC-MONITOR-V2-MIB', 'hpnicfIPsecPolicyDetachV2')) if getattr(mibBuilder, 'version', (0, 0, 0)) > (4, 4, 0): hpnicf_i_psec_trap_group_v2 = hpnicfIPsecTrapGroupV2.setStatus('current') mibBuilder.exportSymbols('HPN-ICF-IPSEC-MONITOR-V2-MIB', HpnicfIPsecSaProtocolV2=HpnicfIPsecSaProtocolV2, hpnicfIPsecTunInReplayDropPktsV2=hpnicfIPsecTunInReplayDropPktsV2, hpnicfIPsecTunnelStatV2Entry=hpnicfIPsecTunnelStatV2Entry, hpnicfIPsecTunTooLongDropPktsV2=hpnicfIPsecTunTooLongDropPktsV2, hpnicfIPsecTunnelTableGroupV2=hpnicfIPsecTunnelTableGroupV2, hpnicfIPsecTrafficRemoteTypeV2=hpnicfIPsecTrafficRemoteTypeV2, HpnicfIPsecAuthAlgoV2=HpnicfIPsecAuthAlgoV2, hpnicfIPsecTunOutPktsV2=hpnicfIPsecTunOutPktsV2, hpnicfIPsecNoSaFailureV2=hpnicfIPsecNoSaFailureV2, hpnicfIPsecEncryFailFailureV2=hpnicfIPsecEncryFailFailureV2, hpnicfIPsecTrafficLocalAddr2TypeV2=hpnicfIPsecTrafficLocalAddr2TypeV2, hpnicfIPsecSaDirectionV2=hpnicfIPsecSaDirectionV2, hpnicfIPsecTunTotalRefreshesV2=hpnicfIPsecTunTotalRefreshesV2, hpnicfIPsecTrafficLocalAddr2V2=hpnicfIPsecTrafficLocalAddr2V2, hpnicfIPsecPolicyAddV2=hpnicfIPsecPolicyAddV2, hpnicfIPsecSaAuthAlgoV2=hpnicfIPsecSaAuthAlgoV2, hpnicfIPsecGlobalOutPktsV2=hpnicfIPsecGlobalOutPktsV2, hpnicfIPsecTunNoMemoryDropPktsV2=hpnicfIPsecTunNoMemoryDropPktsV2, hpnicfIPsecTunLocalAddrTypeV2=hpnicfIPsecTunLocalAddrTypeV2, hpnicfIPsecDecryFailFailureV2=hpnicfIPsecDecryFailFailureV2, hpnicfIPsecSaGroupV2=hpnicfIPsecSaGroupV2, hpnicfIPsecTunOutUncompOctetsV2=hpnicfIPsecTunOutUncompOctetsV2, hpnicfIPsecTunInDecryptFailsV2=hpnicfIPsecTunInDecryptFailsV2, hpnicfIPsecTunInSaEspAuthAlgoV2=hpnicfIPsecTunInSaEspAuthAlgoV2, hpnicfIPsecGlobalInPktsV2=hpnicfIPsecGlobalInPktsV2, hpnicfIPsecGlobalOutEncryptFailsV2=hpnicfIPsecGlobalOutEncryptFailsV2, hpnicfIPsecGroupsV2=hpnicfIPsecGroupsV2, hpnicfIPsecPolicyNameV2=hpnicfIPsecPolicyNameV2, hpnicfIPsecTrafficRemAddr1TypeV2=hpnicfIPsecTrafficRemAddr1TypeV2, hpnicfIPsecTrafficRemPort1V2=hpnicfIPsecTrafficRemPort1V2, hpnicfIPsecMIBVersion=hpnicfIPsecMIBVersion, hpnicfIPsecTunIndexV2=hpnicfIPsecTunIndexV2, hpnicfIPsecTunnelStartV2=hpnicfIPsecTunnelStartV2, hpnicfIPsecGlobalInvalidSaDropsV2=hpnicfIPsecGlobalInvalidSaDropsV2, hpnicfIPsecTunRemainSizeV2=hpnicfIPsecTunRemainSizeV2, hpnicfIPsecTrafficRemAddr2TypeV2=hpnicfIPsecTrafficRemAddr2TypeV2, hpnicfIPsecTunInAuthFailsV2=hpnicfIPsecTunInAuthFailsV2, hpnicfIPsecGlobalTooLongDropsV2=hpnicfIPsecGlobalTooLongDropsV2, hpnicfIPsecInvalidSaTrapCntlV2=hpnicfIPsecInvalidSaTrapCntlV2, hpnicfIPsecTrafficRemPort2V2=hpnicfIPsecTrafficRemPort2V2, hpnicfIPsecGlobalInAuthFailsV2=hpnicfIPsecGlobalInAuthFailsV2, hpnicfIPsecTunOutDropPktsV2=hpnicfIPsecTunOutDropPktsV2, hpnicfIPsecPolicyAttachTrapCntlV2=hpnicfIPsecPolicyAttachTrapCntlV2, hpnicfIPsecTunDiffHellmanGrpV2=hpnicfIPsecTunDiffHellmanGrpV2, hpnicfIPsecTrafficLocalProtocol1V2=hpnicfIPsecTrafficLocalProtocol1V2, hpnicfIPsecTunnelV2Table=hpnicfIPsecTunnelV2Table, hpnicfIPsecTrapGroupV2=hpnicfIPsecTrapGroupV2, hpnicfIPsecTrafficRemAddr2V2=hpnicfIPsecTrafficRemAddr2V2, hpnicfIPsecTunQueueFullDropPktsV2=hpnicfIPsecTunQueueFullDropPktsV2, hpnicfIPsecTunKeyTypeV2=hpnicfIPsecTunKeyTypeV2, hpnicfIPsecTunInvalidSaDropPktsV2=hpnicfIPsecTunInvalidSaDropPktsV2, hpnicfIPsecGlobalOutUncompOctetsV2=hpnicfIPsecGlobalOutUncompOctetsV2, hpnicfIPsecTrafficTableGroupV2=hpnicfIPsecTrafficTableGroupV2, hpnicfIPsecTrafficRemoPro1V2=hpnicfIPsecTrafficRemoPro1V2, hpnicfIPsecTunPolicyNameV2=hpnicfIPsecTunPolicyNameV2, hpnicfIPsecTunInOctetsV2=hpnicfIPsecTunInOctetsV2, HpnicfIPsecDiffHellmanGrpV2=HpnicfIPsecDiffHellmanGrpV2, hpnicfIPsecSaIndexV2=hpnicfIPsecSaIndexV2, PYSNMP_MODULE_ID=hpnicfIPsecMonitorV2, hpnicfIPsecTunIfIndexV2=hpnicfIPsecTunIfIndexV2, hpnicfIPsecSaSecProtocolV2=hpnicfIPsecSaSecProtocolV2, hpnicfIPsecTunIKETunLocalIDVal1V2=hpnicfIPsecTunIKETunLocalIDVal1V2, hpnicfIPsecSaEncryptAlgoV2=hpnicfIPsecSaEncryptAlgoV2, hpnicfIPsecPolicySeqNumV2=hpnicfIPsecPolicySeqNumV2, hpnicfIPsecTunOutSaEncryptAlgoV2=hpnicfIPsecTunOutSaEncryptAlgoV2, hpnicfIPsecComplianceV2=hpnicfIPsecComplianceV2, hpnicfIPsecTunOutOctetsV2=hpnicfIPsecTunOutOctetsV2, hpnicfIPsecGlobalOutOctetsV2=hpnicfIPsecGlobalOutOctetsV2, hpnicfIPsecEncryFailureTrapCntlV2=hpnicfIPsecEncryFailureTrapCntlV2, hpnicfIPsecTunInDecompOctetsV2=hpnicfIPsecTunInDecompOctetsV2, hpnicfIPsecPolicyAttachV2=hpnicfIPsecPolicyAttachV2, hpnicfIPsecGlobalInOctetsV2=hpnicfIPsecGlobalInOctetsV2, hpnicfIPsecGlobalInReplayDropsV2=hpnicfIPsecGlobalInReplayDropsV2, hpnicfIPsecTunInSaEncryptAlgoV2=hpnicfIPsecTunInSaEncryptAlgoV2, hpnicfIPsecGlobalNoMemoryDropsV2=hpnicfIPsecGlobalNoMemoryDropsV2, hpnicfIPsecTrafficLocalAddr1V2=hpnicfIPsecTrafficLocalAddr1V2, hpnicfIPsecTrafficLocalAddr1TypeV2=hpnicfIPsecTrafficLocalAddr1TypeV2, hpnicfIPsecTunIKETunRemoteIDVal2V2=hpnicfIPsecTunIKETunRemoteIDVal2V2, hpnicfIPsecTunCurrentSaInstancesV2=hpnicfIPsecTunCurrentSaInstancesV2, hpnicfIPsecGlobalInDropsV2=hpnicfIPsecGlobalInDropsV2, hpnicfIPsecPolicyDelV2=hpnicfIPsecPolicyDelV2, hpnicfIPsecTrafficLocalPort1V2=hpnicfIPsecTrafficLocalPort1V2, hpnicfIPsecTunInvalidLenDropPktsV2=hpnicfIPsecTunInvalidLenDropPktsV2, hpnicfIPsecPolicyAddTrapCntlV2=hpnicfIPsecPolicyAddTrapCntlV2, hpnicfIPsecTrapV2=hpnicfIPsecTrapV2, hpnicfIPsecMonitorV2=hpnicfIPsecMonitorV2, hpnicfIPsecTrafficV2Table=hpnicfIPsecTrafficV2Table, hpnicfIPsecTunOutEncryptFailsV2=hpnicfIPsecTunOutEncryptFailsV2, hpnicfIPsecTrafficLocalTypeV2=hpnicfIPsecTrafficLocalTypeV2, hpnicfIPsecTrapObjectV2=hpnicfIPsecTrapObjectV2, hpnicfIPsecPolicyDetachV2=hpnicfIPsecPolicyDetachV2, hpnicfIPsecGlobalInvalidLenDropsV2=hpnicfIPsecGlobalInvalidLenDropsV2, hpnicfIPsecTunInSaAhAuthAlgoV2=hpnicfIPsecTunInSaAhAuthAlgoV2, hpnicfIPsecSaV2Table=hpnicfIPsecSaV2Table, hpnicfIPsecPolicySizeV2=hpnicfIPsecPolicySizeV2, hpnicfIPsecTunIKETunRemoteIDTypeV2=hpnicfIPsecTunIKETunRemoteIDTypeV2, hpnicfIPsecAuthFailureTrapCntlV2=hpnicfIPsecAuthFailureTrapCntlV2, hpnicfIPsecTunIKETunRemoteIDVal1V2=hpnicfIPsecTunIKETunRemoteIDVal1V2, hpnicfIPsecObjectsV2=hpnicfIPsecObjectsV2, hpnicfIPsecGlobalActiveSasV2=hpnicfIPsecGlobalActiveSasV2, hpnicfIPsecTunLifeSizeV2=hpnicfIPsecTunLifeSizeV2, hpnicfIPsecTrafficLocalProtocol2V2=hpnicfIPsecTrafficLocalProtocol2V2, hpnicfIPsecGlobalInDecompOctetsV2=hpnicfIPsecGlobalInDecompOctetsV2, hpnicfIPsecTrafficV2Entry=hpnicfIPsecTrafficV2Entry, HpnicfIPsecIDTypeV2=HpnicfIPsecIDTypeV2, hpnicfIPsecTunStatusV2=hpnicfIPsecTunStatusV2, hpnicfIPsecCompliancesV2=hpnicfIPsecCompliancesV2, HpnicfIPsecEncryptAlgoV2=HpnicfIPsecEncryptAlgoV2, hpnicfIPsecTrafficRemoPro2V2=hpnicfIPsecTrafficRemoPro2V2, hpnicfIPsecTrafficRemAddr1V2=hpnicfIPsecTrafficRemAddr1V2, hpnicfIPsecPolicyDelTrapCntlV2=hpnicfIPsecPolicyDelTrapCntlV2, hpnicfIPsecTunOutSaAhAuthAlgoV2=hpnicfIPsecTunOutSaAhAuthAlgoV2, hpnicfIPsecSaStatusV2=hpnicfIPsecSaStatusV2, hpnicfIPsecGlobalOutDropsV2=hpnicfIPsecGlobalOutDropsV2, hpnicfIPsecTunRemoteAddrTypeV2=hpnicfIPsecTunRemoteAddrTypeV2, hpnicfIPsecTrapObjectGroupV2=hpnicfIPsecTrapObjectGroupV2, hpnicfIPsecTunEncapModeV2=hpnicfIPsecTunEncapModeV2, hpnicfIPsecTunnelStatGroupV2=hpnicfIPsecTunnelStatGroupV2, hpnicfIPsecTunLifeTimeV2=hpnicfIPsecTunLifeTimeV2, hpnicfIPsecTunnelStopTrapCntlV2=hpnicfIPsecTunnelStopTrapCntlV2, hpnicfIPsecPolicyDetachTrapCntlV2=hpnicfIPsecPolicyDetachTrapCntlV2, hpnicfIPsecTunOutSaEspAuthAlgoV2=hpnicfIPsecTunOutSaEspAuthAlgoV2, HpnicfIPsecTrafficTypeV2=HpnicfIPsecTrafficTypeV2, hpnicfIPsecTunInitiatorV2=hpnicfIPsecTunInitiatorV2, hpnicfIPsecTunInPktsV2=hpnicfIPsecTunInPktsV2, hpnicfIPsecSaV2Entry=hpnicfIPsecSaV2Entry, hpnicfIPsecTunIKETunLocalIDVal2V2=hpnicfIPsecTunIKETunLocalIDVal2V2, hpnicfIPsecGlobalActiveTunnelsV2=hpnicfIPsecGlobalActiveTunnelsV2, hpnicfIPsecAuthFailFailureV2=hpnicfIPsecAuthFailFailureV2, hpnicfIPsecTunnelStatV2Table=hpnicfIPsecTunnelStatV2Table, hpnicfIPsecTunPolicyNumV2=hpnicfIPsecTunPolicyNumV2, hpnicfIPsecGlobalQueueFullDropsV2=hpnicfIPsecGlobalQueueFullDropsV2, HpnicfIPsecNegoTypeV2=HpnicfIPsecNegoTypeV2, hpnicfIPsecInvalidSaFailureV2=hpnicfIPsecInvalidSaFailureV2, hpnicfIPsecGlobalStatsGroupV2=hpnicfIPsecGlobalStatsGroupV2, hpnicfIPsecTunnelV2Entry=hpnicfIPsecTunnelV2Entry, hpnicfIPsecTunRemoteAddrV2=hpnicfIPsecTunRemoteAddrV2, HpnicfIPsecTunnelStateV2=HpnicfIPsecTunnelStateV2, hpnicfIPsecSaSpiValueV2=hpnicfIPsecSaSpiValueV2, hpnicfIPsecTunIKETunnelIndexV2=hpnicfIPsecTunIKETunnelIndexV2, hpnicfIPsecNoSaTrapCntlV2=hpnicfIPsecNoSaTrapCntlV2, hpnicfIPsecScalarObjectsGroupV2=hpnicfIPsecScalarObjectsGroupV2, hpnicfIPsecConformanceV2=hpnicfIPsecConformanceV2, hpnicfIPsecNotificationsV2=hpnicfIPsecNotificationsV2, HpnicfIPsecEncapModeV2=HpnicfIPsecEncapModeV2, hpnicfIPsecGlobalInDecryptFailsV2=hpnicfIPsecGlobalInDecryptFailsV2, hpnicfIPsecTrapCntlV2=hpnicfIPsecTrapCntlV2, hpnicfIPsecTunInDropPktsV2=hpnicfIPsecTunInDropPktsV2, hpnicfIPsecTunActiveTimeV2=hpnicfIPsecTunActiveTimeV2, hpnicfIPsecTrafficLocalPort2V2=hpnicfIPsecTrafficLocalPort2V2, hpnicfIPsecDecryFailureTrapCntlV2=hpnicfIPsecDecryFailureTrapCntlV2, hpnicfIPsecTrapGlobalCntlV2=hpnicfIPsecTrapGlobalCntlV2, hpnicfIPsecTunRemainTimeV2=hpnicfIPsecTunRemainTimeV2, hpnicfIPsecTrapCntlGroupV2=hpnicfIPsecTrapCntlGroupV2, hpnicfIPsecScalarObjectsV2=hpnicfIPsecScalarObjectsV2, hpnicfIPsecTunLocalAddrV2=hpnicfIPsecTunLocalAddrV2, hpnicfIPsecGlobalStatsV2=hpnicfIPsecGlobalStatsV2, hpnicfIPsecTunnelStartTrapCntlV2=hpnicfIPsecTunnelStartTrapCntlV2, hpnicfIPsecGlobalNoFindSaDropsV2=hpnicfIPsecGlobalNoFindSaDropsV2, hpnicfIPsecTunIKETunLocalIDTypeV2=hpnicfIPsecTunIKETunLocalIDTypeV2, hpnicfIPsecTunnelStopV2=hpnicfIPsecTunnelStopV2)
# You are given a perfect binary tree where all leaves are on the same level, and every parent has two children. The binary tree has the following definition: # struct Node { # int val; # Node *left; # Node *right; # Node *next; # } # Populate each next pointer to point to its next right node. If there is no next right node, the next pointer should be set to NULL. # Initially, all next pointers are set to NULL. # NOTE: Leetcode asks for soln using O(1) space. Look at leetcode discussions for this soln. class Node: def __init__(self, val, left, right, next): self.val = val self.left = left self.right = right self.next = next class Solution: def connect(self, root: 'Node') -> 'Node': if not root: return None cur = root level, nextLevel = [cur], [] while level: for i in range(0, len(level) - 1): level[i].next = level[i + 1] for node in level: if node.left: nextLevel.append(node.left) if node.right: nextLevel.append(node.right) level = nextLevel nextLevel = [] return root
class Node: def __init__(self, val, left, right, next): self.val = val self.left = left self.right = right self.next = next class Solution: def connect(self, root: 'Node') -> 'Node': if not root: return None cur = root (level, next_level) = ([cur], []) while level: for i in range(0, len(level) - 1): level[i].next = level[i + 1] for node in level: if node.left: nextLevel.append(node.left) if node.right: nextLevel.append(node.right) level = nextLevel next_level = [] return root
while 1: while 1: while 1: break break break
while 1: while 1: while 1: break break break
class Edge: def __init__(self, src, dest, cost, vertex1, vertex2, wasser_cost=0): self.src = src self.dest = dest self.cost = cost self.vertex1 = vertex1 self.vertex2 = vertex2 self.wasser_cost = wasser_cost
class Edge: def __init__(self, src, dest, cost, vertex1, vertex2, wasser_cost=0): self.src = src self.dest = dest self.cost = cost self.vertex1 = vertex1 self.vertex2 = vertex2 self.wasser_cost = wasser_cost
# Alexis Cumpstone # Created: 2019 #This program extracts the coded word from the given string and prints, on #one line, the word in all uppercase, all lowercase and in reverse. encoded = "absbpstokyhopwok" #Extract every 4th character from the string to form the 4 letter word decoded = encoded[3::4] wordAllUpper = decoded.upper() wordAllLower = decoded.lower() wordReverse = decoded[::-1] print(wordAllUpper, wordAllLower, wordReverse)
encoded = 'absbpstokyhopwok' decoded = encoded[3::4] word_all_upper = decoded.upper() word_all_lower = decoded.lower() word_reverse = decoded[::-1] print(wordAllUpper, wordAllLower, wordReverse)
#!/usr/bin/python3 def no_c(my_string): str = "" for i in my_string[:]: if i != 'c' and i != 'C': str += i return (str)
def no_c(my_string): str = '' for i in my_string[:]: if i != 'c' and i != 'C': str += i return str
# Funktion: max def list_max(my_list): result = my_list[0] for i in range(1, len(my_list)): wert = my_list[i] if wert > result: result = wert return result # Liste l1 = [-2, 1, -10] l2 = [-20, 123, 22] # Funktionsaufruf l1_max = list_max(l1) l2_max = list_max(l2)
def list_max(my_list): result = my_list[0] for i in range(1, len(my_list)): wert = my_list[i] if wert > result: result = wert return result l1 = [-2, 1, -10] l2 = [-20, 123, 22] l1_max = list_max(l1) l2_max = list_max(l2)
''' +------+-------+----------------+ | Item | Price | Special offers | +------+-------+----------------+ | A | 50 | 3A for 130 | | B | 30 | 2B for 45 | | C | 20 | | | D | 15 | | +------+-------+----------------+ ''' def get_skus(): return { 'A': {'price':50, 'offers': [{'amount': 3, 'price': 130}]}, 'B': {'price':30, 'offers': [{'amount': 2, 'price': 45}]}, 'C': {'price':20, 'offers': []}, 'D': {'price':15, 'offers': []} } # noinspection PyUnusedLocal # skus = unicode string def checkout(basket): skus = get_skus() if list(set(basket) - set(skus.keys())): return -1 total_price = 0 for (sku, options) in skus.iteritems(): amount = basket.count(sku) for offer in options['offers']: while offer['amount'] <= amount: total_price += offer['price'] amount -= offer['amount'] total_price += amount * options['price'] return total_price
""" +------+-------+----------------+ | Item | Price | Special offers | +------+-------+----------------+ | A | 50 | 3A for 130 | | B | 30 | 2B for 45 | | C | 20 | | | D | 15 | | +------+-------+----------------+ """ def get_skus(): return {'A': {'price': 50, 'offers': [{'amount': 3, 'price': 130}]}, 'B': {'price': 30, 'offers': [{'amount': 2, 'price': 45}]}, 'C': {'price': 20, 'offers': []}, 'D': {'price': 15, 'offers': []}} def checkout(basket): skus = get_skus() if list(set(basket) - set(skus.keys())): return -1 total_price = 0 for (sku, options) in skus.iteritems(): amount = basket.count(sku) for offer in options['offers']: while offer['amount'] <= amount: total_price += offer['price'] amount -= offer['amount'] total_price += amount * options['price'] return total_price
## @package fib # # @author cognocoder. # Fibonacci glued between Python and C++. ## Fibonacci list. # @param n specifies the size of the list. # @returns Returns a Fibonacci list with n elements. # @throws ValeuError for negative values of n. # @see {@link #fib.ifib ifib}, {@link #fib.bfib bfib}. def fib(n): try: return ifib(n) except TypeError: return ifib(int(n)) ## Recursive Fibonacci list. # @param n specifies the size of the list. # @returns Returns a Fibonacci list with n elements. # @throws ValeuError for negative values of n. # @see {@link #fib.bfib bfib}. def ifib(n): arr = bfib(n) if n < 3: return arr while len(arr) < n: arr.append(arr[-2] + arr[-1]) return arr ## Base Fibonacci list. # @param n specifies the size of the list. # @return Returns a base Fibonacci list. # @throws ValeuError for negative values of n. def bfib(n): if n < 0: raise ValueError("n must be a positve integer") arr = [] if n == 0: return arr arr.append(0) if n == 1: return arr # Base list size limit reached arr.append(1) return arr
def fib(n): try: return ifib(n) except TypeError: return ifib(int(n)) def ifib(n): arr = bfib(n) if n < 3: return arr while len(arr) < n: arr.append(arr[-2] + arr[-1]) return arr def bfib(n): if n < 0: raise value_error('n must be a positve integer') arr = [] if n == 0: return arr arr.append(0) if n == 1: return arr arr.append(1) return arr
class console: def log(*args, **kwargs): print(*args, **kwargs) console.log("Hello World")
class Console: def log(*args, **kwargs): print(*args, **kwargs) console.log('Hello World')
# Number of terms till which the sequence needs to be printed n = int(input()) a, b = 1, 1 count = 0 # We need to first check if the number is prime or not def ifprime(n): if n> 1: for i in range(2, n// 2 + 1): if (n % i) == 0: return False else: return True else: return False if n == 1: print("Fibonacci sequence upto", n, ":") print(a) else: while count < n: if not ifprime(n1) and a % 5 != 0: print(a, end=' ') else: print(0, end=' ') sums = a + b a = b b = sums count += 1
n = int(input()) (a, b) = (1, 1) count = 0 def ifprime(n): if n > 1: for i in range(2, n // 2 + 1): if n % i == 0: return False else: return True else: return False if n == 1: print('Fibonacci sequence upto', n, ':') print(a) else: while count < n: if not ifprime(n1) and a % 5 != 0: print(a, end=' ') else: print(0, end=' ') sums = a + b a = b b = sums count += 1
class A(object): __doc__ = 16 print(A.__doc__) # <ref>
class A(object): __doc__ = 16 print(A.__doc__)
class SemesterNotFoundException(Exception): # Invalid semester or module does not take place during the specified semester def __init__(self, semester, *args): super().__init__(args) self.semester = semester def __str__(self): return f'No valid modules found for semester {self.semester}' class YearNotFoundException(Exception): # Invalid year def __init__(self, year, *args): super().__init__(args) self.year = year def __str__(self): return f'No valid modules found for academic year {self.year}' class CalendarOutOfRangeError(Exception): # data for the year not present in database def __init__(self, *args): super().__init__(args) def __str__(self): return 'Current date does not fall within any given date boundaries'
class Semesternotfoundexception(Exception): def __init__(self, semester, *args): super().__init__(args) self.semester = semester def __str__(self): return f'No valid modules found for semester {self.semester}' class Yearnotfoundexception(Exception): def __init__(self, year, *args): super().__init__(args) self.year = year def __str__(self): return f'No valid modules found for academic year {self.year}' class Calendaroutofrangeerror(Exception): def __init__(self, *args): super().__init__(args) def __str__(self): return 'Current date does not fall within any given date boundaries'
class Solution: def findMissingRanges(self, nums: List[int], lower: int, upper: int) -> List[str]: """Array. Running time: O(n) where n == len(nums). """ res = [] nxt = lower for i in range(len(nums)): if nums[i] < nxt: continue if nums[i] == nxt: nxt += 1 continue self._append_range(nxt, nums[i] - 1, res) nxt = nums[i] + 1 self._append_range(nxt, upper, res) return res def _append_range(self, lo, hi, res): if lo == hi: res.append(str(lo)) elif lo < hi: res.append(str(lo) + '->' + str(hi))
class Solution: def find_missing_ranges(self, nums: List[int], lower: int, upper: int) -> List[str]: """Array. Running time: O(n) where n == len(nums). """ res = [] nxt = lower for i in range(len(nums)): if nums[i] < nxt: continue if nums[i] == nxt: nxt += 1 continue self._append_range(nxt, nums[i] - 1, res) nxt = nums[i] + 1 self._append_range(nxt, upper, res) return res def _append_range(self, lo, hi, res): if lo == hi: res.append(str(lo)) elif lo < hi: res.append(str(lo) + '->' + str(hi))
# Working with strings print("Hello world!") # Combine strings language = "Python" print("I learning " + language) # Convert to string age = 23 print("I'm " + str(age) + " old.")
print('Hello world!') language = 'Python' print('I learning ' + language) age = 23 print("I'm " + str(age) + ' old.')
class Vertex: def __init__(self, node): self.id = node self.cons = {} def add_con(self, con, weight): self.cons[con] = weight def get_cons(self): return self.cons.keys() def get_id(self): return self.id def get_weight(self, con): return self.cons[con] class Graph: def __init__(self): self.verticies = {} def add_vertex(self, node): self.verticies[node] = Vertex(node) return self.verticies[node] def add_edge(self, frm, to, weight): if frm not in self.verticies: self.add_edge(frm) if to not in self.verticies: self.add_edge(to) self.verticies[frm].add_con(self.verticies[to], weight) self.verticies[to].add_con(self.verticies[frm], weight) def get_verticies(self): return self.verticies.keys()
class Vertex: def __init__(self, node): self.id = node self.cons = {} def add_con(self, con, weight): self.cons[con] = weight def get_cons(self): return self.cons.keys() def get_id(self): return self.id def get_weight(self, con): return self.cons[con] class Graph: def __init__(self): self.verticies = {} def add_vertex(self, node): self.verticies[node] = vertex(node) return self.verticies[node] def add_edge(self, frm, to, weight): if frm not in self.verticies: self.add_edge(frm) if to not in self.verticies: self.add_edge(to) self.verticies[frm].add_con(self.verticies[to], weight) self.verticies[to].add_con(self.verticies[frm], weight) def get_verticies(self): return self.verticies.keys()
def solve(): fib = [1, 2] even = [2] while sum(fib[-2:]) <= 4000000: number = sum(fib[-2:]) if number % 2: even.append(number) fib.append(number) return sum(even) def main(): print(f"{solve()=}") if __name__ == "__main__": main()
def solve(): fib = [1, 2] even = [2] while sum(fib[-2:]) <= 4000000: number = sum(fib[-2:]) if number % 2: even.append(number) fib.append(number) return sum(even) def main(): print(f'solve()={solve()!r}') if __name__ == '__main__': main()
# -*- mode: python -*- # Ansible is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with Ansible. If not, see <http://www.gnu.org/licenses/>. DOCUMENTATION = ''' --- author: "Benno Joy (@bennojoy)" module: include_vars short_description: Load variables from files, dynamically within a task. description: - Loads variables from a YAML/JSON file dynamically during task runtime. It can work with conditionals, or use host specific variables to determine the path name to load from. options: file: version_added: "2.2" description: - The file name from which variables should be loaded. - If the path is relative, it will look for the file in vars/ subdirectory of a role or relative to playbook. name: version_added: "2.2" description: - The name of a variable into which assign the included vars, if omitted (null) they will be made top level vars. default: null free-form: description: - This module allows you to specify the 'file' option directly w/o any other options. notes: - The file is always required either as the explicit option or using the free-form. version_added: "1.4" ''' EXAMPLES = """ # Include vars of stuff.yml into the 'stuff' variable (2.2). - include_vars: file: stuff.yml name: stuff # Conditionally decide to load in variables into 'plans' when x is 0, otherwise do not. (2.2) - include_vars: file=contingency_plan.yml name=plans when: x == 0 # Load a variable file based on the OS type, or a default if not found. - include_vars: "{{ item }}" with_first_found: - "{{ ansible_distribution }}.yml" - "{{ ansible_os_family }}.yml" - "default.yml" # bare include (free-form) - include_vars: myvars.yml """
documentation = '\n---\nauthor: "Benno Joy (@bennojoy)"\nmodule: include_vars\nshort_description: Load variables from files, dynamically within a task.\ndescription:\n - Loads variables from a YAML/JSON file dynamically during task runtime. It can work with conditionals, or use host specific variables to determine the path name to load from.\noptions:\n file:\n version_added: "2.2"\n description:\n - The file name from which variables should be loaded.\n - If the path is relative, it will look for the file in vars/ subdirectory of a role or relative to playbook.\n name:\n version_added: "2.2"\n description:\n - The name of a variable into which assign the included vars, if omitted (null) they will be made top level vars.\n default: null\n free-form:\n description:\n - This module allows you to specify the \'file\' option directly w/o any other options.\nnotes:\n - The file is always required either as the explicit option or using the free-form.\nversion_added: "1.4"\n' examples = '\n# Include vars of stuff.yml into the \'stuff\' variable (2.2).\n- include_vars:\n file: stuff.yml\n name: stuff\n\n# Conditionally decide to load in variables into \'plans\' when x is 0, otherwise do not. (2.2)\n- include_vars: file=contingency_plan.yml name=plans\n when: x == 0\n\n# Load a variable file based on the OS type, or a default if not found.\n- include_vars: "{{ item }}"\n with_first_found:\n - "{{ ansible_distribution }}.yml"\n - "{{ ansible_os_family }}.yml"\n - "default.yml"\n\n# bare include (free-form)\n- include_vars: myvars.yml\n\n'
n = int(input()) a = list(map(int, input().split())) cnt = [0] * 1010 for num in a: cnt[num] += 1 for i in range(1, 1000 + 1): if cnt[i] > 1: print('No') quit() print('Yes')
n = int(input()) a = list(map(int, input().split())) cnt = [0] * 1010 for num in a: cnt[num] += 1 for i in range(1, 1000 + 1): if cnt[i] > 1: print('No') quit() print('Yes')
class Worker: """ Abstract class to define the basic structure of a specif type of worker. """ def __init__(self): """ Initialize worker instance. """ raise NotImplementedError def run(self): """ Logic to be executed on each iteration. """ raise NotImplementedError def do_work(self): """ Performs a specific type of work. """ raise NotImplementedError class TimedWorker(Worker): def __init__(self, wait_time): """ Initialize timed worker class. """ self.wait_time = wait_time def run(self, shutdown_event): """ Calls do_work method inside an infinite loop and wait n seconds to receive a shutdown event before calling do_work again. """ do_work = True while not shutdown_event.is_set(): try: if do_work: self.do_work() shutdown_event.wait(self.wait_time) except KeyboardInterrupt: do_work = False
class Worker: """ Abstract class to define the basic structure of a specif type of worker. """ def __init__(self): """ Initialize worker instance. """ raise NotImplementedError def run(self): """ Logic to be executed on each iteration. """ raise NotImplementedError def do_work(self): """ Performs a specific type of work. """ raise NotImplementedError class Timedworker(Worker): def __init__(self, wait_time): """ Initialize timed worker class. """ self.wait_time = wait_time def run(self, shutdown_event): """ Calls do_work method inside an infinite loop and wait n seconds to receive a shutdown event before calling do_work again. """ do_work = True while not shutdown_event.is_set(): try: if do_work: self.do_work() shutdown_event.wait(self.wait_time) except KeyboardInterrupt: do_work = False
class Solution(object): def reverse(self, x): res = 0 ax = abs(x) while ax != 0: pop = ax % 10 ax = int(ax/10) res = res * 10 + pop if (x < 0): res *= -1 return res b = -123 % -10 a = Solution().reverse(-123)
class Solution(object): def reverse(self, x): res = 0 ax = abs(x) while ax != 0: pop = ax % 10 ax = int(ax / 10) res = res * 10 + pop if x < 0: res *= -1 return res b = -123 % -10 a = solution().reverse(-123)
def bs_decode(binary: str, key: str) -> int: sum = 0 last_idx = 0 for i, s in enumerate(binary): if s == '0': continue elif s == '1': sum += int(key[last_idx: i + 1]) last_idx = i + 1 else: assert False sum += int(key[last_idx:]) return sum def binary_search(binary: str, key: str) -> int: if len(binary) == len(key) - 1: return bs_decode(binary, key) else: return binary_search(binary + '0', key) + binary_search(binary + '1', key) def main(): S = input() print(binary_search('', S)) if __name__ == "__main__": main()
def bs_decode(binary: str, key: str) -> int: sum = 0 last_idx = 0 for (i, s) in enumerate(binary): if s == '0': continue elif s == '1': sum += int(key[last_idx:i + 1]) last_idx = i + 1 else: assert False sum += int(key[last_idx:]) return sum def binary_search(binary: str, key: str) -> int: if len(binary) == len(key) - 1: return bs_decode(binary, key) else: return binary_search(binary + '0', key) + binary_search(binary + '1', key) def main(): s = input() print(binary_search('', S)) if __name__ == '__main__': main()
class ElementPositionBound( ElementPositioning, ): pass
class Elementpositionbound(ElementPositioning): pass
counter = 0 #we go through two for loops #first is for power for i in range(1,50): #and second is for number for j in range(1,50): #we turn j**i into string #and if lenght of that string is equal to i (power) if len(str(j**i)) == i: #then counter increases by 1 counter += 1 #we print counter print(counter)
counter = 0 for i in range(1, 50): for j in range(1, 50): if len(str(j ** i)) == i: counter += 1 print(counter)
class UnknownDeviceError(Exception): pass class DenyError(Exception): pass class WrongP1P2Error(Exception): pass class WrongDataLengthError(Exception): pass class InsNotSupportedError(Exception): pass class ClaNotSupportedError(Exception): pass class WrongResponseLengthError(Exception): pass class DisplayAddressFailError(Exception): pass class DisplayAmountFailError(Exception): pass class WrongTxLengthError(Exception): pass class TxParsingFailError(Exception): pass class TxHashFail(Exception): pass class BadStateError(Exception): pass class SignatureFailError(Exception): pass class TxRejectSignError(Exception): pass class BIP44BadPurposeError(Exception): pass class BIP44BadCoinTypeError(Exception): pass class BIP44BadAccountNotHardenedError(Exception): pass class BIP44BadAccountError(Exception): pass class BIP44BadBadChangeError(Exception): pass class BIP44BadAddressError(Exception): pass class MagicParsingError(Exception): pass class DisplaySystemFeeFailError(Exception): pass class DisplayNetworkFeeFailError(Exception): pass class DisplayTotalFeeFailError(Exception): pass class DisplayTransferAmountError(Exception): pass class ConvertToAddressFailError(Exception): pass
class Unknowndeviceerror(Exception): pass class Denyerror(Exception): pass class Wrongp1P2Error(Exception): pass class Wrongdatalengtherror(Exception): pass class Insnotsupportederror(Exception): pass class Clanotsupportederror(Exception): pass class Wrongresponselengtherror(Exception): pass class Displayaddressfailerror(Exception): pass class Displayamountfailerror(Exception): pass class Wrongtxlengtherror(Exception): pass class Txparsingfailerror(Exception): pass class Txhashfail(Exception): pass class Badstateerror(Exception): pass class Signaturefailerror(Exception): pass class Txrejectsignerror(Exception): pass class Bip44Badpurposeerror(Exception): pass class Bip44Badcointypeerror(Exception): pass class Bip44Badaccountnothardenederror(Exception): pass class Bip44Badaccounterror(Exception): pass class Bip44Badbadchangeerror(Exception): pass class Bip44Badaddresserror(Exception): pass class Magicparsingerror(Exception): pass class Displaysystemfeefailerror(Exception): pass class Displaynetworkfeefailerror(Exception): pass class Displaytotalfeefailerror(Exception): pass class Displaytransferamounterror(Exception): pass class Converttoaddressfailerror(Exception): pass
class SubscriberOne: def __init__(self, name): self.name = name def update(self, message): print('{} got message "{}"'.format(self.name, message)) class SubscriberTwo: def __init__(self, name): self.name = name def receive(self, message): print('{} got message "{}"'.format(self.name, message)) class Publisher: def __init__(self): self.subscribers = dict() def register(self, who, callback=None): if callback == None: callback = getattr(who, 'update') self.subscribers[who] = callback def unregister(self, who): del self.subscribers[who] def dispatch(self, message): for subscriber, callback in self.subscribers.items(): callback(message)
class Subscriberone: def __init__(self, name): self.name = name def update(self, message): print('{} got message "{}"'.format(self.name, message)) class Subscribertwo: def __init__(self, name): self.name = name def receive(self, message): print('{} got message "{}"'.format(self.name, message)) class Publisher: def __init__(self): self.subscribers = dict() def register(self, who, callback=None): if callback == None: callback = getattr(who, 'update') self.subscribers[who] = callback def unregister(self, who): del self.subscribers[who] def dispatch(self, message): for (subscriber, callback) in self.subscribers.items(): callback(message)
_help = "ping local machine" # help is always optional name = "ping" # name must be defined if loading command using CommandModule def ping(): print("Pong!")
_help = 'ping local machine' name = 'ping' def ping(): print('Pong!')
#-*- coding:utf-8 -*- class QuickFind(object): def __init__(self,objnum): self.id=[i for i in range(0,objnum)] def union(self,p,q): qid=self.id[q] pid=self.id[p] j=0 for v in self.id: if pid==v: self.id[j]=qid j=j+1 def connected(self,q,p): return self.id[q]==self.id[p] class QuickUnion(object): def __init__(self,objnum): self.id=[i for i in range(0,objnum)] def _root(self,obj): i=obj while i!=self.id[i]: i=self.id[i] return i def union(self,p,q): qroot=self._root(q) proot=self._root(p) self.id[proot]=qroot def connected(self,q,p): return self._root(q)==self._root(p) class QuickUnionWithWeighted(object): r''' quick union with weighted tree ''' def __init__(self,objnum): self.id=[i for i in range(0,objnum)] self.sz=[0 for i in range(0,objnum)] def _root(self,obj): i=obj while i!=self.id[i]: i=self.id[i] return i def union(self,p,q): qroot=self._root(q) proot=self._root(p) if self.sz[q]>=self.sz[p]: self.id[proot]=qroot self.sz[qroot]=self.sz[qroot]+self.sz[proot] else: self.id[qroot]=proot self.sz[proot]+=self.sz[qroot] def connected(self,q,p): return self._root(q)==self._root(p) if __name__=='__main__': #uf=QuickFind(10) #uf=QuickUnion(20) uf=QuickUnionWithWeighted(20) uf.union(1,4) uf.union(0,9) print('1 connected 4',uf.connected(1,4)) print('0 connected 9',uf.connected(0,9)) print('4 connected 3',uf.connected(4,3)) print(uf.id) print('union 4 to 3') uf.union(4,3) print(uf.id) print('4 connected 3',uf.connected(4,3)) print('1 connected 3',uf.connected(3,1))
class Quickfind(object): def __init__(self, objnum): self.id = [i for i in range(0, objnum)] def union(self, p, q): qid = self.id[q] pid = self.id[p] j = 0 for v in self.id: if pid == v: self.id[j] = qid j = j + 1 def connected(self, q, p): return self.id[q] == self.id[p] class Quickunion(object): def __init__(self, objnum): self.id = [i for i in range(0, objnum)] def _root(self, obj): i = obj while i != self.id[i]: i = self.id[i] return i def union(self, p, q): qroot = self._root(q) proot = self._root(p) self.id[proot] = qroot def connected(self, q, p): return self._root(q) == self._root(p) class Quickunionwithweighted(object): """ quick union with weighted tree """ def __init__(self, objnum): self.id = [i for i in range(0, objnum)] self.sz = [0 for i in range(0, objnum)] def _root(self, obj): i = obj while i != self.id[i]: i = self.id[i] return i def union(self, p, q): qroot = self._root(q) proot = self._root(p) if self.sz[q] >= self.sz[p]: self.id[proot] = qroot self.sz[qroot] = self.sz[qroot] + self.sz[proot] else: self.id[qroot] = proot self.sz[proot] += self.sz[qroot] def connected(self, q, p): return self._root(q) == self._root(p) if __name__ == '__main__': uf = quick_union_with_weighted(20) uf.union(1, 4) uf.union(0, 9) print('1 connected 4', uf.connected(1, 4)) print('0 connected 9', uf.connected(0, 9)) print('4 connected 3', uf.connected(4, 3)) print(uf.id) print('union 4 to 3') uf.union(4, 3) print(uf.id) print('4 connected 3', uf.connected(4, 3)) print('1 connected 3', uf.connected(3, 1))
# parsetab_astmatch.py # This file is automatically generated. Do not edit. _tabversion = '3.2' _lr_method = 'LALR' _lr_signature = b'\x87\xfc\xcf\xdfD\xa2\x85\x13Hp\xa3\xe5Xz\xbcp' _lr_action_items = {'SPECIAL':([0,2,4,5,6,7,8,9,10,11,12,13,15,16,17,18,19,],[-13,3,-13,-13,-13,-9,-8,-7,3,-6,3,3,3,-12,-13,-2,3,]),'OR':([0,2,4,5,6,7,8,9,10,11,12,13,15,16,17,18,19,],[-13,4,-13,-13,-13,-9,-8,-7,4,-6,4,4,4,-12,-13,-2,4,]),'NOT':([0,2,4,5,6,7,8,9,10,11,12,13,15,16,17,18,19,],[-13,5,-13,-13,-13,-9,-8,-7,5,-6,5,5,5,-12,-13,-2,5,]),'CODE':([0,2,4,5,6,7,8,9,10,11,12,13,15,16,17,18,19,],[-13,9,-13,-13,-13,-9,-8,-7,9,-6,9,9,9,-12,-13,-2,9,]),'LBK':([0,2,4,5,6,7,8,9,10,11,12,13,15,16,17,18,19,],[-13,6,-13,-13,-13,-9,-8,-7,6,-6,6,6,6,-12,-13,-2,6,]),'WORD':([3,],[11,]),'COMMA':([4,5,6,7,8,9,11,12,13,14,15,16,17,18,19,],[-13,-13,-5,-9,-8,-7,-6,-10,-11,17,-3,-12,-13,-2,-4,]),'$end':([0,1,2,4,5,7,8,9,11,12,13,16,18,],[-13,0,-1,-13,-13,-9,-8,-7,-6,-10,-11,-12,-2,]),'RBK':([4,5,6,7,8,9,11,12,13,14,15,16,17,18,19,],[-13,-13,-5,-9,-8,-7,-6,-10,-11,18,-3,-12,-13,-2,-4,]),'STAR':([0,2,4,5,6,7,8,9,10,11,12,13,15,16,17,18,19,],[-13,-13,-13,-13,-13,-9,-8,-7,16,-6,-10,-11,-13,-12,-13,-2,-13,]),} _lr_action = { } for _k, _v in _lr_action_items.items(): for _x,_y in zip(_v[0],_v[1]): if not _x in _lr_action: _lr_action[_x] = { } _lr_action[_x][_k] = _y del _lr_action_items _lr_goto_items = {'ast_match':([0,],[1,]),'ast_special':([2,10,12,13,15,19,],[8,8,8,8,8,8,]),'ast_exprlist':([6,],[14,]),'ast_expr':([0,2,4,5,6,10,12,13,15,17,19,],[2,10,12,13,15,10,10,10,10,19,10,]),'ast_set':([2,10,12,13,15,19,],[7,7,7,7,7,7,]),} _lr_goto = { } for _k, _v in _lr_goto_items.items(): for _x,_y in zip(_v[0],_v[1]): if not _x in _lr_goto: _lr_goto[_x] = { } _lr_goto[_x][_k] = _y del _lr_goto_items _lr_productions = [ ("S' -> ast_match","S'",1,None,None,None), ('ast_match -> ast_expr','ast_match',1,'p_ast_match','c:\\dev\\fairmotion\\tools\\extjs_cc\\js_ast_match.py',46), ('ast_set -> LBK ast_exprlist RBK','ast_set',3,'p_ast_set','c:\\dev\\fairmotion\\tools\\extjs_cc\\js_ast_match.py',52), ('ast_exprlist -> ast_expr','ast_exprlist',1,'p_ast_exprlist','c:\\dev\\fairmotion\\tools\\extjs_cc\\js_ast_match.py',60), ('ast_exprlist -> ast_exprlist COMMA ast_expr','ast_exprlist',3,'p_ast_exprlist','c:\\dev\\fairmotion\\tools\\extjs_cc\\js_ast_match.py',61), ('ast_exprlist -> <empty>','ast_exprlist',0,'p_ast_exprlist','c:\\dev\\fairmotion\\tools\\extjs_cc\\js_ast_match.py',62), ('ast_special -> SPECIAL WORD','ast_special',2,'p_ast_noderef','c:\\dev\\fairmotion\\tools\\extjs_cc\\js_ast_match.py',76), ('ast_expr -> ast_expr CODE','ast_expr',2,'p_ast_expr','c:\\dev\\fairmotion\\tools\\extjs_cc\\js_ast_match.py',82), ('ast_expr -> ast_expr ast_special','ast_expr',2,'p_ast_expr','c:\\dev\\fairmotion\\tools\\extjs_cc\\js_ast_match.py',83), ('ast_expr -> ast_expr ast_set','ast_expr',2,'p_ast_expr','c:\\dev\\fairmotion\\tools\\extjs_cc\\js_ast_match.py',84), ('ast_expr -> ast_expr OR ast_expr','ast_expr',3,'p_ast_expr','c:\\dev\\fairmotion\\tools\\extjs_cc\\js_ast_match.py',85), ('ast_expr -> ast_expr NOT ast_expr','ast_expr',3,'p_ast_expr','c:\\dev\\fairmotion\\tools\\extjs_cc\\js_ast_match.py',86), ('ast_expr -> ast_expr ast_expr STAR','ast_expr',3,'p_ast_expr','c:\\dev\\fairmotion\\tools\\extjs_cc\\js_ast_match.py',87), ('ast_expr -> <empty>','ast_expr',0,'p_ast_expr','c:\\dev\\fairmotion\\tools\\extjs_cc\\js_ast_match.py',88), ]
_tabversion = '3.2' _lr_method = 'LALR' _lr_signature = b'\x87\xfc\xcf\xdfD\xa2\x85\x13Hp\xa3\xe5Xz\xbcp' _lr_action_items = {'SPECIAL': ([0, 2, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 15, 16, 17, 18, 19], [-13, 3, -13, -13, -13, -9, -8, -7, 3, -6, 3, 3, 3, -12, -13, -2, 3]), 'OR': ([0, 2, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 15, 16, 17, 18, 19], [-13, 4, -13, -13, -13, -9, -8, -7, 4, -6, 4, 4, 4, -12, -13, -2, 4]), 'NOT': ([0, 2, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 15, 16, 17, 18, 19], [-13, 5, -13, -13, -13, -9, -8, -7, 5, -6, 5, 5, 5, -12, -13, -2, 5]), 'CODE': ([0, 2, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 15, 16, 17, 18, 19], [-13, 9, -13, -13, -13, -9, -8, -7, 9, -6, 9, 9, 9, -12, -13, -2, 9]), 'LBK': ([0, 2, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 15, 16, 17, 18, 19], [-13, 6, -13, -13, -13, -9, -8, -7, 6, -6, 6, 6, 6, -12, -13, -2, 6]), 'WORD': ([3], [11]), 'COMMA': ([4, 5, 6, 7, 8, 9, 11, 12, 13, 14, 15, 16, 17, 18, 19], [-13, -13, -5, -9, -8, -7, -6, -10, -11, 17, -3, -12, -13, -2, -4]), '$end': ([0, 1, 2, 4, 5, 7, 8, 9, 11, 12, 13, 16, 18], [-13, 0, -1, -13, -13, -9, -8, -7, -6, -10, -11, -12, -2]), 'RBK': ([4, 5, 6, 7, 8, 9, 11, 12, 13, 14, 15, 16, 17, 18, 19], [-13, -13, -5, -9, -8, -7, -6, -10, -11, 18, -3, -12, -13, -2, -4]), 'STAR': ([0, 2, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 15, 16, 17, 18, 19], [-13, -13, -13, -13, -13, -9, -8, -7, 16, -6, -10, -11, -13, -12, -13, -2, -13])} _lr_action = {} for (_k, _v) in _lr_action_items.items(): for (_x, _y) in zip(_v[0], _v[1]): if not _x in _lr_action: _lr_action[_x] = {} _lr_action[_x][_k] = _y del _lr_action_items _lr_goto_items = {'ast_match': ([0], [1]), 'ast_special': ([2, 10, 12, 13, 15, 19], [8, 8, 8, 8, 8, 8]), 'ast_exprlist': ([6], [14]), 'ast_expr': ([0, 2, 4, 5, 6, 10, 12, 13, 15, 17, 19], [2, 10, 12, 13, 15, 10, 10, 10, 10, 19, 10]), 'ast_set': ([2, 10, 12, 13, 15, 19], [7, 7, 7, 7, 7, 7])} _lr_goto = {} for (_k, _v) in _lr_goto_items.items(): for (_x, _y) in zip(_v[0], _v[1]): if not _x in _lr_goto: _lr_goto[_x] = {} _lr_goto[_x][_k] = _y del _lr_goto_items _lr_productions = [("S' -> ast_match", "S'", 1, None, None, None), ('ast_match -> ast_expr', 'ast_match', 1, 'p_ast_match', 'c:\\dev\\fairmotion\\tools\\extjs_cc\\js_ast_match.py', 46), ('ast_set -> LBK ast_exprlist RBK', 'ast_set', 3, 'p_ast_set', 'c:\\dev\\fairmotion\\tools\\extjs_cc\\js_ast_match.py', 52), ('ast_exprlist -> ast_expr', 'ast_exprlist', 1, 'p_ast_exprlist', 'c:\\dev\\fairmotion\\tools\\extjs_cc\\js_ast_match.py', 60), ('ast_exprlist -> ast_exprlist COMMA ast_expr', 'ast_exprlist', 3, 'p_ast_exprlist', 'c:\\dev\\fairmotion\\tools\\extjs_cc\\js_ast_match.py', 61), ('ast_exprlist -> <empty>', 'ast_exprlist', 0, 'p_ast_exprlist', 'c:\\dev\\fairmotion\\tools\\extjs_cc\\js_ast_match.py', 62), ('ast_special -> SPECIAL WORD', 'ast_special', 2, 'p_ast_noderef', 'c:\\dev\\fairmotion\\tools\\extjs_cc\\js_ast_match.py', 76), ('ast_expr -> ast_expr CODE', 'ast_expr', 2, 'p_ast_expr', 'c:\\dev\\fairmotion\\tools\\extjs_cc\\js_ast_match.py', 82), ('ast_expr -> ast_expr ast_special', 'ast_expr', 2, 'p_ast_expr', 'c:\\dev\\fairmotion\\tools\\extjs_cc\\js_ast_match.py', 83), ('ast_expr -> ast_expr ast_set', 'ast_expr', 2, 'p_ast_expr', 'c:\\dev\\fairmotion\\tools\\extjs_cc\\js_ast_match.py', 84), ('ast_expr -> ast_expr OR ast_expr', 'ast_expr', 3, 'p_ast_expr', 'c:\\dev\\fairmotion\\tools\\extjs_cc\\js_ast_match.py', 85), ('ast_expr -> ast_expr NOT ast_expr', 'ast_expr', 3, 'p_ast_expr', 'c:\\dev\\fairmotion\\tools\\extjs_cc\\js_ast_match.py', 86), ('ast_expr -> ast_expr ast_expr STAR', 'ast_expr', 3, 'p_ast_expr', 'c:\\dev\\fairmotion\\tools\\extjs_cc\\js_ast_match.py', 87), ('ast_expr -> <empty>', 'ast_expr', 0, 'p_ast_expr', 'c:\\dev\\fairmotion\\tools\\extjs_cc\\js_ast_match.py', 88)]
def print_max(a, b): if a > b: print(a, 'is maximum') elif a == b: print(a, 'is equal to', b) else: print(b, 'is maximum') # directly pass literal values print_max(3, 4) x = 5 y = 7 # pass variables as arguments print_max(x, y)
def print_max(a, b): if a > b: print(a, 'is maximum') elif a == b: print(a, 'is equal to', b) else: print(b, 'is maximum') print_max(3, 4) x = 5 y = 7 print_max(x, y)
tags = [ { "name": "droplet_tag", "resources": { "count": 10, "last_tagged_uri": "https://api.digitalocean.com/v2/droplets/246753544", "droplets": { "count": 7, "last_tagged_uri": "https://api.digitalocean.com/v2/droplets/246753544", }, "images": {"count": 0}, "volumes": {"count": 0}, "volume_snapshots": {"count": 0}, "databases": {"count": 0}, }, }, { "name": "image_tag", "resources": { "count": 6, "last_tagged_uri": "https://api.digitalocean.com/v2/droplets/246753544", "droplets": { "count": 3, "last_tagged_uri": "https://api.digitalocean.com/v2/droplets/246753544", }, "images": {"count": 0}, "volumes": { "count": 1, "last_tagged_uri": "https://api.digitalocean.com/v2/volumes/0e811232-4ea5-11ec-b6b7-246753544456", }, "volume_snapshots": {"count": 0}, "databases": {"count": 0}, }, }, { "name": "volume_tag", "resources": { "count": 0, "droplets": {"count": 0}, "images": {"count": 0}, "volumes": {"count": 0}, "volume_snapshots": {"count": 0}, "databases": {"count": 0}, }, }, { "name": "snapshot_tag", "resources": { "count": 0, "droplets": {"count": 0}, "images": {"count": 0}, "volumes": {"count": 0}, "volume_snapshots": {"count": 0}, "databases": {"count": 0}, }, }, { "name": "database_tag", "resources": { "count": 1, "last_tagged_uri": "https://api.digitalocean.com/v2/load_balancers/ce34912e-07e3-4bde-97ca-246753544f3e", "droplets": {"count": 0}, "images": {"count": 0}, "volumes": {"count": 0}, "volume_snapshots": {"count": 0}, "databases": {"count": 0}, }, }, { "name": "firewall_tag", "resources": { "count": 1, "last_tagged_uri": "https://api.digitalocean.com/v2/load_balancers/ce34912e-07e3-4bde-97ca-246753544f3e", "droplets": {"count": 0}, "images": {"count": 0}, "volumes": {"count": 0}, "volume_snapshots": {"count": 0}, "databases": {"count": 0}, }, }, ]
tags = [{'name': 'droplet_tag', 'resources': {'count': 10, 'last_tagged_uri': 'https://api.digitalocean.com/v2/droplets/246753544', 'droplets': {'count': 7, 'last_tagged_uri': 'https://api.digitalocean.com/v2/droplets/246753544'}, 'images': {'count': 0}, 'volumes': {'count': 0}, 'volume_snapshots': {'count': 0}, 'databases': {'count': 0}}}, {'name': 'image_tag', 'resources': {'count': 6, 'last_tagged_uri': 'https://api.digitalocean.com/v2/droplets/246753544', 'droplets': {'count': 3, 'last_tagged_uri': 'https://api.digitalocean.com/v2/droplets/246753544'}, 'images': {'count': 0}, 'volumes': {'count': 1, 'last_tagged_uri': 'https://api.digitalocean.com/v2/volumes/0e811232-4ea5-11ec-b6b7-246753544456'}, 'volume_snapshots': {'count': 0}, 'databases': {'count': 0}}}, {'name': 'volume_tag', 'resources': {'count': 0, 'droplets': {'count': 0}, 'images': {'count': 0}, 'volumes': {'count': 0}, 'volume_snapshots': {'count': 0}, 'databases': {'count': 0}}}, {'name': 'snapshot_tag', 'resources': {'count': 0, 'droplets': {'count': 0}, 'images': {'count': 0}, 'volumes': {'count': 0}, 'volume_snapshots': {'count': 0}, 'databases': {'count': 0}}}, {'name': 'database_tag', 'resources': {'count': 1, 'last_tagged_uri': 'https://api.digitalocean.com/v2/load_balancers/ce34912e-07e3-4bde-97ca-246753544f3e', 'droplets': {'count': 0}, 'images': {'count': 0}, 'volumes': {'count': 0}, 'volume_snapshots': {'count': 0}, 'databases': {'count': 0}}}, {'name': 'firewall_tag', 'resources': {'count': 1, 'last_tagged_uri': 'https://api.digitalocean.com/v2/load_balancers/ce34912e-07e3-4bde-97ca-246753544f3e', 'droplets': {'count': 0}, 'images': {'count': 0}, 'volumes': {'count': 0}, 'volume_snapshots': {'count': 0}, 'databases': {'count': 0}}}]
# local imports # project imports # external imports def mine(attributes, data): sums = {} counts = {} averages = {} for attribute in attributes: sums[attribute] = float(0) counts[attribute] = 0 for entry in data: for attribute in attributes: if entry[attribute] is not None: sums[attribute] += entry[attribute] counts[attribute] += 1 for attribute in attributes: averages[attribute] = sums[attribute] / counts[attribute] if counts[attribute] > 0 else None return averages
def mine(attributes, data): sums = {} counts = {} averages = {} for attribute in attributes: sums[attribute] = float(0) counts[attribute] = 0 for entry in data: for attribute in attributes: if entry[attribute] is not None: sums[attribute] += entry[attribute] counts[attribute] += 1 for attribute in attributes: averages[attribute] = sums[attribute] / counts[attribute] if counts[attribute] > 0 else None return averages
del_items(0x800A1318) SetType(0x800A1318, "char StrDate[12]") del_items(0x800A1324) SetType(0x800A1324, "char StrTime[9]") del_items(0x800A1330) SetType(0x800A1330, "char *Words[118]") del_items(0x800A1508) SetType(0x800A1508, "struct MONTH_DAYS MonDays[12]")
del_items(2148143896) set_type(2148143896, 'char StrDate[12]') del_items(2148143908) set_type(2148143908, 'char StrTime[9]') del_items(2148143920) set_type(2148143920, 'char *Words[118]') del_items(2148144392) set_type(2148144392, 'struct MONTH_DAYS MonDays[12]')
def method (a, n): p = 1 x = a while n != 0: if n % 2 == 1: p *= x n = n // 2 x *= x return p print(method(3, 5))
def method(a, n): p = 1 x = a while n != 0: if n % 2 == 1: p *= x n = n // 2 x *= x return p print(method(3, 5))
# Authors: Sylvain MARIE <sylvain.marie@se.com> # + All contributors to <https://github.com/smarie/python-pytest-cases> # # License: 3-clause BSD, <https://github.com/smarie/python-pytest-cases/blob/master/LICENSE> def test_pytest_cases_plugin_installed(request): """A simple test to make sure that the pytest-case plugin is actually installed. Otherwise some tests wont work""" assert request.session._fixturemanager.getfixtureclosure.func.__module__ == 'pytest_cases.plugin'
def test_pytest_cases_plugin_installed(request): """A simple test to make sure that the pytest-case plugin is actually installed. Otherwise some tests wont work""" assert request.session._fixturemanager.getfixtureclosure.func.__module__ == 'pytest_cases.plugin'
rcparams = { "svg.fonttype": "none", "pdf.fonttype": 42, "savefig.transparent": True, "figure.figsize": (4, 4), "axes.titlesize": 15, "axes.titleweight": 500, "axes.titlepad": 8.0, "axes.labelsize": 14, "axes.labelweight": 500, "axes.linewidth": 1.2, "axes.labelpad": 6.0, "font.size": 11, "font.family": "sans-serif", "font.sans-serif": [ "Helvetica", "Computer Modern Sans Serif", "DejaVU Sans", ], "font.weight": 500, "xtick.labelsize": 12, "xtick.minor.size": 1.375, "xtick.major.size": 2.75, "xtick.major.pad": 2, "xtick.minor.pad": 2, "ytick.labelsize": 12, "ytick.minor.size": 1.375, "ytick.major.size": 2.75, "ytick.major.pad": 2, "ytick.minor.pad": 2, "legend.fontsize": 12, "legend.handlelength": 1.4, "legend.numpoints": 1, "legend.scatterpoints": 3, "legend.frameon": False, "lines.linewidth": 1.7, }
rcparams = {'svg.fonttype': 'none', 'pdf.fonttype': 42, 'savefig.transparent': True, 'figure.figsize': (4, 4), 'axes.titlesize': 15, 'axes.titleweight': 500, 'axes.titlepad': 8.0, 'axes.labelsize': 14, 'axes.labelweight': 500, 'axes.linewidth': 1.2, 'axes.labelpad': 6.0, 'font.size': 11, 'font.family': 'sans-serif', 'font.sans-serif': ['Helvetica', 'Computer Modern Sans Serif', 'DejaVU Sans'], 'font.weight': 500, 'xtick.labelsize': 12, 'xtick.minor.size': 1.375, 'xtick.major.size': 2.75, 'xtick.major.pad': 2, 'xtick.minor.pad': 2, 'ytick.labelsize': 12, 'ytick.minor.size': 1.375, 'ytick.major.size': 2.75, 'ytick.major.pad': 2, 'ytick.minor.pad': 2, 'legend.fontsize': 12, 'legend.handlelength': 1.4, 'legend.numpoints': 1, 'legend.scatterpoints': 3, 'legend.frameon': False, 'lines.linewidth': 1.7}
""" Test raising an exception, to check how tdiff (formerly clogdiff) handles it """ cases = [ ('Raise an exception - does traceback go to .log file?', 'python -c "raise Exception"') ]
""" Test raising an exception, to check how tdiff (formerly clogdiff) handles it """ cases = [('Raise an exception - does traceback go to .log file?', 'python -c "raise Exception"')]
input = """ b :- not c. a :- b. b :- a. c :- b, not k. e v e1. e v e2. e v e3. e v e4. e v e5. :- not e, not a. k v k1. k v k2. k v k3. k v k4. k v k5. k v k6. c v c1. """ output = """ {a, b, c1, e, k} {a, b, c1, e1, e2, e3, e4, e5, k} {c, e, k1, k2, k3, k4, k5, k6} {c, e, k} """
input = '\nb :- not c.\na :- b.\nb :- a.\nc :- b, not k.\ne v e1.\ne v e2.\ne v e3.\ne v e4.\ne v e5.\n:- not e, not a.\nk v k1.\nk v k2.\nk v k3.\nk v k4.\nk v k5.\nk v k6.\nc v c1.\n' output = '\n{a, b, c1, e, k}\n{a, b, c1, e1, e2, e3, e4, e5, k}\n{c, e, k1, k2, k3, k4, k5, k6}\n{c, e, k}\n'
def conta_alertas_acude(lista): cont=0 for i in range(len(lista)): if lista[i]<17: if i== 0: if abs(lista[i]-17)<10: cont+=1 else: if abs(lista[i]-lista[i-1])<10: cont+=1 return cont
def conta_alertas_acude(lista): cont = 0 for i in range(len(lista)): if lista[i] < 17: if i == 0: if abs(lista[i] - 17) < 10: cont += 1 elif abs(lista[i] - lista[i - 1]) < 10: cont += 1 return cont
# # Main function with the simple pattern check # def main(): # First, we need to let the user enter the string print("String pattern check with python!") print("Please enter a string to validate: ") strInput = input() if (not validateStringInput(strInput)): print("Invalid string entered. Please enter a string longer than one character!") exit(-1) print("What pattern do you want to check, against? Use * for multiple joker characters and ? for single joker characters.") strPattern = input() if (not validatePattern(strPattern)): print("Ambiguous pattern entered. If * is followed by ? or ? is followed by *, the pattern is ambiguous!") exit(-1) # Next, we validate the string and return the results. print("Validating string '%s'..." % strInput) isMatch = ValidateStringAgainstPattern(strInput, strPattern) isMatchString = "MATCHES" if isMatch else "does NOT MATCH" print("The string %s %s the pattern %s!" % (strInput, isMatchString, strPattern)) def validateStringInput(toValidate): if (not isinstance(toValidate, str)): return False if (len(toValidate) <= 1): return False if (toValidate.isspace()): return False return True def validatePattern(toValidate): if (("*?" in toValidate) or ("?*" in toValidate)): return False return True def ValidateStringAgainstPattern(str, strPattern): # Validate, if the first character of both strings are equal or if the first character of # the pattern is a single-character joker. If so, we have a match and can continue to the next item in both, # String and Pattern if there are more characters to validate. if ((str[0] == strPattern[0]) or (strPattern[0] == '?')): strLen = len(str) patternLen = len(strPattern) if strLen > 1 and patternLen > 1: return ValidateStringAgainstPattern(str[1:len(str)], strPattern[1:len(strPattern)]) elif strLen == 1 and patternLen == 1: return True else: return False elif (strPattern[0] == '*'): # Joker sign for multiple characters - let's see if we find pattern matches after the Joker. # If we cannot find any match after the joker, the string does not match. while len(str) > 1: # The last character in the pattern string is the *-joker, hence we're good. if len(strPattern) <= 1: return True # If the last character is not the *-joker, then we need to see, if we can find any pattern match after the joker. # If so, we're good and have a matching string, but if not, we don't. We try to find any possible match after the joker # since the border from the joker to the next section after the joker is not easily determined (i.e. ACCCCB to match A*CB). if ValidateStringAgainstPattern(str, strPattern[1:len(strPattern)]): return True else: str = str[1:len(str)] else: return False if __name__ == "__main__": main()
def main(): print('String pattern check with python!') print('Please enter a string to validate: ') str_input = input() if not validate_string_input(strInput): print('Invalid string entered. Please enter a string longer than one character!') exit(-1) print('What pattern do you want to check, against? Use * for multiple joker characters and ? for single joker characters.') str_pattern = input() if not validate_pattern(strPattern): print('Ambiguous pattern entered. If * is followed by ? or ? is followed by *, the pattern is ambiguous!') exit(-1) print("Validating string '%s'..." % strInput) is_match = validate_string_against_pattern(strInput, strPattern) is_match_string = 'MATCHES' if isMatch else 'does NOT MATCH' print('The string %s %s the pattern %s!' % (strInput, isMatchString, strPattern)) def validate_string_input(toValidate): if not isinstance(toValidate, str): return False if len(toValidate) <= 1: return False if toValidate.isspace(): return False return True def validate_pattern(toValidate): if '*?' in toValidate or '?*' in toValidate: return False return True def validate_string_against_pattern(str, strPattern): if str[0] == strPattern[0] or strPattern[0] == '?': str_len = len(str) pattern_len = len(strPattern) if strLen > 1 and patternLen > 1: return validate_string_against_pattern(str[1:len(str)], strPattern[1:len(strPattern)]) elif strLen == 1 and patternLen == 1: return True else: return False elif strPattern[0] == '*': while len(str) > 1: if len(strPattern) <= 1: return True if validate_string_against_pattern(str, strPattern[1:len(strPattern)]): return True else: str = str[1:len(str)] else: return False if __name__ == '__main__': main()
class TenantsV2(object): def on_get(self, req, resp): client = req.env['sl_client'] account = client['Account'].getObject() tenants = [ { 'enabled': True, 'description': None, 'name': str(account['id']), 'id': str(account['id']), }, ] resp.body = {'tenants': tenants, 'tenant_links': []}
class Tenantsv2(object): def on_get(self, req, resp): client = req.env['sl_client'] account = client['Account'].getObject() tenants = [{'enabled': True, 'description': None, 'name': str(account['id']), 'id': str(account['id'])}] resp.body = {'tenants': tenants, 'tenant_links': []}
list=[' ', '!', '"', '#', '$', '%', '&', "'", '(', ')', '*', '+', ',', '-', '.', '/', '0', '1', '2', '3', '4', '5', '6', '7', '8', '9', ':', ';', '<', '=', '>', '?', '@', 'A', 'B', 'C', 'D', 'E', 'F', 'G', 'H', 'I', 'J', 'K', 'L', 'M', 'N', 'O', 'P', 'Q', 'R', 'S', 'T', 'U', 'V', 'W', 'X', 'Y', 'Z', '[', '\\', ']', '^', '_', '`', 'a', 'b', 'c', 'd', 'e', 'f', 'g', 'h', 'i', 'j', 'k', 'l', 'm', 'n', 'o', 'p', 'q', 'r', 's', 't', 'u', 'v', 'w', 'x', 'y', 'z', '{', '|', '}', '~'] """ This is a list of 95 characters from 32 to the 126 index of the ASCII table. It will work as a lookup table for the method. """ def vigenere(start, text, key): result = "" for i in range(len(text)): if text[i] not in list: result+=text[i] else: if start == 1: result+=list[(list.index(text[i])+list.index(key[i%len(key)]))%len(list)] else: result+=list[(list.index(text[i])-list.index(key[i%len(key)]))%len(list)] return result start=int(input("Would you like to:\n1- Encrypt\n2- Decrypt\n")) text=input("Text: ") key=input("Key: ") print(vigenere(start, text,key)) """ This will work on any of the ASCII characters on the list. Any character that is not on the list will be left as it is. So ideally, don't use accented letters or things like that. Unlike the text being encrypted, all the characters on the key must be on the list. """
list = [' ', '!', '"', '#', '$', '%', '&', "'", '(', ')', '*', '+', ',', '-', '.', '/', '0', '1', '2', '3', '4', '5', '6', '7', '8', '9', ':', ';', '<', '=', '>', '?', '@', 'A', 'B', 'C', 'D', 'E', 'F', 'G', 'H', 'I', 'J', 'K', 'L', 'M', 'N', 'O', 'P', 'Q', 'R', 'S', 'T', 'U', 'V', 'W', 'X', 'Y', 'Z', '[', '\\', ']', '^', '_', '`', 'a', 'b', 'c', 'd', 'e', 'f', 'g', 'h', 'i', 'j', 'k', 'l', 'm', 'n', 'o', 'p', 'q', 'r', 's', 't', 'u', 'v', 'w', 'x', 'y', 'z', '{', '|', '}', '~'] '\nThis is a list of 95 characters from 32 to the 126 index of the ASCII table. It will work as a lookup table for the method.\n' def vigenere(start, text, key): result = '' for i in range(len(text)): if text[i] not in list: result += text[i] elif start == 1: result += list[(list.index(text[i]) + list.index(key[i % len(key)])) % len(list)] else: result += list[(list.index(text[i]) - list.index(key[i % len(key)])) % len(list)] return result start = int(input('Would you like to:\n1- Encrypt\n2- Decrypt\n')) text = input('Text: ') key = input('Key: ') print(vigenere(start, text, key)) "\nThis will work on any of the ASCII characters on the list. \nAny character that is not on the list will be left as it is. \nSo ideally, don't use accented letters or things like that.\n\nUnlike the text being encrypted, all the characters on the key must be on the list.\n"
def eg(): print ("eggo") eg()
def eg(): print('eggo') eg()
def binary_search(arr, first, last, x): res = -1; if last >= first: while first <= last: half = (first + last) // 2 if arr[half] == x: res = half return res elif x > arr[half]: first = half + 1 else: last = half - 1 return res else: return res
def binary_search(arr, first, last, x): res = -1 if last >= first: while first <= last: half = (first + last) // 2 if arr[half] == x: res = half return res elif x > arr[half]: first = half + 1 else: last = half - 1 return res else: return res
def trans(o,beg,end): if end>=beg: mid=beg+(end-beg)//2 if((mid==end or o[mid+1]==0)and(o[mid]==1)): return mid+1 if o[mid]==1: return trans(o,(mid+1),end) return trans(o,beg,mid-1) else: return 0 o=[int(x) for x in input('Enter NUMS seprated by space: ').split()] print('No. 1s=',trans(o,0,len(o)-1))
def trans(o, beg, end): if end >= beg: mid = beg + (end - beg) // 2 if (mid == end or o[mid + 1] == 0) and o[mid] == 1: return mid + 1 if o[mid] == 1: return trans(o, mid + 1, end) return trans(o, beg, mid - 1) else: return 0 o = [int(x) for x in input('Enter NUMS seprated by space: ').split()] print('No. 1s=', trans(o, 0, len(o) - 1))
optGeneric_template = ''' nSteps {nSteps} nStepsInfoInterval {nStepsInterval} nStepsWriteInterval {nStepsWrite} nStepsBackupInterval {nStepsBackupInterval} outPutFilePath {outPutFilePath} outPutFormat {outPutFormat} boxSize {boxX} {boxY} {boxZ} T {temperature} h {steepestDecentScale} nStepsSteepestDescent {nStepsSteepestDescent} nStepsSteepestDescentProgressInterval {nStepsSteepestDescentProgressInterval} maxObjectiveForce {maxObjectiveForce} dt {timeStep} frictionConstant {frictionConstant} cutOffDst {cutOffDst} VerletListDst {VerletListDst} inputCoordPath {inputCoordFile} inputTopologyPath {inputTopFile}''' optGenericWithElec_template = optGeneric_template+''' dielectricConstant {dielectricConstant} debyeLength {debyeLength} ''' optGenericWithSurface_template = optGenericWithElec_template+''' epsilonSurf {epsilonSurf} sigmaSurf {sigmaSurf} surfacePosition {surfacePosition} ''' optGenericClash_template = optGeneric_template+''' lambda {lambd} gamma {gamma} ''' optGenericClashWithCompression_template = optGenericClash_template+''' initialSphereRadius {initialSphereRadius} minimalSphereRadius {minimalSphereRadius} compressionVelocity {compressionVelocity} ''' optAFM_template = optGenericWithSurface_template+''' frictionConstantTip {frictionConstantTip} initialTipSampleDst {initialTipSampleDst} descentVelocity {descentVelocity} minimalChipHeight {minimalChipHeight} Mtip {Mtip} Rtip {Rtip} Kxytip {Kxytip} Ktip {Ktip} epsilonTip {epsilonTip} sigmaTip {sigmaTip} Atip {Atip} Btip {Btip} epsilonTipSurf {epsilonTipSurf} sigmaTipSurf {sigmaTipSurf} ATipSurf {ATipSurf} BTipSurf {BTipSurf} nStepsIndentMeasure {nStepsIndentMeasure} outputIndentationMeasureFilePath {outputIndentationMeasureFilePath} ''' optGenericUmbrella_template = optGenericWithElec_template+''' umbrellaK {umbrellaK} umbrellaInit {umbrellaInit} umbrellaEnd {umbrellaEnd} umbrellaWindowsNumber {umbrellaWindowsNumber} umbrellaCopies {umbrellaCopies} nStepsUmbrellaMeasure {nStepsUmbrellaMeasure} outputUmbrellaMeasureFilePath {outputUmbrellaMeasureFilePath} ''' def writeOptionsGeneric(path:str, nSteps:int, nStepsInterval:int, nStepsWrite:int, nStepsBackupInterval:int, outPutFilePath:str, outPutFormat:str, boxX:float,boxY:float,boxZ:float, temperature:float, steepestDecentScale:float, nStepsSteepestDescent:int, nStepsSteepestDescentProgressInterval:int, maxObjectiveForce:float, timeStep:float, frictionConstant:float, cutOffDst:float, VerletListDst:float, dielectricConstant:float, debyeLength:float, inputCoordFile:str, inputTopFile:str): opt = optGenericWithElec_template.format(nSteps=nSteps, nStepsInterval=nStepsInterval, nStepsWrite=nStepsWrite, nStepsBackupInterval=nStepsBackupInterval, outPutFilePath=outPutFilePath, outPutFormat=outPutFormat, boxX=boxX,boxY=boxY,boxZ=boxZ, temperature=temperature, steepestDecentScale=steepestDecentScale, nStepsSteepestDescent=nStepsSteepestDescent, nStepsSteepestDescentProgressInterval=nStepsSteepestDescentProgressInterval, maxObjectiveForce=maxObjectiveForce, timeStep=timeStep, frictionConstant=frictionConstant, cutOffDst=cutOffDst, VerletListDst=VerletListDst, dielectricConstant=dielectricConstant, debyeLength=debyeLength, inputCoordFile=inputCoordFile, inputTopFile=inputTopFile) with open(path,"w") as f: f.write(opt) def writeOptionsGenericFromDict(path,optionsDict): nSteps=optionsDict["nSteps"] nStepsInterval=optionsDict["nStepsInterval"] nStepsWrite=optionsDict["nStepsWrite"] nStepsBackupInterval=optionsDict["nStepsBackupInterval"] outPutFilePath=optionsDict["outPutFilePath"] outPutFormat=optionsDict["outPutFormat"] boxX=optionsDict["boxX"] boxY=optionsDict["boxY"] boxZ=optionsDict["boxZ"] temperature=optionsDict["temperature"] steepestDecentScale=optionsDict["steepestDecentScale"] nStepsSteepestDescent=optionsDict["nStepsSteepestDescent"] nStepsSteepestDescentProgressInterval=optionsDict["nStepsSteepestDescentProgressInterval"] maxObjectiveForce=optionsDict["maxObjectiveForce"] timeStep=optionsDict["timeStep"] frictionConstant=optionsDict["frictionConstant"] cutOffDst=optionsDict["cutOffDst"] VerletListDst=optionsDict["VerletListDst"] dielectricConstant=optionsDict["dielectricConstant"] debyeLength=optionsDict["debyeLength"] inputCoordFile=optionsDict["inputCoordFile"] inputTopFile=optionsDict["inputTopFile"] writeOptionsGeneric(path, nSteps, nStepsInterval, nStepsWrite, nStepsBackupInterval, outPutFilePath, outPutFormat, boxX,boxY,boxZ, temperature, steepestDecentScale, nStepsSteepestDescent, nStepsSteepestDescentProgressInterval, maxObjectiveForce, timeStep, frictionConstant, cutOffDst, VerletListDst, dielectricConstant, debyeLength, inputCoordFile, inputTopFile) def writeOptionsGenericWithSurface(path:str, nSteps:int, nStepsInterval:int, nStepsWrite:int, nStepsBackupInterval:int, outPutFilePath:str, outPutFormat:str, boxX:float,boxY:float,boxZ:float, temperature:float, steepestDecentScale:float, nStepsSteepestDescent:int, nStepsSteepestDescentProgressInterval:int, maxObjectiveForce:float, timeStep:float, frictionConstant:float, cutOffDst:float, VerletListDst:float, dielectricConstant:float, debyeLength:float, inputCoordFile:str, inputTopFile:str, epsilonSurf:float, sigmaSurf:float, surfacePosition:float): opt = optGenericWithSurface_template.format(nSteps=nSteps, nStepsInterval=nStepsInterval, nStepsWrite=nStepsWrite, nStepsBackupInterval=nStepsBackupInterval, outPutFilePath=outPutFilePath, outPutFormat=outPutFormat, boxX=boxX,boxY=boxY,boxZ=boxZ, temperature=temperature, steepestDecentScale=steepestDecentScale, nStepsSteepestDescent=nStepsSteepestDescent, nStepsSteepestDescentProgressInterval=nStepsSteepestDescentProgressInterval, maxObjectiveForce=maxObjectiveForce, timeStep=timeStep, frictionConstant=frictionConstant, cutOffDst=cutOffDst, VerletListDst=VerletListDst, dielectricConstant=dielectricConstant, debyeLength=debyeLength, inputCoordFile=inputCoordFile, inputTopFile=inputTopFile, epsilonSurf=epsilonSurf, sigmaSurf=sigmaSurf, surfacePosition=surfacePosition) with open(path,"w") as f: f.write(opt) def writeOptionsGenericWithSurfaceFromDict(path,optionsDict): nSteps=optionsDict["nSteps"] nStepsInterval=optionsDict["nStepsInterval"] nStepsWrite=optionsDict["nStepsWrite"] nStepsBackupInterval=optionsDict["nStepsBackupInterval"] outPutFilePath=optionsDict["outPutFilePath"] outPutFormat=optionsDict["outPutFormat"] boxX=optionsDict["boxX"] boxY=optionsDict["boxY"] boxZ=optionsDict["boxZ"] temperature=optionsDict["temperature"] steepestDecentScale=optionsDict["steepestDecentScale"] nStepsSteepestDescent=optionsDict["nStepsSteepestDescent"] nStepsSteepestDescentProgressInterval=optionsDict["nStepsSteepestDescentProgressInterval"] maxObjectiveForce=optionsDict["maxObjectiveForce"] timeStep=optionsDict["timeStep"] frictionConstant=optionsDict["frictionConstant"] cutOffDst=optionsDict["cutOffDst"] VerletListDst=optionsDict["VerletListDst"] inputCoordFile=optionsDict["inputCoordFile"] dielectricConstant=optionsDict["dielectricConstant"] debyeLength=optionsDict["debyeLength"] inputTopFile=optionsDict["inputTopFile"] epsilonSurf=optionsDict["epsilonSurf"] sigmaSurf=optionsDict["sigmaSurf"] surfacePosition=optionsDict["surfacePosition"] writeOptionsGenericWithSurface(path, nSteps, nStepsInterval, nStepsWrite, nStepsBackupInterval, outPutFilePath, outPutFormat, boxX,boxY,boxZ, temperature, steepestDecentScale, nStepsSteepestDescent, nStepsSteepestDescentProgressInterval, maxObjectiveForce, timeStep, frictionConstant, cutOffDst, VerletListDst, dielectricConstant, debyeLength, inputCoordFile, inputTopFile, epsilonSurf, sigmaSurf, surfacePosition) def writeOptionsGenericClash(path:str, nSteps:int, nStepsInterval:int, nStepsWrite:int, nStepsBackupInterval:int, outPutFilePath:str, outPutFormat:str, boxX:float,boxY:float,boxZ:float, temperature:float, steepestDecentScale:float, nStepsSteepestDescent:int, nStepsSteepestDescentProgressInterval:int, maxObjectiveForce:float, timeStep:float, frictionConstant:float, cutOffDst:float, VerletListDst:float, inputCoordFile:str, inputTopFile:str, lambd:float, gamma:float): opt = optGenericClash_template.format(nSteps=nSteps, nStepsInterval=nStepsInterval, nStepsWrite=nStepsWrite, nStepsBackupInterval=nStepsBackupInterval, outPutFilePath=outPutFilePath, outPutFormat=outPutFormat, boxX=boxX,boxY=boxY,boxZ=boxZ, temperature=temperature, steepestDecentScale=steepestDecentScale, nStepsSteepestDescent=nStepsSteepestDescent, nStepsSteepestDescentProgressInterval=nStepsSteepestDescentProgressInterval, maxObjectiveForce=maxObjectiveForce, timeStep=timeStep, frictionConstant=frictionConstant, cutOffDst=cutOffDst, VerletListDst=VerletListDst, inputCoordFile=inputCoordFile, inputTopFile=inputTopFile, lambd=lambd, gamma=gamma) with open(path,"w") as f: f.write(opt) def writeOptionsGenericClashFromDict(path,optionsDict): nSteps=optionsDict["nSteps"] nStepsInterval=optionsDict["nStepsInterval"] nStepsWrite=optionsDict["nStepsWrite"] nStepsBackupInterval=optionsDict["nStepsBackupInterval"] outPutFilePath=optionsDict["outPutFilePath"] outPutFormat=optionsDict["outPutFormat"] boxX=optionsDict["boxX"] boxY=optionsDict["boxY"] boxZ=optionsDict["boxZ"] temperature=optionsDict["temperature"] steepestDecentScale=optionsDict["steepestDecentScale"] nStepsSteepestDescent=optionsDict["nStepsSteepestDescent"] nStepsSteepestDescentProgressInterval=optionsDict["nStepsSteepestDescentProgressInterval"] maxObjectiveForce=optionsDict["maxObjectiveForce"] timeStep=optionsDict["timeStep"] frictionConstant=optionsDict["frictionConstant"] cutOffDst=optionsDict["cutOffDst"] VerletListDst=optionsDict["VerletListDst"] inputCoordFile=optionsDict["inputCoordFile"] inputTopFile=optionsDict["inputTopFile"] lambd=optionsDict["lambd"] gamma=optionsDict["gamma"] writeOptionsGenericClash(path, nSteps, nStepsInterval, nStepsWrite, nStepsBackupInterval, outPutFilePath, outPutFormat, boxX,boxY,boxZ, temperature, steepestDecentScale, nStepsSteepestDescent, nStepsSteepestDescentProgressInterval, maxObjectiveForce, timeStep, frictionConstant, cutOffDst, VerletListDst, inputCoordFile, inputTopFile, lambd, gamma) def writeOptionsGenericClashWithCompression(path:str, nSteps:int, nStepsInterval:int, nStepsWrite:int, nStepsBackupInterval:int, outPutFilePath:str, outPutFormat:str, boxX:float,boxY:float,boxZ:float, temperature:float, steepestDecentScale:float, nStepsSteepestDescent:int, nStepsSteepestDescentProgressInterval:int, maxObjectiveForce:float, timeStep:float, frictionConstant:float, cutOffDst:float, VerletListDst:float, inputCoordFile:str, inputTopFile:str, lambd:float, gamma:float, initialSphereRadius:float, minimalSphereRadius:float, compressionVelocity:float): opt = optGenericClashWithCompression_template.format(nSteps=nSteps, nStepsInterval=nStepsInterval, nStepsWrite=nStepsWrite, nStepsBackupInterval=nStepsBackupInterval, outPutFilePath=outPutFilePath, outPutFormat=outPutFormat, boxX=boxX,boxY=boxY,boxZ=boxZ, temperature=temperature, steepestDecentScale=steepestDecentScale, nStepsSteepestDescent=nStepsSteepestDescent, nStepsSteepestDescentProgressInterval=nStepsSteepestDescentProgressInterval, maxObjectiveForce=maxObjectiveForce, timeStep=timeStep, frictionConstant=frictionConstant, cutOffDst=cutOffDst, VerletListDst=VerletListDst, inputCoordFile=inputCoordFile, inputTopFile=inputTopFile, lambd=lambd, gamma=gamma, initialSphereRadius=initialSphereRadius, minimalSphereRadius=minimalSphereRadius, compressionVelocity=compressionVelocity) with open(path,"w") as f: f.write(opt) def writeOptionsGenericClashWithCompressionFromDict(path,optionsDict): nSteps=optionsDict["nSteps"] nStepsInterval=optionsDict["nStepsInterval"] nStepsWrite=optionsDict["nStepsWrite"] nStepsBackupInterval=optionsDict["nStepsBackupInterval"] outPutFilePath=optionsDict["outPutFilePath"] outPutFormat=optionsDict["outPutFormat"] boxX=optionsDict["boxX"] boxY=optionsDict["boxY"] boxZ=optionsDict["boxZ"] temperature=optionsDict["temperature"] steepestDecentScale=optionsDict["steepestDecentScale"] nStepsSteepestDescent=optionsDict["nStepsSteepestDescent"] nStepsSteepestDescentProgressInterval=optionsDict["nStepsSteepestDescentProgressInterval"] maxObjectiveForce=optionsDict["maxObjectiveForce"] timeStep=optionsDict["timeStep"] frictionConstant=optionsDict["frictionConstant"] cutOffDst=optionsDict["cutOffDst"] VerletListDst=optionsDict["VerletListDst"] inputCoordFile=optionsDict["inputCoordFile"] inputTopFile=optionsDict["inputTopFile"] lambd=optionsDict["lambd"] gamma=optionsDict["gamma"] initialSphereRadius=optionsDict["initialSphereRadius"] minimalSphereRadius=optionsDict["minimalSphereRadius"] compressionVelocity=optionsDict["compressionVelocity"] writeOptionsGenericClashWithCompression(path, nSteps, nStepsInterval, nStepsWrite, nStepsBackupInterval, outPutFilePath, outPutFormat, boxX,boxY,boxZ, temperature, steepestDecentScale, nStepsSteepestDescent, nStepsSteepestDescentProgressInterval, maxObjectiveForce, timeStep, frictionConstant, cutOffDst, VerletListDst, inputCoordFile, inputTopFile, lambd, gamma, initialSphereRadius, minimalSphereRadius, compressionVelocity) def writeOptionsAFM(path:str, nSteps:int, nStepsInterval:int, nStepsWrite:int, nStepsBackupInterval:int, outPutFilePath:str, outPutFormat:str, boxX:float,boxY:float,boxZ:float, temperature:float, steepestDecentScale:float, nStepsSteepestDescent:int, nStepsSteepestDescentProgressInterval:int, maxObjectiveForce:float, timeStep:float, frictionConstant:float, frictionConstantTip:float, cutOffDst:float, VerletListDst:float, dielectricConstant:float, debyeLength:float, inputCoordFile:str, inputTopFile:str, epsilonSurf:float, sigmaSurf:float, surfacePosition:float, initialTipSampleDst:float, descentVelocity:float, minimalChipHeight:float, Mtip:float, Rtip:float, Kxytip:float, Ktip:float, epsilonTip:float, sigmaTip:float, Atip:float, Btip:float, epsilonTipSurf:float, sigmaTipSurf :float, ATipSurf:float, BTipSurf:float, nStepsIndentMeasure:str, outputIndentationMeasureFilePath:str): opt = optAFM_template.format(nSteps=nSteps, nStepsInterval=nStepsInterval, nStepsWrite=nStepsWrite, nStepsBackupInterval=nStepsBackupInterval, outPutFilePath=outPutFilePath, outPutFormat=outPutFormat, boxX=boxX,boxY=boxY,boxZ=boxZ, temperature=temperature, steepestDecentScale=steepestDecentScale, nStepsSteepestDescent=nStepsSteepestDescent, nStepsSteepestDescentProgressInterval=nStepsSteepestDescentProgressInterval, maxObjectiveForce=maxObjectiveForce, timeStep=timeStep, frictionConstant=frictionConstant, frictionConstantTip=frictionConstantTip, cutOffDst=cutOffDst, VerletListDst=VerletListDst, dielectricConstant=dielectricConstant, debyeLength=debyeLength, inputCoordFile=inputCoordFile, inputTopFile=inputTopFile, epsilonSurf=epsilonSurf, sigmaSurf=sigmaSurf, surfacePosition=surfacePosition, initialTipSampleDst=initialTipSampleDst, descentVelocity=descentVelocity, minimalChipHeight=minimalChipHeight, Mtip=Mtip, Rtip=Rtip, Kxytip=Kxytip, Ktip=Ktip, epsilonTip=epsilonTip, sigmaTip=sigmaTip, Atip=Atip, Btip=Btip, epsilonTipSurf=epsilonTipSurf, sigmaTipSurf =sigmaTipSurf, ATipSurf=ATipSurf, BTipSurf=BTipSurf, nStepsIndentMeasure=nStepsIndentMeasure, outputIndentationMeasureFilePath=outputIndentationMeasureFilePath) with open(path,"w") as f: f.write(opt) def writeOptionsAFMFromDict(path,optionsDict): nSteps=optionsDict["nSteps"] nStepsInterval=optionsDict["nStepsInterval"] nStepsWrite=optionsDict["nStepsWrite"] nStepsBackupInterval=optionsDict["nStepsBackupInterval"] outPutFilePath=optionsDict["outPutFilePath"] outPutFormat=optionsDict["outPutFormat"] boxX=optionsDict["boxX"] boxY=optionsDict["boxY"] boxZ=optionsDict["boxZ"] temperature=optionsDict["temperature"] steepestDecentScale=optionsDict["steepestDecentScale"] nStepsSteepestDescent=optionsDict["nStepsSteepestDescent"] nStepsSteepestDescentProgressInterval=optionsDict["nStepsSteepestDescentProgressInterval"] maxObjectiveForce=optionsDict["maxObjectiveForce"] timeStep=optionsDict["timeStep"] frictionConstant=optionsDict["frictionConstant"] frictionConstantTip=optionsDict["frictionConstantTip"] cutOffDst=optionsDict["cutOffDst"] VerletListDst=optionsDict["VerletListDst"] dielectricConstant=optionsDict["dielectricConstant"] debyeLength=optionsDict["debyeLength"] inputCoordFile=optionsDict["inputCoordFile"] inputTopFile=optionsDict["inputTopFile"] epsilonSurf=optionsDict["epsilonSurf"] sigmaSurf=optionsDict["sigmaSurf"] surfacePosition=optionsDict["surfacePosition"] initialTipSampleDst=optionsDict["initialTipSampleDst"] descentVelocity=optionsDict["descentVelocity"] minimalChipHeight=optionsDict["minimalChipHeight"] Mtip=optionsDict["Mtip"] Rtip=optionsDict["Rtip"] Kxytip=optionsDict["Kxytip"] Ktip=optionsDict["Ktip"] epsilonTip=optionsDict["epsilonTip"] sigmaTip=optionsDict["sigmaTip"] Atip=optionsDict["Atip"] Btip=optionsDict["Btip"] epsilonTipSurf=optionsDict["epsilonTipSurf"] sigmaTipSurf =optionsDict["sigmaTipSurf"] ATipSurf=optionsDict["ATipSurf"] BTipSurf=optionsDict["BTipSurf"] nStepsIndentMeasure=optionsDict["nStepsIndentMeasure"] outputIndentationMeasureFilePath=optionsDict["outputIndentationMeasureFilePath"] writeOptionsAFM(path, nSteps, nStepsInterval, nStepsWrite, nStepsBackupInterval, outPutFilePath, outPutFormat, boxX,boxY,boxZ, temperature, steepestDecentScale, nStepsSteepestDescent, nStepsSteepestDescentProgressInterval, maxObjectiveForce, timeStep, frictionConstant, frictionConstantTip, cutOffDst, VerletListDst, dielectricConstant, debyeLength, inputCoordFile, inputTopFile, epsilonSurf, sigmaSurf, surfacePosition, initialTipSampleDst, descentVelocity, minimalChipHeight, Mtip, Rtip, Kxytip, Ktip, epsilonTip, sigmaTip, Atip, Btip, epsilonTipSurf, sigmaTipSurf, ATipSurf, BTipSurf, nStepsIndentMeasure, outputIndentationMeasureFilePath) def writeOptionsGenericUmbrella(path:str, nSteps:int, nStepsInterval:int, nStepsWrite:int, nStepsBackupInterval:int, outPutFilePath:str, outPutFormat:str, boxX:float,boxY:float,boxZ:float, temperature:float, steepestDecentScale:float, nStepsSteepestDescent:int, nStepsSteepestDescentProgressInterval:int, maxObjectiveForce:float, timeStep:float, frictionConstant:float, cutOffDst:float, VerletListDst:float, dielectricConstant:float, debyeLength:float, inputCoordFile:str, inputTopFile:str, umbrellaK:float, umbrellaInit:float, umbrellaEnd:float, umbrellaWindowsNumber:int, umbrellaCopies:int, nStepsUmbrellaMeasure:int, outputUmbrellaMeasureFilePath:str): opt = optGenericUmbrella_template.format(nSteps=nSteps, nStepsInterval=nStepsInterval, nStepsWrite=nStepsWrite, nStepsBackupInterval=nStepsBackupInterval, outPutFilePath=outPutFilePath, outPutFormat=outPutFormat, boxX=boxX,boxY=boxY,boxZ=boxZ, temperature=temperature, steepestDecentScale=steepestDecentScale, nStepsSteepestDescent=nStepsSteepestDescent, nStepsSteepestDescentProgressInterval=nStepsSteepestDescentProgressInterval, maxObjectiveForce=maxObjectiveForce, timeStep=timeStep, frictionConstant=frictionConstant, cutOffDst=cutOffDst, VerletListDst=VerletListDst, dielectricConstant=dielectricConstant, debyeLength=debyeLength, inputCoordFile=inputCoordFile, inputTopFile=inputTopFile, umbrellaK=umbrellaK, umbrellaInit=umbrellaInit, umbrellaEnd=umbrellaEnd, umbrellaWindowsNumber=umbrellaWindowsNumber, umbrellaCopies=umbrellaCopies, nStepsUmbrellaMeasure=nStepsUmbrellaMeasure, outputUmbrellaMeasureFilePath=outputUmbrellaMeasureFilePath) with open(path,"w") as f: f.write(opt) def writeOptionsGenericUmbrellaFromDict(path,optionsDict): nSteps=optionsDict["nSteps"] nStepsInterval=optionsDict["nStepsInterval"] nStepsWrite=optionsDict["nStepsWrite"] nStepsBackupInterval=optionsDict["nStepsBackupInterval"] outPutFilePath=optionsDict["outPutFilePath"] outPutFormat=optionsDict["outPutFormat"] boxX=optionsDict["boxX"] boxY=optionsDict["boxY"] boxZ=optionsDict["boxZ"] temperature=optionsDict["temperature"] steepestDecentScale=optionsDict["steepestDecentScale"] nStepsSteepestDescent=optionsDict["nStepsSteepestDescent"] nStepsSteepestDescentProgressInterval=optionsDict["nStepsSteepestDescentProgressInterval"] maxObjectiveForce=optionsDict["maxObjectiveForce"] timeStep=optionsDict["timeStep"] frictionConstant=optionsDict["frictionConstant"] cutOffDst=optionsDict["cutOffDst"] VerletListDst=optionsDict["VerletListDst"] dielectricConstant=optionsDict["dielectricConstant"] debyeLength=optionsDict["debyeLength"] inputCoordFile=optionsDict["inputCoordFile"] inputTopFile=optionsDict["inputTopFile"] umbrellaK=optionsDict["umbrellaK"] umbrellaInit=optionsDict["umbrellaInit"] umbrellaEnd=optionsDict["umbrellaEnd"] umbrellaWindowsNumber=optionsDict["umbrellaWindowsNumber"] umbrellaCopies=optionsDict["umbrellaCopies"] nStepsUmbrellaMeasure=optionsDict["nStepsUmbrellaMeasure"] outputUmbrellaMeasureFilePath=optionsDict["outputUmbrellaMeasureFilePath"] writeOptionsGenericUmbrella(path, nSteps, nStepsInterval, nStepsWrite, nStepsBackupInterval, outPutFilePath, outPutFormat, boxX,boxY,boxZ, temperature, steepestDecentScale, nStepsSteepestDescent, nStepsSteepestDescentProgressInterval, maxObjectiveForce, timeStep, frictionConstant, cutOffDst, VerletListDst, dielectricConstant, debyeLength, inputCoordFile, inputTopFile, umbrellaK, umbrellaInit, umbrellaEnd, umbrellaWindowsNumber, umbrellaCopies, nStepsUmbrellaMeasure, outputUmbrellaMeasureFilePath) ################################################ #writeOptionsGeneric("optionsTestGeneric.dat", # 1000, # 1000, # 1000, # 1000, # "kk", # "asdf", # 1.23,2.13,3.12, # 1.0, # 1.5, # 55555, # 4444, # -1.0, # 0.123456, # 2.0, # 100.0, # 150.0, # "asdf.coord", # "asdf.top") # #writeOptionsGenericWithSurface("optionsTestGenericSurface.dat", # 1000, # 1000, # 1000, # 1000, # "kk", # "asdf", # 1.23,2.13,3.12, # 1.0, # 1.5, # 55555, # 4444, # -1.0, # 0.123456, # 2.0, # 100.0, # 150.0, # "asdf.coord", # "asdf.top", # 1.0, # 2.0, # -300) # #writeOptionsGenericClash("optionsTestClash.dat", # 1000, # 1000, # 1000, # 1000, # "kk", # "asdf", # 1.23,2.13,3.12, # 1.0, # 1.5, # 55555, # 4444, # -1.0, # 0.123456, # 2.0, # 100.0, # 150.0, # "asdf.coord", # "asdf.top", # 2.0, # 4.0) # #writeOptionsGenericClashWithCompression("optionsTestClashWithCompression.dat", # 1000, # 1000, # 1000, # 1000, # "kk", # "asdf", # 1.23,2.13,3.12, # 1.0, # 1.5, # 55555, # 4444, # -1.0, # 0.123456, # 2.0, # 100.0, # 150.0, # "asdf.coord", # "asdf.top", # 2.0, # 4.0, # 300, # 400, # 0.01001) # #writeOptionsAFM("optionsAFM.dat", # 1000, # 1000, # 1000, # 1000, # "kk", # "asdf", # 1.23,2.13,3.12, # 1.0, # 1.5, # 55555, # 4444, # -1.0, # 0.123456, # 2.0, # 100.0, # 150.0, # "asdf.coord", # "asdf.top", # 1.0, # 2.0, # -300, # 1.123, # 0.001, # 2.323, # 1.02, # 5.02, # 5698, # 456, # 5897, # 57, # 142566, # 146, # 1486, # 98765, # 12453, # 1289)
opt_generic_template = '\nnSteps {nSteps}\nnStepsInfoInterval {nStepsInterval}\nnStepsWriteInterval {nStepsWrite}\nnStepsBackupInterval {nStepsBackupInterval}\n\noutPutFilePath {outPutFilePath}\noutPutFormat {outPutFormat}\n\nboxSize {boxX} {boxY} {boxZ}\nT {temperature}\n\nh {steepestDecentScale}\n\nnStepsSteepestDescent {nStepsSteepestDescent}\nnStepsSteepestDescentProgressInterval {nStepsSteepestDescentProgressInterval}\nmaxObjectiveForce {maxObjectiveForce}\n\ndt {timeStep}\nfrictionConstant {frictionConstant}\n\ncutOffDst {cutOffDst}\nVerletListDst {VerletListDst}\n \ninputCoordPath {inputCoordFile}\ninputTopologyPath {inputTopFile}' opt_generic_with_elec_template = optGeneric_template + '\ndielectricConstant {dielectricConstant}\ndebyeLength {debyeLength}\n' opt_generic_with_surface_template = optGenericWithElec_template + '\n\nepsilonSurf {epsilonSurf}\nsigmaSurf {sigmaSurf}\n\nsurfacePosition {surfacePosition}\n' opt_generic_clash_template = optGeneric_template + '\n\nlambda {lambd}\ngamma {gamma}\n' opt_generic_clash_with_compression_template = optGenericClash_template + '\n\ninitialSphereRadius {initialSphereRadius}\nminimalSphereRadius {minimalSphereRadius}\n\ncompressionVelocity {compressionVelocity}\n' opt_afm_template = optGenericWithSurface_template + '\n\nfrictionConstantTip {frictionConstantTip}\n\ninitialTipSampleDst {initialTipSampleDst}\ndescentVelocity {descentVelocity}\n\nminimalChipHeight {minimalChipHeight}\n\nMtip {Mtip}\nRtip {Rtip}\nKxytip {Kxytip}\nKtip {Ktip}\n\nepsilonTip {epsilonTip}\nsigmaTip {sigmaTip}\n\nAtip {Atip}\nBtip {Btip}\n\nepsilonTipSurf {epsilonTipSurf}\nsigmaTipSurf {sigmaTipSurf}\n\nATipSurf {ATipSurf}\nBTipSurf {BTipSurf}\n\nnStepsIndentMeasure {nStepsIndentMeasure}\noutputIndentationMeasureFilePath {outputIndentationMeasureFilePath}\n' opt_generic_umbrella_template = optGenericWithElec_template + '\n\numbrellaK {umbrellaK}\numbrellaInit {umbrellaInit}\numbrellaEnd {umbrellaEnd}\numbrellaWindowsNumber {umbrellaWindowsNumber}\numbrellaCopies {umbrellaCopies}\n\nnStepsUmbrellaMeasure {nStepsUmbrellaMeasure}\noutputUmbrellaMeasureFilePath {outputUmbrellaMeasureFilePath}\n' def write_options_generic(path: str, nSteps: int, nStepsInterval: int, nStepsWrite: int, nStepsBackupInterval: int, outPutFilePath: str, outPutFormat: str, boxX: float, boxY: float, boxZ: float, temperature: float, steepestDecentScale: float, nStepsSteepestDescent: int, nStepsSteepestDescentProgressInterval: int, maxObjectiveForce: float, timeStep: float, frictionConstant: float, cutOffDst: float, VerletListDst: float, dielectricConstant: float, debyeLength: float, inputCoordFile: str, inputTopFile: str): opt = optGenericWithElec_template.format(nSteps=nSteps, nStepsInterval=nStepsInterval, nStepsWrite=nStepsWrite, nStepsBackupInterval=nStepsBackupInterval, outPutFilePath=outPutFilePath, outPutFormat=outPutFormat, boxX=boxX, boxY=boxY, boxZ=boxZ, temperature=temperature, steepestDecentScale=steepestDecentScale, nStepsSteepestDescent=nStepsSteepestDescent, nStepsSteepestDescentProgressInterval=nStepsSteepestDescentProgressInterval, maxObjectiveForce=maxObjectiveForce, timeStep=timeStep, frictionConstant=frictionConstant, cutOffDst=cutOffDst, VerletListDst=VerletListDst, dielectricConstant=dielectricConstant, debyeLength=debyeLength, inputCoordFile=inputCoordFile, inputTopFile=inputTopFile) with open(path, 'w') as f: f.write(opt) def write_options_generic_from_dict(path, optionsDict): n_steps = optionsDict['nSteps'] n_steps_interval = optionsDict['nStepsInterval'] n_steps_write = optionsDict['nStepsWrite'] n_steps_backup_interval = optionsDict['nStepsBackupInterval'] out_put_file_path = optionsDict['outPutFilePath'] out_put_format = optionsDict['outPutFormat'] box_x = optionsDict['boxX'] box_y = optionsDict['boxY'] box_z = optionsDict['boxZ'] temperature = optionsDict['temperature'] steepest_decent_scale = optionsDict['steepestDecentScale'] n_steps_steepest_descent = optionsDict['nStepsSteepestDescent'] n_steps_steepest_descent_progress_interval = optionsDict['nStepsSteepestDescentProgressInterval'] max_objective_force = optionsDict['maxObjectiveForce'] time_step = optionsDict['timeStep'] friction_constant = optionsDict['frictionConstant'] cut_off_dst = optionsDict['cutOffDst'] verlet_list_dst = optionsDict['VerletListDst'] dielectric_constant = optionsDict['dielectricConstant'] debye_length = optionsDict['debyeLength'] input_coord_file = optionsDict['inputCoordFile'] input_top_file = optionsDict['inputTopFile'] write_options_generic(path, nSteps, nStepsInterval, nStepsWrite, nStepsBackupInterval, outPutFilePath, outPutFormat, boxX, boxY, boxZ, temperature, steepestDecentScale, nStepsSteepestDescent, nStepsSteepestDescentProgressInterval, maxObjectiveForce, timeStep, frictionConstant, cutOffDst, VerletListDst, dielectricConstant, debyeLength, inputCoordFile, inputTopFile) def write_options_generic_with_surface(path: str, nSteps: int, nStepsInterval: int, nStepsWrite: int, nStepsBackupInterval: int, outPutFilePath: str, outPutFormat: str, boxX: float, boxY: float, boxZ: float, temperature: float, steepestDecentScale: float, nStepsSteepestDescent: int, nStepsSteepestDescentProgressInterval: int, maxObjectiveForce: float, timeStep: float, frictionConstant: float, cutOffDst: float, VerletListDst: float, dielectricConstant: float, debyeLength: float, inputCoordFile: str, inputTopFile: str, epsilonSurf: float, sigmaSurf: float, surfacePosition: float): opt = optGenericWithSurface_template.format(nSteps=nSteps, nStepsInterval=nStepsInterval, nStepsWrite=nStepsWrite, nStepsBackupInterval=nStepsBackupInterval, outPutFilePath=outPutFilePath, outPutFormat=outPutFormat, boxX=boxX, boxY=boxY, boxZ=boxZ, temperature=temperature, steepestDecentScale=steepestDecentScale, nStepsSteepestDescent=nStepsSteepestDescent, nStepsSteepestDescentProgressInterval=nStepsSteepestDescentProgressInterval, maxObjectiveForce=maxObjectiveForce, timeStep=timeStep, frictionConstant=frictionConstant, cutOffDst=cutOffDst, VerletListDst=VerletListDst, dielectricConstant=dielectricConstant, debyeLength=debyeLength, inputCoordFile=inputCoordFile, inputTopFile=inputTopFile, epsilonSurf=epsilonSurf, sigmaSurf=sigmaSurf, surfacePosition=surfacePosition) with open(path, 'w') as f: f.write(opt) def write_options_generic_with_surface_from_dict(path, optionsDict): n_steps = optionsDict['nSteps'] n_steps_interval = optionsDict['nStepsInterval'] n_steps_write = optionsDict['nStepsWrite'] n_steps_backup_interval = optionsDict['nStepsBackupInterval'] out_put_file_path = optionsDict['outPutFilePath'] out_put_format = optionsDict['outPutFormat'] box_x = optionsDict['boxX'] box_y = optionsDict['boxY'] box_z = optionsDict['boxZ'] temperature = optionsDict['temperature'] steepest_decent_scale = optionsDict['steepestDecentScale'] n_steps_steepest_descent = optionsDict['nStepsSteepestDescent'] n_steps_steepest_descent_progress_interval = optionsDict['nStepsSteepestDescentProgressInterval'] max_objective_force = optionsDict['maxObjectiveForce'] time_step = optionsDict['timeStep'] friction_constant = optionsDict['frictionConstant'] cut_off_dst = optionsDict['cutOffDst'] verlet_list_dst = optionsDict['VerletListDst'] input_coord_file = optionsDict['inputCoordFile'] dielectric_constant = optionsDict['dielectricConstant'] debye_length = optionsDict['debyeLength'] input_top_file = optionsDict['inputTopFile'] epsilon_surf = optionsDict['epsilonSurf'] sigma_surf = optionsDict['sigmaSurf'] surface_position = optionsDict['surfacePosition'] write_options_generic_with_surface(path, nSteps, nStepsInterval, nStepsWrite, nStepsBackupInterval, outPutFilePath, outPutFormat, boxX, boxY, boxZ, temperature, steepestDecentScale, nStepsSteepestDescent, nStepsSteepestDescentProgressInterval, maxObjectiveForce, timeStep, frictionConstant, cutOffDst, VerletListDst, dielectricConstant, debyeLength, inputCoordFile, inputTopFile, epsilonSurf, sigmaSurf, surfacePosition) def write_options_generic_clash(path: str, nSteps: int, nStepsInterval: int, nStepsWrite: int, nStepsBackupInterval: int, outPutFilePath: str, outPutFormat: str, boxX: float, boxY: float, boxZ: float, temperature: float, steepestDecentScale: float, nStepsSteepestDescent: int, nStepsSteepestDescentProgressInterval: int, maxObjectiveForce: float, timeStep: float, frictionConstant: float, cutOffDst: float, VerletListDst: float, inputCoordFile: str, inputTopFile: str, lambd: float, gamma: float): opt = optGenericClash_template.format(nSteps=nSteps, nStepsInterval=nStepsInterval, nStepsWrite=nStepsWrite, nStepsBackupInterval=nStepsBackupInterval, outPutFilePath=outPutFilePath, outPutFormat=outPutFormat, boxX=boxX, boxY=boxY, boxZ=boxZ, temperature=temperature, steepestDecentScale=steepestDecentScale, nStepsSteepestDescent=nStepsSteepestDescent, nStepsSteepestDescentProgressInterval=nStepsSteepestDescentProgressInterval, maxObjectiveForce=maxObjectiveForce, timeStep=timeStep, frictionConstant=frictionConstant, cutOffDst=cutOffDst, VerletListDst=VerletListDst, inputCoordFile=inputCoordFile, inputTopFile=inputTopFile, lambd=lambd, gamma=gamma) with open(path, 'w') as f: f.write(opt) def write_options_generic_clash_from_dict(path, optionsDict): n_steps = optionsDict['nSteps'] n_steps_interval = optionsDict['nStepsInterval'] n_steps_write = optionsDict['nStepsWrite'] n_steps_backup_interval = optionsDict['nStepsBackupInterval'] out_put_file_path = optionsDict['outPutFilePath'] out_put_format = optionsDict['outPutFormat'] box_x = optionsDict['boxX'] box_y = optionsDict['boxY'] box_z = optionsDict['boxZ'] temperature = optionsDict['temperature'] steepest_decent_scale = optionsDict['steepestDecentScale'] n_steps_steepest_descent = optionsDict['nStepsSteepestDescent'] n_steps_steepest_descent_progress_interval = optionsDict['nStepsSteepestDescentProgressInterval'] max_objective_force = optionsDict['maxObjectiveForce'] time_step = optionsDict['timeStep'] friction_constant = optionsDict['frictionConstant'] cut_off_dst = optionsDict['cutOffDst'] verlet_list_dst = optionsDict['VerletListDst'] input_coord_file = optionsDict['inputCoordFile'] input_top_file = optionsDict['inputTopFile'] lambd = optionsDict['lambd'] gamma = optionsDict['gamma'] write_options_generic_clash(path, nSteps, nStepsInterval, nStepsWrite, nStepsBackupInterval, outPutFilePath, outPutFormat, boxX, boxY, boxZ, temperature, steepestDecentScale, nStepsSteepestDescent, nStepsSteepestDescentProgressInterval, maxObjectiveForce, timeStep, frictionConstant, cutOffDst, VerletListDst, inputCoordFile, inputTopFile, lambd, gamma) def write_options_generic_clash_with_compression(path: str, nSteps: int, nStepsInterval: int, nStepsWrite: int, nStepsBackupInterval: int, outPutFilePath: str, outPutFormat: str, boxX: float, boxY: float, boxZ: float, temperature: float, steepestDecentScale: float, nStepsSteepestDescent: int, nStepsSteepestDescentProgressInterval: int, maxObjectiveForce: float, timeStep: float, frictionConstant: float, cutOffDst: float, VerletListDst: float, inputCoordFile: str, inputTopFile: str, lambd: float, gamma: float, initialSphereRadius: float, minimalSphereRadius: float, compressionVelocity: float): opt = optGenericClashWithCompression_template.format(nSteps=nSteps, nStepsInterval=nStepsInterval, nStepsWrite=nStepsWrite, nStepsBackupInterval=nStepsBackupInterval, outPutFilePath=outPutFilePath, outPutFormat=outPutFormat, boxX=boxX, boxY=boxY, boxZ=boxZ, temperature=temperature, steepestDecentScale=steepestDecentScale, nStepsSteepestDescent=nStepsSteepestDescent, nStepsSteepestDescentProgressInterval=nStepsSteepestDescentProgressInterval, maxObjectiveForce=maxObjectiveForce, timeStep=timeStep, frictionConstant=frictionConstant, cutOffDst=cutOffDst, VerletListDst=VerletListDst, inputCoordFile=inputCoordFile, inputTopFile=inputTopFile, lambd=lambd, gamma=gamma, initialSphereRadius=initialSphereRadius, minimalSphereRadius=minimalSphereRadius, compressionVelocity=compressionVelocity) with open(path, 'w') as f: f.write(opt) def write_options_generic_clash_with_compression_from_dict(path, optionsDict): n_steps = optionsDict['nSteps'] n_steps_interval = optionsDict['nStepsInterval'] n_steps_write = optionsDict['nStepsWrite'] n_steps_backup_interval = optionsDict['nStepsBackupInterval'] out_put_file_path = optionsDict['outPutFilePath'] out_put_format = optionsDict['outPutFormat'] box_x = optionsDict['boxX'] box_y = optionsDict['boxY'] box_z = optionsDict['boxZ'] temperature = optionsDict['temperature'] steepest_decent_scale = optionsDict['steepestDecentScale'] n_steps_steepest_descent = optionsDict['nStepsSteepestDescent'] n_steps_steepest_descent_progress_interval = optionsDict['nStepsSteepestDescentProgressInterval'] max_objective_force = optionsDict['maxObjectiveForce'] time_step = optionsDict['timeStep'] friction_constant = optionsDict['frictionConstant'] cut_off_dst = optionsDict['cutOffDst'] verlet_list_dst = optionsDict['VerletListDst'] input_coord_file = optionsDict['inputCoordFile'] input_top_file = optionsDict['inputTopFile'] lambd = optionsDict['lambd'] gamma = optionsDict['gamma'] initial_sphere_radius = optionsDict['initialSphereRadius'] minimal_sphere_radius = optionsDict['minimalSphereRadius'] compression_velocity = optionsDict['compressionVelocity'] write_options_generic_clash_with_compression(path, nSteps, nStepsInterval, nStepsWrite, nStepsBackupInterval, outPutFilePath, outPutFormat, boxX, boxY, boxZ, temperature, steepestDecentScale, nStepsSteepestDescent, nStepsSteepestDescentProgressInterval, maxObjectiveForce, timeStep, frictionConstant, cutOffDst, VerletListDst, inputCoordFile, inputTopFile, lambd, gamma, initialSphereRadius, minimalSphereRadius, compressionVelocity) def write_options_afm(path: str, nSteps: int, nStepsInterval: int, nStepsWrite: int, nStepsBackupInterval: int, outPutFilePath: str, outPutFormat: str, boxX: float, boxY: float, boxZ: float, temperature: float, steepestDecentScale: float, nStepsSteepestDescent: int, nStepsSteepestDescentProgressInterval: int, maxObjectiveForce: float, timeStep: float, frictionConstant: float, frictionConstantTip: float, cutOffDst: float, VerletListDst: float, dielectricConstant: float, debyeLength: float, inputCoordFile: str, inputTopFile: str, epsilonSurf: float, sigmaSurf: float, surfacePosition: float, initialTipSampleDst: float, descentVelocity: float, minimalChipHeight: float, Mtip: float, Rtip: float, Kxytip: float, Ktip: float, epsilonTip: float, sigmaTip: float, Atip: float, Btip: float, epsilonTipSurf: float, sigmaTipSurf: float, ATipSurf: float, BTipSurf: float, nStepsIndentMeasure: str, outputIndentationMeasureFilePath: str): opt = optAFM_template.format(nSteps=nSteps, nStepsInterval=nStepsInterval, nStepsWrite=nStepsWrite, nStepsBackupInterval=nStepsBackupInterval, outPutFilePath=outPutFilePath, outPutFormat=outPutFormat, boxX=boxX, boxY=boxY, boxZ=boxZ, temperature=temperature, steepestDecentScale=steepestDecentScale, nStepsSteepestDescent=nStepsSteepestDescent, nStepsSteepestDescentProgressInterval=nStepsSteepestDescentProgressInterval, maxObjectiveForce=maxObjectiveForce, timeStep=timeStep, frictionConstant=frictionConstant, frictionConstantTip=frictionConstantTip, cutOffDst=cutOffDst, VerletListDst=VerletListDst, dielectricConstant=dielectricConstant, debyeLength=debyeLength, inputCoordFile=inputCoordFile, inputTopFile=inputTopFile, epsilonSurf=epsilonSurf, sigmaSurf=sigmaSurf, surfacePosition=surfacePosition, initialTipSampleDst=initialTipSampleDst, descentVelocity=descentVelocity, minimalChipHeight=minimalChipHeight, Mtip=Mtip, Rtip=Rtip, Kxytip=Kxytip, Ktip=Ktip, epsilonTip=epsilonTip, sigmaTip=sigmaTip, Atip=Atip, Btip=Btip, epsilonTipSurf=epsilonTipSurf, sigmaTipSurf=sigmaTipSurf, ATipSurf=ATipSurf, BTipSurf=BTipSurf, nStepsIndentMeasure=nStepsIndentMeasure, outputIndentationMeasureFilePath=outputIndentationMeasureFilePath) with open(path, 'w') as f: f.write(opt) def write_options_afm_from_dict(path, optionsDict): n_steps = optionsDict['nSteps'] n_steps_interval = optionsDict['nStepsInterval'] n_steps_write = optionsDict['nStepsWrite'] n_steps_backup_interval = optionsDict['nStepsBackupInterval'] out_put_file_path = optionsDict['outPutFilePath'] out_put_format = optionsDict['outPutFormat'] box_x = optionsDict['boxX'] box_y = optionsDict['boxY'] box_z = optionsDict['boxZ'] temperature = optionsDict['temperature'] steepest_decent_scale = optionsDict['steepestDecentScale'] n_steps_steepest_descent = optionsDict['nStepsSteepestDescent'] n_steps_steepest_descent_progress_interval = optionsDict['nStepsSteepestDescentProgressInterval'] max_objective_force = optionsDict['maxObjectiveForce'] time_step = optionsDict['timeStep'] friction_constant = optionsDict['frictionConstant'] friction_constant_tip = optionsDict['frictionConstantTip'] cut_off_dst = optionsDict['cutOffDst'] verlet_list_dst = optionsDict['VerletListDst'] dielectric_constant = optionsDict['dielectricConstant'] debye_length = optionsDict['debyeLength'] input_coord_file = optionsDict['inputCoordFile'] input_top_file = optionsDict['inputTopFile'] epsilon_surf = optionsDict['epsilonSurf'] sigma_surf = optionsDict['sigmaSurf'] surface_position = optionsDict['surfacePosition'] initial_tip_sample_dst = optionsDict['initialTipSampleDst'] descent_velocity = optionsDict['descentVelocity'] minimal_chip_height = optionsDict['minimalChipHeight'] mtip = optionsDict['Mtip'] rtip = optionsDict['Rtip'] kxytip = optionsDict['Kxytip'] ktip = optionsDict['Ktip'] epsilon_tip = optionsDict['epsilonTip'] sigma_tip = optionsDict['sigmaTip'] atip = optionsDict['Atip'] btip = optionsDict['Btip'] epsilon_tip_surf = optionsDict['epsilonTipSurf'] sigma_tip_surf = optionsDict['sigmaTipSurf'] a_tip_surf = optionsDict['ATipSurf'] b_tip_surf = optionsDict['BTipSurf'] n_steps_indent_measure = optionsDict['nStepsIndentMeasure'] output_indentation_measure_file_path = optionsDict['outputIndentationMeasureFilePath'] write_options_afm(path, nSteps, nStepsInterval, nStepsWrite, nStepsBackupInterval, outPutFilePath, outPutFormat, boxX, boxY, boxZ, temperature, steepestDecentScale, nStepsSteepestDescent, nStepsSteepestDescentProgressInterval, maxObjectiveForce, timeStep, frictionConstant, frictionConstantTip, cutOffDst, VerletListDst, dielectricConstant, debyeLength, inputCoordFile, inputTopFile, epsilonSurf, sigmaSurf, surfacePosition, initialTipSampleDst, descentVelocity, minimalChipHeight, Mtip, Rtip, Kxytip, Ktip, epsilonTip, sigmaTip, Atip, Btip, epsilonTipSurf, sigmaTipSurf, ATipSurf, BTipSurf, nStepsIndentMeasure, outputIndentationMeasureFilePath) def write_options_generic_umbrella(path: str, nSteps: int, nStepsInterval: int, nStepsWrite: int, nStepsBackupInterval: int, outPutFilePath: str, outPutFormat: str, boxX: float, boxY: float, boxZ: float, temperature: float, steepestDecentScale: float, nStepsSteepestDescent: int, nStepsSteepestDescentProgressInterval: int, maxObjectiveForce: float, timeStep: float, frictionConstant: float, cutOffDst: float, VerletListDst: float, dielectricConstant: float, debyeLength: float, inputCoordFile: str, inputTopFile: str, umbrellaK: float, umbrellaInit: float, umbrellaEnd: float, umbrellaWindowsNumber: int, umbrellaCopies: int, nStepsUmbrellaMeasure: int, outputUmbrellaMeasureFilePath: str): opt = optGenericUmbrella_template.format(nSteps=nSteps, nStepsInterval=nStepsInterval, nStepsWrite=nStepsWrite, nStepsBackupInterval=nStepsBackupInterval, outPutFilePath=outPutFilePath, outPutFormat=outPutFormat, boxX=boxX, boxY=boxY, boxZ=boxZ, temperature=temperature, steepestDecentScale=steepestDecentScale, nStepsSteepestDescent=nStepsSteepestDescent, nStepsSteepestDescentProgressInterval=nStepsSteepestDescentProgressInterval, maxObjectiveForce=maxObjectiveForce, timeStep=timeStep, frictionConstant=frictionConstant, cutOffDst=cutOffDst, VerletListDst=VerletListDst, dielectricConstant=dielectricConstant, debyeLength=debyeLength, inputCoordFile=inputCoordFile, inputTopFile=inputTopFile, umbrellaK=umbrellaK, umbrellaInit=umbrellaInit, umbrellaEnd=umbrellaEnd, umbrellaWindowsNumber=umbrellaWindowsNumber, umbrellaCopies=umbrellaCopies, nStepsUmbrellaMeasure=nStepsUmbrellaMeasure, outputUmbrellaMeasureFilePath=outputUmbrellaMeasureFilePath) with open(path, 'w') as f: f.write(opt) def write_options_generic_umbrella_from_dict(path, optionsDict): n_steps = optionsDict['nSteps'] n_steps_interval = optionsDict['nStepsInterval'] n_steps_write = optionsDict['nStepsWrite'] n_steps_backup_interval = optionsDict['nStepsBackupInterval'] out_put_file_path = optionsDict['outPutFilePath'] out_put_format = optionsDict['outPutFormat'] box_x = optionsDict['boxX'] box_y = optionsDict['boxY'] box_z = optionsDict['boxZ'] temperature = optionsDict['temperature'] steepest_decent_scale = optionsDict['steepestDecentScale'] n_steps_steepest_descent = optionsDict['nStepsSteepestDescent'] n_steps_steepest_descent_progress_interval = optionsDict['nStepsSteepestDescentProgressInterval'] max_objective_force = optionsDict['maxObjectiveForce'] time_step = optionsDict['timeStep'] friction_constant = optionsDict['frictionConstant'] cut_off_dst = optionsDict['cutOffDst'] verlet_list_dst = optionsDict['VerletListDst'] dielectric_constant = optionsDict['dielectricConstant'] debye_length = optionsDict['debyeLength'] input_coord_file = optionsDict['inputCoordFile'] input_top_file = optionsDict['inputTopFile'] umbrella_k = optionsDict['umbrellaK'] umbrella_init = optionsDict['umbrellaInit'] umbrella_end = optionsDict['umbrellaEnd'] umbrella_windows_number = optionsDict['umbrellaWindowsNumber'] umbrella_copies = optionsDict['umbrellaCopies'] n_steps_umbrella_measure = optionsDict['nStepsUmbrellaMeasure'] output_umbrella_measure_file_path = optionsDict['outputUmbrellaMeasureFilePath'] write_options_generic_umbrella(path, nSteps, nStepsInterval, nStepsWrite, nStepsBackupInterval, outPutFilePath, outPutFormat, boxX, boxY, boxZ, temperature, steepestDecentScale, nStepsSteepestDescent, nStepsSteepestDescentProgressInterval, maxObjectiveForce, timeStep, frictionConstant, cutOffDst, VerletListDst, dielectricConstant, debyeLength, inputCoordFile, inputTopFile, umbrellaK, umbrellaInit, umbrellaEnd, umbrellaWindowsNumber, umbrellaCopies, nStepsUmbrellaMeasure, outputUmbrellaMeasureFilePath)
def row_as_json(sqlite_row): """Return a dict from a sqlite_row.""" return { key: sqlite_row[key] for key in sqlite_row.keys() } def list_as_json(sqlite_rows): """Return a list of dicts from a list of sqlite_rows.""" return [ row_as_json(row) for row in sqlite_rows ]
def row_as_json(sqlite_row): """Return a dict from a sqlite_row.""" return {key: sqlite_row[key] for key in sqlite_row.keys()} def list_as_json(sqlite_rows): """Return a list of dicts from a list of sqlite_rows.""" return [row_as_json(row) for row in sqlite_rows]
N = int(input()) A = list(map(int, input().split())) t = len(set(A)) if (len(A) - t) % 2 == 0: print(t) else: print(t - 1)
n = int(input()) a = list(map(int, input().split())) t = len(set(A)) if (len(A) - t) % 2 == 0: print(t) else: print(t - 1)
#Tugas Cycom 0001 #converter suhu fahrenheit print ('selamat datang di converter fahrenheit') print('pilih jenis suhu yang ingin diubah ke dalam fahrenheit ') print('1.celcius') print('2.reamur') print('3.kelvin') while True: # Take input from the user choice = input("Masukan pilihan (1/2/3):") # input user dari pilihan di atas if choice == '1': # if user pick number 1. the program will start here Celc = float(input('tentukan angka celcius :')) CtoFahr = (9/5 * Celc) + 32 # rumus konversi suhu print(CtoFahr, 'fahrenheit') if choice == '2': Ream = float(input('tentukan angka reamur : ')) ReamToFahr = (9/4 * Ream) + 32 print(ReamToFahr, 'fahrenheit') if choice == '3': Kelv = float(input('tentukan angka kelvin : ')) KelvToFahr = float(Kelv - 273.15) * 9/5 + 32 print(KelvToFahr, 'fahrenheit') else: break # break mean end so after u input the numbers and got number output the script will end #notes for cycom members #kalo mau copas silahkan tapi ganti variable nya jadi suhu lain dulu
print('selamat datang di converter fahrenheit') print('pilih jenis suhu yang ingin diubah ke dalam fahrenheit ') print('1.celcius') print('2.reamur') print('3.kelvin') while True: choice = input('Masukan pilihan (1/2/3):') if choice == '1': celc = float(input('tentukan angka celcius :')) cto_fahr = 9 / 5 * Celc + 32 print(CtoFahr, 'fahrenheit') if choice == '2': ream = float(input('tentukan angka reamur : ')) ream_to_fahr = 9 / 4 * Ream + 32 print(ReamToFahr, 'fahrenheit') if choice == '3': kelv = float(input('tentukan angka kelvin : ')) kelv_to_fahr = float(Kelv - 273.15) * 9 / 5 + 32 print(KelvToFahr, 'fahrenheit') else: break
# coding: utf-8 # ... import symbolic tools glt_function = load('pyccel.symbolic.gelato', 'glt_function', True, 3) dx = load('pyccel.symbolic.gelato', 'dx', False, 1) dy = load('pyccel.symbolic.gelato', 'dy', False, 1) # ... # ... weak formulation laplace = lambda u,v: dx(u)*dx(v) + dy(u)*dy(v) a = lambda x,y,u,v: laplace(u,v) + 0.1 * dx(u) * v # ... # ... computing the glt symbol and lambdify it ga = glt_function(a, [4, 4], [2, 2]) g = lambdify(ga) # ... # glt symbol is supposed to be 'complex' in this example # TODO fix it. for the moment the symbol is always 'double' y = g(0.5, 0.5, 0.1, 0.3) # ... print(' a := ', a) print(' glt symbol := ', ga) print('') print(' symbol (0.5, 0.5, 0.1, 0.3) = ', y)
glt_function = load('pyccel.symbolic.gelato', 'glt_function', True, 3) dx = load('pyccel.symbolic.gelato', 'dx', False, 1) dy = load('pyccel.symbolic.gelato', 'dy', False, 1) laplace = lambda u, v: dx(u) * dx(v) + dy(u) * dy(v) a = lambda x, y, u, v: laplace(u, v) + 0.1 * dx(u) * v ga = glt_function(a, [4, 4], [2, 2]) g = lambdify(ga) y = g(0.5, 0.5, 0.1, 0.3) print(' a := ', a) print(' glt symbol := ', ga) print('') print(' symbol (0.5, 0.5, 0.1, 0.3) = ', y)
AUTHOR_FEMALE = { "Femina": [ "0009", "0051", "0054", "0197", "0220", "0244", "0294", "0372", "0509", "1213", "1355", "1493", "1572", "1814", "1828", "2703", "2766", ] }
author_female = {'Femina': ['0009', '0051', '0054', '0197', '0220', '0244', '0294', '0372', '0509', '1213', '1355', '1493', '1572', '1814', '1828', '2703', '2766']}
# For reference - not used directly yet def swap_key_values(): objs = cmds.ls(sl=True) a = objs[0] b = objs[1] atx = cmds.getAttr(a + '.tx') aty = cmds.getAttr(a + '.ty') atz = cmds.getAttr(a + '.tz') arx = cmds.getAttr(a + '.rx') ary = cmds.getAttr(a + '.ry') arz = cmds.getAttr(a + '.rz') btx = cmds.getAttr(b + '.tx') bty = cmds.getAttr(b + '.ty') btz = cmds.getAttr(b + '.tz') brx = cmds.getAttr(b + '.rx') bry = cmds.getAttr(b + '.ry') brz = cmds.getAttr(b + '.rz') cmds.setAttr(a + '.tx',btx) cmds.setAttr(a + '.ty',bty) cmds.setAttr(a + '.tz',btz) cmds.setAttr(a + '.rx',brx) cmds.setAttr(a + '.ry',bry) cmds.setAttr(a + '.rz',brz) cmds.setAttr(b + '.tx',atx) cmds.setAttr(b + '.ty',aty) cmds.setAttr(b + '.tz',atz) cmds.setAttr(b + '.rx',arx) cmds.setAttr(b + '.ry',ary) cmds.setAttr(b + '.rz',arz) print("Done key values swap")
def swap_key_values(): objs = cmds.ls(sl=True) a = objs[0] b = objs[1] atx = cmds.getAttr(a + '.tx') aty = cmds.getAttr(a + '.ty') atz = cmds.getAttr(a + '.tz') arx = cmds.getAttr(a + '.rx') ary = cmds.getAttr(a + '.ry') arz = cmds.getAttr(a + '.rz') btx = cmds.getAttr(b + '.tx') bty = cmds.getAttr(b + '.ty') btz = cmds.getAttr(b + '.tz') brx = cmds.getAttr(b + '.rx') bry = cmds.getAttr(b + '.ry') brz = cmds.getAttr(b + '.rz') cmds.setAttr(a + '.tx', btx) cmds.setAttr(a + '.ty', bty) cmds.setAttr(a + '.tz', btz) cmds.setAttr(a + '.rx', brx) cmds.setAttr(a + '.ry', bry) cmds.setAttr(a + '.rz', brz) cmds.setAttr(b + '.tx', atx) cmds.setAttr(b + '.ty', aty) cmds.setAttr(b + '.tz', atz) cmds.setAttr(b + '.rx', arx) cmds.setAttr(b + '.ry', ary) cmds.setAttr(b + '.rz', arz) print('Done key values swap')
class CanvasPoint: def __init__(self, z_index, color): self.z_index = z_index self.color = color
class Canvaspoint: def __init__(self, z_index, color): self.z_index = z_index self.color = color
""" Settings for unit test to connect to your JIRA instance """ SERVER='<JIRA instance URL>' USER='drehtuer@drehtuer.de' PASSWORD='<plain text password or None>' TOKEN='<access token or None>' """ Settings for test cases """ # jira_helper/JiraHelper.query TEST_QUERY_JQL='project=<your project>' TEST_QUERY_FIELDS=['created', 'updated'] # jira_helper/JiraHelper.worklog TEST_WORKLOG_ISSUE='<story>' TEST_WORKLOG_TIME='2h' TEST_WORKLOG_COMMENT='Test comment'
""" Settings for unit test to connect to your JIRA instance """ server = '<JIRA instance URL>' user = 'drehtuer@drehtuer.de' password = '<plain text password or None>' token = '<access token or None>' '\nSettings for test cases\n' test_query_jql = 'project=<your project>' test_query_fields = ['created', 'updated'] test_worklog_issue = '<story>' test_worklog_time = '2h' test_worklog_comment = 'Test comment'
# Copyright 2020 Ian Rankin # # Permission is hereby granted, free of charge, to any person obtaining a copy of this # software and associated documentation files (the "Software"), to deal in the Software # without restriction, including without limitation the rights to use, copy, modify, merge, # publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons # to whom the Software is furnished to do so, subject to the following conditions: # # The above copyright notice and this permission notice shall be included in all copies or # substantial portions of the Software. # # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, # INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR # PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE # FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR # OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER # DEALINGS IN THE SOFTWARE. ## @package Edge.py # Written Ian Rankin October 2019 # # Rather a directed edge, but called an edge for short. # Contains the basic implementation for an edge. # Particular designed to be extendable to allow different information to be # stored. #from rdml_graph.core import Node ## Rather a directed edge, but called an edge for short. # Contains the basic implementation for an edge. # Particular designed to be extendable to allow different information to be # stored. class Edge(object): ## constructor # Pass the parent and child nodes directly (not indcies) # @param parent - the parent Node of the edge # @param child - the child Node of the edge # @param cost - [opt] the cost of the edge. def __init__(self, parent, child, cost = 1.0): # should be handed the parent node directly. self.p = parent self.c = child # don't reference directly rather reference the getCost function. self.cost = cost ## @var p # the parent Node of the edge ## @var c # The child Node of the edge. ## @var cost # The cost of the Edge (use getCost function). ## get function for cost. # This shoud be called rather than directly referencing # in case the function is overloaded. def getCost(self): return self.cost ## checks if connecting id's are the same and cost is the same (could potentially) # have two different edges to the same two nodes. def __eq__(self, other): #return isinstance(other, Edge) and self.c.id == other.c.id and self.p.id == other.p.id \ # and self.cost() == other.cost() if isinstance(other, Edge): return self.c == other.c and self.p == other.p and self.cost() == other.cost() else: return False def __str__(self): s = 'e(' if hasattr(self.p, 'id'): s += 'p.id='+str(self.p.id) else: s += 'p='+str(self.p) if hasattr(self.c, 'id'): s += ',c.id='+str(self.c.id) else: s += ',c='+str(self.c) s += ',cost='+str(self.cost)+')' return s
class Edge(object): def __init__(self, parent, child, cost=1.0): self.p = parent self.c = child self.cost = cost def get_cost(self): return self.cost def __eq__(self, other): if isinstance(other, Edge): return self.c == other.c and self.p == other.p and (self.cost() == other.cost()) else: return False def __str__(self): s = 'e(' if hasattr(self.p, 'id'): s += 'p.id=' + str(self.p.id) else: s += 'p=' + str(self.p) if hasattr(self.c, 'id'): s += ',c.id=' + str(self.c.id) else: s += ',c=' + str(self.c) s += ',cost=' + str(self.cost) + ')' return s
IMAGES_STORE = 'C:\\' ITEM_PIPELINES = {'shoppon.spiders.planning.pipline.ImgPipeline': 1} DOWNLOADER_MIDDLEWARES = { 'scrapy_splash.SplashCookiesMiddleware': 723, 'scrapy_splash.SplashMiddleware': 725, 'scrapy.downloadermiddlewares.httpcompression.HttpCompressionMiddleware': 810, } SPLASH_URL = 'http://192.168.3.42:8050' DUPEFILTER_CLASS = 'scrapy_splash.SplashAwareDupeFilter' HTTPCACHE_STORAGE = 'scrapy_splash.SplashAwareFSCacheStorage'
images_store = 'C:\\' item_pipelines = {'shoppon.spiders.planning.pipline.ImgPipeline': 1} downloader_middlewares = {'scrapy_splash.SplashCookiesMiddleware': 723, 'scrapy_splash.SplashMiddleware': 725, 'scrapy.downloadermiddlewares.httpcompression.HttpCompressionMiddleware': 810} splash_url = 'http://192.168.3.42:8050' dupefilter_class = 'scrapy_splash.SplashAwareDupeFilter' httpcache_storage = 'scrapy_splash.SplashAwareFSCacheStorage'
class Solution: def flipAndInvertImage(self, matrix: list[list[int]]) -> list[list[int]]: if not matrix or len(matrix) == 0: return matrix for row in matrix: start, end = 0, len(row) - 1 while start < end: if row[start] == row[end]: row[start], row[end] = 1 - row[start], 1 - row[end] start += 1 end -= 1 if start == end: row[start] = 1 - row[start] return matrix if __name__ == "__main__": solution = Solution() print(solution.flipAndInvertImage([[1,1,0],[1,0,1],[0,0,0]])) print(solution.flipAndInvertImage([[1,1,0,0],[1,0,0,1],[0,1,1,1],[1,0,1,0]]))
class Solution: def flip_and_invert_image(self, matrix: list[list[int]]) -> list[list[int]]: if not matrix or len(matrix) == 0: return matrix for row in matrix: (start, end) = (0, len(row) - 1) while start < end: if row[start] == row[end]: (row[start], row[end]) = (1 - row[start], 1 - row[end]) start += 1 end -= 1 if start == end: row[start] = 1 - row[start] return matrix if __name__ == '__main__': solution = solution() print(solution.flipAndInvertImage([[1, 1, 0], [1, 0, 1], [0, 0, 0]])) print(solution.flipAndInvertImage([[1, 1, 0, 0], [1, 0, 0, 1], [0, 1, 1, 1], [1, 0, 1, 0]]))
class Colour: BOLD = '\033[1m' UNDERLINE = '\033[4m' END = '\033[0m' GRAY = '\033[90m' RED = '\033[91m' GREEN = '\033[92m' YELLOW = '\033[93m' BLUE = '\033[94m' PURPLE = '\033[95m' CYAN = '\033[96m' WHITE = '\033[97m' DARKGRAY = '\033[30m' DARKRED = '\033[31m' DARKGREEN = '\033[32m' DARKYELLOW = '\033[33m' DARKBLUE = '\033[34m' DARKPURPLE = '\033[35m' DARKCYAN = '\033[36m' DARKWHITE = '\033[37m' FULLDARKGRAY = '\033[40m' FULLDARKRED = '\033[41m' FULLDARKGREEN = '\033[42m' FULLDARKYELLOW = '\033[43m' FULLDARKBLUE = '\033[44m' FULLDARKPURPLE = '\033[45m' FULLDARKCYAN = '\033[46m' FULLDARKWHITE = '\033[47m' FULLGRAY = '\033[100m' FULLRED = '\033[101m' FULLGREEN = '\033[102m' FULLYELLOW = '\033[103m' FULLBLUE = '\033[104m' FULLPURPLE = '\033[105m' FULLCYAN = '\033[106m' FULLWHITE = '\033[107m' def print(mesage,colour=''): print(colour + mesage + Colour.END)
class Colour: bold = '\x1b[1m' underline = '\x1b[4m' end = '\x1b[0m' gray = '\x1b[90m' red = '\x1b[91m' green = '\x1b[92m' yellow = '\x1b[93m' blue = '\x1b[94m' purple = '\x1b[95m' cyan = '\x1b[96m' white = '\x1b[97m' darkgray = '\x1b[30m' darkred = '\x1b[31m' darkgreen = '\x1b[32m' darkyellow = '\x1b[33m' darkblue = '\x1b[34m' darkpurple = '\x1b[35m' darkcyan = '\x1b[36m' darkwhite = '\x1b[37m' fulldarkgray = '\x1b[40m' fulldarkred = '\x1b[41m' fulldarkgreen = '\x1b[42m' fulldarkyellow = '\x1b[43m' fulldarkblue = '\x1b[44m' fulldarkpurple = '\x1b[45m' fulldarkcyan = '\x1b[46m' fulldarkwhite = '\x1b[47m' fullgray = '\x1b[100m' fullred = '\x1b[101m' fullgreen = '\x1b[102m' fullyellow = '\x1b[103m' fullblue = '\x1b[104m' fullpurple = '\x1b[105m' fullcyan = '\x1b[106m' fullwhite = '\x1b[107m' def print(mesage, colour=''): print(colour + mesage + Colour.END)
# LC173 # Definition for a binary tree node. # class TreeNode: # def __init__(self, val=0, left=None, right=None): # self.val = val # self.left = left # self.right = right class BSTIterator: def __init__(self, root: TreeNode): if not root: False self.stack = [] self.dfsLeft(root) def dfsLeft(self, node): while node: self.stack.append(node) node = node.left def next(self) -> int: """ @return the next smallest number """ nextElem = self.stack.pop(-1) if nextElem.right: self.dfsLeft(nextElem.right) return nextElem.val def hasNext(self) -> bool: """ @return whether we have a next smallest number """ return len(self.stack) != 0 # Your BSTIterator object will be instantiated and called as such: # obj = BSTIterator(root) # param_1 = obj.next() # param_2 = obj.hasNext()
class Bstiterator: def __init__(self, root: TreeNode): if not root: False self.stack = [] self.dfsLeft(root) def dfs_left(self, node): while node: self.stack.append(node) node = node.left def next(self) -> int: """ @return the next smallest number """ next_elem = self.stack.pop(-1) if nextElem.right: self.dfsLeft(nextElem.right) return nextElem.val def has_next(self) -> bool: """ @return whether we have a next smallest number """ return len(self.stack) != 0
""" We are given a list of (axis-aligned) rectangles. Each rectangle[i] = [x1, y1, x2, y2] , where (x1, y1) are the coordinates of the bottom-left corner, and (x2, y2) are the coordinates of the top-right corner of the ith rectangle. Find the total area covered by all rectangles in the plane. Since the answer may be too large, return it modulo 10^9 + 7. Example 1: Input: [[0,0,2,2],[1,0,2,3],[1,0,3,1]] Output: 6 Explanation: As illustrated in the picture. Example 2: Input: [[0,0,1000000000,1000000000]] Output: 49 Explanation: The answer is 10^18 modulo (10^9 + 7), which is (10^9)^2 = (-7)^2 = 49. Note: 1 <= rectangles.length <= 200 rectanges[i].length = 4 0 <= rectangles[i][j] <= 10^9 The total area covered by all rectangles will never exceed 2^63 - 1 and thus will fit in a 64-bit signed integer. """ class Solution: def rectangleArea(self, rectangles): """ :type rectangles: List[List[int]] :rtype: int """ MOD = 10 ** 9 + 7 xs = set() for (x1, _, x2, _) in rectangles: xs.add(x1) xs.add(x2) xs = sorted(list(xs)) area = 0 for x1, x2 in zip(xs, xs[1:]): intervals = [(b, t) for l, b, r, t in rectangles if l <= x1 <= x2 <= r] if not intervals: continue intervals.sort() (st, en) = intervals[0] for s, e in intervals[1:]: if s > en: # new area += (x2 - x1) * (en - st) st, en = s, e else: en = max(en, e) area += (x2 - x1) * (en - st) return area % MOD sol = Solution().rectangleArea tests = [ (([[0, 0, 2, 2], [1, 0, 2, 3], [1, 0, 3, 1]],), 6), (([[0, 0, 1000000000, 1000000000]],), 49), ] for inputs, expect in tests: print(sol(*inputs), " ?= ", expect)
""" We are given a list of (axis-aligned) rectangles. Each rectangle[i] = [x1, y1, x2, y2] , where (x1, y1) are the coordinates of the bottom-left corner, and (x2, y2) are the coordinates of the top-right corner of the ith rectangle. Find the total area covered by all rectangles in the plane. Since the answer may be too large, return it modulo 10^9 + 7. Example 1: Input: [[0,0,2,2],[1,0,2,3],[1,0,3,1]] Output: 6 Explanation: As illustrated in the picture. Example 2: Input: [[0,0,1000000000,1000000000]] Output: 49 Explanation: The answer is 10^18 modulo (10^9 + 7), which is (10^9)^2 = (-7)^2 = 49. Note: 1 <= rectangles.length <= 200 rectanges[i].length = 4 0 <= rectangles[i][j] <= 10^9 The total area covered by all rectangles will never exceed 2^63 - 1 and thus will fit in a 64-bit signed integer. """ class Solution: def rectangle_area(self, rectangles): """ :type rectangles: List[List[int]] :rtype: int """ mod = 10 ** 9 + 7 xs = set() for (x1, _, x2, _) in rectangles: xs.add(x1) xs.add(x2) xs = sorted(list(xs)) area = 0 for (x1, x2) in zip(xs, xs[1:]): intervals = [(b, t) for (l, b, r, t) in rectangles if l <= x1 <= x2 <= r] if not intervals: continue intervals.sort() (st, en) = intervals[0] for (s, e) in intervals[1:]: if s > en: area += (x2 - x1) * (en - st) (st, en) = (s, e) else: en = max(en, e) area += (x2 - x1) * (en - st) return area % MOD sol = solution().rectangleArea tests = [(([[0, 0, 2, 2], [1, 0, 2, 3], [1, 0, 3, 1]],), 6), (([[0, 0, 1000000000, 1000000000]],), 49)] for (inputs, expect) in tests: print(sol(*inputs), ' ?= ', expect)
color_list = { "black": (0,0,0), "white": (255,255,255), "gray": (103, 110, 122), "sky_blue": (69, 224, 255), "red": (255, 0, 0), "green": (32, 212, 68), "blue": (0, 0, 255), "purple": (255, 0 ,255), "tan": (235, 218, 108), "orange": (200, 150, 0) }
color_list = {'black': (0, 0, 0), 'white': (255, 255, 255), 'gray': (103, 110, 122), 'sky_blue': (69, 224, 255), 'red': (255, 0, 0), 'green': (32, 212, 68), 'blue': (0, 0, 255), 'purple': (255, 0, 255), 'tan': (235, 218, 108), 'orange': (200, 150, 0)}
# -*- coding: utf-8 -*- """ The :mod:`.visualizations` module has several functions that support celloracle. """ #from .interactive_simulation_and_plot import Oracle_extended, DEFAULT_PARAMETERS #from .development_analysis import Oracle_development_module, subset_oracle_for_development_analysiis __all__ = []
""" The :mod:`.visualizations` module has several functions that support celloracle. """ __all__ = []
class CameraConfig: def __init__(self, name, server_port, camera_num): self.name = name self.server_port = server_port self.camera_num = camera_num
class Cameraconfig: def __init__(self, name, server_port, camera_num): self.name = name self.server_port = server_port self.camera_num = camera_num
pregdata = { 7 : "You need to have an ultrasound to determine the location of the pregnancy sac, size and vitality (heartbeat) of the fetus.", 8 : "You need to have an ultrasound to determine the location of the pregnancy sac, size and vitality (heartbeat) of the fetus.", 9 : "You need to have an ultrasound to determine the location of the pregnancy sac, size and vitality (heartbeat) of the fetus.", 10 : "You need to take the following test :Blood count, fasting glucose, urine culture, blood type (and RH antibodies level if negative), rubella antibodies, VDRL, CMV, antibodies, toxoplasma and HBsAG and if necessary an HIV test.", 11 : "You need to take the following test :Blood count, fasting glucose, urine culture, blood type (and RH antibodies level if negative), rubella antibodies, VDRL, CMV, antibodies, toxoplasma and HBsAG and if necessary an HIV test.", 12 : "Placental structure (chorionic placenta) and early chromosomal genetic diagnostic testing has to be done.", 13 : "Placental structure (chorionic placenta) and early chromosomal genetic diagnostic testing has to be done.", 14 : "You need have an ultrasound, nuchal translucency or fetal development test performed." , 15 : "Ultrasound screening exam needs to be done.", 16 : "Ultrasound screening exam needs to be done.", 17 : "Triple screen test, fetoprotein or amniocentesis and blood count has to be done.", 18 : "Triple screen test, fetoprotein or amniocentesis and blood count has to be done.", 19 : "Triple screen test, fetoprotein or amniocentesis and blood count has to be done.", 20 : "Triple screen test, fetoprotein or amniocentesis and blood count has to be done.", 21 : "Triple screen test, fetoprotein or amniocentesis and blood count has to be done.", 22 : "Late ultrasound anomaly scan has to be done.", 23 : "Late ultrasound anomaly scan has to be done.", 24 : "Late ultrasound anomaly scan has to be done.", 25 : "Late ultrasound anomaly scan has to be done.", 26 : "You need have glucose tolerance test, blood count and RH antibody levels for those with negative blood type.", 27 : "You need have glucose tolerance test, blood count and RH antibody levels for those with negative blood type.", 28 : "You need have a visit to the physician to discuss glucose test results and talk about receiving RH immune globulin if RH negative", 29 : "You need have a visit to the physician to discuss glucose test results and talk about receiving RH immune globulin if RH negative", 30 : "You need have a visit to the physician to discuss glucose test results and talk about receiving RH immune globulin if RH negative", 31 : "Review of fetal growth has to be now!", 32 : "Review of fetal growth has to be now!", 33 : "Follow-up visit has to be done.", 34 : "Weekly tracking of fetal growth weight needs to be done.", 35 : "Weekly tracking of fetal growth weight needs to be done.", 36 : "Weekly tracking of fetal growth weight needs to be done.", 37 : "Weekly tracking of fetal growth weight needs to be done.", 38 : "Weekly tracking of fetal growth weight needs to be done.", 39 : "Weekly tracking of fetal growth weight needs to be done.", 40 : "Follow-up with doctor, ultrasound, monitoring biophysical profile every 2-4 days should be done." } babydata = { 0 : "Baby's dose for BCG vaccine for the prevention of TB and bladder cancer, first dose of HEPB vaccine for the prevention of Hepatitis B and first dose for POLIOVIRUS vaccine for the prevention of polio is due.", 1 : "No vaccination is pending.", 2 : "No vaccination is pending.", 3 : "No vaccination is pending.", 4 : "Baby's second dose of HEPB vaccine for the prevention of Hepatitis B and second dose of POLIOVIRUS vaccine for the prevenion of polio is due.", 5 : "No vaccination is pending.", 6 : "Baby's first dose of DTP vaccine for the prevention of Dipther ia, Tetanus and Pertussis, first dose of Hib vaccine for the prevention of infections, first dose of PCV vaccine for the prevention of Pneumonia, first dose of RV vaccine for the prevention of Diarrhea is due.", 7 : "Baby's first dose of DTP vaccine for the prevention of Dipther ia, Tetanus and Pertussis, first dose of Hib vaccine for the prevention of infections, first dose of PCV vaccine for the prevention of Pneumonia, first dose of RV vaccine for the prevention of Diarrhea is due.", 8 : "Baby's third dose of POLIOVIRUS for the prevention of polio is due.", 9 : "Baby's third dose of POLIOVIRUS for the prevention of polio is due.", 10 :"Baby's second dose of DTP vaccine for the prevention of Dipther ia, Tetanus and Pertussis, second dose of Hib vaccine for the prevention of infections, second dose of PCV vaccine for the prevention of Pneumonia, second dose of RV vaccine for the prevention of Diarrhea is due.", 11 : "Baby's second dose of DTP vaccine for the prevention of Dipther ia, Tetanus and Pertussis, second dose of Hib vaccine for the prevention of infections, second dose of PCV vaccine for the prevention of Pneumonia, second dose of RV vaccine for the prevention of Diarrhea is due.", 12 : "Baby's third dose of HEPB vaccine for the prevention of Hepatitis B is due.", 13 : "Baby's third dose of HEPB vaccine for the prevention of Hepatitis B is due.", 14 : "Baby's third dose of DTP vaccine for the prevention of Dipther ia, Tetanus and Pertussis, third dose of Hib vaccine for the prevention of infections, third dose of PCV vaccine for the prevention of Pneumonia, third dose of RV vaccine for the prevention of Diarrhea is due.", 15 : "Baby's third dose of DTP vaccine for the prevention of Dipther ia, Tetanus and Pertussis, third dose of Hib vaccine for the prevention of infections, third dose of PCV vaccine for the prevention of Pneumonia, third dose of RV vaccine for the prevention of Diarrhea is due.", 16 : "Baby's third dose of DTP vaccine for the prevention of Dipther ia, Tetanus and Pertussis, third dose of Hib vaccine for the prevention of infections, third dose of PCV vaccine for the prevention of Pneumonia, third dose of RV vaccine for the prevention of Diarrhea is due.", 36 : "Baby's first dose of TYPHOID vaccine for the prevention of Typhoid fever and Diarrhea and first dose of MMR vaccine for the prevention of Mumps and Rubella is due.", 38 : "Baby's fourth dose of DTP vaccine for the prevention of Dipther ia, Tetanus and Pertussis, fourth dose of Hib vaccine for the prevention of infections, fourth dose of PCV vaccine for the prevention of Pneumonia is due.", 52 : "Baby's first dose of Varicella vaccine for the prevention of Chicken pox and HepA vaccine for the prevention of the Liver disease.", 55 : "Baby's second dose of MMR vaccine for the prevention of Measles, Mumps and Rubella and Varicella vaccine for the prevention of Chicken pox.", 58 : "Baby's second dose of HepA for the prevention of Liver disease is due.", 104 : "Baby's second dose of Typhoid vaccine for the prevention of Typhoid Fever and Diarrhea is due.", 364 : "Baby's Tdap vaccine for the prevention of the Dipther ia, tetanus, and pertuassis is due.", 468 : "Baby's dose of HPV vaccine for the prevention of cancer and warts is due.", }
pregdata = {7: 'You need to have an ultrasound to determine the location of the pregnancy sac, size and vitality (heartbeat) of the fetus.', 8: 'You need to have an ultrasound to determine the location of the pregnancy sac, size and vitality (heartbeat) of the fetus.', 9: 'You need to have an ultrasound to determine the location of the pregnancy sac, size and vitality (heartbeat) of the fetus.', 10: 'You need to take the following test :Blood count, fasting glucose, urine culture, blood type (and RH antibodies level if negative), rubella antibodies, VDRL, CMV, antibodies, toxoplasma and HBsAG and if necessary an HIV test.', 11: 'You need to take the following test :Blood count, fasting glucose, urine culture, blood type (and RH antibodies level if negative), rubella antibodies, VDRL, CMV, antibodies, toxoplasma and HBsAG and if necessary an HIV test.', 12: 'Placental structure (chorionic placenta) and early chromosomal genetic diagnostic testing has to be done.', 13: 'Placental structure (chorionic placenta) and early chromosomal genetic diagnostic testing has to be done.', 14: 'You need have an ultrasound, nuchal translucency or fetal development test performed.', 15: 'Ultrasound screening exam needs to be done.', 16: 'Ultrasound screening exam needs to be done.', 17: 'Triple screen test, fetoprotein or amniocentesis and blood count has to be done.', 18: 'Triple screen test, fetoprotein or amniocentesis and blood count has to be done.', 19: 'Triple screen test, fetoprotein or amniocentesis and blood count has to be done.', 20: 'Triple screen test, fetoprotein or amniocentesis and blood count has to be done.', 21: 'Triple screen test, fetoprotein or amniocentesis and blood count has to be done.', 22: 'Late ultrasound anomaly scan has to be done.', 23: 'Late ultrasound anomaly scan has to be done.', 24: 'Late ultrasound anomaly scan has to be done.', 25: 'Late ultrasound anomaly scan has to be done.', 26: 'You need have glucose tolerance test, blood count and RH antibody levels for those with negative blood type.', 27: 'You need have glucose tolerance test, blood count and RH antibody levels for those with negative blood type.', 28: 'You need have a visit to the physician to discuss glucose test results and talk about receiving RH immune globulin if RH negative', 29: 'You need have a visit to the physician to discuss glucose test results and talk about receiving RH immune globulin if RH negative', 30: 'You need have a visit to the physician to discuss glucose test results and talk about receiving RH immune globulin if RH negative', 31: 'Review of fetal growth has to be now!', 32: 'Review of fetal growth has to be now!', 33: 'Follow-up visit has to be done.', 34: 'Weekly tracking of fetal growth weight needs to be done.', 35: 'Weekly tracking of fetal growth weight needs to be done.', 36: 'Weekly tracking of fetal growth weight needs to be done.', 37: 'Weekly tracking of fetal growth weight needs to be done.', 38: 'Weekly tracking of fetal growth weight needs to be done.', 39: 'Weekly tracking of fetal growth weight needs to be done.', 40: 'Follow-up with doctor, ultrasound, monitoring biophysical profile every 2-4 days should be done.'} babydata = {0: "Baby's dose for BCG vaccine for the prevention of TB and bladder cancer, first dose of HEPB vaccine for the prevention of Hepatitis B and first dose for POLIOVIRUS vaccine for the prevention of polio is due.", 1: 'No vaccination is pending.', 2: 'No vaccination is pending.', 3: 'No vaccination is pending.', 4: "Baby's second dose of HEPB vaccine for the prevention of Hepatitis B and second dose of POLIOVIRUS vaccine for the prevenion of polio is due.", 5: 'No vaccination is pending.', 6: "Baby's first dose of DTP vaccine for the prevention of Dipther ia, Tetanus and Pertussis, first dose of Hib vaccine for the prevention of infections, first dose of PCV vaccine for the prevention of Pneumonia, first dose of RV vaccine for the prevention of Diarrhea is due.", 7: "Baby's first dose of DTP vaccine for the prevention of Dipther ia, Tetanus and Pertussis, first dose of Hib vaccine for the prevention of infections, first dose of PCV vaccine for the prevention of Pneumonia, first dose of RV vaccine for the prevention of Diarrhea is due.", 8: "Baby's third dose of POLIOVIRUS for the prevention of polio is due.", 9: "Baby's third dose of POLIOVIRUS for the prevention of polio is due.", 10: "Baby's second dose of DTP vaccine for the prevention of Dipther ia, Tetanus and Pertussis, second dose of Hib vaccine for the prevention of infections, second dose of PCV vaccine for the prevention of Pneumonia, second dose of RV vaccine for the prevention of Diarrhea is due.", 11: "Baby's second dose of DTP vaccine for the prevention of Dipther ia, Tetanus and Pertussis, second dose of Hib vaccine for the prevention of infections, second dose of PCV vaccine for the prevention of Pneumonia, second dose of RV vaccine for the prevention of Diarrhea is due.", 12: "Baby's third dose of HEPB vaccine for the prevention of Hepatitis B is due.", 13: "Baby's third dose of HEPB vaccine for the prevention of Hepatitis B is due.", 14: "Baby's third dose of DTP vaccine for the prevention of Dipther ia, Tetanus and Pertussis, third dose of Hib vaccine for the prevention of infections, third dose of PCV vaccine for the prevention of Pneumonia, third dose of RV vaccine for the prevention of Diarrhea is due.", 15: "Baby's third dose of DTP vaccine for the prevention of Dipther ia, Tetanus and Pertussis, third dose of Hib vaccine for the prevention of infections, third dose of PCV vaccine for the prevention of Pneumonia, third dose of RV vaccine for the prevention of Diarrhea is due.", 16: "Baby's third dose of DTP vaccine for the prevention of Dipther ia, Tetanus and Pertussis, third dose of Hib vaccine for the prevention of infections, third dose of PCV vaccine for the prevention of Pneumonia, third dose of RV vaccine for the prevention of Diarrhea is due.", 36: "Baby's first dose of TYPHOID vaccine for the prevention of Typhoid fever and Diarrhea and first dose of MMR vaccine for the prevention of Mumps and Rubella is due.", 38: "Baby's fourth dose of DTP vaccine for the prevention of Dipther ia, Tetanus and Pertussis, fourth dose of Hib vaccine for the prevention of infections, fourth dose of PCV vaccine for the prevention of Pneumonia is due.", 52: "Baby's first dose of Varicella vaccine for the prevention of Chicken pox and HepA vaccine for the prevention of the Liver disease.", 55: "Baby's second dose of MMR vaccine for the prevention of Measles, Mumps and Rubella and Varicella vaccine for the prevention of Chicken pox.", 58: "Baby's second dose of HepA for the prevention of Liver disease is due.", 104: "Baby's second dose of Typhoid vaccine for the prevention of Typhoid Fever and Diarrhea is due.", 364: "Baby's Tdap vaccine for the prevention of the Dipther ia, tetanus, and pertuassis is due.", 468: "Baby's dose of HPV vaccine for the prevention of cancer and warts is due."}
class Solution: def plusOne(self, digits): """ :type digits: List[int] :rtype: List[int] """ extra = 1 for i in range(len(digits)-1, -1, -1): digits[i] += extra extra = digits[i] // 10 digits[i] %= 10 if extra == 1: digits.insert(0, 1) return digits
class Solution: def plus_one(self, digits): """ :type digits: List[int] :rtype: List[int] """ extra = 1 for i in range(len(digits) - 1, -1, -1): digits[i] += extra extra = digits[i] // 10 digits[i] %= 10 if extra == 1: digits.insert(0, 1) return digits
a = 999 b = 999999999999999 b = 111 c = 3333333 c = 0000000 d = ieuwoidjfds
a = 999 b = 999999999999999 b = 111 c = 3333333 c = 0 d = ieuwoidjfds