content
stringlengths
7
1.05M
fixed_cases
stringlengths
1
1.28M
s = input().lower() search = input().lower().strip() str_list = [] # Tokenize token = "" for c in s: if c not in [' ','\'','"','.',',']: token += c else: if len(token) > 0: str_list.append(token) token = "" if len(token) > 0: str_list.append(token) # Search print('Found' if search in str_list else 'Not Found')
s = input().lower() search = input().lower().strip() str_list = [] token = '' for c in s: if c not in [' ', "'", '"', '.', ',']: token += c elif len(token) > 0: str_list.append(token) token = '' if len(token) > 0: str_list.append(token) print('Found' if search in str_list else 'Not Found')
def multiply(a, b): return a * b result = multiply(2,3) print(result)
def multiply(a, b): return a * b result = multiply(2, 3) print(result)
'''https://leetcode.com/problems/decode-string/''' class Solution: def decodeString(self, s: str) -> str: stack = [] curNum = 0 curStr = '' for i in s: if i=='[': stack.append(curStr) stack.append(curNum) curNum = 0 curStr = '' elif i==']': num = stack.pop() prevStr = stack.pop() curStr = prevStr + num*curStr elif i.isdigit(): curNum = curNum*10 + int(i) else: curStr +=i return curStr
"""https://leetcode.com/problems/decode-string/""" class Solution: def decode_string(self, s: str) -> str: stack = [] cur_num = 0 cur_str = '' for i in s: if i == '[': stack.append(curStr) stack.append(curNum) cur_num = 0 cur_str = '' elif i == ']': num = stack.pop() prev_str = stack.pop() cur_str = prevStr + num * curStr elif i.isdigit(): cur_num = curNum * 10 + int(i) else: cur_str += i return curStr
''' Backward method to solve 1D reaction-diffusion equation: u_t = k * u_xx with Neumann boundary conditions at x=0: u_x(0,t) = 0 = sin(2*np.pi) at x=L: u_x(L,t) = 0 = sin(2*np.pi) with L = 1 and initial conditions: u(x,0) = (1.0/2.0)+ np.cos(2.0*np.pi*x) - (1.0/2.0)*np.cos(3*np.pi*x) u_x(x,t) = (-4.0*(np.pi**2))np.exp(-4.0*(np.pi**2)*t)*np.cos(2.0*np.pi*x) + (9.0/2.0)*(np.pi**2)*np.exp(-9.0*(np.pi**2)*t)*np.cos(3*np.pi*x)) ''' def BackwardEuler(M, lambd, T = 0.5, L = 1, k = 1): #Parameters needed to solve the equation within the explicit method # M = GRID POINTS on space interval N = (M**2) #GRID POINTS on time interval # ---- Length of the wire in x direction ---- x0, xL = 0, L # ----- Spatial discretization step ----- dx = (xL - x0)/(M-1) # ---- Final time ---- t0, tF = 0, T # ----- Time step ----- dt = (tF - t0)/(N-1) # k = 1.0 Diffusion coefficient #lambd = dt*k/dx**2 a = 1 + 2*lambd xspan = np.linspace(x0, xL, M) tspan = np.linspace(t0, tF, N) main_diag = (1 + 2*lambd)*np.ones((1,M)) off_diag = -lambd*np.ones((1, M-1)) a = main_diag.shape[1] diagonals = [main_diag, off_diag, off_diag] #Sparse Matrix diagonals A = sparse.diags(diagonals, [0,-1,1], shape=(a,a)).toarray() A[0,1] = -2*lambd A[M-1,M-2] = -2*lambd # --- Initializes matrix U ----- U = np.zeros((M, N)) #print(U) # --- Initial condition ----- U[:,0] = (1.0/2.0)+ np.cos(2.0*np.pi*xspan) - (1.0/2.0)*np.cos(3*np.pi*xspan) # ---- Neumann boundary conditions ----- leftBC = np.arange(1, N+1) #f = np.sin(2*leftBC*np.pi) #f = U[0,:] rightBC = np.arange(1, N+1) #g = np.sin(2*rightBC*np.pi) #g = U[-1,:] U[0,:] = (-3*U[1,:] + 4*U[2,:] - U[3,:])/(2*dx) U[-1,:] = (-3*U[1,:] + 4*U[2,:] - U[3,:])/(2*dx) f = U[0,:] g = U[-1,:] for i in range(1, N): c = np.zeros((M-2,1)).ravel() b1 = np.asarray([2*lambd*dx*f[i], 2*lambd*dx*g[i]]) b1 = np.insert(b1, 1, c) b2 = np.array(U[0:M, i-1]) b = b1 + b2 # Right hand side U[0:M, i] = np.linalg.solve(A,b) # Solve x=A\b return (U, tspan, xspan) U, tspan, xspan = BackwardEuler(M = 14, lambd = 1.0/6.0) Uexact, x, t = ExactSolution(M = 14) surfaceplot(U, Uexact, tspan, xspan, M = 14)
""" Backward method to solve 1D reaction-diffusion equation: u_t = k * u_xx with Neumann boundary conditions at x=0: u_x(0,t) = 0 = sin(2*np.pi) at x=L: u_x(L,t) = 0 = sin(2*np.pi) with L = 1 and initial conditions: u(x,0) = (1.0/2.0)+ np.cos(2.0*np.pi*x) - (1.0/2.0)*np.cos(3*np.pi*x) u_x(x,t) = (-4.0*(np.pi**2))np.exp(-4.0*(np.pi**2)*t)*np.cos(2.0*np.pi*x) + (9.0/2.0)*(np.pi**2)*np.exp(-9.0*(np.pi**2)*t)*np.cos(3*np.pi*x)) """ def backward_euler(M, lambd, T=0.5, L=1, k=1): n = M ** 2 (x0, x_l) = (0, L) dx = (xL - x0) / (M - 1) (t0, t_f) = (0, T) dt = (tF - t0) / (N - 1) a = 1 + 2 * lambd xspan = np.linspace(x0, xL, M) tspan = np.linspace(t0, tF, N) main_diag = (1 + 2 * lambd) * np.ones((1, M)) off_diag = -lambd * np.ones((1, M - 1)) a = main_diag.shape[1] diagonals = [main_diag, off_diag, off_diag] a = sparse.diags(diagonals, [0, -1, 1], shape=(a, a)).toarray() A[0, 1] = -2 * lambd A[M - 1, M - 2] = -2 * lambd u = np.zeros((M, N)) U[:, 0] = 1.0 / 2.0 + np.cos(2.0 * np.pi * xspan) - 1.0 / 2.0 * np.cos(3 * np.pi * xspan) left_bc = np.arange(1, N + 1) right_bc = np.arange(1, N + 1) U[0, :] = (-3 * U[1, :] + 4 * U[2, :] - U[3, :]) / (2 * dx) U[-1, :] = (-3 * U[1, :] + 4 * U[2, :] - U[3, :]) / (2 * dx) f = U[0, :] g = U[-1, :] for i in range(1, N): c = np.zeros((M - 2, 1)).ravel() b1 = np.asarray([2 * lambd * dx * f[i], 2 * lambd * dx * g[i]]) b1 = np.insert(b1, 1, c) b2 = np.array(U[0:M, i - 1]) b = b1 + b2 U[0:M, i] = np.linalg.solve(A, b) return (U, tspan, xspan) (u, tspan, xspan) = backward_euler(M=14, lambd=1.0 / 6.0) (uexact, x, t) = exact_solution(M=14) surfaceplot(U, Uexact, tspan, xspan, M=14)
#!/usr/bin/python3 ''' Program: This is a table of environment variable of deep learning python. Usage: import DL_conf.py // in your deep learning python program editor Jacob975 20180123 ################################# update log 20180123 version alpha 1: Hello!, just a test ''' # Comment of what kinds of variables are saved here. #--------------- Setting python path ---------------- # python path is where you install python # tensorflow python can run under both python3 and python2 # please check the path by $which python python2 path_of_python = "/usr/bin/python3" #--------------- Setting source code path ------------------ # code path means where do you install these code about DL. # recommand: /home/username/bin/DL_python path_of_source_code = "/home/Jacob975/bin/deep_learning" #--------------- Setting data path --------------------- # Where you save your data. # recommand: /mazu/users/Jacob975/AI_data/ELAIS_N1_NICER_control_image path_of_data = "/mazu/users/Jacob975/AI_data"
""" Program: This is a table of environment variable of deep learning python. Usage: import DL_conf.py // in your deep learning python program editor Jacob975 20180123 ################################# update log 20180123 version alpha 1: Hello!, just a test """ path_of_python = '/usr/bin/python3' path_of_source_code = '/home/Jacob975/bin/deep_learning' path_of_data = '/mazu/users/Jacob975/AI_data'
n = int(input()) i = 2 while n != 1: if n%i == 0: n//=i;print(i) else: i+=1
n = int(input()) i = 2 while n != 1: if n % i == 0: n //= i print(i) else: i += 1
def best_par_in_df(search_df): ''' This function takes as input a pandas dataframe containing the inference results (saved in a file having 'search_history.csv' ending) and returns the highest-likelihood parameters set that was found during the search. Args: - search_df (pandas DataFrame object): dataframe containing the results of the inference procedure, produced by the 'parallel_tempering' class. Returns: - best_par: model parameters dictionary containing the highest-likelihood parameters set found during the inference. ''' best_idx = search_df['logl'].argmax() best_par = search_df.loc[best_idx].to_dict() return best_par
def best_par_in_df(search_df): """ This function takes as input a pandas dataframe containing the inference results (saved in a file having 'search_history.csv' ending) and returns the highest-likelihood parameters set that was found during the search. Args: - search_df (pandas DataFrame object): dataframe containing the results of the inference procedure, produced by the 'parallel_tempering' class. Returns: - best_par: model parameters dictionary containing the highest-likelihood parameters set found during the inference. """ best_idx = search_df['logl'].argmax() best_par = search_df.loc[best_idx].to_dict() return best_par
class Config(object): DEBUG = False TESTING = False SQLALCHEMY_TRACK_MODIFICATIONS = False class Production(Config): SQLALCHEMY_DATABASE_URI = '<Production DB URL>' class Development(Config): # psql postgresql://Nghi:nghi1996@localhost/postgres DEBUG = True SQLALCHEMY_DATABASE_URI = 'postgresql://Nghi:nghi1996@localhost/postgres' SQLALCHEMY_ECHO = False JWT_SECRET_KEY = 'JWT_SECRET_NGHI!123' SECRET_KEY = 'SECRET_KEY_NGHI_ABC!123' SECURITY_PASSWORD_SALT = 'SECURITY_PASSWORD_SALT_NGHI_ABC!123' MAIL_DEFAULT_SENDER = 'dev2020@localhost' MAIL_SERVER = 'smtp.gmail.com' MAIL_PORT = 465 MAIL_USERNAME = 'nghidev2020@gmail.com' MAIL_PASSWORD = 'nghi1996' MAIL_USE_TLS = False MAIL_USE_SSL = True UPLOAD_FOLDER = 'images' class Testing(Config): TESTING = True # SQLALCHEMY_DATABASE_URI = 'postgresql://Nghi:nghi1996@localhost/postgres_test' SQLALCHEMY_ECHO = False JWT_SECRET_KEY = 'JWT_SECRET_NGHI!123' SECRET_KEY = 'SECRET_KEY_NGHI_ABC!123' SECURITY_PASSWORD_SALT = 'SECURITY_PASSWORD_SALT_NGHI_ABC!123' MAIL_DEFAULT_SENDER = 'dev2020@localhost' MAIL_SERVER = 'smtp.gmail.com' MAIL_PORT = 465 MAIL_USERNAME = 'nghidev2020@gmail.com' MAIL_PASSWORD = 'nghi1996' MAIL_USE_TLS = False MAIL_USE_SSL = True UPLOAD_FOLDER = 'images'
class Config(object): debug = False testing = False sqlalchemy_track_modifications = False class Production(Config): sqlalchemy_database_uri = '<Production DB URL>' class Development(Config): debug = True sqlalchemy_database_uri = 'postgresql://Nghi:nghi1996@localhost/postgres' sqlalchemy_echo = False jwt_secret_key = 'JWT_SECRET_NGHI!123' secret_key = 'SECRET_KEY_NGHI_ABC!123' security_password_salt = 'SECURITY_PASSWORD_SALT_NGHI_ABC!123' mail_default_sender = 'dev2020@localhost' mail_server = 'smtp.gmail.com' mail_port = 465 mail_username = 'nghidev2020@gmail.com' mail_password = 'nghi1996' mail_use_tls = False mail_use_ssl = True upload_folder = 'images' class Testing(Config): testing = True sqlalchemy_echo = False jwt_secret_key = 'JWT_SECRET_NGHI!123' secret_key = 'SECRET_KEY_NGHI_ABC!123' security_password_salt = 'SECURITY_PASSWORD_SALT_NGHI_ABC!123' mail_default_sender = 'dev2020@localhost' mail_server = 'smtp.gmail.com' mail_port = 465 mail_username = 'nghidev2020@gmail.com' mail_password = 'nghi1996' mail_use_tls = False mail_use_ssl = True upload_folder = 'images'
def rotateImage(a): size = len(a) b = [] for col in range(size): temp = [] for row in reversed(range(size)): temp.append(a[row][col]) b.append(temp) return b if __name__ == '__main__': a = [ [1,2,3], [4,5,6], [7,8,9], ] print(rotateImage(a))
def rotate_image(a): size = len(a) b = [] for col in range(size): temp = [] for row in reversed(range(size)): temp.append(a[row][col]) b.append(temp) return b if __name__ == '__main__': a = [[1, 2, 3], [4, 5, 6], [7, 8, 9]] print(rotate_image(a))
class Context: def time(self): raise NotImplemented def user(self): raise NotImplemented class DefaultContext(Context): def __init__(self, current_time, current_user_id): super(DefaultContext, self).__init__() self.current_time = current_time self.current_user_id = current_user_id def time(self): return self.current_time def user(self): return self.current_user_id
class Context: def time(self): raise NotImplemented def user(self): raise NotImplemented class Defaultcontext(Context): def __init__(self, current_time, current_user_id): super(DefaultContext, self).__init__() self.current_time = current_time self.current_user_id = current_user_id def time(self): return self.current_time def user(self): return self.current_user_id
# This program knows about the schedule for a conference that runs over the # course of a day, with sessions in different tracks in different rooms. Given # a room and a time, it can tell you which session starts at that time. # # Usage: # # $ python conference_schedule.py [room] [time] # # For instance: # # $ python conference_schedule.py "Main Hall" 13:30 # schedule = { 'Main Hall': { '10:00': 'Django REST framework', '11:00': 'Lessons learned from PHP', '12:00': "Tech interviews that don't suck", '14:00': 'Taking control of your Bluetooth devices', '15:00': "Fast Python? Don't Bother!", '16:00': 'Test-Driven Data Analysis', }, 'Seminar Room': { '10:00': 'Python in my Science Classroom', '11:00': 'My journey from wxPython tp PyQt', '12:00': 'Easy solutions to hard problems', '14:00': 'Taking control of your Bluetooth devices', '15:00': "Euler's Key to Cryptography", '16:00': 'Build your Microservices with ZeroMQ', }, 'Assembly Hall': { '10:00': 'Distributed systems from scratch', '11:00': 'Python in Medicine: ventilator data', '12:00': 'Neurodiversity in Technology', '14:00': 'Chat bots: What is AI?', '15:00': 'Pygame Zero', '16:00': 'The state of PyPy', }, } print('There are talks scheduled in {} rooms'.format(len(schedule))) # TODO: # * Implement the program as described in the comments at the top of the file. # TODO (extra): # * Change the program so that that it can tell you what session is running in # a room at a given time, even if a session doesn't start at that time. # * Change the program so that if called with a single argument, the title of a # session, it displays the room and the time of the session.
schedule = {'Main Hall': {'10:00': 'Django REST framework', '11:00': 'Lessons learned from PHP', '12:00': "Tech interviews that don't suck", '14:00': 'Taking control of your Bluetooth devices', '15:00': "Fast Python? Don't Bother!", '16:00': 'Test-Driven Data Analysis'}, 'Seminar Room': {'10:00': 'Python in my Science Classroom', '11:00': 'My journey from wxPython tp PyQt', '12:00': 'Easy solutions to hard problems', '14:00': 'Taking control of your Bluetooth devices', '15:00': "Euler's Key to Cryptography", '16:00': 'Build your Microservices with ZeroMQ'}, 'Assembly Hall': {'10:00': 'Distributed systems from scratch', '11:00': 'Python in Medicine: ventilator data', '12:00': 'Neurodiversity in Technology', '14:00': 'Chat bots: What is AI?', '15:00': 'Pygame Zero', '16:00': 'The state of PyPy'}} print('There are talks scheduled in {} rooms'.format(len(schedule)))
"grpc_py_library.bzl provides a py_library for grpc files." load("@rules_python//python:defs.bzl", "py_library") def grpc_py_library(**kwargs): py_library(**kwargs)
"""grpc_py_library.bzl provides a py_library for grpc files.""" load('@rules_python//python:defs.bzl', 'py_library') def grpc_py_library(**kwargs): py_library(**kwargs)
#Conceito Mec l=int(input()) p=int(input()) r= p / l if r <= 8: print("A") elif 9 <= r <= 12: print("B") elif 13 <= r <= 18: print("C") elif r > 18: print("D")
l = int(input()) p = int(input()) r = p / l if r <= 8: print('A') elif 9 <= r <= 12: print('B') elif 13 <= r <= 18: print('C') elif r > 18: print('D')
## inotify_init1 flags. IN_CLOEXEC = 0o2000000 IN_NONBLOCK = 0o0004000 ## Supported events suitable for MASK parameter of INOTIFY_ADD_WATCH. IN_ACCESS = 0x00000001 IN_MODIFY = 0x00000002 IN_ATTRIB = 0x00000004 IN_CLOSE_WRITE = 0x00000008 IN_CLOSE_NOWRITE = 0x00000010 IN_OPEN = 0x00000020 IN_MOVED_FROM = 0x00000040 IN_MOVED_TO = 0x00000080 IN_CREATE = 0x00000100 IN_DELETE = 0x00000200 IN_DELETE_SELF = 0x00000400 IN_MOVE_SELF = 0x00000800 ## Helper events. IN_CLOSE = (IN_CLOSE_WRITE | IN_CLOSE_NOWRITE) IN_MOVE = (IN_MOVED_FROM | IN_MOVED_TO) ## All events which a program can wait on. IN_ALL_EVENTS = (IN_ACCESS | IN_MODIFY | IN_ATTRIB | IN_CLOSE_WRITE | IN_CLOSE_NOWRITE | IN_OPEN | IN_MOVED_FROM | IN_MOVED_TO | IN_CREATE | IN_DELETE | IN_DELETE_SELF | IN_MOVE_SELF) ## Events sent by kernel. IN_UNMOUNT = 0x00002000 # Backing fs was unmounted. IN_Q_OVERFLOW = 0x00004000 # Event queued overflowed. IN_IGNORED = 0x00008000 # File was ignored. ## Special flags. IN_ONLYDIR = 0x01000000 # Only watch the path if it is a directory. IN_DONT_FOLLOW = 0x02000000 # Do not follow a sym link. IN_MASK_ADD = 0x20000000 # Add to the mask of an already existing watch. IN_ISDIR = 0x40000000 # Event occurred against dir. IN_ONESHOT = 0x80000000 # Only send event once. MASK_LOOKUP = { 0o2000000: 'IN_CLOEXEC', 0o0004000: 'IN_NONBLOCK', ## Supported events suitable for MASK parameter of INOTIFY_ADD_WATCH. 0x00000001: 'IN_ACCESS', 0x00000002: 'IN_MODIFY', 0x00000004: 'IN_ATTRIB', 0x00000008: 'IN_CLOSE_WRITE', 0x00000010: 'IN_CLOSE_NOWRITE', 0x00000020: 'IN_OPEN', 0x00000040: 'IN_MOVED_FROM', 0x00000080: 'IN_MOVED_TO', 0x00000100: 'IN_CREATE', 0x00000200: 'IN_DELETE', 0x00000400: 'IN_DELETE_SELF', 0x00000800: 'IN_MOVE_SELF', ## Events sent by kernel. 0x00002000: 'IN_UNMOUNT', 0x00004000: 'IN_Q_OVERFLOW', 0x00008000: 'IN_IGNORED', ## Special flags. 0x01000000: 'IN_ONLYDIR', 0x02000000: 'IN_DONT_FOLLOW', 0x20000000: 'IN_MASK_ADD', 0x40000000: 'IN_ISDIR', 0x80000000: 'IN_ONESHOT', }
in_cloexec = 524288 in_nonblock = 2048 in_access = 1 in_modify = 2 in_attrib = 4 in_close_write = 8 in_close_nowrite = 16 in_open = 32 in_moved_from = 64 in_moved_to = 128 in_create = 256 in_delete = 512 in_delete_self = 1024 in_move_self = 2048 in_close = IN_CLOSE_WRITE | IN_CLOSE_NOWRITE in_move = IN_MOVED_FROM | IN_MOVED_TO in_all_events = IN_ACCESS | IN_MODIFY | IN_ATTRIB | IN_CLOSE_WRITE | IN_CLOSE_NOWRITE | IN_OPEN | IN_MOVED_FROM | IN_MOVED_TO | IN_CREATE | IN_DELETE | IN_DELETE_SELF | IN_MOVE_SELF in_unmount = 8192 in_q_overflow = 16384 in_ignored = 32768 in_onlydir = 16777216 in_dont_follow = 33554432 in_mask_add = 536870912 in_isdir = 1073741824 in_oneshot = 2147483648 mask_lookup = {524288: 'IN_CLOEXEC', 2048: 'IN_NONBLOCK', 1: 'IN_ACCESS', 2: 'IN_MODIFY', 4: 'IN_ATTRIB', 8: 'IN_CLOSE_WRITE', 16: 'IN_CLOSE_NOWRITE', 32: 'IN_OPEN', 64: 'IN_MOVED_FROM', 128: 'IN_MOVED_TO', 256: 'IN_CREATE', 512: 'IN_DELETE', 1024: 'IN_DELETE_SELF', 2048: 'IN_MOVE_SELF', 8192: 'IN_UNMOUNT', 16384: 'IN_Q_OVERFLOW', 32768: 'IN_IGNORED', 16777216: 'IN_ONLYDIR', 33554432: 'IN_DONT_FOLLOW', 536870912: 'IN_MASK_ADD', 1073741824: 'IN_ISDIR', 2147483648: 'IN_ONESHOT'}
def costodepasajes(): #definir variables y otros montoP=0 #datos de entrada cantidadX=int(input("ingrese la cantidad de estudiantes:")) #proceso if cantidadX>=100: montoP=cantidadX*20 elif cantidadX<100 and cantidadX>49: montoP=cantidadX*35 elif cantidadX<50 and cantidadX>19: montoP=cantidadX*40 elif cantidadX<20: montoP=cantidadX*70 #datos de salida print("el monto a pagar es:",montoP) costodepasajes()
def costodepasajes(): monto_p = 0 cantidad_x = int(input('ingrese la cantidad de estudiantes:')) if cantidadX >= 100: monto_p = cantidadX * 20 elif cantidadX < 100 and cantidadX > 49: monto_p = cantidadX * 35 elif cantidadX < 50 and cantidadX > 19: monto_p = cantidadX * 40 elif cantidadX < 20: monto_p = cantidadX * 70 print('el monto a pagar es:', montoP) costodepasajes()
mylist=[] #python now knows it is a 1D list mylist.append(5) #append is to add a thing to the end print(mylist) #will print only 5 mylist.append(6) print(mylist) #will print 5 AND 6 mylist[1]=7 #value 7 will overwrite the value in position 1 of mylist (which is 6) num=int(input("Enter number to append to the list")) mylist.append(num) #whatever user enters will be added to end of list print("Unsorted List is ",mylist) print(mylist[2]) #prints elemt in position 2 mylist.sort() print("Sorted list is ",mylist) looplist=[] for i in range(10): looplist.append(int(input("Enter element to append to the list in a loop:"))) print("Unsorted list is",looplist) looplist.sort() print("Sorted list is ",looplist) # for element in looplist: # element+=1 print(looplist)
mylist = [] mylist.append(5) print(mylist) mylist.append(6) print(mylist) mylist[1] = 7 num = int(input('Enter number to append to the list')) mylist.append(num) print('Unsorted List is ', mylist) print(mylist[2]) mylist.sort() print('Sorted list is ', mylist) looplist = [] for i in range(10): looplist.append(int(input('Enter element to append to the list in a loop:'))) print('Unsorted list is', looplist) looplist.sort() print('Sorted list is ', looplist) print(looplist)
# HEAD # Classes - Polymorphism # DESCRIPTION # Describes how to create polymorphism using classes # RESOURCES # # Creating Parent class class Parent(): par_cent = "parent" def p_method(self): print("Parent Method invoked with par_cent", self.par_cent) return self.par_cent # Inheriting all Parent attributes # and methods into Child # Form ONE class ChildOne(Parent): chi_one_cent = "childtwo" def c_one_method(self): print("Child Method invoked with chi_one_cent", self.chi_one_cent) # Accessing Parent methods return self.chi_one_cent, self.p_method() # Inheriting all Parent attributes # and methods into Child # Form TWO class ChildTwo(Parent): chi_two_cent = "child" def c_two_method(self): print("Child Method invoked with chi_two_cent", self.chi_two_cent) # Accessing Parent methods return self.chi_two_cent, self.p_method() obj = ChildOne() # Access/Invoke Parent and Child Attributes, Methods print("obj.par_cent ", obj.par_cent) print("obj.chi_one_cent ", obj.chi_one_cent) print("obj.p_method ", obj.p_method()) print("obj.c_one_method ", obj.c_one_method()) obj_two = ChildTwo() # Access/Invoke Parent and Child Attributes, Methods print("obj_two.par_cent ", obj_two.par_cent) print("obj_two.chi_two_cent ", obj_two.chi_two_cent) print("obj_two.p_method ", obj_two.p_method()) print("obj_two.c_two_method ", obj_two.c_two_method())
class Parent: par_cent = 'parent' def p_method(self): print('Parent Method invoked with par_cent', self.par_cent) return self.par_cent class Childone(Parent): chi_one_cent = 'childtwo' def c_one_method(self): print('Child Method invoked with chi_one_cent', self.chi_one_cent) return (self.chi_one_cent, self.p_method()) class Childtwo(Parent): chi_two_cent = 'child' def c_two_method(self): print('Child Method invoked with chi_two_cent', self.chi_two_cent) return (self.chi_two_cent, self.p_method()) obj = child_one() print('obj.par_cent ', obj.par_cent) print('obj.chi_one_cent ', obj.chi_one_cent) print('obj.p_method ', obj.p_method()) print('obj.c_one_method ', obj.c_one_method()) obj_two = child_two() print('obj_two.par_cent ', obj_two.par_cent) print('obj_two.chi_two_cent ', obj_two.chi_two_cent) print('obj_two.p_method ', obj_two.p_method()) print('obj_two.c_two_method ', obj_two.c_two_method())
# Information connected to the email account email = "email@website.com" password = "password" server = "server.website.com" port = 25 # The folder with settings (rss-links.txt and time.txt) folder = "path to folder"
email = 'email@website.com' password = 'password' server = 'server.website.com' port = 25 folder = 'path to folder'
# parsetab.py # This file is automatically generated. Do not edit. # pylint: disable=W,C,R _tabversion = '3.10' _lr_method = 'LALR' _lr_signature = 'and closedBra closedParen coma comment div do doubleColon doubleEquals elif else end endline equals exit id if int integer less lessEquals minus more moreEquals mul not notEquals openBra openParen or parens plus print program rea read real string subroutine swap then\n programa : program action_37 id V F action_38 B end program\n \n V : V Tipo Dim doubleColon Rid action_addSymbols action_32\n |\n \n Rid : id\n | Rid coma id\n \n Tipo : integer\n | real\n \n Dim : openBra int action_30 closedBra\n | openBra int action_30 closedBra openBra int action_31 closedBra\n |\n \n F : F subroutine id action_39 B end subroutine action_40\n |\n \n B : B S\n |\n \n S : Dimensional equals EA action_8\n | id parens action_41\n | read RDimensional\n | print RDimOrString\n | if action_16 Relif ElseOrEmpty end if action_20\n | do id action_24 equals EA action_25 coma EA action_26 IntOrEmpty then B action_29 end do\n | do then action_21 B action_22 end do\n | swap Dimensional coma Dimensional\n | exit action_23\n | comment\n \n Dimensional : id DimensionsOrEmpty action_1\n \n DimensionsOrEmpty : openParen EA action_setDim1 ComaEAOrEmpty closedParen\n |\n \n ComaEAOrEmpty : coma EA action_setDim2\n |\n \n RDimensional : Dimensional action_36\n | RDimensional coma Dimensional action_36\n \n RDimOrString : DimOrString\n | RDimOrString coma DimOrString\n \n DimOrString : Dimensional action_33\n | string action_34\n | endline action_34\n \n Relif : openParen EL closedParen action_17 then B\n | Relif elif action_18 openParen EL closedParen action_17 then B\n \n ElseOrEmpty : else action_19 B\n |\n \n IntOrEmpty : coma int action_28\n | action_27\n \n EA : MultDiv\n | EA SumOrSub action_3 MultDiv action_4\n \n SumOrSub : plus\n | minus\n \n MultDiv : EAParens\n | MultDiv MDSymbols action_5 EAParens action_6\n \n MDSymbols : mul\n | div\n \n EAParens : EItem\n | openParen EA closedParen\n \n EL : AND\n | EL or action_10 AND action_9\n \n AND : Equality\n | AND and action_12 Equality action_11\n \n Equality : EItem EQSymbols action_13 EItem action_14\n | openParen EL closedParen\n | not EL action_15\n \n EItem : Dimensional\n | int action_2\n | rea action_2_rea\n \n EQSymbols : less\n | more\n | doubleEquals\n | notEquals\n | lessEquals\n | moreEquals\n action_addSymbols :action_1 :action_2 :action_2_rea :action_3 :action_4 :action_5 :action_6 :action_8 :action_9 :action_10 :action_11 :action_12 :action_13 :action_14 :action_15 :action_16 :action_17 :action_18 :action_19 :action_20 :action_21 :action_22 :action_23 :action_24 :action_25 :action_26 :action_27 :action_28 :action_29 :action_30 :action_31 :action_32 :action_33 :action_34 :action_36 :action_37 :action_38 :action_39 :action_40 :action_41 :action_setDim1 :action_setDim2 :' _lr_action_items = {'program':([0,19,],[2,36,]),'$end':([1,36,],[0,-1,]),'id':([2,3,4,5,6,10,11,14,15,16,20,22,23,25,26,27,28,29,30,31,33,34,35,37,38,39,40,41,42,43,44,45,48,50,51,52,53,55,56,57,59,60,61,62,63,64,65,66,67,68,69,70,71,73,75,76,78,79,83,84,85,86,87,88,89,90,91,92,93,96,97,102,103,104,105,106,108,110,111,112,113,116,119,120,121,122,123,124,125,126,127,131,133,135,136,137,138,139,142,143,144,150,151,152,154,158,159,161,168,172,174,176,179,],[-105,4,-3,-12,-106,-14,15,18,-107,31,-13,40,40,47,40,-92,-24,-14,-69,-4,-109,-70,40,40,-17,-104,-27,-18,-32,-102,-103,-103,-90,-23,18,-101,79,-16,-25,40,-43,-47,-51,-60,-71,-72,-77,40,-30,40,-34,-35,-36,40,-14,40,-2,-5,-73,-45,-46,-75,-49,-50,-61,-62,-15,-104,-33,-88,40,40,40,18,-22,-108,-52,40,40,40,-31,-14,-79,-81,-82,-63,-64,-65,-66,-67,-68,-11,-26,-74,-76,-89,40,18,40,40,40,-44,-48,-19,-14,40,-21,18,-14,18,-14,18,-20,]),'integer':([4,5,30,31,52,78,79,],[-3,8,-69,-4,-101,-2,-5,]),'real':([4,5,30,31,52,78,79,],[-3,9,-69,-4,-101,-2,-5,]),'subroutine':([4,5,6,30,31,52,77,78,79,106,131,],[-3,-12,11,-69,-4,-101,106,-2,-5,-108,-11,]),'end':([4,5,6,10,14,15,20,27,28,29,30,31,33,34,38,39,40,41,42,43,44,45,48,50,51,52,55,56,59,60,61,62,63,64,65,67,69,70,71,72,75,78,79,89,90,91,92,93,94,96,104,105,106,108,113,116,130,131,133,135,136,137,139,150,151,152,154,159,161,168,172,174,176,177,179,],[-3,-12,-106,-14,19,-107,-13,-92,-24,-14,-69,-4,-109,-70,-17,-104,-27,-18,-32,-102,-103,-103,-90,-23,77,-101,-16,-25,-43,-47,-51,-60,-71,-72,-77,-30,-34,-35,-36,-40,-14,-2,-5,-61,-62,-15,-104,-33,114,-88,-91,-22,-108,-52,-31,-14,147,-11,-26,-74,-76,-89,-39,-44,-48,-19,-14,-21,-37,-14,-38,-14,-98,178,-20,]),'read':([4,5,6,10,14,15,20,27,28,29,30,31,33,34,38,39,40,41,42,43,44,45,48,50,51,52,55,56,59,60,61,62,63,64,65,67,69,70,71,75,78,79,89,90,91,92,93,96,104,105,106,108,113,116,131,133,135,136,137,139,150,151,152,154,159,161,168,172,174,176,179,],[-3,-12,-106,-14,22,-107,-13,-92,-24,-14,-69,-4,-109,-70,-17,-104,-27,-18,-32,-102,-103,-103,-90,-23,22,-101,-16,-25,-43,-47,-51,-60,-71,-72,-77,-30,-34,-35,-36,-14,-2,-5,-61,-62,-15,-104,-33,-88,22,-22,-108,-52,-31,-14,-11,-26,-74,-76,-89,22,-44,-48,-19,-14,-21,22,-14,22,-14,22,-20,]),'print':([4,5,6,10,14,15,20,27,28,29,30,31,33,34,38,39,40,41,42,43,44,45,48,50,51,52,55,56,59,60,61,62,63,64,65,67,69,70,71,75,78,79,89,90,91,92,93,96,104,105,106,108,113,116,131,133,135,136,137,139,150,151,152,154,159,161,168,172,174,176,179,],[-3,-12,-106,-14,23,-107,-13,-92,-24,-14,-69,-4,-109,-70,-17,-104,-27,-18,-32,-102,-103,-103,-90,-23,23,-101,-16,-25,-43,-47,-51,-60,-71,-72,-77,-30,-34,-35,-36,-14,-2,-5,-61,-62,-15,-104,-33,-88,23,-22,-108,-52,-31,-14,-11,-26,-74,-76,-89,23,-44,-48,-19,-14,-21,23,-14,23,-14,23,-20,]),'if':([4,5,6,10,14,15,20,27,28,29,30,31,33,34,38,39,40,41,42,43,44,45,48,50,51,52,55,56,59,60,61,62,63,64,65,67,69,70,71,75,78,79,89,90,91,92,93,96,104,105,106,108,113,114,116,131,133,135,136,137,139,150,151,152,154,159,161,168,172,174,176,179,],[-3,-12,-106,-14,24,-107,-13,-92,-24,-14,-69,-4,-109,-70,-17,-104,-27,-18,-32,-102,-103,-103,-90,-23,24,-101,-16,-25,-43,-47,-51,-60,-71,-72,-77,-30,-34,-35,-36,-14,-2,-5,-61,-62,-15,-104,-33,-88,24,-22,-108,-52,-31,137,-14,-11,-26,-74,-76,-89,24,-44,-48,-19,-14,-21,24,-14,24,-14,24,-20,]),'do':([4,5,6,10,14,15,20,27,28,29,30,31,33,34,38,39,40,41,42,43,44,45,48,50,51,52,55,56,59,60,61,62,63,64,65,67,69,70,71,75,78,79,89,90,91,92,93,96,104,105,106,108,113,116,131,133,135,136,137,139,147,150,151,152,154,159,161,168,172,174,176,178,179,],[-3,-12,-106,-14,25,-107,-13,-92,-24,-14,-69,-4,-109,-70,-17,-104,-27,-18,-32,-102,-103,-103,-90,-23,25,-101,-16,-25,-43,-47,-51,-60,-71,-72,-77,-30,-34,-35,-36,-14,-2,-5,-61,-62,-15,-104,-33,-88,25,-22,-108,-52,-31,-14,-11,-26,-74,-76,-89,25,159,-44,-48,-19,-14,-21,25,-14,25,-14,25,179,-20,]),'swap':([4,5,6,10,14,15,20,27,28,29,30,31,33,34,38,39,40,41,42,43,44,45,48,50,51,52,55,56,59,60,61,62,63,64,65,67,69,70,71,75,78,79,89,90,91,92,93,96,104,105,106,108,113,116,131,133,135,136,137,139,150,151,152,154,159,161,168,172,174,176,179,],[-3,-12,-106,-14,26,-107,-13,-92,-24,-14,-69,-4,-109,-70,-17,-104,-27,-18,-32,-102,-103,-103,-90,-23,26,-101,-16,-25,-43,-47,-51,-60,-71,-72,-77,-30,-34,-35,-36,-14,-2,-5,-61,-62,-15,-104,-33,-88,26,-22,-108,-52,-31,-14,-11,-26,-74,-76,-89,26,-44,-48,-19,-14,-21,26,-14,26,-14,26,-20,]),'exit':([4,5,6,10,14,15,20,27,28,29,30,31,33,34,38,39,40,41,42,43,44,45,48,50,51,52,55,56,59,60,61,62,63,64,65,67,69,70,71,75,78,79,89,90,91,92,93,96,104,105,106,108,113,116,131,133,135,136,137,139,150,151,152,154,159,161,168,172,174,176,179,],[-3,-12,-106,-14,27,-107,-13,-92,-24,-14,-69,-4,-109,-70,-17,-104,-27,-18,-32,-102,-103,-103,-90,-23,27,-101,-16,-25,-43,-47,-51,-60,-71,-72,-77,-30,-34,-35,-36,-14,-2,-5,-61,-62,-15,-104,-33,-88,27,-22,-108,-52,-31,-14,-11,-26,-74,-76,-89,27,-44,-48,-19,-14,-21,27,-14,27,-14,27,-20,]),'comment':([4,5,6,10,14,15,20,27,28,29,30,31,33,34,38,39,40,41,42,43,44,45,48,50,51,52,55,56,59,60,61,62,63,64,65,67,69,70,71,75,78,79,89,90,91,92,93,96,104,105,106,108,113,116,131,133,135,136,137,139,150,151,152,154,159,161,168,172,174,176,179,],[-3,-12,-106,-14,28,-107,-13,-92,-24,-14,-69,-4,-109,-70,-17,-104,-27,-18,-32,-102,-103,-103,-90,-23,28,-101,-16,-25,-43,-47,-51,-60,-71,-72,-77,-30,-34,-35,-36,-14,-2,-5,-61,-62,-15,-104,-33,-88,28,-22,-108,-52,-31,-14,-11,-26,-74,-76,-89,28,-44,-48,-19,-14,-21,28,-14,28,-14,28,-20,]),'openBra':([7,8,9,54,],[13,-6,-7,80,]),'doubleColon':([7,8,9,12,54,148,],[-10,-6,-7,16,-8,-9,]),'int':([13,35,37,57,73,80,83,84,85,86,87,88,97,102,103,110,111,112,119,120,121,122,123,124,125,126,127,138,142,143,144,158,169,],[17,63,63,63,63,107,-73,-45,-46,-75,-49,-50,63,63,63,63,63,63,-79,-81,-82,-63,-64,-65,-66,-67,-68,63,63,63,63,63,173,]),'closedBra':([17,32,107,132,],[-99,54,-100,148,]),'parens':([18,],[33,]),'openParen':([18,24,35,37,40,46,57,73,83,84,85,86,87,88,95,97,102,103,110,111,112,115,119,120,138,142,143,158,],[35,-85,57,57,35,73,57,97,-73,-45,-46,-75,-49,-50,-87,97,97,57,57,57,57,138,-79,-81,97,97,97,57,]),'equals':([18,21,34,47,56,74,133,],[-27,37,-70,-93,-25,103,-26,]),'elif':([20,27,28,33,34,38,39,40,41,42,43,44,45,50,55,56,59,60,61,62,63,64,65,67,69,70,71,72,89,90,91,92,93,105,108,113,133,135,136,137,150,151,152,154,159,161,168,172,179,],[-13,-92,-24,-109,-70,-17,-104,-27,-18,-32,-102,-103,-103,-23,-16,-25,-43,-47,-51,-60,-71,-72,-77,-30,-34,-35,-36,95,-61,-62,-15,-104,-33,-22,-52,-31,-26,-74,-76,-89,-44,-48,-19,-14,-21,-37,-14,-38,-20,]),'else':([20,27,28,33,34,38,39,40,41,42,43,44,45,50,55,56,59,60,61,62,63,64,65,67,69,70,71,72,89,90,91,92,93,105,108,113,133,135,136,137,150,151,152,154,159,161,168,172,179,],[-13,-92,-24,-109,-70,-17,-104,-27,-18,-32,-102,-103,-103,-23,-16,-25,-43,-47,-51,-60,-71,-72,-77,-30,-34,-35,-36,96,-61,-62,-15,-104,-33,-22,-52,-31,-26,-74,-76,-89,-44,-48,-19,-14,-21,-37,-14,-38,-20,]),'string':([23,68,],[44,44,]),'endline':([23,68,],[45,45,]),'then':([25,34,40,56,59,60,61,62,63,64,89,90,108,118,133,135,136,141,150,151,160,165,166,167,170,171,173,175,],[48,-70,-27,-25,-43,-47,-51,-60,-71,-72,-61,-62,-52,-86,-26,-74,-76,154,-44,-48,-86,-95,168,-96,174,-42,-97,-41,]),'coma':([30,31,34,38,39,40,41,42,43,44,45,49,56,58,59,60,61,62,63,64,67,69,70,71,79,82,89,90,92,93,108,113,129,133,135,136,146,150,151,165,167,],[53,-4,-70,66,-104,-27,68,-32,-102,-103,-103,76,-25,-110,-43,-47,-51,-60,-71,-72,-30,-34,-35,-36,-5,110,-61,-62,-104,-33,-52,-31,-94,-26,-74,-76,158,-44,-48,-95,169,]),'mul':([34,40,56,59,60,61,62,63,64,89,90,108,133,135,136,151,],[-70,-27,-25,87,-47,-51,-60,-71,-72,-61,-62,-52,-26,87,-76,-48,]),'div':([34,40,56,59,60,61,62,63,64,89,90,108,133,135,136,151,],[-70,-27,-25,88,-47,-51,-60,-71,-72,-61,-62,-52,-26,88,-76,-48,]),'plus':([34,40,56,58,59,60,61,62,63,64,65,81,89,90,108,129,133,134,135,136,150,151,165,],[-70,-27,-25,84,-43,-47,-51,-60,-71,-72,84,84,-61,-62,-52,84,-26,84,-74,-76,-44,-48,84,]),'minus':([34,40,56,58,59,60,61,62,63,64,65,81,89,90,108,129,133,134,135,136,150,151,165,],[-70,-27,-25,85,-43,-47,-51,-60,-71,-72,85,85,-61,-62,-52,85,-26,85,-74,-76,-44,-48,85,]),'closedParen':([34,40,56,58,59,60,61,62,63,64,81,82,89,90,98,99,100,108,109,117,128,133,134,135,136,140,145,149,150,151,153,155,156,157,162,163,164,],[-70,-27,-25,-110,-43,-47,-51,-60,-71,-72,108,-29,-61,-62,118,-53,-55,-52,133,140,-84,-26,-111,-74,-76,-58,-59,-28,-44,-48,160,-78,-80,-83,-54,-56,-57,]),'less':([34,40,56,62,63,64,89,90,101,133,],[-70,-27,-25,-60,-71,-72,-61,-62,122,-26,]),'more':([34,40,56,62,63,64,89,90,101,133,],[-70,-27,-25,-60,-71,-72,-61,-62,123,-26,]),'doubleEquals':([34,40,56,62,63,64,89,90,101,133,],[-70,-27,-25,-60,-71,-72,-61,-62,124,-26,]),'notEquals':([34,40,56,62,63,64,89,90,101,133,],[-70,-27,-25,-60,-71,-72,-61,-62,125,-26,]),'lessEquals':([34,40,56,62,63,64,89,90,101,133,],[-70,-27,-25,-60,-71,-72,-61,-62,126,-26,]),'moreEquals':([34,40,56,62,63,64,89,90,101,133,],[-70,-27,-25,-60,-71,-72,-61,-62,127,-26,]),'and':([34,40,56,62,63,64,89,90,99,100,128,133,140,145,155,156,157,162,163,164,],[-70,-27,-25,-60,-71,-72,-61,-62,120,-55,-84,-26,-58,-59,120,-80,-83,-54,-56,-57,]),'or':([34,40,56,62,63,64,89,90,98,99,100,117,128,133,140,145,153,155,156,157,162,163,164,],[-70,-27,-25,-60,-71,-72,-61,-62,119,-53,-55,119,119,-26,-58,-59,119,-78,-80,-83,-54,-56,-57,]),'rea':([35,37,57,73,83,84,85,86,87,88,97,102,103,110,111,112,119,120,121,122,123,124,125,126,127,138,142,143,144,158,],[64,64,64,64,-73,-45,-46,-75,-49,-50,64,64,64,64,64,64,-79,-81,-82,-63,-64,-65,-66,-67,-68,64,64,64,64,64,]),'not':([73,97,102,119,120,138,142,143,],[102,102,102,-79,-81,102,102,102,]),} _lr_action = {} for _k, _v in _lr_action_items.items(): for _x,_y in zip(_v[0],_v[1]): if not _x in _lr_action: _lr_action[_x] = {} _lr_action[_x][_k] = _y del _lr_action_items _lr_goto_items = {'programa':([0,],[1,]),'action_37':([2,],[3,]),'V':([4,],[5,]),'F':([5,],[6,]),'Tipo':([5,],[7,]),'action_38':([6,],[10,]),'Dim':([7,],[12,]),'B':([10,29,75,116,154,168,174,],[14,51,104,139,161,172,176,]),'S':([14,51,104,139,161,172,176,],[20,20,20,20,20,20,20,]),'Dimensional':([14,22,23,26,35,37,51,57,66,68,73,76,97,102,103,104,110,111,112,138,139,142,143,144,158,161,172,176,],[21,39,43,49,62,62,21,62,92,43,62,105,62,62,62,21,62,62,62,62,21,62,62,62,62,21,21,21,]),'action_39':([15,],[29,]),'Rid':([16,],[30,]),'action_30':([17,],[32,]),'DimensionsOrEmpty':([18,40,],[34,34,]),'RDimensional':([22,],[38,]),'RDimOrString':([23,],[41,]),'DimOrString':([23,68,],[42,93,]),'action_16':([24,],[46,]),'action_23':([27,],[50,]),'action_addSymbols':([30,],[52,]),'action_41':([33,],[55,]),'action_1':([34,],[56,]),'EA':([35,37,57,103,110,158,],[58,65,81,129,134,165,]),'MultDiv':([35,37,57,103,110,111,158,],[59,59,59,59,59,135,59,]),'EAParens':([35,37,57,103,110,111,112,158,],[60,60,60,60,60,60,136,60,]),'EItem':([35,37,57,73,97,102,103,110,111,112,138,142,143,144,158,],[61,61,61,101,101,101,61,61,61,61,101,101,101,157,61,]),'action_36':([39,92,],[67,113,]),'action_33':([43,],[69,]),'action_34':([44,45,],[70,71,]),'Relif':([46,],[72,]),'action_24':([47,],[74,]),'action_21':([48,],[75,]),'action_32':([52,],[78,]),'action_setDim1':([58,],[82,]),'SumOrSub':([58,65,81,129,134,165,],[83,83,83,83,83,83,]),'MDSymbols':([59,135,],[86,86,]),'action_2':([63,],[89,]),'action_2_rea':([64,],[90,]),'action_8':([65,],[91,]),'ElseOrEmpty':([72,],[94,]),'EL':([73,97,102,138,],[98,117,128,153,]),'AND':([73,97,102,138,142,],[99,99,99,99,155,]),'Equality':([73,97,102,138,142,143,],[100,100,100,100,100,156,]),'ComaEAOrEmpty':([82,],[109,]),'action_3':([83,],[111,]),'action_5':([86,],[112,]),'action_18':([95,],[115,]),'action_19':([96,],[116,]),'EQSymbols':([101,],[121,]),'action_22':([104,],[130,]),'action_40':([106,],[131,]),'action_31':([107,],[132,]),'action_17':([118,160,],[141,166,]),'action_10':([119,],[142,]),'action_12':([120,],[143,]),'action_13':([121,],[144,]),'action_15':([128,],[145,]),'action_25':([129,],[146,]),'action_setDim2':([134,],[149,]),'action_4':([135,],[150,]),'action_6':([136,],[151,]),'action_20':([137,],[152,]),'action_9':([155,],[162,]),'action_11':([156,],[163,]),'action_14':([157,],[164,]),'action_26':([165,],[167,]),'IntOrEmpty':([167,],[170,]),'action_27':([167,],[171,]),'action_28':([173,],[175,]),'action_29':([176,],[177,]),} _lr_goto = {} for _k, _v in _lr_goto_items.items(): for _x, _y in zip(_v[0], _v[1]): if not _x in _lr_goto: _lr_goto[_x] = {} _lr_goto[_x][_k] = _y del _lr_goto_items _lr_productions = [ ("S' -> programa","S'",1,None,None,None), ('programa -> program action_37 id V F action_38 B end program','programa',9,'p_programa','fort.py',225), ('V -> V Tipo Dim doubleColon Rid action_addSymbols action_32','V',7,'p_V','fort.py',232), ('V -> <empty>','V',0,'p_V','fort.py',233), ('Rid -> id','Rid',1,'p_Rid','fort.py',239), ('Rid -> Rid coma id','Rid',3,'p_Rid','fort.py',240), ('Tipo -> integer','Tipo',1,'p_Tipo','fort.py',252), ('Tipo -> real','Tipo',1,'p_Tipo','fort.py',253), ('Dim -> openBra int action_30 closedBra','Dim',4,'p_Dim','fort.py',261), ('Dim -> openBra int action_30 closedBra openBra int action_31 closedBra','Dim',8,'p_Dim','fort.py',262), ('Dim -> <empty>','Dim',0,'p_Dim','fort.py',263), ('F -> F subroutine id action_39 B end subroutine action_40','F',8,'p_F','fort.py',269), ('F -> <empty>','F',0,'p_F','fort.py',270), ('B -> B S','B',2,'p_B','fort.py',276), ('B -> <empty>','B',0,'p_B','fort.py',277), ('S -> Dimensional equals EA action_8','S',4,'p_S','fort.py',283), ('S -> id parens action_41','S',3,'p_S','fort.py',284), ('S -> read RDimensional','S',2,'p_S','fort.py',285), ('S -> print RDimOrString','S',2,'p_S','fort.py',286), ('S -> if action_16 Relif ElseOrEmpty end if action_20','S',7,'p_S','fort.py',287), ('S -> do id action_24 equals EA action_25 coma EA action_26 IntOrEmpty then B action_29 end do','S',15,'p_S','fort.py',288), ('S -> do then action_21 B action_22 end do','S',7,'p_S','fort.py',289), ('S -> swap Dimensional coma Dimensional','S',4,'p_S','fort.py',290), ('S -> exit action_23','S',2,'p_S','fort.py',291), ('S -> comment','S',1,'p_S','fort.py',292), ('Dimensional -> id DimensionsOrEmpty action_1','Dimensional',3,'p_Dimensional','fort.py',300), ('DimensionsOrEmpty -> openParen EA action_setDim1 ComaEAOrEmpty closedParen','DimensionsOrEmpty',5,'p_DimensionsOrEmpty','fort.py',307), ('DimensionsOrEmpty -> <empty>','DimensionsOrEmpty',0,'p_DimensionsOrEmpty','fort.py',308), ('ComaEAOrEmpty -> coma EA action_setDim2','ComaEAOrEmpty',3,'p_ComaEAOrEmpty','fort.py',314), ('ComaEAOrEmpty -> <empty>','ComaEAOrEmpty',0,'p_ComaEAOrEmpty','fort.py',315), ('RDimensional -> Dimensional action_36','RDimensional',2,'p_RDimensional','fort.py',321), ('RDimensional -> RDimensional coma Dimensional action_36','RDimensional',4,'p_RDimensional','fort.py',322), ('RDimOrString -> DimOrString','RDimOrString',1,'p_RDimOrString','fort.py',328), ('RDimOrString -> RDimOrString coma DimOrString','RDimOrString',3,'p_RDimOrString','fort.py',329), ('DimOrString -> Dimensional action_33','DimOrString',2,'p_DimOrString','fort.py',335), ('DimOrString -> string action_34','DimOrString',2,'p_DimOrString','fort.py',336), ('DimOrString -> endline action_34','DimOrString',2,'p_DimOrString','fort.py',337), ('Relif -> openParen EL closedParen action_17 then B','Relif',6,'p_Relif','fort.py',343), ('Relif -> Relif elif action_18 openParen EL closedParen action_17 then B','Relif',9,'p_Relif','fort.py',344), ('ElseOrEmpty -> else action_19 B','ElseOrEmpty',3,'p_ElseOrEmpty','fort.py',350), ('ElseOrEmpty -> <empty>','ElseOrEmpty',0,'p_ElseOrEmpty','fort.py',351), ('IntOrEmpty -> coma int action_28','IntOrEmpty',3,'p_IntOrEmpty','fort.py',357), ('IntOrEmpty -> action_27','IntOrEmpty',1,'p_IntOrEmpty','fort.py',358), ('EA -> MultDiv','EA',1,'p_EA','fort.py',364), ('EA -> EA SumOrSub action_3 MultDiv action_4','EA',5,'p_EA','fort.py',365), ('SumOrSub -> plus','SumOrSub',1,'p_SumOrSub','fort.py',371), ('SumOrSub -> minus','SumOrSub',1,'p_SumOrSub','fort.py',372), ('MultDiv -> EAParens','MultDiv',1,'p_MultDiv','fort.py',379), ('MultDiv -> MultDiv MDSymbols action_5 EAParens action_6','MultDiv',5,'p_MultDiv','fort.py',380), ('MDSymbols -> mul','MDSymbols',1,'p_MDSymbols','fort.py',386), ('MDSymbols -> div','MDSymbols',1,'p_MDSymbols','fort.py',387), ('EAParens -> EItem','EAParens',1,'p_EAParens','fort.py',394), ('EAParens -> openParen EA closedParen','EAParens',3,'p_EAParens','fort.py',395), ('EL -> AND','EL',1,'p_EL','fort.py',401), ('EL -> EL or action_10 AND action_9','EL',5,'p_EL','fort.py',402), ('AND -> Equality','AND',1,'p_AND','fort.py',408), ('AND -> AND and action_12 Equality action_11','AND',5,'p_AND','fort.py',409), ('Equality -> EItem EQSymbols action_13 EItem action_14','Equality',5,'p_Equality','fort.py',415), ('Equality -> openParen EL closedParen','Equality',3,'p_Equality','fort.py',416), ('Equality -> not EL action_15','Equality',3,'p_Equality','fort.py',417), ('EItem -> Dimensional','EItem',1,'p_EItem','fort.py',423), ('EItem -> int action_2','EItem',2,'p_EItem','fort.py',424), ('EItem -> rea action_2_rea','EItem',2,'p_EItem','fort.py',425), ('EQSymbols -> less','EQSymbols',1,'p_EQSymbols','fort.py',431), ('EQSymbols -> more','EQSymbols',1,'p_EQSymbols','fort.py',432), ('EQSymbols -> doubleEquals','EQSymbols',1,'p_EQSymbols','fort.py',433), ('EQSymbols -> notEquals','EQSymbols',1,'p_EQSymbols','fort.py',434), ('EQSymbols -> lessEquals','EQSymbols',1,'p_EQSymbols','fort.py',435), ('EQSymbols -> moreEquals','EQSymbols',1,'p_EQSymbols','fort.py',436), ('action_addSymbols -> <empty>','action_addSymbols',0,'p_action_addSymbols','fort.py',446), ('action_1 -> <empty>','action_1',0,'p_action_1','fort.py',452), ('action_2 -> <empty>','action_2',0,'p_action_2','fort.py',500), ('action_2_rea -> <empty>','action_2_rea',0,'p_action_2_rea','fort.py',506), ('action_3 -> <empty>','action_3',0,'p_action_3','fort.py',512), ('action_4 -> <empty>','action_4',0,'p_action_4','fort.py',517), ('action_5 -> <empty>','action_5',0,'p_action_5','fort.py',540), ('action_6 -> <empty>','action_6',0,'p_action_6','fort.py',545), ('action_8 -> <empty>','action_8',0,'p_action_8','fort.py',568), ('action_9 -> <empty>','action_9',0,'p_action_9','fort.py',588), ('action_10 -> <empty>','action_10',0,'p_action_10','fort.py',611), ('action_11 -> <empty>','action_11',0,'p_action_11','fort.py',616), ('action_12 -> <empty>','action_12',0,'p_action_12','fort.py',639), ('action_13 -> <empty>','action_13',0,'p_action_13','fort.py',644), ('action_14 -> <empty>','action_14',0,'p_action_14','fort.py',649), ('action_15 -> <empty>','action_15',0,'p_action_15','fort.py',672), ('action_16 -> <empty>','action_16',0,'p_action_16','fort.py',687), ('action_17 -> <empty>','action_17',0,'p_action_17','fort.py',692), ('action_18 -> <empty>','action_18',0,'p_action_18','fort.py',708), ('action_19 -> <empty>','action_19',0,'p_action_19','fort.py',718), ('action_20 -> <empty>','action_20',0,'p_action_20','fort.py',728), ('action_21 -> <empty>','action_21',0,'p_action_21','fort.py',736), ('action_22 -> <empty>','action_22',0,'p_action_22','fort.py',742), ('action_23 -> <empty>','action_23',0,'p_action_23','fort.py',755), ('action_24 -> <empty>','action_24',0,'p_action_24','fort.py',764), ('action_25 -> <empty>','action_25',0,'p_action_25','fort.py',778), ('action_26 -> <empty>','action_26',0,'p_action_26','fort.py',796), ('action_27 -> <empty>','action_27',0,'p_action_27','fort.py',820), ('action_28 -> <empty>','action_28',0,'p_action_28','fort.py',826), ('action_29 -> <empty>','action_29',0,'p_action_29','fort.py',832), ('action_30 -> <empty>','action_30',0,'p_action_30','fort.py',856), ('action_31 -> <empty>','action_31',0,'p_action_31','fort.py',864), ('action_32 -> <empty>','action_32',0,'p_action_32','fort.py',872), ('action_33 -> <empty>','action_33',0,'p_action_33','fort.py',882), ('action_34 -> <empty>','action_34',0,'p_action_34','fort.py',894), ('action_36 -> <empty>','action_36',0,'p_action_36','fort.py',901), ('action_37 -> <empty>','action_37',0,'p_action_37','fort.py',910), ('action_38 -> <empty>','action_38',0,'p_action_38','fort.py',917), ('action_39 -> <empty>','action_39',0,'p_action_39','fort.py',923), ('action_40 -> <empty>','action_40',0,'p_action_40','fort.py',930), ('action_41 -> <empty>','action_41',0,'p_action_41','fort.py',937), ('action_setDim1 -> <empty>','action_setDim1',0,'p_action_setDim1','fort.py',949), ('action_setDim2 -> <empty>','action_setDim2',0,'p_action_setDim2','fort.py',960), ]
_tabversion = '3.10' _lr_method = 'LALR' _lr_signature = 'and closedBra closedParen coma comment div do doubleColon doubleEquals elif else end endline equals exit id if int integer less lessEquals minus more moreEquals mul not notEquals openBra openParen or parens plus print program rea read real string subroutine swap then\n programa : program action_37 id V F action_38 B end program\n \n V : V Tipo Dim doubleColon Rid action_addSymbols action_32\n |\n \n Rid : id\n | Rid coma id\n \n Tipo : integer\n | real\n \n Dim : openBra int action_30 closedBra\n | openBra int action_30 closedBra openBra int action_31 closedBra\n |\n \n F : F subroutine id action_39 B end subroutine action_40\n |\n \n B : B S\n |\n \n S : Dimensional equals EA action_8\n | id parens action_41\n | read RDimensional\n | print RDimOrString\n | if action_16 Relif ElseOrEmpty end if action_20\n | do id action_24 equals EA action_25 coma EA action_26 IntOrEmpty then B action_29 end do\n | do then action_21 B action_22 end do\n | swap Dimensional coma Dimensional\n | exit action_23\n | comment\n \n Dimensional : id DimensionsOrEmpty action_1\n \n DimensionsOrEmpty : openParen EA action_setDim1 ComaEAOrEmpty closedParen\n |\n \n ComaEAOrEmpty : coma EA action_setDim2\n |\n \n RDimensional : Dimensional action_36\n | RDimensional coma Dimensional action_36\n \n RDimOrString : DimOrString\n | RDimOrString coma DimOrString\n \n DimOrString : Dimensional action_33\n | string action_34\n | endline action_34\n \n Relif : openParen EL closedParen action_17 then B\n | Relif elif action_18 openParen EL closedParen action_17 then B\n \n ElseOrEmpty : else action_19 B\n |\n \n IntOrEmpty : coma int action_28\n | action_27\n \n EA : MultDiv\n | EA SumOrSub action_3 MultDiv action_4\n \n SumOrSub : plus\n | minus\n \n MultDiv : EAParens\n | MultDiv MDSymbols action_5 EAParens action_6\n \n MDSymbols : mul\n | div\n \n EAParens : EItem\n | openParen EA closedParen\n \n EL : AND\n | EL or action_10 AND action_9\n \n AND : Equality\n | AND and action_12 Equality action_11\n \n Equality : EItem EQSymbols action_13 EItem action_14\n | openParen EL closedParen\n | not EL action_15\n \n EItem : Dimensional\n | int action_2\n | rea action_2_rea\n \n EQSymbols : less\n | more\n | doubleEquals\n | notEquals\n | lessEquals\n | moreEquals\n action_addSymbols :action_1 :action_2 :action_2_rea :action_3 :action_4 :action_5 :action_6 :action_8 :action_9 :action_10 :action_11 :action_12 :action_13 :action_14 :action_15 :action_16 :action_17 :action_18 :action_19 :action_20 :action_21 :action_22 :action_23 :action_24 :action_25 :action_26 :action_27 :action_28 :action_29 :action_30 :action_31 :action_32 :action_33 :action_34 :action_36 :action_37 :action_38 :action_39 :action_40 :action_41 :action_setDim1 :action_setDim2 :' _lr_action_items = {'program': ([0, 19], [2, 36]), '$end': ([1, 36], [0, -1]), 'id': ([2, 3, 4, 5, 6, 10, 11, 14, 15, 16, 20, 22, 23, 25, 26, 27, 28, 29, 30, 31, 33, 34, 35, 37, 38, 39, 40, 41, 42, 43, 44, 45, 48, 50, 51, 52, 53, 55, 56, 57, 59, 60, 61, 62, 63, 64, 65, 66, 67, 68, 69, 70, 71, 73, 75, 76, 78, 79, 83, 84, 85, 86, 87, 88, 89, 90, 91, 92, 93, 96, 97, 102, 103, 104, 105, 106, 108, 110, 111, 112, 113, 116, 119, 120, 121, 122, 123, 124, 125, 126, 127, 131, 133, 135, 136, 137, 138, 139, 142, 143, 144, 150, 151, 152, 154, 158, 159, 161, 168, 172, 174, 176, 179], [-105, 4, -3, -12, -106, -14, 15, 18, -107, 31, -13, 40, 40, 47, 40, -92, -24, -14, -69, -4, -109, -70, 40, 40, -17, -104, -27, -18, -32, -102, -103, -103, -90, -23, 18, -101, 79, -16, -25, 40, -43, -47, -51, -60, -71, -72, -77, 40, -30, 40, -34, -35, -36, 40, -14, 40, -2, -5, -73, -45, -46, -75, -49, -50, -61, -62, -15, -104, -33, -88, 40, 40, 40, 18, -22, -108, -52, 40, 40, 40, -31, -14, -79, -81, -82, -63, -64, -65, -66, -67, -68, -11, -26, -74, -76, -89, 40, 18, 40, 40, 40, -44, -48, -19, -14, 40, -21, 18, -14, 18, -14, 18, -20]), 'integer': ([4, 5, 30, 31, 52, 78, 79], [-3, 8, -69, -4, -101, -2, -5]), 'real': ([4, 5, 30, 31, 52, 78, 79], [-3, 9, -69, -4, -101, -2, -5]), 'subroutine': ([4, 5, 6, 30, 31, 52, 77, 78, 79, 106, 131], [-3, -12, 11, -69, -4, -101, 106, -2, -5, -108, -11]), 'end': ([4, 5, 6, 10, 14, 15, 20, 27, 28, 29, 30, 31, 33, 34, 38, 39, 40, 41, 42, 43, 44, 45, 48, 50, 51, 52, 55, 56, 59, 60, 61, 62, 63, 64, 65, 67, 69, 70, 71, 72, 75, 78, 79, 89, 90, 91, 92, 93, 94, 96, 104, 105, 106, 108, 113, 116, 130, 131, 133, 135, 136, 137, 139, 150, 151, 152, 154, 159, 161, 168, 172, 174, 176, 177, 179], [-3, -12, -106, -14, 19, -107, -13, -92, -24, -14, -69, -4, -109, -70, -17, -104, -27, -18, -32, -102, -103, -103, -90, -23, 77, -101, -16, -25, -43, -47, -51, -60, -71, -72, -77, -30, -34, -35, -36, -40, -14, -2, -5, -61, -62, -15, -104, -33, 114, -88, -91, -22, -108, -52, -31, -14, 147, -11, -26, -74, -76, -89, -39, -44, -48, -19, -14, -21, -37, -14, -38, -14, -98, 178, -20]), 'read': ([4, 5, 6, 10, 14, 15, 20, 27, 28, 29, 30, 31, 33, 34, 38, 39, 40, 41, 42, 43, 44, 45, 48, 50, 51, 52, 55, 56, 59, 60, 61, 62, 63, 64, 65, 67, 69, 70, 71, 75, 78, 79, 89, 90, 91, 92, 93, 96, 104, 105, 106, 108, 113, 116, 131, 133, 135, 136, 137, 139, 150, 151, 152, 154, 159, 161, 168, 172, 174, 176, 179], [-3, -12, -106, -14, 22, -107, -13, -92, -24, -14, -69, -4, -109, -70, -17, -104, -27, -18, -32, -102, -103, -103, -90, -23, 22, -101, -16, -25, -43, -47, -51, -60, -71, -72, -77, -30, -34, -35, -36, -14, -2, -5, -61, -62, -15, -104, -33, -88, 22, -22, -108, -52, -31, -14, -11, -26, -74, -76, -89, 22, -44, -48, -19, -14, -21, 22, -14, 22, -14, 22, -20]), 'print': ([4, 5, 6, 10, 14, 15, 20, 27, 28, 29, 30, 31, 33, 34, 38, 39, 40, 41, 42, 43, 44, 45, 48, 50, 51, 52, 55, 56, 59, 60, 61, 62, 63, 64, 65, 67, 69, 70, 71, 75, 78, 79, 89, 90, 91, 92, 93, 96, 104, 105, 106, 108, 113, 116, 131, 133, 135, 136, 137, 139, 150, 151, 152, 154, 159, 161, 168, 172, 174, 176, 179], [-3, -12, -106, -14, 23, -107, -13, -92, -24, -14, -69, -4, -109, -70, -17, -104, -27, -18, -32, -102, -103, -103, -90, -23, 23, -101, -16, -25, -43, -47, -51, -60, -71, -72, -77, -30, -34, -35, -36, -14, -2, -5, -61, -62, -15, -104, -33, -88, 23, -22, -108, -52, -31, -14, -11, -26, -74, -76, -89, 23, -44, -48, -19, -14, -21, 23, -14, 23, -14, 23, -20]), 'if': ([4, 5, 6, 10, 14, 15, 20, 27, 28, 29, 30, 31, 33, 34, 38, 39, 40, 41, 42, 43, 44, 45, 48, 50, 51, 52, 55, 56, 59, 60, 61, 62, 63, 64, 65, 67, 69, 70, 71, 75, 78, 79, 89, 90, 91, 92, 93, 96, 104, 105, 106, 108, 113, 114, 116, 131, 133, 135, 136, 137, 139, 150, 151, 152, 154, 159, 161, 168, 172, 174, 176, 179], [-3, -12, -106, -14, 24, -107, -13, -92, -24, -14, -69, -4, -109, -70, -17, -104, -27, -18, -32, -102, -103, -103, -90, -23, 24, -101, -16, -25, -43, -47, -51, -60, -71, -72, -77, -30, -34, -35, -36, -14, -2, -5, -61, -62, -15, -104, -33, -88, 24, -22, -108, -52, -31, 137, -14, -11, -26, -74, -76, -89, 24, -44, -48, -19, -14, -21, 24, -14, 24, -14, 24, -20]), 'do': ([4, 5, 6, 10, 14, 15, 20, 27, 28, 29, 30, 31, 33, 34, 38, 39, 40, 41, 42, 43, 44, 45, 48, 50, 51, 52, 55, 56, 59, 60, 61, 62, 63, 64, 65, 67, 69, 70, 71, 75, 78, 79, 89, 90, 91, 92, 93, 96, 104, 105, 106, 108, 113, 116, 131, 133, 135, 136, 137, 139, 147, 150, 151, 152, 154, 159, 161, 168, 172, 174, 176, 178, 179], [-3, -12, -106, -14, 25, -107, -13, -92, -24, -14, -69, -4, -109, -70, -17, -104, -27, -18, -32, -102, -103, -103, -90, -23, 25, -101, -16, -25, -43, -47, -51, -60, -71, -72, -77, -30, -34, -35, -36, -14, -2, -5, -61, -62, -15, -104, -33, -88, 25, -22, -108, -52, -31, -14, -11, -26, -74, -76, -89, 25, 159, -44, -48, -19, -14, -21, 25, -14, 25, -14, 25, 179, -20]), 'swap': ([4, 5, 6, 10, 14, 15, 20, 27, 28, 29, 30, 31, 33, 34, 38, 39, 40, 41, 42, 43, 44, 45, 48, 50, 51, 52, 55, 56, 59, 60, 61, 62, 63, 64, 65, 67, 69, 70, 71, 75, 78, 79, 89, 90, 91, 92, 93, 96, 104, 105, 106, 108, 113, 116, 131, 133, 135, 136, 137, 139, 150, 151, 152, 154, 159, 161, 168, 172, 174, 176, 179], [-3, -12, -106, -14, 26, -107, -13, -92, -24, -14, -69, -4, -109, -70, -17, -104, -27, -18, -32, -102, -103, -103, -90, -23, 26, -101, -16, -25, -43, -47, -51, -60, -71, -72, -77, -30, -34, -35, -36, -14, -2, -5, -61, -62, -15, -104, -33, -88, 26, -22, -108, -52, -31, -14, -11, -26, -74, -76, -89, 26, -44, -48, -19, -14, -21, 26, -14, 26, -14, 26, -20]), 'exit': ([4, 5, 6, 10, 14, 15, 20, 27, 28, 29, 30, 31, 33, 34, 38, 39, 40, 41, 42, 43, 44, 45, 48, 50, 51, 52, 55, 56, 59, 60, 61, 62, 63, 64, 65, 67, 69, 70, 71, 75, 78, 79, 89, 90, 91, 92, 93, 96, 104, 105, 106, 108, 113, 116, 131, 133, 135, 136, 137, 139, 150, 151, 152, 154, 159, 161, 168, 172, 174, 176, 179], [-3, -12, -106, -14, 27, -107, -13, -92, -24, -14, -69, -4, -109, -70, -17, -104, -27, -18, -32, -102, -103, -103, -90, -23, 27, -101, -16, -25, -43, -47, -51, -60, -71, -72, -77, -30, -34, -35, -36, -14, -2, -5, -61, -62, -15, -104, -33, -88, 27, -22, -108, -52, -31, -14, -11, -26, -74, -76, -89, 27, -44, -48, -19, -14, -21, 27, -14, 27, -14, 27, -20]), 'comment': ([4, 5, 6, 10, 14, 15, 20, 27, 28, 29, 30, 31, 33, 34, 38, 39, 40, 41, 42, 43, 44, 45, 48, 50, 51, 52, 55, 56, 59, 60, 61, 62, 63, 64, 65, 67, 69, 70, 71, 75, 78, 79, 89, 90, 91, 92, 93, 96, 104, 105, 106, 108, 113, 116, 131, 133, 135, 136, 137, 139, 150, 151, 152, 154, 159, 161, 168, 172, 174, 176, 179], [-3, -12, -106, -14, 28, -107, -13, -92, -24, -14, -69, -4, -109, -70, -17, -104, -27, -18, -32, -102, -103, -103, -90, -23, 28, -101, -16, -25, -43, -47, -51, -60, -71, -72, -77, -30, -34, -35, -36, -14, -2, -5, -61, -62, -15, -104, -33, -88, 28, -22, -108, -52, -31, -14, -11, -26, -74, -76, -89, 28, -44, -48, -19, -14, -21, 28, -14, 28, -14, 28, -20]), 'openBra': ([7, 8, 9, 54], [13, -6, -7, 80]), 'doubleColon': ([7, 8, 9, 12, 54, 148], [-10, -6, -7, 16, -8, -9]), 'int': ([13, 35, 37, 57, 73, 80, 83, 84, 85, 86, 87, 88, 97, 102, 103, 110, 111, 112, 119, 120, 121, 122, 123, 124, 125, 126, 127, 138, 142, 143, 144, 158, 169], [17, 63, 63, 63, 63, 107, -73, -45, -46, -75, -49, -50, 63, 63, 63, 63, 63, 63, -79, -81, -82, -63, -64, -65, -66, -67, -68, 63, 63, 63, 63, 63, 173]), 'closedBra': ([17, 32, 107, 132], [-99, 54, -100, 148]), 'parens': ([18], [33]), 'openParen': ([18, 24, 35, 37, 40, 46, 57, 73, 83, 84, 85, 86, 87, 88, 95, 97, 102, 103, 110, 111, 112, 115, 119, 120, 138, 142, 143, 158], [35, -85, 57, 57, 35, 73, 57, 97, -73, -45, -46, -75, -49, -50, -87, 97, 97, 57, 57, 57, 57, 138, -79, -81, 97, 97, 97, 57]), 'equals': ([18, 21, 34, 47, 56, 74, 133], [-27, 37, -70, -93, -25, 103, -26]), 'elif': ([20, 27, 28, 33, 34, 38, 39, 40, 41, 42, 43, 44, 45, 50, 55, 56, 59, 60, 61, 62, 63, 64, 65, 67, 69, 70, 71, 72, 89, 90, 91, 92, 93, 105, 108, 113, 133, 135, 136, 137, 150, 151, 152, 154, 159, 161, 168, 172, 179], [-13, -92, -24, -109, -70, -17, -104, -27, -18, -32, -102, -103, -103, -23, -16, -25, -43, -47, -51, -60, -71, -72, -77, -30, -34, -35, -36, 95, -61, -62, -15, -104, -33, -22, -52, -31, -26, -74, -76, -89, -44, -48, -19, -14, -21, -37, -14, -38, -20]), 'else': ([20, 27, 28, 33, 34, 38, 39, 40, 41, 42, 43, 44, 45, 50, 55, 56, 59, 60, 61, 62, 63, 64, 65, 67, 69, 70, 71, 72, 89, 90, 91, 92, 93, 105, 108, 113, 133, 135, 136, 137, 150, 151, 152, 154, 159, 161, 168, 172, 179], [-13, -92, -24, -109, -70, -17, -104, -27, -18, -32, -102, -103, -103, -23, -16, -25, -43, -47, -51, -60, -71, -72, -77, -30, -34, -35, -36, 96, -61, -62, -15, -104, -33, -22, -52, -31, -26, -74, -76, -89, -44, -48, -19, -14, -21, -37, -14, -38, -20]), 'string': ([23, 68], [44, 44]), 'endline': ([23, 68], [45, 45]), 'then': ([25, 34, 40, 56, 59, 60, 61, 62, 63, 64, 89, 90, 108, 118, 133, 135, 136, 141, 150, 151, 160, 165, 166, 167, 170, 171, 173, 175], [48, -70, -27, -25, -43, -47, -51, -60, -71, -72, -61, -62, -52, -86, -26, -74, -76, 154, -44, -48, -86, -95, 168, -96, 174, -42, -97, -41]), 'coma': ([30, 31, 34, 38, 39, 40, 41, 42, 43, 44, 45, 49, 56, 58, 59, 60, 61, 62, 63, 64, 67, 69, 70, 71, 79, 82, 89, 90, 92, 93, 108, 113, 129, 133, 135, 136, 146, 150, 151, 165, 167], [53, -4, -70, 66, -104, -27, 68, -32, -102, -103, -103, 76, -25, -110, -43, -47, -51, -60, -71, -72, -30, -34, -35, -36, -5, 110, -61, -62, -104, -33, -52, -31, -94, -26, -74, -76, 158, -44, -48, -95, 169]), 'mul': ([34, 40, 56, 59, 60, 61, 62, 63, 64, 89, 90, 108, 133, 135, 136, 151], [-70, -27, -25, 87, -47, -51, -60, -71, -72, -61, -62, -52, -26, 87, -76, -48]), 'div': ([34, 40, 56, 59, 60, 61, 62, 63, 64, 89, 90, 108, 133, 135, 136, 151], [-70, -27, -25, 88, -47, -51, -60, -71, -72, -61, -62, -52, -26, 88, -76, -48]), 'plus': ([34, 40, 56, 58, 59, 60, 61, 62, 63, 64, 65, 81, 89, 90, 108, 129, 133, 134, 135, 136, 150, 151, 165], [-70, -27, -25, 84, -43, -47, -51, -60, -71, -72, 84, 84, -61, -62, -52, 84, -26, 84, -74, -76, -44, -48, 84]), 'minus': ([34, 40, 56, 58, 59, 60, 61, 62, 63, 64, 65, 81, 89, 90, 108, 129, 133, 134, 135, 136, 150, 151, 165], [-70, -27, -25, 85, -43, -47, -51, -60, -71, -72, 85, 85, -61, -62, -52, 85, -26, 85, -74, -76, -44, -48, 85]), 'closedParen': ([34, 40, 56, 58, 59, 60, 61, 62, 63, 64, 81, 82, 89, 90, 98, 99, 100, 108, 109, 117, 128, 133, 134, 135, 136, 140, 145, 149, 150, 151, 153, 155, 156, 157, 162, 163, 164], [-70, -27, -25, -110, -43, -47, -51, -60, -71, -72, 108, -29, -61, -62, 118, -53, -55, -52, 133, 140, -84, -26, -111, -74, -76, -58, -59, -28, -44, -48, 160, -78, -80, -83, -54, -56, -57]), 'less': ([34, 40, 56, 62, 63, 64, 89, 90, 101, 133], [-70, -27, -25, -60, -71, -72, -61, -62, 122, -26]), 'more': ([34, 40, 56, 62, 63, 64, 89, 90, 101, 133], [-70, -27, -25, -60, -71, -72, -61, -62, 123, -26]), 'doubleEquals': ([34, 40, 56, 62, 63, 64, 89, 90, 101, 133], [-70, -27, -25, -60, -71, -72, -61, -62, 124, -26]), 'notEquals': ([34, 40, 56, 62, 63, 64, 89, 90, 101, 133], [-70, -27, -25, -60, -71, -72, -61, -62, 125, -26]), 'lessEquals': ([34, 40, 56, 62, 63, 64, 89, 90, 101, 133], [-70, -27, -25, -60, -71, -72, -61, -62, 126, -26]), 'moreEquals': ([34, 40, 56, 62, 63, 64, 89, 90, 101, 133], [-70, -27, -25, -60, -71, -72, -61, -62, 127, -26]), 'and': ([34, 40, 56, 62, 63, 64, 89, 90, 99, 100, 128, 133, 140, 145, 155, 156, 157, 162, 163, 164], [-70, -27, -25, -60, -71, -72, -61, -62, 120, -55, -84, -26, -58, -59, 120, -80, -83, -54, -56, -57]), 'or': ([34, 40, 56, 62, 63, 64, 89, 90, 98, 99, 100, 117, 128, 133, 140, 145, 153, 155, 156, 157, 162, 163, 164], [-70, -27, -25, -60, -71, -72, -61, -62, 119, -53, -55, 119, 119, -26, -58, -59, 119, -78, -80, -83, -54, -56, -57]), 'rea': ([35, 37, 57, 73, 83, 84, 85, 86, 87, 88, 97, 102, 103, 110, 111, 112, 119, 120, 121, 122, 123, 124, 125, 126, 127, 138, 142, 143, 144, 158], [64, 64, 64, 64, -73, -45, -46, -75, -49, -50, 64, 64, 64, 64, 64, 64, -79, -81, -82, -63, -64, -65, -66, -67, -68, 64, 64, 64, 64, 64]), 'not': ([73, 97, 102, 119, 120, 138, 142, 143], [102, 102, 102, -79, -81, 102, 102, 102])} _lr_action = {} for (_k, _v) in _lr_action_items.items(): for (_x, _y) in zip(_v[0], _v[1]): if not _x in _lr_action: _lr_action[_x] = {} _lr_action[_x][_k] = _y del _lr_action_items _lr_goto_items = {'programa': ([0], [1]), 'action_37': ([2], [3]), 'V': ([4], [5]), 'F': ([5], [6]), 'Tipo': ([5], [7]), 'action_38': ([6], [10]), 'Dim': ([7], [12]), 'B': ([10, 29, 75, 116, 154, 168, 174], [14, 51, 104, 139, 161, 172, 176]), 'S': ([14, 51, 104, 139, 161, 172, 176], [20, 20, 20, 20, 20, 20, 20]), 'Dimensional': ([14, 22, 23, 26, 35, 37, 51, 57, 66, 68, 73, 76, 97, 102, 103, 104, 110, 111, 112, 138, 139, 142, 143, 144, 158, 161, 172, 176], [21, 39, 43, 49, 62, 62, 21, 62, 92, 43, 62, 105, 62, 62, 62, 21, 62, 62, 62, 62, 21, 62, 62, 62, 62, 21, 21, 21]), 'action_39': ([15], [29]), 'Rid': ([16], [30]), 'action_30': ([17], [32]), 'DimensionsOrEmpty': ([18, 40], [34, 34]), 'RDimensional': ([22], [38]), 'RDimOrString': ([23], [41]), 'DimOrString': ([23, 68], [42, 93]), 'action_16': ([24], [46]), 'action_23': ([27], [50]), 'action_addSymbols': ([30], [52]), 'action_41': ([33], [55]), 'action_1': ([34], [56]), 'EA': ([35, 37, 57, 103, 110, 158], [58, 65, 81, 129, 134, 165]), 'MultDiv': ([35, 37, 57, 103, 110, 111, 158], [59, 59, 59, 59, 59, 135, 59]), 'EAParens': ([35, 37, 57, 103, 110, 111, 112, 158], [60, 60, 60, 60, 60, 60, 136, 60]), 'EItem': ([35, 37, 57, 73, 97, 102, 103, 110, 111, 112, 138, 142, 143, 144, 158], [61, 61, 61, 101, 101, 101, 61, 61, 61, 61, 101, 101, 101, 157, 61]), 'action_36': ([39, 92], [67, 113]), 'action_33': ([43], [69]), 'action_34': ([44, 45], [70, 71]), 'Relif': ([46], [72]), 'action_24': ([47], [74]), 'action_21': ([48], [75]), 'action_32': ([52], [78]), 'action_setDim1': ([58], [82]), 'SumOrSub': ([58, 65, 81, 129, 134, 165], [83, 83, 83, 83, 83, 83]), 'MDSymbols': ([59, 135], [86, 86]), 'action_2': ([63], [89]), 'action_2_rea': ([64], [90]), 'action_8': ([65], [91]), 'ElseOrEmpty': ([72], [94]), 'EL': ([73, 97, 102, 138], [98, 117, 128, 153]), 'AND': ([73, 97, 102, 138, 142], [99, 99, 99, 99, 155]), 'Equality': ([73, 97, 102, 138, 142, 143], [100, 100, 100, 100, 100, 156]), 'ComaEAOrEmpty': ([82], [109]), 'action_3': ([83], [111]), 'action_5': ([86], [112]), 'action_18': ([95], [115]), 'action_19': ([96], [116]), 'EQSymbols': ([101], [121]), 'action_22': ([104], [130]), 'action_40': ([106], [131]), 'action_31': ([107], [132]), 'action_17': ([118, 160], [141, 166]), 'action_10': ([119], [142]), 'action_12': ([120], [143]), 'action_13': ([121], [144]), 'action_15': ([128], [145]), 'action_25': ([129], [146]), 'action_setDim2': ([134], [149]), 'action_4': ([135], [150]), 'action_6': ([136], [151]), 'action_20': ([137], [152]), 'action_9': ([155], [162]), 'action_11': ([156], [163]), 'action_14': ([157], [164]), 'action_26': ([165], [167]), 'IntOrEmpty': ([167], [170]), 'action_27': ([167], [171]), 'action_28': ([173], [175]), 'action_29': ([176], [177])} _lr_goto = {} for (_k, _v) in _lr_goto_items.items(): for (_x, _y) in zip(_v[0], _v[1]): if not _x in _lr_goto: _lr_goto[_x] = {} _lr_goto[_x][_k] = _y del _lr_goto_items _lr_productions = [("S' -> programa", "S'", 1, None, None, None), ('programa -> program action_37 id V F action_38 B end program', 'programa', 9, 'p_programa', 'fort.py', 225), ('V -> V Tipo Dim doubleColon Rid action_addSymbols action_32', 'V', 7, 'p_V', 'fort.py', 232), ('V -> <empty>', 'V', 0, 'p_V', 'fort.py', 233), ('Rid -> id', 'Rid', 1, 'p_Rid', 'fort.py', 239), ('Rid -> Rid coma id', 'Rid', 3, 'p_Rid', 'fort.py', 240), ('Tipo -> integer', 'Tipo', 1, 'p_Tipo', 'fort.py', 252), ('Tipo -> real', 'Tipo', 1, 'p_Tipo', 'fort.py', 253), ('Dim -> openBra int action_30 closedBra', 'Dim', 4, 'p_Dim', 'fort.py', 261), ('Dim -> openBra int action_30 closedBra openBra int action_31 closedBra', 'Dim', 8, 'p_Dim', 'fort.py', 262), ('Dim -> <empty>', 'Dim', 0, 'p_Dim', 'fort.py', 263), ('F -> F subroutine id action_39 B end subroutine action_40', 'F', 8, 'p_F', 'fort.py', 269), ('F -> <empty>', 'F', 0, 'p_F', 'fort.py', 270), ('B -> B S', 'B', 2, 'p_B', 'fort.py', 276), ('B -> <empty>', 'B', 0, 'p_B', 'fort.py', 277), ('S -> Dimensional equals EA action_8', 'S', 4, 'p_S', 'fort.py', 283), ('S -> id parens action_41', 'S', 3, 'p_S', 'fort.py', 284), ('S -> read RDimensional', 'S', 2, 'p_S', 'fort.py', 285), ('S -> print RDimOrString', 'S', 2, 'p_S', 'fort.py', 286), ('S -> if action_16 Relif ElseOrEmpty end if action_20', 'S', 7, 'p_S', 'fort.py', 287), ('S -> do id action_24 equals EA action_25 coma EA action_26 IntOrEmpty then B action_29 end do', 'S', 15, 'p_S', 'fort.py', 288), ('S -> do then action_21 B action_22 end do', 'S', 7, 'p_S', 'fort.py', 289), ('S -> swap Dimensional coma Dimensional', 'S', 4, 'p_S', 'fort.py', 290), ('S -> exit action_23', 'S', 2, 'p_S', 'fort.py', 291), ('S -> comment', 'S', 1, 'p_S', 'fort.py', 292), ('Dimensional -> id DimensionsOrEmpty action_1', 'Dimensional', 3, 'p_Dimensional', 'fort.py', 300), ('DimensionsOrEmpty -> openParen EA action_setDim1 ComaEAOrEmpty closedParen', 'DimensionsOrEmpty', 5, 'p_DimensionsOrEmpty', 'fort.py', 307), ('DimensionsOrEmpty -> <empty>', 'DimensionsOrEmpty', 0, 'p_DimensionsOrEmpty', 'fort.py', 308), ('ComaEAOrEmpty -> coma EA action_setDim2', 'ComaEAOrEmpty', 3, 'p_ComaEAOrEmpty', 'fort.py', 314), ('ComaEAOrEmpty -> <empty>', 'ComaEAOrEmpty', 0, 'p_ComaEAOrEmpty', 'fort.py', 315), ('RDimensional -> Dimensional action_36', 'RDimensional', 2, 'p_RDimensional', 'fort.py', 321), ('RDimensional -> RDimensional coma Dimensional action_36', 'RDimensional', 4, 'p_RDimensional', 'fort.py', 322), ('RDimOrString -> DimOrString', 'RDimOrString', 1, 'p_RDimOrString', 'fort.py', 328), ('RDimOrString -> RDimOrString coma DimOrString', 'RDimOrString', 3, 'p_RDimOrString', 'fort.py', 329), ('DimOrString -> Dimensional action_33', 'DimOrString', 2, 'p_DimOrString', 'fort.py', 335), ('DimOrString -> string action_34', 'DimOrString', 2, 'p_DimOrString', 'fort.py', 336), ('DimOrString -> endline action_34', 'DimOrString', 2, 'p_DimOrString', 'fort.py', 337), ('Relif -> openParen EL closedParen action_17 then B', 'Relif', 6, 'p_Relif', 'fort.py', 343), ('Relif -> Relif elif action_18 openParen EL closedParen action_17 then B', 'Relif', 9, 'p_Relif', 'fort.py', 344), ('ElseOrEmpty -> else action_19 B', 'ElseOrEmpty', 3, 'p_ElseOrEmpty', 'fort.py', 350), ('ElseOrEmpty -> <empty>', 'ElseOrEmpty', 0, 'p_ElseOrEmpty', 'fort.py', 351), ('IntOrEmpty -> coma int action_28', 'IntOrEmpty', 3, 'p_IntOrEmpty', 'fort.py', 357), ('IntOrEmpty -> action_27', 'IntOrEmpty', 1, 'p_IntOrEmpty', 'fort.py', 358), ('EA -> MultDiv', 'EA', 1, 'p_EA', 'fort.py', 364), ('EA -> EA SumOrSub action_3 MultDiv action_4', 'EA', 5, 'p_EA', 'fort.py', 365), ('SumOrSub -> plus', 'SumOrSub', 1, 'p_SumOrSub', 'fort.py', 371), ('SumOrSub -> minus', 'SumOrSub', 1, 'p_SumOrSub', 'fort.py', 372), ('MultDiv -> EAParens', 'MultDiv', 1, 'p_MultDiv', 'fort.py', 379), ('MultDiv -> MultDiv MDSymbols action_5 EAParens action_6', 'MultDiv', 5, 'p_MultDiv', 'fort.py', 380), ('MDSymbols -> mul', 'MDSymbols', 1, 'p_MDSymbols', 'fort.py', 386), ('MDSymbols -> div', 'MDSymbols', 1, 'p_MDSymbols', 'fort.py', 387), ('EAParens -> EItem', 'EAParens', 1, 'p_EAParens', 'fort.py', 394), ('EAParens -> openParen EA closedParen', 'EAParens', 3, 'p_EAParens', 'fort.py', 395), ('EL -> AND', 'EL', 1, 'p_EL', 'fort.py', 401), ('EL -> EL or action_10 AND action_9', 'EL', 5, 'p_EL', 'fort.py', 402), ('AND -> Equality', 'AND', 1, 'p_AND', 'fort.py', 408), ('AND -> AND and action_12 Equality action_11', 'AND', 5, 'p_AND', 'fort.py', 409), ('Equality -> EItem EQSymbols action_13 EItem action_14', 'Equality', 5, 'p_Equality', 'fort.py', 415), ('Equality -> openParen EL closedParen', 'Equality', 3, 'p_Equality', 'fort.py', 416), ('Equality -> not EL action_15', 'Equality', 3, 'p_Equality', 'fort.py', 417), ('EItem -> Dimensional', 'EItem', 1, 'p_EItem', 'fort.py', 423), ('EItem -> int action_2', 'EItem', 2, 'p_EItem', 'fort.py', 424), ('EItem -> rea action_2_rea', 'EItem', 2, 'p_EItem', 'fort.py', 425), ('EQSymbols -> less', 'EQSymbols', 1, 'p_EQSymbols', 'fort.py', 431), ('EQSymbols -> more', 'EQSymbols', 1, 'p_EQSymbols', 'fort.py', 432), ('EQSymbols -> doubleEquals', 'EQSymbols', 1, 'p_EQSymbols', 'fort.py', 433), ('EQSymbols -> notEquals', 'EQSymbols', 1, 'p_EQSymbols', 'fort.py', 434), ('EQSymbols -> lessEquals', 'EQSymbols', 1, 'p_EQSymbols', 'fort.py', 435), ('EQSymbols -> moreEquals', 'EQSymbols', 1, 'p_EQSymbols', 'fort.py', 436), ('action_addSymbols -> <empty>', 'action_addSymbols', 0, 'p_action_addSymbols', 'fort.py', 446), ('action_1 -> <empty>', 'action_1', 0, 'p_action_1', 'fort.py', 452), ('action_2 -> <empty>', 'action_2', 0, 'p_action_2', 'fort.py', 500), ('action_2_rea -> <empty>', 'action_2_rea', 0, 'p_action_2_rea', 'fort.py', 506), ('action_3 -> <empty>', 'action_3', 0, 'p_action_3', 'fort.py', 512), ('action_4 -> <empty>', 'action_4', 0, 'p_action_4', 'fort.py', 517), ('action_5 -> <empty>', 'action_5', 0, 'p_action_5', 'fort.py', 540), ('action_6 -> <empty>', 'action_6', 0, 'p_action_6', 'fort.py', 545), ('action_8 -> <empty>', 'action_8', 0, 'p_action_8', 'fort.py', 568), ('action_9 -> <empty>', 'action_9', 0, 'p_action_9', 'fort.py', 588), ('action_10 -> <empty>', 'action_10', 0, 'p_action_10', 'fort.py', 611), ('action_11 -> <empty>', 'action_11', 0, 'p_action_11', 'fort.py', 616), ('action_12 -> <empty>', 'action_12', 0, 'p_action_12', 'fort.py', 639), ('action_13 -> <empty>', 'action_13', 0, 'p_action_13', 'fort.py', 644), ('action_14 -> <empty>', 'action_14', 0, 'p_action_14', 'fort.py', 649), ('action_15 -> <empty>', 'action_15', 0, 'p_action_15', 'fort.py', 672), ('action_16 -> <empty>', 'action_16', 0, 'p_action_16', 'fort.py', 687), ('action_17 -> <empty>', 'action_17', 0, 'p_action_17', 'fort.py', 692), ('action_18 -> <empty>', 'action_18', 0, 'p_action_18', 'fort.py', 708), ('action_19 -> <empty>', 'action_19', 0, 'p_action_19', 'fort.py', 718), ('action_20 -> <empty>', 'action_20', 0, 'p_action_20', 'fort.py', 728), ('action_21 -> <empty>', 'action_21', 0, 'p_action_21', 'fort.py', 736), ('action_22 -> <empty>', 'action_22', 0, 'p_action_22', 'fort.py', 742), ('action_23 -> <empty>', 'action_23', 0, 'p_action_23', 'fort.py', 755), ('action_24 -> <empty>', 'action_24', 0, 'p_action_24', 'fort.py', 764), ('action_25 -> <empty>', 'action_25', 0, 'p_action_25', 'fort.py', 778), ('action_26 -> <empty>', 'action_26', 0, 'p_action_26', 'fort.py', 796), ('action_27 -> <empty>', 'action_27', 0, 'p_action_27', 'fort.py', 820), ('action_28 -> <empty>', 'action_28', 0, 'p_action_28', 'fort.py', 826), ('action_29 -> <empty>', 'action_29', 0, 'p_action_29', 'fort.py', 832), ('action_30 -> <empty>', 'action_30', 0, 'p_action_30', 'fort.py', 856), ('action_31 -> <empty>', 'action_31', 0, 'p_action_31', 'fort.py', 864), ('action_32 -> <empty>', 'action_32', 0, 'p_action_32', 'fort.py', 872), ('action_33 -> <empty>', 'action_33', 0, 'p_action_33', 'fort.py', 882), ('action_34 -> <empty>', 'action_34', 0, 'p_action_34', 'fort.py', 894), ('action_36 -> <empty>', 'action_36', 0, 'p_action_36', 'fort.py', 901), ('action_37 -> <empty>', 'action_37', 0, 'p_action_37', 'fort.py', 910), ('action_38 -> <empty>', 'action_38', 0, 'p_action_38', 'fort.py', 917), ('action_39 -> <empty>', 'action_39', 0, 'p_action_39', 'fort.py', 923), ('action_40 -> <empty>', 'action_40', 0, 'p_action_40', 'fort.py', 930), ('action_41 -> <empty>', 'action_41', 0, 'p_action_41', 'fort.py', 937), ('action_setDim1 -> <empty>', 'action_setDim1', 0, 'p_action_setDim1', 'fort.py', 949), ('action_setDim2 -> <empty>', 'action_setDim2', 0, 'p_action_setDim2', 'fort.py', 960)]
__author__ = 'cosmin' class Validator: def __init__(self): pass
__author__ = 'cosmin' class Validator: def __init__(self): pass
catalogue = { 'iphone': { 'X': 800, 'XR': 900, '11': 1000, '12': 1200, }, 'ipad': { 'mini': 400, 'air': 500, 'pro': 800, }, 'mac': { 'macbook air': 999, 'macbook': 1299, 'macbook pro': 1799, } } for key, value in catalogue.items(): print('-' * 10) print(key) for k, v in value.items(): print(k, '', v) print(' ') print('='*64) for key, value in catalogue.items(): print(f"which {key} would you like to purchase together with quantity") for k, v in value.items(): print(k)
catalogue = {'iphone': {'X': 800, 'XR': 900, '11': 1000, '12': 1200}, 'ipad': {'mini': 400, 'air': 500, 'pro': 800}, 'mac': {'macbook air': 999, 'macbook': 1299, 'macbook pro': 1799}} for (key, value) in catalogue.items(): print('-' * 10) print(key) for (k, v) in value.items(): print(k, '', v) print(' ') print('=' * 64) for (key, value) in catalogue.items(): print(f'which {key} would you like to purchase together with quantity') for (k, v) in value.items(): print(k)
# # PySNMP MIB module LBHUB-BRIDGE-MIB (http://snmplabs.com/pysmi) # ASN.1 source file:///Users/davwang4/Dev/mibs.snmplabs.com/asn1/LBHUB-BRIDGE-MIB # Produced by pysmi-0.3.4 at Wed May 1 14:05:57 2019 # On host DAVWANG4-M-1475 platform Darwin version 18.5.0 by user davwang4 # Using Python version 3.7.3 (default, Mar 27 2019, 09:23:15) # Integer, ObjectIdentifier, OctetString = mibBuilder.importSymbols("ASN1", "Integer", "ObjectIdentifier", "OctetString") NamedValues, = mibBuilder.importSymbols("ASN1-ENUMERATION", "NamedValues") SingleValueConstraint, ConstraintsIntersection, ConstraintsUnion, ValueRangeConstraint, ValueSizeConstraint = mibBuilder.importSymbols("ASN1-REFINEMENT", "SingleValueConstraint", "ConstraintsIntersection", "ConstraintsUnion", "ValueRangeConstraint", "ValueSizeConstraint") NotificationGroup, ModuleCompliance = mibBuilder.importSymbols("SNMPv2-CONF", "NotificationGroup", "ModuleCompliance") mgmt, MibScalar, MibTable, MibTableRow, MibTableColumn, MibIdentifier, enterprises, Integer32, ObjectIdentity, IpAddress, Unsigned32, Counter64, NotificationType, ModuleIdentity, iso, Bits, NotificationType, Counter32, Gauge32, TimeTicks = mibBuilder.importSymbols("SNMPv2-SMI", "mgmt", "MibScalar", "MibTable", "MibTableRow", "MibTableColumn", "MibIdentifier", "enterprises", "Integer32", "ObjectIdentity", "IpAddress", "Unsigned32", "Counter64", "NotificationType", "ModuleIdentity", "iso", "Bits", "NotificationType", "Counter32", "Gauge32", "TimeTicks") DisplayString, TextualConvention, PhysAddress = mibBuilder.importSymbols("SNMPv2-TC", "DisplayString", "TextualConvention", "PhysAddress") mib_2 = MibIdentifier((1, 3, 6, 1, 2, 1)).setLabel("mib-2") class DisplayString(OctetString): pass class PhysAddress(OctetString): pass a3Com = MibIdentifier((1, 3, 6, 1, 4, 1, 43)) products = MibIdentifier((1, 3, 6, 1, 4, 1, 43, 1)) terminalServer = MibIdentifier((1, 3, 6, 1, 4, 1, 43, 1, 1)) dedicatedBridgeServer = MibIdentifier((1, 3, 6, 1, 4, 1, 43, 1, 2)) dedicatedRouteServer = MibIdentifier((1, 3, 6, 1, 4, 1, 43, 1, 3)) brouter = MibIdentifier((1, 3, 6, 1, 4, 1, 43, 1, 4)) genericMSWorkstation = MibIdentifier((1, 3, 6, 1, 4, 1, 43, 1, 5)) genericMSServer = MibIdentifier((1, 3, 6, 1, 4, 1, 43, 1, 6)) genericUnixServer = MibIdentifier((1, 3, 6, 1, 4, 1, 43, 1, 7)) hub = MibIdentifier((1, 3, 6, 1, 4, 1, 43, 1, 8)) cards = MibIdentifier((1, 3, 6, 1, 4, 1, 43, 1, 9)) linkBuilder3GH = MibIdentifier((1, 3, 6, 1, 4, 1, 43, 1, 8, 1)) linkBuilder10BTi = MibIdentifier((1, 3, 6, 1, 4, 1, 43, 1, 8, 2)) linkBuilderECS = MibIdentifier((1, 3, 6, 1, 4, 1, 43, 1, 8, 3)) linkBuilderMSH = MibIdentifier((1, 3, 6, 1, 4, 1, 43, 1, 8, 4)) linkBuilderFMS = MibIdentifier((1, 3, 6, 1, 4, 1, 43, 1, 8, 5)) linkBuilderFMSII = MibIdentifier((1, 3, 6, 1, 4, 1, 43, 1, 8, 7)) linkBuilderFMSLBridge = MibIdentifier((1, 3, 6, 1, 4, 1, 43, 1, 8, 10)) linkBuilder3GH_cards = MibIdentifier((1, 3, 6, 1, 4, 1, 43, 1, 9, 1)).setLabel("linkBuilder3GH-cards") linkBuilder10BTi_cards = MibIdentifier((1, 3, 6, 1, 4, 1, 43, 1, 9, 2)).setLabel("linkBuilder10BTi-cards") linkBuilderECS_cards = MibIdentifier((1, 3, 6, 1, 4, 1, 43, 1, 9, 3)).setLabel("linkBuilderECS-cards") linkBuilderMSH_cards = MibIdentifier((1, 3, 6, 1, 4, 1, 43, 1, 9, 4)).setLabel("linkBuilderMSH-cards") linkBuilderFMS_cards = MibIdentifier((1, 3, 6, 1, 4, 1, 43, 1, 9, 5)).setLabel("linkBuilderFMS-cards") linkBuilderFMSII_cards = MibIdentifier((1, 3, 6, 1, 4, 1, 43, 1, 9, 6)).setLabel("linkBuilderFMSII-cards") linkBuilder10BTi_cards_utp = MibIdentifier((1, 3, 6, 1, 4, 1, 43, 1, 9, 2, 1)).setLabel("linkBuilder10BTi-cards-utp") linkBuilder10BT_cards_utp = MibIdentifier((1, 3, 6, 1, 4, 1, 43, 1, 9, 2, 2)).setLabel("linkBuilder10BT-cards-utp") linkBuilderFMS_cards_utp = MibIdentifier((1, 3, 6, 1, 4, 1, 43, 1, 9, 5, 1)).setLabel("linkBuilderFMS-cards-utp") linkBuilderFMS_cards_coax = MibIdentifier((1, 3, 6, 1, 4, 1, 43, 1, 9, 5, 2)).setLabel("linkBuilderFMS-cards-coax") linkBuilderFMS_cards_fiber = MibIdentifier((1, 3, 6, 1, 4, 1, 43, 1, 9, 5, 3)).setLabel("linkBuilderFMS-cards-fiber") linkBuilderFMS_cards_12fiber = MibIdentifier((1, 3, 6, 1, 4, 1, 43, 1, 9, 5, 4)).setLabel("linkBuilderFMS-cards-12fiber") linkBuilderFMS_cards_24utp = MibIdentifier((1, 3, 6, 1, 4, 1, 43, 1, 9, 5, 5)).setLabel("linkBuilderFMS-cards-24utp") linkBuilderFMSII_cards_12tp_rj45 = MibIdentifier((1, 3, 6, 1, 4, 1, 43, 1, 9, 6, 1)).setLabel("linkBuilderFMSII-cards-12tp-rj45") linkBuilderFMSII_cards_10coax_bnc = MibIdentifier((1, 3, 6, 1, 4, 1, 43, 1, 9, 6, 2)).setLabel("linkBuilderFMSII-cards-10coax-bnc") linkBuilderFMSII_cards_6fiber_st = MibIdentifier((1, 3, 6, 1, 4, 1, 43, 1, 9, 6, 3)).setLabel("linkBuilderFMSII-cards-6fiber-st") linkBuilderFMSII_cards_12fiber_st = MibIdentifier((1, 3, 6, 1, 4, 1, 43, 1, 9, 6, 4)).setLabel("linkBuilderFMSII-cards-12fiber-st") linkBuilderFMSII_cards_24tp_rj45 = MibIdentifier((1, 3, 6, 1, 4, 1, 43, 1, 9, 6, 5)).setLabel("linkBuilderFMSII-cards-24tp-rj45") linkBuilderFMSII_cards_24tp_telco = MibIdentifier((1, 3, 6, 1, 4, 1, 43, 1, 9, 6, 6)).setLabel("linkBuilderFMSII-cards-24tp-telco") amp_mib = MibIdentifier((1, 3, 6, 1, 4, 1, 43, 3)).setLabel("amp-mib") genericTrap = MibIdentifier((1, 3, 6, 1, 4, 1, 43, 4)) viewBuilderApps = MibIdentifier((1, 3, 6, 1, 4, 1, 43, 5)) specificTrap = MibIdentifier((1, 3, 6, 1, 4, 1, 43, 6)) linkBuilder3GH_mib = MibIdentifier((1, 3, 6, 1, 4, 1, 43, 7)).setLabel("linkBuilder3GH-mib") linkBuilder10BTi_mib = MibIdentifier((1, 3, 6, 1, 4, 1, 43, 8)).setLabel("linkBuilder10BTi-mib") linkBuilderECS_mib = MibIdentifier((1, 3, 6, 1, 4, 1, 43, 9)).setLabel("linkBuilderECS-mib") generic = MibIdentifier((1, 3, 6, 1, 4, 1, 43, 10)) genExperimental = MibIdentifier((1, 3, 6, 1, 4, 1, 43, 10, 1)) setup = MibIdentifier((1, 3, 6, 1, 4, 1, 43, 10, 2)) sysLoader = MibIdentifier((1, 3, 6, 1, 4, 1, 43, 10, 3)) security = MibIdentifier((1, 3, 6, 1, 4, 1, 43, 10, 4)) gauges = MibIdentifier((1, 3, 6, 1, 4, 1, 43, 10, 5)) asciiAgent = MibIdentifier((1, 3, 6, 1, 4, 1, 43, 10, 6)) serialIf = MibIdentifier((1, 3, 6, 1, 4, 1, 43, 10, 7)) repeaterMgmt = MibIdentifier((1, 3, 6, 1, 4, 1, 43, 10, 8)) endStation = MibIdentifier((1, 3, 6, 1, 4, 1, 43, 10, 9)) localSnmp = MibIdentifier((1, 3, 6, 1, 4, 1, 43, 10, 10)) manager = MibIdentifier((1, 3, 6, 1, 4, 1, 43, 10, 11)) unusedGeneric12 = MibIdentifier((1, 3, 6, 1, 4, 1, 43, 10, 12)) chassis = MibIdentifier((1, 3, 6, 1, 4, 1, 43, 10, 14)) mrmResilience = MibIdentifier((1, 3, 6, 1, 4, 1, 43, 10, 15)) tokenRing = MibIdentifier((1, 3, 6, 1, 4, 1, 43, 10, 16)) multiRepeater = MibIdentifier((1, 3, 6, 1, 4, 1, 43, 10, 17)) bridgeMgmt = MibIdentifier((1, 3, 6, 1, 4, 1, 43, 10, 18)) fault = MibIdentifier((1, 3, 6, 1, 4, 1, 43, 10, 19)) poll = MibIdentifier((1, 3, 6, 1, 4, 1, 43, 10, 20)) powerSupply = MibIdentifier((1, 3, 6, 1, 4, 1, 43, 10, 21)) testData = MibIdentifier((1, 3, 6, 1, 4, 1, 43, 10, 1, 1)) ifExtensions = MibIdentifier((1, 3, 6, 1, 4, 1, 43, 10, 1, 2)) netBuilder_mib = MibIdentifier((1, 3, 6, 1, 4, 1, 43, 11)).setLabel("netBuilder-mib") lBridgeECS_mib = MibIdentifier((1, 3, 6, 1, 4, 1, 43, 12)).setLabel("lBridgeECS-mib") deskMan_mib = MibIdentifier((1, 3, 6, 1, 4, 1, 43, 13)).setLabel("deskMan-mib") linkBuilderMSH_mib = MibIdentifier((1, 3, 6, 1, 4, 1, 43, 14)).setLabel("linkBuilderMSH-mib") brControlPackage = MibIdentifier((1, 3, 6, 1, 4, 1, 43, 10, 18, 1)) brMonitorPackage = MibIdentifier((1, 3, 6, 1, 4, 1, 43, 10, 18, 2)) brDialoguePackage = MibIdentifier((1, 3, 6, 1, 4, 1, 43, 10, 18, 3)) brClearCounters = MibScalar((1, 3, 6, 1, 4, 1, 43, 10, 18, 1, 1), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2))).clone(namedValues=NamedValues(("no-action", 1), ("clear", 2)))).setMaxAccess("readwrite") if mibBuilder.loadTexts: brClearCounters.setStatus('mandatory') if mibBuilder.loadTexts: brClearCounters.setDescription('Clears all the counters associated with the bridgeing function for all bridge ports. A read will always return a value of no-action(1), a write of no-action(1) will have no effect, while a write of clear(2) will clear all the counters.') brSTAPMode = MibScalar((1, 3, 6, 1, 4, 1, 43, 10, 18, 1, 2), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2))).clone(namedValues=NamedValues(("off", 1), ("on", 2)))).setMaxAccess("readwrite") if mibBuilder.loadTexts: brSTAPMode.setStatus('mandatory') if mibBuilder.loadTexts: brSTAPMode.setDescription('Determines whether the STAP algorithm is on or off. If STAP mode is on then brForwardingMode may not be set to transparent. Conversley if brForwardingMode is set to transparent then brSTAPMode may not be set to on.') brLearnMode = MibScalar((1, 3, 6, 1, 4, 1, 43, 10, 18, 1, 3), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2))).clone(namedValues=NamedValues(("off", 1), ("on", 2)))).setMaxAccess("readwrite") if mibBuilder.loadTexts: brLearnMode.setStatus('mandatory') if mibBuilder.loadTexts: brLearnMode.setDescription('Determines whether the bridge is not learning addresses (off), or learning addresses as permanent, deleteOnReset or deleteOnTimeout.') brAgingMode = MibScalar((1, 3, 6, 1, 4, 1, 43, 10, 18, 1, 7), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2))).clone(namedValues=NamedValues(("on", 1), ("off", 2)))).setMaxAccess("readwrite") if mibBuilder.loadTexts: brAgingMode.setStatus('mandatory') if mibBuilder.loadTexts: brAgingMode.setDescription('Determines whether the bridge will age out entries in its filtering database or not.') brMonPortTable = MibTable((1, 3, 6, 1, 4, 1, 43, 10, 18, 2, 1), ) if mibBuilder.loadTexts: brMonPortTable.setStatus('mandatory') if mibBuilder.loadTexts: brMonPortTable.setDescription('A table that contains generic information about every port that is associated with this bridge.') brMonPortEntry = MibTableRow((1, 3, 6, 1, 4, 1, 43, 10, 18, 2, 1, 1), ).setIndexNames((0, "LBHUB-BRIDGE-MIB", "brMonPort")) if mibBuilder.loadTexts: brMonPortEntry.setStatus('mandatory') if mibBuilder.loadTexts: brMonPortEntry.setDescription('A list of information for each port of the bridge.') brMonPort = MibTableColumn((1, 3, 6, 1, 4, 1, 43, 10, 18, 2, 1, 1, 1), Integer32()).setMaxAccess("readonly") if mibBuilder.loadTexts: brMonPort.setStatus('mandatory') if mibBuilder.loadTexts: brMonPort.setDescription('The port number of the port for which this entry contains bridge management information.') brMonPortIfIndex = MibTableColumn((1, 3, 6, 1, 4, 1, 43, 10, 18, 2, 1, 1, 2), Integer32()).setMaxAccess("readonly") if mibBuilder.loadTexts: brMonPortIfIndex.setStatus('mandatory') if mibBuilder.loadTexts: brMonPortIfIndex.setDescription('The value of the instance of the ifIndex object, defined in [4,6], for the interface corresponding to this port.') brMonPortPercentTrafficForwarded = MibTableColumn((1, 3, 6, 1, 4, 1, 43, 10, 18, 2, 1, 1, 3), Integer32()).setMaxAccess("readonly") if mibBuilder.loadTexts: brMonPortPercentTrafficForwarded.setStatus('mandatory') if mibBuilder.loadTexts: brMonPortPercentTrafficForwarded.setDescription("This is a high level 'smart MIB' object. This object provides a running average of the proportion of the received frames that are forwarded. This value is calculated locally on the agent and so does not require processor bandwidth from the management station or occupy valuable network bandwidth communicating with that station. By default an agent supporting this parameter will exhibit the following characteristics:- (1) The parameter will be recalculated at approx 60 second intervals (2) Every calculation period the device will read the value of dot1dTpPortInFrames and dot1dTpPortInDiscards. (3) The calculation will be performed on the most recent 4 samples as follows: 4 Sum(dot1dTpPortInDiscards(i)/dot1dTpPortInFrames(i)) * 1000/4 i=1 Which gives the percentage * 10 filtered, and then subtracting this from 1000 to give percentage * 10 forwarded. dot1dTpPortInDiscards(i) is dot1dTpPortInDiscards(i) - dot1dTpPortInDiscards(i-1). dot1dTpPortInFrames(i) is dot1dTpPortInFrames(i) - dot1dTpPortInFrames(i-1). The value is expressed as a percentage * 10. A default threshold exists on this average so that if a calculated average exceeds 85% a trap will be sent to the management station. Further traps will not be sent until the average drops to below 50%. A particular device may provide a means of changing the number of samples, the averaging period, threshold and threshold action if it so wishes.") brMonPortBandwidthUsed = MibTableColumn((1, 3, 6, 1, 4, 1, 43, 10, 18, 2, 1, 1, 4), Integer32()).setMaxAccess("readonly") if mibBuilder.loadTexts: brMonPortBandwidthUsed.setStatus('mandatory') if mibBuilder.loadTexts: brMonPortBandwidthUsed.setDescription("This is a high level 'smart MIB' object. This object provides a running average of the bandwidth in use. This value is calculated locally on the agent and so does not require processor bandwidth from the management station or occupy valuable network bandwidth communicating with that station. By default an agent supporting this parameter will exhibit the following characteristics: (1) The parameter will be recalculated at approx 60 second intervals (2) Every calculation period the device will read the value of ifInOctets plus ifOutOctets. (3) The calculation will be performed on the most recent 4 samples as follows: 4 Sum(sample(i)/(time(i) * K)) * 1000/4 i=1 Sample(i) is (ifInOctets(i)+ifOutOctets(i))-(ifInOctets(i-1)+ifOutOctets(i-1)) time(i) is the time between sample(i-1) and sample(i) K is the max bytes per unit time (i.e. the available bandwidth) The value is expressed as a percentage * 10. A default threshold exists on this average so that if a calculated average exceeds 50% a trap will be sent to the management station. Further traps will not be sent until the average drops to below 30%. A particular device may provide a means of changing the number of samples, the averaging period, threshold and threshold action if it so wishes.") brMonPortErrorsPer10000Packets = MibTableColumn((1, 3, 6, 1, 4, 1, 43, 10, 18, 2, 1, 1, 5), Integer32()).setMaxAccess("readonly") if mibBuilder.loadTexts: brMonPortErrorsPer10000Packets.setStatus('mandatory') if mibBuilder.loadTexts: brMonPortErrorsPer10000Packets.setDescription("This is a high level 'smart MIB' object. This object provides a running average of the number of errors per 10000 packets. The value of this value is calculated locally on the agent and so does not require processor bandwidth from a management station or occupy valuable network bandwidth communicating with that station. By default an agent supporting this parameter will exhibit the following behaviour: (1) The parameter will be recalculated at approx 60 second intervals. (2) Every calculation period the device will read the value of portTotalErrors and dot1dTpPortInFrames. (3) The calculation will be performed on the most recent 4 samples as follows: 4 10000 * Sum(Errors(i)/Frames(i)) i=1 Errors(i) = portTotalErrors(i)-portTotalErrors(i-1) Frames(i) = dot1dTpPortInFrames(i)-dot1dTpPortInFrames(i-1) The value is an integer number of errors per 10,000 packets received by this port. A default threshold exists on this average so that if a calculated average exceeds 200 (i.e. 2% of frames are in error) a trap will be sent to the management station. Further traps will not be sent until the average drops to below 100 (i.e. 1% of frames are in error). A particular device may provide a means of changing the number of samples, the averaging period and threshold if it so wishes.") brMonPortBroadcastBandwidth = MibTableColumn((1, 3, 6, 1, 4, 1, 43, 10, 18, 2, 1, 1, 6), Integer32()).setMaxAccess("readonly") if mibBuilder.loadTexts: brMonPortBroadcastBandwidth.setStatus('mandatory') if mibBuilder.loadTexts: brMonPortBroadcastBandwidth.setDescription("This is a high level 'smart MIB' object. This object provides a running average of the Broadcast frame bandwidth in use. This value is calculated locally on the agent and so does not require processor bandwidth from the management station or occupy valuable network bandwidth communicating with that station. By default an agent supporting this parameter will exhibit the following characteristics: (1) The parameter will be recalculated at approx 20 second intervals (2) Every calculation period the device will read the value of ifExtnsBroadcastsReceivedOks and ifExtnsBroadcastsTransmittedOks. (3) The calculation will be performed on the most recent 4 samples as follows: 4 Sum(sample(i)/(time(i) * K)) * 1000/4 i=1 Sample(i) is (ifExtnsBroadcastsReceivedOks(i)+ifExtnsBroadcastsTransmittedOks(i))- (ifExtnsBroadcastsReceivedOks(i-1)+ifExtnsBroadcastsTransmittedOks(i-1)). time(i) is the time between sample(i-1) and sample(i) K is the max frames per unit time (i.e. the available bandwidth) The value is expressed as a percentage * 10. A default threshold exists on this average so that if a calculated average exceeds 20% a trap will be sent to the management station. Further traps will not be sent until the average drops to below 10%. A particular device may provide a means of changing the number of samples, the averaging period, threshold and threshold action if it so wishes.") brDataBase = MibIdentifier((1, 3, 6, 1, 4, 1, 43, 10, 18, 4)) brDummyPackage = MibIdentifier((1, 3, 6, 1, 4, 1, 43, 10, 18, 5)) brSizeOfFilteringDataBase = MibScalar((1, 3, 6, 1, 4, 1, 43, 10, 18, 4, 1), Integer32()).setMaxAccess("readonly") if mibBuilder.loadTexts: brSizeOfFilteringDataBase.setStatus('mandatory') if mibBuilder.loadTexts: brSizeOfFilteringDataBase.setDescription('The maximum possible number of Filtering database entries.') brPercentageOfNonageingFDBEntries = MibScalar((1, 3, 6, 1, 4, 1, 43, 10, 18, 4, 2), Integer32()).setMaxAccess("readonly") if mibBuilder.loadTexts: brPercentageOfNonageingFDBEntries.setStatus('mandatory') if mibBuilder.loadTexts: brPercentageOfNonageingFDBEntries.setDescription('The number of entries currently in the filtering database that cannot be aged out, and are not in the permanent database. This is expressed as a percentage * 10 of the size of the filtering database :- ((number of non ageing entries)*1000)/(filtering db size).') brPercentageOfAgeingFDBEntries = MibScalar((1, 3, 6, 1, 4, 1, 43, 10, 18, 4, 3), Integer32()).setMaxAccess("readonly") if mibBuilder.loadTexts: brPercentageOfAgeingFDBEntries.setStatus('mandatory') if mibBuilder.loadTexts: brPercentageOfAgeingFDBEntries.setDescription('The number of entries currently in the filtering database that can be aged out, and not held in the permanent database. This is expressed as a percentage * 10 of the size of the filtering database :- ((number of ageing entries)*1000)/(filtering db size).') brPercentageOfPermanentFDBEntries = MibScalar((1, 3, 6, 1, 4, 1, 43, 10, 18, 4, 4), Integer32()).setMaxAccess("readonly") if mibBuilder.loadTexts: brPercentageOfPermanentFDBEntries.setStatus('mandatory') if mibBuilder.loadTexts: brPercentageOfPermanentFDBEntries.setDescription('The number of permanent entries currently in the filtering database. This is expressed as a percentage * 10 of the size of the filtering database :- ((number of permanent entries)*1000)/(filtering db size).') brClearFilteringDataBase = MibScalar((1, 3, 6, 1, 4, 1, 43, 10, 18, 4, 5), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2))).clone(namedValues=NamedValues(("noAction", 1), ("clear", 2)))).setMaxAccess("readwrite") if mibBuilder.loadTexts: brClearFilteringDataBase.setStatus('mandatory') if mibBuilder.loadTexts: brClearFilteringDataBase.setDescription('An attribute to clear all entries in the filtering database except for those which are permanent.') brMaxNumberOfPermanentEntries = MibScalar((1, 3, 6, 1, 4, 1, 43, 10, 18, 4, 6), Integer32()).setMaxAccess("readonly") if mibBuilder.loadTexts: brMaxNumberOfPermanentEntries.setStatus('mandatory') if mibBuilder.loadTexts: brMaxNumberOfPermanentEntries.setDescription('The maximum number of entries in the filtering database that can be permanent.') brPercentageOfPermanentDatabaseUsed = MibScalar((1, 3, 6, 1, 4, 1, 43, 10, 18, 4, 7), Integer32()).setMaxAccess("readonly") if mibBuilder.loadTexts: brPercentageOfPermanentDatabaseUsed.setStatus('mandatory') if mibBuilder.loadTexts: brPercentageOfPermanentDatabaseUsed.setDescription('The number of permanent entries in the filtering database. This is expressed as a percentage * 10 of the size of the permanent database :- ((number of permanent entries)*1000)/(permanent db size).') brClearPermanentEntries = MibScalar((1, 3, 6, 1, 4, 1, 43, 10, 18, 4, 8), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2))).clone(namedValues=NamedValues(("noAction", 1), ("clear", 2)))).setMaxAccess("readwrite") if mibBuilder.loadTexts: brClearPermanentEntries.setStatus('mandatory') if mibBuilder.loadTexts: brClearPermanentEntries.setDescription('An attribute to clear the permanent entries from the filtering database.') brSaveLearntAddresses = MibScalar((1, 3, 6, 1, 4, 1, 43, 10, 18, 4, 9), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2))).clone(namedValues=NamedValues(("noAction", 1), ("save", 2)))).setMaxAccess("readwrite") if mibBuilder.loadTexts: brSaveLearntAddresses.setStatus('mandatory') if mibBuilder.loadTexts: brSaveLearntAddresses.setDescription('An attribute to make the learnt addresses held in the filtering database become permanent entries.') brDatabaseModified = MibScalar((1, 3, 6, 1, 4, 1, 43, 10, 18, 4, 11), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2))).clone(namedValues=NamedValues(("noChange", 1), ("modified", 2)))).setMaxAccess("readwrite") if mibBuilder.loadTexts: brDatabaseModified.setStatus('mandatory') if mibBuilder.loadTexts: brDatabaseModified.setDescription('This flag is used to indicate to a management application that the database (Forwarding or Static views) has altered while a manager is viewing it. The normal value of this parameter is noChange(1), it will remain at this value untill the database is modified by either:- - a manager mofifying the DB through the Static Table - the relay causing an entry to be inserted into the DB - the ageing process causing an entry to be deleted from the DB when it will be set to modified(2), where it will remain untill reset to noChange(1) by a manager.') brDatabaseType = MibScalar((1, 3, 6, 1, 4, 1, 43, 10, 18, 5, 1), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2))).clone(namedValues=NamedValues(("filtering", 1), ("permanent", 2)))).setMaxAccess("readonly") if mibBuilder.loadTexts: brDatabaseType.setStatus('mandatory') if mibBuilder.loadTexts: brDatabaseType.setDescription('This dummy object enables the database full trap to differentiate between the filtering database and the permanent database.') brDatabaseLevel = MibScalar((1, 3, 6, 1, 4, 1, 43, 10, 18, 5, 2), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(90, 100))).clone(namedValues=NamedValues(("ninetyPercent", 90), ("oneHundredPercent", 100)))).setMaxAccess("readonly") if mibBuilder.loadTexts: brDatabaseLevel.setStatus('mandatory') if mibBuilder.loadTexts: brDatabaseLevel.setDescription('This dummy object enables the database full trap to differentiate between the database being 90% and 100% full.') brTrafficForwarded = MibScalar((1, 3, 6, 1, 4, 1, 43, 10, 18, 5, 3), Counter32()).setMaxAccess("readonly") if mibBuilder.loadTexts: brTrafficForwarded.setStatus('mandatory') if mibBuilder.loadTexts: brTrafficForwarded.setDescription('This dummy object is used internally to calculate a running average of the percentage of traffic forwarded on a port. It should not be accessed by a management station.') brPortBandwidth = MibScalar((1, 3, 6, 1, 4, 1, 43, 10, 18, 5, 4), Counter32()).setMaxAccess("readonly") if mibBuilder.loadTexts: brPortBandwidth.setStatus('mandatory') if mibBuilder.loadTexts: brPortBandwidth.setDescription('This dummy object is used internally to calculate a running average of the port bandwidth in use. It should not be accessed by a management station.') brPortBroadcastBandwidth = MibScalar((1, 3, 6, 1, 4, 1, 43, 10, 18, 5, 5), Counter32()).setMaxAccess("readonly") if mibBuilder.loadTexts: brPortBroadcastBandwidth.setStatus('mandatory') if mibBuilder.loadTexts: brPortBroadcastBandwidth.setDescription('This dummy object is used internally to calculate a running average of the port bandwidth in use. It should not be accessed by a management station.') brPortErrors = MibScalar((1, 3, 6, 1, 4, 1, 43, 10, 18, 5, 6), Counter32()).setMaxAccess("readonly") if mibBuilder.loadTexts: brPortErrors.setStatus('mandatory') if mibBuilder.loadTexts: brPortErrors.setDescription('This dummy object is used internally to calculate a running average of the errors per 10000 frames on a port. It should not be accessed by a management station.') brDatabaseFull = NotificationType((1, 3, 6, 1, 4, 1, 43) + (0,65)).setObjects(("LBHUB-BRIDGE-MIB", "brDatabaseType"), ("LBHUB-BRIDGE-MIB", "brDatabaseLevel")) if mibBuilder.loadTexts: brDatabaseFull.setDescription('This trap indicates that either the Filtering databse or the permanent database has become full. If the database occupancy exceeds 90% this trap will be sent also. The variable bindings enable the trap to be identified as refering to the filtering or permanet database, and to differentiate between 90% or 100% full.') class BridgeId(OctetString): subtypeSpec = OctetString.subtypeSpec + ValueSizeConstraint(8, 8) fixedLength = 8 class MacAddress(OctetString): subtypeSpec = OctetString.subtypeSpec + ValueSizeConstraint(6, 6) fixedLength = 6 mibBuilder.exportSymbols("LBHUB-BRIDGE-MIB", brClearCounters=brClearCounters, endStation=endStation, linkBuilderFMS=linkBuilderFMS, linkBuilder10BTi_mib=linkBuilder10BTi_mib, brDatabaseModified=brDatabaseModified, linkBuilderFMSII_cards_6fiber_st=linkBuilderFMSII_cards_6fiber_st, brPercentageOfPermanentFDBEntries=brPercentageOfPermanentFDBEntries, dedicatedRouteServer=dedicatedRouteServer, linkBuilder10BT_cards_utp=linkBuilder10BT_cards_utp, multiRepeater=multiRepeater, ifExtensions=ifExtensions, brPercentageOfNonageingFDBEntries=brPercentageOfNonageingFDBEntries, linkBuilderFMSII_cards=linkBuilderFMSII_cards, genericUnixServer=genericUnixServer, security=security, linkBuilder3GH=linkBuilder3GH, linkBuilderFMSII_cards_24tp_rj45=linkBuilderFMSII_cards_24tp_rj45, brPortBroadcastBandwidth=brPortBroadcastBandwidth, linkBuilder10BTi_cards=linkBuilder10BTi_cards, MacAddress=MacAddress, linkBuilderFMS_cards_12fiber=linkBuilderFMS_cards_12fiber, brMonPort=brMonPort, generic=generic, brDatabaseType=brDatabaseType, BridgeId=BridgeId, linkBuilderFMS_cards_24utp=linkBuilderFMS_cards_24utp, sysLoader=sysLoader, deskMan_mib=deskMan_mib, linkBuilderFMSII=linkBuilderFMSII, viewBuilderApps=viewBuilderApps, bridgeMgmt=bridgeMgmt, brMonPortBroadcastBandwidth=brMonPortBroadcastBandwidth, products=products, hub=hub, fault=fault, localSnmp=localSnmp, a3Com=a3Com, setup=setup, lBridgeECS_mib=lBridgeECS_mib, linkBuilderFMS_cards_fiber=linkBuilderFMS_cards_fiber, brSTAPMode=brSTAPMode, brouter=brouter, brClearFilteringDataBase=brClearFilteringDataBase, brSaveLearntAddresses=brSaveLearntAddresses, repeaterMgmt=repeaterMgmt, genExperimental=genExperimental, linkBuilderFMSII_cards_12tp_rj45=linkBuilderFMSII_cards_12tp_rj45, brControlPackage=brControlPackage, linkBuilderFMS_cards_utp=linkBuilderFMS_cards_utp, brMaxNumberOfPermanentEntries=brMaxNumberOfPermanentEntries, dedicatedBridgeServer=dedicatedBridgeServer, genericTrap=genericTrap, brMonPortTable=brMonPortTable, brMonPortErrorsPer10000Packets=brMonPortErrorsPer10000Packets, brAgingMode=brAgingMode, brDialoguePackage=brDialoguePackage, linkBuilder3GH_cards=linkBuilder3GH_cards, linkBuilderMSH_cards=linkBuilderMSH_cards, manager=manager, brTrafficForwarded=brTrafficForwarded, linkBuilderFMSII_cards_10coax_bnc=linkBuilderFMSII_cards_10coax_bnc, netBuilder_mib=netBuilder_mib, powerSupply=powerSupply, brLearnMode=brLearnMode, brMonitorPackage=brMonitorPackage, cards=cards, linkBuilderMSH=linkBuilderMSH, linkBuilder3GH_mib=linkBuilder3GH_mib, asciiAgent=asciiAgent, brMonPortIfIndex=brMonPortIfIndex, linkBuilderFMS_cards=linkBuilderFMS_cards, PhysAddress=PhysAddress, unusedGeneric12=unusedGeneric12, linkBuilder10BTi_cards_utp=linkBuilder10BTi_cards_utp, linkBuilderFMS_cards_coax=linkBuilderFMS_cards_coax, linkBuilder10BTi=linkBuilder10BTi, poll=poll, brDatabaseLevel=brDatabaseLevel, brMonPortPercentTrafficForwarded=brMonPortPercentTrafficForwarded, DisplayString=DisplayString, amp_mib=amp_mib, linkBuilderMSH_mib=linkBuilderMSH_mib, linkBuilderFMSLBridge=linkBuilderFMSLBridge, brPortErrors=brPortErrors, brClearPermanentEntries=brClearPermanentEntries, brDummyPackage=brDummyPackage, serialIf=serialIf, brMonPortBandwidthUsed=brMonPortBandwidthUsed, specificTrap=specificTrap, linkBuilderECS_cards=linkBuilderECS_cards, testData=testData, mrmResilience=mrmResilience, linkBuilderECS=linkBuilderECS, gauges=gauges, chassis=chassis, brMonPortEntry=brMonPortEntry, brPortBandwidth=brPortBandwidth, brDataBase=brDataBase, brPercentageOfPermanentDatabaseUsed=brPercentageOfPermanentDatabaseUsed, brPercentageOfAgeingFDBEntries=brPercentageOfAgeingFDBEntries, linkBuilderFMSII_cards_12fiber_st=linkBuilderFMSII_cards_12fiber_st, linkBuilderECS_mib=linkBuilderECS_mib, terminalServer=terminalServer, brDatabaseFull=brDatabaseFull, genericMSWorkstation=genericMSWorkstation, genericMSServer=genericMSServer, tokenRing=tokenRing, brSizeOfFilteringDataBase=brSizeOfFilteringDataBase, linkBuilderFMSII_cards_24tp_telco=linkBuilderFMSII_cards_24tp_telco, mib_2=mib_2)
(integer, object_identifier, octet_string) = mibBuilder.importSymbols('ASN1', 'Integer', 'ObjectIdentifier', 'OctetString') (named_values,) = mibBuilder.importSymbols('ASN1-ENUMERATION', 'NamedValues') (single_value_constraint, constraints_intersection, constraints_union, value_range_constraint, value_size_constraint) = mibBuilder.importSymbols('ASN1-REFINEMENT', 'SingleValueConstraint', 'ConstraintsIntersection', 'ConstraintsUnion', 'ValueRangeConstraint', 'ValueSizeConstraint') (notification_group, module_compliance) = mibBuilder.importSymbols('SNMPv2-CONF', 'NotificationGroup', 'ModuleCompliance') (mgmt, mib_scalar, mib_table, mib_table_row, mib_table_column, mib_identifier, enterprises, integer32, object_identity, ip_address, unsigned32, counter64, notification_type, module_identity, iso, bits, notification_type, counter32, gauge32, time_ticks) = mibBuilder.importSymbols('SNMPv2-SMI', 'mgmt', 'MibScalar', 'MibTable', 'MibTableRow', 'MibTableColumn', 'MibIdentifier', 'enterprises', 'Integer32', 'ObjectIdentity', 'IpAddress', 'Unsigned32', 'Counter64', 'NotificationType', 'ModuleIdentity', 'iso', 'Bits', 'NotificationType', 'Counter32', 'Gauge32', 'TimeTicks') (display_string, textual_convention, phys_address) = mibBuilder.importSymbols('SNMPv2-TC', 'DisplayString', 'TextualConvention', 'PhysAddress') mib_2 = mib_identifier((1, 3, 6, 1, 2, 1)).setLabel('mib-2') class Displaystring(OctetString): pass class Physaddress(OctetString): pass a3_com = mib_identifier((1, 3, 6, 1, 4, 1, 43)) products = mib_identifier((1, 3, 6, 1, 4, 1, 43, 1)) terminal_server = mib_identifier((1, 3, 6, 1, 4, 1, 43, 1, 1)) dedicated_bridge_server = mib_identifier((1, 3, 6, 1, 4, 1, 43, 1, 2)) dedicated_route_server = mib_identifier((1, 3, 6, 1, 4, 1, 43, 1, 3)) brouter = mib_identifier((1, 3, 6, 1, 4, 1, 43, 1, 4)) generic_ms_workstation = mib_identifier((1, 3, 6, 1, 4, 1, 43, 1, 5)) generic_ms_server = mib_identifier((1, 3, 6, 1, 4, 1, 43, 1, 6)) generic_unix_server = mib_identifier((1, 3, 6, 1, 4, 1, 43, 1, 7)) hub = mib_identifier((1, 3, 6, 1, 4, 1, 43, 1, 8)) cards = mib_identifier((1, 3, 6, 1, 4, 1, 43, 1, 9)) link_builder3_gh = mib_identifier((1, 3, 6, 1, 4, 1, 43, 1, 8, 1)) link_builder10_b_ti = mib_identifier((1, 3, 6, 1, 4, 1, 43, 1, 8, 2)) link_builder_ecs = mib_identifier((1, 3, 6, 1, 4, 1, 43, 1, 8, 3)) link_builder_msh = mib_identifier((1, 3, 6, 1, 4, 1, 43, 1, 8, 4)) link_builder_fms = mib_identifier((1, 3, 6, 1, 4, 1, 43, 1, 8, 5)) link_builder_fmsii = mib_identifier((1, 3, 6, 1, 4, 1, 43, 1, 8, 7)) link_builder_fmsl_bridge = mib_identifier((1, 3, 6, 1, 4, 1, 43, 1, 8, 10)) link_builder3_gh_cards = mib_identifier((1, 3, 6, 1, 4, 1, 43, 1, 9, 1)).setLabel('linkBuilder3GH-cards') link_builder10_b_ti_cards = mib_identifier((1, 3, 6, 1, 4, 1, 43, 1, 9, 2)).setLabel('linkBuilder10BTi-cards') link_builder_ecs_cards = mib_identifier((1, 3, 6, 1, 4, 1, 43, 1, 9, 3)).setLabel('linkBuilderECS-cards') link_builder_msh_cards = mib_identifier((1, 3, 6, 1, 4, 1, 43, 1, 9, 4)).setLabel('linkBuilderMSH-cards') link_builder_fms_cards = mib_identifier((1, 3, 6, 1, 4, 1, 43, 1, 9, 5)).setLabel('linkBuilderFMS-cards') link_builder_fmsii_cards = mib_identifier((1, 3, 6, 1, 4, 1, 43, 1, 9, 6)).setLabel('linkBuilderFMSII-cards') link_builder10_b_ti_cards_utp = mib_identifier((1, 3, 6, 1, 4, 1, 43, 1, 9, 2, 1)).setLabel('linkBuilder10BTi-cards-utp') link_builder10_bt_cards_utp = mib_identifier((1, 3, 6, 1, 4, 1, 43, 1, 9, 2, 2)).setLabel('linkBuilder10BT-cards-utp') link_builder_fms_cards_utp = mib_identifier((1, 3, 6, 1, 4, 1, 43, 1, 9, 5, 1)).setLabel('linkBuilderFMS-cards-utp') link_builder_fms_cards_coax = mib_identifier((1, 3, 6, 1, 4, 1, 43, 1, 9, 5, 2)).setLabel('linkBuilderFMS-cards-coax') link_builder_fms_cards_fiber = mib_identifier((1, 3, 6, 1, 4, 1, 43, 1, 9, 5, 3)).setLabel('linkBuilderFMS-cards-fiber') link_builder_fms_cards_12fiber = mib_identifier((1, 3, 6, 1, 4, 1, 43, 1, 9, 5, 4)).setLabel('linkBuilderFMS-cards-12fiber') link_builder_fms_cards_24utp = mib_identifier((1, 3, 6, 1, 4, 1, 43, 1, 9, 5, 5)).setLabel('linkBuilderFMS-cards-24utp') link_builder_fmsii_cards_12tp_rj45 = mib_identifier((1, 3, 6, 1, 4, 1, 43, 1, 9, 6, 1)).setLabel('linkBuilderFMSII-cards-12tp-rj45') link_builder_fmsii_cards_10coax_bnc = mib_identifier((1, 3, 6, 1, 4, 1, 43, 1, 9, 6, 2)).setLabel('linkBuilderFMSII-cards-10coax-bnc') link_builder_fmsii_cards_6fiber_st = mib_identifier((1, 3, 6, 1, 4, 1, 43, 1, 9, 6, 3)).setLabel('linkBuilderFMSII-cards-6fiber-st') link_builder_fmsii_cards_12fiber_st = mib_identifier((1, 3, 6, 1, 4, 1, 43, 1, 9, 6, 4)).setLabel('linkBuilderFMSII-cards-12fiber-st') link_builder_fmsii_cards_24tp_rj45 = mib_identifier((1, 3, 6, 1, 4, 1, 43, 1, 9, 6, 5)).setLabel('linkBuilderFMSII-cards-24tp-rj45') link_builder_fmsii_cards_24tp_telco = mib_identifier((1, 3, 6, 1, 4, 1, 43, 1, 9, 6, 6)).setLabel('linkBuilderFMSII-cards-24tp-telco') amp_mib = mib_identifier((1, 3, 6, 1, 4, 1, 43, 3)).setLabel('amp-mib') generic_trap = mib_identifier((1, 3, 6, 1, 4, 1, 43, 4)) view_builder_apps = mib_identifier((1, 3, 6, 1, 4, 1, 43, 5)) specific_trap = mib_identifier((1, 3, 6, 1, 4, 1, 43, 6)) link_builder3_gh_mib = mib_identifier((1, 3, 6, 1, 4, 1, 43, 7)).setLabel('linkBuilder3GH-mib') link_builder10_b_ti_mib = mib_identifier((1, 3, 6, 1, 4, 1, 43, 8)).setLabel('linkBuilder10BTi-mib') link_builder_ecs_mib = mib_identifier((1, 3, 6, 1, 4, 1, 43, 9)).setLabel('linkBuilderECS-mib') generic = mib_identifier((1, 3, 6, 1, 4, 1, 43, 10)) gen_experimental = mib_identifier((1, 3, 6, 1, 4, 1, 43, 10, 1)) setup = mib_identifier((1, 3, 6, 1, 4, 1, 43, 10, 2)) sys_loader = mib_identifier((1, 3, 6, 1, 4, 1, 43, 10, 3)) security = mib_identifier((1, 3, 6, 1, 4, 1, 43, 10, 4)) gauges = mib_identifier((1, 3, 6, 1, 4, 1, 43, 10, 5)) ascii_agent = mib_identifier((1, 3, 6, 1, 4, 1, 43, 10, 6)) serial_if = mib_identifier((1, 3, 6, 1, 4, 1, 43, 10, 7)) repeater_mgmt = mib_identifier((1, 3, 6, 1, 4, 1, 43, 10, 8)) end_station = mib_identifier((1, 3, 6, 1, 4, 1, 43, 10, 9)) local_snmp = mib_identifier((1, 3, 6, 1, 4, 1, 43, 10, 10)) manager = mib_identifier((1, 3, 6, 1, 4, 1, 43, 10, 11)) unused_generic12 = mib_identifier((1, 3, 6, 1, 4, 1, 43, 10, 12)) chassis = mib_identifier((1, 3, 6, 1, 4, 1, 43, 10, 14)) mrm_resilience = mib_identifier((1, 3, 6, 1, 4, 1, 43, 10, 15)) token_ring = mib_identifier((1, 3, 6, 1, 4, 1, 43, 10, 16)) multi_repeater = mib_identifier((1, 3, 6, 1, 4, 1, 43, 10, 17)) bridge_mgmt = mib_identifier((1, 3, 6, 1, 4, 1, 43, 10, 18)) fault = mib_identifier((1, 3, 6, 1, 4, 1, 43, 10, 19)) poll = mib_identifier((1, 3, 6, 1, 4, 1, 43, 10, 20)) power_supply = mib_identifier((1, 3, 6, 1, 4, 1, 43, 10, 21)) test_data = mib_identifier((1, 3, 6, 1, 4, 1, 43, 10, 1, 1)) if_extensions = mib_identifier((1, 3, 6, 1, 4, 1, 43, 10, 1, 2)) net_builder_mib = mib_identifier((1, 3, 6, 1, 4, 1, 43, 11)).setLabel('netBuilder-mib') l_bridge_ecs_mib = mib_identifier((1, 3, 6, 1, 4, 1, 43, 12)).setLabel('lBridgeECS-mib') desk_man_mib = mib_identifier((1, 3, 6, 1, 4, 1, 43, 13)).setLabel('deskMan-mib') link_builder_msh_mib = mib_identifier((1, 3, 6, 1, 4, 1, 43, 14)).setLabel('linkBuilderMSH-mib') br_control_package = mib_identifier((1, 3, 6, 1, 4, 1, 43, 10, 18, 1)) br_monitor_package = mib_identifier((1, 3, 6, 1, 4, 1, 43, 10, 18, 2)) br_dialogue_package = mib_identifier((1, 3, 6, 1, 4, 1, 43, 10, 18, 3)) br_clear_counters = mib_scalar((1, 3, 6, 1, 4, 1, 43, 10, 18, 1, 1), integer32().subtype(subtypeSpec=constraints_union(single_value_constraint(1, 2))).clone(namedValues=named_values(('no-action', 1), ('clear', 2)))).setMaxAccess('readwrite') if mibBuilder.loadTexts: brClearCounters.setStatus('mandatory') if mibBuilder.loadTexts: brClearCounters.setDescription('Clears all the counters associated with the bridgeing function for all bridge ports. A read will always return a value of no-action(1), a write of no-action(1) will have no effect, while a write of clear(2) will clear all the counters.') br_stap_mode = mib_scalar((1, 3, 6, 1, 4, 1, 43, 10, 18, 1, 2), integer32().subtype(subtypeSpec=constraints_union(single_value_constraint(1, 2))).clone(namedValues=named_values(('off', 1), ('on', 2)))).setMaxAccess('readwrite') if mibBuilder.loadTexts: brSTAPMode.setStatus('mandatory') if mibBuilder.loadTexts: brSTAPMode.setDescription('Determines whether the STAP algorithm is on or off. If STAP mode is on then brForwardingMode may not be set to transparent. Conversley if brForwardingMode is set to transparent then brSTAPMode may not be set to on.') br_learn_mode = mib_scalar((1, 3, 6, 1, 4, 1, 43, 10, 18, 1, 3), integer32().subtype(subtypeSpec=constraints_union(single_value_constraint(1, 2))).clone(namedValues=named_values(('off', 1), ('on', 2)))).setMaxAccess('readwrite') if mibBuilder.loadTexts: brLearnMode.setStatus('mandatory') if mibBuilder.loadTexts: brLearnMode.setDescription('Determines whether the bridge is not learning addresses (off), or learning addresses as permanent, deleteOnReset or deleteOnTimeout.') br_aging_mode = mib_scalar((1, 3, 6, 1, 4, 1, 43, 10, 18, 1, 7), integer32().subtype(subtypeSpec=constraints_union(single_value_constraint(1, 2))).clone(namedValues=named_values(('on', 1), ('off', 2)))).setMaxAccess('readwrite') if mibBuilder.loadTexts: brAgingMode.setStatus('mandatory') if mibBuilder.loadTexts: brAgingMode.setDescription('Determines whether the bridge will age out entries in its filtering database or not.') br_mon_port_table = mib_table((1, 3, 6, 1, 4, 1, 43, 10, 18, 2, 1)) if mibBuilder.loadTexts: brMonPortTable.setStatus('mandatory') if mibBuilder.loadTexts: brMonPortTable.setDescription('A table that contains generic information about every port that is associated with this bridge.') br_mon_port_entry = mib_table_row((1, 3, 6, 1, 4, 1, 43, 10, 18, 2, 1, 1)).setIndexNames((0, 'LBHUB-BRIDGE-MIB', 'brMonPort')) if mibBuilder.loadTexts: brMonPortEntry.setStatus('mandatory') if mibBuilder.loadTexts: brMonPortEntry.setDescription('A list of information for each port of the bridge.') br_mon_port = mib_table_column((1, 3, 6, 1, 4, 1, 43, 10, 18, 2, 1, 1, 1), integer32()).setMaxAccess('readonly') if mibBuilder.loadTexts: brMonPort.setStatus('mandatory') if mibBuilder.loadTexts: brMonPort.setDescription('The port number of the port for which this entry contains bridge management information.') br_mon_port_if_index = mib_table_column((1, 3, 6, 1, 4, 1, 43, 10, 18, 2, 1, 1, 2), integer32()).setMaxAccess('readonly') if mibBuilder.loadTexts: brMonPortIfIndex.setStatus('mandatory') if mibBuilder.loadTexts: brMonPortIfIndex.setDescription('The value of the instance of the ifIndex object, defined in [4,6], for the interface corresponding to this port.') br_mon_port_percent_traffic_forwarded = mib_table_column((1, 3, 6, 1, 4, 1, 43, 10, 18, 2, 1, 1, 3), integer32()).setMaxAccess('readonly') if mibBuilder.loadTexts: brMonPortPercentTrafficForwarded.setStatus('mandatory') if mibBuilder.loadTexts: brMonPortPercentTrafficForwarded.setDescription("This is a high level 'smart MIB' object. This object provides a running average of the proportion of the received frames that are forwarded. This value is calculated locally on the agent and so does not require processor bandwidth from the management station or occupy valuable network bandwidth communicating with that station. By default an agent supporting this parameter will exhibit the following characteristics:- (1) The parameter will be recalculated at approx 60 second intervals (2) Every calculation period the device will read the value of dot1dTpPortInFrames and dot1dTpPortInDiscards. (3) The calculation will be performed on the most recent 4 samples as follows: 4 Sum(dot1dTpPortInDiscards(i)/dot1dTpPortInFrames(i)) * 1000/4 i=1 Which gives the percentage * 10 filtered, and then subtracting this from 1000 to give percentage * 10 forwarded. dot1dTpPortInDiscards(i) is dot1dTpPortInDiscards(i) - dot1dTpPortInDiscards(i-1). dot1dTpPortInFrames(i) is dot1dTpPortInFrames(i) - dot1dTpPortInFrames(i-1). The value is expressed as a percentage * 10. A default threshold exists on this average so that if a calculated average exceeds 85% a trap will be sent to the management station. Further traps will not be sent until the average drops to below 50%. A particular device may provide a means of changing the number of samples, the averaging period, threshold and threshold action if it so wishes.") br_mon_port_bandwidth_used = mib_table_column((1, 3, 6, 1, 4, 1, 43, 10, 18, 2, 1, 1, 4), integer32()).setMaxAccess('readonly') if mibBuilder.loadTexts: brMonPortBandwidthUsed.setStatus('mandatory') if mibBuilder.loadTexts: brMonPortBandwidthUsed.setDescription("This is a high level 'smart MIB' object. This object provides a running average of the bandwidth in use. This value is calculated locally on the agent and so does not require processor bandwidth from the management station or occupy valuable network bandwidth communicating with that station. By default an agent supporting this parameter will exhibit the following characteristics: (1) The parameter will be recalculated at approx 60 second intervals (2) Every calculation period the device will read the value of ifInOctets plus ifOutOctets. (3) The calculation will be performed on the most recent 4 samples as follows: 4 Sum(sample(i)/(time(i) * K)) * 1000/4 i=1 Sample(i) is (ifInOctets(i)+ifOutOctets(i))-(ifInOctets(i-1)+ifOutOctets(i-1)) time(i) is the time between sample(i-1) and sample(i) K is the max bytes per unit time (i.e. the available bandwidth) The value is expressed as a percentage * 10. A default threshold exists on this average so that if a calculated average exceeds 50% a trap will be sent to the management station. Further traps will not be sent until the average drops to below 30%. A particular device may provide a means of changing the number of samples, the averaging period, threshold and threshold action if it so wishes.") br_mon_port_errors_per10000_packets = mib_table_column((1, 3, 6, 1, 4, 1, 43, 10, 18, 2, 1, 1, 5), integer32()).setMaxAccess('readonly') if mibBuilder.loadTexts: brMonPortErrorsPer10000Packets.setStatus('mandatory') if mibBuilder.loadTexts: brMonPortErrorsPer10000Packets.setDescription("This is a high level 'smart MIB' object. This object provides a running average of the number of errors per 10000 packets. The value of this value is calculated locally on the agent and so does not require processor bandwidth from a management station or occupy valuable network bandwidth communicating with that station. By default an agent supporting this parameter will exhibit the following behaviour: (1) The parameter will be recalculated at approx 60 second intervals. (2) Every calculation period the device will read the value of portTotalErrors and dot1dTpPortInFrames. (3) The calculation will be performed on the most recent 4 samples as follows: 4 10000 * Sum(Errors(i)/Frames(i)) i=1 Errors(i) = portTotalErrors(i)-portTotalErrors(i-1) Frames(i) = dot1dTpPortInFrames(i)-dot1dTpPortInFrames(i-1) The value is an integer number of errors per 10,000 packets received by this port. A default threshold exists on this average so that if a calculated average exceeds 200 (i.e. 2% of frames are in error) a trap will be sent to the management station. Further traps will not be sent until the average drops to below 100 (i.e. 1% of frames are in error). A particular device may provide a means of changing the number of samples, the averaging period and threshold if it so wishes.") br_mon_port_broadcast_bandwidth = mib_table_column((1, 3, 6, 1, 4, 1, 43, 10, 18, 2, 1, 1, 6), integer32()).setMaxAccess('readonly') if mibBuilder.loadTexts: brMonPortBroadcastBandwidth.setStatus('mandatory') if mibBuilder.loadTexts: brMonPortBroadcastBandwidth.setDescription("This is a high level 'smart MIB' object. This object provides a running average of the Broadcast frame bandwidth in use. This value is calculated locally on the agent and so does not require processor bandwidth from the management station or occupy valuable network bandwidth communicating with that station. By default an agent supporting this parameter will exhibit the following characteristics: (1) The parameter will be recalculated at approx 20 second intervals (2) Every calculation period the device will read the value of ifExtnsBroadcastsReceivedOks and ifExtnsBroadcastsTransmittedOks. (3) The calculation will be performed on the most recent 4 samples as follows: 4 Sum(sample(i)/(time(i) * K)) * 1000/4 i=1 Sample(i) is (ifExtnsBroadcastsReceivedOks(i)+ifExtnsBroadcastsTransmittedOks(i))- (ifExtnsBroadcastsReceivedOks(i-1)+ifExtnsBroadcastsTransmittedOks(i-1)). time(i) is the time between sample(i-1) and sample(i) K is the max frames per unit time (i.e. the available bandwidth) The value is expressed as a percentage * 10. A default threshold exists on this average so that if a calculated average exceeds 20% a trap will be sent to the management station. Further traps will not be sent until the average drops to below 10%. A particular device may provide a means of changing the number of samples, the averaging period, threshold and threshold action if it so wishes.") br_data_base = mib_identifier((1, 3, 6, 1, 4, 1, 43, 10, 18, 4)) br_dummy_package = mib_identifier((1, 3, 6, 1, 4, 1, 43, 10, 18, 5)) br_size_of_filtering_data_base = mib_scalar((1, 3, 6, 1, 4, 1, 43, 10, 18, 4, 1), integer32()).setMaxAccess('readonly') if mibBuilder.loadTexts: brSizeOfFilteringDataBase.setStatus('mandatory') if mibBuilder.loadTexts: brSizeOfFilteringDataBase.setDescription('The maximum possible number of Filtering database entries.') br_percentage_of_nonageing_fdb_entries = mib_scalar((1, 3, 6, 1, 4, 1, 43, 10, 18, 4, 2), integer32()).setMaxAccess('readonly') if mibBuilder.loadTexts: brPercentageOfNonageingFDBEntries.setStatus('mandatory') if mibBuilder.loadTexts: brPercentageOfNonageingFDBEntries.setDescription('The number of entries currently in the filtering database that cannot be aged out, and are not in the permanent database. This is expressed as a percentage * 10 of the size of the filtering database :- ((number of non ageing entries)*1000)/(filtering db size).') br_percentage_of_ageing_fdb_entries = mib_scalar((1, 3, 6, 1, 4, 1, 43, 10, 18, 4, 3), integer32()).setMaxAccess('readonly') if mibBuilder.loadTexts: brPercentageOfAgeingFDBEntries.setStatus('mandatory') if mibBuilder.loadTexts: brPercentageOfAgeingFDBEntries.setDescription('The number of entries currently in the filtering database that can be aged out, and not held in the permanent database. This is expressed as a percentage * 10 of the size of the filtering database :- ((number of ageing entries)*1000)/(filtering db size).') br_percentage_of_permanent_fdb_entries = mib_scalar((1, 3, 6, 1, 4, 1, 43, 10, 18, 4, 4), integer32()).setMaxAccess('readonly') if mibBuilder.loadTexts: brPercentageOfPermanentFDBEntries.setStatus('mandatory') if mibBuilder.loadTexts: brPercentageOfPermanentFDBEntries.setDescription('The number of permanent entries currently in the filtering database. This is expressed as a percentage * 10 of the size of the filtering database :- ((number of permanent entries)*1000)/(filtering db size).') br_clear_filtering_data_base = mib_scalar((1, 3, 6, 1, 4, 1, 43, 10, 18, 4, 5), integer32().subtype(subtypeSpec=constraints_union(single_value_constraint(1, 2))).clone(namedValues=named_values(('noAction', 1), ('clear', 2)))).setMaxAccess('readwrite') if mibBuilder.loadTexts: brClearFilteringDataBase.setStatus('mandatory') if mibBuilder.loadTexts: brClearFilteringDataBase.setDescription('An attribute to clear all entries in the filtering database except for those which are permanent.') br_max_number_of_permanent_entries = mib_scalar((1, 3, 6, 1, 4, 1, 43, 10, 18, 4, 6), integer32()).setMaxAccess('readonly') if mibBuilder.loadTexts: brMaxNumberOfPermanentEntries.setStatus('mandatory') if mibBuilder.loadTexts: brMaxNumberOfPermanentEntries.setDescription('The maximum number of entries in the filtering database that can be permanent.') br_percentage_of_permanent_database_used = mib_scalar((1, 3, 6, 1, 4, 1, 43, 10, 18, 4, 7), integer32()).setMaxAccess('readonly') if mibBuilder.loadTexts: brPercentageOfPermanentDatabaseUsed.setStatus('mandatory') if mibBuilder.loadTexts: brPercentageOfPermanentDatabaseUsed.setDescription('The number of permanent entries in the filtering database. This is expressed as a percentage * 10 of the size of the permanent database :- ((number of permanent entries)*1000)/(permanent db size).') br_clear_permanent_entries = mib_scalar((1, 3, 6, 1, 4, 1, 43, 10, 18, 4, 8), integer32().subtype(subtypeSpec=constraints_union(single_value_constraint(1, 2))).clone(namedValues=named_values(('noAction', 1), ('clear', 2)))).setMaxAccess('readwrite') if mibBuilder.loadTexts: brClearPermanentEntries.setStatus('mandatory') if mibBuilder.loadTexts: brClearPermanentEntries.setDescription('An attribute to clear the permanent entries from the filtering database.') br_save_learnt_addresses = mib_scalar((1, 3, 6, 1, 4, 1, 43, 10, 18, 4, 9), integer32().subtype(subtypeSpec=constraints_union(single_value_constraint(1, 2))).clone(namedValues=named_values(('noAction', 1), ('save', 2)))).setMaxAccess('readwrite') if mibBuilder.loadTexts: brSaveLearntAddresses.setStatus('mandatory') if mibBuilder.loadTexts: brSaveLearntAddresses.setDescription('An attribute to make the learnt addresses held in the filtering database become permanent entries.') br_database_modified = mib_scalar((1, 3, 6, 1, 4, 1, 43, 10, 18, 4, 11), integer32().subtype(subtypeSpec=constraints_union(single_value_constraint(1, 2))).clone(namedValues=named_values(('noChange', 1), ('modified', 2)))).setMaxAccess('readwrite') if mibBuilder.loadTexts: brDatabaseModified.setStatus('mandatory') if mibBuilder.loadTexts: brDatabaseModified.setDescription('This flag is used to indicate to a management application that the database (Forwarding or Static views) has altered while a manager is viewing it. The normal value of this parameter is noChange(1), it will remain at this value untill the database is modified by either:- - a manager mofifying the DB through the Static Table - the relay causing an entry to be inserted into the DB - the ageing process causing an entry to be deleted from the DB when it will be set to modified(2), where it will remain untill reset to noChange(1) by a manager.') br_database_type = mib_scalar((1, 3, 6, 1, 4, 1, 43, 10, 18, 5, 1), integer32().subtype(subtypeSpec=constraints_union(single_value_constraint(1, 2))).clone(namedValues=named_values(('filtering', 1), ('permanent', 2)))).setMaxAccess('readonly') if mibBuilder.loadTexts: brDatabaseType.setStatus('mandatory') if mibBuilder.loadTexts: brDatabaseType.setDescription('This dummy object enables the database full trap to differentiate between the filtering database and the permanent database.') br_database_level = mib_scalar((1, 3, 6, 1, 4, 1, 43, 10, 18, 5, 2), integer32().subtype(subtypeSpec=constraints_union(single_value_constraint(90, 100))).clone(namedValues=named_values(('ninetyPercent', 90), ('oneHundredPercent', 100)))).setMaxAccess('readonly') if mibBuilder.loadTexts: brDatabaseLevel.setStatus('mandatory') if mibBuilder.loadTexts: brDatabaseLevel.setDescription('This dummy object enables the database full trap to differentiate between the database being 90% and 100% full.') br_traffic_forwarded = mib_scalar((1, 3, 6, 1, 4, 1, 43, 10, 18, 5, 3), counter32()).setMaxAccess('readonly') if mibBuilder.loadTexts: brTrafficForwarded.setStatus('mandatory') if mibBuilder.loadTexts: brTrafficForwarded.setDescription('This dummy object is used internally to calculate a running average of the percentage of traffic forwarded on a port. It should not be accessed by a management station.') br_port_bandwidth = mib_scalar((1, 3, 6, 1, 4, 1, 43, 10, 18, 5, 4), counter32()).setMaxAccess('readonly') if mibBuilder.loadTexts: brPortBandwidth.setStatus('mandatory') if mibBuilder.loadTexts: brPortBandwidth.setDescription('This dummy object is used internally to calculate a running average of the port bandwidth in use. It should not be accessed by a management station.') br_port_broadcast_bandwidth = mib_scalar((1, 3, 6, 1, 4, 1, 43, 10, 18, 5, 5), counter32()).setMaxAccess('readonly') if mibBuilder.loadTexts: brPortBroadcastBandwidth.setStatus('mandatory') if mibBuilder.loadTexts: brPortBroadcastBandwidth.setDescription('This dummy object is used internally to calculate a running average of the port bandwidth in use. It should not be accessed by a management station.') br_port_errors = mib_scalar((1, 3, 6, 1, 4, 1, 43, 10, 18, 5, 6), counter32()).setMaxAccess('readonly') if mibBuilder.loadTexts: brPortErrors.setStatus('mandatory') if mibBuilder.loadTexts: brPortErrors.setDescription('This dummy object is used internally to calculate a running average of the errors per 10000 frames on a port. It should not be accessed by a management station.') br_database_full = notification_type((1, 3, 6, 1, 4, 1, 43) + (0, 65)).setObjects(('LBHUB-BRIDGE-MIB', 'brDatabaseType'), ('LBHUB-BRIDGE-MIB', 'brDatabaseLevel')) if mibBuilder.loadTexts: brDatabaseFull.setDescription('This trap indicates that either the Filtering databse or the permanent database has become full. If the database occupancy exceeds 90% this trap will be sent also. The variable bindings enable the trap to be identified as refering to the filtering or permanet database, and to differentiate between 90% or 100% full.') class Bridgeid(OctetString): subtype_spec = OctetString.subtypeSpec + value_size_constraint(8, 8) fixed_length = 8 class Macaddress(OctetString): subtype_spec = OctetString.subtypeSpec + value_size_constraint(6, 6) fixed_length = 6 mibBuilder.exportSymbols('LBHUB-BRIDGE-MIB', brClearCounters=brClearCounters, endStation=endStation, linkBuilderFMS=linkBuilderFMS, linkBuilder10BTi_mib=linkBuilder10BTi_mib, brDatabaseModified=brDatabaseModified, linkBuilderFMSII_cards_6fiber_st=linkBuilderFMSII_cards_6fiber_st, brPercentageOfPermanentFDBEntries=brPercentageOfPermanentFDBEntries, dedicatedRouteServer=dedicatedRouteServer, linkBuilder10BT_cards_utp=linkBuilder10BT_cards_utp, multiRepeater=multiRepeater, ifExtensions=ifExtensions, brPercentageOfNonageingFDBEntries=brPercentageOfNonageingFDBEntries, linkBuilderFMSII_cards=linkBuilderFMSII_cards, genericUnixServer=genericUnixServer, security=security, linkBuilder3GH=linkBuilder3GH, linkBuilderFMSII_cards_24tp_rj45=linkBuilderFMSII_cards_24tp_rj45, brPortBroadcastBandwidth=brPortBroadcastBandwidth, linkBuilder10BTi_cards=linkBuilder10BTi_cards, MacAddress=MacAddress, linkBuilderFMS_cards_12fiber=linkBuilderFMS_cards_12fiber, brMonPort=brMonPort, generic=generic, brDatabaseType=brDatabaseType, BridgeId=BridgeId, linkBuilderFMS_cards_24utp=linkBuilderFMS_cards_24utp, sysLoader=sysLoader, deskMan_mib=deskMan_mib, linkBuilderFMSII=linkBuilderFMSII, viewBuilderApps=viewBuilderApps, bridgeMgmt=bridgeMgmt, brMonPortBroadcastBandwidth=brMonPortBroadcastBandwidth, products=products, hub=hub, fault=fault, localSnmp=localSnmp, a3Com=a3Com, setup=setup, lBridgeECS_mib=lBridgeECS_mib, linkBuilderFMS_cards_fiber=linkBuilderFMS_cards_fiber, brSTAPMode=brSTAPMode, brouter=brouter, brClearFilteringDataBase=brClearFilteringDataBase, brSaveLearntAddresses=brSaveLearntAddresses, repeaterMgmt=repeaterMgmt, genExperimental=genExperimental, linkBuilderFMSII_cards_12tp_rj45=linkBuilderFMSII_cards_12tp_rj45, brControlPackage=brControlPackage, linkBuilderFMS_cards_utp=linkBuilderFMS_cards_utp, brMaxNumberOfPermanentEntries=brMaxNumberOfPermanentEntries, dedicatedBridgeServer=dedicatedBridgeServer, genericTrap=genericTrap, brMonPortTable=brMonPortTable, brMonPortErrorsPer10000Packets=brMonPortErrorsPer10000Packets, brAgingMode=brAgingMode, brDialoguePackage=brDialoguePackage, linkBuilder3GH_cards=linkBuilder3GH_cards, linkBuilderMSH_cards=linkBuilderMSH_cards, manager=manager, brTrafficForwarded=brTrafficForwarded, linkBuilderFMSII_cards_10coax_bnc=linkBuilderFMSII_cards_10coax_bnc, netBuilder_mib=netBuilder_mib, powerSupply=powerSupply, brLearnMode=brLearnMode, brMonitorPackage=brMonitorPackage, cards=cards, linkBuilderMSH=linkBuilderMSH, linkBuilder3GH_mib=linkBuilder3GH_mib, asciiAgent=asciiAgent, brMonPortIfIndex=brMonPortIfIndex, linkBuilderFMS_cards=linkBuilderFMS_cards, PhysAddress=PhysAddress, unusedGeneric12=unusedGeneric12, linkBuilder10BTi_cards_utp=linkBuilder10BTi_cards_utp, linkBuilderFMS_cards_coax=linkBuilderFMS_cards_coax, linkBuilder10BTi=linkBuilder10BTi, poll=poll, brDatabaseLevel=brDatabaseLevel, brMonPortPercentTrafficForwarded=brMonPortPercentTrafficForwarded, DisplayString=DisplayString, amp_mib=amp_mib, linkBuilderMSH_mib=linkBuilderMSH_mib, linkBuilderFMSLBridge=linkBuilderFMSLBridge, brPortErrors=brPortErrors, brClearPermanentEntries=brClearPermanentEntries, brDummyPackage=brDummyPackage, serialIf=serialIf, brMonPortBandwidthUsed=brMonPortBandwidthUsed, specificTrap=specificTrap, linkBuilderECS_cards=linkBuilderECS_cards, testData=testData, mrmResilience=mrmResilience, linkBuilderECS=linkBuilderECS, gauges=gauges, chassis=chassis, brMonPortEntry=brMonPortEntry, brPortBandwidth=brPortBandwidth, brDataBase=brDataBase, brPercentageOfPermanentDatabaseUsed=brPercentageOfPermanentDatabaseUsed, brPercentageOfAgeingFDBEntries=brPercentageOfAgeingFDBEntries, linkBuilderFMSII_cards_12fiber_st=linkBuilderFMSII_cards_12fiber_st, linkBuilderECS_mib=linkBuilderECS_mib, terminalServer=terminalServer, brDatabaseFull=brDatabaseFull, genericMSWorkstation=genericMSWorkstation, genericMSServer=genericMSServer, tokenRing=tokenRing, brSizeOfFilteringDataBase=brSizeOfFilteringDataBase, linkBuilderFMSII_cards_24tp_telco=linkBuilderFMSII_cards_24tp_telco, mib_2=mib_2)
a = int(input()) if(a>1000000): print(0) else: c = int(input()) if(c==a): print(0) else: ver = [] var = [] for i in range(a): b = float(input()) var.append(b) j=0 sumout = [] for element in var: k=j if(j+c<len(var)+1): nnd=[] for i in range(c): nnd.append(k) k+=1 prh = 0 sum = 0 for element1 in var: if(prh not in nnd): sum = sum + element1 prh += 1 sumout.append(sum) j+=1 print(min(sumout))
a = int(input()) if a > 1000000: print(0) else: c = int(input()) if c == a: print(0) else: ver = [] var = [] for i in range(a): b = float(input()) var.append(b) j = 0 sumout = [] for element in var: k = j if j + c < len(var) + 1: nnd = [] for i in range(c): nnd.append(k) k += 1 prh = 0 sum = 0 for element1 in var: if prh not in nnd: sum = sum + element1 prh += 1 sumout.append(sum) j += 1 print(min(sumout))
def main(): total = float print("**********Think in te last five game that you buy**********") game1 = input("What's the game?: ") time1 = float(input(f"How many hours did you play {game1}?: ")) price1 = float(input(f"How many dollars did you spend in the {game1}?: ")) print("-------------------------------------------------------------------") game2 = input("What's the game?: ") time2 = float(input(f"How many hours did you play {game2}?: ")) price2 = float(input(f"How many dollars did you spend in the {game2}?: ")) print("-------------------------------------------------------------------") game3 = input("What's the game?: ") time3 = float(input(f"How many hours did you play {game3}?: ")) price3 = float(input(f"How many dollars did you spend in the {game3}?: ")) print("-------------------------------------------------------------------") game4 = input("What's the game?: ") time4 = float(input(f"How many hours did you play {game4}?: ")) price4 = float(input(f"How many dollars did you spend in the {game4}?: ")) print("-------------------------------------------------------------------") game5 = input("What's the game?: ") time5 = float(input(f"How many hours did you play {game5}?: ")) price5 = float(input(f"How many dollars did you spend in the {game5}?: ")) print("-------------------------------------------------------------------") total = (time1/price1 + time2/price2 + time3/price3 + time4/price4 + time5/price5) / 5 print(f"The games {game1}, {game2}, {game3}, {game4}, {game5} cost you {total} the hour") if __name__ == '__main__': main()
def main(): total = float print('**********Think in te last five game that you buy**********') game1 = input("What's the game?: ") time1 = float(input(f'How many hours did you play {game1}?: ')) price1 = float(input(f'How many dollars did you spend in the {game1}?: ')) print('-------------------------------------------------------------------') game2 = input("What's the game?: ") time2 = float(input(f'How many hours did you play {game2}?: ')) price2 = float(input(f'How many dollars did you spend in the {game2}?: ')) print('-------------------------------------------------------------------') game3 = input("What's the game?: ") time3 = float(input(f'How many hours did you play {game3}?: ')) price3 = float(input(f'How many dollars did you spend in the {game3}?: ')) print('-------------------------------------------------------------------') game4 = input("What's the game?: ") time4 = float(input(f'How many hours did you play {game4}?: ')) price4 = float(input(f'How many dollars did you spend in the {game4}?: ')) print('-------------------------------------------------------------------') game5 = input("What's the game?: ") time5 = float(input(f'How many hours did you play {game5}?: ')) price5 = float(input(f'How many dollars did you spend in the {game5}?: ')) print('-------------------------------------------------------------------') total = (time1 / price1 + time2 / price2 + time3 / price3 + time4 / price4 + time5 / price5) / 5 print(f'The games {game1}, {game2}, {game3}, {game4}, {game5} cost you {total} the hour') if __name__ == '__main__': main()
class Solution: def minCostToMoveChips(self, position: List[int]) -> int: even_cnt = 0 odd_cnt = 0 for i in position: if i % 2 == 0: even_cnt += 1 else: odd_cnt += 1 return min(even_cnt, odd_cnt)
class Solution: def min_cost_to_move_chips(self, position: List[int]) -> int: even_cnt = 0 odd_cnt = 0 for i in position: if i % 2 == 0: even_cnt += 1 else: odd_cnt += 1 return min(even_cnt, odd_cnt)
n = int(input()) positives = [] negatives = [] for i in range(n): current_number = int(input()) if current_number >= 0: positives.append(current_number) else: negatives.append(current_number) #============ Comprehension =============== #numbers = [int(input()) for _ in range(n)] #positives = [i for i in numbers if i >= 0] #negatives = [i for i in numbers if i < 0] print(positives) print(negatives) print(f"Count of positives: {len(positives)}. Sum of negatives: {sum(negatives)}")
n = int(input()) positives = [] negatives = [] for i in range(n): current_number = int(input()) if current_number >= 0: positives.append(current_number) else: negatives.append(current_number) print(positives) print(negatives) print(f'Count of positives: {len(positives)}. Sum of negatives: {sum(negatives)}')
# # PySNMP MIB module JUNIPER-LSYSSP-NATSRCPOOL-MIB (http://snmplabs.com/pysmi) # ASN.1 source file:///Users/davwang4/Dev/mibs.snmplabs.com/asn1/JUNIPER-LSYSSP-NATSRCPOOL-MIB # Produced by pysmi-0.3.4 at Wed May 1 14:00:04 2019 # On host DAVWANG4-M-1475 platform Darwin version 18.5.0 by user davwang4 # Using Python version 3.7.3 (default, Mar 27 2019, 09:23:15) # OctetString, ObjectIdentifier, Integer = mibBuilder.importSymbols("ASN1", "OctetString", "ObjectIdentifier", "Integer") NamedValues, = mibBuilder.importSymbols("ASN1-ENUMERATION", "NamedValues") ConstraintsIntersection, ValueRangeConstraint, ValueSizeConstraint, ConstraintsUnion, SingleValueConstraint = mibBuilder.importSymbols("ASN1-REFINEMENT", "ConstraintsIntersection", "ValueRangeConstraint", "ValueSizeConstraint", "ConstraintsUnion", "SingleValueConstraint") jnxLsysSpNATsrcpool, = mibBuilder.importSymbols("JUNIPER-LSYS-SECURITYPROFILE-MIB", "jnxLsysSpNATsrcpool") NotificationGroup, ModuleCompliance = mibBuilder.importSymbols("SNMPv2-CONF", "NotificationGroup", "ModuleCompliance") Counter64, Bits, MibIdentifier, iso, Counter32, ModuleIdentity, MibScalar, MibTable, MibTableRow, MibTableColumn, ObjectIdentity, Unsigned32, TimeTicks, Integer32, IpAddress, NotificationType, Gauge32 = mibBuilder.importSymbols("SNMPv2-SMI", "Counter64", "Bits", "MibIdentifier", "iso", "Counter32", "ModuleIdentity", "MibScalar", "MibTable", "MibTableRow", "MibTableColumn", "ObjectIdentity", "Unsigned32", "TimeTicks", "Integer32", "IpAddress", "NotificationType", "Gauge32") DisplayString, TextualConvention = mibBuilder.importSymbols("SNMPv2-TC", "DisplayString", "TextualConvention") jnxLsysSpNATsrcpoolMIB = ModuleIdentity((1, 3, 6, 1, 4, 1, 2636, 3, 39, 1, 17, 8, 1)) if mibBuilder.loadTexts: jnxLsysSpNATsrcpoolMIB.setLastUpdated('201005191644Z') if mibBuilder.loadTexts: jnxLsysSpNATsrcpoolMIB.setOrganization('Juniper Networks, Inc.') if mibBuilder.loadTexts: jnxLsysSpNATsrcpoolMIB.setContactInfo('Juniper Technical Assistance Center Juniper Networks, Inc. 1194 N. Mathilda Avenue Sunnyvale, CA 94089 E-mail: support@juniper.net HTTP://www.juniper.net') if mibBuilder.loadTexts: jnxLsysSpNATsrcpoolMIB.setDescription('This module defines the NAT-src-pool-specific MIB for Juniper Enterprise Logical-System (LSYS) security profiles. Juniper documentation is recommended as the reference. The LSYS security profile provides various static and dynamic resource management by observing resource quota limits. Security NAT-src-pool resource is the focus in this MIB. ') jnxLsysSpNATsrcpoolObjects = MibIdentifier((1, 3, 6, 1, 4, 1, 2636, 3, 39, 1, 17, 8, 1, 1)) jnxLsysSpNATsrcpoolSummary = MibIdentifier((1, 3, 6, 1, 4, 1, 2636, 3, 39, 1, 17, 8, 1, 2)) jnxLsysSpNATsrcpoolTable = MibTable((1, 3, 6, 1, 4, 1, 2636, 3, 39, 1, 17, 8, 1, 1, 1), ) if mibBuilder.loadTexts: jnxLsysSpNATsrcpoolTable.setStatus('current') if mibBuilder.loadTexts: jnxLsysSpNATsrcpoolTable.setDescription('LSYSPROFILE NAT-src-pool objects for NAT-src-pool resource consumption per LSYS.') jnxLsysSpNATsrcpoolEntry = MibTableRow((1, 3, 6, 1, 4, 1, 2636, 3, 39, 1, 17, 8, 1, 1, 1, 1), ).setIndexNames((1, "JUNIPER-LSYSSP-NATSRCPOOL-MIB", "jnxLsysSpNATsrcpoolLsysName")) if mibBuilder.loadTexts: jnxLsysSpNATsrcpoolEntry.setStatus('current') if mibBuilder.loadTexts: jnxLsysSpNATsrcpoolEntry.setDescription('An entry in NAT-src-pool resource table.') jnxLsysSpNATsrcpoolLsysName = MibTableColumn((1, 3, 6, 1, 4, 1, 2636, 3, 39, 1, 17, 8, 1, 1, 1, 1, 1), DisplayString().subtype(subtypeSpec=ValueSizeConstraint(1, 64))) if mibBuilder.loadTexts: jnxLsysSpNATsrcpoolLsysName.setStatus('current') if mibBuilder.loadTexts: jnxLsysSpNATsrcpoolLsysName.setDescription('The name of the logical system for which NAT-src-pool resource information is retrieved. ') jnxLsysSpNATsrcpoolProfileName = MibTableColumn((1, 3, 6, 1, 4, 1, 2636, 3, 39, 1, 17, 8, 1, 1, 1, 1, 2), DisplayString().subtype(subtypeSpec=ValueSizeConstraint(1, 32))).setMaxAccess("readonly") if mibBuilder.loadTexts: jnxLsysSpNATsrcpoolProfileName.setStatus('current') if mibBuilder.loadTexts: jnxLsysSpNATsrcpoolProfileName.setDescription('The security profile name string for the LSYS.') jnxLsysSpNATsrcpoolUsage = MibTableColumn((1, 3, 6, 1, 4, 1, 2636, 3, 39, 1, 17, 8, 1, 1, 1, 1, 3), Unsigned32()).setMaxAccess("readonly") if mibBuilder.loadTexts: jnxLsysSpNATsrcpoolUsage.setStatus('current') if mibBuilder.loadTexts: jnxLsysSpNATsrcpoolUsage.setDescription('The current resource usage count for the LSYS.') jnxLsysSpNATsrcpoolReserved = MibTableColumn((1, 3, 6, 1, 4, 1, 2636, 3, 39, 1, 17, 8, 1, 1, 1, 1, 4), Unsigned32()).setMaxAccess("readonly") if mibBuilder.loadTexts: jnxLsysSpNATsrcpoolReserved.setStatus('current') if mibBuilder.loadTexts: jnxLsysSpNATsrcpoolReserved.setDescription('The reserved resource count for the LSYS.') jnxLsysSpNATsrcpoolMaximum = MibTableColumn((1, 3, 6, 1, 4, 1, 2636, 3, 39, 1, 17, 8, 1, 1, 1, 1, 5), Unsigned32()).setMaxAccess("readonly") if mibBuilder.loadTexts: jnxLsysSpNATsrcpoolMaximum.setStatus('current') if mibBuilder.loadTexts: jnxLsysSpNATsrcpoolMaximum.setDescription('The maximum allowed resource usage count for the LSYS.') jnxLsysSpNATsrcpoolUsedAmount = MibScalar((1, 3, 6, 1, 4, 1, 2636, 3, 39, 1, 17, 8, 1, 2, 1), Unsigned32()).setMaxAccess("readonly") if mibBuilder.loadTexts: jnxLsysSpNATsrcpoolUsedAmount.setStatus('current') if mibBuilder.loadTexts: jnxLsysSpNATsrcpoolUsedAmount.setDescription('The NAT-src-pool resource consumption over all LSYS.') jnxLsysSpNATsrcpoolMaxQuota = MibScalar((1, 3, 6, 1, 4, 1, 2636, 3, 39, 1, 17, 8, 1, 2, 2), Unsigned32()).setMaxAccess("readonly") if mibBuilder.loadTexts: jnxLsysSpNATsrcpoolMaxQuota.setStatus('current') if mibBuilder.loadTexts: jnxLsysSpNATsrcpoolMaxQuota.setDescription('The NAT-src-pool resource maximum quota for the whole device for all LSYS.') jnxLsysSpNATsrcpoolAvailableAmount = MibScalar((1, 3, 6, 1, 4, 1, 2636, 3, 39, 1, 17, 8, 1, 2, 3), Unsigned32()).setMaxAccess("readonly") if mibBuilder.loadTexts: jnxLsysSpNATsrcpoolAvailableAmount.setStatus('current') if mibBuilder.loadTexts: jnxLsysSpNATsrcpoolAvailableAmount.setDescription('The NAT-src-pool resource available in the whole device.') jnxLsysSpNATsrcpoolHeaviestUsage = MibScalar((1, 3, 6, 1, 4, 1, 2636, 3, 39, 1, 17, 8, 1, 2, 4), Unsigned32()).setMaxAccess("readonly") if mibBuilder.loadTexts: jnxLsysSpNATsrcpoolHeaviestUsage.setStatus('current') if mibBuilder.loadTexts: jnxLsysSpNATsrcpoolHeaviestUsage.setDescription('The most amount of NAT-src-pool resource consumed of a LSYS.') jnxLsysSpNATsrcpoolHeaviestUser = MibScalar((1, 3, 6, 1, 4, 1, 2636, 3, 39, 1, 17, 8, 1, 2, 5), DisplayString().subtype(subtypeSpec=ValueSizeConstraint(1, 64))).setMaxAccess("readonly") if mibBuilder.loadTexts: jnxLsysSpNATsrcpoolHeaviestUser.setStatus('current') if mibBuilder.loadTexts: jnxLsysSpNATsrcpoolHeaviestUser.setDescription('The LSYS name that consume the most NAT-src-pool resource.') jnxLsysSpNATsrcpoolLightestUsage = MibScalar((1, 3, 6, 1, 4, 1, 2636, 3, 39, 1, 17, 8, 1, 2, 6), Unsigned32()).setMaxAccess("readonly") if mibBuilder.loadTexts: jnxLsysSpNATsrcpoolLightestUsage.setStatus('current') if mibBuilder.loadTexts: jnxLsysSpNATsrcpoolLightestUsage.setDescription('The least amount of NAT-src-pool resource consumed of a LSYS.') jnxLsysSpNATsrcpoolLightestUser = MibScalar((1, 3, 6, 1, 4, 1, 2636, 3, 39, 1, 17, 8, 1, 2, 7), DisplayString().subtype(subtypeSpec=ValueSizeConstraint(1, 64))).setMaxAccess("readonly") if mibBuilder.loadTexts: jnxLsysSpNATsrcpoolLightestUser.setStatus('current') if mibBuilder.loadTexts: jnxLsysSpNATsrcpoolLightestUser.setDescription('The LSYS name that consume the least NAT-src-pool resource.') mibBuilder.exportSymbols("JUNIPER-LSYSSP-NATSRCPOOL-MIB", jnxLsysSpNATsrcpoolHeaviestUser=jnxLsysSpNATsrcpoolHeaviestUser, jnxLsysSpNATsrcpoolProfileName=jnxLsysSpNATsrcpoolProfileName, jnxLsysSpNATsrcpoolAvailableAmount=jnxLsysSpNATsrcpoolAvailableAmount, jnxLsysSpNATsrcpoolEntry=jnxLsysSpNATsrcpoolEntry, jnxLsysSpNATsrcpoolLsysName=jnxLsysSpNATsrcpoolLsysName, PYSNMP_MODULE_ID=jnxLsysSpNATsrcpoolMIB, jnxLsysSpNATsrcpoolReserved=jnxLsysSpNATsrcpoolReserved, jnxLsysSpNATsrcpoolLightestUsage=jnxLsysSpNATsrcpoolLightestUsage, jnxLsysSpNATsrcpoolLightestUser=jnxLsysSpNATsrcpoolLightestUser, jnxLsysSpNATsrcpoolMIB=jnxLsysSpNATsrcpoolMIB, jnxLsysSpNATsrcpoolHeaviestUsage=jnxLsysSpNATsrcpoolHeaviestUsage, jnxLsysSpNATsrcpoolTable=jnxLsysSpNATsrcpoolTable, jnxLsysSpNATsrcpoolObjects=jnxLsysSpNATsrcpoolObjects, jnxLsysSpNATsrcpoolMaximum=jnxLsysSpNATsrcpoolMaximum, jnxLsysSpNATsrcpoolMaxQuota=jnxLsysSpNATsrcpoolMaxQuota, jnxLsysSpNATsrcpoolSummary=jnxLsysSpNATsrcpoolSummary, jnxLsysSpNATsrcpoolUsedAmount=jnxLsysSpNATsrcpoolUsedAmount, jnxLsysSpNATsrcpoolUsage=jnxLsysSpNATsrcpoolUsage)
(octet_string, object_identifier, integer) = mibBuilder.importSymbols('ASN1', 'OctetString', 'ObjectIdentifier', 'Integer') (named_values,) = mibBuilder.importSymbols('ASN1-ENUMERATION', 'NamedValues') (constraints_intersection, value_range_constraint, value_size_constraint, constraints_union, single_value_constraint) = mibBuilder.importSymbols('ASN1-REFINEMENT', 'ConstraintsIntersection', 'ValueRangeConstraint', 'ValueSizeConstraint', 'ConstraintsUnion', 'SingleValueConstraint') (jnx_lsys_sp_na_tsrcpool,) = mibBuilder.importSymbols('JUNIPER-LSYS-SECURITYPROFILE-MIB', 'jnxLsysSpNATsrcpool') (notification_group, module_compliance) = mibBuilder.importSymbols('SNMPv2-CONF', 'NotificationGroup', 'ModuleCompliance') (counter64, bits, mib_identifier, iso, counter32, module_identity, mib_scalar, mib_table, mib_table_row, mib_table_column, object_identity, unsigned32, time_ticks, integer32, ip_address, notification_type, gauge32) = mibBuilder.importSymbols('SNMPv2-SMI', 'Counter64', 'Bits', 'MibIdentifier', 'iso', 'Counter32', 'ModuleIdentity', 'MibScalar', 'MibTable', 'MibTableRow', 'MibTableColumn', 'ObjectIdentity', 'Unsigned32', 'TimeTicks', 'Integer32', 'IpAddress', 'NotificationType', 'Gauge32') (display_string, textual_convention) = mibBuilder.importSymbols('SNMPv2-TC', 'DisplayString', 'TextualConvention') jnx_lsys_sp_na_tsrcpool_mib = module_identity((1, 3, 6, 1, 4, 1, 2636, 3, 39, 1, 17, 8, 1)) if mibBuilder.loadTexts: jnxLsysSpNATsrcpoolMIB.setLastUpdated('201005191644Z') if mibBuilder.loadTexts: jnxLsysSpNATsrcpoolMIB.setOrganization('Juniper Networks, Inc.') if mibBuilder.loadTexts: jnxLsysSpNATsrcpoolMIB.setContactInfo('Juniper Technical Assistance Center Juniper Networks, Inc. 1194 N. Mathilda Avenue Sunnyvale, CA 94089 E-mail: support@juniper.net HTTP://www.juniper.net') if mibBuilder.loadTexts: jnxLsysSpNATsrcpoolMIB.setDescription('This module defines the NAT-src-pool-specific MIB for Juniper Enterprise Logical-System (LSYS) security profiles. Juniper documentation is recommended as the reference. The LSYS security profile provides various static and dynamic resource management by observing resource quota limits. Security NAT-src-pool resource is the focus in this MIB. ') jnx_lsys_sp_na_tsrcpool_objects = mib_identifier((1, 3, 6, 1, 4, 1, 2636, 3, 39, 1, 17, 8, 1, 1)) jnx_lsys_sp_na_tsrcpool_summary = mib_identifier((1, 3, 6, 1, 4, 1, 2636, 3, 39, 1, 17, 8, 1, 2)) jnx_lsys_sp_na_tsrcpool_table = mib_table((1, 3, 6, 1, 4, 1, 2636, 3, 39, 1, 17, 8, 1, 1, 1)) if mibBuilder.loadTexts: jnxLsysSpNATsrcpoolTable.setStatus('current') if mibBuilder.loadTexts: jnxLsysSpNATsrcpoolTable.setDescription('LSYSPROFILE NAT-src-pool objects for NAT-src-pool resource consumption per LSYS.') jnx_lsys_sp_na_tsrcpool_entry = mib_table_row((1, 3, 6, 1, 4, 1, 2636, 3, 39, 1, 17, 8, 1, 1, 1, 1)).setIndexNames((1, 'JUNIPER-LSYSSP-NATSRCPOOL-MIB', 'jnxLsysSpNATsrcpoolLsysName')) if mibBuilder.loadTexts: jnxLsysSpNATsrcpoolEntry.setStatus('current') if mibBuilder.loadTexts: jnxLsysSpNATsrcpoolEntry.setDescription('An entry in NAT-src-pool resource table.') jnx_lsys_sp_na_tsrcpool_lsys_name = mib_table_column((1, 3, 6, 1, 4, 1, 2636, 3, 39, 1, 17, 8, 1, 1, 1, 1, 1), display_string().subtype(subtypeSpec=value_size_constraint(1, 64))) if mibBuilder.loadTexts: jnxLsysSpNATsrcpoolLsysName.setStatus('current') if mibBuilder.loadTexts: jnxLsysSpNATsrcpoolLsysName.setDescription('The name of the logical system for which NAT-src-pool resource information is retrieved. ') jnx_lsys_sp_na_tsrcpool_profile_name = mib_table_column((1, 3, 6, 1, 4, 1, 2636, 3, 39, 1, 17, 8, 1, 1, 1, 1, 2), display_string().subtype(subtypeSpec=value_size_constraint(1, 32))).setMaxAccess('readonly') if mibBuilder.loadTexts: jnxLsysSpNATsrcpoolProfileName.setStatus('current') if mibBuilder.loadTexts: jnxLsysSpNATsrcpoolProfileName.setDescription('The security profile name string for the LSYS.') jnx_lsys_sp_na_tsrcpool_usage = mib_table_column((1, 3, 6, 1, 4, 1, 2636, 3, 39, 1, 17, 8, 1, 1, 1, 1, 3), unsigned32()).setMaxAccess('readonly') if mibBuilder.loadTexts: jnxLsysSpNATsrcpoolUsage.setStatus('current') if mibBuilder.loadTexts: jnxLsysSpNATsrcpoolUsage.setDescription('The current resource usage count for the LSYS.') jnx_lsys_sp_na_tsrcpool_reserved = mib_table_column((1, 3, 6, 1, 4, 1, 2636, 3, 39, 1, 17, 8, 1, 1, 1, 1, 4), unsigned32()).setMaxAccess('readonly') if mibBuilder.loadTexts: jnxLsysSpNATsrcpoolReserved.setStatus('current') if mibBuilder.loadTexts: jnxLsysSpNATsrcpoolReserved.setDescription('The reserved resource count for the LSYS.') jnx_lsys_sp_na_tsrcpool_maximum = mib_table_column((1, 3, 6, 1, 4, 1, 2636, 3, 39, 1, 17, 8, 1, 1, 1, 1, 5), unsigned32()).setMaxAccess('readonly') if mibBuilder.loadTexts: jnxLsysSpNATsrcpoolMaximum.setStatus('current') if mibBuilder.loadTexts: jnxLsysSpNATsrcpoolMaximum.setDescription('The maximum allowed resource usage count for the LSYS.') jnx_lsys_sp_na_tsrcpool_used_amount = mib_scalar((1, 3, 6, 1, 4, 1, 2636, 3, 39, 1, 17, 8, 1, 2, 1), unsigned32()).setMaxAccess('readonly') if mibBuilder.loadTexts: jnxLsysSpNATsrcpoolUsedAmount.setStatus('current') if mibBuilder.loadTexts: jnxLsysSpNATsrcpoolUsedAmount.setDescription('The NAT-src-pool resource consumption over all LSYS.') jnx_lsys_sp_na_tsrcpool_max_quota = mib_scalar((1, 3, 6, 1, 4, 1, 2636, 3, 39, 1, 17, 8, 1, 2, 2), unsigned32()).setMaxAccess('readonly') if mibBuilder.loadTexts: jnxLsysSpNATsrcpoolMaxQuota.setStatus('current') if mibBuilder.loadTexts: jnxLsysSpNATsrcpoolMaxQuota.setDescription('The NAT-src-pool resource maximum quota for the whole device for all LSYS.') jnx_lsys_sp_na_tsrcpool_available_amount = mib_scalar((1, 3, 6, 1, 4, 1, 2636, 3, 39, 1, 17, 8, 1, 2, 3), unsigned32()).setMaxAccess('readonly') if mibBuilder.loadTexts: jnxLsysSpNATsrcpoolAvailableAmount.setStatus('current') if mibBuilder.loadTexts: jnxLsysSpNATsrcpoolAvailableAmount.setDescription('The NAT-src-pool resource available in the whole device.') jnx_lsys_sp_na_tsrcpool_heaviest_usage = mib_scalar((1, 3, 6, 1, 4, 1, 2636, 3, 39, 1, 17, 8, 1, 2, 4), unsigned32()).setMaxAccess('readonly') if mibBuilder.loadTexts: jnxLsysSpNATsrcpoolHeaviestUsage.setStatus('current') if mibBuilder.loadTexts: jnxLsysSpNATsrcpoolHeaviestUsage.setDescription('The most amount of NAT-src-pool resource consumed of a LSYS.') jnx_lsys_sp_na_tsrcpool_heaviest_user = mib_scalar((1, 3, 6, 1, 4, 1, 2636, 3, 39, 1, 17, 8, 1, 2, 5), display_string().subtype(subtypeSpec=value_size_constraint(1, 64))).setMaxAccess('readonly') if mibBuilder.loadTexts: jnxLsysSpNATsrcpoolHeaviestUser.setStatus('current') if mibBuilder.loadTexts: jnxLsysSpNATsrcpoolHeaviestUser.setDescription('The LSYS name that consume the most NAT-src-pool resource.') jnx_lsys_sp_na_tsrcpool_lightest_usage = mib_scalar((1, 3, 6, 1, 4, 1, 2636, 3, 39, 1, 17, 8, 1, 2, 6), unsigned32()).setMaxAccess('readonly') if mibBuilder.loadTexts: jnxLsysSpNATsrcpoolLightestUsage.setStatus('current') if mibBuilder.loadTexts: jnxLsysSpNATsrcpoolLightestUsage.setDescription('The least amount of NAT-src-pool resource consumed of a LSYS.') jnx_lsys_sp_na_tsrcpool_lightest_user = mib_scalar((1, 3, 6, 1, 4, 1, 2636, 3, 39, 1, 17, 8, 1, 2, 7), display_string().subtype(subtypeSpec=value_size_constraint(1, 64))).setMaxAccess('readonly') if mibBuilder.loadTexts: jnxLsysSpNATsrcpoolLightestUser.setStatus('current') if mibBuilder.loadTexts: jnxLsysSpNATsrcpoolLightestUser.setDescription('The LSYS name that consume the least NAT-src-pool resource.') mibBuilder.exportSymbols('JUNIPER-LSYSSP-NATSRCPOOL-MIB', jnxLsysSpNATsrcpoolHeaviestUser=jnxLsysSpNATsrcpoolHeaviestUser, jnxLsysSpNATsrcpoolProfileName=jnxLsysSpNATsrcpoolProfileName, jnxLsysSpNATsrcpoolAvailableAmount=jnxLsysSpNATsrcpoolAvailableAmount, jnxLsysSpNATsrcpoolEntry=jnxLsysSpNATsrcpoolEntry, jnxLsysSpNATsrcpoolLsysName=jnxLsysSpNATsrcpoolLsysName, PYSNMP_MODULE_ID=jnxLsysSpNATsrcpoolMIB, jnxLsysSpNATsrcpoolReserved=jnxLsysSpNATsrcpoolReserved, jnxLsysSpNATsrcpoolLightestUsage=jnxLsysSpNATsrcpoolLightestUsage, jnxLsysSpNATsrcpoolLightestUser=jnxLsysSpNATsrcpoolLightestUser, jnxLsysSpNATsrcpoolMIB=jnxLsysSpNATsrcpoolMIB, jnxLsysSpNATsrcpoolHeaviestUsage=jnxLsysSpNATsrcpoolHeaviestUsage, jnxLsysSpNATsrcpoolTable=jnxLsysSpNATsrcpoolTable, jnxLsysSpNATsrcpoolObjects=jnxLsysSpNATsrcpoolObjects, jnxLsysSpNATsrcpoolMaximum=jnxLsysSpNATsrcpoolMaximum, jnxLsysSpNATsrcpoolMaxQuota=jnxLsysSpNATsrcpoolMaxQuota, jnxLsysSpNATsrcpoolSummary=jnxLsysSpNATsrcpoolSummary, jnxLsysSpNATsrcpoolUsedAmount=jnxLsysSpNATsrcpoolUsedAmount, jnxLsysSpNATsrcpoolUsage=jnxLsysSpNATsrcpoolUsage)
print("hola mundo") x=4 y=2 print(x+y) #suma=x+y #print(suma) #suma
print('hola mundo') x = 4 y = 2 print(x + y)
# # PySNMP MIB module REDLINE-AN50-PMP-V2-MIB (http://snmplabs.com/pysmi) # ASN.1 source file:///Users/davwang4/Dev/mibs.snmplabs.com/asn1/REDLINE-AN50-PMP-V2-MIB # Produced by pysmi-0.3.4 at Mon Apr 29 20:46: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, ObjectIdentifier, Integer = mibBuilder.importSymbols("ASN1", "OctetString", "ObjectIdentifier", "Integer") NamedValues, = mibBuilder.importSymbols("ASN1-ENUMERATION", "NamedValues") ConstraintsUnion, ValueRangeConstraint, SingleValueConstraint, ConstraintsIntersection, ValueSizeConstraint = mibBuilder.importSymbols("ASN1-REFINEMENT", "ConstraintsUnion", "ValueRangeConstraint", "SingleValueConstraint", "ConstraintsIntersection", "ValueSizeConstraint") redlineMgmt, = mibBuilder.importSymbols("REDLINE-MIB", "redlineMgmt") ModuleCompliance, NotificationGroup, ObjectGroup = mibBuilder.importSymbols("SNMPv2-CONF", "ModuleCompliance", "NotificationGroup", "ObjectGroup") TimeTicks, Gauge32, ModuleIdentity, Counter32, Integer32, iso, Bits, NotificationType, ObjectIdentity, Unsigned32, IpAddress, MibScalar, MibTable, MibTableRow, MibTableColumn, MibIdentifier, Counter64 = mibBuilder.importSymbols("SNMPv2-SMI", "TimeTicks", "Gauge32", "ModuleIdentity", "Counter32", "Integer32", "iso", "Bits", "NotificationType", "ObjectIdentity", "Unsigned32", "IpAddress", "MibScalar", "MibTable", "MibTableRow", "MibTableColumn", "MibIdentifier", "Counter64") RowStatus, DisplayString, TextualConvention = mibBuilder.importSymbols("SNMPv2-TC", "RowStatus", "DisplayString", "TextualConvention") redlineAN50PMPV2 = ModuleIdentity((1, 3, 6, 1, 4, 1, 10728, 2, 51)) if mibBuilder.loadTexts: redlineAN50PMPV2.setLastUpdated('200503160000Z') if mibBuilder.loadTexts: redlineAN50PMPV2.setOrganization('Redline Communications, Inc.') an50pmpLinkTable = MibTable((1, 3, 6, 1, 4, 1, 10728, 2, 51, 1), ) if mibBuilder.loadTexts: an50pmpLinkTable.setStatus('current') an50pmpLinkEntry = MibTableRow((1, 3, 6, 1, 4, 1, 10728, 2, 51, 1, 1), ).setIndexNames((0, "REDLINE-AN50-PMP-V2-MIB", "an50pmpLinkID")) if mibBuilder.loadTexts: an50pmpLinkEntry.setStatus('current') an50pmpLinkID = MibTableColumn((1, 3, 6, 1, 4, 1, 10728, 2, 51, 1, 1, 1), Integer32().subtype(subtypeSpec=ValueRangeConstraint(0, 65536))) if mibBuilder.loadTexts: an50pmpLinkID.setStatus('current') an50pmpLinkName = MibTableColumn((1, 3, 6, 1, 4, 1, 10728, 2, 51, 1, 1, 2), OctetString().subtype(subtypeSpec=ValueSizeConstraint(1, 15))).setMaxAccess("readwrite") if mibBuilder.loadTexts: an50pmpLinkName.setStatus('current') an50pmpLinkGroupId = MibTableColumn((1, 3, 6, 1, 4, 1, 10728, 2, 51, 1, 1, 3), Integer32().subtype(subtypeSpec=ValueRangeConstraint(1, 1024))).setMaxAccess("readwrite") if mibBuilder.loadTexts: an50pmpLinkGroupId.setStatus('obsolete') an50pmpLinkPeerMac = MibTableColumn((1, 3, 6, 1, 4, 1, 10728, 2, 51, 1, 1, 4), OctetString().subtype(subtypeSpec=ValueSizeConstraint(0, 6))).setMaxAccess("readwrite") if mibBuilder.loadTexts: an50pmpLinkPeerMac.setStatus('current') an50pmpLinkMaxDLBurstRate = MibTableColumn((1, 3, 6, 1, 4, 1, 10728, 2, 51, 1, 1, 5), Integer32().subtype(subtypeSpec=ValueRangeConstraint(1, 8))).setMaxAccess("readwrite") if mibBuilder.loadTexts: an50pmpLinkMaxDLBurstRate.setStatus('current') an50pmpLinkMaxULBurstRate = MibTableColumn((1, 3, 6, 1, 4, 1, 10728, 2, 51, 1, 1, 6), Integer32().subtype(subtypeSpec=ValueRangeConstraint(1, 8))).setMaxAccess("readwrite") if mibBuilder.loadTexts: an50pmpLinkMaxULBurstRate.setStatus('current') an50pmpLinkMaxHost = MibTableColumn((1, 3, 6, 1, 4, 1, 10728, 2, 51, 1, 1, 7), Integer32()).setMaxAccess("readwrite") if mibBuilder.loadTexts: an50pmpLinkMaxHost.setStatus('obsolete') an50pmpLinkCIDDLCIR = MibTableColumn((1, 3, 6, 1, 4, 1, 10728, 2, 51, 1, 1, 8), Integer32().subtype(subtypeSpec=ValueRangeConstraint(0, 65535))).setMaxAccess("readwrite") if mibBuilder.loadTexts: an50pmpLinkCIDDLCIR.setStatus('obsolete') an50pmpLinkCIDDLPIR = MibTableColumn((1, 3, 6, 1, 4, 1, 10728, 2, 51, 1, 1, 9), Integer32().subtype(subtypeSpec=ValueRangeConstraint(1, 65535))).setMaxAccess("readwrite") if mibBuilder.loadTexts: an50pmpLinkCIDDLPIR.setStatus('obsolete') an50pmpLinkCIDULCIR = MibTableColumn((1, 3, 6, 1, 4, 1, 10728, 2, 51, 1, 1, 10), Integer32().subtype(subtypeSpec=ValueRangeConstraint(0, 65535))).setMaxAccess("readwrite") if mibBuilder.loadTexts: an50pmpLinkCIDULCIR.setStatus('obsolete') an50pmpLinkCIDULPIR = MibTableColumn((1, 3, 6, 1, 4, 1, 10728, 2, 51, 1, 1, 11), Integer32().subtype(subtypeSpec=ValueRangeConstraint(0, 65535))).setMaxAccess("readwrite") if mibBuilder.loadTexts: an50pmpLinkCIDULPIR.setStatus('obsolete') an50pmpLinkDLQoS = MibTableColumn((1, 3, 6, 1, 4, 1, 10728, 2, 51, 1, 1, 12), Integer32().subtype(subtypeSpec=ValueRangeConstraint(1, 54))).setMaxAccess("readwrite") if mibBuilder.loadTexts: an50pmpLinkDLQoS.setStatus('obsolete') an50pmpLinkULQoS = MibTableColumn((1, 3, 6, 1, 4, 1, 10728, 2, 51, 1, 1, 13), Integer32().subtype(subtypeSpec=ValueRangeConstraint(1, 54))).setMaxAccess("readwrite") if mibBuilder.loadTexts: an50pmpLinkULQoS.setStatus('obsolete') an50pmpLinkEncryptionKey = MibTableColumn((1, 3, 6, 1, 4, 1, 10728, 2, 51, 1, 1, 15), OctetString().subtype(subtypeSpec=ValueSizeConstraint(0, 16))).setMaxAccess("readwrite") if mibBuilder.loadTexts: an50pmpLinkEncryptionKey.setStatus('current') an50pmpLinkRowStatus = MibTableColumn((1, 3, 6, 1, 4, 1, 10728, 2, 51, 1, 1, 14), RowStatus().clone('createAndWait')).setMaxAccess("readwrite") if mibBuilder.loadTexts: an50pmpLinkRowStatus.setStatus('current') an50pmpLinkStatusTable = MibTable((1, 3, 6, 1, 4, 1, 10728, 2, 51, 2), ) if mibBuilder.loadTexts: an50pmpLinkStatusTable.setStatus('current') an50pmpLinkStatusEntry = MibTableRow((1, 3, 6, 1, 4, 1, 10728, 2, 51, 2, 1), ).setIndexNames((0, "REDLINE-AN50-PMP-V2-MIB", "an50pmpLinkStatusID")) if mibBuilder.loadTexts: an50pmpLinkStatusEntry.setStatus('current') an50pmpLinkStatusID = MibTableColumn((1, 3, 6, 1, 4, 1, 10728, 2, 51, 2, 1, 1), Integer32().subtype(subtypeSpec=ValueRangeConstraint(1, 1024))) if mibBuilder.loadTexts: an50pmpLinkStatusID.setStatus('current') an50pmpLinkStatus = MibTableColumn((1, 3, 6, 1, 4, 1, 10728, 2, 51, 2, 1, 2), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2))).clone(namedValues=NamedValues(("up", 1), ("down", 2)))).setMaxAccess("readonly") if mibBuilder.loadTexts: an50pmpLinkStatus.setStatus('current') an50pmpLinkStatusCode = MibTableColumn((1, 3, 6, 1, 4, 1, 10728, 2, 51, 2, 1, 3), Integer32()).setMaxAccess("readonly") if mibBuilder.loadTexts: an50pmpLinkStatusCode.setStatus('current') an50pmpLinkRegConn = MibTableColumn((1, 3, 6, 1, 4, 1, 10728, 2, 51, 2, 1, 4), Integer32().subtype(subtypeSpec=ValueRangeConstraint(1, 1024))).setMaxAccess("readonly") if mibBuilder.loadTexts: an50pmpLinkRegConn.setStatus('current') an50pmpLinkDLBurstRate = MibTableColumn((1, 3, 6, 1, 4, 1, 10728, 2, 51, 2, 1, 5), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2, 3, 4, 5, 6, 7, 8))).clone(namedValues=NamedValues(("tx6Mbs", 1), ("tx9Mbs", 2), ("tx12Mbs", 3), ("tx18Mbs", 4), ("tx24Mbs", 5), ("tx36Mbs", 6), ("tx48Mbs", 7), ("tx54Mbs", 8)))).setMaxAccess("readonly") if mibBuilder.loadTexts: an50pmpLinkDLBurstRate.setStatus('current') an50pmpLinkDLRSSI = MibTableColumn((1, 3, 6, 1, 4, 1, 10728, 2, 51, 2, 1, 6), Integer32()).setMaxAccess("readonly") if mibBuilder.loadTexts: an50pmpLinkDLRSSI.setStatus('current') an50pmpLinkDLSINADR = MibTableColumn((1, 3, 6, 1, 4, 1, 10728, 2, 51, 2, 1, 7), Integer32()).setMaxAccess("readonly") if mibBuilder.loadTexts: an50pmpLinkDLSINADR.setStatus('current') an50pmpLinkDLStatLostFrm = MibTableColumn((1, 3, 6, 1, 4, 1, 10728, 2, 51, 2, 1, 8), Integer32()).setMaxAccess("readonly") if mibBuilder.loadTexts: an50pmpLinkDLStatLostFrm.setStatus('current') an50pmpLinkDLStatBlksTot = MibTableColumn((1, 3, 6, 1, 4, 1, 10728, 2, 51, 2, 1, 9), Integer32()).setMaxAccess("readonly") if mibBuilder.loadTexts: an50pmpLinkDLStatBlksTot.setStatus('current') an50pmpLinkDLStatBlksRetr = MibTableColumn((1, 3, 6, 1, 4, 1, 10728, 2, 51, 2, 1, 10), Integer32()).setMaxAccess("readonly") if mibBuilder.loadTexts: an50pmpLinkDLStatBlksRetr.setStatus('current') an50pmpLinkDLStatBlksDisc = MibTableColumn((1, 3, 6, 1, 4, 1, 10728, 2, 51, 2, 1, 11), Integer32()).setMaxAccess("readonly") if mibBuilder.loadTexts: an50pmpLinkDLStatBlksDisc.setStatus('current') an50pmpLinkDLCIDStatPktDisc = MibTableColumn((1, 3, 6, 1, 4, 1, 10728, 2, 51, 2, 1, 12), Integer32()).setMaxAccess("readonly") if mibBuilder.loadTexts: an50pmpLinkDLCIDStatPktDisc.setStatus('current') an50pmpLinkDLCIDStatPktTran = MibTableColumn((1, 3, 6, 1, 4, 1, 10728, 2, 51, 2, 1, 13), Integer32()).setMaxAccess("readonly") if mibBuilder.loadTexts: an50pmpLinkDLCIDStatPktTran.setStatus('current') an50pmpLinkDLCIDStatPktRecv = MibTableColumn((1, 3, 6, 1, 4, 1, 10728, 2, 51, 2, 1, 14), Integer32()).setMaxAccess("readonly") if mibBuilder.loadTexts: an50pmpLinkDLCIDStatPktRecv.setStatus('current') an50pmpLinkULBurstRate = MibTableColumn((1, 3, 6, 1, 4, 1, 10728, 2, 51, 2, 1, 15), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2, 3, 4, 5, 6, 7, 8))).clone(namedValues=NamedValues(("tx6Mbs", 1), ("tx9Mbs", 2), ("tx12Mbs", 3), ("tx18Mbs", 4), ("tx24Mbs", 5), ("tx36Mbs", 6), ("tx48Mbs", 7), ("tx54Mbs", 8)))).setMaxAccess("readonly") if mibBuilder.loadTexts: an50pmpLinkULBurstRate.setStatus('current') an50pmpLinkULRSSI = MibTableColumn((1, 3, 6, 1, 4, 1, 10728, 2, 51, 2, 1, 16), Integer32()).setMaxAccess("readonly") if mibBuilder.loadTexts: an50pmpLinkULRSSI.setStatus('current') an50pmpLinkULSINADR = MibTableColumn((1, 3, 6, 1, 4, 1, 10728, 2, 51, 2, 1, 17), Integer32()).setMaxAccess("readonly") if mibBuilder.loadTexts: an50pmpLinkULSINADR.setStatus('current') an50pmpLinkULStatLostFrm = MibTableColumn((1, 3, 6, 1, 4, 1, 10728, 2, 51, 2, 1, 18), Integer32()).setMaxAccess("readonly") if mibBuilder.loadTexts: an50pmpLinkULStatLostFrm.setStatus('current') an50pmpLinkULStatBlksTot = MibTableColumn((1, 3, 6, 1, 4, 1, 10728, 2, 51, 2, 1, 19), Integer32()).setMaxAccess("readonly") if mibBuilder.loadTexts: an50pmpLinkULStatBlksTot.setStatus('current') an50pmpLinkULStatBlksRetr = MibTableColumn((1, 3, 6, 1, 4, 1, 10728, 2, 51, 2, 1, 20), Integer32()).setMaxAccess("readonly") if mibBuilder.loadTexts: an50pmpLinkULStatBlksRetr.setStatus('current') an50pmpLinkULStatBlksDisc = MibTableColumn((1, 3, 6, 1, 4, 1, 10728, 2, 51, 2, 1, 21), Integer32()).setMaxAccess("readonly") if mibBuilder.loadTexts: an50pmpLinkULStatBlksDisc.setStatus('current') an50pmpLinkULCIDStatPktDisc = MibTableColumn((1, 3, 6, 1, 4, 1, 10728, 2, 51, 2, 1, 22), Integer32()).setMaxAccess("readonly") if mibBuilder.loadTexts: an50pmpLinkULCIDStatPktDisc.setStatus('current') an50pmpLinkULCIDStatPktTran = MibTableColumn((1, 3, 6, 1, 4, 1, 10728, 2, 51, 2, 1, 23), Integer32()).setMaxAccess("readonly") if mibBuilder.loadTexts: an50pmpLinkULCIDStatPktTran.setStatus('current') an50pmpLinkULCIDStatPktRecv = MibTableColumn((1, 3, 6, 1, 4, 1, 10728, 2, 51, 2, 1, 24), Integer32()).setMaxAccess("readonly") if mibBuilder.loadTexts: an50pmpLinkULCIDStatPktRecv.setStatus('current') an50pmpLinkUpTime = MibTableColumn((1, 3, 6, 1, 4, 1, 10728, 2, 51, 2, 1, 25), TimeTicks()).setMaxAccess("readonly") if mibBuilder.loadTexts: an50pmpLinkUpTime.setStatus('current') an50pmpLinkLostCount = MibTableColumn((1, 3, 6, 1, 4, 1, 10728, 2, 51, 2, 1, 26), Integer32()).setMaxAccess("readonly") if mibBuilder.loadTexts: an50pmpLinkLostCount.setStatus('current') an50pmpCIDSaveConfig = MibScalar((1, 3, 6, 1, 4, 1, 10728, 2, 51, 3), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2))).clone(namedValues=NamedValues(("doNothing", 1), ("saveConfig", 2)))).setMaxAccess("readwrite") if mibBuilder.loadTexts: an50pmpCIDSaveConfig.setStatus('current') an50pmpLastModifiedCID = MibScalar((1, 3, 6, 1, 4, 1, 10728, 2, 51, 4), Integer32().subtype(subtypeSpec=ValueRangeConstraint(4, 1023))).setMaxAccess("readonly") if mibBuilder.loadTexts: an50pmpLastModifiedCID.setStatus('current') an50pmpLastMissedSsMacAddress = MibScalar((1, 3, 6, 1, 4, 1, 10728, 2, 51, 5), OctetString()).setMaxAccess("readonly") if mibBuilder.loadTexts: an50pmpLastMissedSsMacAddress.setStatus('current') an50pmpLastRegisteredSsMacAddress = MibScalar((1, 3, 6, 1, 4, 1, 10728, 2, 51, 6), OctetString()).setMaxAccess("readonly") if mibBuilder.loadTexts: an50pmpLastRegisteredSsMacAddress.setStatus('current') an50pmpLastSuccessfulID = MibScalar((1, 3, 6, 1, 4, 1, 10728, 2, 51, 7), Integer32().subtype(subtypeSpec=ValueRangeConstraint(4, 1023))).setMaxAccess("readonly") if mibBuilder.loadTexts: an50pmpLastSuccessfulID.setStatus('current') an50pmpLastDeniedSsMacAddress = MibScalar((1, 3, 6, 1, 4, 1, 10728, 2, 51, 8), OctetString()).setMaxAccess("readwrite") if mibBuilder.loadTexts: an50pmpLastDeniedSsMacAddress.setStatus('current') an50pmpGroupTable = MibTable((1, 3, 6, 1, 4, 1, 10728, 2, 51, 9), ) if mibBuilder.loadTexts: an50pmpGroupTable.setStatus('current') an50pmpGroupEntry = MibTableRow((1, 3, 6, 1, 4, 1, 10728, 2, 51, 9, 1), ).setIndexNames((0, "REDLINE-AN50-PMP-V2-MIB", "an50pmpGroupId")) if mibBuilder.loadTexts: an50pmpGroupEntry.setStatus('current') an50pmpGroupId = MibTableColumn((1, 3, 6, 1, 4, 1, 10728, 2, 51, 9, 1, 1), Integer32().subtype(subtypeSpec=ValueRangeConstraint(1, 65536))) if mibBuilder.loadTexts: an50pmpGroupId.setStatus('current') an50pmpGroupName = MibTableColumn((1, 3, 6, 1, 4, 1, 10728, 2, 51, 9, 1, 2), OctetString().subtype(subtypeSpec=ValueSizeConstraint(0, 15))).setMaxAccess("readwrite") if mibBuilder.loadTexts: an50pmpGroupName.setStatus('current') an50pmpGroupBSPortTagging = MibTableColumn((1, 3, 6, 1, 4, 1, 10728, 2, 51, 9, 1, 3), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2))).clone(namedValues=NamedValues(("passThrough", 1), ("tagged", 2)))).setMaxAccess("readwrite") if mibBuilder.loadTexts: an50pmpGroupBSPortTagging.setStatus('current') an50pmpGroupVlanId = MibTableColumn((1, 3, 6, 1, 4, 1, 10728, 2, 51, 9, 1, 4), Integer32().subtype(subtypeSpec=ValueRangeConstraint(1, 65536))).setMaxAccess("readwrite") if mibBuilder.loadTexts: an50pmpGroupVlanId.setStatus('current') an50pmpGroupDefaultPriority = MibTableColumn((1, 3, 6, 1, 4, 1, 10728, 2, 51, 9, 1, 5), Integer32().subtype(subtypeSpec=ValueRangeConstraint(0, 65536))).setMaxAccess("readwrite") if mibBuilder.loadTexts: an50pmpGroupDefaultPriority.setStatus('current') an50pmpGroupBSPortEnabled = MibTableColumn((1, 3, 6, 1, 4, 1, 10728, 2, 51, 9, 1, 6), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2))).clone(namedValues=NamedValues(("off", 1), ("on", 2))).clone('off')).setMaxAccess("readwrite") if mibBuilder.loadTexts: an50pmpGroupBSPortEnabled.setStatus('current') an50pmpGroupQos = MibTableColumn((1, 3, 6, 1, 4, 1, 10728, 2, 51, 9, 1, 7), Integer32().subtype(subtypeSpec=ValueRangeConstraint(0, 65536))).setMaxAccess("readwrite") if mibBuilder.loadTexts: an50pmpGroupQos.setStatus('current') an50pmpGroupRowStatus = MibTableColumn((1, 3, 6, 1, 4, 1, 10728, 2, 51, 9, 1, 8), RowStatus().clone('createAndWait')).setMaxAccess("readwrite") if mibBuilder.loadTexts: an50pmpGroupRowStatus.setStatus('current') an50pmpConnectionTable = MibTable((1, 3, 6, 1, 4, 1, 10728, 2, 51, 10), ) if mibBuilder.loadTexts: an50pmpConnectionTable.setStatus('current') an50pmpConnectionEntry = MibTableRow((1, 3, 6, 1, 4, 1, 10728, 2, 51, 10, 1), ).setIndexNames((0, "REDLINE-AN50-PMP-V2-MIB", "an50pmpConnectionId")) if mibBuilder.loadTexts: an50pmpConnectionEntry.setStatus('current') an50pmpConnectionId = MibTableColumn((1, 3, 6, 1, 4, 1, 10728, 2, 51, 10, 1, 1), Integer32().subtype(subtypeSpec=ValueRangeConstraint(1, 65536))) if mibBuilder.loadTexts: an50pmpConnectionId.setStatus('current') an50pmpConnectionName = MibTableColumn((1, 3, 6, 1, 4, 1, 10728, 2, 51, 10, 1, 2), OctetString().subtype(subtypeSpec=ValueSizeConstraint(0, 15))).setMaxAccess("readwrite") if mibBuilder.loadTexts: an50pmpConnectionName.setStatus('current') an50pmpConnectionPortTagging = MibTableColumn((1, 3, 6, 1, 4, 1, 10728, 2, 51, 10, 1, 3), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2))).clone(namedValues=NamedValues(("passThrough", 1), ("tagged", 2)))).setMaxAccess("readwrite") if mibBuilder.loadTexts: an50pmpConnectionPortTagging.setStatus('current') an50pmpConnectionVlanId = MibTableColumn((1, 3, 6, 1, 4, 1, 10728, 2, 51, 10, 1, 4), Integer32().subtype(subtypeSpec=ValueRangeConstraint(0, 65536))).setMaxAccess("readwrite") if mibBuilder.loadTexts: an50pmpConnectionVlanId.setStatus('current') an50pmpConnectionDefaultPriority = MibTableColumn((1, 3, 6, 1, 4, 1, 10728, 2, 51, 10, 1, 5), Integer32().subtype(subtypeSpec=ValueRangeConstraint(0, 65536))).setMaxAccess("readwrite") if mibBuilder.loadTexts: an50pmpConnectionDefaultPriority.setStatus('current') an50pmpConnectionParentLink = MibTableColumn((1, 3, 6, 1, 4, 1, 10728, 2, 51, 10, 1, 6), Integer32().subtype(subtypeSpec=ValueRangeConstraint(0, 65536))).setMaxAccess("readwrite") if mibBuilder.loadTexts: an50pmpConnectionParentLink.setStatus('current') an50pmpConnectionParentGroup = MibTableColumn((1, 3, 6, 1, 4, 1, 10728, 2, 51, 10, 1, 7), Integer32().subtype(subtypeSpec=ValueRangeConstraint(0, 65536))).setMaxAccess("readwrite") if mibBuilder.loadTexts: an50pmpConnectionParentGroup.setStatus('current') an50pmpConnectionDLQoS = MibTableColumn((1, 3, 6, 1, 4, 1, 10728, 2, 51, 10, 1, 8), Integer32().subtype(subtypeSpec=ValueRangeConstraint(0, 65536))).setMaxAccess("readwrite") if mibBuilder.loadTexts: an50pmpConnectionDLQoS.setStatus('current') an50pmpConnectionULQoS = MibTableColumn((1, 3, 6, 1, 4, 1, 10728, 2, 51, 10, 1, 9), Integer32().subtype(subtypeSpec=ValueRangeConstraint(0, 65536))).setMaxAccess("readwrite") if mibBuilder.loadTexts: an50pmpConnectionULQoS.setStatus('current') an50pmpConnectionRowStatus = MibTableColumn((1, 3, 6, 1, 4, 1, 10728, 2, 51, 10, 1, 10), RowStatus().clone('createAndWait')).setMaxAccess("readwrite") if mibBuilder.loadTexts: an50pmpConnectionRowStatus.setStatus('current') an50pmpGroupStatusTable = MibTable((1, 3, 6, 1, 4, 1, 10728, 2, 51, 11), ) if mibBuilder.loadTexts: an50pmpGroupStatusTable.setStatus('current') an50pmpGroupStatusEntry = MibTableRow((1, 3, 6, 1, 4, 1, 10728, 2, 51, 11, 1), ).setIndexNames((0, "REDLINE-AN50-PMP-V2-MIB", "an50pmpGroupStatusId")) if mibBuilder.loadTexts: an50pmpGroupStatusEntry.setStatus('current') an50pmpGroupStatusId = MibTableColumn((1, 3, 6, 1, 4, 1, 10728, 2, 51, 11, 1, 1), Integer32().subtype(subtypeSpec=ValueRangeConstraint(1, 65536))) if mibBuilder.loadTexts: an50pmpGroupStatusId.setStatus('current') an50pmpGroupStatusDLPacketsDiscards = MibTableColumn((1, 3, 6, 1, 4, 1, 10728, 2, 51, 11, 1, 2), Counter32()).setMaxAccess("readonly") if mibBuilder.loadTexts: an50pmpGroupStatusDLPacketsDiscards.setStatus('current') an50pmpGroupStatusDLPacketsTx = MibTableColumn((1, 3, 6, 1, 4, 1, 10728, 2, 51, 11, 1, 3), Counter32()).setMaxAccess("readonly") if mibBuilder.loadTexts: an50pmpGroupStatusDLPacketsTx.setStatus('current') an50pmpGroupStatusDLPacketsRx = MibTableColumn((1, 3, 6, 1, 4, 1, 10728, 2, 51, 11, 1, 4), Counter32()).setMaxAccess("readonly") if mibBuilder.loadTexts: an50pmpGroupStatusDLPacketsRx.setStatus('current') an50pmpGroupStatusULPacketsDiscards = MibTableColumn((1, 3, 6, 1, 4, 1, 10728, 2, 51, 11, 1, 5), Counter32()).setMaxAccess("readonly") if mibBuilder.loadTexts: an50pmpGroupStatusULPacketsDiscards.setStatus('current') an50pmpGroupStatusULPacketsTx = MibTableColumn((1, 3, 6, 1, 4, 1, 10728, 2, 51, 11, 1, 6), Counter32()).setMaxAccess("readonly") if mibBuilder.loadTexts: an50pmpGroupStatusULPacketsTx.setStatus('current') an50pmpGroupStatusULPacketsRx = MibTableColumn((1, 3, 6, 1, 4, 1, 10728, 2, 51, 11, 1, 7), Counter32()).setMaxAccess("readonly") if mibBuilder.loadTexts: an50pmpGroupStatusULPacketsRx.setStatus('current') an50pmpConnectionStatusTable = MibTable((1, 3, 6, 1, 4, 1, 10728, 2, 51, 12), ) if mibBuilder.loadTexts: an50pmpConnectionStatusTable.setStatus('current') an50pmpConnectionStatusEntry = MibTableRow((1, 3, 6, 1, 4, 1, 10728, 2, 51, 12, 1), ).setIndexNames((0, "REDLINE-AN50-PMP-V2-MIB", "an50pmpConnectionStatusId")) if mibBuilder.loadTexts: an50pmpConnectionStatusEntry.setStatus('current') an50pmpConnectionStatusId = MibTableColumn((1, 3, 6, 1, 4, 1, 10728, 2, 51, 12, 1, 1), Integer32().subtype(subtypeSpec=ValueRangeConstraint(1, 65536))) if mibBuilder.loadTexts: an50pmpConnectionStatusId.setStatus('current') an50pmpConnectionStatusDLPacketsDiscards = MibTableColumn((1, 3, 6, 1, 4, 1, 10728, 2, 51, 12, 1, 2), Counter32()).setMaxAccess("readonly") if mibBuilder.loadTexts: an50pmpConnectionStatusDLPacketsDiscards.setStatus('current') an50pmpConnectionStatusDLPacketsTx = MibTableColumn((1, 3, 6, 1, 4, 1, 10728, 2, 51, 12, 1, 3), Counter32()).setMaxAccess("readonly") if mibBuilder.loadTexts: an50pmpConnectionStatusDLPacketsTx.setStatus('current') an50pmpConnectionStatusDLPacketsRx = MibTableColumn((1, 3, 6, 1, 4, 1, 10728, 2, 51, 12, 1, 4), Counter32()).setMaxAccess("readonly") if mibBuilder.loadTexts: an50pmpConnectionStatusDLPacketsRx.setStatus('current') an50pmpConnectionStatusULPacketsDiscards = MibTableColumn((1, 3, 6, 1, 4, 1, 10728, 2, 51, 12, 1, 5), Counter32()).setMaxAccess("readonly") if mibBuilder.loadTexts: an50pmpConnectionStatusULPacketsDiscards.setStatus('current') an50pmpConnectionStatusULPacketsTx = MibTableColumn((1, 3, 6, 1, 4, 1, 10728, 2, 51, 12, 1, 6), Counter32()).setMaxAccess("readonly") if mibBuilder.loadTexts: an50pmpConnectionStatusULPacketsTx.setStatus('current') an50pmpConnectionStatusULPacketsRx = MibTableColumn((1, 3, 6, 1, 4, 1, 10728, 2, 51, 12, 1, 7), Counter32()).setMaxAccess("readonly") if mibBuilder.loadTexts: an50pmpConnectionStatusULPacketsRx.setStatus('current') an50PMPObjectGroup = ObjectGroup((1, 3, 6, 1, 4, 1, 10728, 2, 51, 13)).setObjects(("REDLINE-AN50-PMP-V2-MIB", "an50pmpLinkName"), ("REDLINE-AN50-PMP-V2-MIB", "an50pmpLinkPeerMac"), ("REDLINE-AN50-PMP-V2-MIB", "an50pmpLinkMaxDLBurstRate"), ("REDLINE-AN50-PMP-V2-MIB", "an50pmpLinkMaxULBurstRate"), ("REDLINE-AN50-PMP-V2-MIB", "an50pmpLinkEncryptionKey"), ("REDLINE-AN50-PMP-V2-MIB", "an50pmpLinkRowStatus"), ("REDLINE-AN50-PMP-V2-MIB", "an50pmpLinkStatus"), ("REDLINE-AN50-PMP-V2-MIB", "an50pmpLinkStatusCode"), ("REDLINE-AN50-PMP-V2-MIB", "an50pmpLinkRegConn"), ("REDLINE-AN50-PMP-V2-MIB", "an50pmpLinkDLBurstRate"), ("REDLINE-AN50-PMP-V2-MIB", "an50pmpLinkDLRSSI"), ("REDLINE-AN50-PMP-V2-MIB", "an50pmpLinkDLSINADR"), ("REDLINE-AN50-PMP-V2-MIB", "an50pmpLinkDLStatLostFrm"), ("REDLINE-AN50-PMP-V2-MIB", "an50pmpLinkDLStatBlksTot"), ("REDLINE-AN50-PMP-V2-MIB", "an50pmpLinkDLStatBlksRetr"), ("REDLINE-AN50-PMP-V2-MIB", "an50pmpLinkDLStatBlksDisc"), ("REDLINE-AN50-PMP-V2-MIB", "an50pmpLinkDLCIDStatPktDisc"), ("REDLINE-AN50-PMP-V2-MIB", "an50pmpLinkDLCIDStatPktTran"), ("REDLINE-AN50-PMP-V2-MIB", "an50pmpLinkDLCIDStatPktRecv"), ("REDLINE-AN50-PMP-V2-MIB", "an50pmpLinkULBurstRate"), ("REDLINE-AN50-PMP-V2-MIB", "an50pmpLinkULRSSI"), ("REDLINE-AN50-PMP-V2-MIB", "an50pmpLinkULSINADR"), ("REDLINE-AN50-PMP-V2-MIB", "an50pmpLinkULStatLostFrm"), ("REDLINE-AN50-PMP-V2-MIB", "an50pmpLinkULStatBlksTot"), ("REDLINE-AN50-PMP-V2-MIB", "an50pmpLinkULStatBlksRetr"), ("REDLINE-AN50-PMP-V2-MIB", "an50pmpLinkULStatBlksDisc"), ("REDLINE-AN50-PMP-V2-MIB", "an50pmpLinkULCIDStatPktDisc"), ("REDLINE-AN50-PMP-V2-MIB", "an50pmpLinkULCIDStatPktTran"), ("REDLINE-AN50-PMP-V2-MIB", "an50pmpLinkULCIDStatPktRecv"), ("REDLINE-AN50-PMP-V2-MIB", "an50pmpLinkUpTime"), ("REDLINE-AN50-PMP-V2-MIB", "an50pmpLinkLostCount"), ("REDLINE-AN50-PMP-V2-MIB", "an50pmpCIDSaveConfig"), ("REDLINE-AN50-PMP-V2-MIB", "an50pmpLastModifiedCID"), ("REDLINE-AN50-PMP-V2-MIB", "an50pmpLastMissedSsMacAddress"), ("REDLINE-AN50-PMP-V2-MIB", "an50pmpLastRegisteredSsMacAddress"), ("REDLINE-AN50-PMP-V2-MIB", "an50pmpLastSuccessfulID"), ("REDLINE-AN50-PMP-V2-MIB", "an50pmpLastDeniedSsMacAddress"), ("REDLINE-AN50-PMP-V2-MIB", "an50pmpGroupName"), ("REDLINE-AN50-PMP-V2-MIB", "an50pmpGroupBSPortTagging"), ("REDLINE-AN50-PMP-V2-MIB", "an50pmpGroupVlanId"), ("REDLINE-AN50-PMP-V2-MIB", "an50pmpGroupDefaultPriority"), ("REDLINE-AN50-PMP-V2-MIB", "an50pmpGroupBSPortEnabled"), ("REDLINE-AN50-PMP-V2-MIB", "an50pmpGroupQos"), ("REDLINE-AN50-PMP-V2-MIB", "an50pmpGroupRowStatus"), ("REDLINE-AN50-PMP-V2-MIB", "an50pmpConnectionName"), ("REDLINE-AN50-PMP-V2-MIB", "an50pmpConnectionPortTagging"), ("REDLINE-AN50-PMP-V2-MIB", "an50pmpConnectionVlanId"), ("REDLINE-AN50-PMP-V2-MIB", "an50pmpConnectionDefaultPriority"), ("REDLINE-AN50-PMP-V2-MIB", "an50pmpConnectionParentLink"), ("REDLINE-AN50-PMP-V2-MIB", "an50pmpConnectionParentGroup"), ("REDLINE-AN50-PMP-V2-MIB", "an50pmpConnectionDLQoS"), ("REDLINE-AN50-PMP-V2-MIB", "an50pmpConnectionULQoS"), ("REDLINE-AN50-PMP-V2-MIB", "an50pmpConnectionRowStatus"), ("REDLINE-AN50-PMP-V2-MIB", "an50pmpGroupStatusDLPacketsDiscards"), ("REDLINE-AN50-PMP-V2-MIB", "an50pmpGroupStatusDLPacketsTx"), ("REDLINE-AN50-PMP-V2-MIB", "an50pmpGroupStatusDLPacketsRx"), ("REDLINE-AN50-PMP-V2-MIB", "an50pmpGroupStatusULPacketsDiscards"), ("REDLINE-AN50-PMP-V2-MIB", "an50pmpGroupStatusULPacketsTx"), ("REDLINE-AN50-PMP-V2-MIB", "an50pmpGroupStatusULPacketsRx"), ("REDLINE-AN50-PMP-V2-MIB", "an50pmpConnectionStatusDLPacketsDiscards"), ("REDLINE-AN50-PMP-V2-MIB", "an50pmpConnectionStatusDLPacketsTx"), ("REDLINE-AN50-PMP-V2-MIB", "an50pmpConnectionStatusDLPacketsRx"), ("REDLINE-AN50-PMP-V2-MIB", "an50pmpConnectionStatusULPacketsDiscards"), ("REDLINE-AN50-PMP-V2-MIB", "an50pmpConnectionStatusULPacketsTx"), ("REDLINE-AN50-PMP-V2-MIB", "an50pmpConnectionStatusULPacketsRx")) if getattr(mibBuilder, 'version', (0, 0, 0)) > (4, 4, 0): an50PMPObjectGroup = an50PMPObjectGroup.setStatus('current') an50PMPObsoleteObjectGroup = ObjectGroup((1, 3, 6, 1, 4, 1, 10728, 2, 51, 14)).setObjects(("REDLINE-AN50-PMP-V2-MIB", "an50pmpLinkGroupId"), ("REDLINE-AN50-PMP-V2-MIB", "an50pmpLinkMaxHost"), ("REDLINE-AN50-PMP-V2-MIB", "an50pmpLinkCIDDLCIR"), ("REDLINE-AN50-PMP-V2-MIB", "an50pmpLinkCIDDLPIR"), ("REDLINE-AN50-PMP-V2-MIB", "an50pmpLinkCIDULCIR"), ("REDLINE-AN50-PMP-V2-MIB", "an50pmpLinkCIDULPIR"), ("REDLINE-AN50-PMP-V2-MIB", "an50pmpLinkDLQoS"), ("REDLINE-AN50-PMP-V2-MIB", "an50pmpLinkULQoS")) if getattr(mibBuilder, 'version', (0, 0, 0)) > (4, 4, 0): an50PMPObsoleteObjectGroup = an50PMPObsoleteObjectGroup.setStatus('obsolete') mibBuilder.exportSymbols("REDLINE-AN50-PMP-V2-MIB", an50pmpLinkULQoS=an50pmpLinkULQoS, an50pmpLinkULCIDStatPktRecv=an50pmpLinkULCIDStatPktRecv, an50pmpLinkRowStatus=an50pmpLinkRowStatus, an50pmpLinkDLStatBlksTot=an50pmpLinkDLStatBlksTot, an50pmpConnectionStatusId=an50pmpConnectionStatusId, an50pmpGroupTable=an50pmpGroupTable, an50pmpConnectionId=an50pmpConnectionId, an50pmpLinkLostCount=an50pmpLinkLostCount, an50pmpLastMissedSsMacAddress=an50pmpLastMissedSsMacAddress, an50pmpGroupStatusEntry=an50pmpGroupStatusEntry, an50pmpGroupStatusDLPacketsRx=an50pmpGroupStatusDLPacketsRx, an50pmpConnectionDefaultPriority=an50pmpConnectionDefaultPriority, an50pmpConnectionTable=an50pmpConnectionTable, an50pmpLastModifiedCID=an50pmpLastModifiedCID, an50pmpConnectionStatusULPacketsRx=an50pmpConnectionStatusULPacketsRx, an50PMPObsoleteObjectGroup=an50PMPObsoleteObjectGroup, an50pmpConnectionStatusDLPacketsDiscards=an50pmpConnectionStatusDLPacketsDiscards, an50pmpLinkDLRSSI=an50pmpLinkDLRSSI, an50pmpGroupEntry=an50pmpGroupEntry, an50pmpConnectionStatusULPacketsDiscards=an50pmpConnectionStatusULPacketsDiscards, an50pmpGroupStatusULPacketsDiscards=an50pmpGroupStatusULPacketsDiscards, an50pmpGroupQos=an50pmpGroupQos, an50pmpConnectionName=an50pmpConnectionName, an50pmpConnectionPortTagging=an50pmpConnectionPortTagging, redlineAN50PMPV2=redlineAN50PMPV2, an50pmpLinkCIDULCIR=an50pmpLinkCIDULCIR, an50pmpLinkDLCIDStatPktRecv=an50pmpLinkDLCIDStatPktRecv, an50pmpLinkMaxULBurstRate=an50pmpLinkMaxULBurstRate, an50pmpGroupBSPortEnabled=an50pmpGroupBSPortEnabled, an50pmpLinkName=an50pmpLinkName, an50pmpGroupRowStatus=an50pmpGroupRowStatus, an50pmpConnectionEntry=an50pmpConnectionEntry, an50pmpLinkCIDDLPIR=an50pmpLinkCIDDLPIR, an50pmpCIDSaveConfig=an50pmpCIDSaveConfig, an50pmpLinkDLStatLostFrm=an50pmpLinkDLStatLostFrm, an50pmpConnectionDLQoS=an50pmpConnectionDLQoS, an50pmpConnectionStatusULPacketsTx=an50pmpConnectionStatusULPacketsTx, an50pmpLinkEntry=an50pmpLinkEntry, an50pmpGroupStatusTable=an50pmpGroupStatusTable, an50pmpLinkPeerMac=an50pmpLinkPeerMac, an50pmpLinkID=an50pmpLinkID, an50pmpConnectionStatusDLPacketsTx=an50pmpConnectionStatusDLPacketsTx, an50pmpLinkDLCIDStatPktDisc=an50pmpLinkDLCIDStatPktDisc, an50pmpLinkStatusID=an50pmpLinkStatusID, an50pmpLinkMaxDLBurstRate=an50pmpLinkMaxDLBurstRate, an50pmpConnectionRowStatus=an50pmpConnectionRowStatus, an50pmpGroupStatusULPacketsTx=an50pmpGroupStatusULPacketsTx, an50pmpLinkULSINADR=an50pmpLinkULSINADR, an50pmpLinkULBurstRate=an50pmpLinkULBurstRate, an50pmpLinkULCIDStatPktTran=an50pmpLinkULCIDStatPktTran, an50pmpGroupVlanId=an50pmpGroupVlanId, an50pmpLinkTable=an50pmpLinkTable, PYSNMP_MODULE_ID=redlineAN50PMPV2, an50pmpLinkDLSINADR=an50pmpLinkDLSINADR, an50pmpConnectionParentLink=an50pmpConnectionParentLink, an50pmpConnectionStatusTable=an50pmpConnectionStatusTable, an50pmpLinkStatus=an50pmpLinkStatus, an50pmpLinkDLStatBlksRetr=an50pmpLinkDLStatBlksRetr, an50pmpLastSuccessfulID=an50pmpLastSuccessfulID, an50pmpGroupStatusDLPacketsDiscards=an50pmpGroupStatusDLPacketsDiscards, an50pmpLinkDLCIDStatPktTran=an50pmpLinkDLCIDStatPktTran, an50pmpConnectionParentGroup=an50pmpConnectionParentGroup, an50pmpGroupStatusULPacketsRx=an50pmpGroupStatusULPacketsRx, an50pmpLinkULStatBlksRetr=an50pmpLinkULStatBlksRetr, an50pmpConnectionStatusDLPacketsRx=an50pmpConnectionStatusDLPacketsRx, an50pmpLinkDLQoS=an50pmpLinkDLQoS, an50pmpLinkStatusEntry=an50pmpLinkStatusEntry, an50pmpLinkCIDULPIR=an50pmpLinkCIDULPIR, an50pmpLinkDLStatBlksDisc=an50pmpLinkDLStatBlksDisc, an50pmpLinkUpTime=an50pmpLinkUpTime, an50pmpLinkULStatLostFrm=an50pmpLinkULStatLostFrm, an50pmpLinkMaxHost=an50pmpLinkMaxHost, an50pmpConnectionStatusEntry=an50pmpConnectionStatusEntry, an50pmpConnectionVlanId=an50pmpConnectionVlanId, an50pmpLinkRegConn=an50pmpLinkRegConn, an50pmpLinkEncryptionKey=an50pmpLinkEncryptionKey, an50pmpLinkDLBurstRate=an50pmpLinkDLBurstRate, an50pmpLinkULCIDStatPktDisc=an50pmpLinkULCIDStatPktDisc, an50pmpGroupStatusId=an50pmpGroupStatusId, an50PMPObjectGroup=an50PMPObjectGroup, an50pmpLastDeniedSsMacAddress=an50pmpLastDeniedSsMacAddress, an50pmpGroupStatusDLPacketsTx=an50pmpGroupStatusDLPacketsTx, an50pmpLinkULStatBlksTot=an50pmpLinkULStatBlksTot, an50pmpLinkCIDDLCIR=an50pmpLinkCIDDLCIR, an50pmpLinkULStatBlksDisc=an50pmpLinkULStatBlksDisc, an50pmpGroupBSPortTagging=an50pmpGroupBSPortTagging, an50pmpLinkStatusTable=an50pmpLinkStatusTable, an50pmpGroupName=an50pmpGroupName, an50pmpLinkGroupId=an50pmpLinkGroupId, an50pmpConnectionULQoS=an50pmpConnectionULQoS, an50pmpLinkStatusCode=an50pmpLinkStatusCode, an50pmpGroupId=an50pmpGroupId, an50pmpGroupDefaultPriority=an50pmpGroupDefaultPriority, an50pmpLastRegisteredSsMacAddress=an50pmpLastRegisteredSsMacAddress, an50pmpLinkULRSSI=an50pmpLinkULRSSI)
(octet_string, object_identifier, integer) = mibBuilder.importSymbols('ASN1', 'OctetString', 'ObjectIdentifier', 'Integer') (named_values,) = mibBuilder.importSymbols('ASN1-ENUMERATION', 'NamedValues') (constraints_union, value_range_constraint, single_value_constraint, constraints_intersection, value_size_constraint) = mibBuilder.importSymbols('ASN1-REFINEMENT', 'ConstraintsUnion', 'ValueRangeConstraint', 'SingleValueConstraint', 'ConstraintsIntersection', 'ValueSizeConstraint') (redline_mgmt,) = mibBuilder.importSymbols('REDLINE-MIB', 'redlineMgmt') (module_compliance, notification_group, object_group) = mibBuilder.importSymbols('SNMPv2-CONF', 'ModuleCompliance', 'NotificationGroup', 'ObjectGroup') (time_ticks, gauge32, module_identity, counter32, integer32, iso, bits, notification_type, object_identity, unsigned32, ip_address, mib_scalar, mib_table, mib_table_row, mib_table_column, mib_identifier, counter64) = mibBuilder.importSymbols('SNMPv2-SMI', 'TimeTicks', 'Gauge32', 'ModuleIdentity', 'Counter32', 'Integer32', 'iso', 'Bits', 'NotificationType', 'ObjectIdentity', 'Unsigned32', 'IpAddress', 'MibScalar', 'MibTable', 'MibTableRow', 'MibTableColumn', 'MibIdentifier', 'Counter64') (row_status, display_string, textual_convention) = mibBuilder.importSymbols('SNMPv2-TC', 'RowStatus', 'DisplayString', 'TextualConvention') redline_an50_pmpv2 = module_identity((1, 3, 6, 1, 4, 1, 10728, 2, 51)) if mibBuilder.loadTexts: redlineAN50PMPV2.setLastUpdated('200503160000Z') if mibBuilder.loadTexts: redlineAN50PMPV2.setOrganization('Redline Communications, Inc.') an50pmp_link_table = mib_table((1, 3, 6, 1, 4, 1, 10728, 2, 51, 1)) if mibBuilder.loadTexts: an50pmpLinkTable.setStatus('current') an50pmp_link_entry = mib_table_row((1, 3, 6, 1, 4, 1, 10728, 2, 51, 1, 1)).setIndexNames((0, 'REDLINE-AN50-PMP-V2-MIB', 'an50pmpLinkID')) if mibBuilder.loadTexts: an50pmpLinkEntry.setStatus('current') an50pmp_link_id = mib_table_column((1, 3, 6, 1, 4, 1, 10728, 2, 51, 1, 1, 1), integer32().subtype(subtypeSpec=value_range_constraint(0, 65536))) if mibBuilder.loadTexts: an50pmpLinkID.setStatus('current') an50pmp_link_name = mib_table_column((1, 3, 6, 1, 4, 1, 10728, 2, 51, 1, 1, 2), octet_string().subtype(subtypeSpec=value_size_constraint(1, 15))).setMaxAccess('readwrite') if mibBuilder.loadTexts: an50pmpLinkName.setStatus('current') an50pmp_link_group_id = mib_table_column((1, 3, 6, 1, 4, 1, 10728, 2, 51, 1, 1, 3), integer32().subtype(subtypeSpec=value_range_constraint(1, 1024))).setMaxAccess('readwrite') if mibBuilder.loadTexts: an50pmpLinkGroupId.setStatus('obsolete') an50pmp_link_peer_mac = mib_table_column((1, 3, 6, 1, 4, 1, 10728, 2, 51, 1, 1, 4), octet_string().subtype(subtypeSpec=value_size_constraint(0, 6))).setMaxAccess('readwrite') if mibBuilder.loadTexts: an50pmpLinkPeerMac.setStatus('current') an50pmp_link_max_dl_burst_rate = mib_table_column((1, 3, 6, 1, 4, 1, 10728, 2, 51, 1, 1, 5), integer32().subtype(subtypeSpec=value_range_constraint(1, 8))).setMaxAccess('readwrite') if mibBuilder.loadTexts: an50pmpLinkMaxDLBurstRate.setStatus('current') an50pmp_link_max_ul_burst_rate = mib_table_column((1, 3, 6, 1, 4, 1, 10728, 2, 51, 1, 1, 6), integer32().subtype(subtypeSpec=value_range_constraint(1, 8))).setMaxAccess('readwrite') if mibBuilder.loadTexts: an50pmpLinkMaxULBurstRate.setStatus('current') an50pmp_link_max_host = mib_table_column((1, 3, 6, 1, 4, 1, 10728, 2, 51, 1, 1, 7), integer32()).setMaxAccess('readwrite') if mibBuilder.loadTexts: an50pmpLinkMaxHost.setStatus('obsolete') an50pmp_link_ciddlcir = mib_table_column((1, 3, 6, 1, 4, 1, 10728, 2, 51, 1, 1, 8), integer32().subtype(subtypeSpec=value_range_constraint(0, 65535))).setMaxAccess('readwrite') if mibBuilder.loadTexts: an50pmpLinkCIDDLCIR.setStatus('obsolete') an50pmp_link_ciddlpir = mib_table_column((1, 3, 6, 1, 4, 1, 10728, 2, 51, 1, 1, 9), integer32().subtype(subtypeSpec=value_range_constraint(1, 65535))).setMaxAccess('readwrite') if mibBuilder.loadTexts: an50pmpLinkCIDDLPIR.setStatus('obsolete') an50pmp_link_cidulcir = mib_table_column((1, 3, 6, 1, 4, 1, 10728, 2, 51, 1, 1, 10), integer32().subtype(subtypeSpec=value_range_constraint(0, 65535))).setMaxAccess('readwrite') if mibBuilder.loadTexts: an50pmpLinkCIDULCIR.setStatus('obsolete') an50pmp_link_cidulpir = mib_table_column((1, 3, 6, 1, 4, 1, 10728, 2, 51, 1, 1, 11), integer32().subtype(subtypeSpec=value_range_constraint(0, 65535))).setMaxAccess('readwrite') if mibBuilder.loadTexts: an50pmpLinkCIDULPIR.setStatus('obsolete') an50pmp_link_dl_qo_s = mib_table_column((1, 3, 6, 1, 4, 1, 10728, 2, 51, 1, 1, 12), integer32().subtype(subtypeSpec=value_range_constraint(1, 54))).setMaxAccess('readwrite') if mibBuilder.loadTexts: an50pmpLinkDLQoS.setStatus('obsolete') an50pmp_link_ul_qo_s = mib_table_column((1, 3, 6, 1, 4, 1, 10728, 2, 51, 1, 1, 13), integer32().subtype(subtypeSpec=value_range_constraint(1, 54))).setMaxAccess('readwrite') if mibBuilder.loadTexts: an50pmpLinkULQoS.setStatus('obsolete') an50pmp_link_encryption_key = mib_table_column((1, 3, 6, 1, 4, 1, 10728, 2, 51, 1, 1, 15), octet_string().subtype(subtypeSpec=value_size_constraint(0, 16))).setMaxAccess('readwrite') if mibBuilder.loadTexts: an50pmpLinkEncryptionKey.setStatus('current') an50pmp_link_row_status = mib_table_column((1, 3, 6, 1, 4, 1, 10728, 2, 51, 1, 1, 14), row_status().clone('createAndWait')).setMaxAccess('readwrite') if mibBuilder.loadTexts: an50pmpLinkRowStatus.setStatus('current') an50pmp_link_status_table = mib_table((1, 3, 6, 1, 4, 1, 10728, 2, 51, 2)) if mibBuilder.loadTexts: an50pmpLinkStatusTable.setStatus('current') an50pmp_link_status_entry = mib_table_row((1, 3, 6, 1, 4, 1, 10728, 2, 51, 2, 1)).setIndexNames((0, 'REDLINE-AN50-PMP-V2-MIB', 'an50pmpLinkStatusID')) if mibBuilder.loadTexts: an50pmpLinkStatusEntry.setStatus('current') an50pmp_link_status_id = mib_table_column((1, 3, 6, 1, 4, 1, 10728, 2, 51, 2, 1, 1), integer32().subtype(subtypeSpec=value_range_constraint(1, 1024))) if mibBuilder.loadTexts: an50pmpLinkStatusID.setStatus('current') an50pmp_link_status = mib_table_column((1, 3, 6, 1, 4, 1, 10728, 2, 51, 2, 1, 2), integer32().subtype(subtypeSpec=constraints_union(single_value_constraint(1, 2))).clone(namedValues=named_values(('up', 1), ('down', 2)))).setMaxAccess('readonly') if mibBuilder.loadTexts: an50pmpLinkStatus.setStatus('current') an50pmp_link_status_code = mib_table_column((1, 3, 6, 1, 4, 1, 10728, 2, 51, 2, 1, 3), integer32()).setMaxAccess('readonly') if mibBuilder.loadTexts: an50pmpLinkStatusCode.setStatus('current') an50pmp_link_reg_conn = mib_table_column((1, 3, 6, 1, 4, 1, 10728, 2, 51, 2, 1, 4), integer32().subtype(subtypeSpec=value_range_constraint(1, 1024))).setMaxAccess('readonly') if mibBuilder.loadTexts: an50pmpLinkRegConn.setStatus('current') an50pmp_link_dl_burst_rate = mib_table_column((1, 3, 6, 1, 4, 1, 10728, 2, 51, 2, 1, 5), integer32().subtype(subtypeSpec=constraints_union(single_value_constraint(1, 2, 3, 4, 5, 6, 7, 8))).clone(namedValues=named_values(('tx6Mbs', 1), ('tx9Mbs', 2), ('tx12Mbs', 3), ('tx18Mbs', 4), ('tx24Mbs', 5), ('tx36Mbs', 6), ('tx48Mbs', 7), ('tx54Mbs', 8)))).setMaxAccess('readonly') if mibBuilder.loadTexts: an50pmpLinkDLBurstRate.setStatus('current') an50pmp_link_dlrssi = mib_table_column((1, 3, 6, 1, 4, 1, 10728, 2, 51, 2, 1, 6), integer32()).setMaxAccess('readonly') if mibBuilder.loadTexts: an50pmpLinkDLRSSI.setStatus('current') an50pmp_link_dlsinadr = mib_table_column((1, 3, 6, 1, 4, 1, 10728, 2, 51, 2, 1, 7), integer32()).setMaxAccess('readonly') if mibBuilder.loadTexts: an50pmpLinkDLSINADR.setStatus('current') an50pmp_link_dl_stat_lost_frm = mib_table_column((1, 3, 6, 1, 4, 1, 10728, 2, 51, 2, 1, 8), integer32()).setMaxAccess('readonly') if mibBuilder.loadTexts: an50pmpLinkDLStatLostFrm.setStatus('current') an50pmp_link_dl_stat_blks_tot = mib_table_column((1, 3, 6, 1, 4, 1, 10728, 2, 51, 2, 1, 9), integer32()).setMaxAccess('readonly') if mibBuilder.loadTexts: an50pmpLinkDLStatBlksTot.setStatus('current') an50pmp_link_dl_stat_blks_retr = mib_table_column((1, 3, 6, 1, 4, 1, 10728, 2, 51, 2, 1, 10), integer32()).setMaxAccess('readonly') if mibBuilder.loadTexts: an50pmpLinkDLStatBlksRetr.setStatus('current') an50pmp_link_dl_stat_blks_disc = mib_table_column((1, 3, 6, 1, 4, 1, 10728, 2, 51, 2, 1, 11), integer32()).setMaxAccess('readonly') if mibBuilder.loadTexts: an50pmpLinkDLStatBlksDisc.setStatus('current') an50pmp_link_dlcid_stat_pkt_disc = mib_table_column((1, 3, 6, 1, 4, 1, 10728, 2, 51, 2, 1, 12), integer32()).setMaxAccess('readonly') if mibBuilder.loadTexts: an50pmpLinkDLCIDStatPktDisc.setStatus('current') an50pmp_link_dlcid_stat_pkt_tran = mib_table_column((1, 3, 6, 1, 4, 1, 10728, 2, 51, 2, 1, 13), integer32()).setMaxAccess('readonly') if mibBuilder.loadTexts: an50pmpLinkDLCIDStatPktTran.setStatus('current') an50pmp_link_dlcid_stat_pkt_recv = mib_table_column((1, 3, 6, 1, 4, 1, 10728, 2, 51, 2, 1, 14), integer32()).setMaxAccess('readonly') if mibBuilder.loadTexts: an50pmpLinkDLCIDStatPktRecv.setStatus('current') an50pmp_link_ul_burst_rate = mib_table_column((1, 3, 6, 1, 4, 1, 10728, 2, 51, 2, 1, 15), integer32().subtype(subtypeSpec=constraints_union(single_value_constraint(1, 2, 3, 4, 5, 6, 7, 8))).clone(namedValues=named_values(('tx6Mbs', 1), ('tx9Mbs', 2), ('tx12Mbs', 3), ('tx18Mbs', 4), ('tx24Mbs', 5), ('tx36Mbs', 6), ('tx48Mbs', 7), ('tx54Mbs', 8)))).setMaxAccess('readonly') if mibBuilder.loadTexts: an50pmpLinkULBurstRate.setStatus('current') an50pmp_link_ulrssi = mib_table_column((1, 3, 6, 1, 4, 1, 10728, 2, 51, 2, 1, 16), integer32()).setMaxAccess('readonly') if mibBuilder.loadTexts: an50pmpLinkULRSSI.setStatus('current') an50pmp_link_ulsinadr = mib_table_column((1, 3, 6, 1, 4, 1, 10728, 2, 51, 2, 1, 17), integer32()).setMaxAccess('readonly') if mibBuilder.loadTexts: an50pmpLinkULSINADR.setStatus('current') an50pmp_link_ul_stat_lost_frm = mib_table_column((1, 3, 6, 1, 4, 1, 10728, 2, 51, 2, 1, 18), integer32()).setMaxAccess('readonly') if mibBuilder.loadTexts: an50pmpLinkULStatLostFrm.setStatus('current') an50pmp_link_ul_stat_blks_tot = mib_table_column((1, 3, 6, 1, 4, 1, 10728, 2, 51, 2, 1, 19), integer32()).setMaxAccess('readonly') if mibBuilder.loadTexts: an50pmpLinkULStatBlksTot.setStatus('current') an50pmp_link_ul_stat_blks_retr = mib_table_column((1, 3, 6, 1, 4, 1, 10728, 2, 51, 2, 1, 20), integer32()).setMaxAccess('readonly') if mibBuilder.loadTexts: an50pmpLinkULStatBlksRetr.setStatus('current') an50pmp_link_ul_stat_blks_disc = mib_table_column((1, 3, 6, 1, 4, 1, 10728, 2, 51, 2, 1, 21), integer32()).setMaxAccess('readonly') if mibBuilder.loadTexts: an50pmpLinkULStatBlksDisc.setStatus('current') an50pmp_link_ulcid_stat_pkt_disc = mib_table_column((1, 3, 6, 1, 4, 1, 10728, 2, 51, 2, 1, 22), integer32()).setMaxAccess('readonly') if mibBuilder.loadTexts: an50pmpLinkULCIDStatPktDisc.setStatus('current') an50pmp_link_ulcid_stat_pkt_tran = mib_table_column((1, 3, 6, 1, 4, 1, 10728, 2, 51, 2, 1, 23), integer32()).setMaxAccess('readonly') if mibBuilder.loadTexts: an50pmpLinkULCIDStatPktTran.setStatus('current') an50pmp_link_ulcid_stat_pkt_recv = mib_table_column((1, 3, 6, 1, 4, 1, 10728, 2, 51, 2, 1, 24), integer32()).setMaxAccess('readonly') if mibBuilder.loadTexts: an50pmpLinkULCIDStatPktRecv.setStatus('current') an50pmp_link_up_time = mib_table_column((1, 3, 6, 1, 4, 1, 10728, 2, 51, 2, 1, 25), time_ticks()).setMaxAccess('readonly') if mibBuilder.loadTexts: an50pmpLinkUpTime.setStatus('current') an50pmp_link_lost_count = mib_table_column((1, 3, 6, 1, 4, 1, 10728, 2, 51, 2, 1, 26), integer32()).setMaxAccess('readonly') if mibBuilder.loadTexts: an50pmpLinkLostCount.setStatus('current') an50pmp_cid_save_config = mib_scalar((1, 3, 6, 1, 4, 1, 10728, 2, 51, 3), integer32().subtype(subtypeSpec=constraints_union(single_value_constraint(1, 2))).clone(namedValues=named_values(('doNothing', 1), ('saveConfig', 2)))).setMaxAccess('readwrite') if mibBuilder.loadTexts: an50pmpCIDSaveConfig.setStatus('current') an50pmp_last_modified_cid = mib_scalar((1, 3, 6, 1, 4, 1, 10728, 2, 51, 4), integer32().subtype(subtypeSpec=value_range_constraint(4, 1023))).setMaxAccess('readonly') if mibBuilder.loadTexts: an50pmpLastModifiedCID.setStatus('current') an50pmp_last_missed_ss_mac_address = mib_scalar((1, 3, 6, 1, 4, 1, 10728, 2, 51, 5), octet_string()).setMaxAccess('readonly') if mibBuilder.loadTexts: an50pmpLastMissedSsMacAddress.setStatus('current') an50pmp_last_registered_ss_mac_address = mib_scalar((1, 3, 6, 1, 4, 1, 10728, 2, 51, 6), octet_string()).setMaxAccess('readonly') if mibBuilder.loadTexts: an50pmpLastRegisteredSsMacAddress.setStatus('current') an50pmp_last_successful_id = mib_scalar((1, 3, 6, 1, 4, 1, 10728, 2, 51, 7), integer32().subtype(subtypeSpec=value_range_constraint(4, 1023))).setMaxAccess('readonly') if mibBuilder.loadTexts: an50pmpLastSuccessfulID.setStatus('current') an50pmp_last_denied_ss_mac_address = mib_scalar((1, 3, 6, 1, 4, 1, 10728, 2, 51, 8), octet_string()).setMaxAccess('readwrite') if mibBuilder.loadTexts: an50pmpLastDeniedSsMacAddress.setStatus('current') an50pmp_group_table = mib_table((1, 3, 6, 1, 4, 1, 10728, 2, 51, 9)) if mibBuilder.loadTexts: an50pmpGroupTable.setStatus('current') an50pmp_group_entry = mib_table_row((1, 3, 6, 1, 4, 1, 10728, 2, 51, 9, 1)).setIndexNames((0, 'REDLINE-AN50-PMP-V2-MIB', 'an50pmpGroupId')) if mibBuilder.loadTexts: an50pmpGroupEntry.setStatus('current') an50pmp_group_id = mib_table_column((1, 3, 6, 1, 4, 1, 10728, 2, 51, 9, 1, 1), integer32().subtype(subtypeSpec=value_range_constraint(1, 65536))) if mibBuilder.loadTexts: an50pmpGroupId.setStatus('current') an50pmp_group_name = mib_table_column((1, 3, 6, 1, 4, 1, 10728, 2, 51, 9, 1, 2), octet_string().subtype(subtypeSpec=value_size_constraint(0, 15))).setMaxAccess('readwrite') if mibBuilder.loadTexts: an50pmpGroupName.setStatus('current') an50pmp_group_bs_port_tagging = mib_table_column((1, 3, 6, 1, 4, 1, 10728, 2, 51, 9, 1, 3), integer32().subtype(subtypeSpec=constraints_union(single_value_constraint(1, 2))).clone(namedValues=named_values(('passThrough', 1), ('tagged', 2)))).setMaxAccess('readwrite') if mibBuilder.loadTexts: an50pmpGroupBSPortTagging.setStatus('current') an50pmp_group_vlan_id = mib_table_column((1, 3, 6, 1, 4, 1, 10728, 2, 51, 9, 1, 4), integer32().subtype(subtypeSpec=value_range_constraint(1, 65536))).setMaxAccess('readwrite') if mibBuilder.loadTexts: an50pmpGroupVlanId.setStatus('current') an50pmp_group_default_priority = mib_table_column((1, 3, 6, 1, 4, 1, 10728, 2, 51, 9, 1, 5), integer32().subtype(subtypeSpec=value_range_constraint(0, 65536))).setMaxAccess('readwrite') if mibBuilder.loadTexts: an50pmpGroupDefaultPriority.setStatus('current') an50pmp_group_bs_port_enabled = mib_table_column((1, 3, 6, 1, 4, 1, 10728, 2, 51, 9, 1, 6), integer32().subtype(subtypeSpec=constraints_union(single_value_constraint(1, 2))).clone(namedValues=named_values(('off', 1), ('on', 2))).clone('off')).setMaxAccess('readwrite') if mibBuilder.loadTexts: an50pmpGroupBSPortEnabled.setStatus('current') an50pmp_group_qos = mib_table_column((1, 3, 6, 1, 4, 1, 10728, 2, 51, 9, 1, 7), integer32().subtype(subtypeSpec=value_range_constraint(0, 65536))).setMaxAccess('readwrite') if mibBuilder.loadTexts: an50pmpGroupQos.setStatus('current') an50pmp_group_row_status = mib_table_column((1, 3, 6, 1, 4, 1, 10728, 2, 51, 9, 1, 8), row_status().clone('createAndWait')).setMaxAccess('readwrite') if mibBuilder.loadTexts: an50pmpGroupRowStatus.setStatus('current') an50pmp_connection_table = mib_table((1, 3, 6, 1, 4, 1, 10728, 2, 51, 10)) if mibBuilder.loadTexts: an50pmpConnectionTable.setStatus('current') an50pmp_connection_entry = mib_table_row((1, 3, 6, 1, 4, 1, 10728, 2, 51, 10, 1)).setIndexNames((0, 'REDLINE-AN50-PMP-V2-MIB', 'an50pmpConnectionId')) if mibBuilder.loadTexts: an50pmpConnectionEntry.setStatus('current') an50pmp_connection_id = mib_table_column((1, 3, 6, 1, 4, 1, 10728, 2, 51, 10, 1, 1), integer32().subtype(subtypeSpec=value_range_constraint(1, 65536))) if mibBuilder.loadTexts: an50pmpConnectionId.setStatus('current') an50pmp_connection_name = mib_table_column((1, 3, 6, 1, 4, 1, 10728, 2, 51, 10, 1, 2), octet_string().subtype(subtypeSpec=value_size_constraint(0, 15))).setMaxAccess('readwrite') if mibBuilder.loadTexts: an50pmpConnectionName.setStatus('current') an50pmp_connection_port_tagging = mib_table_column((1, 3, 6, 1, 4, 1, 10728, 2, 51, 10, 1, 3), integer32().subtype(subtypeSpec=constraints_union(single_value_constraint(1, 2))).clone(namedValues=named_values(('passThrough', 1), ('tagged', 2)))).setMaxAccess('readwrite') if mibBuilder.loadTexts: an50pmpConnectionPortTagging.setStatus('current') an50pmp_connection_vlan_id = mib_table_column((1, 3, 6, 1, 4, 1, 10728, 2, 51, 10, 1, 4), integer32().subtype(subtypeSpec=value_range_constraint(0, 65536))).setMaxAccess('readwrite') if mibBuilder.loadTexts: an50pmpConnectionVlanId.setStatus('current') an50pmp_connection_default_priority = mib_table_column((1, 3, 6, 1, 4, 1, 10728, 2, 51, 10, 1, 5), integer32().subtype(subtypeSpec=value_range_constraint(0, 65536))).setMaxAccess('readwrite') if mibBuilder.loadTexts: an50pmpConnectionDefaultPriority.setStatus('current') an50pmp_connection_parent_link = mib_table_column((1, 3, 6, 1, 4, 1, 10728, 2, 51, 10, 1, 6), integer32().subtype(subtypeSpec=value_range_constraint(0, 65536))).setMaxAccess('readwrite') if mibBuilder.loadTexts: an50pmpConnectionParentLink.setStatus('current') an50pmp_connection_parent_group = mib_table_column((1, 3, 6, 1, 4, 1, 10728, 2, 51, 10, 1, 7), integer32().subtype(subtypeSpec=value_range_constraint(0, 65536))).setMaxAccess('readwrite') if mibBuilder.loadTexts: an50pmpConnectionParentGroup.setStatus('current') an50pmp_connection_dl_qo_s = mib_table_column((1, 3, 6, 1, 4, 1, 10728, 2, 51, 10, 1, 8), integer32().subtype(subtypeSpec=value_range_constraint(0, 65536))).setMaxAccess('readwrite') if mibBuilder.loadTexts: an50pmpConnectionDLQoS.setStatus('current') an50pmp_connection_ul_qo_s = mib_table_column((1, 3, 6, 1, 4, 1, 10728, 2, 51, 10, 1, 9), integer32().subtype(subtypeSpec=value_range_constraint(0, 65536))).setMaxAccess('readwrite') if mibBuilder.loadTexts: an50pmpConnectionULQoS.setStatus('current') an50pmp_connection_row_status = mib_table_column((1, 3, 6, 1, 4, 1, 10728, 2, 51, 10, 1, 10), row_status().clone('createAndWait')).setMaxAccess('readwrite') if mibBuilder.loadTexts: an50pmpConnectionRowStatus.setStatus('current') an50pmp_group_status_table = mib_table((1, 3, 6, 1, 4, 1, 10728, 2, 51, 11)) if mibBuilder.loadTexts: an50pmpGroupStatusTable.setStatus('current') an50pmp_group_status_entry = mib_table_row((1, 3, 6, 1, 4, 1, 10728, 2, 51, 11, 1)).setIndexNames((0, 'REDLINE-AN50-PMP-V2-MIB', 'an50pmpGroupStatusId')) if mibBuilder.loadTexts: an50pmpGroupStatusEntry.setStatus('current') an50pmp_group_status_id = mib_table_column((1, 3, 6, 1, 4, 1, 10728, 2, 51, 11, 1, 1), integer32().subtype(subtypeSpec=value_range_constraint(1, 65536))) if mibBuilder.loadTexts: an50pmpGroupStatusId.setStatus('current') an50pmp_group_status_dl_packets_discards = mib_table_column((1, 3, 6, 1, 4, 1, 10728, 2, 51, 11, 1, 2), counter32()).setMaxAccess('readonly') if mibBuilder.loadTexts: an50pmpGroupStatusDLPacketsDiscards.setStatus('current') an50pmp_group_status_dl_packets_tx = mib_table_column((1, 3, 6, 1, 4, 1, 10728, 2, 51, 11, 1, 3), counter32()).setMaxAccess('readonly') if mibBuilder.loadTexts: an50pmpGroupStatusDLPacketsTx.setStatus('current') an50pmp_group_status_dl_packets_rx = mib_table_column((1, 3, 6, 1, 4, 1, 10728, 2, 51, 11, 1, 4), counter32()).setMaxAccess('readonly') if mibBuilder.loadTexts: an50pmpGroupStatusDLPacketsRx.setStatus('current') an50pmp_group_status_ul_packets_discards = mib_table_column((1, 3, 6, 1, 4, 1, 10728, 2, 51, 11, 1, 5), counter32()).setMaxAccess('readonly') if mibBuilder.loadTexts: an50pmpGroupStatusULPacketsDiscards.setStatus('current') an50pmp_group_status_ul_packets_tx = mib_table_column((1, 3, 6, 1, 4, 1, 10728, 2, 51, 11, 1, 6), counter32()).setMaxAccess('readonly') if mibBuilder.loadTexts: an50pmpGroupStatusULPacketsTx.setStatus('current') an50pmp_group_status_ul_packets_rx = mib_table_column((1, 3, 6, 1, 4, 1, 10728, 2, 51, 11, 1, 7), counter32()).setMaxAccess('readonly') if mibBuilder.loadTexts: an50pmpGroupStatusULPacketsRx.setStatus('current') an50pmp_connection_status_table = mib_table((1, 3, 6, 1, 4, 1, 10728, 2, 51, 12)) if mibBuilder.loadTexts: an50pmpConnectionStatusTable.setStatus('current') an50pmp_connection_status_entry = mib_table_row((1, 3, 6, 1, 4, 1, 10728, 2, 51, 12, 1)).setIndexNames((0, 'REDLINE-AN50-PMP-V2-MIB', 'an50pmpConnectionStatusId')) if mibBuilder.loadTexts: an50pmpConnectionStatusEntry.setStatus('current') an50pmp_connection_status_id = mib_table_column((1, 3, 6, 1, 4, 1, 10728, 2, 51, 12, 1, 1), integer32().subtype(subtypeSpec=value_range_constraint(1, 65536))) if mibBuilder.loadTexts: an50pmpConnectionStatusId.setStatus('current') an50pmp_connection_status_dl_packets_discards = mib_table_column((1, 3, 6, 1, 4, 1, 10728, 2, 51, 12, 1, 2), counter32()).setMaxAccess('readonly') if mibBuilder.loadTexts: an50pmpConnectionStatusDLPacketsDiscards.setStatus('current') an50pmp_connection_status_dl_packets_tx = mib_table_column((1, 3, 6, 1, 4, 1, 10728, 2, 51, 12, 1, 3), counter32()).setMaxAccess('readonly') if mibBuilder.loadTexts: an50pmpConnectionStatusDLPacketsTx.setStatus('current') an50pmp_connection_status_dl_packets_rx = mib_table_column((1, 3, 6, 1, 4, 1, 10728, 2, 51, 12, 1, 4), counter32()).setMaxAccess('readonly') if mibBuilder.loadTexts: an50pmpConnectionStatusDLPacketsRx.setStatus('current') an50pmp_connection_status_ul_packets_discards = mib_table_column((1, 3, 6, 1, 4, 1, 10728, 2, 51, 12, 1, 5), counter32()).setMaxAccess('readonly') if mibBuilder.loadTexts: an50pmpConnectionStatusULPacketsDiscards.setStatus('current') an50pmp_connection_status_ul_packets_tx = mib_table_column((1, 3, 6, 1, 4, 1, 10728, 2, 51, 12, 1, 6), counter32()).setMaxAccess('readonly') if mibBuilder.loadTexts: an50pmpConnectionStatusULPacketsTx.setStatus('current') an50pmp_connection_status_ul_packets_rx = mib_table_column((1, 3, 6, 1, 4, 1, 10728, 2, 51, 12, 1, 7), counter32()).setMaxAccess('readonly') if mibBuilder.loadTexts: an50pmpConnectionStatusULPacketsRx.setStatus('current') an50_pmp_object_group = object_group((1, 3, 6, 1, 4, 1, 10728, 2, 51, 13)).setObjects(('REDLINE-AN50-PMP-V2-MIB', 'an50pmpLinkName'), ('REDLINE-AN50-PMP-V2-MIB', 'an50pmpLinkPeerMac'), ('REDLINE-AN50-PMP-V2-MIB', 'an50pmpLinkMaxDLBurstRate'), ('REDLINE-AN50-PMP-V2-MIB', 'an50pmpLinkMaxULBurstRate'), ('REDLINE-AN50-PMP-V2-MIB', 'an50pmpLinkEncryptionKey'), ('REDLINE-AN50-PMP-V2-MIB', 'an50pmpLinkRowStatus'), ('REDLINE-AN50-PMP-V2-MIB', 'an50pmpLinkStatus'), ('REDLINE-AN50-PMP-V2-MIB', 'an50pmpLinkStatusCode'), ('REDLINE-AN50-PMP-V2-MIB', 'an50pmpLinkRegConn'), ('REDLINE-AN50-PMP-V2-MIB', 'an50pmpLinkDLBurstRate'), ('REDLINE-AN50-PMP-V2-MIB', 'an50pmpLinkDLRSSI'), ('REDLINE-AN50-PMP-V2-MIB', 'an50pmpLinkDLSINADR'), ('REDLINE-AN50-PMP-V2-MIB', 'an50pmpLinkDLStatLostFrm'), ('REDLINE-AN50-PMP-V2-MIB', 'an50pmpLinkDLStatBlksTot'), ('REDLINE-AN50-PMP-V2-MIB', 'an50pmpLinkDLStatBlksRetr'), ('REDLINE-AN50-PMP-V2-MIB', 'an50pmpLinkDLStatBlksDisc'), ('REDLINE-AN50-PMP-V2-MIB', 'an50pmpLinkDLCIDStatPktDisc'), ('REDLINE-AN50-PMP-V2-MIB', 'an50pmpLinkDLCIDStatPktTran'), ('REDLINE-AN50-PMP-V2-MIB', 'an50pmpLinkDLCIDStatPktRecv'), ('REDLINE-AN50-PMP-V2-MIB', 'an50pmpLinkULBurstRate'), ('REDLINE-AN50-PMP-V2-MIB', 'an50pmpLinkULRSSI'), ('REDLINE-AN50-PMP-V2-MIB', 'an50pmpLinkULSINADR'), ('REDLINE-AN50-PMP-V2-MIB', 'an50pmpLinkULStatLostFrm'), ('REDLINE-AN50-PMP-V2-MIB', 'an50pmpLinkULStatBlksTot'), ('REDLINE-AN50-PMP-V2-MIB', 'an50pmpLinkULStatBlksRetr'), ('REDLINE-AN50-PMP-V2-MIB', 'an50pmpLinkULStatBlksDisc'), ('REDLINE-AN50-PMP-V2-MIB', 'an50pmpLinkULCIDStatPktDisc'), ('REDLINE-AN50-PMP-V2-MIB', 'an50pmpLinkULCIDStatPktTran'), ('REDLINE-AN50-PMP-V2-MIB', 'an50pmpLinkULCIDStatPktRecv'), ('REDLINE-AN50-PMP-V2-MIB', 'an50pmpLinkUpTime'), ('REDLINE-AN50-PMP-V2-MIB', 'an50pmpLinkLostCount'), ('REDLINE-AN50-PMP-V2-MIB', 'an50pmpCIDSaveConfig'), ('REDLINE-AN50-PMP-V2-MIB', 'an50pmpLastModifiedCID'), ('REDLINE-AN50-PMP-V2-MIB', 'an50pmpLastMissedSsMacAddress'), ('REDLINE-AN50-PMP-V2-MIB', 'an50pmpLastRegisteredSsMacAddress'), ('REDLINE-AN50-PMP-V2-MIB', 'an50pmpLastSuccessfulID'), ('REDLINE-AN50-PMP-V2-MIB', 'an50pmpLastDeniedSsMacAddress'), ('REDLINE-AN50-PMP-V2-MIB', 'an50pmpGroupName'), ('REDLINE-AN50-PMP-V2-MIB', 'an50pmpGroupBSPortTagging'), ('REDLINE-AN50-PMP-V2-MIB', 'an50pmpGroupVlanId'), ('REDLINE-AN50-PMP-V2-MIB', 'an50pmpGroupDefaultPriority'), ('REDLINE-AN50-PMP-V2-MIB', 'an50pmpGroupBSPortEnabled'), ('REDLINE-AN50-PMP-V2-MIB', 'an50pmpGroupQos'), ('REDLINE-AN50-PMP-V2-MIB', 'an50pmpGroupRowStatus'), ('REDLINE-AN50-PMP-V2-MIB', 'an50pmpConnectionName'), ('REDLINE-AN50-PMP-V2-MIB', 'an50pmpConnectionPortTagging'), ('REDLINE-AN50-PMP-V2-MIB', 'an50pmpConnectionVlanId'), ('REDLINE-AN50-PMP-V2-MIB', 'an50pmpConnectionDefaultPriority'), ('REDLINE-AN50-PMP-V2-MIB', 'an50pmpConnectionParentLink'), ('REDLINE-AN50-PMP-V2-MIB', 'an50pmpConnectionParentGroup'), ('REDLINE-AN50-PMP-V2-MIB', 'an50pmpConnectionDLQoS'), ('REDLINE-AN50-PMP-V2-MIB', 'an50pmpConnectionULQoS'), ('REDLINE-AN50-PMP-V2-MIB', 'an50pmpConnectionRowStatus'), ('REDLINE-AN50-PMP-V2-MIB', 'an50pmpGroupStatusDLPacketsDiscards'), ('REDLINE-AN50-PMP-V2-MIB', 'an50pmpGroupStatusDLPacketsTx'), ('REDLINE-AN50-PMP-V2-MIB', 'an50pmpGroupStatusDLPacketsRx'), ('REDLINE-AN50-PMP-V2-MIB', 'an50pmpGroupStatusULPacketsDiscards'), ('REDLINE-AN50-PMP-V2-MIB', 'an50pmpGroupStatusULPacketsTx'), ('REDLINE-AN50-PMP-V2-MIB', 'an50pmpGroupStatusULPacketsRx'), ('REDLINE-AN50-PMP-V2-MIB', 'an50pmpConnectionStatusDLPacketsDiscards'), ('REDLINE-AN50-PMP-V2-MIB', 'an50pmpConnectionStatusDLPacketsTx'), ('REDLINE-AN50-PMP-V2-MIB', 'an50pmpConnectionStatusDLPacketsRx'), ('REDLINE-AN50-PMP-V2-MIB', 'an50pmpConnectionStatusULPacketsDiscards'), ('REDLINE-AN50-PMP-V2-MIB', 'an50pmpConnectionStatusULPacketsTx'), ('REDLINE-AN50-PMP-V2-MIB', 'an50pmpConnectionStatusULPacketsRx')) if getattr(mibBuilder, 'version', (0, 0, 0)) > (4, 4, 0): an50_pmp_object_group = an50PMPObjectGroup.setStatus('current') an50_pmp_obsolete_object_group = object_group((1, 3, 6, 1, 4, 1, 10728, 2, 51, 14)).setObjects(('REDLINE-AN50-PMP-V2-MIB', 'an50pmpLinkGroupId'), ('REDLINE-AN50-PMP-V2-MIB', 'an50pmpLinkMaxHost'), ('REDLINE-AN50-PMP-V2-MIB', 'an50pmpLinkCIDDLCIR'), ('REDLINE-AN50-PMP-V2-MIB', 'an50pmpLinkCIDDLPIR'), ('REDLINE-AN50-PMP-V2-MIB', 'an50pmpLinkCIDULCIR'), ('REDLINE-AN50-PMP-V2-MIB', 'an50pmpLinkCIDULPIR'), ('REDLINE-AN50-PMP-V2-MIB', 'an50pmpLinkDLQoS'), ('REDLINE-AN50-PMP-V2-MIB', 'an50pmpLinkULQoS')) if getattr(mibBuilder, 'version', (0, 0, 0)) > (4, 4, 0): an50_pmp_obsolete_object_group = an50PMPObsoleteObjectGroup.setStatus('obsolete') mibBuilder.exportSymbols('REDLINE-AN50-PMP-V2-MIB', an50pmpLinkULQoS=an50pmpLinkULQoS, an50pmpLinkULCIDStatPktRecv=an50pmpLinkULCIDStatPktRecv, an50pmpLinkRowStatus=an50pmpLinkRowStatus, an50pmpLinkDLStatBlksTot=an50pmpLinkDLStatBlksTot, an50pmpConnectionStatusId=an50pmpConnectionStatusId, an50pmpGroupTable=an50pmpGroupTable, an50pmpConnectionId=an50pmpConnectionId, an50pmpLinkLostCount=an50pmpLinkLostCount, an50pmpLastMissedSsMacAddress=an50pmpLastMissedSsMacAddress, an50pmpGroupStatusEntry=an50pmpGroupStatusEntry, an50pmpGroupStatusDLPacketsRx=an50pmpGroupStatusDLPacketsRx, an50pmpConnectionDefaultPriority=an50pmpConnectionDefaultPriority, an50pmpConnectionTable=an50pmpConnectionTable, an50pmpLastModifiedCID=an50pmpLastModifiedCID, an50pmpConnectionStatusULPacketsRx=an50pmpConnectionStatusULPacketsRx, an50PMPObsoleteObjectGroup=an50PMPObsoleteObjectGroup, an50pmpConnectionStatusDLPacketsDiscards=an50pmpConnectionStatusDLPacketsDiscards, an50pmpLinkDLRSSI=an50pmpLinkDLRSSI, an50pmpGroupEntry=an50pmpGroupEntry, an50pmpConnectionStatusULPacketsDiscards=an50pmpConnectionStatusULPacketsDiscards, an50pmpGroupStatusULPacketsDiscards=an50pmpGroupStatusULPacketsDiscards, an50pmpGroupQos=an50pmpGroupQos, an50pmpConnectionName=an50pmpConnectionName, an50pmpConnectionPortTagging=an50pmpConnectionPortTagging, redlineAN50PMPV2=redlineAN50PMPV2, an50pmpLinkCIDULCIR=an50pmpLinkCIDULCIR, an50pmpLinkDLCIDStatPktRecv=an50pmpLinkDLCIDStatPktRecv, an50pmpLinkMaxULBurstRate=an50pmpLinkMaxULBurstRate, an50pmpGroupBSPortEnabled=an50pmpGroupBSPortEnabled, an50pmpLinkName=an50pmpLinkName, an50pmpGroupRowStatus=an50pmpGroupRowStatus, an50pmpConnectionEntry=an50pmpConnectionEntry, an50pmpLinkCIDDLPIR=an50pmpLinkCIDDLPIR, an50pmpCIDSaveConfig=an50pmpCIDSaveConfig, an50pmpLinkDLStatLostFrm=an50pmpLinkDLStatLostFrm, an50pmpConnectionDLQoS=an50pmpConnectionDLQoS, an50pmpConnectionStatusULPacketsTx=an50pmpConnectionStatusULPacketsTx, an50pmpLinkEntry=an50pmpLinkEntry, an50pmpGroupStatusTable=an50pmpGroupStatusTable, an50pmpLinkPeerMac=an50pmpLinkPeerMac, an50pmpLinkID=an50pmpLinkID, an50pmpConnectionStatusDLPacketsTx=an50pmpConnectionStatusDLPacketsTx, an50pmpLinkDLCIDStatPktDisc=an50pmpLinkDLCIDStatPktDisc, an50pmpLinkStatusID=an50pmpLinkStatusID, an50pmpLinkMaxDLBurstRate=an50pmpLinkMaxDLBurstRate, an50pmpConnectionRowStatus=an50pmpConnectionRowStatus, an50pmpGroupStatusULPacketsTx=an50pmpGroupStatusULPacketsTx, an50pmpLinkULSINADR=an50pmpLinkULSINADR, an50pmpLinkULBurstRate=an50pmpLinkULBurstRate, an50pmpLinkULCIDStatPktTran=an50pmpLinkULCIDStatPktTran, an50pmpGroupVlanId=an50pmpGroupVlanId, an50pmpLinkTable=an50pmpLinkTable, PYSNMP_MODULE_ID=redlineAN50PMPV2, an50pmpLinkDLSINADR=an50pmpLinkDLSINADR, an50pmpConnectionParentLink=an50pmpConnectionParentLink, an50pmpConnectionStatusTable=an50pmpConnectionStatusTable, an50pmpLinkStatus=an50pmpLinkStatus, an50pmpLinkDLStatBlksRetr=an50pmpLinkDLStatBlksRetr, an50pmpLastSuccessfulID=an50pmpLastSuccessfulID, an50pmpGroupStatusDLPacketsDiscards=an50pmpGroupStatusDLPacketsDiscards, an50pmpLinkDLCIDStatPktTran=an50pmpLinkDLCIDStatPktTran, an50pmpConnectionParentGroup=an50pmpConnectionParentGroup, an50pmpGroupStatusULPacketsRx=an50pmpGroupStatusULPacketsRx, an50pmpLinkULStatBlksRetr=an50pmpLinkULStatBlksRetr, an50pmpConnectionStatusDLPacketsRx=an50pmpConnectionStatusDLPacketsRx, an50pmpLinkDLQoS=an50pmpLinkDLQoS, an50pmpLinkStatusEntry=an50pmpLinkStatusEntry, an50pmpLinkCIDULPIR=an50pmpLinkCIDULPIR, an50pmpLinkDLStatBlksDisc=an50pmpLinkDLStatBlksDisc, an50pmpLinkUpTime=an50pmpLinkUpTime, an50pmpLinkULStatLostFrm=an50pmpLinkULStatLostFrm, an50pmpLinkMaxHost=an50pmpLinkMaxHost, an50pmpConnectionStatusEntry=an50pmpConnectionStatusEntry, an50pmpConnectionVlanId=an50pmpConnectionVlanId, an50pmpLinkRegConn=an50pmpLinkRegConn, an50pmpLinkEncryptionKey=an50pmpLinkEncryptionKey, an50pmpLinkDLBurstRate=an50pmpLinkDLBurstRate, an50pmpLinkULCIDStatPktDisc=an50pmpLinkULCIDStatPktDisc, an50pmpGroupStatusId=an50pmpGroupStatusId, an50PMPObjectGroup=an50PMPObjectGroup, an50pmpLastDeniedSsMacAddress=an50pmpLastDeniedSsMacAddress, an50pmpGroupStatusDLPacketsTx=an50pmpGroupStatusDLPacketsTx, an50pmpLinkULStatBlksTot=an50pmpLinkULStatBlksTot, an50pmpLinkCIDDLCIR=an50pmpLinkCIDDLCIR, an50pmpLinkULStatBlksDisc=an50pmpLinkULStatBlksDisc, an50pmpGroupBSPortTagging=an50pmpGroupBSPortTagging, an50pmpLinkStatusTable=an50pmpLinkStatusTable, an50pmpGroupName=an50pmpGroupName, an50pmpLinkGroupId=an50pmpLinkGroupId, an50pmpConnectionULQoS=an50pmpConnectionULQoS, an50pmpLinkStatusCode=an50pmpLinkStatusCode, an50pmpGroupId=an50pmpGroupId, an50pmpGroupDefaultPriority=an50pmpGroupDefaultPriority, an50pmpLastRegisteredSsMacAddress=an50pmpLastRegisteredSsMacAddress, an50pmpLinkULRSSI=an50pmpLinkULRSSI)
# -*- coding: utf-8 -*- # @Time: 2020/5/8 22:38 # @Author: GraceKoo # @File: interview_2.py # @Desc: https://leetcode-cn.com/problems/ti-huan-kong-ge-lcof/ class Solution: def replaceSpace(self, s: str) -> str: s_list = list() for s_value in s: if s_value == " ": s_list.append("%20") else: s_list.append(s_value) return "".join(s_list) so = Solution() print(so.replaceSpace("We are happy."))
class Solution: def replace_space(self, s: str) -> str: s_list = list() for s_value in s: if s_value == ' ': s_list.append('%20') else: s_list.append(s_value) return ''.join(s_list) so = solution() print(so.replaceSpace('We are happy.'))
class Statement: transactions = [] def append_transaction(self, transaction): self.transactions.append(transaction) def print(self): for transaction in self.transactions: print(str(transaction))
class Statement: transactions = [] def append_transaction(self, transaction): self.transactions.append(transaction) def print(self): for transaction in self.transactions: print(str(transaction))
lista = [] dados = [] oper = '' maior = menor = 0 nomeMaior = '' nomeMenor = '' while oper != 'sair': dados.append(str(input('Digite o seu nome: '))) dados.append(int(input('Digite o seu peso: '))) if len(lista) == 0: maior = menor = dados[1] else: if dados[1] > maior: maior = dados[1] nomeMaior = dados[0] if dados[1] < menor: menor = dados[1] nomeMenor = dados[0] lista.append(dados[:]) dados.clear() oper = str(input('Deseja continuar? [Sim/Sair] ')).strip().lower() if oper == 'sair': break print('-=' * 30) print(f'Foram cadastradas {len(lista)} pessoas no total.') print(f'O maior peso foi de {maior}Kg, da pessoa {nomeMaior}') print(f'O menor peso foi de {menor}Kg, da pessoa {nomeMenor}')
lista = [] dados = [] oper = '' maior = menor = 0 nome_maior = '' nome_menor = '' while oper != 'sair': dados.append(str(input('Digite o seu nome: '))) dados.append(int(input('Digite o seu peso: '))) if len(lista) == 0: maior = menor = dados[1] else: if dados[1] > maior: maior = dados[1] nome_maior = dados[0] if dados[1] < menor: menor = dados[1] nome_menor = dados[0] lista.append(dados[:]) dados.clear() oper = str(input('Deseja continuar? [Sim/Sair] ')).strip().lower() if oper == 'sair': break print('-=' * 30) print(f'Foram cadastradas {len(lista)} pessoas no total.') print(f'O maior peso foi de {maior}Kg, da pessoa {nomeMaior}') print(f'O menor peso foi de {menor}Kg, da pessoa {nomeMenor}')
class FeedException(Exception): def __init__(self, *args, **kwargs): self.message = kwargs.pop('message')
class Feedexception(Exception): def __init__(self, *args, **kwargs): self.message = kwargs.pop('message')
# -*- coding: utf-8 -*- _name1 = [ 'Chikorita', 'Bayleef', 'Meganium', 'Cyndaquil', 'Quilava', 'Typhlosion', 'Totodile', 'Croconaw', 'Feraligatr', 'Sentret', 'Furret', 'Hoothoot', 'Noctowl', 'Ledyba', 'Ledian', 'Spinarak', 'Ariados', 'Crobat', 'Chinchou', 'Lanturn', 'Pichu', 'Cleffa', 'Igglybuff', 'Togepi', 'Togetic', 'Natu', 'Xatu', 'Mareep', 'Flaaffy', 'Ampharos', 'Bellossom', 'Marill', 'Azumarill', 'Sudowoodo', 'Politoed', 'Hoppip', 'Skiploom', 'Jumpluff', 'Aipom', 'Sunkern', 'Sunflora', 'Yanma', 'Wooper', 'Quagsire', 'Espeon', 'Umbreon', 'Murkrow', 'Slowking', 'Misdreavus', 'Unown', ] _name2 = [ 'Wobbuffet', 'Girafarig', 'Pineco', 'Forretress', 'Dunsparce', 'Gligar', 'Steelix', 'Snubbull', 'Granbull', 'Qwilfish', 'Scizor', 'Shuckle', 'Heracross', 'Sneasel', 'Teddiursa', 'Ursaring', 'Slugma', 'Magcargo', 'Swinub', 'Piloswine', 'Corsola', 'Remoraid', 'Octillery', 'Delibird', 'Mantine', 'Skarmory', 'Houndour', 'Houndoom', 'Kingdra', 'Phanpy', 'Donphan', 'Porygon2', 'Stantler', 'Smeargle', 'Tyrogue', 'Hitmontop', 'Smoochum', 'Elekid', 'Magby', 'Miltank', 'Blissey', 'Raikou', 'Entei', 'Suicune', 'Larvitar', 'Pupitar', 'Tyranitar', 'Lugia', 'Ho-Oh', 'Celebi', ]
_name1 = ['Chikorita', 'Bayleef', 'Meganium', 'Cyndaquil', 'Quilava', 'Typhlosion', 'Totodile', 'Croconaw', 'Feraligatr', 'Sentret', 'Furret', 'Hoothoot', 'Noctowl', 'Ledyba', 'Ledian', 'Spinarak', 'Ariados', 'Crobat', 'Chinchou', 'Lanturn', 'Pichu', 'Cleffa', 'Igglybuff', 'Togepi', 'Togetic', 'Natu', 'Xatu', 'Mareep', 'Flaaffy', 'Ampharos', 'Bellossom', 'Marill', 'Azumarill', 'Sudowoodo', 'Politoed', 'Hoppip', 'Skiploom', 'Jumpluff', 'Aipom', 'Sunkern', 'Sunflora', 'Yanma', 'Wooper', 'Quagsire', 'Espeon', 'Umbreon', 'Murkrow', 'Slowking', 'Misdreavus', 'Unown'] _name2 = ['Wobbuffet', 'Girafarig', 'Pineco', 'Forretress', 'Dunsparce', 'Gligar', 'Steelix', 'Snubbull', 'Granbull', 'Qwilfish', 'Scizor', 'Shuckle', 'Heracross', 'Sneasel', 'Teddiursa', 'Ursaring', 'Slugma', 'Magcargo', 'Swinub', 'Piloswine', 'Corsola', 'Remoraid', 'Octillery', 'Delibird', 'Mantine', 'Skarmory', 'Houndour', 'Houndoom', 'Kingdra', 'Phanpy', 'Donphan', 'Porygon2', 'Stantler', 'Smeargle', 'Tyrogue', 'Hitmontop', 'Smoochum', 'Elekid', 'Magby', 'Miltank', 'Blissey', 'Raikou', 'Entei', 'Suicune', 'Larvitar', 'Pupitar', 'Tyranitar', 'Lugia', 'Ho-Oh', 'Celebi']
# Solution to part 2 of day 14 of AOC 2015, Reindeer Olympics # https://adventofcode.com/2015/day/14 f = open('input.txt') whole_text = f.read() f.close() race = 2503 deers = {} all_deers = {} for line in whole_text.split('\n'): # print(line) # Example, # Comet can fly 14 km/s for 10 seconds, but then must rest for 127 seconds. reindeer, _, _, speed_str, _, _, fly_str, _, _, _, _, _, _, rest_str, _ = line.split(' ') speed, fly, rest = int(speed_str), int(fly_str), int(rest_str) deers[reindeer] = 0 for second in range(1, race + 1): # print(second) complete_fly_rest_cycles = second // (fly + rest) final_flight_start_second = complete_fly_rest_cycles * (fly + rest) time_left_for_final_flight = second - final_flight_start_second final_flight_secs = min(fly, time_left_for_final_flight) fly_time = complete_fly_rest_cycles * fly + final_flight_secs dist = fly_time * speed all_deers[(reindeer, second)] = dist for second in range(1, race + 1): best_dist_this_sec = 0 best_deers_this_sec = [] for deer in deers: if all_deers[(deer, second)] > best_dist_this_sec: best_dist_this_sec = all_deers[(deer, second)] best_deers_this_sec = [deer] elif all_deers[(deer, second)] == best_dist_this_sec: best_deers_this_sec.append(deer) for deer in best_deers_this_sec: deers[deer] += 1 print() print(deers)
f = open('input.txt') whole_text = f.read() f.close() race = 2503 deers = {} all_deers = {} for line in whole_text.split('\n'): (reindeer, _, _, speed_str, _, _, fly_str, _, _, _, _, _, _, rest_str, _) = line.split(' ') (speed, fly, rest) = (int(speed_str), int(fly_str), int(rest_str)) deers[reindeer] = 0 for second in range(1, race + 1): complete_fly_rest_cycles = second // (fly + rest) final_flight_start_second = complete_fly_rest_cycles * (fly + rest) time_left_for_final_flight = second - final_flight_start_second final_flight_secs = min(fly, time_left_for_final_flight) fly_time = complete_fly_rest_cycles * fly + final_flight_secs dist = fly_time * speed all_deers[reindeer, second] = dist for second in range(1, race + 1): best_dist_this_sec = 0 best_deers_this_sec = [] for deer in deers: if all_deers[deer, second] > best_dist_this_sec: best_dist_this_sec = all_deers[deer, second] best_deers_this_sec = [deer] elif all_deers[deer, second] == best_dist_this_sec: best_deers_this_sec.append(deer) for deer in best_deers_this_sec: deers[deer] += 1 print() print(deers)
word=input() n=int(input()) first_half=word[:n] second_half=word[n+1:] result=(first_half+second_half) print(result)
word = input() n = int(input()) first_half = word[:n] second_half = word[n + 1:] result = first_half + second_half print(result)
# pyre-ignore-all-errors # TODO: Change `pyre-ignore-all-errors` to `pyre-strict` on line 1, so we get # to see all type errors in this file. # We mentioned in the talk that consuming values of union type often requires a # case split. But there are also cases where the case split is not necessary. # This example demonstrates those cases. # Consider these two classes: class Dog: def bark(self) -> None: print("Whoof! Whoof!") def play(self) -> None: print("Dog playing!") def chase(self, dog: Dog) -> None: print("Dog is chasing another dog!") class Cat: def meow(self) -> None: print("Meow! Meow!") def play(self) -> None: print("Cat playing!") def chase(self, cat: Cat) -> None: print("Cat is chasing another cat!") # Now we have a function written like this: def make_sound(pet): if isinstance(pet, Dog): pet.bark() elif isinstance(pet, Cat): pet.meow() else: raise RuntimeError make_sound(Dog()) make_sound(Cat()) # TODO: Type-annotate the `make_sound` function. Is the case-split here # necessary or not? # ------------------------------------------------------------------------------ # Now consider the following function: def make_play(pet): if isinstance(pet, Dog): pet.play() elif isinstance(pet, Cat): pet.play() else: raise RuntimeError make_play(Dog()) make_play(Cat()) # TODO: Type-annotate the `make_sound` function. Is the case-split here # necessary or not? Try removing the isinstance check and see if the type # checker accepts the change. # ------------------------------------------------------------------------------ # Question: Is it possible to type-annotate the following function with union # type, without doing any case split in the function body? Why or why not? def make_chase(pet0, pet1): pet0.chase(pet1) pet1.chase(pet0) make_chase(Dog(), Dog()) make_chase(Cat(), Dog()) make_chase(Dog(), Cat()) make_chase(Cat(), Cat())
class Dog: def bark(self) -> None: print('Whoof! Whoof!') def play(self) -> None: print('Dog playing!') def chase(self, dog: Dog) -> None: print('Dog is chasing another dog!') class Cat: def meow(self) -> None: print('Meow! Meow!') def play(self) -> None: print('Cat playing!') def chase(self, cat: Cat) -> None: print('Cat is chasing another cat!') def make_sound(pet): if isinstance(pet, Dog): pet.bark() elif isinstance(pet, Cat): pet.meow() else: raise RuntimeError make_sound(dog()) make_sound(cat()) def make_play(pet): if isinstance(pet, Dog): pet.play() elif isinstance(pet, Cat): pet.play() else: raise RuntimeError make_play(dog()) make_play(cat()) def make_chase(pet0, pet1): pet0.chase(pet1) pet1.chase(pet0) make_chase(dog(), dog()) make_chase(cat(), dog()) make_chase(dog(), cat()) make_chase(cat(), cat())
def calculateWeight(name, allSupporters): summation = 0 if (len(allSupporters[name]) > 1): for e in allSupporters[name][1]: summation += calculateWeight(e, allSupporters) return allSupporters[name][0]+summation def findAppropriateTree(name, allSupporters): allWeights = [] for i in allSupporters[name][1]: allWeights.append( (calculateWeight(i, allSupporters), i) ) allWeights.sort() if (allWeights[0][0] == allWeights[-1][0]): return allSupporters[name][0] else: if (allWeights[0][0] == allWeights[1][0]): ret = findAppropriateTree(allWeights[-1][1], allSupporters) if (ret != None): print("The weight of", allWeights[-1][1], "needs to be changed by", allWeights[0][0]-allWeights[-1][0], \ "to", allSupporters[allWeights[-1][1]][0]+(allWeights[0][0]-allWeights[-1][0]) ) else: ret = findAppropriateTree(allWeights[0][1], allSupporters) file = open("Day7Input.txt") allSupporters = dict() for line in file: splitput = line.split() name = splitput[0] value = int(splitput[1][1:-1]) children = splitput[3:] for i in range(len(children)): children[i] = children[i].replace(',', '') allSupporters[name] = [value, children] copy = allSupporters.copy() while (len(copy) > 1): for e in allSupporters: if (len(allSupporters[e]) > 1): for oth in allSupporters[e][1]: copy.pop(oth, None) print("Root of tree =", list(copy)[0]) findAppropriateTree('mkxke', allSupporters)
def calculate_weight(name, allSupporters): summation = 0 if len(allSupporters[name]) > 1: for e in allSupporters[name][1]: summation += calculate_weight(e, allSupporters) return allSupporters[name][0] + summation def find_appropriate_tree(name, allSupporters): all_weights = [] for i in allSupporters[name][1]: allWeights.append((calculate_weight(i, allSupporters), i)) allWeights.sort() if allWeights[0][0] == allWeights[-1][0]: return allSupporters[name][0] elif allWeights[0][0] == allWeights[1][0]: ret = find_appropriate_tree(allWeights[-1][1], allSupporters) if ret != None: print('The weight of', allWeights[-1][1], 'needs to be changed by', allWeights[0][0] - allWeights[-1][0], 'to', allSupporters[allWeights[-1][1]][0] + (allWeights[0][0] - allWeights[-1][0])) else: ret = find_appropriate_tree(allWeights[0][1], allSupporters) file = open('Day7Input.txt') all_supporters = dict() for line in file: splitput = line.split() name = splitput[0] value = int(splitput[1][1:-1]) children = splitput[3:] for i in range(len(children)): children[i] = children[i].replace(',', '') allSupporters[name] = [value, children] copy = allSupporters.copy() while len(copy) > 1: for e in allSupporters: if len(allSupporters[e]) > 1: for oth in allSupporters[e][1]: copy.pop(oth, None) print('Root of tree =', list(copy)[0]) find_appropriate_tree('mkxke', allSupporters)
# Performing operations on the DataFrame # DataFrame transformations # select() # filter() # groupby() # orderby() # dropDuplicates() # withColumnRenamed() # DataFrame actions # printSchema() # head() # show() # count() # columns # describe() # 1. Initial EDA # Print the first 10 observations people_df.show(10) # Count the number of rows print("There are {} rows in the people_df DataFrame.".format(people_df.count())) # Count the number of columns and their names print("There are {} columns in the people_df DataFrame and their names are {}".format(len(people_df.columns), people_df.columns)) # 2. Subsetting and cleaning # Select name, sex and date of birth columns people_df_sub = people_df.select('name', 'sex', 'date of birth') # Print the first 10 observations from people_df_sub people_df_sub.show(10) # Remove duplicate entries from people_df_sub people_df_sub_nodup = people_df_sub.dropDuplicates() # Count the number of rows print("There were {} rows before removing duplicates, and {} rows after removing duplicates".format(people_df_sub.count(), people_df_sub_nodup.count())) # 3. Filtering DataFrame # Filter people_df to select females people_df_female = people_df.filter(people_df.sex == "female") # Filter people_df to select males people_df_male = people_df.filter(people_df.sex == "male") # Count the number of rows print("There are {} rows in the people_df_female DataFrame and {} rows in the people_df_male DataFrame".format(people_df_female.count(), people_df_male.count()))
people_df.show(10) print('There are {} rows in the people_df DataFrame.'.format(people_df.count())) print('There are {} columns in the people_df DataFrame and their names are {}'.format(len(people_df.columns), people_df.columns)) people_df_sub = people_df.select('name', 'sex', 'date of birth') people_df_sub.show(10) people_df_sub_nodup = people_df_sub.dropDuplicates() print('There were {} rows before removing duplicates, and {} rows after removing duplicates'.format(people_df_sub.count(), people_df_sub_nodup.count())) people_df_female = people_df.filter(people_df.sex == 'female') people_df_male = people_df.filter(people_df.sex == 'male') print('There are {} rows in the people_df_female DataFrame and {} rows in the people_df_male DataFrame'.format(people_df_female.count(), people_df_male.count()))
# Headers copied directly from browser request static = { 'accept': 'application/json, text/plain, */*', 'accept-encoding': 'gzip, deflate, br', 'accept-language': 'en-GB,en-US;q=0.9,en;q=0.8', 'referer': 'https://www.nowgatewayx.com/login', 'sec-ch-ua': '"Chromium";v="94", "Google Chrome";v="94", ";Not A Brand";v="99"', 'sec-ch-ua-mobile': '?0', 'sec-ch-ua-platform': '"Windows"', 'sec-fetch-dest': 'empty', 'sec-fetch-mode': 'cors', 'sec-fetch-site': 'same-origin', 'user-agent': 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/94.0.4606.81 Safari/537.36', 'x-csrf-token': 'disabled' } login = { 'authorization': 'Basic bnAtcHJvZC1ub3ctcGVuc2lvbnMtZ3dheXItYWM6amhrOTJuOHVTV015R2FxcHMzWVVUY0tYZTc1YnRkREY=', 'content-length': '102', 'content-type': 'application/x-www-form-urlencoded; charset=UTF-8', 'cookie': 'viewed_cookie_policy=', 'origin': 'https://www.nowgatewayx.com', }
static = {'accept': 'application/json, text/plain, */*', 'accept-encoding': 'gzip, deflate, br', 'accept-language': 'en-GB,en-US;q=0.9,en;q=0.8', 'referer': 'https://www.nowgatewayx.com/login', 'sec-ch-ua': '"Chromium";v="94", "Google Chrome";v="94", ";Not A Brand";v="99"', 'sec-ch-ua-mobile': '?0', 'sec-ch-ua-platform': '"Windows"', 'sec-fetch-dest': 'empty', 'sec-fetch-mode': 'cors', 'sec-fetch-site': 'same-origin', 'user-agent': 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/94.0.4606.81 Safari/537.36', 'x-csrf-token': 'disabled'} login = {'authorization': 'Basic bnAtcHJvZC1ub3ctcGVuc2lvbnMtZ3dheXItYWM6amhrOTJuOHVTV015R2FxcHMzWVVUY0tYZTc1YnRkREY=', 'content-length': '102', 'content-type': 'application/x-www-form-urlencoded; charset=UTF-8', 'cookie': 'viewed_cookie_policy=', 'origin': 'https://www.nowgatewayx.com'}
def return_func(): pass def func(): return return_func a = func() a()
def return_func(): pass def func(): return return_func a = func() a()
n = int(input()) a = set(map(int, input().split())) m = int(input()) b = set(map(int, input().split())) d = list(a.union(b).difference(a.intersection(b))) d.sort() for i in d: print(i)
n = int(input()) a = set(map(int, input().split())) m = int(input()) b = set(map(int, input().split())) d = list(a.union(b).difference(a.intersection(b))) d.sort() for i in d: print(i)
# # @lc app=leetcode.cn id=43 lang=python3 # # [43] multiply-strings # None # @lc code=end
None
class PortfolioFilter: def __init__(self, column, options=None, portfolio_options=None, values=None, industry_codes=None, inverted=False, include_null=False, domain=None): self.key = column + '-0' self.column = column self.options = options if options is not None else [] self.portfolio_options = portfolio_options if portfolio_options is not None else [] self.values = values if values is not None else [] self.include_null = include_null self.inverted = inverted self.naics = industry_codes if industry_codes is not None else [] self.domain = self.set_domain(*sorted(domain)) if domain else None def add_value(self, value): self.values.append(value) return self.values def add_industry(self, industry): self.naics.append(industry) return self.naics def set_domain(self, minimum, maximum, from_value=None, to_value=None): self.domain = {"min": minimum, "from": from_value, "to": to_value, "max": maximum} return self.domain def get(self): if self.column in ["inceptiondate", "expirationdate"]: return { "column": self.column, "key": self.key, "domain": self.domain, "includeNull": self.include_null, "naics": {"values": self.naics} } return { "column": self.column, "key": self.key, "filter": {"options": self.options, "values": self.values, "portfolioOptions": self.portfolio_options}, "includeNull": self.include_null, "inverted": self.inverted, "naics": {"values": self.naics} }
class Portfoliofilter: def __init__(self, column, options=None, portfolio_options=None, values=None, industry_codes=None, inverted=False, include_null=False, domain=None): self.key = column + '-0' self.column = column self.options = options if options is not None else [] self.portfolio_options = portfolio_options if portfolio_options is not None else [] self.values = values if values is not None else [] self.include_null = include_null self.inverted = inverted self.naics = industry_codes if industry_codes is not None else [] self.domain = self.set_domain(*sorted(domain)) if domain else None def add_value(self, value): self.values.append(value) return self.values def add_industry(self, industry): self.naics.append(industry) return self.naics def set_domain(self, minimum, maximum, from_value=None, to_value=None): self.domain = {'min': minimum, 'from': from_value, 'to': to_value, 'max': maximum} return self.domain def get(self): if self.column in ['inceptiondate', 'expirationdate']: return {'column': self.column, 'key': self.key, 'domain': self.domain, 'includeNull': self.include_null, 'naics': {'values': self.naics}} return {'column': self.column, 'key': self.key, 'filter': {'options': self.options, 'values': self.values, 'portfolioOptions': self.portfolio_options}, 'includeNull': self.include_null, 'inverted': self.inverted, 'naics': {'values': self.naics}}
# There's no logic or real code here... just data. You need to add some code to # the test! alice_name = "Alice" alice_age = 20 alice_is_drinking = True bob_name = "Bob" bob_age = 12 bob_is_drinking = False charles_name = "Charles" charles_age = 22 charles_is_drinking = True
alice_name = 'Alice' alice_age = 20 alice_is_drinking = True bob_name = 'Bob' bob_age = 12 bob_is_drinking = False charles_name = 'Charles' charles_age = 22 charles_is_drinking = True
def test_role_check(test_role): test_role = test_role.refresh() assert test_role.id assert test_role.slug == "test" def test_role_update(test_role): assert test_role.slug == "test" test_role.slug = "test1" test_role.save() assert test_role.refresh().slug == "test1"
def test_role_check(test_role): test_role = test_role.refresh() assert test_role.id assert test_role.slug == 'test' def test_role_update(test_role): assert test_role.slug == 'test' test_role.slug = 'test1' test_role.save() assert test_role.refresh().slug == 'test1'
# for i in [0, 1, 2, 3, 4, 5]: # print(i) # for j in range(10): # print(j) names = ["Harry", "Ron", "Hermione", "Ginny"] for character in names: print(character)
names = ['Harry', 'Ron', 'Hermione', 'Ginny'] for character in names: print(character)
class Product(): def __init__(self, requirements: list): self.requirements = [] for r in requirements: self.requirements.append(r.type) class Requirement(): def __init__(self, _type: str, name): self.name = name self.type = _type
class Product: def __init__(self, requirements: list): self.requirements = [] for r in requirements: self.requirements.append(r.type) class Requirement: def __init__(self, _type: str, name): self.name = name self.type = _type
p = 196732205348849427366498732223276547339 secret = 4919 # Solved through brute force that secret = 4919, see sageSecret def calc_root(num, mod, n): #Create a modular ring with mod as the modulus f = GF(mod) # temp = num mod Modulus temp = f(num) #Calculate the nth root temp on this modular field # AKA (returnValue)^n % mod = temp return temp.nth_root(n) def gen_v_list(primelist, p, secret): a = [] for prime in primelist: a.append(calc_root(prime, p, secret)) # A is an array of the secreth root of each prime, mod p return a def decodeInt(i, primelist): pl = sorted(primelist)[::-1] out = '' for j in pl: if i%j == 0: out += '1' else: out += '0' return out def bin2asc(b): return hex(int(b,2)).replace('0x','').decode('hex') primelist = [2,3,5,7,11,13,17,19,23,29,31,37,43,47,53,59] #Split message into 2 char chunks message = REDACTED chunks = [] for i in range(0,len(message),2): chunks += [message[i:i+2]] vlist = gen_v_list(primelist,p,secret) print(vlist) for chunk in chunks: # Encode the 2char chunk into hex # replace all 0b with null # make the thing 16 bits longs # reverse it binarized = bin(int(chunk.encode('hex'),16)).replace('0b','').zfill(16)[::-1] #lsb first enc = 1 for bit in range(len(binarized)): enc *= vlist[bit]**int(binarized[bit]) enc = enc%p print(enc)
p = 196732205348849427366498732223276547339 secret = 4919 def calc_root(num, mod, n): f = gf(mod) temp = f(num) return temp.nth_root(n) def gen_v_list(primelist, p, secret): a = [] for prime in primelist: a.append(calc_root(prime, p, secret)) return a def decode_int(i, primelist): pl = sorted(primelist)[::-1] out = '' for j in pl: if i % j == 0: out += '1' else: out += '0' return out def bin2asc(b): return hex(int(b, 2)).replace('0x', '').decode('hex') primelist = [2, 3, 5, 7, 11, 13, 17, 19, 23, 29, 31, 37, 43, 47, 53, 59] message = REDACTED chunks = [] for i in range(0, len(message), 2): chunks += [message[i:i + 2]] vlist = gen_v_list(primelist, p, secret) print(vlist) for chunk in chunks: binarized = bin(int(chunk.encode('hex'), 16)).replace('0b', '').zfill(16)[::-1] enc = 1 for bit in range(len(binarized)): enc *= vlist[bit] ** int(binarized[bit]) enc = enc % p print(enc)
n = int(input()) a = list(map(int, input().split())) ss = sum(a) a.sort() if ss%2 == 1: for i in range(0, n): if a[i]%2 == 1: ss -= a[i] break print(ss)
n = int(input()) a = list(map(int, input().split())) ss = sum(a) a.sort() if ss % 2 == 1: for i in range(0, n): if a[i] % 2 == 1: ss -= a[i] break print(ss)
n = input("Enter a binary number to convert to decimal: ") bit_exp = 0 decimals = [] for bit in n[::-1]: if int(bit) == 1: decimals.append(2**bit_exp) bit_exp += 1 decimal = sum(decimals) print(decimals) print(decimal) '''Varigarble -- 2020'''
n = input('Enter a binary number to convert to decimal: ') bit_exp = 0 decimals = [] for bit in n[::-1]: if int(bit) == 1: decimals.append(2 ** bit_exp) bit_exp += 1 decimal = sum(decimals) print(decimals) print(decimal) 'Varigarble -- 2020'
def main(data,n): initial = n dict = {} for i in range(n): dict[data[i]] = True # Check for initial value if data[i]==initial: s = '' while initial in dict: s += str(initial) + ' ' initial -= 1 print(s) else: print(' ') # Function call if __name__=='__main__': n = int(input()) data = list(map(int, input().split())) main(data, n)
def main(data, n): initial = n dict = {} for i in range(n): dict[data[i]] = True if data[i] == initial: s = '' while initial in dict: s += str(initial) + ' ' initial -= 1 print(s) else: print(' ') if __name__ == '__main__': n = int(input()) data = list(map(int, input().split())) main(data, n)
# __init__.py # Version of the turtlefy package __version__ = "0.8.12"
__version__ = '0.8.12'
#enter the celcius temperature to be converted Celcius_temperature = float(input("Enter celcius temperature: ")) #formula for converting celcius temperature to fahrenheit temperature Fahrenheit = (Celcius_temperature * (9/5)) + 32 #printing the fahrenheit temperature print(Fahrenheit)
celcius_temperature = float(input('Enter celcius temperature: ')) fahrenheit = Celcius_temperature * (9 / 5) + 32 print(Fahrenheit)
n=int(input()) matrix=[0]*(n+1) dp=[[[0]*2 for j in range(n+1)] for i in range(n+1)] dp2=[[[0]*2 for j in range(n+1)] for i in range(n+1)] for i in range(1,n+1): matrix[i]=[0] matrix[i].extend([*map(int,input().split())]) ans=0 for i in range(1,n+1): for j in range(1,n+1): dp[i][j][1]=dp2[i][j][1]=matrix[i][j] for i in range(2,n+1): for j in range(i,n+1): for k in range(i,n+1): dp[j][k][i%2]=dp[j-1][k-1][(i-1)%2]+matrix[j][k] dp2[j][k][i%2]=dp2[j-1][k][(i-1)%2]+matrix[j][k-i+1] ans=max(ans,dp[j][k][i%2]-dp2[j][k][i%2]) print(ans)
n = int(input()) matrix = [0] * (n + 1) dp = [[[0] * 2 for j in range(n + 1)] for i in range(n + 1)] dp2 = [[[0] * 2 for j in range(n + 1)] for i in range(n + 1)] for i in range(1, n + 1): matrix[i] = [0] matrix[i].extend([*map(int, input().split())]) ans = 0 for i in range(1, n + 1): for j in range(1, n + 1): dp[i][j][1] = dp2[i][j][1] = matrix[i][j] for i in range(2, n + 1): for j in range(i, n + 1): for k in range(i, n + 1): dp[j][k][i % 2] = dp[j - 1][k - 1][(i - 1) % 2] + matrix[j][k] dp2[j][k][i % 2] = dp2[j - 1][k][(i - 1) % 2] + matrix[j][k - i + 1] ans = max(ans, dp[j][k][i % 2] - dp2[j][k][i % 2]) print(ans)
def readint(): while True: try: num = int(input('Insert a integer:')) if type(num) == int: return num except: print('\033[1;31mERROR: Please, insert a valid integer.\033[m')
def readint(): while True: try: num = int(input('Insert a integer:')) if type(num) == int: return num except: print('\x1b[1;31mERROR: Please, insert a valid integer.\x1b[m')
# Configuration file for the Sphinx documentation builder. # # This file only contains a selection of the most common options. For a full # list see the documentation: # https://www.sphinx-doc.org/en/master/usage/configuration.html # -- Path setup -------------------------------------------------------------- # If extensions (or modules to document with autodoc) are in another directory, # add these directories to sys.path here. If the directory is relative to the # documentation root, use os.path.abspath to make it absolute, like shown here. # # import os # import sys # sys.path.insert(0, os.path.abspath('.')) # -- Project information ----------------------------------------------------- project = "Fortran Programming Language" copyright = "" author = "" # -- General configuration --------------------------------------------------- # Add any Sphinx extension module names here, as strings. They can be # extensions coming with Sphinx (named 'sphinx.ext.*') or your custom # ones. extensions = [ "ablog", "myst_parser", "sphinx_panels", "sphinx.ext.intersphinx", ] # Add any paths that contain templates here, relative to this directory. templates_path = [ "_templates", ] # List of patterns, relative to source directory, that match files and # directories to ignore when looking for source files. # This pattern also affects html_static_path and html_extra_path. exclude_patterns = [ "_build", "Thumbs.db", ".DS_Store", ] # -- Options for HTML output ------------------------------------------------- # The theme to use for HTML and HTML Help pages. See the documentation for # a list of builtin themes. # html_theme = "pydata_sphinx_theme" # Add any paths that contain custom static files (such as style sheets) here, # relative to this directory. They are copied after the builtin static files, # so a file named "default.css" will overwrite the builtin "default.css". html_static_path = [ "_static", ] html_css_files = [ "css/custom.css", ] html_theme_options = { "favicons" : [ { "rel": "icon", "href": "images/favicon.ico", }, ], "show_prev_next": False, "page_sidebar_items": [], "nosidebar": True, "footer_items": ["copyright"], # "navbar_align": "left", "navbar_start": ["navbar-logo"], "navbar_center": ["navbar-nav"], "navbar_end": ["navbar-icon-links"], "icon_links": [ { "name": "Discourse", "url": "https://fortran-lang.discourse.group/", "icon": "fab fa-discourse", }, { "name": "Twitter", "url": "https://twitter.com/fortranlang", "icon": "fab fa-twitter", }, { "name": "GitHub", "url": "https://github.com/fortran-lang", "icon": "fab fa-github", }, { "name": "RSS", "url": "https://fortran-lang.org/news.xml", "icon": "fas fa-rss", }, ] } html_sidebars = { "*": [], "learn/**": [], "news/**": ['postcard.html', 'recentposts.html', 'archives.html'] } html_title = "Fortran Programming Language" html_logo = "_static/images/fortran-logo-256x256.png" html_baseurl = "https://awvwgk.github.io/fortran-lang.org/" master_doc = 'index' panels_add_bootstrap_css = False blog_path = "news" blog_post_pattern = "_posts/*/*" post_redirect_refresh = 1 post_auto_image = 1 post_auto_excerpt = 2 def hide_h1_on_index_pages(app, pagename, templatename, context, doctree): if pagename in ["index", "learn", "compilers", "community", "packages"]: app.add_css_file("css/hide_h1.css") def setup(app): app.connect('html-page-context', hide_h1_on_index_pages)
project = 'Fortran Programming Language' copyright = '' author = '' extensions = ['ablog', 'myst_parser', 'sphinx_panels', 'sphinx.ext.intersphinx'] templates_path = ['_templates'] exclude_patterns = ['_build', 'Thumbs.db', '.DS_Store'] html_theme = 'pydata_sphinx_theme' html_static_path = ['_static'] html_css_files = ['css/custom.css'] html_theme_options = {'favicons': [{'rel': 'icon', 'href': 'images/favicon.ico'}], 'show_prev_next': False, 'page_sidebar_items': [], 'nosidebar': True, 'footer_items': ['copyright'], 'navbar_start': ['navbar-logo'], 'navbar_center': ['navbar-nav'], 'navbar_end': ['navbar-icon-links'], 'icon_links': [{'name': 'Discourse', 'url': 'https://fortran-lang.discourse.group/', 'icon': 'fab fa-discourse'}, {'name': 'Twitter', 'url': 'https://twitter.com/fortranlang', 'icon': 'fab fa-twitter'}, {'name': 'GitHub', 'url': 'https://github.com/fortran-lang', 'icon': 'fab fa-github'}, {'name': 'RSS', 'url': 'https://fortran-lang.org/news.xml', 'icon': 'fas fa-rss'}]} html_sidebars = {'*': [], 'learn/**': [], 'news/**': ['postcard.html', 'recentposts.html', 'archives.html']} html_title = 'Fortran Programming Language' html_logo = '_static/images/fortran-logo-256x256.png' html_baseurl = 'https://awvwgk.github.io/fortran-lang.org/' master_doc = 'index' panels_add_bootstrap_css = False blog_path = 'news' blog_post_pattern = '_posts/*/*' post_redirect_refresh = 1 post_auto_image = 1 post_auto_excerpt = 2 def hide_h1_on_index_pages(app, pagename, templatename, context, doctree): if pagename in ['index', 'learn', 'compilers', 'community', 'packages']: app.add_css_file('css/hide_h1.css') def setup(app): app.connect('html-page-context', hide_h1_on_index_pages)
def tem_bomba_direita(board, position): if position + 1 >= len(board): return False if board[position+1] == "*": return True return False def tem_bomba_esquerda(board, position): if position - 1 < 0: return False if board[position-1] == "*": return True return False def conta_bombas(board, position): cont = 0 if board[position] == "*": return -1 if tem_bomba_direita(board, position): cont += 1 if tem_bomba_esquerda(board, position): cont += 1 return cont def tem_bomba_acima(board, x, y): return True
def tem_bomba_direita(board, position): if position + 1 >= len(board): return False if board[position + 1] == '*': return True return False def tem_bomba_esquerda(board, position): if position - 1 < 0: return False if board[position - 1] == '*': return True return False def conta_bombas(board, position): cont = 0 if board[position] == '*': return -1 if tem_bomba_direita(board, position): cont += 1 if tem_bomba_esquerda(board, position): cont += 1 return cont def tem_bomba_acima(board, x, y): return True
i01.integratedMovement.removeObject("pole") i01.integratedMovement.removeAi("kinect",i01.integratedMovement.Ai.AVOID_COLLISION) i01.rest() sleep(3) i01.integratedMovement.moveTo("rightArm",-300,500,400) mouth.speakBlocking("Hello, I am vinmoov") sleep(3) i01.rest() mouth.speakBlocking("I want to talk to you about a new myrobotlab service called Integrated Movement") mouth.speakBlocking("With this service, I can move my hand to a point in space by using inverse kinematics") i01.integratedMovement.moveTo("leftArm",500,500,600) mouth.speakBlocking("you don't have to specify how I move each of my joint. You just told me where to move") i01.rest() i01.integratedMovement.addObject(-200,500, -1000,-200,500,1000,"pole",30,True) mouth.speakBlocking("Look! Something appear in my field of view. It's a pole so I can do some pole dancing.") mouth.speakBlocking("But that's for another private video called Sexy Dancing Robots.") mouth.speakBlocking("The Integrated Movement service allow to add objects in my surrounding so I can interract with them") i01.integratedMovement.moveTo("rightArm","pole",i01.integratedMovement.ObjectPointLocation.CENTER_SIDE) mouth.speakBlocking("I can move my hand close to that item. I can also see objects in my surrounding using the kinect I have in my belly.") i01.integratedMovement.moveTo("rightArm",-600,600,400) sleep(3) i01.torso.midStom.setVelocity(3) i01.torso.midStom.moveTo(30) mouth.speakBlocking("I can also react if my arm enter in collision with an object I know of") sleep(10) i01.rest() mouth.speakBlocking("I can also try to control where my center of gravity is. When I am in this position, my center of gravity is right in the middle of my belly") mouth.speakBlocking("So I'm standing in a stable position. But if I raise my arm, my center of gravity will shift away and if it get too far from my center point") mouth.speakBlocking("I may tip over and fall if my base is not fixed strong enough") mouth.speakBlocking("If one of my arm is set to keep balance in integrated movement service, I can adjust my position to keep my center of gravity close to my center point") mouth.speakBlocking("that way, I will be able to stand in a more stable position") i01.integratedMovement.setAi("rightArm",i01.integratedMovement.Ai.KEEP_BALANCE) i01.leftArm.omoplate.moveTo(70) i01.leftArm.rotate.moveTo(180) i01.leftArm.bicep.moveTo(40) i01.torso.topStom.moveTo(80)
i01.integratedMovement.removeObject('pole') i01.integratedMovement.removeAi('kinect', i01.integratedMovement.Ai.AVOID_COLLISION) i01.rest() sleep(3) i01.integratedMovement.moveTo('rightArm', -300, 500, 400) mouth.speakBlocking('Hello, I am vinmoov') sleep(3) i01.rest() mouth.speakBlocking('I want to talk to you about a new myrobotlab service called Integrated Movement') mouth.speakBlocking('With this service, I can move my hand to a point in space by using inverse kinematics') i01.integratedMovement.moveTo('leftArm', 500, 500, 600) mouth.speakBlocking("you don't have to specify how I move each of my joint. You just told me where to move") i01.rest() i01.integratedMovement.addObject(-200, 500, -1000, -200, 500, 1000, 'pole', 30, True) mouth.speakBlocking("Look! Something appear in my field of view. It's a pole so I can do some pole dancing.") mouth.speakBlocking("But that's for another private video called Sexy Dancing Robots.") mouth.speakBlocking('The Integrated Movement service allow to add objects in my surrounding so I can interract with them') i01.integratedMovement.moveTo('rightArm', 'pole', i01.integratedMovement.ObjectPointLocation.CENTER_SIDE) mouth.speakBlocking('I can move my hand close to that item. I can also see objects in my surrounding using the kinect I have in my belly.') i01.integratedMovement.moveTo('rightArm', -600, 600, 400) sleep(3) i01.torso.midStom.setVelocity(3) i01.torso.midStom.moveTo(30) mouth.speakBlocking('I can also react if my arm enter in collision with an object I know of') sleep(10) i01.rest() mouth.speakBlocking('I can also try to control where my center of gravity is. When I am in this position, my center of gravity is right in the middle of my belly') mouth.speakBlocking("So I'm standing in a stable position. But if I raise my arm, my center of gravity will shift away and if it get too far from my center point") mouth.speakBlocking('I may tip over and fall if my base is not fixed strong enough') mouth.speakBlocking('If one of my arm is set to keep balance in integrated movement service, I can adjust my position to keep my center of gravity close to my center point') mouth.speakBlocking('that way, I will be able to stand in a more stable position') i01.integratedMovement.setAi('rightArm', i01.integratedMovement.Ai.KEEP_BALANCE) i01.leftArm.omoplate.moveTo(70) i01.leftArm.rotate.moveTo(180) i01.leftArm.bicep.moveTo(40) i01.torso.topStom.moveTo(80)
# Authors: David Mutchler, Dave Fisher, and many others before them. print('Hello, World') print('hi there') print('one', 'two', 'through my shoe') print(3 + 9) print('3 + 9', 'versus', 3 + 9) # done: After we talk together about the above, add PRINT statements that print: # done: 1. A Hello message to a friend. # done: 2. Two big numbers, followed by their sum. # done: 3. The result of 3,607 multiplied by 34,227. (Hint: the result is interesting.) # done: 4. Anything else you like! print('hi mommy') print('2345 + 3467 =', 2345+3467) print('3607 * 34227 =', 3607*34227) for x in range(10): print("I Love You Daddy!") for x in range(10): print("I love you", x + 2) # for x in range(10): # print(x)
print('Hello, World') print('hi there') print('one', 'two', 'through my shoe') print(3 + 9) print('3 + 9', 'versus', 3 + 9) print('hi mommy') print('2345 + 3467 =', 2345 + 3467) print('3607 * 34227 =', 3607 * 34227) for x in range(10): print('I Love You Daddy!') for x in range(10): print('I love you', x + 2)
def removeDuplicates(nums): n = len(nums) mp = {} for i in range(0 , n): if nums[i] not in mp: mp[nums[i]] = nums[i] op = mp.keys() return op op = removeDuplicates([0,0,1,1,1,2,2,3,3,4]) print(op)
def remove_duplicates(nums): n = len(nums) mp = {} for i in range(0, n): if nums[i] not in mp: mp[nums[i]] = nums[i] op = mp.keys() return op op = remove_duplicates([0, 0, 1, 1, 1, 2, 2, 3, 3, 4]) print(op)
c.NotebookApp.open_browser = False c.NotebookApp.ip='0.0.0.0' #'*' c.NotebookApp.port = 8192 c.NotebookApp.password = u'sha1:45f7d7ac038c:c36b98f22eac5921c435095af65a9a00b0e1eeb9' c.Authenticator.admin_users = {'jupyter'} c.LocalAuthenticator.create_system_users = True
c.NotebookApp.open_browser = False c.NotebookApp.ip = '0.0.0.0' c.NotebookApp.port = 8192 c.NotebookApp.password = u'sha1:45f7d7ac038c:c36b98f22eac5921c435095af65a9a00b0e1eeb9' c.Authenticator.admin_users = {'jupyter'} c.LocalAuthenticator.create_system_users = True
#Actividad 7 Ejercicios For numeros = [1, 2, 3, 4, 5, 6, 7, 8 , 9, 10] numeros2 = [1, 2, 3, 4, 5, 6, 7, 8 , 9, 10] cadena="BIENVENIDOS" indice=0 for letra in "UNIVERSIDAD ESTATAL DE SONORA": print(letra) else: print("FIN DEL BUCLE") for i in numeros: print(i) print("") for x in numeros: x*=20 print(x) for x in numeros: numeros[indice]*=20 indice+=1 print(numeros) print("") print("") for indice, numero in enumerate(numeros2): numeros2[indice]*=40 print(numeros2) print("") for caracter in cadena: print(caracter)
numeros = [1, 2, 3, 4, 5, 6, 7, 8, 9, 10] numeros2 = [1, 2, 3, 4, 5, 6, 7, 8, 9, 10] cadena = 'BIENVENIDOS' indice = 0 for letra in 'UNIVERSIDAD ESTATAL DE SONORA': print(letra) else: print('FIN DEL BUCLE') for i in numeros: print(i) print('') for x in numeros: x *= 20 print(x) for x in numeros: numeros[indice] *= 20 indice += 1 print(numeros) print('') print('') for (indice, numero) in enumerate(numeros2): numeros2[indice] *= 40 print(numeros2) print('') for caracter in cadena: print(caracter)
# Kalman filter | KalmanFilter(VAR, EST_VAR) STD_DEV = 0.075 VAR = 0.1 EST_VAR = STD_DEV ** 2 # PID P_ = 3.6 I_ = 0.02 D_ = 0.6 PID_MIN_VAL = -50 PID_MAX_VAL = 50
std_dev = 0.075 var = 0.1 est_var = STD_DEV ** 2 p_ = 3.6 i_ = 0.02 d_ = 0.6 pid_min_val = -50 pid_max_val = 50
class Solution: def countGoodTriplets(self, arr: List[int], a: int, b: int, c: int) -> int: s1=0 x=len(arr) for i in range(x-2): for j in range(i+1,x-1): if abs(arr[i]-arr[j])<=a: for k in range(j+1,x): if abs(arr[j]-arr[k])<=b and abs(arr[i]-arr[k])<=c: s1+=1 return s1
class Solution: def count_good_triplets(self, arr: List[int], a: int, b: int, c: int) -> int: s1 = 0 x = len(arr) for i in range(x - 2): for j in range(i + 1, x - 1): if abs(arr[i] - arr[j]) <= a: for k in range(j + 1, x): if abs(arr[j] - arr[k]) <= b and abs(arr[i] - arr[k]) <= c: s1 += 1 return s1
for i in range(int(input())): x = list(map(int, input().split())) x.sort() print(x[-2])
for i in range(int(input())): x = list(map(int, input().split())) x.sort() print(x[-2])
# # PySNMP MIB module VPMT-OPT-MIB (http://snmplabs.com/pysmi) # ASN.1 source file:///Users/davwang4/Dev/mibs.snmplabs.com/asn1/VPMT-OPT-MIB # Produced by pysmi-0.3.4 at Mon Apr 29 21:28:31 2019 # On host DAVWANG4-M-1475 platform Darwin version 18.5.0 by user davwang4 # Using Python version 3.7.3 (default, Mar 27 2019, 09:23:15) # ObjectIdentifier, Integer, OctetString = mibBuilder.importSymbols("ASN1", "ObjectIdentifier", "Integer", "OctetString") NamedValues, = mibBuilder.importSymbols("ASN1-ENUMERATION", "NamedValues") ValueSizeConstraint, ValueRangeConstraint, SingleValueConstraint, ConstraintsIntersection, ConstraintsUnion = mibBuilder.importSymbols("ASN1-REFINEMENT", "ValueSizeConstraint", "ValueRangeConstraint", "SingleValueConstraint", "ConstraintsIntersection", "ConstraintsUnion") NotificationGroup, ModuleCompliance = mibBuilder.importSymbols("SNMPv2-CONF", "NotificationGroup", "ModuleCompliance") MibScalar, MibTable, MibTableRow, MibTableColumn, enterprises, MibIdentifier, Bits, TimeTicks, NotificationType, IpAddress, Integer32, Unsigned32, Gauge32, Counter32, ObjectIdentity, Counter64, iso, ModuleIdentity = mibBuilder.importSymbols("SNMPv2-SMI", "MibScalar", "MibTable", "MibTableRow", "MibTableColumn", "enterprises", "MibIdentifier", "Bits", "TimeTicks", "NotificationType", "IpAddress", "Integer32", "Unsigned32", "Gauge32", "Counter32", "ObjectIdentity", "Counter64", "iso", "ModuleIdentity") TextualConvention, DisplayString = mibBuilder.importSymbols("SNMPv2-TC", "TextualConvention", "DisplayString") codex = MibIdentifier((1, 3, 6, 1, 4, 1, 449)) cdxProductSpecific = MibIdentifier((1, 3, 6, 1, 4, 1, 449, 2)) cdx6500 = MibIdentifier((1, 3, 6, 1, 4, 1, 449, 2, 1)) cdx6500Configuration = MibIdentifier((1, 3, 6, 1, 4, 1, 449, 2, 1, 2)) cdx6500CfgGeneralGroup = MibIdentifier((1, 3, 6, 1, 4, 1, 449, 2, 1, 2, 2)) class DisplayString(OctetString): pass cdx6500VPMTCfgTable = MibTable((1, 3, 6, 1, 4, 1, 449, 2, 1, 2, 2, 26), ) if mibBuilder.loadTexts: cdx6500VPMTCfgTable.setStatus('mandatory') cdx6500VPMTCfgEntry = MibTableRow((1, 3, 6, 1, 4, 1, 449, 2, 1, 2, 2, 26, 1), ).setIndexNames((0, "VPMT-OPT-MIB", "cdx6500VPMTCfgEntryNum")) if mibBuilder.loadTexts: cdx6500VPMTCfgEntry.setStatus('mandatory') cdx6500VPMTCfgEntryNum = MibTableColumn((1, 3, 6, 1, 4, 1, 449, 2, 1, 2, 2, 26, 1, 1), Integer32()).setMaxAccess("readonly") if mibBuilder.loadTexts: cdx6500VPMTCfgEntryNum.setStatus('mandatory') cdx6500VPMTCfgvpType = MibTableColumn((1, 3, 6, 1, 4, 1, 449, 2, 1, 2, 2, 26, 1, 2), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12))).clone(namedValues=NamedValues(("vpmt-ptype-null", 1), ("vpmt-ptype-voice", 2), ("vpmt-ptype-pri-voice", 3), ("vpmt-ptype-bypass-voice", 4), ("vpmt-ptype-tdm-data", 5), ("vpmt-ptype-pri-data", 6), ("vpmt-ptype-bypass-data", 7), ("vpmt-ptype-trans-ccs-voice", 8), ("vpmt-ptype-ccs-bypass", 9), ("vpmt-ptype-bri-voice", 10), ("vpmt-ptype-aam", 11), ("vpmt-ptype-num", 12)))).setMaxAccess("readonly") if mibBuilder.loadTexts: cdx6500VPMTCfgvpType.setStatus('mandatory') cdx6500VPMTCfgvpNum = MibTableColumn((1, 3, 6, 1, 4, 1, 449, 2, 1, 2, 2, 26, 1, 3), Integer32().subtype(subtypeSpec=ValueRangeConstraint(100, 254))).setMaxAccess("readonly") if mibBuilder.loadTexts: cdx6500VPMTCfgvpNum.setStatus('mandatory') cdx6500VPMTCfgdslNum = MibTableColumn((1, 3, 6, 1, 4, 1, 449, 2, 1, 2, 2, 26, 1, 4), Integer32().subtype(subtypeSpec=ValueRangeConstraint(4, 7))).setMaxAccess("readonly") if mibBuilder.loadTexts: cdx6500VPMTCfgdslNum.setStatus('mandatory') cdx6500VPMTCfgds0Rate = MibTableColumn((1, 3, 6, 1, 4, 1, 449, 2, 1, 2, 2, 26, 1, 5), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2, 3))).clone(namedValues=NamedValues(("vpmt-rate-56k", 1), ("vpmt-rate-64k", 2), ("vpmt-rate-num", 3)))).setMaxAccess("readonly") if mibBuilder.loadTexts: cdx6500VPMTCfgds0Rate.setStatus('mandatory') cdx6500VPMTCfgsrcTimeSlot = MibTableColumn((1, 3, 6, 1, 4, 1, 449, 2, 1, 2, 2, 26, 1, 6), Integer32()).setMaxAccess("readonly") if mibBuilder.loadTexts: cdx6500VPMTCfgsrcTimeSlot.setStatus('mandatory') cdx6500VPMTCfgdestTimeSlot = MibTableColumn((1, 3, 6, 1, 4, 1, 449, 2, 1, 2, 2, 26, 1, 7), Integer32()).setMaxAccess("readonly") if mibBuilder.loadTexts: cdx6500VPMTCfgdestTimeSlot.setStatus('mandatory') cdx6500VPMTCfglocalDialNum = MibTableColumn((1, 3, 6, 1, 4, 1, 449, 2, 1, 2, 2, 26, 1, 8), DisplayString().subtype(subtypeSpec=ValueSizeConstraint(0, 17))).setMaxAccess("readonly") if mibBuilder.loadTexts: cdx6500VPMTCfglocalDialNum.setStatus('mandatory') cdx6500VPMTCfgsubAddress = MibTableColumn((1, 3, 6, 1, 4, 1, 449, 2, 1, 2, 2, 26, 1, 9), DisplayString().subtype(subtypeSpec=ValueSizeConstraint(0, 17))).setMaxAccess("readonly") if mibBuilder.loadTexts: cdx6500VPMTCfgsubAddress.setStatus('mandatory') cdx6500VPMTCfgcallPermission = MibTableColumn((1, 3, 6, 1, 4, 1, 449, 2, 1, 2, 2, 26, 1, 10), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2))).clone(namedValues=NamedValues(("out", 1), ("inc", 2)))).setMaxAccess("readonly") if mibBuilder.loadTexts: cdx6500VPMTCfgcallPermission.setStatus('mandatory') cdx6500VPMTCfgnum_ccs_bypass_connections = MibScalar((1, 3, 6, 1, 4, 1, 449, 2, 1, 2, 2, 26, 1, 11), Integer32()).setLabel("cdx6500VPMTCfgnum-ccs-bypass-connections").setMaxAccess("readonly") if mibBuilder.loadTexts: cdx6500VPMTCfgnum_ccs_bypass_connections.setStatus('mandatory') cdx6500VPMTCfgPhysical_Port = MibScalar((1, 3, 6, 1, 4, 1, 449, 2, 1, 2, 2, 26, 1, 12), Integer32()).setLabel("cdx6500VPMTCfgPhysical-Port").setMaxAccess("readonly") if mibBuilder.loadTexts: cdx6500VPMTCfgPhysical_Port.setStatus('mandatory') mibBuilder.exportSymbols("VPMT-OPT-MIB", cdx6500VPMTCfgdslNum=cdx6500VPMTCfgdslNum, codex=codex, cdx6500VPMTCfgsrcTimeSlot=cdx6500VPMTCfgsrcTimeSlot, cdx6500VPMTCfgsubAddress=cdx6500VPMTCfgsubAddress, cdx6500VPMTCfgds0Rate=cdx6500VPMTCfgds0Rate, cdx6500CfgGeneralGroup=cdx6500CfgGeneralGroup, cdx6500VPMTCfgEntryNum=cdx6500VPMTCfgEntryNum, cdx6500VPMTCfgcallPermission=cdx6500VPMTCfgcallPermission, cdx6500VPMTCfgTable=cdx6500VPMTCfgTable, cdxProductSpecific=cdxProductSpecific, cdx6500VPMTCfglocalDialNum=cdx6500VPMTCfglocalDialNum, cdx6500VPMTCfgvpNum=cdx6500VPMTCfgvpNum, cdx6500VPMTCfgdestTimeSlot=cdx6500VPMTCfgdestTimeSlot, cdx6500VPMTCfgnum_ccs_bypass_connections=cdx6500VPMTCfgnum_ccs_bypass_connections, cdx6500Configuration=cdx6500Configuration, cdx6500VPMTCfgvpType=cdx6500VPMTCfgvpType, cdx6500VPMTCfgPhysical_Port=cdx6500VPMTCfgPhysical_Port, cdx6500=cdx6500, cdx6500VPMTCfgEntry=cdx6500VPMTCfgEntry, DisplayString=DisplayString)
(object_identifier, integer, octet_string) = mibBuilder.importSymbols('ASN1', 'ObjectIdentifier', 'Integer', 'OctetString') (named_values,) = mibBuilder.importSymbols('ASN1-ENUMERATION', 'NamedValues') (value_size_constraint, value_range_constraint, single_value_constraint, constraints_intersection, constraints_union) = mibBuilder.importSymbols('ASN1-REFINEMENT', 'ValueSizeConstraint', 'ValueRangeConstraint', 'SingleValueConstraint', 'ConstraintsIntersection', 'ConstraintsUnion') (notification_group, module_compliance) = mibBuilder.importSymbols('SNMPv2-CONF', 'NotificationGroup', 'ModuleCompliance') (mib_scalar, mib_table, mib_table_row, mib_table_column, enterprises, mib_identifier, bits, time_ticks, notification_type, ip_address, integer32, unsigned32, gauge32, counter32, object_identity, counter64, iso, module_identity) = mibBuilder.importSymbols('SNMPv2-SMI', 'MibScalar', 'MibTable', 'MibTableRow', 'MibTableColumn', 'enterprises', 'MibIdentifier', 'Bits', 'TimeTicks', 'NotificationType', 'IpAddress', 'Integer32', 'Unsigned32', 'Gauge32', 'Counter32', 'ObjectIdentity', 'Counter64', 'iso', 'ModuleIdentity') (textual_convention, display_string) = mibBuilder.importSymbols('SNMPv2-TC', 'TextualConvention', 'DisplayString') codex = mib_identifier((1, 3, 6, 1, 4, 1, 449)) cdx_product_specific = mib_identifier((1, 3, 6, 1, 4, 1, 449, 2)) cdx6500 = mib_identifier((1, 3, 6, 1, 4, 1, 449, 2, 1)) cdx6500_configuration = mib_identifier((1, 3, 6, 1, 4, 1, 449, 2, 1, 2)) cdx6500_cfg_general_group = mib_identifier((1, 3, 6, 1, 4, 1, 449, 2, 1, 2, 2)) class Displaystring(OctetString): pass cdx6500_vpmt_cfg_table = mib_table((1, 3, 6, 1, 4, 1, 449, 2, 1, 2, 2, 26)) if mibBuilder.loadTexts: cdx6500VPMTCfgTable.setStatus('mandatory') cdx6500_vpmt_cfg_entry = mib_table_row((1, 3, 6, 1, 4, 1, 449, 2, 1, 2, 2, 26, 1)).setIndexNames((0, 'VPMT-OPT-MIB', 'cdx6500VPMTCfgEntryNum')) if mibBuilder.loadTexts: cdx6500VPMTCfgEntry.setStatus('mandatory') cdx6500_vpmt_cfg_entry_num = mib_table_column((1, 3, 6, 1, 4, 1, 449, 2, 1, 2, 2, 26, 1, 1), integer32()).setMaxAccess('readonly') if mibBuilder.loadTexts: cdx6500VPMTCfgEntryNum.setStatus('mandatory') cdx6500_vpmt_cfgvp_type = mib_table_column((1, 3, 6, 1, 4, 1, 449, 2, 1, 2, 2, 26, 1, 2), integer32().subtype(subtypeSpec=constraints_union(single_value_constraint(1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12))).clone(namedValues=named_values(('vpmt-ptype-null', 1), ('vpmt-ptype-voice', 2), ('vpmt-ptype-pri-voice', 3), ('vpmt-ptype-bypass-voice', 4), ('vpmt-ptype-tdm-data', 5), ('vpmt-ptype-pri-data', 6), ('vpmt-ptype-bypass-data', 7), ('vpmt-ptype-trans-ccs-voice', 8), ('vpmt-ptype-ccs-bypass', 9), ('vpmt-ptype-bri-voice', 10), ('vpmt-ptype-aam', 11), ('vpmt-ptype-num', 12)))).setMaxAccess('readonly') if mibBuilder.loadTexts: cdx6500VPMTCfgvpType.setStatus('mandatory') cdx6500_vpmt_cfgvp_num = mib_table_column((1, 3, 6, 1, 4, 1, 449, 2, 1, 2, 2, 26, 1, 3), integer32().subtype(subtypeSpec=value_range_constraint(100, 254))).setMaxAccess('readonly') if mibBuilder.loadTexts: cdx6500VPMTCfgvpNum.setStatus('mandatory') cdx6500_vpmt_cfgdsl_num = mib_table_column((1, 3, 6, 1, 4, 1, 449, 2, 1, 2, 2, 26, 1, 4), integer32().subtype(subtypeSpec=value_range_constraint(4, 7))).setMaxAccess('readonly') if mibBuilder.loadTexts: cdx6500VPMTCfgdslNum.setStatus('mandatory') cdx6500_vpmt_cfgds0_rate = mib_table_column((1, 3, 6, 1, 4, 1, 449, 2, 1, 2, 2, 26, 1, 5), integer32().subtype(subtypeSpec=constraints_union(single_value_constraint(1, 2, 3))).clone(namedValues=named_values(('vpmt-rate-56k', 1), ('vpmt-rate-64k', 2), ('vpmt-rate-num', 3)))).setMaxAccess('readonly') if mibBuilder.loadTexts: cdx6500VPMTCfgds0Rate.setStatus('mandatory') cdx6500_vpmt_cfgsrc_time_slot = mib_table_column((1, 3, 6, 1, 4, 1, 449, 2, 1, 2, 2, 26, 1, 6), integer32()).setMaxAccess('readonly') if mibBuilder.loadTexts: cdx6500VPMTCfgsrcTimeSlot.setStatus('mandatory') cdx6500_vpmt_cfgdest_time_slot = mib_table_column((1, 3, 6, 1, 4, 1, 449, 2, 1, 2, 2, 26, 1, 7), integer32()).setMaxAccess('readonly') if mibBuilder.loadTexts: cdx6500VPMTCfgdestTimeSlot.setStatus('mandatory') cdx6500_vpmt_cfglocal_dial_num = mib_table_column((1, 3, 6, 1, 4, 1, 449, 2, 1, 2, 2, 26, 1, 8), display_string().subtype(subtypeSpec=value_size_constraint(0, 17))).setMaxAccess('readonly') if mibBuilder.loadTexts: cdx6500VPMTCfglocalDialNum.setStatus('mandatory') cdx6500_vpmt_cfgsub_address = mib_table_column((1, 3, 6, 1, 4, 1, 449, 2, 1, 2, 2, 26, 1, 9), display_string().subtype(subtypeSpec=value_size_constraint(0, 17))).setMaxAccess('readonly') if mibBuilder.loadTexts: cdx6500VPMTCfgsubAddress.setStatus('mandatory') cdx6500_vpmt_cfgcall_permission = mib_table_column((1, 3, 6, 1, 4, 1, 449, 2, 1, 2, 2, 26, 1, 10), integer32().subtype(subtypeSpec=constraints_union(single_value_constraint(1, 2))).clone(namedValues=named_values(('out', 1), ('inc', 2)))).setMaxAccess('readonly') if mibBuilder.loadTexts: cdx6500VPMTCfgcallPermission.setStatus('mandatory') cdx6500_vpmt_cfgnum_ccs_bypass_connections = mib_scalar((1, 3, 6, 1, 4, 1, 449, 2, 1, 2, 2, 26, 1, 11), integer32()).setLabel('cdx6500VPMTCfgnum-ccs-bypass-connections').setMaxAccess('readonly') if mibBuilder.loadTexts: cdx6500VPMTCfgnum_ccs_bypass_connections.setStatus('mandatory') cdx6500_vpmt_cfg_physical__port = mib_scalar((1, 3, 6, 1, 4, 1, 449, 2, 1, 2, 2, 26, 1, 12), integer32()).setLabel('cdx6500VPMTCfgPhysical-Port').setMaxAccess('readonly') if mibBuilder.loadTexts: cdx6500VPMTCfgPhysical_Port.setStatus('mandatory') mibBuilder.exportSymbols('VPMT-OPT-MIB', cdx6500VPMTCfgdslNum=cdx6500VPMTCfgdslNum, codex=codex, cdx6500VPMTCfgsrcTimeSlot=cdx6500VPMTCfgsrcTimeSlot, cdx6500VPMTCfgsubAddress=cdx6500VPMTCfgsubAddress, cdx6500VPMTCfgds0Rate=cdx6500VPMTCfgds0Rate, cdx6500CfgGeneralGroup=cdx6500CfgGeneralGroup, cdx6500VPMTCfgEntryNum=cdx6500VPMTCfgEntryNum, cdx6500VPMTCfgcallPermission=cdx6500VPMTCfgcallPermission, cdx6500VPMTCfgTable=cdx6500VPMTCfgTable, cdxProductSpecific=cdxProductSpecific, cdx6500VPMTCfglocalDialNum=cdx6500VPMTCfglocalDialNum, cdx6500VPMTCfgvpNum=cdx6500VPMTCfgvpNum, cdx6500VPMTCfgdestTimeSlot=cdx6500VPMTCfgdestTimeSlot, cdx6500VPMTCfgnum_ccs_bypass_connections=cdx6500VPMTCfgnum_ccs_bypass_connections, cdx6500Configuration=cdx6500Configuration, cdx6500VPMTCfgvpType=cdx6500VPMTCfgvpType, cdx6500VPMTCfgPhysical_Port=cdx6500VPMTCfgPhysical_Port, cdx6500=cdx6500, cdx6500VPMTCfgEntry=cdx6500VPMTCfgEntry, DisplayString=DisplayString)
# Define minimum distance threshold in map dist_thresh = 0.5 scaling_factor = int(1 / dist_thresh) # Define threshold around goal goal_thresh = int(scaling_factor * 1.5) # Define map size width, height = 300, 200 map_size = (scaling_factor * height), (scaling_factor * width) # Define all the possible no. of actions max_actions = 5 half_actions = max_actions // 2 # Define total angle of a complete circle total_angle = 360 # Define exploration constants no_parent = -1 node_generated = 1 start_parent = -99
dist_thresh = 0.5 scaling_factor = int(1 / dist_thresh) goal_thresh = int(scaling_factor * 1.5) (width, height) = (300, 200) map_size = (scaling_factor * height, scaling_factor * width) max_actions = 5 half_actions = max_actions // 2 total_angle = 360 no_parent = -1 node_generated = 1 start_parent = -99
def outside(r, c, size): if r < 0 or c < 0 or r >= size or c >= size: return True return False def get_next_pos(r, c, command): if command == 'up': return r - 1, c elif command == 'down': return r + 1, c elif command == 'left': return r, c - 1 elif command == 'right': return r, c + 1 def get_matrix(size): matrix, santa_row, santa_col = [], 0, 0 unhappy_nice_kids = 0 for _ in range(size): row = input().split() matrix.append(row) if 'S' in row: santa_row, santa_col = matrix.index(row), row.index('S') return matrix, santa_row, santa_col, unhappy_nice_kids happy_kids = 0 presents = int(input()) n = int(input()) matrix, santa_row, santa_col, unhappy_nice_kids = get_matrix(n) command = input() while command != 'Christmas morning': santa_next_row, santa_next_col = get_next_pos(santa_row, santa_col, command) if outside(santa_next_row, santa_next_col, n): command = input() continue if matrix[santa_next_row][santa_next_col] == 'V': matrix[santa_row][santa_col] = '-' matrix[santa_next_row][santa_next_col] = 'S' presents -= 1 happy_kids += 1 if presents <= 0: break elif matrix[santa_next_row][santa_next_col] == 'C': matrix[santa_row][santa_col] = '-' matrix[santa_next_row][santa_next_col] = 'S' if matrix[santa_next_row - 1][santa_next_col] == 'V' or matrix[santa_next_row - 1][santa_next_col] == 'X': # up if matrix[santa_next_row - 1][santa_next_col] == 'V': happy_kids += 1 matrix[santa_next_row - 1][santa_next_col] = '-' presents -= 1 if presents <= 0: break if matrix[santa_next_row + 1][santa_next_col] == 'V' or matrix[santa_next_row + 1][santa_next_col] == 'X': # down if matrix[santa_next_row + 1][santa_next_col] == 'V': happy_kids += 1 matrix[santa_next_row + 1][santa_next_col] = '-' presents -= 1 if presents <= 0: break if matrix[santa_next_row][santa_next_col - 1] == 'V' or matrix[santa_next_row][santa_next_col -1] == 'X': # left if matrix[santa_next_row][santa_next_col - 1] == 'V': happy_kids += 1 matrix[santa_next_row][santa_next_col - 1] = '-' presents -= 1 if presents <= 0: break if matrix[santa_next_row][santa_next_col + 1] == 'V' or matrix[santa_next_row][santa_next_col + 1] == 'X': if matrix[santa_next_row][santa_next_col + 1] == 'V': happy_kids += 1 matrix[santa_next_row][santa_next_col + 1] = '-' presents -= 1 if presents <= 0: break else: matrix[santa_row][santa_col] = '-' matrix[santa_next_row][santa_next_col] = 'S' santa_row, santa_col = santa_next_row, santa_next_col command = input() if presents == 0: for row in matrix: if 'V' in row: print('Santa ran out of presents!') break [print(' '.join(row)) for row in matrix] nice_kids_left = 0 for row in matrix: if 'V' in row: nice_kids_left += row.count('V') if nice_kids_left == 0: print(f'Good job, Santa! {happy_kids} happy nice kid/s.') else: print(f'No presents for {nice_kids_left} nice kid/s.')
def outside(r, c, size): if r < 0 or c < 0 or r >= size or (c >= size): return True return False def get_next_pos(r, c, command): if command == 'up': return (r - 1, c) elif command == 'down': return (r + 1, c) elif command == 'left': return (r, c - 1) elif command == 'right': return (r, c + 1) def get_matrix(size): (matrix, santa_row, santa_col) = ([], 0, 0) unhappy_nice_kids = 0 for _ in range(size): row = input().split() matrix.append(row) if 'S' in row: (santa_row, santa_col) = (matrix.index(row), row.index('S')) return (matrix, santa_row, santa_col, unhappy_nice_kids) happy_kids = 0 presents = int(input()) n = int(input()) (matrix, santa_row, santa_col, unhappy_nice_kids) = get_matrix(n) command = input() while command != 'Christmas morning': (santa_next_row, santa_next_col) = get_next_pos(santa_row, santa_col, command) if outside(santa_next_row, santa_next_col, n): command = input() continue if matrix[santa_next_row][santa_next_col] == 'V': matrix[santa_row][santa_col] = '-' matrix[santa_next_row][santa_next_col] = 'S' presents -= 1 happy_kids += 1 if presents <= 0: break elif matrix[santa_next_row][santa_next_col] == 'C': matrix[santa_row][santa_col] = '-' matrix[santa_next_row][santa_next_col] = 'S' if matrix[santa_next_row - 1][santa_next_col] == 'V' or matrix[santa_next_row - 1][santa_next_col] == 'X': if matrix[santa_next_row - 1][santa_next_col] == 'V': happy_kids += 1 matrix[santa_next_row - 1][santa_next_col] = '-' presents -= 1 if presents <= 0: break if matrix[santa_next_row + 1][santa_next_col] == 'V' or matrix[santa_next_row + 1][santa_next_col] == 'X': if matrix[santa_next_row + 1][santa_next_col] == 'V': happy_kids += 1 matrix[santa_next_row + 1][santa_next_col] = '-' presents -= 1 if presents <= 0: break if matrix[santa_next_row][santa_next_col - 1] == 'V' or matrix[santa_next_row][santa_next_col - 1] == 'X': if matrix[santa_next_row][santa_next_col - 1] == 'V': happy_kids += 1 matrix[santa_next_row][santa_next_col - 1] = '-' presents -= 1 if presents <= 0: break if matrix[santa_next_row][santa_next_col + 1] == 'V' or matrix[santa_next_row][santa_next_col + 1] == 'X': if matrix[santa_next_row][santa_next_col + 1] == 'V': happy_kids += 1 matrix[santa_next_row][santa_next_col + 1] = '-' presents -= 1 if presents <= 0: break else: matrix[santa_row][santa_col] = '-' matrix[santa_next_row][santa_next_col] = 'S' (santa_row, santa_col) = (santa_next_row, santa_next_col) command = input() if presents == 0: for row in matrix: if 'V' in row: print('Santa ran out of presents!') break [print(' '.join(row)) for row in matrix] nice_kids_left = 0 for row in matrix: if 'V' in row: nice_kids_left += row.count('V') if nice_kids_left == 0: print(f'Good job, Santa! {happy_kids} happy nice kid/s.') else: print(f'No presents for {nice_kids_left} nice kid/s.')
# eradicate a destroyed file system snapshot named myfs.mysnap client.delete_file_system_snapshots(names=["myfs.mysnap"]) # Other valid fields: ids # See section "Common Fields" for examples
client.delete_file_system_snapshots(names=['myfs.mysnap'])
''' The Olympic competitions between 1952 and 1988 took place during the height of the Cold War between the United States of America (USA) & the Union of Soviet Socialist Republics (USSR). Your goal in this exercise is to aggregate the number of distinct sports in which the USA and the USSR won medals during the Cold War years. The construction is mostly the same as in the preceding exercise. There is an additional filtering stage beforehand in which you reduce the original DataFrame medals by extracting data from the Cold War period that applies only to the US or to the USSR. The relevant country codes in the DataFrame, which has been pre-loaded as medals, are 'USA' & 'URS'. ''' # Extract all rows for which the 'Edition' is between 1952 & 1988: during_cold_war during_cold_war = (medals['Edition'] >= 1952) & (medals['Edition'] <= 1988) # Extract rows for which 'NOC' is either 'USA' or 'URS': is_usa_urs is_usa_urs = medals.NOC.isin(['USA', 'URS']) # Use during_cold_war and is_usa_urs to create the DataFrame: cold_war_medals cold_war_medals = medals.loc[during_cold_war & is_usa_urs] # Group cold_war_medals by 'NOC' country_grouped = cold_war_medals.groupby('NOC') # Create Nsports Nsports = country_grouped['Sport'].nunique().sort_values(ascending=False) # Print Nsports print(Nsports)
""" The Olympic competitions between 1952 and 1988 took place during the height of the Cold War between the United States of America (USA) & the Union of Soviet Socialist Republics (USSR). Your goal in this exercise is to aggregate the number of distinct sports in which the USA and the USSR won medals during the Cold War years. The construction is mostly the same as in the preceding exercise. There is an additional filtering stage beforehand in which you reduce the original DataFrame medals by extracting data from the Cold War period that applies only to the US or to the USSR. The relevant country codes in the DataFrame, which has been pre-loaded as medals, are 'USA' & 'URS'. """ during_cold_war = (medals['Edition'] >= 1952) & (medals['Edition'] <= 1988) is_usa_urs = medals.NOC.isin(['USA', 'URS']) cold_war_medals = medals.loc[during_cold_war & is_usa_urs] country_grouped = cold_war_medals.groupby('NOC') nsports = country_grouped['Sport'].nunique().sort_values(ascending=False) print(Nsports)
grades = int(input()) name_exam = str(input()) grade = int(input()) poor_grade = 0 pas = True average = 0 problems_solved = 0 last_name_exam = str() while name_exam != "Enough": if int(grade) <= 4: poor_grade += 1 if poor_grade == grades: pas = False break problems_solved += 1 average += int(grade) last_name_exam = name_exam name_exam = str(input()) grade = input() if pas: print(f"Average score: {average / problems_solved:.2f}") print(f"Number of problems: {problems_solved}") print(f"Last problem: {last_name_exam}") else: print(f"You need a break, {poor_grade} poor grades.")
grades = int(input()) name_exam = str(input()) grade = int(input()) poor_grade = 0 pas = True average = 0 problems_solved = 0 last_name_exam = str() while name_exam != 'Enough': if int(grade) <= 4: poor_grade += 1 if poor_grade == grades: pas = False break problems_solved += 1 average += int(grade) last_name_exam = name_exam name_exam = str(input()) grade = input() if pas: print(f'Average score: {average / problems_solved:.2f}') print(f'Number of problems: {problems_solved}') print(f'Last problem: {last_name_exam}') else: print(f'You need a break, {poor_grade} poor grades.')
# Coding is all about making things easier for ourselves. # Some times you will be writing the same code over and # over again. When this happens, it is often best to write # a function. # functions are defined with the def keyword: def paulsFunction(): # anything inside the function will execute when I call it print("Hello! Nice function!") # To run the code, just call the function paulsFunction()
def pauls_function(): print('Hello! Nice function!') pauls_function()
def narcissistic(num): sum = 0 iterableNum = str(num) for i in iterableNum: sum += int(i) ** len(iterableNum) return True if sum == num else False # One-liner: def narcissistic2(num): return num == sum(int(i) ** len(str(num)) for i in str(num))
def narcissistic(num): sum = 0 iterable_num = str(num) for i in iterableNum: sum += int(i) ** len(iterableNum) return True if sum == num else False def narcissistic2(num): return num == sum((int(i) ** len(str(num)) for i in str(num)))
def answer_type(request, json_list, nested): for question in json_list: if question['payload']['object_type'] == 'task_instance': question['answer_class'] = 'task_answer'
def answer_type(request, json_list, nested): for question in json_list: if question['payload']['object_type'] == 'task_instance': question['answer_class'] = 'task_answer'
# Solution 1 # def remove_duplicates(arr): # val_tracker = {} # for num in arr: # if num not in arr: # val_tracker[num] = 1 # else: # print('True') # return True # print('False') # return False # Solution 2 def remove_duplicates(arr): unique = set(arr) if len(unique) != len(arr): print('True') return True else: print('False') return False test_arr = [1, 1, 1, 1, 2, 3, 4, 5, 5, 5] answer_arr = set(test_arr) remove_duplicates(test_arr)
def remove_duplicates(arr): unique = set(arr) if len(unique) != len(arr): print('True') return True else: print('False') return False test_arr = [1, 1, 1, 1, 2, 3, 4, 5, 5, 5] answer_arr = set(test_arr) remove_duplicates(test_arr)
index = 1 result = 0 while index < 1000: if index % 3 ==0 or index % 5 == 0: result = result + index index = index + 1 print(result)
index = 1 result = 0 while index < 1000: if index % 3 == 0 or index % 5 == 0: result = result + index index = index + 1 print(result)
class NoticeModel: def __init__(self, dbRow): self.ID = dbRow["ID"] self.Message = dbRow["Message"] self.Timestamp = dbRow["Timestamp"]
class Noticemodel: def __init__(self, dbRow): self.ID = dbRow['ID'] self.Message = dbRow['Message'] self.Timestamp = dbRow['Timestamp']
def keep_one_mRNA_with_same_stop_codon_position(f): output = [] nameset = set() with open(f, 'r') as FILE: for line in FILE: if line[0] == '#': output.append(line.strip()) else: s = line.strip().split('\t') if s[6] == '+': # then stop codons are on the right name = s[8].split(';')[1] + '.' + s[4] if name in nameset: pass else: nameset.add(name) output.append(line.strip()) elif s[6] == '-': # then stop codons are on the left name = s[8].split(';')[1] + '.' + s[3] if name in nameset: pass else: nameset.add(name) output.append(line.strip()) outfile = '.'.join(f.split('.')[:-1] + ['onestop', 'gff3']) with open(outfile, 'w') as OUT: OUT.write('\n'.join(output)) print('Output file: %s' % outfile) def trim_to_mRNA_and_add_protein_id(f, feature='mRNA'): output = [] with open(f, 'r') as FILE: for line in FILE: if line[0] == '#': output.append(line.strip()) else: if line.strip().split('\t')[2] == feature: outline = line.strip() gate = 'open' # allow it to find the next CDS line, which should have protein ID elif (line.strip().split('\t')[2] == 'CDS') and (gate == 'open'): # extract: XP_011540840.1 # from: ID=cds4;Parent=rna43;Dbxref=GeneID:105378947,Genbank:XP_011540840.1;Name=XP_011540840.1; outline += ';%s' % (line.strip().split('\t')[8].split(';')[3][5:]) gate = 'closed' output.append(outline) outfile = '.'.join(f.split('.')[:-1] + [feature, 'wProtID', 'gff3']) with open(outfile, 'w') as OUT: OUT.write('\n'.join(output)) print('Output file: %s' % outfile) def trim_ensembl_gtf_to_3utrs_of_target_genes(f, feature='three_prime_utr', targetgenenames=[], minpeplength=5): # this is the worst piece of shit i have ever written <3 # f is full path to ensembl .gtf file # example ensembl .gtf 3' UTR feature: # 1 havana three_prime_utr 944154 944259 . + . gene_id "ENSG00000187634"; gene_version "13"; transcript_id "ENST00000455979"; transcript_version "1"; gene_name "SAMD11"; gene_source "ensembl_havana"; gene_biotype "protein_coding"; transcript_name "SAMD11-204"; transcript_source "havana"; transcript_biotype "protein_coding"; tag "cds_start_NF"; tag "mRNA_start_NF"; transcript_support_level "2"; collectedfeatures = [] stopcodons = [] with open(f, 'r') as FILE: for line in FILE: if line[0] == '#': collectedfeatures.append(line.strip()) else: if line.strip().split('\t')[2] == feature: orientation = line.strip().split('\t')[6] metadata = line.strip().split('\t')[8].split('"; ') genename = '' for meta in metadata: if meta[:len('gene_name "')] == 'gene_name "': genename = meta[len('gene_name "'):] if (genename != '') and (genename in targetgenenames): collectedfeatures.append(line.strip()) output = [] outputgenes = [] # enename_startposition value is line of longest 3'UTR for each unique start for line in collectedfeatures: if line[0] == '#': output.append(line) else: gate = 'open' if line.split('\t')[6] == '+': start = line.split('\t')[3] end = line.split('\t')[4] orientation = line.split('\t')[6] difference = int(end) - int(start) + 1 elif line.split('\t')[6] == '-': end = line.split('\t')[3] start = line.split('\t')[4] orientation = line.split('\t')[6] difference = int(start) - int(end) + 1 if difference >= minpeplength * 3: # it needs to be at least minpeplength AA long metadata = line.split('\t')[8].split('"; ') for meta in metadata: if meta[:len('gene_name "')] == 'gene_name "': genename = meta[len('gene_name "'):] for line2 in collectedfeatures: if line2[0] == '#': pass else: metadata2 = line2.split('\t')[8].split('"; ') for meta2 in metadata2: if meta2[:len('gene_name "')] == 'gene_name "': genename2 = meta2[len('gene_name "'):] if line2.split('\t')[6] == '+': start2 = line2.split('\t')[3] end2 = line2.split('\t')[4] if (genename == genename2) and (start == start2) and (int(end) <= int(end2)): if int(end) < int(end2): gate = 'closed' elif int(end) == int(end2): for out in output: if out[0] == '#': pass else: metadata3 = out.split('\t')[8].split('"; ') for meta3 in metadata3: if meta3[:len('gene_name "')] == 'gene_name "': genename3 = meta3[len('gene_name "'):] if line.split('\t')[6] == '+': start3 = out.split('\t')[3] end3 = out.split('\t')[4] # if the same gene with same 3'UTR start & end coordinates is already in output then # do not output a duplicate 3UTR feature with same start and end (close gate) # However if no gene with exact start and end is in output then output the first one if (genename == genename3) and (start == start3) and (end == end3): gate = 'closed' elif line2.split('\t')[6] == '-': end2 = line2.split('\t')[3] start2 = line2.split('\t')[4] if (genename == genename2) and (start == start2) and (int(end) >= int(end2)): if int(end) > int(end2): gate = 'closed' elif int(end) == int(end2): for out in output: if out[0] == '#': pass else: metadata3 = out.split('\t')[8].split('"; ') for meta3 in metadata3: if meta3[:len('gene_name "')] == 'gene_name "': genename3 = meta3[len('gene_name "'):] if line.split('\t')[6] == '-': end3 = out.split('\t')[3] start3 = out.split('\t')[4] # if the same gene with same 3'UTR start & end coordinates is already in output then # do not output a duplicate 3UTR feature with same start and end (close gate) # However if no gene with exact start and end is in output then output the first one if (genename == genename3) and (end == end3) and (start == start3): gate = 'closed' # if (genename == genename2) and (start == start2) and (x == ''): # int(end) <= int(end2) # if int(end) < int(end2): # gate = 'closed' # elif int(end) == int(end2): # for out in output: # if out[0] == '#': # pass # else: # start3 = out.split('\t')[3] # end3 = out.split('\t')[4] # metadata3 = out.split('\t')[8].split('"; ') # for meta3 in metadata3: # if meta3[:len('gene_name "')] == 'gene_name "': # genename3 = meta3[len('gene_name "'):] # # if the same gene with same 3'UTR start & end coordinates is already in output then # # do not output a duplicate 3UTR feature with same start and end (close gate) # # However if no gene with exact start and end is in output then output the first one # if (genename == genename3) and (start == start3) and (int(end) == int(end3)): # gate = 'closed' else: gate = 'closed' if (gate == 'open') and (line[0] != '#'): output.append(line) outputgenes.append(genename) print(f'Number of gene names entered and searched for {len(targetgenenames)}') print(f'Number of genes with a transcript in output: {len(set(outputgenes))}') print(f'Genes with a transcript in output: {set(outputgenes)}') outfile = '.'.join(f.split('.')[:-1] + [feature, 'all', 'gtf']) with open(outfile, 'w') as OUT: OUT.write('\n'.join(collectedfeatures)) print('Output file: %s' % outfile) outfile = '.'.join(f.split('.')[:-1] + [feature, 'longest', 'gtf']) with open(outfile, 'w') as OUT: OUT.write('\n'.join(output)) print('Output file: %s' % outfile) ##### broken ##### class GENE: def __init__(self, line): # line is line form annotation file if line.strip().split('\t')[2] == 'gene': self.genename = line.strip().split('\t')[8].split(';')[3][len('Name='):].upper() self.scaffold = line.strip().split('\t')[0] self.orientation = line.strip().split('\t')[6] self.biotype = line.strip().split('\t') elif line.strip().split('\t')[2] == 'mRNA': self.mrnafeaturelength = int(line.strip().split('\t')[4]) - int(line.strip().split('\t')[3]) self.start = int(line.strip().split('\t')[3]) self.end = int(line.strip().split('\t')[4]) self.length = len(line.strip().split('\t')[8].split(';')[-1][len('sequence='):]) self.sequence = line.strip().split('\t')[8].split(';')[-1][len('sequence='):] def main(f, feature='gene'): output = [] with open(f, 'r') as FILE: for line in FILE: if line[0] == '#': output.append(line.strip()) else: if line.strip().split('\t')[2] == feature: output.append(line.strip()) outfile = '.'.join(f.split('.')[:-1] + [feature, 'gff3']) with open(outfile, 'w') as OUT: OUT.write('\n'.join(output)) print('Output file: %s' % outfile)
def keep_one_m_rna_with_same_stop_codon_position(f): output = [] nameset = set() with open(f, 'r') as file: for line in FILE: if line[0] == '#': output.append(line.strip()) else: s = line.strip().split('\t') if s[6] == '+': name = s[8].split(';')[1] + '.' + s[4] if name in nameset: pass else: nameset.add(name) output.append(line.strip()) elif s[6] == '-': name = s[8].split(';')[1] + '.' + s[3] if name in nameset: pass else: nameset.add(name) output.append(line.strip()) outfile = '.'.join(f.split('.')[:-1] + ['onestop', 'gff3']) with open(outfile, 'w') as out: OUT.write('\n'.join(output)) print('Output file: %s' % outfile) def trim_to_m_rna_and_add_protein_id(f, feature='mRNA'): output = [] with open(f, 'r') as file: for line in FILE: if line[0] == '#': output.append(line.strip()) elif line.strip().split('\t')[2] == feature: outline = line.strip() gate = 'open' elif line.strip().split('\t')[2] == 'CDS' and gate == 'open': outline += ';%s' % line.strip().split('\t')[8].split(';')[3][5:] gate = 'closed' output.append(outline) outfile = '.'.join(f.split('.')[:-1] + [feature, 'wProtID', 'gff3']) with open(outfile, 'w') as out: OUT.write('\n'.join(output)) print('Output file: %s' % outfile) def trim_ensembl_gtf_to_3utrs_of_target_genes(f, feature='three_prime_utr', targetgenenames=[], minpeplength=5): collectedfeatures = [] stopcodons = [] with open(f, 'r') as file: for line in FILE: if line[0] == '#': collectedfeatures.append(line.strip()) elif line.strip().split('\t')[2] == feature: orientation = line.strip().split('\t')[6] metadata = line.strip().split('\t')[8].split('"; ') genename = '' for meta in metadata: if meta[:len('gene_name "')] == 'gene_name "': genename = meta[len('gene_name "'):] if genename != '' and genename in targetgenenames: collectedfeatures.append(line.strip()) output = [] outputgenes = [] for line in collectedfeatures: if line[0] == '#': output.append(line) else: gate = 'open' if line.split('\t')[6] == '+': start = line.split('\t')[3] end = line.split('\t')[4] orientation = line.split('\t')[6] difference = int(end) - int(start) + 1 elif line.split('\t')[6] == '-': end = line.split('\t')[3] start = line.split('\t')[4] orientation = line.split('\t')[6] difference = int(start) - int(end) + 1 if difference >= minpeplength * 3: metadata = line.split('\t')[8].split('"; ') for meta in metadata: if meta[:len('gene_name "')] == 'gene_name "': genename = meta[len('gene_name "'):] for line2 in collectedfeatures: if line2[0] == '#': pass else: metadata2 = line2.split('\t')[8].split('"; ') for meta2 in metadata2: if meta2[:len('gene_name "')] == 'gene_name "': genename2 = meta2[len('gene_name "'):] if line2.split('\t')[6] == '+': start2 = line2.split('\t')[3] end2 = line2.split('\t')[4] if genename == genename2 and start == start2 and (int(end) <= int(end2)): if int(end) < int(end2): gate = 'closed' elif int(end) == int(end2): for out in output: if out[0] == '#': pass else: metadata3 = out.split('\t')[8].split('"; ') for meta3 in metadata3: if meta3[:len('gene_name "')] == 'gene_name "': genename3 = meta3[len('gene_name "'):] if line.split('\t')[6] == '+': start3 = out.split('\t')[3] end3 = out.split('\t')[4] if genename == genename3 and start == start3 and (end == end3): gate = 'closed' elif line2.split('\t')[6] == '-': end2 = line2.split('\t')[3] start2 = line2.split('\t')[4] if genename == genename2 and start == start2 and (int(end) >= int(end2)): if int(end) > int(end2): gate = 'closed' elif int(end) == int(end2): for out in output: if out[0] == '#': pass else: metadata3 = out.split('\t')[8].split('"; ') for meta3 in metadata3: if meta3[:len('gene_name "')] == 'gene_name "': genename3 = meta3[len('gene_name "'):] if line.split('\t')[6] == '-': end3 = out.split('\t')[3] start3 = out.split('\t')[4] if genename == genename3 and end == end3 and (start == start3): gate = 'closed' else: gate = 'closed' if gate == 'open' and line[0] != '#': output.append(line) outputgenes.append(genename) print(f'Number of gene names entered and searched for {len(targetgenenames)}') print(f'Number of genes with a transcript in output: {len(set(outputgenes))}') print(f'Genes with a transcript in output: {set(outputgenes)}') outfile = '.'.join(f.split('.')[:-1] + [feature, 'all', 'gtf']) with open(outfile, 'w') as out: OUT.write('\n'.join(collectedfeatures)) print('Output file: %s' % outfile) outfile = '.'.join(f.split('.')[:-1] + [feature, 'longest', 'gtf']) with open(outfile, 'w') as out: OUT.write('\n'.join(output)) print('Output file: %s' % outfile) class Gene: def __init__(self, line): if line.strip().split('\t')[2] == 'gene': self.genename = line.strip().split('\t')[8].split(';')[3][len('Name='):].upper() self.scaffold = line.strip().split('\t')[0] self.orientation = line.strip().split('\t')[6] self.biotype = line.strip().split('\t') elif line.strip().split('\t')[2] == 'mRNA': self.mrnafeaturelength = int(line.strip().split('\t')[4]) - int(line.strip().split('\t')[3]) self.start = int(line.strip().split('\t')[3]) self.end = int(line.strip().split('\t')[4]) self.length = len(line.strip().split('\t')[8].split(';')[-1][len('sequence='):]) self.sequence = line.strip().split('\t')[8].split(';')[-1][len('sequence='):] def main(f, feature='gene'): output = [] with open(f, 'r') as file: for line in FILE: if line[0] == '#': output.append(line.strip()) elif line.strip().split('\t')[2] == feature: output.append(line.strip()) outfile = '.'.join(f.split('.')[:-1] + [feature, 'gff3']) with open(outfile, 'w') as out: OUT.write('\n'.join(output)) print('Output file: %s' % outfile)
class Building(object): def __init__(self, south, west, width_WE, width_NS, height=10): self.south = south self.west = west self.width_WE = width_WE self.width_NS = width_NS self.height = height def corners(self): north_west = [self.south+self.width_NS, self.west] north_east = [self.south+self.width_NS, self.west+self.width_WE] south_west = [self.south, self.west] south_east = [self.south, self.west+self.width_WE] corner = {"north-west": north_west, "north-east": north_east, "south-west": south_west, "south-east": south_east} return corner def area(self): return self.width_NS*self.width_WE def volume(self): return self.area()*self.height def __repr__(self): return "Building({0}, {1}, {2}, {3}, {4})".format(self.south, self.west, self.width_WE, self.width_NS, self.height)
class Building(object): def __init__(self, south, west, width_WE, width_NS, height=10): self.south = south self.west = west self.width_WE = width_WE self.width_NS = width_NS self.height = height def corners(self): north_west = [self.south + self.width_NS, self.west] north_east = [self.south + self.width_NS, self.west + self.width_WE] south_west = [self.south, self.west] south_east = [self.south, self.west + self.width_WE] corner = {'north-west': north_west, 'north-east': north_east, 'south-west': south_west, 'south-east': south_east} return corner def area(self): return self.width_NS * self.width_WE def volume(self): return self.area() * self.height def __repr__(self): return 'Building({0}, {1}, {2}, {3}, {4})'.format(self.south, self.west, self.width_WE, self.width_NS, self.height)
def bio(*args): header = ["Name", "Roll no.", "Regd no.", "Branch", "Stream", "Sem", "Phone no.", "Address"] for head, data in zip(header, args): print("%-10s: %s"%(head, data)) bio("Md.Azharuddin", "36725", "1701105431", "CSE", "B.Tech", "7th", "9078600498", "Arad Bazar, Balasore")
def bio(*args): header = ['Name', 'Roll no.', 'Regd no.', 'Branch', 'Stream', 'Sem', 'Phone no.', 'Address'] for (head, data) in zip(header, args): print('%-10s: %s' % (head, data)) bio('Md.Azharuddin', '36725', '1701105431', 'CSE', 'B.Tech', '7th', '9078600498', 'Arad Bazar, Balasore')
class Subscription(object): def __init__(self, sid, subject, queue, callback, connetion): self.sid = sid self.subject = subject self.queue = queue self.connetion = connetion self.callback = callback self.received = 0 self.delivered = 0 self.bytes = 0 self.max = 0 def handle_msg(self, msg): return self.callback(msg)
class Subscription(object): def __init__(self, sid, subject, queue, callback, connetion): self.sid = sid self.subject = subject self.queue = queue self.connetion = connetion self.callback = callback self.received = 0 self.delivered = 0 self.bytes = 0 self.max = 0 def handle_msg(self, msg): return self.callback(msg)
class Animation(): def __init__(self): self.vertex_n = 0 self.verticies = [] def get_coord(self, V_kind): print("\n\t***\nFor vertex %s please enter:\n" % V_kind) x = input('X: ') y = input('Y: ') z = input('Z: ') pos = [x, y, z] return pos def add_Vertex(self): self.vertex_n +=1 self.verticies.append(Vertex()) self.verticies[self.vertex_n-1].p_zero = self.get_coord("position zero") self.verticies[self.vertex_n-1].name = "Vertex_"+ str(self.vertex_n) return class Vertex(object): def __init__(self, p_zero = None, position = None, rest = None, name = None): self.p_zero = p_zero #initial vertex position and this vertex's zero self.position = position #current vertex position self.rest = rest #set rest position for the vertex self.servos = [] #list of servo objects self.servo_n = 0 #servo count on vertex self.name = name #Vertex name def add_servo(self): self.servos.append(Servo(self.name)) return print("Not Done") class Servo(object): def __init__(self, vertex, vector = None, rate = None, track = None): self.vertex = Vertex #What vertex is this servo linked to self.vector = vector #Input for movement self.rate = rate #Acceleration self.track = track #axis and range of movement mouth = Animation() mouth.add_Vertex() for i, obj in enumerate(mouth.verticies): print ("Zero position for", obj.name, "is", obj.p_zero)
class Animation: def __init__(self): self.vertex_n = 0 self.verticies = [] def get_coord(self, V_kind): print('\n\t***\nFor vertex %s please enter:\n' % V_kind) x = input('X: ') y = input('Y: ') z = input('Z: ') pos = [x, y, z] return pos def add__vertex(self): self.vertex_n += 1 self.verticies.append(vertex()) self.verticies[self.vertex_n - 1].p_zero = self.get_coord('position zero') self.verticies[self.vertex_n - 1].name = 'Vertex_' + str(self.vertex_n) return class Vertex(object): def __init__(self, p_zero=None, position=None, rest=None, name=None): self.p_zero = p_zero self.position = position self.rest = rest self.servos = [] self.servo_n = 0 self.name = name def add_servo(self): self.servos.append(servo(self.name)) return print('Not Done') class Servo(object): def __init__(self, vertex, vector=None, rate=None, track=None): self.vertex = Vertex self.vector = vector self.rate = rate self.track = track mouth = animation() mouth.add_Vertex() for (i, obj) in enumerate(mouth.verticies): print('Zero position for', obj.name, 'is', obj.p_zero)
with open("input.txt", "r") as f: lines = [line.strip() for line in f.readlines()] gamma = "" epsilon = "" for i in range(0, len(lines[0])): zero = 0 one = 0 for line in lines: if line[i] == "0": zero += 1 else: one += 1 if(zero > one): gamma = gamma + str(0) epsilon = epsilon + str(1) else: gamma = gamma + str(1) epsilon = epsilon + str(0) gamma_rate = int(gamma, 2) epsilon_rate = int(epsilon, 2) print("gamma: ", gamma_rate) print("epsilon: ", epsilon_rate) print("power consumption: ", gamma_rate*epsilon_rate)
with open('input.txt', 'r') as f: lines = [line.strip() for line in f.readlines()] gamma = '' epsilon = '' for i in range(0, len(lines[0])): zero = 0 one = 0 for line in lines: if line[i] == '0': zero += 1 else: one += 1 if zero > one: gamma = gamma + str(0) epsilon = epsilon + str(1) else: gamma = gamma + str(1) epsilon = epsilon + str(0) gamma_rate = int(gamma, 2) epsilon_rate = int(epsilon, 2) print('gamma: ', gamma_rate) print('epsilon: ', epsilon_rate) print('power consumption: ', gamma_rate * epsilon_rate)
COLOUR_CHOICES = [ ('white', 'White'), ('grey', 'Grey'), ('blue', 'Blue'), ] COLUMN_CHOICES = [ ('12', 'Full Width'), ('11', '11/12'), ('10', '5/6'), ('9', 'Three Quarters'), ('8', 'Two Thirds'), ('7', '7/12'), ('6', 'Half Width'), ('5', '5/12'), ('4', 'One Third'), ('3', 'One Quarter'), ('2', '1/6'), ('1', '1/12'), ] LANGUAGE_CHOICES = [ ('python', 'python'), ('css', 'css'), ('sql', 'sql'), ('javascript', 'javascript'), ('clike', 'clike'), ('markup', 'markup'), ('java', 'java'), ]
colour_choices = [('white', 'White'), ('grey', 'Grey'), ('blue', 'Blue')] column_choices = [('12', 'Full Width'), ('11', '11/12'), ('10', '5/6'), ('9', 'Three Quarters'), ('8', 'Two Thirds'), ('7', '7/12'), ('6', 'Half Width'), ('5', '5/12'), ('4', 'One Third'), ('3', 'One Quarter'), ('2', '1/6'), ('1', '1/12')] language_choices = [('python', 'python'), ('css', 'css'), ('sql', 'sql'), ('javascript', 'javascript'), ('clike', 'clike'), ('markup', 'markup'), ('java', 'java')]
x = 1 # int y = 2.8 # float z = 1j # complex # convert from int to float a = float(x) # convert from float to int b = int(y) # convert from int to complex c = complex(x) print(a) print(b) print(c) print(type(a)) print(type(b)) print(type(c))
x = 1 y = 2.8 z = 1j a = float(x) b = int(y) c = complex(x) print(a) print(b) print(c) print(type(a)) print(type(b)) print(type(c))
class Identifier: def __init__(self, id): self.id = id def eval(self, env): if self.id in env: return env[self.id] else: error("Referencing " + self.id + " before assignment") def __repr__(self): return "Identifier: {0}".format(self.id)
class Identifier: def __init__(self, id): self.id = id def eval(self, env): if self.id in env: return env[self.id] else: error('Referencing ' + self.id + ' before assignment') def __repr__(self): return 'Identifier: {0}'.format(self.id)
WORKERS = 50 RESULT_FILE = 'results.json' ZIP_CODE_FILE = './reference/zips.csv'
workers = 50 result_file = 'results.json' zip_code_file = './reference/zips.csv'
NAME = 'send_message.py' ORIGINAL_AUTHORS = [ 'Justin Walker' ] ABOUT = ''' Sends a message to another channel. ''' COMMANDS = ''' >>> .send #channel .u riceabove .m how are you? Sends a message to #channel like 'IronPenguin from #channel says to riceabove: how are you?' >>> .send #channel hi all Sends a message to #channel like 'IronPenguin from #channel says: hi all' Checks if user online first and says "User not online." ''' WEBSITE = ''
name = 'send_message.py' original_authors = ['Justin Walker'] about = '\nSends a message to another channel.\n' commands = '\n>>> .send #channel .u riceabove .m how are you?\nSends a message to #channel like\n\'IronPenguin from #channel says to riceabove: how are you?\'\n\n>>> .send #channel hi all\nSends a message to #channel like\n\'IronPenguin from #channel says: hi all\'\n\nChecks if user online first and says "User not online."\n' website = ''
class Node: def __init__(self, data): self.data = data self.next = None class LinkedList: def __init__(self): self.head = None def printList(self): temp = self.head while temp : print(temp.data, end=" ") temp = temp.next def append(self, new_data): new_node = Node(new_data) if self.head is None: self.head = new_node return last = self.head while last.next: last = last.next last.next = new_node def mergeLists(head1, head2): temp = None if head1 == None: return head2 if head2 == None: return head1 if head1.data <= head2.data: temp = head1 temp.next = mergeLists(head1.next, head2) else: temp = head2 temp.next = mergeLists(head1, head2.next) return temp if __name__ == '__main__': list1 = LinkedList() list1.append(10) list1.append(20) list1.append(30) list1.append(40) list1.append(50) list1.append(60) list2 = LinkedList() list2.append(15) list2.append(25) list2.append(35) list2.append(45) list2.append(55) list2.append(65) list3 = LinkedList() list3.head = mergeLists(list1.head, list2.head) print(" Merged Linked List is : ", end="") list3.printList()
class Node: def __init__(self, data): self.data = data self.next = None class Linkedlist: def __init__(self): self.head = None def print_list(self): temp = self.head while temp: print(temp.data, end=' ') temp = temp.next def append(self, new_data): new_node = node(new_data) if self.head is None: self.head = new_node return last = self.head while last.next: last = last.next last.next = new_node def merge_lists(head1, head2): temp = None if head1 == None: return head2 if head2 == None: return head1 if head1.data <= head2.data: temp = head1 temp.next = merge_lists(head1.next, head2) else: temp = head2 temp.next = merge_lists(head1, head2.next) return temp if __name__ == '__main__': list1 = linked_list() list1.append(10) list1.append(20) list1.append(30) list1.append(40) list1.append(50) list1.append(60) list2 = linked_list() list2.append(15) list2.append(25) list2.append(35) list2.append(45) list2.append(55) list2.append(65) list3 = linked_list() list3.head = merge_lists(list1.head, list2.head) print(' Merged Linked List is : ', end='') list3.printList()
class IUserCommandRepository: def create_user(self, user): pass def update_user_auth_token(self, user_id, auth_token): pass def increment_user_score(self, user_id, score): pass
class Iusercommandrepository: def create_user(self, user): pass def update_user_auth_token(self, user_id, auth_token): pass def increment_user_score(self, user_id, score): pass
out = [] push = out.append concate = ' '.join while True: try: a, b = [int(x) for x in input().split()] except EOFError: break ans = [] ans_append = ans.append for num in range(a, b+1): num = str(num) length = len(num) check = str(sum(pow(int(x), length) for x in num)) if check == num: ans_append(num) if ans: push(concate(ans)) else: push("none") print(*out, sep='\n')
out = [] push = out.append concate = ' '.join while True: try: (a, b) = [int(x) for x in input().split()] except EOFError: break ans = [] ans_append = ans.append for num in range(a, b + 1): num = str(num) length = len(num) check = str(sum((pow(int(x), length) for x in num))) if check == num: ans_append(num) if ans: push(concate(ans)) else: push('none') print(*out, sep='\n')
def characters_between(start: str, end: str): start = ord(start) end = ord(end) if start < end: for letter in range(start + 1, end): print(chr(letter), end=' ') else: for i in range(end + 1, start, -1): print(chr(i), end=' ') a = input() b = input() characters_between(a, b)
def characters_between(start: str, end: str): start = ord(start) end = ord(end) if start < end: for letter in range(start + 1, end): print(chr(letter), end=' ') else: for i in range(end + 1, start, -1): print(chr(i), end=' ') a = input() b = input() characters_between(a, b)
def solve(sudoku): find = find_empty(sudoku) if not find: return True else: row, col = find for i in range(1,10): if valid(sudoku, i, (row, col)): sudoku[row][col] = i if solve(sudoku): return True sudoku[row][col] = 0 return False def valid(sudoku, num, pos): # Check row for i in range(len(sudoku[0])): if sudoku[pos[0]][i] == num and pos[1] != i: return False # Check column for i in range(len(sudoku)): if sudoku[i][pos[1]] == num and pos[0] != i: return False # Check box box_x = pos[1] // 3 box_y = pos[0] // 3 for i in range(box_y*3, box_y*3 + 3): for j in range(box_x * 3, box_x*3 + 3): if sudoku[i][j] == num and (i,j) != pos: return False return True def find_empty(sudoku): for i in range(len(sudoku)): for j in range(len(sudoku[0])): if sudoku[i][j] == 0: return (i, j) # row, col return None
def solve(sudoku): find = find_empty(sudoku) if not find: return True else: (row, col) = find for i in range(1, 10): if valid(sudoku, i, (row, col)): sudoku[row][col] = i if solve(sudoku): return True sudoku[row][col] = 0 return False def valid(sudoku, num, pos): for i in range(len(sudoku[0])): if sudoku[pos[0]][i] == num and pos[1] != i: return False for i in range(len(sudoku)): if sudoku[i][pos[1]] == num and pos[0] != i: return False box_x = pos[1] // 3 box_y = pos[0] // 3 for i in range(box_y * 3, box_y * 3 + 3): for j in range(box_x * 3, box_x * 3 + 3): if sudoku[i][j] == num and (i, j) != pos: return False return True def find_empty(sudoku): for i in range(len(sudoku)): for j in range(len(sudoku[0])): if sudoku[i][j] == 0: return (i, j) return None
MONGODB_URI = "mongodb://localhost:27017" MONGODB_DATABASE = 'Cose2' MONGODB_USER_COLLECTION = 'users' MONGODB_TOPIC_COLLECTION = 'topics' MONGODB_COMMENT_COLLECTION = 'comments'
mongodb_uri = 'mongodb://localhost:27017' mongodb_database = 'Cose2' mongodb_user_collection = 'users' mongodb_topic_collection = 'topics' mongodb_comment_collection = 'comments'
''' Created on Mar 31, 2018 @author: Burkhard A. Meier ''' # list with loop loop_numbers = [] # create an empty list for number in range(1, 101): # use for loop loop_numbers.append(number) # append 100 numbers to list print(loop_numbers) # list comprehension comp_numbers = [ number for number in range(1, 101) ] # create a new list print(comp_numbers) # list comprehension with added condition comp_numbers_three = [ number for number in range(1, 101) if number % 3 == 0 ] # multiples of three print(comp_numbers_three)
""" Created on Mar 31, 2018 @author: Burkhard A. Meier """ loop_numbers = [] for number in range(1, 101): loop_numbers.append(number) print(loop_numbers) comp_numbers = [number for number in range(1, 101)] print(comp_numbers) comp_numbers_three = [number for number in range(1, 101) if number % 3 == 0] print(comp_numbers_three)
Rt = [[1,2,3 ], [2, 4, 5], [3,6,7], [4,8,9],[5,10,11],[6,12,13],[7,14,15]] def findRoot(RT): S = set() for i in RT: for j in i: S.add( j ) print (S) for i in RT : for j in i[1:]: S.remove( j ) print (S) try : for i in S : retval = i break return retval except : print ("Not a tree") print ( findRoot (Rt)) def LocateNode(RT, nd): ret_tuple = None for i in RT: if ( i[0] == nd ): ret_tuple = i break #return i if (ret_tuple == None ): return False, () else: return True, ret_tuple def isLeaf (RT, nd): for i in RT: if ( i[0] == nd ): return False return True preordered_list = [] def walk(RT, root, path): flag, rootTuple = LocateNode(RT, root) if (flag == False ): pass else: dirs = [] files = [] for ch in rootTuple[1:]: if (isLeaf (RT, ch) ): files.append(ch) else: dirs.append(ch) #endif #endfor preordered_list.append((path , dirs, files)) for ch in rootTuple[1:]: walk(RT, ch, path + [ch]) #endfor #endif walk (Rt, 1, [1]) print (preordered_list)
rt = [[1, 2, 3], [2, 4, 5], [3, 6, 7], [4, 8, 9], [5, 10, 11], [6, 12, 13], [7, 14, 15]] def find_root(RT): s = set() for i in RT: for j in i: S.add(j) print(S) for i in RT: for j in i[1:]: S.remove(j) print(S) try: for i in S: retval = i break return retval except: print('Not a tree') print(find_root(Rt)) def locate_node(RT, nd): ret_tuple = None for i in RT: if i[0] == nd: ret_tuple = i break if ret_tuple == None: return (False, ()) else: return (True, ret_tuple) def is_leaf(RT, nd): for i in RT: if i[0] == nd: return False return True preordered_list = [] def walk(RT, root, path): (flag, root_tuple) = locate_node(RT, root) if flag == False: pass else: dirs = [] files = [] for ch in rootTuple[1:]: if is_leaf(RT, ch): files.append(ch) else: dirs.append(ch) preordered_list.append((path, dirs, files)) for ch in rootTuple[1:]: walk(RT, ch, path + [ch]) walk(Rt, 1, [1]) print(preordered_list)
c.NbServer.base_url = '/paws-public/' c.NbServer.bind_ip = '0.0.0.0' c.NbServer.bind_port = 8000 c.NbServer.publisher_class = 'paws.PAWSPublisher' c.NbServer.register_proxy = False c.PAWSPublisher.base_path = '/data/project/paws/userhomes'
c.NbServer.base_url = '/paws-public/' c.NbServer.bind_ip = '0.0.0.0' c.NbServer.bind_port = 8000 c.NbServer.publisher_class = 'paws.PAWSPublisher' c.NbServer.register_proxy = False c.PAWSPublisher.base_path = '/data/project/paws/userhomes'
del_items(0x800A0E14) SetType(0x800A0E14, "char StrDate[12]") del_items(0x800A0E20) SetType(0x800A0E20, "char StrTime[9]") del_items(0x800A0E2C) SetType(0x800A0E2C, "char *Words[118]") del_items(0x800A1004) SetType(0x800A1004, "struct MONTH_DAYS MonDays[12]")
del_items(2148142612) set_type(2148142612, 'char StrDate[12]') del_items(2148142624) set_type(2148142624, 'char StrTime[9]') del_items(2148142636) set_type(2148142636, 'char *Words[118]') del_items(2148143108) set_type(2148143108, 'struct MONTH_DAYS MonDays[12]')
# Excel Column Number # https://www.interviewbit.com/problems/excel-column-number/ # # Given a column title as appears in an Excel sheet, return its corresponding # column number. # # Example: # # A -> 1 # # B -> 2 # # C -> 3 # # ... # # Z -> 26 # # AA -> 27 # # AB -> 28 # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # class Solution: # @param A : string # @return an integer def titleToNumber(self, A): res = 0 for char in A: diff = ord(char) - ord('A') + 1 res = res * 26 + diff return res # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # if __name__ == "__main__": s = Solution() print(s.titleToNumber('AA')) print(s.titleToNumber('A'))
class Solution: def title_to_number(self, A): res = 0 for char in A: diff = ord(char) - ord('A') + 1 res = res * 26 + diff return res if __name__ == '__main__': s = solution() print(s.titleToNumber('AA')) print(s.titleToNumber('A'))