content
stringlengths
7
1.05M
fixed_cases
stringlengths
1
1.28M
# I usually do not hard-code urls here, # but there is not much need for complex configuration BASEURL = 'https://simple-chat-asapp.herokuapp.com/' login_button_text = 'Login' sign_in_message = 'Sign in to Chat' who_are_you = 'Who are you?' who_are_you_talking_to = 'Who are you talking to?' chatting_text = 'Chatting' chatting_with_text = 'You\'re {0}, and you\'re chatting with {1}' say_something_text = 'Say something...' send_button_text = 'Send' # If these need to remain a secret, I normally create a separate file # for secret data and exclude it in .gitignore username_1 = 'nicole 1' username_2 = 'nicole 2' username_3 = 'nicole 3' long_username = 'hello' * 20 empty_username = '' # Messages hello_message = 'Hello chat!' hello_2_message = 'Hello to you too!' secret_message = 'We have a secret! Ssh!' long_message = '1234567890' * 100 comma_message = 'Hello, I have a comma!'
baseurl = 'https://simple-chat-asapp.herokuapp.com/' login_button_text = 'Login' sign_in_message = 'Sign in to Chat' who_are_you = 'Who are you?' who_are_you_talking_to = 'Who are you talking to?' chatting_text = 'Chatting' chatting_with_text = "You're {0}, and you're chatting with {1}" say_something_text = 'Say something...' send_button_text = 'Send' username_1 = 'nicole 1' username_2 = 'nicole 2' username_3 = 'nicole 3' long_username = 'hello' * 20 empty_username = '' hello_message = 'Hello chat!' hello_2_message = 'Hello to you too!' secret_message = 'We have a secret! Ssh!' long_message = '1234567890' * 100 comma_message = 'Hello, I have a comma!'
# code to run in IPython shell to test whether clustering info in spikes struct array and in # the neurons dict is consistent: for nid in sorted(self.sort.neurons): print(nid, (self.sort.neurons[nid].sids == np.where(self.sort.spikes['nid'] == nid)[0]).all())
for nid in sorted(self.sort.neurons): print(nid, (self.sort.neurons[nid].sids == np.where(self.sort.spikes['nid'] == nid)[0]).all())
def sum67(nums): count = 0 blocked = False for n in nums: if n == 6: blocked = True continue if n == 7 and blocked: blocked = False continue if not blocked: count += n return count
def sum67(nums): count = 0 blocked = False for n in nums: if n == 6: blocked = True continue if n == 7 and blocked: blocked = False continue if not blocked: count += n return count
# author : @akash kumar # problem link: # https://prepinsta.com/tcs-coding-question-1/ x,y,d,t=0,0,10,1 for n in range(int(input())): if t==1: x+=d t=2 d+=10 elif t==2: y+=d t=3 d+=10 elif t==3: x-=d t=4 d+=10 elif t==4: y-=d t=5 d+=10 else: x+=d t=1 d+=10 print(x,y) #Time complexity T(n)=O(n)
(x, y, d, t) = (0, 0, 10, 1) for n in range(int(input())): if t == 1: x += d t = 2 d += 10 elif t == 2: y += d t = 3 d += 10 elif t == 3: x -= d t = 4 d += 10 elif t == 4: y -= d t = 5 d += 10 else: x += d t = 1 d += 10 print(x, y)
#!/usr/bin/env python3 #encoding=utf-8 #-------------------------------------------- # Usage: python3 3-calltracer_descr-for-method.py # Description: make descriptor class as decorator to decorate class method #-------------------------------------------- class Tracer: # a decorator + descriptor def __init__(self, func): # on @ decorator print('in property descriptor __init__') self.calls = 0 self.func = func def __call__(self, *args, **kwargs): # on call to original func print('in property descriptor __call__') self.calls += 1 print('call %s to %s' % (self.calls, self.func.__name__)) return self.func(*args, **kwargs) def __get__(self, instance, owner): # on method attribute fetch print('in property descriptor __get__') def wrapper(*args, **kwargs): # retain state information in both instance print('in enclosing method wrapper') return self(instance, *args, **kwargs) # runs __call__ return wrapper # apply to normal function @Tracer def spam(a, b, c): print('in original function spam') print('<', a + b + c, '>') @Tracer def eggs(x, y): print('in original function eggs') print('<', x ** y, '>') # apply to class method class Person: def __init__(self, name, pay): print('in original class Person __init__') self.name = name self.pay = pay @Tracer def giveRaise(self, percent): print('in decorated class giveRaise method') self.pay *= (1.0 + percent) @Tracer def lastName(self): print('in decorated class lastName method') return self.name.split()[-1] if __name__ == '__main__': print('\n\033[1;36mEntrance\033[0m\n') print('\n\033[1;37mApply to simple function\033[0m\n') spam(1, 2, 3) spam(a=4, b=5, c=6) print('\n\033[1;37mApply to class method\033[0m\n') bob = Person('Bob Smith', 50000) sue = Person('Sue Jones', 100000) print('<', bob.name, sue.name, '>') sue.giveRaise(.10) print(int(sue.pay)) print('<', bob.lastName(), sue.lastName(), '>') ''' Execution results: Chapter39.Decorators]# python3 3-calltracer_descr-for-method-1.py in property descriptor __init__ in property descriptor __init__ in property descriptor __init__ in property descriptor __init__ Entrance Apply to simple function in property descriptor __call__ call 1 to spam in original function spam < 6 > in property descriptor __call__ call 2 to spam in original function spam < 15 > Apply to class method in original class Person __init__ in original class Person __init__ < Bob Smith Sue Jones > in property descriptor __get__ in enclosing method wrapper in property descriptor __call__ call 1 to giveRaise in decorated class giveRaise method 110000 in property descriptor __get__ in enclosing method wrapper in property descriptor __call__ call 1 to lastName in decorated class lastName method in property descriptor __get__ in enclosing method wrapper in property descriptor __call__ call 2 to lastName in decorated class lastName method < Smith Jones > '''
class Tracer: def __init__(self, func): print('in property descriptor __init__') self.calls = 0 self.func = func def __call__(self, *args, **kwargs): print('in property descriptor __call__') self.calls += 1 print('call %s to %s' % (self.calls, self.func.__name__)) return self.func(*args, **kwargs) def __get__(self, instance, owner): print('in property descriptor __get__') def wrapper(*args, **kwargs): print('in enclosing method wrapper') return self(instance, *args, **kwargs) return wrapper @Tracer def spam(a, b, c): print('in original function spam') print('<', a + b + c, '>') @Tracer def eggs(x, y): print('in original function eggs') print('<', x ** y, '>') class Person: def __init__(self, name, pay): print('in original class Person __init__') self.name = name self.pay = pay @Tracer def give_raise(self, percent): print('in decorated class giveRaise method') self.pay *= 1.0 + percent @Tracer def last_name(self): print('in decorated class lastName method') return self.name.split()[-1] if __name__ == '__main__': print('\n\x1b[1;36mEntrance\x1b[0m\n') print('\n\x1b[1;37mApply to simple function\x1b[0m\n') spam(1, 2, 3) spam(a=4, b=5, c=6) print('\n\x1b[1;37mApply to class method\x1b[0m\n') bob = person('Bob Smith', 50000) sue = person('Sue Jones', 100000) print('<', bob.name, sue.name, '>') sue.giveRaise(0.1) print(int(sue.pay)) print('<', bob.lastName(), sue.lastName(), '>') '\n Execution results:\n Chapter39.Decorators]# python3 3-calltracer_descr-for-method-1.py\n in property descriptor __init__\n in property descriptor __init__\n in property descriptor __init__\n in property descriptor __init__\n \n \x1b[1;36mEntrance\x1b[0m\n \n \n \x1b[1;37mApply to simple function\x1b[0m\n \n in property descriptor __call__\n call 1 to spam\n in original function spam\n < 6 >\n in property descriptor __call__\n call 2 to spam\n in original function spam\n < 15 >\n \n \x1b[1;37mApply to class method\x1b[0m\n \n in original class Person __init__\n in original class Person __init__\n < Bob Smith Sue Jones >\n in property descriptor __get__\n in enclosing method wrapper\n in property descriptor __call__\n call 1 to giveRaise\n in decorated class giveRaise method\n 110000\n in property descriptor __get__\n in enclosing method wrapper\n in property descriptor __call__\n call 1 to lastName\n in decorated class lastName method\n in property descriptor __get__\n in enclosing method wrapper\n in property descriptor __call__\n call 2 to lastName\n in decorated class lastName method\n < Smith Jones >\n '
def bytes2int(data: bytes) -> int: return int.from_bytes(data, byteorder="big", signed=True) def int2bytes(x: int) -> bytes: return int.to_bytes(x, length=4, byteorder="big", signed=True)
def bytes2int(data: bytes) -> int: return int.from_bytes(data, byteorder='big', signed=True) def int2bytes(x: int) -> bytes: return int.to_bytes(x, length=4, byteorder='big', signed=True)
#!/usr/bin/python3.4 tableData = [['apples','oranges','cherries','bananas'], ['Alice','Bob','Carol','David'], ['dogs','cats','moose','goose']] # Per the hint colWidth = [0] * len(tableData) # Who knew you had to transpose this list of lists def matrixTranspose( matrix ): if not matrix: return [] return [ [ row[ i ] for row in matrix ] for i in range( len( matrix[ 0 ] ) ) ] def printTable(argData): # Copy of transpose argDataTrans = matrixTranspose(argData) # Get longest string in each for sub in range(len(argData)): for i in argData[sub]: if(len(i)>colWidth[sub]): colWidth[sub] = len(i) # Get max column width maxCol = max(colWidth) # Now print it using the transposed array for j in range(len(argDataTrans)): for k in range(len(argDataTrans[j])): print(argDataTrans[j][k].rjust(maxCol),end='') print() if __name__ == '__main__': printTable(tableData)
table_data = [['apples', 'oranges', 'cherries', 'bananas'], ['Alice', 'Bob', 'Carol', 'David'], ['dogs', 'cats', 'moose', 'goose']] col_width = [0] * len(tableData) def matrix_transpose(matrix): if not matrix: return [] return [[row[i] for row in matrix] for i in range(len(matrix[0]))] def print_table(argData): arg_data_trans = matrix_transpose(argData) for sub in range(len(argData)): for i in argData[sub]: if len(i) > colWidth[sub]: colWidth[sub] = len(i) max_col = max(colWidth) for j in range(len(argDataTrans)): for k in range(len(argDataTrans[j])): print(argDataTrans[j][k].rjust(maxCol), end='') print() if __name__ == '__main__': print_table(tableData)
folder_nm='end_to_end' coref_path="/home/raj/"+folder_nm+"/output/coreferent_pairs/output2.txt" chains_path="/home/raj/"+folder_nm+"/output/chains/chains.txt" f1=open(chains_path,"w+") def linear_search(obj, item, start=0): for l in range(start, len(obj)): if obj[l] == item: return l return -1 with open(coref_path, 'r') as f6: i=0 key=[] value=[] words,start,start_end,concept=[],[],[],[] for num,line in enumerate(f6,1): #from the coreferent pairs file separate the words and their positions in file items_nnp = line.rstrip("\n\r").split("|") word_1,start_1,end_1,word_2,start_2,end_2,concept_type = items_nnp[0], items_nnp[1],items_nnp[2],items_nnp[3],items_nnp[4],items_nnp[5],items_nnp[6] #get all words in a list and also their positions in another list at corresponding positions if linear_search(start,start_1)==-1: words.append(word_1) start.append(start_1) start_end.append(start_1+" "+end_1) concept.append(concept_type) if linear_search(start,start_2)==-1: words.append(word_2) start.append(start_2) start_end.append(start_2+" "+end_2) concept.append(concept_type) #1st row will be marked as 1st pair and so on key.append(num) value.append(start_1) key.append(num) value.append(start_2) def formchain(i,Chains): #if the element is not present in the chain then add it if linear_search(Chains,value[i])==-1: Chains.append(value[i]) #store the key and value temporarily temp_k=key[i] temp_v=value[i] #if there is only one element in the list delete it if i==(len(key)-1): key[len(key)-1]="" value[len(value)-1]="" else: #delete the element by shifting the following elements by 1 position to left for j in range (i,len(key)-1): key[j]=key[j+1] value[j]=value[j+1] #mark the last position as "" key[len(key)-1]="" value[len(value)-1]="" # call the method again for the another mention of the pair which shares same key if linear_search(key,temp_k)!=-1: formchain(linear_search(key,temp_k),Chains) # call the method for another pair which has same mention which has already been included if linear_search(value,temp_v)!=-1: formchain(linear_search(value,temp_v),Chains) #As positions are being shifted left, 0th element will never be zero unless the entire array is empty while(key[0]!=""): Chains=[] #start with first element of the list formchain(0,Chains) for i in range(len(Chains)-1): j=linear_search(start,Chains[i]) f1.write(words[j]+"|"+start_end[j]+"|") j=linear_search(start,Chains[len(Chains)-1]) f1.write(words[j]+"|"+start_end[j]+"|"+concept[j]+"\n") f1.close()
folder_nm = 'end_to_end' coref_path = '/home/raj/' + folder_nm + '/output/coreferent_pairs/output2.txt' chains_path = '/home/raj/' + folder_nm + '/output/chains/chains.txt' f1 = open(chains_path, 'w+') def linear_search(obj, item, start=0): for l in range(start, len(obj)): if obj[l] == item: return l return -1 with open(coref_path, 'r') as f6: i = 0 key = [] value = [] (words, start, start_end, concept) = ([], [], [], []) for (num, line) in enumerate(f6, 1): items_nnp = line.rstrip('\n\r').split('|') (word_1, start_1, end_1, word_2, start_2, end_2, concept_type) = (items_nnp[0], items_nnp[1], items_nnp[2], items_nnp[3], items_nnp[4], items_nnp[5], items_nnp[6]) if linear_search(start, start_1) == -1: words.append(word_1) start.append(start_1) start_end.append(start_1 + ' ' + end_1) concept.append(concept_type) if linear_search(start, start_2) == -1: words.append(word_2) start.append(start_2) start_end.append(start_2 + ' ' + end_2) concept.append(concept_type) key.append(num) value.append(start_1) key.append(num) value.append(start_2) def formchain(i, Chains): if linear_search(Chains, value[i]) == -1: Chains.append(value[i]) temp_k = key[i] temp_v = value[i] if i == len(key) - 1: key[len(key) - 1] = '' value[len(value) - 1] = '' else: for j in range(i, len(key) - 1): key[j] = key[j + 1] value[j] = value[j + 1] key[len(key) - 1] = '' value[len(value) - 1] = '' if linear_search(key, temp_k) != -1: formchain(linear_search(key, temp_k), Chains) if linear_search(value, temp_v) != -1: formchain(linear_search(value, temp_v), Chains) while key[0] != '': chains = [] formchain(0, Chains) for i in range(len(Chains) - 1): j = linear_search(start, Chains[i]) f1.write(words[j] + '|' + start_end[j] + '|') j = linear_search(start, Chains[len(Chains) - 1]) f1.write(words[j] + '|' + start_end[j] + '|' + concept[j] + '\n') f1.close()
SCOUTOATH = ''' On my honor, I will do my best to do my duty to God and my country to obey the Scout Law to help other people at all times to keep myself physically strong, mentally awake and morally straight. ''' SCOUTLAW = ''' A scout is: Trustworthy Loyal Helpful Friendly Courteous Kind Obedient Cheerful Thrifty Brave Clean and Reverent ''' OUTDOORCODE = ''' As an American, I will do my best: To be clean in my outdoor manner To be careful with fire To be considerate in the outdoors And to be conservation-minded ''' PLEDGE = ''' I pledge allegiance to the flag of the United States of America and to the republic for which it stands: one nation under God with liberty and justice for all '''
scoutoath = '\nOn my honor, I will do my best\nto do my duty to God and my country\nto obey the Scout Law\nto help other people at all times\nto keep myself physically strong, mentally awake and morally straight.\n' scoutlaw = '\nA scout is:\n Trustworthy\n Loyal\n Helpful\n Friendly\n Courteous\n Kind\n Obedient\n Cheerful\n Thrifty\n Brave\n Clean\n and Reverent\n' outdoorcode = '\nAs an American, I will do my best:\n To be clean in my outdoor manner\n To be careful with fire\n To be considerate in the outdoors\n And to be conservation-minded\n' pledge = '\nI pledge allegiance\nto the flag\nof the United States of America\nand to the republic\nfor which it stands:\none nation under God\nwith liberty\nand justice for all\n'
# Colors BLACK = (0, 0, 0) WHITE = (255, 255, 255) GREY = (140, 140, 140) CYAN = (0, 255, 255) DARK_CYAN = (0, 150, 150) ORANGE = (255, 165, 0) RED = (255, 0, 0) GREEN = (0, 255, 0)
black = (0, 0, 0) white = (255, 255, 255) grey = (140, 140, 140) cyan = (0, 255, 255) dark_cyan = (0, 150, 150) orange = (255, 165, 0) red = (255, 0, 0) green = (0, 255, 0)
data = ( 'kka', # 0x00 'kk', # 0x01 'nu', # 0x02 'no', # 0x03 'ne', # 0x04 'nee', # 0x05 'ni', # 0x06 'na', # 0x07 'mu', # 0x08 'mo', # 0x09 'me', # 0x0a 'mee', # 0x0b 'mi', # 0x0c 'ma', # 0x0d 'yu', # 0x0e 'yo', # 0x0f 'ye', # 0x10 'yee', # 0x11 'yi', # 0x12 'ya', # 0x13 'ju', # 0x14 'ju', # 0x15 'jo', # 0x16 'je', # 0x17 'jee', # 0x18 'ji', # 0x19 'ji', # 0x1a 'ja', # 0x1b 'jju', # 0x1c 'jjo', # 0x1d 'jje', # 0x1e 'jjee', # 0x1f 'jji', # 0x20 'jja', # 0x21 'lu', # 0x22 'lo', # 0x23 'le', # 0x24 'lee', # 0x25 'li', # 0x26 'la', # 0x27 'dlu', # 0x28 'dlo', # 0x29 'dle', # 0x2a 'dlee', # 0x2b 'dli', # 0x2c 'dla', # 0x2d 'lhu', # 0x2e 'lho', # 0x2f 'lhe', # 0x30 'lhee', # 0x31 'lhi', # 0x32 'lha', # 0x33 'tlhu', # 0x34 'tlho', # 0x35 'tlhe', # 0x36 'tlhee', # 0x37 'tlhi', # 0x38 'tlha', # 0x39 'tlu', # 0x3a 'tlo', # 0x3b 'tle', # 0x3c 'tlee', # 0x3d 'tli', # 0x3e 'tla', # 0x3f 'zu', # 0x40 'zo', # 0x41 'ze', # 0x42 'zee', # 0x43 'zi', # 0x44 'za', # 0x45 'z', # 0x46 'z', # 0x47 'dzu', # 0x48 'dzo', # 0x49 'dze', # 0x4a 'dzee', # 0x4b 'dzi', # 0x4c 'dza', # 0x4d 'su', # 0x4e 'so', # 0x4f 'se', # 0x50 'see', # 0x51 'si', # 0x52 'sa', # 0x53 'shu', # 0x54 'sho', # 0x55 'she', # 0x56 'shee', # 0x57 'shi', # 0x58 'sha', # 0x59 'sh', # 0x5a 'tsu', # 0x5b 'tso', # 0x5c 'tse', # 0x5d 'tsee', # 0x5e 'tsi', # 0x5f 'tsa', # 0x60 'chu', # 0x61 'cho', # 0x62 'che', # 0x63 'chee', # 0x64 'chi', # 0x65 'cha', # 0x66 'ttsu', # 0x67 'ttso', # 0x68 'ttse', # 0x69 'ttsee', # 0x6a 'ttsi', # 0x6b 'ttsa', # 0x6c 'X', # 0x6d '.', # 0x6e 'qai', # 0x6f 'ngai', # 0x70 'nngi', # 0x71 'nngii', # 0x72 'nngo', # 0x73 'nngoo', # 0x74 'nnga', # 0x75 'nngaa', # 0x76 '[?]', # 0x77 '[?]', # 0x78 '[?]', # 0x79 '[?]', # 0x7a '[?]', # 0x7b '[?]', # 0x7c '[?]', # 0x7d '[?]', # 0x7e '[?]', # 0x7f ' ', # 0x80 'b', # 0x81 'l', # 0x82 'f', # 0x83 's', # 0x84 'n', # 0x85 'h', # 0x86 'd', # 0x87 't', # 0x88 'c', # 0x89 'q', # 0x8a 'm', # 0x8b 'g', # 0x8c 'ng', # 0x8d 'z', # 0x8e 'r', # 0x8f 'a', # 0x90 'o', # 0x91 'u', # 0x92 'e', # 0x93 'i', # 0x94 'ch', # 0x95 'th', # 0x96 'ph', # 0x97 'p', # 0x98 'x', # 0x99 'p', # 0x9a '<', # 0x9b '>', # 0x9c '[?]', # 0x9d '[?]', # 0x9e '[?]', # 0x9f 'f', # 0xa0 'v', # 0xa1 'u', # 0xa2 'yr', # 0xa3 'y', # 0xa4 'w', # 0xa5 'th', # 0xa6 'th', # 0xa7 'a', # 0xa8 'o', # 0xa9 'ac', # 0xaa 'ae', # 0xab 'o', # 0xac 'o', # 0xad 'o', # 0xae 'oe', # 0xaf 'on', # 0xb0 'r', # 0xb1 'k', # 0xb2 'c', # 0xb3 'k', # 0xb4 'g', # 0xb5 'ng', # 0xb6 'g', # 0xb7 'g', # 0xb8 'w', # 0xb9 'h', # 0xba 'h', # 0xbb 'h', # 0xbc 'h', # 0xbd 'n', # 0xbe 'n', # 0xbf 'n', # 0xc0 'i', # 0xc1 'e', # 0xc2 'j', # 0xc3 'g', # 0xc4 'ae', # 0xc5 'a', # 0xc6 'eo', # 0xc7 'p', # 0xc8 'z', # 0xc9 's', # 0xca 's', # 0xcb 's', # 0xcc 'c', # 0xcd 'z', # 0xce 't', # 0xcf 't', # 0xd0 'd', # 0xd1 'b', # 0xd2 'b', # 0xd3 'p', # 0xd4 'p', # 0xd5 'e', # 0xd6 'm', # 0xd7 'm', # 0xd8 'm', # 0xd9 'l', # 0xda 'l', # 0xdb 'ng', # 0xdc 'ng', # 0xdd 'd', # 0xde 'o', # 0xdf 'ear', # 0xe0 'ior', # 0xe1 'qu', # 0xe2 'qu', # 0xe3 'qu', # 0xe4 's', # 0xe5 'yr', # 0xe6 'yr', # 0xe7 'yr', # 0xe8 'q', # 0xe9 'x', # 0xea '.', # 0xeb ':', # 0xec '+', # 0xed '17', # 0xee '18', # 0xef '19', # 0xf0 '[?]', # 0xf1 '[?]', # 0xf2 '[?]', # 0xf3 '[?]', # 0xf4 '[?]', # 0xf5 '[?]', # 0xf6 '[?]', # 0xf7 '[?]', # 0xf8 '[?]', # 0xf9 '[?]', # 0xfa '[?]', # 0xfb '[?]', # 0xfc '[?]', # 0xfd '[?]', # 0xfe )
data = ('kka', 'kk', 'nu', 'no', 'ne', 'nee', 'ni', 'na', 'mu', 'mo', 'me', 'mee', 'mi', 'ma', 'yu', 'yo', 'ye', 'yee', 'yi', 'ya', 'ju', 'ju', 'jo', 'je', 'jee', 'ji', 'ji', 'ja', 'jju', 'jjo', 'jje', 'jjee', 'jji', 'jja', 'lu', 'lo', 'le', 'lee', 'li', 'la', 'dlu', 'dlo', 'dle', 'dlee', 'dli', 'dla', 'lhu', 'lho', 'lhe', 'lhee', 'lhi', 'lha', 'tlhu', 'tlho', 'tlhe', 'tlhee', 'tlhi', 'tlha', 'tlu', 'tlo', 'tle', 'tlee', 'tli', 'tla', 'zu', 'zo', 'ze', 'zee', 'zi', 'za', 'z', 'z', 'dzu', 'dzo', 'dze', 'dzee', 'dzi', 'dza', 'su', 'so', 'se', 'see', 'si', 'sa', 'shu', 'sho', 'she', 'shee', 'shi', 'sha', 'sh', 'tsu', 'tso', 'tse', 'tsee', 'tsi', 'tsa', 'chu', 'cho', 'che', 'chee', 'chi', 'cha', 'ttsu', 'ttso', 'ttse', 'ttsee', 'ttsi', 'ttsa', 'X', '.', 'qai', 'ngai', 'nngi', 'nngii', 'nngo', 'nngoo', 'nnga', 'nngaa', '[?]', '[?]', '[?]', '[?]', '[?]', '[?]', '[?]', '[?]', '[?]', ' ', 'b', 'l', 'f', 's', 'n', 'h', 'd', 't', 'c', 'q', 'm', 'g', 'ng', 'z', 'r', 'a', 'o', 'u', 'e', 'i', 'ch', 'th', 'ph', 'p', 'x', 'p', '<', '>', '[?]', '[?]', '[?]', 'f', 'v', 'u', 'yr', 'y', 'w', 'th', 'th', 'a', 'o', 'ac', 'ae', 'o', 'o', 'o', 'oe', 'on', 'r', 'k', 'c', 'k', 'g', 'ng', 'g', 'g', 'w', 'h', 'h', 'h', 'h', 'n', 'n', 'n', 'i', 'e', 'j', 'g', 'ae', 'a', 'eo', 'p', 'z', 's', 's', 's', 'c', 'z', 't', 't', 'd', 'b', 'b', 'p', 'p', 'e', 'm', 'm', 'm', 'l', 'l', 'ng', 'ng', 'd', 'o', 'ear', 'ior', 'qu', 'qu', 'qu', 's', 'yr', 'yr', 'yr', 'q', 'x', '.', ':', '+', '17', '18', '19', '[?]', '[?]', '[?]', '[?]', '[?]', '[?]', '[?]', '[?]', '[?]', '[?]', '[?]', '[?]', '[?]', '[?]')
class SymbolTableItem: def __init__(self, type, name, customId, value): self.type = type self.name = name self.value = value # if type == 'int' or type == 'bool': # self.value = 0 # elif type == 'string': # self.value = ' ' # else: # self.value = None self.id = 'id_{}'.format(customId) def __str__(self): return '{}, {}, {}, {}'.format(self.type, self.name, self.value, self.id)
class Symboltableitem: def __init__(self, type, name, customId, value): self.type = type self.name = name self.value = value self.id = 'id_{}'.format(customId) def __str__(self): return '{}, {}, {}, {}'.format(self.type, self.name, self.value, self.id)
# Define the fileName as a variable fileToWrite = 'outputFile.txt' fileHandle = open(fileToWrite, 'w') i = 0 while i < 10: fileHandle.write("This is line Number " + str(i) + "\n") i += 1 fileHandle.close()
file_to_write = 'outputFile.txt' file_handle = open(fileToWrite, 'w') i = 0 while i < 10: fileHandle.write('This is line Number ' + str(i) + '\n') i += 1 fileHandle.close()
a = source() if True: b = a + 3 * sanitizer2(y) else: b = sanitizer(a) sink(b)
a = source() if True: b = a + 3 * sanitizer2(y) else: b = sanitizer(a) sink(b)
# # This file contains the Python code from Program 10.10 of # "Data Structures and Algorithms # with Object-Oriented Design Patterns in Python" # by Bruno R. Preiss. # # Copyright (c) 2003 by Bruno R. Preiss, P.Eng. All rights reserved. # # http://www.brpreiss.com/books/opus7/programs/pgm10_10.txt # class AVLTree(BinarySearchTree): def balance(self): self.adjustHeight() if self.balanceFactor > 1: if self._left.balanceFactor > 0: self.doLLRotation() else: self.doLRRotation() elif self.balanceFactor < -1: if self._right.balanceFactor < 0: self.doRRRotation() else: self.doRLRotation() # ...
class Avltree(BinarySearchTree): def balance(self): self.adjustHeight() if self.balanceFactor > 1: if self._left.balanceFactor > 0: self.doLLRotation() else: self.doLRRotation() elif self.balanceFactor < -1: if self._right.balanceFactor < 0: self.doRRRotation() else: self.doRLRotation()
# Python program to print Even Numbers in given range start, end = 4, 19 # iterating each number in list for num in range(start, end + 1): # checking condition if num % 2 == 0: print(num, end = " ")
(start, end) = (4, 19) for num in range(start, end + 1): if num % 2 == 0: print(num, end=' ')
x = input() y = input() z = input() flag = z % (1 + 1) == 0 and (1 < x and x < 123) or (1 > y and y > x and x > y and y < 123) def identity(var): return var if x ^ y == 1 or ( x % 2 == 0 and (3 > x and x <= 3 and 3 <= y and y > z and z >= 5) or ( identity(-1) + hash('hello') < 10 + 120 and 10 + 120 < hash('world') - 1)): print(x, y, z)
x = input() y = input() z = input() flag = z % (1 + 1) == 0 and (1 < x and x < 123) or (1 > y and y > x and (x > y) and (y < 123)) def identity(var): return var if x ^ y == 1 or (x % 2 == 0 and (3 > x and x <= 3 and (3 <= y) and (y > z) and (z >= 5)) or (identity(-1) + hash('hello') < 10 + 120 and 10 + 120 < hash('world') - 1)): print(x, y, z)
def main(): class student: std = [] def __init__(self,name,id,cgpa): self.name = name self.id = id self.cgpa = cgpa def showId(self): return self.id def result(self): if(self.cgpa > 8.5): print("Great score") elif(self.cgpa > 7 and self.cgpa < 8.5): print("Keep it up") else: print("Not gonna pass") def details(self): print(f'STUDENT ID: {self.id}\nSTUDENT NAME: {self.name}\nCGPA: {self.cgpa}\nPROGRESS REPORT:',end='')+self.result() def insert(): if 1: x = input('Enter the name of the student: ') y = input('Enter the id of the student: ') z = input('Enter the cgpa of the student: ') while not(z.isdigit() and int(z)<10): z = input('Enter a correct cgpa') if float(z)<5: print(f'Hey {x}, You better work on your studies') data = student(x,y,float(z)) student.std.append(data.__dict__) print(f'id no {y} has been added') def search(): found = 0 try: x= input('Enter your id: ') for data in student.std: if x == data['id']: print('NAME: '+ data['name']) print('CGPA: '+ str(data['cgpa'])) found=1 # print(data['id']) if found ==0: print('Data not found') except: print('Ooops!Error') def decision(x): try: return{ '1':insert(), '2':search(), '3':delete(), '4': exit() }[x] except: print('Invalid input') while True: y = input('Press 1 if you want to insert data\nPress 2 if you want to search data\nPress 3 if you want to delete a data\npress 4 if you want to exit\n') if y in ['1','2','3']: if y is '1': insert() print(student.std) continue elif y is '2': search() continue else: search() continue else: x1=input('INVALID OPTION.PRESS * TO CONTINUE OR ELSE TO EXIT :') if int(ord(x1))==42: continue else: break if __name__=='__main__': main()
def main(): class Student: std = [] def __init__(self, name, id, cgpa): self.name = name self.id = id self.cgpa = cgpa def show_id(self): return self.id def result(self): if self.cgpa > 8.5: print('Great score') elif self.cgpa > 7 and self.cgpa < 8.5: print('Keep it up') else: print('Not gonna pass') def details(self): print(f'STUDENT ID: {self.id}\nSTUDENT NAME: {self.name}\nCGPA: {self.cgpa}\nPROGRESS REPORT:', end='') + self.result() def insert(): if 1: x = input('Enter the name of the student: ') y = input('Enter the id of the student: ') z = input('Enter the cgpa of the student: ') while not (z.isdigit() and int(z) < 10): z = input('Enter a correct cgpa') if float(z) < 5: print(f'Hey {x}, You better work on your studies') data = student(x, y, float(z)) student.std.append(data.__dict__) print(f'id no {y} has been added') def search(): found = 0 try: x = input('Enter your id: ') for data in student.std: if x == data['id']: print('NAME: ' + data['name']) print('CGPA: ' + str(data['cgpa'])) found = 1 if found == 0: print('Data not found') except: print('Ooops!Error') def decision(x): try: return {'1': insert(), '2': search(), '3': delete(), '4': exit()}[x] except: print('Invalid input') while True: y = input('Press 1 if you want to insert data\nPress 2 if you want to search data\nPress 3 if you want to delete a data\npress 4 if you want to exit\n') if y in ['1', '2', '3']: if y is '1': insert() print(student.std) continue elif y is '2': search() continue else: search() continue else: x1 = input('INVALID OPTION.PRESS * TO CONTINUE OR ELSE TO EXIT :') if int(ord(x1)) == 42: continue else: break if __name__ == '__main__': main()
def valid(a): a = str(a) num = set() for char in a: num.add(char) return len(a) == len(num) n = int(input()) n += 1 while True: if valid(n): print(n) break else: n += 1
def valid(a): a = str(a) num = set() for char in a: num.add(char) return len(a) == len(num) n = int(input()) n += 1 while True: if valid(n): print(n) break else: n += 1
P, A, B = map(int, input().split()) if P >= A+B: print(P) elif B > P: print(-1) else: print(A+B)
(p, a, b) = map(int, input().split()) if P >= A + B: print(P) elif B > P: print(-1) else: print(A + B)
PASSWORD = "PASSW0RD2019" TO = ["test@gmail.com", "test2@gmail.com"] FROM = "test@gmail.com"
password = 'PASSW0RD2019' to = ['test@gmail.com', 'test2@gmail.com'] from = 'test@gmail.com'
# -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the MIT License. See License.txt in the project root for # license information. # # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is # regenerated. # -------------------------------------------------------------------------- # pylint: disable=too-many-lines def edgeorder_order_show(client, name, resource_group_name, location): return client.get_order_by_name(order_name=name, resource_group_name=resource_group_name, location=location) def edgeorder_list_config(client, configuration_filters, skip_token=None, registered_features=None, location_placement_id=None, quota_id=None): configurations_request = {} configurations_request['configuration_filters'] = configuration_filters configurations_request['customer_subscription_details'] = {} if registered_features is not None: configurations_request['customer_subscription_details']['registered_features'] = registered_features if location_placement_id is not None: configurations_request['customer_subscription_details']['location_placement_id'] = location_placement_id if quota_id is not None: configurations_request['customer_subscription_details']['quota_id'] = quota_id if len(configurations_request['customer_subscription_details']) == 0: del configurations_request['customer_subscription_details'] return client.list_configurations(skip_token=skip_token, configurations_request=configurations_request) def edgeorder_list_family(client, filterable_properties, expand=None, skip_token=None, registered_features=None, location_placement_id=None, quota_id=None): product_families_request = {} product_families_request['filterable_properties'] = filterable_properties product_families_request['customer_subscription_details'] = {} if registered_features is not None: product_families_request['customer_subscription_details']['registered_features'] = registered_features if location_placement_id is not None: product_families_request['customer_subscription_details']['location_placement_id'] = location_placement_id if quota_id is not None: product_families_request['customer_subscription_details']['quota_id'] = quota_id if len(product_families_request['customer_subscription_details']) == 0: del product_families_request['customer_subscription_details'] return client.list_product_families(expand=expand, skip_token=skip_token, product_families_request=product_families_request) def edgeorder_list_metadata(client, skip_token=None): return client.list_product_families_metadata(skip_token=skip_token) def edgeorder_list_operation(client): return client.list_operations() def edgeorder_address_list(client, resource_group_name=None, filter_=None, skip_token=None): if resource_group_name: return client.list_by_group(resource_group_name=resource_group_name, filter=filter_, skip_token=skip_token) return client.list(filter=filter_, skip_token=skip_token) def edgeorder_address_show(client, address_name, resource_group_name): return client.get_address_by_name(address_name=address_name, resource_group_name=resource_group_name) def edgeorder_address_create(client, address_name, resource_group_name, location, contact_details, tags=None, shipping_address=None): address_resource = {} if tags is not None: address_resource['tags'] = tags address_resource['location'] = location if shipping_address is not None: address_resource['shipping_address'] = shipping_address address_resource['contact_details'] = contact_details return client.begin_create_address(address_name=address_name, resource_group_name=resource_group_name, address_resource=address_resource) def edgeorder_address_update(client, address_name, resource_group_name, if_match=None, tags=None, shipping_address=None, contact_details=None): address_update_parameter = {} if tags is not None: address_update_parameter['tags'] = tags if shipping_address is not None: address_update_parameter['shipping_address'] = shipping_address if contact_details is not None: address_update_parameter['contact_details'] = contact_details return client.begin_update_address(address_name=address_name, resource_group_name=resource_group_name, if_match=if_match, address_update_parameter=address_update_parameter) def edgeorder_address_delete(client, address_name, resource_group_name): return client.begin_delete_address_by_name(address_name=address_name, resource_group_name=resource_group_name) def edgeorder_order_list(client, resource_group_name=None, skip_token=None): if resource_group_name: return client.list_by_group(resource_group_name=resource_group_name, skip_token=skip_token) return client.list(skip_token=skip_token) def edgeorder_order_item_list(client, resource_group_name=None, filter_=None, expand=None, skip_token=None): if resource_group_name: return client.list_by_group(resource_group_name=resource_group_name, filter=filter_, expand=expand, skip_token=skip_token) return client.list(filter=filter_, expand=expand, skip_token=skip_token) def edgeorder_order_item_show(client, order_item_name, resource_group_name, expand=None): return client.get_order_item_by_name(order_item_name=order_item_name, resource_group_name=resource_group_name, expand=expand) def edgeorder_order_item_create(client, order_item_name, resource_group_name, order_item_resource): return client.begin_create_order_item(order_item_name=order_item_name, resource_group_name=resource_group_name, order_item_resource=order_item_resource) def edgeorder_order_item_update(client, order_item_name, resource_group_name, if_match=None, tags=None, notification_email_list=None, notification_preferences=None, transport_preferences=None, encryption_preferences=None, management_resource_preferences=None, shipping_address=None, contact_details=None): order_item_update_parameter = {} if tags is not None: order_item_update_parameter['tags'] = tags if notification_email_list is not None: order_item_update_parameter['notification_email_list'] = notification_email_list order_item_update_parameter['preferences'] = {} if notification_preferences is not None: order_item_update_parameter['preferences']['notification_preferences'] = notification_preferences if transport_preferences is not None: order_item_update_parameter['preferences']['transport_preferences'] = transport_preferences if encryption_preferences is not None: order_item_update_parameter['preferences']['encryption_preferences'] = encryption_preferences if management_resource_preferences is not None: order_item_update_parameter['preferences']['management_resource_preferences'] = management_resource_preferences if len(order_item_update_parameter['preferences']) == 0: del order_item_update_parameter['preferences'] order_item_update_parameter['forward_address'] = {} if shipping_address is not None: order_item_update_parameter['forward_address']['shipping_address'] = shipping_address if contact_details is not None: order_item_update_parameter['forward_address']['contact_details'] = contact_details if len(order_item_update_parameter['forward_address']) == 0: del order_item_update_parameter['forward_address'] return client.begin_update_order_item(order_item_name=order_item_name, resource_group_name=resource_group_name, if_match=if_match, order_item_update_parameter=order_item_update_parameter) def edgeorder_order_item_delete(client, order_item_name, resource_group_name): return client.begin_delete_order_item_by_name(order_item_name=order_item_name, resource_group_name=resource_group_name) def edgeorder_order_item_cancel(client, order_item_name, resource_group_name, reason): cancellation_reason = {} cancellation_reason['reason'] = reason return client.cancel_order_item(order_item_name=order_item_name, resource_group_name=resource_group_name, cancellation_reason=cancellation_reason) def edgeorder_order_item_return(client, order_item_name, resource_group_name, return_reason, service_tag=None, shipping_box_required=None, shipping_address=None, contact_details=None): return_order_item_details = {} return_order_item_details['return_reason'] = return_reason if service_tag is not None: return_order_item_details['service_tag'] = service_tag if shipping_box_required is not None: return_order_item_details['shipping_box_required'] = shipping_box_required else: return_order_item_details['shipping_box_required'] = False return_order_item_details['return_address'] = {} if shipping_address is not None: return_order_item_details['return_address']['shipping_address'] = shipping_address if contact_details is not None: return_order_item_details['return_address']['contact_details'] = contact_details if len(return_order_item_details['return_address']) == 0: del return_order_item_details['return_address'] return client.begin_return_order_item(order_item_name=order_item_name, resource_group_name=resource_group_name, return_order_item_details=return_order_item_details)
def edgeorder_order_show(client, name, resource_group_name, location): return client.get_order_by_name(order_name=name, resource_group_name=resource_group_name, location=location) def edgeorder_list_config(client, configuration_filters, skip_token=None, registered_features=None, location_placement_id=None, quota_id=None): configurations_request = {} configurations_request['configuration_filters'] = configuration_filters configurations_request['customer_subscription_details'] = {} if registered_features is not None: configurations_request['customer_subscription_details']['registered_features'] = registered_features if location_placement_id is not None: configurations_request['customer_subscription_details']['location_placement_id'] = location_placement_id if quota_id is not None: configurations_request['customer_subscription_details']['quota_id'] = quota_id if len(configurations_request['customer_subscription_details']) == 0: del configurations_request['customer_subscription_details'] return client.list_configurations(skip_token=skip_token, configurations_request=configurations_request) def edgeorder_list_family(client, filterable_properties, expand=None, skip_token=None, registered_features=None, location_placement_id=None, quota_id=None): product_families_request = {} product_families_request['filterable_properties'] = filterable_properties product_families_request['customer_subscription_details'] = {} if registered_features is not None: product_families_request['customer_subscription_details']['registered_features'] = registered_features if location_placement_id is not None: product_families_request['customer_subscription_details']['location_placement_id'] = location_placement_id if quota_id is not None: product_families_request['customer_subscription_details']['quota_id'] = quota_id if len(product_families_request['customer_subscription_details']) == 0: del product_families_request['customer_subscription_details'] return client.list_product_families(expand=expand, skip_token=skip_token, product_families_request=product_families_request) def edgeorder_list_metadata(client, skip_token=None): return client.list_product_families_metadata(skip_token=skip_token) def edgeorder_list_operation(client): return client.list_operations() def edgeorder_address_list(client, resource_group_name=None, filter_=None, skip_token=None): if resource_group_name: return client.list_by_group(resource_group_name=resource_group_name, filter=filter_, skip_token=skip_token) return client.list(filter=filter_, skip_token=skip_token) def edgeorder_address_show(client, address_name, resource_group_name): return client.get_address_by_name(address_name=address_name, resource_group_name=resource_group_name) def edgeorder_address_create(client, address_name, resource_group_name, location, contact_details, tags=None, shipping_address=None): address_resource = {} if tags is not None: address_resource['tags'] = tags address_resource['location'] = location if shipping_address is not None: address_resource['shipping_address'] = shipping_address address_resource['contact_details'] = contact_details return client.begin_create_address(address_name=address_name, resource_group_name=resource_group_name, address_resource=address_resource) def edgeorder_address_update(client, address_name, resource_group_name, if_match=None, tags=None, shipping_address=None, contact_details=None): address_update_parameter = {} if tags is not None: address_update_parameter['tags'] = tags if shipping_address is not None: address_update_parameter['shipping_address'] = shipping_address if contact_details is not None: address_update_parameter['contact_details'] = contact_details return client.begin_update_address(address_name=address_name, resource_group_name=resource_group_name, if_match=if_match, address_update_parameter=address_update_parameter) def edgeorder_address_delete(client, address_name, resource_group_name): return client.begin_delete_address_by_name(address_name=address_name, resource_group_name=resource_group_name) def edgeorder_order_list(client, resource_group_name=None, skip_token=None): if resource_group_name: return client.list_by_group(resource_group_name=resource_group_name, skip_token=skip_token) return client.list(skip_token=skip_token) def edgeorder_order_item_list(client, resource_group_name=None, filter_=None, expand=None, skip_token=None): if resource_group_name: return client.list_by_group(resource_group_name=resource_group_name, filter=filter_, expand=expand, skip_token=skip_token) return client.list(filter=filter_, expand=expand, skip_token=skip_token) def edgeorder_order_item_show(client, order_item_name, resource_group_name, expand=None): return client.get_order_item_by_name(order_item_name=order_item_name, resource_group_name=resource_group_name, expand=expand) def edgeorder_order_item_create(client, order_item_name, resource_group_name, order_item_resource): return client.begin_create_order_item(order_item_name=order_item_name, resource_group_name=resource_group_name, order_item_resource=order_item_resource) def edgeorder_order_item_update(client, order_item_name, resource_group_name, if_match=None, tags=None, notification_email_list=None, notification_preferences=None, transport_preferences=None, encryption_preferences=None, management_resource_preferences=None, shipping_address=None, contact_details=None): order_item_update_parameter = {} if tags is not None: order_item_update_parameter['tags'] = tags if notification_email_list is not None: order_item_update_parameter['notification_email_list'] = notification_email_list order_item_update_parameter['preferences'] = {} if notification_preferences is not None: order_item_update_parameter['preferences']['notification_preferences'] = notification_preferences if transport_preferences is not None: order_item_update_parameter['preferences']['transport_preferences'] = transport_preferences if encryption_preferences is not None: order_item_update_parameter['preferences']['encryption_preferences'] = encryption_preferences if management_resource_preferences is not None: order_item_update_parameter['preferences']['management_resource_preferences'] = management_resource_preferences if len(order_item_update_parameter['preferences']) == 0: del order_item_update_parameter['preferences'] order_item_update_parameter['forward_address'] = {} if shipping_address is not None: order_item_update_parameter['forward_address']['shipping_address'] = shipping_address if contact_details is not None: order_item_update_parameter['forward_address']['contact_details'] = contact_details if len(order_item_update_parameter['forward_address']) == 0: del order_item_update_parameter['forward_address'] return client.begin_update_order_item(order_item_name=order_item_name, resource_group_name=resource_group_name, if_match=if_match, order_item_update_parameter=order_item_update_parameter) def edgeorder_order_item_delete(client, order_item_name, resource_group_name): return client.begin_delete_order_item_by_name(order_item_name=order_item_name, resource_group_name=resource_group_name) def edgeorder_order_item_cancel(client, order_item_name, resource_group_name, reason): cancellation_reason = {} cancellation_reason['reason'] = reason return client.cancel_order_item(order_item_name=order_item_name, resource_group_name=resource_group_name, cancellation_reason=cancellation_reason) def edgeorder_order_item_return(client, order_item_name, resource_group_name, return_reason, service_tag=None, shipping_box_required=None, shipping_address=None, contact_details=None): return_order_item_details = {} return_order_item_details['return_reason'] = return_reason if service_tag is not None: return_order_item_details['service_tag'] = service_tag if shipping_box_required is not None: return_order_item_details['shipping_box_required'] = shipping_box_required else: return_order_item_details['shipping_box_required'] = False return_order_item_details['return_address'] = {} if shipping_address is not None: return_order_item_details['return_address']['shipping_address'] = shipping_address if contact_details is not None: return_order_item_details['return_address']['contact_details'] = contact_details if len(return_order_item_details['return_address']) == 0: del return_order_item_details['return_address'] return client.begin_return_order_item(order_item_name=order_item_name, resource_group_name=resource_group_name, return_order_item_details=return_order_item_details)
class Config(object): ORG_NAME = 'footprints' ORG_DOMAIN = 'footprints.devel' APP_NAME = 'Footprints' APP_VERSION = '0.4.0'
class Config(object): org_name = 'footprints' org_domain = 'footprints.devel' app_name = 'Footprints' app_version = '0.4.0'
class Solution: def minSubArrayLen(self, s: int, nums: List[int]) -> int: left, sum, count = 0, 0, float('inf') for right in range(len(nums)): sum += nums[right] while sum >= s: count = min(count, right - left + 1) sum -= nums[left] left += 1 return count if count != float('inf') else 0
class Solution: def min_sub_array_len(self, s: int, nums: List[int]) -> int: (left, sum, count) = (0, 0, float('inf')) for right in range(len(nums)): sum += nums[right] while sum >= s: count = min(count, right - left + 1) sum -= nums[left] left += 1 return count if count != float('inf') else 0
def pisano(m): prev,curr=0,1 for i in range(0,m*m): prev,curr=curr,(prev+curr)%m if prev==0 and curr == 1 : return i+1 def fib(n,m): seq=pisano(m) n%=seq if n<2: return n f=[0]*(n+1) f[1]=1 for i in range(2,n+1): f[i]=f[i-1]+f[i-2] return f[n] # Print Fn % m where n and m are 2 inputs, and Fn => nth Fibonacci Term inp=list(map(int,input().split())) print(fib(inp[0],inp[1])%inp[1])
def pisano(m): (prev, curr) = (0, 1) for i in range(0, m * m): (prev, curr) = (curr, (prev + curr) % m) if prev == 0 and curr == 1: return i + 1 def fib(n, m): seq = pisano(m) n %= seq if n < 2: return n f = [0] * (n + 1) f[1] = 1 for i in range(2, n + 1): f[i] = f[i - 1] + f[i - 2] return f[n] inp = list(map(int, input().split())) print(fib(inp[0], inp[1]) % inp[1])
# # PySNMP MIB module TRAPEZE-NETWORKS-RF-BLACKLIST-MIB (http://snmplabs.com/pysmi) # ASN.1 source file:///Users/davwang4/Dev/mibs.snmplabs.com/asn1/TRAPEZE-NETWORKS-RF-BLACKLIST-MIB # Produced by pysmi-0.3.4 at Wed May 1 15:27:23 2019 # On host DAVWANG4-M-1475 platform Darwin version 18.5.0 by user davwang4 # Using Python version 3.7.3 (default, Mar 27 2019, 09:23:15) # OctetString, Integer, ObjectIdentifier = mibBuilder.importSymbols("ASN1", "OctetString", "Integer", "ObjectIdentifier") NamedValues, = mibBuilder.importSymbols("ASN1-ENUMERATION", "NamedValues") ConstraintsIntersection, ValueSizeConstraint, SingleValueConstraint, ConstraintsUnion, ValueRangeConstraint = mibBuilder.importSymbols("ASN1-REFINEMENT", "ConstraintsIntersection", "ValueSizeConstraint", "SingleValueConstraint", "ConstraintsUnion", "ValueRangeConstraint") ObjectGroup, ModuleCompliance, NotificationGroup = mibBuilder.importSymbols("SNMPv2-CONF", "ObjectGroup", "ModuleCompliance", "NotificationGroup") TimeTicks, MibScalar, MibTable, MibTableRow, MibTableColumn, MibIdentifier, Unsigned32, Counter32, ObjectIdentity, iso, Gauge32, Counter64, NotificationType, Bits, IpAddress, ModuleIdentity, Integer32 = mibBuilder.importSymbols("SNMPv2-SMI", "TimeTicks", "MibScalar", "MibTable", "MibTableRow", "MibTableColumn", "MibIdentifier", "Unsigned32", "Counter32", "ObjectIdentity", "iso", "Gauge32", "Counter64", "NotificationType", "Bits", "IpAddress", "ModuleIdentity", "Integer32") DisplayString, TextualConvention, MacAddress = mibBuilder.importSymbols("SNMPv2-TC", "DisplayString", "TextualConvention", "MacAddress") trpzMibs, = mibBuilder.importSymbols("TRAPEZE-NETWORKS-ROOT-MIB", "trpzMibs") trpzRFBlacklistMib = ModuleIdentity((1, 3, 6, 1, 4, 1, 14525, 4, 18)) trpzRFBlacklistMib.setRevisions(('2011-02-24 00:14',)) if getattr(mibBuilder, 'version', (0, 0, 0)) > (4, 4, 0): if mibBuilder.loadTexts: trpzRFBlacklistMib.setRevisionsDescriptions(('v1.0.4: Initial version, for 7.5 release',)) if mibBuilder.loadTexts: trpzRFBlacklistMib.setLastUpdated('201102240014Z') if mibBuilder.loadTexts: trpzRFBlacklistMib.setOrganization('Trapeze Networks') if mibBuilder.loadTexts: trpzRFBlacklistMib.setContactInfo('Trapeze Networks Technical Support www.trapezenetworks.com US: 866.TRPZ.TAC International: 925.474.2400 support@trapezenetworks.com') if mibBuilder.loadTexts: trpzRFBlacklistMib.setDescription("RF Blacklist objects for Trapeze Networks wireless switches. Copyright (c) 2009-2011 by Trapeze Networks, Inc. All rights reserved. This Trapeze Networks SNMP Management Information Base Specification (Specification) embodies Trapeze Networks' confidential and proprietary intellectual property. Trapeze Networks retains all title and ownership in the Specification, including any revisions. This Specification is supplied 'AS IS' and Trapeze Networks makes no warranty, either express or implied, as to the use, operation, condition, or performance of the Specification.") class TrpzRFBlacklistedEntryType(TextualConvention, Integer32): description = 'Enumeration to indicate the Type of a Blacklisted Entry: configuredPermanent: The MAC address has been permanently blacklisted by administrative action; configuredDynamic: The MAC address has been temporarily blacklisted by administrative action; assocReqFlood, reassocReqFlood, disassocReqFlood, unknownDynamic: The MAC address has been automatically blacklisted by RF Detection.' status = 'current' subtypeSpec = Integer32.subtypeSpec + ConstraintsUnion(SingleValueConstraint(1, 2, 3, 4, 5, 6, 7)) namedValues = NamedValues(("other", 1), ("unknownDynamic", 2), ("configuredPermanent", 3), ("configuredDynamic", 4), ("assocReqFlood", 5), ("reassocReqFlood", 6), ("disassocReqFlood", 7)) trpzRFBlacklistMibObjects = MibIdentifier((1, 3, 6, 1, 4, 1, 14525, 4, 18, 1)) trpzRFBlacklistXmtrTable = MibTable((1, 3, 6, 1, 4, 1, 14525, 4, 18, 1, 2), ) if mibBuilder.loadTexts: trpzRFBlacklistXmtrTable.setStatus('current') if mibBuilder.loadTexts: trpzRFBlacklistXmtrTable.setDescription('A table containing transmitters blacklisted by RF Detection.') trpzRFBlacklistXmtrEntry = MibTableRow((1, 3, 6, 1, 4, 1, 14525, 4, 18, 1, 2, 1), ).setIndexNames((0, "TRAPEZE-NETWORKS-RF-BLACKLIST-MIB", "trpzRFBlacklistXmtrMacAddress")) if mibBuilder.loadTexts: trpzRFBlacklistXmtrEntry.setStatus('current') if mibBuilder.loadTexts: trpzRFBlacklistXmtrEntry.setDescription('Information about a particular blacklisted transmitter.') trpzRFBlacklistXmtrMacAddress = MibTableColumn((1, 3, 6, 1, 4, 1, 14525, 4, 18, 1, 2, 1, 1), MacAddress()) if mibBuilder.loadTexts: trpzRFBlacklistXmtrMacAddress.setStatus('current') if mibBuilder.loadTexts: trpzRFBlacklistXmtrMacAddress.setDescription('The MAC Address of this Blacklisted Transmitter.') trpzRFBlacklistXmtrType = MibTableColumn((1, 3, 6, 1, 4, 1, 14525, 4, 18, 1, 2, 1, 2), TrpzRFBlacklistedEntryType()).setMaxAccess("readonly") if mibBuilder.loadTexts: trpzRFBlacklistXmtrType.setStatus('current') if mibBuilder.loadTexts: trpzRFBlacklistXmtrType.setDescription('The Type of this Blacklisted Transmitter.') trpzRFBlacklistXmtrTimeToLive = MibTableColumn((1, 3, 6, 1, 4, 1, 14525, 4, 18, 1, 2, 1, 3), Unsigned32()).setMaxAccess("readonly") if mibBuilder.loadTexts: trpzRFBlacklistXmtrTimeToLive.setStatus('current') if mibBuilder.loadTexts: trpzRFBlacklistXmtrTimeToLive.setDescription('The remaining time in seconds until this Transmitter is removed from the RF Blacklist. For permanent entries, the value will be always zero.') trpzRFBlacklistConformance = MibIdentifier((1, 3, 6, 1, 4, 1, 14525, 4, 18, 2)) trpzRFBlacklistCompliances = MibIdentifier((1, 3, 6, 1, 4, 1, 14525, 4, 18, 2, 1)) trpzRFBlacklistGroups = MibIdentifier((1, 3, 6, 1, 4, 1, 14525, 4, 18, 2, 2)) trpzRFBlacklistCompliance = ModuleCompliance((1, 3, 6, 1, 4, 1, 14525, 4, 18, 2, 1, 1)).setObjects(("TRAPEZE-NETWORKS-RF-BLACKLIST-MIB", "trpzRFBlacklistXmtrGroup")) if getattr(mibBuilder, 'version', (0, 0, 0)) > (4, 4, 0): trpzRFBlacklistCompliance = trpzRFBlacklistCompliance.setStatus('current') if mibBuilder.loadTexts: trpzRFBlacklistCompliance.setDescription('The compliance statement for devices that implement RF Blacklist MIB. This compliance statement is for releases 7.5 and greater of AC (wireless switch) software.') trpzRFBlacklistXmtrGroup = ObjectGroup((1, 3, 6, 1, 4, 1, 14525, 4, 18, 2, 2, 1)).setObjects(("TRAPEZE-NETWORKS-RF-BLACKLIST-MIB", "trpzRFBlacklistXmtrType"), ("TRAPEZE-NETWORKS-RF-BLACKLIST-MIB", "trpzRFBlacklistXmtrTimeToLive")) if getattr(mibBuilder, 'version', (0, 0, 0)) > (4, 4, 0): trpzRFBlacklistXmtrGroup = trpzRFBlacklistXmtrGroup.setStatus('current') if mibBuilder.loadTexts: trpzRFBlacklistXmtrGroup.setDescription('Group of columnar objects implemented to provide Blacklisted Transmitter info in releases 7.5 and greater.') mibBuilder.exportSymbols("TRAPEZE-NETWORKS-RF-BLACKLIST-MIB", trpzRFBlacklistXmtrEntry=trpzRFBlacklistXmtrEntry, TrpzRFBlacklistedEntryType=TrpzRFBlacklistedEntryType, trpzRFBlacklistXmtrType=trpzRFBlacklistXmtrType, trpzRFBlacklistCompliances=trpzRFBlacklistCompliances, trpzRFBlacklistMib=trpzRFBlacklistMib, trpzRFBlacklistMibObjects=trpzRFBlacklistMibObjects, trpzRFBlacklistGroups=trpzRFBlacklistGroups, trpzRFBlacklistXmtrMacAddress=trpzRFBlacklistXmtrMacAddress, trpzRFBlacklistXmtrTimeToLive=trpzRFBlacklistXmtrTimeToLive, trpzRFBlacklistXmtrGroup=trpzRFBlacklistXmtrGroup, trpzRFBlacklistXmtrTable=trpzRFBlacklistXmtrTable, trpzRFBlacklistCompliance=trpzRFBlacklistCompliance, trpzRFBlacklistConformance=trpzRFBlacklistConformance, PYSNMP_MODULE_ID=trpzRFBlacklistMib)
(octet_string, integer, object_identifier) = mibBuilder.importSymbols('ASN1', 'OctetString', 'Integer', 'ObjectIdentifier') (named_values,) = mibBuilder.importSymbols('ASN1-ENUMERATION', 'NamedValues') (constraints_intersection, value_size_constraint, single_value_constraint, constraints_union, value_range_constraint) = mibBuilder.importSymbols('ASN1-REFINEMENT', 'ConstraintsIntersection', 'ValueSizeConstraint', 'SingleValueConstraint', 'ConstraintsUnion', 'ValueRangeConstraint') (object_group, module_compliance, notification_group) = mibBuilder.importSymbols('SNMPv2-CONF', 'ObjectGroup', 'ModuleCompliance', 'NotificationGroup') (time_ticks, mib_scalar, mib_table, mib_table_row, mib_table_column, mib_identifier, unsigned32, counter32, object_identity, iso, gauge32, counter64, notification_type, bits, ip_address, module_identity, integer32) = mibBuilder.importSymbols('SNMPv2-SMI', 'TimeTicks', 'MibScalar', 'MibTable', 'MibTableRow', 'MibTableColumn', 'MibIdentifier', 'Unsigned32', 'Counter32', 'ObjectIdentity', 'iso', 'Gauge32', 'Counter64', 'NotificationType', 'Bits', 'IpAddress', 'ModuleIdentity', 'Integer32') (display_string, textual_convention, mac_address) = mibBuilder.importSymbols('SNMPv2-TC', 'DisplayString', 'TextualConvention', 'MacAddress') (trpz_mibs,) = mibBuilder.importSymbols('TRAPEZE-NETWORKS-ROOT-MIB', 'trpzMibs') trpz_rf_blacklist_mib = module_identity((1, 3, 6, 1, 4, 1, 14525, 4, 18)) trpzRFBlacklistMib.setRevisions(('2011-02-24 00:14',)) if getattr(mibBuilder, 'version', (0, 0, 0)) > (4, 4, 0): if mibBuilder.loadTexts: trpzRFBlacklistMib.setRevisionsDescriptions(('v1.0.4: Initial version, for 7.5 release',)) if mibBuilder.loadTexts: trpzRFBlacklistMib.setLastUpdated('201102240014Z') if mibBuilder.loadTexts: trpzRFBlacklistMib.setOrganization('Trapeze Networks') if mibBuilder.loadTexts: trpzRFBlacklistMib.setContactInfo('Trapeze Networks Technical Support www.trapezenetworks.com US: 866.TRPZ.TAC International: 925.474.2400 support@trapezenetworks.com') if mibBuilder.loadTexts: trpzRFBlacklistMib.setDescription("RF Blacklist objects for Trapeze Networks wireless switches. Copyright (c) 2009-2011 by Trapeze Networks, Inc. All rights reserved. This Trapeze Networks SNMP Management Information Base Specification (Specification) embodies Trapeze Networks' confidential and proprietary intellectual property. Trapeze Networks retains all title and ownership in the Specification, including any revisions. This Specification is supplied 'AS IS' and Trapeze Networks makes no warranty, either express or implied, as to the use, operation, condition, or performance of the Specification.") class Trpzrfblacklistedentrytype(TextualConvention, Integer32): description = 'Enumeration to indicate the Type of a Blacklisted Entry: configuredPermanent: The MAC address has been permanently blacklisted by administrative action; configuredDynamic: The MAC address has been temporarily blacklisted by administrative action; assocReqFlood, reassocReqFlood, disassocReqFlood, unknownDynamic: The MAC address has been automatically blacklisted by RF Detection.' status = 'current' subtype_spec = Integer32.subtypeSpec + constraints_union(single_value_constraint(1, 2, 3, 4, 5, 6, 7)) named_values = named_values(('other', 1), ('unknownDynamic', 2), ('configuredPermanent', 3), ('configuredDynamic', 4), ('assocReqFlood', 5), ('reassocReqFlood', 6), ('disassocReqFlood', 7)) trpz_rf_blacklist_mib_objects = mib_identifier((1, 3, 6, 1, 4, 1, 14525, 4, 18, 1)) trpz_rf_blacklist_xmtr_table = mib_table((1, 3, 6, 1, 4, 1, 14525, 4, 18, 1, 2)) if mibBuilder.loadTexts: trpzRFBlacklistXmtrTable.setStatus('current') if mibBuilder.loadTexts: trpzRFBlacklistXmtrTable.setDescription('A table containing transmitters blacklisted by RF Detection.') trpz_rf_blacklist_xmtr_entry = mib_table_row((1, 3, 6, 1, 4, 1, 14525, 4, 18, 1, 2, 1)).setIndexNames((0, 'TRAPEZE-NETWORKS-RF-BLACKLIST-MIB', 'trpzRFBlacklistXmtrMacAddress')) if mibBuilder.loadTexts: trpzRFBlacklistXmtrEntry.setStatus('current') if mibBuilder.loadTexts: trpzRFBlacklistXmtrEntry.setDescription('Information about a particular blacklisted transmitter.') trpz_rf_blacklist_xmtr_mac_address = mib_table_column((1, 3, 6, 1, 4, 1, 14525, 4, 18, 1, 2, 1, 1), mac_address()) if mibBuilder.loadTexts: trpzRFBlacklistXmtrMacAddress.setStatus('current') if mibBuilder.loadTexts: trpzRFBlacklistXmtrMacAddress.setDescription('The MAC Address of this Blacklisted Transmitter.') trpz_rf_blacklist_xmtr_type = mib_table_column((1, 3, 6, 1, 4, 1, 14525, 4, 18, 1, 2, 1, 2), trpz_rf_blacklisted_entry_type()).setMaxAccess('readonly') if mibBuilder.loadTexts: trpzRFBlacklistXmtrType.setStatus('current') if mibBuilder.loadTexts: trpzRFBlacklistXmtrType.setDescription('The Type of this Blacklisted Transmitter.') trpz_rf_blacklist_xmtr_time_to_live = mib_table_column((1, 3, 6, 1, 4, 1, 14525, 4, 18, 1, 2, 1, 3), unsigned32()).setMaxAccess('readonly') if mibBuilder.loadTexts: trpzRFBlacklistXmtrTimeToLive.setStatus('current') if mibBuilder.loadTexts: trpzRFBlacklistXmtrTimeToLive.setDescription('The remaining time in seconds until this Transmitter is removed from the RF Blacklist. For permanent entries, the value will be always zero.') trpz_rf_blacklist_conformance = mib_identifier((1, 3, 6, 1, 4, 1, 14525, 4, 18, 2)) trpz_rf_blacklist_compliances = mib_identifier((1, 3, 6, 1, 4, 1, 14525, 4, 18, 2, 1)) trpz_rf_blacklist_groups = mib_identifier((1, 3, 6, 1, 4, 1, 14525, 4, 18, 2, 2)) trpz_rf_blacklist_compliance = module_compliance((1, 3, 6, 1, 4, 1, 14525, 4, 18, 2, 1, 1)).setObjects(('TRAPEZE-NETWORKS-RF-BLACKLIST-MIB', 'trpzRFBlacklistXmtrGroup')) if getattr(mibBuilder, 'version', (0, 0, 0)) > (4, 4, 0): trpz_rf_blacklist_compliance = trpzRFBlacklistCompliance.setStatus('current') if mibBuilder.loadTexts: trpzRFBlacklistCompliance.setDescription('The compliance statement for devices that implement RF Blacklist MIB. This compliance statement is for releases 7.5 and greater of AC (wireless switch) software.') trpz_rf_blacklist_xmtr_group = object_group((1, 3, 6, 1, 4, 1, 14525, 4, 18, 2, 2, 1)).setObjects(('TRAPEZE-NETWORKS-RF-BLACKLIST-MIB', 'trpzRFBlacklistXmtrType'), ('TRAPEZE-NETWORKS-RF-BLACKLIST-MIB', 'trpzRFBlacklistXmtrTimeToLive')) if getattr(mibBuilder, 'version', (0, 0, 0)) > (4, 4, 0): trpz_rf_blacklist_xmtr_group = trpzRFBlacklistXmtrGroup.setStatus('current') if mibBuilder.loadTexts: trpzRFBlacklistXmtrGroup.setDescription('Group of columnar objects implemented to provide Blacklisted Transmitter info in releases 7.5 and greater.') mibBuilder.exportSymbols('TRAPEZE-NETWORKS-RF-BLACKLIST-MIB', trpzRFBlacklistXmtrEntry=trpzRFBlacklistXmtrEntry, TrpzRFBlacklistedEntryType=TrpzRFBlacklistedEntryType, trpzRFBlacklistXmtrType=trpzRFBlacklistXmtrType, trpzRFBlacklistCompliances=trpzRFBlacklistCompliances, trpzRFBlacklistMib=trpzRFBlacklistMib, trpzRFBlacklistMibObjects=trpzRFBlacklistMibObjects, trpzRFBlacklistGroups=trpzRFBlacklistGroups, trpzRFBlacklistXmtrMacAddress=trpzRFBlacklistXmtrMacAddress, trpzRFBlacklistXmtrTimeToLive=trpzRFBlacklistXmtrTimeToLive, trpzRFBlacklistXmtrGroup=trpzRFBlacklistXmtrGroup, trpzRFBlacklistXmtrTable=trpzRFBlacklistXmtrTable, trpzRFBlacklistCompliance=trpzRFBlacklistCompliance, trpzRFBlacklistConformance=trpzRFBlacklistConformance, PYSNMP_MODULE_ID=trpzRFBlacklistMib)
T = int(input()) for i in range(T): try: a, b = map(str, input().split()) print(int(int(a)//int(b))) except Exception as e: print("Error Code:", e)
t = int(input()) for i in range(T): try: (a, b) = map(str, input().split()) print(int(int(a) // int(b))) except Exception as e: print('Error Code:', e)
def sortNums(nums): # constant space solution i = 0 j = len(nums) - 1 index = 0 while index <= j: if nums[index] == 1: nums[index], nums[i] = nums[i], nums[index] index += 1 i += 1 if nums[index] == 2: index += 1 if nums[index] == 3: nums[index], nums[j] = nums[j], nums[index] j -= 1 return nums print(sortNums([2, 3, 2, 2, 3, 2, 3, 1, 1, 2, 1, 3]))
def sort_nums(nums): i = 0 j = len(nums) - 1 index = 0 while index <= j: if nums[index] == 1: (nums[index], nums[i]) = (nums[i], nums[index]) index += 1 i += 1 if nums[index] == 2: index += 1 if nums[index] == 3: (nums[index], nums[j]) = (nums[j], nums[index]) j -= 1 return nums print(sort_nums([2, 3, 2, 2, 3, 2, 3, 1, 1, 2, 1, 3]))
#!/usr/bin/env python def num_digits(k): c = 0 while k > 0: c += 1 k /= 10 return c def is_kaprekar(k): k2 = pow(k, 2) p10ndk = pow(10, num_digits(k)) if k == (k2 // p10ndk) + (k2 % p10ndk): return True else: return False if __name__ == '__main__': for k in range(1, 1001): if is_kaprekar(k): print(k)
def num_digits(k): c = 0 while k > 0: c += 1 k /= 10 return c def is_kaprekar(k): k2 = pow(k, 2) p10ndk = pow(10, num_digits(k)) if k == k2 // p10ndk + k2 % p10ndk: return True else: return False if __name__ == '__main__': for k in range(1, 1001): if is_kaprekar(k): print(k)
def decorating_fun(func): def wrapping_function(): print("this is wrapping function and get func start") func() print("func end") return wrapping_function @decorating_fun def decorated_func(): print("i`m decoraed") decorated_func()
def decorating_fun(func): def wrapping_function(): print('this is wrapping function and get func start') func() print('func end') return wrapping_function @decorating_fun def decorated_func(): print('i`m decoraed') decorated_func()
class CannotAssignValueFromParentCategory(Exception): def __init__(self): super().__init__("422 Cannot assign value from parent category")
class Cannotassignvaluefromparentcategory(Exception): def __init__(self): super().__init__('422 Cannot assign value from parent category')
# read file f=open("funny.txt","r") for line in f: print(line) f.close() # readlines() f=open("funny.txt","r") lines = f.readlines() print(lines) # write file f=open("love.txt","w") f.write("I love python") f.close() # same file when you write i love javascript the previous line goes away f=open("love.txt","w") f.write("I love javascript") f.close() # You can use append mode to stop having previous lines overwritten f=open("love.txt","a") f.write("I love javascript") f.close() # show a picture of file open modes (12:12 in old video) # writelines f=open("love.txt","w") f.writelines(["I love C++\n","I love scala"]) f.close() # with statement with open("funny.txt","r") as f: for line in f: print(line) # https://www.cricketworldcup.com/teams/india/players/107 player_scores = {} with open("scores.csv","r") as f: for line in f: tokens = line.split(',') player = tokens[0] score = int(tokens[1]) if player in player_scores: player_scores[player].append(score) else: player_scores[player] = [score] print(player_scores) for player, score_list in player_scores.items(): min_score=min(score_list) max_score=max(score_list) avg_score=sum(score_list)/len(score_list) print(f"{player}==>Min:{min_score}, Max:{max_score}, Avg:{avg_score}")
f = open('funny.txt', 'r') for line in f: print(line) f.close() f = open('funny.txt', 'r') lines = f.readlines() print(lines) f = open('love.txt', 'w') f.write('I love python') f.close() f = open('love.txt', 'w') f.write('I love javascript') f.close() f = open('love.txt', 'a') f.write('I love javascript') f.close() f = open('love.txt', 'w') f.writelines(['I love C++\n', 'I love scala']) f.close() with open('funny.txt', 'r') as f: for line in f: print(line) player_scores = {} with open('scores.csv', 'r') as f: for line in f: tokens = line.split(',') player = tokens[0] score = int(tokens[1]) if player in player_scores: player_scores[player].append(score) else: player_scores[player] = [score] print(player_scores) for (player, score_list) in player_scores.items(): min_score = min(score_list) max_score = max(score_list) avg_score = sum(score_list) / len(score_list) print(f'{player}==>Min:{min_score}, Max:{max_score}, Avg:{avg_score}')
def get_first_matching_attr(obj, *attrs, default=None): for attr in attrs: if hasattr(obj, attr): return getattr(obj, attr) return default def get_error_message(exc) -> str: if hasattr(exc, 'message_dict'): return exc.message_dict error_msg = get_first_matching_attr(exc, 'message', 'messages') if isinstance(error_msg, list): error_msg = ', '.join(error_msg) if error_msg is None: error_msg = str(exc) return error_msg
def get_first_matching_attr(obj, *attrs, default=None): for attr in attrs: if hasattr(obj, attr): return getattr(obj, attr) return default def get_error_message(exc) -> str: if hasattr(exc, 'message_dict'): return exc.message_dict error_msg = get_first_matching_attr(exc, 'message', 'messages') if isinstance(error_msg, list): error_msg = ', '.join(error_msg) if error_msg is None: error_msg = str(exc) return error_msg
c = input().strip() fr = input().split() n = 0 for i in fr: if c in i: n += 1 print('{:.1f}'.format(n*100/len(fr)))
c = input().strip() fr = input().split() n = 0 for i in fr: if c in i: n += 1 print('{:.1f}'.format(n * 100 / len(fr)))
# Copyright 2021 Huawei Technologies Co., Ltd # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software # distributed under the License is distributed on an "AS IS" BASIS, # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. # See the License for the specific language governing permissions and # limitations under the License. _base_ = [ '../_base_/models/mask_rcnn_r50_fpn.py', '../_base_/datasets/coco_instance.py', '../_base_/schedules/schedule_1x.py', '../_base_/default_runtime.py' ] model = dict( rpn_head=dict( anchor_generator=dict(type='LegacyAnchorGenerator', center_offset=0.5), bbox_coder=dict(type='LegacyDeltaXYWHBBoxCoder'), loss_bbox=dict(type='SmoothL1Loss', beta=1.0 / 9.0, loss_weight=1.0)), roi_head=dict( bbox_roi_extractor=dict( type='SingleRoIExtractor', roi_layer=dict( type='RoIAlign', output_size=7, sampling_ratio=2, aligned=False)), mask_roi_extractor=dict( type='SingleRoIExtractor', roi_layer=dict( type='RoIAlign', output_size=14, sampling_ratio=2, aligned=False)), bbox_head=dict( bbox_coder=dict(type='LegacyDeltaXYWHBBoxCoder'), loss_bbox=dict(type='SmoothL1Loss', beta=1.0, loss_weight=1.0)))) # model training and testing settings train_cfg = dict( rpn_proposal=dict(nms_post=2000, max_num=2000), rcnn=dict(assigner=dict(match_low_quality=True)))
_base_ = ['../_base_/models/mask_rcnn_r50_fpn.py', '../_base_/datasets/coco_instance.py', '../_base_/schedules/schedule_1x.py', '../_base_/default_runtime.py'] model = dict(rpn_head=dict(anchor_generator=dict(type='LegacyAnchorGenerator', center_offset=0.5), bbox_coder=dict(type='LegacyDeltaXYWHBBoxCoder'), loss_bbox=dict(type='SmoothL1Loss', beta=1.0 / 9.0, loss_weight=1.0)), roi_head=dict(bbox_roi_extractor=dict(type='SingleRoIExtractor', roi_layer=dict(type='RoIAlign', output_size=7, sampling_ratio=2, aligned=False)), mask_roi_extractor=dict(type='SingleRoIExtractor', roi_layer=dict(type='RoIAlign', output_size=14, sampling_ratio=2, aligned=False)), bbox_head=dict(bbox_coder=dict(type='LegacyDeltaXYWHBBoxCoder'), loss_bbox=dict(type='SmoothL1Loss', beta=1.0, loss_weight=1.0)))) train_cfg = dict(rpn_proposal=dict(nms_post=2000, max_num=2000), rcnn=dict(assigner=dict(match_low_quality=True)))
raw_data = [ b'\x1cT#01 61.01,\r\nT#03 88.07,90.78,90.17,29.48,14.41\r\n \r\n \xae$\xe2\x02\xe0D\x143P\x02\xe0', b'T#01 56.92,\r\nT#03 88.10,90.62,90.42,29.68,14.39\r\n \r\n C \xfc', b'T#01 63.51,\r\nT#03 87.98,90.36,90.15,29.30,14.41\r\n \r\n \x03\x82\x01\x80$\x9f\xd8\xbc\x0f\x08', b'T#01 56.05,\r\nT#03 87.99,90.66,90.52,29.00,14.40\r\n \r\n \x080"', b'T#01 59.20,\r\nT#03 88.17,91.09,90.62,28.79,14.41\r\n \r\n \x803\x06\x18\xf8', b'T#01 52.21,\r\nT#03 87.93,90.57,90.56,28.65,14.40\r\n \r\n \xf83\x0b\x1c', b'T#01 49.17,\r\nT#03 87.75,90.50,90.40,28.24,14.41\r\n \r\n :\x02@\x8c\x06', b'T#01 45.93,\r\nT#03 87.86,91.08,90.75,27.81,14.42\r\n \r\n \x01\x80\xa1s\x86\xe7\x03\xfc', b'T#01 50.86,\r\nT#03 87.79,90.61,90.53,27.23,14.43\r\n \r\n \x86\x16 \x80\xf0\xc7\xf2\xc0', b'\x1e\x80\xf8T#01 47.12,\r\nT#03 87.54,90.59,90.41,26.66,14.42\r\n \r\n \xf1\x17a\x80\x02\xfe', b'T#01 50.26,\r\nT#03 87.60,90.97,90.42,26.95,14.40\r\n \r\n \xc0\xf3[\xd3\x81\xfc9\xf5\xb8\x06\x80\xfe', b'T#01 57.21,\r\nT#03 87.64,90.55,90.13,25.40,14.42\r\n \r\n \x04\x08\x93\x98\xd9\xfc', b'T#01 54.55,\r\nT#03 87.86,90.88,90.43,25.55,14.40\r\n \r\n \x01\x80\t\x18\xc6!`\xfe', b'#01 53.39,\r\nT#03 87.89,90.84,90.12,25.71,14.41\r\n \r\n \x01(\x12 \xfe', b'T#01 52.59,\r\nT#03 88.06,90.75,90.29,26.29,14.40\r\n \r\n \xf2\x83l\x1e<\x90\x04', b'\xfeT#01 54.47,\r\nT#03 87.93,90.83,90.04,26.48,14.41\r\n \r\n k|^y\xfe', b'T#01 55.85,\r\nT#03 87.83,90.89,90.51,26.45,14.42\r\n \r\n \xc4\xd6>4\xfa', b'T#01 52.55,\r\nT#03 87.59,90.84,90.53,25.37,14.42\r\n \r\n \x02:\\@\x84G\x01\x84', b'T#01 54.72,\r\nT#03 87.76,90.86,90.25,25.36,14.40\r\n \r\n \x90\x80B\xc8;\x80\x0e\x80', b'T#01 54.70,\r\nT#03 87.78,90.64,90.08,25.54,14.40\r\n \r\n \x88P\xc2\x06', b'T#01 55.10,\r\nT#03 87.96,90.90,90.54,26.46,14.41\r\n \r\n @\xf0kT\xfc', b'T#01 53.83,\r\nT#03 87.90,90.91,90.32,25.77,14.42\r\n \r\n \x12\x0e"\xf2 \xbb\x0f\x80', b'T#01 54.64,\r\nT#03 87.99,90.50,90.26,26.15,14.43\r\n \r\n ', b'T#01 53.13,\r\nT#03 87.85,91.07,90.40,25.94,14.43\r\n \r\n \x80\xf8', b'T#01 60.26,\r\nT#03 87.62,91.09,90.31,25.16,14.42\r\n \r\n \x18A\x04', b'T#01 56.29,\r\nT#03 87.71,91.03,90.17,24.70,14.40\r\n \r\n "\xc8H\xc0', b'T#01 66.20,\r\nT#03 87.77,91.03,90.26,24.44,14.40\r\n \r\n ', b'T#01 57.08,\r\nT#03 87.82,91.13,90.22,24.22,14.40\r\n \r\n \x01\x02\x80@\x04', b'T#01 61.81,\r\nT#03 87.69,91.07,90.28,24.03,14.40\r\n \r\n \xf3', b'T#01 59.01,\r\nT#03 87.73,90.70,90.07,23.99,14.42\r\n \r\n @\xfc', b'T#01 56.05,\r\nT#03 87.69,91.02,90.36,24.32,14.40\r\n \r\n \xa0\x8f\x0b\x07\x01', b'T#01 63.64,\r\nT#03 87.72,90.99,90.34,24.45,14.41\r\nT#01 64.58,\r\n \r\n \xfe', b'\xfcT#01 67.45,\r\nT#03 87.80,90.83,90.22,24.52,14.42\r\n \r\n \x02\x04\xfe ,@\xa3\x03', b'T#01 60.04,\r\nT#03 87.69,90.80,90.57,24.98,14.41\r\n \r\n \xe0\x01\x14', b'T#01 59.57,\r\nT#03 87.72,90.96,90.57,25.91,14.42\r\n \r\n \x01\xe4s\xe10D\x03\xe0', b'T#01 61.67,\r\nT#03 87.73,91.05,90.40,26.04,14.42\r\n \r\n \xe0\xfa\xe2\xc8\x84\x1e', b'\x12\xf8T#01 85.78,\r\nT#03 87.71,91.21,90.41,25.67,14.39\r\n \r\n 2\x011\x95\x89\x80\r\xf0', b'T#01 69.74,\r\nT#03 87.91,90.97,90.49,25.24,14.42\r\n \r\n \xf0', b'T#01 65.01,\r\nT#03 87.93,90.61,90.60,25.28,14.41\r\n \r\n \x01\xf3HB', b'T#01 63.63,\r\nT#03 87.97,90.90,90.92,26.12,14.40\r\n \r\n \xfe', b'T#01 61.84,\r\nT#03 88.17,91.13,90.78,26.92,14.42\r\n \r\n \x80H\xf0', b'T#01 65.72,\r\nT#03 87.72,90.93,90.51,26.14,14.40\r\n \r\n \xfe1\x8e', b'T#01 61.01,\r\nT#03 87.61,90.94,90.65,25.93,14.40\r\n \r\n \x02\x1cH\xe0', b'T#01 60.10,\r\nT#03 87.62,90.97,90.60,25.87,14.39\r\n \r\n \xf1', b'T#01 61.83,\r\nT#03 87.83,91.03,90.29,25.60,14.43\r\n \r\n \xf8\xe8', b'T#01 65.53,\r\nT#03 88.13,90.71,90.49,25.44,14.42\r\n \r\n \xc7a"\x12\x04', b'T#01 67.88,\r\nT#03 87.83,91.02,90.20,25.28,14.42\r\n \r\n 0\x07@\x12D', b'T#01 77.61,\r\nT#03 87.68,91.06,90.27,24.85,14.42\r\n \r\n \x800\xfb\x02\xdc\x03\x01\x1e', b'T#01 67.28,\r\nT#03 87.94,91.08,90.61,24.95,14.40\r\n \r\n \xc0|\xdb\xe8g<', b'T#01 63.90,\r\nT#03 87.86,90.98,90.53,24.97,14.43\r\n \r\n \xc7\x02\x80', b'T#01 60.11,\r\nT#03 87.76,90.91,90.52,25.06,14.40\r\n \r\n ', b'T#01 66.12,\r\nT#03 87.65,90.85,90.69,25.25,14.42\r\n \r\n \xe0\x02\x80X\t\x04@', b'T#01 71.97,\r\nT#03 87.81,90.91,90.32,25.65,14.42\r\n \r\n \xc8\x06\x047', b'T#01 66.58,\r\nT#03 87.79,91.06,90.35,25.46,14.43\r\n \r\n `\x80\x88\xa4\xfc', b'T#01 58.96,\r\nT#03 87.32,90.92,90.27,25.17,14.39\r\n \r\n \x08\xfa', b'T#01 58.30,\r\nT#03 87.23,90.91,90.43,24.80,14.41\r\n \r\n ', b'T#01 56.55,\r\nT#03 87.35,90.98,90.50,24.71,14.39\r\n \r\n \xf8<-\x0c', b'T#01 58.05,\r\nT#03 87.40,90.91,90.18,24.76,14.41\r\n \r\n \x05', b'T#01 76.65,\r\nT#03 87.64,91.03,90.22,24.38,14.42\r\n \r\n `\x81\xc2\xc0#\x0c\x1c', b'T#01 65.58,\r\nT#03 87.69,90.56,90.21,24.26,14.40\r\n \r\n \xc8', b'T#01 62.54,\r\nT#03 87.65,90.73,90.48,24.64,14.42\r\n \r\n \x0e7\x124\r\xfe', b'T#01 62.07,\r\nT#03 87.48,90.98,90.17,25.01,14.42\r\n \r\n \x80\xfea\x92\xc4\xae', b'T#01 63.46,\r\nT#03 87.52,91.04,90.37,24.83,14.40\r\n \r\n \x80\xc0', b'T#01 60.82,\r\nT#03 87.18,90.87,90.26,24.67,14.39\r\n \r\n \x03?h\x04\xb1\x98\t\x80\x0f\x81\x01\x80', b'T#01 54.87,\r\nT#03 87.27,90.85,90.50,24.82,14.41\r\n \r\n \xfc(\x04B\x1c\xf0', b'T#01 73.36,\r\nT#03 87.56,90\xfc\x04\x01\x12\x12\xf5\x1e0\x01\x80', b'T#01 71.44,\r\nT#03 87.76,91.00,90.31,24.82,14.14\r\n \r\n \xc0t', b'T#01 64.59,\r\nT#03 87.24,91.05,90.08,24.17,14.42\r\n \r\n \x02\xe0', b'T#01 72.30,\r\nT#03 87.32,91.08,90.14,23.47,14.42\r\n \r\n @H\x80\x01\xa0\x19\x15\x03', b'T#01 65.38,\r\nT#03 87.48,90.94,90.24,23.25,14.44\r\n \r\n \x03\x10\x06\x85l0\x18', b'T#01 64.02,\r\nT#03 87.45,90.98,90.18,22.97,14.42\r\n \r\n \x80\xfe\x1b', b'\x01\xf9T#01 87.72,\r\nT#03 87.60,91.12,90.06,22.60,14.27\r\n \r\n \x80\xf8\x8c\x10\x8b', b'T#01 80.09,\r\nT#03 87.47,91.07,89.97,22.08,14.09\r\nT#01 86.17,\r\nT#03 87.47,91.09,90.05,21.94,14.04\r\n \r\n \xfcM\x06D\x06', b'T#01 67.42,\r\nT#03 87.45,91.03,90.00,21.38,14.42\r\n \r\n \xfd9P\x0c\\\x04', b'T#01 72.79,\r\nT#03 87.40,91.07,90.09,20.90,14.13\r\n \r\n \xc1\x03', b'T#01 72.22,\r\nT#03 87.66,91.27,90.00,20.44,13.91\r\n \r\n \x10\x10\x80\x0c\xd0t\xc4\x17\x0c\x80', b'T#01 71.30,\r\nT#03 87.56,91.18,90.11,20.04,13.76\r\n \r\n \x01\xea', b'T#01 83.55,\r\nT#03 87.52,90.96,89.86,19.28,13.64\r\n \r\n \xf4', b'T#01 77.06,\r\nT#03 87.75,91.30,90.21,18.97,13.49\r\n \r\n \xa0\x8a&\x02', b'T#01 79.01,\r\nT#03 87.55,91.02,90.12,18.57,13.39\r\n \r\n \x0c\x03\x03\xc0\xe1\x80 \xfc', b'T#01 91.21,\r\nT#03 87.67,91.03,90.01,18.39,13.28\r\n \r\n \xe6\x19\xd0\x01\xd0', b'T#01 89.87,\r\nT#03 88.16,91.20,90.12,18.07,13.16\r\n \r\n \xe0\xc4\x90\xc2\x03\xf0', b'T#01 89.64,\r\nT#03 87.91,90.82,89.80,17.45,13.08\r\n \r\n \x02\x02\x13\xc0c\xc8\x19\xfc', b'T#01 88.11,\r\nT#03 87.94,90.98,89.85,17.33,13.01\r\n \r\n \x80\r\x18\xfe', b'T#01 89.66,\r\nT#03 87.88,91.42,89.75,17.03,12.96\r\n \r\n \xc0x\x80\x08\xbd\x0f', b'T#01 92.55,\r\nT#03 87.94,90.80,89.64,16.70,12.93\r\n \r\n \xfev\xa9\x04', b'T#01 88.17,\r\nT#03 87.94,91.15,89.74,16.60,12.93\r\n \r\n \x050\x89\xc1\x81\xe7V\x06&', b'T#01 92.07,\r\nT#03 87.76,90.92,89.62,16.64,12.93\r\n \r\n \xfc\x01<\xe0\x08\x04', b'T#01 89.57,\r\nT#03 87.67,90.97,89.57,16.57,12.93\r\n \r\n \x01"\x80\x04\xfe', b'T#01 88.74,\r\nT#03 88.18,91.11,90.09,16.61,12.93\r\n \r\n \x03\x060\xfe\x8f\x97\x0e\x170\x01\xc0', b'T#01 88.81,\r\nT#03 87.98,90.89,89.86,16.19,12.95\r\n \r\n \xf0\x85\x0e8\xe8\x03', b'T#01 95.93,\r\nT#03 87.88,90.96,90.01,16.06,12.96\r\n \r\n \xfa', b'\xf8T#01 92.55,\r\nT#03 87.87,90.92,90.17,15.88,12.96\r\n \r\n \xc9\x08,', b'T#01 93.25,\r\nT#03 87.74,90.88,89.86,15.81,12.96\r\n \r\n \xfe%m\x03\x91\x0f', b'\x0c\xc0T#01 94.89,\r\nT#03 87.81,91.07,89.78,15.67,12.96\r\n \r\n \x01\xfa0\x08', b'T#01 92.07,\r\nT#03 87.87,90.94,89.96,15.63,12.96\r\n \r\n \xfe\x0b\xe0\xc3', b'T#01 97.30,\r\nT#03 87.75,91.06,90.04,15.38,12.96\r\n \r\n \x02@', b'T#01 95.69,\r\nT#03 87.68,91.04,89.88,15.24,12.96\r\n \r\n \x900\xe4', b'T#01 95.21,\r\nT#03 87.78,90.99,89.73,15.18,12.96\r\n \r\n C\xfe\x1cD\n\x89\x81', b'T#01 91.75,\r\nT#03 87.90,90.96,89.65,15.18,12.96\r\n \r\n @\xf2,A', ] clean_data = [ [['61.01', ], ], [['56.92', ], ], [['63.51', ], ], [['56.05', ], ], [['59.20', ], ], [['52.21', ], ], [['49.17', ], ], [['45.93', ], ], [['50.86', ], ], [['47.12', ], ], [['50.26', ], ], [['57.21', ], ], [['54.55', ], ], [['53.39', ], ], [['52.59', ], ], [['54.47', ], ], [['55.85', ], ], [['52.55', ], ], [['54.72', ], ], [['54.70', ], ], [['55.10', ], ], [['53.83', ], ], [['54.64', ], ], [['53.13', ], ], [['60.26', ], ], [['56.29', ], ], [['66.20', ], ], [['57.08', ], ], [['61.81', ], ], [['59.01', ], ], [['56.05', ], ], [['63.64', ], ['64.58', ], ], [['67.45', ], ], [['60.04', ], ], [['59.57', ], ], [['61.67', ], ], [['85.78', ], ], [['69.74', ], ], [['65.01', ], ], [['63.63', ], ], [['61.84', ], ], [['65.72', ], ], [['61.01', ], ], [['60.10', ], ], [['61.83', ], ], [['65.53', ], ], [['67.88', ], ], [['77.61', ], ], [['67.28', ], ], [['63.90', ], ], [['60.11', ], ], [['66.12', ], ], [['71.97', ], ], [['66.58', ], ], [['58.96', ], ], [['58.30', ], ], [['56.55', ], ], [['58.05', ], ], [['76.65', ], ], [['65.58', ], ], [['62.54', ], ], [['62.07', ], ], [['63.46', ], ], [['60.82', ], ], [['54.87', ], ], [['73.36', ], ], [['71.44', ], ], [['64.59', ], ], [['72.30', ], ], [['65.38', ], ], [['64.02', ], ], [['87.72', ], ], [['80.09', ], ['86.17', ], ], [['67.42', ], ], [['72.79', ], ], [['72.22', ], ], [['71.30', ], ], [['83.55', ], ], [['77.06', ], ], [['79.01', ], ], [['91.21', ], ], [['89.87', ], ], [['89.64', ], ], [['88.11', ], ], [['89.66', ], ], [['92.55', ], ], [['88.17', ], ], [['92.07', ], ], [['89.57', ], ], [['88.74', ], ], [['88.81', ], ], [['95.93', ], ], [['92.55', ], ], [['93.25', ], ], [['94.89', ], ], [['92.07', ], ], [['97.30', ], ], [['95.69', ], ], [['95.21', ], ], [['91.75', ], ], ]
raw_data = [b'\x1cT#01 61.01,\r\nT#03 88.07,90.78,90.17,29.48,14.41\r\n \r\n \xae$\xe2\x02\xe0D\x143P\x02\xe0', b'T#01 56.92,\r\nT#03 88.10,90.62,90.42,29.68,14.39\r\n \r\n C \xfc', b'T#01 63.51,\r\nT#03 87.98,90.36,90.15,29.30,14.41\r\n \r\n \x03\x82\x01\x80$\x9f\xd8\xbc\x0f\x08', b'T#01 56.05,\r\nT#03 87.99,90.66,90.52,29.00,14.40\r\n \r\n \x080"', b'T#01 59.20,\r\nT#03 88.17,91.09,90.62,28.79,14.41\r\n \r\n \x803\x06\x18\xf8', b'T#01 52.21,\r\nT#03 87.93,90.57,90.56,28.65,14.40\r\n \r\n \xf83\x0b\x1c', b'T#01 49.17,\r\nT#03 87.75,90.50,90.40,28.24,14.41\r\n \r\n :\x02@\x8c\x06', b'T#01 45.93,\r\nT#03 87.86,91.08,90.75,27.81,14.42\r\n \r\n \x01\x80\xa1s\x86\xe7\x03\xfc', b'T#01 50.86,\r\nT#03 87.79,90.61,90.53,27.23,14.43\r\n \r\n \x86\x16 \x80\xf0\xc7\xf2\xc0', b'\x1e\x80\xf8T#01 47.12,\r\nT#03 87.54,90.59,90.41,26.66,14.42\r\n \r\n \xf1\x17a\x80\x02\xfe', b'T#01 50.26,\r\nT#03 87.60,90.97,90.42,26.95,14.40\r\n \r\n \xc0\xf3[\xd3\x81\xfc9\xf5\xb8\x06\x80\xfe', b'T#01 57.21,\r\nT#03 87.64,90.55,90.13,25.40,14.42\r\n \r\n \x04\x08\x93\x98\xd9\xfc', b'T#01 54.55,\r\nT#03 87.86,90.88,90.43,25.55,14.40\r\n \r\n \x01\x80\t\x18\xc6!`\xfe', b'#01 53.39,\r\nT#03 87.89,90.84,90.12,25.71,14.41\r\n \r\n \x01(\x12 \xfe', b'T#01 52.59,\r\nT#03 88.06,90.75,90.29,26.29,14.40\r\n \r\n \xf2\x83l\x1e<\x90\x04', b'\xfeT#01 54.47,\r\nT#03 87.93,90.83,90.04,26.48,14.41\r\n \r\n k|^y\xfe', b'T#01 55.85,\r\nT#03 87.83,90.89,90.51,26.45,14.42\r\n \r\n \xc4\xd6>4\xfa', b'T#01 52.55,\r\nT#03 87.59,90.84,90.53,25.37,14.42\r\n \r\n \x02:\\@\x84G\x01\x84', b'T#01 54.72,\r\nT#03 87.76,90.86,90.25,25.36,14.40\r\n \r\n \x90\x80B\xc8;\x80\x0e\x80', b'T#01 54.70,\r\nT#03 87.78,90.64,90.08,25.54,14.40\r\n \r\n \x88P\xc2\x06', b'T#01 55.10,\r\nT#03 87.96,90.90,90.54,26.46,14.41\r\n \r\n @\xf0kT\xfc', b'T#01 53.83,\r\nT#03 87.90,90.91,90.32,25.77,14.42\r\n \r\n \x12\x0e"\xf2 \xbb\x0f\x80', b'T#01 54.64,\r\nT#03 87.99,90.50,90.26,26.15,14.43\r\n \r\n ', b'T#01 53.13,\r\nT#03 87.85,91.07,90.40,25.94,14.43\r\n \r\n \x80\xf8', b'T#01 60.26,\r\nT#03 87.62,91.09,90.31,25.16,14.42\r\n \r\n \x18A\x04', b'T#01 56.29,\r\nT#03 87.71,91.03,90.17,24.70,14.40\r\n \r\n "\xc8H\xc0', b'T#01 66.20,\r\nT#03 87.77,91.03,90.26,24.44,14.40\r\n \r\n ', b'T#01 57.08,\r\nT#03 87.82,91.13,90.22,24.22,14.40\r\n \r\n \x01\x02\x80@\x04', b'T#01 61.81,\r\nT#03 87.69,91.07,90.28,24.03,14.40\r\n \r\n \xf3', b'T#01 59.01,\r\nT#03 87.73,90.70,90.07,23.99,14.42\r\n \r\n @\xfc', b'T#01 56.05,\r\nT#03 87.69,91.02,90.36,24.32,14.40\r\n \r\n \xa0\x8f\x0b\x07\x01', b'T#01 63.64,\r\nT#03 87.72,90.99,90.34,24.45,14.41\r\nT#01 64.58,\r\n \r\n \xfe', b'\xfcT#01 67.45,\r\nT#03 87.80,90.83,90.22,24.52,14.42\r\n \r\n \x02\x04\xfe ,@\xa3\x03', b'T#01 60.04,\r\nT#03 87.69,90.80,90.57,24.98,14.41\r\n \r\n \xe0\x01\x14', b'T#01 59.57,\r\nT#03 87.72,90.96,90.57,25.91,14.42\r\n \r\n \x01\xe4s\xe10D\x03\xe0', b'T#01 61.67,\r\nT#03 87.73,91.05,90.40,26.04,14.42\r\n \r\n \xe0\xfa\xe2\xc8\x84\x1e', b'\x12\xf8T#01 85.78,\r\nT#03 87.71,91.21,90.41,25.67,14.39\r\n \r\n 2\x011\x95\x89\x80\r\xf0', b'T#01 69.74,\r\nT#03 87.91,90.97,90.49,25.24,14.42\r\n \r\n \xf0', b'T#01 65.01,\r\nT#03 87.93,90.61,90.60,25.28,14.41\r\n \r\n \x01\xf3HB', b'T#01 63.63,\r\nT#03 87.97,90.90,90.92,26.12,14.40\r\n \r\n \xfe', b'T#01 61.84,\r\nT#03 88.17,91.13,90.78,26.92,14.42\r\n \r\n \x80H\xf0', b'T#01 65.72,\r\nT#03 87.72,90.93,90.51,26.14,14.40\r\n \r\n \xfe1\x8e', b'T#01 61.01,\r\nT#03 87.61,90.94,90.65,25.93,14.40\r\n \r\n \x02\x1cH\xe0', b'T#01 60.10,\r\nT#03 87.62,90.97,90.60,25.87,14.39\r\n \r\n \xf1', b'T#01 61.83,\r\nT#03 87.83,91.03,90.29,25.60,14.43\r\n \r\n \xf8\xe8', b'T#01 65.53,\r\nT#03 88.13,90.71,90.49,25.44,14.42\r\n \r\n \xc7a"\x12\x04', b'T#01 67.88,\r\nT#03 87.83,91.02,90.20,25.28,14.42\r\n \r\n 0\x07@\x12D', b'T#01 77.61,\r\nT#03 87.68,91.06,90.27,24.85,14.42\r\n \r\n \x800\xfb\x02\xdc\x03\x01\x1e', b'T#01 67.28,\r\nT#03 87.94,91.08,90.61,24.95,14.40\r\n \r\n \xc0|\xdb\xe8g<', b'T#01 63.90,\r\nT#03 87.86,90.98,90.53,24.97,14.43\r\n \r\n \xc7\x02\x80', b'T#01 60.11,\r\nT#03 87.76,90.91,90.52,25.06,14.40\r\n \r\n ', b'T#01 66.12,\r\nT#03 87.65,90.85,90.69,25.25,14.42\r\n \r\n \xe0\x02\x80X\t\x04@', b'T#01 71.97,\r\nT#03 87.81,90.91,90.32,25.65,14.42\r\n \r\n \xc8\x06\x047', b'T#01 66.58,\r\nT#03 87.79,91.06,90.35,25.46,14.43\r\n \r\n `\x80\x88\xa4\xfc', b'T#01 58.96,\r\nT#03 87.32,90.92,90.27,25.17,14.39\r\n \r\n \x08\xfa', b'T#01 58.30,\r\nT#03 87.23,90.91,90.43,24.80,14.41\r\n \r\n ', b'T#01 56.55,\r\nT#03 87.35,90.98,90.50,24.71,14.39\r\n \r\n \xf8<-\x0c', b'T#01 58.05,\r\nT#03 87.40,90.91,90.18,24.76,14.41\r\n \r\n \x05', b'T#01 76.65,\r\nT#03 87.64,91.03,90.22,24.38,14.42\r\n \r\n `\x81\xc2\xc0#\x0c\x1c', b'T#01 65.58,\r\nT#03 87.69,90.56,90.21,24.26,14.40\r\n \r\n \xc8', b'T#01 62.54,\r\nT#03 87.65,90.73,90.48,24.64,14.42\r\n \r\n \x0e7\x124\r\xfe', b'T#01 62.07,\r\nT#03 87.48,90.98,90.17,25.01,14.42\r\n \r\n \x80\xfea\x92\xc4\xae', b'T#01 63.46,\r\nT#03 87.52,91.04,90.37,24.83,14.40\r\n \r\n \x80\xc0', b'T#01 60.82,\r\nT#03 87.18,90.87,90.26,24.67,14.39\r\n \r\n \x03?h\x04\xb1\x98\t\x80\x0f\x81\x01\x80', b'T#01 54.87,\r\nT#03 87.27,90.85,90.50,24.82,14.41\r\n \r\n \xfc(\x04B\x1c\xf0', b'T#01 73.36,\r\nT#03 87.56,90\xfc\x04\x01\x12\x12\xf5\x1e0\x01\x80', b'T#01 71.44,\r\nT#03 87.76,91.00,90.31,24.82,14.14\r\n \r\n \xc0t', b'T#01 64.59,\r\nT#03 87.24,91.05,90.08,24.17,14.42\r\n \r\n \x02\xe0', b'T#01 72.30,\r\nT#03 87.32,91.08,90.14,23.47,14.42\r\n \r\n @H\x80\x01\xa0\x19\x15\x03', b'T#01 65.38,\r\nT#03 87.48,90.94,90.24,23.25,14.44\r\n \r\n \x03\x10\x06\x85l0\x18', b'T#01 64.02,\r\nT#03 87.45,90.98,90.18,22.97,14.42\r\n \r\n \x80\xfe\x1b', b'\x01\xf9T#01 87.72,\r\nT#03 87.60,91.12,90.06,22.60,14.27\r\n \r\n \x80\xf8\x8c\x10\x8b', b'T#01 80.09,\r\nT#03 87.47,91.07,89.97,22.08,14.09\r\nT#01 86.17,\r\nT#03 87.47,91.09,90.05,21.94,14.04\r\n \r\n \xfcM\x06D\x06', b'T#01 67.42,\r\nT#03 87.45,91.03,90.00,21.38,14.42\r\n \r\n \xfd9P\x0c\\\x04', b'T#01 72.79,\r\nT#03 87.40,91.07,90.09,20.90,14.13\r\n \r\n \xc1\x03', b'T#01 72.22,\r\nT#03 87.66,91.27,90.00,20.44,13.91\r\n \r\n \x10\x10\x80\x0c\xd0t\xc4\x17\x0c\x80', b'T#01 71.30,\r\nT#03 87.56,91.18,90.11,20.04,13.76\r\n \r\n \x01\xea', b'T#01 83.55,\r\nT#03 87.52,90.96,89.86,19.28,13.64\r\n \r\n \xf4', b'T#01 77.06,\r\nT#03 87.75,91.30,90.21,18.97,13.49\r\n \r\n \xa0\x8a&\x02', b'T#01 79.01,\r\nT#03 87.55,91.02,90.12,18.57,13.39\r\n \r\n \x0c\x03\x03\xc0\xe1\x80 \xfc', b'T#01 91.21,\r\nT#03 87.67,91.03,90.01,18.39,13.28\r\n \r\n \xe6\x19\xd0\x01\xd0', b'T#01 89.87,\r\nT#03 88.16,91.20,90.12,18.07,13.16\r\n \r\n \xe0\xc4\x90\xc2\x03\xf0', b'T#01 89.64,\r\nT#03 87.91,90.82,89.80,17.45,13.08\r\n \r\n \x02\x02\x13\xc0c\xc8\x19\xfc', b'T#01 88.11,\r\nT#03 87.94,90.98,89.85,17.33,13.01\r\n \r\n \x80\r\x18\xfe', b'T#01 89.66,\r\nT#03 87.88,91.42,89.75,17.03,12.96\r\n \r\n \xc0x\x80\x08\xbd\x0f', b'T#01 92.55,\r\nT#03 87.94,90.80,89.64,16.70,12.93\r\n \r\n \xfev\xa9\x04', b'T#01 88.17,\r\nT#03 87.94,91.15,89.74,16.60,12.93\r\n \r\n \x050\x89\xc1\x81\xe7V\x06&', b'T#01 92.07,\r\nT#03 87.76,90.92,89.62,16.64,12.93\r\n \r\n \xfc\x01<\xe0\x08\x04', b'T#01 89.57,\r\nT#03 87.67,90.97,89.57,16.57,12.93\r\n \r\n \x01"\x80\x04\xfe', b'T#01 88.74,\r\nT#03 88.18,91.11,90.09,16.61,12.93\r\n \r\n \x03\x060\xfe\x8f\x97\x0e\x170\x01\xc0', b'T#01 88.81,\r\nT#03 87.98,90.89,89.86,16.19,12.95\r\n \r\n \xf0\x85\x0e8\xe8\x03', b'T#01 95.93,\r\nT#03 87.88,90.96,90.01,16.06,12.96\r\n \r\n \xfa', b'\xf8T#01 92.55,\r\nT#03 87.87,90.92,90.17,15.88,12.96\r\n \r\n \xc9\x08,', b'T#01 93.25,\r\nT#03 87.74,90.88,89.86,15.81,12.96\r\n \r\n \xfe%m\x03\x91\x0f', b'\x0c\xc0T#01 94.89,\r\nT#03 87.81,91.07,89.78,15.67,12.96\r\n \r\n \x01\xfa0\x08', b'T#01 92.07,\r\nT#03 87.87,90.94,89.96,15.63,12.96\r\n \r\n \xfe\x0b\xe0\xc3', b'T#01 97.30,\r\nT#03 87.75,91.06,90.04,15.38,12.96\r\n \r\n \x02@', b'T#01 95.69,\r\nT#03 87.68,91.04,89.88,15.24,12.96\r\n \r\n \x900\xe4', b'T#01 95.21,\r\nT#03 87.78,90.99,89.73,15.18,12.96\r\n \r\n C\xfe\x1cD\n\x89\x81', b'T#01 91.75,\r\nT#03 87.90,90.96,89.65,15.18,12.96\r\n \r\n @\xf2,A'] clean_data = [[['61.01']], [['56.92']], [['63.51']], [['56.05']], [['59.20']], [['52.21']], [['49.17']], [['45.93']], [['50.86']], [['47.12']], [['50.26']], [['57.21']], [['54.55']], [['53.39']], [['52.59']], [['54.47']], [['55.85']], [['52.55']], [['54.72']], [['54.70']], [['55.10']], [['53.83']], [['54.64']], [['53.13']], [['60.26']], [['56.29']], [['66.20']], [['57.08']], [['61.81']], [['59.01']], [['56.05']], [['63.64'], ['64.58']], [['67.45']], [['60.04']], [['59.57']], [['61.67']], [['85.78']], [['69.74']], [['65.01']], [['63.63']], [['61.84']], [['65.72']], [['61.01']], [['60.10']], [['61.83']], [['65.53']], [['67.88']], [['77.61']], [['67.28']], [['63.90']], [['60.11']], [['66.12']], [['71.97']], [['66.58']], [['58.96']], [['58.30']], [['56.55']], [['58.05']], [['76.65']], [['65.58']], [['62.54']], [['62.07']], [['63.46']], [['60.82']], [['54.87']], [['73.36']], [['71.44']], [['64.59']], [['72.30']], [['65.38']], [['64.02']], [['87.72']], [['80.09'], ['86.17']], [['67.42']], [['72.79']], [['72.22']], [['71.30']], [['83.55']], [['77.06']], [['79.01']], [['91.21']], [['89.87']], [['89.64']], [['88.11']], [['89.66']], [['92.55']], [['88.17']], [['92.07']], [['89.57']], [['88.74']], [['88.81']], [['95.93']], [['92.55']], [['93.25']], [['94.89']], [['92.07']], [['97.30']], [['95.69']], [['95.21']], [['91.75']]]
# # @lc app=leetcode id=1299 lang=python3 # # [1299] Replace Elements with Greatest Element on Right Side # # @lc code=start class Solution: def replaceElements(self, arr: List[int]) -> List[int]: index = 0 result = [] for i,v in enumerate(arr): if i+1 == len(arr): result.append(-1) break result.append(max(arr[i+1:len(arr)])) index = index + 1 return result # @lc code=end
class Solution: def replace_elements(self, arr: List[int]) -> List[int]: index = 0 result = [] for (i, v) in enumerate(arr): if i + 1 == len(arr): result.append(-1) break result.append(max(arr[i + 1:len(arr)])) index = index + 1 return result
def rotate(cur_direction, rotation_command): # Assumes there are only R/L 90/180/270 invert_rl = { "R": "L", "L": "R", } if int(rotation_command[1:]) == 270: rotation_command = f"{invert_rl[rotation_command[0]]}90" elif int(rotation_command[1:]) == 180: flip = { "N": "S", "E": "W", "S": "N", "W": "E", } return flip[cur_direction] lookup = { "L90" : { "N": "W", "E": "N", "S": "E", "W": "S", }, "R90" : { "N": "E", "E": "S", "S": "W", "W": "N", }, } return lookup[rotation_command][cur_direction] def rotate_waypoint(x, y, rotation_command): # Assumes there are only R/L 90/180/270 invert_rl = { "R": "L", "L": "R", } if int(rotation_command[1:]) == 270: rotation_command = f"{invert_rl[rotation_command[0]]}90" elif int(rotation_command[1:]) == 180: return -1 * x, -1 * y if rotation_command == "L90": return -1 * y, x elif rotation_command == "R90": return y, -1 * x else: print(f"Invalid command: {rotation_command}") exit(-1) def shift_coords(curx, cury, command): n = int(command[1:]) offsets = { "N": (0, 1), "S": (0, -1), "W": (-1, 0), "E": (1, 0), } offx, offy = offsets[command[0]] return n * offx + curx, n * offy + cury class Ship: def __init__(self): self.direction = "E" self.x = 0 self.y = 0 def run_command(self, command): if "L" in command or "R" in command: self.direction = rotate(self.direction, command) else: command = command.replace("F", self.direction) self.x, self.y = shift_coords(self.x, self.y, command) def manhattan_dist(self): return abs(self.x) + abs(self.y) class ShipWithWaypoint: def __init__(self): self.x = 0 self.y = 0 self.waypoint_x = 10 self.waypoint_y = 1 def run_command(self, command): if "L" in command or "R" in command: self.waypoint_x, self.waypoint_y = rotate_waypoint(self.waypoint_x, self.waypoint_y, command) elif "F" in command: n = int(command[1:]) self.x += self.waypoint_x * n self.y += self.waypoint_y * n else: self.waypoint_x, self.waypoint_y = shift_coords(self.waypoint_x, self.waypoint_y, command) def manhattan_dist(self): return abs(self.x) + abs(self.y)
def rotate(cur_direction, rotation_command): invert_rl = {'R': 'L', 'L': 'R'} if int(rotation_command[1:]) == 270: rotation_command = f'{invert_rl[rotation_command[0]]}90' elif int(rotation_command[1:]) == 180: flip = {'N': 'S', 'E': 'W', 'S': 'N', 'W': 'E'} return flip[cur_direction] lookup = {'L90': {'N': 'W', 'E': 'N', 'S': 'E', 'W': 'S'}, 'R90': {'N': 'E', 'E': 'S', 'S': 'W', 'W': 'N'}} return lookup[rotation_command][cur_direction] def rotate_waypoint(x, y, rotation_command): invert_rl = {'R': 'L', 'L': 'R'} if int(rotation_command[1:]) == 270: rotation_command = f'{invert_rl[rotation_command[0]]}90' elif int(rotation_command[1:]) == 180: return (-1 * x, -1 * y) if rotation_command == 'L90': return (-1 * y, x) elif rotation_command == 'R90': return (y, -1 * x) else: print(f'Invalid command: {rotation_command}') exit(-1) def shift_coords(curx, cury, command): n = int(command[1:]) offsets = {'N': (0, 1), 'S': (0, -1), 'W': (-1, 0), 'E': (1, 0)} (offx, offy) = offsets[command[0]] return (n * offx + curx, n * offy + cury) class Ship: def __init__(self): self.direction = 'E' self.x = 0 self.y = 0 def run_command(self, command): if 'L' in command or 'R' in command: self.direction = rotate(self.direction, command) else: command = command.replace('F', self.direction) (self.x, self.y) = shift_coords(self.x, self.y, command) def manhattan_dist(self): return abs(self.x) + abs(self.y) class Shipwithwaypoint: def __init__(self): self.x = 0 self.y = 0 self.waypoint_x = 10 self.waypoint_y = 1 def run_command(self, command): if 'L' in command or 'R' in command: (self.waypoint_x, self.waypoint_y) = rotate_waypoint(self.waypoint_x, self.waypoint_y, command) elif 'F' in command: n = int(command[1:]) self.x += self.waypoint_x * n self.y += self.waypoint_y * n else: (self.waypoint_x, self.waypoint_y) = shift_coords(self.waypoint_x, self.waypoint_y, command) def manhattan_dist(self): return abs(self.x) + abs(self.y)
# https://codeforces.com/problemsets/acmsguru/problem/99999/100 A, B = map(int, input().split()) print(A+B)
(a, b) = map(int, input().split()) print(A + B)
# Hand decompiled day 19 part 2 a,b,c,d,e,f = 1,0,0,0,0,0 c += 2 c *= c c *= 209 b += 2 b *= 22 b += 7 c += b if a == 1: b = 27 b *= 28 b += 29 b *= 30 b *= 14 b *= 32 c += b a = 0 for d in range(1, c+1): if c % d == 0: a += d print(a)
(a, b, c, d, e, f) = (1, 0, 0, 0, 0, 0) c += 2 c *= c c *= 209 b += 2 b *= 22 b += 7 c += b if a == 1: b = 27 b *= 28 b += 29 b *= 30 b *= 14 b *= 32 c += b a = 0 for d in range(1, c + 1): if c % d == 0: a += d print(a)
def go(o, a, b): if o == '+': return a + b return a * b def main(): a, o, b = int(input()), input(), int(input()) return go(o, a, b) if __name__ == '__main__': print(main())
def go(o, a, b): if o == '+': return a + b return a * b def main(): (a, o, b) = (int(input()), input(), int(input())) return go(o, a, b) if __name__ == '__main__': print(main())
# # This file contains the Python code from Program 14.14 of # "Data Structures and Algorithms # with Object-Oriented Design Patterns in Python" # by Bruno R. Preiss. # # Copyright (c) 2003 by Bruno R. Preiss, P.Eng. All rights reserved. # # http://www.brpreiss.com/books/opus7/programs/pgm14_14.txt # class SimpleRV(RandomVariable): def getNext(self): return RandomNumberGenerator.next
class Simplerv(RandomVariable): def get_next(self): return RandomNumberGenerator.next
def test_list(client, seeder, utils): user_id, admin_unit_id = seeder.setup_base() seeder.create_event(admin_unit_id) url = utils.get_url("planing") utils.get_ok(url) url = utils.get_url("planing", keyword="name") utils.get_ok(url)
def test_list(client, seeder, utils): (user_id, admin_unit_id) = seeder.setup_base() seeder.create_event(admin_unit_id) url = utils.get_url('planing') utils.get_ok(url) url = utils.get_url('planing', keyword='name') utils.get_ok(url)
class Solution: def to_hex(self, num: int) -> str: if num == 0: return "0" prefix, ans = "0123456789abcdef", "" num = 2 ** 32 + num if num < 0 else num while num: item = num & 15 # num % 16 ans = prefix[item] + ans num >>= 4 # num //= 4 return ans
class Solution: def to_hex(self, num: int) -> str: if num == 0: return '0' (prefix, ans) = ('0123456789abcdef', '') num = 2 ** 32 + num if num < 0 else num while num: item = num & 15 ans = prefix[item] + ans num >>= 4 return ans
def partTwo(instr: str) -> int: # This is the parsing section service_list = instr.strip().split("\n")[-1].split(",") eqns = [] for i, svc in enumerate(service_list): if svc == "x": continue svc = int(svc) v = 0 if i != 0: v = svc - i # This is the only maths stuff in the parsing eqns.append((v, svc)) # This is the maths section n = 1 for (_, v) in eqns: n *= v sigma_x = 0 for (bi, ni) in eqns: # this type cast could potentially cause a problem. # int required for pow function and the division *should* produce a whole number anyway Ni = int(n / ni) yi = pow(Ni, -1, ni) # https://stackoverflow.com/a/9758173 sigma_x += bi * Ni * yi return sigma_x % n
def part_two(instr: str) -> int: service_list = instr.strip().split('\n')[-1].split(',') eqns = [] for (i, svc) in enumerate(service_list): if svc == 'x': continue svc = int(svc) v = 0 if i != 0: v = svc - i eqns.append((v, svc)) n = 1 for (_, v) in eqns: n *= v sigma_x = 0 for (bi, ni) in eqns: ni = int(n / ni) yi = pow(Ni, -1, ni) sigma_x += bi * Ni * yi return sigma_x % n
''' Motion Event Provider ===================== Abstract class for the implemention of a :class:`~kivy.input.motionevent.MotionEvent` provider. The implementation must support the :meth:`~MotionEventProvider.start`, :meth:`~MotionEventProvider.stop` and :meth:`~MotionEventProvider.update` methods. ''' __all__ = ('MotionEventProvider', ) class MotionEventProvider(object): '''Base class for a provider. ''' def __init__(self, device, args): self.device = device if self.__class__ == MotionEventProvider: raise NotImplementedError('class MotionEventProvider is abstract') def start(self): '''Start the provider. This method is automatically called when the application is started and if the configuration uses the current provider. ''' pass def stop(self): '''Stop the provider. ''' pass def update(self, dispatch_fn): '''Update the provider and dispatch all the new touch events though the `dispatch_fn` argument. ''' pass
""" Motion Event Provider ===================== Abstract class for the implemention of a :class:`~kivy.input.motionevent.MotionEvent` provider. The implementation must support the :meth:`~MotionEventProvider.start`, :meth:`~MotionEventProvider.stop` and :meth:`~MotionEventProvider.update` methods. """ __all__ = ('MotionEventProvider',) class Motioneventprovider(object): """Base class for a provider. """ def __init__(self, device, args): self.device = device if self.__class__ == MotionEventProvider: raise not_implemented_error('class MotionEventProvider is abstract') def start(self): """Start the provider. This method is automatically called when the application is started and if the configuration uses the current provider. """ pass def stop(self): """Stop the provider. """ pass def update(self, dispatch_fn): """Update the provider and dispatch all the new touch events though the `dispatch_fn` argument. """ pass
class Model(object): def __init__(self, xml): self.raw_data = xml def __str__(self): return self.raw_data.toprettyxml( ) def _get_attribute(self, attr): val = self.raw_data.getAttribute(attr) if val == '': return None return val def _get_element(self, name): nodes = self.raw_data.getElementsByTagName(name) if len(nodes) == 0: return None if len(nodes) > 1: raise AttributeError("Too many elements with name %s" % name) return nodes[0] def _get_childNodes(self, name): return self._get_element(name).childNodes if self._get_element(name) else [] def _get_nodeValue(self, node): if isinstance(node, str): nodes = self._get_childNodes(node) elif hasattr(node, 'childNodes'): nodes = node.childNodes else: return None if len(nodes) == 0: return None if len(nodes) > 1: raise AttributeError("Unable to parse value from node with name %s" % name) return nodes[0].nodeValue class Book(Model): @property def book_id(self): return self._get_attribute('book_id') @property def isbn(self): return self._get_attribute('isbn') @property def isbn13(self): return self._get_attribute('isbn13') @property def title(self): return self._get_nodeValue('Title') @property def title_long(self): return self._get_nodeValue('TitleLong') @property def authors_text(self): return self._get_nodeValue('AuthorsText') @property def authors(self): for node in self._get_childNodes('Authors'): if node.nodeType == node.ELEMENT_NODE: aid = node.getAttribute('person_id') name = self._get_nodeValue(node) yield { 'person_id': aid, 'person_text': name, } @property def publisher_id(self): pelem = self._get_element('PublisherText') if pelem is not None: val = pelem.getAttribute('publisher_id') if val != '': return val return None @property def publisher_text(self): return self._get_nodeValue('PublisherText') @property def details(self): delem = self._get_element('Details') if delem is not None: return dict(delem.attributes.items()) return None @property def summary(self): return self._get_nodeValue('Summary') @property def notes(self): return self._get_nodeValue('Notes') @property def urls_text(self): return self._get_nodeValue('UrlsText') @property def awards_text(self): return self._get_nodeValue('AwardsText') @property def prices(self): for node in self._get_childNodes('Prices'): if node.nodeType == node.ELEMENT_NODE: yield dict(node.attributes.items()) @property def subjects(self): for node in self._get_childNodes('Subjects'): if node.nodeType == node.ELEMENT_NODE: sid = node.getAttribute('subject_id') text = self._get_nodeValue(node) yield { 'subject_id': sid, 'subject_text': text, } @property def marc_records(self): for node in self._get_childNodes('MARCRecords'): if node.nodeType == node.ELEMENT_NODE: yield dict(node.attributes.items()) class Subject(Model): @property def subject_id(self): return self._get_attribute('subject_id') @property def book_count(self): return self._get_attribute('book_count') @property def marc_field(self): return self._get_attribute('marc_field') @property def marc_indicators(self): return (self._get_attribute('marc_indicator_1'), self._get_attribute('marc_indicator_2')) @property def name(self): return self._get_nodeValue('Name') @property def categories(self): for node in self._get_childNodes('Categories'): if node.nodeType == node.ELEMENT_NODE: cid = node.getAttribute('category_id') text = self._get_nodeValue(node) yield { 'category_id': cid, 'category_text': text, } @property def structure(self): for node in self._get_childNodes('SubjectStructure'): if node.nodeType == node.ELEMENT_NODE: yield dict(node.attributes.items()) class Category(Model): @property def category_id(self): return self._get_attribute('category_id') @property def parent_id(self): return self._get_attribute('parent_id') @property def name(self): return self._get_nodeValue('Name') @property def details(self): delem = self._get_element('Details') if delem: return dict(delem.attributes.items()) return {} @property def subcategories(self): for node in self._get_childNodes('SubCategories'): if node.nodeType == node.ELEMENT_NODE: yield dict(node.attributes.items()) class Author(Model): @property def author_id(self): return self._get_attribute('person_id') @property def name(self): return self._get_nodeValue('Name') @property def details(self): delem = self._get_element('Details') if delem: return dict(delem.attributes.items()) return None @property def categories(self): for node in self._get_childNodes('Categories'): if node.nodeType == node.ELEMENT_NODE: cid = node.getAttribute('category_id') text = self._get_nodeValue(node) yield { 'category_id': cid, 'category_text': text, } @property def subjects(self): for node in self._get_childNodes('Subjects'): if node.nodeType == node.ELEMENT_NODE: sid = node.getAttribute('subject_id') count = node.getAttribute('book_count') text = self._get_nodeValue(node) yield { 'subject_id': sid, 'book_count': count, 'subject_text': text, } class Publisher(Model): @property def publisher_id(self): return self._get_attribute('publisher_id') @property def name(self): return self._get_nodeValue('Name') @property def details(self): delem = self._get_element('Details') if delem: return dict(delem.attributes.items()) return None @property def categories(self): for node in self._get_childNodes('Categories'): if node.nodeType == node.ELEMENT_NODE: cid = node.getAttribute('category_id') text = self._get_nodeValue(node) yield { 'category_id': cid, 'category_text': text, }
class Model(object): def __init__(self, xml): self.raw_data = xml def __str__(self): return self.raw_data.toprettyxml() def _get_attribute(self, attr): val = self.raw_data.getAttribute(attr) if val == '': return None return val def _get_element(self, name): nodes = self.raw_data.getElementsByTagName(name) if len(nodes) == 0: return None if len(nodes) > 1: raise attribute_error('Too many elements with name %s' % name) return nodes[0] def _get_child_nodes(self, name): return self._get_element(name).childNodes if self._get_element(name) else [] def _get_node_value(self, node): if isinstance(node, str): nodes = self._get_childNodes(node) elif hasattr(node, 'childNodes'): nodes = node.childNodes else: return None if len(nodes) == 0: return None if len(nodes) > 1: raise attribute_error('Unable to parse value from node with name %s' % name) return nodes[0].nodeValue class Book(Model): @property def book_id(self): return self._get_attribute('book_id') @property def isbn(self): return self._get_attribute('isbn') @property def isbn13(self): return self._get_attribute('isbn13') @property def title(self): return self._get_nodeValue('Title') @property def title_long(self): return self._get_nodeValue('TitleLong') @property def authors_text(self): return self._get_nodeValue('AuthorsText') @property def authors(self): for node in self._get_childNodes('Authors'): if node.nodeType == node.ELEMENT_NODE: aid = node.getAttribute('person_id') name = self._get_nodeValue(node) yield {'person_id': aid, 'person_text': name} @property def publisher_id(self): pelem = self._get_element('PublisherText') if pelem is not None: val = pelem.getAttribute('publisher_id') if val != '': return val return None @property def publisher_text(self): return self._get_nodeValue('PublisherText') @property def details(self): delem = self._get_element('Details') if delem is not None: return dict(delem.attributes.items()) return None @property def summary(self): return self._get_nodeValue('Summary') @property def notes(self): return self._get_nodeValue('Notes') @property def urls_text(self): return self._get_nodeValue('UrlsText') @property def awards_text(self): return self._get_nodeValue('AwardsText') @property def prices(self): for node in self._get_childNodes('Prices'): if node.nodeType == node.ELEMENT_NODE: yield dict(node.attributes.items()) @property def subjects(self): for node in self._get_childNodes('Subjects'): if node.nodeType == node.ELEMENT_NODE: sid = node.getAttribute('subject_id') text = self._get_nodeValue(node) yield {'subject_id': sid, 'subject_text': text} @property def marc_records(self): for node in self._get_childNodes('MARCRecords'): if node.nodeType == node.ELEMENT_NODE: yield dict(node.attributes.items()) class Subject(Model): @property def subject_id(self): return self._get_attribute('subject_id') @property def book_count(self): return self._get_attribute('book_count') @property def marc_field(self): return self._get_attribute('marc_field') @property def marc_indicators(self): return (self._get_attribute('marc_indicator_1'), self._get_attribute('marc_indicator_2')) @property def name(self): return self._get_nodeValue('Name') @property def categories(self): for node in self._get_childNodes('Categories'): if node.nodeType == node.ELEMENT_NODE: cid = node.getAttribute('category_id') text = self._get_nodeValue(node) yield {'category_id': cid, 'category_text': text} @property def structure(self): for node in self._get_childNodes('SubjectStructure'): if node.nodeType == node.ELEMENT_NODE: yield dict(node.attributes.items()) class Category(Model): @property def category_id(self): return self._get_attribute('category_id') @property def parent_id(self): return self._get_attribute('parent_id') @property def name(self): return self._get_nodeValue('Name') @property def details(self): delem = self._get_element('Details') if delem: return dict(delem.attributes.items()) return {} @property def subcategories(self): for node in self._get_childNodes('SubCategories'): if node.nodeType == node.ELEMENT_NODE: yield dict(node.attributes.items()) class Author(Model): @property def author_id(self): return self._get_attribute('person_id') @property def name(self): return self._get_nodeValue('Name') @property def details(self): delem = self._get_element('Details') if delem: return dict(delem.attributes.items()) return None @property def categories(self): for node in self._get_childNodes('Categories'): if node.nodeType == node.ELEMENT_NODE: cid = node.getAttribute('category_id') text = self._get_nodeValue(node) yield {'category_id': cid, 'category_text': text} @property def subjects(self): for node in self._get_childNodes('Subjects'): if node.nodeType == node.ELEMENT_NODE: sid = node.getAttribute('subject_id') count = node.getAttribute('book_count') text = self._get_nodeValue(node) yield {'subject_id': sid, 'book_count': count, 'subject_text': text} class Publisher(Model): @property def publisher_id(self): return self._get_attribute('publisher_id') @property def name(self): return self._get_nodeValue('Name') @property def details(self): delem = self._get_element('Details') if delem: return dict(delem.attributes.items()) return None @property def categories(self): for node in self._get_childNodes('Categories'): if node.nodeType == node.ELEMENT_NODE: cid = node.getAttribute('category_id') text = self._get_nodeValue(node) yield {'category_id': cid, 'category_text': text}
# cook your dish here a=int(input()) b=int(input()) while(1): if a%b==0: print(a) break else: a-=1
a = int(input()) b = int(input()) while 1: if a % b == 0: print(a) break else: a -= 1
# -*- coding: utf-8 -*- AUCTIONS = { 'simple': 'openprocurement.auction.esco.auctions.simple', 'multilot': 'openprocurement.auction.esco.auctions.multilot', }
auctions = {'simple': 'openprocurement.auction.esco.auctions.simple', 'multilot': 'openprocurement.auction.esco.auctions.multilot'}
# python3 def max_pairwise_product(numbers): x = sorted(numbers) n = len(numbers) return x[n-1] * x[n-2] if __name__ == '__main__': input_n = int(input()) input_numbers = [int(x) for x in input().split()] print(max_pairwise_product(input_numbers))
def max_pairwise_product(numbers): x = sorted(numbers) n = len(numbers) return x[n - 1] * x[n - 2] if __name__ == '__main__': input_n = int(input()) input_numbers = [int(x) for x in input().split()] print(max_pairwise_product(input_numbers))
''' Homework assignment for the 'Python is easy' course by Pirple. Written by Ed Yablonsky. It pprints the numbers from 1 to 100. But for multiples of three print "Fizz" instead of the number and for the multiples of five print "Buzz". For numbers which are multiples of both three and five print "FizzBuzz". It also adds "prime" to the output when the number is a prime (divisible only by itself and one). ''' for number in range(1, 101): output = "" # collects output for the number if number % 3 == 0: output += "Fizz" if number % 5 == 0: output += "Buzz" if output == "": output = str(number) isPrime = True # assume the number is a prime by default for divisor in range(2, number): if number % divisor == 0: isPrime = False # mark the number as not a prime break if isPrime: output += " prime" print(output)
""" Homework assignment for the 'Python is easy' course by Pirple. Written by Ed Yablonsky. It pprints the numbers from 1 to 100. But for multiples of three print "Fizz" instead of the number and for the multiples of five print "Buzz". For numbers which are multiples of both three and five print "FizzBuzz". It also adds "prime" to the output when the number is a prime (divisible only by itself and one). """ for number in range(1, 101): output = '' if number % 3 == 0: output += 'Fizz' if number % 5 == 0: output += 'Buzz' if output == '': output = str(number) is_prime = True for divisor in range(2, number): if number % divisor == 0: is_prime = False break if isPrime: output += ' prime' print(output)
a=input() print(a) print(a) print(a)
a = input() print(a) print(a) print(a)
# Fancy-pants method for getting a where clause that groups adjacent image keys # using "BETWEEN X AND Y" ... unfortunately this usually takes far more # characters than using "ImageNumber IN (X,Y,Z...)" since we don't run into # queries asking for consecutive image numbers very often (except when we do it # deliberately). It is also slower than the "IN" method unless the ImageNumbers # come in a smaller list of consecutive groups. # # ...still, this may be very useful since it is notably faster when ImageNumbers # are consecutive. def get_where_clause_for_images(keys, is_sorted=False): ''' takes a list of keys and returns a (hopefully) short where clause that includes those keys. ''' def in_sequence(k1,k2): if len(k1)>1: if k1[:-1] != k2[:-1]: return False return k1[-1]==(k2[-1]-1) def optimize_for_query(keys, is_sorted=False): if not is_sorted: keys.sort() groups = [] in_run = False for i in range(len(keys)): if i == len(keys)-1: if in_run: groups[-1] += [keys[i]] else: groups += [[keys[i]]] break if in_run: if in_sequence(keys[i], keys[i+1]): continue else: groups[-1] += [keys[i]] in_run = False else: if in_sequence(keys[i], keys[i+1]): in_run = True groups += [[keys[i]]] return groups groups = optimize_for_query(keys) wheres = [] for k in groups: if len(k)==1: wheres += ['%s=%s'%(col,value) for col, value in zip(object_key_columns(), k[0])] else: # expect 2 keys: the first and last of a contiguous run first, last = k if p.table_id: wheres += ['(%s=%s AND %s BETWEEN %s and %s)'% (p.table_id, first[0], p.image_id, first[1], last[1])] else: wheres += ['(%s BETWEEN %s and %s)'% (p.image_id, first[0], last[0])] return ' OR '.join(wheres)
def get_where_clause_for_images(keys, is_sorted=False): """ takes a list of keys and returns a (hopefully) short where clause that includes those keys. """ def in_sequence(k1, k2): if len(k1) > 1: if k1[:-1] != k2[:-1]: return False return k1[-1] == k2[-1] - 1 def optimize_for_query(keys, is_sorted=False): if not is_sorted: keys.sort() groups = [] in_run = False for i in range(len(keys)): if i == len(keys) - 1: if in_run: groups[-1] += [keys[i]] else: groups += [[keys[i]]] break if in_run: if in_sequence(keys[i], keys[i + 1]): continue else: groups[-1] += [keys[i]] in_run = False else: if in_sequence(keys[i], keys[i + 1]): in_run = True groups += [[keys[i]]] return groups groups = optimize_for_query(keys) wheres = [] for k in groups: if len(k) == 1: wheres += ['%s=%s' % (col, value) for (col, value) in zip(object_key_columns(), k[0])] else: (first, last) = k if p.table_id: wheres += ['(%s=%s AND %s BETWEEN %s and %s)' % (p.table_id, first[0], p.image_id, first[1], last[1])] else: wheres += ['(%s BETWEEN %s and %s)' % (p.image_id, first[0], last[0])] return ' OR '.join(wheres)
g = int(input().strip()) for _ in range(g): n = int(input().strip()) s = [int(x) for x in input().strip().split(' ')] x = 0 for i in s: x ^= i if len(set(s))==1 and 1 in s: #here x=0 or 1 if x:#odd no. of ones print("Second") else:#even no. of ones print("First") else: if x: print("First") else: print("Second")
g = int(input().strip()) for _ in range(g): n = int(input().strip()) s = [int(x) for x in input().strip().split(' ')] x = 0 for i in s: x ^= i if len(set(s)) == 1 and 1 in s: if x: print('Second') else: print('First') elif x: print('First') else: print('Second')
class A(object): def do_this(self): print('do_this() in A') class B(A): pass class C(A): def do_this(self): print('do_this() in C') class D(B, C): pass D_instance = D() D_instance.do_this() print(D.mro()) # Method resolution order
class A(object): def do_this(self): print('do_this() in A') class B(A): pass class C(A): def do_this(self): print('do_this() in C') class D(B, C): pass d_instance = d() D_instance.do_this() print(D.mro())
a, b = 0, 1 while b < 10: print(b) a, b = b, a + b # 1 # 1 # 2 # 3 # 5 # 8 a, b = 0, 1 while b < 1000: print(b, end='->') a, b = b, a + b # 1->1->2->3->5->8->13->21->34->55->89->144->233->377->610->987->%
(a, b) = (0, 1) while b < 10: print(b) (a, b) = (b, a + b) (a, b) = (0, 1) while b < 1000: print(b, end='->') (a, b) = (b, a + b)
class AutoScaleSettingVO: def __init__(self, mini_size=1, max_size=1, mem_exc=0, deploy_name = ""): self.miniSize = mini_size self.maxSize = max_size self.memExc = mem_exc self.deployName = deploy_name self.operationResult = ""
class Autoscalesettingvo: def __init__(self, mini_size=1, max_size=1, mem_exc=0, deploy_name=''): self.miniSize = mini_size self.maxSize = max_size self.memExc = mem_exc self.deployName = deploy_name self.operationResult = ''
# # PySNMP MIB module STN-ATM-VPN-MIB (http://snmplabs.com/pysmi) # ASN.1 source file:///Users/davwang4/Dev/mibs.snmplabs.com/asn1/STN-ATM-VPN-MIB # Produced by pysmi-0.3.4 at Mon Apr 29 21:03:27 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, ValueSizeConstraint, ValueRangeConstraint, ConstraintsUnion, ConstraintsIntersection = mibBuilder.importSymbols("ASN1-REFINEMENT", "SingleValueConstraint", "ValueSizeConstraint", "ValueRangeConstraint", "ConstraintsUnion", "ConstraintsIntersection") InterfaceIndex, = mibBuilder.importSymbols("IF-MIB", "InterfaceIndex") NotificationGroup, ModuleCompliance = mibBuilder.importSymbols("SNMPv2-CONF", "NotificationGroup", "ModuleCompliance") MibScalar, MibTable, MibTableRow, MibTableColumn, Integer32, ModuleIdentity, MibIdentifier, NotificationType, Unsigned32, Counter32, Gauge32, Counter64, iso, ObjectIdentity, TimeTicks, Bits, IpAddress = mibBuilder.importSymbols("SNMPv2-SMI", "MibScalar", "MibTable", "MibTableRow", "MibTableColumn", "Integer32", "ModuleIdentity", "MibIdentifier", "NotificationType", "Unsigned32", "Counter32", "Gauge32", "Counter64", "iso", "ObjectIdentity", "TimeTicks", "Bits", "IpAddress") DisplayString, TextualConvention = mibBuilder.importSymbols("SNMPv2-TC", "DisplayString", "TextualConvention") stnNotification, = mibBuilder.importSymbols("SPRING-TIDE-NETWORKS-SMI", "stnNotification") stnRouterAtmVpn, = mibBuilder.importSymbols("STN-ROUTER-MIB", "stnRouterAtmVpn") stnAtmVpn = ModuleIdentity((1, 3, 6, 1, 4, 1, 3551, 2, 7, 1, 7, 1)) if mibBuilder.loadTexts: stnAtmVpn.setLastUpdated('0008080000Z') if mibBuilder.loadTexts: stnAtmVpn.setOrganization('Spring Tide Networks') stnAtmVpnTrunkObjects = MibIdentifier((1, 3, 6, 1, 4, 1, 3551, 2, 7, 1, 7, 1, 1)) stnAtmVpnLinkObjects = MibIdentifier((1, 3, 6, 1, 4, 1, 3551, 2, 7, 1, 7, 1, 2)) stnAtmVpnTrunkTable = MibTable((1, 3, 6, 1, 4, 1, 3551, 2, 7, 1, 7, 1, 1, 1), ) if mibBuilder.loadTexts: stnAtmVpnTrunkTable.setStatus('current') stnAtmVpnTrunkEntry = MibTableRow((1, 3, 6, 1, 4, 1, 3551, 2, 7, 1, 7, 1, 1, 1, 1), ).setIndexNames((0, "STN-ATM-VPN-MIB", "stnAtmVpnTrunkIfIndex")) if mibBuilder.loadTexts: stnAtmVpnTrunkEntry.setStatus('current') stnAtmVpnTrunkIfIndex = MibTableColumn((1, 3, 6, 1, 4, 1, 3551, 2, 7, 1, 7, 1, 1, 1, 1, 1), InterfaceIndex()).setMaxAccess("readonly") if mibBuilder.loadTexts: stnAtmVpnTrunkIfIndex.setStatus('current') stnAtmVpnTrunkViId = MibTableColumn((1, 3, 6, 1, 4, 1, 3551, 2, 7, 1, 7, 1, 1, 1, 1, 2), Integer32()).setMaxAccess("readonly") if mibBuilder.loadTexts: stnAtmVpnTrunkViId.setStatus('current') stnAtmVpnTrunkName = MibTableColumn((1, 3, 6, 1, 4, 1, 3551, 2, 7, 1, 7, 1, 1, 1, 1, 3), DisplayString().subtype(subtypeSpec=ValueSizeConstraint(1, 32))).setMaxAccess("readonly") if mibBuilder.loadTexts: stnAtmVpnTrunkName.setStatus('current') stnAtmVpnTrunkState = MibTableColumn((1, 3, 6, 1, 4, 1, 3551, 2, 7, 1, 7, 1, 1, 1, 1, 4), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2, 3))).clone(namedValues=NamedValues(("up", 1), ("down", 2), ("testing", 3)))).setMaxAccess("readonly") if mibBuilder.loadTexts: stnAtmVpnTrunkState.setStatus('current') stnAtmVpnTrunkLowerIfIndex = MibTableColumn((1, 3, 6, 1, 4, 1, 3551, 2, 7, 1, 7, 1, 1, 1, 1, 5), InterfaceIndex()).setMaxAccess("readonly") if mibBuilder.loadTexts: stnAtmVpnTrunkLowerIfIndex.setStatus('current') stnAtmVpnTrunkVpnPaths = MibTableColumn((1, 3, 6, 1, 4, 1, 3551, 2, 7, 1, 7, 1, 1, 1, 1, 6), Integer32()).setMaxAccess("readonly") if mibBuilder.loadTexts: stnAtmVpnTrunkVpnPaths.setStatus('current') stnAtmVpnTrunkInUnknownVpnId = MibTableColumn((1, 3, 6, 1, 4, 1, 3551, 2, 7, 1, 7, 1, 1, 1, 1, 7), Counter64()).setMaxAccess("readonly") if mibBuilder.loadTexts: stnAtmVpnTrunkInUnknownVpnId.setStatus('current') stnAtmVpnTrunkInVpnIdIfaceInvalid = MibTableColumn((1, 3, 6, 1, 4, 1, 3551, 2, 7, 1, 7, 1, 1, 1, 1, 8), Counter64()).setMaxAccess("readonly") if mibBuilder.loadTexts: stnAtmVpnTrunkInVpnIdIfaceInvalid.setStatus('current') stnAtmVpnTrunkOutUnknownVpnId = MibTableColumn((1, 3, 6, 1, 4, 1, 3551, 2, 7, 1, 7, 1, 1, 1, 1, 9), Counter64()).setMaxAccess("readonly") if mibBuilder.loadTexts: stnAtmVpnTrunkOutUnknownVpnId.setStatus('current') stnAtmVpnTrunkOutVpnIdIfaceInvalid = MibTableColumn((1, 3, 6, 1, 4, 1, 3551, 2, 7, 1, 7, 1, 1, 1, 1, 10), Counter64()).setMaxAccess("readonly") if mibBuilder.loadTexts: stnAtmVpnTrunkOutVpnIdIfaceInvalid.setStatus('current') stnAtmVpnTrunkPathTable = MibTable((1, 3, 6, 1, 4, 1, 3551, 2, 7, 1, 7, 1, 1, 2), ) if mibBuilder.loadTexts: stnAtmVpnTrunkPathTable.setStatus('current') stnAtmVpnTrunkPathEntry = MibTableRow((1, 3, 6, 1, 4, 1, 3551, 2, 7, 1, 7, 1, 1, 2, 1), ).setIndexNames((0, "STN-ATM-VPN-MIB", "stnAtmVpnTrunkPathTrunkIfIndex"), (0, "STN-ATM-VPN-MIB", "stnAtmVpnTrunkPathVpnOUI"), (0, "STN-ATM-VPN-MIB", "stnAtmVpnTrunkPathVpnIndex"), (0, "STN-ATM-VPN-MIB", "stnAtmVpnTrunkPathVpnSubIndex")) if mibBuilder.loadTexts: stnAtmVpnTrunkPathEntry.setStatus('current') stnAtmVpnTrunkPathTrunkIfIndex = MibTableColumn((1, 3, 6, 1, 4, 1, 3551, 2, 7, 1, 7, 1, 1, 2, 1, 1), InterfaceIndex()).setMaxAccess("readonly") if mibBuilder.loadTexts: stnAtmVpnTrunkPathTrunkIfIndex.setStatus('current') stnAtmVpnTrunkPathVpnOUI = MibTableColumn((1, 3, 6, 1, 4, 1, 3551, 2, 7, 1, 7, 1, 1, 2, 1, 2), Integer32()).setMaxAccess("readonly") if mibBuilder.loadTexts: stnAtmVpnTrunkPathVpnOUI.setStatus('current') stnAtmVpnTrunkPathVpnIndex = MibTableColumn((1, 3, 6, 1, 4, 1, 3551, 2, 7, 1, 7, 1, 1, 2, 1, 3), Integer32()).setMaxAccess("readonly") if mibBuilder.loadTexts: stnAtmVpnTrunkPathVpnIndex.setStatus('current') stnAtmVpnTrunkPathVpnSubIndex = MibTableColumn((1, 3, 6, 1, 4, 1, 3551, 2, 7, 1, 7, 1, 1, 2, 1, 4), Integer32()).setMaxAccess("readonly") if mibBuilder.loadTexts: stnAtmVpnTrunkPathVpnSubIndex.setStatus('current') stnAtmVpnTrunkPathType = MibTableColumn((1, 3, 6, 1, 4, 1, 3551, 2, 7, 1, 7, 1, 1, 2, 1, 5), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2))).clone(namedValues=NamedValues(("vpnLearnedPath", 1), ("vpnStaticPath", 2)))).setMaxAccess("readonly") if mibBuilder.loadTexts: stnAtmVpnTrunkPathType.setStatus('current') stnAtmVpnTrunkPathNextIfType = MibTableColumn((1, 3, 6, 1, 4, 1, 3551, 2, 7, 1, 7, 1, 1, 2, 1, 6), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2))).clone(namedValues=NamedValues(("atmVpnLink", 1), ("atmVpnTrunk", 2)))).setMaxAccess("readonly") if mibBuilder.loadTexts: stnAtmVpnTrunkPathNextIfType.setStatus('current') stnAtmVpnTrunkPathNextIfIndex = MibTableColumn((1, 3, 6, 1, 4, 1, 3551, 2, 7, 1, 7, 1, 1, 2, 1, 7), InterfaceIndex()).setMaxAccess("readonly") if mibBuilder.loadTexts: stnAtmVpnTrunkPathNextIfIndex.setStatus('current') stnAtmVpnTrunkPathInPackets = MibTableColumn((1, 3, 6, 1, 4, 1, 3551, 2, 7, 1, 7, 1, 1, 2, 1, 8), Counter64()).setMaxAccess("readonly") if mibBuilder.loadTexts: stnAtmVpnTrunkPathInPackets.setStatus('current') stnAtmVpnTrunkPathInOctets = MibTableColumn((1, 3, 6, 1, 4, 1, 3551, 2, 7, 1, 7, 1, 1, 2, 1, 9), Counter64()).setMaxAccess("readonly") if mibBuilder.loadTexts: stnAtmVpnTrunkPathInOctets.setStatus('current') stnAtmVpnTrunkPathOutPackets = MibTableColumn((1, 3, 6, 1, 4, 1, 3551, 2, 7, 1, 7, 1, 1, 2, 1, 10), Counter64()).setMaxAccess("readonly") if mibBuilder.loadTexts: stnAtmVpnTrunkPathOutPackets.setStatus('current') stnAtmVpnTrunkPathOutOctets = MibTableColumn((1, 3, 6, 1, 4, 1, 3551, 2, 7, 1, 7, 1, 1, 2, 1, 11), Counter64()).setMaxAccess("readonly") if mibBuilder.loadTexts: stnAtmVpnTrunkPathOutOctets.setStatus('current') stnAtmVpnLinkTable = MibTable((1, 3, 6, 1, 4, 1, 3551, 2, 7, 1, 7, 1, 2, 1), ) if mibBuilder.loadTexts: stnAtmVpnLinkTable.setStatus('current') stnAtmVpnLinkEntry = MibTableRow((1, 3, 6, 1, 4, 1, 3551, 2, 7, 1, 7, 1, 2, 1, 1), ).setIndexNames((0, "STN-ATM-VPN-MIB", "stnAtmVpnLinkIfIndex")) if mibBuilder.loadTexts: stnAtmVpnLinkEntry.setStatus('current') stnAtmVpnLinkIfIndex = MibTableColumn((1, 3, 6, 1, 4, 1, 3551, 2, 7, 1, 7, 1, 2, 1, 1, 1), InterfaceIndex()).setMaxAccess("readonly") if mibBuilder.loadTexts: stnAtmVpnLinkIfIndex.setStatus('current') stnAtmVpnLinkViId = MibTableColumn((1, 3, 6, 1, 4, 1, 3551, 2, 7, 1, 7, 1, 2, 1, 1, 2), Integer32()).setMaxAccess("readonly") if mibBuilder.loadTexts: stnAtmVpnLinkViId.setStatus('current') stnAtmVpnLinkName = MibTableColumn((1, 3, 6, 1, 4, 1, 3551, 2, 7, 1, 7, 1, 2, 1, 1, 3), DisplayString().subtype(subtypeSpec=ValueSizeConstraint(1, 32))).setMaxAccess("readonly") if mibBuilder.loadTexts: stnAtmVpnLinkName.setStatus('current') stnAtmVpnLinkVpnOUI = MibTableColumn((1, 3, 6, 1, 4, 1, 3551, 2, 7, 1, 7, 1, 2, 1, 1, 4), Integer32()).setMaxAccess("readonly") if mibBuilder.loadTexts: stnAtmVpnLinkVpnOUI.setStatus('current') stnAtmVpnLinkVpnIndex = MibTableColumn((1, 3, 6, 1, 4, 1, 3551, 2, 7, 1, 7, 1, 2, 1, 1, 5), Integer32()).setMaxAccess("readonly") if mibBuilder.loadTexts: stnAtmVpnLinkVpnIndex.setStatus('current') stnAtmVpnLinkVpnSubIndex = MibTableColumn((1, 3, 6, 1, 4, 1, 3551, 2, 7, 1, 7, 1, 2, 1, 1, 6), Integer32()).setMaxAccess("readonly") if mibBuilder.loadTexts: stnAtmVpnLinkVpnSubIndex.setStatus('current') stnAtmVpnLinkState = MibTableColumn((1, 3, 6, 1, 4, 1, 3551, 2, 7, 1, 7, 1, 2, 1, 1, 7), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2, 3))).clone(namedValues=NamedValues(("up", 1), ("down", 2), ("testing", 3)))).setMaxAccess("readonly") if mibBuilder.loadTexts: stnAtmVpnLinkState.setStatus('current') stnAtmVpnLinkTrunkViId = MibTableColumn((1, 3, 6, 1, 4, 1, 3551, 2, 7, 1, 7, 1, 2, 1, 1, 8), Integer32()).setMaxAccess("readonly") if mibBuilder.loadTexts: stnAtmVpnLinkTrunkViId.setStatus('current') stnAtmVpnLinkLowerIfIndex = MibTableColumn((1, 3, 6, 1, 4, 1, 3551, 2, 7, 1, 7, 1, 2, 1, 1, 9), InterfaceIndex()).setMaxAccess("readonly") if mibBuilder.loadTexts: stnAtmVpnLinkLowerIfIndex.setStatus('current') stnAtmVpnLinkOutUnknownVpnId = MibTableColumn((1, 3, 6, 1, 4, 1, 3551, 2, 7, 1, 7, 1, 2, 1, 1, 10), Counter64()).setMaxAccess("readonly") if mibBuilder.loadTexts: stnAtmVpnLinkOutUnknownVpnId.setStatus('current') stnAtmVpnLinkOutVpnIdIfaceInvalid = MibTableColumn((1, 3, 6, 1, 4, 1, 3551, 2, 7, 1, 7, 1, 2, 1, 1, 11), Counter64()).setMaxAccess("readonly") if mibBuilder.loadTexts: stnAtmVpnLinkOutVpnIdIfaceInvalid.setStatus('current') stnAtmVpnLinkInVpnIdIfaceInvalid = MibTableColumn((1, 3, 6, 1, 4, 1, 3551, 2, 7, 1, 7, 1, 2, 1, 1, 12), Counter64()).setMaxAccess("readonly") if mibBuilder.loadTexts: stnAtmVpnLinkInVpnIdIfaceInvalid.setStatus('current') mibBuilder.exportSymbols("STN-ATM-VPN-MIB", stnAtmVpnLinkIfIndex=stnAtmVpnLinkIfIndex, stnAtmVpnTrunkState=stnAtmVpnTrunkState, stnAtmVpnTrunkPathInOctets=stnAtmVpnTrunkPathInOctets, stnAtmVpnLinkLowerIfIndex=stnAtmVpnLinkLowerIfIndex, stnAtmVpnLinkInVpnIdIfaceInvalid=stnAtmVpnLinkInVpnIdIfaceInvalid, stnAtmVpnLinkObjects=stnAtmVpnLinkObjects, stnAtmVpnTrunkPathVpnSubIndex=stnAtmVpnTrunkPathVpnSubIndex, stnAtmVpnTrunkPathTable=stnAtmVpnTrunkPathTable, stnAtmVpn=stnAtmVpn, PYSNMP_MODULE_ID=stnAtmVpn, stnAtmVpnLinkState=stnAtmVpnLinkState, stnAtmVpnTrunkOutVpnIdIfaceInvalid=stnAtmVpnTrunkOutVpnIdIfaceInvalid, stnAtmVpnTrunkInVpnIdIfaceInvalid=stnAtmVpnTrunkInVpnIdIfaceInvalid, stnAtmVpnTrunkName=stnAtmVpnTrunkName, stnAtmVpnTrunkEntry=stnAtmVpnTrunkEntry, stnAtmVpnTrunkVpnPaths=stnAtmVpnTrunkVpnPaths, stnAtmVpnTrunkPathVpnOUI=stnAtmVpnTrunkPathVpnOUI, stnAtmVpnTrunkViId=stnAtmVpnTrunkViId, stnAtmVpnTrunkTable=stnAtmVpnTrunkTable, stnAtmVpnLinkVpnOUI=stnAtmVpnLinkVpnOUI, stnAtmVpnTrunkPathVpnIndex=stnAtmVpnTrunkPathVpnIndex, stnAtmVpnTrunkPathInPackets=stnAtmVpnTrunkPathInPackets, stnAtmVpnTrunkPathNextIfType=stnAtmVpnTrunkPathNextIfType, stnAtmVpnTrunkOutUnknownVpnId=stnAtmVpnTrunkOutUnknownVpnId, stnAtmVpnTrunkInUnknownVpnId=stnAtmVpnTrunkInUnknownVpnId, stnAtmVpnLinkOutUnknownVpnId=stnAtmVpnLinkOutUnknownVpnId, stnAtmVpnTrunkPathOutPackets=stnAtmVpnTrunkPathOutPackets, stnAtmVpnLinkTrunkViId=stnAtmVpnLinkTrunkViId, stnAtmVpnTrunkPathTrunkIfIndex=stnAtmVpnTrunkPathTrunkIfIndex, stnAtmVpnTrunkPathNextIfIndex=stnAtmVpnTrunkPathNextIfIndex, stnAtmVpnTrunkPathEntry=stnAtmVpnTrunkPathEntry, stnAtmVpnTrunkIfIndex=stnAtmVpnTrunkIfIndex, stnAtmVpnLinkTable=stnAtmVpnLinkTable, stnAtmVpnLinkOutVpnIdIfaceInvalid=stnAtmVpnLinkOutVpnIdIfaceInvalid, stnAtmVpnTrunkPathType=stnAtmVpnTrunkPathType, stnAtmVpnLinkVpnSubIndex=stnAtmVpnLinkVpnSubIndex, stnAtmVpnLinkName=stnAtmVpnLinkName, stnAtmVpnTrunkObjects=stnAtmVpnTrunkObjects, stnAtmVpnLinkVpnIndex=stnAtmVpnLinkVpnIndex, stnAtmVpnLinkEntry=stnAtmVpnLinkEntry, stnAtmVpnLinkViId=stnAtmVpnLinkViId, stnAtmVpnTrunkPathOutOctets=stnAtmVpnTrunkPathOutOctets, stnAtmVpnTrunkLowerIfIndex=stnAtmVpnTrunkLowerIfIndex)
(integer, object_identifier, octet_string) = mibBuilder.importSymbols('ASN1', 'Integer', 'ObjectIdentifier', 'OctetString') (named_values,) = mibBuilder.importSymbols('ASN1-ENUMERATION', 'NamedValues') (single_value_constraint, value_size_constraint, value_range_constraint, constraints_union, constraints_intersection) = mibBuilder.importSymbols('ASN1-REFINEMENT', 'SingleValueConstraint', 'ValueSizeConstraint', 'ValueRangeConstraint', 'ConstraintsUnion', 'ConstraintsIntersection') (interface_index,) = mibBuilder.importSymbols('IF-MIB', 'InterfaceIndex') (notification_group, module_compliance) = mibBuilder.importSymbols('SNMPv2-CONF', 'NotificationGroup', 'ModuleCompliance') (mib_scalar, mib_table, mib_table_row, mib_table_column, integer32, module_identity, mib_identifier, notification_type, unsigned32, counter32, gauge32, counter64, iso, object_identity, time_ticks, bits, ip_address) = mibBuilder.importSymbols('SNMPv2-SMI', 'MibScalar', 'MibTable', 'MibTableRow', 'MibTableColumn', 'Integer32', 'ModuleIdentity', 'MibIdentifier', 'NotificationType', 'Unsigned32', 'Counter32', 'Gauge32', 'Counter64', 'iso', 'ObjectIdentity', 'TimeTicks', 'Bits', 'IpAddress') (display_string, textual_convention) = mibBuilder.importSymbols('SNMPv2-TC', 'DisplayString', 'TextualConvention') (stn_notification,) = mibBuilder.importSymbols('SPRING-TIDE-NETWORKS-SMI', 'stnNotification') (stn_router_atm_vpn,) = mibBuilder.importSymbols('STN-ROUTER-MIB', 'stnRouterAtmVpn') stn_atm_vpn = module_identity((1, 3, 6, 1, 4, 1, 3551, 2, 7, 1, 7, 1)) if mibBuilder.loadTexts: stnAtmVpn.setLastUpdated('0008080000Z') if mibBuilder.loadTexts: stnAtmVpn.setOrganization('Spring Tide Networks') stn_atm_vpn_trunk_objects = mib_identifier((1, 3, 6, 1, 4, 1, 3551, 2, 7, 1, 7, 1, 1)) stn_atm_vpn_link_objects = mib_identifier((1, 3, 6, 1, 4, 1, 3551, 2, 7, 1, 7, 1, 2)) stn_atm_vpn_trunk_table = mib_table((1, 3, 6, 1, 4, 1, 3551, 2, 7, 1, 7, 1, 1, 1)) if mibBuilder.loadTexts: stnAtmVpnTrunkTable.setStatus('current') stn_atm_vpn_trunk_entry = mib_table_row((1, 3, 6, 1, 4, 1, 3551, 2, 7, 1, 7, 1, 1, 1, 1)).setIndexNames((0, 'STN-ATM-VPN-MIB', 'stnAtmVpnTrunkIfIndex')) if mibBuilder.loadTexts: stnAtmVpnTrunkEntry.setStatus('current') stn_atm_vpn_trunk_if_index = mib_table_column((1, 3, 6, 1, 4, 1, 3551, 2, 7, 1, 7, 1, 1, 1, 1, 1), interface_index()).setMaxAccess('readonly') if mibBuilder.loadTexts: stnAtmVpnTrunkIfIndex.setStatus('current') stn_atm_vpn_trunk_vi_id = mib_table_column((1, 3, 6, 1, 4, 1, 3551, 2, 7, 1, 7, 1, 1, 1, 1, 2), integer32()).setMaxAccess('readonly') if mibBuilder.loadTexts: stnAtmVpnTrunkViId.setStatus('current') stn_atm_vpn_trunk_name = mib_table_column((1, 3, 6, 1, 4, 1, 3551, 2, 7, 1, 7, 1, 1, 1, 1, 3), display_string().subtype(subtypeSpec=value_size_constraint(1, 32))).setMaxAccess('readonly') if mibBuilder.loadTexts: stnAtmVpnTrunkName.setStatus('current') stn_atm_vpn_trunk_state = mib_table_column((1, 3, 6, 1, 4, 1, 3551, 2, 7, 1, 7, 1, 1, 1, 1, 4), integer32().subtype(subtypeSpec=constraints_union(single_value_constraint(1, 2, 3))).clone(namedValues=named_values(('up', 1), ('down', 2), ('testing', 3)))).setMaxAccess('readonly') if mibBuilder.loadTexts: stnAtmVpnTrunkState.setStatus('current') stn_atm_vpn_trunk_lower_if_index = mib_table_column((1, 3, 6, 1, 4, 1, 3551, 2, 7, 1, 7, 1, 1, 1, 1, 5), interface_index()).setMaxAccess('readonly') if mibBuilder.loadTexts: stnAtmVpnTrunkLowerIfIndex.setStatus('current') stn_atm_vpn_trunk_vpn_paths = mib_table_column((1, 3, 6, 1, 4, 1, 3551, 2, 7, 1, 7, 1, 1, 1, 1, 6), integer32()).setMaxAccess('readonly') if mibBuilder.loadTexts: stnAtmVpnTrunkVpnPaths.setStatus('current') stn_atm_vpn_trunk_in_unknown_vpn_id = mib_table_column((1, 3, 6, 1, 4, 1, 3551, 2, 7, 1, 7, 1, 1, 1, 1, 7), counter64()).setMaxAccess('readonly') if mibBuilder.loadTexts: stnAtmVpnTrunkInUnknownVpnId.setStatus('current') stn_atm_vpn_trunk_in_vpn_id_iface_invalid = mib_table_column((1, 3, 6, 1, 4, 1, 3551, 2, 7, 1, 7, 1, 1, 1, 1, 8), counter64()).setMaxAccess('readonly') if mibBuilder.loadTexts: stnAtmVpnTrunkInVpnIdIfaceInvalid.setStatus('current') stn_atm_vpn_trunk_out_unknown_vpn_id = mib_table_column((1, 3, 6, 1, 4, 1, 3551, 2, 7, 1, 7, 1, 1, 1, 1, 9), counter64()).setMaxAccess('readonly') if mibBuilder.loadTexts: stnAtmVpnTrunkOutUnknownVpnId.setStatus('current') stn_atm_vpn_trunk_out_vpn_id_iface_invalid = mib_table_column((1, 3, 6, 1, 4, 1, 3551, 2, 7, 1, 7, 1, 1, 1, 1, 10), counter64()).setMaxAccess('readonly') if mibBuilder.loadTexts: stnAtmVpnTrunkOutVpnIdIfaceInvalid.setStatus('current') stn_atm_vpn_trunk_path_table = mib_table((1, 3, 6, 1, 4, 1, 3551, 2, 7, 1, 7, 1, 1, 2)) if mibBuilder.loadTexts: stnAtmVpnTrunkPathTable.setStatus('current') stn_atm_vpn_trunk_path_entry = mib_table_row((1, 3, 6, 1, 4, 1, 3551, 2, 7, 1, 7, 1, 1, 2, 1)).setIndexNames((0, 'STN-ATM-VPN-MIB', 'stnAtmVpnTrunkPathTrunkIfIndex'), (0, 'STN-ATM-VPN-MIB', 'stnAtmVpnTrunkPathVpnOUI'), (0, 'STN-ATM-VPN-MIB', 'stnAtmVpnTrunkPathVpnIndex'), (0, 'STN-ATM-VPN-MIB', 'stnAtmVpnTrunkPathVpnSubIndex')) if mibBuilder.loadTexts: stnAtmVpnTrunkPathEntry.setStatus('current') stn_atm_vpn_trunk_path_trunk_if_index = mib_table_column((1, 3, 6, 1, 4, 1, 3551, 2, 7, 1, 7, 1, 1, 2, 1, 1), interface_index()).setMaxAccess('readonly') if mibBuilder.loadTexts: stnAtmVpnTrunkPathTrunkIfIndex.setStatus('current') stn_atm_vpn_trunk_path_vpn_oui = mib_table_column((1, 3, 6, 1, 4, 1, 3551, 2, 7, 1, 7, 1, 1, 2, 1, 2), integer32()).setMaxAccess('readonly') if mibBuilder.loadTexts: stnAtmVpnTrunkPathVpnOUI.setStatus('current') stn_atm_vpn_trunk_path_vpn_index = mib_table_column((1, 3, 6, 1, 4, 1, 3551, 2, 7, 1, 7, 1, 1, 2, 1, 3), integer32()).setMaxAccess('readonly') if mibBuilder.loadTexts: stnAtmVpnTrunkPathVpnIndex.setStatus('current') stn_atm_vpn_trunk_path_vpn_sub_index = mib_table_column((1, 3, 6, 1, 4, 1, 3551, 2, 7, 1, 7, 1, 1, 2, 1, 4), integer32()).setMaxAccess('readonly') if mibBuilder.loadTexts: stnAtmVpnTrunkPathVpnSubIndex.setStatus('current') stn_atm_vpn_trunk_path_type = mib_table_column((1, 3, 6, 1, 4, 1, 3551, 2, 7, 1, 7, 1, 1, 2, 1, 5), integer32().subtype(subtypeSpec=constraints_union(single_value_constraint(1, 2))).clone(namedValues=named_values(('vpnLearnedPath', 1), ('vpnStaticPath', 2)))).setMaxAccess('readonly') if mibBuilder.loadTexts: stnAtmVpnTrunkPathType.setStatus('current') stn_atm_vpn_trunk_path_next_if_type = mib_table_column((1, 3, 6, 1, 4, 1, 3551, 2, 7, 1, 7, 1, 1, 2, 1, 6), integer32().subtype(subtypeSpec=constraints_union(single_value_constraint(1, 2))).clone(namedValues=named_values(('atmVpnLink', 1), ('atmVpnTrunk', 2)))).setMaxAccess('readonly') if mibBuilder.loadTexts: stnAtmVpnTrunkPathNextIfType.setStatus('current') stn_atm_vpn_trunk_path_next_if_index = mib_table_column((1, 3, 6, 1, 4, 1, 3551, 2, 7, 1, 7, 1, 1, 2, 1, 7), interface_index()).setMaxAccess('readonly') if mibBuilder.loadTexts: stnAtmVpnTrunkPathNextIfIndex.setStatus('current') stn_atm_vpn_trunk_path_in_packets = mib_table_column((1, 3, 6, 1, 4, 1, 3551, 2, 7, 1, 7, 1, 1, 2, 1, 8), counter64()).setMaxAccess('readonly') if mibBuilder.loadTexts: stnAtmVpnTrunkPathInPackets.setStatus('current') stn_atm_vpn_trunk_path_in_octets = mib_table_column((1, 3, 6, 1, 4, 1, 3551, 2, 7, 1, 7, 1, 1, 2, 1, 9), counter64()).setMaxAccess('readonly') if mibBuilder.loadTexts: stnAtmVpnTrunkPathInOctets.setStatus('current') stn_atm_vpn_trunk_path_out_packets = mib_table_column((1, 3, 6, 1, 4, 1, 3551, 2, 7, 1, 7, 1, 1, 2, 1, 10), counter64()).setMaxAccess('readonly') if mibBuilder.loadTexts: stnAtmVpnTrunkPathOutPackets.setStatus('current') stn_atm_vpn_trunk_path_out_octets = mib_table_column((1, 3, 6, 1, 4, 1, 3551, 2, 7, 1, 7, 1, 1, 2, 1, 11), counter64()).setMaxAccess('readonly') if mibBuilder.loadTexts: stnAtmVpnTrunkPathOutOctets.setStatus('current') stn_atm_vpn_link_table = mib_table((1, 3, 6, 1, 4, 1, 3551, 2, 7, 1, 7, 1, 2, 1)) if mibBuilder.loadTexts: stnAtmVpnLinkTable.setStatus('current') stn_atm_vpn_link_entry = mib_table_row((1, 3, 6, 1, 4, 1, 3551, 2, 7, 1, 7, 1, 2, 1, 1)).setIndexNames((0, 'STN-ATM-VPN-MIB', 'stnAtmVpnLinkIfIndex')) if mibBuilder.loadTexts: stnAtmVpnLinkEntry.setStatus('current') stn_atm_vpn_link_if_index = mib_table_column((1, 3, 6, 1, 4, 1, 3551, 2, 7, 1, 7, 1, 2, 1, 1, 1), interface_index()).setMaxAccess('readonly') if mibBuilder.loadTexts: stnAtmVpnLinkIfIndex.setStatus('current') stn_atm_vpn_link_vi_id = mib_table_column((1, 3, 6, 1, 4, 1, 3551, 2, 7, 1, 7, 1, 2, 1, 1, 2), integer32()).setMaxAccess('readonly') if mibBuilder.loadTexts: stnAtmVpnLinkViId.setStatus('current') stn_atm_vpn_link_name = mib_table_column((1, 3, 6, 1, 4, 1, 3551, 2, 7, 1, 7, 1, 2, 1, 1, 3), display_string().subtype(subtypeSpec=value_size_constraint(1, 32))).setMaxAccess('readonly') if mibBuilder.loadTexts: stnAtmVpnLinkName.setStatus('current') stn_atm_vpn_link_vpn_oui = mib_table_column((1, 3, 6, 1, 4, 1, 3551, 2, 7, 1, 7, 1, 2, 1, 1, 4), integer32()).setMaxAccess('readonly') if mibBuilder.loadTexts: stnAtmVpnLinkVpnOUI.setStatus('current') stn_atm_vpn_link_vpn_index = mib_table_column((1, 3, 6, 1, 4, 1, 3551, 2, 7, 1, 7, 1, 2, 1, 1, 5), integer32()).setMaxAccess('readonly') if mibBuilder.loadTexts: stnAtmVpnLinkVpnIndex.setStatus('current') stn_atm_vpn_link_vpn_sub_index = mib_table_column((1, 3, 6, 1, 4, 1, 3551, 2, 7, 1, 7, 1, 2, 1, 1, 6), integer32()).setMaxAccess('readonly') if mibBuilder.loadTexts: stnAtmVpnLinkVpnSubIndex.setStatus('current') stn_atm_vpn_link_state = mib_table_column((1, 3, 6, 1, 4, 1, 3551, 2, 7, 1, 7, 1, 2, 1, 1, 7), integer32().subtype(subtypeSpec=constraints_union(single_value_constraint(1, 2, 3))).clone(namedValues=named_values(('up', 1), ('down', 2), ('testing', 3)))).setMaxAccess('readonly') if mibBuilder.loadTexts: stnAtmVpnLinkState.setStatus('current') stn_atm_vpn_link_trunk_vi_id = mib_table_column((1, 3, 6, 1, 4, 1, 3551, 2, 7, 1, 7, 1, 2, 1, 1, 8), integer32()).setMaxAccess('readonly') if mibBuilder.loadTexts: stnAtmVpnLinkTrunkViId.setStatus('current') stn_atm_vpn_link_lower_if_index = mib_table_column((1, 3, 6, 1, 4, 1, 3551, 2, 7, 1, 7, 1, 2, 1, 1, 9), interface_index()).setMaxAccess('readonly') if mibBuilder.loadTexts: stnAtmVpnLinkLowerIfIndex.setStatus('current') stn_atm_vpn_link_out_unknown_vpn_id = mib_table_column((1, 3, 6, 1, 4, 1, 3551, 2, 7, 1, 7, 1, 2, 1, 1, 10), counter64()).setMaxAccess('readonly') if mibBuilder.loadTexts: stnAtmVpnLinkOutUnknownVpnId.setStatus('current') stn_atm_vpn_link_out_vpn_id_iface_invalid = mib_table_column((1, 3, 6, 1, 4, 1, 3551, 2, 7, 1, 7, 1, 2, 1, 1, 11), counter64()).setMaxAccess('readonly') if mibBuilder.loadTexts: stnAtmVpnLinkOutVpnIdIfaceInvalid.setStatus('current') stn_atm_vpn_link_in_vpn_id_iface_invalid = mib_table_column((1, 3, 6, 1, 4, 1, 3551, 2, 7, 1, 7, 1, 2, 1, 1, 12), counter64()).setMaxAccess('readonly') if mibBuilder.loadTexts: stnAtmVpnLinkInVpnIdIfaceInvalid.setStatus('current') mibBuilder.exportSymbols('STN-ATM-VPN-MIB', stnAtmVpnLinkIfIndex=stnAtmVpnLinkIfIndex, stnAtmVpnTrunkState=stnAtmVpnTrunkState, stnAtmVpnTrunkPathInOctets=stnAtmVpnTrunkPathInOctets, stnAtmVpnLinkLowerIfIndex=stnAtmVpnLinkLowerIfIndex, stnAtmVpnLinkInVpnIdIfaceInvalid=stnAtmVpnLinkInVpnIdIfaceInvalid, stnAtmVpnLinkObjects=stnAtmVpnLinkObjects, stnAtmVpnTrunkPathVpnSubIndex=stnAtmVpnTrunkPathVpnSubIndex, stnAtmVpnTrunkPathTable=stnAtmVpnTrunkPathTable, stnAtmVpn=stnAtmVpn, PYSNMP_MODULE_ID=stnAtmVpn, stnAtmVpnLinkState=stnAtmVpnLinkState, stnAtmVpnTrunkOutVpnIdIfaceInvalid=stnAtmVpnTrunkOutVpnIdIfaceInvalid, stnAtmVpnTrunkInVpnIdIfaceInvalid=stnAtmVpnTrunkInVpnIdIfaceInvalid, stnAtmVpnTrunkName=stnAtmVpnTrunkName, stnAtmVpnTrunkEntry=stnAtmVpnTrunkEntry, stnAtmVpnTrunkVpnPaths=stnAtmVpnTrunkVpnPaths, stnAtmVpnTrunkPathVpnOUI=stnAtmVpnTrunkPathVpnOUI, stnAtmVpnTrunkViId=stnAtmVpnTrunkViId, stnAtmVpnTrunkTable=stnAtmVpnTrunkTable, stnAtmVpnLinkVpnOUI=stnAtmVpnLinkVpnOUI, stnAtmVpnTrunkPathVpnIndex=stnAtmVpnTrunkPathVpnIndex, stnAtmVpnTrunkPathInPackets=stnAtmVpnTrunkPathInPackets, stnAtmVpnTrunkPathNextIfType=stnAtmVpnTrunkPathNextIfType, stnAtmVpnTrunkOutUnknownVpnId=stnAtmVpnTrunkOutUnknownVpnId, stnAtmVpnTrunkInUnknownVpnId=stnAtmVpnTrunkInUnknownVpnId, stnAtmVpnLinkOutUnknownVpnId=stnAtmVpnLinkOutUnknownVpnId, stnAtmVpnTrunkPathOutPackets=stnAtmVpnTrunkPathOutPackets, stnAtmVpnLinkTrunkViId=stnAtmVpnLinkTrunkViId, stnAtmVpnTrunkPathTrunkIfIndex=stnAtmVpnTrunkPathTrunkIfIndex, stnAtmVpnTrunkPathNextIfIndex=stnAtmVpnTrunkPathNextIfIndex, stnAtmVpnTrunkPathEntry=stnAtmVpnTrunkPathEntry, stnAtmVpnTrunkIfIndex=stnAtmVpnTrunkIfIndex, stnAtmVpnLinkTable=stnAtmVpnLinkTable, stnAtmVpnLinkOutVpnIdIfaceInvalid=stnAtmVpnLinkOutVpnIdIfaceInvalid, stnAtmVpnTrunkPathType=stnAtmVpnTrunkPathType, stnAtmVpnLinkVpnSubIndex=stnAtmVpnLinkVpnSubIndex, stnAtmVpnLinkName=stnAtmVpnLinkName, stnAtmVpnTrunkObjects=stnAtmVpnTrunkObjects, stnAtmVpnLinkVpnIndex=stnAtmVpnLinkVpnIndex, stnAtmVpnLinkEntry=stnAtmVpnLinkEntry, stnAtmVpnLinkViId=stnAtmVpnLinkViId, stnAtmVpnTrunkPathOutOctets=stnAtmVpnTrunkPathOutOctets, stnAtmVpnTrunkLowerIfIndex=stnAtmVpnTrunkLowerIfIndex)
class MenuItem: # Definiskan method info def info(self): print('Tampilkan nama dan harga dari menu item') menu_item1 = MenuItem() menu_item1.name = 'Roti Lapis' menu_item1.price = 5 # Panggil method info dari menu_item1 menu_item1.info() menu_item2 = MenuItem() menu_item2.name = 'Kue Coklat' menu_item2.price = 4 # Panggil method info dari menu_item2 menu_item2.info()
class Menuitem: def info(self): print('Tampilkan nama dan harga dari menu item') menu_item1 = menu_item() menu_item1.name = 'Roti Lapis' menu_item1.price = 5 menu_item1.info() menu_item2 = menu_item() menu_item2.name = 'Kue Coklat' menu_item2.price = 4 menu_item2.info()
#!/user/bin/python '''Number of Inversions '''
"""Number of Inversions """
class HideX(object): # def x(): # def fget(self): # return ~self.__x # def fset(self, x): # assert isinstance(x, int), 'x must be int' # self.__x = ~x # return locals() # x = property(**x()) @property def x(self): return ~self.__x @x.setter def x(self, x): assert isinstance(x, int), 'x must be int' self.__x = ~x o = HideX() o.x = 5 print(o.x) print(o._HideX__x)
class Hidex(object): @property def x(self): return ~self.__x @x.setter def x(self, x): assert isinstance(x, int), 'x must be int' self.__x = ~x o = hide_x() o.x = 5 print(o.x) print(o._HideX__x)
#coding=utf-8 ''' Created on 2015-10-10 @author: Devuser ''' class HomeTaskPath(object): left_nav_template_path="home/home_left_nav.html" sub_nav_template_path="task/home_task_leftsub_nav.html" task_index_path="task/home_task_index.html" class HomeProjectPath(object): left_nav_template_path="home/home_left_nav.html" sub_nav_template_path="project/home_project_leftsub_nav.html" project_list_template_path="project/home_project_listview.html" project_list_control_path="project/home_project_list_control.html" class HomeAutoTaskPath(object): left_nav_template_path="home/home_left_nav.html" sub_nav_template_path="autotask/home_autotask_leftsub_nav.html" project_list_template_path="autotask/home_autotask_listview.html" class HomeDashBoardPath(object): left_nav_template_path="home/home_left_nav.html" activity_template_path="dashboard/home_dashboard_activity.html" summary_template_path="dashboard/home_dashboard_summary.html" class HomeFortestingPath(object): left_nav_template_path="home/home_left_nav.html" sub_nav_template_path="fortesting/home_fortesting_leftsub_nav.html" class HomeIssuePath(object): left_nav_template_path="home/home_left_nav.html" sub_nav_template_path="issue/home_issue_leftsub_nav.html" home_issue_webapp="issue/home_issue_webapp.html" home_issue_index="issue/index.html" class HomeWebappsPath(object): webapps_index_path="webapps/home_webapp_index.html" left_nav_template_path="home/home_left_nav.html" sub_nav_template_path="webapps/home_webapps_leftsub_nav.html" webapps_webpart_path="webapps/home_webapp_webpart.html" webapps_create_dialog_path="webapps/home_webapp_create_dialog.html" class Home_unloginPagePath(object): home_page_path="home/home_page.html" home_welcome_path="home/home_page_welcome.html" home_project_summary_path="home/home_page_project_summary.html" home_device_page_path="home/home_page_device.html" class DevicePagePath(object): left_nav_template_path="home/home_left_nav.html" device_page_path="device/home_device_index.html" device_list_page="device/home_device_list_page.html" device_list_controll="device/home_device_list_controll.html"
""" Created on 2015-10-10 @author: Devuser """ class Hometaskpath(object): left_nav_template_path = 'home/home_left_nav.html' sub_nav_template_path = 'task/home_task_leftsub_nav.html' task_index_path = 'task/home_task_index.html' class Homeprojectpath(object): left_nav_template_path = 'home/home_left_nav.html' sub_nav_template_path = 'project/home_project_leftsub_nav.html' project_list_template_path = 'project/home_project_listview.html' project_list_control_path = 'project/home_project_list_control.html' class Homeautotaskpath(object): left_nav_template_path = 'home/home_left_nav.html' sub_nav_template_path = 'autotask/home_autotask_leftsub_nav.html' project_list_template_path = 'autotask/home_autotask_listview.html' class Homedashboardpath(object): left_nav_template_path = 'home/home_left_nav.html' activity_template_path = 'dashboard/home_dashboard_activity.html' summary_template_path = 'dashboard/home_dashboard_summary.html' class Homefortestingpath(object): left_nav_template_path = 'home/home_left_nav.html' sub_nav_template_path = 'fortesting/home_fortesting_leftsub_nav.html' class Homeissuepath(object): left_nav_template_path = 'home/home_left_nav.html' sub_nav_template_path = 'issue/home_issue_leftsub_nav.html' home_issue_webapp = 'issue/home_issue_webapp.html' home_issue_index = 'issue/index.html' class Homewebappspath(object): webapps_index_path = 'webapps/home_webapp_index.html' left_nav_template_path = 'home/home_left_nav.html' sub_nav_template_path = 'webapps/home_webapps_leftsub_nav.html' webapps_webpart_path = 'webapps/home_webapp_webpart.html' webapps_create_dialog_path = 'webapps/home_webapp_create_dialog.html' class Home_Unloginpagepath(object): home_page_path = 'home/home_page.html' home_welcome_path = 'home/home_page_welcome.html' home_project_summary_path = 'home/home_page_project_summary.html' home_device_page_path = 'home/home_page_device.html' class Devicepagepath(object): left_nav_template_path = 'home/home_left_nav.html' device_page_path = 'device/home_device_index.html' device_list_page = 'device/home_device_list_page.html' device_list_controll = 'device/home_device_list_controll.html'
class Reccomandation: def __init__(self, input_text): self.text = input_text def __get__(self, name ): return self.name
class Reccomandation: def __init__(self, input_text): self.text = input_text def __get__(self, name): return self.name
num_classes = 81 # model settings model = dict( type='SOLOv2', #pretrained='torchvision://resnet50', # The backbone weights will be overwritten when using load_from or resume_from. # https://github.com/open-mmlab/mmdetection/issues/7817#issuecomment-1108503826 backbone=dict( type='ResNet', depth=50, in_channels = 3, num_stages=4, out_indices=(0, 1, 2, 3), # C2, C3, C4, C5 frozen_stages=-1, # -1 is unfrozen, 0 -> C1 is frozen, 1 - C1, C2 are frozen and so on style='pytorch'), # norm_eval = True # true by default, "you're fine-tuning to minimize training, it's typically best to keep batch normalization frozen" # https://stackoverflow.com/questions/63016740/why-its-necessary-to-frozen-all-inner-state-of-a-batch-normalization-layer-when # required for traning from scratch neck=dict( type='FPN', in_channels=[256, 512, 1024, 2048], out_channels=256, start_level=0, num_outs=5), bbox_head=dict( type='SOLOv2Head', num_classes=num_classes, in_channels=256, stacked_convs=2, seg_feat_channels=256, strides=[8, 8, 16, 32, 32], scale_ranges=((1, 56), (28, 112), (56, 224), (112, 448), (224, 896)), sigma=0.2, num_grids=[40, 36, 24, 16, 12], ins_out_channels=128, loss_ins=dict( type='DiceLoss', use_sigmoid=True, loss_weight=3.0), loss_cate=dict( type='FocalLoss', use_sigmoid=True, gamma=2.0, alpha=0.25, loss_weight=1.0)), mask_feat_head=dict( type='MaskFeatHead', in_channels=256, out_channels=128, start_level=0, end_level=3, num_classes=128, norm_cfg=dict(type='GN', num_groups=32, requires_grad=True)), ) # training and testing settings train_cfg = dict() test_cfg = dict( nms_pre=500, score_thr=0.1, mask_thr=0.5, update_thr=0.05, kernel='gaussian', # gaussian/linear sigma=2.0, max_per_img=100)
num_classes = 81 model = dict(type='SOLOv2', backbone=dict(type='ResNet', depth=50, in_channels=3, num_stages=4, out_indices=(0, 1, 2, 3), frozen_stages=-1, style='pytorch'), neck=dict(type='FPN', in_channels=[256, 512, 1024, 2048], out_channels=256, start_level=0, num_outs=5), bbox_head=dict(type='SOLOv2Head', num_classes=num_classes, in_channels=256, stacked_convs=2, seg_feat_channels=256, strides=[8, 8, 16, 32, 32], scale_ranges=((1, 56), (28, 112), (56, 224), (112, 448), (224, 896)), sigma=0.2, num_grids=[40, 36, 24, 16, 12], ins_out_channels=128, loss_ins=dict(type='DiceLoss', use_sigmoid=True, loss_weight=3.0), loss_cate=dict(type='FocalLoss', use_sigmoid=True, gamma=2.0, alpha=0.25, loss_weight=1.0)), mask_feat_head=dict(type='MaskFeatHead', in_channels=256, out_channels=128, start_level=0, end_level=3, num_classes=128, norm_cfg=dict(type='GN', num_groups=32, requires_grad=True))) train_cfg = dict() test_cfg = dict(nms_pre=500, score_thr=0.1, mask_thr=0.5, update_thr=0.05, kernel='gaussian', sigma=2.0, max_per_img=100)
#!/usr/bin/env prey async def main(): word = input("Give me a word: ") await x(f"echo {word}")
async def main(): word = input('Give me a word: ') await x(f'echo {word}')
class ToolConfig (): def __init__ (self): self.one = './data/onetwothree1.wav' self.two = './data/onetwothree8.wav' self.digits_path = './data/digits'
class Toolconfig: def __init__(self): self.one = './data/onetwothree1.wav' self.two = './data/onetwothree8.wav' self.digits_path = './data/digits'
# # PySNMP MIB module SW-DES3x50-ACLMGMT-MIB (http://snmplabs.com/pysmi) # ASN.1 source file:///Users/davwang4/Dev/mibs.snmplabs.com/asn1/SW-DES3x50-ACLMGMT-MIB # Produced by pysmi-0.3.4 at Wed May 1 15:12:30 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") ValueRangeConstraint, SingleValueConstraint, ValueSizeConstraint, ConstraintsIntersection, ConstraintsUnion = mibBuilder.importSymbols("ASN1-REFINEMENT", "ValueRangeConstraint", "SingleValueConstraint", "ValueSizeConstraint", "ConstraintsIntersection", "ConstraintsUnion") dlink_mgmt, = mibBuilder.importSymbols("DLINK-ID-REC-MIB", "dlink-mgmt") PortList, = mibBuilder.importSymbols("Q-BRIDGE-MIB", "PortList") SnmpAdminString, = mibBuilder.importSymbols("SNMP-FRAMEWORK-MIB", "SnmpAdminString") NotificationGroup, ModuleCompliance = mibBuilder.importSymbols("SNMPv2-CONF", "NotificationGroup", "ModuleCompliance") Counter64, NotificationType, iso, MibIdentifier, Integer32, IpAddress, MibScalar, MibTable, MibTableRow, MibTableColumn, Counter32, Gauge32, ObjectIdentity, Bits, TimeTicks, ModuleIdentity, Unsigned32 = mibBuilder.importSymbols("SNMPv2-SMI", "Counter64", "NotificationType", "iso", "MibIdentifier", "Integer32", "IpAddress", "MibScalar", "MibTable", "MibTableRow", "MibTableColumn", "Counter32", "Gauge32", "ObjectIdentity", "Bits", "TimeTicks", "ModuleIdentity", "Unsigned32") DisplayString, RowStatus, TextualConvention, MacAddress = mibBuilder.importSymbols("SNMPv2-TC", "DisplayString", "RowStatus", "TextualConvention", "MacAddress") swAclMgmtMIB = ModuleIdentity((1, 3, 6, 1, 4, 1, 171, 11, 5)) if mibBuilder.loadTexts: swAclMgmtMIB.setLastUpdated('0007150000Z') if mibBuilder.loadTexts: swAclMgmtMIB.setOrganization('enterprise, Inc.') if mibBuilder.loadTexts: swAclMgmtMIB.setContactInfo(' Customer Service Postal: Tel: E-mail: ') if mibBuilder.loadTexts: swAclMgmtMIB.setDescription('The Structure of Access Control List Information for the proprietary enterprise.') swAclMaskMgmt = MibIdentifier((1, 3, 6, 1, 4, 1, 171, 11, 5, 1)) swAclRuleMgmt = MibIdentifier((1, 3, 6, 1, 4, 1, 171, 11, 5, 2)) swACLEthernetTable = MibTable((1, 3, 6, 1, 4, 1, 171, 11, 5, 1, 1), ) if mibBuilder.loadTexts: swACLEthernetTable.setStatus('current') if mibBuilder.loadTexts: swACLEthernetTable.setDescription("This table contain ACL mask of Ethernet information. Access profiles will be created on the switch by row creation and to define which parts of each incoming frame's layer 2 part of header the switch will examine. Masks can be entered that will be combined with the values the switch finds in the specified frame header fields. ") swACLEthernetEntry = MibTableRow((1, 3, 6, 1, 4, 1, 171, 11, 5, 1, 1, 1), ).setIndexNames((0, "SW-DES3x50-ACLMGMT-MIB", "swACLEthernetProfileID")) if mibBuilder.loadTexts: swACLEthernetEntry.setStatus('current') if mibBuilder.loadTexts: swACLEthernetEntry.setDescription('A list of information about ACL of Ethernet.') swACLEthernetProfileID = MibTableColumn((1, 3, 6, 1, 4, 1, 171, 11, 5, 1, 1, 1, 1), Integer32().subtype(subtypeSpec=ValueRangeConstraint(1, 255))).setMaxAccess("readonly") if mibBuilder.loadTexts: swACLEthernetProfileID.setStatus('current') if mibBuilder.loadTexts: swACLEthernetProfileID.setDescription('The ID of ACL mask entry ,and is unique in the mask list.') swACLEthernetUsevlan = MibTableColumn((1, 3, 6, 1, 4, 1, 171, 11, 5, 1, 1, 1, 2), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2))).clone(namedValues=NamedValues(("enabled", 1), ("disabled", 2)))).setMaxAccess("readcreate") if mibBuilder.loadTexts: swACLEthernetUsevlan.setStatus('current') if mibBuilder.loadTexts: swACLEthernetUsevlan.setDescription('Specifies that the switch will examine the VLAN part of each packet header.') swACLEthernetMacAddrMaskState = MibTableColumn((1, 3, 6, 1, 4, 1, 171, 11, 5, 1, 1, 1, 3), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2, 3, 4))).clone(namedValues=NamedValues(("other", 1), ("dst-mac-addr", 2), ("src-mac-addr", 3), ("dst-src-mac-addr", 4)))).setMaxAccess("readcreate") if mibBuilder.loadTexts: swACLEthernetMacAddrMaskState.setStatus('current') if mibBuilder.loadTexts: swACLEthernetMacAddrMaskState.setDescription("This object indicates the status of MAC address mask. other(1) - Neither source MAC address nor destination MAC address are masked. dst-mac-addr(2) - recieved frames's destination MAC address are currently used to be filtered as it meets with the MAC address entry of the table. src-mac-addr(3) - recieved frames's source MAC address are currently used to be filtered as it meets with the MAC address entry of the table. dst-src-mac-addr(4) - recieved frames's destination MAC address or source MAC address are currently used to be filtered as it meets with the MAC address entry of the table.") swACLEthernetSrcMacAddrMask = MibTableColumn((1, 3, 6, 1, 4, 1, 171, 11, 5, 1, 1, 1, 4), MacAddress()).setMaxAccess("readcreate") if mibBuilder.loadTexts: swACLEthernetSrcMacAddrMask.setStatus('current') if mibBuilder.loadTexts: swACLEthernetSrcMacAddrMask.setDescription('This object Specifies the MAC address mask for the source MAC address.') swACLEthernetDstMacAddrMask = MibTableColumn((1, 3, 6, 1, 4, 1, 171, 11, 5, 1, 1, 1, 5), MacAddress()).setMaxAccess("readcreate") if mibBuilder.loadTexts: swACLEthernetDstMacAddrMask.setStatus('current') if mibBuilder.loadTexts: swACLEthernetDstMacAddrMask.setDescription('This object Specifies the MAC address mask for the destination MAC address.') swACLEthernetUse8021p = MibTableColumn((1, 3, 6, 1, 4, 1, 171, 11, 5, 1, 1, 1, 6), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2))).clone(namedValues=NamedValues(("enabled", 1), ("disabled", 2)))).setMaxAccess("readcreate") if mibBuilder.loadTexts: swACLEthernetUse8021p.setStatus('current') if mibBuilder.loadTexts: swACLEthernetUse8021p.setDescription("Specifies if the switch will examine the 802.1p priority value in the frame's header or not.") swACLEthernetUseEthernetType = MibTableColumn((1, 3, 6, 1, 4, 1, 171, 11, 5, 1, 1, 1, 7), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2))).clone(namedValues=NamedValues(("enabled", 1), ("disabled", 2)))).setMaxAccess("readcreate") if mibBuilder.loadTexts: swACLEthernetUseEthernetType.setStatus('current') if mibBuilder.loadTexts: swACLEthernetUseEthernetType.setDescription("Specifies if the switch will examine the Ethernet type value in each frame's header or not.") swACLEthernetPort = MibTableColumn((1, 3, 6, 1, 4, 1, 171, 11, 5, 1, 1, 1, 8), PortList().subtype(subtypeSpec=ValueSizeConstraint(0, 127))).setMaxAccess("readcreate") if mibBuilder.loadTexts: swACLEthernetPort.setStatus('current') if mibBuilder.loadTexts: swACLEthernetPort.setDescription('.') swACLEthernetRowStatus = MibTableColumn((1, 3, 6, 1, 4, 1, 171, 11, 5, 1, 1, 1, 9), RowStatus()).setMaxAccess("readcreate") if mibBuilder.loadTexts: swACLEthernetRowStatus.setStatus('current') if mibBuilder.loadTexts: swACLEthernetRowStatus.setDescription('This object indicates the status of this entry.') swACLIpTable = MibTable((1, 3, 6, 1, 4, 1, 171, 11, 5, 1, 2), ) if mibBuilder.loadTexts: swACLIpTable.setStatus('current') if mibBuilder.loadTexts: swACLIpTable.setDescription("This table contain ACL mask of IP information. Access profiles will be created on the switch by row creation and to define which parts of each incoming frame's IP layer part of header the switch will examine. Masks can be entered that will be combined with the values the switch finds in the specified frame header fields.") swACLIpEntry = MibTableRow((1, 3, 6, 1, 4, 1, 171, 11, 5, 1, 2, 1), ).setIndexNames((0, "SW-DES3x50-ACLMGMT-MIB", "swACLIpProfileID")) if mibBuilder.loadTexts: swACLIpEntry.setStatus('current') if mibBuilder.loadTexts: swACLIpEntry.setDescription('A list of information about ACL of IP Layer.') swACLIpProfileID = MibTableColumn((1, 3, 6, 1, 4, 1, 171, 11, 5, 1, 2, 1, 1), Integer32().subtype(subtypeSpec=ValueRangeConstraint(1, 255))).setMaxAccess("readonly") if mibBuilder.loadTexts: swACLIpProfileID.setStatus('current') if mibBuilder.loadTexts: swACLIpProfileID.setDescription('The ID of ACL mask entry ,and is unique in the mask list.') swACLIpUsevlan = MibTableColumn((1, 3, 6, 1, 4, 1, 171, 11, 5, 1, 2, 1, 2), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2))).clone(namedValues=NamedValues(("enabled", 1), ("disabled", 2)))).setMaxAccess("readcreate") if mibBuilder.loadTexts: swACLIpUsevlan.setStatus('current') if mibBuilder.loadTexts: swACLIpUsevlan.setDescription('This object indicates if IP layer vlan is examined or not.') swACLIpIpAddrMaskState = MibTableColumn((1, 3, 6, 1, 4, 1, 171, 11, 5, 1, 2, 1, 3), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2, 3, 4))).clone(namedValues=NamedValues(("other", 1), ("dst-ip-addr", 2), ("src-ip-addr", 3), ("dst-src-ip-addr", 4)))).setMaxAccess("readcreate") if mibBuilder.loadTexts: swACLIpIpAddrMaskState.setStatus('current') if mibBuilder.loadTexts: swACLIpIpAddrMaskState.setDescription("This object indicates the status of IP address mask. other(1) - Neither source IP address nor destination IP address are masked. dst-ip-addr(2) - recieved frames's destination IP address are currently used to be filtered as it meets with the IP address entry of the table. src-ip-addr(3) - recieved frames's source IP address are currently used to be filtered as it meets with the IP address entry of the table. dst-src-ip-addr(4) - recieved frames's destination IP address or source IP address are currently used to be filtered as it meets with the IP address entry of the table.") swACLIpSrcIpAddrMask = MibTableColumn((1, 3, 6, 1, 4, 1, 171, 11, 5, 1, 2, 1, 4), IpAddress()).setMaxAccess("readcreate") if mibBuilder.loadTexts: swACLIpSrcIpAddrMask.setStatus('current') if mibBuilder.loadTexts: swACLIpSrcIpAddrMask.setDescription('This object Specifies IP address mask for the source IP address.') swACLIpDstIpAddrMask = MibTableColumn((1, 3, 6, 1, 4, 1, 171, 11, 5, 1, 2, 1, 5), IpAddress()).setMaxAccess("readcreate") if mibBuilder.loadTexts: swACLIpDstIpAddrMask.setStatus('current') if mibBuilder.loadTexts: swACLIpDstIpAddrMask.setDescription('This object Specifies the IP address mask for the destination IP address.') swACLIpUseDSCP = MibTableColumn((1, 3, 6, 1, 4, 1, 171, 11, 5, 1, 2, 1, 6), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2))).clone(namedValues=NamedValues(("enabled", 1), ("disabled", 2)))).setMaxAccess("readcreate") if mibBuilder.loadTexts: swACLIpUseDSCP.setStatus('current') if mibBuilder.loadTexts: swACLIpUseDSCP.setDescription('This object indicates DSCP protocol is is examined or not.') swACLIpUseProtoType = MibTableColumn((1, 3, 6, 1, 4, 1, 171, 11, 5, 1, 2, 1, 7), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2, 3, 4, 5, 6))).clone(namedValues=NamedValues(("none", 1), ("icmp", 2), ("igmp", 3), ("tcp", 4), ("udp", 5), ("protocolId", 6)))).setMaxAccess("readcreate") if mibBuilder.loadTexts: swACLIpUseProtoType.setStatus('current') if mibBuilder.loadTexts: swACLIpUseProtoType.setDescription('That object indicates which protocol will be examined.') swACLIpIcmpOption = MibTableColumn((1, 3, 6, 1, 4, 1, 171, 11, 5, 1, 2, 1, 8), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2, 3, 4))).clone(namedValues=NamedValues(("none", 1), ("type", 2), ("code", 3), ("type-code", 4)))).setMaxAccess("readcreate") if mibBuilder.loadTexts: swACLIpIcmpOption.setStatus('current') if mibBuilder.loadTexts: swACLIpIcmpOption.setDescription('This object indicates which fields should be filled in of ICMP. none(1)- two fields are null. type(2)- type field should be filled in. code(3)- code field should be filled in. type-code(4)- not only type fileld but code field should be filled in. ') swACLIpIgmpOption = MibTableColumn((1, 3, 6, 1, 4, 1, 171, 11, 5, 1, 2, 1, 9), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2))).clone(namedValues=NamedValues(("enable", 1), ("disable", 2)))).setMaxAccess("readcreate") if mibBuilder.loadTexts: swACLIpIgmpOption.setStatus('current') if mibBuilder.loadTexts: swACLIpIgmpOption.setDescription('This object indicates Options of IGMP is examined or not.') swACLIpTcpOption = MibTableColumn((1, 3, 6, 1, 4, 1, 171, 11, 5, 1, 2, 1, 10), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2, 3, 4))).clone(namedValues=NamedValues(("other", 1), ("dst-addr", 2), ("src-addr", 3), ("dst-src-addr", 4)))).setMaxAccess("readcreate") if mibBuilder.loadTexts: swACLIpTcpOption.setStatus('current') if mibBuilder.loadTexts: swACLIpTcpOption.setDescription("This object indicates the status of filtered address of TCP. other(1) - Neither source port nor destination port are masked. dst-addr(2) - recieved frames's destination port are currently used to be filtered . src-addr(3) - recieved frames's source port are currently used to be filtered . dst-src-addr(4) - both recieved frames's destination port and source port are currently used to be filtered .") swACLIpUdpOption = MibTableColumn((1, 3, 6, 1, 4, 1, 171, 11, 5, 1, 2, 1, 11), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2, 3, 4))).clone(namedValues=NamedValues(("other", 1), ("dst-addr", 2), ("src-addr", 3), ("dst-src-addr", 4)))).setMaxAccess("readcreate") if mibBuilder.loadTexts: swACLIpUdpOption.setStatus('current') if mibBuilder.loadTexts: swACLIpUdpOption.setDescription("This object indicates the status of filtered address of UDP . other(1) - Neither source port nor destination port are masked. dst-addr(2) - recieved frames's destination port are currently used to be filtered . src-addr(3) - recieved frames's source port are currently used to be filtered . dst-src-addr(4) - recieved frames's destination port or source port are currently used to be filtered.") swACLIpTCPorUDPSrcPortMask = MibTableColumn((1, 3, 6, 1, 4, 1, 171, 11, 5, 1, 2, 1, 12), OctetString().subtype(subtypeSpec=ValueSizeConstraint(2, 2)).setFixedLength(2)).setMaxAccess("readcreate") if mibBuilder.loadTexts: swACLIpTCPorUDPSrcPortMask.setStatus('current') if mibBuilder.loadTexts: swACLIpTCPorUDPSrcPortMask.setDescription('Specifies a TCP port mask for the source port if swACLIpUseProtoType is TCP Specifies a UDP port mask for the source port if swACLIpUseProtoType is UDP. ') swACLIpTCPorUDPDstPortMask = MibTableColumn((1, 3, 6, 1, 4, 1, 171, 11, 5, 1, 2, 1, 13), OctetString().subtype(subtypeSpec=ValueSizeConstraint(2, 2)).setFixedLength(2)).setMaxAccess("readcreate") if mibBuilder.loadTexts: swACLIpTCPorUDPDstPortMask.setStatus('current') if mibBuilder.loadTexts: swACLIpTCPorUDPDstPortMask.setDescription('Specifies a TCP port mask for the destination port if swACLIpUseProtoType is TCP Specifies a UDP port mask for the destination port if swACLIpUseProtoType is UDP.') swACLIpTCPFlagBit = MibTableColumn((1, 3, 6, 1, 4, 1, 171, 11, 5, 1, 2, 1, 14), Integer32().subtype(subtypeSpec=ValueRangeConstraint(0, 63))).setMaxAccess("readcreate") if mibBuilder.loadTexts: swACLIpTCPFlagBit.setStatus('current') if mibBuilder.loadTexts: swACLIpTCPFlagBit.setDescription('Specifies a TCP connection flag mask.') swACLIpProtoIDOption = MibTableColumn((1, 3, 6, 1, 4, 1, 171, 11, 5, 1, 2, 1, 15), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2))).clone(namedValues=NamedValues(("enable", 1), ("disable", 2)))).setMaxAccess("readcreate") if mibBuilder.loadTexts: swACLIpProtoIDOption.setStatus('current') if mibBuilder.loadTexts: swACLIpProtoIDOption.setDescription("Specifies that the switch will examine each frame's Protocol ID field or not.") swACLIpProtoIDMask = MibTableColumn((1, 3, 6, 1, 4, 1, 171, 11, 5, 1, 2, 1, 16), OctetString().subtype(subtypeSpec=ValueSizeConstraint(4, 4)).setFixedLength(4)).setMaxAccess("readcreate") if mibBuilder.loadTexts: swACLIpProtoIDMask.setStatus('current') if mibBuilder.loadTexts: swACLIpProtoIDMask.setDescription('Specifies that the rule applies to the IP protocol ID and the mask options behind the IP header.') swACLIpPort = MibTableColumn((1, 3, 6, 1, 4, 1, 171, 11, 5, 1, 2, 1, 17), PortList().subtype(subtypeSpec=ValueSizeConstraint(0, 127))).setMaxAccess("readcreate") if mibBuilder.loadTexts: swACLIpPort.setStatus('current') if mibBuilder.loadTexts: swACLIpPort.setDescription('.') swACLIpRowStatus = MibTableColumn((1, 3, 6, 1, 4, 1, 171, 11, 5, 1, 2, 1, 18), RowStatus()).setMaxAccess("readcreate") if mibBuilder.loadTexts: swACLIpRowStatus.setStatus('current') if mibBuilder.loadTexts: swACLIpRowStatus.setDescription('This object indicates the status of this entry.') swACLPayloadTable = MibTable((1, 3, 6, 1, 4, 1, 171, 11, 5, 1, 3), ) if mibBuilder.loadTexts: swACLPayloadTable.setStatus('current') if mibBuilder.loadTexts: swACLPayloadTable.setDescription('') swACLPayloadEntry = MibTableRow((1, 3, 6, 1, 4, 1, 171, 11, 5, 1, 3, 1), ).setIndexNames((0, "SW-DES3x50-ACLMGMT-MIB", "swACLPayloadProfileID")) if mibBuilder.loadTexts: swACLPayloadEntry.setStatus('current') if mibBuilder.loadTexts: swACLPayloadEntry.setDescription('') swACLPayloadProfileID = MibTableColumn((1, 3, 6, 1, 4, 1, 171, 11, 5, 1, 3, 1, 1), Integer32().subtype(subtypeSpec=ValueRangeConstraint(1, 255))).setMaxAccess("readonly") if mibBuilder.loadTexts: swACLPayloadProfileID.setStatus('current') if mibBuilder.loadTexts: swACLPayloadProfileID.setDescription('.') swACLPayloadOffSet0to15 = MibTableColumn((1, 3, 6, 1, 4, 1, 171, 11, 5, 1, 3, 1, 2), OctetString().subtype(subtypeSpec=ValueSizeConstraint(16, 16)).setFixedLength(16)).setMaxAccess("readcreate") if mibBuilder.loadTexts: swACLPayloadOffSet0to15.setStatus('current') if mibBuilder.loadTexts: swACLPayloadOffSet0to15.setDescription('.') swACLPayloadOffSet16to31 = MibTableColumn((1, 3, 6, 1, 4, 1, 171, 11, 5, 1, 3, 1, 3), OctetString().subtype(subtypeSpec=ValueSizeConstraint(16, 16)).setFixedLength(16)).setMaxAccess("readcreate") if mibBuilder.loadTexts: swACLPayloadOffSet16to31.setStatus('current') if mibBuilder.loadTexts: swACLPayloadOffSet16to31.setDescription('.') swACLPayloadOffSet32to47 = MibTableColumn((1, 3, 6, 1, 4, 1, 171, 11, 5, 1, 3, 1, 4), OctetString().subtype(subtypeSpec=ValueSizeConstraint(16, 16)).setFixedLength(16)).setMaxAccess("readcreate") if mibBuilder.loadTexts: swACLPayloadOffSet32to47.setStatus('current') if mibBuilder.loadTexts: swACLPayloadOffSet32to47.setDescription('.') swACLPayloadOffSet48to63 = MibTableColumn((1, 3, 6, 1, 4, 1, 171, 11, 5, 1, 3, 1, 5), OctetString().subtype(subtypeSpec=ValueSizeConstraint(16, 16)).setFixedLength(16)).setMaxAccess("readcreate") if mibBuilder.loadTexts: swACLPayloadOffSet48to63.setStatus('current') if mibBuilder.loadTexts: swACLPayloadOffSet48to63.setDescription('.') swACLPayloadOffSet64to79 = MibTableColumn((1, 3, 6, 1, 4, 1, 171, 11, 5, 1, 3, 1, 6), OctetString().subtype(subtypeSpec=ValueSizeConstraint(16, 16)).setFixedLength(16)).setMaxAccess("readcreate") if mibBuilder.loadTexts: swACLPayloadOffSet64to79.setStatus('current') if mibBuilder.loadTexts: swACLPayloadOffSet64to79.setDescription('.') swACLPayloadPort = MibTableColumn((1, 3, 6, 1, 4, 1, 171, 11, 5, 1, 3, 1, 7), PortList().subtype(subtypeSpec=ValueSizeConstraint(0, 127))).setMaxAccess("readcreate") if mibBuilder.loadTexts: swACLPayloadPort.setStatus('current') if mibBuilder.loadTexts: swACLPayloadPort.setDescription('.') swACLPayloadRowStatus = MibTableColumn((1, 3, 6, 1, 4, 1, 171, 11, 5, 1, 3, 1, 8), RowStatus()).setMaxAccess("readcreate") if mibBuilder.loadTexts: swACLPayloadRowStatus.setStatus('current') if mibBuilder.loadTexts: swACLPayloadRowStatus.setDescription('.') swACLEtherRuleTable = MibTable((1, 3, 6, 1, 4, 1, 171, 11, 5, 2, 1), ) if mibBuilder.loadTexts: swACLEtherRuleTable.setStatus('current') if mibBuilder.loadTexts: swACLEtherRuleTable.setDescription('This table contain ACL rule of ethernet information.') swACLEtherRuleEntry = MibTableRow((1, 3, 6, 1, 4, 1, 171, 11, 5, 2, 1, 1), ).setIndexNames((0, "SW-DES3x50-ACLMGMT-MIB", "swACLEtherRuleProfileID"), (0, "SW-DES3x50-ACLMGMT-MIB", "swACLEtherRuleAccessID")) if mibBuilder.loadTexts: swACLEtherRuleEntry.setStatus('current') if mibBuilder.loadTexts: swACLEtherRuleEntry.setDescription('A list of information about ACL rule of the layer 2 part of each packet.') swACLEtherRuleProfileID = MibTableColumn((1, 3, 6, 1, 4, 1, 171, 11, 5, 2, 1, 1, 1), Integer32().subtype(subtypeSpec=ValueRangeConstraint(1, 255))).setMaxAccess("readonly") if mibBuilder.loadTexts: swACLEtherRuleProfileID.setStatus('current') if mibBuilder.loadTexts: swACLEtherRuleProfileID.setDescription('The ID of ACL mask entry ,and is unique in the mask list.') swACLEtherRuleAccessID = MibTableColumn((1, 3, 6, 1, 4, 1, 171, 11, 5, 2, 1, 1, 2), Integer32().subtype(subtypeSpec=ValueRangeConstraint(1, 255))).setMaxAccess("readonly") if mibBuilder.loadTexts: swACLEtherRuleAccessID.setStatus('current') if mibBuilder.loadTexts: swACLEtherRuleAccessID.setDescription('The ID of ACL rule entry relate to swACLEtherRuleProfileID.') swACLEtherRuleVlan = MibTableColumn((1, 3, 6, 1, 4, 1, 171, 11, 5, 2, 1, 1, 3), SnmpAdminString().subtype(subtypeSpec=ValueSizeConstraint(1, 32))).setMaxAccess("readcreate") if mibBuilder.loadTexts: swACLEtherRuleVlan.setStatus('current') if mibBuilder.loadTexts: swACLEtherRuleVlan.setDescription('Specifies that the access will apply to only to this VLAN.') swACLEtherRuleSrcMacAddress = MibTableColumn((1, 3, 6, 1, 4, 1, 171, 11, 5, 2, 1, 1, 4), MacAddress()).setMaxAccess("readcreate") if mibBuilder.loadTexts: swACLEtherRuleSrcMacAddress.setStatus('current') if mibBuilder.loadTexts: swACLEtherRuleSrcMacAddress.setDescription('Specifies that the access will apply to only packets with this source MAC address.') swACLEtherRuleDstMacAddress = MibTableColumn((1, 3, 6, 1, 4, 1, 171, 11, 5, 2, 1, 1, 5), MacAddress()).setMaxAccess("readcreate") if mibBuilder.loadTexts: swACLEtherRuleDstMacAddress.setStatus('current') if mibBuilder.loadTexts: swACLEtherRuleDstMacAddress.setDescription('Specifies that the access will apply to only packets with this destination MAC address.') swACLEtherRule8021P = MibTableColumn((1, 3, 6, 1, 4, 1, 171, 11, 5, 2, 1, 1, 6), Integer32().subtype(subtypeSpec=ValueRangeConstraint(0, 7))).setMaxAccess("readcreate") if mibBuilder.loadTexts: swACLEtherRule8021P.setStatus('current') if mibBuilder.loadTexts: swACLEtherRule8021P.setDescription('Specifies that the access will apply only to packets with this 802.1p priority value.') swACLEtherRuleEtherType = MibTableColumn((1, 3, 6, 1, 4, 1, 171, 11, 5, 2, 1, 1, 7), OctetString().subtype(subtypeSpec=ValueSizeConstraint(2, 2)).setFixedLength(2)).setMaxAccess("readcreate") if mibBuilder.loadTexts: swACLEtherRuleEtherType.setStatus('current') if mibBuilder.loadTexts: swACLEtherRuleEtherType.setDescription('Specifies that the access will apply only to packets with this hexidecimal 802.1Q Ethernet type value in the packet header.') swACLEtherRuleEnablePriority = MibTableColumn((1, 3, 6, 1, 4, 1, 171, 11, 5, 2, 1, 1, 8), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2))).clone(namedValues=NamedValues(("enabled", 1), ("disabled", 2)))).setMaxAccess("readcreate") if mibBuilder.loadTexts: swACLEtherRuleEnablePriority.setStatus('current') if mibBuilder.loadTexts: swACLEtherRuleEnablePriority.setDescription('Specifies that the access will apply only to packets with priority value.') swACLEtherRulePriority = MibTableColumn((1, 3, 6, 1, 4, 1, 171, 11, 5, 2, 1, 1, 9), Integer32().subtype(subtypeSpec=ValueRangeConstraint(0, 7))).setMaxAccess("readcreate") if mibBuilder.loadTexts: swACLEtherRulePriority.setStatus('current') if mibBuilder.loadTexts: swACLEtherRulePriority.setDescription('Specific the priority will change to the packets while the swACLEtherRuleReplacePriority is enabled .') swACLEtherRuleReplacePriority = MibTableColumn((1, 3, 6, 1, 4, 1, 171, 11, 5, 2, 1, 1, 10), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2))).clone(namedValues=NamedValues(("enabled", 1), ("disabled", 2)))).setMaxAccess("readcreate") if mibBuilder.loadTexts: swACLEtherRuleReplacePriority.setStatus('current') if mibBuilder.loadTexts: swACLEtherRuleReplacePriority.setDescription('Specific the packets that match the access profile will changed the 802.1p priority tag field by the switch or not .') swACLEtherRuleEnableReplaceDscp = MibTableColumn((1, 3, 6, 1, 4, 1, 171, 11, 5, 2, 1, 1, 11), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2))).clone(namedValues=NamedValues(("enabled", 1), ("disabled", 2)))).setMaxAccess("readcreate") if mibBuilder.loadTexts: swACLEtherRuleEnableReplaceDscp.setStatus('current') if mibBuilder.loadTexts: swACLEtherRuleEnableReplaceDscp.setDescription('Specific the packets that match the access profile will replaced the DSCP field by the switch or not .') swACLEtherRuleRepDscp = MibTableColumn((1, 3, 6, 1, 4, 1, 171, 11, 5, 2, 1, 1, 12), Integer32().subtype(subtypeSpec=ValueRangeConstraint(0, 63))).setMaxAccess("readcreate") if mibBuilder.loadTexts: swACLEtherRuleRepDscp.setStatus('current') if mibBuilder.loadTexts: swACLEtherRuleRepDscp.setDescription('specify a value to be written to the DSCP field of an incoming packet that meets the criteria specified in the first part of the command. This value will over-write the value in the DSCP field of the packet.') swACLEtherRulePermit = MibTableColumn((1, 3, 6, 1, 4, 1, 171, 11, 5, 2, 1, 1, 13), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2))).clone(namedValues=NamedValues(("permit", 1), ("deny", 2)))).setMaxAccess("readcreate") if mibBuilder.loadTexts: swACLEtherRulePermit.setStatus('current') if mibBuilder.loadTexts: swACLEtherRulePermit.setDescription('This object indicates resoult of examination is permit or deny;default is permit(1) permit - Specifies that packets that match the access profile are permitted to be forwarded by the switch. deny - Specifies that packets that do not match the access profile are not permitted to be forwarded by the switch and will be filtered.') swACLEtherRuleRowStatus = MibTableColumn((1, 3, 6, 1, 4, 1, 171, 11, 5, 2, 1, 1, 14), RowStatus()).setMaxAccess("readcreate") if mibBuilder.loadTexts: swACLEtherRuleRowStatus.setStatus('current') if mibBuilder.loadTexts: swACLEtherRuleRowStatus.setDescription('This object indicates the status of this entry.') swACLIpRuleTable = MibTable((1, 3, 6, 1, 4, 1, 171, 11, 5, 2, 2), ) if mibBuilder.loadTexts: swACLIpRuleTable.setStatus('current') if mibBuilder.loadTexts: swACLIpRuleTable.setDescription('.') swACLIpRuleEntry = MibTableRow((1, 3, 6, 1, 4, 1, 171, 11, 5, 2, 2, 1), ).setIndexNames((0, "SW-DES3x50-ACLMGMT-MIB", "swACLIpRuleProfileID"), (0, "SW-DES3x50-ACLMGMT-MIB", "swACLIpRuleAccessID")) if mibBuilder.loadTexts: swACLIpRuleEntry.setStatus('current') if mibBuilder.loadTexts: swACLIpRuleEntry.setDescription('.') swACLIpRuleProfileID = MibTableColumn((1, 3, 6, 1, 4, 1, 171, 11, 5, 2, 2, 1, 1), Integer32().subtype(subtypeSpec=ValueRangeConstraint(1, 255))).setMaxAccess("readonly") if mibBuilder.loadTexts: swACLIpRuleProfileID.setStatus('current') if mibBuilder.loadTexts: swACLIpRuleProfileID.setDescription('The ID of ACL mask entry ,and is unique in the mask list.') swACLIpRuleAccessID = MibTableColumn((1, 3, 6, 1, 4, 1, 171, 11, 5, 2, 2, 1, 2), Integer32().subtype(subtypeSpec=ValueRangeConstraint(1, 255))).setMaxAccess("readonly") if mibBuilder.loadTexts: swACLIpRuleAccessID.setStatus('current') if mibBuilder.loadTexts: swACLIpRuleAccessID.setDescription('The ID of ACL IP rule entry .') swACLIpRuleVlan = MibTableColumn((1, 3, 6, 1, 4, 1, 171, 11, 5, 2, 2, 1, 3), SnmpAdminString().subtype(subtypeSpec=ValueSizeConstraint(1, 32))).setMaxAccess("readcreate") if mibBuilder.loadTexts: swACLIpRuleVlan.setStatus('current') if mibBuilder.loadTexts: swACLIpRuleVlan.setDescription('Specifies that the access will apply to only to this VLAN.') swACLIpRuleSrcIpaddress = MibTableColumn((1, 3, 6, 1, 4, 1, 171, 11, 5, 2, 2, 1, 4), IpAddress()).setMaxAccess("readcreate") if mibBuilder.loadTexts: swACLIpRuleSrcIpaddress.setStatus('current') if mibBuilder.loadTexts: swACLIpRuleSrcIpaddress.setDescription('Specific an IP source address.') swACLIpRuleDstIpaddress = MibTableColumn((1, 3, 6, 1, 4, 1, 171, 11, 5, 2, 2, 1, 5), IpAddress()).setMaxAccess("readcreate") if mibBuilder.loadTexts: swACLIpRuleDstIpaddress.setStatus('current') if mibBuilder.loadTexts: swACLIpRuleDstIpaddress.setDescription('Specific an IP destination address.') swACLIpRuleDscp = MibTableColumn((1, 3, 6, 1, 4, 1, 171, 11, 5, 2, 2, 1, 6), Integer32().subtype(subtypeSpec=ValueRangeConstraint(0, 63))).setMaxAccess("readcreate") if mibBuilder.loadTexts: swACLIpRuleDscp.setStatus('current') if mibBuilder.loadTexts: swACLIpRuleDscp.setDescription('Specific the value of dscp, the value can be configured 0 to 63') swACLIpRuleProtocol = MibTableColumn((1, 3, 6, 1, 4, 1, 171, 11, 5, 2, 2, 1, 7), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2, 3, 4, 5, 6))).clone(namedValues=NamedValues(("none", 1), ("icmp", 2), ("igmp", 3), ("tcp", 4), ("udp", 5), ("protocolId", 6)))).setMaxAccess("readonly") if mibBuilder.loadTexts: swACLIpRuleProtocol.setStatus('current') if mibBuilder.loadTexts: swACLIpRuleProtocol.setDescription('Specifies the IP protocol which has been configured in swACLIpEntry .') swACLIpRuleType = MibTableColumn((1, 3, 6, 1, 4, 1, 171, 11, 5, 2, 2, 1, 8), Integer32().subtype(subtypeSpec=ValueRangeConstraint(0, 255))).setMaxAccess("readcreate") if mibBuilder.loadTexts: swACLIpRuleType.setStatus('current') if mibBuilder.loadTexts: swACLIpRuleType.setDescription('Specific that the rule applies to the value of icmp type traffic.') swACLIpRuleCode = MibTableColumn((1, 3, 6, 1, 4, 1, 171, 11, 5, 2, 2, 1, 9), Integer32().subtype(subtypeSpec=ValueRangeConstraint(0, 255))).setMaxAccess("readcreate") if mibBuilder.loadTexts: swACLIpRuleCode.setStatus('current') if mibBuilder.loadTexts: swACLIpRuleCode.setDescription('Specific that the rule applies to the value of icmp code traffic.') swACLIpRuleSrcPort = MibTableColumn((1, 3, 6, 1, 4, 1, 171, 11, 5, 2, 2, 1, 10), Integer32().subtype(subtypeSpec=ValueRangeConstraint(0, 65535))).setMaxAccess("readcreate") if mibBuilder.loadTexts: swACLIpRuleSrcPort.setStatus('current') if mibBuilder.loadTexts: swACLIpRuleSrcPort.setDescription('Specific that the rule applies the range of tcp/udp source port') swACLIpRuleDstPort = MibTableColumn((1, 3, 6, 1, 4, 1, 171, 11, 5, 2, 2, 1, 11), Integer32().subtype(subtypeSpec=ValueRangeConstraint(0, 65535))).setMaxAccess("readcreate") if mibBuilder.loadTexts: swACLIpRuleDstPort.setStatus('current') if mibBuilder.loadTexts: swACLIpRuleDstPort.setDescription('Specific the range of tcp/udp destination port range') swACLIpRuleFlagBits = MibTableColumn((1, 3, 6, 1, 4, 1, 171, 11, 5, 2, 2, 1, 12), Integer32().subtype(subtypeSpec=ValueRangeConstraint(0, 63))).setMaxAccess("readcreate") if mibBuilder.loadTexts: swACLIpRuleFlagBits.setStatus('current') if mibBuilder.loadTexts: swACLIpRuleFlagBits.setDescription('A value which indicates the set of TCP flags that this entity may potentially offers. The value is a sum. This sum initially takes the value zero, Then, for each flag, L, in the range 1 through 6, that this node performs transactions for, 2 raised to (L - 1) is added to the sum. Note that values should be calculated accordingly: Flag functionality 6 urg bit 5 ack bit 4 rsh bit 3 rst bit 2 syn bit 1 fin bit For example,it you want to enable urg bit and ack bit,you should set vlaue 48(2^(5-1) + 2^(6-1)).') swACLIpRuleProtoID = MibTableColumn((1, 3, 6, 1, 4, 1, 171, 11, 5, 2, 2, 1, 13), Integer32().subtype(subtypeSpec=ValueRangeConstraint(0, 255))).setMaxAccess("readcreate") if mibBuilder.loadTexts: swACLIpRuleProtoID.setStatus('current') if mibBuilder.loadTexts: swACLIpRuleProtoID.setDescription('Specific that the rule applies to the value of ip protocol id traffic') swACLIpRuleUserMask = MibTableColumn((1, 3, 6, 1, 4, 1, 171, 11, 5, 2, 2, 1, 14), OctetString().subtype(subtypeSpec=ValueSizeConstraint(4, 4)).setFixedLength(4)).setMaxAccess("readcreate") if mibBuilder.loadTexts: swACLIpRuleUserMask.setStatus('current') if mibBuilder.loadTexts: swACLIpRuleUserMask.setDescription('Specific that the rule applies to the ip protocol id and the range of options behind the IP header.') swACLIpRuleEnablePriority = MibTableColumn((1, 3, 6, 1, 4, 1, 171, 11, 5, 2, 2, 1, 15), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2))).clone(namedValues=NamedValues(("enabled", 1), ("disabled", 2)))).setMaxAccess("readcreate") if mibBuilder.loadTexts: swACLIpRuleEnablePriority.setStatus('current') if mibBuilder.loadTexts: swACLIpRuleEnablePriority.setDescription('Specifies that the access will apply only to packets with priority value.') swACLIpRulePriority = MibTableColumn((1, 3, 6, 1, 4, 1, 171, 11, 5, 2, 2, 1, 16), Integer32().subtype(subtypeSpec=ValueRangeConstraint(0, 7))).setMaxAccess("readcreate") if mibBuilder.loadTexts: swACLIpRulePriority.setStatus('current') if mibBuilder.loadTexts: swACLIpRulePriority.setDescription('Specifies that the access profile will apply to packets that contain this value in their 802.1p priority field of their header.') swACLIpRuleReplacePriority = MibTableColumn((1, 3, 6, 1, 4, 1, 171, 11, 5, 2, 2, 1, 17), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2))).clone(namedValues=NamedValues(("enabled", 1), ("disabled", 2)))).setMaxAccess("readcreate") if mibBuilder.loadTexts: swACLIpRuleReplacePriority.setStatus('current') if mibBuilder.loadTexts: swACLIpRuleReplacePriority.setDescription('Specific the packets that match the access profile will changed the 802.1p priority tag field by the switch or not .') swACLIpRuleEnableReplaceDscp = MibTableColumn((1, 3, 6, 1, 4, 1, 171, 11, 5, 2, 2, 1, 18), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2))).clone(namedValues=NamedValues(("enabled", 1), ("disabled", 2)))).setMaxAccess("readcreate") if mibBuilder.loadTexts: swACLIpRuleEnableReplaceDscp.setStatus('current') if mibBuilder.loadTexts: swACLIpRuleEnableReplaceDscp.setDescription('Indicate weather the DSCP field can be over-write or not. ') swACLIpRuleRepDscp = MibTableColumn((1, 3, 6, 1, 4, 1, 171, 11, 5, 2, 2, 1, 19), Integer32().subtype(subtypeSpec=ValueRangeConstraint(0, 63))).setMaxAccess("readcreate") if mibBuilder.loadTexts: swACLIpRuleRepDscp.setStatus('current') if mibBuilder.loadTexts: swACLIpRuleRepDscp.setDescription('specify a value to be written to the DSCP field of an incoming packet that meets the criteria specified in the first part of the command. This value will over-write the value in the DSCP field of the packet.') swACLIpRulePermit = MibTableColumn((1, 3, 6, 1, 4, 1, 171, 11, 5, 2, 2, 1, 20), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2))).clone(namedValues=NamedValues(("deny", 1), ("permit", 2)))).setMaxAccess("readcreate") if mibBuilder.loadTexts: swACLIpRulePermit.setStatus('current') if mibBuilder.loadTexts: swACLIpRulePermit.setDescription('This object indicates filter is permit or deny; default is permit(1)') swACLIpRuleRowStatus = MibTableColumn((1, 3, 6, 1, 4, 1, 171, 11, 5, 2, 2, 1, 21), RowStatus()).setMaxAccess("readcreate") if mibBuilder.loadTexts: swACLIpRuleRowStatus.setStatus('current') if mibBuilder.loadTexts: swACLIpRuleRowStatus.setDescription('This object indicates the status of this entry.') swACLPayloadRuleTable = MibTable((1, 3, 6, 1, 4, 1, 171, 11, 5, 2, 3), ) if mibBuilder.loadTexts: swACLPayloadRuleTable.setStatus('current') if mibBuilder.loadTexts: swACLPayloadRuleTable.setDescription('') swACLPayloadRuleEntry = MibTableRow((1, 3, 6, 1, 4, 1, 171, 11, 5, 2, 3, 1), ).setIndexNames((0, "SW-DES3x50-ACLMGMT-MIB", "swACLPayloadRuleProfileID"), (0, "SW-DES3x50-ACLMGMT-MIB", "swACLPayloadRuleAccessID")) if mibBuilder.loadTexts: swACLPayloadRuleEntry.setStatus('current') if mibBuilder.loadTexts: swACLPayloadRuleEntry.setDescription('') swACLPayloadRuleProfileID = MibTableColumn((1, 3, 6, 1, 4, 1, 171, 11, 5, 2, 3, 1, 1), Integer32().subtype(subtypeSpec=ValueRangeConstraint(1, 255))).setMaxAccess("readonly") if mibBuilder.loadTexts: swACLPayloadRuleProfileID.setStatus('current') if mibBuilder.loadTexts: swACLPayloadRuleProfileID.setDescription('') swACLPayloadRuleAccessID = MibTableColumn((1, 3, 6, 1, 4, 1, 171, 11, 5, 2, 3, 1, 2), Integer32().subtype(subtypeSpec=ValueRangeConstraint(1, 255))).setMaxAccess("readonly") if mibBuilder.loadTexts: swACLPayloadRuleAccessID.setStatus('current') if mibBuilder.loadTexts: swACLPayloadRuleAccessID.setDescription('') swACLPayloadRuleOffSet0to15 = MibTableColumn((1, 3, 6, 1, 4, 1, 171, 11, 5, 2, 3, 1, 3), OctetString().subtype(subtypeSpec=ValueSizeConstraint(16, 16)).setFixedLength(16)).setMaxAccess("readcreate") if mibBuilder.loadTexts: swACLPayloadRuleOffSet0to15.setStatus('current') if mibBuilder.loadTexts: swACLPayloadRuleOffSet0to15.setDescription('') swACLPayloadRuleOffSet16to31 = MibTableColumn((1, 3, 6, 1, 4, 1, 171, 11, 5, 2, 3, 1, 4), OctetString().subtype(subtypeSpec=ValueSizeConstraint(16, 16)).setFixedLength(16)).setMaxAccess("readcreate") if mibBuilder.loadTexts: swACLPayloadRuleOffSet16to31.setStatus('current') if mibBuilder.loadTexts: swACLPayloadRuleOffSet16to31.setDescription('') swACLPayloadRuleOffSet32to47 = MibTableColumn((1, 3, 6, 1, 4, 1, 171, 11, 5, 2, 3, 1, 5), OctetString().subtype(subtypeSpec=ValueSizeConstraint(16, 16)).setFixedLength(16)).setMaxAccess("readcreate") if mibBuilder.loadTexts: swACLPayloadRuleOffSet32to47.setStatus('current') if mibBuilder.loadTexts: swACLPayloadRuleOffSet32to47.setDescription('') swACLPayloadRuleOffSet48to63 = MibTableColumn((1, 3, 6, 1, 4, 1, 171, 11, 5, 2, 3, 1, 6), OctetString().subtype(subtypeSpec=ValueSizeConstraint(16, 16)).setFixedLength(16)).setMaxAccess("readcreate") if mibBuilder.loadTexts: swACLPayloadRuleOffSet48to63.setStatus('current') if mibBuilder.loadTexts: swACLPayloadRuleOffSet48to63.setDescription('') swACLPayloadRuleOffSet64to79 = MibTableColumn((1, 3, 6, 1, 4, 1, 171, 11, 5, 2, 3, 1, 7), OctetString().subtype(subtypeSpec=ValueSizeConstraint(16, 16)).setFixedLength(16)).setMaxAccess("readcreate") if mibBuilder.loadTexts: swACLPayloadRuleOffSet64to79.setStatus('current') if mibBuilder.loadTexts: swACLPayloadRuleOffSet64to79.setDescription('') swACLPayloadRuleEnablePriority = MibTableColumn((1, 3, 6, 1, 4, 1, 171, 11, 5, 2, 3, 1, 8), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2))).clone(namedValues=NamedValues(("enabled", 1), ("disabled", 2)))).setMaxAccess("readcreate") if mibBuilder.loadTexts: swACLPayloadRuleEnablePriority.setStatus('current') if mibBuilder.loadTexts: swACLPayloadRuleEnablePriority.setDescription('') swACLPayloadRulePriority = MibTableColumn((1, 3, 6, 1, 4, 1, 171, 11, 5, 2, 3, 1, 9), Integer32().subtype(subtypeSpec=ValueRangeConstraint(0, 7))).setMaxAccess("readcreate") if mibBuilder.loadTexts: swACLPayloadRulePriority.setStatus('current') if mibBuilder.loadTexts: swACLPayloadRulePriority.setDescription('Specifies that the access profile will apply to packets that contain this value in their 802.1p priority field of their header.') swACLPayloadRuleReplacePriority = MibTableColumn((1, 3, 6, 1, 4, 1, 171, 11, 5, 2, 3, 1, 10), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2))).clone(namedValues=NamedValues(("enabled", 1), ("disabled", 2)))).setMaxAccess("readcreate") if mibBuilder.loadTexts: swACLPayloadRuleReplacePriority.setStatus('current') if mibBuilder.loadTexts: swACLPayloadRuleReplacePriority.setDescription('') swACLPayloadRuleEnableReplaceDscp = MibTableColumn((1, 3, 6, 1, 4, 1, 171, 11, 5, 2, 3, 1, 11), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2))).clone(namedValues=NamedValues(("enabled", 1), ("disabled", 2)))).setMaxAccess("readcreate") if mibBuilder.loadTexts: swACLPayloadRuleEnableReplaceDscp.setStatus('current') if mibBuilder.loadTexts: swACLPayloadRuleEnableReplaceDscp.setDescription('Indicate wether the DSCP field can be over-write or not ') swACLPayloadRuleRepDscp = MibTableColumn((1, 3, 6, 1, 4, 1, 171, 11, 5, 2, 3, 1, 12), Integer32().subtype(subtypeSpec=ValueRangeConstraint(0, 63))).setMaxAccess("readcreate") if mibBuilder.loadTexts: swACLPayloadRuleRepDscp.setStatus('current') if mibBuilder.loadTexts: swACLPayloadRuleRepDscp.setDescription('specify a value to be written to the DSCP field of an incoming packet that meets the criteria specified in the first part of the command. This value will over-write the value in the DSCP field of the packet.') swACLPayloadRulePermit = MibTableColumn((1, 3, 6, 1, 4, 1, 171, 11, 5, 2, 3, 1, 13), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2))).clone(namedValues=NamedValues(("permit", 1), ("deny", 2)))).setMaxAccess("readcreate") if mibBuilder.loadTexts: swACLPayloadRulePermit.setStatus('current') if mibBuilder.loadTexts: swACLPayloadRulePermit.setDescription('') swACLPayloadRuleRowStatus = MibTableColumn((1, 3, 6, 1, 4, 1, 171, 11, 5, 2, 3, 1, 14), RowStatus()).setMaxAccess("readcreate") if mibBuilder.loadTexts: swACLPayloadRuleRowStatus.setStatus('current') if mibBuilder.loadTexts: swACLPayloadRuleRowStatus.setDescription('') mibBuilder.exportSymbols("SW-DES3x50-ACLMGMT-MIB", swACLIpUseDSCP=swACLIpUseDSCP, swACLIpRuleFlagBits=swACLIpRuleFlagBits, swACLEthernetPort=swACLEthernetPort, swACLIpRuleEntry=swACLIpRuleEntry, swACLIpUdpOption=swACLIpUdpOption, swACLIpRuleSrcPort=swACLIpRuleSrcPort, swACLPayloadRuleEnablePriority=swACLPayloadRuleEnablePriority, swACLPayloadOffSet48to63=swACLPayloadOffSet48to63, swACLIpTCPorUDPDstPortMask=swACLIpTCPorUDPDstPortMask, swACLPayloadOffSet64to79=swACLPayloadOffSet64to79, swACLPayloadRuleOffSet16to31=swACLPayloadRuleOffSet16to31, swACLIpIgmpOption=swACLIpIgmpOption, swACLEtherRuleDstMacAddress=swACLEtherRuleDstMacAddress, swAclMgmtMIB=swAclMgmtMIB, swACLIpRulePermit=swACLIpRulePermit, swACLIpRuleProtocol=swACLIpRuleProtocol, swACLIpUsevlan=swACLIpUsevlan, swACLPayloadRulePriority=swACLPayloadRulePriority, swACLIpRuleDstIpaddress=swACLIpRuleDstIpaddress, swACLIpEntry=swACLIpEntry, swACLIpRuleEnableReplaceDscp=swACLIpRuleEnableReplaceDscp, swACLIpSrcIpAddrMask=swACLIpSrcIpAddrMask, swACLEtherRuleRowStatus=swACLEtherRuleRowStatus, swACLIpRuleEnablePriority=swACLIpRuleEnablePriority, swACLIpRuleType=swACLIpRuleType, swACLIpRuleUserMask=swACLIpRuleUserMask, swACLIpUseProtoType=swACLIpUseProtoType, swACLIpRulePriority=swACLIpRulePriority, swACLIpRuleSrcIpaddress=swACLIpRuleSrcIpaddress, swACLPayloadProfileID=swACLPayloadProfileID, swACLEthernetTable=swACLEthernetTable, swACLIpTCPorUDPSrcPortMask=swACLIpTCPorUDPSrcPortMask, swACLPayloadPort=swACLPayloadPort, swACLPayloadRuleOffSet32to47=swACLPayloadRuleOffSet32to47, swAclMaskMgmt=swAclMaskMgmt, swACLPayloadRuleRowStatus=swACLPayloadRuleRowStatus, swACLEthernetRowStatus=swACLEthernetRowStatus, swACLEtherRuleEntry=swACLEtherRuleEntry, swACLIpRuleAccessID=swACLIpRuleAccessID, swACLIpTable=swACLIpTable, swACLEthernetUseEthernetType=swACLEthernetUseEthernetType, swACLIpTcpOption=swACLIpTcpOption, swACLEtherRuleTable=swACLEtherRuleTable, swACLIpRuleCode=swACLIpRuleCode, swACLEthernetProfileID=swACLEthernetProfileID, swAclRuleMgmt=swAclRuleMgmt, swACLEthernetSrcMacAddrMask=swACLEthernetSrcMacAddrMask, swACLPayloadOffSet16to31=swACLPayloadOffSet16to31, swACLPayloadRuleOffSet64to79=swACLPayloadRuleOffSet64to79, swACLIpTCPFlagBit=swACLIpTCPFlagBit, swACLPayloadRuleTable=swACLPayloadRuleTable, swACLEthernetEntry=swACLEthernetEntry, swACLEtherRuleSrcMacAddress=swACLEtherRuleSrcMacAddress, PYSNMP_MODULE_ID=swAclMgmtMIB, swACLEthernetUse8021p=swACLEthernetUse8021p, swACLPayloadRuleEnableReplaceDscp=swACLPayloadRuleEnableReplaceDscp, swACLPayloadOffSet0to15=swACLPayloadOffSet0to15, swACLIpRuleVlan=swACLIpRuleVlan, swACLIpProtoIDMask=swACLIpProtoIDMask, swACLPayloadRulePermit=swACLPayloadRulePermit, swACLPayloadRuleEntry=swACLPayloadRuleEntry, swACLEthernetMacAddrMaskState=swACLEthernetMacAddrMaskState, swACLEtherRuleReplacePriority=swACLEtherRuleReplacePriority, swACLEtherRuleRepDscp=swACLEtherRuleRepDscp, swACLEtherRule8021P=swACLEtherRule8021P, swACLIpRowStatus=swACLIpRowStatus, swACLPayloadRuleOffSet48to63=swACLPayloadRuleOffSet48to63, swACLIpDstIpAddrMask=swACLIpDstIpAddrMask, swACLPayloadTable=swACLPayloadTable, swACLIpProtoIDOption=swACLIpProtoIDOption, swACLEtherRuleProfileID=swACLEtherRuleProfileID, swACLIpRuleTable=swACLIpRuleTable, swACLEtherRuleVlan=swACLEtherRuleVlan, swACLPayloadEntry=swACLPayloadEntry, swACLPayloadRuleAccessID=swACLPayloadRuleAccessID, swACLEthernetUsevlan=swACLEthernetUsevlan, swACLPayloadOffSet32to47=swACLPayloadOffSet32to47, swACLIpRuleRowStatus=swACLIpRuleRowStatus, swACLEtherRuleEnablePriority=swACLEtherRuleEnablePriority, swACLIpPort=swACLIpPort, swACLPayloadRuleReplacePriority=swACLPayloadRuleReplacePriority, swACLEtherRulePriority=swACLEtherRulePriority, swACLIpRuleDstPort=swACLIpRuleDstPort, swACLIpRuleRepDscp=swACLIpRuleRepDscp, swACLPayloadRowStatus=swACLPayloadRowStatus, swACLEtherRuleEnableReplaceDscp=swACLEtherRuleEnableReplaceDscp, swACLEthernetDstMacAddrMask=swACLEthernetDstMacAddrMask, swACLIpProfileID=swACLIpProfileID, swACLIpRuleProfileID=swACLIpRuleProfileID, swACLPayloadRuleRepDscp=swACLPayloadRuleRepDscp, swACLIpRuleProtoID=swACLIpRuleProtoID, swACLEtherRuleAccessID=swACLEtherRuleAccessID, swACLEtherRulePermit=swACLEtherRulePermit, swACLIpIcmpOption=swACLIpIcmpOption, swACLIpIpAddrMaskState=swACLIpIpAddrMaskState, swACLEtherRuleEtherType=swACLEtherRuleEtherType, swACLPayloadRuleProfileID=swACLPayloadRuleProfileID, swACLPayloadRuleOffSet0to15=swACLPayloadRuleOffSet0to15, swACLIpRuleReplacePriority=swACLIpRuleReplacePriority, swACLIpRuleDscp=swACLIpRuleDscp)
(octet_string, object_identifier, integer) = mibBuilder.importSymbols('ASN1', 'OctetString', 'ObjectIdentifier', 'Integer') (named_values,) = mibBuilder.importSymbols('ASN1-ENUMERATION', 'NamedValues') (value_range_constraint, single_value_constraint, value_size_constraint, constraints_intersection, constraints_union) = mibBuilder.importSymbols('ASN1-REFINEMENT', 'ValueRangeConstraint', 'SingleValueConstraint', 'ValueSizeConstraint', 'ConstraintsIntersection', 'ConstraintsUnion') (dlink_mgmt,) = mibBuilder.importSymbols('DLINK-ID-REC-MIB', 'dlink-mgmt') (port_list,) = mibBuilder.importSymbols('Q-BRIDGE-MIB', 'PortList') (snmp_admin_string,) = mibBuilder.importSymbols('SNMP-FRAMEWORK-MIB', 'SnmpAdminString') (notification_group, module_compliance) = mibBuilder.importSymbols('SNMPv2-CONF', 'NotificationGroup', 'ModuleCompliance') (counter64, notification_type, iso, mib_identifier, integer32, ip_address, mib_scalar, mib_table, mib_table_row, mib_table_column, counter32, gauge32, object_identity, bits, time_ticks, module_identity, unsigned32) = mibBuilder.importSymbols('SNMPv2-SMI', 'Counter64', 'NotificationType', 'iso', 'MibIdentifier', 'Integer32', 'IpAddress', 'MibScalar', 'MibTable', 'MibTableRow', 'MibTableColumn', 'Counter32', 'Gauge32', 'ObjectIdentity', 'Bits', 'TimeTicks', 'ModuleIdentity', 'Unsigned32') (display_string, row_status, textual_convention, mac_address) = mibBuilder.importSymbols('SNMPv2-TC', 'DisplayString', 'RowStatus', 'TextualConvention', 'MacAddress') sw_acl_mgmt_mib = module_identity((1, 3, 6, 1, 4, 1, 171, 11, 5)) if mibBuilder.loadTexts: swAclMgmtMIB.setLastUpdated('0007150000Z') if mibBuilder.loadTexts: swAclMgmtMIB.setOrganization('enterprise, Inc.') if mibBuilder.loadTexts: swAclMgmtMIB.setContactInfo(' Customer Service Postal: Tel: E-mail: ') if mibBuilder.loadTexts: swAclMgmtMIB.setDescription('The Structure of Access Control List Information for the proprietary enterprise.') sw_acl_mask_mgmt = mib_identifier((1, 3, 6, 1, 4, 1, 171, 11, 5, 1)) sw_acl_rule_mgmt = mib_identifier((1, 3, 6, 1, 4, 1, 171, 11, 5, 2)) sw_acl_ethernet_table = mib_table((1, 3, 6, 1, 4, 1, 171, 11, 5, 1, 1)) if mibBuilder.loadTexts: swACLEthernetTable.setStatus('current') if mibBuilder.loadTexts: swACLEthernetTable.setDescription("This table contain ACL mask of Ethernet information. Access profiles will be created on the switch by row creation and to define which parts of each incoming frame's layer 2 part of header the switch will examine. Masks can be entered that will be combined with the values the switch finds in the specified frame header fields. ") sw_acl_ethernet_entry = mib_table_row((1, 3, 6, 1, 4, 1, 171, 11, 5, 1, 1, 1)).setIndexNames((0, 'SW-DES3x50-ACLMGMT-MIB', 'swACLEthernetProfileID')) if mibBuilder.loadTexts: swACLEthernetEntry.setStatus('current') if mibBuilder.loadTexts: swACLEthernetEntry.setDescription('A list of information about ACL of Ethernet.') sw_acl_ethernet_profile_id = mib_table_column((1, 3, 6, 1, 4, 1, 171, 11, 5, 1, 1, 1, 1), integer32().subtype(subtypeSpec=value_range_constraint(1, 255))).setMaxAccess('readonly') if mibBuilder.loadTexts: swACLEthernetProfileID.setStatus('current') if mibBuilder.loadTexts: swACLEthernetProfileID.setDescription('The ID of ACL mask entry ,and is unique in the mask list.') sw_acl_ethernet_usevlan = mib_table_column((1, 3, 6, 1, 4, 1, 171, 11, 5, 1, 1, 1, 2), integer32().subtype(subtypeSpec=constraints_union(single_value_constraint(1, 2))).clone(namedValues=named_values(('enabled', 1), ('disabled', 2)))).setMaxAccess('readcreate') if mibBuilder.loadTexts: swACLEthernetUsevlan.setStatus('current') if mibBuilder.loadTexts: swACLEthernetUsevlan.setDescription('Specifies that the switch will examine the VLAN part of each packet header.') sw_acl_ethernet_mac_addr_mask_state = mib_table_column((1, 3, 6, 1, 4, 1, 171, 11, 5, 1, 1, 1, 3), integer32().subtype(subtypeSpec=constraints_union(single_value_constraint(1, 2, 3, 4))).clone(namedValues=named_values(('other', 1), ('dst-mac-addr', 2), ('src-mac-addr', 3), ('dst-src-mac-addr', 4)))).setMaxAccess('readcreate') if mibBuilder.loadTexts: swACLEthernetMacAddrMaskState.setStatus('current') if mibBuilder.loadTexts: swACLEthernetMacAddrMaskState.setDescription("This object indicates the status of MAC address mask. other(1) - Neither source MAC address nor destination MAC address are masked. dst-mac-addr(2) - recieved frames's destination MAC address are currently used to be filtered as it meets with the MAC address entry of the table. src-mac-addr(3) - recieved frames's source MAC address are currently used to be filtered as it meets with the MAC address entry of the table. dst-src-mac-addr(4) - recieved frames's destination MAC address or source MAC address are currently used to be filtered as it meets with the MAC address entry of the table.") sw_acl_ethernet_src_mac_addr_mask = mib_table_column((1, 3, 6, 1, 4, 1, 171, 11, 5, 1, 1, 1, 4), mac_address()).setMaxAccess('readcreate') if mibBuilder.loadTexts: swACLEthernetSrcMacAddrMask.setStatus('current') if mibBuilder.loadTexts: swACLEthernetSrcMacAddrMask.setDescription('This object Specifies the MAC address mask for the source MAC address.') sw_acl_ethernet_dst_mac_addr_mask = mib_table_column((1, 3, 6, 1, 4, 1, 171, 11, 5, 1, 1, 1, 5), mac_address()).setMaxAccess('readcreate') if mibBuilder.loadTexts: swACLEthernetDstMacAddrMask.setStatus('current') if mibBuilder.loadTexts: swACLEthernetDstMacAddrMask.setDescription('This object Specifies the MAC address mask for the destination MAC address.') sw_acl_ethernet_use8021p = mib_table_column((1, 3, 6, 1, 4, 1, 171, 11, 5, 1, 1, 1, 6), integer32().subtype(subtypeSpec=constraints_union(single_value_constraint(1, 2))).clone(namedValues=named_values(('enabled', 1), ('disabled', 2)))).setMaxAccess('readcreate') if mibBuilder.loadTexts: swACLEthernetUse8021p.setStatus('current') if mibBuilder.loadTexts: swACLEthernetUse8021p.setDescription("Specifies if the switch will examine the 802.1p priority value in the frame's header or not.") sw_acl_ethernet_use_ethernet_type = mib_table_column((1, 3, 6, 1, 4, 1, 171, 11, 5, 1, 1, 1, 7), integer32().subtype(subtypeSpec=constraints_union(single_value_constraint(1, 2))).clone(namedValues=named_values(('enabled', 1), ('disabled', 2)))).setMaxAccess('readcreate') if mibBuilder.loadTexts: swACLEthernetUseEthernetType.setStatus('current') if mibBuilder.loadTexts: swACLEthernetUseEthernetType.setDescription("Specifies if the switch will examine the Ethernet type value in each frame's header or not.") sw_acl_ethernet_port = mib_table_column((1, 3, 6, 1, 4, 1, 171, 11, 5, 1, 1, 1, 8), port_list().subtype(subtypeSpec=value_size_constraint(0, 127))).setMaxAccess('readcreate') if mibBuilder.loadTexts: swACLEthernetPort.setStatus('current') if mibBuilder.loadTexts: swACLEthernetPort.setDescription('.') sw_acl_ethernet_row_status = mib_table_column((1, 3, 6, 1, 4, 1, 171, 11, 5, 1, 1, 1, 9), row_status()).setMaxAccess('readcreate') if mibBuilder.loadTexts: swACLEthernetRowStatus.setStatus('current') if mibBuilder.loadTexts: swACLEthernetRowStatus.setDescription('This object indicates the status of this entry.') sw_acl_ip_table = mib_table((1, 3, 6, 1, 4, 1, 171, 11, 5, 1, 2)) if mibBuilder.loadTexts: swACLIpTable.setStatus('current') if mibBuilder.loadTexts: swACLIpTable.setDescription("This table contain ACL mask of IP information. Access profiles will be created on the switch by row creation and to define which parts of each incoming frame's IP layer part of header the switch will examine. Masks can be entered that will be combined with the values the switch finds in the specified frame header fields.") sw_acl_ip_entry = mib_table_row((1, 3, 6, 1, 4, 1, 171, 11, 5, 1, 2, 1)).setIndexNames((0, 'SW-DES3x50-ACLMGMT-MIB', 'swACLIpProfileID')) if mibBuilder.loadTexts: swACLIpEntry.setStatus('current') if mibBuilder.loadTexts: swACLIpEntry.setDescription('A list of information about ACL of IP Layer.') sw_acl_ip_profile_id = mib_table_column((1, 3, 6, 1, 4, 1, 171, 11, 5, 1, 2, 1, 1), integer32().subtype(subtypeSpec=value_range_constraint(1, 255))).setMaxAccess('readonly') if mibBuilder.loadTexts: swACLIpProfileID.setStatus('current') if mibBuilder.loadTexts: swACLIpProfileID.setDescription('The ID of ACL mask entry ,and is unique in the mask list.') sw_acl_ip_usevlan = mib_table_column((1, 3, 6, 1, 4, 1, 171, 11, 5, 1, 2, 1, 2), integer32().subtype(subtypeSpec=constraints_union(single_value_constraint(1, 2))).clone(namedValues=named_values(('enabled', 1), ('disabled', 2)))).setMaxAccess('readcreate') if mibBuilder.loadTexts: swACLIpUsevlan.setStatus('current') if mibBuilder.loadTexts: swACLIpUsevlan.setDescription('This object indicates if IP layer vlan is examined or not.') sw_acl_ip_ip_addr_mask_state = mib_table_column((1, 3, 6, 1, 4, 1, 171, 11, 5, 1, 2, 1, 3), integer32().subtype(subtypeSpec=constraints_union(single_value_constraint(1, 2, 3, 4))).clone(namedValues=named_values(('other', 1), ('dst-ip-addr', 2), ('src-ip-addr', 3), ('dst-src-ip-addr', 4)))).setMaxAccess('readcreate') if mibBuilder.loadTexts: swACLIpIpAddrMaskState.setStatus('current') if mibBuilder.loadTexts: swACLIpIpAddrMaskState.setDescription("This object indicates the status of IP address mask. other(1) - Neither source IP address nor destination IP address are masked. dst-ip-addr(2) - recieved frames's destination IP address are currently used to be filtered as it meets with the IP address entry of the table. src-ip-addr(3) - recieved frames's source IP address are currently used to be filtered as it meets with the IP address entry of the table. dst-src-ip-addr(4) - recieved frames's destination IP address or source IP address are currently used to be filtered as it meets with the IP address entry of the table.") sw_acl_ip_src_ip_addr_mask = mib_table_column((1, 3, 6, 1, 4, 1, 171, 11, 5, 1, 2, 1, 4), ip_address()).setMaxAccess('readcreate') if mibBuilder.loadTexts: swACLIpSrcIpAddrMask.setStatus('current') if mibBuilder.loadTexts: swACLIpSrcIpAddrMask.setDescription('This object Specifies IP address mask for the source IP address.') sw_acl_ip_dst_ip_addr_mask = mib_table_column((1, 3, 6, 1, 4, 1, 171, 11, 5, 1, 2, 1, 5), ip_address()).setMaxAccess('readcreate') if mibBuilder.loadTexts: swACLIpDstIpAddrMask.setStatus('current') if mibBuilder.loadTexts: swACLIpDstIpAddrMask.setDescription('This object Specifies the IP address mask for the destination IP address.') sw_acl_ip_use_dscp = mib_table_column((1, 3, 6, 1, 4, 1, 171, 11, 5, 1, 2, 1, 6), integer32().subtype(subtypeSpec=constraints_union(single_value_constraint(1, 2))).clone(namedValues=named_values(('enabled', 1), ('disabled', 2)))).setMaxAccess('readcreate') if mibBuilder.loadTexts: swACLIpUseDSCP.setStatus('current') if mibBuilder.loadTexts: swACLIpUseDSCP.setDescription('This object indicates DSCP protocol is is examined or not.') sw_acl_ip_use_proto_type = mib_table_column((1, 3, 6, 1, 4, 1, 171, 11, 5, 1, 2, 1, 7), integer32().subtype(subtypeSpec=constraints_union(single_value_constraint(1, 2, 3, 4, 5, 6))).clone(namedValues=named_values(('none', 1), ('icmp', 2), ('igmp', 3), ('tcp', 4), ('udp', 5), ('protocolId', 6)))).setMaxAccess('readcreate') if mibBuilder.loadTexts: swACLIpUseProtoType.setStatus('current') if mibBuilder.loadTexts: swACLIpUseProtoType.setDescription('That object indicates which protocol will be examined.') sw_acl_ip_icmp_option = mib_table_column((1, 3, 6, 1, 4, 1, 171, 11, 5, 1, 2, 1, 8), integer32().subtype(subtypeSpec=constraints_union(single_value_constraint(1, 2, 3, 4))).clone(namedValues=named_values(('none', 1), ('type', 2), ('code', 3), ('type-code', 4)))).setMaxAccess('readcreate') if mibBuilder.loadTexts: swACLIpIcmpOption.setStatus('current') if mibBuilder.loadTexts: swACLIpIcmpOption.setDescription('This object indicates which fields should be filled in of ICMP. none(1)- two fields are null. type(2)- type field should be filled in. code(3)- code field should be filled in. type-code(4)- not only type fileld but code field should be filled in. ') sw_acl_ip_igmp_option = mib_table_column((1, 3, 6, 1, 4, 1, 171, 11, 5, 1, 2, 1, 9), integer32().subtype(subtypeSpec=constraints_union(single_value_constraint(1, 2))).clone(namedValues=named_values(('enable', 1), ('disable', 2)))).setMaxAccess('readcreate') if mibBuilder.loadTexts: swACLIpIgmpOption.setStatus('current') if mibBuilder.loadTexts: swACLIpIgmpOption.setDescription('This object indicates Options of IGMP is examined or not.') sw_acl_ip_tcp_option = mib_table_column((1, 3, 6, 1, 4, 1, 171, 11, 5, 1, 2, 1, 10), integer32().subtype(subtypeSpec=constraints_union(single_value_constraint(1, 2, 3, 4))).clone(namedValues=named_values(('other', 1), ('dst-addr', 2), ('src-addr', 3), ('dst-src-addr', 4)))).setMaxAccess('readcreate') if mibBuilder.loadTexts: swACLIpTcpOption.setStatus('current') if mibBuilder.loadTexts: swACLIpTcpOption.setDescription("This object indicates the status of filtered address of TCP. other(1) - Neither source port nor destination port are masked. dst-addr(2) - recieved frames's destination port are currently used to be filtered . src-addr(3) - recieved frames's source port are currently used to be filtered . dst-src-addr(4) - both recieved frames's destination port and source port are currently used to be filtered .") sw_acl_ip_udp_option = mib_table_column((1, 3, 6, 1, 4, 1, 171, 11, 5, 1, 2, 1, 11), integer32().subtype(subtypeSpec=constraints_union(single_value_constraint(1, 2, 3, 4))).clone(namedValues=named_values(('other', 1), ('dst-addr', 2), ('src-addr', 3), ('dst-src-addr', 4)))).setMaxAccess('readcreate') if mibBuilder.loadTexts: swACLIpUdpOption.setStatus('current') if mibBuilder.loadTexts: swACLIpUdpOption.setDescription("This object indicates the status of filtered address of UDP . other(1) - Neither source port nor destination port are masked. dst-addr(2) - recieved frames's destination port are currently used to be filtered . src-addr(3) - recieved frames's source port are currently used to be filtered . dst-src-addr(4) - recieved frames's destination port or source port are currently used to be filtered.") sw_acl_ip_tc_por_udp_src_port_mask = mib_table_column((1, 3, 6, 1, 4, 1, 171, 11, 5, 1, 2, 1, 12), octet_string().subtype(subtypeSpec=value_size_constraint(2, 2)).setFixedLength(2)).setMaxAccess('readcreate') if mibBuilder.loadTexts: swACLIpTCPorUDPSrcPortMask.setStatus('current') if mibBuilder.loadTexts: swACLIpTCPorUDPSrcPortMask.setDescription('Specifies a TCP port mask for the source port if swACLIpUseProtoType is TCP Specifies a UDP port mask for the source port if swACLIpUseProtoType is UDP. ') sw_acl_ip_tc_por_udp_dst_port_mask = mib_table_column((1, 3, 6, 1, 4, 1, 171, 11, 5, 1, 2, 1, 13), octet_string().subtype(subtypeSpec=value_size_constraint(2, 2)).setFixedLength(2)).setMaxAccess('readcreate') if mibBuilder.loadTexts: swACLIpTCPorUDPDstPortMask.setStatus('current') if mibBuilder.loadTexts: swACLIpTCPorUDPDstPortMask.setDescription('Specifies a TCP port mask for the destination port if swACLIpUseProtoType is TCP Specifies a UDP port mask for the destination port if swACLIpUseProtoType is UDP.') sw_acl_ip_tcp_flag_bit = mib_table_column((1, 3, 6, 1, 4, 1, 171, 11, 5, 1, 2, 1, 14), integer32().subtype(subtypeSpec=value_range_constraint(0, 63))).setMaxAccess('readcreate') if mibBuilder.loadTexts: swACLIpTCPFlagBit.setStatus('current') if mibBuilder.loadTexts: swACLIpTCPFlagBit.setDescription('Specifies a TCP connection flag mask.') sw_acl_ip_proto_id_option = mib_table_column((1, 3, 6, 1, 4, 1, 171, 11, 5, 1, 2, 1, 15), integer32().subtype(subtypeSpec=constraints_union(single_value_constraint(1, 2))).clone(namedValues=named_values(('enable', 1), ('disable', 2)))).setMaxAccess('readcreate') if mibBuilder.loadTexts: swACLIpProtoIDOption.setStatus('current') if mibBuilder.loadTexts: swACLIpProtoIDOption.setDescription("Specifies that the switch will examine each frame's Protocol ID field or not.") sw_acl_ip_proto_id_mask = mib_table_column((1, 3, 6, 1, 4, 1, 171, 11, 5, 1, 2, 1, 16), octet_string().subtype(subtypeSpec=value_size_constraint(4, 4)).setFixedLength(4)).setMaxAccess('readcreate') if mibBuilder.loadTexts: swACLIpProtoIDMask.setStatus('current') if mibBuilder.loadTexts: swACLIpProtoIDMask.setDescription('Specifies that the rule applies to the IP protocol ID and the mask options behind the IP header.') sw_acl_ip_port = mib_table_column((1, 3, 6, 1, 4, 1, 171, 11, 5, 1, 2, 1, 17), port_list().subtype(subtypeSpec=value_size_constraint(0, 127))).setMaxAccess('readcreate') if mibBuilder.loadTexts: swACLIpPort.setStatus('current') if mibBuilder.loadTexts: swACLIpPort.setDescription('.') sw_acl_ip_row_status = mib_table_column((1, 3, 6, 1, 4, 1, 171, 11, 5, 1, 2, 1, 18), row_status()).setMaxAccess('readcreate') if mibBuilder.loadTexts: swACLIpRowStatus.setStatus('current') if mibBuilder.loadTexts: swACLIpRowStatus.setDescription('This object indicates the status of this entry.') sw_acl_payload_table = mib_table((1, 3, 6, 1, 4, 1, 171, 11, 5, 1, 3)) if mibBuilder.loadTexts: swACLPayloadTable.setStatus('current') if mibBuilder.loadTexts: swACLPayloadTable.setDescription('') sw_acl_payload_entry = mib_table_row((1, 3, 6, 1, 4, 1, 171, 11, 5, 1, 3, 1)).setIndexNames((0, 'SW-DES3x50-ACLMGMT-MIB', 'swACLPayloadProfileID')) if mibBuilder.loadTexts: swACLPayloadEntry.setStatus('current') if mibBuilder.loadTexts: swACLPayloadEntry.setDescription('') sw_acl_payload_profile_id = mib_table_column((1, 3, 6, 1, 4, 1, 171, 11, 5, 1, 3, 1, 1), integer32().subtype(subtypeSpec=value_range_constraint(1, 255))).setMaxAccess('readonly') if mibBuilder.loadTexts: swACLPayloadProfileID.setStatus('current') if mibBuilder.loadTexts: swACLPayloadProfileID.setDescription('.') sw_acl_payload_off_set0to15 = mib_table_column((1, 3, 6, 1, 4, 1, 171, 11, 5, 1, 3, 1, 2), octet_string().subtype(subtypeSpec=value_size_constraint(16, 16)).setFixedLength(16)).setMaxAccess('readcreate') if mibBuilder.loadTexts: swACLPayloadOffSet0to15.setStatus('current') if mibBuilder.loadTexts: swACLPayloadOffSet0to15.setDescription('.') sw_acl_payload_off_set16to31 = mib_table_column((1, 3, 6, 1, 4, 1, 171, 11, 5, 1, 3, 1, 3), octet_string().subtype(subtypeSpec=value_size_constraint(16, 16)).setFixedLength(16)).setMaxAccess('readcreate') if mibBuilder.loadTexts: swACLPayloadOffSet16to31.setStatus('current') if mibBuilder.loadTexts: swACLPayloadOffSet16to31.setDescription('.') sw_acl_payload_off_set32to47 = mib_table_column((1, 3, 6, 1, 4, 1, 171, 11, 5, 1, 3, 1, 4), octet_string().subtype(subtypeSpec=value_size_constraint(16, 16)).setFixedLength(16)).setMaxAccess('readcreate') if mibBuilder.loadTexts: swACLPayloadOffSet32to47.setStatus('current') if mibBuilder.loadTexts: swACLPayloadOffSet32to47.setDescription('.') sw_acl_payload_off_set48to63 = mib_table_column((1, 3, 6, 1, 4, 1, 171, 11, 5, 1, 3, 1, 5), octet_string().subtype(subtypeSpec=value_size_constraint(16, 16)).setFixedLength(16)).setMaxAccess('readcreate') if mibBuilder.loadTexts: swACLPayloadOffSet48to63.setStatus('current') if mibBuilder.loadTexts: swACLPayloadOffSet48to63.setDescription('.') sw_acl_payload_off_set64to79 = mib_table_column((1, 3, 6, 1, 4, 1, 171, 11, 5, 1, 3, 1, 6), octet_string().subtype(subtypeSpec=value_size_constraint(16, 16)).setFixedLength(16)).setMaxAccess('readcreate') if mibBuilder.loadTexts: swACLPayloadOffSet64to79.setStatus('current') if mibBuilder.loadTexts: swACLPayloadOffSet64to79.setDescription('.') sw_acl_payload_port = mib_table_column((1, 3, 6, 1, 4, 1, 171, 11, 5, 1, 3, 1, 7), port_list().subtype(subtypeSpec=value_size_constraint(0, 127))).setMaxAccess('readcreate') if mibBuilder.loadTexts: swACLPayloadPort.setStatus('current') if mibBuilder.loadTexts: swACLPayloadPort.setDescription('.') sw_acl_payload_row_status = mib_table_column((1, 3, 6, 1, 4, 1, 171, 11, 5, 1, 3, 1, 8), row_status()).setMaxAccess('readcreate') if mibBuilder.loadTexts: swACLPayloadRowStatus.setStatus('current') if mibBuilder.loadTexts: swACLPayloadRowStatus.setDescription('.') sw_acl_ether_rule_table = mib_table((1, 3, 6, 1, 4, 1, 171, 11, 5, 2, 1)) if mibBuilder.loadTexts: swACLEtherRuleTable.setStatus('current') if mibBuilder.loadTexts: swACLEtherRuleTable.setDescription('This table contain ACL rule of ethernet information.') sw_acl_ether_rule_entry = mib_table_row((1, 3, 6, 1, 4, 1, 171, 11, 5, 2, 1, 1)).setIndexNames((0, 'SW-DES3x50-ACLMGMT-MIB', 'swACLEtherRuleProfileID'), (0, 'SW-DES3x50-ACLMGMT-MIB', 'swACLEtherRuleAccessID')) if mibBuilder.loadTexts: swACLEtherRuleEntry.setStatus('current') if mibBuilder.loadTexts: swACLEtherRuleEntry.setDescription('A list of information about ACL rule of the layer 2 part of each packet.') sw_acl_ether_rule_profile_id = mib_table_column((1, 3, 6, 1, 4, 1, 171, 11, 5, 2, 1, 1, 1), integer32().subtype(subtypeSpec=value_range_constraint(1, 255))).setMaxAccess('readonly') if mibBuilder.loadTexts: swACLEtherRuleProfileID.setStatus('current') if mibBuilder.loadTexts: swACLEtherRuleProfileID.setDescription('The ID of ACL mask entry ,and is unique in the mask list.') sw_acl_ether_rule_access_id = mib_table_column((1, 3, 6, 1, 4, 1, 171, 11, 5, 2, 1, 1, 2), integer32().subtype(subtypeSpec=value_range_constraint(1, 255))).setMaxAccess('readonly') if mibBuilder.loadTexts: swACLEtherRuleAccessID.setStatus('current') if mibBuilder.loadTexts: swACLEtherRuleAccessID.setDescription('The ID of ACL rule entry relate to swACLEtherRuleProfileID.') sw_acl_ether_rule_vlan = mib_table_column((1, 3, 6, 1, 4, 1, 171, 11, 5, 2, 1, 1, 3), snmp_admin_string().subtype(subtypeSpec=value_size_constraint(1, 32))).setMaxAccess('readcreate') if mibBuilder.loadTexts: swACLEtherRuleVlan.setStatus('current') if mibBuilder.loadTexts: swACLEtherRuleVlan.setDescription('Specifies that the access will apply to only to this VLAN.') sw_acl_ether_rule_src_mac_address = mib_table_column((1, 3, 6, 1, 4, 1, 171, 11, 5, 2, 1, 1, 4), mac_address()).setMaxAccess('readcreate') if mibBuilder.loadTexts: swACLEtherRuleSrcMacAddress.setStatus('current') if mibBuilder.loadTexts: swACLEtherRuleSrcMacAddress.setDescription('Specifies that the access will apply to only packets with this source MAC address.') sw_acl_ether_rule_dst_mac_address = mib_table_column((1, 3, 6, 1, 4, 1, 171, 11, 5, 2, 1, 1, 5), mac_address()).setMaxAccess('readcreate') if mibBuilder.loadTexts: swACLEtherRuleDstMacAddress.setStatus('current') if mibBuilder.loadTexts: swACLEtherRuleDstMacAddress.setDescription('Specifies that the access will apply to only packets with this destination MAC address.') sw_acl_ether_rule8021_p = mib_table_column((1, 3, 6, 1, 4, 1, 171, 11, 5, 2, 1, 1, 6), integer32().subtype(subtypeSpec=value_range_constraint(0, 7))).setMaxAccess('readcreate') if mibBuilder.loadTexts: swACLEtherRule8021P.setStatus('current') if mibBuilder.loadTexts: swACLEtherRule8021P.setDescription('Specifies that the access will apply only to packets with this 802.1p priority value.') sw_acl_ether_rule_ether_type = mib_table_column((1, 3, 6, 1, 4, 1, 171, 11, 5, 2, 1, 1, 7), octet_string().subtype(subtypeSpec=value_size_constraint(2, 2)).setFixedLength(2)).setMaxAccess('readcreate') if mibBuilder.loadTexts: swACLEtherRuleEtherType.setStatus('current') if mibBuilder.loadTexts: swACLEtherRuleEtherType.setDescription('Specifies that the access will apply only to packets with this hexidecimal 802.1Q Ethernet type value in the packet header.') sw_acl_ether_rule_enable_priority = mib_table_column((1, 3, 6, 1, 4, 1, 171, 11, 5, 2, 1, 1, 8), integer32().subtype(subtypeSpec=constraints_union(single_value_constraint(1, 2))).clone(namedValues=named_values(('enabled', 1), ('disabled', 2)))).setMaxAccess('readcreate') if mibBuilder.loadTexts: swACLEtherRuleEnablePriority.setStatus('current') if mibBuilder.loadTexts: swACLEtherRuleEnablePriority.setDescription('Specifies that the access will apply only to packets with priority value.') sw_acl_ether_rule_priority = mib_table_column((1, 3, 6, 1, 4, 1, 171, 11, 5, 2, 1, 1, 9), integer32().subtype(subtypeSpec=value_range_constraint(0, 7))).setMaxAccess('readcreate') if mibBuilder.loadTexts: swACLEtherRulePriority.setStatus('current') if mibBuilder.loadTexts: swACLEtherRulePriority.setDescription('Specific the priority will change to the packets while the swACLEtherRuleReplacePriority is enabled .') sw_acl_ether_rule_replace_priority = mib_table_column((1, 3, 6, 1, 4, 1, 171, 11, 5, 2, 1, 1, 10), integer32().subtype(subtypeSpec=constraints_union(single_value_constraint(1, 2))).clone(namedValues=named_values(('enabled', 1), ('disabled', 2)))).setMaxAccess('readcreate') if mibBuilder.loadTexts: swACLEtherRuleReplacePriority.setStatus('current') if mibBuilder.loadTexts: swACLEtherRuleReplacePriority.setDescription('Specific the packets that match the access profile will changed the 802.1p priority tag field by the switch or not .') sw_acl_ether_rule_enable_replace_dscp = mib_table_column((1, 3, 6, 1, 4, 1, 171, 11, 5, 2, 1, 1, 11), integer32().subtype(subtypeSpec=constraints_union(single_value_constraint(1, 2))).clone(namedValues=named_values(('enabled', 1), ('disabled', 2)))).setMaxAccess('readcreate') if mibBuilder.loadTexts: swACLEtherRuleEnableReplaceDscp.setStatus('current') if mibBuilder.loadTexts: swACLEtherRuleEnableReplaceDscp.setDescription('Specific the packets that match the access profile will replaced the DSCP field by the switch or not .') sw_acl_ether_rule_rep_dscp = mib_table_column((1, 3, 6, 1, 4, 1, 171, 11, 5, 2, 1, 1, 12), integer32().subtype(subtypeSpec=value_range_constraint(0, 63))).setMaxAccess('readcreate') if mibBuilder.loadTexts: swACLEtherRuleRepDscp.setStatus('current') if mibBuilder.loadTexts: swACLEtherRuleRepDscp.setDescription('specify a value to be written to the DSCP field of an incoming packet that meets the criteria specified in the first part of the command. This value will over-write the value in the DSCP field of the packet.') sw_acl_ether_rule_permit = mib_table_column((1, 3, 6, 1, 4, 1, 171, 11, 5, 2, 1, 1, 13), integer32().subtype(subtypeSpec=constraints_union(single_value_constraint(1, 2))).clone(namedValues=named_values(('permit', 1), ('deny', 2)))).setMaxAccess('readcreate') if mibBuilder.loadTexts: swACLEtherRulePermit.setStatus('current') if mibBuilder.loadTexts: swACLEtherRulePermit.setDescription('This object indicates resoult of examination is permit or deny;default is permit(1) permit - Specifies that packets that match the access profile are permitted to be forwarded by the switch. deny - Specifies that packets that do not match the access profile are not permitted to be forwarded by the switch and will be filtered.') sw_acl_ether_rule_row_status = mib_table_column((1, 3, 6, 1, 4, 1, 171, 11, 5, 2, 1, 1, 14), row_status()).setMaxAccess('readcreate') if mibBuilder.loadTexts: swACLEtherRuleRowStatus.setStatus('current') if mibBuilder.loadTexts: swACLEtherRuleRowStatus.setDescription('This object indicates the status of this entry.') sw_acl_ip_rule_table = mib_table((1, 3, 6, 1, 4, 1, 171, 11, 5, 2, 2)) if mibBuilder.loadTexts: swACLIpRuleTable.setStatus('current') if mibBuilder.loadTexts: swACLIpRuleTable.setDescription('.') sw_acl_ip_rule_entry = mib_table_row((1, 3, 6, 1, 4, 1, 171, 11, 5, 2, 2, 1)).setIndexNames((0, 'SW-DES3x50-ACLMGMT-MIB', 'swACLIpRuleProfileID'), (0, 'SW-DES3x50-ACLMGMT-MIB', 'swACLIpRuleAccessID')) if mibBuilder.loadTexts: swACLIpRuleEntry.setStatus('current') if mibBuilder.loadTexts: swACLIpRuleEntry.setDescription('.') sw_acl_ip_rule_profile_id = mib_table_column((1, 3, 6, 1, 4, 1, 171, 11, 5, 2, 2, 1, 1), integer32().subtype(subtypeSpec=value_range_constraint(1, 255))).setMaxAccess('readonly') if mibBuilder.loadTexts: swACLIpRuleProfileID.setStatus('current') if mibBuilder.loadTexts: swACLIpRuleProfileID.setDescription('The ID of ACL mask entry ,and is unique in the mask list.') sw_acl_ip_rule_access_id = mib_table_column((1, 3, 6, 1, 4, 1, 171, 11, 5, 2, 2, 1, 2), integer32().subtype(subtypeSpec=value_range_constraint(1, 255))).setMaxAccess('readonly') if mibBuilder.loadTexts: swACLIpRuleAccessID.setStatus('current') if mibBuilder.loadTexts: swACLIpRuleAccessID.setDescription('The ID of ACL IP rule entry .') sw_acl_ip_rule_vlan = mib_table_column((1, 3, 6, 1, 4, 1, 171, 11, 5, 2, 2, 1, 3), snmp_admin_string().subtype(subtypeSpec=value_size_constraint(1, 32))).setMaxAccess('readcreate') if mibBuilder.loadTexts: swACLIpRuleVlan.setStatus('current') if mibBuilder.loadTexts: swACLIpRuleVlan.setDescription('Specifies that the access will apply to only to this VLAN.') sw_acl_ip_rule_src_ipaddress = mib_table_column((1, 3, 6, 1, 4, 1, 171, 11, 5, 2, 2, 1, 4), ip_address()).setMaxAccess('readcreate') if mibBuilder.loadTexts: swACLIpRuleSrcIpaddress.setStatus('current') if mibBuilder.loadTexts: swACLIpRuleSrcIpaddress.setDescription('Specific an IP source address.') sw_acl_ip_rule_dst_ipaddress = mib_table_column((1, 3, 6, 1, 4, 1, 171, 11, 5, 2, 2, 1, 5), ip_address()).setMaxAccess('readcreate') if mibBuilder.loadTexts: swACLIpRuleDstIpaddress.setStatus('current') if mibBuilder.loadTexts: swACLIpRuleDstIpaddress.setDescription('Specific an IP destination address.') sw_acl_ip_rule_dscp = mib_table_column((1, 3, 6, 1, 4, 1, 171, 11, 5, 2, 2, 1, 6), integer32().subtype(subtypeSpec=value_range_constraint(0, 63))).setMaxAccess('readcreate') if mibBuilder.loadTexts: swACLIpRuleDscp.setStatus('current') if mibBuilder.loadTexts: swACLIpRuleDscp.setDescription('Specific the value of dscp, the value can be configured 0 to 63') sw_acl_ip_rule_protocol = mib_table_column((1, 3, 6, 1, 4, 1, 171, 11, 5, 2, 2, 1, 7), integer32().subtype(subtypeSpec=constraints_union(single_value_constraint(1, 2, 3, 4, 5, 6))).clone(namedValues=named_values(('none', 1), ('icmp', 2), ('igmp', 3), ('tcp', 4), ('udp', 5), ('protocolId', 6)))).setMaxAccess('readonly') if mibBuilder.loadTexts: swACLIpRuleProtocol.setStatus('current') if mibBuilder.loadTexts: swACLIpRuleProtocol.setDescription('Specifies the IP protocol which has been configured in swACLIpEntry .') sw_acl_ip_rule_type = mib_table_column((1, 3, 6, 1, 4, 1, 171, 11, 5, 2, 2, 1, 8), integer32().subtype(subtypeSpec=value_range_constraint(0, 255))).setMaxAccess('readcreate') if mibBuilder.loadTexts: swACLIpRuleType.setStatus('current') if mibBuilder.loadTexts: swACLIpRuleType.setDescription('Specific that the rule applies to the value of icmp type traffic.') sw_acl_ip_rule_code = mib_table_column((1, 3, 6, 1, 4, 1, 171, 11, 5, 2, 2, 1, 9), integer32().subtype(subtypeSpec=value_range_constraint(0, 255))).setMaxAccess('readcreate') if mibBuilder.loadTexts: swACLIpRuleCode.setStatus('current') if mibBuilder.loadTexts: swACLIpRuleCode.setDescription('Specific that the rule applies to the value of icmp code traffic.') sw_acl_ip_rule_src_port = mib_table_column((1, 3, 6, 1, 4, 1, 171, 11, 5, 2, 2, 1, 10), integer32().subtype(subtypeSpec=value_range_constraint(0, 65535))).setMaxAccess('readcreate') if mibBuilder.loadTexts: swACLIpRuleSrcPort.setStatus('current') if mibBuilder.loadTexts: swACLIpRuleSrcPort.setDescription('Specific that the rule applies the range of tcp/udp source port') sw_acl_ip_rule_dst_port = mib_table_column((1, 3, 6, 1, 4, 1, 171, 11, 5, 2, 2, 1, 11), integer32().subtype(subtypeSpec=value_range_constraint(0, 65535))).setMaxAccess('readcreate') if mibBuilder.loadTexts: swACLIpRuleDstPort.setStatus('current') if mibBuilder.loadTexts: swACLIpRuleDstPort.setDescription('Specific the range of tcp/udp destination port range') sw_acl_ip_rule_flag_bits = mib_table_column((1, 3, 6, 1, 4, 1, 171, 11, 5, 2, 2, 1, 12), integer32().subtype(subtypeSpec=value_range_constraint(0, 63))).setMaxAccess('readcreate') if mibBuilder.loadTexts: swACLIpRuleFlagBits.setStatus('current') if mibBuilder.loadTexts: swACLIpRuleFlagBits.setDescription('A value which indicates the set of TCP flags that this entity may potentially offers. The value is a sum. This sum initially takes the value zero, Then, for each flag, L, in the range 1 through 6, that this node performs transactions for, 2 raised to (L - 1) is added to the sum. Note that values should be calculated accordingly: Flag functionality 6 urg bit 5 ack bit 4 rsh bit 3 rst bit 2 syn bit 1 fin bit For example,it you want to enable urg bit and ack bit,you should set vlaue 48(2^(5-1) + 2^(6-1)).') sw_acl_ip_rule_proto_id = mib_table_column((1, 3, 6, 1, 4, 1, 171, 11, 5, 2, 2, 1, 13), integer32().subtype(subtypeSpec=value_range_constraint(0, 255))).setMaxAccess('readcreate') if mibBuilder.loadTexts: swACLIpRuleProtoID.setStatus('current') if mibBuilder.loadTexts: swACLIpRuleProtoID.setDescription('Specific that the rule applies to the value of ip protocol id traffic') sw_acl_ip_rule_user_mask = mib_table_column((1, 3, 6, 1, 4, 1, 171, 11, 5, 2, 2, 1, 14), octet_string().subtype(subtypeSpec=value_size_constraint(4, 4)).setFixedLength(4)).setMaxAccess('readcreate') if mibBuilder.loadTexts: swACLIpRuleUserMask.setStatus('current') if mibBuilder.loadTexts: swACLIpRuleUserMask.setDescription('Specific that the rule applies to the ip protocol id and the range of options behind the IP header.') sw_acl_ip_rule_enable_priority = mib_table_column((1, 3, 6, 1, 4, 1, 171, 11, 5, 2, 2, 1, 15), integer32().subtype(subtypeSpec=constraints_union(single_value_constraint(1, 2))).clone(namedValues=named_values(('enabled', 1), ('disabled', 2)))).setMaxAccess('readcreate') if mibBuilder.loadTexts: swACLIpRuleEnablePriority.setStatus('current') if mibBuilder.loadTexts: swACLIpRuleEnablePriority.setDescription('Specifies that the access will apply only to packets with priority value.') sw_acl_ip_rule_priority = mib_table_column((1, 3, 6, 1, 4, 1, 171, 11, 5, 2, 2, 1, 16), integer32().subtype(subtypeSpec=value_range_constraint(0, 7))).setMaxAccess('readcreate') if mibBuilder.loadTexts: swACLIpRulePriority.setStatus('current') if mibBuilder.loadTexts: swACLIpRulePriority.setDescription('Specifies that the access profile will apply to packets that contain this value in their 802.1p priority field of their header.') sw_acl_ip_rule_replace_priority = mib_table_column((1, 3, 6, 1, 4, 1, 171, 11, 5, 2, 2, 1, 17), integer32().subtype(subtypeSpec=constraints_union(single_value_constraint(1, 2))).clone(namedValues=named_values(('enabled', 1), ('disabled', 2)))).setMaxAccess('readcreate') if mibBuilder.loadTexts: swACLIpRuleReplacePriority.setStatus('current') if mibBuilder.loadTexts: swACLIpRuleReplacePriority.setDescription('Specific the packets that match the access profile will changed the 802.1p priority tag field by the switch or not .') sw_acl_ip_rule_enable_replace_dscp = mib_table_column((1, 3, 6, 1, 4, 1, 171, 11, 5, 2, 2, 1, 18), integer32().subtype(subtypeSpec=constraints_union(single_value_constraint(1, 2))).clone(namedValues=named_values(('enabled', 1), ('disabled', 2)))).setMaxAccess('readcreate') if mibBuilder.loadTexts: swACLIpRuleEnableReplaceDscp.setStatus('current') if mibBuilder.loadTexts: swACLIpRuleEnableReplaceDscp.setDescription('Indicate weather the DSCP field can be over-write or not. ') sw_acl_ip_rule_rep_dscp = mib_table_column((1, 3, 6, 1, 4, 1, 171, 11, 5, 2, 2, 1, 19), integer32().subtype(subtypeSpec=value_range_constraint(0, 63))).setMaxAccess('readcreate') if mibBuilder.loadTexts: swACLIpRuleRepDscp.setStatus('current') if mibBuilder.loadTexts: swACLIpRuleRepDscp.setDescription('specify a value to be written to the DSCP field of an incoming packet that meets the criteria specified in the first part of the command. This value will over-write the value in the DSCP field of the packet.') sw_acl_ip_rule_permit = mib_table_column((1, 3, 6, 1, 4, 1, 171, 11, 5, 2, 2, 1, 20), integer32().subtype(subtypeSpec=constraints_union(single_value_constraint(1, 2))).clone(namedValues=named_values(('deny', 1), ('permit', 2)))).setMaxAccess('readcreate') if mibBuilder.loadTexts: swACLIpRulePermit.setStatus('current') if mibBuilder.loadTexts: swACLIpRulePermit.setDescription('This object indicates filter is permit or deny; default is permit(1)') sw_acl_ip_rule_row_status = mib_table_column((1, 3, 6, 1, 4, 1, 171, 11, 5, 2, 2, 1, 21), row_status()).setMaxAccess('readcreate') if mibBuilder.loadTexts: swACLIpRuleRowStatus.setStatus('current') if mibBuilder.loadTexts: swACLIpRuleRowStatus.setDescription('This object indicates the status of this entry.') sw_acl_payload_rule_table = mib_table((1, 3, 6, 1, 4, 1, 171, 11, 5, 2, 3)) if mibBuilder.loadTexts: swACLPayloadRuleTable.setStatus('current') if mibBuilder.loadTexts: swACLPayloadRuleTable.setDescription('') sw_acl_payload_rule_entry = mib_table_row((1, 3, 6, 1, 4, 1, 171, 11, 5, 2, 3, 1)).setIndexNames((0, 'SW-DES3x50-ACLMGMT-MIB', 'swACLPayloadRuleProfileID'), (0, 'SW-DES3x50-ACLMGMT-MIB', 'swACLPayloadRuleAccessID')) if mibBuilder.loadTexts: swACLPayloadRuleEntry.setStatus('current') if mibBuilder.loadTexts: swACLPayloadRuleEntry.setDescription('') sw_acl_payload_rule_profile_id = mib_table_column((1, 3, 6, 1, 4, 1, 171, 11, 5, 2, 3, 1, 1), integer32().subtype(subtypeSpec=value_range_constraint(1, 255))).setMaxAccess('readonly') if mibBuilder.loadTexts: swACLPayloadRuleProfileID.setStatus('current') if mibBuilder.loadTexts: swACLPayloadRuleProfileID.setDescription('') sw_acl_payload_rule_access_id = mib_table_column((1, 3, 6, 1, 4, 1, 171, 11, 5, 2, 3, 1, 2), integer32().subtype(subtypeSpec=value_range_constraint(1, 255))).setMaxAccess('readonly') if mibBuilder.loadTexts: swACLPayloadRuleAccessID.setStatus('current') if mibBuilder.loadTexts: swACLPayloadRuleAccessID.setDescription('') sw_acl_payload_rule_off_set0to15 = mib_table_column((1, 3, 6, 1, 4, 1, 171, 11, 5, 2, 3, 1, 3), octet_string().subtype(subtypeSpec=value_size_constraint(16, 16)).setFixedLength(16)).setMaxAccess('readcreate') if mibBuilder.loadTexts: swACLPayloadRuleOffSet0to15.setStatus('current') if mibBuilder.loadTexts: swACLPayloadRuleOffSet0to15.setDescription('') sw_acl_payload_rule_off_set16to31 = mib_table_column((1, 3, 6, 1, 4, 1, 171, 11, 5, 2, 3, 1, 4), octet_string().subtype(subtypeSpec=value_size_constraint(16, 16)).setFixedLength(16)).setMaxAccess('readcreate') if mibBuilder.loadTexts: swACLPayloadRuleOffSet16to31.setStatus('current') if mibBuilder.loadTexts: swACLPayloadRuleOffSet16to31.setDescription('') sw_acl_payload_rule_off_set32to47 = mib_table_column((1, 3, 6, 1, 4, 1, 171, 11, 5, 2, 3, 1, 5), octet_string().subtype(subtypeSpec=value_size_constraint(16, 16)).setFixedLength(16)).setMaxAccess('readcreate') if mibBuilder.loadTexts: swACLPayloadRuleOffSet32to47.setStatus('current') if mibBuilder.loadTexts: swACLPayloadRuleOffSet32to47.setDescription('') sw_acl_payload_rule_off_set48to63 = mib_table_column((1, 3, 6, 1, 4, 1, 171, 11, 5, 2, 3, 1, 6), octet_string().subtype(subtypeSpec=value_size_constraint(16, 16)).setFixedLength(16)).setMaxAccess('readcreate') if mibBuilder.loadTexts: swACLPayloadRuleOffSet48to63.setStatus('current') if mibBuilder.loadTexts: swACLPayloadRuleOffSet48to63.setDescription('') sw_acl_payload_rule_off_set64to79 = mib_table_column((1, 3, 6, 1, 4, 1, 171, 11, 5, 2, 3, 1, 7), octet_string().subtype(subtypeSpec=value_size_constraint(16, 16)).setFixedLength(16)).setMaxAccess('readcreate') if mibBuilder.loadTexts: swACLPayloadRuleOffSet64to79.setStatus('current') if mibBuilder.loadTexts: swACLPayloadRuleOffSet64to79.setDescription('') sw_acl_payload_rule_enable_priority = mib_table_column((1, 3, 6, 1, 4, 1, 171, 11, 5, 2, 3, 1, 8), integer32().subtype(subtypeSpec=constraints_union(single_value_constraint(1, 2))).clone(namedValues=named_values(('enabled', 1), ('disabled', 2)))).setMaxAccess('readcreate') if mibBuilder.loadTexts: swACLPayloadRuleEnablePriority.setStatus('current') if mibBuilder.loadTexts: swACLPayloadRuleEnablePriority.setDescription('') sw_acl_payload_rule_priority = mib_table_column((1, 3, 6, 1, 4, 1, 171, 11, 5, 2, 3, 1, 9), integer32().subtype(subtypeSpec=value_range_constraint(0, 7))).setMaxAccess('readcreate') if mibBuilder.loadTexts: swACLPayloadRulePriority.setStatus('current') if mibBuilder.loadTexts: swACLPayloadRulePriority.setDescription('Specifies that the access profile will apply to packets that contain this value in their 802.1p priority field of their header.') sw_acl_payload_rule_replace_priority = mib_table_column((1, 3, 6, 1, 4, 1, 171, 11, 5, 2, 3, 1, 10), integer32().subtype(subtypeSpec=constraints_union(single_value_constraint(1, 2))).clone(namedValues=named_values(('enabled', 1), ('disabled', 2)))).setMaxAccess('readcreate') if mibBuilder.loadTexts: swACLPayloadRuleReplacePriority.setStatus('current') if mibBuilder.loadTexts: swACLPayloadRuleReplacePriority.setDescription('') sw_acl_payload_rule_enable_replace_dscp = mib_table_column((1, 3, 6, 1, 4, 1, 171, 11, 5, 2, 3, 1, 11), integer32().subtype(subtypeSpec=constraints_union(single_value_constraint(1, 2))).clone(namedValues=named_values(('enabled', 1), ('disabled', 2)))).setMaxAccess('readcreate') if mibBuilder.loadTexts: swACLPayloadRuleEnableReplaceDscp.setStatus('current') if mibBuilder.loadTexts: swACLPayloadRuleEnableReplaceDscp.setDescription('Indicate wether the DSCP field can be over-write or not ') sw_acl_payload_rule_rep_dscp = mib_table_column((1, 3, 6, 1, 4, 1, 171, 11, 5, 2, 3, 1, 12), integer32().subtype(subtypeSpec=value_range_constraint(0, 63))).setMaxAccess('readcreate') if mibBuilder.loadTexts: swACLPayloadRuleRepDscp.setStatus('current') if mibBuilder.loadTexts: swACLPayloadRuleRepDscp.setDescription('specify a value to be written to the DSCP field of an incoming packet that meets the criteria specified in the first part of the command. This value will over-write the value in the DSCP field of the packet.') sw_acl_payload_rule_permit = mib_table_column((1, 3, 6, 1, 4, 1, 171, 11, 5, 2, 3, 1, 13), integer32().subtype(subtypeSpec=constraints_union(single_value_constraint(1, 2))).clone(namedValues=named_values(('permit', 1), ('deny', 2)))).setMaxAccess('readcreate') if mibBuilder.loadTexts: swACLPayloadRulePermit.setStatus('current') if mibBuilder.loadTexts: swACLPayloadRulePermit.setDescription('') sw_acl_payload_rule_row_status = mib_table_column((1, 3, 6, 1, 4, 1, 171, 11, 5, 2, 3, 1, 14), row_status()).setMaxAccess('readcreate') if mibBuilder.loadTexts: swACLPayloadRuleRowStatus.setStatus('current') if mibBuilder.loadTexts: swACLPayloadRuleRowStatus.setDescription('') mibBuilder.exportSymbols('SW-DES3x50-ACLMGMT-MIB', swACLIpUseDSCP=swACLIpUseDSCP, swACLIpRuleFlagBits=swACLIpRuleFlagBits, swACLEthernetPort=swACLEthernetPort, swACLIpRuleEntry=swACLIpRuleEntry, swACLIpUdpOption=swACLIpUdpOption, swACLIpRuleSrcPort=swACLIpRuleSrcPort, swACLPayloadRuleEnablePriority=swACLPayloadRuleEnablePriority, swACLPayloadOffSet48to63=swACLPayloadOffSet48to63, swACLIpTCPorUDPDstPortMask=swACLIpTCPorUDPDstPortMask, swACLPayloadOffSet64to79=swACLPayloadOffSet64to79, swACLPayloadRuleOffSet16to31=swACLPayloadRuleOffSet16to31, swACLIpIgmpOption=swACLIpIgmpOption, swACLEtherRuleDstMacAddress=swACLEtherRuleDstMacAddress, swAclMgmtMIB=swAclMgmtMIB, swACLIpRulePermit=swACLIpRulePermit, swACLIpRuleProtocol=swACLIpRuleProtocol, swACLIpUsevlan=swACLIpUsevlan, swACLPayloadRulePriority=swACLPayloadRulePriority, swACLIpRuleDstIpaddress=swACLIpRuleDstIpaddress, swACLIpEntry=swACLIpEntry, swACLIpRuleEnableReplaceDscp=swACLIpRuleEnableReplaceDscp, swACLIpSrcIpAddrMask=swACLIpSrcIpAddrMask, swACLEtherRuleRowStatus=swACLEtherRuleRowStatus, swACLIpRuleEnablePriority=swACLIpRuleEnablePriority, swACLIpRuleType=swACLIpRuleType, swACLIpRuleUserMask=swACLIpRuleUserMask, swACLIpUseProtoType=swACLIpUseProtoType, swACLIpRulePriority=swACLIpRulePriority, swACLIpRuleSrcIpaddress=swACLIpRuleSrcIpaddress, swACLPayloadProfileID=swACLPayloadProfileID, swACLEthernetTable=swACLEthernetTable, swACLIpTCPorUDPSrcPortMask=swACLIpTCPorUDPSrcPortMask, swACLPayloadPort=swACLPayloadPort, swACLPayloadRuleOffSet32to47=swACLPayloadRuleOffSet32to47, swAclMaskMgmt=swAclMaskMgmt, swACLPayloadRuleRowStatus=swACLPayloadRuleRowStatus, swACLEthernetRowStatus=swACLEthernetRowStatus, swACLEtherRuleEntry=swACLEtherRuleEntry, swACLIpRuleAccessID=swACLIpRuleAccessID, swACLIpTable=swACLIpTable, swACLEthernetUseEthernetType=swACLEthernetUseEthernetType, swACLIpTcpOption=swACLIpTcpOption, swACLEtherRuleTable=swACLEtherRuleTable, swACLIpRuleCode=swACLIpRuleCode, swACLEthernetProfileID=swACLEthernetProfileID, swAclRuleMgmt=swAclRuleMgmt, swACLEthernetSrcMacAddrMask=swACLEthernetSrcMacAddrMask, swACLPayloadOffSet16to31=swACLPayloadOffSet16to31, swACLPayloadRuleOffSet64to79=swACLPayloadRuleOffSet64to79, swACLIpTCPFlagBit=swACLIpTCPFlagBit, swACLPayloadRuleTable=swACLPayloadRuleTable, swACLEthernetEntry=swACLEthernetEntry, swACLEtherRuleSrcMacAddress=swACLEtherRuleSrcMacAddress, PYSNMP_MODULE_ID=swAclMgmtMIB, swACLEthernetUse8021p=swACLEthernetUse8021p, swACLPayloadRuleEnableReplaceDscp=swACLPayloadRuleEnableReplaceDscp, swACLPayloadOffSet0to15=swACLPayloadOffSet0to15, swACLIpRuleVlan=swACLIpRuleVlan, swACLIpProtoIDMask=swACLIpProtoIDMask, swACLPayloadRulePermit=swACLPayloadRulePermit, swACLPayloadRuleEntry=swACLPayloadRuleEntry, swACLEthernetMacAddrMaskState=swACLEthernetMacAddrMaskState, swACLEtherRuleReplacePriority=swACLEtherRuleReplacePriority, swACLEtherRuleRepDscp=swACLEtherRuleRepDscp, swACLEtherRule8021P=swACLEtherRule8021P, swACLIpRowStatus=swACLIpRowStatus, swACLPayloadRuleOffSet48to63=swACLPayloadRuleOffSet48to63, swACLIpDstIpAddrMask=swACLIpDstIpAddrMask, swACLPayloadTable=swACLPayloadTable, swACLIpProtoIDOption=swACLIpProtoIDOption, swACLEtherRuleProfileID=swACLEtherRuleProfileID, swACLIpRuleTable=swACLIpRuleTable, swACLEtherRuleVlan=swACLEtherRuleVlan, swACLPayloadEntry=swACLPayloadEntry, swACLPayloadRuleAccessID=swACLPayloadRuleAccessID, swACLEthernetUsevlan=swACLEthernetUsevlan, swACLPayloadOffSet32to47=swACLPayloadOffSet32to47, swACLIpRuleRowStatus=swACLIpRuleRowStatus, swACLEtherRuleEnablePriority=swACLEtherRuleEnablePriority, swACLIpPort=swACLIpPort, swACLPayloadRuleReplacePriority=swACLPayloadRuleReplacePriority, swACLEtherRulePriority=swACLEtherRulePriority, swACLIpRuleDstPort=swACLIpRuleDstPort, swACLIpRuleRepDscp=swACLIpRuleRepDscp, swACLPayloadRowStatus=swACLPayloadRowStatus, swACLEtherRuleEnableReplaceDscp=swACLEtherRuleEnableReplaceDscp, swACLEthernetDstMacAddrMask=swACLEthernetDstMacAddrMask, swACLIpProfileID=swACLIpProfileID, swACLIpRuleProfileID=swACLIpRuleProfileID, swACLPayloadRuleRepDscp=swACLPayloadRuleRepDscp, swACLIpRuleProtoID=swACLIpRuleProtoID, swACLEtherRuleAccessID=swACLEtherRuleAccessID, swACLEtherRulePermit=swACLEtherRulePermit, swACLIpIcmpOption=swACLIpIcmpOption, swACLIpIpAddrMaskState=swACLIpIpAddrMaskState, swACLEtherRuleEtherType=swACLEtherRuleEtherType, swACLPayloadRuleProfileID=swACLPayloadRuleProfileID, swACLPayloadRuleOffSet0to15=swACLPayloadRuleOffSet0to15, swACLIpRuleReplacePriority=swACLIpRuleReplacePriority, swACLIpRuleDscp=swACLIpRuleDscp)
# Michael O'Regan 05/May/2019 # https://www.sanfoundry.com/python-program-implement-bucket-sort/ def bucketSort(alist): largest = max(alist) length = len(alist) size = largest/length buckets = [[] for _ in range(length)] for i in range(length): j = int(alist[i]/size) if j != length: buckets[j].append(alist[i]) else: buckets[length - 1].append(alist[i]) for i in range(length): insertionSort(buckets[i]) result = [] for i in range(length): result = result + buckets[i] return result def insertionSort(alist): for i in range(1, len(alist)): temp = alist[i] j = i - 1 while (j >= 0 and temp < alist[j]): alist[j + 1] = alist[j] j = j - 1 alist[j + 1] = temp alist = [54,26,93,17,77,31,44,55,20] bucketSort(alist) print(bucketSort(alist))
def bucket_sort(alist): largest = max(alist) length = len(alist) size = largest / length buckets = [[] for _ in range(length)] for i in range(length): j = int(alist[i] / size) if j != length: buckets[j].append(alist[i]) else: buckets[length - 1].append(alist[i]) for i in range(length): insertion_sort(buckets[i]) result = [] for i in range(length): result = result + buckets[i] return result def insertion_sort(alist): for i in range(1, len(alist)): temp = alist[i] j = i - 1 while j >= 0 and temp < alist[j]: alist[j + 1] = alist[j] j = j - 1 alist[j + 1] = temp alist = [54, 26, 93, 17, 77, 31, 44, 55, 20] bucket_sort(alist) print(bucket_sort(alist))
divs = {} def sm(x): s = 0 for i in range(2,int(x**0.5)): if x%i == 0: s += i s += x/i if i*i == x: s -= i return s+1 for i in range(10001): divs[i] = sm(i) ans = 0 for i in range(10001): for j in range(10001): if divs[i] == j and divs[j] == i and i!=j: ans += i print(ans)
divs = {} def sm(x): s = 0 for i in range(2, int(x ** 0.5)): if x % i == 0: s += i s += x / i if i * i == x: s -= i return s + 1 for i in range(10001): divs[i] = sm(i) ans = 0 for i in range(10001): for j in range(10001): if divs[i] == j and divs[j] == i and (i != j): ans += i print(ans)
####################### # MaudeMiner Settings # ####################### # Database settings DATABASE_PATH = '/Users/tklovett/maude/' DATABASE_NAME = 'maude' # These setting control where the text files and zip files retrieved from the FDA website are stored DATA_PATH = '/Users/tklovett/maude/data/' ZIPS_PATH = DATA_PATH + 'zips/' TXTS_PATH = DATA_PATH + 'txts/' # The downloader module will use MAUDE_DATA_ORIGIN = 'http://www.fda.gov/MedicalDevices/DeviceRegulationandGuidance/PostmarketRequirements/ReportingAdverseEvents/ucm127891.htm' LINES_PER_DB_COMMIT = 1000 * 50 # MaudeMiner will load any modules listed here INSTALLED_MODULES = ( "querier", "tokenizer", "html_generator", "cleanser", )
database_path = '/Users/tklovett/maude/' database_name = 'maude' data_path = '/Users/tklovett/maude/data/' zips_path = DATA_PATH + 'zips/' txts_path = DATA_PATH + 'txts/' maude_data_origin = 'http://www.fda.gov/MedicalDevices/DeviceRegulationandGuidance/PostmarketRequirements/ReportingAdverseEvents/ucm127891.htm' lines_per_db_commit = 1000 * 50 installed_modules = ('querier', 'tokenizer', 'html_generator', 'cleanser')
# https://leetcode.com/problems/convert-sorted-array-to-binary-search-tree/ # Definition for a binary tree node. # class TreeNode: # def __init__(self, val=0, left=None, right=None): # self.val = val # self.left = left # self.right = right class Solution: def sortedArrayToBST(self, nums: List[int]) -> TreeNode: return self.generateTree(nums, 0, len(nums) - 1) def generateTree(self, nums, left, right): if left > right: return None mid = (left + right) // 2 curNode = TreeNode(nums[mid]) curNode.left = self.generateTree(nums, left, mid - 1) curNode.right = self.generateTree(nums, mid + 1, right) return curNode
class Solution: def sorted_array_to_bst(self, nums: List[int]) -> TreeNode: return self.generateTree(nums, 0, len(nums) - 1) def generate_tree(self, nums, left, right): if left > right: return None mid = (left + right) // 2 cur_node = tree_node(nums[mid]) curNode.left = self.generateTree(nums, left, mid - 1) curNode.right = self.generateTree(nums, mid + 1, right) return curNode
class _LinearWithBias(Module): __parameters__ = ["weight", "bias", ] __buffers__ = [] weight : Tensor bias : Tensor training : bool
class _Linearwithbias(Module): __parameters__ = ['weight', 'bias'] __buffers__ = [] weight: Tensor bias: Tensor training: bool
count = 0 current_group = set() with open('in', 'r') as f: for line in f.readlines(): l = line.strip() if len(l) == 0: # this is end of the last group count += len(current_group) current_group = set() else: # add answers to the current group for chr in l: current_group.add(chr) # don't forget the last group count += len(current_group) print(count)
count = 0 current_group = set() with open('in', 'r') as f: for line in f.readlines(): l = line.strip() if len(l) == 0: count += len(current_group) current_group = set() else: for chr in l: current_group.add(chr) count += len(current_group) print(count)
stim_positions = { "double": [ [(0.4584, 0.2575, 0.2038), (0.4612, 0.2690, -0.0283)], # 3d location [(0.4601, 0.1549, 0.1937), (0.4614, 0.1660, -0.0358)], ], "double_20070301": [ [(0.4538, 0.2740, 0.1994), (0.4565, 0.2939, -0.0531)], # top highy [(0.4516, 0.1642, 0.1872), (0.4541, 0.1767, -0.0606)], # top lowy ], "half": [[(0.4567, 0.2029, 0.1958), (0.4581, 0.2166, -0.0329)],], "half_20070303": [[(0.4628, 0.2066, 0.1920), (0.4703, 0.2276, -0.0555)]], "tall": [[(0.4562, 0.1951, 0.2798), (0.4542, 0.2097, -0.0325)],], ##from 20061205: ##tall=[( 456.2, 195.1, 279.8), ## ( 454.2, 209.7,-32.5)] ##from 20061212: ##short=[( 461.4, 204.2, 128.1), ## ( 462.5, 205.3, 114.4)] ##from 20061219: ##necklace = [( 455.9, 194.4, 262.8), ## ( 456.2, 212.8,-42.2)] ## 'no post (smoothed)' : [( .4562, .1951, .2798), ## ( .4542, .2097,-.0325)], "short": [[(0.4614, 0.2042, 0.1281), (0.4625, 0.2053, 0.1144)]], "necklace": [[(0.4559, 0.1944, 0.2628), (0.4562, 0.2128, -0.0422)]], None: [], }
stim_positions = {'double': [[(0.4584, 0.2575, 0.2038), (0.4612, 0.269, -0.0283)], [(0.4601, 0.1549, 0.1937), (0.4614, 0.166, -0.0358)]], 'double_20070301': [[(0.4538, 0.274, 0.1994), (0.4565, 0.2939, -0.0531)], [(0.4516, 0.1642, 0.1872), (0.4541, 0.1767, -0.0606)]], 'half': [[(0.4567, 0.2029, 0.1958), (0.4581, 0.2166, -0.0329)]], 'half_20070303': [[(0.4628, 0.2066, 0.192), (0.4703, 0.2276, -0.0555)]], 'tall': [[(0.4562, 0.1951, 0.2798), (0.4542, 0.2097, -0.0325)]], 'short': [[(0.4614, 0.2042, 0.1281), (0.4625, 0.2053, 0.1144)]], 'necklace': [[(0.4559, 0.1944, 0.2628), (0.4562, 0.2128, -0.0422)]], None: []}
class Node(object): def __init__(self): super().__init__() self.__filename = '' self.__children = [] self.__line_number = 0 self.__column_number = 0 def get_children(self) -> list: return self.__children def add_child(self, child: 'Node') -> None: assert isinstance(child, Node) self.__children.append(child) def get_line_number(self) -> int: return self.__line_number def set_line_number(self, n: int) -> None: self.__line_number = int(n) def get_column_number(self) -> int: return self.__column_number def set_column_number(self, n: int) -> None: self.__column_number = int(n) def get_file_name(self) -> str: return self.__filename def set_file_name(self, f: str) -> None: self.__filename = str(f) def is_leaf(self) -> bool: if len(self.__children) == 0: return True return False
class Node(object): def __init__(self): super().__init__() self.__filename = '' self.__children = [] self.__line_number = 0 self.__column_number = 0 def get_children(self) -> list: return self.__children def add_child(self, child: 'Node') -> None: assert isinstance(child, Node) self.__children.append(child) def get_line_number(self) -> int: return self.__line_number def set_line_number(self, n: int) -> None: self.__line_number = int(n) def get_column_number(self) -> int: return self.__column_number def set_column_number(self, n: int) -> None: self.__column_number = int(n) def get_file_name(self) -> str: return self.__filename def set_file_name(self, f: str) -> None: self.__filename = str(f) def is_leaf(self) -> bool: if len(self.__children) == 0: return True return False
def binary_search(nums, target): low = 0 high = len(nums) - 1 while low <= high: mid = low + ((high - low) // 2) if nums[mid] > target: high = mid-1 elif nums[mid] < target: low = mid+1 else: return mid return -1 if __name__ == "__main__": lst = [0, 1, 2, 5, 6, 7, 8] print(binary_search(lst, 10)) print(binary_search(lst, 7)) print(binary_search(lst, 1))
def binary_search(nums, target): low = 0 high = len(nums) - 1 while low <= high: mid = low + (high - low) // 2 if nums[mid] > target: high = mid - 1 elif nums[mid] < target: low = mid + 1 else: return mid return -1 if __name__ == '__main__': lst = [0, 1, 2, 5, 6, 7, 8] print(binary_search(lst, 10)) print(binary_search(lst, 7)) print(binary_search(lst, 1))
# # PySNMP MIB module ALVARION-USER-ACCOUNT-MIB (http://snmplabs.com/pysmi) # ASN.1 source file:///Users/davwang4/Dev/mibs.snmplabs.com/asn1/ALVARION-USER-ACCOUNT-MIB # Produced by pysmi-0.3.4 at Mon Apr 29 17:06:37 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) # alvarionMgmtV2, = mibBuilder.importSymbols("ALVARION-SMI", "alvarionMgmtV2") OctetString, ObjectIdentifier, Integer = mibBuilder.importSymbols("ASN1", "OctetString", "ObjectIdentifier", "Integer") NamedValues, = mibBuilder.importSymbols("ASN1-ENUMERATION", "NamedValues") SingleValueConstraint, ValueRangeConstraint, ConstraintsIntersection, ConstraintsUnion, ValueSizeConstraint = mibBuilder.importSymbols("ASN1-REFINEMENT", "SingleValueConstraint", "ValueRangeConstraint", "ConstraintsIntersection", "ConstraintsUnion", "ValueSizeConstraint") NotificationGroup, ObjectGroup, ModuleCompliance = mibBuilder.importSymbols("SNMPv2-CONF", "NotificationGroup", "ObjectGroup", "ModuleCompliance") Bits, MibScalar, MibTable, MibTableRow, MibTableColumn, NotificationType, Unsigned32, MibIdentifier, Integer32, Counter64, Gauge32, TimeTicks, ObjectIdentity, IpAddress, ModuleIdentity, Counter32, iso = mibBuilder.importSymbols("SNMPv2-SMI", "Bits", "MibScalar", "MibTable", "MibTableRow", "MibTableColumn", "NotificationType", "Unsigned32", "MibIdentifier", "Integer32", "Counter64", "Gauge32", "TimeTicks", "ObjectIdentity", "IpAddress", "ModuleIdentity", "Counter32", "iso") DisplayString, TextualConvention = mibBuilder.importSymbols("SNMPv2-TC", "DisplayString", "TextualConvention") alvarionUserAccountMIB = ModuleIdentity((1, 3, 6, 1, 4, 1, 12394, 1, 10, 5, 35)) if mibBuilder.loadTexts: alvarionUserAccountMIB.setLastUpdated('200710310000Z') if mibBuilder.loadTexts: alvarionUserAccountMIB.setOrganization('Alvarion Ltd.') alvarionUserAccountMIBObjects = MibIdentifier((1, 3, 6, 1, 4, 1, 12394, 1, 10, 5, 35, 1)) coUserAccountStatusGroup = MibIdentifier((1, 3, 6, 1, 4, 1, 12394, 1, 10, 5, 35, 1, 1)) coUserAccountStatusTable = MibTable((1, 3, 6, 1, 4, 1, 12394, 1, 10, 5, 35, 1, 1, 1), ) if mibBuilder.loadTexts: coUserAccountStatusTable.setStatus('current') coUserAccountStatusEntry = MibTableRow((1, 3, 6, 1, 4, 1, 12394, 1, 10, 5, 35, 1, 1, 1, 1), ).setIndexNames((0, "ALVARION-USER-ACCOUNT-MIB", "coUserAccIndex")) if mibBuilder.loadTexts: coUserAccountStatusEntry.setStatus('current') coUserAccIndex = MibTableColumn((1, 3, 6, 1, 4, 1, 12394, 1, 10, 5, 35, 1, 1, 1, 1, 1), Integer32().subtype(subtypeSpec=ValueRangeConstraint(1, 2147483647))) if mibBuilder.loadTexts: coUserAccIndex.setStatus('current') coUserAccUserName = MibTableColumn((1, 3, 6, 1, 4, 1, 12394, 1, 10, 5, 35, 1, 1, 1, 1, 2), DisplayString()).setMaxAccess("readonly") if mibBuilder.loadTexts: coUserAccUserName.setStatus('current') coUserAccPlanName = MibTableColumn((1, 3, 6, 1, 4, 1, 12394, 1, 10, 5, 35, 1, 1, 1, 1, 3), DisplayString()).setMaxAccess("readonly") if mibBuilder.loadTexts: coUserAccPlanName.setStatus('current') coUserAccRemainingOnlineTime = MibTableColumn((1, 3, 6, 1, 4, 1, 12394, 1, 10, 5, 35, 1, 1, 1, 1, 4), Integer32()).setUnits('seconds').setMaxAccess("readonly") if mibBuilder.loadTexts: coUserAccRemainingOnlineTime.setStatus('current') coUserAccFirstLoginTime = MibTableColumn((1, 3, 6, 1, 4, 1, 12394, 1, 10, 5, 35, 1, 1, 1, 1, 5), DisplayString()).setMaxAccess("readonly") if mibBuilder.loadTexts: coUserAccFirstLoginTime.setStatus('current') coUserAccRemainingSessionTime = MibTableColumn((1, 3, 6, 1, 4, 1, 12394, 1, 10, 5, 35, 1, 1, 1, 1, 6), Integer32()).setUnits('seconds').setMaxAccess("readonly") if mibBuilder.loadTexts: coUserAccRemainingSessionTime.setStatus('current') coUserAccStatus = MibTableColumn((1, 3, 6, 1, 4, 1, 12394, 1, 10, 5, 35, 1, 1, 1, 1, 7), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2))).clone(namedValues=NamedValues(("valid", 1), ("invalid", 2)))).setMaxAccess("readonly") if mibBuilder.loadTexts: coUserAccStatus.setStatus('current') coUserAccExpirationTime = MibTableColumn((1, 3, 6, 1, 4, 1, 12394, 1, 10, 5, 35, 1, 1, 1, 1, 8), DisplayString()).setMaxAccess("readonly") if mibBuilder.loadTexts: coUserAccExpirationTime.setStatus('current') alvarionUserAccountMIBNotificationPrefix = MibIdentifier((1, 3, 6, 1, 4, 1, 12394, 1, 10, 5, 35, 2)) alvarionUserAccountMIBNotifications = MibIdentifier((1, 3, 6, 1, 4, 1, 12394, 1, 10, 5, 35, 2, 0)) alvarionUserAccountMIBConformance = MibIdentifier((1, 3, 6, 1, 4, 1, 12394, 1, 10, 5, 35, 3)) alvarionUserAccountMIBCompliances = MibIdentifier((1, 3, 6, 1, 4, 1, 12394, 1, 10, 5, 35, 3, 1)) alvarionUserAccountMIBGroups = MibIdentifier((1, 3, 6, 1, 4, 1, 12394, 1, 10, 5, 35, 3, 2)) alvarionUserAccountMIBCompliance = ModuleCompliance((1, 3, 6, 1, 4, 1, 12394, 1, 10, 5, 35, 3, 1, 1)).setObjects(("ALVARION-USER-ACCOUNT-MIB", "alvarionUserAccountStatusMIBGroup")) if getattr(mibBuilder, 'version', (0, 0, 0)) > (4, 4, 0): alvarionUserAccountMIBCompliance = alvarionUserAccountMIBCompliance.setStatus('current') alvarionUserAccountStatusMIBGroup = ObjectGroup((1, 3, 6, 1, 4, 1, 12394, 1, 10, 5, 35, 3, 2, 1)).setObjects(("ALVARION-USER-ACCOUNT-MIB", "coUserAccUserName"), ("ALVARION-USER-ACCOUNT-MIB", "coUserAccPlanName"), ("ALVARION-USER-ACCOUNT-MIB", "coUserAccRemainingOnlineTime"), ("ALVARION-USER-ACCOUNT-MIB", "coUserAccFirstLoginTime"), ("ALVARION-USER-ACCOUNT-MIB", "coUserAccRemainingSessionTime"), ("ALVARION-USER-ACCOUNT-MIB", "coUserAccStatus"), ("ALVARION-USER-ACCOUNT-MIB", "coUserAccExpirationTime")) if getattr(mibBuilder, 'version', (0, 0, 0)) > (4, 4, 0): alvarionUserAccountStatusMIBGroup = alvarionUserAccountStatusMIBGroup.setStatus('current') mibBuilder.exportSymbols("ALVARION-USER-ACCOUNT-MIB", coUserAccountStatusEntry=coUserAccountStatusEntry, coUserAccountStatusTable=coUserAccountStatusTable, alvarionUserAccountMIBNotificationPrefix=alvarionUserAccountMIBNotificationPrefix, alvarionUserAccountMIBGroups=alvarionUserAccountMIBGroups, alvarionUserAccountStatusMIBGroup=alvarionUserAccountStatusMIBGroup, coUserAccountStatusGroup=coUserAccountStatusGroup, alvarionUserAccountMIBCompliances=alvarionUserAccountMIBCompliances, PYSNMP_MODULE_ID=alvarionUserAccountMIB, coUserAccRemainingOnlineTime=coUserAccRemainingOnlineTime, coUserAccExpirationTime=coUserAccExpirationTime, coUserAccUserName=coUserAccUserName, coUserAccFirstLoginTime=coUserAccFirstLoginTime, alvarionUserAccountMIB=alvarionUserAccountMIB, alvarionUserAccountMIBCompliance=alvarionUserAccountMIBCompliance, coUserAccStatus=coUserAccStatus, coUserAccPlanName=coUserAccPlanName, coUserAccIndex=coUserAccIndex, alvarionUserAccountMIBConformance=alvarionUserAccountMIBConformance, coUserAccRemainingSessionTime=coUserAccRemainingSessionTime, alvarionUserAccountMIBObjects=alvarionUserAccountMIBObjects, alvarionUserAccountMIBNotifications=alvarionUserAccountMIBNotifications)
(alvarion_mgmt_v2,) = mibBuilder.importSymbols('ALVARION-SMI', 'alvarionMgmtV2') (octet_string, object_identifier, integer) = mibBuilder.importSymbols('ASN1', 'OctetString', 'ObjectIdentifier', 'Integer') (named_values,) = mibBuilder.importSymbols('ASN1-ENUMERATION', 'NamedValues') (single_value_constraint, value_range_constraint, constraints_intersection, constraints_union, value_size_constraint) = mibBuilder.importSymbols('ASN1-REFINEMENT', 'SingleValueConstraint', 'ValueRangeConstraint', 'ConstraintsIntersection', 'ConstraintsUnion', 'ValueSizeConstraint') (notification_group, object_group, module_compliance) = mibBuilder.importSymbols('SNMPv2-CONF', 'NotificationGroup', 'ObjectGroup', 'ModuleCompliance') (bits, mib_scalar, mib_table, mib_table_row, mib_table_column, notification_type, unsigned32, mib_identifier, integer32, counter64, gauge32, time_ticks, object_identity, ip_address, module_identity, counter32, iso) = mibBuilder.importSymbols('SNMPv2-SMI', 'Bits', 'MibScalar', 'MibTable', 'MibTableRow', 'MibTableColumn', 'NotificationType', 'Unsigned32', 'MibIdentifier', 'Integer32', 'Counter64', 'Gauge32', 'TimeTicks', 'ObjectIdentity', 'IpAddress', 'ModuleIdentity', 'Counter32', 'iso') (display_string, textual_convention) = mibBuilder.importSymbols('SNMPv2-TC', 'DisplayString', 'TextualConvention') alvarion_user_account_mib = module_identity((1, 3, 6, 1, 4, 1, 12394, 1, 10, 5, 35)) if mibBuilder.loadTexts: alvarionUserAccountMIB.setLastUpdated('200710310000Z') if mibBuilder.loadTexts: alvarionUserAccountMIB.setOrganization('Alvarion Ltd.') alvarion_user_account_mib_objects = mib_identifier((1, 3, 6, 1, 4, 1, 12394, 1, 10, 5, 35, 1)) co_user_account_status_group = mib_identifier((1, 3, 6, 1, 4, 1, 12394, 1, 10, 5, 35, 1, 1)) co_user_account_status_table = mib_table((1, 3, 6, 1, 4, 1, 12394, 1, 10, 5, 35, 1, 1, 1)) if mibBuilder.loadTexts: coUserAccountStatusTable.setStatus('current') co_user_account_status_entry = mib_table_row((1, 3, 6, 1, 4, 1, 12394, 1, 10, 5, 35, 1, 1, 1, 1)).setIndexNames((0, 'ALVARION-USER-ACCOUNT-MIB', 'coUserAccIndex')) if mibBuilder.loadTexts: coUserAccountStatusEntry.setStatus('current') co_user_acc_index = mib_table_column((1, 3, 6, 1, 4, 1, 12394, 1, 10, 5, 35, 1, 1, 1, 1, 1), integer32().subtype(subtypeSpec=value_range_constraint(1, 2147483647))) if mibBuilder.loadTexts: coUserAccIndex.setStatus('current') co_user_acc_user_name = mib_table_column((1, 3, 6, 1, 4, 1, 12394, 1, 10, 5, 35, 1, 1, 1, 1, 2), display_string()).setMaxAccess('readonly') if mibBuilder.loadTexts: coUserAccUserName.setStatus('current') co_user_acc_plan_name = mib_table_column((1, 3, 6, 1, 4, 1, 12394, 1, 10, 5, 35, 1, 1, 1, 1, 3), display_string()).setMaxAccess('readonly') if mibBuilder.loadTexts: coUserAccPlanName.setStatus('current') co_user_acc_remaining_online_time = mib_table_column((1, 3, 6, 1, 4, 1, 12394, 1, 10, 5, 35, 1, 1, 1, 1, 4), integer32()).setUnits('seconds').setMaxAccess('readonly') if mibBuilder.loadTexts: coUserAccRemainingOnlineTime.setStatus('current') co_user_acc_first_login_time = mib_table_column((1, 3, 6, 1, 4, 1, 12394, 1, 10, 5, 35, 1, 1, 1, 1, 5), display_string()).setMaxAccess('readonly') if mibBuilder.loadTexts: coUserAccFirstLoginTime.setStatus('current') co_user_acc_remaining_session_time = mib_table_column((1, 3, 6, 1, 4, 1, 12394, 1, 10, 5, 35, 1, 1, 1, 1, 6), integer32()).setUnits('seconds').setMaxAccess('readonly') if mibBuilder.loadTexts: coUserAccRemainingSessionTime.setStatus('current') co_user_acc_status = mib_table_column((1, 3, 6, 1, 4, 1, 12394, 1, 10, 5, 35, 1, 1, 1, 1, 7), integer32().subtype(subtypeSpec=constraints_union(single_value_constraint(1, 2))).clone(namedValues=named_values(('valid', 1), ('invalid', 2)))).setMaxAccess('readonly') if mibBuilder.loadTexts: coUserAccStatus.setStatus('current') co_user_acc_expiration_time = mib_table_column((1, 3, 6, 1, 4, 1, 12394, 1, 10, 5, 35, 1, 1, 1, 1, 8), display_string()).setMaxAccess('readonly') if mibBuilder.loadTexts: coUserAccExpirationTime.setStatus('current') alvarion_user_account_mib_notification_prefix = mib_identifier((1, 3, 6, 1, 4, 1, 12394, 1, 10, 5, 35, 2)) alvarion_user_account_mib_notifications = mib_identifier((1, 3, 6, 1, 4, 1, 12394, 1, 10, 5, 35, 2, 0)) alvarion_user_account_mib_conformance = mib_identifier((1, 3, 6, 1, 4, 1, 12394, 1, 10, 5, 35, 3)) alvarion_user_account_mib_compliances = mib_identifier((1, 3, 6, 1, 4, 1, 12394, 1, 10, 5, 35, 3, 1)) alvarion_user_account_mib_groups = mib_identifier((1, 3, 6, 1, 4, 1, 12394, 1, 10, 5, 35, 3, 2)) alvarion_user_account_mib_compliance = module_compliance((1, 3, 6, 1, 4, 1, 12394, 1, 10, 5, 35, 3, 1, 1)).setObjects(('ALVARION-USER-ACCOUNT-MIB', 'alvarionUserAccountStatusMIBGroup')) if getattr(mibBuilder, 'version', (0, 0, 0)) > (4, 4, 0): alvarion_user_account_mib_compliance = alvarionUserAccountMIBCompliance.setStatus('current') alvarion_user_account_status_mib_group = object_group((1, 3, 6, 1, 4, 1, 12394, 1, 10, 5, 35, 3, 2, 1)).setObjects(('ALVARION-USER-ACCOUNT-MIB', 'coUserAccUserName'), ('ALVARION-USER-ACCOUNT-MIB', 'coUserAccPlanName'), ('ALVARION-USER-ACCOUNT-MIB', 'coUserAccRemainingOnlineTime'), ('ALVARION-USER-ACCOUNT-MIB', 'coUserAccFirstLoginTime'), ('ALVARION-USER-ACCOUNT-MIB', 'coUserAccRemainingSessionTime'), ('ALVARION-USER-ACCOUNT-MIB', 'coUserAccStatus'), ('ALVARION-USER-ACCOUNT-MIB', 'coUserAccExpirationTime')) if getattr(mibBuilder, 'version', (0, 0, 0)) > (4, 4, 0): alvarion_user_account_status_mib_group = alvarionUserAccountStatusMIBGroup.setStatus('current') mibBuilder.exportSymbols('ALVARION-USER-ACCOUNT-MIB', coUserAccountStatusEntry=coUserAccountStatusEntry, coUserAccountStatusTable=coUserAccountStatusTable, alvarionUserAccountMIBNotificationPrefix=alvarionUserAccountMIBNotificationPrefix, alvarionUserAccountMIBGroups=alvarionUserAccountMIBGroups, alvarionUserAccountStatusMIBGroup=alvarionUserAccountStatusMIBGroup, coUserAccountStatusGroup=coUserAccountStatusGroup, alvarionUserAccountMIBCompliances=alvarionUserAccountMIBCompliances, PYSNMP_MODULE_ID=alvarionUserAccountMIB, coUserAccRemainingOnlineTime=coUserAccRemainingOnlineTime, coUserAccExpirationTime=coUserAccExpirationTime, coUserAccUserName=coUserAccUserName, coUserAccFirstLoginTime=coUserAccFirstLoginTime, alvarionUserAccountMIB=alvarionUserAccountMIB, alvarionUserAccountMIBCompliance=alvarionUserAccountMIBCompliance, coUserAccStatus=coUserAccStatus, coUserAccPlanName=coUserAccPlanName, coUserAccIndex=coUserAccIndex, alvarionUserAccountMIBConformance=alvarionUserAccountMIBConformance, coUserAccRemainingSessionTime=coUserAccRemainingSessionTime, alvarionUserAccountMIBObjects=alvarionUserAccountMIBObjects, alvarionUserAccountMIBNotifications=alvarionUserAccountMIBNotifications)
class Solution: def superPow(self, a: int, b: List[int]) -> int: if (a % 1337 == 0): return 0 return pow(a, reduce(lambda x, y: x * 10 + y, b), 1337)
class Solution: def super_pow(self, a: int, b: List[int]) -> int: if a % 1337 == 0: return 0 return pow(a, reduce(lambda x, y: x * 10 + y, b), 1337)
print("Hello, world!") x = "Hello World" print(x) y = 42 print(y)
print('Hello, world!') x = 'Hello World' print(x) y = 42 print(y)
def StringToDict(s): RES = dict() for e in set(s): RES[e] = 0 for e in s: RES[e] += 1 return RES
def string_to_dict(s): res = dict() for e in set(s): RES[e] = 0 for e in s: RES[e] += 1 return RES
DO_RUN_BIAS_TEST=False DEBUG = False INPUT_CSV=False ROOT_FOLDER="/home/jupyter/forms-ocr" OUTPUT_FOLDER= ROOT_FOLDER + "/sample_images" GEN_FOLDER = OUTPUT_FOLDER + "/img" LOCALE = "en_GB" DUMMY_GENERATOR=0 FIELD_DICT_3FIELDS= {'Name':(0,0),'Tax':(0,0), 'Address':(0,0) } FIELD_DICT_7FIELDS= {'Name':(0,0),'BusinessName':(0,0), 'Tax':(0,0), 'Address':(0,0), 'City':(0,0), 'Requester':(0,0), 'Signature':(0,0) } FIELD_DICT_16FIELDS= {'Name':(0,0),'BusinessName':(0,0), 'Tax':(0,0), 'Address':(0,0), 'City':(0,0), 'Requester':(0,0), 'Signature':(0,0), 'ssn1':(0,0), 'ssn2':(0,0), 'ssn3':(0,0), 'ssn4':(0,0), 'ssn5':(0,0), 'ssn6':(0,0), 'ssn7':(0,0), 'ssn8':(0,0), 'ssn9':(0,0) } FIELD_DICT_23FIELDS= {'Name':(0,0),'BusinessName':(0,0), 'Tax':(0,0), 'Address':(0,0), 'City':(0,0), 'Requester':(0,0), 'Signature':(0,0), 'ssn1':(0,0), 'ssn2':(0,0), 'ssn3':(0,0), 'ssn4':(0,0), 'ssn5':(0,0), 'ssn6':(0,0), 'ssn7':(0,0), 'ssn8':(0,0), 'ssn9':(0,0), 'Tax2':(0,0), 'Tax3':(0,0), 'Tax4':(0,0), 'Tax5':(0,0), 'Tax6':(0,0), 'Tax7':(0,0), 'Date':(0,0) } FIELD_DICT_SSN= {'ssn1':(0,0), 'ssn2':(0,0), 'ssn3':(0,0), 'ssn4':(0,0), 'ssn5':(0,0), 'ssn6':(0,0), 'ssn7':(0,0), 'ssn8':(0,0), 'ssn9':(0,0) } FIELD_DICT= {'Name':(0,0),'BusinessName':(0,0), 'Tax':(0,0), 'Instructions':(0,0), 'Exemptions':(0,0), 'ExemptionCode':(0,0), 'Address':(0,0), 'City':(0,0), 'Requester':(0,0),'Account':(0,0), 'SocialSeciurityNumber':(0,0), 'EmpIdentificationNumber':(0,0) } ############################### FAKER_GENERATOR=1 HANDWRITING_FIXED=0 HANDWRITING_PRESET_FLAG=1
do_run_bias_test = False debug = False input_csv = False root_folder = '/home/jupyter/forms-ocr' output_folder = ROOT_FOLDER + '/sample_images' gen_folder = OUTPUT_FOLDER + '/img' locale = 'en_GB' dummy_generator = 0 field_dict_3_fields = {'Name': (0, 0), 'Tax': (0, 0), 'Address': (0, 0)} field_dict_7_fields = {'Name': (0, 0), 'BusinessName': (0, 0), 'Tax': (0, 0), 'Address': (0, 0), 'City': (0, 0), 'Requester': (0, 0), 'Signature': (0, 0)} field_dict_16_fields = {'Name': (0, 0), 'BusinessName': (0, 0), 'Tax': (0, 0), 'Address': (0, 0), 'City': (0, 0), 'Requester': (0, 0), 'Signature': (0, 0), 'ssn1': (0, 0), 'ssn2': (0, 0), 'ssn3': (0, 0), 'ssn4': (0, 0), 'ssn5': (0, 0), 'ssn6': (0, 0), 'ssn7': (0, 0), 'ssn8': (0, 0), 'ssn9': (0, 0)} field_dict_23_fields = {'Name': (0, 0), 'BusinessName': (0, 0), 'Tax': (0, 0), 'Address': (0, 0), 'City': (0, 0), 'Requester': (0, 0), 'Signature': (0, 0), 'ssn1': (0, 0), 'ssn2': (0, 0), 'ssn3': (0, 0), 'ssn4': (0, 0), 'ssn5': (0, 0), 'ssn6': (0, 0), 'ssn7': (0, 0), 'ssn8': (0, 0), 'ssn9': (0, 0), 'Tax2': (0, 0), 'Tax3': (0, 0), 'Tax4': (0, 0), 'Tax5': (0, 0), 'Tax6': (0, 0), 'Tax7': (0, 0), 'Date': (0, 0)} field_dict_ssn = {'ssn1': (0, 0), 'ssn2': (0, 0), 'ssn3': (0, 0), 'ssn4': (0, 0), 'ssn5': (0, 0), 'ssn6': (0, 0), 'ssn7': (0, 0), 'ssn8': (0, 0), 'ssn9': (0, 0)} field_dict = {'Name': (0, 0), 'BusinessName': (0, 0), 'Tax': (0, 0), 'Instructions': (0, 0), 'Exemptions': (0, 0), 'ExemptionCode': (0, 0), 'Address': (0, 0), 'City': (0, 0), 'Requester': (0, 0), 'Account': (0, 0), 'SocialSeciurityNumber': (0, 0), 'EmpIdentificationNumber': (0, 0)} faker_generator = 1 handwriting_fixed = 0 handwriting_preset_flag = 1
class Student: studentLevel = 'first year computer science 2020/2021 session' studentCounter = 0 def __init__(self, thename, thematricno, thesex, thehostelname , theage,thecsc102examscore): self.name = thename self.matricno = thematricno self.sex = thesex self.hostelname = thehostelname self.age = theage self.csc102examscore = thecsc102examscore Student.studentCounter = Student.studentCounter registeredCourse = 'CSC102' @classmethod def registeredcourse(cls): print("registerd course is {Student.registeredCourse}") def function(self): if self.age > 16: return "yes, he is older than 16" else: return "no he is not older than 16" def getName(self): return self.name def setName(self, thenewName): self.name = thenewName @staticmethod def PAUNanthem(): print('Pau, here we come, Pau, here we come ') studendt1 = Student('James Kaka', '021074', 'M','cooperative mall',15,98) print(studendt1.getName()) studendt1.setName('James Gaga') print(studendt1.getName()) print(studendt1.function()) Student.registeredCourse() Student.PAUNanthem()
class Student: student_level = 'first year computer science 2020/2021 session' student_counter = 0 def __init__(self, thename, thematricno, thesex, thehostelname, theage, thecsc102examscore): self.name = thename self.matricno = thematricno self.sex = thesex self.hostelname = thehostelname self.age = theage self.csc102examscore = thecsc102examscore Student.studentCounter = Student.studentCounter registered_course = 'CSC102' @classmethod def registeredcourse(cls): print('registerd course is {Student.registeredCourse}') def function(self): if self.age > 16: return 'yes, he is older than 16' else: return 'no he is not older than 16' def get_name(self): return self.name def set_name(self, thenewName): self.name = thenewName @staticmethod def pau_nanthem(): print('Pau, here we come, Pau, here we come ') studendt1 = student('James Kaka', '021074', 'M', 'cooperative mall', 15, 98) print(studendt1.getName()) studendt1.setName('James Gaga') print(studendt1.getName()) print(studendt1.function()) Student.registeredCourse() Student.PAUNanthem()
# success values # sql.h SQL_INVALID_HANDLE = -2 SQL_ERROR = -1 SQL_SUCCESS = 0 SQL_SUCCESS_WITH_INFO = 1 SQL_STILL_EXECUTING = 2 SQL_NEED_DATA = 99 SQL_NO_DATA_FOUND = 100 sql_errors = [SQL_ERROR, SQL_INVALID_HANDLE] # sqlext.h SQL_FETCH_NEXT = 0x01 SQL_FETCH_FIRST = 0x02 SQL_FETCH_LAST = 0x04 SQL_FETCH_PRIOR = 0x08 SQL_FETCH_ABSOLUTE = 0x10 SQL_FETCH_RELATIVE = 0x20 SQL_FETCH_RESUME = 0x40 SQL_FETCH_BOOKMARK = 0x80 # sql types SQL_TYPE_NULL = 0 SQL_CHAR = 1 SQL_NUMERIC = 2 SQL_DECIMAL = 3 SQL_INTEGER = 4 SQL_SMALLINT = 5 SQL_FLOAT = 6 SQL_REAL = 7 SQL_DOUBLE = 8 SQL_DATE = 9 SQL_TIME = 10 SQL_TIMESTAMP = 11 SQL_VARCHAR = 12 # SQL extended datatypes SQL_LONGVARCHAR = -1 SQL_BINARY = -2 SQL_VARBINARY = -3 SQL_LONGVARBINARY = -4 SQL_BIGINT = -5 SQL_TINYINT = -6 SQL_BIT = -7 SQL_INTERVAL_YEAR = -80 SQL_INTERVAL_MONTH = -81 SQL_INTERVAL_YEAR_TO_MONTH = -82 SQL_INTERVAL_DAY = -83 SQL_INTERVAL_HOUR = -84 SQL_INTERVAL_MINUTE = -85 SQL_INTERVAL_SECOND = -86 SQL_INTERVAL_DAY_TO_HOUR = -87 SQL_INTERVAL_DAY_TO_MINUTE = -88 SQL_INTERVAL_DAY_TO_SECOND = -89 SQL_INTERVAL_HOUR_TO_MINUTE = -90 SQL_INTERVAL_HOUR_TO_SECOND = -91 SQL_INTERVAL_MINUTE_TO_SECOND = -92 SQL_UNICODE = -95 SQL_UNICODE_VARCHAR = -96 SQL_UNICODE_LONGVARCHAR = -97 SQL_UNICODE_CHAR = SQL_UNICODE SQL_TYPE_DRIVER_START = SQL_INTERVAL_YEAR SQL_TYPE_DRIVER_END = SQL_UNICODE_LONGVARCHAR SQL_SIGNED_OFFSET = -20 SQL_UNSIGNED_OFFSET = -22 # Special length values (don't work yet) SQL_NULL_DATA = -1 SQL_DATA_AT_EXEC = -2 SQL_NTS = -3 # SQLGetInfo type types STRING = 's' INT16 = 'h' INT32 = 'l' # C datatype to SQL datatype mapping SQL types SQL_C_CHAR = SQL_CHAR # CHAR, VARCHAR, DECIMAL, NUMERIC SQL_C_LONG = SQL_INTEGER # INTEGER SQL_C_SHORT = SQL_SMALLINT # SMALLINT SQL_C_FLOAT = SQL_REAL # REAL SQL_C_DOUBLE = SQL_DOUBLE # FLOAT, DOUBLE SQL_C_DEFAULT = 99 # SQL_C_DATE = SQL_DATE SQL_C_TIME = SQL_TIME SQL_C_TIMESTAMP = SQL_TIMESTAMP SQL_C_BINARY = SQL_BINARY SQL_C_BIT = SQL_BIT SQL_C_TINYINT = SQL_TINYINT SQL_C_SLONG = SQL_C_LONG+SQL_SIGNED_OFFSET # SIGNED INTEGER SQL_C_SSHORT = SQL_C_SHORT+SQL_SIGNED_OFFSET # SIGNED SMALLINT SQL_C_STINYINT = SQL_TINYINT+SQL_SIGNED_OFFSET # SIGNED TINYINT SQL_C_ULONG = SQL_C_LONG+SQL_UNSIGNED_OFFSET # UNSIGNED INTEGER SQL_C_USHORT = SQL_C_SHORT+SQL_UNSIGNED_OFFSET # UNSIGNED SMALLINT SQL_C_UTINYINT = SQL_TINYINT+SQL_UNSIGNED_OFFSET # UNSIGNED TINYINT SQL_C_BOOKMARK = SQL_C_ULONG # BOOKMARK # from "sql.h" # Defines for SQLGetInfo SQL_ACTIVE_CONNECTIONS = 0, INT16 SQL_ACTIVE_STATEMENTS = 1, INT16 SQL_DATA_SOURCE_NAME = 2, STRING SQL_DRIVER_HDBC = 3, INT32 SQL_DRIVER_HENV = 4, INT32 SQL_DRIVER_HSTMT = 5, INT32 SQL_DRIVER_NAME = 6, STRING SQL_DRIVER_VER = 7, STRING SQL_FETCH_DIRECTION = 8, INT32 SQL_ODBC_API_CONFORMANCE = 9, INT16 SQL_ODBC_VER = 10, STRING SQL_ROW_UPDATES = 11, STRING SQL_ODBC_SAG_CLI_CONFORMANCE = 12, INT16 SQL_SERVER_NAME = 13, STRING SQL_SEARCH_PATTERN_ESCAPE = 14, STRING SQL_ODBC_SQL_CONFORMANCE = 15, INT16 SQL_DATABASE_NAME = 16, STRING SQL_DBMS_NAME = 17, STRING SQL_DBMS_VER = 18, STRING SQL_ACCESSIBLE_TABLES = 19, STRING SQL_ACCESSIBLE_PROCEDURES = 20, STRING SQL_PROCEDURES = 21, STRING SQL_CONCAT_NULL_BEHAVIOR = 22, INT16 SQL_CURSOR_COMMIT_BEHAVIOR = 23, INT16 SQL_CURSOR_ROLLBACK_BEHAVIOR = 24, INT16 SQL_DATA_SOURCE_READ_ONLY = 25, STRING SQL_DEFAULT_TXN_ISOLATION = 26, INT32 SQL_EXPRESSIONS_IN_ORDERBY = 27, STRING SQL_IDENTIFIER_CASE = 28, INT16 SQL_IDENTIFIER_QUOTE_CHAR = 29, STRING SQL_MAX_COLUMN_NAME_LEN = 30, INT16 SQL_MAX_CURSOR_NAME_LEN = 31, INT16 SQL_MAX_OWNER_NAME_LEN = 32, INT16 SQL_MAX_PROCEDURE_NAME_LEN = 33, INT16 SQL_MAX_QUALIFIER_NAME_LEN = 34, INT16 SQL_MAX_TABLE_NAME_LEN = 35, INT16 SQL_MULT_RESULT_SETS = 36, STRING SQL_MULTIPLE_ACTIVE_TXN = 37, STRING SQL_OUTER_JOINS = 38, STRING SQL_OWNER_TERM = 39, STRING SQL_PROCEDURE_TERM = 40, STRING SQL_QUALIFIER_NAME_SEPARATOR = 41, STRING SQL_QUALIFIER_TERM = 42, STRING SQL_SCROLL_CONCURRENCY = 43, INT32 SQL_SCROLL_OPTIONS = 44, INT32 SQL_TABLE_TERM = 45, STRING SQL_TXN_CAPABLE = 46, INT16 SQL_USER_NAME = 47, STRING SQL_CONVERT_FUNCTIONS = 48, INT32 SQL_NUMERIC_FUNCTIONS = 49, INT32 SQL_STRING_FUNCTIONS = 50, INT32 SQL_SYSTEM_FUNCTIONS = 51, INT32 SQL_TIMEDATE_FUNCTIONS = 52, INT32 SQL_CONVERT_BIGINT = 53, INT32 SQL_CONVERT_BINARY = 54, INT32 SQL_CONVERT_BIT = 55, INT32 SQL_CONVERT_CHAR = 56, INT32 SQL_CONVERT_DATE = 57, INT32 SQL_CONVERT_DECIMAL = 58, INT32 SQL_CONVERT_DOUBLE = 59, INT32 SQL_CONVERT_FLOAT = 60, INT32 SQL_CONVERT_INTEGER = 61, INT32 SQL_CONVERT_LONGVARCHAR = 62, INT32 SQL_CONVERT_NUMERIC = 63, INT32 SQL_CONVERT_REAL = 64, INT32 SQL_CONVERT_SMALLINT = 65, INT32 SQL_CONVERT_TIME = 66, INT32 SQL_CONVERT_TIMESTAMP = 67, INT32 SQL_CONVERT_TINYINT = 68, INT32 SQL_CONVERT_VARBINARY = 69, INT32 SQL_CONVERT_VARCHAR = 70, INT32 SQL_CONVERT_LONGVARBINARY = 71, INT32 SQL_TXN_ISOLATION_OPTION = 72, INT32 SQL_ODBC_SQL_OPT_IEF = 73, STRING SQL_CORRELATION_NAME = 74, INT16 SQL_NON_NULLABLE_COLUMNS = 75, INT16 SQL_DRIVER_HLIB = 76, INT32 SQL_DRIVER_ODBC_VER = 77, STRING SQL_LOCK_TYPES = 78, INT32 SQL_POS_OPERATIONS = 79, INT32 SQL_POSITIONED_STATEMENTS = 80, INT32 SQL_GETDATA_EXTENSIONS = 81, INT32 SQL_BOOKMARK_PERSISTENCE = 82, INT32 SQL_STATIC_SENSITIVITY = 83, INT32 SQL_FILE_USAGE = 84, INT16 SQL_NULL_COLLATION = 85, INT16 SQL_ALTER_TABLE = 86, INT32 SQL_COLUMN_ALIAS = 87, STRING SQL_GROUP_BY = 88, INT16 SQL_KEYWORDS = 89, STRING SQL_ORDER_BY_COLUMNS_IN_SELECT = 90, STRING SQL_OWNER_USAGE = 91, INT32 SQL_QUALIFIER_USAGE = 92, INT32 SQL_QUOTED_IDENTIFIER_CASE = 93, INT32 SQL_SPECIAL_CHARACTERS = 94, STRING SQL_SUBQUERIES = 95, INT32 SQL_UNION = 96, INT32 SQL_MAX_COLUMNS_IN_GROUP_BY = 97, INT16 SQL_MAX_COLUMNS_IN_INDEX = 98, INT16 SQL_MAX_COLUMNS_IN_ORDER_BY = 99, INT16 SQL_MAX_COLUMNS_IN_SELECT = 100, INT16 SQL_MAX_COLUMNS_IN_TABLE = 101, INT16 SQL_MAX_INDEX_SIZE = 102, INT32 SQL_MAX_ROW_SIZE_INCLUDES_LONG = 103, STRING SQL_MAX_ROW_SIZE = 104, INT32 SQL_MAX_STATEMENT_LEN = 105, INT32 SQL_MAX_TABLES_IN_SELECT = 106, INT16 SQL_MAX_USER_NAME_LEN = 107, INT16 SQL_MAX_CHAR_LITERAL_LEN = 108, INT32 SQL_TIMEDATE_ADD_INTERVALS = 109, INT32 SQL_TIMEDATE_DIFF_INTERVALS = 110, INT32 SQL_NEED_LONG_DATA_LEN = 111, STRING SQL_MAX_BINARY_LITERAL_LEN = 112, INT32 SQL_LIKE_ESCAPE_CLAUSE = 113, STRING SQL_QUALIFIER_LOCATION = 114, INT16 # # <Phew!> # # Level 1 Prototypes # <sqlext.h> # Options for SQLDriverConnect SQL_DRIVER_NOPROMPT = 0 SQL_DRIVER_COMPLETE = 1 SQL_DRIVER_PROMPT = 2 SQL_DRIVER_COMPLETE_REQUIRED = 3 # For SQLGetFunctions SQL_API_ALL_FUNCTIONS = 0 # Defines for SQLBindParameter and # SQLProcedureColumns (returned in the result set) SQL_PARAM_TYPE_UNKNOWN = 0 SQL_PARAM_INPUT = 1 SQL_PARAM_INPUT_OUTPUT = 2 SQL_RESULT_COL = 3 SQL_PARAM_OUTPUT = 4 SQL_RETURN_VALUE = 5 # SQLFreeStmt defines SQL_CLOSE = 0 SQL_DROP = 1 SQL_UNBIND = 2 SQL_RESET_PARAMS = 3 # Added by Edward Akerboom: # SQL Handles SQL_HANDLE_ENV = 1 SQL_HANDLE_DBC = 2 SQL_HANDLE_STMT = 3 SQL_HANDLE_DESC = 4 # SQLGetEnvAttr - Attributes SQL_ATTR_ODBC_VERSION = 200 SQL_ATTR_CONNECTION_POOLING = 201 SQL_ATTR_CP_MATCH = 202 # SQLGetEnvAttr - SQL_ATTR_ODBC_VERSION SQL_OV_ODBC2 = 2, INT32 SQL_OV_ODBC3 = 3, INT32 # # SQLGetEnvAttr - SQL_ATTR_CONNECTION_POOLING # SQL_CP_OFF 0UL # SQL_CP_ONE_PER_DRIVER 1UL # SQL_CP_ONE_PER_HENV 2UL # SQL_CP_DEFAULT SQL_CP_OFF # # # # SQLGetEnvAttr - SQL_ATTR_CP_MATCH # SQL_CP_STRICT_MATCH 0UL # SQL_CP_RELAXED_MATCH 1UL # SQL_CP_MATCH_DEFAULT SQL_CP_STRICT_MATCH SQL_NO_DATA = 100 SQL_NULL_HENV = 0 SQL_NULL_HDBC = 0 SQL_NULL_HSTMT = 0 # Don't know if this works: SQL_IS_POINTER = -4 SQL_IS_UINTEGER = -5 SQL_IS_INTEGER = -6 SQL_IS_USMALLINT = -7 SQL_IS_SMALLINT = -8
sql_invalid_handle = -2 sql_error = -1 sql_success = 0 sql_success_with_info = 1 sql_still_executing = 2 sql_need_data = 99 sql_no_data_found = 100 sql_errors = [SQL_ERROR, SQL_INVALID_HANDLE] sql_fetch_next = 1 sql_fetch_first = 2 sql_fetch_last = 4 sql_fetch_prior = 8 sql_fetch_absolute = 16 sql_fetch_relative = 32 sql_fetch_resume = 64 sql_fetch_bookmark = 128 sql_type_null = 0 sql_char = 1 sql_numeric = 2 sql_decimal = 3 sql_integer = 4 sql_smallint = 5 sql_float = 6 sql_real = 7 sql_double = 8 sql_date = 9 sql_time = 10 sql_timestamp = 11 sql_varchar = 12 sql_longvarchar = -1 sql_binary = -2 sql_varbinary = -3 sql_longvarbinary = -4 sql_bigint = -5 sql_tinyint = -6 sql_bit = -7 sql_interval_year = -80 sql_interval_month = -81 sql_interval_year_to_month = -82 sql_interval_day = -83 sql_interval_hour = -84 sql_interval_minute = -85 sql_interval_second = -86 sql_interval_day_to_hour = -87 sql_interval_day_to_minute = -88 sql_interval_day_to_second = -89 sql_interval_hour_to_minute = -90 sql_interval_hour_to_second = -91 sql_interval_minute_to_second = -92 sql_unicode = -95 sql_unicode_varchar = -96 sql_unicode_longvarchar = -97 sql_unicode_char = SQL_UNICODE sql_type_driver_start = SQL_INTERVAL_YEAR sql_type_driver_end = SQL_UNICODE_LONGVARCHAR sql_signed_offset = -20 sql_unsigned_offset = -22 sql_null_data = -1 sql_data_at_exec = -2 sql_nts = -3 string = 's' int16 = 'h' int32 = 'l' sql_c_char = SQL_CHAR sql_c_long = SQL_INTEGER sql_c_short = SQL_SMALLINT sql_c_float = SQL_REAL sql_c_double = SQL_DOUBLE sql_c_default = 99 sql_c_date = SQL_DATE sql_c_time = SQL_TIME sql_c_timestamp = SQL_TIMESTAMP sql_c_binary = SQL_BINARY sql_c_bit = SQL_BIT sql_c_tinyint = SQL_TINYINT sql_c_slong = SQL_C_LONG + SQL_SIGNED_OFFSET sql_c_sshort = SQL_C_SHORT + SQL_SIGNED_OFFSET sql_c_stinyint = SQL_TINYINT + SQL_SIGNED_OFFSET sql_c_ulong = SQL_C_LONG + SQL_UNSIGNED_OFFSET sql_c_ushort = SQL_C_SHORT + SQL_UNSIGNED_OFFSET sql_c_utinyint = SQL_TINYINT + SQL_UNSIGNED_OFFSET sql_c_bookmark = SQL_C_ULONG sql_active_connections = (0, INT16) sql_active_statements = (1, INT16) sql_data_source_name = (2, STRING) sql_driver_hdbc = (3, INT32) sql_driver_henv = (4, INT32) sql_driver_hstmt = (5, INT32) sql_driver_name = (6, STRING) sql_driver_ver = (7, STRING) sql_fetch_direction = (8, INT32) sql_odbc_api_conformance = (9, INT16) sql_odbc_ver = (10, STRING) sql_row_updates = (11, STRING) sql_odbc_sag_cli_conformance = (12, INT16) sql_server_name = (13, STRING) sql_search_pattern_escape = (14, STRING) sql_odbc_sql_conformance = (15, INT16) sql_database_name = (16, STRING) sql_dbms_name = (17, STRING) sql_dbms_ver = (18, STRING) sql_accessible_tables = (19, STRING) sql_accessible_procedures = (20, STRING) sql_procedures = (21, STRING) sql_concat_null_behavior = (22, INT16) sql_cursor_commit_behavior = (23, INT16) sql_cursor_rollback_behavior = (24, INT16) sql_data_source_read_only = (25, STRING) sql_default_txn_isolation = (26, INT32) sql_expressions_in_orderby = (27, STRING) sql_identifier_case = (28, INT16) sql_identifier_quote_char = (29, STRING) sql_max_column_name_len = (30, INT16) sql_max_cursor_name_len = (31, INT16) sql_max_owner_name_len = (32, INT16) sql_max_procedure_name_len = (33, INT16) sql_max_qualifier_name_len = (34, INT16) sql_max_table_name_len = (35, INT16) sql_mult_result_sets = (36, STRING) sql_multiple_active_txn = (37, STRING) sql_outer_joins = (38, STRING) sql_owner_term = (39, STRING) sql_procedure_term = (40, STRING) sql_qualifier_name_separator = (41, STRING) sql_qualifier_term = (42, STRING) sql_scroll_concurrency = (43, INT32) sql_scroll_options = (44, INT32) sql_table_term = (45, STRING) sql_txn_capable = (46, INT16) sql_user_name = (47, STRING) sql_convert_functions = (48, INT32) sql_numeric_functions = (49, INT32) sql_string_functions = (50, INT32) sql_system_functions = (51, INT32) sql_timedate_functions = (52, INT32) sql_convert_bigint = (53, INT32) sql_convert_binary = (54, INT32) sql_convert_bit = (55, INT32) sql_convert_char = (56, INT32) sql_convert_date = (57, INT32) sql_convert_decimal = (58, INT32) sql_convert_double = (59, INT32) sql_convert_float = (60, INT32) sql_convert_integer = (61, INT32) sql_convert_longvarchar = (62, INT32) sql_convert_numeric = (63, INT32) sql_convert_real = (64, INT32) sql_convert_smallint = (65, INT32) sql_convert_time = (66, INT32) sql_convert_timestamp = (67, INT32) sql_convert_tinyint = (68, INT32) sql_convert_varbinary = (69, INT32) sql_convert_varchar = (70, INT32) sql_convert_longvarbinary = (71, INT32) sql_txn_isolation_option = (72, INT32) sql_odbc_sql_opt_ief = (73, STRING) sql_correlation_name = (74, INT16) sql_non_nullable_columns = (75, INT16) sql_driver_hlib = (76, INT32) sql_driver_odbc_ver = (77, STRING) sql_lock_types = (78, INT32) sql_pos_operations = (79, INT32) sql_positioned_statements = (80, INT32) sql_getdata_extensions = (81, INT32) sql_bookmark_persistence = (82, INT32) sql_static_sensitivity = (83, INT32) sql_file_usage = (84, INT16) sql_null_collation = (85, INT16) sql_alter_table = (86, INT32) sql_column_alias = (87, STRING) sql_group_by = (88, INT16) sql_keywords = (89, STRING) sql_order_by_columns_in_select = (90, STRING) sql_owner_usage = (91, INT32) sql_qualifier_usage = (92, INT32) sql_quoted_identifier_case = (93, INT32) sql_special_characters = (94, STRING) sql_subqueries = (95, INT32) sql_union = (96, INT32) sql_max_columns_in_group_by = (97, INT16) sql_max_columns_in_index = (98, INT16) sql_max_columns_in_order_by = (99, INT16) sql_max_columns_in_select = (100, INT16) sql_max_columns_in_table = (101, INT16) sql_max_index_size = (102, INT32) sql_max_row_size_includes_long = (103, STRING) sql_max_row_size = (104, INT32) sql_max_statement_len = (105, INT32) sql_max_tables_in_select = (106, INT16) sql_max_user_name_len = (107, INT16) sql_max_char_literal_len = (108, INT32) sql_timedate_add_intervals = (109, INT32) sql_timedate_diff_intervals = (110, INT32) sql_need_long_data_len = (111, STRING) sql_max_binary_literal_len = (112, INT32) sql_like_escape_clause = (113, STRING) sql_qualifier_location = (114, INT16) sql_driver_noprompt = 0 sql_driver_complete = 1 sql_driver_prompt = 2 sql_driver_complete_required = 3 sql_api_all_functions = 0 sql_param_type_unknown = 0 sql_param_input = 1 sql_param_input_output = 2 sql_result_col = 3 sql_param_output = 4 sql_return_value = 5 sql_close = 0 sql_drop = 1 sql_unbind = 2 sql_reset_params = 3 sql_handle_env = 1 sql_handle_dbc = 2 sql_handle_stmt = 3 sql_handle_desc = 4 sql_attr_odbc_version = 200 sql_attr_connection_pooling = 201 sql_attr_cp_match = 202 sql_ov_odbc2 = (2, INT32) sql_ov_odbc3 = (3, INT32) sql_no_data = 100 sql_null_henv = 0 sql_null_hdbc = 0 sql_null_hstmt = 0 sql_is_pointer = -4 sql_is_uinteger = -5 sql_is_integer = -6 sql_is_usmallint = -7 sql_is_smallint = -8
class Solution: # @param A : list of integers # @return an integer def perfectPeak(self, A): n = len(A) left = [0] * n right = [0] * n left[0] = A[0] right[n-1] = A[n-1] for i in range(1, n) : left[i] = max(left[i-1], A[i]) for i in range(n-2, -1, -1) : right[i] = min(right[i+1], A[i]) for i in range(1, n-1) : if A[i] > left[i-1] and A[i] < right[i+1] : return 1 return 0 A = [ 5706, 26963, 24465, 29359, 16828, 26501, 28146, 18468, 9962, 2996, 492, 11479, 23282, 19170, 15725, 6335 ] ob = Solution() print(ob.perfectPeak(A))
class Solution: def perfect_peak(self, A): n = len(A) left = [0] * n right = [0] * n left[0] = A[0] right[n - 1] = A[n - 1] for i in range(1, n): left[i] = max(left[i - 1], A[i]) for i in range(n - 2, -1, -1): right[i] = min(right[i + 1], A[i]) for i in range(1, n - 1): if A[i] > left[i - 1] and A[i] < right[i + 1]: return 1 return 0 a = [5706, 26963, 24465, 29359, 16828, 26501, 28146, 18468, 9962, 2996, 492, 11479, 23282, 19170, 15725, 6335] ob = solution() print(ob.perfectPeak(A))
class Matrix: def __init__(self, matrix_string: str): # Split matrix_string into lines, split lines on whitespace and cast elements as integers. self.matrix = [[int(j) for j in i.split()] for i in matrix_string.splitlines()] def row(self, index: int) -> list[int]: return self.matrix[index - 1] def column(self, index: int) -> list[int]: return [i[index - 1] for i in self.matrix]
class Matrix: def __init__(self, matrix_string: str): self.matrix = [[int(j) for j in i.split()] for i in matrix_string.splitlines()] def row(self, index: int) -> list[int]: return self.matrix[index - 1] def column(self, index: int) -> list[int]: return [i[index - 1] for i in self.matrix]
Colors = {'snow': ('255', '250', '250'), 'ghostwhite': ('248', '248', '255'), 'GhostWhite': ('248', '248', '255'), 'whitesmoke': ('245', '245', '245'), 'WhiteSmoke': ('245', '245', '245'), 'gainsboro': ('220', '220', '220'), 'floralwhite': ('255', '250', '240'), 'FloralWhite': ('255', '250', '240'), 'oldlace': ('253', '245', '230'), 'OldLace': ('253', '245', '230'), 'linen': ('250', '240', '230'), 'antiquewhite': ('250', '235', '215'), 'AntiqueWhite': ('250', '235', '215'), 'papayawhip': ('255', '239', '213'), 'PapayaWhip': ('255', '239', '213'), 'blanchedalmond': ('255', '235', '205'), 'BlanchedAlmond': ('255', '235', '205'), 'bisque': ('255', '228', '196'), 'peachpuff': ('255', '218', '185'), 'PeachPuff': ('255', '218', '185'), 'navajowhite': ('255', '222', '173'), 'NavajoWhite': ('255', '222', '173'), 'moccasin': ('255', '228', '181'), 'cornsilk': ('255', '248', '220'), 'ivory': ('255', '255', '240'), 'lemonchiffon': ('255', '250', '205'), 'LemonChiffon': ('255', '250', '205'), 'seashell': ('255', '245', '238'), 'honeydew': ('240', '255', '240'), 'mintcream': ('245', '255', '250'), 'MintCream': ('245', '255', '250'), 'azure': ('240', '255', '255'), 'aliceblue': ('240', '248', '255'), 'AliceBlue': ('240', '248', '255'), 'lavender': ('230', '230', '250'), 'lavenderblush': ('255', '240', '245'), 'LavenderBlush': ('255', '240', '245'), 'mistyrose': ('255', '228', '225'), 'MistyRose': ('255', '228', '225'), 'white': ('255', '255', '255'), 'black': ('0', '0', '0'), 'darkslategray': ('47', '79', '79'), 'DarkSlateGray': ('47', '79', '79'), 'darkslategrey': ('47', '79', '79'), 'DarkSlateGrey': ('47', '79', '79'), 'dimgray': ('105', '105', '105'), 'DimGray': ('105', '105', '105'), 'dimgrey': ('105', '105', '105'), 'DimGrey': ('105', '105', '105'), 'slategray': ('112', '128', '144'), 'SlateGray': ('112', '128', '144'), 'slategrey': ('112', '128', '144'), 'SlateGrey': ('112', '128', '144'), 'lightslategray': ('119', '136', '153'), 'LightSlateGray': ('119', '136', '153'), 'lightslategrey': ('119', '136', '153'), 'LightSlateGrey': ('119', '136', '153'), 'gray': ('190', '190', '190'), 'grey': ('190', '190', '190'), 'lightgrey': ('211', '211', '211'), 'LightGrey': ('211', '211', '211'), 'lightgray': ('211', '211', '211'), 'LightGray': ('211', '211', '211'), 'midnightblue': ('25', '25', '112'), 'MidnightBlue': ('25', '25', '112'), 'navy': ('0', '0', '128'), 'navyblue': ('0', '0', '128'), 'NavyBlue': ('0', '0', '128'), 'cornflowerblue': ('100', '149', '237'), 'CornflowerBlue': ('100', '149', '237'), 'darkslateblue': ('72', '61', '139'), 'DarkSlateBlue': ('72', '61', '139'), 'slateblue': ('106', '90', '205'), 'SlateBlue': ('106', '90', '205'), 'mediumslateblue': ('123', '104', '238'), 'MediumSlateBlue': ('123', '104', '238'), 'lightslateblue': ('132', '112', '255'), 'LightSlateBlue': ('132', '112', '255'), 'mediumblue': ('0', '0', '205'), 'MediumBlue': ('0', '0', '205'), 'royalblue': ('65', '105', '225'), 'RoyalBlue': ('65', '105', '225'), 'blue': ('0', '0', '255'), 'dodgerblue': ('30', '144', '255'), 'DodgerBlue': ('30', '144', '255'), 'deepskyblue': ('0', '191', '255'), 'DeepSkyBlue': ('0', '191', '255'), 'skyblue': ('135', '206', '235'), 'SkyBlue': ('135', '206', '235'), 'lightskyblue': ('135', '206', '250'), 'LightSkyBlue': ('135', '206', '250'), 'steelblue': ('70', '130', '180'), 'SteelBlue': ('70', '130', '180'), 'lightsteelblue': ('176', '196', '222'), 'LightSteelBlue': ('176', '196', '222'), 'lightblue': ('173', '216', '230'), 'LightBlue': ('173', '216', '230'), 'powderblue': ('176', '224', '230'), 'PowderBlue': ('176', '224', '230'), 'paleturquoise': ('175', '238', '238'), 'PaleTurquoise': ('175', '238', '238'), 'darkturquoise': ('0', '206', '209'), 'DarkTurquoise': ('0', '206', '209'), 'mediumturquoise': ('72', '209', '204'), 'MediumTurquoise': ('72', '209', '204'), 'turquoise': ('64', '224', '208'), 'cyan': ('0', '255', '255'), 'lightcyan': ('224', '255', '255'), 'LightCyan': ('224', '255', '255'), 'cadetblue': ('95', '158', '160'), 'CadetBlue': ('95', '158', '160'), 'mediumaquamarine': ('102', '205', '170'), 'MediumAquamarine': ('102', '205', '170'), 'aquamarine': ('127', '255', '212'), 'darkgreen': ('0', '100', '0'), 'DarkGreen': ('0', '100', '0'), 'darkolivegreen': ('85', '107', '47'), 'DarkOliveGreen': ('85', '107', '47'), 'darkseagreen': ('143', '188', '143'), 'DarkSeaGreen': ('143', '188', '143'), 'seagreen': ('46', '139', '87'), 'SeaGreen': ('46', '139', '87'), 'mediumseagreen': ('60', '179', '113'), 'MediumSeaGreen': ('60', '179', '113'), 'lightseagreen': ('32', '178', '170'), 'LightSeaGreen': ('32', '178', '170'), 'palegreen': ('152', '251', '152'), 'PaleGreen': ('152', '251', '152'), 'springgreen': ('0', '255', '127'), 'SpringGreen': ('0', '255', '127'), 'lawngreen': ('124', '252', '0'), 'LawnGreen': ('124', '252', '0'), 'green': ('0', '255', '0'), 'chartreuse': ('127', '255', '0'), 'mediumspringgreen': ('0', '250', '154'), 'MediumSpringGreen': ('0', '250', '154'), 'greenyellow': ('173', '255', '47'), 'GreenYellow': ('173', '255', '47'), 'limegreen': ('50', '205', '50'), 'LimeGreen': ('50', '205', '50'), 'yellowgreen': ('154', '205', '50'), 'YellowGreen': ('154', '205', '50'), 'forestgreen': ('34', '139', '34'), 'ForestGreen': ('34', '139', '34'), 'olivedrab': ('107', '142', '35'), 'OliveDrab': ('107', '142', '35'), 'darkkhaki': ('189', '183', '107'), 'DarkKhaki': ('189', '183', '107'), 'khaki': ('240', '230', '140'), 'palegoldenrod': ('238', '232', '170'), 'PaleGoldenrod': ('238', '232', '170'), 'lightgoldenrodyellow': ('250', '250', '210'), 'LightGoldenrodYellow': ('250', '250', '210'), 'lightyellow': ('255', '255', '224'), 'LightYellow': ('255', '255', '224'), 'yellow': ('255', '255', '0'), 'gold': ('255', '215', '0'), 'lightgoldenrod': ('238', '221', '130'), 'LightGoldenrod': ('238', '221', '130'), 'goldenrod': ('218', '165', '32'), 'darkgoldenrod': ('184', '134', '11'), 'DarkGoldenrod': ('184', '134', '11'), 'rosybrown': ('188', '143', '143'), 'RosyBrown': ('188', '143', '143'), 'indianred': ('205', '92', '92'), 'IndianRed': ('205', '92', '92'), 'saddlebrown': ('139', '69', '19'), 'SaddleBrown': ('139', '69', '19'), 'sienna': ('160', '82', '45'), 'peru': ('205', '133', '63'), 'burlywood': ('222', '184', '135'), 'beige': ('245', '245', '220'), 'wheat': ('245', '222', '179'), 'sandybrown': ('244', '164', '96'), 'SandyBrown': ('244', '164', '96'), 'tan': ('210', '180', '140'), 'chocolate': ('210', '105', '30'), 'firebrick': ('178', '34', '34'), 'brown': ('165', '42', '42'), 'darksalmon': ('233', '150', '122'), 'DarkSalmon': ('233', '150', '122'), 'salmon': ('250', '128', '114'), 'lightsalmon': ('255', '160', '122'), 'LightSalmon': ('255', '160', '122'), 'orange': ('255', '165', '0'), 'darkorange': ('255', '140', '0'), 'DarkOrange': ('255', '140', '0'), 'coral': ('255', '127', '80'), 'lightcoral': ('240', '128', '128'), 'LightCoral': ('240', '128', '128'), 'tomato': ('255', '99', '71'), 'orangered': ('255', '69', '0'), 'OrangeRed': ('255', '69', '0'), 'red': ('255', '0', '0'), 'hotpink': ('255', '105', '180'), 'HotPink': ('255', '105', '180'), 'deeppink': ('255', '20', '147'), 'DeepPink': ('255', '20', '147'), 'pink': ('255', '192', '203'), 'lightpink': ('255', '182', '193'), 'LightPink': ('255', '182', '193'), 'palevioletred': ('219', '112', '147'), 'PaleVioletRed': ('219', '112', '147'), 'maroon': ('176', '48', '96'), 'mediumvioletred': ('199', '21', '133'), 'MediumVioletRed': ('199', '21', '133'), 'violetred': ('208', '32', '144'), 'VioletRed': ('208', '32', '144'), 'magenta': ('255', '0', '255'), 'violet': ('238', '130', '238'), 'plum': ('221', '160', '221'), 'orchid': ('218', '112', '214'), 'mediumorchid': ('186', '85', '211'), 'MediumOrchid': ('186', '85', '211'), 'darkorchid': ('153', '50', '204'), 'DarkOrchid': ('153', '50', '204'), 'darkviolet': ('148', '0', '211'), 'DarkViolet': ('148', '0', '211'), 'blueviolet': ('138', '43', '226'), 'BlueViolet': ('138', '43', '226'), 'purple': ('160', '32', '240'), 'mediumpurple': ('147', '112', '219'), 'MediumPurple': ('147', '112', '219'), 'thistle': ('216', '191', '216'), 'snow1': ('255', '250', '250'), 'snow2': ('238', '233', '233'), 'snow3': ('205', '201', '201'), 'snow4': ('139', '137', '137'), 'seashell1': ('255', '245', '238'), 'seashell2': ('238', '229', '222'), 'seashell3': ('205', '197', '191'), 'seashell4': ('139', '134', '130'), 'AntiqueWhite1': ('255', '239', '219'), 'AntiqueWhite2': ('238', '223', '204'), 'AntiqueWhite3': ('205', '192', '176'), 'AntiqueWhite4': ('139', '131', '120'), 'bisque1': ('255', '228', '196'), 'bisque2': ('238', '213', '183'), 'bisque3': ('205', '183', '158'), 'bisque4': ('139', '125', '107'), 'PeachPuff1': ('255', '218', '185'), 'PeachPuff2': ('238', '203', '173'), 'PeachPuff3': ('205', '175', '149'), 'PeachPuff4': ('139', '119', '101'), 'NavajoWhite1': ('255', '222', '173'), 'NavajoWhite2': ('238', '207', '161'), 'NavajoWhite3': ('205', '179', '139'), 'NavajoWhite4': ('139', '121', '94'), 'LemonChiffon1': ('255', '250', '205'), 'LemonChiffon2': ('238', '233', '191'), 'LemonChiffon3': ('205', '201', '165'), 'LemonChiffon4': ('139', '137', '112'), 'cornsilk1': ('255', '248', '220'), 'cornsilk2': ('238', '232', '205'), 'cornsilk3': ('205', '200', '177'), 'cornsilk4': ('139', '136', '120'), 'ivory1': ('255', '255', '240'), 'ivory2': ('238', '238', '224'), 'ivory3': ('205', '205', '193'), 'ivory4': ('139', '139', '131'), 'honeydew1': ('240', '255', '240'), 'honeydew2': ('224', '238', '224'), 'honeydew3': ('193', '205', '193'), 'honeydew4': ('131', '139', '131'), 'LavenderBlush1': ('255', '240', '245'), 'LavenderBlush2': ('238', '224', '229'), 'LavenderBlush3': ('205', '193', '197'), 'LavenderBlush4': ('139', '131', '134'), 'MistyRose1': ('255', '228', '225'), 'MistyRose2': ('238', '213', '210'), 'MistyRose3': ('205', '183', '181'), 'MistyRose4': ('139', '125', '123'), 'azure1': ('240', '255', '255'), 'azure2': ('224', '238', '238'), 'azure3': ('193', '205', '205'), 'azure4': ('131', '139', '139'), 'SlateBlue1': ('131', '111', '255'), 'SlateBlue2': ('122', '103', '238'), 'SlateBlue3': ('105', '89', '205'), 'SlateBlue4': ('71', '60', '139'), 'RoyalBlue1': ('72', '118', '255'), 'RoyalBlue2': ('67', '110', '238'), 'RoyalBlue3': ('58', '95', '205'), 'RoyalBlue4': ('39', '64', '139'), 'blue1': ('0', '0', '255'), 'blue2': ('0', '0', '238'), 'blue3': ('0', '0', '205'), 'blue4': ('0', '0', '139'), 'DodgerBlue1': ('30', '144', '255'), 'DodgerBlue2': ('28', '134', '238'), 'DodgerBlue3': ('24', '116', '205'), 'DodgerBlue4': ('16', '78', '139'), 'SteelBlue1': ('99', '184', '255'), 'SteelBlue2': ('92', '172', '238'), 'SteelBlue3': ('79', '148', '205'), 'SteelBlue4': ('54', '100', '139'), 'DeepSkyBlue1': ('0', '191', '255'), 'DeepSkyBlue2': ('0', '178', '238'), 'DeepSkyBlue3': ('0', '154', '205'), 'DeepSkyBlue4': ('0', '104', '139'), 'SkyBlue1': ('135', '206', '255'), 'SkyBlue2': ('126', '192', '238'), 'SkyBlue3': ('108', '166', '205'), 'SkyBlue4': ('74', '112', '139'), 'LightSkyBlue1': ('176', '226', '255'), 'LightSkyBlue2': ('164', '211', '238'), 'LightSkyBlue3': ('141', '182', '205'), 'LightSkyBlue4': ('96', '123', '139'), 'SlateGray1': ('198', '226', '255'), 'SlateGray2': ('185', '211', '238'), 'SlateGray3': ('159', '182', '205'), 'SlateGray4': ('108', '123', '139'), 'LightSteelBlue1': ('202', '225', '255'), 'LightSteelBlue2': ('188', '210', '238'), 'LightSteelBlue3': ('162', '181', '205'), 'LightSteelBlue4': ('110', '123', '139'), 'LightBlue1': ('191', '239', '255'), 'LightBlue2': ('178', '223', '238'), 'LightBlue3': ('154', '192', '205'), 'LightBlue4': ('104', '131', '139'), 'LightCyan1': ('224', '255', '255'), 'LightCyan2': ('209', '238', '238'), 'LightCyan3': ('180', '205', '205'), 'LightCyan4': ('122', '139', '139'), 'PaleTurquoise1': ('187', '255', '255'), 'PaleTurquoise2': ('174', '238', '238'), 'PaleTurquoise3': ('150', '205', '205'), 'PaleTurquoise4': ('102', '139', '139'), 'CadetBlue1': ('152', '245', '255'), 'CadetBlue2': ('142', '229', '238'), 'CadetBlue3': ('122', '197', '205'), 'CadetBlue4': ('83', '134', '139'), 'turquoise1': ('0', '245', '255'), 'turquoise2': ('0', '229', '238'), 'turquoise3': ('0', '197', '205'), 'turquoise4': ('0', '134', '139'), 'cyan1': ('0', '255', '255'), 'cyan2': ('0', '238', '238'), 'cyan3': ('0', '205', '205'), 'cyan4': ('0', '139', '139'), 'DarkSlateGray1': ('151', '255', '255'), 'DarkSlateGray2': ('141', '238', '238'), 'DarkSlateGray3': ('121', '205', '205'), 'DarkSlateGray4': ('82', '139', '139'), 'aquamarine1': ('127', '255', '212'), 'aquamarine2': ('118', '238', '198'), 'aquamarine3': ('102', '205', '170'), 'aquamarine4': ('69', '139', '116'), 'DarkSeaGreen1': ('193', '255', '193'), 'DarkSeaGreen2': ('180', '238', '180'), 'DarkSeaGreen3': ('155', '205', '155'), 'DarkSeaGreen4': ('105', '139', '105'), 'SeaGreen1': ('84', '255', '159'), 'SeaGreen2': ('78', '238', '148'), 'SeaGreen3': ('67', '205', '128'), 'SeaGreen4': ('46', '139', '87'), 'PaleGreen1': ('154', '255', '154'), 'PaleGreen2': ('144', '238', '144'), 'PaleGreen3': ('124', '205', '124'), 'PaleGreen4': ('84', '139', '84'), 'SpringGreen1': ('0', '255', '127'), 'SpringGreen2': ('0', '238', '118'), 'SpringGreen3': ('0', '205', '102'), 'SpringGreen4': ('0', '139', '69'), 'green1': ('0', '255', '0'), 'green2': ('0', '238', '0'), 'green3': ('0', '205', '0'), 'green4': ('0', '139', '0'), 'chartreuse1': ('127', '255', '0'), 'chartreuse2': ('118', '238', '0'), 'chartreuse3': ('102', '205', '0'), 'chartreuse4': ('69', '139', '0'), 'OliveDrab1': ('192', '255', '62'), 'OliveDrab2': ('179', '238', '58'), 'OliveDrab3': ('154', '205', '50'), 'OliveDrab4': ('105', '139', '34'), 'DarkOliveGreen1': ('202', '255', '112'), 'DarkOliveGreen2': ('188', '238', '104'), 'DarkOliveGreen3': ('162', '205', '90'), 'DarkOliveGreen4': ('110', '139', '61'), 'khaki1': ('255', '246', '143'), 'khaki2': ('238', '230', '133'), 'khaki3': ('205', '198', '115'), 'khaki4': ('139', '134', '78'), 'LightGoldenrod1': ('255', '236', '139'), 'LightGoldenrod2': ('238', '220', '130'), 'LightGoldenrod3': ('205', '190', '112'), 'LightGoldenrod4': ('139', '129', '76'), 'LightYellow1': ('255', '255', '224'), 'LightYellow2': ('238', '238', '209'), 'LightYellow3': ('205', '205', '180'), 'LightYellow4': ('139', '139', '122'), 'yellow1': ('255', '255', '0'), 'yellow2': ('238', '238', '0'), 'yellow3': ('205', '205', '0'), 'yellow4': ('139', '139', '0'), 'gold1': ('255', '215', '0'), 'gold2': ('238', '201', '0'), 'gold3': ('205', '173', '0'), 'gold4': ('139', '117', '0'), 'goldenrod1': ('255', '193', '37'), 'goldenrod2': ('238', '180', '34'), 'goldenrod3': ('205', '155', '29'), 'goldenrod4': ('139', '105', '20'), 'DarkGoldenrod1': ('255', '185', '15'), 'DarkGoldenrod2': ('238', '173', '14'), 'DarkGoldenrod3': ('205', '149', '12'), 'DarkGoldenrod4': ('139', '101', '8'), 'RosyBrown1': ('255', '193', '193'), 'RosyBrown2': ('238', '180', '180'), 'RosyBrown3': ('205', '155', '155'), 'RosyBrown4': ('139', '105', '105'), 'IndianRed1': ('255', '106', '106'), 'IndianRed2': ('238', '99', '99'), 'IndianRed3': ('205', '85', '85'), 'IndianRed4': ('139', '58', '58'), 'sienna1': ('255', '130', '71'), 'sienna2': ('238', '121', '66'), 'sienna3': ('205', '104', '57'), 'sienna4': ('139', '71', '38'), 'burlywood1': ('255', '211', '155'), 'burlywood2': ('238', '197', '145'), 'burlywood3': ('205', '170', '125'), 'burlywood4': ('139', '115', '85'), 'wheat1': ('255', '231', '186'), 'wheat2': ('238', '216', '174'), 'wheat3': ('205', '186', '150'), 'wheat4': ('139', '126', '102'), 'tan1': ('255', '165', '79'), 'tan2': ('238', '154', '73'), 'tan3': ('205', '133', '63'), 'tan4': ('139', '90', '43'), 'chocolate1': ('255', '127', '36'), 'chocolate2': ('238', '118', '33'), 'chocolate3': ('205', '102', '29'), 'chocolate4': ('139', '69', '19'), 'firebrick1': ('255', '48', '48'), 'firebrick2': ('238', '44', '44'), 'firebrick3': ('205', '38', '38'), 'firebrick4': ('139', '26', '26'), 'brown1': ('255', '64', '64'), 'brown2': ('238', '59', '59'), 'brown3': ('205', '51', '51'), 'brown4': ('139', '35', '35'), 'salmon1': ('255', '140', '105'), 'salmon2': ('238', '130', '98'), 'salmon3': ('205', '112', '84'), 'salmon4': ('139', '76', '57'), 'LightSalmon1': ('255', '160', '122'), 'LightSalmon2': ('238', '149', '114'), 'LightSalmon3': ('205', '129', '98'), 'LightSalmon4': ('139', '87', '66'), 'orange1': ('255', '165', '0'), 'orange2': ('238', '154', '0'), 'orange3': ('205', '133', '0'), 'orange4': ('139', '90', '0'), 'DarkOrange1': ('255', '127', '0'), 'DarkOrange2': ('238', '118', '0'), 'DarkOrange3': ('205', '102', '0'), 'DarkOrange4': ('139', '69', '0'), 'coral1': ('255', '114', '86'), 'coral2': ('238', '106', '80'), 'coral3': ('205', '91', '69'), 'coral4': ('139', '62', '47'), 'tomato1': ('255', '99', '71'), 'tomato2': ('238', '92', '66'), 'tomato3': ('205', '79', '57'), 'tomato4': ('139', '54', '38'), 'OrangeRed1': ('255', '69', '0'), 'OrangeRed2': ('238', '64', '0'), 'OrangeRed3': ('205', '55', '0'), 'OrangeRed4': ('139', '37', '0'), 'red1': ('255', '0', '0'), 'red2': ('238', '0', '0'), 'red3': ('205', '0', '0'), 'red4': ('139', '0', '0'), 'DeepPink1': ('255', '20', '147'), 'DeepPink2': ('238', '18', '137'), 'DeepPink3': ('205', '16', '118'), 'DeepPink4': ('139', '10', '80'), 'HotPink1': ('255', '110', '180'), 'HotPink2': ('238', '106', '167'), 'HotPink3': ('205', '96', '144'), 'HotPink4': ('139', '58', '98'), 'pink1': ('255', '181', '197'), 'pink2': ('238', '169', '184'), 'pink3': ('205', '145', '158'), 'pink4': ('139', '99', '108'), 'LightPink1': ('255', '174', '185'), 'LightPink2': ('238', '162', '173'), 'LightPink3': ('205', '140', '149'), 'LightPink4': ('139', '95', '101'), 'PaleVioletRed1': ('255', '130', '171'), 'PaleVioletRed2': ('238', '121', '159'), 'PaleVioletRed3': ('205', '104', '137'), 'PaleVioletRed4': ('139', '71', '93'), 'maroon1': ('255', '52', '179'), 'maroon2': ('238', '48', '167'), 'maroon3': ('205', '41', '144'), 'maroon4': ('139', '28', '98'), 'VioletRed1': ('255', '62', '150'), 'VioletRed2': ('238', '58', '140'), 'VioletRed3': ('205', '50', '120'), 'VioletRed4': ('139', '34', '82'), 'magenta1': ('255', '0', '255'), 'magenta2': ('238', '0', '238'), 'magenta3': ('205', '0', '205'), 'magenta4': ('139', '0', '139'), 'orchid1': ('255', '131', '250'), 'orchid2': ('238', '122', '233'), 'orchid3': ('205', '105', '201'), 'orchid4': ('139', '71', '137'), 'plum1': ('255', '187', '255'), 'plum2': ('238', '174', '238'), 'plum3': ('205', '150', '205'), 'plum4': ('139', '102', '139'), 'MediumOrchid1': ('224', '102', '255'), 'MediumOrchid2': ('209', '95', '238'), 'MediumOrchid3': ('180', '82', '205'), 'MediumOrchid4': ('122', '55', '139'), 'DarkOrchid1': ('191', '62', '255'), 'DarkOrchid2': ('178', '58', '238'), 'DarkOrchid3': ('154', '50', '205'), 'DarkOrchid4': ('104', '34', '139'), 'purple1': ('155', '48', '255'), 'purple2': ('145', '44', '238'), 'purple3': ('125', '38', '205'), 'purple4': ('85', '26', '139'), 'MediumPurple1': ('171', '130', '255'), 'MediumPurple2': ('159', '121', '238'), 'MediumPurple3': ('137', '104', '205'), 'MediumPurple4': ('93', '71', '139'), 'thistle1': ('255', '225', '255'), 'thistle2': ('238', '210', '238'), 'thistle3': ('205', '181', '205'), 'thistle4': ('139', '123', '139'), 'gray0': ('0', '0', '0'), 'grey0': ('0', '0', '0'), 'gray1': ('3', '3', '3'), 'grey1': ('3', '3', '3'), 'gray2': ('5', '5', '5'), 'grey2': ('5', '5', '5'), 'gray3': ('8', '8', '8'), 'grey3': ('8', '8', '8'), 'gray4': ('10', '10', '10'), 'grey4': ('10', '10', '10'), 'gray5': ('13', '13', '13'), 'grey5': ('13', '13', '13'), 'gray6': ('15', '15', '15'), 'grey6': ('15', '15', '15'), 'gray7': ('18', '18', '18'), 'grey7': ('18', '18', '18'), 'gray8': ('20', '20', '20'), 'grey8': ('20', '20', '20'), 'gray9': ('23', '23', '23'), 'grey9': ('23', '23', '23'), 'gray10': ('26', '26', '26'), 'grey10': ('26', '26', '26'), 'gray11': ('28', '28', '28'), 'grey11': ('28', '28', '28'), 'gray12': ('31', '31', '31'), 'grey12': ('31', '31', '31'), 'gray13': ('33', '33', '33'), 'grey13': ('33', '33', '33'), 'gray14': ('36', '36', '36'), 'grey14': ('36', '36', '36'), 'gray15': ('38', '38', '38'), 'grey15': ('38', '38', '38'), 'gray16': ('41', '41', '41'), 'grey16': ('41', '41', '41'), 'gray17': ('43', '43', '43'), 'grey17': ('43', '43', '43'), 'gray18': ('46', '46', '46'), 'grey18': ('46', '46', '46'), 'gray19': ('48', '48', '48'), 'grey19': ('48', '48', '48'), 'gray20': ('51', '51', '51'), 'grey20': ('51', '51', '51'), 'gray21': ('54', '54', '54'), 'grey21': ('54', '54', '54'), 'gray22': ('56', '56', '56'), 'grey22': ('56', '56', '56'), 'gray23': ('59', '59', '59'), 'grey23': ('59', '59', '59'), 'gray24': ('61', '61', '61'), 'grey24': ('61', '61', '61'), 'gray25': ('64', '64', '64'), 'grey25': ('64', '64', '64'), 'gray26': ('66', '66', '66'), 'grey26': ('66', '66', '66'), 'gray27': ('69', '69', '69'), 'grey27': ('69', '69', '69'), 'gray28': ('71', '71', '71'), 'grey28': ('71', '71', '71'), 'gray29': ('74', '74', '74'), 'grey29': ('74', '74', '74'), 'gray30': ('77', '77', '77'), 'grey30': ('77', '77', '77'), 'gray31': ('79', '79', '79'), 'grey31': ('79', '79', '79'), 'gray32': ('82', '82', '82'), 'grey32': ('82', '82', '82'), 'gray33': ('84', '84', '84'), 'grey33': ('84', '84', '84'), 'gray34': ('87', '87', '87'), 'grey34': ('87', '87', '87'), 'gray35': ('89', '89', '89'), 'grey35': ('89', '89', '89'), 'gray36': ('92', '92', '92'), 'grey36': ('92', '92', '92'), 'gray37': ('94', '94', '94'), 'grey37': ('94', '94', '94'), 'gray38': ('97', '97', '97'), 'grey38': ('97', '97', '97'), 'gray39': ('99', '99', '99'), 'grey39': ('99', '99', '99'), 'gray40': ('102', '102', '102'), 'grey40': ('102', '102', '102'), 'gray41': ('105', '105', '105'), 'grey41': ('105', '105', '105'), 'gray42': ('107', '107', '107'), 'grey42': ('107', '107', '107'), 'gray43': ('110', '110', '110'), 'grey43': ('110', '110', '110'), 'gray44': ('112', '112', '112'), 'grey44': ('112', '112', '112'), 'gray45': ('115', '115', '115'), 'grey45': ('115', '115', '115'), 'gray46': ('117', '117', '117'), 'grey46': ('117', '117', '117'), 'gray47': ('120', '120', '120'), 'grey47': ('120', '120', '120'), 'gray48': ('122', '122', '122'), 'grey48': ('122', '122', '122'), 'gray49': ('125', '125', '125'), 'grey49': ('125', '125', '125'), 'gray50': ('127', '127', '127'), 'grey50': ('127', '127', '127'), 'gray51': ('130', '130', '130'), 'grey51': ('130', '130', '130'), 'gray52': ('133', '133', '133'), 'grey52': ('133', '133', '133'), 'gray53': ('135', '135', '135'), 'grey53': ('135', '135', '135'), 'gray54': ('138', '138', '138'), 'grey54': ('138', '138', '138'), 'gray55': ('140', '140', '140'), 'grey55': ('140', '140', '140'), 'gray56': ('143', '143', '143'), 'grey56': ('143', '143', '143'), 'gray57': ('145', '145', '145'), 'grey57': ('145', '145', '145'), 'gray58': ('148', '148', '148'), 'grey58': ('148', '148', '148'), 'gray59': ('150', '150', '150'), 'grey59': ('150', '150', '150'), 'gray60': ('153', '153', '153'), 'grey60': ('153', '153', '153'), 'gray61': ('156', '156', '156'), 'grey61': ('156', '156', '156'), 'gray62': ('158', '158', '158'), 'grey62': ('158', '158', '158'), 'gray63': ('161', '161', '161'), 'grey63': ('161', '161', '161'), 'gray64': ('163', '163', '163'), 'grey64': ('163', '163', '163'), 'gray65': ('166', '166', '166'), 'grey65': ('166', '166', '166'), 'gray66': ('168', '168', '168'), 'grey66': ('168', '168', '168'), 'gray67': ('171', '171', '171'), 'grey67': ('171', '171', '171'), 'gray68': ('173', '173', '173'), 'grey68': ('173', '173', '173'), 'gray69': ('176', '176', '176'), 'grey69': ('176', '176', '176'), 'gray70': ('179', '179', '179'), 'grey70': ('179', '179', '179'), 'gray71': ('181', '181', '181'), 'grey71': ('181', '181', '181'), 'gray72': ('184', '184', '184'), 'grey72': ('184', '184', '184'), 'gray73': ('186', '186', '186'), 'grey73': ('186', '186', '186'), 'gray74': ('189', '189', '189'), 'grey74': ('189', '189', '189'), 'gray75': ('191', '191', '191'), 'grey75': ('191', '191', '191'), 'gray76': ('194', '194', '194'), 'grey76': ('194', '194', '194'), 'gray77': ('196', '196', '196'), 'grey77': ('196', '196', '196'), 'gray78': ('199', '199', '199'), 'grey78': ('199', '199', '199'), 'gray79': ('201', '201', '201'), 'grey79': ('201', '201', '201'), 'gray80': ('204', '204', '204'), 'grey80': ('204', '204', '204'), 'gray81': ('207', '207', '207'), 'grey81': ('207', '207', '207'), 'gray82': ('209', '209', '209'), 'grey82': ('209', '209', '209'), 'gray83': ('212', '212', '212'), 'grey83': ('212', '212', '212'), 'gray84': ('214', '214', '214'), 'grey84': ('214', '214', '214'), 'gray85': ('217', '217', '217'), 'grey85': ('217', '217', '217'), 'gray86': ('219', '219', '219'), 'grey86': ('219', '219', '219'), 'gray87': ('222', '222', '222'), 'grey87': ('222', '222', '222'), 'gray88': ('224', '224', '224'), 'grey88': ('224', '224', '224'), 'gray89': ('227', '227', '227'), 'grey89': ('227', '227', '227'), 'gray90': ('229', '229', '229'), 'grey90': ('229', '229', '229'), 'gray91': ('232', '232', '232'), 'grey91': ('232', '232', '232'), 'gray92': ('235', '235', '235'), 'grey92': ('235', '235', '235'), 'gray93': ('237', '237', '237'), 'grey93': ('237', '237', '237'), 'gray94': ('240', '240', '240'), 'grey94': ('240', '240', '240'), 'gray95': ('242', '242', '242'), 'grey95': ('242', '242', '242'), 'gray96': ('245', '245', '245'), 'grey96': ('245', '245', '245'), 'gray97': ('247', '247', '247'), 'grey97': ('247', '247', '247'), 'gray98': ('250', '250', '250'), 'grey98': ('250', '250', '250'), 'gray99': ('252', '252', '252'), 'grey99': ('252', '252', '252'), 'gray100': ('255', '255', '255'), 'grey100': ('255', '255', '255'), 'darkgrey': ('169', '169', '169'), 'DarkGrey': ('169', '169', '169'), 'darkgray': ('169', '169', '169'), 'DarkGray': ('169', '169', '169'), 'darkblue': ('0', '0', '139'), 'DarkBlue': ('0', '0', '139'), 'darkcyan': ('0', '139', '139'), 'DarkCyan': ('0', '139', '139'), 'darkmagenta': ('139', '0', '139'), 'DarkMagenta': ('139', '0', '139'), 'darkred': ('139', '0', '0'), 'DarkRed': ('139', '0', '0'), 'lightgreen': ('144', '238', '144'), 'LightGreen': ('144', '238', '144')}
colors = {'snow': ('255', '250', '250'), 'ghostwhite': ('248', '248', '255'), 'GhostWhite': ('248', '248', '255'), 'whitesmoke': ('245', '245', '245'), 'WhiteSmoke': ('245', '245', '245'), 'gainsboro': ('220', '220', '220'), 'floralwhite': ('255', '250', '240'), 'FloralWhite': ('255', '250', '240'), 'oldlace': ('253', '245', '230'), 'OldLace': ('253', '245', '230'), 'linen': ('250', '240', '230'), 'antiquewhite': ('250', '235', '215'), 'AntiqueWhite': ('250', '235', '215'), 'papayawhip': ('255', '239', '213'), 'PapayaWhip': ('255', '239', '213'), 'blanchedalmond': ('255', '235', '205'), 'BlanchedAlmond': ('255', '235', '205'), 'bisque': ('255', '228', '196'), 'peachpuff': ('255', '218', '185'), 'PeachPuff': ('255', '218', '185'), 'navajowhite': ('255', '222', '173'), 'NavajoWhite': ('255', '222', '173'), 'moccasin': ('255', '228', '181'), 'cornsilk': ('255', '248', '220'), 'ivory': ('255', '255', '240'), 'lemonchiffon': ('255', '250', '205'), 'LemonChiffon': ('255', '250', '205'), 'seashell': ('255', '245', '238'), 'honeydew': ('240', '255', '240'), 'mintcream': ('245', '255', '250'), 'MintCream': ('245', '255', '250'), 'azure': ('240', '255', '255'), 'aliceblue': ('240', '248', '255'), 'AliceBlue': ('240', '248', '255'), 'lavender': ('230', '230', '250'), 'lavenderblush': ('255', '240', '245'), 'LavenderBlush': ('255', '240', '245'), 'mistyrose': ('255', '228', '225'), 'MistyRose': ('255', '228', '225'), 'white': ('255', '255', '255'), 'black': ('0', '0', '0'), 'darkslategray': ('47', '79', '79'), 'DarkSlateGray': ('47', '79', '79'), 'darkslategrey': ('47', '79', '79'), 'DarkSlateGrey': ('47', '79', '79'), 'dimgray': ('105', '105', '105'), 'DimGray': ('105', '105', '105'), 'dimgrey': ('105', '105', '105'), 'DimGrey': ('105', '105', '105'), 'slategray': ('112', '128', '144'), 'SlateGray': ('112', '128', '144'), 'slategrey': ('112', '128', '144'), 'SlateGrey': ('112', '128', '144'), 'lightslategray': ('119', '136', '153'), 'LightSlateGray': ('119', '136', '153'), 'lightslategrey': ('119', '136', '153'), 'LightSlateGrey': ('119', '136', '153'), 'gray': ('190', '190', '190'), 'grey': ('190', '190', '190'), 'lightgrey': ('211', '211', '211'), 'LightGrey': ('211', '211', '211'), 'lightgray': ('211', '211', '211'), 'LightGray': ('211', '211', '211'), 'midnightblue': ('25', '25', '112'), 'MidnightBlue': ('25', '25', '112'), 'navy': ('0', '0', '128'), 'navyblue': ('0', '0', '128'), 'NavyBlue': ('0', '0', '128'), 'cornflowerblue': ('100', '149', '237'), 'CornflowerBlue': ('100', '149', '237'), 'darkslateblue': ('72', '61', '139'), 'DarkSlateBlue': ('72', '61', '139'), 'slateblue': ('106', '90', '205'), 'SlateBlue': ('106', '90', '205'), 'mediumslateblue': ('123', '104', '238'), 'MediumSlateBlue': ('123', '104', '238'), 'lightslateblue': ('132', '112', '255'), 'LightSlateBlue': ('132', '112', '255'), 'mediumblue': ('0', '0', '205'), 'MediumBlue': ('0', '0', '205'), 'royalblue': ('65', '105', '225'), 'RoyalBlue': ('65', '105', '225'), 'blue': ('0', '0', '255'), 'dodgerblue': ('30', '144', '255'), 'DodgerBlue': ('30', '144', '255'), 'deepskyblue': ('0', '191', '255'), 'DeepSkyBlue': ('0', '191', '255'), 'skyblue': ('135', '206', '235'), 'SkyBlue': ('135', '206', '235'), 'lightskyblue': ('135', '206', '250'), 'LightSkyBlue': ('135', '206', '250'), 'steelblue': ('70', '130', '180'), 'SteelBlue': ('70', '130', '180'), 'lightsteelblue': ('176', '196', '222'), 'LightSteelBlue': ('176', '196', '222'), 'lightblue': ('173', '216', '230'), 'LightBlue': ('173', '216', '230'), 'powderblue': ('176', '224', '230'), 'PowderBlue': ('176', '224', '230'), 'paleturquoise': ('175', '238', '238'), 'PaleTurquoise': ('175', '238', '238'), 'darkturquoise': ('0', '206', '209'), 'DarkTurquoise': ('0', '206', '209'), 'mediumturquoise': ('72', '209', '204'), 'MediumTurquoise': ('72', '209', '204'), 'turquoise': ('64', '224', '208'), 'cyan': ('0', '255', '255'), 'lightcyan': ('224', '255', '255'), 'LightCyan': ('224', '255', '255'), 'cadetblue': ('95', '158', '160'), 'CadetBlue': ('95', '158', '160'), 'mediumaquamarine': ('102', '205', '170'), 'MediumAquamarine': ('102', '205', '170'), 'aquamarine': ('127', '255', '212'), 'darkgreen': ('0', '100', '0'), 'DarkGreen': ('0', '100', '0'), 'darkolivegreen': ('85', '107', '47'), 'DarkOliveGreen': ('85', '107', '47'), 'darkseagreen': ('143', '188', '143'), 'DarkSeaGreen': ('143', '188', '143'), 'seagreen': ('46', '139', '87'), 'SeaGreen': ('46', '139', '87'), 'mediumseagreen': ('60', '179', '113'), 'MediumSeaGreen': ('60', '179', '113'), 'lightseagreen': ('32', '178', '170'), 'LightSeaGreen': ('32', '178', '170'), 'palegreen': ('152', '251', '152'), 'PaleGreen': ('152', '251', '152'), 'springgreen': ('0', '255', '127'), 'SpringGreen': ('0', '255', '127'), 'lawngreen': ('124', '252', '0'), 'LawnGreen': ('124', '252', '0'), 'green': ('0', '255', '0'), 'chartreuse': ('127', '255', '0'), 'mediumspringgreen': ('0', '250', '154'), 'MediumSpringGreen': ('0', '250', '154'), 'greenyellow': ('173', '255', '47'), 'GreenYellow': ('173', '255', '47'), 'limegreen': ('50', '205', '50'), 'LimeGreen': ('50', '205', '50'), 'yellowgreen': ('154', '205', '50'), 'YellowGreen': ('154', '205', '50'), 'forestgreen': ('34', '139', '34'), 'ForestGreen': ('34', '139', '34'), 'olivedrab': ('107', '142', '35'), 'OliveDrab': ('107', '142', '35'), 'darkkhaki': ('189', '183', '107'), 'DarkKhaki': ('189', '183', '107'), 'khaki': ('240', '230', '140'), 'palegoldenrod': ('238', '232', '170'), 'PaleGoldenrod': ('238', '232', '170'), 'lightgoldenrodyellow': ('250', '250', '210'), 'LightGoldenrodYellow': ('250', '250', '210'), 'lightyellow': ('255', '255', '224'), 'LightYellow': ('255', '255', '224'), 'yellow': ('255', '255', '0'), 'gold': ('255', '215', '0'), 'lightgoldenrod': ('238', '221', '130'), 'LightGoldenrod': ('238', '221', '130'), 'goldenrod': ('218', '165', '32'), 'darkgoldenrod': ('184', '134', '11'), 'DarkGoldenrod': ('184', '134', '11'), 'rosybrown': ('188', '143', '143'), 'RosyBrown': ('188', '143', '143'), 'indianred': ('205', '92', '92'), 'IndianRed': ('205', '92', '92'), 'saddlebrown': ('139', '69', '19'), 'SaddleBrown': ('139', '69', '19'), 'sienna': ('160', '82', '45'), 'peru': ('205', '133', '63'), 'burlywood': ('222', '184', '135'), 'beige': ('245', '245', '220'), 'wheat': ('245', '222', '179'), 'sandybrown': ('244', '164', '96'), 'SandyBrown': ('244', '164', '96'), 'tan': ('210', '180', '140'), 'chocolate': ('210', '105', '30'), 'firebrick': ('178', '34', '34'), 'brown': ('165', '42', '42'), 'darksalmon': ('233', '150', '122'), 'DarkSalmon': ('233', '150', '122'), 'salmon': ('250', '128', '114'), 'lightsalmon': ('255', '160', '122'), 'LightSalmon': ('255', '160', '122'), 'orange': ('255', '165', '0'), 'darkorange': ('255', '140', '0'), 'DarkOrange': ('255', '140', '0'), 'coral': ('255', '127', '80'), 'lightcoral': ('240', '128', '128'), 'LightCoral': ('240', '128', '128'), 'tomato': ('255', '99', '71'), 'orangered': ('255', '69', '0'), 'OrangeRed': ('255', '69', '0'), 'red': ('255', '0', '0'), 'hotpink': ('255', '105', '180'), 'HotPink': ('255', '105', '180'), 'deeppink': ('255', '20', '147'), 'DeepPink': ('255', '20', '147'), 'pink': ('255', '192', '203'), 'lightpink': ('255', '182', '193'), 'LightPink': ('255', '182', '193'), 'palevioletred': ('219', '112', '147'), 'PaleVioletRed': ('219', '112', '147'), 'maroon': ('176', '48', '96'), 'mediumvioletred': ('199', '21', '133'), 'MediumVioletRed': ('199', '21', '133'), 'violetred': ('208', '32', '144'), 'VioletRed': ('208', '32', '144'), 'magenta': ('255', '0', '255'), 'violet': ('238', '130', '238'), 'plum': ('221', '160', '221'), 'orchid': ('218', '112', '214'), 'mediumorchid': ('186', '85', '211'), 'MediumOrchid': ('186', '85', '211'), 'darkorchid': ('153', '50', '204'), 'DarkOrchid': ('153', '50', '204'), 'darkviolet': ('148', '0', '211'), 'DarkViolet': ('148', '0', '211'), 'blueviolet': ('138', '43', '226'), 'BlueViolet': ('138', '43', '226'), 'purple': ('160', '32', '240'), 'mediumpurple': ('147', '112', '219'), 'MediumPurple': ('147', '112', '219'), 'thistle': ('216', '191', '216'), 'snow1': ('255', '250', '250'), 'snow2': ('238', '233', '233'), 'snow3': ('205', '201', '201'), 'snow4': ('139', '137', '137'), 'seashell1': ('255', '245', '238'), 'seashell2': ('238', '229', '222'), 'seashell3': ('205', '197', '191'), 'seashell4': ('139', '134', '130'), 'AntiqueWhite1': ('255', '239', '219'), 'AntiqueWhite2': ('238', '223', '204'), 'AntiqueWhite3': ('205', '192', '176'), 'AntiqueWhite4': ('139', '131', '120'), 'bisque1': ('255', '228', '196'), 'bisque2': ('238', '213', '183'), 'bisque3': ('205', '183', '158'), 'bisque4': ('139', '125', '107'), 'PeachPuff1': ('255', '218', '185'), 'PeachPuff2': ('238', '203', '173'), 'PeachPuff3': ('205', '175', '149'), 'PeachPuff4': ('139', '119', '101'), 'NavajoWhite1': ('255', '222', '173'), 'NavajoWhite2': ('238', '207', '161'), 'NavajoWhite3': ('205', '179', '139'), 'NavajoWhite4': ('139', '121', '94'), 'LemonChiffon1': ('255', '250', '205'), 'LemonChiffon2': ('238', '233', '191'), 'LemonChiffon3': ('205', '201', '165'), 'LemonChiffon4': ('139', '137', '112'), 'cornsilk1': ('255', '248', '220'), 'cornsilk2': ('238', '232', '205'), 'cornsilk3': ('205', '200', '177'), 'cornsilk4': ('139', '136', '120'), 'ivory1': ('255', '255', '240'), 'ivory2': ('238', '238', '224'), 'ivory3': ('205', '205', '193'), 'ivory4': ('139', '139', '131'), 'honeydew1': ('240', '255', '240'), 'honeydew2': ('224', '238', '224'), 'honeydew3': ('193', '205', '193'), 'honeydew4': ('131', '139', '131'), 'LavenderBlush1': ('255', '240', '245'), 'LavenderBlush2': ('238', '224', '229'), 'LavenderBlush3': ('205', '193', '197'), 'LavenderBlush4': ('139', '131', '134'), 'MistyRose1': ('255', '228', '225'), 'MistyRose2': ('238', '213', '210'), 'MistyRose3': ('205', '183', '181'), 'MistyRose4': ('139', '125', '123'), 'azure1': ('240', '255', '255'), 'azure2': ('224', '238', '238'), 'azure3': ('193', '205', '205'), 'azure4': ('131', '139', '139'), 'SlateBlue1': ('131', '111', '255'), 'SlateBlue2': ('122', '103', '238'), 'SlateBlue3': ('105', '89', '205'), 'SlateBlue4': ('71', '60', '139'), 'RoyalBlue1': ('72', '118', '255'), 'RoyalBlue2': ('67', '110', '238'), 'RoyalBlue3': ('58', '95', '205'), 'RoyalBlue4': ('39', '64', '139'), 'blue1': ('0', '0', '255'), 'blue2': ('0', '0', '238'), 'blue3': ('0', '0', '205'), 'blue4': ('0', '0', '139'), 'DodgerBlue1': ('30', '144', '255'), 'DodgerBlue2': ('28', '134', '238'), 'DodgerBlue3': ('24', '116', '205'), 'DodgerBlue4': ('16', '78', '139'), 'SteelBlue1': ('99', '184', '255'), 'SteelBlue2': ('92', '172', '238'), 'SteelBlue3': ('79', '148', '205'), 'SteelBlue4': ('54', '100', '139'), 'DeepSkyBlue1': ('0', '191', '255'), 'DeepSkyBlue2': ('0', '178', '238'), 'DeepSkyBlue3': ('0', '154', '205'), 'DeepSkyBlue4': ('0', '104', '139'), 'SkyBlue1': ('135', '206', '255'), 'SkyBlue2': ('126', '192', '238'), 'SkyBlue3': ('108', '166', '205'), 'SkyBlue4': ('74', '112', '139'), 'LightSkyBlue1': ('176', '226', '255'), 'LightSkyBlue2': ('164', '211', '238'), 'LightSkyBlue3': ('141', '182', '205'), 'LightSkyBlue4': ('96', '123', '139'), 'SlateGray1': ('198', '226', '255'), 'SlateGray2': ('185', '211', '238'), 'SlateGray3': ('159', '182', '205'), 'SlateGray4': ('108', '123', '139'), 'LightSteelBlue1': ('202', '225', '255'), 'LightSteelBlue2': ('188', '210', '238'), 'LightSteelBlue3': ('162', '181', '205'), 'LightSteelBlue4': ('110', '123', '139'), 'LightBlue1': ('191', '239', '255'), 'LightBlue2': ('178', '223', '238'), 'LightBlue3': ('154', '192', '205'), 'LightBlue4': ('104', '131', '139'), 'LightCyan1': ('224', '255', '255'), 'LightCyan2': ('209', '238', '238'), 'LightCyan3': ('180', '205', '205'), 'LightCyan4': ('122', '139', '139'), 'PaleTurquoise1': ('187', '255', '255'), 'PaleTurquoise2': ('174', '238', '238'), 'PaleTurquoise3': ('150', '205', '205'), 'PaleTurquoise4': ('102', '139', '139'), 'CadetBlue1': ('152', '245', '255'), 'CadetBlue2': ('142', '229', '238'), 'CadetBlue3': ('122', '197', '205'), 'CadetBlue4': ('83', '134', '139'), 'turquoise1': ('0', '245', '255'), 'turquoise2': ('0', '229', '238'), 'turquoise3': ('0', '197', '205'), 'turquoise4': ('0', '134', '139'), 'cyan1': ('0', '255', '255'), 'cyan2': ('0', '238', '238'), 'cyan3': ('0', '205', '205'), 'cyan4': ('0', '139', '139'), 'DarkSlateGray1': ('151', '255', '255'), 'DarkSlateGray2': ('141', '238', '238'), 'DarkSlateGray3': ('121', '205', '205'), 'DarkSlateGray4': ('82', '139', '139'), 'aquamarine1': ('127', '255', '212'), 'aquamarine2': ('118', '238', '198'), 'aquamarine3': ('102', '205', '170'), 'aquamarine4': ('69', '139', '116'), 'DarkSeaGreen1': ('193', '255', '193'), 'DarkSeaGreen2': ('180', '238', '180'), 'DarkSeaGreen3': ('155', '205', '155'), 'DarkSeaGreen4': ('105', '139', '105'), 'SeaGreen1': ('84', '255', '159'), 'SeaGreen2': ('78', '238', '148'), 'SeaGreen3': ('67', '205', '128'), 'SeaGreen4': ('46', '139', '87'), 'PaleGreen1': ('154', '255', '154'), 'PaleGreen2': ('144', '238', '144'), 'PaleGreen3': ('124', '205', '124'), 'PaleGreen4': ('84', '139', '84'), 'SpringGreen1': ('0', '255', '127'), 'SpringGreen2': ('0', '238', '118'), 'SpringGreen3': ('0', '205', '102'), 'SpringGreen4': ('0', '139', '69'), 'green1': ('0', '255', '0'), 'green2': ('0', '238', '0'), 'green3': ('0', '205', '0'), 'green4': ('0', '139', '0'), 'chartreuse1': ('127', '255', '0'), 'chartreuse2': ('118', '238', '0'), 'chartreuse3': ('102', '205', '0'), 'chartreuse4': ('69', '139', '0'), 'OliveDrab1': ('192', '255', '62'), 'OliveDrab2': ('179', '238', '58'), 'OliveDrab3': ('154', '205', '50'), 'OliveDrab4': ('105', '139', '34'), 'DarkOliveGreen1': ('202', '255', '112'), 'DarkOliveGreen2': ('188', '238', '104'), 'DarkOliveGreen3': ('162', '205', '90'), 'DarkOliveGreen4': ('110', '139', '61'), 'khaki1': ('255', '246', '143'), 'khaki2': ('238', '230', '133'), 'khaki3': ('205', '198', '115'), 'khaki4': ('139', '134', '78'), 'LightGoldenrod1': ('255', '236', '139'), 'LightGoldenrod2': ('238', '220', '130'), 'LightGoldenrod3': ('205', '190', '112'), 'LightGoldenrod4': ('139', '129', '76'), 'LightYellow1': ('255', '255', '224'), 'LightYellow2': ('238', '238', '209'), 'LightYellow3': ('205', '205', '180'), 'LightYellow4': ('139', '139', '122'), 'yellow1': ('255', '255', '0'), 'yellow2': ('238', '238', '0'), 'yellow3': ('205', '205', '0'), 'yellow4': ('139', '139', '0'), 'gold1': ('255', '215', '0'), 'gold2': ('238', '201', '0'), 'gold3': ('205', '173', '0'), 'gold4': ('139', '117', '0'), 'goldenrod1': ('255', '193', '37'), 'goldenrod2': ('238', '180', '34'), 'goldenrod3': ('205', '155', '29'), 'goldenrod4': ('139', '105', '20'), 'DarkGoldenrod1': ('255', '185', '15'), 'DarkGoldenrod2': ('238', '173', '14'), 'DarkGoldenrod3': ('205', '149', '12'), 'DarkGoldenrod4': ('139', '101', '8'), 'RosyBrown1': ('255', '193', '193'), 'RosyBrown2': ('238', '180', '180'), 'RosyBrown3': ('205', '155', '155'), 'RosyBrown4': ('139', '105', '105'), 'IndianRed1': ('255', '106', '106'), 'IndianRed2': ('238', '99', '99'), 'IndianRed3': ('205', '85', '85'), 'IndianRed4': ('139', '58', '58'), 'sienna1': ('255', '130', '71'), 'sienna2': ('238', '121', '66'), 'sienna3': ('205', '104', '57'), 'sienna4': ('139', '71', '38'), 'burlywood1': ('255', '211', '155'), 'burlywood2': ('238', '197', '145'), 'burlywood3': ('205', '170', '125'), 'burlywood4': ('139', '115', '85'), 'wheat1': ('255', '231', '186'), 'wheat2': ('238', '216', '174'), 'wheat3': ('205', '186', '150'), 'wheat4': ('139', '126', '102'), 'tan1': ('255', '165', '79'), 'tan2': ('238', '154', '73'), 'tan3': ('205', '133', '63'), 'tan4': ('139', '90', '43'), 'chocolate1': ('255', '127', '36'), 'chocolate2': ('238', '118', '33'), 'chocolate3': ('205', '102', '29'), 'chocolate4': ('139', '69', '19'), 'firebrick1': ('255', '48', '48'), 'firebrick2': ('238', '44', '44'), 'firebrick3': ('205', '38', '38'), 'firebrick4': ('139', '26', '26'), 'brown1': ('255', '64', '64'), 'brown2': ('238', '59', '59'), 'brown3': ('205', '51', '51'), 'brown4': ('139', '35', '35'), 'salmon1': ('255', '140', '105'), 'salmon2': ('238', '130', '98'), 'salmon3': ('205', '112', '84'), 'salmon4': ('139', '76', '57'), 'LightSalmon1': ('255', '160', '122'), 'LightSalmon2': ('238', '149', '114'), 'LightSalmon3': ('205', '129', '98'), 'LightSalmon4': ('139', '87', '66'), 'orange1': ('255', '165', '0'), 'orange2': ('238', '154', '0'), 'orange3': ('205', '133', '0'), 'orange4': ('139', '90', '0'), 'DarkOrange1': ('255', '127', '0'), 'DarkOrange2': ('238', '118', '0'), 'DarkOrange3': ('205', '102', '0'), 'DarkOrange4': ('139', '69', '0'), 'coral1': ('255', '114', '86'), 'coral2': ('238', '106', '80'), 'coral3': ('205', '91', '69'), 'coral4': ('139', '62', '47'), 'tomato1': ('255', '99', '71'), 'tomato2': ('238', '92', '66'), 'tomato3': ('205', '79', '57'), 'tomato4': ('139', '54', '38'), 'OrangeRed1': ('255', '69', '0'), 'OrangeRed2': ('238', '64', '0'), 'OrangeRed3': ('205', '55', '0'), 'OrangeRed4': ('139', '37', '0'), 'red1': ('255', '0', '0'), 'red2': ('238', '0', '0'), 'red3': ('205', '0', '0'), 'red4': ('139', '0', '0'), 'DeepPink1': ('255', '20', '147'), 'DeepPink2': ('238', '18', '137'), 'DeepPink3': ('205', '16', '118'), 'DeepPink4': ('139', '10', '80'), 'HotPink1': ('255', '110', '180'), 'HotPink2': ('238', '106', '167'), 'HotPink3': ('205', '96', '144'), 'HotPink4': ('139', '58', '98'), 'pink1': ('255', '181', '197'), 'pink2': ('238', '169', '184'), 'pink3': ('205', '145', '158'), 'pink4': ('139', '99', '108'), 'LightPink1': ('255', '174', '185'), 'LightPink2': ('238', '162', '173'), 'LightPink3': ('205', '140', '149'), 'LightPink4': ('139', '95', '101'), 'PaleVioletRed1': ('255', '130', '171'), 'PaleVioletRed2': ('238', '121', '159'), 'PaleVioletRed3': ('205', '104', '137'), 'PaleVioletRed4': ('139', '71', '93'), 'maroon1': ('255', '52', '179'), 'maroon2': ('238', '48', '167'), 'maroon3': ('205', '41', '144'), 'maroon4': ('139', '28', '98'), 'VioletRed1': ('255', '62', '150'), 'VioletRed2': ('238', '58', '140'), 'VioletRed3': ('205', '50', '120'), 'VioletRed4': ('139', '34', '82'), 'magenta1': ('255', '0', '255'), 'magenta2': ('238', '0', '238'), 'magenta3': ('205', '0', '205'), 'magenta4': ('139', '0', '139'), 'orchid1': ('255', '131', '250'), 'orchid2': ('238', '122', '233'), 'orchid3': ('205', '105', '201'), 'orchid4': ('139', '71', '137'), 'plum1': ('255', '187', '255'), 'plum2': ('238', '174', '238'), 'plum3': ('205', '150', '205'), 'plum4': ('139', '102', '139'), 'MediumOrchid1': ('224', '102', '255'), 'MediumOrchid2': ('209', '95', '238'), 'MediumOrchid3': ('180', '82', '205'), 'MediumOrchid4': ('122', '55', '139'), 'DarkOrchid1': ('191', '62', '255'), 'DarkOrchid2': ('178', '58', '238'), 'DarkOrchid3': ('154', '50', '205'), 'DarkOrchid4': ('104', '34', '139'), 'purple1': ('155', '48', '255'), 'purple2': ('145', '44', '238'), 'purple3': ('125', '38', '205'), 'purple4': ('85', '26', '139'), 'MediumPurple1': ('171', '130', '255'), 'MediumPurple2': ('159', '121', '238'), 'MediumPurple3': ('137', '104', '205'), 'MediumPurple4': ('93', '71', '139'), 'thistle1': ('255', '225', '255'), 'thistle2': ('238', '210', '238'), 'thistle3': ('205', '181', '205'), 'thistle4': ('139', '123', '139'), 'gray0': ('0', '0', '0'), 'grey0': ('0', '0', '0'), 'gray1': ('3', '3', '3'), 'grey1': ('3', '3', '3'), 'gray2': ('5', '5', '5'), 'grey2': ('5', '5', '5'), 'gray3': ('8', '8', '8'), 'grey3': ('8', '8', '8'), 'gray4': ('10', '10', '10'), 'grey4': ('10', '10', '10'), 'gray5': ('13', '13', '13'), 'grey5': ('13', '13', '13'), 'gray6': ('15', '15', '15'), 'grey6': ('15', '15', '15'), 'gray7': ('18', '18', '18'), 'grey7': ('18', '18', '18'), 'gray8': ('20', '20', '20'), 'grey8': ('20', '20', '20'), 'gray9': ('23', '23', '23'), 'grey9': ('23', '23', '23'), 'gray10': ('26', '26', '26'), 'grey10': ('26', '26', '26'), 'gray11': ('28', '28', '28'), 'grey11': ('28', '28', '28'), 'gray12': ('31', '31', '31'), 'grey12': ('31', '31', '31'), 'gray13': ('33', '33', '33'), 'grey13': ('33', '33', '33'), 'gray14': ('36', '36', '36'), 'grey14': ('36', '36', '36'), 'gray15': ('38', '38', '38'), 'grey15': ('38', '38', '38'), 'gray16': ('41', '41', '41'), 'grey16': ('41', '41', '41'), 'gray17': ('43', '43', '43'), 'grey17': ('43', '43', '43'), 'gray18': ('46', '46', '46'), 'grey18': ('46', '46', '46'), 'gray19': ('48', '48', '48'), 'grey19': ('48', '48', '48'), 'gray20': ('51', '51', '51'), 'grey20': ('51', '51', '51'), 'gray21': ('54', '54', '54'), 'grey21': ('54', '54', '54'), 'gray22': ('56', '56', '56'), 'grey22': ('56', '56', '56'), 'gray23': ('59', '59', '59'), 'grey23': ('59', '59', '59'), 'gray24': ('61', '61', '61'), 'grey24': ('61', '61', '61'), 'gray25': ('64', '64', '64'), 'grey25': ('64', '64', '64'), 'gray26': ('66', '66', '66'), 'grey26': ('66', '66', '66'), 'gray27': ('69', '69', '69'), 'grey27': ('69', '69', '69'), 'gray28': ('71', '71', '71'), 'grey28': ('71', '71', '71'), 'gray29': ('74', '74', '74'), 'grey29': ('74', '74', '74'), 'gray30': ('77', '77', '77'), 'grey30': ('77', '77', '77'), 'gray31': ('79', '79', '79'), 'grey31': ('79', '79', '79'), 'gray32': ('82', '82', '82'), 'grey32': ('82', '82', '82'), 'gray33': ('84', '84', '84'), 'grey33': ('84', '84', '84'), 'gray34': ('87', '87', '87'), 'grey34': ('87', '87', '87'), 'gray35': ('89', '89', '89'), 'grey35': ('89', '89', '89'), 'gray36': ('92', '92', '92'), 'grey36': ('92', '92', '92'), 'gray37': ('94', '94', '94'), 'grey37': ('94', '94', '94'), 'gray38': ('97', '97', '97'), 'grey38': ('97', '97', '97'), 'gray39': ('99', '99', '99'), 'grey39': ('99', '99', '99'), 'gray40': ('102', '102', '102'), 'grey40': ('102', '102', '102'), 'gray41': ('105', '105', '105'), 'grey41': ('105', '105', '105'), 'gray42': ('107', '107', '107'), 'grey42': ('107', '107', '107'), 'gray43': ('110', '110', '110'), 'grey43': ('110', '110', '110'), 'gray44': ('112', '112', '112'), 'grey44': ('112', '112', '112'), 'gray45': ('115', '115', '115'), 'grey45': ('115', '115', '115'), 'gray46': ('117', '117', '117'), 'grey46': ('117', '117', '117'), 'gray47': ('120', '120', '120'), 'grey47': ('120', '120', '120'), 'gray48': ('122', '122', '122'), 'grey48': ('122', '122', '122'), 'gray49': ('125', '125', '125'), 'grey49': ('125', '125', '125'), 'gray50': ('127', '127', '127'), 'grey50': ('127', '127', '127'), 'gray51': ('130', '130', '130'), 'grey51': ('130', '130', '130'), 'gray52': ('133', '133', '133'), 'grey52': ('133', '133', '133'), 'gray53': ('135', '135', '135'), 'grey53': ('135', '135', '135'), 'gray54': ('138', '138', '138'), 'grey54': ('138', '138', '138'), 'gray55': ('140', '140', '140'), 'grey55': ('140', '140', '140'), 'gray56': ('143', '143', '143'), 'grey56': ('143', '143', '143'), 'gray57': ('145', '145', '145'), 'grey57': ('145', '145', '145'), 'gray58': ('148', '148', '148'), 'grey58': ('148', '148', '148'), 'gray59': ('150', '150', '150'), 'grey59': ('150', '150', '150'), 'gray60': ('153', '153', '153'), 'grey60': ('153', '153', '153'), 'gray61': ('156', '156', '156'), 'grey61': ('156', '156', '156'), 'gray62': ('158', '158', '158'), 'grey62': ('158', '158', '158'), 'gray63': ('161', '161', '161'), 'grey63': ('161', '161', '161'), 'gray64': ('163', '163', '163'), 'grey64': ('163', '163', '163'), 'gray65': ('166', '166', '166'), 'grey65': ('166', '166', '166'), 'gray66': ('168', '168', '168'), 'grey66': ('168', '168', '168'), 'gray67': ('171', '171', '171'), 'grey67': ('171', '171', '171'), 'gray68': ('173', '173', '173'), 'grey68': ('173', '173', '173'), 'gray69': ('176', '176', '176'), 'grey69': ('176', '176', '176'), 'gray70': ('179', '179', '179'), 'grey70': ('179', '179', '179'), 'gray71': ('181', '181', '181'), 'grey71': ('181', '181', '181'), 'gray72': ('184', '184', '184'), 'grey72': ('184', '184', '184'), 'gray73': ('186', '186', '186'), 'grey73': ('186', '186', '186'), 'gray74': ('189', '189', '189'), 'grey74': ('189', '189', '189'), 'gray75': ('191', '191', '191'), 'grey75': ('191', '191', '191'), 'gray76': ('194', '194', '194'), 'grey76': ('194', '194', '194'), 'gray77': ('196', '196', '196'), 'grey77': ('196', '196', '196'), 'gray78': ('199', '199', '199'), 'grey78': ('199', '199', '199'), 'gray79': ('201', '201', '201'), 'grey79': ('201', '201', '201'), 'gray80': ('204', '204', '204'), 'grey80': ('204', '204', '204'), 'gray81': ('207', '207', '207'), 'grey81': ('207', '207', '207'), 'gray82': ('209', '209', '209'), 'grey82': ('209', '209', '209'), 'gray83': ('212', '212', '212'), 'grey83': ('212', '212', '212'), 'gray84': ('214', '214', '214'), 'grey84': ('214', '214', '214'), 'gray85': ('217', '217', '217'), 'grey85': ('217', '217', '217'), 'gray86': ('219', '219', '219'), 'grey86': ('219', '219', '219'), 'gray87': ('222', '222', '222'), 'grey87': ('222', '222', '222'), 'gray88': ('224', '224', '224'), 'grey88': ('224', '224', '224'), 'gray89': ('227', '227', '227'), 'grey89': ('227', '227', '227'), 'gray90': ('229', '229', '229'), 'grey90': ('229', '229', '229'), 'gray91': ('232', '232', '232'), 'grey91': ('232', '232', '232'), 'gray92': ('235', '235', '235'), 'grey92': ('235', '235', '235'), 'gray93': ('237', '237', '237'), 'grey93': ('237', '237', '237'), 'gray94': ('240', '240', '240'), 'grey94': ('240', '240', '240'), 'gray95': ('242', '242', '242'), 'grey95': ('242', '242', '242'), 'gray96': ('245', '245', '245'), 'grey96': ('245', '245', '245'), 'gray97': ('247', '247', '247'), 'grey97': ('247', '247', '247'), 'gray98': ('250', '250', '250'), 'grey98': ('250', '250', '250'), 'gray99': ('252', '252', '252'), 'grey99': ('252', '252', '252'), 'gray100': ('255', '255', '255'), 'grey100': ('255', '255', '255'), 'darkgrey': ('169', '169', '169'), 'DarkGrey': ('169', '169', '169'), 'darkgray': ('169', '169', '169'), 'DarkGray': ('169', '169', '169'), 'darkblue': ('0', '0', '139'), 'DarkBlue': ('0', '0', '139'), 'darkcyan': ('0', '139', '139'), 'DarkCyan': ('0', '139', '139'), 'darkmagenta': ('139', '0', '139'), 'DarkMagenta': ('139', '0', '139'), 'darkred': ('139', '0', '0'), 'DarkRed': ('139', '0', '0'), 'lightgreen': ('144', '238', '144'), 'LightGreen': ('144', '238', '144')}
class Student: def __init__(self, id: str, name: str) -> None: self.id = id self.name = name class Course: def __init__(self, id: str, name: str, hours: int, grades = None) -> None: self.id = id self.name = name self.hours = hours self.grades = grades or {} def add_grade(self, student: Student, grade: str): self.grades[student.id] = grade @staticmethod def convert_grade_to_points(grade: str) -> float: return { "A+": 4.0, "A" : 4.0, "A-": 3.7, "B+": 3.5, "B" : 3.3, "B-": 3.0, "C+": 2.7, "C" : 2.5, "C-": 2.3, "D" : 2.0, "F" : 0.0 }.get(grade, 0)
class Student: def __init__(self, id: str, name: str) -> None: self.id = id self.name = name class Course: def __init__(self, id: str, name: str, hours: int, grades=None) -> None: self.id = id self.name = name self.hours = hours self.grades = grades or {} def add_grade(self, student: Student, grade: str): self.grades[student.id] = grade @staticmethod def convert_grade_to_points(grade: str) -> float: return {'A+': 4.0, 'A': 4.0, 'A-': 3.7, 'B+': 3.5, 'B': 3.3, 'B-': 3.0, 'C+': 2.7, 'C': 2.5, 'C-': 2.3, 'D': 2.0, 'F': 0.0}.get(grade, 0)
class WebServerDefinitions: name = None root = None template = None https = False default_template = 'laravel' def __init__(self, name, root, template=None, https=False): self.name = name self.root = root self.https = https if not template: template = self.default_template self.template = template
class Webserverdefinitions: name = None root = None template = None https = False default_template = 'laravel' def __init__(self, name, root, template=None, https=False): self.name = name self.root = root self.https = https if not template: template = self.default_template self.template = template
class GraphReprBase(object): @staticmethod def read_from_file(input_file): raise NotImplemented()
class Graphreprbase(object): @staticmethod def read_from_file(input_file): raise not_implemented()
STATUS_MAP = { 'RECEIVED_UNREAD': b'0', 'RECEIVED_READ': b'1', 'STORED_UNSENT': b'2', 'STORED_SENT': b'3', 'ALL': b'4' } STATUS_MAP_R = { b'0': 'RECEIVED_UNREAD', b'1': 'RECEIVED_READ', b'2': 'STORED_UNSENT', b'3': 'STORED_SENT', b'4': 'ALL' } DELETE_FLAG = { 'ALL_READ': b'1', 'READ_AND_SENT': b'2', 'READ_AND_UNSENT': b'3', 'ALL': b'4' } ERROR_CODES = [ b'+CMS ERROR', b'+CME ERROR' ] # EC25 URC codes with the corresponding chunk count UNSOLICITED_RESULT_CODES = [ (b'+CREG', 1), (b'+CGREG', 1), (b'+CTZV', 1), (b'+CTZE', 1), (b'+CMTI', 1), (b'+CMT', 2), (b'^HCMT', 2), (b'+CBM', 2), (b'+CDS', 1), (b'+CDSI', 1), (b'^HCDS', 2), (b'+COLP', 1), (b'+CLIP', 1), (b'+CRING', 1), (b'+CCWA', 1), (b'+CSSI', 1), (b'+CSSU', 1), (b'+CUSD', 1), (b'RDY', 1), (b'+CFUN', 1), (b'+CPIN', 1), (b'+QIND', 1), (b'POWERED DOWN', 1), (b'+CGEV', 1), (b'NO CARRIER', 1) ]
status_map = {'RECEIVED_UNREAD': b'0', 'RECEIVED_READ': b'1', 'STORED_UNSENT': b'2', 'STORED_SENT': b'3', 'ALL': b'4'} status_map_r = {b'0': 'RECEIVED_UNREAD', b'1': 'RECEIVED_READ', b'2': 'STORED_UNSENT', b'3': 'STORED_SENT', b'4': 'ALL'} delete_flag = {'ALL_READ': b'1', 'READ_AND_SENT': b'2', 'READ_AND_UNSENT': b'3', 'ALL': b'4'} error_codes = [b'+CMS ERROR', b'+CME ERROR'] unsolicited_result_codes = [(b'+CREG', 1), (b'+CGREG', 1), (b'+CTZV', 1), (b'+CTZE', 1), (b'+CMTI', 1), (b'+CMT', 2), (b'^HCMT', 2), (b'+CBM', 2), (b'+CDS', 1), (b'+CDSI', 1), (b'^HCDS', 2), (b'+COLP', 1), (b'+CLIP', 1), (b'+CRING', 1), (b'+CCWA', 1), (b'+CSSI', 1), (b'+CSSU', 1), (b'+CUSD', 1), (b'RDY', 1), (b'+CFUN', 1), (b'+CPIN', 1), (b'+QIND', 1), (b'POWERED DOWN', 1), (b'+CGEV', 1), (b'NO CARRIER', 1)]
def collatz(n, count): if n == 1: return count else: count = count + 1 if n % 2 == 0: n = n /2 else: n = 3 * n + 1 return collatz(n, count) max_collatz = 1 iteration = 1 for i in range(1, 1000000): count = 1 contesting = collatz(i, 1) if contesting > max_collatz: max_collatz = contesting iteration = i print("Final winner is integer {}".format(iteration))
def collatz(n, count): if n == 1: return count else: count = count + 1 if n % 2 == 0: n = n / 2 else: n = 3 * n + 1 return collatz(n, count) max_collatz = 1 iteration = 1 for i in range(1, 1000000): count = 1 contesting = collatz(i, 1) if contesting > max_collatz: max_collatz = contesting iteration = i print('Final winner is integer {}'.format(iteration))
#!/usr/bin/env python3 # Copyright 2009-2017 BHG http://bw.org/ # Functions allow variable-length argument lists def main(): kitten('meow', 'grrr', 'purr') # We treat it as a sequence, actually a tuple def kitten(*args): # It's denoted as *args. args is the conventional name if len(args): # If the length of args is greater than zero for s in args: print(s) # If len(args), print all the items in the tuple else: print('Meow.') # otherwise print meow if __name__ == '__main__': main() # You can call the kitten function like this: x = ('hiss', 'howl', 'roar', 'screech') kitten(*x) # note the star
def main(): kitten('meow', 'grrr', 'purr') def kitten(*args): if len(args): for s in args: print(s) else: print('Meow.') if __name__ == '__main__': main() x = ('hiss', 'howl', 'roar', 'screech') kitten(*x)
for i in range(5): for j in range(5): if i==j: print('#',end='') else: print("+",end='') print("")
for i in range(5): for j in range(5): if i == j: print('#', end='') else: print('+', end='') print('')
DATA_URL = 'http://archive.ics.uci.edu/ml/machine-learning-databases/auto-mpg/auto-mpg.data' DATA_COLUMNS = ['MPG', 'Cylinders', 'Displacement', 'Horsepower', 'Weight', 'Acceleration', 'Model Year', 'Origin'] NORMALIZE = False TARGET_VARIABLE = 'MPG' # FEATURES_TO_USE = [ 'Cylinders', 'Displacement', 'Horsepower', 'Weight', 'Acceleration', 'Model Year', 'Europe', 'Japan', 'USA'] FEATURES_TO_USE = [ 'MPG', 'Horsepower','Displacement'] NORMALIZE_HORSEPOWER = False
data_url = 'http://archive.ics.uci.edu/ml/machine-learning-databases/auto-mpg/auto-mpg.data' data_columns = ['MPG', 'Cylinders', 'Displacement', 'Horsepower', 'Weight', 'Acceleration', 'Model Year', 'Origin'] normalize = False target_variable = 'MPG' features_to_use = ['MPG', 'Horsepower', 'Displacement'] normalize_horsepower = False
# question : https://quera.ir/problemset/contest/8901 x_n = input().split(' ') x = x_n[1] n = int(x_n[0]) default_value = { 'L': 0, 'M': 0, 'R': 0, } movements = [] for one_input in range(n): movements.append(input().split(' ')) default_value[x] = 1 for one_movement in movements: temp = default_value.get(one_movement[0]) default_value[one_movement[0]] = default_value.get(one_movement[1]) default_value[one_movement[1]] = temp for index in default_value: if default_value.get(index) == 1: print(index) break
x_n = input().split(' ') x = x_n[1] n = int(x_n[0]) default_value = {'L': 0, 'M': 0, 'R': 0} movements = [] for one_input in range(n): movements.append(input().split(' ')) default_value[x] = 1 for one_movement in movements: temp = default_value.get(one_movement[0]) default_value[one_movement[0]] = default_value.get(one_movement[1]) default_value[one_movement[1]] = temp for index in default_value: if default_value.get(index) == 1: print(index) break
#!/usr/bin/env python3 def get_vertices(wire): x = y = steps = 0 vertices = [(x, y, 0)] for edge in wire: length = int(edge[1:]) steps += length if edge[0] == "R": x += length if edge[0] == "L": x -= length if edge[0] == "U": y += length if edge[0] == "D": y -= length vertices.append((x, y, steps)) return vertices def get_intersections(edges1, edges2): intersections = [] for i in range(len(edges1) - 1): for j in range(len(edges2) - 1): intersection = get_intersection( edges1[i], edges1[i + 1], edges2[j], edges2[j + 1] ) if intersection: intersections.append(intersection) # remove 0,0 if any try: intersections.remove((0, 0, 0)) except Exception: pass return intersections def get_distance(vert): return abs(vert[0]) + abs(vert[1]) def get_intersection(e1from, e1to, e2from, e2to): e1x1, e1y1, steps_e1 = e1from e1x2, e1y2, _ = e1to e2x1, e2y1, steps_e2 = e2from e2x2, e2y2, _ = e2to if e1y1 == e1y2 and e2x1 == e2x2: # e1 is horizontal and e2 is vertical if (e2y1 <= e1y1 <= e2y2 or e2y1 >= e1y1 >= e2y2) and ( e1x1 <= e2x1 <= e1x2 or e1x1 >= e2x1 >= e1x2 ): steps = steps_e1 + steps_e2 + abs(e2x1 - e1x1) + abs(e1y1 - e2y1) return (e2x1, e1y1, steps) elif e2y1 == e2y2 and e1x1 == e1x2: # e1 is vertical and e2 is horizontal if (e1y1 <= e2y1 <= e1y2 or e1y1 >= e2y1 >= e1y2) and ( e2x1 <= e1x1 <= e2x2 or e2x1 >= e1x1 >= e2x2 ): steps = steps_e1 + steps_e2 + abs(e1x1 - e2x1) + abs(e2y1 - e1y1) return (e1x1, e2y1, steps) def get_closest_intersection(edges1, edges2): ints = get_intersections(edges1, edges2) return min(map(lambda vert: get_distance(vert), ints)) def get_min_path_intersection(edges1, edges2): ints = get_intersections(edges1, edges2) return min(map(lambda vert: vert[2], ints)) def test1(): wire1 = ["R8", "U5", "L5", "D3"] wire2 = ["U7", "R6", "D4", "L4"] edges1 = get_vertices(wire1) edges2 = get_vertices(wire2) assert get_closest_intersection(edges1, edges2) == 6 assert get_min_path_intersection(edges1, edges2) == 30 def test2(): wire1 = ["R75", "D30", "R83", "U83", "L12", "D49", "R71", "U7", "L72"] wire2 = ["U62", "R66", "U55", "R34", "D71", "R55", "D58", "R83"] edges1 = get_vertices(wire1) edges2 = get_vertices(wire2) assert get_closest_intersection(edges1, edges2) == 159 assert get_min_path_intersection(edges1, edges2) == 610 if __name__ == "__main__": with open("../inputs/day03.txt") as ip: lines = ip.readlines() wire1 = lines[0].strip().split(",") edges1 = get_vertices(wire1) wire2 = lines[1].strip().split(",") edges2 = get_vertices(wire2) print( "Distanct to closest intersection", get_closest_intersection(edges1, edges2) ) print("Min Steps to intersection", get_min_path_intersection(edges1, edges2))
def get_vertices(wire): x = y = steps = 0 vertices = [(x, y, 0)] for edge in wire: length = int(edge[1:]) steps += length if edge[0] == 'R': x += length if edge[0] == 'L': x -= length if edge[0] == 'U': y += length if edge[0] == 'D': y -= length vertices.append((x, y, steps)) return vertices def get_intersections(edges1, edges2): intersections = [] for i in range(len(edges1) - 1): for j in range(len(edges2) - 1): intersection = get_intersection(edges1[i], edges1[i + 1], edges2[j], edges2[j + 1]) if intersection: intersections.append(intersection) try: intersections.remove((0, 0, 0)) except Exception: pass return intersections def get_distance(vert): return abs(vert[0]) + abs(vert[1]) def get_intersection(e1from, e1to, e2from, e2to): (e1x1, e1y1, steps_e1) = e1from (e1x2, e1y2, _) = e1to (e2x1, e2y1, steps_e2) = e2from (e2x2, e2y2, _) = e2to if e1y1 == e1y2 and e2x1 == e2x2: if (e2y1 <= e1y1 <= e2y2 or e2y1 >= e1y1 >= e2y2) and (e1x1 <= e2x1 <= e1x2 or e1x1 >= e2x1 >= e1x2): steps = steps_e1 + steps_e2 + abs(e2x1 - e1x1) + abs(e1y1 - e2y1) return (e2x1, e1y1, steps) elif e2y1 == e2y2 and e1x1 == e1x2: if (e1y1 <= e2y1 <= e1y2 or e1y1 >= e2y1 >= e1y2) and (e2x1 <= e1x1 <= e2x2 or e2x1 >= e1x1 >= e2x2): steps = steps_e1 + steps_e2 + abs(e1x1 - e2x1) + abs(e2y1 - e1y1) return (e1x1, e2y1, steps) def get_closest_intersection(edges1, edges2): ints = get_intersections(edges1, edges2) return min(map(lambda vert: get_distance(vert), ints)) def get_min_path_intersection(edges1, edges2): ints = get_intersections(edges1, edges2) return min(map(lambda vert: vert[2], ints)) def test1(): wire1 = ['R8', 'U5', 'L5', 'D3'] wire2 = ['U7', 'R6', 'D4', 'L4'] edges1 = get_vertices(wire1) edges2 = get_vertices(wire2) assert get_closest_intersection(edges1, edges2) == 6 assert get_min_path_intersection(edges1, edges2) == 30 def test2(): wire1 = ['R75', 'D30', 'R83', 'U83', 'L12', 'D49', 'R71', 'U7', 'L72'] wire2 = ['U62', 'R66', 'U55', 'R34', 'D71', 'R55', 'D58', 'R83'] edges1 = get_vertices(wire1) edges2 = get_vertices(wire2) assert get_closest_intersection(edges1, edges2) == 159 assert get_min_path_intersection(edges1, edges2) == 610 if __name__ == '__main__': with open('../inputs/day03.txt') as ip: lines = ip.readlines() wire1 = lines[0].strip().split(',') edges1 = get_vertices(wire1) wire2 = lines[1].strip().split(',') edges2 = get_vertices(wire2) print('Distanct to closest intersection', get_closest_intersection(edges1, edges2)) print('Min Steps to intersection', get_min_path_intersection(edges1, edges2))
dim=10.0 eta=0.5 steps=100 #must be integer (no decimal point) rneighb=eta
dim = 10.0 eta = 0.5 steps = 100 rneighb = eta
# automatically generated by the FlatBuffers compiler, do not modify # namespace: apemodefb class EAnimCurvePropertyFb(object): LclTranslation = 0 RotationOffset = 1 RotationPivot = 2 PreRotation = 3 PostRotation = 4 LclRotation = 5 ScalingOffset = 6 ScalingPivot = 7 LclScaling = 8 GeometricTranslation = 9 GeometricRotation = 10 GeometricScaling = 11
class Eanimcurvepropertyfb(object): lcl_translation = 0 rotation_offset = 1 rotation_pivot = 2 pre_rotation = 3 post_rotation = 4 lcl_rotation = 5 scaling_offset = 6 scaling_pivot = 7 lcl_scaling = 8 geometric_translation = 9 geometric_rotation = 10 geometric_scaling = 11
__author__ = 'tylin' # from .bleu import Bleu # # __all__ = ['Bleu']
__author__ = 'tylin'
# General ES Constants COUNT = 'count' CREATE = 'create' DOCS = 'docs' FIELD = 'field' FIELDS = 'fields' HITS = 'hits' ID = '_id' INDEX = 'index' INDEX_NAME = 'index_name' ITEMS = 'items' KILOMETERS = 'km' MAPPING_DYNAMIC = 'dynamic' MAPPING_MULTI_FIELD = 'multi_field' MAPPING_NULL_VALUE = 'null_value' MILES = 'mi' OK = 'ok' PROPERTIES = 'properties' PROPERTY_TYPE = 'type' SCORE = '_score' SOURCE = '_source' TOTAL = 'total' TTL = '_ttl' TYPE = '_type' UID = '_uid' UNIT = 'unit' URL = 'url' URLS = 'urls' # Matching / Filtering AND = "and" BOOL = 'bool' DOC_TYPE = 'doc_type' FILTER = 'filter' FILTERED = 'filtered' MATCH_ALL = 'match_all' MUST = 'must' MUST_NOT = 'must_not' OR = "or" QUERY = 'query' SHOULD = 'should' SORT = 'sort' TERMS = 'terms' TERM = 'term' # Sorting / Misc. ASC = 'asc' DESC = 'desc' FACET_FILTER = 'facet_filter' FACETS = 'facets' FROM = 'from' OFFSET = 'offset' ORDER = 'order' SIZE = 'size' TO = 'to' # Runtime Constants DEFAULT_PAGE_SIZE = 20
count = 'count' create = 'create' docs = 'docs' field = 'field' fields = 'fields' hits = 'hits' id = '_id' index = 'index' index_name = 'index_name' items = 'items' kilometers = 'km' mapping_dynamic = 'dynamic' mapping_multi_field = 'multi_field' mapping_null_value = 'null_value' miles = 'mi' ok = 'ok' properties = 'properties' property_type = 'type' score = '_score' source = '_source' total = 'total' ttl = '_ttl' type = '_type' uid = '_uid' unit = 'unit' url = 'url' urls = 'urls' and = 'and' bool = 'bool' doc_type = 'doc_type' filter = 'filter' filtered = 'filtered' match_all = 'match_all' must = 'must' must_not = 'must_not' or = 'or' query = 'query' should = 'should' sort = 'sort' terms = 'terms' term = 'term' asc = 'asc' desc = 'desc' facet_filter = 'facet_filter' facets = 'facets' from = 'from' offset = 'offset' order = 'order' size = 'size' to = 'to' default_page_size = 20