content
stringlengths
7
1.05M
fixed_cases
stringlengths
1
1.28M
while True: a, b = map(int, input().split(" ")) if not a and not b: break print(a + b)
while True: (a, b) = map(int, input().split(' ')) if not a and (not b): break print(a + b)
class LetterFrequencyPair: def __init__(self, letter: str, frequency: int): self.letter: str = letter self.frequency: int = frequency def __str__(self): return '{}:{}'.format(self.letter, self.frequency) class HTreeNode: pass print(LetterFrequencyPair('A', 23))
class Letterfrequencypair: def __init__(self, letter: str, frequency: int): self.letter: str = letter self.frequency: int = frequency def __str__(self): return '{}:{}'.format(self.letter, self.frequency) class Htreenode: pass print(letter_frequency_pair('A', 23))
class HashMap: def __init__(self, size): self.array_size = size self.array = [None] * size def hash(self, key, count_collisions = 0): return sum(key.encode()) + count_collisions def compressor(self, hash_code): return hash_code % self.array_size def assign(self, key, value): chosen_index = self.compressor(self.hash(key)) current_array_value = self.array[chosen_index] if not current_array_value: self.array[chosen_index] = [key, value] else: if current_array_value[0] == key: self.array[chosen_index][1] = value else: number_of_collisions = 1 while current_array_value != key: new_hash_code = self.hash(key, number_of_collisions) new_array_index = self.compressor(new_hash_code) new_array_value = self.array[new_array_index] if not new_array_value: self.array[new_array_index] = [key, value] return if new_array_value[0] == key: new_array_value[1] = value return number_of_collisions += 1 def retrieve(self, key): potential_index = self.compressor(self.hash(key)) possible_return_value = self.array[potential_index] if not possible_return_value: return None else: if possible_return_value[0] == key: return possible_return_value[1] else: retrieval_collisions = 1 while possible_return_value[0] != key: new_hash_code = self.hash(key, retrieval_collisions) retrieving_array_index = self.compressor(new_hash_code) possible_return_value = self.array[retrieving_array_index] if not possible_return_value: return None if possible_return_value[0] == key: return possible_return_value[1] retrieval_collisions += 1 flower_definitions = [['begonia', 'cautiousness'], ['chrysanthemum', 'cheerfulness'], ['carnation', 'memories'], ['daisy', 'innocence'], ['hyacinth', 'playfulness'], ['lavender', 'devotion'], ['magnolia', 'dignity'], ['morning glory', 'unrequited love'], ['periwinkle', 'new friendship'], ['poppy', 'rest'], ['rose', 'love'], ['snapdragon', 'grace'], ['sunflower', 'longevity'], ['wisteria', 'good luck']] h = HashMap(len(flower_definitions)) for i in flower_definitions: h.assign(i[0], i[1]) print(h.retrieve("daisy")) print(h.retrieve("magnolia")) print(h.retrieve("carnation")) print(h.retrieve("morning glory"))
class Hashmap: def __init__(self, size): self.array_size = size self.array = [None] * size def hash(self, key, count_collisions=0): return sum(key.encode()) + count_collisions def compressor(self, hash_code): return hash_code % self.array_size def assign(self, key, value): chosen_index = self.compressor(self.hash(key)) current_array_value = self.array[chosen_index] if not current_array_value: self.array[chosen_index] = [key, value] elif current_array_value[0] == key: self.array[chosen_index][1] = value else: number_of_collisions = 1 while current_array_value != key: new_hash_code = self.hash(key, number_of_collisions) new_array_index = self.compressor(new_hash_code) new_array_value = self.array[new_array_index] if not new_array_value: self.array[new_array_index] = [key, value] return if new_array_value[0] == key: new_array_value[1] = value return number_of_collisions += 1 def retrieve(self, key): potential_index = self.compressor(self.hash(key)) possible_return_value = self.array[potential_index] if not possible_return_value: return None elif possible_return_value[0] == key: return possible_return_value[1] else: retrieval_collisions = 1 while possible_return_value[0] != key: new_hash_code = self.hash(key, retrieval_collisions) retrieving_array_index = self.compressor(new_hash_code) possible_return_value = self.array[retrieving_array_index] if not possible_return_value: return None if possible_return_value[0] == key: return possible_return_value[1] retrieval_collisions += 1 flower_definitions = [['begonia', 'cautiousness'], ['chrysanthemum', 'cheerfulness'], ['carnation', 'memories'], ['daisy', 'innocence'], ['hyacinth', 'playfulness'], ['lavender', 'devotion'], ['magnolia', 'dignity'], ['morning glory', 'unrequited love'], ['periwinkle', 'new friendship'], ['poppy', 'rest'], ['rose', 'love'], ['snapdragon', 'grace'], ['sunflower', 'longevity'], ['wisteria', 'good luck']] h = hash_map(len(flower_definitions)) for i in flower_definitions: h.assign(i[0], i[1]) print(h.retrieve('daisy')) print(h.retrieve('magnolia')) print(h.retrieve('carnation')) print(h.retrieve('morning glory'))
def solution(n): n = str(n) if len(n) % 2 != 0: return False n = list(n) a,b = n[:len(n)//2], n[len(n)//2:] a,b = list(map(int, a)), list(map(int, b)) return sum(a) == sum(b)
def solution(n): n = str(n) if len(n) % 2 != 0: return False n = list(n) (a, b) = (n[:len(n) // 2], n[len(n) // 2:]) (a, b) = (list(map(int, a)), list(map(int, b))) return sum(a) == sum(b)
def main(): while True: userinput = input("Write something (quit ends): ") if(userinput == "quit"): break else: tester(userinput) def tester(givenstring="Too short"): if(len(givenstring) < 10): print("Too short") else: print(givenstring) if __name__ == "__main__": main()
def main(): while True: userinput = input('Write something (quit ends): ') if userinput == 'quit': break else: tester(userinput) def tester(givenstring='Too short'): if len(givenstring) < 10: print('Too short') else: print(givenstring) if __name__ == '__main__': main()
df = pd.read_csv(DATA, delimiter=';') df[['EV1', 'EV2', 'EV3']] = df['Participants'].str.split(', ', expand=True) df['Duration'] = pd.to_timedelta(df['Duration']) result = (pd.concat([ df[['EV1', 'Duration']].rename(columns={'EV1': 'Astronaut'}), df[['EV2', 'Duration']].rename(columns={'EV2': 'Astronaut'}), df[['EV3', 'Duration']].rename(columns={'EV3': 'Astronaut'}) ], axis='rows') .groupby('Astronaut') .sum() .sort_values('Duration', ascending=False))
df = pd.read_csv(DATA, delimiter=';') df[['EV1', 'EV2', 'EV3']] = df['Participants'].str.split(', ', expand=True) df['Duration'] = pd.to_timedelta(df['Duration']) result = pd.concat([df[['EV1', 'Duration']].rename(columns={'EV1': 'Astronaut'}), df[['EV2', 'Duration']].rename(columns={'EV2': 'Astronaut'}), df[['EV3', 'Duration']].rename(columns={'EV3': 'Astronaut'})], axis='rows').groupby('Astronaut').sum().sort_values('Duration', ascending=False)
class Solution: def hasValidPath(self, grid): def dfs(x, y, d): if x == m or y == n: return True if grid[x][y] == 1: if d == 1: return dfs(x, y + 1, d) elif d == 3: return dfs(x, y - 1, d) elif grid[x][y] == 2: if d == 0: return dfs(x + 1, y, d) elif d == 2: return dfs(x - 1, y, d) elif grid[x][y] == 3: if d == 1: return dfs(x + 1, y, 0) elif d == 2: return dfs(x, y - 1, 3) elif grid[x][y] == 4: if d == 3: return dfs(x + 1, y, 0) elif d == 2: return dfs(x, y + 1, 1) elif grid[x][y] == 5: if d == 1: return dfs(x - 1, y, 2) elif d == 0: return dfs(x, y - 1, 3) elif grid[x][y] == 6: if d == 3: return dfs(x - 1, y, 2) elif d == 0: return dfs(x, y + 1, 1) return False m, n = len(grid), len(grid[0]) if m == 1 and n == 1: return True elif grid[0][0] == 5: return False elif grid[0][0] in [1, 6]: return n >= 2 and dfs(0, 1, 1) elif grid[0][0] in [2, 3]: return m >= 2 and dfs(1, 0, 0) elif grid[0][0] == 4: return n >= 2 and dfs(0, 1, 1) or m >= 1 and dfs(1, 0, 0)
class Solution: def has_valid_path(self, grid): def dfs(x, y, d): if x == m or y == n: return True if grid[x][y] == 1: if d == 1: return dfs(x, y + 1, d) elif d == 3: return dfs(x, y - 1, d) elif grid[x][y] == 2: if d == 0: return dfs(x + 1, y, d) elif d == 2: return dfs(x - 1, y, d) elif grid[x][y] == 3: if d == 1: return dfs(x + 1, y, 0) elif d == 2: return dfs(x, y - 1, 3) elif grid[x][y] == 4: if d == 3: return dfs(x + 1, y, 0) elif d == 2: return dfs(x, y + 1, 1) elif grid[x][y] == 5: if d == 1: return dfs(x - 1, y, 2) elif d == 0: return dfs(x, y - 1, 3) elif grid[x][y] == 6: if d == 3: return dfs(x - 1, y, 2) elif d == 0: return dfs(x, y + 1, 1) return False (m, n) = (len(grid), len(grid[0])) if m == 1 and n == 1: return True elif grid[0][0] == 5: return False elif grid[0][0] in [1, 6]: return n >= 2 and dfs(0, 1, 1) elif grid[0][0] in [2, 3]: return m >= 2 and dfs(1, 0, 0) elif grid[0][0] == 4: return n >= 2 and dfs(0, 1, 1) or (m >= 1 and dfs(1, 0, 0))
class fabrica: def __init__(self, tiempo, nombre, ruedas): self.tiempo = tiempo self.nombre = nombre self.ruedas = ruedas print("se creo el auto", self.nombre) def __str__(self): return "{}({})".format(self.nombre, self.tiempo) class listado: # autos = []# lista que contiene lso datos def __init__(self,autos=[]): # constructor self.autos = autos def agregar(self, obj): self.autos.append(obj) # agrego obj def mirar(self): for obj in self.autos: print(obj) a = fabrica(20, "automovil",4) # clase listado l = listado([a]) l.mirar() l.agregar(fabrica(123,"segundo",4)) l.mirar()
class Fabrica: def __init__(self, tiempo, nombre, ruedas): self.tiempo = tiempo self.nombre = nombre self.ruedas = ruedas print('se creo el auto', self.nombre) def __str__(self): return '{}({})'.format(self.nombre, self.tiempo) class Listado: autos = [] def __init__(self, autos=[]): self.autos = autos def agregar(self, obj): self.autos.append(obj) def mirar(self): for obj in self.autos: print(obj) a = fabrica(20, 'automovil', 4) l = listado([a]) l.mirar() l.agregar(fabrica(123, 'segundo', 4)) l.mirar()
n1 = int(input('digite um valor: ')) n2 = int(input('digite outro valor: ')) s = n1 + n2 m = n1 * n2 p = n1 ** n2 print(f'a soma vale {s}, a mult vale {m}, e a potencia vale {p}', end=', ') print('testando end')
n1 = int(input('digite um valor: ')) n2 = int(input('digite outro valor: ')) s = n1 + n2 m = n1 * n2 p = n1 ** n2 print(f'a soma vale {s}, a mult vale {m}, e a potencia vale {p}', end=', ') print('testando end')
file_name = 'data/PacMan.png' reader = itk.ImageFileReader.New(FileName=file_name) smoother = itk.RecursiveGaussianImageFilter.New(Input=reader.GetOutput()) smoother.SetSigma(5.0) smoother.Update() view(smoother.GetOutput(), ui_collapsed=True)
file_name = 'data/PacMan.png' reader = itk.ImageFileReader.New(FileName=file_name) smoother = itk.RecursiveGaussianImageFilter.New(Input=reader.GetOutput()) smoother.SetSigma(5.0) smoother.Update() view(smoother.GetOutput(), ui_collapsed=True)
# -*- coding: utf-8 -*- __all__ = ['Microblog', 'MICROBLOG_SESSION_PROFILE'] MICROBLOG_SESSION_PROFILE = 'mic_profile_session' class Microblog(object): def __init__(self): self.profile = None
__all__ = ['Microblog', 'MICROBLOG_SESSION_PROFILE'] microblog_session_profile = 'mic_profile_session' class Microblog(object): def __init__(self): self.profile = None
# https://leetcode.com/problems/binary-tree-postorder-traversal/ # Definition for a binary tree node. # class TreeNode: # def __init__(self, val=0, left=None, right=None): # self.val = val # self.left = left # self.right = right class Solution: # DFS def postorderTraversal(self, root: TreeNode) -> List[int]: stack, res = [root], [] while stack: node = stack.pop() if node: res.append(node.val) stack.append(node.left) stack.append(node.right) return res[::-1] class Solution: # Visited flag def postorderTraversal(self, root: TreeNode) -> List[int]: traversal, stack = [], [(root, False)] while stack: node, visited = stack.pop() if node: if visited: traversal.append(node.val) else: stack.append((node, True)) stack.append((node.right, False)) stack.append((node.left, False)) return traversal def postorderTraversal1(self, root): # recursively res = [] self.dfs(root, res) return res def dfs(self, root, res): if root: self.dfs(root.left, res) self.dfs(root.right, res) res.append(root.val)
class Solution: def postorder_traversal(self, root: TreeNode) -> List[int]: (stack, res) = ([root], []) while stack: node = stack.pop() if node: res.append(node.val) stack.append(node.left) stack.append(node.right) return res[::-1] class Solution: def postorder_traversal(self, root: TreeNode) -> List[int]: (traversal, stack) = ([], [(root, False)]) while stack: (node, visited) = stack.pop() if node: if visited: traversal.append(node.val) else: stack.append((node, True)) stack.append((node.right, False)) stack.append((node.left, False)) return traversal def postorder_traversal1(self, root): res = [] self.dfs(root, res) return res def dfs(self, root, res): if root: self.dfs(root.left, res) self.dfs(root.right, res) res.append(root.val)
class Node(object): def __init__(self, data): self.data = data self.next = None def push(head, data): node = Node(data) node.next = head return node def build_one_two_three(): return push(push(Node(3), 2), 1)
class Node(object): def __init__(self, data): self.data = data self.next = None def push(head, data): node = node(data) node.next = head return node def build_one_two_three(): return push(push(node(3), 2), 1)
string = "a" * ITERATIONS # --- for char in string: pass
string = 'a' * ITERATIONS for char in string: pass
# Tool Types BRACKEN = 'bracken_abundance_estimation' KRAKEN = 'kraken_taxonomy_profiling' KRAKENHLL = 'krakenhll_taxonomy_profiling' METAPHLAN2 = 'metaphlan2_taxonomy_profiling' HMP_SITES = 'hmp_site_dists' MICROBE_CENSUS = 'microbe_census' AMR_GENES = 'align_to_amr_genes' RESISTOME_AMRS = 'resistome_amrs' READ_CLASS_PROPS = 'read_classification_proportions' READ_STATS = 'read_stats' MICROBE_DIRECTORY = 'microbe_directory_annotate' ALPHA_DIVERSITY = 'alpha_diversity_stats' BETA_DIVERSITY = 'beta_diversity_stats' HUMANN2 = 'humann2_functional_profiling' HUMANN2_NORMALIZED = 'humann2_normalize_genes' METHYLS = 'align_to_methyltransferases' VFDB = 'vfdb_quantify' MACROBES = 'quantify_macrobial' ANCESTRY = 'human_ancestry'
bracken = 'bracken_abundance_estimation' kraken = 'kraken_taxonomy_profiling' krakenhll = 'krakenhll_taxonomy_profiling' metaphlan2 = 'metaphlan2_taxonomy_profiling' hmp_sites = 'hmp_site_dists' microbe_census = 'microbe_census' amr_genes = 'align_to_amr_genes' resistome_amrs = 'resistome_amrs' read_class_props = 'read_classification_proportions' read_stats = 'read_stats' microbe_directory = 'microbe_directory_annotate' alpha_diversity = 'alpha_diversity_stats' beta_diversity = 'beta_diversity_stats' humann2 = 'humann2_functional_profiling' humann2_normalized = 'humann2_normalize_genes' methyls = 'align_to_methyltransferases' vfdb = 'vfdb_quantify' macrobes = 'quantify_macrobial' ancestry = 'human_ancestry'
def predict(x_test, model): # predict y_pred = model.predict(x_test) y_pred_scores = model.predict_proba(x_test) return y_pred, y_pred_scores
def predict(x_test, model): y_pred = model.predict(x_test) y_pred_scores = model.predict_proba(x_test) return (y_pred, y_pred_scores)
r = [int (r) for r in input().split()] renas = ['Rudolph','Dasher','Dancer','Prancer','Vixen','Comet','Cupid','Donner','Blitzen'] b = 0 for s in range(len(r)): b = b + r[s] resto = b%9 for t in range(0,9): if resto == t: print(renas[t])
r = [int(r) for r in input().split()] renas = ['Rudolph', 'Dasher', 'Dancer', 'Prancer', 'Vixen', 'Comet', 'Cupid', 'Donner', 'Blitzen'] b = 0 for s in range(len(r)): b = b + r[s] resto = b % 9 for t in range(0, 9): if resto == t: print(renas[t])
# This exercise should be done in Jupyter and in the interpreter # Print your name print('My name is Anne.')
print('My name is Anne.')
n = input() while len(n) > 1: x = 1 for c in n: if c != '0': x *= int(c) n = str(x) print(n)
n = input() while len(n) > 1: x = 1 for c in n: if c != '0': x *= int(c) n = str(x) print(n)
# from the paper `using cython to speedup numerical python programs' #pythran export timeloop(float, float, float, float, float, float list list, float list list, float list list) #pythran export timeloop(float, float, float, float, float, int list list, int list list, int list list) #bench A=[list(range(70)) for i in range(100)] ; B=[list(range(70)) for i in range(100)] ; C=[list(range(70)) for i in range(100)] ; timeloop(1.,2.,.01,.1,.18, A,B,C ) #runas A=[list(range(10)) for i in range(5)] ; B=[list(range(10)) for i in range(5)] ; C=[list(range(10)) for i in range(5)] ; timeloop(1.,2.,.1,.1,.2, A,B,C ) def timeloop(t, t_stop, dt, dx, dy, u, um, k): while t <= t_stop: t += dt new_u = calculate_u(dt, dx, dy, u, um, k) um = u u = new_u return u def calculate_u(dt, dx, dy, u, um, k): up = [ [0.]*len(u[0]) for i in range(len(u)) ] "omp parallel for" for i in range(1, len(u)-1): for j in range(1, len(u[0])-1): up[i][j] = 2*u[i][j] - um[i][j] + \ (dt/dx)**2*( (0.5*(k[i+1][j] + k[i][j])*(u[i+1][j] - u[i][j]) - 0.5*(k[i][j] + k[i-1][j])*(u[i][j] - u[i-1][j]))) + \ (dt/dy)**2*( (0.5*(k[i][j+1] + k[i][j])*(u[i][j+1] - u[i][j]) - 0.5*(k[i][j] + k[i][j-1])*(u[i][j] - u[i][j-1]))) return up
def timeloop(t, t_stop, dt, dx, dy, u, um, k): while t <= t_stop: t += dt new_u = calculate_u(dt, dx, dy, u, um, k) um = u u = new_u return u def calculate_u(dt, dx, dy, u, um, k): up = [[0.0] * len(u[0]) for i in range(len(u))] 'omp parallel for' for i in range(1, len(u) - 1): for j in range(1, len(u[0]) - 1): up[i][j] = 2 * u[i][j] - um[i][j] + (dt / dx) ** 2 * (0.5 * (k[i + 1][j] + k[i][j]) * (u[i + 1][j] - u[i][j]) - 0.5 * (k[i][j] + k[i - 1][j]) * (u[i][j] - u[i - 1][j])) + (dt / dy) ** 2 * (0.5 * (k[i][j + 1] + k[i][j]) * (u[i][j + 1] - u[i][j]) - 0.5 * (k[i][j] + k[i][j - 1]) * (u[i][j] - u[i][j - 1])) return up
#Python task list example taskList = [] def commander(): print("\na to add, s to show list, q to quit") commandOrder = input("Command --> ") if commandOrder == "a": addTasks() if commandOrder == "s": printTasklist() if commandOrder == "q": print("Bye Bye Friend....") def addTasks(): print("Please enter a task (Q to stop adding):") while True: newTask = input("Task --> ") if str.lower(newTask) == "q": commander() taskList.append(newTask) def printTasklist(): print("\n\nTasklist:") print("----------------------------") taskCounter = 0 for task in taskList: taskCounter += 1 print(f"#{taskCounter} {task.title()}") commander() #program starts running here print("Python Tasklist v 1.0\n") commander()
task_list = [] def commander(): print('\na to add, s to show list, q to quit') command_order = input('Command --> ') if commandOrder == 'a': add_tasks() if commandOrder == 's': print_tasklist() if commandOrder == 'q': print('Bye Bye Friend....') def add_tasks(): print('Please enter a task (Q to stop adding):') while True: new_task = input('Task --> ') if str.lower(newTask) == 'q': commander() taskList.append(newTask) def print_tasklist(): print('\n\nTasklist:') print('----------------------------') task_counter = 0 for task in taskList: task_counter += 1 print(f'#{taskCounter} {task.title()}') commander() print('Python Tasklist v 1.0\n') commander()
class C: def m1(self): pass # <editor-fold desc="Description"> def m2(self): pass def m3(self): pass # </editor-fold>
class C: def m1(self): pass def m2(self): pass def m3(self): pass
''' Created on Aug 14, 2016 @author: rafacarv '''
""" Created on Aug 14, 2016 @author: rafacarv """
class CBWGroup(object): def __init__(self, id="", name="", created_at="", updated_at=""): self.group_id = id self.name = name self.created_at = created_at self.updated_at = updated_at
class Cbwgroup(object): def __init__(self, id='', name='', created_at='', updated_at=''): self.group_id = id self.name = name self.created_at = created_at self.updated_at = updated_at
def print_board(data, board): snake_index = 0 for snake in board['snakes']: if (snake['id'] == data['you']['id']): break snake_index += 1 print("My snake: " + str(snake_index)) for i in range(board['height'] - 1, -1, -1): for j in range(0, board['width'], 1): found_snake = False for k in range(len(board['snakes'])): #head if ({'x': j, 'y': i} == board['snakes'][k]['body'][0]): print(str(k), end =">") found_snake = True break #tail elif ({'x': j, 'y': i} == board['snakes'][k]['body'][len(board['snakes'][k]['body']) - 1]): print(str(k), end =")") found_snake = True break #body elif ({'x': j, 'y': i} in board['snakes'][k]['body']): print(str(k), end =" ") found_snake = True break if (found_snake): continue if ({'x': j, 'y': i} in board['food']): print("$", end =" ") else: print("-", end =" ") print(" ")
def print_board(data, board): snake_index = 0 for snake in board['snakes']: if snake['id'] == data['you']['id']: break snake_index += 1 print('My snake: ' + str(snake_index)) for i in range(board['height'] - 1, -1, -1): for j in range(0, board['width'], 1): found_snake = False for k in range(len(board['snakes'])): if {'x': j, 'y': i} == board['snakes'][k]['body'][0]: print(str(k), end='>') found_snake = True break elif {'x': j, 'y': i} == board['snakes'][k]['body'][len(board['snakes'][k]['body']) - 1]: print(str(k), end=')') found_snake = True break elif {'x': j, 'y': i} in board['snakes'][k]['body']: print(str(k), end=' ') found_snake = True break if found_snake: continue if {'x': j, 'y': i} in board['food']: print('$', end=' ') else: print('-', end=' ') print(' ')
# automatically generated by the FlatBuffers compiler, do not modify # namespace: class Value(object): NONE = 0 boolean = 1 i8 = 2 u8 = 3 i16 = 4 u16 = 5 i32 = 6 u32 = 7 i64 = 8 u64 = 9 f32 = 10 f64 = 11 str = 12 str_list = 13 int32_list = 14 float_list = 15 bin = 16
class Value(object): none = 0 boolean = 1 i8 = 2 u8 = 3 i16 = 4 u16 = 5 i32 = 6 u32 = 7 i64 = 8 u64 = 9 f32 = 10 f64 = 11 str = 12 str_list = 13 int32_list = 14 float_list = 15 bin = 16
l = [1,2,3] assert 1 in l assert 5 not in l d = {1:2} assert 1 in d assert 2 not in d d[2] = d assert 2 in d print("ok")
l = [1, 2, 3] assert 1 in l assert 5 not in l d = {1: 2} assert 1 in d assert 2 not in d d[2] = d assert 2 in d print('ok')
def encode(message, rails): period = 2 * rails - 2 rows = [[] for _ in range(rails)] for i, c in enumerate(message): rows[min(i % period, period - i % period)].append(c) return ''.join(''.join(row) for row in rows) def decode(encoded_message, rails): period = 2 * rails - 2 rows_size = [0] * rails rows = [] text = [] for i in range(len(encoded_message)): rows_size[min(i % period, period - i % period)] += 1 encoded_message = iter(encoded_message) for size in rows_size: rows.append([next(encoded_message) for _ in range(size)][::-1]) for i in range(sum(rows_size)): text.append(rows[min(i % period, period - i % period)].pop()) return ''.join(text)
def encode(message, rails): period = 2 * rails - 2 rows = [[] for _ in range(rails)] for (i, c) in enumerate(message): rows[min(i % period, period - i % period)].append(c) return ''.join((''.join(row) for row in rows)) def decode(encoded_message, rails): period = 2 * rails - 2 rows_size = [0] * rails rows = [] text = [] for i in range(len(encoded_message)): rows_size[min(i % period, period - i % period)] += 1 encoded_message = iter(encoded_message) for size in rows_size: rows.append([next(encoded_message) for _ in range(size)][::-1]) for i in range(sum(rows_size)): text.append(rows[min(i % period, period - i % period)].pop()) return ''.join(text)
__author__ = 'Kalyan' notes = ''' 1. Read instructions for each function carefully. 2. Feel free to create new functions if needed. Give good names! 3. Use builtins and datatypes that we have seen so far. 4. If something about the function spec is not clear, use the corresponding test for clarification. 5. Many python builtin functions allow you to pass functions to customize their behavior. This makes it very productive to get things done in python. ''' # Given a list of age, height of various people [(name, years, cms), .... ]. Sort them in decreasing by age and increasing by height. # NOTE: define a function and pass it to the builtin sort function (key) to get this done, don't do your own sort. # Do the sort in-place (ie) don't create new lists. def custom_sort(input): if(input==None): return None if(input==[]): return [] else: input.sort(key=get_data) input.sort(key=get_age,reverse=True) pass def single_custom_sort_test(input, expected): custom_sort(input) # sorts in place assert input == expected def test_custom_sort(): # boundary cases single_custom_sort_test(None, None) single_custom_sort_test([], []) # no collisions single_custom_sort_test( [("Ram", 25, 160), ("Shyam", 30, 162), ("Sita", 15, 130)], [("Shyam", 30, 162), ("Ram", 25, 160), ("Sita", 15, 130)]) # collisions in age single_custom_sort_test( [("Ram", 25, 165), ("Shyam", 30, 162), ("Ravi", 25, 160), ("Gita", 30, 140)], [("Gita", 30, 140), ("Shyam", 30, 162), ("Ravi", 25, 160), ("Ram", 25, 165)]) # collisions in age and height, then initial order is maintained in stable sorts. single_custom_sort_test( [("Ram", 25, 165), ("Shyam", 30, 140), ("Ravi", 25, 165), ("Gita", 30, 140)], [("Shyam", 30, 140), ("Gita", 30, 140), ("Ram", 25, 165), ("Ravi", 25, 165)]) VOWELS = set("aeiou") # returns the word with the maximum number of vowels, in case of tie return # the word which occurs first. Use the builtin max function and pass a key func to get this done. def max_vowels(words): max=0 if (words==[]or words== None): return None else: k=words[0] for i in words: x=set(i)& VOWELS if(len(x)>max): max=len(x) k=i return k pass def test_max_vowels(): assert None == max_vowels(None) assert None == max_vowels([]) assert "hello" == max_vowels(["hello", "pot", "gut", "sit"]) assert "engine" == max_vowels(["engine", "hello", "pot", "gut", "sit"]) assert "automobile" == max_vowels(["engine", "hello", "pot", "gut", "sit", "automobile"]) assert "fly" == max_vowels(["fly", "pry", "ply"]) def get_data(o): return o[2] def get_age(o): return o[1]
__author__ = 'Kalyan' notes = '\n1. Read instructions for each function carefully.\n2. Feel free to create new functions if needed. Give good names!\n3. Use builtins and datatypes that we have seen so far.\n4. If something about the function spec is not clear, use the corresponding test\n for clarification.\n5. Many python builtin functions allow you to pass functions to customize their behavior. This makes it very productive\n to get things done in python.\n' def custom_sort(input): if input == None: return None if input == []: return [] else: input.sort(key=get_data) input.sort(key=get_age, reverse=True) pass def single_custom_sort_test(input, expected): custom_sort(input) assert input == expected def test_custom_sort(): single_custom_sort_test(None, None) single_custom_sort_test([], []) single_custom_sort_test([('Ram', 25, 160), ('Shyam', 30, 162), ('Sita', 15, 130)], [('Shyam', 30, 162), ('Ram', 25, 160), ('Sita', 15, 130)]) single_custom_sort_test([('Ram', 25, 165), ('Shyam', 30, 162), ('Ravi', 25, 160), ('Gita', 30, 140)], [('Gita', 30, 140), ('Shyam', 30, 162), ('Ravi', 25, 160), ('Ram', 25, 165)]) single_custom_sort_test([('Ram', 25, 165), ('Shyam', 30, 140), ('Ravi', 25, 165), ('Gita', 30, 140)], [('Shyam', 30, 140), ('Gita', 30, 140), ('Ram', 25, 165), ('Ravi', 25, 165)]) vowels = set('aeiou') def max_vowels(words): max = 0 if words == [] or words == None: return None else: k = words[0] for i in words: x = set(i) & VOWELS if len(x) > max: max = len(x) k = i return k pass def test_max_vowels(): assert None == max_vowels(None) assert None == max_vowels([]) assert 'hello' == max_vowels(['hello', 'pot', 'gut', 'sit']) assert 'engine' == max_vowels(['engine', 'hello', 'pot', 'gut', 'sit']) assert 'automobile' == max_vowels(['engine', 'hello', 'pot', 'gut', 'sit', 'automobile']) assert 'fly' == max_vowels(['fly', 'pry', 'ply']) def get_data(o): return o[2] def get_age(o): return o[1]
a1 = b'\x02' b1 = 'AB' c1 = 'EF' c2 = None d1 = b'\x03' bb = a1 + bytes(b1.encode()) + bytes(c1.encode()) + d1 bb2 = a1 + bytes(b1.encode()) + bytes(c2.encode()) + d1 print(type(bb), bb)
a1 = b'\x02' b1 = 'AB' c1 = 'EF' c2 = None d1 = b'\x03' bb = a1 + bytes(b1.encode()) + bytes(c1.encode()) + d1 bb2 = a1 + bytes(b1.encode()) + bytes(c2.encode()) + d1 print(type(bb), bb)
class Solution: def reverseBits(self, n: int) -> int: # we can take the last bit of "n" by doing "n % 2" # and shift the "n" to the right # then we paste the last bit to the first bit of "res" # by using `|` operation # Take 0101 as an example: # 0010 (1) => 1 000 # 0001 (0) => 10 00 # 0000 (1) => 101 0 # 0000 (0) => 1010 res = 0 for i in range(32): bit = n % 2 n >>= 1 # res += 2 ** (31-i) if bit else 0 res |= bit << (31-i) return res
class Solution: def reverse_bits(self, n: int) -> int: res = 0 for i in range(32): bit = n % 2 n >>= 1 res |= bit << 31 - i return res
"Create maps with OpenStreetMap layers in a minute and embed them in your site." VERSION = (1, 0, 0) __author__ = 'Yohan Boniface' __contact__ = "[email protected]" __homepage__ = "https://github.com/umap-project/umap" __version__ = ".".join(map(str, VERSION))
"""Create maps with OpenStreetMap layers in a minute and embed them in your site.""" version = (1, 0, 0) __author__ = 'Yohan Boniface' __contact__ = '[email protected]' __homepage__ = 'https://github.com/umap-project/umap' __version__ = '.'.join(map(str, VERSION))
#!/user/bin/env python '''structureToPolymerSequences.py: This mapper maps a structure to it's polypeptides, polynucleotide chain sequences. For a multi-model structure, only the first model is considered. ''' __author__ = "Mars (Shih-Cheng) Huang" __maintainer__ = "Mars (Shih-Cheng) Huang" __email__ = "[email protected]" __version__ = "0.2.0" __status__ = "Done" class StructureToPolymerSequences(object): '''This mapper maps a structure to it's polypeptides, polynucleotide chain sequences. For a multi-model structure, only the first model is considered. ''' def __init__(self, useChainIdInsteadOfChainName=False, excludeDuplicates=False): '''Extracts all polymer chains from a structure. If the argument is set to true, the assigned key is: <PDB ID.Chain ID>, where Chain ID is the unique identifier assigned to each molecular entity in an mmCIF file. This Chain ID corresponds to `_atom_site.label_asym_id <http://mmcif.wwpdb.org/dictionaries/mmcif_mdb.dic/Items/_atom_site.label_asym_id.html>`_ field in an mmCIF file. Parameters ---------- useChainIdInsteadOfChainName : bool if true, use the Chain Id in the key assignments excludeDuplicates : bool if true, return only one chain for each unique sequence= t[1] ''' self.useChainIdInsteadOfChainName = useChainIdInsteadOfChainName self.excludeDuplicates = excludeDuplicates def __call__(self, t): structure = t[1] sequences = list() seqSet = set() chainToEntityIndex = self._get_chain_to_entity_index(structure) for i in range(structure.chains_per_model[0]): polymer = structure.entity_list[chainToEntityIndex[i]]['type'] == 'polymer' if polymer: key = t[0] if '.' in key: key = key.split('.')[0] key += '.' if self.useChainIdInsteadOfChainName: key += structure.chain_id_list[i] else: key += structure.chain_name_list[i] if self.excludeDuplicates: if chainToEntityIndex[i] in seqSet: continue seqSet.add(chainToEntityIndex[i]) sequences.append( (key, structure.entity_list[chainToEntityIndex[i]]['sequence'])) return sequences def _get_chain_to_entity_index(self, structure): entityChainIndex = [0] * structure.num_chains for i in range(len(structure.entity_list)): for j in structure.entity_list[i]['chainIndexList']: entityChainIndex[j] = i return entityChainIndex
"""structureToPolymerSequences.py: This mapper maps a structure to it's polypeptides, polynucleotide chain sequences. For a multi-model structure, only the first model is considered. """ __author__ = 'Mars (Shih-Cheng) Huang' __maintainer__ = 'Mars (Shih-Cheng) Huang' __email__ = '[email protected]' __version__ = '0.2.0' __status__ = 'Done' class Structuretopolymersequences(object): """This mapper maps a structure to it's polypeptides, polynucleotide chain sequences. For a multi-model structure, only the first model is considered. """ def __init__(self, useChainIdInsteadOfChainName=False, excludeDuplicates=False): """Extracts all polymer chains from a structure. If the argument is set to true, the assigned key is: <PDB ID.Chain ID>, where Chain ID is the unique identifier assigned to each molecular entity in an mmCIF file. This Chain ID corresponds to `_atom_site.label_asym_id <http://mmcif.wwpdb.org/dictionaries/mmcif_mdb.dic/Items/_atom_site.label_asym_id.html>`_ field in an mmCIF file. Parameters ---------- useChainIdInsteadOfChainName : bool if true, use the Chain Id in the key assignments excludeDuplicates : bool if true, return only one chain for each unique sequence= t[1] """ self.useChainIdInsteadOfChainName = useChainIdInsteadOfChainName self.excludeDuplicates = excludeDuplicates def __call__(self, t): structure = t[1] sequences = list() seq_set = set() chain_to_entity_index = self._get_chain_to_entity_index(structure) for i in range(structure.chains_per_model[0]): polymer = structure.entity_list[chainToEntityIndex[i]]['type'] == 'polymer' if polymer: key = t[0] if '.' in key: key = key.split('.')[0] key += '.' if self.useChainIdInsteadOfChainName: key += structure.chain_id_list[i] else: key += structure.chain_name_list[i] if self.excludeDuplicates: if chainToEntityIndex[i] in seqSet: continue seqSet.add(chainToEntityIndex[i]) sequences.append((key, structure.entity_list[chainToEntityIndex[i]]['sequence'])) return sequences def _get_chain_to_entity_index(self, structure): entity_chain_index = [0] * structure.num_chains for i in range(len(structure.entity_list)): for j in structure.entity_list[i]['chainIndexList']: entityChainIndex[j] = i return entityChainIndex
class ChooserStatistician: def __init__(self, m_iterations): self.m_iterations = m_iterations @property def m_iterations(self): return self._m_iterations @m_iterations.setter def m_iterations(self, m_iterations): if not m_iterations > 1: raise ValueError("Number of iterations should be > 1") self._m_iterations = m_iterations def get_chooser_p(self, chooser): return sum(chooser.is_win() for _ in range(self.m_iterations)) / self.m_iterations
class Chooserstatistician: def __init__(self, m_iterations): self.m_iterations = m_iterations @property def m_iterations(self): return self._m_iterations @m_iterations.setter def m_iterations(self, m_iterations): if not m_iterations > 1: raise value_error('Number of iterations should be > 1') self._m_iterations = m_iterations def get_chooser_p(self, chooser): return sum((chooser.is_win() for _ in range(self.m_iterations))) / self.m_iterations
# a = '42' # print(type(a)) # a = int(a) # print(type(a)) # b = 'a2' # print(type(b)) # b = int(b) ERROR ->>>> this cause error!!! because of 'a' in 'a2' # c = 3.141592 # print(type(c)) # c = int(c) # print(c, type(c)) d = '3.141592' print(type(d)) d = int(float(d)) print(d, type(d))
d = '3.141592' print(type(d)) d = int(float(d)) print(d, type(d))
class MultiStack: def __init__(self, stacksize): self.numstacks = 3 self.array = [0] * (stacksize * self.numstacks) self.sizes = [0] * self.numstacks self.stacksize = stacksize def Push(self, item, stacknum): if self.IsFull(stacknum): raise Exception("Stack is full") self.sizes[stacknum] += 1 self.array[self.IndexOfTop(stacknum)] = item def Pop(self, stacknum): if self.IsEmpty(stacknum): raise Exception("Stack is empty") value = self.array[self.IndexOfTop(stacknum)] self.array[self.IndexOfTop(stacknum)] = 0 self.sizes[stacknum] -= 1 return value def Peek(self, stacknum): if self.IsEmpty(stacknum): raise Exception("Stack is empty") return self.array[self.IndexOfTop(stacknum)] def IsEmpty(self, stacknum): return self.sizes[stacknum] == 0 def IsFull(self, stacknum): return self.sizes[stacknum] == self.stacksize def IndexOfTop(self, stacknum): offset = stacknum * self.stacksize return offset + self.sizes[stacknum] - 1 stack = MultiStack(1)
class Multistack: def __init__(self, stacksize): self.numstacks = 3 self.array = [0] * (stacksize * self.numstacks) self.sizes = [0] * self.numstacks self.stacksize = stacksize def push(self, item, stacknum): if self.IsFull(stacknum): raise exception('Stack is full') self.sizes[stacknum] += 1 self.array[self.IndexOfTop(stacknum)] = item def pop(self, stacknum): if self.IsEmpty(stacknum): raise exception('Stack is empty') value = self.array[self.IndexOfTop(stacknum)] self.array[self.IndexOfTop(stacknum)] = 0 self.sizes[stacknum] -= 1 return value def peek(self, stacknum): if self.IsEmpty(stacknum): raise exception('Stack is empty') return self.array[self.IndexOfTop(stacknum)] def is_empty(self, stacknum): return self.sizes[stacknum] == 0 def is_full(self, stacknum): return self.sizes[stacknum] == self.stacksize def index_of_top(self, stacknum): offset = stacknum * self.stacksize return offset + self.sizes[stacknum] - 1 stack = multi_stack(1)
# Confidence Interval using Stats Model Summary thresh = 0.05 intervals = results.conf_int(alpha=thresh) # Renaming column names first_col = str(thresh/2*100)+"%" second_col = str((1-thresh/2)*100)+"%" intervals = intervals.rename(columns={0:first_col,1:second_col}) display(intervals)
thresh = 0.05 intervals = results.conf_int(alpha=thresh) first_col = str(thresh / 2 * 100) + '%' second_col = str((1 - thresh / 2) * 100) + '%' intervals = intervals.rename(columns={0: first_col, 1: second_col}) display(intervals)
def loadfile(name): lines = [] f = open(name, "r") for x in f: if x.endswith('\n'): x = x[:-1] line = [] for character in x: line.append(int(character)) lines.append(line) return lines def add1ToAll(lines): for i in range (0, len(lines)): for j in range(0, len(lines[i])): lines[i][j] = lines[i][j] + 1 return lines neighbours = [[-1, -1], [0, -1], [1, -1], [-1, 0], [1, 0], [1, 1], [0, 1], [-1, 1]] def flash(i, j): lines[i][j] = 0 count = 1 for coor in neighbours: if i + coor[0] >= 0 and i + coor[0] < len(lines) and j + coor[1] >= 0 and j + coor[1] < len(lines[0]): if lines[i + coor[0]][j + coor[1]] != 0: lines[i + coor[0]][j + coor[1]] += 1 if lines[i + coor[0]][j + coor[1]] > 9: count += flash(i + coor[0], j + coor[1]) return count def makeOctopusFlash(): count = 0 for i in range (0, len(lines)): for j in range(0, len(lines[i])): if lines[i][j] > 9: count += flash(i, j) return count def goThroughSteps (lines, steps): countFlashes = 0 for step in range(1, steps + 1): lines = add1ToAll(lines) count = makeOctopusFlash() print("Step: ", step, " Flashes: ", count) countFlashes += count return countFlashes def findAllFlash(lines): countFlashes = 0 found = False step = 1 while found == False: lines = add1ToAll(lines) count = makeOctopusFlash() print("Step: ", step, " Flashes: ", count) if count == 100: return step countFlashes += count step += 1 return 0 lines = loadfile("data.txt") print(lines) flashes = goThroughSteps(lines, 100) lines = loadfile("data.txt") step = findAllFlash(lines) print("Opdracht 11a: ", flashes) print("Opdracht 11b: ", step)
def loadfile(name): lines = [] f = open(name, 'r') for x in f: if x.endswith('\n'): x = x[:-1] line = [] for character in x: line.append(int(character)) lines.append(line) return lines def add1_to_all(lines): for i in range(0, len(lines)): for j in range(0, len(lines[i])): lines[i][j] = lines[i][j] + 1 return lines neighbours = [[-1, -1], [0, -1], [1, -1], [-1, 0], [1, 0], [1, 1], [0, 1], [-1, 1]] def flash(i, j): lines[i][j] = 0 count = 1 for coor in neighbours: if i + coor[0] >= 0 and i + coor[0] < len(lines) and (j + coor[1] >= 0) and (j + coor[1] < len(lines[0])): if lines[i + coor[0]][j + coor[1]] != 0: lines[i + coor[0]][j + coor[1]] += 1 if lines[i + coor[0]][j + coor[1]] > 9: count += flash(i + coor[0], j + coor[1]) return count def make_octopus_flash(): count = 0 for i in range(0, len(lines)): for j in range(0, len(lines[i])): if lines[i][j] > 9: count += flash(i, j) return count def go_through_steps(lines, steps): count_flashes = 0 for step in range(1, steps + 1): lines = add1_to_all(lines) count = make_octopus_flash() print('Step: ', step, ' Flashes: ', count) count_flashes += count return countFlashes def find_all_flash(lines): count_flashes = 0 found = False step = 1 while found == False: lines = add1_to_all(lines) count = make_octopus_flash() print('Step: ', step, ' Flashes: ', count) if count == 100: return step count_flashes += count step += 1 return 0 lines = loadfile('data.txt') print(lines) flashes = go_through_steps(lines, 100) lines = loadfile('data.txt') step = find_all_flash(lines) print('Opdracht 11a: ', flashes) print('Opdracht 11b: ', step)
class BuildingSpecification(object): def __init__(self,building_type, display_string, other_buildings_available, codes_available): self.building_type = building_type self.display_string = display_string self.other_buildings_available = other_buildings_available # list of building names self.codes_available = codes_available #list of baseline codes available
class Buildingspecification(object): def __init__(self, building_type, display_string, other_buildings_available, codes_available): self.building_type = building_type self.display_string = display_string self.other_buildings_available = other_buildings_available self.codes_available = codes_available
################################################################################ level_number = 6 dungeon_name = 'Catacombs' wall_style = 'Catacombs' monster_difficulty = 3 goes_down = True entry_position = (0, 0) phase_door = False level_teleport = [ (4, True), (5, True), (6, False), ] stairs_previous = [(13, 11)] stairs_next = [] portal_down = [] portal_up = [] teleports = [ ((0, 21), (10, 7)), ((21, 15), (13, 17)), ((20, 19), (8, 11)), ((16, 21), (14, 21)), ] encounters = [ ((1, 0), (60, 7)), ((3, 9), (51, 36)), ((4, 13), (30, 69)), ((7, 17), (10, 99)), ((8, 5), (10, 99)), ((16, 13), (20, 66)), ((18, 14), (20, 53)), ((21, 0), (60, 8)), ] messages = [ ((20, 16), "A message is scrawled on the wall in blood:\nSeek the Mad One's stoney self in Harkyn's domain."), ] specials = [((19, 20), (22, 255))] smoke_zones = [] darkness = [(3, 17), (3, 18), (4, 17), (4, 18), (5, 17), (5, 18), (6, 17), (6, 18)] antimagic_zones = [(13, 18), (13, 19), (13, 20), (14, 17), (14, 18), (14, 19), (14, 20), (18, 20)] spinners = [(9, 9), (12, 13), (18, 6)] traps = [(3, 19), (4, 19), (4, 20), (7, 14), (9, 2), (10, 15), (11, 4), (11, 12), (12, 16), (15, 6), (16, 3), (17, 6)] hitpoint_damage = [] spellpoint_restore = [] stasis_chambers = [] random_encounter = [(0, 4), (0, 8), (1, 16), (2, 5), (2, 7), (3, 0), (3, 13), (4, 5), (4, 11), (5, 1), (6, 8), (6, 11), (7, 1), (7, 2), (7, 3), (7, 4), (9, 3), (9, 4), (9, 8), (10, 1), (11, 3), (11, 4), (11, 7), (12, 21), (13, 0), (13, 3), (13, 14), (14, 0), (14, 12), (14, 21), (16, 0), (16, 17), (16, 19), (17, 21), (19, 2), (19, 9), (19, 13), (19, 17), (19, 19), (19, 21), (21, 5), (21, 9)] specials_other = [(0, 0), (0, 15), (1, 16), (1, 19), (2, 20), (3, 6), (3, 14), (3, 20), (5, 13), (5, 21), (7, 17), (7, 18), (7, 19), (7, 20), (8, 18), (8, 19), (8, 20), (9, 13), (12, 9), (13, 5), (14, 17), (17, 13), (18, 9), (20, 0), (21, 21)] map = [ '+-++-------++-++---D---++-++----------++----++-++----++----------+', '| DD DD || DD || || || || || |', '+-++-----. |+-++--. .--++-+| .------. || .. || || .. || .------. |', '+--------. |+----+| |+----+| .-----+| || || .. || .. || |+----+| |', '| || || || || || || || || || || || |', '+D---------+| .. || || .. |+-----. || || |+----++D---+| || .. || |', '+D---++----+| .. || || .. |+----+| || .. |+----++D----. || .. || |', '| || || DD DD || || || || || || || |', '| .. || .. |+---D+| |+D---+| .. || |+---D+| .. || .-----++---D+| |', '| .. || .. .----D-. .-D----. .. || .--++D+| .. || |+----++---D+| |', '| DD DD || || || || || || |', '+D---+| .. .----D-. .-D----. .. |+--. |+D++D---+| || .. || .--+| |', '+D---+| .. |+---D+| |+D---+| .. |+-+| |+D++D----. || || || .--+| |', '| || || DD DD || || DD || || || || || || |', '| .. |+----+| .. || || .. |+----++-+| |+D+| .. .. || || |+---D+| |', '| .. |+----+| .. || || .. |+--------. |+D+| .. .. || || |+---D+| |', '| DD || || || || || || || || || || |', '+----+| .. |+----+| |+----+| .----D---++-+| .. .. || || || .. || |', '+-----. .. |+-++--. .--++-+| |+---D++-----. .. .. || || .. .. || |', '| DD || DD || || || || || || |', '| .--------++-++---D---++-+| || .. || .. .. .. .. || |+-------+| |', '| |+-++-++-++-++-++----++--. || .. || .. .. .. .. || .--------+| |', '| || || || || || || || || || || || |', '+D++D++D++D++D++D++--. |+D---++----+| .. .. .. .. |+--------. || |', '+D++D++D++D++D++D++-+| |+D---++-----. .. .. .. .. |+--------. || |', '| DD DD || DD || DD || || || || || |', '+-++D++-++-++D+| |+-+| || .. || .. .. .-D-. .. .. |+----------+| |', '+-++D++-++-++D+| |+-+| || .. || .. .. |+D+| .. .. .------------. |', '| DD DD DD || DD DD || DD || DD DD |', '+D++-++-++D++-++D++-++D++----+| .. .. |+D+| .. .. .. .. .. .-D---+', '+D++-++-++D++-++D++-++D++-----. .. .. .-D-. .. .. .. .. .. |+D---+', '| || || DD DD DD DD || || || |', '+D++D++D++-++-++-++-++D+| .. .. .. .. .. .. .. .. .. .-D---+| .. |', '+D--D--D++-++-++-++-++D+| .. .. .. .. .. .. .. .. .. |+D---+| .. |', '| DD || DD DD || || || || |', '+D----. |+-++-++D++-++-+| .-D-. .. .. .. .. .. .-D---+| .. || .-D+', '+D++-+| |+-++-++D++-----. |+D+| .. .. .. .. .. |+D---+| .. || |+D+', '| || || DD || DD DD DD DD || || || DD |', '+-++D+| |+-++D++-+| .. .. |+D+| .. .. .. .-D---+| .. || .-D+| |+-+', '+-++D+| |+-++D++-+| .. .. .-D-. .. .. .. |+D---+| .. || |+D+| |+-+', '| DD || DD DD || DD || || || DD || DD |', '+-++D++D+| |+-++-+| .. .. .. .. .. .-D---+| .. || .-D+| |+-+| |+-+', '+-++D--D+| |+-----. .. .. .. .. .. |+D---+| .. || |+D+| |+-+| |+-+', '| DD DD || || || || DD || DD || DD |', '+-+| .. |+-+| .. .. .. .. .. .-D---+| .. || .-D+| |+-+| |+-+| |+-+', '+-+| .. |+-+| .. .. .. .. .. |+D---+| .. || |+D+| |+-+| |+-+| |+-+', '| DD DD || || || || DD || DD || DD || DD |', '+-++D---++D+| .. .. .. .-D---+| .. || .-D+| |+-+| |+-+| |+-+| |+-+', '+-++D++---D-. .. .. .. |+D---+| .. || |+D+| |+-+| |+-+| |+-+| |+-+', '| DD || || || || DD || DD || DD || DD || DD |', '+-+| || .. .. .. .-D---+| .. || .-D+| |+-+| |+-+| |+-+| |+-+| |+-+', '+-+| || .. .. .. |+D---+| .. || |+D+| |+-+| |+-+| |+-+| |+-+| |+-+', '| DD || || || || DD || DD || DD || DD || DD || DD |', '+-++D+| .. .-D---+| .. || .-D+| |+-+| |+-+| |+-+| |+-+| |+-+| |+-+', '+---D-. .. |+D---+| .. || |+D+| |+-+| |+-+| |+-+| |+-+| |+-+| |+-+', '| || || || DD || DD || DD || DD || DD || DD || DD |', '| .. .-D---+| .. || .-D+| |+-+| |+-+| |+-+| |+-+| |+-+| |+-+| |+-+', '| .. |+D---+| .. || |+D+| |+-+| |+-+| |+-+| |+-+| |+-+| |+-+| |+-+', '| || || || DD || DD || DD || DD || DD || DD || DD || DD |', '+D---+| .. || .-D+| |+-+| |+-+| |+-+| |+-+| |+-+| |+-+| |+-+| |+-+', '+D---+| .. || |+D+| |+-+| |+-+| |+-+| |+-+| |+-+| |+-+| |+-+| |+-+', '| || || DD || DD || DD || DD || DD || DD || DD || DD || DD |', '| .. || .-D+| |+-+| |+-+| |+-+| |+-+| |+-+| |+-+| |+-+| |+-+| |+-+', '| .. || |+D+| |+-+| |+-+| |+-+| |+-+| |+-+| |+-+| |+-+| |+-+| |+-+', '| || DD || DD || DD || DD || DD || DD || DD || DD || DD || DD |', '+----++-++-++-++-++-++-++-++-++-++-++-++-++-++-++-++-++-++-++-++-+', ]
level_number = 6 dungeon_name = 'Catacombs' wall_style = 'Catacombs' monster_difficulty = 3 goes_down = True entry_position = (0, 0) phase_door = False level_teleport = [(4, True), (5, True), (6, False)] stairs_previous = [(13, 11)] stairs_next = [] portal_down = [] portal_up = [] teleports = [((0, 21), (10, 7)), ((21, 15), (13, 17)), ((20, 19), (8, 11)), ((16, 21), (14, 21))] encounters = [((1, 0), (60, 7)), ((3, 9), (51, 36)), ((4, 13), (30, 69)), ((7, 17), (10, 99)), ((8, 5), (10, 99)), ((16, 13), (20, 66)), ((18, 14), (20, 53)), ((21, 0), (60, 8))] messages = [((20, 16), "A message is scrawled on the wall in blood:\nSeek the Mad One's stoney self in Harkyn's domain.")] specials = [((19, 20), (22, 255))] smoke_zones = [] darkness = [(3, 17), (3, 18), (4, 17), (4, 18), (5, 17), (5, 18), (6, 17), (6, 18)] antimagic_zones = [(13, 18), (13, 19), (13, 20), (14, 17), (14, 18), (14, 19), (14, 20), (18, 20)] spinners = [(9, 9), (12, 13), (18, 6)] traps = [(3, 19), (4, 19), (4, 20), (7, 14), (9, 2), (10, 15), (11, 4), (11, 12), (12, 16), (15, 6), (16, 3), (17, 6)] hitpoint_damage = [] spellpoint_restore = [] stasis_chambers = [] random_encounter = [(0, 4), (0, 8), (1, 16), (2, 5), (2, 7), (3, 0), (3, 13), (4, 5), (4, 11), (5, 1), (6, 8), (6, 11), (7, 1), (7, 2), (7, 3), (7, 4), (9, 3), (9, 4), (9, 8), (10, 1), (11, 3), (11, 4), (11, 7), (12, 21), (13, 0), (13, 3), (13, 14), (14, 0), (14, 12), (14, 21), (16, 0), (16, 17), (16, 19), (17, 21), (19, 2), (19, 9), (19, 13), (19, 17), (19, 19), (19, 21), (21, 5), (21, 9)] specials_other = [(0, 0), (0, 15), (1, 16), (1, 19), (2, 20), (3, 6), (3, 14), (3, 20), (5, 13), (5, 21), (7, 17), (7, 18), (7, 19), (7, 20), (8, 18), (8, 19), (8, 20), (9, 13), (12, 9), (13, 5), (14, 17), (17, 13), (18, 9), (20, 0), (21, 21)] map = ['+-++-------++-++---D---++-++----------++----++-++----++----------+', '| DD DD || DD || || || || || |', '+-++-----. |+-++--. .--++-+| .------. || .. || || .. || .------. |', '+--------. |+----+| |+----+| .-----+| || || .. || .. || |+----+| |', '| || || || || || || || || || || || |', '+D---------+| .. || || .. |+-----. || || |+----++D---+| || .. || |', '+D---++----+| .. || || .. |+----+| || .. |+----++D----. || .. || |', '| || || DD DD || || || || || || || |', '| .. || .. |+---D+| |+D---+| .. || |+---D+| .. || .-----++---D+| |', '| .. || .. .----D-. .-D----. .. || .--++D+| .. || |+----++---D+| |', '| DD DD || || || || || || |', '+D---+| .. .----D-. .-D----. .. |+--. |+D++D---+| || .. || .--+| |', '+D---+| .. |+---D+| |+D---+| .. |+-+| |+D++D----. || || || .--+| |', '| || || DD DD || || DD || || || || || || |', '| .. |+----+| .. || || .. |+----++-+| |+D+| .. .. || || |+---D+| |', '| .. |+----+| .. || || .. |+--------. |+D+| .. .. || || |+---D+| |', '| DD || || || || || || || || || || |', '+----+| .. |+----+| |+----+| .----D---++-+| .. .. || || || .. || |', '+-----. .. |+-++--. .--++-+| |+---D++-----. .. .. || || .. .. || |', '| DD || DD || || || || || || |', '| .--------++-++---D---++-+| || .. || .. .. .. .. || |+-------+| |', '| |+-++-++-++-++-++----++--. || .. || .. .. .. .. || .--------+| |', '| || || || || || || || || || || || |', '+D++D++D++D++D++D++--. |+D---++----+| .. .. .. .. |+--------. || |', '+D++D++D++D++D++D++-+| |+D---++-----. .. .. .. .. |+--------. || |', '| DD DD || DD || DD || || || || || |', '+-++D++-++-++D+| |+-+| || .. || .. .. .-D-. .. .. |+----------+| |', '+-++D++-++-++D+| |+-+| || .. || .. .. |+D+| .. .. .------------. |', '| DD DD DD || DD DD || DD || DD DD |', '+D++-++-++D++-++D++-++D++----+| .. .. |+D+| .. .. .. .. .. .-D---+', '+D++-++-++D++-++D++-++D++-----. .. .. .-D-. .. .. .. .. .. |+D---+', '| || || DD DD DD DD || || || |', '+D++D++D++-++-++-++-++D+| .. .. .. .. .. .. .. .. .. .-D---+| .. |', '+D--D--D++-++-++-++-++D+| .. .. .. .. .. .. .. .. .. |+D---+| .. |', '| DD || DD DD || || || || |', '+D----. |+-++-++D++-++-+| .-D-. .. .. .. .. .. .-D---+| .. || .-D+', '+D++-+| |+-++-++D++-----. |+D+| .. .. .. .. .. |+D---+| .. || |+D+', '| || || DD || DD DD DD DD || || || DD |', '+-++D+| |+-++D++-+| .. .. |+D+| .. .. .. .-D---+| .. || .-D+| |+-+', '+-++D+| |+-++D++-+| .. .. .-D-. .. .. .. |+D---+| .. || |+D+| |+-+', '| DD || DD DD || DD || || || DD || DD |', '+-++D++D+| |+-++-+| .. .. .. .. .. .-D---+| .. || .-D+| |+-+| |+-+', '+-++D--D+| |+-----. .. .. .. .. .. |+D---+| .. || |+D+| |+-+| |+-+', '| DD DD || || || || DD || DD || DD |', '+-+| .. |+-+| .. .. .. .. .. .-D---+| .. || .-D+| |+-+| |+-+| |+-+', '+-+| .. |+-+| .. .. .. .. .. |+D---+| .. || |+D+| |+-+| |+-+| |+-+', '| DD DD || || || || DD || DD || DD || DD |', '+-++D---++D+| .. .. .. .-D---+| .. || .-D+| |+-+| |+-+| |+-+| |+-+', '+-++D++---D-. .. .. .. |+D---+| .. || |+D+| |+-+| |+-+| |+-+| |+-+', '| DD || || || || DD || DD || DD || DD || DD |', '+-+| || .. .. .. .-D---+| .. || .-D+| |+-+| |+-+| |+-+| |+-+| |+-+', '+-+| || .. .. .. |+D---+| .. || |+D+| |+-+| |+-+| |+-+| |+-+| |+-+', '| DD || || || || DD || DD || DD || DD || DD || DD |', '+-++D+| .. .-D---+| .. || .-D+| |+-+| |+-+| |+-+| |+-+| |+-+| |+-+', '+---D-. .. |+D---+| .. || |+D+| |+-+| |+-+| |+-+| |+-+| |+-+| |+-+', '| || || || DD || DD || DD || DD || DD || DD || DD |', '| .. .-D---+| .. || .-D+| |+-+| |+-+| |+-+| |+-+| |+-+| |+-+| |+-+', '| .. |+D---+| .. || |+D+| |+-+| |+-+| |+-+| |+-+| |+-+| |+-+| |+-+', '| || || || DD || DD || DD || DD || DD || DD || DD || DD |', '+D---+| .. || .-D+| |+-+| |+-+| |+-+| |+-+| |+-+| |+-+| |+-+| |+-+', '+D---+| .. || |+D+| |+-+| |+-+| |+-+| |+-+| |+-+| |+-+| |+-+| |+-+', '| || || DD || DD || DD || DD || DD || DD || DD || DD || DD |', '| .. || .-D+| |+-+| |+-+| |+-+| |+-+| |+-+| |+-+| |+-+| |+-+| |+-+', '| .. || |+D+| |+-+| |+-+| |+-+| |+-+| |+-+| |+-+| |+-+| |+-+| |+-+', '| || DD || DD || DD || DD || DD || DD || DD || DD || DD || DD |', '+----++-++-++-++-++-++-++-++-++-++-++-++-++-++-++-++-++-++-++-++-+']
class Solution: def deleteAndEarn(self, nums: List[int]) -> int: d = [0] *(max(nums)+1) for i in nums: d[i] += i prev,prever = 0,0 for i in d: cur = max(prev,prever+i) prever = prev prev = cur return max(cur,prever)
class Solution: def delete_and_earn(self, nums: List[int]) -> int: d = [0] * (max(nums) + 1) for i in nums: d[i] += i (prev, prever) = (0, 0) for i in d: cur = max(prev, prever + i) prever = prev prev = cur return max(cur, prever)
keywords = ['program', 'label', 'type', 'array', 'of', 'var', 'procedure' ,'function', 'begin', 'end', 'if', 'then', 'else', 'while', 'do' , 'or', 'and', 'div', 'not'] symbols = ['.', ';', ',', '(', ')', ':', '=', '<', '>', '+', '-', '*', '[', ':=', '..'] def get_tokens(code): label = '' tokens = [] for str in code: if str in symbols: if label in keywords: tokens.append('<' + label + '>') tokens.append('<' + str + '>') label = '' else: if label is not '': tokens.append('#' + label + '#') tokens.append('<' + str + '>') label = '' elif str is ' ' or str is'\t' or str is '\n': if label in keywords: if label is not '' : tokens.append('<' + label + '>') label = '' else: if label is not '': tokens.append('#' + label + '#') label = '' else: label += str return tokens
keywords = ['program', 'label', 'type', 'array', 'of', 'var', 'procedure', 'function', 'begin', 'end', 'if', 'then', 'else', 'while', 'do', 'or', 'and', 'div', 'not'] symbols = ['.', ';', ',', '(', ')', ':', '=', '<', '>', '+', '-', '*', '[', ':=', '..'] def get_tokens(code): label = '' tokens = [] for str in code: if str in symbols: if label in keywords: tokens.append('<' + label + '>') tokens.append('<' + str + '>') label = '' else: if label is not '': tokens.append('#' + label + '#') tokens.append('<' + str + '>') label = '' elif str is ' ' or str is '\t' or str is '\n': if label in keywords: if label is not '': tokens.append('<' + label + '>') label = '' else: if label is not '': tokens.append('#' + label + '#') label = '' else: label += str return tokens
# Problem Link : https://codeforces.com/problemset/problem/339/A# s = input() nums = list(s[0:len(s):2]) nums.sort() j = 0 for i in range(len(s)): if i%2 == 0: print(nums[j], end="") j += 1 else: print("+", end="")
s = input() nums = list(s[0:len(s):2]) nums.sort() j = 0 for i in range(len(s)): if i % 2 == 0: print(nums[j], end='') j += 1 else: print('+', end='')
# # PySNMP MIB module CISCO-SNMPv2-CAPABILITY (http://snmplabs.com/pysmi) # ASN.1 source file:///Users/davwang4/Dev/mibs.snmplabs.com/asn1/CISCO-SNMPv2-CAPABILITY # Produced by pysmi-0.3.4 at Wed May 1 12:12:36 2019 # On host DAVWANG4-M-1475 platform Darwin version 18.5.0 by user davwang4 # Using Python version 3.7.3 (default, Mar 27 2019, 09:23:15) # Integer, OctetString, ObjectIdentifier = mibBuilder.importSymbols("ASN1", "Integer", "OctetString", "ObjectIdentifier") NamedValues, = mibBuilder.importSymbols("ASN1-ENUMERATION", "NamedValues") ValueRangeConstraint, ValueSizeConstraint, ConstraintsIntersection, SingleValueConstraint, ConstraintsUnion = mibBuilder.importSymbols("ASN1-REFINEMENT", "ValueRangeConstraint", "ValueSizeConstraint", "ConstraintsIntersection", "SingleValueConstraint", "ConstraintsUnion") ciscoAgentCapability, = mibBuilder.importSymbols("CISCO-SMI", "ciscoAgentCapability") ModuleCompliance, NotificationGroup, AgentCapabilities = mibBuilder.importSymbols("SNMPv2-CONF", "ModuleCompliance", "NotificationGroup", "AgentCapabilities") TimeTicks, MibScalar, MibTable, MibTableRow, MibTableColumn, IpAddress, MibIdentifier, iso, ObjectIdentity, Integer32, Unsigned32, ModuleIdentity, Counter64, Counter32, Gauge32, NotificationType, Bits = mibBuilder.importSymbols("SNMPv2-SMI", "TimeTicks", "MibScalar", "MibTable", "MibTableRow", "MibTableColumn", "IpAddress", "MibIdentifier", "iso", "ObjectIdentity", "Integer32", "Unsigned32", "ModuleIdentity", "Counter64", "Counter32", "Gauge32", "NotificationType", "Bits") DisplayString, TextualConvention = mibBuilder.importSymbols("SNMPv2-TC", "DisplayString", "TextualConvention") ciscoSnmpV2Capability = ModuleIdentity((1, 3, 6, 1, 4, 1, 9, 7, 113)) ciscoSnmpV2Capability.setRevisions(('2007-11-12 00:00', '2006-05-30 00:00', '2006-04-24 00:00', '2004-03-18 00:00', '2002-02-07 00:00', '2002-01-31 00:00', '1994-08-18 00:00',)) if getattr(mibBuilder, 'version', (0, 0, 0)) > (4, 4, 0): if mibBuilder.loadTexts: ciscoSnmpV2Capability.setRevisionsDescriptions(('Added capability statement ciscoSnmpV2Capc4710aceVA1R700 for ACE 4710 Application Control Engine Appliance.', 'Added capability statement ciscoSnmpV2CapACSWV03R000 for Application Control Engine (ACE). For ciscoSnmpV2CapabilityV10R02 commented out references to object groups snmpStatsGroup, snmpV1Group, snmpORGroup, snmpTrapGroup because they are defined only in the original RFC 1450, not in the latest RFC 3418.', 'Added the VARIATION for the notification authenticationFailure in ciscoSnmpV2CapCatOSV08R0301. Added capability statement ciscoSnmpV2CapCatOSV08R0601.', 'Added ciscoSnmpV2CapCatOSV08R0301.', 'Added following agent capabilities: - ciscoMgxSnmpV2CapabilityV20 for MGX8850 series - ciscoBpxSesSnmpV2CapabilityV10 for BPX SES.', "Added 'ciscoRpmsSnmpV2CapabilityV20' for Cisco Resource Policy Management Server (RPMS) 2.0.", 'Initial version of this MIB module.',)) if mibBuilder.loadTexts: ciscoSnmpV2Capability.setLastUpdated('200711120000Z') if mibBuilder.loadTexts: ciscoSnmpV2Capability.setOrganization('Cisco Systems, Inc.') if mibBuilder.loadTexts: ciscoSnmpV2Capability.setContactInfo('Cisco Systems Customer Service Postal: 170 West Tasman Drive San Jose, CA 95134 USA Tel: +1 800 553-NETS E-mail: [email protected]') if mibBuilder.loadTexts: ciscoSnmpV2Capability.setDescription('Agent capabilities for SNMPv2-MIB') ciscoSnmpV2CapabilityV10R02 = AgentCapabilities((1, 3, 6, 1, 4, 1, 9, 7, 113, 1)) if getattr(mibBuilder, 'version', (0, 0, 0)) > (4, 4, 0): ciscoSnmpV2CapabilityV10R02 = ciscoSnmpV2CapabilityV10R02.setProductRelease('Cisco IOS 10.2') if getattr(mibBuilder, 'version', (0, 0, 0)) > (4, 4, 0): ciscoSnmpV2CapabilityV10R02 = ciscoSnmpV2CapabilityV10R02.setStatus('current') if mibBuilder.loadTexts: ciscoSnmpV2CapabilityV10R02.setDescription('IOS 10.2 SNMPv2 MIB capabilities') ciscoRpmsSnmpV2CapabilityV20 = AgentCapabilities((1, 3, 6, 1, 4, 1, 9, 7, 113, 2)) if getattr(mibBuilder, 'version', (0, 0, 0)) > (4, 4, 0): ciscoRpmsSnmpV2CapabilityV20 = ciscoRpmsSnmpV2CapabilityV20.setProductRelease('Cisco Resource Policy Management Server (RPMS) 2.0') if getattr(mibBuilder, 'version', (0, 0, 0)) > (4, 4, 0): ciscoRpmsSnmpV2CapabilityV20 = ciscoRpmsSnmpV2CapabilityV20.setStatus('current') if mibBuilder.loadTexts: ciscoRpmsSnmpV2CapabilityV20.setDescription('Cisco RPMS 2.0 SNMPv2 MIB capabilities.') ciscoMgxSnmpV2CapabilityV20 = AgentCapabilities((1, 3, 6, 1, 4, 1, 9, 7, 113, 3)) if getattr(mibBuilder, 'version', (0, 0, 0)) > (4, 4, 0): ciscoMgxSnmpV2CapabilityV20 = ciscoMgxSnmpV2CapabilityV20.setProductRelease('MGX8850 Release 2.0.00') if getattr(mibBuilder, 'version', (0, 0, 0)) > (4, 4, 0): ciscoMgxSnmpV2CapabilityV20 = ciscoMgxSnmpV2CapabilityV20.setStatus('current') if mibBuilder.loadTexts: ciscoMgxSnmpV2CapabilityV20.setDescription('SNMPv2-MIB capabilities in MGX Series.') ciscoBpxSesSnmpV2CapabilityV10 = AgentCapabilities((1, 3, 6, 1, 4, 1, 9, 7, 113, 4)) if getattr(mibBuilder, 'version', (0, 0, 0)) > (4, 4, 0): ciscoBpxSesSnmpV2CapabilityV10 = ciscoBpxSesSnmpV2CapabilityV10.setProductRelease('Cisco BPX SES Release 1.0.00') if getattr(mibBuilder, 'version', (0, 0, 0)) > (4, 4, 0): ciscoBpxSesSnmpV2CapabilityV10 = ciscoBpxSesSnmpV2CapabilityV10.setStatus('current') if mibBuilder.loadTexts: ciscoBpxSesSnmpV2CapabilityV10.setDescription('SNMPv2-MIB capabilities.') ciscoSnmpV2CapCatOSV08R0301 = AgentCapabilities((1, 3, 6, 1, 4, 1, 9, 7, 113, 5)) if getattr(mibBuilder, 'version', (0, 0, 0)) > (4, 4, 0): ciscoSnmpV2CapCatOSV08R0301 = ciscoSnmpV2CapCatOSV08R0301.setProductRelease('Cisco CatOS 8.3(1) for Catalyst 6000/6500\n and Cisco 7600 series devices.') if getattr(mibBuilder, 'version', (0, 0, 0)) > (4, 4, 0): ciscoSnmpV2CapCatOSV08R0301 = ciscoSnmpV2CapCatOSV08R0301.setStatus('current') if mibBuilder.loadTexts: ciscoSnmpV2CapCatOSV08R0301.setDescription('SNMPv2-MIB capabilities.') ciscoSnmpV2CapCatOSV08R0601 = AgentCapabilities((1, 3, 6, 1, 4, 1, 9, 7, 113, 6)) if getattr(mibBuilder, 'version', (0, 0, 0)) > (4, 4, 0): ciscoSnmpV2CapCatOSV08R0601 = ciscoSnmpV2CapCatOSV08R0601.setProductRelease('Cisco CatOS 8.6(1) for Catalyst 6000/6500\n and Cisco 7600 series devices.') if getattr(mibBuilder, 'version', (0, 0, 0)) > (4, 4, 0): ciscoSnmpV2CapCatOSV08R0601 = ciscoSnmpV2CapCatOSV08R0601.setStatus('current') if mibBuilder.loadTexts: ciscoSnmpV2CapCatOSV08R0601.setDescription('SNMPv2-MIB capabilities.') ciscoSnmpV2CapACSWV03R000 = AgentCapabilities((1, 3, 6, 1, 4, 1, 9, 7, 113, 7)) if getattr(mibBuilder, 'version', (0, 0, 0)) > (4, 4, 0): ciscoSnmpV2CapACSWV03R000 = ciscoSnmpV2CapACSWV03R000.setProductRelease('ACSW (Application Control Software) 3.0\n for Application Control Engine (ACE) \n Service Module.') if getattr(mibBuilder, 'version', (0, 0, 0)) > (4, 4, 0): ciscoSnmpV2CapACSWV03R000 = ciscoSnmpV2CapACSWV03R000.setStatus('current') if mibBuilder.loadTexts: ciscoSnmpV2CapACSWV03R000.setDescription('SNMPv2-MIB capabilities.') ciscoSnmpV2Capc4710aceVA1R700 = AgentCapabilities((1, 3, 6, 1, 4, 1, 9, 7, 113, 8)) if getattr(mibBuilder, 'version', (0, 0, 0)) > (4, 4, 0): ciscoSnmpV2Capc4710aceVA1R700 = ciscoSnmpV2Capc4710aceVA1R700.setProductRelease('ACSW (Application Control Software) A1(7)\n for ACE 4710 Application Control Engine \n Appliance.') if getattr(mibBuilder, 'version', (0, 0, 0)) > (4, 4, 0): ciscoSnmpV2Capc4710aceVA1R700 = ciscoSnmpV2Capc4710aceVA1R700.setStatus('current') if mibBuilder.loadTexts: ciscoSnmpV2Capc4710aceVA1R700.setDescription('SNMPv2-MIB capabilities.') mibBuilder.exportSymbols("CISCO-SNMPv2-CAPABILITY", ciscoSnmpV2CapCatOSV08R0601=ciscoSnmpV2CapCatOSV08R0601, ciscoSnmpV2CapACSWV03R000=ciscoSnmpV2CapACSWV03R000, PYSNMP_MODULE_ID=ciscoSnmpV2Capability, ciscoBpxSesSnmpV2CapabilityV10=ciscoBpxSesSnmpV2CapabilityV10, ciscoSnmpV2CapCatOSV08R0301=ciscoSnmpV2CapCatOSV08R0301, ciscoMgxSnmpV2CapabilityV20=ciscoMgxSnmpV2CapabilityV20, ciscoRpmsSnmpV2CapabilityV20=ciscoRpmsSnmpV2CapabilityV20, ciscoSnmpV2Capability=ciscoSnmpV2Capability, ciscoSnmpV2Capc4710aceVA1R700=ciscoSnmpV2Capc4710aceVA1R700, ciscoSnmpV2CapabilityV10R02=ciscoSnmpV2CapabilityV10R02)
(integer, octet_string, object_identifier) = mibBuilder.importSymbols('ASN1', 'Integer', 'OctetString', 'ObjectIdentifier') (named_values,) = mibBuilder.importSymbols('ASN1-ENUMERATION', 'NamedValues') (value_range_constraint, value_size_constraint, constraints_intersection, single_value_constraint, constraints_union) = mibBuilder.importSymbols('ASN1-REFINEMENT', 'ValueRangeConstraint', 'ValueSizeConstraint', 'ConstraintsIntersection', 'SingleValueConstraint', 'ConstraintsUnion') (cisco_agent_capability,) = mibBuilder.importSymbols('CISCO-SMI', 'ciscoAgentCapability') (module_compliance, notification_group, agent_capabilities) = mibBuilder.importSymbols('SNMPv2-CONF', 'ModuleCompliance', 'NotificationGroup', 'AgentCapabilities') (time_ticks, mib_scalar, mib_table, mib_table_row, mib_table_column, ip_address, mib_identifier, iso, object_identity, integer32, unsigned32, module_identity, counter64, counter32, gauge32, notification_type, bits) = mibBuilder.importSymbols('SNMPv2-SMI', 'TimeTicks', 'MibScalar', 'MibTable', 'MibTableRow', 'MibTableColumn', 'IpAddress', 'MibIdentifier', 'iso', 'ObjectIdentity', 'Integer32', 'Unsigned32', 'ModuleIdentity', 'Counter64', 'Counter32', 'Gauge32', 'NotificationType', 'Bits') (display_string, textual_convention) = mibBuilder.importSymbols('SNMPv2-TC', 'DisplayString', 'TextualConvention') cisco_snmp_v2_capability = module_identity((1, 3, 6, 1, 4, 1, 9, 7, 113)) ciscoSnmpV2Capability.setRevisions(('2007-11-12 00:00', '2006-05-30 00:00', '2006-04-24 00:00', '2004-03-18 00:00', '2002-02-07 00:00', '2002-01-31 00:00', '1994-08-18 00:00')) if getattr(mibBuilder, 'version', (0, 0, 0)) > (4, 4, 0): if mibBuilder.loadTexts: ciscoSnmpV2Capability.setRevisionsDescriptions(('Added capability statement ciscoSnmpV2Capc4710aceVA1R700 for ACE 4710 Application Control Engine Appliance.', 'Added capability statement ciscoSnmpV2CapACSWV03R000 for Application Control Engine (ACE). For ciscoSnmpV2CapabilityV10R02 commented out references to object groups snmpStatsGroup, snmpV1Group, snmpORGroup, snmpTrapGroup because they are defined only in the original RFC 1450, not in the latest RFC 3418.', 'Added the VARIATION for the notification authenticationFailure in ciscoSnmpV2CapCatOSV08R0301. Added capability statement ciscoSnmpV2CapCatOSV08R0601.', 'Added ciscoSnmpV2CapCatOSV08R0301.', 'Added following agent capabilities: - ciscoMgxSnmpV2CapabilityV20 for MGX8850 series - ciscoBpxSesSnmpV2CapabilityV10 for BPX SES.', "Added 'ciscoRpmsSnmpV2CapabilityV20' for Cisco Resource Policy Management Server (RPMS) 2.0.", 'Initial version of this MIB module.')) if mibBuilder.loadTexts: ciscoSnmpV2Capability.setLastUpdated('200711120000Z') if mibBuilder.loadTexts: ciscoSnmpV2Capability.setOrganization('Cisco Systems, Inc.') if mibBuilder.loadTexts: ciscoSnmpV2Capability.setContactInfo('Cisco Systems Customer Service Postal: 170 West Tasman Drive San Jose, CA 95134 USA Tel: +1 800 553-NETS E-mail: [email protected]') if mibBuilder.loadTexts: ciscoSnmpV2Capability.setDescription('Agent capabilities for SNMPv2-MIB') cisco_snmp_v2_capability_v10_r02 = agent_capabilities((1, 3, 6, 1, 4, 1, 9, 7, 113, 1)) if getattr(mibBuilder, 'version', (0, 0, 0)) > (4, 4, 0): cisco_snmp_v2_capability_v10_r02 = ciscoSnmpV2CapabilityV10R02.setProductRelease('Cisco IOS 10.2') if getattr(mibBuilder, 'version', (0, 0, 0)) > (4, 4, 0): cisco_snmp_v2_capability_v10_r02 = ciscoSnmpV2CapabilityV10R02.setStatus('current') if mibBuilder.loadTexts: ciscoSnmpV2CapabilityV10R02.setDescription('IOS 10.2 SNMPv2 MIB capabilities') cisco_rpms_snmp_v2_capability_v20 = agent_capabilities((1, 3, 6, 1, 4, 1, 9, 7, 113, 2)) if getattr(mibBuilder, 'version', (0, 0, 0)) > (4, 4, 0): cisco_rpms_snmp_v2_capability_v20 = ciscoRpmsSnmpV2CapabilityV20.setProductRelease('Cisco Resource Policy Management Server (RPMS) 2.0') if getattr(mibBuilder, 'version', (0, 0, 0)) > (4, 4, 0): cisco_rpms_snmp_v2_capability_v20 = ciscoRpmsSnmpV2CapabilityV20.setStatus('current') if mibBuilder.loadTexts: ciscoRpmsSnmpV2CapabilityV20.setDescription('Cisco RPMS 2.0 SNMPv2 MIB capabilities.') cisco_mgx_snmp_v2_capability_v20 = agent_capabilities((1, 3, 6, 1, 4, 1, 9, 7, 113, 3)) if getattr(mibBuilder, 'version', (0, 0, 0)) > (4, 4, 0): cisco_mgx_snmp_v2_capability_v20 = ciscoMgxSnmpV2CapabilityV20.setProductRelease('MGX8850 Release 2.0.00') if getattr(mibBuilder, 'version', (0, 0, 0)) > (4, 4, 0): cisco_mgx_snmp_v2_capability_v20 = ciscoMgxSnmpV2CapabilityV20.setStatus('current') if mibBuilder.loadTexts: ciscoMgxSnmpV2CapabilityV20.setDescription('SNMPv2-MIB capabilities in MGX Series.') cisco_bpx_ses_snmp_v2_capability_v10 = agent_capabilities((1, 3, 6, 1, 4, 1, 9, 7, 113, 4)) if getattr(mibBuilder, 'version', (0, 0, 0)) > (4, 4, 0): cisco_bpx_ses_snmp_v2_capability_v10 = ciscoBpxSesSnmpV2CapabilityV10.setProductRelease('Cisco BPX SES Release 1.0.00') if getattr(mibBuilder, 'version', (0, 0, 0)) > (4, 4, 0): cisco_bpx_ses_snmp_v2_capability_v10 = ciscoBpxSesSnmpV2CapabilityV10.setStatus('current') if mibBuilder.loadTexts: ciscoBpxSesSnmpV2CapabilityV10.setDescription('SNMPv2-MIB capabilities.') cisco_snmp_v2_cap_cat_osv08_r0301 = agent_capabilities((1, 3, 6, 1, 4, 1, 9, 7, 113, 5)) if getattr(mibBuilder, 'version', (0, 0, 0)) > (4, 4, 0): cisco_snmp_v2_cap_cat_osv08_r0301 = ciscoSnmpV2CapCatOSV08R0301.setProductRelease('Cisco CatOS 8.3(1) for Catalyst 6000/6500\n and Cisco 7600 series devices.') if getattr(mibBuilder, 'version', (0, 0, 0)) > (4, 4, 0): cisco_snmp_v2_cap_cat_osv08_r0301 = ciscoSnmpV2CapCatOSV08R0301.setStatus('current') if mibBuilder.loadTexts: ciscoSnmpV2CapCatOSV08R0301.setDescription('SNMPv2-MIB capabilities.') cisco_snmp_v2_cap_cat_osv08_r0601 = agent_capabilities((1, 3, 6, 1, 4, 1, 9, 7, 113, 6)) if getattr(mibBuilder, 'version', (0, 0, 0)) > (4, 4, 0): cisco_snmp_v2_cap_cat_osv08_r0601 = ciscoSnmpV2CapCatOSV08R0601.setProductRelease('Cisco CatOS 8.6(1) for Catalyst 6000/6500\n and Cisco 7600 series devices.') if getattr(mibBuilder, 'version', (0, 0, 0)) > (4, 4, 0): cisco_snmp_v2_cap_cat_osv08_r0601 = ciscoSnmpV2CapCatOSV08R0601.setStatus('current') if mibBuilder.loadTexts: ciscoSnmpV2CapCatOSV08R0601.setDescription('SNMPv2-MIB capabilities.') cisco_snmp_v2_cap_acswv03_r000 = agent_capabilities((1, 3, 6, 1, 4, 1, 9, 7, 113, 7)) if getattr(mibBuilder, 'version', (0, 0, 0)) > (4, 4, 0): cisco_snmp_v2_cap_acswv03_r000 = ciscoSnmpV2CapACSWV03R000.setProductRelease('ACSW (Application Control Software) 3.0\n for Application Control Engine (ACE) \n Service Module.') if getattr(mibBuilder, 'version', (0, 0, 0)) > (4, 4, 0): cisco_snmp_v2_cap_acswv03_r000 = ciscoSnmpV2CapACSWV03R000.setStatus('current') if mibBuilder.loadTexts: ciscoSnmpV2CapACSWV03R000.setDescription('SNMPv2-MIB capabilities.') cisco_snmp_v2_capc4710ace_va1_r700 = agent_capabilities((1, 3, 6, 1, 4, 1, 9, 7, 113, 8)) if getattr(mibBuilder, 'version', (0, 0, 0)) > (4, 4, 0): cisco_snmp_v2_capc4710ace_va1_r700 = ciscoSnmpV2Capc4710aceVA1R700.setProductRelease('ACSW (Application Control Software) A1(7)\n for ACE 4710 Application Control Engine \n Appliance.') if getattr(mibBuilder, 'version', (0, 0, 0)) > (4, 4, 0): cisco_snmp_v2_capc4710ace_va1_r700 = ciscoSnmpV2Capc4710aceVA1R700.setStatus('current') if mibBuilder.loadTexts: ciscoSnmpV2Capc4710aceVA1R700.setDescription('SNMPv2-MIB capabilities.') mibBuilder.exportSymbols('CISCO-SNMPv2-CAPABILITY', ciscoSnmpV2CapCatOSV08R0601=ciscoSnmpV2CapCatOSV08R0601, ciscoSnmpV2CapACSWV03R000=ciscoSnmpV2CapACSWV03R000, PYSNMP_MODULE_ID=ciscoSnmpV2Capability, ciscoBpxSesSnmpV2CapabilityV10=ciscoBpxSesSnmpV2CapabilityV10, ciscoSnmpV2CapCatOSV08R0301=ciscoSnmpV2CapCatOSV08R0301, ciscoMgxSnmpV2CapabilityV20=ciscoMgxSnmpV2CapabilityV20, ciscoRpmsSnmpV2CapabilityV20=ciscoRpmsSnmpV2CapabilityV20, ciscoSnmpV2Capability=ciscoSnmpV2Capability, ciscoSnmpV2Capc4710aceVA1R700=ciscoSnmpV2Capc4710aceVA1R700, ciscoSnmpV2CapabilityV10R02=ciscoSnmpV2CapabilityV10R02)
description = 'Asyn serial controllers in the SINQ AMOR.' group='lowlevel' pvprefix = 'SQ:AMOR:serial' devices = dict( serial1=device( 'nicos_ess.devices.epics.extensions.EpicsCommandReply', epicstimeout=3.0, description='Controller of the devices connected to serial 1', commandpv=pvprefix + '1.AOUT', replypv=pvprefix + '1.AINP', ), serial2=device( 'nicos_ess.devices.epics.extensions.EpicsCommandReply', epicstimeout=3.0, description='Controller of the devices connected to serial 2', commandpv=pvprefix + '2.AOUT', replypv=pvprefix + '2.AINP', ), serial3=device( 'nicos_ess.devices.epics.extensions.EpicsCommandReply', epicstimeout=3.0, description='Controller of the devices connected to serial 3', commandpv=pvprefix + '3.AOUT', replypv=pvprefix + '3.AINP', ), cter1=device( 'nicos_ess.devices.epics.extensions.EpicsCommandReply', epicstimeout=3.0, description='Controller of the counter box', commandpv='SQ:AMOR:cter1.AOUT', replypv='SQ:AMOR:cter1.AINP', ), )
description = 'Asyn serial controllers in the SINQ AMOR.' group = 'lowlevel' pvprefix = 'SQ:AMOR:serial' devices = dict(serial1=device('nicos_ess.devices.epics.extensions.EpicsCommandReply', epicstimeout=3.0, description='Controller of the devices connected to serial 1', commandpv=pvprefix + '1.AOUT', replypv=pvprefix + '1.AINP'), serial2=device('nicos_ess.devices.epics.extensions.EpicsCommandReply', epicstimeout=3.0, description='Controller of the devices connected to serial 2', commandpv=pvprefix + '2.AOUT', replypv=pvprefix + '2.AINP'), serial3=device('nicos_ess.devices.epics.extensions.EpicsCommandReply', epicstimeout=3.0, description='Controller of the devices connected to serial 3', commandpv=pvprefix + '3.AOUT', replypv=pvprefix + '3.AINP'), cter1=device('nicos_ess.devices.epics.extensions.EpicsCommandReply', epicstimeout=3.0, description='Controller of the counter box', commandpv='SQ:AMOR:cter1.AOUT', replypv='SQ:AMOR:cter1.AINP'))
#!/usr/bin/python3 def NativeZeros(nRows, nCols): return [range(nRows) for col in range(nCols)] matrix = NativeZeros(4, 4) print(matrix) print(sum([sum(row) for row in matrix]))
def native_zeros(nRows, nCols): return [range(nRows) for col in range(nCols)] matrix = native_zeros(4, 4) print(matrix) print(sum([sum(row) for row in matrix]))
# Copyright 2013 The Chromium Authors. All rights reserved. # Use of this source code is governed by a BSD-style license that can be # found in the LICENSE file. { 'variables': { 'chromium_code': 1, }, 'includes': [ '../build/win_precompile.gypi', '../chrome/version.gypi', 'blacklist.gypi', ], 'targets': [ { 'target_name': 'chrome_elf', 'type': 'shared_library', 'include_dirs': [ '..', ], 'sources': [ 'chrome_elf.def', 'chrome_elf_main.cc', 'chrome_elf_main.h', ], 'dependencies': [ 'blacklist', 'chrome_elf_lib', ], 'msvs_settings': { 'VCLinkerTool': { 'BaseAddress': '0x01c20000', # Set /SUBSYSTEM:WINDOWS. 'SubSystem': '2', 'AdditionalDependencies!': [ 'user32.lib', ], 'IgnoreDefaultLibraryNames': [ 'user32.lib', ], }, }, }, { 'target_name': 'chrome_elf_unittests_exe', 'product_name': 'chrome_elf_unittests', 'type': 'executable', 'sources': [ 'blacklist/test/blacklist_test.cc', 'create_file/chrome_create_file_unittest.cc', 'elf_imports_unittest.cc', 'ntdll_cache_unittest.cc', ], 'include_dirs': [ '..', '<(SHARED_INTERMEDIATE_DIR)', ], 'dependencies': [ 'chrome_elf_lib', '../base/base.gyp:base', '../base/base.gyp:run_all_unittests', '../base/base.gyp:test_support_base', '../sandbox/sandbox.gyp:sandbox', '../testing/gtest.gyp:gtest', 'blacklist', 'blacklist_test_dll_1', 'blacklist_test_dll_2', 'blacklist_test_dll_3', 'blacklist_test_main_dll', ], 'conditions': [ ['component=="shared_library"', { # In component builds, all targets depend on chrome_redirects by # default. Remove it here so we are able to test it. 'dependencies!': [ '../chrome_elf/chrome_elf.gyp:chrome_redirects', ], }], ], }, { # A dummy target to ensure that chrome_elf.dll and chrome.exe gets built # when building chrome_elf_unittests.exe without introducing an # explicit runtime dependency. 'target_name': 'chrome_elf_unittests', 'type': 'none', 'dependencies': [ '../chrome/chrome.gyp:chrome', 'chrome_elf', 'chrome_elf_unittests_exe', ], }, { 'target_name': 'chrome_elf_lib', 'type': 'static_library', 'include_dirs': [ '..', ], 'sources': [ 'chrome_elf_constants.cc', 'chrome_elf_constants.h', 'chrome_elf_types.h', 'create_file/chrome_create_file.cc', 'create_file/chrome_create_file.h', 'ntdll_cache.cc', 'ntdll_cache.h', ], 'conditions': [ ['component=="shared_library"', { # In component builds, all targets depend on chrome_redirects by # default. Remove it here to avoid a circular dependency. 'dependencies!': [ '../chrome_elf/chrome_elf.gyp:chrome_redirects', ], }], ], }, ], # targets 'conditions': [ ['component=="shared_library"', { 'targets': [ { 'target_name': 'chrome_redirects', 'type': 'shared_library', 'include_dirs': [ '..', ], 'sources': [ 'chrome_redirects.def', ], 'dependencies': [ 'chrome_elf_lib', ], 'msvs_settings': { 'VCLinkerTool': { 'BaseAddress': '0x01c10000', # Set /SUBSYSTEM:WINDOWS. 'SubSystem': '2', }, }, 'conditions': [ ['component=="shared_library"', { # In component builds, all targets depend on chrome_redirects by # default. Remove it here to avoid a circular dependency. 'dependencies!': [ '../chrome_elf/chrome_elf.gyp:chrome_redirects', ], }], ], }, ], }], ], }
{'variables': {'chromium_code': 1}, 'includes': ['../build/win_precompile.gypi', '../chrome/version.gypi', 'blacklist.gypi'], 'targets': [{'target_name': 'chrome_elf', 'type': 'shared_library', 'include_dirs': ['..'], 'sources': ['chrome_elf.def', 'chrome_elf_main.cc', 'chrome_elf_main.h'], 'dependencies': ['blacklist', 'chrome_elf_lib'], 'msvs_settings': {'VCLinkerTool': {'BaseAddress': '0x01c20000', 'SubSystem': '2', 'AdditionalDependencies!': ['user32.lib'], 'IgnoreDefaultLibraryNames': ['user32.lib']}}}, {'target_name': 'chrome_elf_unittests_exe', 'product_name': 'chrome_elf_unittests', 'type': 'executable', 'sources': ['blacklist/test/blacklist_test.cc', 'create_file/chrome_create_file_unittest.cc', 'elf_imports_unittest.cc', 'ntdll_cache_unittest.cc'], 'include_dirs': ['..', '<(SHARED_INTERMEDIATE_DIR)'], 'dependencies': ['chrome_elf_lib', '../base/base.gyp:base', '../base/base.gyp:run_all_unittests', '../base/base.gyp:test_support_base', '../sandbox/sandbox.gyp:sandbox', '../testing/gtest.gyp:gtest', 'blacklist', 'blacklist_test_dll_1', 'blacklist_test_dll_2', 'blacklist_test_dll_3', 'blacklist_test_main_dll'], 'conditions': [['component=="shared_library"', {'dependencies!': ['../chrome_elf/chrome_elf.gyp:chrome_redirects']}]]}, {'target_name': 'chrome_elf_unittests', 'type': 'none', 'dependencies': ['../chrome/chrome.gyp:chrome', 'chrome_elf', 'chrome_elf_unittests_exe']}, {'target_name': 'chrome_elf_lib', 'type': 'static_library', 'include_dirs': ['..'], 'sources': ['chrome_elf_constants.cc', 'chrome_elf_constants.h', 'chrome_elf_types.h', 'create_file/chrome_create_file.cc', 'create_file/chrome_create_file.h', 'ntdll_cache.cc', 'ntdll_cache.h'], 'conditions': [['component=="shared_library"', {'dependencies!': ['../chrome_elf/chrome_elf.gyp:chrome_redirects']}]]}], 'conditions': [['component=="shared_library"', {'targets': [{'target_name': 'chrome_redirects', 'type': 'shared_library', 'include_dirs': ['..'], 'sources': ['chrome_redirects.def'], 'dependencies': ['chrome_elf_lib'], 'msvs_settings': {'VCLinkerTool': {'BaseAddress': '0x01c10000', 'SubSystem': '2'}}, 'conditions': [['component=="shared_library"', {'dependencies!': ['../chrome_elf/chrome_elf.gyp:chrome_redirects']}]]}]}]]}
elem = lambda value, next: {'value': value, 'next': next} to_str = lambda head: '' if head is None \ else str(head['value']) + ' ' + to_str(head['next']) values = elem(1, elem(2, elem(3, None))) # print(to_str(values)) def make_powers(count): powers = [] for i in range(count): # powers.append(lambda x: x ** i) # wrong code powers.append((lambda p: lambda x: x ** p)(i)) # wrong code return powers powers = make_powers(5) # for power in powers: # print(power(2)) handlers = [] for i in range(1, 4): def on_click(i=i): print('Button {} was clicked!'.format(i)) handlers.append(on_click) for handler in handlers: handler()
elem = lambda value, next: {'value': value, 'next': next} to_str = lambda head: '' if head is None else str(head['value']) + ' ' + to_str(head['next']) values = elem(1, elem(2, elem(3, None))) def make_powers(count): powers = [] for i in range(count): powers.append((lambda p: lambda x: x ** p)(i)) return powers powers = make_powers(5) handlers = [] for i in range(1, 4): def on_click(i=i): print('Button {} was clicked!'.format(i)) handlers.append(on_click) for handler in handlers: handler()
class Allergies(object): def __init__(self, score): self.score = [allergen for num, allergen in list(enumerate([ 'eggs', 'peanuts', 'shellfish', 'strawberries', 'tomatoes', 'chocolate', 'pollen', 'cats' ])) if 0 < (score & (1 << num))] def is_allergic_to(self, item): return item in self.score @property def lst(self): return self.score
class Allergies(object): def __init__(self, score): self.score = [allergen for (num, allergen) in list(enumerate(['eggs', 'peanuts', 'shellfish', 'strawberries', 'tomatoes', 'chocolate', 'pollen', 'cats'])) if 0 < score & 1 << num] def is_allergic_to(self, item): return item in self.score @property def lst(self): return self.score
# 1. Sort the 'people' list of dictionaries alphabetically based on the # 'name' key from each dictionary using the 'sorted' function and store # the new list as 'sorted_by_name' people = [ {'name': 'Kevin Bacon', 'age': 61}, {'name': 'Fred Ward', 'age': 77}, {'name': 'finn Carter', 'age': 59}, {'name': 'Ariana Richards', 'age': 40}, {'name': 'Vicotor Wong', 'age': 74}, ] # sorted_by_name = None # AssertionError sorted_by_name = sorted(people, key=lambda d: d['name'].lower()) assert sorted_by_name == [ {'name': 'Ariana Richards', 'age': 40}, {'name': 'finn Carter', 'age': 59}, {'name': 'Fred Ward', 'age': 77}, {'name': 'Kevin Bacon', 'age': 61}, {'name': 'Vicotor Wong', 'age': 74}, ] # =============================================================================== # # 2. Use the 'map' function to iterate over 'sorted_by_name' to generate a # new list called 'name_declarations' where each value is a string with # '<NAME> is <AGE> years old.' where the '<NAME>' and '<AGE>' values are from # the dictionary. # name_declarations = None # name_declarations = list(map(lambda d: f"{d['name']} is {d['age']} years old", sorted_by_name)) name_declarations = list( map(lambda d: f"{d['name']} is {d['age']} years old", sorted_by_name) ) # print(name_declarations) assert name_declarations == [ "Ariana Richards is 40 years old", "finn Carter is 59 years old", "Fred Ward is 77 years old", "Kevin Bacon is 61 years old", "Victor Wong is 74 years old", ]
people = [{'name': 'Kevin Bacon', 'age': 61}, {'name': 'Fred Ward', 'age': 77}, {'name': 'finn Carter', 'age': 59}, {'name': 'Ariana Richards', 'age': 40}, {'name': 'Vicotor Wong', 'age': 74}] sorted_by_name = sorted(people, key=lambda d: d['name'].lower()) assert sorted_by_name == [{'name': 'Ariana Richards', 'age': 40}, {'name': 'finn Carter', 'age': 59}, {'name': 'Fred Ward', 'age': 77}, {'name': 'Kevin Bacon', 'age': 61}, {'name': 'Vicotor Wong', 'age': 74}] name_declarations = list(map(lambda d: f"{d['name']} is {d['age']} years old", sorted_by_name)) assert name_declarations == ['Ariana Richards is 40 years old', 'finn Carter is 59 years old', 'Fred Ward is 77 years old', 'Kevin Bacon is 61 years old', 'Victor Wong is 74 years old']
# Copyright 2017 Pedro M. Baeza <[email protected]> # License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl). { "name": "Weights in the invoices analysis view", "version": "13.0.1.0.0", "author": "Tecnativa," "Odoo Community Association (OCA)", "category": "Inventory, Logistics, Warehousing", "development_status": "Production/Stable", "license": "AGPL-3", "website": "https://www.github.com/account_reporting_weight", "depends": ["sale"], "installable": True, }
{'name': 'Weights in the invoices analysis view', 'version': '13.0.1.0.0', 'author': 'Tecnativa,Odoo Community Association (OCA)', 'category': 'Inventory, Logistics, Warehousing', 'development_status': 'Production/Stable', 'license': 'AGPL-3', 'website': 'https://www.github.com/account_reporting_weight', 'depends': ['sale'], 'installable': True}
# Theory: List # In your programs, you often need to group several elements in # order to process them as a single object. For this, you will need # to use different collections. One of the most useful collections # in Python is a list. It is one of the most important things in # Python. # 1. Creating and printing lists # Look at a simple list that stores several names of dog's breed: dog_breeds = ['corgi', 'labrador', 'poodle', 'jack russel'] print(dog_breeds) # In this first line, we use square brackets to create a list that # contains four elements and then assign it to the dog_breeds # variable. In the second line, the list is printed through the # variable's name. All the elements are printed in the same order # as they were stored in the list because lists are ordered. # Here is another list that contains five integers: numbers = [1, 2, 3, 4, 5] print(numbers) # [1, 2, 3, 4, 5] # Another way to create a list is to invoke the list function. It is # used to create a list out of an iterable object: that is, a kind of # object where you can get its elements one by one. The concept # of iterability will be explained in detail further on, but let's look # at the examples below: list_out_of_string = list('danger!') print(list_out_of_string) # ['d', 'a', 'n', 'g', 'e', 'r', '!'] # list_out_of_integer = list(235) # TypeError: 'int' object is not iterable # So, the list function create a list containing each element # from the given iterable object. For now, remember that a string # is an example of an iterable object, and an integer is an example # of non-iterable object. A list itself is also an iterable object. # Let's also note the difference between the list function and # creating a list using square brackets: multi_element_list = list('danger!') print(multi_element_list) # ['d', 'a', 'n', 'g', 'e', 'r', '!'] singe_element_list = ['danger!'] print(singe_element_list) # ['danger!'] # The square brackets and the list function can also be used to # create empty lists that do not have elements at all. empty_list_1 = list() empty_list_2 = [] # In the following topics, we will consider how to fill empty lists. # 2. Features of lists # Lists can store duplicate values as many times as needed. on_off_list = ['on', 'off', 'on', 'off', 'on'] print(on_off_list) # ['on', 'off', 'on', 'off', 'on'] # Another important thing about lists is that they can contain # different types of elements. So there are neither restrictions, # nor fixed list types, and you can add to your list any data you # want, like in the following example: different_object = ['a', 1, 'b', 2] # 3. Length of a list # Sometimes you need to know how many elements are there in a # list. There is a built-in function len that can be applied # to any iterable object, and it returns simply the length of that # object. # So, when applied to a list, it returns the number of elements in # that lists. numbers = [1, 2, 3, 4, 5] print(len(numbers)) # 5 empty_list = list() print(len(empty_list)) # 0 single_element_list = ['danger!'] print(len(single_element_list)) # 1 multi_element_list = list('danger!') print(len(multi_element_list)) # 7 # In the example above, you can see how the len() function # works. Again, pay attention to the difference between list() # and [] as applied to strings: it may not result in what you # expected: # 4. Summary # As a recap, we note that lists are: # ordered, i.e. each element has a fixed position in a list; # iterable, i.e. you can get their elements one by one; # able to store duplicate values; # able to store different types of elements
dog_breeds = ['corgi', 'labrador', 'poodle', 'jack russel'] print(dog_breeds) numbers = [1, 2, 3, 4, 5] print(numbers) list_out_of_string = list('danger!') print(list_out_of_string) multi_element_list = list('danger!') print(multi_element_list) singe_element_list = ['danger!'] print(singe_element_list) empty_list_1 = list() empty_list_2 = [] on_off_list = ['on', 'off', 'on', 'off', 'on'] print(on_off_list) different_object = ['a', 1, 'b', 2] numbers = [1, 2, 3, 4, 5] print(len(numbers)) empty_list = list() print(len(empty_list)) single_element_list = ['danger!'] print(len(single_element_list)) multi_element_list = list('danger!') print(len(multi_element_list))
# -*- python -*- # This software was produced by NIST, an agency of the U.S. government, # and by statute is not subject to copyright in the United States. # Recipients of this software assume all responsibilities associated # with its operation, modification and maintenance. However, to # facilitate maintenance we ask that before distributing modified # versions of this software, you first contact the authors at # [email protected]. # Time, in milliseconds, between the time that a progressbar object is # created and the time that it is installed in the ActivityViewer # window. delay = 2000 # Time in milliseconds between progress bar updates. period = 200 def set_delay(menuitem, milliseconds): global delay delay = milliseconds
delay = 2000 period = 200 def set_delay(menuitem, milliseconds): global delay delay = milliseconds
class Solution: def floodFill(self, image: List[List[int]], sr: int, sc: int, newColor: int) -> List[List[int]]: m = len(image) n = len(image[0]) oldColor = image[sr][sc] if oldColor == newColor: return image def dfs(r, c): nonlocal image, newColor, oldColor if image[r][c] == oldColor: image[r][c] = newColor if r - 1 >= 0: dfs(r-1, c) if r + 1 < m: dfs(r+1, c) if c - 1 >= 0: dfs(r, c-1) if c + 1 < n: dfs(r, c+1) dfs(sr, sc) return image
class Solution: def flood_fill(self, image: List[List[int]], sr: int, sc: int, newColor: int) -> List[List[int]]: m = len(image) n = len(image[0]) old_color = image[sr][sc] if oldColor == newColor: return image def dfs(r, c): nonlocal image, newColor, oldColor if image[r][c] == oldColor: image[r][c] = newColor if r - 1 >= 0: dfs(r - 1, c) if r + 1 < m: dfs(r + 1, c) if c - 1 >= 0: dfs(r, c - 1) if c + 1 < n: dfs(r, c + 1) dfs(sr, sc) return image
#### digonal sum digonal=[[1,2,3,5], [4,5,6,4], [7,8,9,3] ] def digonaldiffernce(arr): SUM1=0 SUM2=0 j=0 for i in arr: SUM1+=i[j] SUM2+=i[(len(i)-1)-j] j+=1 return abs(SUM1-SUM2) print(digonaldiffernce(digonal))
digonal = [[1, 2, 3, 5], [4, 5, 6, 4], [7, 8, 9, 3]] def digonaldiffernce(arr): sum1 = 0 sum2 = 0 j = 0 for i in arr: sum1 += i[j] sum2 += i[len(i) - 1 - j] j += 1 return abs(SUM1 - SUM2) print(digonaldiffernce(digonal))
class Main: class featured: it = {'css': '#content > div.row'} products = {'css': it['css'] + ' .product-layout'} names = {'css': products['css'] + ' .caption h4 a'}
class Main: class Featured: it = {'css': '#content > div.row'} products = {'css': it['css'] + ' .product-layout'} names = {'css': products['css'] + ' .caption h4 a'}
def foo(x): print(x) foo([x for x in range(10)])
def foo(x): print(x) foo([x for x in range(10)])
def dogleg(value, units): return_dict = {} if units == 'deg/100ft': return_dict['deg/100ft'] = value return_dict['deg/30m'] = value * 0.9843004 elif units == 'deg/30m': return_dict['deg/100ft'] = value * 1.01595 return_dict['deg/30m'] = value return return_dict def axial_spring_con(value, units): return_dict = {} if units == 'N/m': return_dict['N/m'] = value return_dict['lb/in'] = value * 1.016 elif units == 'lb/in': return_dict['N/m'] = value * 0.984252 return_dict['lb/in'] = value return return_dict def axial_dampening_coef(value, units): return_dict = {} if units == 'N-s/m': return_dict['N-s/m'] = value return_dict['lb-s/in'] = value * 1.016 elif units == 'lb-s/in': return_dict['N-s/m'] = value * 0.984252 return_dict['lb-s/in'] = value return return_dict def torsional_spring_con(value, units): return_dict = {} if units == 'N-m/rad': return_dict['N-m/rad'] = value return_dict['lb-in/rad'] = value * 1.01595 elif units == 'lb-in/rad': return_dict['N-m/rad'] = value * 0.9843004 return_dict['lb-in/rad'] = value return return_dict def torsional_dampening_coef(value, units): return_dict = {} if units == 'N-m-s/rad': return_dict['N-m-s/rad'] = value return_dict['lb-in-s/rad'] = value * 1.01595 elif units == 'lb-in-s/rad': return_dict['N-m-s/rad'] = value * 0.9843004 return_dict['lb-in-s/rad'] = value return return_dict def pressure_grad(value, units): return_dict = {} if units == 'psi/ft': return_dict['psi/ft'] = value return_dict['kPa/m'] = value * 22.5 return_dict['Mpa/m'] = value * 0.0225 return_dict['Pa/m'] = value * 22500 elif units == 'kPa/m': return_dict['psi/ft'] = value * 0.0444444 return_dict['kPa/m'] = value return_dict['Mpa/m'] = value * 0.001 return_dict['Pa/m'] = value * 1000 elif units == 'Mpa/m': return_dict['psi/ft'] = value * 44.4444444 return_dict['kPa/m'] = value * 1000 return_dict['Mpa/m'] = value return_dict['Pa/m'] = value * 1000000 elif units == 'Pa/m': return_dict['psi/ft'] = value * 0.0000444 return_dict['kPa/m'] = value * 0.001 return_dict['Mpa/m'] = value * 0.000001 return_dict['Pa/m'] = value return return_dict def yield_slurry(value, units): return_dict = {} if units == 'ft3/sk': return_dict['ft3/sk'] = value return_dict['m3/sk'] = value * 0.028317 return_dict['gal/sk'] = value * 7 elif units == 'm3/sk': return_dict['ft3/sk'] = value * 35 return_dict['m3/sk'] = value return_dict['gal/sk'] = value * 264 elif units == 'gal/sk': return_dict['ft3/sk'] = value * 0.13369 return_dict['m3/sk'] = value * 0.0037857 return_dict['gal/sk'] = value return return_dict def footage_cost(value, units): return_dict = {} if units == 'cur/ft': return_dict['cur/ft'] = value return_dict['cur/m'] = value * 3.2810014 return_dict['cur/1000ft'] = value / 0.001 return_dict['cur/1000m'] = value * 3281.0014 elif units == 'cur/m': return_dict['cur/ft'] = value * 0.304785 return_dict['cur/m'] = value return_dict['cur/1000ft'] = value / 0.0003048 return_dict['cur/1000m'] = value * 1000 elif units == 'cur/1000ft': return_dict['cur/ft'] = value / 1000 return_dict['cur/m'] = value / 3281.00 return_dict['cur/1000ft'] = value return_dict['cur/1000m'] = value / 3.2810003 elif units == 'cur/1000m': return_dict['cur/ft'] = value / 305 return_dict['cur/m'] = value / 1000 return_dict['cur/1000ft'] = value / 0.3047851 return_dict['cur/1000m'] = value return return_dict def mud_weight(value, units): return_dict = {} if units == 'g/cm3': return_dict['g/cm3'] = value * 1.0 return_dict['g/L'] = value * 1000.0 return_dict['kg/m3'] = value * 1000.0 return_dict['kg/L'] = value * 1.0 return_dict['kPa/m'] = value * 9.8114244 return_dict['lb/ft3'] = value * 62.4336642 return_dict['lb/bbl'] = value * 350.5070669 return_dict['ppg'] = value * 8.3454064 return_dict['psi/ft'] = value * 0.4339843 return_dict['psi/100ft'] = value * 43.3726579 return_dict['SG'] = value * 1.0 elif units == 'g/L': return_dict['g/cm3'] = value * 0.001 return_dict['g/L'] = value * 1.0 return_dict['kg/m3'] = value * 1.0 return_dict['kg/L'] = value * 0.001 return_dict['kPa/m'] = value * 0.0098114 return_dict['lb/ft3'] = value * 0.0624337 return_dict['lb/bbl'] = value * 0.3505071 return_dict['ppg'] = value * 0.0083454 return_dict['psi/ft'] = value * 0.000434 return_dict['psi/100ft'] = value * 0.0433727 return_dict['SG'] = value * 0.001 elif units == 'kg/m3': return_dict['g/cm3'] = value * 0.001 return_dict['g/L'] = value * 1.0 return_dict['kg/m3'] = value * 1.0 return_dict['kg/L'] = value * 0.001 return_dict['kPa/m'] = value * 0.0098114 return_dict['lb/ft3'] = value * 0.0624337 return_dict['lb/bbl'] = value * 0.3505071 return_dict['ppg'] = value * 0.0083454 return_dict['psi/ft'] = value * 0.000434 return_dict['psi/100ft'] = value * 0.0433727 return_dict['SG'] = value * 0.001 elif units == 'kg/L': return_dict['g/cm3'] = value * 1.0 return_dict['g/L'] = value * 1000.0 return_dict['kg/m3'] = value * 1000.0 return_dict['kg/L'] = value * 1.0 return_dict['kPa/m'] = value * 9.8114244 return_dict['lb/ft3'] = value * 62.4336642 return_dict['lb/bbl'] = value * 350.5070669 return_dict['ppg'] = value * 8.3454064 return_dict['psi/ft'] = value * 0.4339843 return_dict['psi/100ft'] = value * 43.3726579 return_dict['SG'] = value * 1.0 elif units == 'kPa/m': return_dict['g/cm3'] = value * 0.101922 return_dict['g/L'] = value * 101.922 return_dict['kg/m3'] = value * 101.922 return_dict['kg/L'] = value * 0.101922 return_dict['kPa/m'] = value * 1.0 return_dict['lb/ft3'] = value * 6.3633639 return_dict['lb/bbl'] = value * 35.7243813 return_dict['ppg'] = value * 0.8505805 return_dict['psi/ft'] = value * 0.0442325 return_dict['psi/100ft'] = value * 4.420628 return_dict['SG'] = value * 0.101922 elif units == 'lb/ft3': return_dict['g/cm3'] = value * 0.016017 return_dict['g/L'] = value * 16.017 return_dict['kg/m3'] = value * 16.017 return_dict['kg/L'] = value * 0.016017 return_dict['kPa/m'] = value * 0.1571496 return_dict['lb/ft3'] = value * 1.0 return_dict['lb/bbl'] = value * 5.6140717 return_dict['ppg'] = value * 0.1336684 return_dict['psi/ft'] = value * 0.0069511 return_dict['psi/100ft'] = value * 0.6946999 return_dict['SG'] = value * 0.016017 elif units == 'lb/bbl': return_dict['g/cm3'] = value * 0.002853 return_dict['g/L'] = value * 2.8530095 return_dict['kg/m3'] = value * 2.8530095 return_dict['kg/L'] = value * 0.002853 return_dict['kPa/m'] = value * 0.0279921 return_dict['lb/ft3'] = value * 0.1781238 return_dict['lb/bbl'] = value * 1.0 return_dict['ppg'] = value * 0.0238095 return_dict['psi/ft'] = value * 0.0012382 return_dict['psi/100ft'] = value * 0.1237426 return_dict['SG'] = value * 0.002853 elif units == 'ppg': return_dict['g/cm3'] = value * 0.1198264 return_dict['g/L'] = value * 119.8264 return_dict['kg/m3'] = value * 119.8264 return_dict['kg/L'] = value * 0.1198264 return_dict['kPa/m'] = value * 1.1756677 return_dict['lb/ft3'] = value * 7.4812012 return_dict['lb/bbl'] = value * 42.0 return_dict['ppg'] = value * 1.0 return_dict['psi/ft'] = value * 0.0520028 return_dict['psi/100ft'] = value * 5.1971895 return_dict['SG'] = value * 0.1198264 elif units == 'psi/ft': return_dict['g/cm3'] = value * 2.304231 return_dict['g/L'] = value * 2304.231 return_dict['kg/m3'] = value * 2304.231 return_dict['kg/L'] = value * 2.304231 return_dict['kPa/m'] = value * 22.6077883 return_dict['lb/ft3'] = value * 143.8615846 return_dict['lb/bbl'] = value * 807.6492492 return_dict['ppg'] = value * 19.229744 return_dict['psi/ft'] = value * 1.0 return_dict['psi/100ft'] = value * 99.9406228 return_dict['SG'] = value * 2.304231 elif units == 'psi/100ft': return_dict['g/cm3'] = value * 0.023056 return_dict['g/L'] = value * 23.056 return_dict['kg/m3'] = value * 23.056 return_dict['kg/L'] = value * 0.023056 return_dict['kPa/m'] = value * 0.2262122 return_dict['lb/ft3'] = value * 1.4394706 return_dict['lb/bbl'] = value * 8.0812909 return_dict['ppg'] = value * 0.1924117 return_dict['psi/ft'] = value * 0.0100059 return_dict['psi/100ft'] = value * 1.0 return_dict['SG'] = value * 0.023056 elif units == 'SG': return_dict['g/cm3'] = value * 1.0 return_dict['g/L'] = value * 1000.0 return_dict['kg/m3'] = value * 1000.0 return_dict['kg/L'] = value * 1.0 return_dict['kPa/m'] = value * 9.8114244 return_dict['lb/ft3'] = value * 62.4336642 return_dict['lb/bbl'] = value * 350.5070669 return_dict['ppg'] = value * 8.3454064 return_dict['psi/ft'] = value * 0.4339843 return_dict['psi/100ft'] = value * 43.3726579 return_dict['SG'] = value * 1.0 return return_dict def flow_rate(value, units): return_dict = {} if units == 'bbl/hr': return_dict['bbl/hr'] = value * 1.0 return_dict['bbl/min'] = value * 0.0166667 return_dict['ft3/min'] = value * 0.0935764 return_dict['m3/hr'] = value * 0.1589873 return_dict['m3/min'] = value * 0.0026498 return_dict['gal/hr'] = value * 42.0 return_dict['gpm'] = value * 0.7 return_dict['L/hr'] = value * 158.9872949 return_dict['L/min'] = value * 2.6497882 elif units == 'bbl/min': return_dict['bbl/hr'] = value * 60.0 return_dict['bbl/min'] = value * 1.0 return_dict['ft3/min'] = value * 5.6145833 return_dict['m3/hr'] = value * 9.5392377 return_dict['m3/min'] = value * 0.1589873 return_dict['gal/hr'] = value * 2520.0 return_dict['gpm'] = value * 42.0 return_dict['L/hr'] = value * 9539.2376957 return_dict['L/min'] = value * 158.9872949 elif units == 'ft3/min': return_dict['bbl/hr'] = value * 10.6864564 return_dict['bbl/min'] = value * 0.1781076 return_dict['ft3/min'] = value * 1.0 return_dict['m3/hr'] = value * 1.6990108 return_dict['m3/min'] = value * 0.0283168 return_dict['gal/hr'] = value * 448.8311688 return_dict['gpm'] = value * 7.4805195 return_dict['L/hr'] = value * 1699.0107955 return_dict['L/min'] = value * 28.3168466 elif units == 'm3/hr': return_dict['bbl/hr'] = value * 6.2898108 return_dict['bbl/min'] = value * 0.1048302 return_dict['ft3/min'] = value * 0.5885778 return_dict['m3/hr'] = value * 1.0 return_dict['m3/min'] = value * 0.0166667 return_dict['gal/hr'] = value * 264.1720524 return_dict['gpm'] = value * 4.4028675 return_dict['L/hr'] = value * 1000.0 return_dict['L/min'] = value * 16.6666667 elif units == 'm3/min': return_dict['bbl/hr'] = value * 377.3886462 return_dict['bbl/min'] = value * 6.2898108 return_dict['ft3/min'] = value * 35.3146667 return_dict['m3/hr'] = value * 60.0 return_dict['m3/min'] = value * 1.0 return_dict['gal/hr'] = value * 15850.3231414 return_dict['gpm'] = value * 264.1720524 return_dict['L/hr'] = value * 60000.0 return_dict['L/min'] = value * 1000.0 elif units == 'gal/hr': return_dict['bbl/hr'] = value * 0.0238095 return_dict['bbl/min'] = value * 0.0003968 return_dict['ft3/min'] = value * 0.002228 return_dict['m3/hr'] = value * 0.0037854 return_dict['m3/min'] = value * 6.31e-05 return_dict['gal/hr'] = value * 1.0 return_dict['gpm'] = value * 0.0166667 return_dict['L/hr'] = value * 3.7854118 return_dict['L/min'] = value * 0.0630902 elif units == 'gpm': return_dict['bbl/hr'] = value * 1.4285714 return_dict['bbl/min'] = value * 0.0238095 return_dict['ft3/min'] = value * 0.1336806 return_dict['m3/hr'] = value * 0.2271247 return_dict['m3/min'] = value * 0.0037854 return_dict['gal/hr'] = value * 60.0 return_dict['gpm'] = value * 1.0 return_dict['L/hr'] = value * 227.124707 return_dict['L/min'] = value * 3.7854118 elif units == 'L/hr': return_dict['bbl/hr'] = value * 0.0062898 return_dict['bbl/min'] = value * 0.0001048 return_dict['ft3/min'] = value * 0.0005886 return_dict['m3/hr'] = value * 0.001 return_dict['m3/min'] = value * 1.67e-05 return_dict['gal/hr'] = value * 0.2641721 return_dict['gpm'] = value * 0.0044029 return_dict['L/hr'] = value * 1.0 return_dict['L/min'] = value * 0.0166667 elif units == 'L/min': return_dict['bbl/hr'] = value * 0.3773886 return_dict['bbl/min'] = value * 0.0062898 return_dict['ft3/min'] = value * 0.0353147 return_dict['m3/hr'] = value * 0.06 return_dict['m3/min'] = value * 0.001 return_dict['gal/hr'] = value * 15.8503231 return_dict['gpm'] = value * 0.2641721 return_dict['L/hr'] = value * 60.0 return_dict['L/min'] = value * 1.0 return return_dict def drilling_rate(value, units): return_dict = {} if units == 'ft/d': return_dict['ft/d'] = value * 1.0 return_dict['ft/hr'] = value * 0.0416667 return_dict['ft/min'] = value * 0.0006944 return_dict['ft/s'] = value * 1.16e-05 return_dict['m/d'] = value * 0.3048 return_dict['m/hr'] = value * 0.0127 return_dict['m/min'] = value * 0.0002117 return_dict['m/s'] = value * 3.5e-06 elif units == 'ft/hr': return_dict['ft/d'] = value * 24.0 return_dict['ft/hr'] = value * 1.0 return_dict['ft/min'] = value * 0.0166667 return_dict['ft/s'] = value * 0.0002778 return_dict['m/d'] = value * 7.3152 return_dict['m/hr'] = value * 0.3048 return_dict['m/min'] = value * 0.00508 return_dict['m/s'] = value * 8.47e-05 elif units == 'ft/min': return_dict['ft/d'] = value * 1440.0 return_dict['ft/hr'] = value * 60.0 return_dict['ft/min'] = value * 1.0 return_dict['ft/s'] = value * 0.0166667 return_dict['m/d'] = value * 438.9119993 return_dict['m/hr'] = value * 18.288 return_dict['m/min'] = value * 0.3048 return_dict['m/s'] = value * 0.00508 elif units == 'ft/s': return_dict['ft/d'] = value * 86400.0 return_dict['ft/hr'] = value * 3600.0 return_dict['ft/min'] = value * 60.0 return_dict['ft/s'] = value * 1.0 return_dict['m/d'] = value * 26334.71996 return_dict['m/hr'] = value * 1097.2799983 return_dict['m/min'] = value * 18.288 return_dict['m/s'] = value * 0.3048 elif units == 'm/d': return_dict['ft/d'] = value * 3.2808399 return_dict['ft/hr'] = value * 0.1367017 return_dict['ft/min'] = value * 0.0022784 return_dict['ft/s'] = value * 3.8e-05 return_dict['m/d'] = value * 1.0 return_dict['m/hr'] = value * 0.0416667 return_dict['m/min'] = value * 0.0006944 return_dict['m/s'] = value * 1.16e-05 elif units == 'm/hr': return_dict['ft/d'] = value * 78.7401576 return_dict['ft/hr'] = value * 3.2808399 return_dict['ft/min'] = value * 0.0546807 return_dict['ft/s'] = value * 0.0009113 return_dict['m/d'] = value * 24.0 return_dict['m/hr'] = value * 1.0 return_dict['m/min'] = value * 0.0166667 return_dict['m/s'] = value * 0.0002778 elif units == 'm/min': return_dict['ft/d'] = value * 4724.409456 return_dict['ft/hr'] = value * 196.850394 return_dict['ft/min'] = value * 3.2808399 return_dict['ft/s'] = value * 0.0546807 return_dict['m/d'] = value * 1440.0 return_dict['m/hr'] = value * 60.0 return_dict['m/min'] = value * 1.0 return_dict['m/s'] = value * 0.0166667 elif units == 'm/s': return_dict['ft/d'] = value * 283464.56736 return_dict['ft/hr'] = value * 11811.02364 return_dict['ft/min'] = value * 196.850394 return_dict['ft/s'] = value * 3.2808399 return_dict['m/d'] = value * 86400.0 return_dict['m/hr'] = value * 3600.0 return_dict['m/min'] = value * 60.0 return_dict['m/s'] = value * 1.0 return return_dict def weight_length(value, units): return_dict = {} if units == 'lb/ft': return_dict['lb/ft'] = value return_dict['kg/m'] = value * 1.48816 elif units == 'kg/m': return_dict['lb/ft'] = value * 0.671969 return_dict['kg/m'] = value return return_dict def geothermal_gradient(value, units): return_dict = {} if units == 'c/100m': return_dict['c/100m'] = value return_dict['f/100ft'] = value * 0.549 elif units == 'f/100ft': return_dict['c/100m'] = value / 0.549 return_dict['f/100ft'] = value return return_dict
def dogleg(value, units): return_dict = {} if units == 'deg/100ft': return_dict['deg/100ft'] = value return_dict['deg/30m'] = value * 0.9843004 elif units == 'deg/30m': return_dict['deg/100ft'] = value * 1.01595 return_dict['deg/30m'] = value return return_dict def axial_spring_con(value, units): return_dict = {} if units == 'N/m': return_dict['N/m'] = value return_dict['lb/in'] = value * 1.016 elif units == 'lb/in': return_dict['N/m'] = value * 0.984252 return_dict['lb/in'] = value return return_dict def axial_dampening_coef(value, units): return_dict = {} if units == 'N-s/m': return_dict['N-s/m'] = value return_dict['lb-s/in'] = value * 1.016 elif units == 'lb-s/in': return_dict['N-s/m'] = value * 0.984252 return_dict['lb-s/in'] = value return return_dict def torsional_spring_con(value, units): return_dict = {} if units == 'N-m/rad': return_dict['N-m/rad'] = value return_dict['lb-in/rad'] = value * 1.01595 elif units == 'lb-in/rad': return_dict['N-m/rad'] = value * 0.9843004 return_dict['lb-in/rad'] = value return return_dict def torsional_dampening_coef(value, units): return_dict = {} if units == 'N-m-s/rad': return_dict['N-m-s/rad'] = value return_dict['lb-in-s/rad'] = value * 1.01595 elif units == 'lb-in-s/rad': return_dict['N-m-s/rad'] = value * 0.9843004 return_dict['lb-in-s/rad'] = value return return_dict def pressure_grad(value, units): return_dict = {} if units == 'psi/ft': return_dict['psi/ft'] = value return_dict['kPa/m'] = value * 22.5 return_dict['Mpa/m'] = value * 0.0225 return_dict['Pa/m'] = value * 22500 elif units == 'kPa/m': return_dict['psi/ft'] = value * 0.0444444 return_dict['kPa/m'] = value return_dict['Mpa/m'] = value * 0.001 return_dict['Pa/m'] = value * 1000 elif units == 'Mpa/m': return_dict['psi/ft'] = value * 44.4444444 return_dict['kPa/m'] = value * 1000 return_dict['Mpa/m'] = value return_dict['Pa/m'] = value * 1000000 elif units == 'Pa/m': return_dict['psi/ft'] = value * 4.44e-05 return_dict['kPa/m'] = value * 0.001 return_dict['Mpa/m'] = value * 1e-06 return_dict['Pa/m'] = value return return_dict def yield_slurry(value, units): return_dict = {} if units == 'ft3/sk': return_dict['ft3/sk'] = value return_dict['m3/sk'] = value * 0.028317 return_dict['gal/sk'] = value * 7 elif units == 'm3/sk': return_dict['ft3/sk'] = value * 35 return_dict['m3/sk'] = value return_dict['gal/sk'] = value * 264 elif units == 'gal/sk': return_dict['ft3/sk'] = value * 0.13369 return_dict['m3/sk'] = value * 0.0037857 return_dict['gal/sk'] = value return return_dict def footage_cost(value, units): return_dict = {} if units == 'cur/ft': return_dict['cur/ft'] = value return_dict['cur/m'] = value * 3.2810014 return_dict['cur/1000ft'] = value / 0.001 return_dict['cur/1000m'] = value * 3281.0014 elif units == 'cur/m': return_dict['cur/ft'] = value * 0.304785 return_dict['cur/m'] = value return_dict['cur/1000ft'] = value / 0.0003048 return_dict['cur/1000m'] = value * 1000 elif units == 'cur/1000ft': return_dict['cur/ft'] = value / 1000 return_dict['cur/m'] = value / 3281.0 return_dict['cur/1000ft'] = value return_dict['cur/1000m'] = value / 3.2810003 elif units == 'cur/1000m': return_dict['cur/ft'] = value / 305 return_dict['cur/m'] = value / 1000 return_dict['cur/1000ft'] = value / 0.3047851 return_dict['cur/1000m'] = value return return_dict def mud_weight(value, units): return_dict = {} if units == 'g/cm3': return_dict['g/cm3'] = value * 1.0 return_dict['g/L'] = value * 1000.0 return_dict['kg/m3'] = value * 1000.0 return_dict['kg/L'] = value * 1.0 return_dict['kPa/m'] = value * 9.8114244 return_dict['lb/ft3'] = value * 62.4336642 return_dict['lb/bbl'] = value * 350.5070669 return_dict['ppg'] = value * 8.3454064 return_dict['psi/ft'] = value * 0.4339843 return_dict['psi/100ft'] = value * 43.3726579 return_dict['SG'] = value * 1.0 elif units == 'g/L': return_dict['g/cm3'] = value * 0.001 return_dict['g/L'] = value * 1.0 return_dict['kg/m3'] = value * 1.0 return_dict['kg/L'] = value * 0.001 return_dict['kPa/m'] = value * 0.0098114 return_dict['lb/ft3'] = value * 0.0624337 return_dict['lb/bbl'] = value * 0.3505071 return_dict['ppg'] = value * 0.0083454 return_dict['psi/ft'] = value * 0.000434 return_dict['psi/100ft'] = value * 0.0433727 return_dict['SG'] = value * 0.001 elif units == 'kg/m3': return_dict['g/cm3'] = value * 0.001 return_dict['g/L'] = value * 1.0 return_dict['kg/m3'] = value * 1.0 return_dict['kg/L'] = value * 0.001 return_dict['kPa/m'] = value * 0.0098114 return_dict['lb/ft3'] = value * 0.0624337 return_dict['lb/bbl'] = value * 0.3505071 return_dict['ppg'] = value * 0.0083454 return_dict['psi/ft'] = value * 0.000434 return_dict['psi/100ft'] = value * 0.0433727 return_dict['SG'] = value * 0.001 elif units == 'kg/L': return_dict['g/cm3'] = value * 1.0 return_dict['g/L'] = value * 1000.0 return_dict['kg/m3'] = value * 1000.0 return_dict['kg/L'] = value * 1.0 return_dict['kPa/m'] = value * 9.8114244 return_dict['lb/ft3'] = value * 62.4336642 return_dict['lb/bbl'] = value * 350.5070669 return_dict['ppg'] = value * 8.3454064 return_dict['psi/ft'] = value * 0.4339843 return_dict['psi/100ft'] = value * 43.3726579 return_dict['SG'] = value * 1.0 elif units == 'kPa/m': return_dict['g/cm3'] = value * 0.101922 return_dict['g/L'] = value * 101.922 return_dict['kg/m3'] = value * 101.922 return_dict['kg/L'] = value * 0.101922 return_dict['kPa/m'] = value * 1.0 return_dict['lb/ft3'] = value * 6.3633639 return_dict['lb/bbl'] = value * 35.7243813 return_dict['ppg'] = value * 0.8505805 return_dict['psi/ft'] = value * 0.0442325 return_dict['psi/100ft'] = value * 4.420628 return_dict['SG'] = value * 0.101922 elif units == 'lb/ft3': return_dict['g/cm3'] = value * 0.016017 return_dict['g/L'] = value * 16.017 return_dict['kg/m3'] = value * 16.017 return_dict['kg/L'] = value * 0.016017 return_dict['kPa/m'] = value * 0.1571496 return_dict['lb/ft3'] = value * 1.0 return_dict['lb/bbl'] = value * 5.6140717 return_dict['ppg'] = value * 0.1336684 return_dict['psi/ft'] = value * 0.0069511 return_dict['psi/100ft'] = value * 0.6946999 return_dict['SG'] = value * 0.016017 elif units == 'lb/bbl': return_dict['g/cm3'] = value * 0.002853 return_dict['g/L'] = value * 2.8530095 return_dict['kg/m3'] = value * 2.8530095 return_dict['kg/L'] = value * 0.002853 return_dict['kPa/m'] = value * 0.0279921 return_dict['lb/ft3'] = value * 0.1781238 return_dict['lb/bbl'] = value * 1.0 return_dict['ppg'] = value * 0.0238095 return_dict['psi/ft'] = value * 0.0012382 return_dict['psi/100ft'] = value * 0.1237426 return_dict['SG'] = value * 0.002853 elif units == 'ppg': return_dict['g/cm3'] = value * 0.1198264 return_dict['g/L'] = value * 119.8264 return_dict['kg/m3'] = value * 119.8264 return_dict['kg/L'] = value * 0.1198264 return_dict['kPa/m'] = value * 1.1756677 return_dict['lb/ft3'] = value * 7.4812012 return_dict['lb/bbl'] = value * 42.0 return_dict['ppg'] = value * 1.0 return_dict['psi/ft'] = value * 0.0520028 return_dict['psi/100ft'] = value * 5.1971895 return_dict['SG'] = value * 0.1198264 elif units == 'psi/ft': return_dict['g/cm3'] = value * 2.304231 return_dict['g/L'] = value * 2304.231 return_dict['kg/m3'] = value * 2304.231 return_dict['kg/L'] = value * 2.304231 return_dict['kPa/m'] = value * 22.6077883 return_dict['lb/ft3'] = value * 143.8615846 return_dict['lb/bbl'] = value * 807.6492492 return_dict['ppg'] = value * 19.229744 return_dict['psi/ft'] = value * 1.0 return_dict['psi/100ft'] = value * 99.9406228 return_dict['SG'] = value * 2.304231 elif units == 'psi/100ft': return_dict['g/cm3'] = value * 0.023056 return_dict['g/L'] = value * 23.056 return_dict['kg/m3'] = value * 23.056 return_dict['kg/L'] = value * 0.023056 return_dict['kPa/m'] = value * 0.2262122 return_dict['lb/ft3'] = value * 1.4394706 return_dict['lb/bbl'] = value * 8.0812909 return_dict['ppg'] = value * 0.1924117 return_dict['psi/ft'] = value * 0.0100059 return_dict['psi/100ft'] = value * 1.0 return_dict['SG'] = value * 0.023056 elif units == 'SG': return_dict['g/cm3'] = value * 1.0 return_dict['g/L'] = value * 1000.0 return_dict['kg/m3'] = value * 1000.0 return_dict['kg/L'] = value * 1.0 return_dict['kPa/m'] = value * 9.8114244 return_dict['lb/ft3'] = value * 62.4336642 return_dict['lb/bbl'] = value * 350.5070669 return_dict['ppg'] = value * 8.3454064 return_dict['psi/ft'] = value * 0.4339843 return_dict['psi/100ft'] = value * 43.3726579 return_dict['SG'] = value * 1.0 return return_dict def flow_rate(value, units): return_dict = {} if units == 'bbl/hr': return_dict['bbl/hr'] = value * 1.0 return_dict['bbl/min'] = value * 0.0166667 return_dict['ft3/min'] = value * 0.0935764 return_dict['m3/hr'] = value * 0.1589873 return_dict['m3/min'] = value * 0.0026498 return_dict['gal/hr'] = value * 42.0 return_dict['gpm'] = value * 0.7 return_dict['L/hr'] = value * 158.9872949 return_dict['L/min'] = value * 2.6497882 elif units == 'bbl/min': return_dict['bbl/hr'] = value * 60.0 return_dict['bbl/min'] = value * 1.0 return_dict['ft3/min'] = value * 5.6145833 return_dict['m3/hr'] = value * 9.5392377 return_dict['m3/min'] = value * 0.1589873 return_dict['gal/hr'] = value * 2520.0 return_dict['gpm'] = value * 42.0 return_dict['L/hr'] = value * 9539.2376957 return_dict['L/min'] = value * 158.9872949 elif units == 'ft3/min': return_dict['bbl/hr'] = value * 10.6864564 return_dict['bbl/min'] = value * 0.1781076 return_dict['ft3/min'] = value * 1.0 return_dict['m3/hr'] = value * 1.6990108 return_dict['m3/min'] = value * 0.0283168 return_dict['gal/hr'] = value * 448.8311688 return_dict['gpm'] = value * 7.4805195 return_dict['L/hr'] = value * 1699.0107955 return_dict['L/min'] = value * 28.3168466 elif units == 'm3/hr': return_dict['bbl/hr'] = value * 6.2898108 return_dict['bbl/min'] = value * 0.1048302 return_dict['ft3/min'] = value * 0.5885778 return_dict['m3/hr'] = value * 1.0 return_dict['m3/min'] = value * 0.0166667 return_dict['gal/hr'] = value * 264.1720524 return_dict['gpm'] = value * 4.4028675 return_dict['L/hr'] = value * 1000.0 return_dict['L/min'] = value * 16.6666667 elif units == 'm3/min': return_dict['bbl/hr'] = value * 377.3886462 return_dict['bbl/min'] = value * 6.2898108 return_dict['ft3/min'] = value * 35.3146667 return_dict['m3/hr'] = value * 60.0 return_dict['m3/min'] = value * 1.0 return_dict['gal/hr'] = value * 15850.3231414 return_dict['gpm'] = value * 264.1720524 return_dict['L/hr'] = value * 60000.0 return_dict['L/min'] = value * 1000.0 elif units == 'gal/hr': return_dict['bbl/hr'] = value * 0.0238095 return_dict['bbl/min'] = value * 0.0003968 return_dict['ft3/min'] = value * 0.002228 return_dict['m3/hr'] = value * 0.0037854 return_dict['m3/min'] = value * 6.31e-05 return_dict['gal/hr'] = value * 1.0 return_dict['gpm'] = value * 0.0166667 return_dict['L/hr'] = value * 3.7854118 return_dict['L/min'] = value * 0.0630902 elif units == 'gpm': return_dict['bbl/hr'] = value * 1.4285714 return_dict['bbl/min'] = value * 0.0238095 return_dict['ft3/min'] = value * 0.1336806 return_dict['m3/hr'] = value * 0.2271247 return_dict['m3/min'] = value * 0.0037854 return_dict['gal/hr'] = value * 60.0 return_dict['gpm'] = value * 1.0 return_dict['L/hr'] = value * 227.124707 return_dict['L/min'] = value * 3.7854118 elif units == 'L/hr': return_dict['bbl/hr'] = value * 0.0062898 return_dict['bbl/min'] = value * 0.0001048 return_dict['ft3/min'] = value * 0.0005886 return_dict['m3/hr'] = value * 0.001 return_dict['m3/min'] = value * 1.67e-05 return_dict['gal/hr'] = value * 0.2641721 return_dict['gpm'] = value * 0.0044029 return_dict['L/hr'] = value * 1.0 return_dict['L/min'] = value * 0.0166667 elif units == 'L/min': return_dict['bbl/hr'] = value * 0.3773886 return_dict['bbl/min'] = value * 0.0062898 return_dict['ft3/min'] = value * 0.0353147 return_dict['m3/hr'] = value * 0.06 return_dict['m3/min'] = value * 0.001 return_dict['gal/hr'] = value * 15.8503231 return_dict['gpm'] = value * 0.2641721 return_dict['L/hr'] = value * 60.0 return_dict['L/min'] = value * 1.0 return return_dict def drilling_rate(value, units): return_dict = {} if units == 'ft/d': return_dict['ft/d'] = value * 1.0 return_dict['ft/hr'] = value * 0.0416667 return_dict['ft/min'] = value * 0.0006944 return_dict['ft/s'] = value * 1.16e-05 return_dict['m/d'] = value * 0.3048 return_dict['m/hr'] = value * 0.0127 return_dict['m/min'] = value * 0.0002117 return_dict['m/s'] = value * 3.5e-06 elif units == 'ft/hr': return_dict['ft/d'] = value * 24.0 return_dict['ft/hr'] = value * 1.0 return_dict['ft/min'] = value * 0.0166667 return_dict['ft/s'] = value * 0.0002778 return_dict['m/d'] = value * 7.3152 return_dict['m/hr'] = value * 0.3048 return_dict['m/min'] = value * 0.00508 return_dict['m/s'] = value * 8.47e-05 elif units == 'ft/min': return_dict['ft/d'] = value * 1440.0 return_dict['ft/hr'] = value * 60.0 return_dict['ft/min'] = value * 1.0 return_dict['ft/s'] = value * 0.0166667 return_dict['m/d'] = value * 438.9119993 return_dict['m/hr'] = value * 18.288 return_dict['m/min'] = value * 0.3048 return_dict['m/s'] = value * 0.00508 elif units == 'ft/s': return_dict['ft/d'] = value * 86400.0 return_dict['ft/hr'] = value * 3600.0 return_dict['ft/min'] = value * 60.0 return_dict['ft/s'] = value * 1.0 return_dict['m/d'] = value * 26334.71996 return_dict['m/hr'] = value * 1097.2799983 return_dict['m/min'] = value * 18.288 return_dict['m/s'] = value * 0.3048 elif units == 'm/d': return_dict['ft/d'] = value * 3.2808399 return_dict['ft/hr'] = value * 0.1367017 return_dict['ft/min'] = value * 0.0022784 return_dict['ft/s'] = value * 3.8e-05 return_dict['m/d'] = value * 1.0 return_dict['m/hr'] = value * 0.0416667 return_dict['m/min'] = value * 0.0006944 return_dict['m/s'] = value * 1.16e-05 elif units == 'm/hr': return_dict['ft/d'] = value * 78.7401576 return_dict['ft/hr'] = value * 3.2808399 return_dict['ft/min'] = value * 0.0546807 return_dict['ft/s'] = value * 0.0009113 return_dict['m/d'] = value * 24.0 return_dict['m/hr'] = value * 1.0 return_dict['m/min'] = value * 0.0166667 return_dict['m/s'] = value * 0.0002778 elif units == 'm/min': return_dict['ft/d'] = value * 4724.409456 return_dict['ft/hr'] = value * 196.850394 return_dict['ft/min'] = value * 3.2808399 return_dict['ft/s'] = value * 0.0546807 return_dict['m/d'] = value * 1440.0 return_dict['m/hr'] = value * 60.0 return_dict['m/min'] = value * 1.0 return_dict['m/s'] = value * 0.0166667 elif units == 'm/s': return_dict['ft/d'] = value * 283464.56736 return_dict['ft/hr'] = value * 11811.02364 return_dict['ft/min'] = value * 196.850394 return_dict['ft/s'] = value * 3.2808399 return_dict['m/d'] = value * 86400.0 return_dict['m/hr'] = value * 3600.0 return_dict['m/min'] = value * 60.0 return_dict['m/s'] = value * 1.0 return return_dict def weight_length(value, units): return_dict = {} if units == 'lb/ft': return_dict['lb/ft'] = value return_dict['kg/m'] = value * 1.48816 elif units == 'kg/m': return_dict['lb/ft'] = value * 0.671969 return_dict['kg/m'] = value return return_dict def geothermal_gradient(value, units): return_dict = {} if units == 'c/100m': return_dict['c/100m'] = value return_dict['f/100ft'] = value * 0.549 elif units == 'f/100ft': return_dict['c/100m'] = value / 0.549 return_dict['f/100ft'] = value return return_dict
DYNAMIC_API_URL = 'https://api.vc.bilibili.com/dynamic_svr/v1/dynamic_svr/space_history' GET_DYNAMIC_DETAIL_API_URL = 'https://api.vc.bilibili.com/dynamic_svr/v1/dynamic_svr/get_dynamic_detail' USER_INFO_API_URL = 'https://api.bilibili.com/x/space/acc/info' DYNAMIC_URL = 'https://t.bilibili.com/'
dynamic_api_url = 'https://api.vc.bilibili.com/dynamic_svr/v1/dynamic_svr/space_history' get_dynamic_detail_api_url = 'https://api.vc.bilibili.com/dynamic_svr/v1/dynamic_svr/get_dynamic_detail' user_info_api_url = 'https://api.bilibili.com/x/space/acc/info' dynamic_url = 'https://t.bilibili.com/'
def readDiary(): day = input("What day do you want to read? ") file = open(day, "r") line = file.read() print(line) file.close() def writeDiary(): day = input("What day is your diary for? ") file = open(day, "w") line = input("Enter entry: ") file.write(line) file.close() operation = input("Read entries or write entries (R/W)? ") if (operation == "R"): readDiary() elif (operation == "W"): writeDiary() else: print("Sorry, you can only enter a R (for read) or W (for write). Run the program again.") print("=== All done ===")
def read_diary(): day = input('What day do you want to read? ') file = open(day, 'r') line = file.read() print(line) file.close() def write_diary(): day = input('What day is your diary for? ') file = open(day, 'w') line = input('Enter entry: ') file.write(line) file.close() operation = input('Read entries or write entries (R/W)? ') if operation == 'R': read_diary() elif operation == 'W': write_diary() else: print('Sorry, you can only enter a R (for read) or W (for write). Run the program again.') print('=== All done ===')
T = int(input()) for c in range(T): N = int(input()) sum = N * (N + 1) // 2 sqs = N * (N + 1) * (2 * N + 1) // 6 d = sum * sum - sqs print(abs(d))
t = int(input()) for c in range(T): n = int(input()) sum = N * (N + 1) // 2 sqs = N * (N + 1) * (2 * N + 1) // 6 d = sum * sum - sqs print(abs(d))
# @Vipin Chaudhari host='192.168.1.15' meetup_rsvp_stream_api_url = "http://stream.meetup.com/2/rsvps" # Kafka info kafka_topic = "meetup-rsvp-topic" kafka_server = host+':9092' # MySQL info mysql_user = "python" mysql_pwd = "python" mysql_db = "meetup" mysql_driver = "com.mysql.cj.jdbc.Driver" mysql_tbl = "MeetupRSVP" mysql_jdbc_url = "jdbc:mysql://" + host + ":3306/" + mysql_db + "?useJDBCCompliantTimezoneShift=true&useLegacyDatetimeCode=false&serverTimezone=UTC" # MongoDB info mongodb_host=host mongodb_user = "admin" mongodb_pwd = "admin" mongodb_db = "meetup" mongodb_collection = "tbl_meetup_rsvp"
host = '192.168.1.15' meetup_rsvp_stream_api_url = 'http://stream.meetup.com/2/rsvps' kafka_topic = 'meetup-rsvp-topic' kafka_server = host + ':9092' mysql_user = 'python' mysql_pwd = 'python' mysql_db = 'meetup' mysql_driver = 'com.mysql.cj.jdbc.Driver' mysql_tbl = 'MeetupRSVP' mysql_jdbc_url = 'jdbc:mysql://' + host + ':3306/' + mysql_db + '?useJDBCCompliantTimezoneShift=true&useLegacyDatetimeCode=false&serverTimezone=UTC' mongodb_host = host mongodb_user = 'admin' mongodb_pwd = 'admin' mongodb_db = 'meetup' mongodb_collection = 'tbl_meetup_rsvp'
class Layer: def __init__(self): self.input = None self.output = None def forward_propagation(self,input): raise NotImplementedError def backward_propagation(self, output_error,learning_rate): raise NotImplementedError
class Layer: def __init__(self): self.input = None self.output = None def forward_propagation(self, input): raise NotImplementedError def backward_propagation(self, output_error, learning_rate): raise NotImplementedError
def to_fp_name(path, prefix='fp'): if path == 'stdout': return 'stdout' if path == 'stderr': return 'stderr' if path == 'stdin': return 'stdin' # For now, just construct a fd variable name by taking objectionable chars out of the path cleaned = path.replace('.', '_').replace ('/', '_').replace ('-', '_').replace ('+', 'x') return "{}_{}".format(prefix, cleaned) def doinatest(): return "YO"
def to_fp_name(path, prefix='fp'): if path == 'stdout': return 'stdout' if path == 'stderr': return 'stderr' if path == 'stdin': return 'stdin' cleaned = path.replace('.', '_').replace('/', '_').replace('-', '_').replace('+', 'x') return '{}_{}'.format(prefix, cleaned) def doinatest(): return 'YO'
class TreeNode: def __init__(self, x): self.val = x self.left = None self.right = None class Solution: def lowestCommonAncestor(self, root: TreeNode, p: TreeNode, q: TreeNode) -> TreeNode: if root is None: return None left = self.lowestCommonAncestor(root.left, p, q) right = self.lowestCommonAncestor(root.right, p, q) if (left and right) or root in [p,q]: return root else: return left or right
class Treenode: def __init__(self, x): self.val = x self.left = None self.right = None class Solution: def lowest_common_ancestor(self, root: TreeNode, p: TreeNode, q: TreeNode) -> TreeNode: if root is None: return None left = self.lowestCommonAncestor(root.left, p, q) right = self.lowestCommonAncestor(root.right, p, q) if left and right or root in [p, q]: return root else: return left or right
class MarginGetError(Exception): pass class PositionGetError(Exception): pass class TickGetError(Exception): pass class TradeGetError(Exception): pass class BarGetError(Exception): pass class FillGetError(Exception): pass class OrderPostError(Exception): pass class OrderGetError(Exception): pass class OrderBookGetError(Exception): pass class BalanceGetError(Exception): pass class AssetTransferError(Exception): pass
class Margingeterror(Exception): pass class Positiongeterror(Exception): pass class Tickgeterror(Exception): pass class Tradegeterror(Exception): pass class Bargeterror(Exception): pass class Fillgeterror(Exception): pass class Orderposterror(Exception): pass class Ordergeterror(Exception): pass class Orderbookgeterror(Exception): pass class Balancegeterror(Exception): pass class Assettransfererror(Exception): pass
class MyStuff(object): def __init__(self): self.stark = "I am classy Iron Man." def groot(self): print("I am classy groot!") thing = MyStuff() thing.groot() print(thing.stark)
class Mystuff(object): def __init__(self): self.stark = 'I am classy Iron Man.' def groot(self): print('I am classy groot!') thing = my_stuff() thing.groot() print(thing.stark)
expected_output = { "GigabitEthernet0/1/1": { "service_policy": { "output": { "policy_name": { "shape-out": { "class_map": { "class-default": { "bytes": 0, "bytes_output": 0, "match": ["any"], "match_evaluation": "match-any", "no_buffer_drops": 0, "packets": 0, "pkts_output": 0, "queue_depth": 0, "queue_limit_packets": "64", "queueing": True, "rate": { "drop_rate_bps": 0, "interval": 300, "offered_rate_bps": 0, }, "shape_bc_bps": 2000, "shape_be_bps": 2000, "shape_cir_bps": 500000, "shape_type": "average", "target_shape_rate": 500000, "total_drops": 0, } } } } } } } }
expected_output = {'GigabitEthernet0/1/1': {'service_policy': {'output': {'policy_name': {'shape-out': {'class_map': {'class-default': {'bytes': 0, 'bytes_output': 0, 'match': ['any'], 'match_evaluation': 'match-any', 'no_buffer_drops': 0, 'packets': 0, 'pkts_output': 0, 'queue_depth': 0, 'queue_limit_packets': '64', 'queueing': True, 'rate': {'drop_rate_bps': 0, 'interval': 300, 'offered_rate_bps': 0}, 'shape_bc_bps': 2000, 'shape_be_bps': 2000, 'shape_cir_bps': 500000, 'shape_type': 'average', 'target_shape_rate': 500000, 'total_drops': 0}}}}}}}}
TOKEN = '668308467:AAETX4hdMRnVvYVBP4bK5WDgvL8zIXoHq5g' main_url = 'https://schedule.vekclub.com/api/v1/' list_group = 'handbook/groups-by-institution?institutionId=4' shedule_group ='schedule/group?groupId='
token = '668308467:AAETX4hdMRnVvYVBP4bK5WDgvL8zIXoHq5g' main_url = 'https://schedule.vekclub.com/api/v1/' list_group = 'handbook/groups-by-institution?institutionId=4' shedule_group = 'schedule/group?groupId='
# SOME BASIC CONSTANT AND MASS FUNCTION OF POISSION DISTRIBUTION # e is Euler's number (e = 2.71828...) # f(k, lambda) = lambda^k * e^-lambda / k! # Task: # A random variable, X , follows Poisson distribution with mean of 2.5. Find the probability with which the random variable X is equal to 5. # Define functions def factorial(n): if n == 1 or n == 0: return 1 if n > 1: return factorial(n - 1) * n # Input data lam = float(input()) k = float(input()) e = 2.71828 # We can show result on the screen # The round() function returns a floating point number that is a rounded version of the specified number, with the specified number of decimals. # 3 denotes decimal places (i.e., 1.234 format): result = ((lam ** k) * (e ** -lam)) / factorial(k) print(round(result, 3))
def factorial(n): if n == 1 or n == 0: return 1 if n > 1: return factorial(n - 1) * n lam = float(input()) k = float(input()) e = 2.71828 result = lam ** k * e ** (-lam) / factorial(k) print(round(result, 3))
s1 = {'ab', 3,4, (5,6)} s2 = {'ab', 7, (7,6)} print(s1-s2) # Returns all the items in both s1 and s2 print(s1.intersection(s2)) # Returns all the items in a set print(s1.union(s2)) print('ab' in s1) # Testing for a member's presence in the set # Lopping through elements in a set for element in s1: print(element) # Frozen or Immutable sets s1.add(frozenset(s2)) print(s1) # Using frozen set as a key to a dictionary fs1 = frozenset(s1) fs2 = frozenset(s2) {fs1: 'fs1', fs2: 'fs2'}
s1 = {'ab', 3, 4, (5, 6)} s2 = {'ab', 7, (7, 6)} print(s1 - s2) print(s1.intersection(s2)) print(s1.union(s2)) print('ab' in s1) for element in s1: print(element) s1.add(frozenset(s2)) print(s1) fs1 = frozenset(s1) fs2 = frozenset(s2) {fs1: 'fs1', fs2: 'fs2'}
# -*- coding: utf-8 -*- class TreeNode: def __init__(self, x): self.val = x self.left = None self.right = None class Solution: def tree2str(self, t): if t is None: return '' result = [str(t.val)] if t.left is not None or t.right is not None: result.extend(['(', self.tree2str(t.left), ')']) if t.right is not None: result.extend(['(', self.tree2str(t.right), ')']) return ''.join(result) if __name__ == '__main__': solution = Solution() t0_0 = TreeNode(1) t0_1 = TreeNode(2) t0_2 = TreeNode(3) t0_3 = TreeNode(4) t0_1.left = t0_3 t0_0.right = t0_2 t0_0.left = t0_1 assert '1(2(4))(3)' == solution.tree2str(t0_0) t1_0 = TreeNode(1) t1_1 = TreeNode(2) t1_2 = TreeNode(3) t1_3 = TreeNode(4) t1_1.right = t1_3 t1_0.right = t1_2 t1_0.left = t1_1 assert '1(2()(4))(3)' == solution.tree2str(t1_0)
class Treenode: def __init__(self, x): self.val = x self.left = None self.right = None class Solution: def tree2str(self, t): if t is None: return '' result = [str(t.val)] if t.left is not None or t.right is not None: result.extend(['(', self.tree2str(t.left), ')']) if t.right is not None: result.extend(['(', self.tree2str(t.right), ')']) return ''.join(result) if __name__ == '__main__': solution = solution() t0_0 = tree_node(1) t0_1 = tree_node(2) t0_2 = tree_node(3) t0_3 = tree_node(4) t0_1.left = t0_3 t0_0.right = t0_2 t0_0.left = t0_1 assert '1(2(4))(3)' == solution.tree2str(t0_0) t1_0 = tree_node(1) t1_1 = tree_node(2) t1_2 = tree_node(3) t1_3 = tree_node(4) t1_1.right = t1_3 t1_0.right = t1_2 t1_0.left = t1_1 assert '1(2()(4))(3)' == solution.tree2str(t1_0)
#!/usr/bin/python # -*- coding: utf-8 -*- # Simulation : https://framagit.org/kepon/PvMonit/issues/8 # ~ print("PID:0x203"); # ~ print("FW:146"); # ~ print("SER#:HQ18523ZGZI"); # ~ print("V:25260"); # ~ print("I:100"); # ~ print("VPV:28600"); # ~ print("PPV:6"); # ~ print("CS:3"); # ~ print("MPPT:2"); # ~ print("OR:0x00000000"); # ~ print("ERR:0"); # ~ print("LOAD:OFF"); # ~ print("Relay:OFF"); # ~ print("H19:3213"); # ~ print("H20:76"); # ~ print("H21:293"); # ~ print("H22:73"); # ~ print("H23:361"); # Simulation BMV 700 print("AR:0"); print("Alarm:OFF"); print("BMV:700"); print("CE:-36228"); print("FW: 0308"); print("H1:-102738"); print("H10:121"); print("H11:0"); print("H12:0"); print("H17:59983"); print("H18:70519"); print("H2:-36228"); print("H3:-102738"); print("H4:1"); print("H5:0"); print("H6:-24205923"); print("H7:21238"); print("H8:29442"); print("H9:104538"); print("I:-2082"); print("P:-50"); print("PID:0x203"); print("Relay:OFF"); print("SOC:886"); print("TTG:3429"); print("V:24061");
print('AR:0') print('Alarm:OFF') print('BMV:700') print('CE:-36228') print('FW: 0308') print('H1:-102738') print('H10:121') print('H11:0') print('H12:0') print('H17:59983') print('H18:70519') print('H2:-36228') print('H3:-102738') print('H4:1') print('H5:0') print('H6:-24205923') print('H7:21238') print('H8:29442') print('H9:104538') print('I:-2082') print('P:-50') print('PID:0x203') print('Relay:OFF') print('SOC:886') print('TTG:3429') print('V:24061')
def check_prime(n): f = 0 for i in range (2, n//2 +1): if n%i==0 : f= 1 break return f def min_range(d): a = (10**(d-1)) return a def max_range(d): b = (10**d) return b d=int(input("Enter d")) twin_prime_list = [] for i in range ( min_range(d) , max_range(d) ): if check_prime(i)== 0 and check_prime(i+2)== 0: twin_prime_list.append((i, i+2)) with open("twin_prime_list.txt", "w") as f: for twin_pair in twin_prime_list: f.write(str(twin_pair)) f.write("\n")
def check_prime(n): f = 0 for i in range(2, n // 2 + 1): if n % i == 0: f = 1 break return f def min_range(d): a = 10 ** (d - 1) return a def max_range(d): b = 10 ** d return b d = int(input('Enter d')) twin_prime_list = [] for i in range(min_range(d), max_range(d)): if check_prime(i) == 0 and check_prime(i + 2) == 0: twin_prime_list.append((i, i + 2)) with open('twin_prime_list.txt', 'w') as f: for twin_pair in twin_prime_list: f.write(str(twin_pair)) f.write('\n')
# 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 # DFS class Solution: def levelOrder(self, root: TreeNode) -> List[List[int]]: self.ans = [] self.dfs(root, 0) return self.ans def dfs(self, node, level): if not node: return if level == len(self.ans): self.ans.append([node.val]) else: self.ans[level].append(node.val) self.dfs(node.left, level + 1) self.dfs(node.right, level + 1) # BFS class Solution: def levelOrder(self, root: TreeNode) -> List[List[int]]: ans = [] queue = collections.deque([(root, 0)]) while queue: node, level = queue.popleft() if node: if level == len(ans): ans.append([node.val]) else: ans[level].append(node.val) queue.append((node.left, level + 1)) queue.append((node.right, level + 1)) return ans
class Treenode: def __init__(self, val=0, left=None, right=None): self.val = val self.left = left self.right = right class Solution: def level_order(self, root: TreeNode) -> List[List[int]]: self.ans = [] self.dfs(root, 0) return self.ans def dfs(self, node, level): if not node: return if level == len(self.ans): self.ans.append([node.val]) else: self.ans[level].append(node.val) self.dfs(node.left, level + 1) self.dfs(node.right, level + 1) class Solution: def level_order(self, root: TreeNode) -> List[List[int]]: ans = [] queue = collections.deque([(root, 0)]) while queue: (node, level) = queue.popleft() if node: if level == len(ans): ans.append([node.val]) else: ans[level].append(node.val) queue.append((node.left, level + 1)) queue.append((node.right, level + 1)) return ans
numbers = (input("enter the value of a number")) def divisors(numbers): array = [] for item in range(1, numbers): if(numbers % item == 0): print("divisors items", item) array.append(item) print(array) # print("all items",item) divisors(numbers)
numbers = input('enter the value of a number') def divisors(numbers): array = [] for item in range(1, numbers): if numbers % item == 0: print('divisors items', item) array.append(item) print(array) divisors(numbers)
# Space : O(n) # Time : O(n**2) class Solution: def jump(self, nums: List[int]) -> int: n = len(nums) dp = [10**5] * n dp[0] = 0 if n == 1: return 0 for i in range(n): for j in range(nums[i]): dp[j+i+1] = min(dp[j+i+1], dp[i] + 1) if j+i+1 == n-1: return dp[-1] return dp[-1]
class Solution: def jump(self, nums: List[int]) -> int: n = len(nums) dp = [10 ** 5] * n dp[0] = 0 if n == 1: return 0 for i in range(n): for j in range(nums[i]): dp[j + i + 1] = min(dp[j + i + 1], dp[i] + 1) if j + i + 1 == n - 1: return dp[-1] return dp[-1]
while True: a = input() if int(a) == 42: break; print(int(a))
while True: a = input() if int(a) == 42: break print(int(a))
__version__ = '0.0.7' def get_version(): return __version__
__version__ = '0.0.7' def get_version(): return __version__
#Question:1 # Initializing matrix matrix = [] # Taking input from user of rows and column row = int(input("Enter the number of rows:")) column = int(input("Enter the number of columns:")) print("Enter the elements row wise:") # Getting elements of matrix from user for i in range(row): a =[] for j in range (column): a.append(int(input())) matrix.append(a) print() # Printing user entered matrix print("Entered Matrix is: ") for i in range(row): for j in range(column): print(matrix[i][j], end = " ") print() print() #Printing prime numbers of matrix: print("The prime numbers in the matrix are: ") for i in range(row): for j in range(column): if( matrix[i][j] > 1): for p in range(2, matrix[i][j]): if(matrix[i][j] % p) == 0: break else: print(matrix[i][j])
matrix = [] row = int(input('Enter the number of rows:')) column = int(input('Enter the number of columns:')) print('Enter the elements row wise:') for i in range(row): a = [] for j in range(column): a.append(int(input())) matrix.append(a) print() print('Entered Matrix is: ') for i in range(row): for j in range(column): print(matrix[i][j], end=' ') print() print() print('The prime numbers in the matrix are: ') for i in range(row): for j in range(column): if matrix[i][j] > 1: for p in range(2, matrix[i][j]): if matrix[i][j] % p == 0: break else: print(matrix[i][j])
devices = \ { # ------------------------------------------------------------------------- # NXP ARM7TDMI devices Series LPC21xx, LPC22xx, LPC23xx, LPC24xx "lpc2129": { "defines": ["__ARM_LPC2000__"], "linkerscript": "arm7/lpc/linker/lpc2129.ld", "size": { "flash": 262144, "ram": 16384 }, }, "lpc2368": { "defines": ["__ARM_LPC2000__", "__ARM_LPC23_24__"], "linkerscript": "arm7/lpc/linker/lpc2368.ld", "size": { "flash": 524288, "ram": 32768 }, }, "lpc2468": { "defines": ["__ARM_LPC2000__", "__ARM_LPC23_24__"], "linkerscript": "arm7/lpc/linker/lpc2468.ld", "size": { "flash": 524288, "ram": 65536 }, }, # ------------------------------------------------------------------------- # NXP Cortex-M0 devices Series LPC11xx and LPC11Cxx "lpc1112_301": { "defines": ["__ARM_LPC11XX__",], "linkerscript": "cortex_m0/lpc/linker/lpc1112_301.ld", "size": { "flash": 16384, "ram": 8192 }, }, "lpc1114_301": { "defines": ["__ARM_LPC11XX__",], "linkerscript": "cortex_m0/lpc/linker/lpc1114_301.ld", "size": { "flash": 32768, "ram": 8192 }, }, "lpc1115_303": { "defines": ["__ARM_LPC11XX__",], "linkerscript": "cortex_m0/lpc/linker/lpc1115_303.ld", "size": { "flash": 65536, "ram": 8192 }, }, # Integrated CAN transceiver "lpc11c22_301": { "defines": ["__ARM_LPC11XX__", "__ARM_LPC11CXX__"], "linkerscript": "cortex_m0/lpc/linker/lpc11c22.ld", "size": { "flash": 16384, "ram": 8192 }, }, # Integrated CAN transceiver "lpc11c24_301": { "defines": ["__ARM_LPC11XX__", "__ARM_LPC11CXX__"], "linkerscript": "cortex_m0/lpc/linker/lpc11c24.ld", "size": { "flash": 32768, "ram": 8192 }, }, # ------------------------------------------------------------------------- # NXP Cortex-M3 devices Series LPC13xx # TODO # ------------------------------------------------------------------------- "lpc1343": { "defines": ["__ARM_LPC13XX__",], "linkerscript": "cortex_m3/lpc/linker/lpc1343.ld", "size": { "flash": 32768, "ram":8192 }, }, "lpc1769": { "defines": ["__ARM_LPC17XX__"], "linkerscript": "cortex_m3/lpc/linker/lpc1769.ld", "size": { "flash": 524288, "ram": 65536 }, # 32kB local SRAM + 2x16kB AHB SRAM }, # ------------------------------------------------------------------------- # AT91SAM7S "at91sam7s32": { "defines": ["__ARM_AT91__", "__ARM_AT91SAM7S__", "__ARM_AT91SAM7S32__"], "linkerscript": "arm7/at91/linker/at91sam7s32.ld", "size": { "flash": 32768, "ram": 4096 }, }, "at91sam7s321": { "defines": ["__ARM_AT91__", "__ARM_AT91SAM7S__", "__ARM_AT91SAM7S321__"], "linkerscript": "arm7/at91/linker/at91sam7s32.ld", "size": { "flash": 32768, "ram": 8192 }, }, "at91sam7s64": { "defines": ["__ARM_AT91__", "__ARM_AT91SAM7S__", "__ARM_AT91SAM7S64__"], "linkerscript": "arm7/at91/linker/at91sam7s64.ld", "size": { "flash": 65536, "ram": 16384 }, }, "at91sam7s128": { "defines": ["__ARM_AT91__", "__ARM_AT91SAM7S__", "__ARM_AT91SAM7S128__"], "linkerscript": "arm7/at91/linker/at91sam7s128.ld", "size": { "flash": 131072, "ram": 32768 }, }, "at91sam7s256": { "defines": ["__ARM_AT91__", "__ARM_AT91SAM7S__", "__ARM_AT91SAM7S256__"], "linkerscript": "arm7/at91/linker/at91sam7s256.ld", "size": { "flash": 262144, "ram": 65536 }, }, "at91sam7s512": { "defines": ["__ARM_AT91__", "__ARM_AT91SAM7S__", "__ARM_AT91SAM7S512__"], "linkerscript": "arm7/at91/linker/at91sam7s512.ld", "size": { "flash": 524288, "ram": 65536 }, }, # ------------------------------------------------------------------------- # AT91SAM7X "at91sam7x128": { "defines": ["__ARM_AT91__", "__ARM_AT91SAM7X__"], "linkerscript": "arm7/at91/linker/at91sam7x128.ld", "size": { "flash": 131072, "ram": 32768 }, }, "at91sam7x256": { "defines": ["__ARM_AT91__", "__ARM_AT91SAM7X__"], "linkerscript": "arm7/at91/linker/at91sam7x256.ld", "size": { "flash": 262144, "ram": 65536 }, }, "at91sam7x512": { "defines": ["__ARM_AT91__", "__ARM_AT91SAM7X__"], "linkerscript": "arm7/at91/linker/at91sam7x512.ld", "size": { "flash": 524288, "ram": 131072 }, }, # ------------------------------------------------------------------------- # STM32F103 p s # # Pins (p): # T | 36 pins # C | 48 pins # R | 64 pins # V | 100 pins # Z | 144 pins # # Size (s): # 4 | 16 kB Flash, 6 kB RAM low density line (T, C, R) # 6 | 32 kB Flash, 10 kB RAM # 8 | 64 kB Flash, 20 kB RAM medium density (T, C, R, V) # B | 128 kB Flash, 20 kB RAM # C | 256 kB Flash, 48 kB RAM high density (R, V, Z) # D | 384 kB Flash, 64 kB RAM # E | 512 kB Flash, 64 kB RAM # F | 768 kB Flash, 96 kB RAM xl density (R, V, Z) # G | 1 MB Flash, 96 kB RAM # "stm32f103_4": { "defines": ["__STM32F103__", "__ARM_STM32__", "STM32F10X", "STM32F10X_LD", "STM32_LOW_DENSITY"], "linkerscript": "cortex_m3/stm32/linker/stm32f103_4.ld", "size": { "flash": 16384, "ram": 6144 }, }, "stm32f103_6": { "defines": ["__STM32F103__", "__ARM_STM32__", "STM32F10X", "STM32F10X_LD", "STM32_LOW_DENSITY"], "linkerscript": "cortex_m3/stm32/linker/stm32f103_6.ld", "size": { "flash": 32768, "ram": 10240 }, }, "stm32f103_8": { "defines": ["__STM32F103__", "__ARM_STM32__", "STM32F10X", "STM32F10X_MD", "STM32_MEDIUM_DENSITY"], "linkerscript": "cortex_m3/stm32/linker/stm32f103_8.ld", "size": { "flash": 65536, "ram": 20480 }, }, "stm32f103_b": { "defines": ["__STM32F103__", "__ARM_STM32__", "STM32F10X", "STM32F10X_MD", "STM32_MEDIUM_DENSITY"], "linkerscript": "cortex_m3/stm32/linker/stm32f103_b.ld", "size": { "flash": 131072, "ram": 20480 }, }, "stm32f103_c": { "defines": ["__STM32F103__", "__ARM_STM32__", "STM32F10X", "STM32F10X_HD", "STM32_HIGH_DENSITY"], "linkerscript": "cortex_m3/stm32/linker/stm32f103_c.ld", "size": { "flash": 262144, "ram": 49152 }, }, "stm32f103_d": { "defines": ["__STM32F103__", "__ARM_STM32__", "STM32F10X", "STM32F10X_HD", "STM32_HIGH_DENSITY"], "linkerscript": "cortex_m3/stm32/linker/stm32f103_d.ld", "size": { "flash": 393216, "ram": 65536 }, }, "stm32f103_e": { "defines": ["__STM32F103__", "__ARM_STM32__", "STM32F10X", "STM32F10X_HD", "STM32_HIGH_DENSITY"], "linkerscript": "cortex_m3/stm32/linker/stm32f103_e.ld", "size": { "flash": 524288, "ram": 65536 }, }, "stm32f103_f": { "defines": ["__STM32F103__", "__ARM_STM32__", "STM32F10X", "STM32F10X_XL", "STM32_XL_DENSITY"], "linkerscript": "cortex_m3/stm32/linker/stm32f103_f.ld", "size": { "flash": 786432, "ram": 98304 }, }, "stm32f103_g": { "defines": ["__STM32F103__", "__ARM_STM32__", "STM32F10X", "STM32F10X_XL", "STM32_XL_DENSITY"], "linkerscript": "cortex_m3/stm32/linker/stm32f103_g.ld", "size": { "flash": 1048576, "ram": 98304 }, }, # STM32F105 p s (pins: R, V) # # Size (s): # 8 | 64 kB Flash, 20 kB RAM # B | 128 kB Flash, 32 kB RAM # C | 256 kB Flash, 64 kB RAM # "stm32f105_8": { "defines": ["__STM32F105__", "__ARM_STM32__", "STM32F10X", "STM32F10X_CL", "STM32_CONNECTIVITY"], "linkerscript": "cortex_m3/stm32/linker/stm32f105_8.ld", "size": { "flash": 65536, "ram": 20480 }, }, "stm32f105_b": { "defines": ["__STM32F105__", "__ARM_STM32__", "STM32F10X", "STM32F10X_CL", "STM32_CONNECTIVITY"], "linkerscript": "cortex_m3/stm32/linker/stm32f105_b.ld", "size": { "flash": 131072, "ram": 32768 }, }, "stm32f105_c": { "defines": ["__STM32F105__", "__ARM_STM32__", "STM32F10X", "STM32F10X_CL", "STM32_CONNECTIVITY"], "linkerscript": "cortex_m3/stm32/linker/stm32f105_c.ld", "size": { "flash": 262144, "ram": 65536 }, }, # STM32F107 p s (pins: R, V) # # Size (s): # B | 128 kB Flash, 48 kB RAM # C | 256 kB Flash, 64 kB RAM # "stm32f107_b": { "defines": ["__STM32F107__", "__ARM_STM32__", "STM32F10X", "STM32F10X_CL", "STM32_CONNECTIVITY"], "linkerscript": "cortex_m3/stm32/linker/stm32f107_b.ld", "size": { "flash": 131072, "ram": 49152 }, }, "stm32f107_c": { "defines": ["__STM32F107__", "__ARM_STM32__", "STM32F10X", "STM32F10X_CL", "STM32_CONNECTIVITY"], "linkerscript": "cortex_m3/stm32/linker/stm32f107_c.ld", "size": { "flash": 262144, "ram": 65536 }, }, # ------------------------------------------------------------------------- # STM32F205 p s # # Pins (p): # R | 64 pins # V | 100 pins # Z | 144 pins # # Size (s): # B | 128 kB Flash, 48+16 kB RAM (R, V) # C | 256 kB Flash, 80+16 kB RAM (R, V, Z) # E | 512 kB Flash, 112+16 kB RAM (R, V, Z) # F | 768 kB Flash, 112+16 kB RAM (R, V, Z) # G | 1 MB Flash, 112+16 kB RAM (R, V, Z) # "stm32f205_b": { "defines": ["__STM32F205__", "__ARM_STM32__", "STM32F2XX"], "linkerscript": "cortex_m3/stm32/linker/stm32f205_b.ld", "size": { "flash": 131072, "ram": 49152 }, }, "stm32f205_c": { "defines": ["__STM32F205__", "__ARM_STM32__", "STM32F2XX"], "linkerscript": "cortex_m3/stm32/linker/stm32f205_c.ld", "size": { "flash": 262144, "ram": 81920 }, }, "stm32f205_e": { "defines": ["__STM32F205__", "__ARM_STM32__", "STM32F2XX"], "linkerscript": "cortex_m3/stm32/linker/stm32f205_e.ld", "size": { "flash": 524288, "ram": 114688 }, }, "stm32f205_f": { "defines": ["__STM32F205__", "__ARM_STM32__", "STM32F2XX"], "linkerscript": "cortex_m3/stm32/linker/stm32f205_f.ld", "size": { "flash": 786432, "ram": 114688 }, }, "stm32f205_g": { "defines": ["__STM32F205__", "__ARM_STM32__", "STM32F2XX"], "linkerscript": "cortex_m3/stm32/linker/stm32f205_g.ld", "size": { "flash": 1048576, "ram": 114688 }, }, # STM32F207 p s # # Pins (p): # V | 100 pins # Z | 144 pins # I | 176 pins # # Size (s): # C | 256 kB Flash, 112+16 kB RAM # E | 512 kB Flash, 112+16 kB RAM # F | 768 kB Flash, 112+16 kB RAM # G | 1 MB Flash, 112+16 kB RAM # "stm32f207_c": { "defines": ["__STM32F207__", "__ARM_STM32__", "STM32F2XX"], "linkerscript": "cortex_m3/stm32/linker/stm32f207_c.ld", "size": { "flash": 262144, "ram": 114688 }, }, "stm32f207_e": { "defines": ["__STM32F207__", "__ARM_STM32__", "STM32F2XX"], "linkerscript": "cortex_m3/stm32/linker/stm32f207_e.ld", "size": { "flash": 524288, "ram": 114688 }, }, "stm32f207_f": { "defines": ["__STM32F207__", "__ARM_STM32__", "STM32F2XX"], "linkerscript": "cortex_m3/stm32/linker/stm32f207_f.ld", "size": { "flash": 786432, "ram": 114688 }, }, "stm32f207_g": { "defines": ["__STM32F207__", "__ARM_STM32__", "STM32F2XX"], "linkerscript": "cortex_m3/stm32/linker/stm32f207_g.ld", "size": { "flash": 1048576, "ram": 114688 }, }, # ------------------------------------------------------------------------- # STM32F405 p s # # Pins (p): # R | 64 pins # V | 100 pins # Z | 144 pins # # Size (s): # G | 1 MB Flash, 112+64+16 kB RAM # "stm32f405_g": { "defines": ["__STM32F405__", "__ARM_STM32__", "STM32F4XX"], "linkerscript": "cortex_m3/stm32/linker/stm32f4xx_g.ld", "size": { "flash": 1048576, "ram": 114688 }, }, # STM32F407 p s # # Pins (p): # V | 100 pins # Z | 144 pins # I | 176 pins # # Size (s): # E | 512 kB Flash, 112+64+16 kB RAM # G | 1 MB Flash, 112+64+16 kB RAM # "stm32f407_e": { "defines": ["__STM32F407__", "__ARM_STM32__", "STM32F4XX"], "linkerscript": "cortex_m3/stm32/linker/stm32f4xx_e.ld", "size": { "flash": 524288, "ram": 114688 }, }, "stm32f407_g": { "defines": ["__STM32F407__", "__ARM_STM32__", "STM32F4XX"], "linkerscript": "cortex_m3/stm32/linker/stm32f4xx_g.ld", "size": { "flash": 1048576, "ram": 114688 }, }, # ------------------------------------------------------------------------- # STM32 F3 Series # ARM Cortex-M4F MCU + FPU # STM32F302 p s # # Pins (p): # C | 48 pins # R | 64 pins # V | 100 pins # # Size (s): # B | 128 kB Flash, 8 + 40 kB RAM # C | 256 kB Flash, 8 + 40 kB RAM # "stm32f303_b": { "defines": ["__STM32F303__", "__ARM_STM32__", "STM32F3XX", "STM32F30X"], "linkerscript": "cortex_m3/stm32/linker/stm32f3xx_b.ld", "size": { "flash": 131072, "ram": 40960 }, }, "stm32f303_c": { "defines": ["__STM32F303__", "__ARM_STM32__", "STM32F3XX", "STM32F30X"], "linkerscript": "cortex_m3/stm32/linker/stm32f3xx_c.ld", "size": { "flash": 262144, "ram": 40960 }, }, }
devices = {'lpc2129': {'defines': ['__ARM_LPC2000__'], 'linkerscript': 'arm7/lpc/linker/lpc2129.ld', 'size': {'flash': 262144, 'ram': 16384}}, 'lpc2368': {'defines': ['__ARM_LPC2000__', '__ARM_LPC23_24__'], 'linkerscript': 'arm7/lpc/linker/lpc2368.ld', 'size': {'flash': 524288, 'ram': 32768}}, 'lpc2468': {'defines': ['__ARM_LPC2000__', '__ARM_LPC23_24__'], 'linkerscript': 'arm7/lpc/linker/lpc2468.ld', 'size': {'flash': 524288, 'ram': 65536}}, 'lpc1112_301': {'defines': ['__ARM_LPC11XX__'], 'linkerscript': 'cortex_m0/lpc/linker/lpc1112_301.ld', 'size': {'flash': 16384, 'ram': 8192}}, 'lpc1114_301': {'defines': ['__ARM_LPC11XX__'], 'linkerscript': 'cortex_m0/lpc/linker/lpc1114_301.ld', 'size': {'flash': 32768, 'ram': 8192}}, 'lpc1115_303': {'defines': ['__ARM_LPC11XX__'], 'linkerscript': 'cortex_m0/lpc/linker/lpc1115_303.ld', 'size': {'flash': 65536, 'ram': 8192}}, 'lpc11c22_301': {'defines': ['__ARM_LPC11XX__', '__ARM_LPC11CXX__'], 'linkerscript': 'cortex_m0/lpc/linker/lpc11c22.ld', 'size': {'flash': 16384, 'ram': 8192}}, 'lpc11c24_301': {'defines': ['__ARM_LPC11XX__', '__ARM_LPC11CXX__'], 'linkerscript': 'cortex_m0/lpc/linker/lpc11c24.ld', 'size': {'flash': 32768, 'ram': 8192}}, 'lpc1343': {'defines': ['__ARM_LPC13XX__'], 'linkerscript': 'cortex_m3/lpc/linker/lpc1343.ld', 'size': {'flash': 32768, 'ram': 8192}}, 'lpc1769': {'defines': ['__ARM_LPC17XX__'], 'linkerscript': 'cortex_m3/lpc/linker/lpc1769.ld', 'size': {'flash': 524288, 'ram': 65536}}, 'at91sam7s32': {'defines': ['__ARM_AT91__', '__ARM_AT91SAM7S__', '__ARM_AT91SAM7S32__'], 'linkerscript': 'arm7/at91/linker/at91sam7s32.ld', 'size': {'flash': 32768, 'ram': 4096}}, 'at91sam7s321': {'defines': ['__ARM_AT91__', '__ARM_AT91SAM7S__', '__ARM_AT91SAM7S321__'], 'linkerscript': 'arm7/at91/linker/at91sam7s32.ld', 'size': {'flash': 32768, 'ram': 8192}}, 'at91sam7s64': {'defines': ['__ARM_AT91__', '__ARM_AT91SAM7S__', '__ARM_AT91SAM7S64__'], 'linkerscript': 'arm7/at91/linker/at91sam7s64.ld', 'size': {'flash': 65536, 'ram': 16384}}, 'at91sam7s128': {'defines': ['__ARM_AT91__', '__ARM_AT91SAM7S__', '__ARM_AT91SAM7S128__'], 'linkerscript': 'arm7/at91/linker/at91sam7s128.ld', 'size': {'flash': 131072, 'ram': 32768}}, 'at91sam7s256': {'defines': ['__ARM_AT91__', '__ARM_AT91SAM7S__', '__ARM_AT91SAM7S256__'], 'linkerscript': 'arm7/at91/linker/at91sam7s256.ld', 'size': {'flash': 262144, 'ram': 65536}}, 'at91sam7s512': {'defines': ['__ARM_AT91__', '__ARM_AT91SAM7S__', '__ARM_AT91SAM7S512__'], 'linkerscript': 'arm7/at91/linker/at91sam7s512.ld', 'size': {'flash': 524288, 'ram': 65536}}, 'at91sam7x128': {'defines': ['__ARM_AT91__', '__ARM_AT91SAM7X__'], 'linkerscript': 'arm7/at91/linker/at91sam7x128.ld', 'size': {'flash': 131072, 'ram': 32768}}, 'at91sam7x256': {'defines': ['__ARM_AT91__', '__ARM_AT91SAM7X__'], 'linkerscript': 'arm7/at91/linker/at91sam7x256.ld', 'size': {'flash': 262144, 'ram': 65536}}, 'at91sam7x512': {'defines': ['__ARM_AT91__', '__ARM_AT91SAM7X__'], 'linkerscript': 'arm7/at91/linker/at91sam7x512.ld', 'size': {'flash': 524288, 'ram': 131072}}, 'stm32f103_4': {'defines': ['__STM32F103__', '__ARM_STM32__', 'STM32F10X', 'STM32F10X_LD', 'STM32_LOW_DENSITY'], 'linkerscript': 'cortex_m3/stm32/linker/stm32f103_4.ld', 'size': {'flash': 16384, 'ram': 6144}}, 'stm32f103_6': {'defines': ['__STM32F103__', '__ARM_STM32__', 'STM32F10X', 'STM32F10X_LD', 'STM32_LOW_DENSITY'], 'linkerscript': 'cortex_m3/stm32/linker/stm32f103_6.ld', 'size': {'flash': 32768, 'ram': 10240}}, 'stm32f103_8': {'defines': ['__STM32F103__', '__ARM_STM32__', 'STM32F10X', 'STM32F10X_MD', 'STM32_MEDIUM_DENSITY'], 'linkerscript': 'cortex_m3/stm32/linker/stm32f103_8.ld', 'size': {'flash': 65536, 'ram': 20480}}, 'stm32f103_b': {'defines': ['__STM32F103__', '__ARM_STM32__', 'STM32F10X', 'STM32F10X_MD', 'STM32_MEDIUM_DENSITY'], 'linkerscript': 'cortex_m3/stm32/linker/stm32f103_b.ld', 'size': {'flash': 131072, 'ram': 20480}}, 'stm32f103_c': {'defines': ['__STM32F103__', '__ARM_STM32__', 'STM32F10X', 'STM32F10X_HD', 'STM32_HIGH_DENSITY'], 'linkerscript': 'cortex_m3/stm32/linker/stm32f103_c.ld', 'size': {'flash': 262144, 'ram': 49152}}, 'stm32f103_d': {'defines': ['__STM32F103__', '__ARM_STM32__', 'STM32F10X', 'STM32F10X_HD', 'STM32_HIGH_DENSITY'], 'linkerscript': 'cortex_m3/stm32/linker/stm32f103_d.ld', 'size': {'flash': 393216, 'ram': 65536}}, 'stm32f103_e': {'defines': ['__STM32F103__', '__ARM_STM32__', 'STM32F10X', 'STM32F10X_HD', 'STM32_HIGH_DENSITY'], 'linkerscript': 'cortex_m3/stm32/linker/stm32f103_e.ld', 'size': {'flash': 524288, 'ram': 65536}}, 'stm32f103_f': {'defines': ['__STM32F103__', '__ARM_STM32__', 'STM32F10X', 'STM32F10X_XL', 'STM32_XL_DENSITY'], 'linkerscript': 'cortex_m3/stm32/linker/stm32f103_f.ld', 'size': {'flash': 786432, 'ram': 98304}}, 'stm32f103_g': {'defines': ['__STM32F103__', '__ARM_STM32__', 'STM32F10X', 'STM32F10X_XL', 'STM32_XL_DENSITY'], 'linkerscript': 'cortex_m3/stm32/linker/stm32f103_g.ld', 'size': {'flash': 1048576, 'ram': 98304}}, 'stm32f105_8': {'defines': ['__STM32F105__', '__ARM_STM32__', 'STM32F10X', 'STM32F10X_CL', 'STM32_CONNECTIVITY'], 'linkerscript': 'cortex_m3/stm32/linker/stm32f105_8.ld', 'size': {'flash': 65536, 'ram': 20480}}, 'stm32f105_b': {'defines': ['__STM32F105__', '__ARM_STM32__', 'STM32F10X', 'STM32F10X_CL', 'STM32_CONNECTIVITY'], 'linkerscript': 'cortex_m3/stm32/linker/stm32f105_b.ld', 'size': {'flash': 131072, 'ram': 32768}}, 'stm32f105_c': {'defines': ['__STM32F105__', '__ARM_STM32__', 'STM32F10X', 'STM32F10X_CL', 'STM32_CONNECTIVITY'], 'linkerscript': 'cortex_m3/stm32/linker/stm32f105_c.ld', 'size': {'flash': 262144, 'ram': 65536}}, 'stm32f107_b': {'defines': ['__STM32F107__', '__ARM_STM32__', 'STM32F10X', 'STM32F10X_CL', 'STM32_CONNECTIVITY'], 'linkerscript': 'cortex_m3/stm32/linker/stm32f107_b.ld', 'size': {'flash': 131072, 'ram': 49152}}, 'stm32f107_c': {'defines': ['__STM32F107__', '__ARM_STM32__', 'STM32F10X', 'STM32F10X_CL', 'STM32_CONNECTIVITY'], 'linkerscript': 'cortex_m3/stm32/linker/stm32f107_c.ld', 'size': {'flash': 262144, 'ram': 65536}}, 'stm32f205_b': {'defines': ['__STM32F205__', '__ARM_STM32__', 'STM32F2XX'], 'linkerscript': 'cortex_m3/stm32/linker/stm32f205_b.ld', 'size': {'flash': 131072, 'ram': 49152}}, 'stm32f205_c': {'defines': ['__STM32F205__', '__ARM_STM32__', 'STM32F2XX'], 'linkerscript': 'cortex_m3/stm32/linker/stm32f205_c.ld', 'size': {'flash': 262144, 'ram': 81920}}, 'stm32f205_e': {'defines': ['__STM32F205__', '__ARM_STM32__', 'STM32F2XX'], 'linkerscript': 'cortex_m3/stm32/linker/stm32f205_e.ld', 'size': {'flash': 524288, 'ram': 114688}}, 'stm32f205_f': {'defines': ['__STM32F205__', '__ARM_STM32__', 'STM32F2XX'], 'linkerscript': 'cortex_m3/stm32/linker/stm32f205_f.ld', 'size': {'flash': 786432, 'ram': 114688}}, 'stm32f205_g': {'defines': ['__STM32F205__', '__ARM_STM32__', 'STM32F2XX'], 'linkerscript': 'cortex_m3/stm32/linker/stm32f205_g.ld', 'size': {'flash': 1048576, 'ram': 114688}}, 'stm32f207_c': {'defines': ['__STM32F207__', '__ARM_STM32__', 'STM32F2XX'], 'linkerscript': 'cortex_m3/stm32/linker/stm32f207_c.ld', 'size': {'flash': 262144, 'ram': 114688}}, 'stm32f207_e': {'defines': ['__STM32F207__', '__ARM_STM32__', 'STM32F2XX'], 'linkerscript': 'cortex_m3/stm32/linker/stm32f207_e.ld', 'size': {'flash': 524288, 'ram': 114688}}, 'stm32f207_f': {'defines': ['__STM32F207__', '__ARM_STM32__', 'STM32F2XX'], 'linkerscript': 'cortex_m3/stm32/linker/stm32f207_f.ld', 'size': {'flash': 786432, 'ram': 114688}}, 'stm32f207_g': {'defines': ['__STM32F207__', '__ARM_STM32__', 'STM32F2XX'], 'linkerscript': 'cortex_m3/stm32/linker/stm32f207_g.ld', 'size': {'flash': 1048576, 'ram': 114688}}, 'stm32f405_g': {'defines': ['__STM32F405__', '__ARM_STM32__', 'STM32F4XX'], 'linkerscript': 'cortex_m3/stm32/linker/stm32f4xx_g.ld', 'size': {'flash': 1048576, 'ram': 114688}}, 'stm32f407_e': {'defines': ['__STM32F407__', '__ARM_STM32__', 'STM32F4XX'], 'linkerscript': 'cortex_m3/stm32/linker/stm32f4xx_e.ld', 'size': {'flash': 524288, 'ram': 114688}}, 'stm32f407_g': {'defines': ['__STM32F407__', '__ARM_STM32__', 'STM32F4XX'], 'linkerscript': 'cortex_m3/stm32/linker/stm32f4xx_g.ld', 'size': {'flash': 1048576, 'ram': 114688}}, 'stm32f303_b': {'defines': ['__STM32F303__', '__ARM_STM32__', 'STM32F3XX', 'STM32F30X'], 'linkerscript': 'cortex_m3/stm32/linker/stm32f3xx_b.ld', 'size': {'flash': 131072, 'ram': 40960}}, 'stm32f303_c': {'defines': ['__STM32F303__', '__ARM_STM32__', 'STM32F3XX', 'STM32F30X'], 'linkerscript': 'cortex_m3/stm32/linker/stm32f3xx_c.ld', 'size': {'flash': 262144, 'ram': 40960}}}
WALK_UP = 4 WALK_DOWN = 3 WALK_RIGHT = 2 WALK_LEFT = 1 NO_OP = 0 SHOOT = 5 WALK_ACTIONS = [WALK_UP, WALK_DOWN, WALK_RIGHT, WALK_LEFT] ACTIONS = [NO_OP, WALK_LEFT, WALK_RIGHT, WALK_DOWN, WALK_UP, SHOOT]
walk_up = 4 walk_down = 3 walk_right = 2 walk_left = 1 no_op = 0 shoot = 5 walk_actions = [WALK_UP, WALK_DOWN, WALK_RIGHT, WALK_LEFT] actions = [NO_OP, WALK_LEFT, WALK_RIGHT, WALK_DOWN, WALK_UP, SHOOT]
# Day Six: Lanternfish file = open("input/06.txt").readlines() ages = [] for num in file[0].split(","): ages.append(int(num)) for day in range(80): for i, fish in enumerate(ages): if fish == 0: ages[i] = 6 ages.append(9) else: ages[i] = fish-1 print(len(ages)) # ages: 0, 1, 2, 3, 4, 5, 6, 7, 8, 9 ages = [0, 0, 0, 0, 0, 0, 0, 0, 0, 0] for num in file[0].split(","): ages[int(num)] += 1 for day in range(256): for i, age in enumerate(ages): if i == 0: ages[7] += ages[0] ages[9] += ages[0] ages[0] -= ages[0] else: ages[i-1] += ages[i] ages[i] -= ages[i] print(sum(ages))
file = open('input/06.txt').readlines() ages = [] for num in file[0].split(','): ages.append(int(num)) for day in range(80): for (i, fish) in enumerate(ages): if fish == 0: ages[i] = 6 ages.append(9) else: ages[i] = fish - 1 print(len(ages)) ages = [0, 0, 0, 0, 0, 0, 0, 0, 0, 0] for num in file[0].split(','): ages[int(num)] += 1 for day in range(256): for (i, age) in enumerate(ages): if i == 0: ages[7] += ages[0] ages[9] += ages[0] ages[0] -= ages[0] else: ages[i - 1] += ages[i] ages[i] -= ages[i] print(sum(ages))
#Horas-minutos e Segundos valor = int(input()) horas = 0 minutos = 0 segundos = 0 valorA = valor contador = segundos while(contador <= valorA): if contador > 0: segundos += 1 if segundos >= 60: minutos += 1 segundos = 0 if minutos >= 60: horas += 1 minutos = 0 contador+=1 print("{}:{}:{}".format(horas,minutos,segundos))
valor = int(input()) horas = 0 minutos = 0 segundos = 0 valor_a = valor contador = segundos while contador <= valorA: if contador > 0: segundos += 1 if segundos >= 60: minutos += 1 segundos = 0 if minutos >= 60: horas += 1 minutos = 0 contador += 1 print('{}:{}:{}'.format(horas, minutos, segundos))
#!/usr/bin/env python # Author: Omid Mashayekhi <[email protected]> # ssh -i ~/.ssh/omidm-sing-key-pair-us-west-2.pem -o UserKnownHostsFile=/dev/null -o StrictHostKeyChecking=no ubuntu@<ip> # US West (Northern California) Region # EC2_LOCATION = 'us-west-1' # NIMBUS_AMI = 'ami-50201815' # UBUNTU_AMI = 'ami-660c3023' # KEY_NAME = 'omidm-sing-key-pair-us-west-1' # SECURITY_GROUP = 'nimbus_sg_uswest1' # EC2 configurations # US West (Oregon) Region EC2_LOCATION = 'us-west-2' UBUNTU_AMI = 'ami-fa9cf1ca' NIMBUS_AMI = 'ami-4f5c392f' CONTROLLER_INSTANCE_TYPE = 'c3.4xlarge' WORKER_INSTANCE_TYPE = 'c3.2xlarge' PLACEMENT = 'us-west-2a' # None PLACEMENT_GROUP = 'nimbus-cluster' # None / '*' SECURITY_GROUP = 'nimbus_sg_uswest2' KEY_NAME = 'sing-key-pair-us-west-2' PRIVATE_KEY = '/home/omidm/.ssh/' + KEY_NAME + '.pem' CONTROLLER_NUM = 1 WORKER_NUM = 100 #Environment variables DBG_MODE = 'warn' # 'error' TTIMER_LEVEL = 'l1' # 'l0' # Controller configurations ASSIGNER_THREAD_NUM = 8 BATCH_ASSIGN_NUM = 200 COMMAND_BATCH_SIZE = 10000 DEACTIVATE_CONTROLLER_TEMPLATE = False DEACTIVATE_COMPLEX_MEMOIZATION = False DEACTIVATE_BINDING_MEMOIZATION = False DEACTIVATE_WORKER_TEMPLATE = False DEACTIVATE_MEGA_RCR_JOB = False DEACTIVATE_CASCADED_BINDING = False ACTIVATE_LB = False ACTIVATE_FT = False LB_PERIOD = 60 FT_PERIOD = 600 FIRST_PORT = 5800 SPLIT_ARGS = str(WORKER_NUM) + ' 1 1' # '2 2 2' '4 4 4' # Worker configurations OTHREAD_NUM = 8 APPLICATION = 'lr' # 'lr' 'k-means' 'water' 'heat' DEACTIVATE_EXECUTION_TEMPLATE = False DEACTIVATE_CACHE_MANAGER = False DEACTIVATE_VDATA_MANAGER = False DISABLE_HYPERTHREADING = False RUN_WITH_TASKSET = False WORKER_TASKSET = '0-1,4-5' # '0-3,8-11' # Application configurations # lr and k-means DIMENSION = 10 CLUSTER_NUM = 2 ITERATION_NUM = 30 PARTITION_PER_CORE = 10 PARTITION_NUM = WORKER_NUM * OTHREAD_NUM * PARTITION_PER_CORE # 8000 REDUCTION_PARTITION_NUM = WORKER_NUM SAMPLE_NUM_M = 544 # PARTITION_NUM / 1000000.0 SPIN_WAIT_US = 0 # 4000 # 4000 * (100 / WORKER_NUM) DEACTIVATE_AUTOMATIC_REDUCTION = True DEACTIVATE_REDUCTION_COMBINER = False # water SIMULATION_SCALE = 512 PART_X = 4 PART_Y = 4 PART_Z = 4 PROJ_PART_X = 4 PROJ_PART_Y = 4 PROJ_PART_Z = 4 FRAME_NUMBER = 1 ITERATION_BATCH = 1 MAX_ITERATION = 100 WATER_LEVEL = 0.35 PROJECTION_SMART_LEVEL = 0 NO_PROJ_BOTTLENECK = False GLOBAL_WRITE = False # heat ITER_NUM = 30 NX = 800 NY = 800 NZ = 800 PNX = 2 PNY = 2 PNZ = 2 BW = 1 SW_US = 0
ec2_location = 'us-west-2' ubuntu_ami = 'ami-fa9cf1ca' nimbus_ami = 'ami-4f5c392f' controller_instance_type = 'c3.4xlarge' worker_instance_type = 'c3.2xlarge' placement = 'us-west-2a' placement_group = 'nimbus-cluster' security_group = 'nimbus_sg_uswest2' key_name = 'sing-key-pair-us-west-2' private_key = '/home/omidm/.ssh/' + KEY_NAME + '.pem' controller_num = 1 worker_num = 100 dbg_mode = 'warn' ttimer_level = 'l1' assigner_thread_num = 8 batch_assign_num = 200 command_batch_size = 10000 deactivate_controller_template = False deactivate_complex_memoization = False deactivate_binding_memoization = False deactivate_worker_template = False deactivate_mega_rcr_job = False deactivate_cascaded_binding = False activate_lb = False activate_ft = False lb_period = 60 ft_period = 600 first_port = 5800 split_args = str(WORKER_NUM) + ' 1 1' othread_num = 8 application = 'lr' deactivate_execution_template = False deactivate_cache_manager = False deactivate_vdata_manager = False disable_hyperthreading = False run_with_taskset = False worker_taskset = '0-1,4-5' dimension = 10 cluster_num = 2 iteration_num = 30 partition_per_core = 10 partition_num = WORKER_NUM * OTHREAD_NUM * PARTITION_PER_CORE reduction_partition_num = WORKER_NUM sample_num_m = 544 spin_wait_us = 0 deactivate_automatic_reduction = True deactivate_reduction_combiner = False simulation_scale = 512 part_x = 4 part_y = 4 part_z = 4 proj_part_x = 4 proj_part_y = 4 proj_part_z = 4 frame_number = 1 iteration_batch = 1 max_iteration = 100 water_level = 0.35 projection_smart_level = 0 no_proj_bottleneck = False global_write = False iter_num = 30 nx = 800 ny = 800 nz = 800 pnx = 2 pny = 2 pnz = 2 bw = 1 sw_us = 0
# Copyright: 2006 Marien Zwart <[email protected]> # License: BSD/GPL2 #base class __all__ = ("PackageError", "InvalidPackageName", "MetadataException", "InvalidDependency", "ChksumBase", "MissingChksum", "ParseChksumError") class PackageError(ValueError): pass class InvalidPackageName(PackageError): pass class MetadataException(PackageError): def __init__(self, pkg, attr, error): Exception.__init__(self, "Metadata Exception: pkg %s, attr %s\nerror: %s" % (pkg, attr, error)) self.pkg, self.attr, self.error = pkg, attr, error class InvalidDependency(PackageError): pass class ChksumBase(Exception): pass class MissingChksum(ChksumBase): def __init__(self, filename): ChksumBase.__init__(self, "Missing chksum data for %r" % filename) self.file = filename class ParseChksumError(ChksumBase): def __init__(self, filename, error, missing=False): if missing: ChksumBase.__init__(self, "Failed parsing %r chksum; data isn't available: %s" % (filename, error)) else: ChksumBase.__init__(self, "Failed parsing %r chksum due to %s" % (filename, error)) self.file = filename self.error = error self.missing = missing
__all__ = ('PackageError', 'InvalidPackageName', 'MetadataException', 'InvalidDependency', 'ChksumBase', 'MissingChksum', 'ParseChksumError') class Packageerror(ValueError): pass class Invalidpackagename(PackageError): pass class Metadataexception(PackageError): def __init__(self, pkg, attr, error): Exception.__init__(self, 'Metadata Exception: pkg %s, attr %s\nerror: %s' % (pkg, attr, error)) (self.pkg, self.attr, self.error) = (pkg, attr, error) class Invaliddependency(PackageError): pass class Chksumbase(Exception): pass class Missingchksum(ChksumBase): def __init__(self, filename): ChksumBase.__init__(self, 'Missing chksum data for %r' % filename) self.file = filename class Parsechksumerror(ChksumBase): def __init__(self, filename, error, missing=False): if missing: ChksumBase.__init__(self, "Failed parsing %r chksum; data isn't available: %s" % (filename, error)) else: ChksumBase.__init__(self, 'Failed parsing %r chksum due to %s' % (filename, error)) self.file = filename self.error = error self.missing = missing
# # PySNMP MIB module CISCO-ENTITY-ASSET-MIB (http://snmplabs.com/pysmi) # ASN.1 source file:///Users/davwang4/Dev/mibs.snmplabs.com/asn1/CISCO-ENTITY-ASSET-MIB # Produced by pysmi-0.3.4 at Wed May 1 11:56:50 2019 # On host DAVWANG4-M-1475 platform Darwin version 18.5.0 by user davwang4 # Using Python version 3.7.3 (default, Mar 27 2019, 09:23:15) # OctetString, Integer, ObjectIdentifier = mibBuilder.importSymbols("ASN1", "OctetString", "Integer", "ObjectIdentifier") NamedValues, = mibBuilder.importSymbols("ASN1-ENUMERATION", "NamedValues") ValueSizeConstraint, ConstraintsIntersection, ConstraintsUnion, ValueRangeConstraint, SingleValueConstraint = mibBuilder.importSymbols("ASN1-REFINEMENT", "ValueSizeConstraint", "ConstraintsIntersection", "ConstraintsUnion", "ValueRangeConstraint", "SingleValueConstraint") ciscoMgmt, = mibBuilder.importSymbols("CISCO-SMI", "ciscoMgmt") entPhysicalIndex, = mibBuilder.importSymbols("ENTITY-MIB", "entPhysicalIndex") SnmpAdminString, = mibBuilder.importSymbols("SNMP-FRAMEWORK-MIB", "SnmpAdminString") ModuleCompliance, NotificationGroup, ObjectGroup = mibBuilder.importSymbols("SNMPv2-CONF", "ModuleCompliance", "NotificationGroup", "ObjectGroup") ModuleIdentity, IpAddress, iso, MibIdentifier, NotificationType, Counter64, Gauge32, Bits, MibScalar, MibTable, MibTableRow, MibTableColumn, Unsigned32, ObjectIdentity, TimeTicks, Counter32, Integer32 = mibBuilder.importSymbols("SNMPv2-SMI", "ModuleIdentity", "IpAddress", "iso", "MibIdentifier", "NotificationType", "Counter64", "Gauge32", "Bits", "MibScalar", "MibTable", "MibTableRow", "MibTableColumn", "Unsigned32", "ObjectIdentity", "TimeTicks", "Counter32", "Integer32") TextualConvention, TruthValue, DisplayString = mibBuilder.importSymbols("SNMPv2-TC", "TextualConvention", "TruthValue", "DisplayString") ciscoEntityAssetMIB = ModuleIdentity((1, 3, 6, 1, 4, 1, 9, 9, 92)) ciscoEntityAssetMIB.setRevisions(('2003-09-18 00:00', '2002-07-23 16:00', '1999-06-02 16:00',)) if getattr(mibBuilder, 'version', (0, 0, 0)) > (4, 4, 0): if mibBuilder.loadTexts: ciscoEntityAssetMIB.setRevisionsDescriptions(('Some of the Objects have been deprecated since these are available in ENTITY-MIB(RFC 2737). 1. Following Objects have been deprecated. ceAssetOEMString : superceded by entPhysicalMfgName ceAssetSerialNumber : superceded by entPhysicalSerialNum ceAssetOrderablePartNumber: superceded by entPhysicalModelName ceAssetHardwareRevision : superceded by entPhysicalHardwareRev ceAssetFirmwareID : superceded by entPhysicalFirmwareRev ceAssetFirmwareRevision : superceded by entPhysicalFirmwareRev ceAssetSoftwareID : superceded by entPhysicalSoftwareRev ceAssetSoftwareRevision : superceded by entPhysicalSoftwareRev ceAssetAlias : superceded by entPhysicalAlias ceAssetTag : superceded by entPhysicalAssetID ceAssetIsFRU : superceded by entPhysicalIsFRU. 2. ceAssetEntityGroup has been deprecated.', 'Split the MIB objects of this MIB into two object groups.', 'Initial version of this MIB module.',)) if mibBuilder.loadTexts: ciscoEntityAssetMIB.setLastUpdated('200309180000Z') if mibBuilder.loadTexts: ciscoEntityAssetMIB.setOrganization('Cisco Systems, Inc.') if mibBuilder.loadTexts: ciscoEntityAssetMIB.setContactInfo('Cisco Systems Customer Service Postal: Cisco Systems, Inc. 170 West Tasman Drive San Jose, CA 95134-1706 USA Tel: +1 408 526 4000 E-mail: [email protected]') if mibBuilder.loadTexts: ciscoEntityAssetMIB.setDescription('Monitor the asset information of items in the ENTITY-MIB (RFC 2037) entPhysical table.') ciscoEntityAssetMIBObjects = MibIdentifier((1, 3, 6, 1, 4, 1, 9, 9, 92, 1)) ceAssetTable = MibTable((1, 3, 6, 1, 4, 1, 9, 9, 92, 1, 1), ) if mibBuilder.loadTexts: ceAssetTable.setStatus('current') if mibBuilder.loadTexts: ceAssetTable.setDescription('This table lists the orderable part number, serial number, hardware revision, manufacturing assembly number and revision, firmwareID and revision if any, and softwareID and revision if any, of relevant entities listed in the ENTITY-MIB entPhysicalTable. Entities for which none of this data is available are not listed in this table. This is a sparse table so some of these variables may not exist for a particular entity at a particular time. For example, a powered-off module does not have softwareID and revision; a power-supply would probably never have firmware or software information. Although the data may have other items encoded in it (for example manufacturing-date in the serial number) please treat all data items as monolithic. Do not decompose them or parse them. Use only string equals and unequals operations on them.') ceAssetEntry = MibTableRow((1, 3, 6, 1, 4, 1, 9, 9, 92, 1, 1, 1), ).setIndexNames((0, "ENTITY-MIB", "entPhysicalIndex")) if mibBuilder.loadTexts: ceAssetEntry.setStatus('current') if mibBuilder.loadTexts: ceAssetEntry.setDescription('An entAssetEntry entry describes the asset-tracking related data for an entity.') ceAssetOEMString = MibTableColumn((1, 3, 6, 1, 4, 1, 9, 9, 92, 1, 1, 1, 1), SnmpAdminString()).setMaxAccess("readonly") if mibBuilder.loadTexts: ceAssetOEMString.setStatus('deprecated') if mibBuilder.loadTexts: ceAssetOEMString.setDescription('This variable indicates the Original Equipment Manufacturer of the entity.') ceAssetSerialNumber = MibTableColumn((1, 3, 6, 1, 4, 1, 9, 9, 92, 1, 1, 1, 2), SnmpAdminString()).setMaxAccess("readonly") if mibBuilder.loadTexts: ceAssetSerialNumber.setStatus('deprecated') if mibBuilder.loadTexts: ceAssetSerialNumber.setDescription('This variable indicates the serial number of the entity.') ceAssetOrderablePartNumber = MibTableColumn((1, 3, 6, 1, 4, 1, 9, 9, 92, 1, 1, 1, 3), SnmpAdminString()).setMaxAccess("readonly") if mibBuilder.loadTexts: ceAssetOrderablePartNumber.setStatus('deprecated') if mibBuilder.loadTexts: ceAssetOrderablePartNumber.setDescription('This variable indicates the part number you can use to order the entity.') ceAssetHardwareRevision = MibTableColumn((1, 3, 6, 1, 4, 1, 9, 9, 92, 1, 1, 1, 4), SnmpAdminString()).setMaxAccess("readonly") if mibBuilder.loadTexts: ceAssetHardwareRevision.setStatus('deprecated') if mibBuilder.loadTexts: ceAssetHardwareRevision.setDescription('This variable indicates the engineering design revision of the hardware of the entity.') ceAssetMfgAssyNumber = MibTableColumn((1, 3, 6, 1, 4, 1, 9, 9, 92, 1, 1, 1, 5), SnmpAdminString()).setMaxAccess("readonly") if mibBuilder.loadTexts: ceAssetMfgAssyNumber.setStatus('current') if mibBuilder.loadTexts: ceAssetMfgAssyNumber.setDescription("This variable indicates the manufacturing assembly number, which is the 'hardware' identification.") ceAssetMfgAssyRevision = MibTableColumn((1, 3, 6, 1, 4, 1, 9, 9, 92, 1, 1, 1, 6), SnmpAdminString()).setMaxAccess("readonly") if mibBuilder.loadTexts: ceAssetMfgAssyRevision.setStatus('current') if mibBuilder.loadTexts: ceAssetMfgAssyRevision.setDescription('This variable indicates the revision of the entity, within the ceAssetMfgAssyNumber.') ceAssetFirmwareID = MibTableColumn((1, 3, 6, 1, 4, 1, 9, 9, 92, 1, 1, 1, 7), SnmpAdminString()).setMaxAccess("readonly") if mibBuilder.loadTexts: ceAssetFirmwareID.setStatus('deprecated') if mibBuilder.loadTexts: ceAssetFirmwareID.setDescription("This variable indicates the firmware installed on this entity. For IOS devices, this variable's value is in the IOS Image Naming Convention format. IOS Image Naming Convention Software images are named according to a scheme that identifies what's in the image and what platform it runs on. The names have three parts, separated by dashes: e.g. xxxx-yyyy-ww. xxxx = Platform yyyy = Features ww = Where it executes from and if compressed ") ceAssetFirmwareRevision = MibTableColumn((1, 3, 6, 1, 4, 1, 9, 9, 92, 1, 1, 1, 8), SnmpAdminString()).setMaxAccess("readonly") if mibBuilder.loadTexts: ceAssetFirmwareRevision.setStatus('deprecated') if mibBuilder.loadTexts: ceAssetFirmwareRevision.setDescription("This variable indicates the revision of firmware installed on this entity. For IOS devices, this variable's value is in the NGRP external customer-visible format. NGRP external customer-visible revision strings have this format: 'x.y (z [p] ) [A] [ [ u ( v [ p ] ) ] ] [ q ]', where: - x.y Combination of two 1-2 digit numerics separated by a '.' that identify the Software major release - z 1-3 digit numeric that identifies the maintenance release of x.y - A 1-3 alpha letters, designator of the release train. - u 1-2 digit numeric that identifies the version of the ED-specific code - v 1-2 digit numeric that identifies the maintenance release of the ED-specific code - v 1-2 digit numeric that identifies the maintenance release of the ED-specific code - p 1 alpha letter that identifies the unusual special case SW Line Stop Fast Re-build by the Release Ops team to replace the posted/shipping release in CCO and Mfg with a version containing a critical catastrophic defect fix that cannot wait until the next maintenance release - q 3 alphanumeric optional suffix used as an indicator in the image banner by the SW Line Stop Re-build process used unusual special case situation when the renumber build has occurred but the images have not been released (value always blank unless these special circumstances require its use). ") ceAssetSoftwareID = MibTableColumn((1, 3, 6, 1, 4, 1, 9, 9, 92, 1, 1, 1, 9), SnmpAdminString()).setMaxAccess("readonly") if mibBuilder.loadTexts: ceAssetSoftwareID.setStatus('deprecated') if mibBuilder.loadTexts: ceAssetSoftwareID.setDescription("This variable indicates the software installed on this entity. For IOS devices, this variable's value is in the IOS Image Naming Convention format. IOS Image Naming Convention --------------------------- Software images are named according to a scheme that identifies what's in the image and what platform it runs on. The names have three parts, separated by dashes: e.g. xxxx-yyyy-ww. xxxx = Platform yyyy = Features ww = Where it executes from and if compressed ") ceAssetSoftwareRevision = MibTableColumn((1, 3, 6, 1, 4, 1, 9, 9, 92, 1, 1, 1, 10), SnmpAdminString()).setMaxAccess("readonly") if mibBuilder.loadTexts: ceAssetSoftwareRevision.setStatus('deprecated') if mibBuilder.loadTexts: ceAssetSoftwareRevision.setDescription("This variable indicates the revision of software installed on this entity. For IOS devices, this variable's value is in the NGRP external customer-visible format. NGRP external customer-visible revision strings have this format: 'x.y (z [p] ) [A] [ [ u ( v [ p ] ) ] ] [ q ]', where: - x.y Combination of two 1-2 digit numerics separated by a '.' that identify the Software major release - z 1-3 digit numeric that identifies the maintenance release of x.y - A 1-3 alpha letters, designator of the release train. - u 1-2 digit numeric that identifies the version of the ED-specific code - v 1-2 digit numeric that identifies the maintenance release of the ED-specific code - p 1 alpha letter that identifies the unusual special case SW Line Stop Fast Re-build by the Release Ops team to replace the posted/shipping release in CCO and Mfg with a version containing a critical catastrophic defect fix that cannot wait until the next maintenance release - q 3 alphanumeric optional suffix used as an indicator in the image banner by the SW Line Stop Re-build process used unusual special case situation when the renumber build has occurred but the images have not been released (value always blank unless these special circumstances require its use). ") ceAssetCLEI = MibTableColumn((1, 3, 6, 1, 4, 1, 9, 9, 92, 1, 1, 1, 11), SnmpAdminString().subtype(subtypeSpec=ConstraintsUnion(ValueSizeConstraint(0, 0), ValueSizeConstraint(10, 10), ))).setMaxAccess("readonly") if mibBuilder.loadTexts: ceAssetCLEI.setReference('Bellcore Technical reference GR-485-CORE, COMMON LANGUAGE Equipment Processes and Guidelines, Issue 2, October, 1995.') if mibBuilder.loadTexts: ceAssetCLEI.setStatus('current') if mibBuilder.loadTexts: ceAssetCLEI.setDescription('This object represents the CLEI (Common Language Equipment Identifier) code for the physical entity. If the physical entity is not present in the system, or does not have an associated CLEI code, then the value of this object will be a zero-length string.') ceAssetAlias = MibTableColumn((1, 3, 6, 1, 4, 1, 9, 9, 92, 1, 1, 1, 12), SnmpAdminString().subtype(subtypeSpec=ValueSizeConstraint(0, 32))).setMaxAccess("readwrite") if mibBuilder.loadTexts: ceAssetAlias.setStatus('deprecated') if mibBuilder.loadTexts: ceAssetAlias.setDescription("This object is an 'alias' name for the physical entity as specified by a network manager, and provides a non-volatile 'handle' for the physical entity. On the first instantiation of an physical entity, the value of entPhysicalAlias associated with that entity is set to the zero-length string. However, agent may set the value to a locally unique default value, instead of a zero-length string. If write access is implemented for an instance of entPhysicalAlias, and a value is written into the instance, the agent must retain the supplied value in the entPhysicalAlias instance associated with the same physical entity for as long as that entity remains instantiated. This includes instantiations across all re-initializations/reboots of the network management system, including those which result in a change of the physical entity's entPhysicalIndex value.") ceAssetTag = MibTableColumn((1, 3, 6, 1, 4, 1, 9, 9, 92, 1, 1, 1, 13), SnmpAdminString().subtype(subtypeSpec=ValueSizeConstraint(0, 32))).setMaxAccess("readwrite") if mibBuilder.loadTexts: ceAssetTag.setStatus('deprecated') if mibBuilder.loadTexts: ceAssetTag.setDescription("This object is a user-assigned asset tracking identifier for the physical entity as specified by a network manager, and provides non-volatile storage of this information. On the first instantiation of an physical entity, the value of ceasAssetID associated with that entity is set to the zero-length string. Not every physical component will have a asset tracking identifier, or even need one. Physical entities for which the associated value of the ceAssetIsFRU object is equal to 'false' (e.g., the repeater ports within a repeater module), do not need their own unique asset tracking identifier. An agent does not have to provide write access for such entities, and may instead return a zero-length string. If write access is implemented for an instance of ceasAssetID, and a value is written into the instance, the agent must retain the supplied value in the ceasAssetID instance associated with the same physical entity for as long as that entity remains instantiated. This includes instantiations across all re-initializations/reboots of the network management system, including those which result in a change of the physical entity's entPhysicalIndex value. If no asset tracking information is associated with the physical component, then this object will contain a zero- length string.") ceAssetIsFRU = MibTableColumn((1, 3, 6, 1, 4, 1, 9, 9, 92, 1, 1, 1, 14), TruthValue()).setMaxAccess("readonly") if mibBuilder.loadTexts: ceAssetIsFRU.setStatus('deprecated') if mibBuilder.loadTexts: ceAssetIsFRU.setDescription("This object indicates whether or not this physical entity is considered a 'field replaceable unit' by the vendor. If this object contains the value 'true' then the corresponding entPhysicalEntry identifies a field replaceable unit. For all entPhysicalEntries which represent components that are permanently contained within a field replaceable unit, the value 'false' should be returned for this object.") ciscoEntityAssetMIBNotificationsPrefix = MibIdentifier((1, 3, 6, 1, 4, 1, 9, 9, 92, 2)) ciscoEntityAssetMIBNotifications = MibIdentifier((1, 3, 6, 1, 4, 1, 9, 9, 92, 2, 0)) ciscoEntityAssetMIBConformance = MibIdentifier((1, 3, 6, 1, 4, 1, 9, 9, 92, 3)) ciscoEntityAssetMIBCompliances = MibIdentifier((1, 3, 6, 1, 4, 1, 9, 9, 92, 3, 1)) ciscoEntityAssetMIBGroups = MibIdentifier((1, 3, 6, 1, 4, 1, 9, 9, 92, 3, 2)) ciscoEntityAssetMIBCompliance = ModuleCompliance((1, 3, 6, 1, 4, 1, 9, 9, 92, 3, 1, 1)).setObjects(("CISCO-ENTITY-ASSET-MIB", "ceAssetGroup")) if getattr(mibBuilder, 'version', (0, 0, 0)) > (4, 4, 0): ciscoEntityAssetMIBCompliance = ciscoEntityAssetMIBCompliance.setStatus('deprecated') if mibBuilder.loadTexts: ciscoEntityAssetMIBCompliance.setDescription('An ENTITY-MIB implementation that lists entities with asset information in its entPhysicalTable must implement this group.') ciscoEntityAssetMIBComplianceRev1 = ModuleCompliance((1, 3, 6, 1, 4, 1, 9, 9, 92, 3, 1, 2)).setObjects(("CISCO-ENTITY-ASSET-MIB", "ceAssetGroupRev1"), ("CISCO-ENTITY-ASSET-MIB", "ceAssetEntityGroup")) if getattr(mibBuilder, 'version', (0, 0, 0)) > (4, 4, 0): ciscoEntityAssetMIBComplianceRev1 = ciscoEntityAssetMIBComplianceRev1.setStatus('deprecated') if mibBuilder.loadTexts: ciscoEntityAssetMIBComplianceRev1.setDescription('An ENTITY-MIB implementation that lists entities with asset information in its entPhysicalTable must implement this group.') ciscoEntityAssetMIBComplianceRev2 = ModuleCompliance((1, 3, 6, 1, 4, 1, 9, 9, 92, 3, 1, 3)).setObjects(("CISCO-ENTITY-ASSET-MIB", "ceAssetGroupRev2")) if getattr(mibBuilder, 'version', (0, 0, 0)) > (4, 4, 0): ciscoEntityAssetMIBComplianceRev2 = ciscoEntityAssetMIBComplianceRev2.setStatus('current') if mibBuilder.loadTexts: ciscoEntityAssetMIBComplianceRev2.setDescription('An ENTITY-MIB implementation that lists entities with asset information in its entPhysicalTable must implement this group.') ceAssetGroup = ObjectGroup((1, 3, 6, 1, 4, 1, 9, 9, 92, 3, 2, 1)).setObjects(("CISCO-ENTITY-ASSET-MIB", "ceAssetOEMString"), ("CISCO-ENTITY-ASSET-MIB", "ceAssetSerialNumber"), ("CISCO-ENTITY-ASSET-MIB", "ceAssetOrderablePartNumber"), ("CISCO-ENTITY-ASSET-MIB", "ceAssetHardwareRevision"), ("CISCO-ENTITY-ASSET-MIB", "ceAssetMfgAssyNumber"), ("CISCO-ENTITY-ASSET-MIB", "ceAssetMfgAssyRevision"), ("CISCO-ENTITY-ASSET-MIB", "ceAssetFirmwareID"), ("CISCO-ENTITY-ASSET-MIB", "ceAssetFirmwareRevision"), ("CISCO-ENTITY-ASSET-MIB", "ceAssetSoftwareID"), ("CISCO-ENTITY-ASSET-MIB", "ceAssetSoftwareRevision"), ("CISCO-ENTITY-ASSET-MIB", "ceAssetCLEI"), ("CISCO-ENTITY-ASSET-MIB", "ceAssetAlias"), ("CISCO-ENTITY-ASSET-MIB", "ceAssetTag"), ("CISCO-ENTITY-ASSET-MIB", "ceAssetIsFRU")) if getattr(mibBuilder, 'version', (0, 0, 0)) > (4, 4, 0): ceAssetGroup = ceAssetGroup.setStatus('deprecated') if mibBuilder.loadTexts: ceAssetGroup.setDescription('The collection of objects which are used to describe and monitor asset-related data of ENTITY-MIB entPhysicalTable items.') ceAssetGroupRev1 = ObjectGroup((1, 3, 6, 1, 4, 1, 9, 9, 92, 3, 2, 2)).setObjects(("CISCO-ENTITY-ASSET-MIB", "ceAssetOEMString"), ("CISCO-ENTITY-ASSET-MIB", "ceAssetMfgAssyNumber"), ("CISCO-ENTITY-ASSET-MIB", "ceAssetMfgAssyRevision"), ("CISCO-ENTITY-ASSET-MIB", "ceAssetFirmwareID"), ("CISCO-ENTITY-ASSET-MIB", "ceAssetSoftwareID"), ("CISCO-ENTITY-ASSET-MIB", "ceAssetCLEI")) if getattr(mibBuilder, 'version', (0, 0, 0)) > (4, 4, 0): ceAssetGroupRev1 = ceAssetGroupRev1.setStatus('deprecated') if mibBuilder.loadTexts: ceAssetGroupRev1.setDescription('The collection of objects which are used to describe and monitor asset-related extension data of ENTITY-MIB (RFC 2737) entPhysicalTable items.') ceAssetEntityGroup = ObjectGroup((1, 3, 6, 1, 4, 1, 9, 9, 92, 3, 2, 3)).setObjects(("CISCO-ENTITY-ASSET-MIB", "ceAssetOrderablePartNumber"), ("CISCO-ENTITY-ASSET-MIB", "ceAssetSerialNumber"), ("CISCO-ENTITY-ASSET-MIB", "ceAssetHardwareRevision"), ("CISCO-ENTITY-ASSET-MIB", "ceAssetFirmwareRevision"), ("CISCO-ENTITY-ASSET-MIB", "ceAssetSoftwareRevision"), ("CISCO-ENTITY-ASSET-MIB", "ceAssetAlias"), ("CISCO-ENTITY-ASSET-MIB", "ceAssetTag"), ("CISCO-ENTITY-ASSET-MIB", "ceAssetIsFRU")) if getattr(mibBuilder, 'version', (0, 0, 0)) > (4, 4, 0): ceAssetEntityGroup = ceAssetEntityGroup.setStatus('deprecated') if mibBuilder.loadTexts: ceAssetEntityGroup.setDescription('The collection of objects which are duplicated from the objects in the entPhysicalTable of ENTITY-MIB (RFC 2737).') ceAssetGroupRev2 = ObjectGroup((1, 3, 6, 1, 4, 1, 9, 9, 92, 3, 2, 4)).setObjects(("CISCO-ENTITY-ASSET-MIB", "ceAssetMfgAssyNumber"), ("CISCO-ENTITY-ASSET-MIB", "ceAssetMfgAssyRevision"), ("CISCO-ENTITY-ASSET-MIB", "ceAssetCLEI")) if getattr(mibBuilder, 'version', (0, 0, 0)) > (4, 4, 0): ceAssetGroupRev2 = ceAssetGroupRev2.setStatus('current') if mibBuilder.loadTexts: ceAssetGroupRev2.setDescription('The collection of objects which are used to describe and monitor asset-related extension data of ENTITY-MIB (RFC 2737) entPhysicalTable items.') mibBuilder.exportSymbols("CISCO-ENTITY-ASSET-MIB", ciscoEntityAssetMIBComplianceRev1=ciscoEntityAssetMIBComplianceRev1, ciscoEntityAssetMIB=ciscoEntityAssetMIB, ceAssetTag=ceAssetTag, ciscoEntityAssetMIBGroups=ciscoEntityAssetMIBGroups, ceAssetFirmwareRevision=ceAssetFirmwareRevision, ceAssetAlias=ceAssetAlias, ciscoEntityAssetMIBNotifications=ciscoEntityAssetMIBNotifications, ceAssetGroup=ceAssetGroup, PYSNMP_MODULE_ID=ciscoEntityAssetMIB, ceAssetCLEI=ceAssetCLEI, ceAssetMfgAssyNumber=ceAssetMfgAssyNumber, ceAssetSerialNumber=ceAssetSerialNumber, ceAssetHardwareRevision=ceAssetHardwareRevision, ceAssetGroupRev2=ceAssetGroupRev2, ciscoEntityAssetMIBComplianceRev2=ciscoEntityAssetMIBComplianceRev2, ciscoEntityAssetMIBObjects=ciscoEntityAssetMIBObjects, ceAssetEntry=ceAssetEntry, ciscoEntityAssetMIBCompliances=ciscoEntityAssetMIBCompliances, ciscoEntityAssetMIBCompliance=ciscoEntityAssetMIBCompliance, ceAssetSoftwareRevision=ceAssetSoftwareRevision, ceAssetIsFRU=ceAssetIsFRU, ciscoEntityAssetMIBConformance=ciscoEntityAssetMIBConformance, ceAssetOEMString=ceAssetOEMString, ceAssetFirmwareID=ceAssetFirmwareID, ceAssetTable=ceAssetTable, ceAssetEntityGroup=ceAssetEntityGroup, ciscoEntityAssetMIBNotificationsPrefix=ciscoEntityAssetMIBNotificationsPrefix, ceAssetSoftwareID=ceAssetSoftwareID, ceAssetGroupRev1=ceAssetGroupRev1, ceAssetOrderablePartNumber=ceAssetOrderablePartNumber, ceAssetMfgAssyRevision=ceAssetMfgAssyRevision)
(octet_string, integer, object_identifier) = mibBuilder.importSymbols('ASN1', 'OctetString', 'Integer', 'ObjectIdentifier') (named_values,) = mibBuilder.importSymbols('ASN1-ENUMERATION', 'NamedValues') (value_size_constraint, constraints_intersection, constraints_union, value_range_constraint, single_value_constraint) = mibBuilder.importSymbols('ASN1-REFINEMENT', 'ValueSizeConstraint', 'ConstraintsIntersection', 'ConstraintsUnion', 'ValueRangeConstraint', 'SingleValueConstraint') (cisco_mgmt,) = mibBuilder.importSymbols('CISCO-SMI', 'ciscoMgmt') (ent_physical_index,) = mibBuilder.importSymbols('ENTITY-MIB', 'entPhysicalIndex') (snmp_admin_string,) = mibBuilder.importSymbols('SNMP-FRAMEWORK-MIB', 'SnmpAdminString') (module_compliance, notification_group, object_group) = mibBuilder.importSymbols('SNMPv2-CONF', 'ModuleCompliance', 'NotificationGroup', 'ObjectGroup') (module_identity, ip_address, iso, mib_identifier, notification_type, counter64, gauge32, bits, mib_scalar, mib_table, mib_table_row, mib_table_column, unsigned32, object_identity, time_ticks, counter32, integer32) = mibBuilder.importSymbols('SNMPv2-SMI', 'ModuleIdentity', 'IpAddress', 'iso', 'MibIdentifier', 'NotificationType', 'Counter64', 'Gauge32', 'Bits', 'MibScalar', 'MibTable', 'MibTableRow', 'MibTableColumn', 'Unsigned32', 'ObjectIdentity', 'TimeTicks', 'Counter32', 'Integer32') (textual_convention, truth_value, display_string) = mibBuilder.importSymbols('SNMPv2-TC', 'TextualConvention', 'TruthValue', 'DisplayString') cisco_entity_asset_mib = module_identity((1, 3, 6, 1, 4, 1, 9, 9, 92)) ciscoEntityAssetMIB.setRevisions(('2003-09-18 00:00', '2002-07-23 16:00', '1999-06-02 16:00')) if getattr(mibBuilder, 'version', (0, 0, 0)) > (4, 4, 0): if mibBuilder.loadTexts: ciscoEntityAssetMIB.setRevisionsDescriptions(('Some of the Objects have been deprecated since these are available in ENTITY-MIB(RFC 2737). 1. Following Objects have been deprecated. ceAssetOEMString : superceded by entPhysicalMfgName ceAssetSerialNumber : superceded by entPhysicalSerialNum ceAssetOrderablePartNumber: superceded by entPhysicalModelName ceAssetHardwareRevision : superceded by entPhysicalHardwareRev ceAssetFirmwareID : superceded by entPhysicalFirmwareRev ceAssetFirmwareRevision : superceded by entPhysicalFirmwareRev ceAssetSoftwareID : superceded by entPhysicalSoftwareRev ceAssetSoftwareRevision : superceded by entPhysicalSoftwareRev ceAssetAlias : superceded by entPhysicalAlias ceAssetTag : superceded by entPhysicalAssetID ceAssetIsFRU : superceded by entPhysicalIsFRU. 2. ceAssetEntityGroup has been deprecated.', 'Split the MIB objects of this MIB into two object groups.', 'Initial version of this MIB module.')) if mibBuilder.loadTexts: ciscoEntityAssetMIB.setLastUpdated('200309180000Z') if mibBuilder.loadTexts: ciscoEntityAssetMIB.setOrganization('Cisco Systems, Inc.') if mibBuilder.loadTexts: ciscoEntityAssetMIB.setContactInfo('Cisco Systems Customer Service Postal: Cisco Systems, Inc. 170 West Tasman Drive San Jose, CA 95134-1706 USA Tel: +1 408 526 4000 E-mail: [email protected]') if mibBuilder.loadTexts: ciscoEntityAssetMIB.setDescription('Monitor the asset information of items in the ENTITY-MIB (RFC 2037) entPhysical table.') cisco_entity_asset_mib_objects = mib_identifier((1, 3, 6, 1, 4, 1, 9, 9, 92, 1)) ce_asset_table = mib_table((1, 3, 6, 1, 4, 1, 9, 9, 92, 1, 1)) if mibBuilder.loadTexts: ceAssetTable.setStatus('current') if mibBuilder.loadTexts: ceAssetTable.setDescription('This table lists the orderable part number, serial number, hardware revision, manufacturing assembly number and revision, firmwareID and revision if any, and softwareID and revision if any, of relevant entities listed in the ENTITY-MIB entPhysicalTable. Entities for which none of this data is available are not listed in this table. This is a sparse table so some of these variables may not exist for a particular entity at a particular time. For example, a powered-off module does not have softwareID and revision; a power-supply would probably never have firmware or software information. Although the data may have other items encoded in it (for example manufacturing-date in the serial number) please treat all data items as monolithic. Do not decompose them or parse them. Use only string equals and unequals operations on them.') ce_asset_entry = mib_table_row((1, 3, 6, 1, 4, 1, 9, 9, 92, 1, 1, 1)).setIndexNames((0, 'ENTITY-MIB', 'entPhysicalIndex')) if mibBuilder.loadTexts: ceAssetEntry.setStatus('current') if mibBuilder.loadTexts: ceAssetEntry.setDescription('An entAssetEntry entry describes the asset-tracking related data for an entity.') ce_asset_oem_string = mib_table_column((1, 3, 6, 1, 4, 1, 9, 9, 92, 1, 1, 1, 1), snmp_admin_string()).setMaxAccess('readonly') if mibBuilder.loadTexts: ceAssetOEMString.setStatus('deprecated') if mibBuilder.loadTexts: ceAssetOEMString.setDescription('This variable indicates the Original Equipment Manufacturer of the entity.') ce_asset_serial_number = mib_table_column((1, 3, 6, 1, 4, 1, 9, 9, 92, 1, 1, 1, 2), snmp_admin_string()).setMaxAccess('readonly') if mibBuilder.loadTexts: ceAssetSerialNumber.setStatus('deprecated') if mibBuilder.loadTexts: ceAssetSerialNumber.setDescription('This variable indicates the serial number of the entity.') ce_asset_orderable_part_number = mib_table_column((1, 3, 6, 1, 4, 1, 9, 9, 92, 1, 1, 1, 3), snmp_admin_string()).setMaxAccess('readonly') if mibBuilder.loadTexts: ceAssetOrderablePartNumber.setStatus('deprecated') if mibBuilder.loadTexts: ceAssetOrderablePartNumber.setDescription('This variable indicates the part number you can use to order the entity.') ce_asset_hardware_revision = mib_table_column((1, 3, 6, 1, 4, 1, 9, 9, 92, 1, 1, 1, 4), snmp_admin_string()).setMaxAccess('readonly') if mibBuilder.loadTexts: ceAssetHardwareRevision.setStatus('deprecated') if mibBuilder.loadTexts: ceAssetHardwareRevision.setDescription('This variable indicates the engineering design revision of the hardware of the entity.') ce_asset_mfg_assy_number = mib_table_column((1, 3, 6, 1, 4, 1, 9, 9, 92, 1, 1, 1, 5), snmp_admin_string()).setMaxAccess('readonly') if mibBuilder.loadTexts: ceAssetMfgAssyNumber.setStatus('current') if mibBuilder.loadTexts: ceAssetMfgAssyNumber.setDescription("This variable indicates the manufacturing assembly number, which is the 'hardware' identification.") ce_asset_mfg_assy_revision = mib_table_column((1, 3, 6, 1, 4, 1, 9, 9, 92, 1, 1, 1, 6), snmp_admin_string()).setMaxAccess('readonly') if mibBuilder.loadTexts: ceAssetMfgAssyRevision.setStatus('current') if mibBuilder.loadTexts: ceAssetMfgAssyRevision.setDescription('This variable indicates the revision of the entity, within the ceAssetMfgAssyNumber.') ce_asset_firmware_id = mib_table_column((1, 3, 6, 1, 4, 1, 9, 9, 92, 1, 1, 1, 7), snmp_admin_string()).setMaxAccess('readonly') if mibBuilder.loadTexts: ceAssetFirmwareID.setStatus('deprecated') if mibBuilder.loadTexts: ceAssetFirmwareID.setDescription("This variable indicates the firmware installed on this entity. For IOS devices, this variable's value is in the IOS Image Naming Convention format. IOS Image Naming Convention Software images are named according to a scheme that identifies what's in the image and what platform it runs on. The names have three parts, separated by dashes: e.g. xxxx-yyyy-ww. xxxx = Platform yyyy = Features ww = Where it executes from and if compressed ") ce_asset_firmware_revision = mib_table_column((1, 3, 6, 1, 4, 1, 9, 9, 92, 1, 1, 1, 8), snmp_admin_string()).setMaxAccess('readonly') if mibBuilder.loadTexts: ceAssetFirmwareRevision.setStatus('deprecated') if mibBuilder.loadTexts: ceAssetFirmwareRevision.setDescription("This variable indicates the revision of firmware installed on this entity. For IOS devices, this variable's value is in the NGRP external customer-visible format. NGRP external customer-visible revision strings have this format: 'x.y (z [p] ) [A] [ [ u ( v [ p ] ) ] ] [ q ]', where: - x.y Combination of two 1-2 digit numerics separated by a '.' that identify the Software major release - z 1-3 digit numeric that identifies the maintenance release of x.y - A 1-3 alpha letters, designator of the release train. - u 1-2 digit numeric that identifies the version of the ED-specific code - v 1-2 digit numeric that identifies the maintenance release of the ED-specific code - v 1-2 digit numeric that identifies the maintenance release of the ED-specific code - p 1 alpha letter that identifies the unusual special case SW Line Stop Fast Re-build by the Release Ops team to replace the posted/shipping release in CCO and Mfg with a version containing a critical catastrophic defect fix that cannot wait until the next maintenance release - q 3 alphanumeric optional suffix used as an indicator in the image banner by the SW Line Stop Re-build process used unusual special case situation when the renumber build has occurred but the images have not been released (value always blank unless these special circumstances require its use). ") ce_asset_software_id = mib_table_column((1, 3, 6, 1, 4, 1, 9, 9, 92, 1, 1, 1, 9), snmp_admin_string()).setMaxAccess('readonly') if mibBuilder.loadTexts: ceAssetSoftwareID.setStatus('deprecated') if mibBuilder.loadTexts: ceAssetSoftwareID.setDescription("This variable indicates the software installed on this entity. For IOS devices, this variable's value is in the IOS Image Naming Convention format. IOS Image Naming Convention --------------------------- Software images are named according to a scheme that identifies what's in the image and what platform it runs on. The names have three parts, separated by dashes: e.g. xxxx-yyyy-ww. xxxx = Platform yyyy = Features ww = Where it executes from and if compressed ") ce_asset_software_revision = mib_table_column((1, 3, 6, 1, 4, 1, 9, 9, 92, 1, 1, 1, 10), snmp_admin_string()).setMaxAccess('readonly') if mibBuilder.loadTexts: ceAssetSoftwareRevision.setStatus('deprecated') if mibBuilder.loadTexts: ceAssetSoftwareRevision.setDescription("This variable indicates the revision of software installed on this entity. For IOS devices, this variable's value is in the NGRP external customer-visible format. NGRP external customer-visible revision strings have this format: 'x.y (z [p] ) [A] [ [ u ( v [ p ] ) ] ] [ q ]', where: - x.y Combination of two 1-2 digit numerics separated by a '.' that identify the Software major release - z 1-3 digit numeric that identifies the maintenance release of x.y - A 1-3 alpha letters, designator of the release train. - u 1-2 digit numeric that identifies the version of the ED-specific code - v 1-2 digit numeric that identifies the maintenance release of the ED-specific code - p 1 alpha letter that identifies the unusual special case SW Line Stop Fast Re-build by the Release Ops team to replace the posted/shipping release in CCO and Mfg with a version containing a critical catastrophic defect fix that cannot wait until the next maintenance release - q 3 alphanumeric optional suffix used as an indicator in the image banner by the SW Line Stop Re-build process used unusual special case situation when the renumber build has occurred but the images have not been released (value always blank unless these special circumstances require its use). ") ce_asset_clei = mib_table_column((1, 3, 6, 1, 4, 1, 9, 9, 92, 1, 1, 1, 11), snmp_admin_string().subtype(subtypeSpec=constraints_union(value_size_constraint(0, 0), value_size_constraint(10, 10)))).setMaxAccess('readonly') if mibBuilder.loadTexts: ceAssetCLEI.setReference('Bellcore Technical reference GR-485-CORE, COMMON LANGUAGE Equipment Processes and Guidelines, Issue 2, October, 1995.') if mibBuilder.loadTexts: ceAssetCLEI.setStatus('current') if mibBuilder.loadTexts: ceAssetCLEI.setDescription('This object represents the CLEI (Common Language Equipment Identifier) code for the physical entity. If the physical entity is not present in the system, or does not have an associated CLEI code, then the value of this object will be a zero-length string.') ce_asset_alias = mib_table_column((1, 3, 6, 1, 4, 1, 9, 9, 92, 1, 1, 1, 12), snmp_admin_string().subtype(subtypeSpec=value_size_constraint(0, 32))).setMaxAccess('readwrite') if mibBuilder.loadTexts: ceAssetAlias.setStatus('deprecated') if mibBuilder.loadTexts: ceAssetAlias.setDescription("This object is an 'alias' name for the physical entity as specified by a network manager, and provides a non-volatile 'handle' for the physical entity. On the first instantiation of an physical entity, the value of entPhysicalAlias associated with that entity is set to the zero-length string. However, agent may set the value to a locally unique default value, instead of a zero-length string. If write access is implemented for an instance of entPhysicalAlias, and a value is written into the instance, the agent must retain the supplied value in the entPhysicalAlias instance associated with the same physical entity for as long as that entity remains instantiated. This includes instantiations across all re-initializations/reboots of the network management system, including those which result in a change of the physical entity's entPhysicalIndex value.") ce_asset_tag = mib_table_column((1, 3, 6, 1, 4, 1, 9, 9, 92, 1, 1, 1, 13), snmp_admin_string().subtype(subtypeSpec=value_size_constraint(0, 32))).setMaxAccess('readwrite') if mibBuilder.loadTexts: ceAssetTag.setStatus('deprecated') if mibBuilder.loadTexts: ceAssetTag.setDescription("This object is a user-assigned asset tracking identifier for the physical entity as specified by a network manager, and provides non-volatile storage of this information. On the first instantiation of an physical entity, the value of ceasAssetID associated with that entity is set to the zero-length string. Not every physical component will have a asset tracking identifier, or even need one. Physical entities for which the associated value of the ceAssetIsFRU object is equal to 'false' (e.g., the repeater ports within a repeater module), do not need their own unique asset tracking identifier. An agent does not have to provide write access for such entities, and may instead return a zero-length string. If write access is implemented for an instance of ceasAssetID, and a value is written into the instance, the agent must retain the supplied value in the ceasAssetID instance associated with the same physical entity for as long as that entity remains instantiated. This includes instantiations across all re-initializations/reboots of the network management system, including those which result in a change of the physical entity's entPhysicalIndex value. If no asset tracking information is associated with the physical component, then this object will contain a zero- length string.") ce_asset_is_fru = mib_table_column((1, 3, 6, 1, 4, 1, 9, 9, 92, 1, 1, 1, 14), truth_value()).setMaxAccess('readonly') if mibBuilder.loadTexts: ceAssetIsFRU.setStatus('deprecated') if mibBuilder.loadTexts: ceAssetIsFRU.setDescription("This object indicates whether or not this physical entity is considered a 'field replaceable unit' by the vendor. If this object contains the value 'true' then the corresponding entPhysicalEntry identifies a field replaceable unit. For all entPhysicalEntries which represent components that are permanently contained within a field replaceable unit, the value 'false' should be returned for this object.") cisco_entity_asset_mib_notifications_prefix = mib_identifier((1, 3, 6, 1, 4, 1, 9, 9, 92, 2)) cisco_entity_asset_mib_notifications = mib_identifier((1, 3, 6, 1, 4, 1, 9, 9, 92, 2, 0)) cisco_entity_asset_mib_conformance = mib_identifier((1, 3, 6, 1, 4, 1, 9, 9, 92, 3)) cisco_entity_asset_mib_compliances = mib_identifier((1, 3, 6, 1, 4, 1, 9, 9, 92, 3, 1)) cisco_entity_asset_mib_groups = mib_identifier((1, 3, 6, 1, 4, 1, 9, 9, 92, 3, 2)) cisco_entity_asset_mib_compliance = module_compliance((1, 3, 6, 1, 4, 1, 9, 9, 92, 3, 1, 1)).setObjects(('CISCO-ENTITY-ASSET-MIB', 'ceAssetGroup')) if getattr(mibBuilder, 'version', (0, 0, 0)) > (4, 4, 0): cisco_entity_asset_mib_compliance = ciscoEntityAssetMIBCompliance.setStatus('deprecated') if mibBuilder.loadTexts: ciscoEntityAssetMIBCompliance.setDescription('An ENTITY-MIB implementation that lists entities with asset information in its entPhysicalTable must implement this group.') cisco_entity_asset_mib_compliance_rev1 = module_compliance((1, 3, 6, 1, 4, 1, 9, 9, 92, 3, 1, 2)).setObjects(('CISCO-ENTITY-ASSET-MIB', 'ceAssetGroupRev1'), ('CISCO-ENTITY-ASSET-MIB', 'ceAssetEntityGroup')) if getattr(mibBuilder, 'version', (0, 0, 0)) > (4, 4, 0): cisco_entity_asset_mib_compliance_rev1 = ciscoEntityAssetMIBComplianceRev1.setStatus('deprecated') if mibBuilder.loadTexts: ciscoEntityAssetMIBComplianceRev1.setDescription('An ENTITY-MIB implementation that lists entities with asset information in its entPhysicalTable must implement this group.') cisco_entity_asset_mib_compliance_rev2 = module_compliance((1, 3, 6, 1, 4, 1, 9, 9, 92, 3, 1, 3)).setObjects(('CISCO-ENTITY-ASSET-MIB', 'ceAssetGroupRev2')) if getattr(mibBuilder, 'version', (0, 0, 0)) > (4, 4, 0): cisco_entity_asset_mib_compliance_rev2 = ciscoEntityAssetMIBComplianceRev2.setStatus('current') if mibBuilder.loadTexts: ciscoEntityAssetMIBComplianceRev2.setDescription('An ENTITY-MIB implementation that lists entities with asset information in its entPhysicalTable must implement this group.') ce_asset_group = object_group((1, 3, 6, 1, 4, 1, 9, 9, 92, 3, 2, 1)).setObjects(('CISCO-ENTITY-ASSET-MIB', 'ceAssetOEMString'), ('CISCO-ENTITY-ASSET-MIB', 'ceAssetSerialNumber'), ('CISCO-ENTITY-ASSET-MIB', 'ceAssetOrderablePartNumber'), ('CISCO-ENTITY-ASSET-MIB', 'ceAssetHardwareRevision'), ('CISCO-ENTITY-ASSET-MIB', 'ceAssetMfgAssyNumber'), ('CISCO-ENTITY-ASSET-MIB', 'ceAssetMfgAssyRevision'), ('CISCO-ENTITY-ASSET-MIB', 'ceAssetFirmwareID'), ('CISCO-ENTITY-ASSET-MIB', 'ceAssetFirmwareRevision'), ('CISCO-ENTITY-ASSET-MIB', 'ceAssetSoftwareID'), ('CISCO-ENTITY-ASSET-MIB', 'ceAssetSoftwareRevision'), ('CISCO-ENTITY-ASSET-MIB', 'ceAssetCLEI'), ('CISCO-ENTITY-ASSET-MIB', 'ceAssetAlias'), ('CISCO-ENTITY-ASSET-MIB', 'ceAssetTag'), ('CISCO-ENTITY-ASSET-MIB', 'ceAssetIsFRU')) if getattr(mibBuilder, 'version', (0, 0, 0)) > (4, 4, 0): ce_asset_group = ceAssetGroup.setStatus('deprecated') if mibBuilder.loadTexts: ceAssetGroup.setDescription('The collection of objects which are used to describe and monitor asset-related data of ENTITY-MIB entPhysicalTable items.') ce_asset_group_rev1 = object_group((1, 3, 6, 1, 4, 1, 9, 9, 92, 3, 2, 2)).setObjects(('CISCO-ENTITY-ASSET-MIB', 'ceAssetOEMString'), ('CISCO-ENTITY-ASSET-MIB', 'ceAssetMfgAssyNumber'), ('CISCO-ENTITY-ASSET-MIB', 'ceAssetMfgAssyRevision'), ('CISCO-ENTITY-ASSET-MIB', 'ceAssetFirmwareID'), ('CISCO-ENTITY-ASSET-MIB', 'ceAssetSoftwareID'), ('CISCO-ENTITY-ASSET-MIB', 'ceAssetCLEI')) if getattr(mibBuilder, 'version', (0, 0, 0)) > (4, 4, 0): ce_asset_group_rev1 = ceAssetGroupRev1.setStatus('deprecated') if mibBuilder.loadTexts: ceAssetGroupRev1.setDescription('The collection of objects which are used to describe and monitor asset-related extension data of ENTITY-MIB (RFC 2737) entPhysicalTable items.') ce_asset_entity_group = object_group((1, 3, 6, 1, 4, 1, 9, 9, 92, 3, 2, 3)).setObjects(('CISCO-ENTITY-ASSET-MIB', 'ceAssetOrderablePartNumber'), ('CISCO-ENTITY-ASSET-MIB', 'ceAssetSerialNumber'), ('CISCO-ENTITY-ASSET-MIB', 'ceAssetHardwareRevision'), ('CISCO-ENTITY-ASSET-MIB', 'ceAssetFirmwareRevision'), ('CISCO-ENTITY-ASSET-MIB', 'ceAssetSoftwareRevision'), ('CISCO-ENTITY-ASSET-MIB', 'ceAssetAlias'), ('CISCO-ENTITY-ASSET-MIB', 'ceAssetTag'), ('CISCO-ENTITY-ASSET-MIB', 'ceAssetIsFRU')) if getattr(mibBuilder, 'version', (0, 0, 0)) > (4, 4, 0): ce_asset_entity_group = ceAssetEntityGroup.setStatus('deprecated') if mibBuilder.loadTexts: ceAssetEntityGroup.setDescription('The collection of objects which are duplicated from the objects in the entPhysicalTable of ENTITY-MIB (RFC 2737).') ce_asset_group_rev2 = object_group((1, 3, 6, 1, 4, 1, 9, 9, 92, 3, 2, 4)).setObjects(('CISCO-ENTITY-ASSET-MIB', 'ceAssetMfgAssyNumber'), ('CISCO-ENTITY-ASSET-MIB', 'ceAssetMfgAssyRevision'), ('CISCO-ENTITY-ASSET-MIB', 'ceAssetCLEI')) if getattr(mibBuilder, 'version', (0, 0, 0)) > (4, 4, 0): ce_asset_group_rev2 = ceAssetGroupRev2.setStatus('current') if mibBuilder.loadTexts: ceAssetGroupRev2.setDescription('The collection of objects which are used to describe and monitor asset-related extension data of ENTITY-MIB (RFC 2737) entPhysicalTable items.') mibBuilder.exportSymbols('CISCO-ENTITY-ASSET-MIB', ciscoEntityAssetMIBComplianceRev1=ciscoEntityAssetMIBComplianceRev1, ciscoEntityAssetMIB=ciscoEntityAssetMIB, ceAssetTag=ceAssetTag, ciscoEntityAssetMIBGroups=ciscoEntityAssetMIBGroups, ceAssetFirmwareRevision=ceAssetFirmwareRevision, ceAssetAlias=ceAssetAlias, ciscoEntityAssetMIBNotifications=ciscoEntityAssetMIBNotifications, ceAssetGroup=ceAssetGroup, PYSNMP_MODULE_ID=ciscoEntityAssetMIB, ceAssetCLEI=ceAssetCLEI, ceAssetMfgAssyNumber=ceAssetMfgAssyNumber, ceAssetSerialNumber=ceAssetSerialNumber, ceAssetHardwareRevision=ceAssetHardwareRevision, ceAssetGroupRev2=ceAssetGroupRev2, ciscoEntityAssetMIBComplianceRev2=ciscoEntityAssetMIBComplianceRev2, ciscoEntityAssetMIBObjects=ciscoEntityAssetMIBObjects, ceAssetEntry=ceAssetEntry, ciscoEntityAssetMIBCompliances=ciscoEntityAssetMIBCompliances, ciscoEntityAssetMIBCompliance=ciscoEntityAssetMIBCompliance, ceAssetSoftwareRevision=ceAssetSoftwareRevision, ceAssetIsFRU=ceAssetIsFRU, ciscoEntityAssetMIBConformance=ciscoEntityAssetMIBConformance, ceAssetOEMString=ceAssetOEMString, ceAssetFirmwareID=ceAssetFirmwareID, ceAssetTable=ceAssetTable, ceAssetEntityGroup=ceAssetEntityGroup, ciscoEntityAssetMIBNotificationsPrefix=ciscoEntityAssetMIBNotificationsPrefix, ceAssetSoftwareID=ceAssetSoftwareID, ceAssetGroupRev1=ceAssetGroupRev1, ceAssetOrderablePartNumber=ceAssetOrderablePartNumber, ceAssetMfgAssyRevision=ceAssetMfgAssyRevision)
def egcd(a, b): if a==0: return b, 0, 1 else: gcd, x, y = egcd(b%a, a) return gcd, y-(b//a)*x, x if __name__ == '__main__': a = int(input('Enter a: ')) b = int(input('Enter b: ')) gcd, x, y = egcd(a, b) print(egcd(a,b)) if gcd!=1: print("M.I. doesn't exist") else: print('M.I. of b under modulo a is: ', (x%b + b)%b)
def egcd(a, b): if a == 0: return (b, 0, 1) else: (gcd, x, y) = egcd(b % a, a) return (gcd, y - b // a * x, x) if __name__ == '__main__': a = int(input('Enter a: ')) b = int(input('Enter b: ')) (gcd, x, y) = egcd(a, b) print(egcd(a, b)) if gcd != 1: print("M.I. doesn't exist") else: print('M.I. of b under modulo a is: ', (x % b + b) % b)
def app(environ, start_response): s = "" for i in environ['QUERY_STRING'].split("&"): s = s + i + "\r\n" start_response("200 OK", [ ("Content-Type", "text/plain"), ("Content-Length", str(len(s))) ]) return [bytes(s, 'utf-8')]
def app(environ, start_response): s = '' for i in environ['QUERY_STRING'].split('&'): s = s + i + '\r\n' start_response('200 OK', [('Content-Type', 'text/plain'), ('Content-Length', str(len(s)))]) return [bytes(s, 'utf-8')]
deck_test = { "kategori 1": ["kartuA", "kartuB", "kartuC", "kartuD"], "kategori 2": ["kartuE", "kartuF", "kartuG", "kartuH"], "kategori 3": ["kartuI", "kartuJ", "kartuK", "kartuL"], # "kategori 4": ["kartuM", "kartuN", "kartuO", "kartuP"], # "kategori 5": ["kartuQ", "kartuR", "kartuS", "kartuT"], } deck_used = { "nasi": ["nasi goreng", "nasi uduk", "nasi kuning", "nasi kucing"], "air": ["air putih", "air santan", "air susu", "air tajin"], "benda lengkung": ["busur", "karet", "tampah", "jembatan"], "minuman": ["kopi", "teh", "cincau", "boba"], "sumber tenaga": ["listrik", "bensin", "matahari", "karbohidrat"], "manisan": ["permen", "coklat", "gula", "tebu"], "tempat tinggal": ["hotel", "apartemen", "rumah", "emperan"] }
deck_test = {'kategori 1': ['kartuA', 'kartuB', 'kartuC', 'kartuD'], 'kategori 2': ['kartuE', 'kartuF', 'kartuG', 'kartuH'], 'kategori 3': ['kartuI', 'kartuJ', 'kartuK', 'kartuL']} deck_used = {'nasi': ['nasi goreng', 'nasi uduk', 'nasi kuning', 'nasi kucing'], 'air': ['air putih', 'air santan', 'air susu', 'air tajin'], 'benda lengkung': ['busur', 'karet', 'tampah', 'jembatan'], 'minuman': ['kopi', 'teh', 'cincau', 'boba'], 'sumber tenaga': ['listrik', 'bensin', 'matahari', 'karbohidrat'], 'manisan': ['permen', 'coklat', 'gula', 'tebu'], 'tempat tinggal': ['hotel', 'apartemen', 'rumah', 'emperan']}
data = [int(input()), input()] if 10 <= data[0] <= 15 and data[1] == "f": print("YES") else: print("NO")
data = [int(input()), input()] if 10 <= data[0] <= 15 and data[1] == 'f': print('YES') else: print('NO')
class Solution: def findMaxConsecutiveOnes(self, nums: List[int]) -> int: res = cnt = 0 for i in nums: if i: cnt += 1 else: if cnt: res = max(res, cnt) cnt = 0 return max(res, cnt)
class Solution: def find_max_consecutive_ones(self, nums: List[int]) -> int: res = cnt = 0 for i in nums: if i: cnt += 1 elif cnt: res = max(res, cnt) cnt = 0 return max(res, cnt)
n = int(input()) while True: s,z =0,n while z>0: s+=z%10 z//=10 if n%s==0: print(n) break n+=1
n = int(input()) while True: (s, z) = (0, n) while z > 0: s += z % 10 z //= 10 if n % s == 0: print(n) break n += 1
n = int(input()) k = n >> 1 ans = 1 for i in range(n-k+1,n+1): ans *= i for i in range(1,k+1): ans //= i print (ans)
n = int(input()) k = n >> 1 ans = 1 for i in range(n - k + 1, n + 1): ans *= i for i in range(1, k + 1): ans //= i print(ans)
# # PySNMP MIB module DVMRP-STD-MIB-UNI (http://snmplabs.com/pysmi) # ASN.1 source file:///Users/davwang4/Dev/mibs.snmplabs.com/asn1/DVMRP-STD-MIB-UNI # Produced by pysmi-0.3.4 at Mon Apr 29 18:40:19 2019 # On host DAVWANG4-M-1475 platform Darwin version 18.5.0 by user davwang4 # Using Python version 3.7.3 (default, Mar 27 2019, 09:23:15) # Integer, OctetString, ObjectIdentifier = mibBuilder.importSymbols("ASN1", "Integer", "OctetString", "ObjectIdentifier") NamedValues, = mibBuilder.importSymbols("ASN1-ENUMERATION", "NamedValues") ValueSizeConstraint, SingleValueConstraint, ConstraintsUnion, ConstraintsIntersection, ValueRangeConstraint = mibBuilder.importSymbols("ASN1-REFINEMENT", "ValueSizeConstraint", "SingleValueConstraint", "ConstraintsUnion", "ConstraintsIntersection", "ValueRangeConstraint") InterfaceIndex, InterfaceIndexOrZero = mibBuilder.importSymbols("IF-MIB", "InterfaceIndex", "InterfaceIndexOrZero") SnmpAdminString, = mibBuilder.importSymbols("SNMP-FRAMEWORK-MIB", "SnmpAdminString") NotificationGroup, ObjectGroup, ModuleCompliance = mibBuilder.importSymbols("SNMPv2-CONF", "NotificationGroup", "ObjectGroup", "ModuleCompliance") Integer32, TimeTicks, NotificationType, MibScalar, MibTable, MibTableRow, MibTableColumn, Counter64, MibIdentifier, Unsigned32, ModuleIdentity, iso, IpAddress, Bits, ObjectIdentity, Gauge32, Counter32 = mibBuilder.importSymbols("SNMPv2-SMI", "Integer32", "TimeTicks", "NotificationType", "MibScalar", "MibTable", "MibTableRow", "MibTableColumn", "Counter64", "MibIdentifier", "Unsigned32", "ModuleIdentity", "iso", "IpAddress", "Bits", "ObjectIdentity", "Gauge32", "Counter32") TextualConvention, DisplayString, RowStatus = mibBuilder.importSymbols("SNMPv2-TC", "TextualConvention", "DisplayString", "RowStatus") usdDvmrpExperiment, = mibBuilder.importSymbols("Unisphere-Data-Experiment", "usdDvmrpExperiment") dvmrpStdMIB = ModuleIdentity((1, 3, 6, 1, 4, 1, 4874, 3, 2, 1, 1)) dvmrpStdMIB.setRevisions(('1999-10-19 12:00',)) if mibBuilder.loadTexts: dvmrpStdMIB.setLastUpdated('9910191200Z') if mibBuilder.loadTexts: dvmrpStdMIB.setOrganization('IETF IDMR Working Group.') dvmrpMIBObjects = MibIdentifier((1, 3, 6, 1, 4, 1, 4874, 3, 2, 1, 1, 1)) dvmrp = MibIdentifier((1, 3, 6, 1, 4, 1, 4874, 3, 2, 1, 1, 1, 1)) dvmrpScalar = MibIdentifier((1, 3, 6, 1, 4, 1, 4874, 3, 2, 1, 1, 1, 1, 1)) dvmrpVersionString = MibScalar((1, 3, 6, 1, 4, 1, 4874, 3, 2, 1, 1, 1, 1, 1, 1), DisplayString()).setMaxAccess("readonly") if mibBuilder.loadTexts: dvmrpVersionString.setStatus('current') dvmrpGenerationId = MibScalar((1, 3, 6, 1, 4, 1, 4874, 3, 2, 1, 1, 1, 1, 1, 2), Integer32()).setMaxAccess("readonly") if mibBuilder.loadTexts: dvmrpGenerationId.setStatus('current') dvmrpNumRoutes = MibScalar((1, 3, 6, 1, 4, 1, 4874, 3, 2, 1, 1, 1, 1, 1, 3), Gauge32()).setMaxAccess("readonly") if mibBuilder.loadTexts: dvmrpNumRoutes.setStatus('current') dvmrpReachableRoutes = MibScalar((1, 3, 6, 1, 4, 1, 4874, 3, 2, 1, 1, 1, 1, 1, 4), Gauge32()).setMaxAccess("readonly") if mibBuilder.loadTexts: dvmrpReachableRoutes.setStatus('current') dvmrpInterfaceTable = MibTable((1, 3, 6, 1, 4, 1, 4874, 3, 2, 1, 1, 1, 1, 2), ) if mibBuilder.loadTexts: dvmrpInterfaceTable.setStatus('current') dvmrpInterfaceEntry = MibTableRow((1, 3, 6, 1, 4, 1, 4874, 3, 2, 1, 1, 1, 1, 2, 1), ).setIndexNames((0, "DVMRP-STD-MIB-UNI", "dvmrpInterfaceIfIndex")) if mibBuilder.loadTexts: dvmrpInterfaceEntry.setStatus('current') dvmrpInterfaceIfIndex = MibTableColumn((1, 3, 6, 1, 4, 1, 4874, 3, 2, 1, 1, 1, 1, 2, 1, 1), InterfaceIndex()) if mibBuilder.loadTexts: dvmrpInterfaceIfIndex.setStatus('current') dvmrpInterfaceLocalAddress = MibTableColumn((1, 3, 6, 1, 4, 1, 4874, 3, 2, 1, 1, 1, 1, 2, 1, 2), IpAddress()).setMaxAccess("readcreate") if mibBuilder.loadTexts: dvmrpInterfaceLocalAddress.setStatus('current') dvmrpInterfaceMetric = MibTableColumn((1, 3, 6, 1, 4, 1, 4874, 3, 2, 1, 1, 1, 1, 2, 1, 3), Integer32().subtype(subtypeSpec=ValueRangeConstraint(1, 31)).clone(1)).setMaxAccess("readcreate") if mibBuilder.loadTexts: dvmrpInterfaceMetric.setStatus('current') dvmrpInterfaceStatus = MibTableColumn((1, 3, 6, 1, 4, 1, 4874, 3, 2, 1, 1, 1, 1, 2, 1, 4), RowStatus()).setMaxAccess("readcreate") if mibBuilder.loadTexts: dvmrpInterfaceStatus.setStatus('current') dvmrpInterfaceRcvBadPkts = MibTableColumn((1, 3, 6, 1, 4, 1, 4874, 3, 2, 1, 1, 1, 1, 2, 1, 5), Counter32()).setMaxAccess("readonly") if mibBuilder.loadTexts: dvmrpInterfaceRcvBadPkts.setStatus('current') dvmrpInterfaceRcvBadRoutes = MibTableColumn((1, 3, 6, 1, 4, 1, 4874, 3, 2, 1, 1, 1, 1, 2, 1, 6), Counter32()).setMaxAccess("readonly") if mibBuilder.loadTexts: dvmrpInterfaceRcvBadRoutes.setStatus('current') dvmrpInterfaceSentRoutes = MibTableColumn((1, 3, 6, 1, 4, 1, 4874, 3, 2, 1, 1, 1, 1, 2, 1, 7), Counter32()).setMaxAccess("readonly") if mibBuilder.loadTexts: dvmrpInterfaceSentRoutes.setStatus('current') dvmrpInterfaceInterfaceKey = MibTableColumn((1, 3, 6, 1, 4, 1, 4874, 3, 2, 1, 1, 1, 1, 2, 1, 8), SnmpAdminString()).setMaxAccess("readcreate") if mibBuilder.loadTexts: dvmrpInterfaceInterfaceKey.setStatus('current') dvmrpInterfaceInterfaceKeyVersion = MibTableColumn((1, 3, 6, 1, 4, 1, 4874, 3, 2, 1, 1, 1, 1, 2, 1, 9), Integer32()).setMaxAccess("readcreate") if mibBuilder.loadTexts: dvmrpInterfaceInterfaceKeyVersion.setStatus('current') dvmrpNeighborTable = MibTable((1, 3, 6, 1, 4, 1, 4874, 3, 2, 1, 1, 1, 1, 3), ) if mibBuilder.loadTexts: dvmrpNeighborTable.setStatus('current') dvmrpNeighborEntry = MibTableRow((1, 3, 6, 1, 4, 1, 4874, 3, 2, 1, 1, 1, 1, 3, 1), ).setIndexNames((0, "DVMRP-STD-MIB-UNI", "dvmrpNeighborIfIndex"), (0, "DVMRP-STD-MIB-UNI", "dvmrpNeighborAddress")) if mibBuilder.loadTexts: dvmrpNeighborEntry.setStatus('current') dvmrpNeighborIfIndex = MibTableColumn((1, 3, 6, 1, 4, 1, 4874, 3, 2, 1, 1, 1, 1, 3, 1, 1), InterfaceIndex()) if mibBuilder.loadTexts: dvmrpNeighborIfIndex.setStatus('current') dvmrpNeighborAddress = MibTableColumn((1, 3, 6, 1, 4, 1, 4874, 3, 2, 1, 1, 1, 1, 3, 1, 2), IpAddress()) if mibBuilder.loadTexts: dvmrpNeighborAddress.setStatus('current') dvmrpNeighborUpTime = MibTableColumn((1, 3, 6, 1, 4, 1, 4874, 3, 2, 1, 1, 1, 1, 3, 1, 3), TimeTicks()).setMaxAccess("readonly") if mibBuilder.loadTexts: dvmrpNeighborUpTime.setStatus('current') dvmrpNeighborExpiryTime = MibTableColumn((1, 3, 6, 1, 4, 1, 4874, 3, 2, 1, 1, 1, 1, 3, 1, 4), TimeTicks()).setMaxAccess("readonly") if mibBuilder.loadTexts: dvmrpNeighborExpiryTime.setStatus('current') dvmrpNeighborGenerationId = MibTableColumn((1, 3, 6, 1, 4, 1, 4874, 3, 2, 1, 1, 1, 1, 3, 1, 5), Integer32()).setMaxAccess("readonly") if mibBuilder.loadTexts: dvmrpNeighborGenerationId.setStatus('current') dvmrpNeighborMajorVersion = MibTableColumn((1, 3, 6, 1, 4, 1, 4874, 3, 2, 1, 1, 1, 1, 3, 1, 6), Integer32().subtype(subtypeSpec=ValueRangeConstraint(0, 255))).setMaxAccess("readonly") if mibBuilder.loadTexts: dvmrpNeighborMajorVersion.setStatus('current') dvmrpNeighborMinorVersion = MibTableColumn((1, 3, 6, 1, 4, 1, 4874, 3, 2, 1, 1, 1, 1, 3, 1, 7), Integer32().subtype(subtypeSpec=ValueRangeConstraint(0, 255))).setMaxAccess("readonly") if mibBuilder.loadTexts: dvmrpNeighborMinorVersion.setStatus('current') dvmrpNeighborCapabilities = MibTableColumn((1, 3, 6, 1, 4, 1, 4874, 3, 2, 1, 1, 1, 1, 3, 1, 8), Bits().clone(namedValues=NamedValues(("leaf", 0), ("prune", 1), ("generationID", 2), ("mtrace", 3)))).setMaxAccess("readonly") if mibBuilder.loadTexts: dvmrpNeighborCapabilities.setStatus('current') dvmrpNeighborRcvRoutes = MibTableColumn((1, 3, 6, 1, 4, 1, 4874, 3, 2, 1, 1, 1, 1, 3, 1, 9), Counter32()).setMaxAccess("readonly") if mibBuilder.loadTexts: dvmrpNeighborRcvRoutes.setStatus('current') dvmrpNeighborRcvBadPkts = MibTableColumn((1, 3, 6, 1, 4, 1, 4874, 3, 2, 1, 1, 1, 1, 3, 1, 10), Counter32()).setMaxAccess("readonly") if mibBuilder.loadTexts: dvmrpNeighborRcvBadPkts.setStatus('current') dvmrpNeighborRcvBadRoutes = MibTableColumn((1, 3, 6, 1, 4, 1, 4874, 3, 2, 1, 1, 1, 1, 3, 1, 11), Counter32()).setMaxAccess("readonly") if mibBuilder.loadTexts: dvmrpNeighborRcvBadRoutes.setStatus('current') dvmrpNeighborState = MibTableColumn((1, 3, 6, 1, 4, 1, 4874, 3, 2, 1, 1, 1, 1, 3, 1, 12), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2, 3, 4))).clone(namedValues=NamedValues(("oneway", 1), ("active", 2), ("ignoring", 3), ("down", 4)))).setMaxAccess("readonly") if mibBuilder.loadTexts: dvmrpNeighborState.setStatus('current') dvmrpRouteTable = MibTable((1, 3, 6, 1, 4, 1, 4874, 3, 2, 1, 1, 1, 1, 4), ) if mibBuilder.loadTexts: dvmrpRouteTable.setStatus('current') dvmrpRouteEntry = MibTableRow((1, 3, 6, 1, 4, 1, 4874, 3, 2, 1, 1, 1, 1, 4, 1), ).setIndexNames((0, "DVMRP-STD-MIB-UNI", "dvmrpRouteSource"), (0, "DVMRP-STD-MIB-UNI", "dvmrpRouteSourceMask")) if mibBuilder.loadTexts: dvmrpRouteEntry.setStatus('current') dvmrpRouteSource = MibTableColumn((1, 3, 6, 1, 4, 1, 4874, 3, 2, 1, 1, 1, 1, 4, 1, 1), IpAddress()) if mibBuilder.loadTexts: dvmrpRouteSource.setStatus('current') dvmrpRouteSourceMask = MibTableColumn((1, 3, 6, 1, 4, 1, 4874, 3, 2, 1, 1, 1, 1, 4, 1, 2), IpAddress()) if mibBuilder.loadTexts: dvmrpRouteSourceMask.setStatus('current') dvmrpRouteUpstreamNeighbor = MibTableColumn((1, 3, 6, 1, 4, 1, 4874, 3, 2, 1, 1, 1, 1, 4, 1, 3), IpAddress()).setMaxAccess("readonly") if mibBuilder.loadTexts: dvmrpRouteUpstreamNeighbor.setStatus('current') dvmrpRouteIfIndex = MibTableColumn((1, 3, 6, 1, 4, 1, 4874, 3, 2, 1, 1, 1, 1, 4, 1, 4), InterfaceIndexOrZero()).setMaxAccess("readonly") if mibBuilder.loadTexts: dvmrpRouteIfIndex.setStatus('current') dvmrpRouteMetric = MibTableColumn((1, 3, 6, 1, 4, 1, 4874, 3, 2, 1, 1, 1, 1, 4, 1, 5), Integer32().subtype(subtypeSpec=ValueRangeConstraint(1, 32))).setMaxAccess("readonly") if mibBuilder.loadTexts: dvmrpRouteMetric.setStatus('current') dvmrpRouteExpiryTime = MibTableColumn((1, 3, 6, 1, 4, 1, 4874, 3, 2, 1, 1, 1, 1, 4, 1, 6), TimeTicks()).setMaxAccess("readonly") if mibBuilder.loadTexts: dvmrpRouteExpiryTime.setStatus('current') dvmrpRouteUpTime = MibTableColumn((1, 3, 6, 1, 4, 1, 4874, 3, 2, 1, 1, 1, 1, 4, 1, 7), TimeTicks()).setMaxAccess("readonly") if mibBuilder.loadTexts: dvmrpRouteUpTime.setStatus('current') dvmrpRouteNextHopTable = MibTable((1, 3, 6, 1, 4, 1, 4874, 3, 2, 1, 1, 1, 1, 5), ) if mibBuilder.loadTexts: dvmrpRouteNextHopTable.setStatus('current') dvmrpRouteNextHopEntry = MibTableRow((1, 3, 6, 1, 4, 1, 4874, 3, 2, 1, 1, 1, 1, 5, 1), ).setIndexNames((0, "DVMRP-STD-MIB-UNI", "dvmrpRouteNextHopSource"), (0, "DVMRP-STD-MIB-UNI", "dvmrpRouteNextHopSourceMask"), (0, "DVMRP-STD-MIB-UNI", "dvmrpRouteNextHopIfIndex")) if mibBuilder.loadTexts: dvmrpRouteNextHopEntry.setStatus('current') dvmrpRouteNextHopSource = MibTableColumn((1, 3, 6, 1, 4, 1, 4874, 3, 2, 1, 1, 1, 1, 5, 1, 1), IpAddress()) if mibBuilder.loadTexts: dvmrpRouteNextHopSource.setStatus('current') dvmrpRouteNextHopSourceMask = MibTableColumn((1, 3, 6, 1, 4, 1, 4874, 3, 2, 1, 1, 1, 1, 5, 1, 2), IpAddress()) if mibBuilder.loadTexts: dvmrpRouteNextHopSourceMask.setStatus('current') dvmrpRouteNextHopIfIndex = MibTableColumn((1, 3, 6, 1, 4, 1, 4874, 3, 2, 1, 1, 1, 1, 5, 1, 3), InterfaceIndex()) if mibBuilder.loadTexts: dvmrpRouteNextHopIfIndex.setStatus('current') dvmrpRouteNextHopType = MibTableColumn((1, 3, 6, 1, 4, 1, 4874, 3, 2, 1, 1, 1, 1, 5, 1, 4), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2))).clone(namedValues=NamedValues(("leaf", 1), ("branch", 2)))).setMaxAccess("readonly") if mibBuilder.loadTexts: dvmrpRouteNextHopType.setStatus('current') dvmrpPruneTable = MibTable((1, 3, 6, 1, 4, 1, 4874, 3, 2, 1, 1, 1, 1, 6), ) if mibBuilder.loadTexts: dvmrpPruneTable.setStatus('current') dvmrpPruneEntry = MibTableRow((1, 3, 6, 1, 4, 1, 4874, 3, 2, 1, 1, 1, 1, 6, 1), ).setIndexNames((0, "DVMRP-STD-MIB-UNI", "dvmrpPruneGroup"), (0, "DVMRP-STD-MIB-UNI", "dvmrpPruneSource"), (0, "DVMRP-STD-MIB-UNI", "dvmrpPruneSourceMask")) if mibBuilder.loadTexts: dvmrpPruneEntry.setStatus('current') dvmrpPruneGroup = MibTableColumn((1, 3, 6, 1, 4, 1, 4874, 3, 2, 1, 1, 1, 1, 6, 1, 1), IpAddress()) if mibBuilder.loadTexts: dvmrpPruneGroup.setStatus('current') dvmrpPruneSource = MibTableColumn((1, 3, 6, 1, 4, 1, 4874, 3, 2, 1, 1, 1, 1, 6, 1, 2), IpAddress()) if mibBuilder.loadTexts: dvmrpPruneSource.setStatus('current') dvmrpPruneSourceMask = MibTableColumn((1, 3, 6, 1, 4, 1, 4874, 3, 2, 1, 1, 1, 1, 6, 1, 3), IpAddress()) if mibBuilder.loadTexts: dvmrpPruneSourceMask.setStatus('current') dvmrpPruneExpiryTime = MibTableColumn((1, 3, 6, 1, 4, 1, 4874, 3, 2, 1, 1, 1, 1, 6, 1, 4), TimeTicks()).setMaxAccess("readonly") if mibBuilder.loadTexts: dvmrpPruneExpiryTime.setStatus('current') dvmrpTraps = MibIdentifier((1, 3, 6, 1, 4, 1, 4874, 3, 2, 1, 1, 1, 1, 0)) dvmrpNeighborLoss = NotificationType((1, 3, 6, 1, 4, 1, 4874, 3, 2, 1, 1, 1, 1, 0, 1)).setObjects(("DVMRP-STD-MIB-UNI", "dvmrpInterfaceLocalAddress"), ("DVMRP-STD-MIB-UNI", "dvmrpNeighborState")) if mibBuilder.loadTexts: dvmrpNeighborLoss.setStatus('current') dvmrpNeighborNotPruning = NotificationType((1, 3, 6, 1, 4, 1, 4874, 3, 2, 1, 1, 1, 1, 0, 2)).setObjects(("DVMRP-STD-MIB-UNI", "dvmrpInterfaceLocalAddress"), ("DVMRP-STD-MIB-UNI", "dvmrpNeighborCapabilities")) if mibBuilder.loadTexts: dvmrpNeighborNotPruning.setStatus('current') dvmrpMIBConformance = MibIdentifier((1, 3, 6, 1, 4, 1, 4874, 3, 2, 1, 1, 2)) dvmrpMIBCompliances = MibIdentifier((1, 3, 6, 1, 4, 1, 4874, 3, 2, 1, 1, 2, 1)) dvmrpMIBGroups = MibIdentifier((1, 3, 6, 1, 4, 1, 4874, 3, 2, 1, 1, 2, 2)) dvmrpMIBCompliance = ModuleCompliance((1, 3, 6, 1, 4, 1, 4874, 3, 2, 1, 1, 2, 1, 1)).setObjects(("DVMRP-STD-MIB-UNI", "dvmrpGeneralGroup"), ("DVMRP-STD-MIB-UNI", "dvmrpInterfaceGroup"), ("DVMRP-STD-MIB-UNI", "dvmrpNeighborGroup"), ("DVMRP-STD-MIB-UNI", "dvmrpRoutingGroup"), ("DVMRP-STD-MIB-UNI", "dvmrpTreeGroup"), ("DVMRP-STD-MIB-UNI", "dvmrpSecurityGroup")) if getattr(mibBuilder, 'version', (0, 0, 0)) > (4, 4, 0): dvmrpMIBCompliance = dvmrpMIBCompliance.setStatus('current') dvmrpGeneralGroup = ObjectGroup((1, 3, 6, 1, 4, 1, 4874, 3, 2, 1, 1, 2, 2, 2)).setObjects(("DVMRP-STD-MIB-UNI", "dvmrpVersionString"), ("DVMRP-STD-MIB-UNI", "dvmrpGenerationId"), ("DVMRP-STD-MIB-UNI", "dvmrpNumRoutes"), ("DVMRP-STD-MIB-UNI", "dvmrpReachableRoutes")) if getattr(mibBuilder, 'version', (0, 0, 0)) > (4, 4, 0): dvmrpGeneralGroup = dvmrpGeneralGroup.setStatus('current') dvmrpInterfaceGroup = ObjectGroup((1, 3, 6, 1, 4, 1, 4874, 3, 2, 1, 1, 2, 2, 3)).setObjects(("DVMRP-STD-MIB-UNI", "dvmrpInterfaceLocalAddress"), ("DVMRP-STD-MIB-UNI", "dvmrpInterfaceMetric"), ("DVMRP-STD-MIB-UNI", "dvmrpInterfaceStatus"), ("DVMRP-STD-MIB-UNI", "dvmrpInterfaceRcvBadPkts"), ("DVMRP-STD-MIB-UNI", "dvmrpInterfaceRcvBadRoutes"), ("DVMRP-STD-MIB-UNI", "dvmrpInterfaceSentRoutes")) if getattr(mibBuilder, 'version', (0, 0, 0)) > (4, 4, 0): dvmrpInterfaceGroup = dvmrpInterfaceGroup.setStatus('current') dvmrpNeighborGroup = ObjectGroup((1, 3, 6, 1, 4, 1, 4874, 3, 2, 1, 1, 2, 2, 4)).setObjects(("DVMRP-STD-MIB-UNI", "dvmrpNeighborUpTime"), ("DVMRP-STD-MIB-UNI", "dvmrpNeighborExpiryTime"), ("DVMRP-STD-MIB-UNI", "dvmrpNeighborGenerationId"), ("DVMRP-STD-MIB-UNI", "dvmrpNeighborMajorVersion"), ("DVMRP-STD-MIB-UNI", "dvmrpNeighborMinorVersion"), ("DVMRP-STD-MIB-UNI", "dvmrpNeighborCapabilities"), ("DVMRP-STD-MIB-UNI", "dvmrpNeighborRcvRoutes"), ("DVMRP-STD-MIB-UNI", "dvmrpNeighborRcvBadPkts"), ("DVMRP-STD-MIB-UNI", "dvmrpNeighborRcvBadRoutes"), ("DVMRP-STD-MIB-UNI", "dvmrpNeighborState")) if getattr(mibBuilder, 'version', (0, 0, 0)) > (4, 4, 0): dvmrpNeighborGroup = dvmrpNeighborGroup.setStatus('current') dvmrpRoutingGroup = ObjectGroup((1, 3, 6, 1, 4, 1, 4874, 3, 2, 1, 1, 2, 2, 5)).setObjects(("DVMRP-STD-MIB-UNI", "dvmrpRouteUpstreamNeighbor"), ("DVMRP-STD-MIB-UNI", "dvmrpRouteIfIndex"), ("DVMRP-STD-MIB-UNI", "dvmrpRouteMetric"), ("DVMRP-STD-MIB-UNI", "dvmrpRouteExpiryTime"), ("DVMRP-STD-MIB-UNI", "dvmrpRouteUpTime"), ("DVMRP-STD-MIB-UNI", "dvmrpRouteNextHopType")) if getattr(mibBuilder, 'version', (0, 0, 0)) > (4, 4, 0): dvmrpRoutingGroup = dvmrpRoutingGroup.setStatus('current') dvmrpSecurityGroup = ObjectGroup((1, 3, 6, 1, 4, 1, 4874, 3, 2, 1, 1, 2, 2, 6)).setObjects(("DVMRP-STD-MIB-UNI", "dvmrpInterfaceInterfaceKey"), ("DVMRP-STD-MIB-UNI", "dvmrpInterfaceInterfaceKeyVersion")) if getattr(mibBuilder, 'version', (0, 0, 0)) > (4, 4, 0): dvmrpSecurityGroup = dvmrpSecurityGroup.setStatus('current') dvmrpTreeGroup = ObjectGroup((1, 3, 6, 1, 4, 1, 4874, 3, 2, 1, 1, 2, 2, 7)).setObjects(("DVMRP-STD-MIB-UNI", "dvmrpPruneExpiryTime")) if getattr(mibBuilder, 'version', (0, 0, 0)) > (4, 4, 0): dvmrpTreeGroup = dvmrpTreeGroup.setStatus('current') dvmrpNotificationGroup = NotificationGroup((1, 3, 6, 1, 4, 1, 4874, 3, 2, 1, 1, 2, 2, 8)).setObjects(("DVMRP-STD-MIB-UNI", "dvmrpNeighborLoss"), ("DVMRP-STD-MIB-UNI", "dvmrpNeighborNotPruning")) if getattr(mibBuilder, 'version', (0, 0, 0)) > (4, 4, 0): dvmrpNotificationGroup = dvmrpNotificationGroup.setStatus('current') mibBuilder.exportSymbols("DVMRP-STD-MIB-UNI", dvmrpInterfaceRcvBadRoutes=dvmrpInterfaceRcvBadRoutes, dvmrpNeighborMinorVersion=dvmrpNeighborMinorVersion, dvmrpNeighborUpTime=dvmrpNeighborUpTime, dvmrpNeighborEntry=dvmrpNeighborEntry, dvmrpReachableRoutes=dvmrpReachableRoutes, dvmrpInterfaceIfIndex=dvmrpInterfaceIfIndex, dvmrpNeighborAddress=dvmrpNeighborAddress, dvmrpPruneGroup=dvmrpPruneGroup, dvmrpPruneExpiryTime=dvmrpPruneExpiryTime, dvmrpMIBCompliances=dvmrpMIBCompliances, dvmrpRouteUpTime=dvmrpRouteUpTime, dvmrpInterfaceInterfaceKey=dvmrpInterfaceInterfaceKey, dvmrp=dvmrp, dvmrpNeighborExpiryTime=dvmrpNeighborExpiryTime, dvmrpNeighborRcvBadRoutes=dvmrpNeighborRcvBadRoutes, dvmrpInterfaceSentRoutes=dvmrpInterfaceSentRoutes, dvmrpRouteSource=dvmrpRouteSource, dvmrpRouteNextHopTable=dvmrpRouteNextHopTable, dvmrpRouteNextHopSourceMask=dvmrpRouteNextHopSourceMask, dvmrpRouteNextHopIfIndex=dvmrpRouteNextHopIfIndex, dvmrpTraps=dvmrpTraps, dvmrpNeighborNotPruning=dvmrpNeighborNotPruning, dvmrpNeighborState=dvmrpNeighborState, dvmrpRouteTable=dvmrpRouteTable, dvmrpNeighborRcvRoutes=dvmrpNeighborRcvRoutes, dvmrpScalar=dvmrpScalar, dvmrpMIBGroups=dvmrpMIBGroups, dvmrpRouteIfIndex=dvmrpRouteIfIndex, dvmrpInterfaceLocalAddress=dvmrpInterfaceLocalAddress, dvmrpNeighborCapabilities=dvmrpNeighborCapabilities, dvmrpRouteNextHopSource=dvmrpRouteNextHopSource, dvmrpRouteNextHopType=dvmrpRouteNextHopType, dvmrpInterfaceRcvBadPkts=dvmrpInterfaceRcvBadPkts, dvmrpRouteSourceMask=dvmrpRouteSourceMask, dvmrpNotificationGroup=dvmrpNotificationGroup, dvmrpInterfaceInterfaceKeyVersion=dvmrpInterfaceInterfaceKeyVersion, dvmrpSecurityGroup=dvmrpSecurityGroup, PYSNMP_MODULE_ID=dvmrpStdMIB, dvmrpRouteEntry=dvmrpRouteEntry, dvmrpNeighborTable=dvmrpNeighborTable, dvmrpRouteUpstreamNeighbor=dvmrpRouteUpstreamNeighbor, dvmrpPruneSource=dvmrpPruneSource, dvmrpGeneralGroup=dvmrpGeneralGroup, dvmrpNeighborRcvBadPkts=dvmrpNeighborRcvBadPkts, dvmrpNeighborLoss=dvmrpNeighborLoss, dvmrpStdMIB=dvmrpStdMIB, dvmrpPruneSourceMask=dvmrpPruneSourceMask, dvmrpRouteExpiryTime=dvmrpRouteExpiryTime, dvmrpNeighborMajorVersion=dvmrpNeighborMajorVersion, dvmrpRouteNextHopEntry=dvmrpRouteNextHopEntry, dvmrpInterfaceMetric=dvmrpInterfaceMetric, dvmrpNeighborGroup=dvmrpNeighborGroup, dvmrpInterfaceEntry=dvmrpInterfaceEntry, dvmrpPruneEntry=dvmrpPruneEntry, dvmrpNeighborIfIndex=dvmrpNeighborIfIndex, dvmrpInterfaceStatus=dvmrpInterfaceStatus, dvmrpPruneTable=dvmrpPruneTable, dvmrpGenerationId=dvmrpGenerationId, dvmrpMIBConformance=dvmrpMIBConformance, dvmrpInterfaceTable=dvmrpInterfaceTable, dvmrpInterfaceGroup=dvmrpInterfaceGroup, dvmrpRouteMetric=dvmrpRouteMetric, dvmrpRoutingGroup=dvmrpRoutingGroup, dvmrpVersionString=dvmrpVersionString, dvmrpMIBCompliance=dvmrpMIBCompliance, dvmrpNeighborGenerationId=dvmrpNeighborGenerationId, dvmrpNumRoutes=dvmrpNumRoutes, dvmrpTreeGroup=dvmrpTreeGroup, dvmrpMIBObjects=dvmrpMIBObjects)
(integer, octet_string, object_identifier) = mibBuilder.importSymbols('ASN1', 'Integer', 'OctetString', 'ObjectIdentifier') (named_values,) = mibBuilder.importSymbols('ASN1-ENUMERATION', 'NamedValues') (value_size_constraint, single_value_constraint, constraints_union, constraints_intersection, value_range_constraint) = mibBuilder.importSymbols('ASN1-REFINEMENT', 'ValueSizeConstraint', 'SingleValueConstraint', 'ConstraintsUnion', 'ConstraintsIntersection', 'ValueRangeConstraint') (interface_index, interface_index_or_zero) = mibBuilder.importSymbols('IF-MIB', 'InterfaceIndex', 'InterfaceIndexOrZero') (snmp_admin_string,) = mibBuilder.importSymbols('SNMP-FRAMEWORK-MIB', 'SnmpAdminString') (notification_group, object_group, module_compliance) = mibBuilder.importSymbols('SNMPv2-CONF', 'NotificationGroup', 'ObjectGroup', 'ModuleCompliance') (integer32, time_ticks, notification_type, mib_scalar, mib_table, mib_table_row, mib_table_column, counter64, mib_identifier, unsigned32, module_identity, iso, ip_address, bits, object_identity, gauge32, counter32) = mibBuilder.importSymbols('SNMPv2-SMI', 'Integer32', 'TimeTicks', 'NotificationType', 'MibScalar', 'MibTable', 'MibTableRow', 'MibTableColumn', 'Counter64', 'MibIdentifier', 'Unsigned32', 'ModuleIdentity', 'iso', 'IpAddress', 'Bits', 'ObjectIdentity', 'Gauge32', 'Counter32') (textual_convention, display_string, row_status) = mibBuilder.importSymbols('SNMPv2-TC', 'TextualConvention', 'DisplayString', 'RowStatus') (usd_dvmrp_experiment,) = mibBuilder.importSymbols('Unisphere-Data-Experiment', 'usdDvmrpExperiment') dvmrp_std_mib = module_identity((1, 3, 6, 1, 4, 1, 4874, 3, 2, 1, 1)) dvmrpStdMIB.setRevisions(('1999-10-19 12:00',)) if mibBuilder.loadTexts: dvmrpStdMIB.setLastUpdated('9910191200Z') if mibBuilder.loadTexts: dvmrpStdMIB.setOrganization('IETF IDMR Working Group.') dvmrp_mib_objects = mib_identifier((1, 3, 6, 1, 4, 1, 4874, 3, 2, 1, 1, 1)) dvmrp = mib_identifier((1, 3, 6, 1, 4, 1, 4874, 3, 2, 1, 1, 1, 1)) dvmrp_scalar = mib_identifier((1, 3, 6, 1, 4, 1, 4874, 3, 2, 1, 1, 1, 1, 1)) dvmrp_version_string = mib_scalar((1, 3, 6, 1, 4, 1, 4874, 3, 2, 1, 1, 1, 1, 1, 1), display_string()).setMaxAccess('readonly') if mibBuilder.loadTexts: dvmrpVersionString.setStatus('current') dvmrp_generation_id = mib_scalar((1, 3, 6, 1, 4, 1, 4874, 3, 2, 1, 1, 1, 1, 1, 2), integer32()).setMaxAccess('readonly') if mibBuilder.loadTexts: dvmrpGenerationId.setStatus('current') dvmrp_num_routes = mib_scalar((1, 3, 6, 1, 4, 1, 4874, 3, 2, 1, 1, 1, 1, 1, 3), gauge32()).setMaxAccess('readonly') if mibBuilder.loadTexts: dvmrpNumRoutes.setStatus('current') dvmrp_reachable_routes = mib_scalar((1, 3, 6, 1, 4, 1, 4874, 3, 2, 1, 1, 1, 1, 1, 4), gauge32()).setMaxAccess('readonly') if mibBuilder.loadTexts: dvmrpReachableRoutes.setStatus('current') dvmrp_interface_table = mib_table((1, 3, 6, 1, 4, 1, 4874, 3, 2, 1, 1, 1, 1, 2)) if mibBuilder.loadTexts: dvmrpInterfaceTable.setStatus('current') dvmrp_interface_entry = mib_table_row((1, 3, 6, 1, 4, 1, 4874, 3, 2, 1, 1, 1, 1, 2, 1)).setIndexNames((0, 'DVMRP-STD-MIB-UNI', 'dvmrpInterfaceIfIndex')) if mibBuilder.loadTexts: dvmrpInterfaceEntry.setStatus('current') dvmrp_interface_if_index = mib_table_column((1, 3, 6, 1, 4, 1, 4874, 3, 2, 1, 1, 1, 1, 2, 1, 1), interface_index()) if mibBuilder.loadTexts: dvmrpInterfaceIfIndex.setStatus('current') dvmrp_interface_local_address = mib_table_column((1, 3, 6, 1, 4, 1, 4874, 3, 2, 1, 1, 1, 1, 2, 1, 2), ip_address()).setMaxAccess('readcreate') if mibBuilder.loadTexts: dvmrpInterfaceLocalAddress.setStatus('current') dvmrp_interface_metric = mib_table_column((1, 3, 6, 1, 4, 1, 4874, 3, 2, 1, 1, 1, 1, 2, 1, 3), integer32().subtype(subtypeSpec=value_range_constraint(1, 31)).clone(1)).setMaxAccess('readcreate') if mibBuilder.loadTexts: dvmrpInterfaceMetric.setStatus('current') dvmrp_interface_status = mib_table_column((1, 3, 6, 1, 4, 1, 4874, 3, 2, 1, 1, 1, 1, 2, 1, 4), row_status()).setMaxAccess('readcreate') if mibBuilder.loadTexts: dvmrpInterfaceStatus.setStatus('current') dvmrp_interface_rcv_bad_pkts = mib_table_column((1, 3, 6, 1, 4, 1, 4874, 3, 2, 1, 1, 1, 1, 2, 1, 5), counter32()).setMaxAccess('readonly') if mibBuilder.loadTexts: dvmrpInterfaceRcvBadPkts.setStatus('current') dvmrp_interface_rcv_bad_routes = mib_table_column((1, 3, 6, 1, 4, 1, 4874, 3, 2, 1, 1, 1, 1, 2, 1, 6), counter32()).setMaxAccess('readonly') if mibBuilder.loadTexts: dvmrpInterfaceRcvBadRoutes.setStatus('current') dvmrp_interface_sent_routes = mib_table_column((1, 3, 6, 1, 4, 1, 4874, 3, 2, 1, 1, 1, 1, 2, 1, 7), counter32()).setMaxAccess('readonly') if mibBuilder.loadTexts: dvmrpInterfaceSentRoutes.setStatus('current') dvmrp_interface_interface_key = mib_table_column((1, 3, 6, 1, 4, 1, 4874, 3, 2, 1, 1, 1, 1, 2, 1, 8), snmp_admin_string()).setMaxAccess('readcreate') if mibBuilder.loadTexts: dvmrpInterfaceInterfaceKey.setStatus('current') dvmrp_interface_interface_key_version = mib_table_column((1, 3, 6, 1, 4, 1, 4874, 3, 2, 1, 1, 1, 1, 2, 1, 9), integer32()).setMaxAccess('readcreate') if mibBuilder.loadTexts: dvmrpInterfaceInterfaceKeyVersion.setStatus('current') dvmrp_neighbor_table = mib_table((1, 3, 6, 1, 4, 1, 4874, 3, 2, 1, 1, 1, 1, 3)) if mibBuilder.loadTexts: dvmrpNeighborTable.setStatus('current') dvmrp_neighbor_entry = mib_table_row((1, 3, 6, 1, 4, 1, 4874, 3, 2, 1, 1, 1, 1, 3, 1)).setIndexNames((0, 'DVMRP-STD-MIB-UNI', 'dvmrpNeighborIfIndex'), (0, 'DVMRP-STD-MIB-UNI', 'dvmrpNeighborAddress')) if mibBuilder.loadTexts: dvmrpNeighborEntry.setStatus('current') dvmrp_neighbor_if_index = mib_table_column((1, 3, 6, 1, 4, 1, 4874, 3, 2, 1, 1, 1, 1, 3, 1, 1), interface_index()) if mibBuilder.loadTexts: dvmrpNeighborIfIndex.setStatus('current') dvmrp_neighbor_address = mib_table_column((1, 3, 6, 1, 4, 1, 4874, 3, 2, 1, 1, 1, 1, 3, 1, 2), ip_address()) if mibBuilder.loadTexts: dvmrpNeighborAddress.setStatus('current') dvmrp_neighbor_up_time = mib_table_column((1, 3, 6, 1, 4, 1, 4874, 3, 2, 1, 1, 1, 1, 3, 1, 3), time_ticks()).setMaxAccess('readonly') if mibBuilder.loadTexts: dvmrpNeighborUpTime.setStatus('current') dvmrp_neighbor_expiry_time = mib_table_column((1, 3, 6, 1, 4, 1, 4874, 3, 2, 1, 1, 1, 1, 3, 1, 4), time_ticks()).setMaxAccess('readonly') if mibBuilder.loadTexts: dvmrpNeighborExpiryTime.setStatus('current') dvmrp_neighbor_generation_id = mib_table_column((1, 3, 6, 1, 4, 1, 4874, 3, 2, 1, 1, 1, 1, 3, 1, 5), integer32()).setMaxAccess('readonly') if mibBuilder.loadTexts: dvmrpNeighborGenerationId.setStatus('current') dvmrp_neighbor_major_version = mib_table_column((1, 3, 6, 1, 4, 1, 4874, 3, 2, 1, 1, 1, 1, 3, 1, 6), integer32().subtype(subtypeSpec=value_range_constraint(0, 255))).setMaxAccess('readonly') if mibBuilder.loadTexts: dvmrpNeighborMajorVersion.setStatus('current') dvmrp_neighbor_minor_version = mib_table_column((1, 3, 6, 1, 4, 1, 4874, 3, 2, 1, 1, 1, 1, 3, 1, 7), integer32().subtype(subtypeSpec=value_range_constraint(0, 255))).setMaxAccess('readonly') if mibBuilder.loadTexts: dvmrpNeighborMinorVersion.setStatus('current') dvmrp_neighbor_capabilities = mib_table_column((1, 3, 6, 1, 4, 1, 4874, 3, 2, 1, 1, 1, 1, 3, 1, 8), bits().clone(namedValues=named_values(('leaf', 0), ('prune', 1), ('generationID', 2), ('mtrace', 3)))).setMaxAccess('readonly') if mibBuilder.loadTexts: dvmrpNeighborCapabilities.setStatus('current') dvmrp_neighbor_rcv_routes = mib_table_column((1, 3, 6, 1, 4, 1, 4874, 3, 2, 1, 1, 1, 1, 3, 1, 9), counter32()).setMaxAccess('readonly') if mibBuilder.loadTexts: dvmrpNeighborRcvRoutes.setStatus('current') dvmrp_neighbor_rcv_bad_pkts = mib_table_column((1, 3, 6, 1, 4, 1, 4874, 3, 2, 1, 1, 1, 1, 3, 1, 10), counter32()).setMaxAccess('readonly') if mibBuilder.loadTexts: dvmrpNeighborRcvBadPkts.setStatus('current') dvmrp_neighbor_rcv_bad_routes = mib_table_column((1, 3, 6, 1, 4, 1, 4874, 3, 2, 1, 1, 1, 1, 3, 1, 11), counter32()).setMaxAccess('readonly') if mibBuilder.loadTexts: dvmrpNeighborRcvBadRoutes.setStatus('current') dvmrp_neighbor_state = mib_table_column((1, 3, 6, 1, 4, 1, 4874, 3, 2, 1, 1, 1, 1, 3, 1, 12), integer32().subtype(subtypeSpec=constraints_union(single_value_constraint(1, 2, 3, 4))).clone(namedValues=named_values(('oneway', 1), ('active', 2), ('ignoring', 3), ('down', 4)))).setMaxAccess('readonly') if mibBuilder.loadTexts: dvmrpNeighborState.setStatus('current') dvmrp_route_table = mib_table((1, 3, 6, 1, 4, 1, 4874, 3, 2, 1, 1, 1, 1, 4)) if mibBuilder.loadTexts: dvmrpRouteTable.setStatus('current') dvmrp_route_entry = mib_table_row((1, 3, 6, 1, 4, 1, 4874, 3, 2, 1, 1, 1, 1, 4, 1)).setIndexNames((0, 'DVMRP-STD-MIB-UNI', 'dvmrpRouteSource'), (0, 'DVMRP-STD-MIB-UNI', 'dvmrpRouteSourceMask')) if mibBuilder.loadTexts: dvmrpRouteEntry.setStatus('current') dvmrp_route_source = mib_table_column((1, 3, 6, 1, 4, 1, 4874, 3, 2, 1, 1, 1, 1, 4, 1, 1), ip_address()) if mibBuilder.loadTexts: dvmrpRouteSource.setStatus('current') dvmrp_route_source_mask = mib_table_column((1, 3, 6, 1, 4, 1, 4874, 3, 2, 1, 1, 1, 1, 4, 1, 2), ip_address()) if mibBuilder.loadTexts: dvmrpRouteSourceMask.setStatus('current') dvmrp_route_upstream_neighbor = mib_table_column((1, 3, 6, 1, 4, 1, 4874, 3, 2, 1, 1, 1, 1, 4, 1, 3), ip_address()).setMaxAccess('readonly') if mibBuilder.loadTexts: dvmrpRouteUpstreamNeighbor.setStatus('current') dvmrp_route_if_index = mib_table_column((1, 3, 6, 1, 4, 1, 4874, 3, 2, 1, 1, 1, 1, 4, 1, 4), interface_index_or_zero()).setMaxAccess('readonly') if mibBuilder.loadTexts: dvmrpRouteIfIndex.setStatus('current') dvmrp_route_metric = mib_table_column((1, 3, 6, 1, 4, 1, 4874, 3, 2, 1, 1, 1, 1, 4, 1, 5), integer32().subtype(subtypeSpec=value_range_constraint(1, 32))).setMaxAccess('readonly') if mibBuilder.loadTexts: dvmrpRouteMetric.setStatus('current') dvmrp_route_expiry_time = mib_table_column((1, 3, 6, 1, 4, 1, 4874, 3, 2, 1, 1, 1, 1, 4, 1, 6), time_ticks()).setMaxAccess('readonly') if mibBuilder.loadTexts: dvmrpRouteExpiryTime.setStatus('current') dvmrp_route_up_time = mib_table_column((1, 3, 6, 1, 4, 1, 4874, 3, 2, 1, 1, 1, 1, 4, 1, 7), time_ticks()).setMaxAccess('readonly') if mibBuilder.loadTexts: dvmrpRouteUpTime.setStatus('current') dvmrp_route_next_hop_table = mib_table((1, 3, 6, 1, 4, 1, 4874, 3, 2, 1, 1, 1, 1, 5)) if mibBuilder.loadTexts: dvmrpRouteNextHopTable.setStatus('current') dvmrp_route_next_hop_entry = mib_table_row((1, 3, 6, 1, 4, 1, 4874, 3, 2, 1, 1, 1, 1, 5, 1)).setIndexNames((0, 'DVMRP-STD-MIB-UNI', 'dvmrpRouteNextHopSource'), (0, 'DVMRP-STD-MIB-UNI', 'dvmrpRouteNextHopSourceMask'), (0, 'DVMRP-STD-MIB-UNI', 'dvmrpRouteNextHopIfIndex')) if mibBuilder.loadTexts: dvmrpRouteNextHopEntry.setStatus('current') dvmrp_route_next_hop_source = mib_table_column((1, 3, 6, 1, 4, 1, 4874, 3, 2, 1, 1, 1, 1, 5, 1, 1), ip_address()) if mibBuilder.loadTexts: dvmrpRouteNextHopSource.setStatus('current') dvmrp_route_next_hop_source_mask = mib_table_column((1, 3, 6, 1, 4, 1, 4874, 3, 2, 1, 1, 1, 1, 5, 1, 2), ip_address()) if mibBuilder.loadTexts: dvmrpRouteNextHopSourceMask.setStatus('current') dvmrp_route_next_hop_if_index = mib_table_column((1, 3, 6, 1, 4, 1, 4874, 3, 2, 1, 1, 1, 1, 5, 1, 3), interface_index()) if mibBuilder.loadTexts: dvmrpRouteNextHopIfIndex.setStatus('current') dvmrp_route_next_hop_type = mib_table_column((1, 3, 6, 1, 4, 1, 4874, 3, 2, 1, 1, 1, 1, 5, 1, 4), integer32().subtype(subtypeSpec=constraints_union(single_value_constraint(1, 2))).clone(namedValues=named_values(('leaf', 1), ('branch', 2)))).setMaxAccess('readonly') if mibBuilder.loadTexts: dvmrpRouteNextHopType.setStatus('current') dvmrp_prune_table = mib_table((1, 3, 6, 1, 4, 1, 4874, 3, 2, 1, 1, 1, 1, 6)) if mibBuilder.loadTexts: dvmrpPruneTable.setStatus('current') dvmrp_prune_entry = mib_table_row((1, 3, 6, 1, 4, 1, 4874, 3, 2, 1, 1, 1, 1, 6, 1)).setIndexNames((0, 'DVMRP-STD-MIB-UNI', 'dvmrpPruneGroup'), (0, 'DVMRP-STD-MIB-UNI', 'dvmrpPruneSource'), (0, 'DVMRP-STD-MIB-UNI', 'dvmrpPruneSourceMask')) if mibBuilder.loadTexts: dvmrpPruneEntry.setStatus('current') dvmrp_prune_group = mib_table_column((1, 3, 6, 1, 4, 1, 4874, 3, 2, 1, 1, 1, 1, 6, 1, 1), ip_address()) if mibBuilder.loadTexts: dvmrpPruneGroup.setStatus('current') dvmrp_prune_source = mib_table_column((1, 3, 6, 1, 4, 1, 4874, 3, 2, 1, 1, 1, 1, 6, 1, 2), ip_address()) if mibBuilder.loadTexts: dvmrpPruneSource.setStatus('current') dvmrp_prune_source_mask = mib_table_column((1, 3, 6, 1, 4, 1, 4874, 3, 2, 1, 1, 1, 1, 6, 1, 3), ip_address()) if mibBuilder.loadTexts: dvmrpPruneSourceMask.setStatus('current') dvmrp_prune_expiry_time = mib_table_column((1, 3, 6, 1, 4, 1, 4874, 3, 2, 1, 1, 1, 1, 6, 1, 4), time_ticks()).setMaxAccess('readonly') if mibBuilder.loadTexts: dvmrpPruneExpiryTime.setStatus('current') dvmrp_traps = mib_identifier((1, 3, 6, 1, 4, 1, 4874, 3, 2, 1, 1, 1, 1, 0)) dvmrp_neighbor_loss = notification_type((1, 3, 6, 1, 4, 1, 4874, 3, 2, 1, 1, 1, 1, 0, 1)).setObjects(('DVMRP-STD-MIB-UNI', 'dvmrpInterfaceLocalAddress'), ('DVMRP-STD-MIB-UNI', 'dvmrpNeighborState')) if mibBuilder.loadTexts: dvmrpNeighborLoss.setStatus('current') dvmrp_neighbor_not_pruning = notification_type((1, 3, 6, 1, 4, 1, 4874, 3, 2, 1, 1, 1, 1, 0, 2)).setObjects(('DVMRP-STD-MIB-UNI', 'dvmrpInterfaceLocalAddress'), ('DVMRP-STD-MIB-UNI', 'dvmrpNeighborCapabilities')) if mibBuilder.loadTexts: dvmrpNeighborNotPruning.setStatus('current') dvmrp_mib_conformance = mib_identifier((1, 3, 6, 1, 4, 1, 4874, 3, 2, 1, 1, 2)) dvmrp_mib_compliances = mib_identifier((1, 3, 6, 1, 4, 1, 4874, 3, 2, 1, 1, 2, 1)) dvmrp_mib_groups = mib_identifier((1, 3, 6, 1, 4, 1, 4874, 3, 2, 1, 1, 2, 2)) dvmrp_mib_compliance = module_compliance((1, 3, 6, 1, 4, 1, 4874, 3, 2, 1, 1, 2, 1, 1)).setObjects(('DVMRP-STD-MIB-UNI', 'dvmrpGeneralGroup'), ('DVMRP-STD-MIB-UNI', 'dvmrpInterfaceGroup'), ('DVMRP-STD-MIB-UNI', 'dvmrpNeighborGroup'), ('DVMRP-STD-MIB-UNI', 'dvmrpRoutingGroup'), ('DVMRP-STD-MIB-UNI', 'dvmrpTreeGroup'), ('DVMRP-STD-MIB-UNI', 'dvmrpSecurityGroup')) if getattr(mibBuilder, 'version', (0, 0, 0)) > (4, 4, 0): dvmrp_mib_compliance = dvmrpMIBCompliance.setStatus('current') dvmrp_general_group = object_group((1, 3, 6, 1, 4, 1, 4874, 3, 2, 1, 1, 2, 2, 2)).setObjects(('DVMRP-STD-MIB-UNI', 'dvmrpVersionString'), ('DVMRP-STD-MIB-UNI', 'dvmrpGenerationId'), ('DVMRP-STD-MIB-UNI', 'dvmrpNumRoutes'), ('DVMRP-STD-MIB-UNI', 'dvmrpReachableRoutes')) if getattr(mibBuilder, 'version', (0, 0, 0)) > (4, 4, 0): dvmrp_general_group = dvmrpGeneralGroup.setStatus('current') dvmrp_interface_group = object_group((1, 3, 6, 1, 4, 1, 4874, 3, 2, 1, 1, 2, 2, 3)).setObjects(('DVMRP-STD-MIB-UNI', 'dvmrpInterfaceLocalAddress'), ('DVMRP-STD-MIB-UNI', 'dvmrpInterfaceMetric'), ('DVMRP-STD-MIB-UNI', 'dvmrpInterfaceStatus'), ('DVMRP-STD-MIB-UNI', 'dvmrpInterfaceRcvBadPkts'), ('DVMRP-STD-MIB-UNI', 'dvmrpInterfaceRcvBadRoutes'), ('DVMRP-STD-MIB-UNI', 'dvmrpInterfaceSentRoutes')) if getattr(mibBuilder, 'version', (0, 0, 0)) > (4, 4, 0): dvmrp_interface_group = dvmrpInterfaceGroup.setStatus('current') dvmrp_neighbor_group = object_group((1, 3, 6, 1, 4, 1, 4874, 3, 2, 1, 1, 2, 2, 4)).setObjects(('DVMRP-STD-MIB-UNI', 'dvmrpNeighborUpTime'), ('DVMRP-STD-MIB-UNI', 'dvmrpNeighborExpiryTime'), ('DVMRP-STD-MIB-UNI', 'dvmrpNeighborGenerationId'), ('DVMRP-STD-MIB-UNI', 'dvmrpNeighborMajorVersion'), ('DVMRP-STD-MIB-UNI', 'dvmrpNeighborMinorVersion'), ('DVMRP-STD-MIB-UNI', 'dvmrpNeighborCapabilities'), ('DVMRP-STD-MIB-UNI', 'dvmrpNeighborRcvRoutes'), ('DVMRP-STD-MIB-UNI', 'dvmrpNeighborRcvBadPkts'), ('DVMRP-STD-MIB-UNI', 'dvmrpNeighborRcvBadRoutes'), ('DVMRP-STD-MIB-UNI', 'dvmrpNeighborState')) if getattr(mibBuilder, 'version', (0, 0, 0)) > (4, 4, 0): dvmrp_neighbor_group = dvmrpNeighborGroup.setStatus('current') dvmrp_routing_group = object_group((1, 3, 6, 1, 4, 1, 4874, 3, 2, 1, 1, 2, 2, 5)).setObjects(('DVMRP-STD-MIB-UNI', 'dvmrpRouteUpstreamNeighbor'), ('DVMRP-STD-MIB-UNI', 'dvmrpRouteIfIndex'), ('DVMRP-STD-MIB-UNI', 'dvmrpRouteMetric'), ('DVMRP-STD-MIB-UNI', 'dvmrpRouteExpiryTime'), ('DVMRP-STD-MIB-UNI', 'dvmrpRouteUpTime'), ('DVMRP-STD-MIB-UNI', 'dvmrpRouteNextHopType')) if getattr(mibBuilder, 'version', (0, 0, 0)) > (4, 4, 0): dvmrp_routing_group = dvmrpRoutingGroup.setStatus('current') dvmrp_security_group = object_group((1, 3, 6, 1, 4, 1, 4874, 3, 2, 1, 1, 2, 2, 6)).setObjects(('DVMRP-STD-MIB-UNI', 'dvmrpInterfaceInterfaceKey'), ('DVMRP-STD-MIB-UNI', 'dvmrpInterfaceInterfaceKeyVersion')) if getattr(mibBuilder, 'version', (0, 0, 0)) > (4, 4, 0): dvmrp_security_group = dvmrpSecurityGroup.setStatus('current') dvmrp_tree_group = object_group((1, 3, 6, 1, 4, 1, 4874, 3, 2, 1, 1, 2, 2, 7)).setObjects(('DVMRP-STD-MIB-UNI', 'dvmrpPruneExpiryTime')) if getattr(mibBuilder, 'version', (0, 0, 0)) > (4, 4, 0): dvmrp_tree_group = dvmrpTreeGroup.setStatus('current') dvmrp_notification_group = notification_group((1, 3, 6, 1, 4, 1, 4874, 3, 2, 1, 1, 2, 2, 8)).setObjects(('DVMRP-STD-MIB-UNI', 'dvmrpNeighborLoss'), ('DVMRP-STD-MIB-UNI', 'dvmrpNeighborNotPruning')) if getattr(mibBuilder, 'version', (0, 0, 0)) > (4, 4, 0): dvmrp_notification_group = dvmrpNotificationGroup.setStatus('current') mibBuilder.exportSymbols('DVMRP-STD-MIB-UNI', dvmrpInterfaceRcvBadRoutes=dvmrpInterfaceRcvBadRoutes, dvmrpNeighborMinorVersion=dvmrpNeighborMinorVersion, dvmrpNeighborUpTime=dvmrpNeighborUpTime, dvmrpNeighborEntry=dvmrpNeighborEntry, dvmrpReachableRoutes=dvmrpReachableRoutes, dvmrpInterfaceIfIndex=dvmrpInterfaceIfIndex, dvmrpNeighborAddress=dvmrpNeighborAddress, dvmrpPruneGroup=dvmrpPruneGroup, dvmrpPruneExpiryTime=dvmrpPruneExpiryTime, dvmrpMIBCompliances=dvmrpMIBCompliances, dvmrpRouteUpTime=dvmrpRouteUpTime, dvmrpInterfaceInterfaceKey=dvmrpInterfaceInterfaceKey, dvmrp=dvmrp, dvmrpNeighborExpiryTime=dvmrpNeighborExpiryTime, dvmrpNeighborRcvBadRoutes=dvmrpNeighborRcvBadRoutes, dvmrpInterfaceSentRoutes=dvmrpInterfaceSentRoutes, dvmrpRouteSource=dvmrpRouteSource, dvmrpRouteNextHopTable=dvmrpRouteNextHopTable, dvmrpRouteNextHopSourceMask=dvmrpRouteNextHopSourceMask, dvmrpRouteNextHopIfIndex=dvmrpRouteNextHopIfIndex, dvmrpTraps=dvmrpTraps, dvmrpNeighborNotPruning=dvmrpNeighborNotPruning, dvmrpNeighborState=dvmrpNeighborState, dvmrpRouteTable=dvmrpRouteTable, dvmrpNeighborRcvRoutes=dvmrpNeighborRcvRoutes, dvmrpScalar=dvmrpScalar, dvmrpMIBGroups=dvmrpMIBGroups, dvmrpRouteIfIndex=dvmrpRouteIfIndex, dvmrpInterfaceLocalAddress=dvmrpInterfaceLocalAddress, dvmrpNeighborCapabilities=dvmrpNeighborCapabilities, dvmrpRouteNextHopSource=dvmrpRouteNextHopSource, dvmrpRouteNextHopType=dvmrpRouteNextHopType, dvmrpInterfaceRcvBadPkts=dvmrpInterfaceRcvBadPkts, dvmrpRouteSourceMask=dvmrpRouteSourceMask, dvmrpNotificationGroup=dvmrpNotificationGroup, dvmrpInterfaceInterfaceKeyVersion=dvmrpInterfaceInterfaceKeyVersion, dvmrpSecurityGroup=dvmrpSecurityGroup, PYSNMP_MODULE_ID=dvmrpStdMIB, dvmrpRouteEntry=dvmrpRouteEntry, dvmrpNeighborTable=dvmrpNeighborTable, dvmrpRouteUpstreamNeighbor=dvmrpRouteUpstreamNeighbor, dvmrpPruneSource=dvmrpPruneSource, dvmrpGeneralGroup=dvmrpGeneralGroup, dvmrpNeighborRcvBadPkts=dvmrpNeighborRcvBadPkts, dvmrpNeighborLoss=dvmrpNeighborLoss, dvmrpStdMIB=dvmrpStdMIB, dvmrpPruneSourceMask=dvmrpPruneSourceMask, dvmrpRouteExpiryTime=dvmrpRouteExpiryTime, dvmrpNeighborMajorVersion=dvmrpNeighborMajorVersion, dvmrpRouteNextHopEntry=dvmrpRouteNextHopEntry, dvmrpInterfaceMetric=dvmrpInterfaceMetric, dvmrpNeighborGroup=dvmrpNeighborGroup, dvmrpInterfaceEntry=dvmrpInterfaceEntry, dvmrpPruneEntry=dvmrpPruneEntry, dvmrpNeighborIfIndex=dvmrpNeighborIfIndex, dvmrpInterfaceStatus=dvmrpInterfaceStatus, dvmrpPruneTable=dvmrpPruneTable, dvmrpGenerationId=dvmrpGenerationId, dvmrpMIBConformance=dvmrpMIBConformance, dvmrpInterfaceTable=dvmrpInterfaceTable, dvmrpInterfaceGroup=dvmrpInterfaceGroup, dvmrpRouteMetric=dvmrpRouteMetric, dvmrpRoutingGroup=dvmrpRoutingGroup, dvmrpVersionString=dvmrpVersionString, dvmrpMIBCompliance=dvmrpMIBCompliance, dvmrpNeighborGenerationId=dvmrpNeighborGenerationId, dvmrpNumRoutes=dvmrpNumRoutes, dvmrpTreeGroup=dvmrpTreeGroup, dvmrpMIBObjects=dvmrpMIBObjects)
mesh_meshes_begin = 0 mesh_mp_score_a = 1 mesh_mp_score_b = 2 mesh_load_window = 3 mesh_checkbox_off = 4 mesh_checkbox_on = 5 mesh_white_plane = 6 mesh_white_dot = 7 mesh_player_dot = 8 mesh_flag_infantry = 9 mesh_flag_archers = 10 mesh_flag_cavalry = 11 mesh_inv_slot = 12 mesh_mp_ingame_menu = 13 mesh_mp_inventory_left = 14 mesh_mp_inventory_right = 15 mesh_mp_inventory_choose = 16 mesh_mp_inventory_slot_glove = 17 mesh_mp_inventory_slot_horse = 18 mesh_mp_inventory_slot_armor = 19 mesh_mp_inventory_slot_helmet = 20 mesh_mp_inventory_slot_boot = 21 mesh_mp_inventory_slot_empty = 22 mesh_mp_inventory_slot_equip = 23 mesh_mp_inventory_left_arrow = 24 mesh_mp_inventory_right_arrow = 25 mesh_mp_ui_host_main = 26 mesh_mp_ui_command_panel = 27 mesh_mp_ui_command_border_l = 28 mesh_mp_ui_command_border_r = 29 mesh_mp_ui_welcome_panel = 30 mesh_flag_project_sw = 31 mesh_flag_project_vg = 32 mesh_flag_project_kh = 33 mesh_flag_project_nd = 34 mesh_flag_project_rh = 35 mesh_flag_project_sr = 36 mesh_flag_projects_end = 37 mesh_flag_project_sw_miss = 38 mesh_flag_project_vg_miss = 39 mesh_flag_project_kh_miss = 40 mesh_flag_project_nd_miss = 41 mesh_flag_project_rh_miss = 42 mesh_flag_project_sr_miss = 43 mesh_flag_project_misses_end = 44 mesh_banner_a01 = 45 mesh_banner_a02 = 46 mesh_banner_a03 = 47 mesh_banner_a04 = 48 mesh_banner_a05 = 49 mesh_banner_a06 = 50 mesh_banner_a07 = 51 mesh_banner_a08 = 52 mesh_banner_a09 = 53 mesh_banner_a10 = 54 mesh_banner_a11 = 55 mesh_banner_a12 = 56 mesh_banner_a13 = 57 mesh_banner_a14 = 58 mesh_banner_a15 = 59 mesh_banner_a16 = 60 mesh_banner_a17 = 61 mesh_banner_a18 = 62 mesh_banner_a19 = 63 mesh_banner_a20 = 64 mesh_banner_a21 = 65 mesh_banner_b01 = 66 mesh_banner_b02 = 67 mesh_banner_b03 = 68 mesh_banner_b04 = 69 mesh_banner_b05 = 70 mesh_banner_b06 = 71 mesh_banner_b07 = 72 mesh_banner_b08 = 73 mesh_banner_b09 = 74 mesh_banner_b10 = 75 mesh_banner_b11 = 76 mesh_banner_b12 = 77 mesh_banner_b13 = 78 mesh_banner_b14 = 79 mesh_banner_b15 = 80 mesh_banner_b16 = 81 mesh_banner_b17 = 82 mesh_banner_b18 = 83 mesh_banner_b19 = 84 mesh_banner_b20 = 85 mesh_banner_b21 = 86 mesh_banner_c01 = 87 mesh_banner_c02 = 88 mesh_banner_c03 = 89 mesh_banner_c04 = 90 mesh_banner_c05 = 91 mesh_banner_c06 = 92 mesh_banner_c07 = 93 mesh_banner_c08 = 94 mesh_banner_c09 = 95 mesh_banner_c10 = 96 mesh_banner_c11 = 97 mesh_banner_c12 = 98 mesh_banner_c13 = 99 mesh_banner_c14 = 100 mesh_banner_c15 = 101 mesh_banner_c16 = 102 mesh_banner_c17 = 103 mesh_banner_c18 = 104 mesh_banner_c19 = 105 mesh_banner_c20 = 106 mesh_banner_c21 = 107 mesh_banner_d01 = 108 mesh_banner_d02 = 109 mesh_banner_d03 = 110 mesh_banner_d04 = 111 mesh_banner_d05 = 112 mesh_banner_d06 = 113 mesh_banner_d07 = 114 mesh_banner_d08 = 115 mesh_banner_d09 = 116 mesh_banner_d10 = 117 mesh_banner_d11 = 118 mesh_banner_d12 = 119 mesh_banner_d13 = 120 mesh_banner_d14 = 121 mesh_banner_d15 = 122 mesh_banner_d16 = 123 mesh_banner_d17 = 124 mesh_banner_d18 = 125 mesh_banner_d19 = 126 mesh_banner_d20 = 127 mesh_banner_d21 = 128 mesh_banner_e01 = 129 mesh_banner_e02 = 130 mesh_banner_e03 = 131 mesh_banner_e04 = 132 mesh_banner_e05 = 133 mesh_banner_e06 = 134 mesh_banner_e07 = 135 mesh_banner_e08 = 136 mesh_banner_kingdom_a = 137 mesh_banner_kingdom_b = 138 mesh_banner_kingdom_c = 139 mesh_banner_kingdom_d = 140 mesh_banner_kingdom_e = 141 mesh_banner_kingdom_f = 142 mesh_banner_f21 = 143 mesh_banners_default_a = 144 mesh_banners_default_b = 145 mesh_banners_default_c = 146 mesh_banners_default_d = 147 mesh_banners_default_e = 148 mesh_troop_label_banner = 149 mesh_ui_kingdom_shield_1 = 150 mesh_ui_kingdom_shield_2 = 151 mesh_ui_kingdom_shield_3 = 152 mesh_ui_kingdom_shield_4 = 153 mesh_ui_kingdom_shield_5 = 154 mesh_ui_kingdom_shield_6 = 155 mesh_mouse_arrow_down = 156 mesh_mouse_arrow_right = 157 mesh_mouse_arrow_left = 158 mesh_mouse_arrow_up = 159 mesh_mouse_arrow_plus = 160 mesh_mouse_left_click = 161 mesh_mouse_right_click = 162 mesh_main_menu_background = 163 mesh_loading_background = 164 mesh_white_bg_plane_a = 165 mesh_cb_ui_main = 166 mesh_cb_ui_maps_scene_french_farm = 167 mesh_cb_ui_maps_scene_landshut = 168 mesh_cb_ui_maps_scene_river_crossing = 169 mesh_cb_ui_maps_scene_spanish_village = 170 mesh_cb_ui_maps_scene_strangefields = 171 mesh_cb_ui_maps_scene_01 = 172 mesh_cb_ui_maps_scene_02 = 173 mesh_cb_ui_maps_scene_03 = 174 mesh_cb_ui_maps_scene_04 = 175 mesh_cb_ui_maps_scene_05 = 176 mesh_cb_ui_maps_scene_06 = 177 mesh_cb_ui_maps_scene_07 = 178 mesh_cb_ui_maps_scene_08 = 179 mesh_cb_ui_maps_scene_09 = 180 mesh_ui_kingdom_shield_7 = 181 mesh_flag_project_rb = 182 mesh_flag_project_rb_miss = 183 mesh_ui_kingdom_shield_neutral = 184 mesh_ui_team_select_shield_aus = 185 mesh_ui_team_select_shield_bri = 186 mesh_ui_team_select_shield_fra = 187 mesh_ui_team_select_shield_pru = 188 mesh_ui_team_select_shield_rus = 189 mesh_ui_team_select_shield_reb = 190 mesh_ui_team_select_shield_neu = 191 mesh_construct_mesh_stakes = 192 mesh_construct_mesh_stakes2 = 193 mesh_construct_mesh_sandbags = 194 mesh_construct_mesh_cdf_tri = 195 mesh_construct_mesh_gabion = 196 mesh_construct_mesh_fence = 197 mesh_construct_mesh_plank = 198 mesh_construct_mesh_earthwork = 199 mesh_construct_mesh_explosives = 200 mesh_bonus_icon_melee = 201 mesh_bonus_icon_accuracy = 202 mesh_bonus_icon_speed = 203 mesh_bonus_icon_reload = 204 mesh_bonus_icon_artillery = 205 mesh_bonus_icon_commander = 206 mesh_arty_icon_take_ammo = 207 mesh_arty_icon_put_ammo = 208 mesh_arty_icon_ram = 209 mesh_arty_icon_move_up = 210 mesh_arty_icon_take_control = 211 mesh_item_select_no_select = 212 mesh_mm_spyglass_ui = 213 mesh_target_plate = 214 mesh_scn_mp_arabian_harbour_select = 215 mesh_scn_mp_arabian_village_select = 216 mesh_scn_mp_ardennes_select = 217 mesh_scn_mp_avignon_select = 218 mesh_scn_mp_bordino_select = 219 mesh_scn_mp_champs_elysees_select = 220 mesh_scn_mp_columbia_farm_select = 221 mesh_scn_mp_european_city_summer_select = 222 mesh_scn_mp_european_city_winter_select = 223 mesh_scn_mp_fort_beaver_select = 224 mesh_scn_mp_fort_boyd_select = 225 mesh_scn_mp_fort_fleetwood_select = 226 mesh_scn_mp_fort_lyon_select = 227 mesh_scn_mp_fort_refleax_select = 228 mesh_scn_mp_fort_vincey_select = 229 mesh_scn_mp_french_farm_select = 230 mesh_scn_mp_german_village_select = 231 mesh_scn_mp_hougoumont_select = 232 mesh_scn_mp_hungarian_plains_select = 233 mesh_scn_mp_la_haye_sainte_select = 234 mesh_scn_mp_landshut_select = 235 mesh_scn_mp_minden_select = 236 mesh_scn_mp_oaksfield_select = 237 mesh_scn_mp_quatre_bras_select = 238 mesh_scn_mp_river_crossing_select = 239 mesh_scn_mp_roxburgh_select = 240 mesh_scn_mp_russian_village_select = 241 mesh_scn_mp_schemmerbach_select = 242 mesh_scn_mp_slovenian_village_select = 243 mesh_scn_mp_spanish_farm_select = 244 mesh_scn_mp_spanish_mountain_pass_select = 245 mesh_scn_mp_spanish_village_select = 246 mesh_scn_mp_strangefields_select = 247 mesh_scn_mp_swamp_select = 248 mesh_scn_mp_walloon_farm_select = 249 mesh_scn_mp_testing_map_select = 250 mesh_scn_mp_random_plain_select = 251 mesh_scn_mp_random_steppe_select = 252 mesh_scn_mp_random_desert_select = 253 mesh_scn_mp_random_snow_select = 254 mesh_meshes_end = 255
mesh_meshes_begin = 0 mesh_mp_score_a = 1 mesh_mp_score_b = 2 mesh_load_window = 3 mesh_checkbox_off = 4 mesh_checkbox_on = 5 mesh_white_plane = 6 mesh_white_dot = 7 mesh_player_dot = 8 mesh_flag_infantry = 9 mesh_flag_archers = 10 mesh_flag_cavalry = 11 mesh_inv_slot = 12 mesh_mp_ingame_menu = 13 mesh_mp_inventory_left = 14 mesh_mp_inventory_right = 15 mesh_mp_inventory_choose = 16 mesh_mp_inventory_slot_glove = 17 mesh_mp_inventory_slot_horse = 18 mesh_mp_inventory_slot_armor = 19 mesh_mp_inventory_slot_helmet = 20 mesh_mp_inventory_slot_boot = 21 mesh_mp_inventory_slot_empty = 22 mesh_mp_inventory_slot_equip = 23 mesh_mp_inventory_left_arrow = 24 mesh_mp_inventory_right_arrow = 25 mesh_mp_ui_host_main = 26 mesh_mp_ui_command_panel = 27 mesh_mp_ui_command_border_l = 28 mesh_mp_ui_command_border_r = 29 mesh_mp_ui_welcome_panel = 30 mesh_flag_project_sw = 31 mesh_flag_project_vg = 32 mesh_flag_project_kh = 33 mesh_flag_project_nd = 34 mesh_flag_project_rh = 35 mesh_flag_project_sr = 36 mesh_flag_projects_end = 37 mesh_flag_project_sw_miss = 38 mesh_flag_project_vg_miss = 39 mesh_flag_project_kh_miss = 40 mesh_flag_project_nd_miss = 41 mesh_flag_project_rh_miss = 42 mesh_flag_project_sr_miss = 43 mesh_flag_project_misses_end = 44 mesh_banner_a01 = 45 mesh_banner_a02 = 46 mesh_banner_a03 = 47 mesh_banner_a04 = 48 mesh_banner_a05 = 49 mesh_banner_a06 = 50 mesh_banner_a07 = 51 mesh_banner_a08 = 52 mesh_banner_a09 = 53 mesh_banner_a10 = 54 mesh_banner_a11 = 55 mesh_banner_a12 = 56 mesh_banner_a13 = 57 mesh_banner_a14 = 58 mesh_banner_a15 = 59 mesh_banner_a16 = 60 mesh_banner_a17 = 61 mesh_banner_a18 = 62 mesh_banner_a19 = 63 mesh_banner_a20 = 64 mesh_banner_a21 = 65 mesh_banner_b01 = 66 mesh_banner_b02 = 67 mesh_banner_b03 = 68 mesh_banner_b04 = 69 mesh_banner_b05 = 70 mesh_banner_b06 = 71 mesh_banner_b07 = 72 mesh_banner_b08 = 73 mesh_banner_b09 = 74 mesh_banner_b10 = 75 mesh_banner_b11 = 76 mesh_banner_b12 = 77 mesh_banner_b13 = 78 mesh_banner_b14 = 79 mesh_banner_b15 = 80 mesh_banner_b16 = 81 mesh_banner_b17 = 82 mesh_banner_b18 = 83 mesh_banner_b19 = 84 mesh_banner_b20 = 85 mesh_banner_b21 = 86 mesh_banner_c01 = 87 mesh_banner_c02 = 88 mesh_banner_c03 = 89 mesh_banner_c04 = 90 mesh_banner_c05 = 91 mesh_banner_c06 = 92 mesh_banner_c07 = 93 mesh_banner_c08 = 94 mesh_banner_c09 = 95 mesh_banner_c10 = 96 mesh_banner_c11 = 97 mesh_banner_c12 = 98 mesh_banner_c13 = 99 mesh_banner_c14 = 100 mesh_banner_c15 = 101 mesh_banner_c16 = 102 mesh_banner_c17 = 103 mesh_banner_c18 = 104 mesh_banner_c19 = 105 mesh_banner_c20 = 106 mesh_banner_c21 = 107 mesh_banner_d01 = 108 mesh_banner_d02 = 109 mesh_banner_d03 = 110 mesh_banner_d04 = 111 mesh_banner_d05 = 112 mesh_banner_d06 = 113 mesh_banner_d07 = 114 mesh_banner_d08 = 115 mesh_banner_d09 = 116 mesh_banner_d10 = 117 mesh_banner_d11 = 118 mesh_banner_d12 = 119 mesh_banner_d13 = 120 mesh_banner_d14 = 121 mesh_banner_d15 = 122 mesh_banner_d16 = 123 mesh_banner_d17 = 124 mesh_banner_d18 = 125 mesh_banner_d19 = 126 mesh_banner_d20 = 127 mesh_banner_d21 = 128 mesh_banner_e01 = 129 mesh_banner_e02 = 130 mesh_banner_e03 = 131 mesh_banner_e04 = 132 mesh_banner_e05 = 133 mesh_banner_e06 = 134 mesh_banner_e07 = 135 mesh_banner_e08 = 136 mesh_banner_kingdom_a = 137 mesh_banner_kingdom_b = 138 mesh_banner_kingdom_c = 139 mesh_banner_kingdom_d = 140 mesh_banner_kingdom_e = 141 mesh_banner_kingdom_f = 142 mesh_banner_f21 = 143 mesh_banners_default_a = 144 mesh_banners_default_b = 145 mesh_banners_default_c = 146 mesh_banners_default_d = 147 mesh_banners_default_e = 148 mesh_troop_label_banner = 149 mesh_ui_kingdom_shield_1 = 150 mesh_ui_kingdom_shield_2 = 151 mesh_ui_kingdom_shield_3 = 152 mesh_ui_kingdom_shield_4 = 153 mesh_ui_kingdom_shield_5 = 154 mesh_ui_kingdom_shield_6 = 155 mesh_mouse_arrow_down = 156 mesh_mouse_arrow_right = 157 mesh_mouse_arrow_left = 158 mesh_mouse_arrow_up = 159 mesh_mouse_arrow_plus = 160 mesh_mouse_left_click = 161 mesh_mouse_right_click = 162 mesh_main_menu_background = 163 mesh_loading_background = 164 mesh_white_bg_plane_a = 165 mesh_cb_ui_main = 166 mesh_cb_ui_maps_scene_french_farm = 167 mesh_cb_ui_maps_scene_landshut = 168 mesh_cb_ui_maps_scene_river_crossing = 169 mesh_cb_ui_maps_scene_spanish_village = 170 mesh_cb_ui_maps_scene_strangefields = 171 mesh_cb_ui_maps_scene_01 = 172 mesh_cb_ui_maps_scene_02 = 173 mesh_cb_ui_maps_scene_03 = 174 mesh_cb_ui_maps_scene_04 = 175 mesh_cb_ui_maps_scene_05 = 176 mesh_cb_ui_maps_scene_06 = 177 mesh_cb_ui_maps_scene_07 = 178 mesh_cb_ui_maps_scene_08 = 179 mesh_cb_ui_maps_scene_09 = 180 mesh_ui_kingdom_shield_7 = 181 mesh_flag_project_rb = 182 mesh_flag_project_rb_miss = 183 mesh_ui_kingdom_shield_neutral = 184 mesh_ui_team_select_shield_aus = 185 mesh_ui_team_select_shield_bri = 186 mesh_ui_team_select_shield_fra = 187 mesh_ui_team_select_shield_pru = 188 mesh_ui_team_select_shield_rus = 189 mesh_ui_team_select_shield_reb = 190 mesh_ui_team_select_shield_neu = 191 mesh_construct_mesh_stakes = 192 mesh_construct_mesh_stakes2 = 193 mesh_construct_mesh_sandbags = 194 mesh_construct_mesh_cdf_tri = 195 mesh_construct_mesh_gabion = 196 mesh_construct_mesh_fence = 197 mesh_construct_mesh_plank = 198 mesh_construct_mesh_earthwork = 199 mesh_construct_mesh_explosives = 200 mesh_bonus_icon_melee = 201 mesh_bonus_icon_accuracy = 202 mesh_bonus_icon_speed = 203 mesh_bonus_icon_reload = 204 mesh_bonus_icon_artillery = 205 mesh_bonus_icon_commander = 206 mesh_arty_icon_take_ammo = 207 mesh_arty_icon_put_ammo = 208 mesh_arty_icon_ram = 209 mesh_arty_icon_move_up = 210 mesh_arty_icon_take_control = 211 mesh_item_select_no_select = 212 mesh_mm_spyglass_ui = 213 mesh_target_plate = 214 mesh_scn_mp_arabian_harbour_select = 215 mesh_scn_mp_arabian_village_select = 216 mesh_scn_mp_ardennes_select = 217 mesh_scn_mp_avignon_select = 218 mesh_scn_mp_bordino_select = 219 mesh_scn_mp_champs_elysees_select = 220 mesh_scn_mp_columbia_farm_select = 221 mesh_scn_mp_european_city_summer_select = 222 mesh_scn_mp_european_city_winter_select = 223 mesh_scn_mp_fort_beaver_select = 224 mesh_scn_mp_fort_boyd_select = 225 mesh_scn_mp_fort_fleetwood_select = 226 mesh_scn_mp_fort_lyon_select = 227 mesh_scn_mp_fort_refleax_select = 228 mesh_scn_mp_fort_vincey_select = 229 mesh_scn_mp_french_farm_select = 230 mesh_scn_mp_german_village_select = 231 mesh_scn_mp_hougoumont_select = 232 mesh_scn_mp_hungarian_plains_select = 233 mesh_scn_mp_la_haye_sainte_select = 234 mesh_scn_mp_landshut_select = 235 mesh_scn_mp_minden_select = 236 mesh_scn_mp_oaksfield_select = 237 mesh_scn_mp_quatre_bras_select = 238 mesh_scn_mp_river_crossing_select = 239 mesh_scn_mp_roxburgh_select = 240 mesh_scn_mp_russian_village_select = 241 mesh_scn_mp_schemmerbach_select = 242 mesh_scn_mp_slovenian_village_select = 243 mesh_scn_mp_spanish_farm_select = 244 mesh_scn_mp_spanish_mountain_pass_select = 245 mesh_scn_mp_spanish_village_select = 246 mesh_scn_mp_strangefields_select = 247 mesh_scn_mp_swamp_select = 248 mesh_scn_mp_walloon_farm_select = 249 mesh_scn_mp_testing_map_select = 250 mesh_scn_mp_random_plain_select = 251 mesh_scn_mp_random_steppe_select = 252 mesh_scn_mp_random_desert_select = 253 mesh_scn_mp_random_snow_select = 254 mesh_meshes_end = 255
# hanoi: int -> int # calcula el numero de movimientos necesarios aara mover # una torre de n discos de una vara a otra # usando 3 varas y siguiendo las restricciones del puzzle hanoi # ejemplo: hanoi(0) debe dar 0, hanoi(1) debe dar 1, hanoi(2) debe dar 3 def hanoi(n): if n < 2: return n else: return 1+ 2* hanoi(n-1) #test assert hanoi(0) == 0 assert hanoi(1) == 1 assert hanoi(4) == 15 assert hanoi(5) == 31
def hanoi(n): if n < 2: return n else: return 1 + 2 * hanoi(n - 1) assert hanoi(0) == 0 assert hanoi(1) == 1 assert hanoi(4) == 15 assert hanoi(5) == 31
date = input("enter the date: ").split() dd = int(date[0]) yyyy = int(date[2]) mm = date[1] l = [] l.append(yyyy) l.append(mm) l.append(dd) t = tuple(l) print(t)
date = input('enter the date: ').split() dd = int(date[0]) yyyy = int(date[2]) mm = date[1] l = [] l.append(yyyy) l.append(mm) l.append(dd) t = tuple(l) print(t)
a, b = input().split() a = int(a) b = int(b) if a > b: print(">") elif a < b: print("<") else: print("==")
(a, b) = input().split() a = int(a) b = int(b) if a > b: print('>') elif a < b: print('<') else: print('==')
n = int(input("Enter a number: ")) for i in range(1, n+1): count = 0 for j in range(1, n+1): if i%j==0: count= count+1 if count==2: print(i)
n = int(input('Enter a number: ')) for i in range(1, n + 1): count = 0 for j in range(1, n + 1): if i % j == 0: count = count + 1 if count == 2: print(i)