content
stringlengths
7
1.05M
fixed_cases
stringlengths
1
1.28M
class FixtureException(Exception): pass class FixtureUploadError(FixtureException): pass class DuplicateFixtureTagException(FixtureUploadError): pass class ExcelMalformatException(FixtureUploadError): pass class FixtureAPIException(Exception): pass class FixtureTypeCheckError(Exception): pass class FixtureVersionError(Exception): pass
class Fixtureexception(Exception): pass class Fixtureuploaderror(FixtureException): pass class Duplicatefixturetagexception(FixtureUploadError): pass class Excelmalformatexception(FixtureUploadError): pass class Fixtureapiexception(Exception): pass class Fixturetypecheckerror(Exception): pass class Fixtureversionerror(Exception): pass
#!/usr/bin/env python3 # tuples is a type of list. # tuples is immutable. # the structure of a tuple: (1, "nice work", 2.3, [1,2,"hey"]) my_tuple = ("hey", 1, 2, "hey ho!", "hey", "hey") print("My tuple:", my_tuple) # to get a tuple value use it's index print("Second item in my_tuple:", my_tuple[1]) # to count how many times a values appears in a tuple: tuple.count(value) # returns 0 if no values exists. print("How many 'hey' in my_tuple:", my_tuple.count("hey")) # go get the index value of a tuple item. tuple.index(value) # if value does not exist you will get an error like "ValueError: tuple.index(x): x not in tuple" print("Index position of 'hey ho!' in my_tuple:", my_tuple.index("hey ho!")) # tuples are immutable so you cannot reassign a value like # my_tuple[2] = "wop wop" # TypeError: 'tuple' object does not support item assignment
my_tuple = ('hey', 1, 2, 'hey ho!', 'hey', 'hey') print('My tuple:', my_tuple) print('Second item in my_tuple:', my_tuple[1]) print("How many 'hey' in my_tuple:", my_tuple.count('hey')) print("Index position of 'hey ho!' in my_tuple:", my_tuple.index('hey ho!'))
def possibleHeights(parent): edges = [[] for i in range(len(parent))] height = [0 for i in range(len(parent))] isPossibleHeight = [False for i in range(len(parent))] def initGraph(parent): for i in range(1, len(parent)): edges[parent[i]].append(i) def calcHeight(v): for u in edges[v]: calcHeight(u) height[v] = max(height[v], height[u]+1) countHeights = [[] for i in range(len(edges))] for i in range(len(edges[v])): u = edges[v][i] countHeights[height[u]].append(u) edges[v] = [] for i in range(len(edges) - 1, -1, -1): for j in range(len(countHeights[i])): edges[v].append(countHeights[i][j]) def findNewHeights(v, tailHeight): isPossibleHeight[max(height[v], tailHeight)] = True firstMaxHeight = tailHeight + 1 secondMaxHeight = tailHeight + 1 if len(edges[v]) > 0: firstMaxHeight = max(firstMaxHeight, height[edges[v][0]] + 2) if len(edges[v]) > 1: secondMaxHeight = max(secondMaxHeight, height[edges[v][1]] + 2) if len(edges[v]) > 0: findNewHeights(edges[v][0], secondMaxHeight) for i in range(1, len(edges[v])): findNewHeights(edges[v][i], firstMaxHeight) initGraph(parent) calcHeight(0) findNewHeights(0, 0) heights = [] for i in range(len(parent)): if isPossibleHeight[i]: heights.append(i) return heights
def possible_heights(parent): edges = [[] for i in range(len(parent))] height = [0 for i in range(len(parent))] is_possible_height = [False for i in range(len(parent))] def init_graph(parent): for i in range(1, len(parent)): edges[parent[i]].append(i) def calc_height(v): for u in edges[v]: calc_height(u) height[v] = max(height[v], height[u] + 1) count_heights = [[] for i in range(len(edges))] for i in range(len(edges[v])): u = edges[v][i] countHeights[height[u]].append(u) edges[v] = [] for i in range(len(edges) - 1, -1, -1): for j in range(len(countHeights[i])): edges[v].append(countHeights[i][j]) def find_new_heights(v, tailHeight): isPossibleHeight[max(height[v], tailHeight)] = True first_max_height = tailHeight + 1 second_max_height = tailHeight + 1 if len(edges[v]) > 0: first_max_height = max(firstMaxHeight, height[edges[v][0]] + 2) if len(edges[v]) > 1: second_max_height = max(secondMaxHeight, height[edges[v][1]] + 2) if len(edges[v]) > 0: find_new_heights(edges[v][0], secondMaxHeight) for i in range(1, len(edges[v])): find_new_heights(edges[v][i], firstMaxHeight) init_graph(parent) calc_height(0) find_new_heights(0, 0) heights = [] for i in range(len(parent)): if isPossibleHeight[i]: heights.append(i) return heights
expected_output = { 'instance': { 'isp': { 'address_family': { 'IPv4 Unicast': { 'spf_log': { 1: { 'type': 'FSPF', 'time_ms': 1, 'level': 1, 'total_nodes': 1, 'trigger_count': 1, 'first_trigger_lsp': '12a5.00-00', 'triggers': 'NEWLSP0', 'start_timestamp': 'Mon Aug 16 2004 19:25:35.140', 'delay': { 'since_first_trigger_ms': 51, }, 'spt_calculation': { 'cpu_time_ms': 0, 'real_time_ms': 0, }, 'prefix_update': { 'cpu_time_ms': 1, 'real_time_ms': 1, }, 'new_lsp_arrivals': 0, 'next_wait_interval_ms': 200, 'results': { 'nodes': { 'reach': 1, 'unreach': 0, 'total': 1, }, 'prefixes': { 'items': { 'critical_priority': { 'reach': 0, 'unreach': 0, 'total': 0, }, 'high_priority': { 'reach': 0, 'unreach': 0, 'total': 0, }, 'medium_priority': { 'reach': 0, 'unreach': 0, 'total': 0, }, 'low_priority': { 'reach': 0, 'unreach': 0, 'total': 0, }, 'all_priority': { 'reach': 0, 'unreach': 0, 'total': 0, }, }, 'routes': { 'critical_priority': { 'reach': 0, 'total': 0, }, 'high_priority': { 'reach': 0, 'total': 0, }, 'medium_priority': { 'reach': 0, 'total': 0, }, 'low_priority': { 'reach': 0, 'total': 0, }, 'all_priority': { 'reach': 0, 'total': 0, }, }, }, }, }, }, }, }, }, }, }
expected_output = {'instance': {'isp': {'address_family': {'IPv4 Unicast': {'spf_log': {1: {'type': 'FSPF', 'time_ms': 1, 'level': 1, 'total_nodes': 1, 'trigger_count': 1, 'first_trigger_lsp': '12a5.00-00', 'triggers': 'NEWLSP0', 'start_timestamp': 'Mon Aug 16 2004 19:25:35.140', 'delay': {'since_first_trigger_ms': 51}, 'spt_calculation': {'cpu_time_ms': 0, 'real_time_ms': 0}, 'prefix_update': {'cpu_time_ms': 1, 'real_time_ms': 1}, 'new_lsp_arrivals': 0, 'next_wait_interval_ms': 200, 'results': {'nodes': {'reach': 1, 'unreach': 0, 'total': 1}, 'prefixes': {'items': {'critical_priority': {'reach': 0, 'unreach': 0, 'total': 0}, 'high_priority': {'reach': 0, 'unreach': 0, 'total': 0}, 'medium_priority': {'reach': 0, 'unreach': 0, 'total': 0}, 'low_priority': {'reach': 0, 'unreach': 0, 'total': 0}, 'all_priority': {'reach': 0, 'unreach': 0, 'total': 0}}, 'routes': {'critical_priority': {'reach': 0, 'total': 0}, 'high_priority': {'reach': 0, 'total': 0}, 'medium_priority': {'reach': 0, 'total': 0}, 'low_priority': {'reach': 0, 'total': 0}, 'all_priority': {'reach': 0, 'total': 0}}}}}}}}}}}
b = "r n b q k b n r p p p p p p p p".split(" ") + ['.']*32 + "p p p p p p p p r n b q k b n r".upper().split(" ") def newBoard(): b = "r n b q k b n r p p p p p p p p".split(" ") + ['.']*32 + "p p p p p p p p r n b q k b n r".upper().split(" ") def display(): #white side view c , k= 1 ,0 ap = range(1,9)[::-1] row,col=[],[] for i in b: row.append(i) if c==8 : c=0 col.append(row) row=[] c+=1 for j in col[::-1]: print(ap[k] , " |" ,end=" ") for i in j: print(i,end=' ') print() k+=1 print(" ",end="") print("-"*18," A B C D E F G H",sep="\n") def move(fr,to): fnum = (conv(fr))-1 tnum = (conv(to))-1 b[fnum], b[tnum] = '.',b[fnum] display() def conv(s): num = int(s[1]) alp = s[0] a = {'a':1,'b':2,'c':3,'d':4,'e':5,'f':6,'g':7,'h':8} alpn = a[alp] return ((num-1)*8)+alpn def rookValid(fr,to): fnum = (conv(fr))-1 tnum = (conv(to))-1 con1,con2,con3=False,False,False if abs(fnum-tnum)%8==0: con1=True rows=[range(0,8),range(8,16),range(16,24),range(24,32),range(32,40),range(40,48),range(48,56),range(56,64)] for k in rows: if fnum in k and tnum in k: con2=True if con2: #verifies if path is clear if fr and to are in same row for l in range(fnum+1,tnum): if b[l] != '.': con2=False mi =min(fnum,tnum) ma = max(fnum,tnum) if con1: while mi < ma: mi+=8 if b[mi] !='.': con1=False if (b[fnum].isupper() and not b[tnum].isupper()) or (b[fnum].islower() and not b[tnum].islower()) : con3 = True return (con1 or con2) and con3 def kingValid(fr,to): fnum = (conv(fr))-1 tnum = (conv(to))-1 if not addressValid(fnum,tnum): return False con1,con2=False,False if fnum%8!=0 and fnum%9!=0: val = [fnum+1 , fnum-1,fnum+8,fnum-8] elif fnum%8==0: val =[fnum+8 , fnum-8,fnum-1] else: val =[fnum+8 , fnum-8,fnum+1] if fnum in val : con=True if (b[fnum].isupper() and not b[tnum].isupper()) or (b[fnum].islower() and not b[tnum].islower()) : con2 = True return con1 and con2 def pawnValid(fr,to): fnum = (conv(fr))-1 tnum = (conv(to))-1 if not addressValid(fnum,tnum): return False if fr.isupper() : c='b' if fr.islower() : c='w' if c=='w': if fr in range(8,16): vm = [fnum+8,fnum+16] else : vm= [fnum+8] if b[fnum+7].isupper(): vm.append(fnum+7) if b[fnum+9].isupper(): vm.append(fnum+9) if tnum in vm and not b[tnum].islower(): return True else: return False if c=='b': if fr in range(48,56): vm = [fnum-8,fnum-16] else : vm= [fnum-8] if b[fnum-7].islower(): vm.append(fnum+7) if b[fnum-9].islower(): vm.append(fnum+9) if tnum in vm and not b[tnum].isupper(): return True else: return False def bishopValid(fr,to): fnum = (conv(fr))-1 tnum = (conv(to))-1 if not addressValid(fnum,tnum): return False con1=False if abs(fnum-tnum)%9==0 or abs(fnum-tnum)%7==0: con1 = True if (fnum-tnum)%9==0: while fnum!=tnum: tnum+=9 if b[tnum]!='.' : return False if (fnum-tnum)%7==0: while fnum!=tnum: tnum+=7 if b[tnum]!='.' : return False if (tnum-fnum)%9==0: while tnum!=fnum: fnum+=9 if b[fnum]!='.' : return False if (tnum-fnum)%7==0: while tnum!=fnum: fnum+=7 if b[fnum]!='.' : return False if (b[fnum].isupper() and not b[tnum].isupper()) or (b[fnum].islower() and not b[tnum].islower()) : con2 = True return con1 and con2 def queenValid(fr,to): fnum = (conv(fr))-1 tnum = (conv(to))-1 if not addressValid(fnum,tnum): return False return bishopValid(fr,to) or rookValid(fr,to) def knightValid(fr,to): fnum = (conv(fr))-1 tnum = (conv(to))-1 if not addressValid(fnum,tnum): return False if tnum in [fnum+17,fnum-17,fnum+15,fnum-15,fnum+10,fnum-6,fnum+6,fnum-10]: con1=True if (b[fnum].isupper() and not b[tnum].isupper()) or (b[fnum].islower() and not b[tnum].islower()) : con2=True return con1 and con2 def addressValid(fnum,tnum): return 0<=fnum<64 and 0<=tnum<64 def rookMoves(pos): num=(conv(pos))-1 #num is index if b[num].isupper() : c='b' elif b[num].islower() : c='w' else: return "Block is empty" vm=[] col=(num+1)%8 if col==0: col=8 row=int(pos[1]) if c=='w': block=num+8 while row<=8: if b[block] == '.' : vm.append(block) if b[block].isupper() : vm.append(block) break if b[block].islower(): break block+=8 row+=1 row=int(pos[1]) block=num-8 while row>0: if b[block] == '.' : vm.append(block) if b[block].isupper() : vm.append(block) break if b[block].islower(): break block-=8 row-=1 tcol=col+1 #col is from 1 to 8 , row is from 1 to 8 block =num+1 while tcol<=8: if b[block] == '.' : vm.append(block) if b[block].isupper() : vm.append(block) break if b[block].islower(): break block+=1 tcol+=1 block =num-1 tcol=col while tcol>1: if b[block] == '.' : vm.append(block) if b[block].isupper() : vm.append(block) break if b[block].islower(): break block-=1 tcol-=1 tcol=col row=int(pos[1]) if c=='b': block=num+8 while row<=8: if b[block] == '.' : vm.append(block) if b[block].islower() : vm.append(block) break if b[block].isupper(): break block+=8 row+=1 row=int(pos[1]) block=num-8 while row>1: if b[block] == '.' : vm.append(block) if b[block].islower() : vm.append(block) break if b[block].isupper(): break block-=8 row-=1 tcol=col+1 #col is from 1 to 8 , row is from 1 to 8 block =num+1 while tcol<=8: if b[block] == '.' : vm.append(block) if b[block].islower() : vm.append(block) break if b[block].isupper(): break block+=1 tcol+=1 block =num-1 tcol=col while tcol>1: if b[block] == '.' : vm.append(block) if b[block].islower() : vm.append(block) break if b[block].isupper(): break block-=1 tcol-=1 move=[] for l in vm: move.append(numToAlg(l)) return move def bishopMoves(pos): num=(conv(pos))-1 if b[num].isupper() : c='b' elif b[num].islower() : c='w' else: return "Block is empty" vm=[] col=(num+1)%8 if col==0: col=8 row=int(pos[1])+1 if c=='w': tcol=col+1 row=int(pos[1])+1 block=num+9 while row<=8 and col<=8 : #goes top right if b[block] == '.' : vm.append(block) if b[block].isupper() : vm.append(block) break if b[block].islower(): break block+=9 row+=1 tcol+=1 row=int(pos[1])-1 tcol=col-1 block=num-9 while row>0 and tcol>1: #goes below left if b[block] == '.' : vm.append(block) if b[block].isupper() : vm.append(block) break if b[block].islower(): break block-=9 row-=1 tcol-=1 row=int(pos[1])-1 tcol=col+1 block =num-7 while tcol<=8 and row>1: #goes below right if b[block] == '.' : vm.append(block) if b[block].isupper() : vm.append(block) break if b[block].islower(): break block-=7 tcol+=1 row-=1 block =num+7 tcol=col-1 row=int(pos[1])+1 while tcol>0 and row<=8: #goes top left if b[block] == '.' : vm.append(block) if b[block].isupper() : vm.append(block) break if b[block].islower(): break block+=7 tcol-=1 row+=1 if c=='b': tcol=col+1 row=int(pos[1])+1 block=num+9 while row<=8 and col<=8 : #goes top right if b[block] == '.' : vm.append(block) if b[block].islower() : vm.append(block) break if b[block].isupper(): break block+=9 row+=1 tcol+=1 row=int(pos[1])-1 tcol=col-1 block=num-9 while row>0 and tcol>1: #goes below left if b[block] == '.' : vm.append(block) if b[block].islower() : vm.append(block) break if b[block].isupper(): break block-=9 row-=1 tcol-=1 row=int(pos[1])-1 tcol=col+1 block =num-7 while tcol<=8 and row>1: #goes below right if b[block] == '.' : vm.append(block) if b[block].islower() : vm.append(block) break if b[block].isupper(): break block-=7 tcol+=1 row-=1 block =num+7 tcol=col-1 row=int(pos[1])+1 while tcol>0 and row<=8: #goes top left if b[block] == '.' : vm.append(block) if b[block].islower() : vm.append(block) break if b[block].upper(): break block+=7 tcol-=1 row+=1 move=[] for l in vm: move.append(numToAlg(l)) return move def queenMoves(pos): return rookMoves(pos) + bishopMoves(pos) def knightMoves(pos): num = conv(pos)-1 #num is index vm = [num-17,num-15,num-10,num-6,num+6,num+10,num+15,num+17] if vm[3]%8 in [0,1]: vm.pop(3) vm.pop(5) if vm[4]%8 in [6,7]: vm.pop(4) vm.pop(2) tvm=[] for i in vm: if (i>=0 and i<=63) and not ((b[num].isupper and b[i].isupper()) or (b[num].islower and b[i].islower())) : tvm.append(i) move=[] for l in tvm: move.append(numToAlg(l)) return move def kingMoves(pos): num = conv(pos)-1 #num is index vm = [num+8,num-8,num+9,num-9,num+7,num-7,num+1,num-1] if vm[2]%8==0: vm.pop(2) vm.pop(6) vm.pop(5) if vm[3]%8 ==7: vm.pop(3) vm.pop(-1) vm.pop(4) tvm=[] for i in vm: if (i>=0 and i<=63) and not ((b[num].isupper and b[i].isupper()) or (b[num].islower and b[i].islower())) : tvm.append(i) move=[] for l in tvm: move.append(numToAlg(l)) return move def pawnMoves(pos): num = conv(pos)-1 vm=[] if b[num].islower() : if b[num+8] =='.':vm.append(num+8) if b[num+9].isupper() : vm.append(num+9) if b[num+7].isupper() : vm.append(num+7) if b[num+16] =='.' and 7<num<16 : vm.append(num+16) if b[num].isupper() : if b[num-8] =='.':vm.append(num-8) if b[num-9].islower() : vm.append(num-9) if b[num-7].islower() : vm.append(num-7) if b[num-16] =='.' and 7<num<16 : vm.append(num-16) list =[] for i in vm: list.append(numToAlg(i)) return list def moves(pos): num = conv(pos)-1 if b[num].lower() =='k': return(kingMoves(pos)) elif b[num].lower() == 'q': return(queenMoves(pos)) elif b[num].lower() == 'p': return(pawnMoves(pos)) elif b[num].lower() == 'r': return(rookMoves(pos)) elif b[num].lower() == 'b': return(bishopMoves(pos)) elif b[num].lower() == 'n': return(knightMoves(pos)) def isCheck(pos): num = conv(pos)-1 r = rookMoves(pos) b = bishopMoves(pos) n = knightMoves(pos) check = False for rcase in r: if b[conv(rcase)-1].lower() in ['r','q'] and ( (b[num].islower() and b[conv(rcase)-1].isupper()) or (b[num].isupper() and b[conv(rcase)-1].islower()) ) : check=True for bcase in r: if b[conv(bcase)-1].lower() in ['b','q'] and ( (b[num].islower() and b[conv(rcase)-1].isupper()) or (b[num].isupper() and b[conv(rcase)-1].islower()) ): check=True for kcas in r: if b[conv(bcase)-1].lower()=='n' and ( (b[num].islower() and b[conv(rcase)-1].isupper()) or (b[num].isupper() and b[conv(rcase)-1].islower()) ): check=True return check def numToAlg(ind): alp=(ind+1)%8 n=((ind+1)//8) + 1 if alp==0: n-=1 a = {0:'h',1 : 'a' , 2:'b',3:'c',4:'d',5:'e',6:'f',7:'g',8:'h'} return str(a[alp]) + str(n)
b = 'r n b q k b n r p p p p p p p p'.split(' ') + ['.'] * 32 + 'p p p p p p p p r n b q k b n r'.upper().split(' ') def new_board(): b = 'r n b q k b n r p p p p p p p p'.split(' ') + ['.'] * 32 + 'p p p p p p p p r n b q k b n r'.upper().split(' ') def display(): (c, k) = (1, 0) ap = range(1, 9)[::-1] (row, col) = ([], []) for i in b: row.append(i) if c == 8: c = 0 col.append(row) row = [] c += 1 for j in col[::-1]: print(ap[k], ' |', end=' ') for i in j: print(i, end=' ') print() k += 1 print(' ', end='') print('-' * 18, ' A B C D E F G H', sep='\n') def move(fr, to): fnum = conv(fr) - 1 tnum = conv(to) - 1 (b[fnum], b[tnum]) = ('.', b[fnum]) display() def conv(s): num = int(s[1]) alp = s[0] a = {'a': 1, 'b': 2, 'c': 3, 'd': 4, 'e': 5, 'f': 6, 'g': 7, 'h': 8} alpn = a[alp] return (num - 1) * 8 + alpn def rook_valid(fr, to): fnum = conv(fr) - 1 tnum = conv(to) - 1 (con1, con2, con3) = (False, False, False) if abs(fnum - tnum) % 8 == 0: con1 = True rows = [range(0, 8), range(8, 16), range(16, 24), range(24, 32), range(32, 40), range(40, 48), range(48, 56), range(56, 64)] for k in rows: if fnum in k and tnum in k: con2 = True if con2: for l in range(fnum + 1, tnum): if b[l] != '.': con2 = False mi = min(fnum, tnum) ma = max(fnum, tnum) if con1: while mi < ma: mi += 8 if b[mi] != '.': con1 = False if b[fnum].isupper() and (not b[tnum].isupper()) or (b[fnum].islower() and (not b[tnum].islower())): con3 = True return (con1 or con2) and con3 def king_valid(fr, to): fnum = conv(fr) - 1 tnum = conv(to) - 1 if not address_valid(fnum, tnum): return False (con1, con2) = (False, False) if fnum % 8 != 0 and fnum % 9 != 0: val = [fnum + 1, fnum - 1, fnum + 8, fnum - 8] elif fnum % 8 == 0: val = [fnum + 8, fnum - 8, fnum - 1] else: val = [fnum + 8, fnum - 8, fnum + 1] if fnum in val: con = True if b[fnum].isupper() and (not b[tnum].isupper()) or (b[fnum].islower() and (not b[tnum].islower())): con2 = True return con1 and con2 def pawn_valid(fr, to): fnum = conv(fr) - 1 tnum = conv(to) - 1 if not address_valid(fnum, tnum): return False if fr.isupper(): c = 'b' if fr.islower(): c = 'w' if c == 'w': if fr in range(8, 16): vm = [fnum + 8, fnum + 16] else: vm = [fnum + 8] if b[fnum + 7].isupper(): vm.append(fnum + 7) if b[fnum + 9].isupper(): vm.append(fnum + 9) if tnum in vm and (not b[tnum].islower()): return True else: return False if c == 'b': if fr in range(48, 56): vm = [fnum - 8, fnum - 16] else: vm = [fnum - 8] if b[fnum - 7].islower(): vm.append(fnum + 7) if b[fnum - 9].islower(): vm.append(fnum + 9) if tnum in vm and (not b[tnum].isupper()): return True else: return False def bishop_valid(fr, to): fnum = conv(fr) - 1 tnum = conv(to) - 1 if not address_valid(fnum, tnum): return False con1 = False if abs(fnum - tnum) % 9 == 0 or abs(fnum - tnum) % 7 == 0: con1 = True if (fnum - tnum) % 9 == 0: while fnum != tnum: tnum += 9 if b[tnum] != '.': return False if (fnum - tnum) % 7 == 0: while fnum != tnum: tnum += 7 if b[tnum] != '.': return False if (tnum - fnum) % 9 == 0: while tnum != fnum: fnum += 9 if b[fnum] != '.': return False if (tnum - fnum) % 7 == 0: while tnum != fnum: fnum += 7 if b[fnum] != '.': return False if b[fnum].isupper() and (not b[tnum].isupper()) or (b[fnum].islower() and (not b[tnum].islower())): con2 = True return con1 and con2 def queen_valid(fr, to): fnum = conv(fr) - 1 tnum = conv(to) - 1 if not address_valid(fnum, tnum): return False return bishop_valid(fr, to) or rook_valid(fr, to) def knight_valid(fr, to): fnum = conv(fr) - 1 tnum = conv(to) - 1 if not address_valid(fnum, tnum): return False if tnum in [fnum + 17, fnum - 17, fnum + 15, fnum - 15, fnum + 10, fnum - 6, fnum + 6, fnum - 10]: con1 = True if b[fnum].isupper() and (not b[tnum].isupper()) or (b[fnum].islower() and (not b[tnum].islower())): con2 = True return con1 and con2 def address_valid(fnum, tnum): return 0 <= fnum < 64 and 0 <= tnum < 64 def rook_moves(pos): num = conv(pos) - 1 if b[num].isupper(): c = 'b' elif b[num].islower(): c = 'w' else: return 'Block is empty' vm = [] col = (num + 1) % 8 if col == 0: col = 8 row = int(pos[1]) if c == 'w': block = num + 8 while row <= 8: if b[block] == '.': vm.append(block) if b[block].isupper(): vm.append(block) break if b[block].islower(): break block += 8 row += 1 row = int(pos[1]) block = num - 8 while row > 0: if b[block] == '.': vm.append(block) if b[block].isupper(): vm.append(block) break if b[block].islower(): break block -= 8 row -= 1 tcol = col + 1 block = num + 1 while tcol <= 8: if b[block] == '.': vm.append(block) if b[block].isupper(): vm.append(block) break if b[block].islower(): break block += 1 tcol += 1 block = num - 1 tcol = col while tcol > 1: if b[block] == '.': vm.append(block) if b[block].isupper(): vm.append(block) break if b[block].islower(): break block -= 1 tcol -= 1 tcol = col row = int(pos[1]) if c == 'b': block = num + 8 while row <= 8: if b[block] == '.': vm.append(block) if b[block].islower(): vm.append(block) break if b[block].isupper(): break block += 8 row += 1 row = int(pos[1]) block = num - 8 while row > 1: if b[block] == '.': vm.append(block) if b[block].islower(): vm.append(block) break if b[block].isupper(): break block -= 8 row -= 1 tcol = col + 1 block = num + 1 while tcol <= 8: if b[block] == '.': vm.append(block) if b[block].islower(): vm.append(block) break if b[block].isupper(): break block += 1 tcol += 1 block = num - 1 tcol = col while tcol > 1: if b[block] == '.': vm.append(block) if b[block].islower(): vm.append(block) break if b[block].isupper(): break block -= 1 tcol -= 1 move = [] for l in vm: move.append(num_to_alg(l)) return move def bishop_moves(pos): num = conv(pos) - 1 if b[num].isupper(): c = 'b' elif b[num].islower(): c = 'w' else: return 'Block is empty' vm = [] col = (num + 1) % 8 if col == 0: col = 8 row = int(pos[1]) + 1 if c == 'w': tcol = col + 1 row = int(pos[1]) + 1 block = num + 9 while row <= 8 and col <= 8: if b[block] == '.': vm.append(block) if b[block].isupper(): vm.append(block) break if b[block].islower(): break block += 9 row += 1 tcol += 1 row = int(pos[1]) - 1 tcol = col - 1 block = num - 9 while row > 0 and tcol > 1: if b[block] == '.': vm.append(block) if b[block].isupper(): vm.append(block) break if b[block].islower(): break block -= 9 row -= 1 tcol -= 1 row = int(pos[1]) - 1 tcol = col + 1 block = num - 7 while tcol <= 8 and row > 1: if b[block] == '.': vm.append(block) if b[block].isupper(): vm.append(block) break if b[block].islower(): break block -= 7 tcol += 1 row -= 1 block = num + 7 tcol = col - 1 row = int(pos[1]) + 1 while tcol > 0 and row <= 8: if b[block] == '.': vm.append(block) if b[block].isupper(): vm.append(block) break if b[block].islower(): break block += 7 tcol -= 1 row += 1 if c == 'b': tcol = col + 1 row = int(pos[1]) + 1 block = num + 9 while row <= 8 and col <= 8: if b[block] == '.': vm.append(block) if b[block].islower(): vm.append(block) break if b[block].isupper(): break block += 9 row += 1 tcol += 1 row = int(pos[1]) - 1 tcol = col - 1 block = num - 9 while row > 0 and tcol > 1: if b[block] == '.': vm.append(block) if b[block].islower(): vm.append(block) break if b[block].isupper(): break block -= 9 row -= 1 tcol -= 1 row = int(pos[1]) - 1 tcol = col + 1 block = num - 7 while tcol <= 8 and row > 1: if b[block] == '.': vm.append(block) if b[block].islower(): vm.append(block) break if b[block].isupper(): break block -= 7 tcol += 1 row -= 1 block = num + 7 tcol = col - 1 row = int(pos[1]) + 1 while tcol > 0 and row <= 8: if b[block] == '.': vm.append(block) if b[block].islower(): vm.append(block) break if b[block].upper(): break block += 7 tcol -= 1 row += 1 move = [] for l in vm: move.append(num_to_alg(l)) return move def queen_moves(pos): return rook_moves(pos) + bishop_moves(pos) def knight_moves(pos): num = conv(pos) - 1 vm = [num - 17, num - 15, num - 10, num - 6, num + 6, num + 10, num + 15, num + 17] if vm[3] % 8 in [0, 1]: vm.pop(3) vm.pop(5) if vm[4] % 8 in [6, 7]: vm.pop(4) vm.pop(2) tvm = [] for i in vm: if (i >= 0 and i <= 63) and (not (b[num].isupper and b[i].isupper() or (b[num].islower and b[i].islower()))): tvm.append(i) move = [] for l in tvm: move.append(num_to_alg(l)) return move def king_moves(pos): num = conv(pos) - 1 vm = [num + 8, num - 8, num + 9, num - 9, num + 7, num - 7, num + 1, num - 1] if vm[2] % 8 == 0: vm.pop(2) vm.pop(6) vm.pop(5) if vm[3] % 8 == 7: vm.pop(3) vm.pop(-1) vm.pop(4) tvm = [] for i in vm: if (i >= 0 and i <= 63) and (not (b[num].isupper and b[i].isupper() or (b[num].islower and b[i].islower()))): tvm.append(i) move = [] for l in tvm: move.append(num_to_alg(l)) return move def pawn_moves(pos): num = conv(pos) - 1 vm = [] if b[num].islower(): if b[num + 8] == '.': vm.append(num + 8) if b[num + 9].isupper(): vm.append(num + 9) if b[num + 7].isupper(): vm.append(num + 7) if b[num + 16] == '.' and 7 < num < 16: vm.append(num + 16) if b[num].isupper(): if b[num - 8] == '.': vm.append(num - 8) if b[num - 9].islower(): vm.append(num - 9) if b[num - 7].islower(): vm.append(num - 7) if b[num - 16] == '.' and 7 < num < 16: vm.append(num - 16) list = [] for i in vm: list.append(num_to_alg(i)) return list def moves(pos): num = conv(pos) - 1 if b[num].lower() == 'k': return king_moves(pos) elif b[num].lower() == 'q': return queen_moves(pos) elif b[num].lower() == 'p': return pawn_moves(pos) elif b[num].lower() == 'r': return rook_moves(pos) elif b[num].lower() == 'b': return bishop_moves(pos) elif b[num].lower() == 'n': return knight_moves(pos) def is_check(pos): num = conv(pos) - 1 r = rook_moves(pos) b = bishop_moves(pos) n = knight_moves(pos) check = False for rcase in r: if b[conv(rcase) - 1].lower() in ['r', 'q'] and (b[num].islower() and b[conv(rcase) - 1].isupper() or (b[num].isupper() and b[conv(rcase) - 1].islower())): check = True for bcase in r: if b[conv(bcase) - 1].lower() in ['b', 'q'] and (b[num].islower() and b[conv(rcase) - 1].isupper() or (b[num].isupper() and b[conv(rcase) - 1].islower())): check = True for kcas in r: if b[conv(bcase) - 1].lower() == 'n' and (b[num].islower() and b[conv(rcase) - 1].isupper() or (b[num].isupper() and b[conv(rcase) - 1].islower())): check = True return check def num_to_alg(ind): alp = (ind + 1) % 8 n = (ind + 1) // 8 + 1 if alp == 0: n -= 1 a = {0: 'h', 1: 'a', 2: 'b', 3: 'c', 4: 'd', 5: 'e', 6: 'f', 7: 'g', 8: 'h'} return str(a[alp]) + str(n)
#!/usr/bin/env python3 print("""\ Usage: thingy [OPTIONS] -h Display this usage message -H hostname Hostname to connect to """)
print('Usage: thingy [OPTIONS]\n -h Display this usage message\n -H hostname Hostname to connect to\n')
tree_count, tree_hinput, tree_chosen = int(input()), input().split(), 0 tree_height = [int(x) for x in tree_hinput] for each_tree in range(tree_count): if each_tree==0 and tree_height[0]>tree_height[1]:tree_chosen+=1 elif each_tree==tree_count-1 and tree_height[each_tree]>tree_height[each_tree-1]:tree_chosen+=1 elif tree_height[each_tree-1]<tree_height[each_tree]>tree_height[each_tree+1]:tree_chosen+=1 print(tree_chosen) # Passed
(tree_count, tree_hinput, tree_chosen) = (int(input()), input().split(), 0) tree_height = [int(x) for x in tree_hinput] for each_tree in range(tree_count): if each_tree == 0 and tree_height[0] > tree_height[1]: tree_chosen += 1 elif each_tree == tree_count - 1 and tree_height[each_tree] > tree_height[each_tree - 1]: tree_chosen += 1 elif tree_height[each_tree - 1] < tree_height[each_tree] > tree_height[each_tree + 1]: tree_chosen += 1 print(tree_chosen)
# Create the DMatrix: housing_dmatrix housing_dmatrix = xgb.DMatrix(data=X, label=y) # Create the parameter dictionary: params params = {'objective':'reg:linear', 'max_depth':4} # Train the model: xg_reg xg_reg = xgb.train(dtrain=housing_dmatrix, params=params, num_boost_round=10) # Plot the feature importances xgb.plot_importance(xg_reg) plt.show()
housing_dmatrix = xgb.DMatrix(data=X, label=y) params = {'objective': 'reg:linear', 'max_depth': 4} xg_reg = xgb.train(dtrain=housing_dmatrix, params=params, num_boost_round=10) xgb.plot_importance(xg_reg) plt.show()
# -*- encoding:utf-8 -*- impar = lambda n : 2 * n - 1 header = """ Demostrar que es cierto: 1 + 3 + 5 + ... + (2*n)-1 = n ^ 2 Luego con este programa se busca probar dicha afirmacion. """ def suma_impares(n): suma = 0 for i in range(1, n+1): suma += impar(i) return suma def main(): print(header) num = int(input('Numero: ')) suma = suma_impares(num) cuadrado = num ** 2 print('Suma de los ', num, ' primeros impares = ', suma) print('Cuadrado del numero: ', cuadrado) if suma == cuadrado: print('Son iguales, luego se cumple la afirmacion') else: print('No son iguales, luego no se cumple la afirmacion') if __name__ == '__main__': main()
impar = lambda n: 2 * n - 1 header = '\n\tDemostrar que es cierto:\n\n\t1 + 3 + 5 + ... + (2*n)-1 = n ^ 2\n\t\n\tLuego con este programa se busca probar dicha afirmacion.\n' def suma_impares(n): suma = 0 for i in range(1, n + 1): suma += impar(i) return suma def main(): print(header) num = int(input('Numero: ')) suma = suma_impares(num) cuadrado = num ** 2 print('Suma de los ', num, ' primeros impares = ', suma) print('Cuadrado del numero: ', cuadrado) if suma == cuadrado: print('Son iguales, luego se cumple la afirmacion') else: print('No son iguales, luego no se cumple la afirmacion') if __name__ == '__main__': main()
#!/usr/bin/env python def bubble_search_func(data_list): cnt_num_all = len(data_list) for i in range(cnt_num_all-1): for j in range(1,cnt_num_all-i): if(data_list[j-1]>data_list[j]): data_list[j-1],data_list[j]=data_list[j],data_list[j-1] data_list = [54, 25, 93, 17, 77, 31, 44, 55, 20, 10] bubble_search_func(data_list) print(data_list)
def bubble_search_func(data_list): cnt_num_all = len(data_list) for i in range(cnt_num_all - 1): for j in range(1, cnt_num_all - i): if data_list[j - 1] > data_list[j]: (data_list[j - 1], data_list[j]) = (data_list[j], data_list[j - 1]) data_list = [54, 25, 93, 17, 77, 31, 44, 55, 20, 10] bubble_search_func(data_list) print(data_list)
entries = [ { 'env-title': 'atari-enduro', 'score': 207.47, }, { 'env-title': 'atari-space-invaders', 'score': 459.89, }, { 'env-title': 'atari-qbert', 'score': 7184.73, }, { 'env-title': 'atari-seaquest', 'score': 1383.38, }, { 'env-title': 'atari-pong', 'score': 13.9, }, { 'env-title': 'atari-beam-rider', 'score': 594.45, }, { 'env-title': 'atari-breakout', 'score': 81.61, }, ]
entries = [{'env-title': 'atari-enduro', 'score': 207.47}, {'env-title': 'atari-space-invaders', 'score': 459.89}, {'env-title': 'atari-qbert', 'score': 7184.73}, {'env-title': 'atari-seaquest', 'score': 1383.38}, {'env-title': 'atari-pong', 'score': 13.9}, {'env-title': 'atari-beam-rider', 'score': 594.45}, {'env-title': 'atari-breakout', 'score': 81.61}]
class Solution: def diStringMatch(self, S): low,high=0,len(S) ans=[] for i in S: if i=="I": ans.append(low) low+=1 else: ans.append(high) high-=1 return ans +[low]
class Solution: def di_string_match(self, S): (low, high) = (0, len(S)) ans = [] for i in S: if i == 'I': ans.append(low) low += 1 else: ans.append(high) high -= 1 return ans + [low]
def main() -> None: s = input() print(s * (6 // len(s))) if __name__ == "__main__": main()
def main() -> None: s = input() print(s * (6 // len(s))) if __name__ == '__main__': main()
def get_next_target(page): start_link = page.find('<a href=') if start_link == -1: return None,0 else: start_quote = page.find('"', start_link) end_quote = page.find('"', start_quote + 1) url = page[start_quote + 1:end_quote] return url, end_quote
def get_next_target(page): start_link = page.find('<a href=') if start_link == -1: return (None, 0) else: start_quote = page.find('"', start_link) end_quote = page.find('"', start_quote + 1) url = page[start_quote + 1:end_quote] return (url, end_quote)
def test_socfaker_application_status(socfaker_fixture): assert socfaker_fixture.application.status in ['Active', 'Inactive', 'Legacy'] def test_socfaker_application_account_status(socfaker_fixture): assert socfaker_fixture.application.account_status in ['Enabled', 'Disabled'] def test_socfaker_name(socfaker_fixture): assert socfaker_fixture.application.name def test_socfaker_application_logon_timestamp(socfaker_fixture): assert socfaker_fixture.application.logon_timestamp
def test_socfaker_application_status(socfaker_fixture): assert socfaker_fixture.application.status in ['Active', 'Inactive', 'Legacy'] def test_socfaker_application_account_status(socfaker_fixture): assert socfaker_fixture.application.account_status in ['Enabled', 'Disabled'] def test_socfaker_name(socfaker_fixture): assert socfaker_fixture.application.name def test_socfaker_application_logon_timestamp(socfaker_fixture): assert socfaker_fixture.application.logon_timestamp
_base_ = [ '../_base_/models/retinanet_r50_fpn.py', '../_base_/datasets/bdd100k_detection.py', '../_base_/schedules/schedule_1x.py', '../_base_/default_runtime.py' ] # optimizer optimizer = dict(type='SGD', lr=0.01, momentum=0.9, weight_decay=0.0001) # model model = dict( bbox_head=dict( num_classes=10, # bdd100k class number ) ) # data loader data = dict( samples_per_gpu=4, # TODO samples pre gpu workers_per_gpu=2, )
_base_ = ['../_base_/models/retinanet_r50_fpn.py', '../_base_/datasets/bdd100k_detection.py', '../_base_/schedules/schedule_1x.py', '../_base_/default_runtime.py'] optimizer = dict(type='SGD', lr=0.01, momentum=0.9, weight_decay=0.0001) model = dict(bbox_head=dict(num_classes=10)) data = dict(samples_per_gpu=4, workers_per_gpu=2)
# Definition for a binary tree node. class TreeNode(object): def __init__(self, x): self.val = x self.left = None self.right = None class Solution(object): def buildTree(self, inorder, postorder): """ :type preorder: List[int] :type inorder: List[int] :rtype: TreeNode """ def buildChildTree(inIndex, postIndex, length): if length == 0: return None root = TreeNode(postorder[postIndex]) count = 0 while inorder[inIndex+count] != postorder[postIndex]: count += 1 root.left = buildChildTree(inIndex, postIndex-length+count, count) root.right = buildChildTree(inIndex+count+1, postIndex-1, length-count-1) return root return buildChildTree(0, len(postorder)-1, len(postorder))
class Treenode(object): def __init__(self, x): self.val = x self.left = None self.right = None class Solution(object): def build_tree(self, inorder, postorder): """ :type preorder: List[int] :type inorder: List[int] :rtype: TreeNode """ def build_child_tree(inIndex, postIndex, length): if length == 0: return None root = tree_node(postorder[postIndex]) count = 0 while inorder[inIndex + count] != postorder[postIndex]: count += 1 root.left = build_child_tree(inIndex, postIndex - length + count, count) root.right = build_child_tree(inIndex + count + 1, postIndex - 1, length - count - 1) return root return build_child_tree(0, len(postorder) - 1, len(postorder))
class InterfaceWriter(object): def __init__(self, output_path): self._output_path_template = output_path + '/_{key}_{subsystem}.i' self._fp = { 'pre': {}, 'post': {}, } def _write(self, key, subsystem, text): subsystem = subsystem.lower() fp = self._fp[key].get(subsystem) if fp is None: self._fp[key][subsystem] = fp = open(self._output_path_template.format(key=key, subsystem=subsystem), 'w+') fp.write(text) fp.write('\n') def write_pre(self, subsystem, text): self._write('pre', subsystem, text) def write_post(self, subsystem, text): self._write('post', subsystem, text) def close(self): for fp_map in self._fp.values(): for fp in fp_map.values(): fp.close()
class Interfacewriter(object): def __init__(self, output_path): self._output_path_template = output_path + '/_{key}_{subsystem}.i' self._fp = {'pre': {}, 'post': {}} def _write(self, key, subsystem, text): subsystem = subsystem.lower() fp = self._fp[key].get(subsystem) if fp is None: self._fp[key][subsystem] = fp = open(self._output_path_template.format(key=key, subsystem=subsystem), 'w+') fp.write(text) fp.write('\n') def write_pre(self, subsystem, text): self._write('pre', subsystem, text) def write_post(self, subsystem, text): self._write('post', subsystem, text) def close(self): for fp_map in self._fp.values(): for fp in fp_map.values(): fp.close()
# Format of training prompt defaultPrompt = """I am a Cardiologist. My patient asked me what this means: Input: Normal left ventricular size and systolic function. EF > 55 %. Normal right ventricular size and systolic function. Normal valve structure and function Output: Normal pumping function of the left and right side of the heart. Heart valves are normal - Input: {} Output:"""
default_prompt = 'I am a Cardiologist. My patient asked me what this means:\n\nInput: Normal left ventricular size and systolic function. EF > 55 %. Normal right ventricular size and systolic function. Normal valve structure and function\n\nOutput: Normal pumping function of the left and right side of the heart. Heart valves are normal\n\n-\n\nInput: {}\n\nOutput:'
abilities = {1: 'Stench', 2: 'Drizzle', 3: 'Speed Boost', 4: 'Battle Armor', 5: 'Sturdy', 6: 'Damp', 7: 'Limber', 8: 'Sand Veil', 9: 'Static', 10: 'Volt Absorb', 11: 'Water Absorb', 12: 'Oblivious', 13: 'Cloud Nine', 14: 'Compound Eyes', 15: 'Insomnia', 16: 'Color Change', 17: 'Immunity', 18: 'Flash Fire', 19: 'Shield Dust', 20: 'Own Tempo', 21: 'Suction Cups', 22: 'Intimidate', 23: 'Shadow Tag', 24: 'Rough Skin', 25: 'Wonder Guard', 26: 'Levitate', 27: 'Effect Spore', 28: 'Synchronize', 29: 'Clear Body', 30: 'Natural Cure', 31: 'Lightning Rod', 32: 'Serene Grace', 33: 'Swift Swim', 34: 'Chlorophyll', 35: 'Illuminate', 36: 'Trace', 37: 'Huge Power', 38: 'Poison Point', 39: 'Inner Focus', 40: 'Magma Armor', 41: 'Water Veil', 42: 'Magnet Pull', 43: 'Soundproof', 44: 'Rain Dish', 45: 'Sand Stream', 46: 'Pressure', 47: 'Thick Fat', 48: 'Early Bird', 49: 'Flame Body', 50: 'Run Away', 51: 'Keen Eye', 52: 'Hyper Cutter', 53: 'Pickup', 54: 'Truant', 55: 'Hustle', 56: 'Cute Charm', 57: 'Plus', 58: 'Minus', 59: 'Forecast', 60: 'Sticky Hold', 61: 'Shed Skin', 62: 'Guts', 63: 'Marvel Scale', 64: 'Liquid Ooze', 65: 'Overgrow', 66: 'Blaze', 67: 'Torrent', 68: 'Swarm', 69: 'Rock Head', 70: 'Drought', 71: 'Arena Trap', 72: 'Vital Spirit', 73: 'White Smoke', 74: 'Pure Power', 75: 'Shell Armor', 76: 'Air Lock', 77: 'Tangled Feet', 78: 'Motor Drive', 79: 'Rivalry', 80: 'Steadfast', 81: 'Snow Cloak', 82: 'Gluttony', 83: 'Anger Point', 84: 'Unburden', 85: 'Heatproof', 86: 'Simple', 87: 'Dry Skin', 88: 'Download', 89: 'Iron Fist', 90: 'Poison Heal', 91: 'Adaptability', 92: 'Skill Link', 93: 'Hydration', 94: 'Solar Power', 95: 'Quick Feet', 96: 'Normalize', 97: 'Sniper', 98: 'Magic Guard', 99: 'No Guard', 100: 'Stall', 101: 'Technician', 102: 'Leaf Guard', 103: 'Klutz', 104: 'Mold Breaker', 105: 'Super Luck', 106: 'Aftermath', 107: 'Anticipation', 108: 'Forewarn', 109: 'Unaware', 110: 'Tinted Lens', 111: 'Filter', 112: 'Slow Start', 113: 'Scrappy', 114: 'Storm Drain', 115: 'Ice Body', 116: 'Solid Rock', 117: 'Snow Warning', 118: 'Honey Gather', 119: 'Frisk', 120: 'Reckless', 121: 'Multitype', 122: 'Flower Gift', 123: 'Bad Dreams', 124: 'Pickpocket', 125: 'Sheer Force', 126: 'Contrary', 127: 'Unnerve', 128: 'Defiant', 129: 'Defeatist', 130: 'Cursed Body', 131: 'Healer', 132: 'Friend Guard', 133: 'Weak Armor', 134: 'Heavy Metal', 135: 'Light Metal', 136: 'Multiscale', 137: 'Toxic Boost', 138: 'Flare Boost', 139: 'Harvest', 140: 'Telepathy', 141: 'Moody', 142: 'Overcoat', 143: 'Poison Touch', 144: 'Regenerator', 145: 'Big Pecks', 146: 'Sand Rush', 147: 'Wonder Skin', 148: 'Analytic', 149: 'Illusion', 150: 'Imposter', 151: 'Infiltrator', 152: 'Mummy', 153: 'Moxie', 154: 'Justified', 155: 'Rattled', 156: 'Magic Bounce', 157: 'Sap Sipper', 158: 'Prankster', 159: 'Sand Force', 160: 'Iron Barbs', 161: 'Zen Mode', 162: 'Victory Star', 163: 'Turboblaze', 164: 'Teravolt', 165: 'Aroma Veil', 166: 'Flower Veil', 167: 'Cheek Pouch', 168: 'Protean', 169: 'Fur Coat', 170: 'Magician', 171: 'Bulletproof', 172: 'Competitive', 173: 'Strong Jaw', 174: 'Refrigerate', 175: 'Sweet Veil', 176: 'Stance Change', 177: 'Gale Wings', 178: 'Mega Launcher', 179: 'Grass Pelt', 180: 'Symbiosis', 181: 'Tough Claws', 182: 'Pixilate', 183: 'Gooey', 184: 'Aerilate', 185: 'Parental Bond', 186: 'Dark Aura', 187: 'Fairy Aura', 188: 'Aura Break', 189: 'Primordial Sea', 190: 'Desolate Land', 191: 'Delta Stream', 192: 'Stamina', 193: 'Wimp Out', 194: 'Emergency Exit', 195: 'Water Compaction', 196: 'Merciless', 197: 'Shields Down', 198: 'Stakeout', 199: 'Water Bubble', 200: 'Steelworker', 201: 'Berserk', 202: 'Slush Rush', 203: 'Long Reach', 204: 'Liquid Voice', 205: 'Triage', 206: 'Galvanize', 207: 'Surge Surfer', 208: 'Schooling', 209: 'Disguise', 210: 'Battle Bond', 211: 'Power Construct', 212: 'Corrosion', 213: 'Comatose', 214: 'Queenly Majesty', 215: 'Innards Out', 216: 'Dancer', 217: 'Battery', 218: 'Fluffy', 219: 'Dazzling', 220: 'Soul-Heart', 221: 'Tangling Hair', 222: 'Receiver', 223: 'Power of Alchemy', 224: 'Beast Boost', 225: 'RKS System', 226: 'Electric Surge', 227: 'Psychic Surge', 228: 'Misty Surge', 229: 'Grassy Surge', 230: 'Full Metal Body', 231: 'Shadow Shield', 232: 'Prism Armor', 233: 'Neuroforce', 234: 'Intrepid Sword', 235: 'Dauntless Shield', 236: 'Libero', 237: 'Ball Fetch', 238: 'Cotton Down', 239: 'Propeller Tail', 240: 'Mirror Armor', 241: 'Gulp Missile', 242: 'Stalwart', 243: 'Steam Engine', 244: 'Punk Rock', 245: 'Sand Spit', 246: 'Ice Scales', 247: 'Ripen', 248: 'Ice Face', 249: 'Power Spot', 250: 'Mimicry', 251: 'Screen Cleaner', 252: 'Steely Spirit', 253: 'Perish Body', 254: 'Wandering Spirit', 255: 'Gorilla Tactics', 256: 'Neutralizing Gas', 257: 'Pastel Veil', 258: 'Hunger Switch', 259: 'Quick Draw', 260: 'Unseen Fist', 261: 'Curious Medicine', 262: 'Transistor', 263: "Dragon's Maw", 264: 'Chilling Neigh', 265: 'Grim Neigh', 266: 'As One', 267: 'As One'}
abilities = {1: 'Stench', 2: 'Drizzle', 3: 'Speed Boost', 4: 'Battle Armor', 5: 'Sturdy', 6: 'Damp', 7: 'Limber', 8: 'Sand Veil', 9: 'Static', 10: 'Volt Absorb', 11: 'Water Absorb', 12: 'Oblivious', 13: 'Cloud Nine', 14: 'Compound Eyes', 15: 'Insomnia', 16: 'Color Change', 17: 'Immunity', 18: 'Flash Fire', 19: 'Shield Dust', 20: 'Own Tempo', 21: 'Suction Cups', 22: 'Intimidate', 23: 'Shadow Tag', 24: 'Rough Skin', 25: 'Wonder Guard', 26: 'Levitate', 27: 'Effect Spore', 28: 'Synchronize', 29: 'Clear Body', 30: 'Natural Cure', 31: 'Lightning Rod', 32: 'Serene Grace', 33: 'Swift Swim', 34: 'Chlorophyll', 35: 'Illuminate', 36: 'Trace', 37: 'Huge Power', 38: 'Poison Point', 39: 'Inner Focus', 40: 'Magma Armor', 41: 'Water Veil', 42: 'Magnet Pull', 43: 'Soundproof', 44: 'Rain Dish', 45: 'Sand Stream', 46: 'Pressure', 47: 'Thick Fat', 48: 'Early Bird', 49: 'Flame Body', 50: 'Run Away', 51: 'Keen Eye', 52: 'Hyper Cutter', 53: 'Pickup', 54: 'Truant', 55: 'Hustle', 56: 'Cute Charm', 57: 'Plus', 58: 'Minus', 59: 'Forecast', 60: 'Sticky Hold', 61: 'Shed Skin', 62: 'Guts', 63: 'Marvel Scale', 64: 'Liquid Ooze', 65: 'Overgrow', 66: 'Blaze', 67: 'Torrent', 68: 'Swarm', 69: 'Rock Head', 70: 'Drought', 71: 'Arena Trap', 72: 'Vital Spirit', 73: 'White Smoke', 74: 'Pure Power', 75: 'Shell Armor', 76: 'Air Lock', 77: 'Tangled Feet', 78: 'Motor Drive', 79: 'Rivalry', 80: 'Steadfast', 81: 'Snow Cloak', 82: 'Gluttony', 83: 'Anger Point', 84: 'Unburden', 85: 'Heatproof', 86: 'Simple', 87: 'Dry Skin', 88: 'Download', 89: 'Iron Fist', 90: 'Poison Heal', 91: 'Adaptability', 92: 'Skill Link', 93: 'Hydration', 94: 'Solar Power', 95: 'Quick Feet', 96: 'Normalize', 97: 'Sniper', 98: 'Magic Guard', 99: 'No Guard', 100: 'Stall', 101: 'Technician', 102: 'Leaf Guard', 103: 'Klutz', 104: 'Mold Breaker', 105: 'Super Luck', 106: 'Aftermath', 107: 'Anticipation', 108: 'Forewarn', 109: 'Unaware', 110: 'Tinted Lens', 111: 'Filter', 112: 'Slow Start', 113: 'Scrappy', 114: 'Storm Drain', 115: 'Ice Body', 116: 'Solid Rock', 117: 'Snow Warning', 118: 'Honey Gather', 119: 'Frisk', 120: 'Reckless', 121: 'Multitype', 122: 'Flower Gift', 123: 'Bad Dreams', 124: 'Pickpocket', 125: 'Sheer Force', 126: 'Contrary', 127: 'Unnerve', 128: 'Defiant', 129: 'Defeatist', 130: 'Cursed Body', 131: 'Healer', 132: 'Friend Guard', 133: 'Weak Armor', 134: 'Heavy Metal', 135: 'Light Metal', 136: 'Multiscale', 137: 'Toxic Boost', 138: 'Flare Boost', 139: 'Harvest', 140: 'Telepathy', 141: 'Moody', 142: 'Overcoat', 143: 'Poison Touch', 144: 'Regenerator', 145: 'Big Pecks', 146: 'Sand Rush', 147: 'Wonder Skin', 148: 'Analytic', 149: 'Illusion', 150: 'Imposter', 151: 'Infiltrator', 152: 'Mummy', 153: 'Moxie', 154: 'Justified', 155: 'Rattled', 156: 'Magic Bounce', 157: 'Sap Sipper', 158: 'Prankster', 159: 'Sand Force', 160: 'Iron Barbs', 161: 'Zen Mode', 162: 'Victory Star', 163: 'Turboblaze', 164: 'Teravolt', 165: 'Aroma Veil', 166: 'Flower Veil', 167: 'Cheek Pouch', 168: 'Protean', 169: 'Fur Coat', 170: 'Magician', 171: 'Bulletproof', 172: 'Competitive', 173: 'Strong Jaw', 174: 'Refrigerate', 175: 'Sweet Veil', 176: 'Stance Change', 177: 'Gale Wings', 178: 'Mega Launcher', 179: 'Grass Pelt', 180: 'Symbiosis', 181: 'Tough Claws', 182: 'Pixilate', 183: 'Gooey', 184: 'Aerilate', 185: 'Parental Bond', 186: 'Dark Aura', 187: 'Fairy Aura', 188: 'Aura Break', 189: 'Primordial Sea', 190: 'Desolate Land', 191: 'Delta Stream', 192: 'Stamina', 193: 'Wimp Out', 194: 'Emergency Exit', 195: 'Water Compaction', 196: 'Merciless', 197: 'Shields Down', 198: 'Stakeout', 199: 'Water Bubble', 200: 'Steelworker', 201: 'Berserk', 202: 'Slush Rush', 203: 'Long Reach', 204: 'Liquid Voice', 205: 'Triage', 206: 'Galvanize', 207: 'Surge Surfer', 208: 'Schooling', 209: 'Disguise', 210: 'Battle Bond', 211: 'Power Construct', 212: 'Corrosion', 213: 'Comatose', 214: 'Queenly Majesty', 215: 'Innards Out', 216: 'Dancer', 217: 'Battery', 218: 'Fluffy', 219: 'Dazzling', 220: 'Soul-Heart', 221: 'Tangling Hair', 222: 'Receiver', 223: 'Power of Alchemy', 224: 'Beast Boost', 225: 'RKS System', 226: 'Electric Surge', 227: 'Psychic Surge', 228: 'Misty Surge', 229: 'Grassy Surge', 230: 'Full Metal Body', 231: 'Shadow Shield', 232: 'Prism Armor', 233: 'Neuroforce', 234: 'Intrepid Sword', 235: 'Dauntless Shield', 236: 'Libero', 237: 'Ball Fetch', 238: 'Cotton Down', 239: 'Propeller Tail', 240: 'Mirror Armor', 241: 'Gulp Missile', 242: 'Stalwart', 243: 'Steam Engine', 244: 'Punk Rock', 245: 'Sand Spit', 246: 'Ice Scales', 247: 'Ripen', 248: 'Ice Face', 249: 'Power Spot', 250: 'Mimicry', 251: 'Screen Cleaner', 252: 'Steely Spirit', 253: 'Perish Body', 254: 'Wandering Spirit', 255: 'Gorilla Tactics', 256: 'Neutralizing Gas', 257: 'Pastel Veil', 258: 'Hunger Switch', 259: 'Quick Draw', 260: 'Unseen Fist', 261: 'Curious Medicine', 262: 'Transistor', 263: "Dragon's Maw", 264: 'Chilling Neigh', 265: 'Grim Neigh', 266: 'As One', 267: 'As One'}
STRICTDOC_GRAMMAR = r""" Document[noskipws]: '[DOCUMENT]' '\n' // NAME: is deprecated. Both documents and sections now have TITLE:. (('NAME: ' name = /.*$/ '\n') | ('TITLE: ' title = /.*$/ '\n')?) (config = DocumentConfig)? ('\n' grammar = DocumentGrammar)? free_texts *= SpaceThenFreeText section_contents *= SectionOrRequirement ; ReservedKeyword[noskipws]: 'DOCUMENT' | 'GRAMMAR' ; DocumentGrammar[noskipws]: '[GRAMMAR]' '\n' 'ELEMENTS:' '\n' elements += GrammarElement ; GrammarElement[noskipws]: '- TAG: ' tag = RequirementType '\n' ' FIELDS:' '\n' fields += GrammarElementField ; GrammarElementField[noskipws]: GrammarElementFieldString | GrammarElementFieldSingleChoice | GrammarElementFieldMultipleChoice | GrammarElementFieldTag ; GrammarElementFieldString[noskipws]: ' - TITLE: ' title=FieldName '\n' ' TYPE: String' '\n' ' REQUIRED: ' (required = BooleanChoice) '\n' ; GrammarElementFieldSingleChoice[noskipws]: ' - TITLE: ' title=FieldName '\n' ' TYPE: SingleChoice' '(' ((options = ChoiceOption) (options *= ChoiceOptionXs)) ')' '\n' ' REQUIRED: ' (required = BooleanChoice) '\n' ; GrammarElementFieldMultipleChoice[noskipws]: ' - TITLE: ' title=FieldName '\n' ' TYPE: MultipleChoice' '(' ((options = ChoiceOption) (options *= ChoiceOptionXs)) ')' '\n' ' REQUIRED: ' (required = BooleanChoice) '\n' ; GrammarElementFieldTag[noskipws]: ' - TITLE: ' title=FieldName '\n' ' TYPE: Tag' '\n' ' REQUIRED: ' (required = BooleanChoice) '\n' ; BooleanChoice[noskipws]: ('True' | 'False') ; DocumentConfig[noskipws]: ('VERSION: ' version = /.*$/ '\n')? ('NUMBER: ' number = /.*$/ '\n')? ('OPTIONS:' '\n' (' MARKUP: ' (markup = MarkupChoice) '\n')? (' AUTO_LEVELS: ' (auto_levels = AutoLevelsChoice) '\n')? )? ; MarkupChoice[noskipws]: 'RST' | 'Text' | 'HTML' ; AutoLevelsChoice[noskipws]: 'On' | 'Off' ; Section[noskipws]: '[SECTION]' '\n' ('UID: ' uid = /.+$/ '\n')? ('LEVEL: ' level = /.*/ '\n')? 'TITLE: ' title = /.*$/ '\n' free_texts *= SpaceThenFreeText section_contents *= SectionOrRequirement '\n' '[/SECTION]' '\n' ; SectionOrRequirement[noskipws]: '\n' (Section | Requirement | CompositeRequirement) ; SpaceThenRequirement[noskipws]: '\n' (Requirement | CompositeRequirement) ; SpaceThenFreeText[noskipws]: '\n' (FreeText) ; ReservedKeyword[noskipws]: 'DOCUMENT' | 'GRAMMAR' | 'SECTION' | 'FREETEXT' ; Requirement[noskipws]: '[' !CompositeRequirementTagName requirement_type = RequirementType ']' '\n' fields *= RequirementField ; CompositeRequirementTagName[noskipws]: 'COMPOSITE_' ; RequirementType[noskipws]: !ReservedKeyword /[A-Z]+(_[A-Z]+)*/ ; RequirementField[noskipws]: ( field_name = 'REFS' ':' '\n' (field_value_references += Reference) ) | ( field_name = FieldName ':' ( ((' ' field_value = SingleLineString | field_value = '') '\n') | (' ' (field_value_multiline = MultiLineString) '\n') ) ) ; CompositeRequirement[noskipws]: '[COMPOSITE_' requirement_type = RequirementType ']' '\n' fields *= RequirementField requirements *= SpaceThenRequirement '\n' '[/COMPOSITE_REQUIREMENT]' '\n' ; ChoiceOption[noskipws]: /[\w\/-]+( *[\w\/-]+)*/ ; ChoiceOptionXs[noskipws]: /, /- ChoiceOption ; RequirementStatus[noskipws]: 'Draft' | 'Active' | 'Deleted'; RequirementComment[noskipws]: 'COMMENT: ' ( comment_single = SingleLineString | comment_multiline = MultiLineString ) '\n' ; FreeText[noskipws]: '[FREETEXT]' '\n' parts+=TextPart FreeTextEnd ; FreeTextEnd: /^/ '[/FREETEXT]' '\n'; TextPart[noskipws]: (InlineLink | NormalString) ; NormalString[noskipws]: (!SpecialKeyword !FreeTextEnd /(?ms)./)* ; SpecialKeyword: InlineLinkStart // more keywords are coming later ; InlineLinkStart: '[LINK: '; InlineLink[noskipws]: InlineLinkStart value = /[^\]]*/ ']' ; """
strictdoc_grammar = "\nDocument[noskipws]:\n '[DOCUMENT]' '\\n'\n // NAME: is deprecated. Both documents and sections now have TITLE:.\n (('NAME: ' name = /.*$/ '\\n') | ('TITLE: ' title = /.*$/ '\\n')?)\n (config = DocumentConfig)?\n ('\\n' grammar = DocumentGrammar)?\n free_texts *= SpaceThenFreeText\n section_contents *= SectionOrRequirement\n;\n\nReservedKeyword[noskipws]:\n 'DOCUMENT' | 'GRAMMAR'\n;\n\nDocumentGrammar[noskipws]:\n '[GRAMMAR]' '\\n'\n 'ELEMENTS:' '\\n'\n elements += GrammarElement\n;\n\nGrammarElement[noskipws]:\n '- TAG: ' tag = RequirementType '\\n'\n ' FIELDS:' '\\n'\n fields += GrammarElementField\n;\n\nGrammarElementField[noskipws]:\n GrammarElementFieldString |\n GrammarElementFieldSingleChoice |\n GrammarElementFieldMultipleChoice |\n GrammarElementFieldTag\n;\n\nGrammarElementFieldString[noskipws]:\n ' - TITLE: ' title=FieldName '\\n'\n ' TYPE: String' '\\n'\n ' REQUIRED: ' (required = BooleanChoice) '\\n'\n;\n\nGrammarElementFieldSingleChoice[noskipws]:\n ' - TITLE: ' title=FieldName '\\n'\n ' TYPE: SingleChoice'\n '(' ((options = ChoiceOption) (options *= ChoiceOptionXs)) ')' '\\n'\n ' REQUIRED: ' (required = BooleanChoice) '\\n'\n;\n\nGrammarElementFieldMultipleChoice[noskipws]:\n ' - TITLE: ' title=FieldName '\\n'\n ' TYPE: MultipleChoice'\n '(' ((options = ChoiceOption) (options *= ChoiceOptionXs)) ')' '\\n'\n ' REQUIRED: ' (required = BooleanChoice) '\\n'\n;\n\nGrammarElementFieldTag[noskipws]:\n ' - TITLE: ' title=FieldName '\\n'\n ' TYPE: Tag' '\\n'\n ' REQUIRED: ' (required = BooleanChoice) '\\n'\n;\n\nBooleanChoice[noskipws]:\n ('True' | 'False')\n;\n\nDocumentConfig[noskipws]:\n ('VERSION: ' version = /.*$/ '\\n')?\n ('NUMBER: ' number = /.*$/ '\\n')?\n\n ('OPTIONS:' '\\n'\n (' MARKUP: ' (markup = MarkupChoice) '\\n')?\n (' AUTO_LEVELS: ' (auto_levels = AutoLevelsChoice) '\\n')?\n )?\n;\n\nMarkupChoice[noskipws]:\n 'RST' | 'Text' | 'HTML'\n;\n\nAutoLevelsChoice[noskipws]:\n 'On' | 'Off'\n;\n\nSection[noskipws]:\n '[SECTION]'\n '\\n'\n ('UID: ' uid = /.+$/ '\\n')?\n ('LEVEL: ' level = /.*/ '\\n')?\n 'TITLE: ' title = /.*$/ '\\n'\n free_texts *= SpaceThenFreeText\n section_contents *= SectionOrRequirement\n '\\n'\n '[/SECTION]'\n '\\n'\n;\n\nSectionOrRequirement[noskipws]:\n '\\n' (Section | Requirement | CompositeRequirement)\n;\n\nSpaceThenRequirement[noskipws]:\n '\\n' (Requirement | CompositeRequirement)\n;\n\nSpaceThenFreeText[noskipws]:\n '\\n' (FreeText)\n;\n\nReservedKeyword[noskipws]:\n 'DOCUMENT' | 'GRAMMAR' | 'SECTION' | 'FREETEXT'\n;\n\nRequirement[noskipws]:\n '[' !CompositeRequirementTagName requirement_type = RequirementType ']' '\\n'\n fields *= RequirementField\n;\n\nCompositeRequirementTagName[noskipws]:\n 'COMPOSITE_'\n;\n\nRequirementType[noskipws]:\n !ReservedKeyword /[A-Z]+(_[A-Z]+)*/\n;\n\nRequirementField[noskipws]:\n (\n field_name = 'REFS' ':' '\\n'\n (field_value_references += Reference)\n ) |\n (\n field_name = FieldName ':'\n (\n ((' ' field_value = SingleLineString | field_value = '') '\\n') |\n (' ' (field_value_multiline = MultiLineString) '\\n')\n )\n )\n;\n\nCompositeRequirement[noskipws]:\n '[COMPOSITE_' requirement_type = RequirementType ']' '\\n'\n\n fields *= RequirementField\n\n requirements *= SpaceThenRequirement\n\n '\\n'\n '[/COMPOSITE_REQUIREMENT]' '\\n'\n;\n\nChoiceOption[noskipws]:\n /[\\w\\/-]+( *[\\w\\/-]+)*/\n;\n\nChoiceOptionXs[noskipws]:\n /, /- ChoiceOption\n;\n\nRequirementStatus[noskipws]:\n 'Draft' | 'Active' | 'Deleted';\n\nRequirementComment[noskipws]:\n 'COMMENT: ' (\n comment_single = SingleLineString | comment_multiline = MultiLineString\n ) '\\n'\n;\n\nFreeText[noskipws]:\n '[FREETEXT]' '\\n'\n parts+=TextPart\n FreeTextEnd\n;\n\nFreeTextEnd: /^/ '[/FREETEXT]' '\\n';\n\nTextPart[noskipws]:\n (InlineLink | NormalString)\n;\n\nNormalString[noskipws]:\n (!SpecialKeyword !FreeTextEnd /(?ms)./)*\n;\n\nSpecialKeyword:\n InlineLinkStart // more keywords are coming later\n;\n\nInlineLinkStart: '[LINK: ';\n\nInlineLink[noskipws]:\n InlineLinkStart value = /[^\\]]*/ ']'\n;\n\n"
li=["a","b","d"] print(li) str="".join(li)#adding the lists value together print(str) str=" ".join(li)#adding the lists value together along with a space print(str) str=",".join(li)#adding the lists value together along with a comma print(str) str="&".join(li)#adding the lists value together along with a & print(str)
li = ['a', 'b', 'd'] print(li) str = ''.join(li) print(str) str = ' '.join(li) print(str) str = ','.join(li) print(str) str = '&'.join(li) print(str)
def limpar(*args): telaPrincipal = args[0] cursor = args[1] banco10 = args[2] sql_limpa_tableWidget = args[3] telaPrincipal.valorTotal.setText("Valor Total:") telaPrincipal.tableWidget_cadastro.clear() telaPrincipal.desconto.clear() telaPrincipal.acrescimo.clear() sql_limpa_tableWidget.limpar(cursor, banco10)
def limpar(*args): tela_principal = args[0] cursor = args[1] banco10 = args[2] sql_limpa_table_widget = args[3] telaPrincipal.valorTotal.setText('Valor Total:') telaPrincipal.tableWidget_cadastro.clear() telaPrincipal.desconto.clear() telaPrincipal.acrescimo.clear() sql_limpa_tableWidget.limpar(cursor, banco10)
consonents = ['sch', 'squ', 'thr', 'qu', 'th', 'sc', 'sh', 'ch', 'st', 'rh'] consonents.extend('bcdfghjklmnpqrstvwxyz') def prefix(word): if word[:2] not in ['xr', 'yt']: for x in consonents: if word.startswith(x): return (x, word[len(x):]) return ('', word) def translate(phrase): return ' '.join([x + y + 'ay' for y, x in map(prefix, phrase.split())])
consonents = ['sch', 'squ', 'thr', 'qu', 'th', 'sc', 'sh', 'ch', 'st', 'rh'] consonents.extend('bcdfghjklmnpqrstvwxyz') def prefix(word): if word[:2] not in ['xr', 'yt']: for x in consonents: if word.startswith(x): return (x, word[len(x):]) return ('', word) def translate(phrase): return ' '.join([x + y + 'ay' for (y, x) in map(prefix, phrase.split())])
[ [float("NaN"), float("NaN"), 73.55631426, 76.45173763], [float("NaN"), float("NaN"), 71.11031587, 73.6557548], [float("NaN"), float("NaN"), 11.32891221, 9.80444014], [float("NaN"), float("NaN"), 10.27812002, 8.15602626], [float("NaN"), float("NaN"), 21.60703222, 17.9604664], [float("NaN"), float("NaN"), 2.44599839, 2.79598283], [float("NaN"), float("NaN"), 0.61043458, 0.41397093], [float("NaN"), float("NaN"), 2.65390256, 2.9383991], [float("NaN"), float("NaN"), 1.36865038, 1.84961059], [float("NaN"), float("NaN"), 0.20366599, 0.38581535], [float("NaN"), float("NaN"), 1.57231637, 2.23542594], ]
[[float('NaN'), float('NaN'), 73.55631426, 76.45173763], [float('NaN'), float('NaN'), 71.11031587, 73.6557548], [float('NaN'), float('NaN'), 11.32891221, 9.80444014], [float('NaN'), float('NaN'), 10.27812002, 8.15602626], [float('NaN'), float('NaN'), 21.60703222, 17.9604664], [float('NaN'), float('NaN'), 2.44599839, 2.79598283], [float('NaN'), float('NaN'), 0.61043458, 0.41397093], [float('NaN'), float('NaN'), 2.65390256, 2.9383991], [float('NaN'), float('NaN'), 1.36865038, 1.84961059], [float('NaN'), float('NaN'), 0.20366599, 0.38581535], [float('NaN'), float('NaN'), 1.57231637, 2.23542594]]
numbers = [float(num) for num in input().split()] nums_dict = {} for el in numbers: if el not in nums_dict: nums_dict[el] = 0 nums_dict[el] += 1 [print(f"{el:.1f} - {occurence} times") for el, occurence in nums_dict.items()]
numbers = [float(num) for num in input().split()] nums_dict = {} for el in numbers: if el not in nums_dict: nums_dict[el] = 0 nums_dict[el] += 1 [print(f'{el:.1f} - {occurence} times') for (el, occurence) in nums_dict.items()]
modules_rules = { "graphlib": (None, (3, 9)), "test.support.socket_helper": (None, (3, 9)), "zoneinfo": (None, (3, 9)), } classes_rules = { "asyncio.BufferedProtocol": (None, (3, 7)), "asyncio.PidfdChildWatcher": (None, (3, 9)), "importlib.abc.Traversable": (None, (3, 9)), "importlib.abc.TraversableReader": (None, (3, 9)), "pstats.FunctionProfile": (None, (3, 9)), "pstats.StatsProfile": (None, (3, 9)), } exceptions_rules = { } functions_rules = { "ast.unparse": (None, (3, 9)), "asyncio.loop.shutdown_default_executor": (None, (3, 9)), "asyncio.to_thread": (None, (3, 9)), "bytearray.removeprefix": (None, (3, 9)), "bytearray.removesuffix": (None, (3, 9)), "bytes.removeprefix": (None, (3, 9)), "bytes.removesuffix": (None, (3, 9)), "curses.get_escdelay": (None, (3, 9)), "curses.get_tabsize": (None, (3, 9)), "curses.set_escdelay": (None, (3, 9)), "curses.set_tabsize": (None, (3, 9)), "gc.is_finalized": (None, (3, 9)), "imaplib.IMAP4.unselect": (None, (3, 9)), "importlib.machinery.FrozenImporter.create_module": (None, (3, 4)), "importlib.machinery.FrozenImporter.exec_module": (None, (3, 4)), "importlib.resources.files": (None, (3, 9)), "keyword.issoftkeyword": (None, (3, 9)), "logging.StreamHandler.setStream": (None, (3, 7)), "math.lcm": (None, (3, 9)), "math.nextafter": (None, (3, 9)), "math.ulp": (None, (3, 9)), "multiprocessing.SimpleQueue.close": (None, (3, 9)), "os.pidfd_open": (None, (3, 9)), "os.waitstatus_to_exitcode": (None, (3, 9)), "pathlib.Path.link_to": (None, (3, 8)), "pathlib.Path.readlink": (None, (3, 9)), "pathlib.PurePath.is_relative_to": (None, (3, 9)), "pathlib.PurePath.with_stem": (None, (3, 9)), "pkgutil.resolve_name": (None, (3, 9)), "pstats.Stats.get_stats_profile": (None, (3, 9)), "random.randbytes": (None, (3, 9)), "signal.pidfd_send_signal": (None, (3, 9)), "socket.recv_fds": (None, (3, 9)), "socket.send_fds": (None, (3, 9)), "statistics.NormalDist.zscore": (None, (3, 9)), "str.removeprefix": (None, (3, 9)), "str.removesuffix": (None, (3, 9)), "test.support.print_warning": (None, (3, 9)), "test.support.wait_process": (None, (3, 9)), "tracemalloc.reset_peak": (None, (3, 9)), "types.CodeType.replace": (None, (3, 8)), "typing.get_origin": (None, (3, 8)), "venv.EnvBuilder.upgrade_dependencies": (None, (3, 9)), "xml.etree.ElementTree.indent": (None, (3, 9)), } variables_and_constants_rules = { "decimal.HAVE_CONTEXTVAR": (None, (3, 7)), "difflib.SequenceMatcher.bjunk": (None, (3, 2)), "difflib.SequenceMatcher.bpopular": (None, (3, 2)), "fcntl.F_GETPATH": (None, (3, 9)), "fcntl.F_OFD_GETLK": (None, (3, 9)), "fcntl.F_OFD_SETLK": (None, (3, 9)), "fcntl.F_OFD_SETLKW": (None, (3, 9)), "http.HTTPStatus.EARLY_HINTS": (None, (3, 9)), "http.HTTPStatus.IM_A_TEAPOT": (None, (3, 9)), "http.HTTPStatus.TOO_EARLY": (None, (3, 9)), "keyword.softkwlist": (None, (3, 9)), "logging.StreamHandler.terminator": (None, (3, 2)), "os.CLD_KILLED": (None, (3, 9)), "os.CLD_STOPPED": (None, (3, 9)), "os.P_PIDFD": (None, (3, 9)), "socket.CAN_J1939": (None, (3, 9)), "socket.CAN_RAW_JOIN_FILTERS": (None, (3, 9)), "socket.IPPROTO_UDPLITE": (None, (3, 9)), "sys.__unraisablehook__": (None, (3, 8)), "sys.flags.dev_mode": (None, (3, 7)), "sys.flags.utf8_mode": (None, (3, 7)), "sys.platlibdir": (None, (3, 9)), "time.CLOCK_TAI": (None, (3, 9)), "token.COLONEQUAL": (None, (3, 8)), "token.TYPE_COMMENT": (None, (3, 8)), "token.TYPE_IGNORE": (None, (3, 8)), "tracemalloc.Traceback.total_nframe": (None, (3, 9)), "typing.Annotated": (None, (3, 9)), "unittest.mock.Mock.call_args.args": (None, (3, 8)), "unittest.mock.Mock.call_args.kwargs": (None, (3, 8)), "urllib.response.addinfourl.status": (None, (3, 9)), } decorators_rules = { "functools.cache": (None, (3, 9)), } kwargs_rules = { ("argparse.ArgumentParser", "exit_on_error"): (None, (3, 9)), ("ast.dump", "indent"): (None, (3, 9)), ("asyncio.Future.cancel", "msg"): (None, (3, 9)), ("asyncio.Task.cancel", "msg"): (None, (3, 9)), ("asyncio.loop.create_connection", "happy_eyeballs_delay"): (None, (3, 8)), ("asyncio.loop.create_connection", "interleave"): (None, (3, 8)), ("bytearray.hex", "bytes_per_sep"): (None, (3, 8)), ("bytearray.hex", "sep"): (None, (3, 8)), ("compileall.compile_dir", "hardlink_dupes"): (None, (3, 9)), ("compileall.compile_dir", "limit_sl_dest"): (None, (3, 9)), ("compileall.compile_dir", "prependdir"): (None, (3, 9)), ("compileall.compile_dir", "stripdir"): (None, (3, 9)), ("compileall.compile_file", "hardlink_dupes"): (None, (3, 9)), ("compileall.compile_file", "limit_sl_dest"): (None, (3, 9)), ("compileall.compile_file", "prependdir"): (None, (3, 9)), ("compileall.compile_file", "stripdir"): (None, (3, 9)), ("concurrent.futures.Executor.shutdown", "cancel_futures"): (None, (3, 9)), ("ftplib.FTP", "encoding"): (None, (3, 9)), ("ftplib.FTP_TLS", "encoding"): (None, (3, 9)), ("hashlib.blake2b", "usedforsecurity"): (None, (3, 9)), ("hashlib.blake2s", "usedforsecurity"): (None, (3, 9)), ("hashlib.md5", "usedforsecurity"): (None, (3, 9)), ("hashlib.new", "usedforsecurity"): (None, (3, 9)), ("hashlib.sha1", "usedforsecurity"): (None, (3, 9)), ("hashlib.sha224", "usedforsecurity"): (None, (3, 9)), ("hashlib.sha256", "usedforsecurity"): (None, (3, 9)), ("hashlib.sha384", "usedforsecurity"): (None, (3, 9)), ("hashlib.sha3_224", "usedforsecurity"): (None, (3, 9)), ("hashlib.sha3_256", "usedforsecurity"): (None, (3, 9)), ("hashlib.sha3_384", "usedforsecurity"): (None, (3, 9)), ("hashlib.sha3_512", "usedforsecurity"): (None, (3, 9)), ("hashlib.sha512", "usedforsecurity"): (None, (3, 9)), ("hashlib.shake_128", "usedforsecurity"): (None, (3, 9)), ("hashlib.shake_256", "usedforsecurity"): (None, (3, 9)), ("imaplib.IMAP4", "timeout"): (None, (3, 9)), ("imaplib.IMAP4.open", "timeout"): (None, (3, 9)), ("imaplib.IMAP4_SSL", "ssl_context"): (None, (3, 3)), ("imaplib.IMAP4_SSL", "timeout"): (None, (3, 9)), ("logging.basicConfig", "encoding"): (None, (3, 9)), ("logging.basicConfig", "errors"): (None, (3, 9)), ("logging.handlers.RotatingFileHandler", "errors"): (None, (3, 9)), ("logging.handlers.TimedRotatingFileHandler", "errors"): (None, (3, 9)), ("logging.handlers.WatchedFileHandler", "errors"): (None, (3, 9)), ("memoryview.hex", "bytes_per_sep"): (None, (3, 8)), ("memoryview.hex", "sep"): (None, (3, 8)), ("os.sendfile", "in_fd"): (None, (3, 9)), ("os.sendfile", "out_fd"): (None, (3, 9)), ("pow", "base"): (None, (3, 8)), ("pow", "exp"): (None, (3, 8)), ("pow", "mod"): (None, (3, 8)), ("random.sample", "counts"): (None, (3, 9)), ("smtplib.LMTP", "timeout"): (None, (3, 9)), ("subprocess.Popen", "extra_groups"): (None, (3, 9)), ("subprocess.Popen", "group"): (None, (3, 9)), ("subprocess.Popen", "umask"): (None, (3, 9)), ("subprocess.Popen", "user"): (None, (3, 9)), ("threading.Semaphore.release", "n"): (None, (3, 9)), ("typing.get_type_hints", "include_extras"): (None, (3, 9)), ("venv.EnvBuilder", "upgrade_deps"): (None, (3, 9)), ("xml.etree.ElementInclude.include", "base_url"): (None, (3, 9)), ("xml.etree.ElementInclude.include", "max_depth"): (None, (3, 9)), }
modules_rules = {'graphlib': (None, (3, 9)), 'test.support.socket_helper': (None, (3, 9)), 'zoneinfo': (None, (3, 9))} classes_rules = {'asyncio.BufferedProtocol': (None, (3, 7)), 'asyncio.PidfdChildWatcher': (None, (3, 9)), 'importlib.abc.Traversable': (None, (3, 9)), 'importlib.abc.TraversableReader': (None, (3, 9)), 'pstats.FunctionProfile': (None, (3, 9)), 'pstats.StatsProfile': (None, (3, 9))} exceptions_rules = {} functions_rules = {'ast.unparse': (None, (3, 9)), 'asyncio.loop.shutdown_default_executor': (None, (3, 9)), 'asyncio.to_thread': (None, (3, 9)), 'bytearray.removeprefix': (None, (3, 9)), 'bytearray.removesuffix': (None, (3, 9)), 'bytes.removeprefix': (None, (3, 9)), 'bytes.removesuffix': (None, (3, 9)), 'curses.get_escdelay': (None, (3, 9)), 'curses.get_tabsize': (None, (3, 9)), 'curses.set_escdelay': (None, (3, 9)), 'curses.set_tabsize': (None, (3, 9)), 'gc.is_finalized': (None, (3, 9)), 'imaplib.IMAP4.unselect': (None, (3, 9)), 'importlib.machinery.FrozenImporter.create_module': (None, (3, 4)), 'importlib.machinery.FrozenImporter.exec_module': (None, (3, 4)), 'importlib.resources.files': (None, (3, 9)), 'keyword.issoftkeyword': (None, (3, 9)), 'logging.StreamHandler.setStream': (None, (3, 7)), 'math.lcm': (None, (3, 9)), 'math.nextafter': (None, (3, 9)), 'math.ulp': (None, (3, 9)), 'multiprocessing.SimpleQueue.close': (None, (3, 9)), 'os.pidfd_open': (None, (3, 9)), 'os.waitstatus_to_exitcode': (None, (3, 9)), 'pathlib.Path.link_to': (None, (3, 8)), 'pathlib.Path.readlink': (None, (3, 9)), 'pathlib.PurePath.is_relative_to': (None, (3, 9)), 'pathlib.PurePath.with_stem': (None, (3, 9)), 'pkgutil.resolve_name': (None, (3, 9)), 'pstats.Stats.get_stats_profile': (None, (3, 9)), 'random.randbytes': (None, (3, 9)), 'signal.pidfd_send_signal': (None, (3, 9)), 'socket.recv_fds': (None, (3, 9)), 'socket.send_fds': (None, (3, 9)), 'statistics.NormalDist.zscore': (None, (3, 9)), 'str.removeprefix': (None, (3, 9)), 'str.removesuffix': (None, (3, 9)), 'test.support.print_warning': (None, (3, 9)), 'test.support.wait_process': (None, (3, 9)), 'tracemalloc.reset_peak': (None, (3, 9)), 'types.CodeType.replace': (None, (3, 8)), 'typing.get_origin': (None, (3, 8)), 'venv.EnvBuilder.upgrade_dependencies': (None, (3, 9)), 'xml.etree.ElementTree.indent': (None, (3, 9))} variables_and_constants_rules = {'decimal.HAVE_CONTEXTVAR': (None, (3, 7)), 'difflib.SequenceMatcher.bjunk': (None, (3, 2)), 'difflib.SequenceMatcher.bpopular': (None, (3, 2)), 'fcntl.F_GETPATH': (None, (3, 9)), 'fcntl.F_OFD_GETLK': (None, (3, 9)), 'fcntl.F_OFD_SETLK': (None, (3, 9)), 'fcntl.F_OFD_SETLKW': (None, (3, 9)), 'http.HTTPStatus.EARLY_HINTS': (None, (3, 9)), 'http.HTTPStatus.IM_A_TEAPOT': (None, (3, 9)), 'http.HTTPStatus.TOO_EARLY': (None, (3, 9)), 'keyword.softkwlist': (None, (3, 9)), 'logging.StreamHandler.terminator': (None, (3, 2)), 'os.CLD_KILLED': (None, (3, 9)), 'os.CLD_STOPPED': (None, (3, 9)), 'os.P_PIDFD': (None, (3, 9)), 'socket.CAN_J1939': (None, (3, 9)), 'socket.CAN_RAW_JOIN_FILTERS': (None, (3, 9)), 'socket.IPPROTO_UDPLITE': (None, (3, 9)), 'sys.__unraisablehook__': (None, (3, 8)), 'sys.flags.dev_mode': (None, (3, 7)), 'sys.flags.utf8_mode': (None, (3, 7)), 'sys.platlibdir': (None, (3, 9)), 'time.CLOCK_TAI': (None, (3, 9)), 'token.COLONEQUAL': (None, (3, 8)), 'token.TYPE_COMMENT': (None, (3, 8)), 'token.TYPE_IGNORE': (None, (3, 8)), 'tracemalloc.Traceback.total_nframe': (None, (3, 9)), 'typing.Annotated': (None, (3, 9)), 'unittest.mock.Mock.call_args.args': (None, (3, 8)), 'unittest.mock.Mock.call_args.kwargs': (None, (3, 8)), 'urllib.response.addinfourl.status': (None, (3, 9))} decorators_rules = {'functools.cache': (None, (3, 9))} kwargs_rules = {('argparse.ArgumentParser', 'exit_on_error'): (None, (3, 9)), ('ast.dump', 'indent'): (None, (3, 9)), ('asyncio.Future.cancel', 'msg'): (None, (3, 9)), ('asyncio.Task.cancel', 'msg'): (None, (3, 9)), ('asyncio.loop.create_connection', 'happy_eyeballs_delay'): (None, (3, 8)), ('asyncio.loop.create_connection', 'interleave'): (None, (3, 8)), ('bytearray.hex', 'bytes_per_sep'): (None, (3, 8)), ('bytearray.hex', 'sep'): (None, (3, 8)), ('compileall.compile_dir', 'hardlink_dupes'): (None, (3, 9)), ('compileall.compile_dir', 'limit_sl_dest'): (None, (3, 9)), ('compileall.compile_dir', 'prependdir'): (None, (3, 9)), ('compileall.compile_dir', 'stripdir'): (None, (3, 9)), ('compileall.compile_file', 'hardlink_dupes'): (None, (3, 9)), ('compileall.compile_file', 'limit_sl_dest'): (None, (3, 9)), ('compileall.compile_file', 'prependdir'): (None, (3, 9)), ('compileall.compile_file', 'stripdir'): (None, (3, 9)), ('concurrent.futures.Executor.shutdown', 'cancel_futures'): (None, (3, 9)), ('ftplib.FTP', 'encoding'): (None, (3, 9)), ('ftplib.FTP_TLS', 'encoding'): (None, (3, 9)), ('hashlib.blake2b', 'usedforsecurity'): (None, (3, 9)), ('hashlib.blake2s', 'usedforsecurity'): (None, (3, 9)), ('hashlib.md5', 'usedforsecurity'): (None, (3, 9)), ('hashlib.new', 'usedforsecurity'): (None, (3, 9)), ('hashlib.sha1', 'usedforsecurity'): (None, (3, 9)), ('hashlib.sha224', 'usedforsecurity'): (None, (3, 9)), ('hashlib.sha256', 'usedforsecurity'): (None, (3, 9)), ('hashlib.sha384', 'usedforsecurity'): (None, (3, 9)), ('hashlib.sha3_224', 'usedforsecurity'): (None, (3, 9)), ('hashlib.sha3_256', 'usedforsecurity'): (None, (3, 9)), ('hashlib.sha3_384', 'usedforsecurity'): (None, (3, 9)), ('hashlib.sha3_512', 'usedforsecurity'): (None, (3, 9)), ('hashlib.sha512', 'usedforsecurity'): (None, (3, 9)), ('hashlib.shake_128', 'usedforsecurity'): (None, (3, 9)), ('hashlib.shake_256', 'usedforsecurity'): (None, (3, 9)), ('imaplib.IMAP4', 'timeout'): (None, (3, 9)), ('imaplib.IMAP4.open', 'timeout'): (None, (3, 9)), ('imaplib.IMAP4_SSL', 'ssl_context'): (None, (3, 3)), ('imaplib.IMAP4_SSL', 'timeout'): (None, (3, 9)), ('logging.basicConfig', 'encoding'): (None, (3, 9)), ('logging.basicConfig', 'errors'): (None, (3, 9)), ('logging.handlers.RotatingFileHandler', 'errors'): (None, (3, 9)), ('logging.handlers.TimedRotatingFileHandler', 'errors'): (None, (3, 9)), ('logging.handlers.WatchedFileHandler', 'errors'): (None, (3, 9)), ('memoryview.hex', 'bytes_per_sep'): (None, (3, 8)), ('memoryview.hex', 'sep'): (None, (3, 8)), ('os.sendfile', 'in_fd'): (None, (3, 9)), ('os.sendfile', 'out_fd'): (None, (3, 9)), ('pow', 'base'): (None, (3, 8)), ('pow', 'exp'): (None, (3, 8)), ('pow', 'mod'): (None, (3, 8)), ('random.sample', 'counts'): (None, (3, 9)), ('smtplib.LMTP', 'timeout'): (None, (3, 9)), ('subprocess.Popen', 'extra_groups'): (None, (3, 9)), ('subprocess.Popen', 'group'): (None, (3, 9)), ('subprocess.Popen', 'umask'): (None, (3, 9)), ('subprocess.Popen', 'user'): (None, (3, 9)), ('threading.Semaphore.release', 'n'): (None, (3, 9)), ('typing.get_type_hints', 'include_extras'): (None, (3, 9)), ('venv.EnvBuilder', 'upgrade_deps'): (None, (3, 9)), ('xml.etree.ElementInclude.include', 'base_url'): (None, (3, 9)), ('xml.etree.ElementInclude.include', 'max_depth'): (None, (3, 9))}
def bolha_curta(self, lista): fim = len(lista) for i in range(fim-1, 0, -1): trocou = False for j in range(i): if lista[j] > lista[j+1]: lista[j], lista[j+1] = lista[j+1], lista[j] trocou = True if trocou== False: return
def bolha_curta(self, lista): fim = len(lista) for i in range(fim - 1, 0, -1): trocou = False for j in range(i): if lista[j] > lista[j + 1]: (lista[j], lista[j + 1]) = (lista[j + 1], lista[j]) trocou = True if trocou == False: return
a = float(input('digite um numero:')) b = float(input('digite um numero:')) c = float(input('digite um numero:')) if a > b: if a > c: ma = a if b > c: mi = c if c > b: mi = b if b > a: if b > c: ma = b if a > c: mi = c if c > a: mi = a if c > b: if c > a: ma = c if b > a: mi = a if a > b: mi = b print('O menor numero e : {} e o maior e {}'.format(mi, ma))
a = float(input('digite um numero:')) b = float(input('digite um numero:')) c = float(input('digite um numero:')) if a > b: if a > c: ma = a if b > c: mi = c if c > b: mi = b if b > a: if b > c: ma = b if a > c: mi = c if c > a: mi = a if c > b: if c > a: ma = c if b > a: mi = a if a > b: mi = b print('O menor numero e : {} e o maior e {}'.format(mi, ma))
""" Common constants for Pipeline. """ AD_FIELD_NAME = 'asof_date' ANNOUNCEMENT_FIELD_NAME = 'announcement_date' CASH_FIELD_NAME = 'cash' CASH_AMOUNT_FIELD_NAME = 'cash_amount' BUYBACK_ANNOUNCEMENT_FIELD_NAME = 'buyback_date' DAYS_SINCE_PREV = 'days_since_prev' DAYS_SINCE_PREV_DIVIDEND_ANNOUNCEMENT = 'days_since_prev_dividend_announcement' DAYS_SINCE_PREV_EX_DATE = 'days_since_prev_ex_date' DAYS_TO_NEXT = 'days_to_next' DAYS_TO_NEXT_EX_DATE = 'days_to_next_ex_date' EX_DATE_FIELD_NAME = 'ex_date' NEXT_AMOUNT = 'next_amount' NEXT_ANNOUNCEMENT = 'next_announcement' NEXT_EX_DATE = 'next_ex_date' NEXT_PAY_DATE = 'next_pay_date' PAY_DATE_FIELD_NAME = 'pay_date' PREVIOUS_AMOUNT = 'previous_amount' PREVIOUS_ANNOUNCEMENT = 'previous_announcement' PREVIOUS_BUYBACK_ANNOUNCEMENT = 'previous_buyback_announcement' PREVIOUS_BUYBACK_CASH = 'previous_buyback_cash' PREVIOUS_BUYBACK_SHARE_COUNT = 'previous_buyback_share_count' PREVIOUS_EX_DATE = 'previous_ex_date' PREVIOUS_PAY_DATE = 'previous_pay_date' SHARE_COUNT_FIELD_NAME = 'share_count' SID_FIELD_NAME = 'sid' TS_FIELD_NAME = 'timestamp'
""" Common constants for Pipeline. """ ad_field_name = 'asof_date' announcement_field_name = 'announcement_date' cash_field_name = 'cash' cash_amount_field_name = 'cash_amount' buyback_announcement_field_name = 'buyback_date' days_since_prev = 'days_since_prev' days_since_prev_dividend_announcement = 'days_since_prev_dividend_announcement' days_since_prev_ex_date = 'days_since_prev_ex_date' days_to_next = 'days_to_next' days_to_next_ex_date = 'days_to_next_ex_date' ex_date_field_name = 'ex_date' next_amount = 'next_amount' next_announcement = 'next_announcement' next_ex_date = 'next_ex_date' next_pay_date = 'next_pay_date' pay_date_field_name = 'pay_date' previous_amount = 'previous_amount' previous_announcement = 'previous_announcement' previous_buyback_announcement = 'previous_buyback_announcement' previous_buyback_cash = 'previous_buyback_cash' previous_buyback_share_count = 'previous_buyback_share_count' previous_ex_date = 'previous_ex_date' previous_pay_date = 'previous_pay_date' share_count_field_name = 'share_count' sid_field_name = 'sid' ts_field_name = 'timestamp'
# Write a Python program to get the n (non-negative integer) copies of the first 2 characters of a given string. # Return the n copies of the whole string if the length is less than 2 s = input("Enter a string: ") def copies(string, number): copy = "" for i in range(number): copy += string[0] + string[1] return copy if len(s) > 2: n = int(input("Enter the number of copies: ")) print(copies(s, n)) else: print(s + s)
s = input('Enter a string: ') def copies(string, number): copy = '' for i in range(number): copy += string[0] + string[1] return copy if len(s) > 2: n = int(input('Enter the number of copies: ')) print(copies(s, n)) else: print(s + s)
# model settings model = dict( type='Recognizer3D', backbone=dict(type='X3D', frozen_stages = -1, gamma_w=1, gamma_b=2.25, gamma_d=2.2), cls_head=dict( type='X3DHead', in_channels=432, num_classes=400, multi_class=False, spatial_type='avg', dropout_ratio=0.7, fc1_bias=False), # model training and testing settings train_cfg=None, test_cfg=dict(average_clips='prob')) # model = dict( # type='Recognizer3D', # backbone=dict(type='X3D', frozen_stages = 0, gamma_w=2, gamma_b=2.25, gamma_d=5), # cls_head=dict( # type='X3DHead', # in_channels=864, # num_classes=7, # spatial_type='avg', # dropout_ratio=0.6, # fc1_bias=False), # # model training and testing settings # train_cfg=None, # test_cfg=dict(average_clips='prob'))
model = dict(type='Recognizer3D', backbone=dict(type='X3D', frozen_stages=-1, gamma_w=1, gamma_b=2.25, gamma_d=2.2), cls_head=dict(type='X3DHead', in_channels=432, num_classes=400, multi_class=False, spatial_type='avg', dropout_ratio=0.7, fc1_bias=False), train_cfg=None, test_cfg=dict(average_clips='prob'))
channels1 = { "#test1": ("@user1", "user2", "user3"), "#test2": ("@user4", "user5", "user6"), "#test3": ("@user7", "user8", "user9") } channels2 = { "#test1": ("@user1", "user2", "user3"), "#test2": ("@user4", "user5", "user6"), "#test3": ("@user7", "user8", "user9"), None: ("user10" , "user11") } channels3 = { "#test1": ("@user1", "user2", "user3"), "#test2": ("@user2",), "#test3": ("@user3", "@user4", "user5", "user6"), "#test4": ("@user7", "+user8", "+user9", "user1", "user2"), "#test5": ("@user1", "@user5"), None: ("user10" , "user11") } channels4 = { None: ("user1", "user2", "user3", "user4", "user5") }
channels1 = {'#test1': ('@user1', 'user2', 'user3'), '#test2': ('@user4', 'user5', 'user6'), '#test3': ('@user7', 'user8', 'user9')} channels2 = {'#test1': ('@user1', 'user2', 'user3'), '#test2': ('@user4', 'user5', 'user6'), '#test3': ('@user7', 'user8', 'user9'), None: ('user10', 'user11')} channels3 = {'#test1': ('@user1', 'user2', 'user3'), '#test2': ('@user2',), '#test3': ('@user3', '@user4', 'user5', 'user6'), '#test4': ('@user7', '+user8', '+user9', 'user1', 'user2'), '#test5': ('@user1', '@user5'), None: ('user10', 'user11')} channels4 = {None: ('user1', 'user2', 'user3', 'user4', 'user5')}
class BaseAnsiblerException(Exception): message = "Error" def __init__(self, *args, **kwargs) -> None: super().__init__(*args) self.__class__.message = kwargs.get("message", self.message) def __str__(self) -> str: return self.__class__.message class CommandNotFound(BaseAnsiblerException): message = "Command not found" class RolesParseError(BaseAnsiblerException): message = "Could not parse default roles" class MetaYMLError(BaseAnsiblerException): message = "Invalid meta/main.yml" class RoleMetadataError(BaseAnsiblerException): message = "Role metadata error" class MoleculeTestsNotFound(BaseAnsiblerException): message = "Molecule tests not foound" class MoleculeTestParseError(BaseAnsiblerException): message = "Could not parse molecule test file" class NoPackageJsonError(BaseAnsiblerException): message = "No package.json"
class Baseansiblerexception(Exception): message = 'Error' def __init__(self, *args, **kwargs) -> None: super().__init__(*args) self.__class__.message = kwargs.get('message', self.message) def __str__(self) -> str: return self.__class__.message class Commandnotfound(BaseAnsiblerException): message = 'Command not found' class Rolesparseerror(BaseAnsiblerException): message = 'Could not parse default roles' class Metaymlerror(BaseAnsiblerException): message = 'Invalid meta/main.yml' class Rolemetadataerror(BaseAnsiblerException): message = 'Role metadata error' class Moleculetestsnotfound(BaseAnsiblerException): message = 'Molecule tests not foound' class Moleculetestparseerror(BaseAnsiblerException): message = 'Could not parse molecule test file' class Nopackagejsonerror(BaseAnsiblerException): message = 'No package.json'
""" Given preorder and inorder traversal of a tree, construct the binary tree. Note: You may assume that duplicates do not exist in the tree. """ __author__ = 'Danyang' class TreeNode: def __init__(self, x): self.val = x self.left = None self.right = None class Solution: def buildTree(self, preorder, inorder): """ Recursive algorithm. Pre-order, in-order, post-order traversal relationship pre-order: [root, left_subtree, right_subtree] in-order: [left_subtree, root, right_subtree] recursive algorithm :param preorder: a list of integers :param inorder: a list of integers :return: TreeNode, root """ if not preorder: return None root = TreeNode(preorder[0]) root_index = inorder.index(root.val) root.left = self.buildTree(preorder[1:root_index+1], inorder[0:root_index]) root.right = self.buildTree(preorder[root_index+1:], inorder[root_index+1:]) return root
""" Given preorder and inorder traversal of a tree, construct the binary tree. Note: You may assume that duplicates do not exist in the tree. """ __author__ = 'Danyang' class Treenode: def __init__(self, x): self.val = x self.left = None self.right = None class Solution: def build_tree(self, preorder, inorder): """ Recursive algorithm. Pre-order, in-order, post-order traversal relationship pre-order: [root, left_subtree, right_subtree] in-order: [left_subtree, root, right_subtree] recursive algorithm :param preorder: a list of integers :param inorder: a list of integers :return: TreeNode, root """ if not preorder: return None root = tree_node(preorder[0]) root_index = inorder.index(root.val) root.left = self.buildTree(preorder[1:root_index + 1], inorder[0:root_index]) root.right = self.buildTree(preorder[root_index + 1:], inorder[root_index + 1:]) return root
def make_list(element, keep_none=False): """ Turns element into a list of itself if it is not of type list or tuple. """ if element is None and not keep_none: element = [] # Convert none to empty list if not isinstance(element, (list, tuple, set)): element = [element] elif isinstance(element, (tuple, set)): element = list(element) return element
def make_list(element, keep_none=False): """ Turns element into a list of itself if it is not of type list or tuple. """ if element is None and (not keep_none): element = [] if not isinstance(element, (list, tuple, set)): element = [element] elif isinstance(element, (tuple, set)): element = list(element) return element
#Evaludador de numero primo #Created by @neriphy numero = input("Ingrese el numero a evaluar: ") divisor = numero - 1 residuo = True while divisor > 1 and residuo == True: if numero%divisor != 0: divisor = divisor - 1 print("Evaluando") residuo = True elif numero%divisor == 0: residuo = False if residuo == True: print(numero,"es un numero primo") if residuo == False: print(numero,"no es un numero primo")
numero = input('Ingrese el numero a evaluar: ') divisor = numero - 1 residuo = True while divisor > 1 and residuo == True: if numero % divisor != 0: divisor = divisor - 1 print('Evaluando') residuo = True elif numero % divisor == 0: residuo = False if residuo == True: print(numero, 'es un numero primo') if residuo == False: print(numero, 'no es un numero primo')
# Python programming that returns the weight of the maximum weight path in a triangle def triangle_max_weight(arrs, level=0, index=0): if level == len(arrs) - 1: return arrs[level][index] else: return arrs[level][index] + max( triangle_max_weight(arrs, level + 1, index), triangle_max_weight(arrs, level + 1, index + 1) ) if __name__ == "__main__": # Driver function arrs1 =[[1], [2, 3], [1, 5, 1]] print(triangle_max_weight(arrs1))
def triangle_max_weight(arrs, level=0, index=0): if level == len(arrs) - 1: return arrs[level][index] else: return arrs[level][index] + max(triangle_max_weight(arrs, level + 1, index), triangle_max_weight(arrs, level + 1, index + 1)) if __name__ == '__main__': arrs1 = [[1], [2, 3], [1, 5, 1]] print(triangle_max_weight(arrs1))
# Definition for singly-linked list. # class ListNode: # def __init__(self, val=0, next=None): # self.val = val # self.next = next class Solution: def reverseList(self, head: Optional[ListNode]) -> Optional[ListNode]: ## By passing the case if empty linked list if not head: return head else: ## We will be using two nodes method with prev and curr ## intialized to None and head respectively prev, curr = None, head ## We will be traversing throught the linked list while curr: ## Let us temporalily save the rest of the linked list ## right to the curr node in rest_ll rest_ll = curr.next ## Make the curr point to the pre curr.next = prev ## Prev point to the curr prev = curr ## Update curr to point to the rest of the ll curr = rest_ll return prev
class Solution: def reverse_list(self, head: Optional[ListNode]) -> Optional[ListNode]: if not head: return head else: (prev, curr) = (None, head) while curr: rest_ll = curr.next curr.next = prev prev = curr curr = rest_ll return prev
def get_span_and_trace(headers): try: trace, span = headers.get("X-Cloud-Trace-Context").split("/") except (ValueError, AttributeError): return None, None span = span.split(";")[0] return span, trace
def get_span_and_trace(headers): try: (trace, span) = headers.get('X-Cloud-Trace-Context').split('/') except (ValueError, AttributeError): return (None, None) span = span.split(';')[0] return (span, trace)
def trigger(): return """ CREATE OR REPLACE FUNCTION trg_ticket_prioridade() RETURNS TRIGGER AS $$ DECLARE prioridade_grupo smallint; prioridade_subgrupo smallint; BEGIN prioridade_grupo = COALESCE((SELECT prioridade FROM grupo WHERE id = NEW.grupo_id), 0); prioridade_subgrupo = COALESCE((SELECT prioridade FROM subgrupo WHERE id = NEW.subgrupo_id), 0); NEW.prioridade = prioridade_grupo + prioridade_subgrupo; RETURN NEW; END $$ LANGUAGE plpgsql; DROP TRIGGER IF EXISTS trg_ticket_prioridade ON ticket; CREATE TRIGGER trg_ticket_prioridade BEFORE INSERT OR UPDATE ON ticket FOR EACH ROW EXECUTE PROCEDURE trg_ticket_prioridade(); """
def trigger(): return '\n CREATE OR REPLACE FUNCTION trg_ticket_prioridade()\n RETURNS TRIGGER AS $$\n DECLARE\n prioridade_grupo smallint;\n prioridade_subgrupo smallint;\n \n BEGIN\n prioridade_grupo = COALESCE((SELECT prioridade FROM grupo WHERE id = NEW.grupo_id), 0);\n prioridade_subgrupo = COALESCE((SELECT prioridade FROM subgrupo WHERE id = NEW.subgrupo_id), 0);\n \n NEW.prioridade = prioridade_grupo + prioridade_subgrupo;\n \n RETURN NEW;\n END\n $$ LANGUAGE plpgsql;\n \n DROP TRIGGER IF EXISTS trg_ticket_prioridade ON ticket;\n CREATE TRIGGER trg_ticket_prioridade\n BEFORE INSERT OR UPDATE ON ticket\n FOR EACH ROW EXECUTE PROCEDURE trg_ticket_prioridade();\n '
# CPU: 0.18 s n_rows, _ = map(int, input().split()) common_items = set(input().split()) for _ in range(n_rows - 1): common_items = common_items.intersection(set(input().split())) print(len(common_items)) print(*sorted(common_items), sep="\n")
(n_rows, _) = map(int, input().split()) common_items = set(input().split()) for _ in range(n_rows - 1): common_items = common_items.intersection(set(input().split())) print(len(common_items)) print(*sorted(common_items), sep='\n')
class APIException(Exception): def __init__(self, message, code=None): self.context = {} if code: self.context['errorCode'] = code super().__init__(message)
class Apiexception(Exception): def __init__(self, message, code=None): self.context = {} if code: self.context['errorCode'] = code super().__init__(message)
class Solution: def lengthOfLongestSubstring(self, s: str) -> int: max_len = 0 l, r = 0, 0 count = dict() while r < len(s): count[s[r]] = count.get(s[r], 0) + 1 while count[s[r]] > 1: count[s[l]] = count[s[l]] - 1 l += 1 max_len = max(max_len, r-l+1) r += 1 return max_len
class Solution: def length_of_longest_substring(self, s: str) -> int: max_len = 0 (l, r) = (0, 0) count = dict() while r < len(s): count[s[r]] = count.get(s[r], 0) + 1 while count[s[r]] > 1: count[s[l]] = count[s[l]] - 1 l += 1 max_len = max(max_len, r - l + 1) r += 1 return max_len
class DeviceInterface: # This operation is used to initialize the device instance. Accepts a dictionary that is read in from the device's yaml definition. # This device_config_yaml may contain any number of parameters/fields necessary to initialize/setup the instance for data collection. def initialize(self, device_config_dict): pass # This is a standard operation that will return a dictionary to be converted to the appropriate format (json, plaintext, etc) for # use by endpoints or other publishing methods. def get_device_data(self): pass
class Deviceinterface: def initialize(self, device_config_dict): pass def get_device_data(self): pass
''' mro stands for Method Resolution Order. It returns a list of types the class is derived from, in the order they are searched for methods''' print(__doc__) print('\n'+'-'*35+ 'Method Resolution Order'+'-'*35) class A(object): def dothis(self): print('From A class') class B1(A): def dothis(self): print('From B1 class') pass class B2(object): def dothis(self): print('From B2 class') pass class B3(A): def dothis(self): print('From B3 class') # Diamond inheritance class D1(B1, B3): pass class D2(B1, B2): pass d1_instance = D1() d1_instance.dothis() print(D1.__mro__) d2_instance = D2() d2_instance.dothis() print(D2.__mro__)
""" mro stands for Method Resolution Order. It returns a list of types the class is derived from, in the order they are searched for methods""" print(__doc__) print('\n' + '-' * 35 + 'Method Resolution Order' + '-' * 35) class A(object): def dothis(self): print('From A class') class B1(A): def dothis(self): print('From B1 class') pass class B2(object): def dothis(self): print('From B2 class') pass class B3(A): def dothis(self): print('From B3 class') class D1(B1, B3): pass class D2(B1, B2): pass d1_instance = d1() d1_instance.dothis() print(D1.__mro__) d2_instance = d2() d2_instance.dothis() print(D2.__mro__)
def solution(s1, s2): ''' EXPLANATION ------------------------------------------------------------------- I approached this problem by creating two dictionaries, one for each string. These dictionaries are formatted with characters as keys, and counts as values. I then iterate over each string, counting the instances of each character. Finally, I iterate over the first dictionary, and if that character exists in the second dictionary, I add the lesser of the two values to create a total count of shared characters. ------------------------------------------------------------------- ''' s1_dict = {} s2_dict = {} count = 0 for letter in s1: s1_dict[letter] = s1.count(letter) s1.replace(letter, "") for letter in s2: s2_dict[letter] = s2.count(letter) s2.replace(letter, "") for letter in s1_dict: if letter in s2_dict: if s1_dict[letter] > s2_dict[letter]: count += s2_dict[letter] else: count += s1_dict[letter] return count def oneline(s1, s2): ''' EXPLANATION ------------------------------------------------------------------- keeping_it_leal from Germany comes back again with this far more concise solution to the problem utilizing Python's set() function. The set function returns all unique elements of an iterable. By using this, we can simply create an array of the minimum counts of each unique character in EITHER string (s1 chosen here), and return the sum of these counts. If the character doesn't exist in the second string, the minimum will therein be zero, which is a more implicit way to compare characters between the strings. ------------------------------------------------------------------- ''' return sum([min(s1.count(c),s2.count(c)) for c in set(s1)])
def solution(s1, s2): """ EXPLANATION ------------------------------------------------------------------- I approached this problem by creating two dictionaries, one for each string. These dictionaries are formatted with characters as keys, and counts as values. I then iterate over each string, counting the instances of each character. Finally, I iterate over the first dictionary, and if that character exists in the second dictionary, I add the lesser of the two values to create a total count of shared characters. ------------------------------------------------------------------- """ s1_dict = {} s2_dict = {} count = 0 for letter in s1: s1_dict[letter] = s1.count(letter) s1.replace(letter, '') for letter in s2: s2_dict[letter] = s2.count(letter) s2.replace(letter, '') for letter in s1_dict: if letter in s2_dict: if s1_dict[letter] > s2_dict[letter]: count += s2_dict[letter] else: count += s1_dict[letter] return count def oneline(s1, s2): """ EXPLANATION ------------------------------------------------------------------- keeping_it_leal from Germany comes back again with this far more concise solution to the problem utilizing Python's set() function. The set function returns all unique elements of an iterable. By using this, we can simply create an array of the minimum counts of each unique character in EITHER string (s1 chosen here), and return the sum of these counts. If the character doesn't exist in the second string, the minimum will therein be zero, which is a more implicit way to compare characters between the strings. ------------------------------------------------------------------- """ return sum([min(s1.count(c), s2.count(c)) for c in set(s1)])
class Node: def __init__(self, data=None, left=None, right=None): self._left = left self._data = data self._right = right @property def left(self): return self._left @left.setter def left(self, left): self._left = left @property def right(self): return self._right @right.setter def right(self, right): self._right = right @property def data(self): return self._data @data.setter def data(self, left): self._data = data def spiral(root): stack1 = [] stack2 = [] stack1.append(root) while len(stack1) > 0 or len(stack2) > 0: while len(stack1) > 0: curr_node = stack1.pop() print(curr_node.data) if curr_node.left: stack2.append(curr_node.left) if curr_node.right: stack2.append(curr_node.right) while len(stack2) > 0: curr_node = stack2.pop() print(curr_node.data) if curr_node.right: stack1.append(curr_node.right) if curr_node.left: stack1.append(curr_node.left) def spiral_reverse(root): stack1 = [] stack2 = [] stack1.append(root) while len(stack1) > 0 or len(stack2) > 0: while len(stack1) > 0: curr_node = stack1.pop() print(curr_node.data) if curr_node.right: stack2.append(curr_node.right) if curr_node.left: stack2.append(curr_node.left) while len(stack2) > 0: curr_node = stack2.pop() print(curr_node.data) if curr_node.left: stack1.append(curr_node.left) if curr_node.right: stack1.append(curr_node.right) if __name__ == '__main__': tree = Node(1) tree.left = Node(2) tree.right = Node(3) tree.left.left = Node(4) tree.left.right = Node(5) tree.right.right = Node(7) tree.right.left = Node(18) tree.right.right.right = Node(8) tree.left.right.left = Node(17) tree.left.right.right = Node(6) tree.left.right.left.left = Node(19) spiral_reverse(tree)
class Node: def __init__(self, data=None, left=None, right=None): self._left = left self._data = data self._right = right @property def left(self): return self._left @left.setter def left(self, left): self._left = left @property def right(self): return self._right @right.setter def right(self, right): self._right = right @property def data(self): return self._data @data.setter def data(self, left): self._data = data def spiral(root): stack1 = [] stack2 = [] stack1.append(root) while len(stack1) > 0 or len(stack2) > 0: while len(stack1) > 0: curr_node = stack1.pop() print(curr_node.data) if curr_node.left: stack2.append(curr_node.left) if curr_node.right: stack2.append(curr_node.right) while len(stack2) > 0: curr_node = stack2.pop() print(curr_node.data) if curr_node.right: stack1.append(curr_node.right) if curr_node.left: stack1.append(curr_node.left) def spiral_reverse(root): stack1 = [] stack2 = [] stack1.append(root) while len(stack1) > 0 or len(stack2) > 0: while len(stack1) > 0: curr_node = stack1.pop() print(curr_node.data) if curr_node.right: stack2.append(curr_node.right) if curr_node.left: stack2.append(curr_node.left) while len(stack2) > 0: curr_node = stack2.pop() print(curr_node.data) if curr_node.left: stack1.append(curr_node.left) if curr_node.right: stack1.append(curr_node.right) if __name__ == '__main__': tree = node(1) tree.left = node(2) tree.right = node(3) tree.left.left = node(4) tree.left.right = node(5) tree.right.right = node(7) tree.right.left = node(18) tree.right.right.right = node(8) tree.left.right.left = node(17) tree.left.right.right = node(6) tree.left.right.left.left = node(19) spiral_reverse(tree)
# A resizable list of integers class Vector(object): # Attributes items: [int] = None size: int = 0 # Constructor def __init__(self:"Vector"): self.items = [0] # Returns current capacity def capacity(self:"Vector") -> int: return len(self.items) # Increases capacity of vector by one element def increase_capacity(self:"Vector") -> int: self.items = self.items + [0] return self.capacity() # Appends one item to end of vector def append(self:"Vector", item: int): if self.size == self.capacity(): self.increase_capacity() self.items[self.size] = item self.size = self.size + 1 # A faster (but more memory-consuming) implementation of vector class DoublingVector(Vector): doubling_limit:int = 16 # Overriding to do fewer resizes def increase_capacity(self:"DoublingVector") -> int: if (self.capacity() <= self.doubling_limit // 2): self.items = self.items + self.items else: # If doubling limit has been reached, fall back to # standard capacity increases self.items = self.items + [0] return self.capacity() def vrange(i:int, j:int) -> Vector: v:Vector = None v = DoublingVector() while i < j: v.append(i) i = i + 1 return v vec:Vector = None num:int = 0 # Create a vector and populate it with The Numbers vec = DoublingVector() for num in [4, 8, 15, 16, 23, 42]: vec.append(num) __assert__(vec.capacity() == 8) __assert__(vec.size == 6) __assert__(vec.items[0] == 4) __assert__(vec.items[1] == 8) __assert__(vec.items[2] == 15) __assert__(vec.items[3] == 16) __assert__(vec.items[4] == 23) __assert__(vec.items[5] == 42) # extras from doubling __assert__(vec.items[6] == 15) __assert__(vec.items[7] == 16) vec = Vector() for num in [4, 8, 15, 16, 23, 42]: vec.append(num) __assert__(vec.capacity() == 6) __assert__(vec.size == 6) __assert__(vec.items[0] == 4) __assert__(vec.items[1] == 8) __assert__(vec.items[2] == 15) __assert__(vec.items[3] == 16) __assert__(vec.items[4] == 23) __assert__(vec.items[5] == 42) vec = vrange(0, 1) __assert__(vec.capacity() == 1) __assert__(vec.size == 1) __assert__(vec.items[0] == 0) vec = vrange(0, 2) __assert__(vec.capacity() == 2) __assert__(vec.size == 2) __assert__(vec.items[0] == 0) __assert__(vec.items[1] == 1) vec = vrange(1, 3) __assert__(vec.capacity() == 2) __assert__(vec.size == 2) __assert__(vec.items[0] == 1) __assert__(vec.items[1] == 2) vec = vrange(1, 1) __assert__(vec.capacity() == 1) __assert__(vec.size == 0) vec = vrange(0, -1) __assert__(vec.capacity() == 1) __assert__(vec.size == 0) vec = vrange(1, 100) __assert__(vec.size == 99)
class Vector(object): items: [int] = None size: int = 0 def __init__(self: 'Vector'): self.items = [0] def capacity(self: 'Vector') -> int: return len(self.items) def increase_capacity(self: 'Vector') -> int: self.items = self.items + [0] return self.capacity() def append(self: 'Vector', item: int): if self.size == self.capacity(): self.increase_capacity() self.items[self.size] = item self.size = self.size + 1 class Doublingvector(Vector): doubling_limit: int = 16 def increase_capacity(self: 'DoublingVector') -> int: if self.capacity() <= self.doubling_limit // 2: self.items = self.items + self.items else: self.items = self.items + [0] return self.capacity() def vrange(i: int, j: int) -> Vector: v: Vector = None v = doubling_vector() while i < j: v.append(i) i = i + 1 return v vec: Vector = None num: int = 0 vec = doubling_vector() for num in [4, 8, 15, 16, 23, 42]: vec.append(num) __assert__(vec.capacity() == 8) __assert__(vec.size == 6) __assert__(vec.items[0] == 4) __assert__(vec.items[1] == 8) __assert__(vec.items[2] == 15) __assert__(vec.items[3] == 16) __assert__(vec.items[4] == 23) __assert__(vec.items[5] == 42) __assert__(vec.items[6] == 15) __assert__(vec.items[7] == 16) vec = vector() for num in [4, 8, 15, 16, 23, 42]: vec.append(num) __assert__(vec.capacity() == 6) __assert__(vec.size == 6) __assert__(vec.items[0] == 4) __assert__(vec.items[1] == 8) __assert__(vec.items[2] == 15) __assert__(vec.items[3] == 16) __assert__(vec.items[4] == 23) __assert__(vec.items[5] == 42) vec = vrange(0, 1) __assert__(vec.capacity() == 1) __assert__(vec.size == 1) __assert__(vec.items[0] == 0) vec = vrange(0, 2) __assert__(vec.capacity() == 2) __assert__(vec.size == 2) __assert__(vec.items[0] == 0) __assert__(vec.items[1] == 1) vec = vrange(1, 3) __assert__(vec.capacity() == 2) __assert__(vec.size == 2) __assert__(vec.items[0] == 1) __assert__(vec.items[1] == 2) vec = vrange(1, 1) __assert__(vec.capacity() == 1) __assert__(vec.size == 0) vec = vrange(0, -1) __assert__(vec.capacity() == 1) __assert__(vec.size == 0) vec = vrange(1, 100) __assert__(vec.size == 99)
#!/usr/bin/python3 # File: fizz_buzz.py # Author: Jonathan Belden # Description: Fizz-Buzz Coding Challenge # Reference: https://edabit.com/challenge/WXqH9qvvGkmx4dMvp def evaluate(inputValue): result = None if inputValue % 3 == 0 and inputValue % 5 == 0: result = "FizzBuzz" elif inputValue % 3 == 0: result = "Fizz" elif inputValue % 5 == 0: result = "Buzz" else: result = str(inputValue) return result
def evaluate(inputValue): result = None if inputValue % 3 == 0 and inputValue % 5 == 0: result = 'FizzBuzz' elif inputValue % 3 == 0: result = 'Fizz' elif inputValue % 5 == 0: result = 'Buzz' else: result = str(inputValue) return result
class Solution: """ @param A: @return: nothing """ def numFactoredBinaryTrees(self, A): A.sort() MOD = 10 ** 9 + 7 dp = {} for j in range(len(A)): dp[A[j]] = 1 for i in range(j): if A[j] % A[i] == 0: num = A[j] // A[i] if num in dp: dp[A[j]] = (dp[A[j]] + dp[A[i]] * dp[num]) % MOD return sum(dp.values()) % MOD
class Solution: """ @param A: @return: nothing """ def num_factored_binary_trees(self, A): A.sort() mod = 10 ** 9 + 7 dp = {} for j in range(len(A)): dp[A[j]] = 1 for i in range(j): if A[j] % A[i] == 0: num = A[j] // A[i] if num in dp: dp[A[j]] = (dp[A[j]] + dp[A[i]] * dp[num]) % MOD return sum(dp.values()) % MOD
def multiplo(a, b): if a % b == 0: return True else: return False print(multiplo(2, 1)) print(multiplo(9, 5)) print(multiplo(81, 9))
def multiplo(a, b): if a % b == 0: return True else: return False print(multiplo(2, 1)) print(multiplo(9, 5)) print(multiplo(81, 9))
valores = [] quant = int(input()) for c in range(0, quant): x, y = input().split(' ') x = int(x) y = int(y) maior = menor = soma = 0 if x > y: maior = x menor = y else: maior = y menor = x if maior == menor+1 or maior == menor: valores.append(0) else: for i in range(menor+1, maior): if i % 2 != 0: soma += i if i+1 == maior: valores.append(soma) for valor in valores: print(valor)
valores = [] quant = int(input()) for c in range(0, quant): (x, y) = input().split(' ') x = int(x) y = int(y) maior = menor = soma = 0 if x > y: maior = x menor = y else: maior = y menor = x if maior == menor + 1 or maior == menor: valores.append(0) else: for i in range(menor + 1, maior): if i % 2 != 0: soma += i if i + 1 == maior: valores.append(soma) for valor in valores: print(valor)
def binary_search(collection, lhs, rhs, value): if rhs > lhs: mid = lhs + (rhs - lhs) // 2 if collection[mid] == value: return mid if collection[mid] > value: return binary_search(collection, lhs, mid-1, value) return binary_search(collection, mid+1, rhs, value) return -1 def eq(exp, val): assert exp == val, f'Expected: {exp}, got value {val}' def main(): tests = [ (0, 5, [5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15]), (8, 13, [5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15]), (8, 9, [1,2,3,4,5,6,7,8,9]), ] for expected, value, collection in tests: eq(expected, binary_search(collection, 0, len(collection), value)) if __name__ == '__main__': main() print('success')
def binary_search(collection, lhs, rhs, value): if rhs > lhs: mid = lhs + (rhs - lhs) // 2 if collection[mid] == value: return mid if collection[mid] > value: return binary_search(collection, lhs, mid - 1, value) return binary_search(collection, mid + 1, rhs, value) return -1 def eq(exp, val): assert exp == val, f'Expected: {exp}, got value {val}' def main(): tests = [(0, 5, [5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15]), (8, 13, [5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15]), (8, 9, [1, 2, 3, 4, 5, 6, 7, 8, 9])] for (expected, value, collection) in tests: eq(expected, binary_search(collection, 0, len(collection), value)) if __name__ == '__main__': main() print('success')
click(Pattern("Bameumbrace.png").similar(0.80)) sleep(1) click("3abnb.png") exit(0)
click(pattern('Bameumbrace.png').similar(0.8)) sleep(1) click('3abnb.png') exit(0)
class Rover: def __init__(self,photo,name,date): self.photo = photo self.name = name self.date = date class Articles: def __init__(self,author,title,description,url,poster,time): self.author = author self.title = title self.description = description self.url = url self.poster = poster self.time = time
class Rover: def __init__(self, photo, name, date): self.photo = photo self.name = name self.date = date class Articles: def __init__(self, author, title, description, url, poster, time): self.author = author self.title = title self.description = description self.url = url self.poster = poster self.time = time
'''https://leetcode.com/problems/max-consecutive-ones/''' class Solution: def findMaxConsecutiveOnes(self, nums: List[int]) -> int: i, j = 0, 0 ans = 0 while j<len(nums): if nums[j]==0: ans = max(ans, j-i) i = j+1 j+=1 return max(ans, j-i)
"""https://leetcode.com/problems/max-consecutive-ones/""" class Solution: def find_max_consecutive_ones(self, nums: List[int]) -> int: (i, j) = (0, 0) ans = 0 while j < len(nums): if nums[j] == 0: ans = max(ans, j - i) i = j + 1 j += 1 return max(ans, j - i)
class Solution: def snakesAndLadders(self, board: List[List[int]]) -> int: n = len(board) q = collections.deque() q.append(1) visited = set() visited.add(1) step = 0 while q: size = len(q) for _ in range(size): num = q.popleft() if num == n*n: return step for i in range(1,7): if num+i > n*n: break nxt = self.getValue(board, num+i) if nxt == -1: nxt = num+i if nxt not in visited: q.append(nxt) visited.add(nxt) step += 1 return -1 def getValue(self, board, num): n = len(board) x = (num-1)//n y = (num-1)%n if x%2 == 1: y = n-1-y x = n-1-x return board[x][y]
class Solution: def snakes_and_ladders(self, board: List[List[int]]) -> int: n = len(board) q = collections.deque() q.append(1) visited = set() visited.add(1) step = 0 while q: size = len(q) for _ in range(size): num = q.popleft() if num == n * n: return step for i in range(1, 7): if num + i > n * n: break nxt = self.getValue(board, num + i) if nxt == -1: nxt = num + i if nxt not in visited: q.append(nxt) visited.add(nxt) step += 1 return -1 def get_value(self, board, num): n = len(board) x = (num - 1) // n y = (num - 1) % n if x % 2 == 1: y = n - 1 - y x = n - 1 - x return board[x][y]
def mergingLetters(s, t): #edge cases mergedStr = "" firstChar = list(s) secondChar = list(t) for i, ele in enumerate(secondChar): if i < len(firstChar): mergedStr = mergedStr + firstChar[i] print('first pointer', firstChar[i], mergedStr) if i < len(secondChar): mergedStr = mergedStr + secondChar[i] print('second pointer', secondChar[i], "merged",mergedStr) return mergedStr print(mergingLetters('abcd', 'jjjjjjj'))
def merging_letters(s, t): merged_str = '' first_char = list(s) second_char = list(t) for (i, ele) in enumerate(secondChar): if i < len(firstChar): merged_str = mergedStr + firstChar[i] print('first pointer', firstChar[i], mergedStr) if i < len(secondChar): merged_str = mergedStr + secondChar[i] print('second pointer', secondChar[i], 'merged', mergedStr) return mergedStr print(merging_letters('abcd', 'jjjjjjj'))
# # PySNMP MIB module TIMETRA-SAS-IEEE8021-PAE-MIB (http://snmplabs.com/pysmi) # ASN.1 source file:///Users/davwang4/Dev/mibs.snmplabs.com/asn1/TIMETRA-SAS-IEEE8021-PAE-MIB # Produced by pysmi-0.3.4 at Wed May 1 15:21:45 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") ConstraintsUnion, SingleValueConstraint, ValueSizeConstraint, ValueRangeConstraint, ConstraintsIntersection = mibBuilder.importSymbols("ASN1-REFINEMENT", "ConstraintsUnion", "SingleValueConstraint", "ValueSizeConstraint", "ValueRangeConstraint", "ConstraintsIntersection") dot1xAuthConfigEntry, = mibBuilder.importSymbols("IEEE8021-PAE-MIB", "dot1xAuthConfigEntry") ModuleCompliance, NotificationGroup, ObjectGroup = mibBuilder.importSymbols("SNMPv2-CONF", "ModuleCompliance", "NotificationGroup", "ObjectGroup") Counter32, NotificationType, Gauge32, MibIdentifier, ModuleIdentity, Bits, TimeTicks, MibScalar, MibTable, MibTableRow, MibTableColumn, ObjectIdentity, iso, Integer32, Counter64, IpAddress, Unsigned32 = mibBuilder.importSymbols("SNMPv2-SMI", "Counter32", "NotificationType", "Gauge32", "MibIdentifier", "ModuleIdentity", "Bits", "TimeTicks", "MibScalar", "MibTable", "MibTableRow", "MibTableColumn", "ObjectIdentity", "iso", "Integer32", "Counter64", "IpAddress", "Unsigned32") DisplayString, TruthValue, TextualConvention, RowStatus = mibBuilder.importSymbols("SNMPv2-TC", "DisplayString", "TruthValue", "TextualConvention", "RowStatus") timetraSASNotifyPrefix, timetraSASConfs, timetraSASModules, timetraSASObjs = mibBuilder.importSymbols("TIMETRA-SAS-GLOBAL-MIB", "timetraSASNotifyPrefix", "timetraSASConfs", "timetraSASModules", "timetraSASObjs") TNamedItem, TPolicyStatementNameOrEmpty, ServiceAdminStatus = mibBuilder.importSymbols("TIMETRA-TC-MIB", "TNamedItem", "TPolicyStatementNameOrEmpty", "ServiceAdminStatus") timeraSASIEEE8021PaeMIBModule = ModuleIdentity((1, 3, 6, 1, 4, 1, 6527, 6, 2, 1, 1, 17)) timeraSASIEEE8021PaeMIBModule.setRevisions(('1912-07-01 00:00',)) if getattr(mibBuilder, 'version', (0, 0, 0)) > (4, 4, 0): if mibBuilder.loadTexts: timeraSASIEEE8021PaeMIBModule.setRevisionsDescriptions(('Rev 1.0 03 Aug 2012 00:00 1.0 release of the ALCATEL-SAS-IEEE8021-PAE-MIB.',)) if mibBuilder.loadTexts: timeraSASIEEE8021PaeMIBModule.setLastUpdated('1207010000Z') if mibBuilder.loadTexts: timeraSASIEEE8021PaeMIBModule.setOrganization('Alcatel-Lucent') if mibBuilder.loadTexts: timeraSASIEEE8021PaeMIBModule.setContactInfo('Alcatel-Lucent SROS Support Web: http://support.alcatel-lucent.com ') if mibBuilder.loadTexts: timeraSASIEEE8021PaeMIBModule.setDescription("This document is the SNMP MIB module to manage and provision the 7x50 extensions to the IEEE8021-PAE-MIB (Port Access Entity nodule for managing IEEE 802.X) feature for the Alcatel 7210 device. Copyright 2004-2012 Alcatel-Lucent. All rights reserved. Reproduction of this document is authorized on the condition that the foregoing copyright notice is included. This SNMP MIB module (Specification) embodies Alcatel-Lucent's proprietary intellectual property. Alcatel-Lucent retains all title and ownership in the Specification, including any revisions. Alcatel-Lucent grants all interested parties a non-exclusive license to use and distribute an unmodified copy of this Specification in connection with management of Alcatel-Lucent products, and without fee, provided this copyright notice and license appear on all copies. This Specification is supplied 'as is', and Alcatel-Lucent makes no warranty, either express or implied, as to the use, operation, condition, or performance of the Specification.") tmnxSASDot1xObjs = MibIdentifier((1, 3, 6, 1, 4, 1, 6527, 6, 2, 2, 2, 16)) tmnxSASDot1xAuthenticatorObjs = MibIdentifier((1, 3, 6, 1, 4, 1, 6527, 6, 2, 2, 2, 16, 1)) tmnxSASDot1xConformance = MibIdentifier((1, 3, 6, 1, 4, 1, 6527, 6, 2, 2, 1, 12)) tmnxDot1xSASCompliancs = MibIdentifier((1, 3, 6, 1, 4, 1, 6527, 6, 2, 2, 1, 12, 1)) tmnxDot1xSASGroups = MibIdentifier((1, 3, 6, 1, 4, 1, 6527, 6, 2, 2, 1, 12, 2)) dot1xAuthConfigExtnTable = MibTable((1, 3, 6, 1, 4, 1, 6527, 6, 2, 2, 2, 16, 1, 1), ) if mibBuilder.loadTexts: dot1xAuthConfigExtnTable.setStatus('current') if mibBuilder.loadTexts: dot1xAuthConfigExtnTable.setDescription('The table dot1xAuthConfigExtnTable allows configuration of RADIUS authentication parameters for the 802.1X PAE feature on port level.') dot1xAuthConfigExtnEntry = MibTableRow((1, 3, 6, 1, 4, 1, 6527, 6, 2, 2, 2, 16, 1, 1, 1), ) dot1xAuthConfigEntry.registerAugmentions(("TIMETRA-SAS-IEEE8021-PAE-MIB", "dot1xAuthConfigExtnEntry")) dot1xAuthConfigExtnEntry.setIndexNames(*dot1xAuthConfigEntry.getIndexNames()) if mibBuilder.loadTexts: dot1xAuthConfigExtnEntry.setStatus('current') if mibBuilder.loadTexts: dot1xAuthConfigExtnEntry.setDescription('dot1xAuthConfigExtnEntry is an entry (conceptual row) in the dot1xAuthConfigExtnTable. Each entry represents the configuration for Radius Authentication on a port. Entries have a presumed StorageType of nonVolatile.') dot1xPortEtherTunnel = MibTableColumn((1, 3, 6, 1, 4, 1, 6527, 6, 2, 2, 2, 16, 1, 1, 1, 150), TruthValue().clone('false')).setMaxAccess("readwrite") if mibBuilder.loadTexts: dot1xPortEtherTunnel.setStatus('current') if mibBuilder.loadTexts: dot1xPortEtherTunnel.setDescription('The value of tmnxPortEtherDot1xTunnel specifies whether the DOT1X packet tunneling for the ethernet port is enabled or disabled. When tunneling is enabled, the port will not process any DOT1X packets but will tunnel them through instead.') dot1xAuthConfigExtnGroup = ObjectGroup((1, 3, 6, 1, 4, 1, 6527, 6, 2, 2, 1, 12, 2, 1)).setObjects(("TIMETRA-SAS-IEEE8021-PAE-MIB", "dot1xPortEtherTunnel")) if getattr(mibBuilder, 'version', (0, 0, 0)) > (4, 4, 0): dot1xAuthConfigExtnGroup = dot1xAuthConfigExtnGroup.setStatus('current') if mibBuilder.loadTexts: dot1xAuthConfigExtnGroup.setDescription('The group of objects supporting management of Radius authentication for the IEEE801.1X PAE feature on Alcatel 7210 SR series systems.') dot1xAuthConfigExtnCompliance = ModuleCompliance((1, 3, 6, 1, 4, 1, 6527, 6, 2, 2, 1, 12, 1, 1)).setObjects(("TIMETRA-SAS-IEEE8021-PAE-MIB", "dot1xAuthConfigExtnGroup")) if getattr(mibBuilder, 'version', (0, 0, 0)) > (4, 4, 0): dot1xAuthConfigExtnCompliance = dot1xAuthConfigExtnCompliance.setStatus('current') if mibBuilder.loadTexts: dot1xAuthConfigExtnCompliance.setDescription('The compliance statement for management of Radius authentication for the IEEE801.1X PAE feature on Alcatel 7210 SR series systems.') mibBuilder.exportSymbols("TIMETRA-SAS-IEEE8021-PAE-MIB", dot1xAuthConfigExtnGroup=dot1xAuthConfigExtnGroup, dot1xAuthConfigExtnEntry=dot1xAuthConfigExtnEntry, tmnxSASDot1xObjs=tmnxSASDot1xObjs, timeraSASIEEE8021PaeMIBModule=timeraSASIEEE8021PaeMIBModule, tmnxDot1xSASGroups=tmnxDot1xSASGroups, PYSNMP_MODULE_ID=timeraSASIEEE8021PaeMIBModule, dot1xAuthConfigExtnCompliance=dot1xAuthConfigExtnCompliance, tmnxDot1xSASCompliancs=tmnxDot1xSASCompliancs, dot1xPortEtherTunnel=dot1xPortEtherTunnel, tmnxSASDot1xConformance=tmnxSASDot1xConformance, dot1xAuthConfigExtnTable=dot1xAuthConfigExtnTable, tmnxSASDot1xAuthenticatorObjs=tmnxSASDot1xAuthenticatorObjs)
(integer, object_identifier, octet_string) = mibBuilder.importSymbols('ASN1', 'Integer', 'ObjectIdentifier', 'OctetString') (named_values,) = mibBuilder.importSymbols('ASN1-ENUMERATION', 'NamedValues') (constraints_union, single_value_constraint, value_size_constraint, value_range_constraint, constraints_intersection) = mibBuilder.importSymbols('ASN1-REFINEMENT', 'ConstraintsUnion', 'SingleValueConstraint', 'ValueSizeConstraint', 'ValueRangeConstraint', 'ConstraintsIntersection') (dot1x_auth_config_entry,) = mibBuilder.importSymbols('IEEE8021-PAE-MIB', 'dot1xAuthConfigEntry') (module_compliance, notification_group, object_group) = mibBuilder.importSymbols('SNMPv2-CONF', 'ModuleCompliance', 'NotificationGroup', 'ObjectGroup') (counter32, notification_type, gauge32, mib_identifier, module_identity, bits, time_ticks, mib_scalar, mib_table, mib_table_row, mib_table_column, object_identity, iso, integer32, counter64, ip_address, unsigned32) = mibBuilder.importSymbols('SNMPv2-SMI', 'Counter32', 'NotificationType', 'Gauge32', 'MibIdentifier', 'ModuleIdentity', 'Bits', 'TimeTicks', 'MibScalar', 'MibTable', 'MibTableRow', 'MibTableColumn', 'ObjectIdentity', 'iso', 'Integer32', 'Counter64', 'IpAddress', 'Unsigned32') (display_string, truth_value, textual_convention, row_status) = mibBuilder.importSymbols('SNMPv2-TC', 'DisplayString', 'TruthValue', 'TextualConvention', 'RowStatus') (timetra_sas_notify_prefix, timetra_sas_confs, timetra_sas_modules, timetra_sas_objs) = mibBuilder.importSymbols('TIMETRA-SAS-GLOBAL-MIB', 'timetraSASNotifyPrefix', 'timetraSASConfs', 'timetraSASModules', 'timetraSASObjs') (t_named_item, t_policy_statement_name_or_empty, service_admin_status) = mibBuilder.importSymbols('TIMETRA-TC-MIB', 'TNamedItem', 'TPolicyStatementNameOrEmpty', 'ServiceAdminStatus') timera_sasieee8021_pae_mib_module = module_identity((1, 3, 6, 1, 4, 1, 6527, 6, 2, 1, 1, 17)) timeraSASIEEE8021PaeMIBModule.setRevisions(('1912-07-01 00:00',)) if getattr(mibBuilder, 'version', (0, 0, 0)) > (4, 4, 0): if mibBuilder.loadTexts: timeraSASIEEE8021PaeMIBModule.setRevisionsDescriptions(('Rev 1.0 03 Aug 2012 00:00 1.0 release of the ALCATEL-SAS-IEEE8021-PAE-MIB.',)) if mibBuilder.loadTexts: timeraSASIEEE8021PaeMIBModule.setLastUpdated('1207010000Z') if mibBuilder.loadTexts: timeraSASIEEE8021PaeMIBModule.setOrganization('Alcatel-Lucent') if mibBuilder.loadTexts: timeraSASIEEE8021PaeMIBModule.setContactInfo('Alcatel-Lucent SROS Support Web: http://support.alcatel-lucent.com ') if mibBuilder.loadTexts: timeraSASIEEE8021PaeMIBModule.setDescription("This document is the SNMP MIB module to manage and provision the 7x50 extensions to the IEEE8021-PAE-MIB (Port Access Entity nodule for managing IEEE 802.X) feature for the Alcatel 7210 device. Copyright 2004-2012 Alcatel-Lucent. All rights reserved. Reproduction of this document is authorized on the condition that the foregoing copyright notice is included. This SNMP MIB module (Specification) embodies Alcatel-Lucent's proprietary intellectual property. Alcatel-Lucent retains all title and ownership in the Specification, including any revisions. Alcatel-Lucent grants all interested parties a non-exclusive license to use and distribute an unmodified copy of this Specification in connection with management of Alcatel-Lucent products, and without fee, provided this copyright notice and license appear on all copies. This Specification is supplied 'as is', and Alcatel-Lucent makes no warranty, either express or implied, as to the use, operation, condition, or performance of the Specification.") tmnx_sas_dot1x_objs = mib_identifier((1, 3, 6, 1, 4, 1, 6527, 6, 2, 2, 2, 16)) tmnx_sas_dot1x_authenticator_objs = mib_identifier((1, 3, 6, 1, 4, 1, 6527, 6, 2, 2, 2, 16, 1)) tmnx_sas_dot1x_conformance = mib_identifier((1, 3, 6, 1, 4, 1, 6527, 6, 2, 2, 1, 12)) tmnx_dot1x_sas_compliancs = mib_identifier((1, 3, 6, 1, 4, 1, 6527, 6, 2, 2, 1, 12, 1)) tmnx_dot1x_sas_groups = mib_identifier((1, 3, 6, 1, 4, 1, 6527, 6, 2, 2, 1, 12, 2)) dot1x_auth_config_extn_table = mib_table((1, 3, 6, 1, 4, 1, 6527, 6, 2, 2, 2, 16, 1, 1)) if mibBuilder.loadTexts: dot1xAuthConfigExtnTable.setStatus('current') if mibBuilder.loadTexts: dot1xAuthConfigExtnTable.setDescription('The table dot1xAuthConfigExtnTable allows configuration of RADIUS authentication parameters for the 802.1X PAE feature on port level.') dot1x_auth_config_extn_entry = mib_table_row((1, 3, 6, 1, 4, 1, 6527, 6, 2, 2, 2, 16, 1, 1, 1)) dot1xAuthConfigEntry.registerAugmentions(('TIMETRA-SAS-IEEE8021-PAE-MIB', 'dot1xAuthConfigExtnEntry')) dot1xAuthConfigExtnEntry.setIndexNames(*dot1xAuthConfigEntry.getIndexNames()) if mibBuilder.loadTexts: dot1xAuthConfigExtnEntry.setStatus('current') if mibBuilder.loadTexts: dot1xAuthConfigExtnEntry.setDescription('dot1xAuthConfigExtnEntry is an entry (conceptual row) in the dot1xAuthConfigExtnTable. Each entry represents the configuration for Radius Authentication on a port. Entries have a presumed StorageType of nonVolatile.') dot1x_port_ether_tunnel = mib_table_column((1, 3, 6, 1, 4, 1, 6527, 6, 2, 2, 2, 16, 1, 1, 1, 150), truth_value().clone('false')).setMaxAccess('readwrite') if mibBuilder.loadTexts: dot1xPortEtherTunnel.setStatus('current') if mibBuilder.loadTexts: dot1xPortEtherTunnel.setDescription('The value of tmnxPortEtherDot1xTunnel specifies whether the DOT1X packet tunneling for the ethernet port is enabled or disabled. When tunneling is enabled, the port will not process any DOT1X packets but will tunnel them through instead.') dot1x_auth_config_extn_group = object_group((1, 3, 6, 1, 4, 1, 6527, 6, 2, 2, 1, 12, 2, 1)).setObjects(('TIMETRA-SAS-IEEE8021-PAE-MIB', 'dot1xPortEtherTunnel')) if getattr(mibBuilder, 'version', (0, 0, 0)) > (4, 4, 0): dot1x_auth_config_extn_group = dot1xAuthConfigExtnGroup.setStatus('current') if mibBuilder.loadTexts: dot1xAuthConfigExtnGroup.setDescription('The group of objects supporting management of Radius authentication for the IEEE801.1X PAE feature on Alcatel 7210 SR series systems.') dot1x_auth_config_extn_compliance = module_compliance((1, 3, 6, 1, 4, 1, 6527, 6, 2, 2, 1, 12, 1, 1)).setObjects(('TIMETRA-SAS-IEEE8021-PAE-MIB', 'dot1xAuthConfigExtnGroup')) if getattr(mibBuilder, 'version', (0, 0, 0)) > (4, 4, 0): dot1x_auth_config_extn_compliance = dot1xAuthConfigExtnCompliance.setStatus('current') if mibBuilder.loadTexts: dot1xAuthConfigExtnCompliance.setDescription('The compliance statement for management of Radius authentication for the IEEE801.1X PAE feature on Alcatel 7210 SR series systems.') mibBuilder.exportSymbols('TIMETRA-SAS-IEEE8021-PAE-MIB', dot1xAuthConfigExtnGroup=dot1xAuthConfigExtnGroup, dot1xAuthConfigExtnEntry=dot1xAuthConfigExtnEntry, tmnxSASDot1xObjs=tmnxSASDot1xObjs, timeraSASIEEE8021PaeMIBModule=timeraSASIEEE8021PaeMIBModule, tmnxDot1xSASGroups=tmnxDot1xSASGroups, PYSNMP_MODULE_ID=timeraSASIEEE8021PaeMIBModule, dot1xAuthConfigExtnCompliance=dot1xAuthConfigExtnCompliance, tmnxDot1xSASCompliancs=tmnxDot1xSASCompliancs, dot1xPortEtherTunnel=dot1xPortEtherTunnel, tmnxSASDot1xConformance=tmnxSASDot1xConformance, dot1xAuthConfigExtnTable=dot1xAuthConfigExtnTable, tmnxSASDot1xAuthenticatorObjs=tmnxSASDot1xAuthenticatorObjs)
x = 0 y = 0 aim = 0 with open('input') as f: for line in f: direction = line.split()[0] magnitude = int(line.split()[1]) if direction == 'forward': x += magnitude y += aim * magnitude elif direction == 'down': aim += magnitude elif direction == 'up': aim -= magnitude print(str(x * y))
x = 0 y = 0 aim = 0 with open('input') as f: for line in f: direction = line.split()[0] magnitude = int(line.split()[1]) if direction == 'forward': x += magnitude y += aim * magnitude elif direction == 'down': aim += magnitude elif direction == 'up': aim -= magnitude print(str(x * y))
# # PySNMP MIB module PRIVATE-SW0657840-MIB (http://snmplabs.com/pysmi) # ASN.1 source file:///Users/davwang4/Dev/mibs.snmplabs.com/asn1/PRIVATE-SW0657840-MIB # Produced by pysmi-0.3.4 at Mon Apr 29 20:33:18 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") ConstraintsUnion, ValueRangeConstraint, SingleValueConstraint, ConstraintsIntersection, ValueSizeConstraint = mibBuilder.importSymbols("ASN1-REFINEMENT", "ConstraintsUnion", "ValueRangeConstraint", "SingleValueConstraint", "ConstraintsIntersection", "ValueSizeConstraint") ifIndex, = mibBuilder.importSymbols("IF-MIB", "ifIndex") NotificationGroup, ModuleCompliance, ObjectGroup = mibBuilder.importSymbols("SNMPv2-CONF", "NotificationGroup", "ModuleCompliance", "ObjectGroup") Integer32, Counter64, Counter32, MibIdentifier, iso, Gauge32, enterprises, TimeTicks, MibScalar, MibTable, MibTableRow, MibTableColumn, ModuleIdentity, ObjectIdentity, Unsigned32, IpAddress, Bits, NotificationType = mibBuilder.importSymbols("SNMPv2-SMI", "Integer32", "Counter64", "Counter32", "MibIdentifier", "iso", "Gauge32", "enterprises", "TimeTicks", "MibScalar", "MibTable", "MibTableRow", "MibTableColumn", "ModuleIdentity", "ObjectIdentity", "Unsigned32", "IpAddress", "Bits", "NotificationType") DisplayString, TextualConvention = mibBuilder.importSymbols("SNMPv2-TC", "DisplayString", "TextualConvention") privatetech = ModuleIdentity((1, 3, 6, 1, 4, 1, 5205)) if mibBuilder.loadTexts: privatetech.setLastUpdated('200607030000Z') if mibBuilder.loadTexts: privatetech.setOrganization('xxx Tech Corp.') switch = MibIdentifier((1, 3, 6, 1, 4, 1, 5205, 2)) sw0657840ProductID = MibIdentifier((1, 3, 6, 1, 4, 1, 5205, 2, 9)) sw0657840Produces = MibIdentifier((1, 3, 6, 1, 4, 1, 5205, 2, 9, 1)) sw0657840System = MibIdentifier((1, 3, 6, 1, 4, 1, 5205, 2, 9, 1, 1)) sw0657840CommonSys = MibIdentifier((1, 3, 6, 1, 4, 1, 5205, 2, 9, 1, 1, 1)) sw0657840Reboot = MibScalar((1, 3, 6, 1, 4, 1, 5205, 2, 9, 1, 1, 1, 1), Integer32().subtype(subtypeSpec=ConstraintsUnion(ValueRangeConstraint(0, 0), ValueRangeConstraint(1, 1), ValueRangeConstraint(2, 2), ))).setMaxAccess("readwrite") if mibBuilder.loadTexts: sw0657840Reboot.setStatus('current') sw0657840BiosVsersion = MibScalar((1, 3, 6, 1, 4, 1, 5205, 2, 9, 1, 1, 1, 2), DisplayString()).setMaxAccess("readonly") if mibBuilder.loadTexts: sw0657840BiosVsersion.setStatus('current') sw0657840FirmwareVersion = MibScalar((1, 3, 6, 1, 4, 1, 5205, 2, 9, 1, 1, 1, 3), DisplayString()).setMaxAccess("readonly") if mibBuilder.loadTexts: sw0657840FirmwareVersion.setStatus('current') sw0657840HardwareVersion = MibScalar((1, 3, 6, 1, 4, 1, 5205, 2, 9, 1, 1, 1, 4), DisplayString()).setMaxAccess("readonly") if mibBuilder.loadTexts: sw0657840HardwareVersion.setStatus('current') sw0657840MechanicalVersion = MibScalar((1, 3, 6, 1, 4, 1, 5205, 2, 9, 1, 1, 1, 5), DisplayString()).setMaxAccess("readonly") if mibBuilder.loadTexts: sw0657840MechanicalVersion.setStatus('current') sw0657840SerialNumber = MibScalar((1, 3, 6, 1, 4, 1, 5205, 2, 9, 1, 1, 1, 6), DisplayString()).setMaxAccess("readonly") if mibBuilder.loadTexts: sw0657840SerialNumber.setStatus('current') sw0657840HostMacAddress = MibScalar((1, 3, 6, 1, 4, 1, 5205, 2, 9, 1, 1, 1, 7), DisplayString()).setMaxAccess("readonly") if mibBuilder.loadTexts: sw0657840HostMacAddress.setStatus('current') sw0657840DevicePort = MibScalar((1, 3, 6, 1, 4, 1, 5205, 2, 9, 1, 1, 1, 8), DisplayString()).setMaxAccess("readonly") if mibBuilder.loadTexts: sw0657840DevicePort.setStatus('current') sw0657840RamSize = MibScalar((1, 3, 6, 1, 4, 1, 5205, 2, 9, 1, 1, 1, 9), DisplayString()).setMaxAccess("readonly") if mibBuilder.loadTexts: sw0657840RamSize.setStatus('current') sw0657840FlashSize = MibScalar((1, 3, 6, 1, 4, 1, 5205, 2, 9, 1, 1, 1, 10), DisplayString()).setMaxAccess("readonly") if mibBuilder.loadTexts: sw0657840FlashSize.setStatus('current') sw0657840IP = MibIdentifier((1, 3, 6, 1, 4, 1, 5205, 2, 9, 1, 1, 2)) sw0657840DhcpSetting = MibScalar((1, 3, 6, 1, 4, 1, 5205, 2, 9, 1, 1, 2, 1), Integer32().subtype(subtypeSpec=ConstraintsUnion(ValueRangeConstraint(0, 0), ValueRangeConstraint(1, 1), ))).setMaxAccess("readwrite") if mibBuilder.loadTexts: sw0657840DhcpSetting.setStatus('current') sw0657840IPAddress = MibScalar((1, 3, 6, 1, 4, 1, 5205, 2, 9, 1, 1, 2, 2), IpAddress()).setMaxAccess("readwrite") if mibBuilder.loadTexts: sw0657840IPAddress.setStatus('current') sw0657840NetMask = MibScalar((1, 3, 6, 1, 4, 1, 5205, 2, 9, 1, 1, 2, 3), IpAddress()).setMaxAccess("readwrite") if mibBuilder.loadTexts: sw0657840NetMask.setStatus('current') sw0657840DefaultGateway = MibScalar((1, 3, 6, 1, 4, 1, 5205, 2, 9, 1, 1, 2, 4), IpAddress()).setMaxAccess("readwrite") if mibBuilder.loadTexts: sw0657840DefaultGateway.setStatus('current') sw0657840DnsSetting = MibScalar((1, 3, 6, 1, 4, 1, 5205, 2, 9, 1, 1, 2, 5), Integer32().subtype(subtypeSpec=ConstraintsUnion(ValueRangeConstraint(0, 0), ValueRangeConstraint(1, 1), ))).setMaxAccess("readwrite") if mibBuilder.loadTexts: sw0657840DnsSetting.setStatus('current') sw0657840DnsServer = MibScalar((1, 3, 6, 1, 4, 1, 5205, 2, 9, 1, 1, 2, 6), IpAddress()).setMaxAccess("readwrite") if mibBuilder.loadTexts: sw0657840DnsServer.setStatus('current') sw0657840Time = MibIdentifier((1, 3, 6, 1, 4, 1, 5205, 2, 9, 1, 1, 3)) sw0657840SystemCurrentTime = MibScalar((1, 3, 6, 1, 4, 1, 5205, 2, 9, 1, 1, 3, 1), DisplayString()).setMaxAccess("readonly") if mibBuilder.loadTexts: sw0657840SystemCurrentTime.setStatus('current') sw0657840ManualTimeSetting = MibScalar((1, 3, 6, 1, 4, 1, 5205, 2, 9, 1, 1, 3, 2), DisplayString()).setMaxAccess("readwrite") if mibBuilder.loadTexts: sw0657840ManualTimeSetting.setStatus('current') sw0657840NTPServer = MibScalar((1, 3, 6, 1, 4, 1, 5205, 2, 9, 1, 1, 3, 3), DisplayString()).setMaxAccess("readwrite") if mibBuilder.loadTexts: sw0657840NTPServer.setStatus('current') sw0657840NTPTimeZone = MibScalar((1, 3, 6, 1, 4, 1, 5205, 2, 9, 1, 1, 3, 4), Integer32().subtype(subtypeSpec=ValueRangeConstraint(-12, 13))).setMaxAccess("readwrite") if mibBuilder.loadTexts: sw0657840NTPTimeZone.setStatus('current') sw0657840NTPTimeSync = MibScalar((1, 3, 6, 1, 4, 1, 5205, 2, 9, 1, 1, 3, 5), Integer32().subtype(subtypeSpec=ConstraintsUnion(ValueRangeConstraint(0, 0), ValueRangeConstraint(1, 1), ))).setMaxAccess("readwrite") if mibBuilder.loadTexts: sw0657840NTPTimeSync.setStatus('current') sw0657840DaylightSavingTime = MibScalar((1, 3, 6, 1, 4, 1, 5205, 2, 9, 1, 1, 3, 6), Integer32().subtype(subtypeSpec=ValueRangeConstraint(-5, 5))).setMaxAccess("readwrite") if mibBuilder.loadTexts: sw0657840DaylightSavingTime.setStatus('current') sw0657840DaylightStartTime = MibScalar((1, 3, 6, 1, 4, 1, 5205, 2, 9, 1, 1, 3, 7), DisplayString()).setMaxAccess("readwrite") if mibBuilder.loadTexts: sw0657840DaylightStartTime.setStatus('current') sw0657840DaylightEndTime = MibScalar((1, 3, 6, 1, 4, 1, 5205, 2, 9, 1, 1, 3, 8), DisplayString()).setMaxAccess("readwrite") if mibBuilder.loadTexts: sw0657840DaylightEndTime.setStatus('current') sw0657840Account = MibIdentifier((1, 3, 6, 1, 4, 1, 5205, 2, 9, 1, 1, 4)) sw0657840AccountNumber = MibScalar((1, 3, 6, 1, 4, 1, 5205, 2, 9, 1, 1, 4, 1), Integer32().subtype(subtypeSpec=ValueRangeConstraint(1, 5))).setMaxAccess("readonly") if mibBuilder.loadTexts: sw0657840AccountNumber.setStatus('current') sw0657840AccountTable = MibTable((1, 3, 6, 1, 4, 1, 5205, 2, 9, 1, 1, 4, 2), ) if mibBuilder.loadTexts: sw0657840AccountTable.setStatus('current') sw0657840AccountEntry = MibTableRow((1, 3, 6, 1, 4, 1, 5205, 2, 9, 1, 1, 4, 2, 1), ).setIndexNames((0, "PRIVATE-SW0657840-MIB", "sw0657840AccountIndex")) if mibBuilder.loadTexts: sw0657840AccountEntry.setStatus('current') sw0657840AccountIndex = MibTableColumn((1, 3, 6, 1, 4, 1, 5205, 2, 9, 1, 1, 4, 2, 1, 1), Integer32().subtype(subtypeSpec=ValueRangeConstraint(1, 5))).setMaxAccess("readonly") if mibBuilder.loadTexts: sw0657840AccountIndex.setStatus('current') sw0657840AccountAuthorization = MibTableColumn((1, 3, 6, 1, 4, 1, 5205, 2, 9, 1, 1, 4, 2, 1, 2), DisplayString()).setMaxAccess("readonly") if mibBuilder.loadTexts: sw0657840AccountAuthorization.setStatus('current') sw0657840AccountName = MibTableColumn((1, 3, 6, 1, 4, 1, 5205, 2, 9, 1, 1, 4, 2, 1, 3), DisplayString()).setMaxAccess("readwrite") if mibBuilder.loadTexts: sw0657840AccountName.setStatus('current') sw0657840AccountPassword = MibTableColumn((1, 3, 6, 1, 4, 1, 5205, 2, 9, 1, 1, 4, 2, 1, 4), DisplayString()).setMaxAccess("readwrite") if mibBuilder.loadTexts: sw0657840AccountPassword.setStatus('current') sw0657840AccountAddName = MibScalar((1, 3, 6, 1, 4, 1, 5205, 2, 9, 1, 1, 4, 3), DisplayString()).setMaxAccess("readwrite") if mibBuilder.loadTexts: sw0657840AccountAddName.setStatus('current') sw0657840AccountAddPassword = MibScalar((1, 3, 6, 1, 4, 1, 5205, 2, 9, 1, 1, 4, 4), DisplayString()).setMaxAccess("readwrite") if mibBuilder.loadTexts: sw0657840AccountAddPassword.setStatus('current') sw0657840DoAccountAdd = MibScalar((1, 3, 6, 1, 4, 1, 5205, 2, 9, 1, 1, 4, 5), Integer32().subtype(subtypeSpec=ConstraintsUnion(ValueRangeConstraint(0, 0), ValueRangeConstraint(1, 1), ))).setMaxAccess("readwrite") if mibBuilder.loadTexts: sw0657840DoAccountAdd.setStatus('current') sw0657840AccountDel = MibScalar((1, 3, 6, 1, 4, 1, 5205, 2, 9, 1, 1, 4, 6), Integer32().subtype(subtypeSpec=ValueRangeConstraint(2, 5))).setMaxAccess("readwrite") if mibBuilder.loadTexts: sw0657840AccountDel.setStatus('current') sw0657840Snmp = MibIdentifier((1, 3, 6, 1, 4, 1, 5205, 2, 9, 1, 2)) sw0657840GetCommunity = MibScalar((1, 3, 6, 1, 4, 1, 5205, 2, 9, 1, 2, 1), DisplayString()).setMaxAccess("readwrite") if mibBuilder.loadTexts: sw0657840GetCommunity.setStatus('current') sw0657840SetCommunity = MibScalar((1, 3, 6, 1, 4, 1, 5205, 2, 9, 1, 2, 2), DisplayString()).setMaxAccess("readwrite") if mibBuilder.loadTexts: sw0657840SetCommunity.setStatus('current') sw0657840TrapHostNumber = MibScalar((1, 3, 6, 1, 4, 1, 5205, 2, 9, 1, 2, 3), Integer32().subtype(subtypeSpec=ValueRangeConstraint(1, 6))).setMaxAccess("readonly") if mibBuilder.loadTexts: sw0657840TrapHostNumber.setStatus('current') sw0657840TrapHostTable = MibTable((1, 3, 6, 1, 4, 1, 5205, 2, 9, 1, 2, 4), ) if mibBuilder.loadTexts: sw0657840TrapHostTable.setStatus('current') sw0657840TrapHostEntry = MibTableRow((1, 3, 6, 1, 4, 1, 5205, 2, 9, 1, 2, 4, 1), ).setIndexNames((0, "PRIVATE-SW0657840-MIB", "sw0657840TrapHostIndex")) if mibBuilder.loadTexts: sw0657840TrapHostEntry.setStatus('current') sw0657840TrapHostIndex = MibTableColumn((1, 3, 6, 1, 4, 1, 5205, 2, 9, 1, 2, 4, 1, 1), Integer32().subtype(subtypeSpec=ValueRangeConstraint(1, 6))).setMaxAccess("readonly") if mibBuilder.loadTexts: sw0657840TrapHostIndex.setStatus('current') sw0657840TrapHostIP = MibTableColumn((1, 3, 6, 1, 4, 1, 5205, 2, 9, 1, 2, 4, 1, 2), IpAddress()).setMaxAccess("readwrite") if mibBuilder.loadTexts: sw0657840TrapHostIP.setStatus('current') sw0657840TrapHostPort = MibTableColumn((1, 3, 6, 1, 4, 1, 5205, 2, 9, 1, 2, 4, 1, 3), Integer32().subtype(subtypeSpec=ValueRangeConstraint(1, 65535))).setMaxAccess("readwrite") if mibBuilder.loadTexts: sw0657840TrapHostPort.setStatus('current') sw0657840TrapHostCommunity = MibTableColumn((1, 3, 6, 1, 4, 1, 5205, 2, 9, 1, 2, 4, 1, 4), DisplayString()).setMaxAccess("readwrite") if mibBuilder.loadTexts: sw0657840TrapHostCommunity.setStatus('current') sw0657840Alarm = MibIdentifier((1, 3, 6, 1, 4, 1, 5205, 2, 9, 1, 3)) sw0657840Event = MibIdentifier((1, 3, 6, 1, 4, 1, 5205, 2, 9, 1, 3, 1)) sw0657840EventNumber = MibScalar((1, 3, 6, 1, 4, 1, 5205, 2, 9, 1, 3, 1, 1), Integer32().subtype(subtypeSpec=ValueRangeConstraint(1, 2147483647))).setMaxAccess("readonly") if mibBuilder.loadTexts: sw0657840EventNumber.setStatus('current') sw0657840EventTable = MibTable((1, 3, 6, 1, 4, 1, 5205, 2, 9, 1, 3, 1, 2), ) if mibBuilder.loadTexts: sw0657840EventTable.setStatus('current') sw0657840EventEntry = MibTableRow((1, 3, 6, 1, 4, 1, 5205, 2, 9, 1, 3, 1, 2, 1), ).setIndexNames((0, "PRIVATE-SW0657840-MIB", "sw0657840EventIndex")) if mibBuilder.loadTexts: sw0657840EventEntry.setStatus('current') sw0657840EventIndex = MibTableColumn((1, 3, 6, 1, 4, 1, 5205, 2, 9, 1, 3, 1, 2, 1, 1), Integer32().subtype(subtypeSpec=ValueRangeConstraint(1, 2147483647))).setMaxAccess("readonly") if mibBuilder.loadTexts: sw0657840EventIndex.setStatus('current') sw0657840EventName = MibTableColumn((1, 3, 6, 1, 4, 1, 5205, 2, 9, 1, 3, 1, 2, 1, 2), DisplayString()).setMaxAccess("readonly") if mibBuilder.loadTexts: sw0657840EventName.setStatus('current') sw0657840EventSendEmail = MibTableColumn((1, 3, 6, 1, 4, 1, 5205, 2, 9, 1, 3, 1, 2, 1, 3), Integer32().subtype(subtypeSpec=ConstraintsUnion(ValueRangeConstraint(0, 0), ValueRangeConstraint(1, 1), ))).setMaxAccess("readwrite") if mibBuilder.loadTexts: sw0657840EventSendEmail.setStatus('current') sw0657840EventSendSMS = MibTableColumn((1, 3, 6, 1, 4, 1, 5205, 2, 9, 1, 3, 1, 2, 1, 4), Integer32().subtype(subtypeSpec=ConstraintsUnion(ValueRangeConstraint(0, 0), ValueRangeConstraint(1, 1), ))).setMaxAccess("readwrite") if mibBuilder.loadTexts: sw0657840EventSendSMS.setStatus('current') sw0657840EventSendTrap = MibTableColumn((1, 3, 6, 1, 4, 1, 5205, 2, 9, 1, 3, 1, 2, 1, 5), Integer32().subtype(subtypeSpec=ConstraintsUnion(ValueRangeConstraint(0, 0), ValueRangeConstraint(1, 1), ))).setMaxAccess("readwrite") if mibBuilder.loadTexts: sw0657840EventSendTrap.setStatus('current') sw0657840Email = MibIdentifier((1, 3, 6, 1, 4, 1, 5205, 2, 9, 1, 3, 2)) sw0657840EmailServer = MibScalar((1, 3, 6, 1, 4, 1, 5205, 2, 9, 1, 3, 2, 1), DisplayString()).setMaxAccess("readwrite") if mibBuilder.loadTexts: sw0657840EmailServer.setStatus('current') sw0657840EmailUsername = MibScalar((1, 3, 6, 1, 4, 1, 5205, 2, 9, 1, 3, 2, 2), DisplayString()).setMaxAccess("readwrite") if mibBuilder.loadTexts: sw0657840EmailUsername.setStatus('current') sw0657840EmailPassword = MibScalar((1, 3, 6, 1, 4, 1, 5205, 2, 9, 1, 3, 2, 3), DisplayString()).setMaxAccess("readwrite") if mibBuilder.loadTexts: sw0657840EmailPassword.setStatus('current') sw0657840EmailUserNumber = MibScalar((1, 3, 6, 1, 4, 1, 5205, 2, 9, 1, 3, 2, 4), Integer32().subtype(subtypeSpec=ValueRangeConstraint(1, 6))).setMaxAccess("readonly") if mibBuilder.loadTexts: sw0657840EmailUserNumber.setStatus('current') sw0657840EmailUserTable = MibTable((1, 3, 6, 1, 4, 1, 5205, 2, 9, 1, 3, 2, 5), ) if mibBuilder.loadTexts: sw0657840EmailUserTable.setStatus('current') sw0657840EmailUserEntry = MibTableRow((1, 3, 6, 1, 4, 1, 5205, 2, 9, 1, 3, 2, 5, 1), ).setIndexNames((0, "PRIVATE-SW0657840-MIB", "sw0657840EmailUserIndex")) if mibBuilder.loadTexts: sw0657840EmailUserEntry.setStatus('current') sw0657840EmailUserIndex = MibTableColumn((1, 3, 6, 1, 4, 1, 5205, 2, 9, 1, 3, 2, 5, 1, 1), Integer32().subtype(subtypeSpec=ValueRangeConstraint(1, 6))).setMaxAccess("readonly") if mibBuilder.loadTexts: sw0657840EmailUserIndex.setStatus('current') sw0657840EmailUserAddress = MibTableColumn((1, 3, 6, 1, 4, 1, 5205, 2, 9, 1, 3, 2, 5, 1, 2), DisplayString()).setMaxAccess("readwrite") if mibBuilder.loadTexts: sw0657840EmailUserAddress.setStatus('current') sw0657840SMS = MibIdentifier((1, 3, 6, 1, 4, 1, 5205, 2, 9, 1, 3, 3)) sw0657840SMSServer = MibScalar((1, 3, 6, 1, 4, 1, 5205, 2, 9, 1, 3, 3, 1), DisplayString()).setMaxAccess("readwrite") if mibBuilder.loadTexts: sw0657840SMSServer.setStatus('current') sw0657840SMSUsername = MibScalar((1, 3, 6, 1, 4, 1, 5205, 2, 9, 1, 3, 3, 2), DisplayString()).setMaxAccess("readwrite") if mibBuilder.loadTexts: sw0657840SMSUsername.setStatus('current') sw0657840SMSPassword = MibScalar((1, 3, 6, 1, 4, 1, 5205, 2, 9, 1, 3, 3, 3), DisplayString()).setMaxAccess("readwrite") if mibBuilder.loadTexts: sw0657840SMSPassword.setStatus('current') sw0657840SMSUserNumber = MibScalar((1, 3, 6, 1, 4, 1, 5205, 2, 9, 1, 3, 3, 4), Integer32().subtype(subtypeSpec=ValueRangeConstraint(1, 6))).setMaxAccess("readonly") if mibBuilder.loadTexts: sw0657840SMSUserNumber.setStatus('current') sw0657840SMSUserTable = MibTable((1, 3, 6, 1, 4, 1, 5205, 2, 9, 1, 3, 3, 5), ) if mibBuilder.loadTexts: sw0657840SMSUserTable.setStatus('current') sw0657840SMSUserEntry = MibTableRow((1, 3, 6, 1, 4, 1, 5205, 2, 9, 1, 3, 3, 5, 1), ).setIndexNames((0, "PRIVATE-SW0657840-MIB", "sw0657840SMSUserIndex")) if mibBuilder.loadTexts: sw0657840SMSUserEntry.setStatus('current') sw0657840SMSUserIndex = MibTableColumn((1, 3, 6, 1, 4, 1, 5205, 2, 9, 1, 3, 3, 5, 1, 1), Integer32().subtype(subtypeSpec=ValueRangeConstraint(1, 6))).setMaxAccess("readonly") if mibBuilder.loadTexts: sw0657840SMSUserIndex.setStatus('current') sw0657840SMSUserMobilePhone = MibTableColumn((1, 3, 6, 1, 4, 1, 5205, 2, 9, 1, 3, 3, 5, 1, 2), DisplayString()).setMaxAccess("readwrite") if mibBuilder.loadTexts: sw0657840SMSUserMobilePhone.setStatus('current') sw0657840Tftp = MibIdentifier((1, 3, 6, 1, 4, 1, 5205, 2, 9, 1, 4)) sw0657840TftpServer = MibScalar((1, 3, 6, 1, 4, 1, 5205, 2, 9, 1, 4, 1), IpAddress()).setMaxAccess("readwrite") if mibBuilder.loadTexts: sw0657840TftpServer.setStatus('current') sw0657840Configuration = MibIdentifier((1, 3, 6, 1, 4, 1, 5205, 2, 9, 1, 5)) sw0657840SaveRestore = MibIdentifier((1, 3, 6, 1, 4, 1, 5205, 2, 9, 1, 5, 1)) sw0657840SaveStart = MibScalar((1, 3, 6, 1, 4, 1, 5205, 2, 9, 1, 5, 1, 1), Integer32().subtype(subtypeSpec=ConstraintsUnion(ValueRangeConstraint(0, 0), ValueRangeConstraint(1, 1), ))).setMaxAccess("readwrite") if mibBuilder.loadTexts: sw0657840SaveStart.setStatus('current') sw0657840SaveUser = MibScalar((1, 3, 6, 1, 4, 1, 5205, 2, 9, 1, 5, 1, 2), Integer32().subtype(subtypeSpec=ConstraintsUnion(ValueRangeConstraint(0, 0), ValueRangeConstraint(1, 1), ))).setMaxAccess("readwrite") if mibBuilder.loadTexts: sw0657840SaveUser.setStatus('current') sw0657840RestoreDefault = MibScalar((1, 3, 6, 1, 4, 1, 5205, 2, 9, 1, 5, 1, 3), Integer32().subtype(subtypeSpec=ConstraintsUnion(ValueRangeConstraint(0, 0), ValueRangeConstraint(1, 1), ValueRangeConstraint(2, 2), ))).setMaxAccess("readwrite") if mibBuilder.loadTexts: sw0657840RestoreDefault.setStatus('current') sw0657840RestoreUser = MibScalar((1, 3, 6, 1, 4, 1, 5205, 2, 9, 1, 5, 1, 4), Integer32().subtype(subtypeSpec=ConstraintsUnion(ValueRangeConstraint(0, 0), ValueRangeConstraint(1, 1), ))).setMaxAccess("readwrite") if mibBuilder.loadTexts: sw0657840RestoreUser.setStatus('current') sw0657840ConfigFile = MibIdentifier((1, 3, 6, 1, 4, 1, 5205, 2, 9, 1, 5, 2)) sw0657840ExportConfigName = MibScalar((1, 3, 6, 1, 4, 1, 5205, 2, 9, 1, 5, 2, 1), DisplayString()).setMaxAccess("readwrite") if mibBuilder.loadTexts: sw0657840ExportConfigName.setStatus('current') sw0657840DoExportConfig = MibScalar((1, 3, 6, 1, 4, 1, 5205, 2, 9, 1, 5, 2, 2), Integer32().subtype(subtypeSpec=ConstraintsUnion(ValueRangeConstraint(1, 1), ValueRangeConstraint(2, 2), ))).setMaxAccess("readwrite") if mibBuilder.loadTexts: sw0657840DoExportConfig.setStatus('current') sw0657840ImportConfigName = MibScalar((1, 3, 6, 1, 4, 1, 5205, 2, 9, 1, 5, 2, 3), DisplayString()).setMaxAccess("readwrite") if mibBuilder.loadTexts: sw0657840ImportConfigName.setStatus('current') sw0657840DoImportConfig = MibScalar((1, 3, 6, 1, 4, 1, 5205, 2, 9, 1, 5, 2, 4), Integer32().subtype(subtypeSpec=ConstraintsUnion(ValueRangeConstraint(1, 1), ValueRangeConstraint(2, 2), ))).setMaxAccess("readwrite") if mibBuilder.loadTexts: sw0657840DoImportConfig.setStatus('current') sw0657840Diagnostic = MibIdentifier((1, 3, 6, 1, 4, 1, 5205, 2, 9, 1, 6)) sw0657840EEPROMTest = MibScalar((1, 3, 6, 1, 4, 1, 5205, 2, 9, 1, 6, 1), DisplayString()).setMaxAccess("readonly") if mibBuilder.loadTexts: sw0657840EEPROMTest.setStatus('current') sw0657840UartTest = MibScalar((1, 3, 6, 1, 4, 1, 5205, 2, 9, 1, 6, 2), DisplayString()).setMaxAccess("readonly") if mibBuilder.loadTexts: sw0657840UartTest.setStatus('current') sw0657840DramTest = MibScalar((1, 3, 6, 1, 4, 1, 5205, 2, 9, 1, 6, 3), DisplayString()).setMaxAccess("readonly") if mibBuilder.loadTexts: sw0657840DramTest.setStatus('current') sw0657840FlashTest = MibScalar((1, 3, 6, 1, 4, 1, 5205, 2, 9, 1, 6, 4), DisplayString()).setMaxAccess("readonly") if mibBuilder.loadTexts: sw0657840FlashTest.setStatus('current') sw0657840InternalLoopbackTest = MibScalar((1, 3, 6, 1, 4, 1, 5205, 2, 9, 1, 6, 5), DisplayString()).setMaxAccess("readonly") if mibBuilder.loadTexts: sw0657840InternalLoopbackTest.setStatus('current') sw0657840ExternalLoopbackTest = MibScalar((1, 3, 6, 1, 4, 1, 5205, 2, 9, 1, 6, 6), DisplayString()).setMaxAccess("readonly") if mibBuilder.loadTexts: sw0657840ExternalLoopbackTest.setStatus('current') sw0657840PingTest = MibScalar((1, 3, 6, 1, 4, 1, 5205, 2, 9, 1, 6, 7), DisplayString()).setMaxAccess("readwrite") if mibBuilder.loadTexts: sw0657840PingTest.setStatus('current') sw0657840Log = MibIdentifier((1, 3, 6, 1, 4, 1, 5205, 2, 9, 1, 7)) sw0657840ClearLog = MibScalar((1, 3, 6, 1, 4, 1, 5205, 2, 9, 1, 7, 1), Integer32().subtype(subtypeSpec=ConstraintsUnion(ValueRangeConstraint(0, 0), ValueRangeConstraint(1, 1), ))).setMaxAccess("readwrite") if mibBuilder.loadTexts: sw0657840ClearLog.setStatus('current') sw0657840UploadLog = MibScalar((1, 3, 6, 1, 4, 1, 5205, 2, 9, 1, 7, 2), Integer32().subtype(subtypeSpec=ConstraintsUnion(ValueRangeConstraint(0, 0), ValueRangeConstraint(1, 1), ))).setMaxAccess("readwrite") if mibBuilder.loadTexts: sw0657840UploadLog.setStatus('current') sw0657840AutoUploadLogState = MibScalar((1, 3, 6, 1, 4, 1, 5205, 2, 9, 1, 7, 3), Integer32().subtype(subtypeSpec=ConstraintsUnion(ValueRangeConstraint(0, 0), ValueRangeConstraint(1, 1), ))).setMaxAccess("readwrite") if mibBuilder.loadTexts: sw0657840AutoUploadLogState.setStatus('current') sw0657840LogNumber = MibScalar((1, 3, 6, 1, 4, 1, 5205, 2, 9, 1, 7, 4), Integer32().subtype(subtypeSpec=ValueRangeConstraint(0, 120))).setMaxAccess("readonly") if mibBuilder.loadTexts: sw0657840LogNumber.setStatus('current') sw0657840LogTable = MibTable((1, 3, 6, 1, 4, 1, 5205, 2, 9, 1, 7, 5), ) if mibBuilder.loadTexts: sw0657840LogTable.setStatus('current') sw0657840LogEntry = MibTableRow((1, 3, 6, 1, 4, 1, 5205, 2, 9, 1, 7, 5, 1), ).setIndexNames((0, "PRIVATE-SW0657840-MIB", "sw0657840LogIndex")) if mibBuilder.loadTexts: sw0657840LogEntry.setStatus('current') sw0657840LogIndex = MibTableColumn((1, 3, 6, 1, 4, 1, 5205, 2, 9, 1, 7, 5, 1, 1), Integer32().subtype(subtypeSpec=ValueRangeConstraint(1, 120))).setMaxAccess("readonly") if mibBuilder.loadTexts: sw0657840LogIndex.setStatus('current') sw0657840LogEvent = MibTableColumn((1, 3, 6, 1, 4, 1, 5205, 2, 9, 1, 7, 5, 1, 2), DisplayString()).setMaxAccess("readonly") if mibBuilder.loadTexts: sw0657840LogEvent.setStatus('current') sw0657840Firmware = MibIdentifier((1, 3, 6, 1, 4, 1, 5205, 2, 9, 1, 8)) sw0657840FirmwareFileName = MibScalar((1, 3, 6, 1, 4, 1, 5205, 2, 9, 1, 8, 1), DisplayString()).setMaxAccess("readwrite") if mibBuilder.loadTexts: sw0657840FirmwareFileName.setStatus('current') sw0657840DoFirmwareUpgrade = MibScalar((1, 3, 6, 1, 4, 1, 5205, 2, 9, 1, 8, 2), Integer32().subtype(subtypeSpec=ConstraintsUnion(ValueRangeConstraint(0, 0), ValueRangeConstraint(1, 1), ))).setMaxAccess("readwrite") if mibBuilder.loadTexts: sw0657840DoFirmwareUpgrade.setStatus('current') sw0657840Port = MibIdentifier((1, 3, 6, 1, 4, 1, 5205, 2, 9, 1, 9)) sw0657840PortStatus = MibIdentifier((1, 3, 6, 1, 4, 1, 5205, 2, 9, 1, 9, 1)) sw0657840PortStatusNumber = MibScalar((1, 3, 6, 1, 4, 1, 5205, 2, 9, 1, 9, 1, 1), Integer32().subtype(subtypeSpec=ValueRangeConstraint(1, 2147483647))).setMaxAccess("readonly") if mibBuilder.loadTexts: sw0657840PortStatusNumber.setStatus('current') sw0657840PortStatusTable = MibTable((1, 3, 6, 1, 4, 1, 5205, 2, 9, 1, 9, 1, 2), ) if mibBuilder.loadTexts: sw0657840PortStatusTable.setStatus('current') sw0657840PortStatusEntry = MibTableRow((1, 3, 6, 1, 4, 1, 5205, 2, 9, 1, 9, 1, 2, 1), ).setIndexNames((0, "PRIVATE-SW0657840-MIB", "sw0657840PortStatusIndex")) if mibBuilder.loadTexts: sw0657840PortStatusEntry.setStatus('current') sw0657840PortStatusIndex = MibTableColumn((1, 3, 6, 1, 4, 1, 5205, 2, 9, 1, 9, 1, 2, 1, 1), Integer32().subtype(subtypeSpec=ValueRangeConstraint(1, 2147483647))).setMaxAccess("readonly") if mibBuilder.loadTexts: sw0657840PortStatusIndex.setStatus('current') sw0657840PortStatusMedia = MibTableColumn((1, 3, 6, 1, 4, 1, 5205, 2, 9, 1, 9, 1, 2, 1, 2), DisplayString()).setMaxAccess("readonly") if mibBuilder.loadTexts: sw0657840PortStatusMedia.setStatus('current') sw0657840PortStatusLink = MibTableColumn((1, 3, 6, 1, 4, 1, 5205, 2, 9, 1, 9, 1, 2, 1, 3), DisplayString()).setMaxAccess("readonly") if mibBuilder.loadTexts: sw0657840PortStatusLink.setStatus('current') sw0657840PortStatusPortState = MibTableColumn((1, 3, 6, 1, 4, 1, 5205, 2, 9, 1, 9, 1, 2, 1, 4), DisplayString()).setMaxAccess("readonly") if mibBuilder.loadTexts: sw0657840PortStatusPortState.setStatus('current') sw0657840PortStatusAutoNego = MibTableColumn((1, 3, 6, 1, 4, 1, 5205, 2, 9, 1, 9, 1, 2, 1, 5), DisplayString()).setMaxAccess("readonly") if mibBuilder.loadTexts: sw0657840PortStatusAutoNego.setStatus('current') sw0657840PortStatusSpdDpx = MibTableColumn((1, 3, 6, 1, 4, 1, 5205, 2, 9, 1, 9, 1, 2, 1, 6), DisplayString()).setMaxAccess("readonly") if mibBuilder.loadTexts: sw0657840PortStatusSpdDpx.setStatus('current') sw0657840PortStatusFlwCtrl = MibTableColumn((1, 3, 6, 1, 4, 1, 5205, 2, 9, 1, 9, 1, 2, 1, 7), DisplayString()).setMaxAccess("readonly") if mibBuilder.loadTexts: sw0657840PortStatusFlwCtrl.setStatus('current') sw0657840PortStatuDescription = MibTableColumn((1, 3, 6, 1, 4, 1, 5205, 2, 9, 1, 9, 1, 2, 1, 8), DisplayString()).setMaxAccess("readonly") if mibBuilder.loadTexts: sw0657840PortStatuDescription.setStatus('current') sw0657840PortConf = MibIdentifier((1, 3, 6, 1, 4, 1, 5205, 2, 9, 1, 9, 2)) sw0657840PortConfNumber = MibScalar((1, 3, 6, 1, 4, 1, 5205, 2, 9, 1, 9, 2, 1), Integer32().subtype(subtypeSpec=ValueRangeConstraint(1, 2147483647))).setMaxAccess("readonly") if mibBuilder.loadTexts: sw0657840PortConfNumber.setStatus('current') sw0657840PortConfTable = MibTable((1, 3, 6, 1, 4, 1, 5205, 2, 9, 1, 9, 2, 2), ) if mibBuilder.loadTexts: sw0657840PortConfTable.setStatus('current') sw0657840PortConfEntry = MibTableRow((1, 3, 6, 1, 4, 1, 5205, 2, 9, 1, 9, 2, 2, 1), ).setIndexNames((0, "PRIVATE-SW0657840-MIB", "sw0657840PortConfIndex")) if mibBuilder.loadTexts: sw0657840PortConfEntry.setStatus('current') sw0657840PortConfIndex = MibTableColumn((1, 3, 6, 1, 4, 1, 5205, 2, 9, 1, 9, 2, 2, 1, 1), Integer32().subtype(subtypeSpec=ValueRangeConstraint(1, 2147483647))).setMaxAccess("readonly") if mibBuilder.loadTexts: sw0657840PortConfIndex.setStatus('current') sw0657840PortConfPortState = MibTableColumn((1, 3, 6, 1, 4, 1, 5205, 2, 9, 1, 9, 2, 2, 1, 2), Integer32().subtype(subtypeSpec=ConstraintsUnion(ValueRangeConstraint(0, 0), ValueRangeConstraint(1, 1), ))).setMaxAccess("readwrite") if mibBuilder.loadTexts: sw0657840PortConfPortState.setStatus('current') sw0657840PortConfSpdDpx = MibTableColumn((1, 3, 6, 1, 4, 1, 5205, 2, 9, 1, 9, 2, 2, 1, 3), Integer32().subtype(subtypeSpec=ValueRangeConstraint(0, 5))).setMaxAccess("readwrite") if mibBuilder.loadTexts: sw0657840PortConfSpdDpx.setStatus('current') sw0657840PortConfFlwCtrl = MibTableColumn((1, 3, 6, 1, 4, 1, 5205, 2, 9, 1, 9, 2, 2, 1, 4), Integer32().subtype(subtypeSpec=ConstraintsUnion(ValueRangeConstraint(0, 0), ValueRangeConstraint(1, 1), ))).setMaxAccess("readwrite") if mibBuilder.loadTexts: sw0657840PortConfFlwCtrl.setStatus('current') sw0657840PortConfDescription = MibTableColumn((1, 3, 6, 1, 4, 1, 5205, 2, 9, 1, 9, 2, 2, 1, 5), DisplayString()).setMaxAccess("readwrite") if mibBuilder.loadTexts: sw0657840PortConfDescription.setStatus('current') sw0657840Mirror = MibIdentifier((1, 3, 6, 1, 4, 1, 5205, 2, 9, 1, 10)) sw0657840MirrorMode = MibScalar((1, 3, 6, 1, 4, 1, 5205, 2, 9, 1, 10, 1), Integer32().subtype(subtypeSpec=ConstraintsUnion(ValueRangeConstraint(0, 0), ValueRangeConstraint(1, 1), ))).setMaxAccess("readwrite") if mibBuilder.loadTexts: sw0657840MirrorMode.setStatus('current') sw0657840MirroringPort = MibScalar((1, 3, 6, 1, 4, 1, 5205, 2, 9, 1, 10, 2), Integer32().subtype(subtypeSpec=ValueRangeConstraint(1, 2147483647))).setMaxAccess("readwrite") if mibBuilder.loadTexts: sw0657840MirroringPort.setStatus('current') sw0657840MirroredPorts = MibScalar((1, 3, 6, 1, 4, 1, 5205, 2, 9, 1, 10, 3), DisplayString()).setMaxAccess("readwrite") if mibBuilder.loadTexts: sw0657840MirroredPorts.setStatus('current') sw0657840MaxPktLen = MibIdentifier((1, 3, 6, 1, 4, 1, 5205, 2, 9, 1, 11)) sw0657840MaxPktLen1 = MibIdentifier((1, 3, 6, 1, 4, 1, 5205, 2, 9, 1, 11, 1)) sw0657840MaxPktLenPortNumber = MibScalar((1, 3, 6, 1, 4, 1, 5205, 2, 9, 1, 11, 1, 1), Integer32().subtype(subtypeSpec=ValueRangeConstraint(1, 2147483647))).setMaxAccess("readonly") if mibBuilder.loadTexts: sw0657840MaxPktLenPortNumber.setStatus('current') sw0657840MaxPktLenConfTable = MibTable((1, 3, 6, 1, 4, 1, 5205, 2, 9, 1, 11, 1, 2), ) if mibBuilder.loadTexts: sw0657840MaxPktLenConfTable.setStatus('current') sw0657840MaxPktLenConfEntry = MibTableRow((1, 3, 6, 1, 4, 1, 5205, 2, 9, 1, 11, 1, 2, 1), ).setIndexNames((0, "PRIVATE-SW0657840-MIB", "sw0657840MaxPktLenConfIndex")) if mibBuilder.loadTexts: sw0657840MaxPktLenConfEntry.setStatus('current') sw0657840MaxPktLenConfIndex = MibTableColumn((1, 3, 6, 1, 4, 1, 5205, 2, 9, 1, 11, 1, 2, 1, 1), Integer32().subtype(subtypeSpec=ValueRangeConstraint(1, 2147483647))).setMaxAccess("readonly") if mibBuilder.loadTexts: sw0657840MaxPktLenConfIndex.setStatus('current') sw0657840MaxPktLenConfSetting = MibTableColumn((1, 3, 6, 1, 4, 1, 5205, 2, 9, 1, 11, 1, 2, 1, 2), Integer32().subtype(subtypeSpec=ConstraintsUnion(ValueRangeConstraint(1518, 1518), ValueRangeConstraint(1532, 1532), ValueRangeConstraint(9216, 9216), ))).setMaxAccess("readwrite") if mibBuilder.loadTexts: sw0657840MaxPktLenConfSetting.setStatus('current') sw0657840Bandwidth = MibIdentifier((1, 3, 6, 1, 4, 1, 5205, 2, 9, 1, 12)) sw0657840Bandwidth1 = MibIdentifier((1, 3, 6, 1, 4, 1, 5205, 2, 9, 1, 12, 1)) sw0657840BandwidthPortNumber = MibScalar((1, 3, 6, 1, 4, 1, 5205, 2, 9, 1, 12, 1, 1), Integer32().subtype(subtypeSpec=ValueRangeConstraint(1, 2147483647))).setMaxAccess("readonly") if mibBuilder.loadTexts: sw0657840BandwidthPortNumber.setStatus('current') sw0657840BandwidthConfTable = MibTable((1, 3, 6, 1, 4, 1, 5205, 2, 9, 1, 12, 1, 2), ) if mibBuilder.loadTexts: sw0657840BandwidthConfTable.setStatus('current') sw0657840BandwidthConfEntry = MibTableRow((1, 3, 6, 1, 4, 1, 5205, 2, 9, 1, 12, 1, 2, 1), ).setIndexNames((0, "PRIVATE-SW0657840-MIB", "sw0657840BandwidthConfIndex")) if mibBuilder.loadTexts: sw0657840BandwidthConfEntry.setStatus('current') sw0657840BandwidthConfIndex = MibTableColumn((1, 3, 6, 1, 4, 1, 5205, 2, 9, 1, 12, 1, 2, 1, 1), Integer32().subtype(subtypeSpec=ValueRangeConstraint(1, 2147483647))).setMaxAccess("readonly") if mibBuilder.loadTexts: sw0657840BandwidthConfIndex.setStatus('current') sw0657840BandwidthConfIngressState = MibTableColumn((1, 3, 6, 1, 4, 1, 5205, 2, 9, 1, 12, 1, 2, 1, 2), Integer32().subtype(subtypeSpec=ConstraintsUnion(ValueRangeConstraint(0, 0), ValueRangeConstraint(1, 1), ))).setMaxAccess("readwrite") if mibBuilder.loadTexts: sw0657840BandwidthConfIngressState.setStatus('current') sw0657840BandwidthConfIngressBW = MibTableColumn((1, 3, 6, 1, 4, 1, 5205, 2, 9, 1, 12, 1, 2, 1, 3), Integer32().subtype(subtypeSpec=ValueRangeConstraint(0, 1000))).setMaxAccess("readwrite") if mibBuilder.loadTexts: sw0657840BandwidthConfIngressBW.setStatus('current') sw0657840BandwidthConfStormState = MibTableColumn((1, 3, 6, 1, 4, 1, 5205, 2, 9, 1, 12, 1, 2, 1, 4), Integer32().subtype(subtypeSpec=ConstraintsUnion(ValueRangeConstraint(0, 0), ValueRangeConstraint(1, 1), ))).setMaxAccess("readwrite") if mibBuilder.loadTexts: sw0657840BandwidthConfStormState.setStatus('current') sw0657840BandwidthConfStormBW = MibTableColumn((1, 3, 6, 1, 4, 1, 5205, 2, 9, 1, 12, 1, 2, 1, 5), Integer32().subtype(subtypeSpec=ValueRangeConstraint(0, 1000))).setMaxAccess("readwrite") if mibBuilder.loadTexts: sw0657840BandwidthConfStormBW.setStatus('current') sw0657840BandwidthConfEgressState = MibTableColumn((1, 3, 6, 1, 4, 1, 5205, 2, 9, 1, 12, 1, 2, 1, 6), Integer32().subtype(subtypeSpec=ConstraintsUnion(ValueRangeConstraint(0, 0), ValueRangeConstraint(1, 1), ))).setMaxAccess("readwrite") if mibBuilder.loadTexts: sw0657840BandwidthConfEgressState.setStatus('current') sw0657840BandwidthConfEgressBW = MibTableColumn((1, 3, 6, 1, 4, 1, 5205, 2, 9, 1, 12, 1, 2, 1, 7), Integer32().subtype(subtypeSpec=ValueRangeConstraint(0, 1000))).setMaxAccess("readwrite") if mibBuilder.loadTexts: sw0657840BandwidthConfEgressBW.setStatus('current') sw0657840LoopDetectedConf = MibIdentifier((1, 3, 6, 1, 4, 1, 5205, 2, 9, 1, 13)) sw0657840LoopDetectedNumber = MibScalar((1, 3, 6, 1, 4, 1, 5205, 2, 9, 1, 13, 1), Integer32().subtype(subtypeSpec=ValueRangeConstraint(1, 2147483647))).setMaxAccess("readonly") if mibBuilder.loadTexts: sw0657840LoopDetectedNumber.setStatus('current') sw0657840LoopDetectedTable = MibTable((1, 3, 6, 1, 4, 1, 5205, 2, 9, 1, 13, 2), ) if mibBuilder.loadTexts: sw0657840LoopDetectedTable.setStatus('current') sw0657840LoopDetectedEntry = MibTableRow((1, 3, 6, 1, 4, 1, 5205, 2, 9, 1, 13, 2, 1), ).setIndexNames((0, "PRIVATE-SW0657840-MIB", "sw0657840LoopDetectedfIndex")) if mibBuilder.loadTexts: sw0657840LoopDetectedEntry.setStatus('current') sw0657840LoopDetectedfIndex = MibTableColumn((1, 3, 6, 1, 4, 1, 5205, 2, 9, 1, 13, 2, 1, 1), Integer32().subtype(subtypeSpec=ValueRangeConstraint(1, 2147483647))).setMaxAccess("readonly") if mibBuilder.loadTexts: sw0657840LoopDetectedfIndex.setStatus('current') sw0657840LoopDetectedStateEbl = MibTableColumn((1, 3, 6, 1, 4, 1, 5205, 2, 9, 1, 13, 2, 1, 2), Integer32().subtype(subtypeSpec=ConstraintsUnion(ValueRangeConstraint(0, 0), ValueRangeConstraint(1, 1), ))).setMaxAccess("readwrite") if mibBuilder.loadTexts: sw0657840LoopDetectedStateEbl.setStatus('current') sw0657840LoopDetectedCurrentStatus = MibTableColumn((1, 3, 6, 1, 4, 1, 5205, 2, 9, 1, 13, 2, 1, 3), Integer32().subtype(subtypeSpec=ConstraintsUnion(ValueRangeConstraint(0, 0), ValueRangeConstraint(1, 1), ))).setMaxAccess("readonly") if mibBuilder.loadTexts: sw0657840LoopDetectedCurrentStatus.setStatus('current') sw0657840LoopDetectedResumed = MibTableColumn((1, 3, 6, 1, 4, 1, 5205, 2, 9, 1, 13, 2, 1, 4), Integer32().subtype(subtypeSpec=ConstraintsUnion(ValueRangeConstraint(0, 0), ValueRangeConstraint(1, 1), ))).setMaxAccess("readwrite") if mibBuilder.loadTexts: sw0657840LoopDetectedResumed.setStatus('current') sw0657840LoopDetectedAction = MibScalar((1, 3, 6, 1, 4, 1, 5205, 2, 9, 1, 13, 3), Integer32().subtype(subtypeSpec=ConstraintsUnion(ValueRangeConstraint(0, 0), ValueRangeConstraint(1, 1), ))).setMaxAccess("readwrite") if mibBuilder.loadTexts: sw0657840LoopDetectedAction.setStatus('current') sw0657840SFPInfo = MibIdentifier((1, 3, 6, 1, 4, 1, 5205, 2, 9, 1, 14)) sw0657840SFPInfoNumber = MibScalar((1, 3, 6, 1, 4, 1, 5205, 2, 9, 1, 14, 1), Integer32().subtype(subtypeSpec=ValueRangeConstraint(1, 2147483647))).setMaxAccess("readonly") if mibBuilder.loadTexts: sw0657840SFPInfoNumber.setStatus('current') sw0657840SFPInfoTable = MibTable((1, 3, 6, 1, 4, 1, 5205, 2, 9, 1, 14, 2), ) if mibBuilder.loadTexts: sw0657840SFPInfoTable.setStatus('current') sw0657840SFPInfoEntry = MibTableRow((1, 3, 6, 1, 4, 1, 5205, 2, 9, 1, 14, 2, 1), ).setIndexNames((0, "PRIVATE-SW0657840-MIB", "sw0657840SFPInfoIndex")) if mibBuilder.loadTexts: sw0657840SFPInfoEntry.setStatus('current') sw0657840SFPInfoIndex = MibTableColumn((1, 3, 6, 1, 4, 1, 5205, 2, 9, 1, 14, 2, 1, 1), Integer32().subtype(subtypeSpec=ValueRangeConstraint(1, 2147483647))).setMaxAccess("readonly") if mibBuilder.loadTexts: sw0657840SFPInfoIndex.setStatus('current') sw0657840SFPConnectorType = MibTableColumn((1, 3, 6, 1, 4, 1, 5205, 2, 9, 1, 14, 2, 1, 2), DisplayString()).setMaxAccess("readonly") if mibBuilder.loadTexts: sw0657840SFPConnectorType.setStatus('current') sw0657840SFPFiberType = MibTableColumn((1, 3, 6, 1, 4, 1, 5205, 2, 9, 1, 14, 2, 1, 3), DisplayString()).setMaxAccess("readonly") if mibBuilder.loadTexts: sw0657840SFPFiberType.setStatus('current') sw0657840SFPWavelength = MibTableColumn((1, 3, 6, 1, 4, 1, 5205, 2, 9, 1, 14, 2, 1, 4), DisplayString()).setMaxAccess("readonly") if mibBuilder.loadTexts: sw0657840SFPWavelength.setStatus('current') sw0657840SFPBaudRate = MibTableColumn((1, 3, 6, 1, 4, 1, 5205, 2, 9, 1, 14, 2, 1, 5), DisplayString()).setMaxAccess("readonly") if mibBuilder.loadTexts: sw0657840SFPBaudRate.setStatus('current') sw0657840SFPVendorOUI = MibTableColumn((1, 3, 6, 1, 4, 1, 5205, 2, 9, 1, 14, 2, 1, 6), DisplayString()).setMaxAccess("readonly") if mibBuilder.loadTexts: sw0657840SFPVendorOUI.setStatus('current') sw0657840SFPVendorName = MibTableColumn((1, 3, 6, 1, 4, 1, 5205, 2, 9, 1, 14, 2, 1, 7), DisplayString()).setMaxAccess("readonly") if mibBuilder.loadTexts: sw0657840SFPVendorName.setStatus('current') sw0657840SFPVendorPN = MibTableColumn((1, 3, 6, 1, 4, 1, 5205, 2, 9, 1, 14, 2, 1, 8), DisplayString()).setMaxAccess("readonly") if mibBuilder.loadTexts: sw0657840SFPVendorPN.setStatus('current') sw0657840SFPVendorRev = MibTableColumn((1, 3, 6, 1, 4, 1, 5205, 2, 9, 1, 14, 2, 1, 9), DisplayString()).setMaxAccess("readonly") if mibBuilder.loadTexts: sw0657840SFPVendorRev.setStatus('current') sw0657840SFPVendorSN = MibTableColumn((1, 3, 6, 1, 4, 1, 5205, 2, 9, 1, 14, 2, 1, 10), DisplayString()).setMaxAccess("readonly") if mibBuilder.loadTexts: sw0657840SFPVendorSN.setStatus('current') sw0657840SFPDateCode = MibTableColumn((1, 3, 6, 1, 4, 1, 5205, 2, 9, 1, 14, 2, 1, 11), DisplayString()).setMaxAccess("readonly") if mibBuilder.loadTexts: sw0657840SFPDateCode.setStatus('current') sw0657840SFPTemperature = MibTableColumn((1, 3, 6, 1, 4, 1, 5205, 2, 9, 1, 14, 2, 1, 12), DisplayString()).setMaxAccess("readonly") if mibBuilder.loadTexts: sw0657840SFPTemperature.setStatus('current') sw0657840SFPVcc = MibTableColumn((1, 3, 6, 1, 4, 1, 5205, 2, 9, 1, 14, 2, 1, 13), DisplayString()).setMaxAccess("readonly") if mibBuilder.loadTexts: sw0657840SFPVcc.setStatus('current') sw0657840SFPTxBias = MibTableColumn((1, 3, 6, 1, 4, 1, 5205, 2, 9, 1, 14, 2, 1, 14), DisplayString()).setMaxAccess("readonly") if mibBuilder.loadTexts: sw0657840SFPTxBias.setStatus('current') sw0657840SFPTxPWR = MibTableColumn((1, 3, 6, 1, 4, 1, 5205, 2, 9, 1, 14, 2, 1, 15), DisplayString()).setMaxAccess("readonly") if mibBuilder.loadTexts: sw0657840SFPTxPWR.setStatus('current') sw0657840SFPRxPWR = MibTableColumn((1, 3, 6, 1, 4, 1, 5205, 2, 9, 1, 14, 2, 1, 16), DisplayString()).setMaxAccess("readonly") if mibBuilder.loadTexts: sw0657840SFPRxPWR.setStatus('current') sw0657840TrapEntry = MibIdentifier((1, 3, 6, 1, 4, 1, 5205, 2, 9, 1, 20)) sw0657840ModuleInserted = NotificationType((1, 3, 6, 1, 4, 1, 5205, 2, 9, 1, 20, 1)).setObjects(("IF-MIB", "ifIndex")) if mibBuilder.loadTexts: sw0657840ModuleInserted.setStatus('current') sw0657840ModuleRemoved = NotificationType((1, 3, 6, 1, 4, 1, 5205, 2, 9, 1, 20, 2)).setObjects(("IF-MIB", "ifIndex")) if mibBuilder.loadTexts: sw0657840ModuleRemoved.setStatus('current') sw0657840DualMediaSwapped = NotificationType((1, 3, 6, 1, 4, 1, 5205, 2, 9, 1, 20, 3)).setObjects(("IF-MIB", "ifIndex")) if mibBuilder.loadTexts: sw0657840DualMediaSwapped.setStatus('current') sw0657840LoopDetected = NotificationType((1, 3, 6, 1, 4, 1, 5205, 2, 9, 1, 20, 5)).setObjects(("IF-MIB", "ifIndex")) if mibBuilder.loadTexts: sw0657840LoopDetected.setStatus('current') sw0657840StpStateDisabled = NotificationType((1, 3, 6, 1, 4, 1, 5205, 2, 9, 1, 20, 100)) if mibBuilder.loadTexts: sw0657840StpStateDisabled.setStatus('current') sw0657840StpStateEnabled = NotificationType((1, 3, 6, 1, 4, 1, 5205, 2, 9, 1, 20, 101)) if mibBuilder.loadTexts: sw0657840StpStateEnabled.setStatus('current') sw0657840StpTopologyChanged = NotificationType((1, 3, 6, 1, 4, 1, 5205, 2, 9, 1, 20, 102)).setObjects(("IF-MIB", "ifIndex")) if mibBuilder.loadTexts: sw0657840StpTopologyChanged.setStatus('current') sw0657840LacpStateDisabled = NotificationType((1, 3, 6, 1, 4, 1, 5205, 2, 9, 1, 20, 120)).setObjects(("IF-MIB", "ifIndex"), ("PRIVATE-SW0657840-MIB", "groupId")) if mibBuilder.loadTexts: sw0657840LacpStateDisabled.setStatus('current') sw0657840LacpStateEnabled = NotificationType((1, 3, 6, 1, 4, 1, 5205, 2, 9, 1, 20, 121)).setObjects(("IF-MIB", "ifIndex"), ("PRIVATE-SW0657840-MIB", "groupId")) if mibBuilder.loadTexts: sw0657840LacpStateEnabled.setStatus('current') sw0657840LacpPortAdded = NotificationType((1, 3, 6, 1, 4, 1, 5205, 2, 9, 1, 20, 123)).setObjects(("IF-MIB", "ifIndex"), ("PRIVATE-SW0657840-MIB", "actorkey"), ("PRIVATE-SW0657840-MIB", "partnerkey")) if mibBuilder.loadTexts: sw0657840LacpPortAdded.setStatus('current') sw0657840LacpPortTrunkFailure = NotificationType((1, 3, 6, 1, 4, 1, 5205, 2, 9, 1, 20, 124)).setObjects(("IF-MIB", "ifIndex"), ("PRIVATE-SW0657840-MIB", "actorkey"), ("PRIVATE-SW0657840-MIB", "partnerkey")) if mibBuilder.loadTexts: sw0657840LacpPortTrunkFailure.setStatus('current') sw0657840GvrpStateDisabled = NotificationType((1, 3, 6, 1, 4, 1, 5205, 2, 9, 1, 20, 140)) if mibBuilder.loadTexts: sw0657840GvrpStateDisabled.setStatus('current') sw0657840GvrpStateEnabled = NotificationType((1, 3, 6, 1, 4, 1, 5205, 2, 9, 1, 20, 141)) if mibBuilder.loadTexts: sw0657840GvrpStateEnabled.setStatus('current') sw0657840VlanStateDisabled = NotificationType((1, 3, 6, 1, 4, 1, 5205, 2, 9, 1, 20, 150)) if mibBuilder.loadTexts: sw0657840VlanStateDisabled.setStatus('current') sw0657840VlanPortBaseEnabled = NotificationType((1, 3, 6, 1, 4, 1, 5205, 2, 9, 1, 20, 151)) if mibBuilder.loadTexts: sw0657840VlanPortBaseEnabled.setStatus('current') sw0657840VlanTagBaseEnabled = NotificationType((1, 3, 6, 1, 4, 1, 5205, 2, 9, 1, 20, 152)) if mibBuilder.loadTexts: sw0657840VlanTagBaseEnabled.setStatus('current') sw0657840VlanMetroModeEnabled = NotificationType((1, 3, 6, 1, 4, 1, 5205, 2, 9, 1, 20, 153)).setObjects(("PRIVATE-SW0657840-MIB", "uplink")) if mibBuilder.loadTexts: sw0657840VlanMetroModeEnabled.setStatus('current') sw0657840VlanDoubleTagEnabled = NotificationType((1, 3, 6, 1, 4, 1, 5205, 2, 9, 1, 20, 154)) if mibBuilder.loadTexts: sw0657840VlanDoubleTagEnabled.setStatus('current') sw0657840UserLogin = NotificationType((1, 3, 6, 1, 4, 1, 5205, 2, 9, 1, 20, 200)).setObjects(("PRIVATE-SW0657840-MIB", "username")) if mibBuilder.loadTexts: sw0657840UserLogin.setStatus('current') sw0657840UserLogout = NotificationType((1, 3, 6, 1, 4, 1, 5205, 2, 9, 1, 20, 201)).setObjects(("PRIVATE-SW0657840-MIB", "username")) if mibBuilder.loadTexts: sw0657840UserLogout.setStatus('current') sw0657840TrapVariable = MibIdentifier((1, 3, 6, 1, 4, 1, 5205, 2, 9, 1, 21)) username = MibScalar((1, 3, 6, 1, 4, 1, 5205, 2, 9, 1, 21, 1), DisplayString()).setMaxAccess("readonly") if mibBuilder.loadTexts: username.setStatus('current') groupId = MibScalar((1, 3, 6, 1, 4, 1, 5205, 2, 9, 1, 21, 2), Integer32().subtype(subtypeSpec=ValueRangeConstraint(1, 8))).setMaxAccess("readonly") if mibBuilder.loadTexts: groupId.setStatus('current') actorkey = MibScalar((1, 3, 6, 1, 4, 1, 5205, 2, 9, 1, 21, 3), Integer32().subtype(subtypeSpec=ValueRangeConstraint(1, 2147483647))).setMaxAccess("readonly") if mibBuilder.loadTexts: actorkey.setStatus('current') partnerkey = MibScalar((1, 3, 6, 1, 4, 1, 5205, 2, 9, 1, 21, 4), Integer32().subtype(subtypeSpec=ValueRangeConstraint(1, 2147483647))).setMaxAccess("readonly") if mibBuilder.loadTexts: partnerkey.setStatus('current') uplink = MibScalar((1, 3, 6, 1, 4, 1, 5205, 2, 9, 1, 21, 5), DisplayString()).setMaxAccess("readonly") if mibBuilder.loadTexts: uplink.setStatus('current') mibBuilder.exportSymbols("PRIVATE-SW0657840-MIB", sw0657840Diagnostic=sw0657840Diagnostic, sw0657840SMSUserTable=sw0657840SMSUserTable, sw0657840PortConfFlwCtrl=sw0657840PortConfFlwCtrl, sw0657840SerialNumber=sw0657840SerialNumber, sw0657840DevicePort=sw0657840DevicePort, sw0657840SFPTxPWR=sw0657840SFPTxPWR, username=username, sw0657840PortConfTable=sw0657840PortConfTable, sw0657840PingTest=sw0657840PingTest, sw0657840Time=sw0657840Time, sw0657840PortStatusTable=sw0657840PortStatusTable, sw0657840SFPVendorRev=sw0657840SFPVendorRev, sw0657840ModuleInserted=sw0657840ModuleInserted, sw0657840AccountNumber=sw0657840AccountNumber, sw0657840ModuleRemoved=sw0657840ModuleRemoved, sw0657840SFPWavelength=sw0657840SFPWavelength, sw0657840PortStatusLink=sw0657840PortStatusLink, sw0657840BandwidthConfStormBW=sw0657840BandwidthConfStormBW, sw0657840UploadLog=sw0657840UploadLog, sw0657840EventSendSMS=sw0657840EventSendSMS, sw0657840PortConf=sw0657840PortConf, sw0657840DoImportConfig=sw0657840DoImportConfig, sw0657840PortConfSpdDpx=sw0657840PortConfSpdDpx, sw0657840Alarm=sw0657840Alarm, switch=switch, sw0657840EEPROMTest=sw0657840EEPROMTest, sw0657840LoopDetectedConf=sw0657840LoopDetectedConf, sw0657840LacpStateDisabled=sw0657840LacpStateDisabled, sw0657840BandwidthConfIngressBW=sw0657840BandwidthConfIngressBW, sw0657840TrapHostIndex=sw0657840TrapHostIndex, actorkey=actorkey, sw0657840ExternalLoopbackTest=sw0657840ExternalLoopbackTest, sw0657840MirroringPort=sw0657840MirroringPort, sw0657840RestoreDefault=sw0657840RestoreDefault, sw0657840SFPVendorOUI=sw0657840SFPVendorOUI, sw0657840AccountIndex=sw0657840AccountIndex, sw0657840MirroredPorts=sw0657840MirroredPorts, sw0657840AutoUploadLogState=sw0657840AutoUploadLogState, sw0657840DoAccountAdd=sw0657840DoAccountAdd, sw0657840BandwidthPortNumber=sw0657840BandwidthPortNumber, sw0657840RamSize=sw0657840RamSize, sw0657840EventIndex=sw0657840EventIndex, sw0657840Produces=sw0657840Produces, sw0657840FlashSize=sw0657840FlashSize, sw0657840EmailPassword=sw0657840EmailPassword, sw0657840SMSUsername=sw0657840SMSUsername, sw0657840Mirror=sw0657840Mirror, sw0657840Configuration=sw0657840Configuration, sw0657840BandwidthConfStormState=sw0657840BandwidthConfStormState, sw0657840NTPTimeSync=sw0657840NTPTimeSync, sw0657840LoopDetectedfIndex=sw0657840LoopDetectedfIndex, sw0657840TrapEntry=sw0657840TrapEntry, sw0657840SMSServer=sw0657840SMSServer, sw0657840MirrorMode=sw0657840MirrorMode, sw0657840SFPTemperature=sw0657840SFPTemperature, sw0657840UartTest=sw0657840UartTest, sw0657840GvrpStateEnabled=sw0657840GvrpStateEnabled, sw0657840TrapVariable=sw0657840TrapVariable, sw0657840SaveRestore=sw0657840SaveRestore, sw0657840PortConfNumber=sw0657840PortConfNumber, sw0657840PortStatusIndex=sw0657840PortStatusIndex, sw0657840AccountPassword=sw0657840AccountPassword, sw0657840PortStatusMedia=sw0657840PortStatusMedia, sw0657840SMSUserEntry=sw0657840SMSUserEntry, sw0657840DoExportConfig=sw0657840DoExportConfig, sw0657840Bandwidth=sw0657840Bandwidth, sw0657840TrapHostTable=sw0657840TrapHostTable, sw0657840SystemCurrentTime=sw0657840SystemCurrentTime, sw0657840EventEntry=sw0657840EventEntry, sw0657840EventSendTrap=sw0657840EventSendTrap, sw0657840LoopDetectedEntry=sw0657840LoopDetectedEntry, sw0657840SFPRxPWR=sw0657840SFPRxPWR, sw0657840MaxPktLenConfTable=sw0657840MaxPktLenConfTable, sw0657840LoopDetectedAction=sw0657840LoopDetectedAction, sw0657840ProductID=sw0657840ProductID, sw0657840VlanPortBaseEnabled=sw0657840VlanPortBaseEnabled, sw0657840LogIndex=sw0657840LogIndex, sw0657840UserLogin=sw0657840UserLogin, sw0657840SFPBaudRate=sw0657840SFPBaudRate, sw0657840Account=sw0657840Account, sw0657840TrapHostCommunity=sw0657840TrapHostCommunity, sw0657840LacpPortTrunkFailure=sw0657840LacpPortTrunkFailure, sw0657840EventTable=sw0657840EventTable, sw0657840LoopDetectedCurrentStatus=sw0657840LoopDetectedCurrentStatus, sw0657840FirmwareVersion=sw0657840FirmwareVersion, sw0657840ImportConfigName=sw0657840ImportConfigName, sw0657840PortStatusAutoNego=sw0657840PortStatusAutoNego, sw0657840MaxPktLen=sw0657840MaxPktLen, sw0657840DhcpSetting=sw0657840DhcpSetting, sw0657840Reboot=sw0657840Reboot, sw0657840SaveUser=sw0657840SaveUser, sw0657840PortStatusPortState=sw0657840PortStatusPortState, sw0657840BandwidthConfIngressState=sw0657840BandwidthConfIngressState, sw0657840SetCommunity=sw0657840SetCommunity, sw0657840VlanDoubleTagEnabled=sw0657840VlanDoubleTagEnabled, sw0657840Log=sw0657840Log, sw0657840DoFirmwareUpgrade=sw0657840DoFirmwareUpgrade, sw0657840HostMacAddress=sw0657840HostMacAddress, sw0657840FirmwareFileName=sw0657840FirmwareFileName, sw0657840LoopDetectedTable=sw0657840LoopDetectedTable, sw0657840ManualTimeSetting=sw0657840ManualTimeSetting, sw0657840LogEvent=sw0657840LogEvent, sw0657840ClearLog=sw0657840ClearLog, sw0657840EventName=sw0657840EventName, sw0657840PortStatuDescription=sw0657840PortStatuDescription, sw0657840NTPTimeZone=sw0657840NTPTimeZone, sw0657840LacpStateEnabled=sw0657840LacpStateEnabled, sw0657840SMSUserMobilePhone=sw0657840SMSUserMobilePhone, sw0657840StpStateEnabled=sw0657840StpStateEnabled, sw0657840VlanTagBaseEnabled=sw0657840VlanTagBaseEnabled, sw0657840DnsServer=sw0657840DnsServer, sw0657840LogTable=sw0657840LogTable, sw0657840MaxPktLen1=sw0657840MaxPktLen1, sw0657840EmailUserIndex=sw0657840EmailUserIndex, sw0657840ConfigFile=sw0657840ConfigFile, sw0657840LoopDetected=sw0657840LoopDetected, sw0657840EmailUserTable=sw0657840EmailUserTable, sw0657840DaylightEndTime=sw0657840DaylightEndTime, sw0657840SaveStart=sw0657840SaveStart, sw0657840SMS=sw0657840SMS, sw0657840DnsSetting=sw0657840DnsSetting, sw0657840Snmp=sw0657840Snmp, sw0657840IPAddress=sw0657840IPAddress, sw0657840DefaultGateway=sw0657840DefaultGateway, sw0657840AccountDel=sw0657840AccountDel, sw0657840EmailUserNumber=sw0657840EmailUserNumber, sw0657840AccountAddPassword=sw0657840AccountAddPassword, sw0657840SFPVendorSN=sw0657840SFPVendorSN, sw0657840EmailUserAddress=sw0657840EmailUserAddress, sw0657840NTPServer=sw0657840NTPServer, sw0657840EventNumber=sw0657840EventNumber, sw0657840BandwidthConfEntry=sw0657840BandwidthConfEntry, sw0657840LoopDetectedStateEbl=sw0657840LoopDetectedStateEbl, sw0657840GvrpStateDisabled=sw0657840GvrpStateDisabled, sw0657840AccountName=sw0657840AccountName, sw0657840EmailUsername=sw0657840EmailUsername, sw0657840DramTest=sw0657840DramTest, sw0657840FlashTest=sw0657840FlashTest, sw0657840Tftp=sw0657840Tftp, sw0657840RestoreUser=sw0657840RestoreUser, sw0657840EmailUserEntry=sw0657840EmailUserEntry, sw0657840VlanMetroModeEnabled=sw0657840VlanMetroModeEnabled, sw0657840SFPInfoIndex=sw0657840SFPInfoIndex, sw0657840PortStatusFlwCtrl=sw0657840PortStatusFlwCtrl, partnerkey=partnerkey, sw0657840DualMediaSwapped=sw0657840DualMediaSwapped, sw0657840SFPInfoNumber=sw0657840SFPInfoNumber, sw0657840Email=sw0657840Email, sw0657840MaxPktLenPortNumber=sw0657840MaxPktLenPortNumber, sw0657840LoopDetectedNumber=sw0657840LoopDetectedNumber, groupId=groupId, sw0657840SFPInfo=sw0657840SFPInfo, sw0657840PortStatus=sw0657840PortStatus, sw0657840TrapHostIP=sw0657840TrapHostIP, sw0657840TftpServer=sw0657840TftpServer, sw0657840Event=sw0657840Event, sw0657840BandwidthConfEgressBW=sw0657840BandwidthConfEgressBW, sw0657840SFPFiberType=sw0657840SFPFiberType, sw0657840BiosVsersion=sw0657840BiosVsersion, sw0657840Bandwidth1=sw0657840Bandwidth1, sw0657840ExportConfigName=sw0657840ExportConfigName, sw0657840SFPInfoEntry=sw0657840SFPInfoEntry, sw0657840SFPInfoTable=sw0657840SFPInfoTable, sw0657840AccountAddName=sw0657840AccountAddName, sw0657840TrapHostPort=sw0657840TrapHostPort, sw0657840TrapHostEntry=sw0657840TrapHostEntry, sw0657840CommonSys=sw0657840CommonSys, privatetech=privatetech, sw0657840VlanStateDisabled=sw0657840VlanStateDisabled, sw0657840DaylightSavingTime=sw0657840DaylightSavingTime, sw0657840AccountTable=sw0657840AccountTable, sw0657840BandwidthConfTable=sw0657840BandwidthConfTable, sw0657840LoopDetectedResumed=sw0657840LoopDetectedResumed, sw0657840SMSUserIndex=sw0657840SMSUserIndex, sw0657840StpStateDisabled=sw0657840StpStateDisabled, sw0657840PortStatusEntry=sw0657840PortStatusEntry, sw0657840SMSUserNumber=sw0657840SMSUserNumber, sw0657840BandwidthConfEgressState=sw0657840BandwidthConfEgressState, sw0657840LogEntry=sw0657840LogEntry, sw0657840MechanicalVersion=sw0657840MechanicalVersion, sw0657840NetMask=sw0657840NetMask, sw0657840GetCommunity=sw0657840GetCommunity, sw0657840SFPConnectorType=sw0657840SFPConnectorType, sw0657840TrapHostNumber=sw0657840TrapHostNumber, sw0657840SFPVcc=sw0657840SFPVcc, sw0657840LogNumber=sw0657840LogNumber, sw0657840LacpPortAdded=sw0657840LacpPortAdded, sw0657840SFPVendorPN=sw0657840SFPVendorPN, sw0657840UserLogout=sw0657840UserLogout, sw0657840EmailServer=sw0657840EmailServer, sw0657840EventSendEmail=sw0657840EventSendEmail, sw0657840Port=sw0657840Port, sw0657840IP=sw0657840IP, sw0657840HardwareVersion=sw0657840HardwareVersion, sw0657840MaxPktLenConfEntry=sw0657840MaxPktLenConfEntry, sw0657840DaylightStartTime=sw0657840DaylightStartTime, sw0657840SFPVendorName=sw0657840SFPVendorName, sw0657840PortConfIndex=sw0657840PortConfIndex, sw0657840PortConfDescription=sw0657840PortConfDescription, sw0657840BandwidthConfIndex=sw0657840BandwidthConfIndex, sw0657840PortStatusNumber=sw0657840PortStatusNumber, sw0657840AccountEntry=sw0657840AccountEntry, sw0657840StpTopologyChanged=sw0657840StpTopologyChanged, sw0657840InternalLoopbackTest=sw0657840InternalLoopbackTest, sw0657840MaxPktLenConfSetting=sw0657840MaxPktLenConfSetting, sw0657840SFPTxBias=sw0657840SFPTxBias, sw0657840PortConfEntry=sw0657840PortConfEntry, sw0657840MaxPktLenConfIndex=sw0657840MaxPktLenConfIndex, uplink=uplink, sw0657840PortStatusSpdDpx=sw0657840PortStatusSpdDpx, sw0657840PortConfPortState=sw0657840PortConfPortState, sw0657840System=sw0657840System, sw0657840Firmware=sw0657840Firmware, PYSNMP_MODULE_ID=privatetech, sw0657840SMSPassword=sw0657840SMSPassword, sw0657840SFPDateCode=sw0657840SFPDateCode, sw0657840AccountAuthorization=sw0657840AccountAuthorization)
(octet_string, integer, object_identifier) = mibBuilder.importSymbols('ASN1', 'OctetString', 'Integer', 'ObjectIdentifier') (named_values,) = mibBuilder.importSymbols('ASN1-ENUMERATION', 'NamedValues') (constraints_union, value_range_constraint, single_value_constraint, constraints_intersection, value_size_constraint) = mibBuilder.importSymbols('ASN1-REFINEMENT', 'ConstraintsUnion', 'ValueRangeConstraint', 'SingleValueConstraint', 'ConstraintsIntersection', 'ValueSizeConstraint') (if_index,) = mibBuilder.importSymbols('IF-MIB', 'ifIndex') (notification_group, module_compliance, object_group) = mibBuilder.importSymbols('SNMPv2-CONF', 'NotificationGroup', 'ModuleCompliance', 'ObjectGroup') (integer32, counter64, counter32, mib_identifier, iso, gauge32, enterprises, time_ticks, mib_scalar, mib_table, mib_table_row, mib_table_column, module_identity, object_identity, unsigned32, ip_address, bits, notification_type) = mibBuilder.importSymbols('SNMPv2-SMI', 'Integer32', 'Counter64', 'Counter32', 'MibIdentifier', 'iso', 'Gauge32', 'enterprises', 'TimeTicks', 'MibScalar', 'MibTable', 'MibTableRow', 'MibTableColumn', 'ModuleIdentity', 'ObjectIdentity', 'Unsigned32', 'IpAddress', 'Bits', 'NotificationType') (display_string, textual_convention) = mibBuilder.importSymbols('SNMPv2-TC', 'DisplayString', 'TextualConvention') privatetech = module_identity((1, 3, 6, 1, 4, 1, 5205)) if mibBuilder.loadTexts: privatetech.setLastUpdated('200607030000Z') if mibBuilder.loadTexts: privatetech.setOrganization('xxx Tech Corp.') switch = mib_identifier((1, 3, 6, 1, 4, 1, 5205, 2)) sw0657840_product_id = mib_identifier((1, 3, 6, 1, 4, 1, 5205, 2, 9)) sw0657840_produces = mib_identifier((1, 3, 6, 1, 4, 1, 5205, 2, 9, 1)) sw0657840_system = mib_identifier((1, 3, 6, 1, 4, 1, 5205, 2, 9, 1, 1)) sw0657840_common_sys = mib_identifier((1, 3, 6, 1, 4, 1, 5205, 2, 9, 1, 1, 1)) sw0657840_reboot = mib_scalar((1, 3, 6, 1, 4, 1, 5205, 2, 9, 1, 1, 1, 1), integer32().subtype(subtypeSpec=constraints_union(value_range_constraint(0, 0), value_range_constraint(1, 1), value_range_constraint(2, 2)))).setMaxAccess('readwrite') if mibBuilder.loadTexts: sw0657840Reboot.setStatus('current') sw0657840_bios_vsersion = mib_scalar((1, 3, 6, 1, 4, 1, 5205, 2, 9, 1, 1, 1, 2), display_string()).setMaxAccess('readonly') if mibBuilder.loadTexts: sw0657840BiosVsersion.setStatus('current') sw0657840_firmware_version = mib_scalar((1, 3, 6, 1, 4, 1, 5205, 2, 9, 1, 1, 1, 3), display_string()).setMaxAccess('readonly') if mibBuilder.loadTexts: sw0657840FirmwareVersion.setStatus('current') sw0657840_hardware_version = mib_scalar((1, 3, 6, 1, 4, 1, 5205, 2, 9, 1, 1, 1, 4), display_string()).setMaxAccess('readonly') if mibBuilder.loadTexts: sw0657840HardwareVersion.setStatus('current') sw0657840_mechanical_version = mib_scalar((1, 3, 6, 1, 4, 1, 5205, 2, 9, 1, 1, 1, 5), display_string()).setMaxAccess('readonly') if mibBuilder.loadTexts: sw0657840MechanicalVersion.setStatus('current') sw0657840_serial_number = mib_scalar((1, 3, 6, 1, 4, 1, 5205, 2, 9, 1, 1, 1, 6), display_string()).setMaxAccess('readonly') if mibBuilder.loadTexts: sw0657840SerialNumber.setStatus('current') sw0657840_host_mac_address = mib_scalar((1, 3, 6, 1, 4, 1, 5205, 2, 9, 1, 1, 1, 7), display_string()).setMaxAccess('readonly') if mibBuilder.loadTexts: sw0657840HostMacAddress.setStatus('current') sw0657840_device_port = mib_scalar((1, 3, 6, 1, 4, 1, 5205, 2, 9, 1, 1, 1, 8), display_string()).setMaxAccess('readonly') if mibBuilder.loadTexts: sw0657840DevicePort.setStatus('current') sw0657840_ram_size = mib_scalar((1, 3, 6, 1, 4, 1, 5205, 2, 9, 1, 1, 1, 9), display_string()).setMaxAccess('readonly') if mibBuilder.loadTexts: sw0657840RamSize.setStatus('current') sw0657840_flash_size = mib_scalar((1, 3, 6, 1, 4, 1, 5205, 2, 9, 1, 1, 1, 10), display_string()).setMaxAccess('readonly') if mibBuilder.loadTexts: sw0657840FlashSize.setStatus('current') sw0657840_ip = mib_identifier((1, 3, 6, 1, 4, 1, 5205, 2, 9, 1, 1, 2)) sw0657840_dhcp_setting = mib_scalar((1, 3, 6, 1, 4, 1, 5205, 2, 9, 1, 1, 2, 1), integer32().subtype(subtypeSpec=constraints_union(value_range_constraint(0, 0), value_range_constraint(1, 1)))).setMaxAccess('readwrite') if mibBuilder.loadTexts: sw0657840DhcpSetting.setStatus('current') sw0657840_ip_address = mib_scalar((1, 3, 6, 1, 4, 1, 5205, 2, 9, 1, 1, 2, 2), ip_address()).setMaxAccess('readwrite') if mibBuilder.loadTexts: sw0657840IPAddress.setStatus('current') sw0657840_net_mask = mib_scalar((1, 3, 6, 1, 4, 1, 5205, 2, 9, 1, 1, 2, 3), ip_address()).setMaxAccess('readwrite') if mibBuilder.loadTexts: sw0657840NetMask.setStatus('current') sw0657840_default_gateway = mib_scalar((1, 3, 6, 1, 4, 1, 5205, 2, 9, 1, 1, 2, 4), ip_address()).setMaxAccess('readwrite') if mibBuilder.loadTexts: sw0657840DefaultGateway.setStatus('current') sw0657840_dns_setting = mib_scalar((1, 3, 6, 1, 4, 1, 5205, 2, 9, 1, 1, 2, 5), integer32().subtype(subtypeSpec=constraints_union(value_range_constraint(0, 0), value_range_constraint(1, 1)))).setMaxAccess('readwrite') if mibBuilder.loadTexts: sw0657840DnsSetting.setStatus('current') sw0657840_dns_server = mib_scalar((1, 3, 6, 1, 4, 1, 5205, 2, 9, 1, 1, 2, 6), ip_address()).setMaxAccess('readwrite') if mibBuilder.loadTexts: sw0657840DnsServer.setStatus('current') sw0657840_time = mib_identifier((1, 3, 6, 1, 4, 1, 5205, 2, 9, 1, 1, 3)) sw0657840_system_current_time = mib_scalar((1, 3, 6, 1, 4, 1, 5205, 2, 9, 1, 1, 3, 1), display_string()).setMaxAccess('readonly') if mibBuilder.loadTexts: sw0657840SystemCurrentTime.setStatus('current') sw0657840_manual_time_setting = mib_scalar((1, 3, 6, 1, 4, 1, 5205, 2, 9, 1, 1, 3, 2), display_string()).setMaxAccess('readwrite') if mibBuilder.loadTexts: sw0657840ManualTimeSetting.setStatus('current') sw0657840_ntp_server = mib_scalar((1, 3, 6, 1, 4, 1, 5205, 2, 9, 1, 1, 3, 3), display_string()).setMaxAccess('readwrite') if mibBuilder.loadTexts: sw0657840NTPServer.setStatus('current') sw0657840_ntp_time_zone = mib_scalar((1, 3, 6, 1, 4, 1, 5205, 2, 9, 1, 1, 3, 4), integer32().subtype(subtypeSpec=value_range_constraint(-12, 13))).setMaxAccess('readwrite') if mibBuilder.loadTexts: sw0657840NTPTimeZone.setStatus('current') sw0657840_ntp_time_sync = mib_scalar((1, 3, 6, 1, 4, 1, 5205, 2, 9, 1, 1, 3, 5), integer32().subtype(subtypeSpec=constraints_union(value_range_constraint(0, 0), value_range_constraint(1, 1)))).setMaxAccess('readwrite') if mibBuilder.loadTexts: sw0657840NTPTimeSync.setStatus('current') sw0657840_daylight_saving_time = mib_scalar((1, 3, 6, 1, 4, 1, 5205, 2, 9, 1, 1, 3, 6), integer32().subtype(subtypeSpec=value_range_constraint(-5, 5))).setMaxAccess('readwrite') if mibBuilder.loadTexts: sw0657840DaylightSavingTime.setStatus('current') sw0657840_daylight_start_time = mib_scalar((1, 3, 6, 1, 4, 1, 5205, 2, 9, 1, 1, 3, 7), display_string()).setMaxAccess('readwrite') if mibBuilder.loadTexts: sw0657840DaylightStartTime.setStatus('current') sw0657840_daylight_end_time = mib_scalar((1, 3, 6, 1, 4, 1, 5205, 2, 9, 1, 1, 3, 8), display_string()).setMaxAccess('readwrite') if mibBuilder.loadTexts: sw0657840DaylightEndTime.setStatus('current') sw0657840_account = mib_identifier((1, 3, 6, 1, 4, 1, 5205, 2, 9, 1, 1, 4)) sw0657840_account_number = mib_scalar((1, 3, 6, 1, 4, 1, 5205, 2, 9, 1, 1, 4, 1), integer32().subtype(subtypeSpec=value_range_constraint(1, 5))).setMaxAccess('readonly') if mibBuilder.loadTexts: sw0657840AccountNumber.setStatus('current') sw0657840_account_table = mib_table((1, 3, 6, 1, 4, 1, 5205, 2, 9, 1, 1, 4, 2)) if mibBuilder.loadTexts: sw0657840AccountTable.setStatus('current') sw0657840_account_entry = mib_table_row((1, 3, 6, 1, 4, 1, 5205, 2, 9, 1, 1, 4, 2, 1)).setIndexNames((0, 'PRIVATE-SW0657840-MIB', 'sw0657840AccountIndex')) if mibBuilder.loadTexts: sw0657840AccountEntry.setStatus('current') sw0657840_account_index = mib_table_column((1, 3, 6, 1, 4, 1, 5205, 2, 9, 1, 1, 4, 2, 1, 1), integer32().subtype(subtypeSpec=value_range_constraint(1, 5))).setMaxAccess('readonly') if mibBuilder.loadTexts: sw0657840AccountIndex.setStatus('current') sw0657840_account_authorization = mib_table_column((1, 3, 6, 1, 4, 1, 5205, 2, 9, 1, 1, 4, 2, 1, 2), display_string()).setMaxAccess('readonly') if mibBuilder.loadTexts: sw0657840AccountAuthorization.setStatus('current') sw0657840_account_name = mib_table_column((1, 3, 6, 1, 4, 1, 5205, 2, 9, 1, 1, 4, 2, 1, 3), display_string()).setMaxAccess('readwrite') if mibBuilder.loadTexts: sw0657840AccountName.setStatus('current') sw0657840_account_password = mib_table_column((1, 3, 6, 1, 4, 1, 5205, 2, 9, 1, 1, 4, 2, 1, 4), display_string()).setMaxAccess('readwrite') if mibBuilder.loadTexts: sw0657840AccountPassword.setStatus('current') sw0657840_account_add_name = mib_scalar((1, 3, 6, 1, 4, 1, 5205, 2, 9, 1, 1, 4, 3), display_string()).setMaxAccess('readwrite') if mibBuilder.loadTexts: sw0657840AccountAddName.setStatus('current') sw0657840_account_add_password = mib_scalar((1, 3, 6, 1, 4, 1, 5205, 2, 9, 1, 1, 4, 4), display_string()).setMaxAccess('readwrite') if mibBuilder.loadTexts: sw0657840AccountAddPassword.setStatus('current') sw0657840_do_account_add = mib_scalar((1, 3, 6, 1, 4, 1, 5205, 2, 9, 1, 1, 4, 5), integer32().subtype(subtypeSpec=constraints_union(value_range_constraint(0, 0), value_range_constraint(1, 1)))).setMaxAccess('readwrite') if mibBuilder.loadTexts: sw0657840DoAccountAdd.setStatus('current') sw0657840_account_del = mib_scalar((1, 3, 6, 1, 4, 1, 5205, 2, 9, 1, 1, 4, 6), integer32().subtype(subtypeSpec=value_range_constraint(2, 5))).setMaxAccess('readwrite') if mibBuilder.loadTexts: sw0657840AccountDel.setStatus('current') sw0657840_snmp = mib_identifier((1, 3, 6, 1, 4, 1, 5205, 2, 9, 1, 2)) sw0657840_get_community = mib_scalar((1, 3, 6, 1, 4, 1, 5205, 2, 9, 1, 2, 1), display_string()).setMaxAccess('readwrite') if mibBuilder.loadTexts: sw0657840GetCommunity.setStatus('current') sw0657840_set_community = mib_scalar((1, 3, 6, 1, 4, 1, 5205, 2, 9, 1, 2, 2), display_string()).setMaxAccess('readwrite') if mibBuilder.loadTexts: sw0657840SetCommunity.setStatus('current') sw0657840_trap_host_number = mib_scalar((1, 3, 6, 1, 4, 1, 5205, 2, 9, 1, 2, 3), integer32().subtype(subtypeSpec=value_range_constraint(1, 6))).setMaxAccess('readonly') if mibBuilder.loadTexts: sw0657840TrapHostNumber.setStatus('current') sw0657840_trap_host_table = mib_table((1, 3, 6, 1, 4, 1, 5205, 2, 9, 1, 2, 4)) if mibBuilder.loadTexts: sw0657840TrapHostTable.setStatus('current') sw0657840_trap_host_entry = mib_table_row((1, 3, 6, 1, 4, 1, 5205, 2, 9, 1, 2, 4, 1)).setIndexNames((0, 'PRIVATE-SW0657840-MIB', 'sw0657840TrapHostIndex')) if mibBuilder.loadTexts: sw0657840TrapHostEntry.setStatus('current') sw0657840_trap_host_index = mib_table_column((1, 3, 6, 1, 4, 1, 5205, 2, 9, 1, 2, 4, 1, 1), integer32().subtype(subtypeSpec=value_range_constraint(1, 6))).setMaxAccess('readonly') if mibBuilder.loadTexts: sw0657840TrapHostIndex.setStatus('current') sw0657840_trap_host_ip = mib_table_column((1, 3, 6, 1, 4, 1, 5205, 2, 9, 1, 2, 4, 1, 2), ip_address()).setMaxAccess('readwrite') if mibBuilder.loadTexts: sw0657840TrapHostIP.setStatus('current') sw0657840_trap_host_port = mib_table_column((1, 3, 6, 1, 4, 1, 5205, 2, 9, 1, 2, 4, 1, 3), integer32().subtype(subtypeSpec=value_range_constraint(1, 65535))).setMaxAccess('readwrite') if mibBuilder.loadTexts: sw0657840TrapHostPort.setStatus('current') sw0657840_trap_host_community = mib_table_column((1, 3, 6, 1, 4, 1, 5205, 2, 9, 1, 2, 4, 1, 4), display_string()).setMaxAccess('readwrite') if mibBuilder.loadTexts: sw0657840TrapHostCommunity.setStatus('current') sw0657840_alarm = mib_identifier((1, 3, 6, 1, 4, 1, 5205, 2, 9, 1, 3)) sw0657840_event = mib_identifier((1, 3, 6, 1, 4, 1, 5205, 2, 9, 1, 3, 1)) sw0657840_event_number = mib_scalar((1, 3, 6, 1, 4, 1, 5205, 2, 9, 1, 3, 1, 1), integer32().subtype(subtypeSpec=value_range_constraint(1, 2147483647))).setMaxAccess('readonly') if mibBuilder.loadTexts: sw0657840EventNumber.setStatus('current') sw0657840_event_table = mib_table((1, 3, 6, 1, 4, 1, 5205, 2, 9, 1, 3, 1, 2)) if mibBuilder.loadTexts: sw0657840EventTable.setStatus('current') sw0657840_event_entry = mib_table_row((1, 3, 6, 1, 4, 1, 5205, 2, 9, 1, 3, 1, 2, 1)).setIndexNames((0, 'PRIVATE-SW0657840-MIB', 'sw0657840EventIndex')) if mibBuilder.loadTexts: sw0657840EventEntry.setStatus('current') sw0657840_event_index = mib_table_column((1, 3, 6, 1, 4, 1, 5205, 2, 9, 1, 3, 1, 2, 1, 1), integer32().subtype(subtypeSpec=value_range_constraint(1, 2147483647))).setMaxAccess('readonly') if mibBuilder.loadTexts: sw0657840EventIndex.setStatus('current') sw0657840_event_name = mib_table_column((1, 3, 6, 1, 4, 1, 5205, 2, 9, 1, 3, 1, 2, 1, 2), display_string()).setMaxAccess('readonly') if mibBuilder.loadTexts: sw0657840EventName.setStatus('current') sw0657840_event_send_email = mib_table_column((1, 3, 6, 1, 4, 1, 5205, 2, 9, 1, 3, 1, 2, 1, 3), integer32().subtype(subtypeSpec=constraints_union(value_range_constraint(0, 0), value_range_constraint(1, 1)))).setMaxAccess('readwrite') if mibBuilder.loadTexts: sw0657840EventSendEmail.setStatus('current') sw0657840_event_send_sms = mib_table_column((1, 3, 6, 1, 4, 1, 5205, 2, 9, 1, 3, 1, 2, 1, 4), integer32().subtype(subtypeSpec=constraints_union(value_range_constraint(0, 0), value_range_constraint(1, 1)))).setMaxAccess('readwrite') if mibBuilder.loadTexts: sw0657840EventSendSMS.setStatus('current') sw0657840_event_send_trap = mib_table_column((1, 3, 6, 1, 4, 1, 5205, 2, 9, 1, 3, 1, 2, 1, 5), integer32().subtype(subtypeSpec=constraints_union(value_range_constraint(0, 0), value_range_constraint(1, 1)))).setMaxAccess('readwrite') if mibBuilder.loadTexts: sw0657840EventSendTrap.setStatus('current') sw0657840_email = mib_identifier((1, 3, 6, 1, 4, 1, 5205, 2, 9, 1, 3, 2)) sw0657840_email_server = mib_scalar((1, 3, 6, 1, 4, 1, 5205, 2, 9, 1, 3, 2, 1), display_string()).setMaxAccess('readwrite') if mibBuilder.loadTexts: sw0657840EmailServer.setStatus('current') sw0657840_email_username = mib_scalar((1, 3, 6, 1, 4, 1, 5205, 2, 9, 1, 3, 2, 2), display_string()).setMaxAccess('readwrite') if mibBuilder.loadTexts: sw0657840EmailUsername.setStatus('current') sw0657840_email_password = mib_scalar((1, 3, 6, 1, 4, 1, 5205, 2, 9, 1, 3, 2, 3), display_string()).setMaxAccess('readwrite') if mibBuilder.loadTexts: sw0657840EmailPassword.setStatus('current') sw0657840_email_user_number = mib_scalar((1, 3, 6, 1, 4, 1, 5205, 2, 9, 1, 3, 2, 4), integer32().subtype(subtypeSpec=value_range_constraint(1, 6))).setMaxAccess('readonly') if mibBuilder.loadTexts: sw0657840EmailUserNumber.setStatus('current') sw0657840_email_user_table = mib_table((1, 3, 6, 1, 4, 1, 5205, 2, 9, 1, 3, 2, 5)) if mibBuilder.loadTexts: sw0657840EmailUserTable.setStatus('current') sw0657840_email_user_entry = mib_table_row((1, 3, 6, 1, 4, 1, 5205, 2, 9, 1, 3, 2, 5, 1)).setIndexNames((0, 'PRIVATE-SW0657840-MIB', 'sw0657840EmailUserIndex')) if mibBuilder.loadTexts: sw0657840EmailUserEntry.setStatus('current') sw0657840_email_user_index = mib_table_column((1, 3, 6, 1, 4, 1, 5205, 2, 9, 1, 3, 2, 5, 1, 1), integer32().subtype(subtypeSpec=value_range_constraint(1, 6))).setMaxAccess('readonly') if mibBuilder.loadTexts: sw0657840EmailUserIndex.setStatus('current') sw0657840_email_user_address = mib_table_column((1, 3, 6, 1, 4, 1, 5205, 2, 9, 1, 3, 2, 5, 1, 2), display_string()).setMaxAccess('readwrite') if mibBuilder.loadTexts: sw0657840EmailUserAddress.setStatus('current') sw0657840_sms = mib_identifier((1, 3, 6, 1, 4, 1, 5205, 2, 9, 1, 3, 3)) sw0657840_sms_server = mib_scalar((1, 3, 6, 1, 4, 1, 5205, 2, 9, 1, 3, 3, 1), display_string()).setMaxAccess('readwrite') if mibBuilder.loadTexts: sw0657840SMSServer.setStatus('current') sw0657840_sms_username = mib_scalar((1, 3, 6, 1, 4, 1, 5205, 2, 9, 1, 3, 3, 2), display_string()).setMaxAccess('readwrite') if mibBuilder.loadTexts: sw0657840SMSUsername.setStatus('current') sw0657840_sms_password = mib_scalar((1, 3, 6, 1, 4, 1, 5205, 2, 9, 1, 3, 3, 3), display_string()).setMaxAccess('readwrite') if mibBuilder.loadTexts: sw0657840SMSPassword.setStatus('current') sw0657840_sms_user_number = mib_scalar((1, 3, 6, 1, 4, 1, 5205, 2, 9, 1, 3, 3, 4), integer32().subtype(subtypeSpec=value_range_constraint(1, 6))).setMaxAccess('readonly') if mibBuilder.loadTexts: sw0657840SMSUserNumber.setStatus('current') sw0657840_sms_user_table = mib_table((1, 3, 6, 1, 4, 1, 5205, 2, 9, 1, 3, 3, 5)) if mibBuilder.loadTexts: sw0657840SMSUserTable.setStatus('current') sw0657840_sms_user_entry = mib_table_row((1, 3, 6, 1, 4, 1, 5205, 2, 9, 1, 3, 3, 5, 1)).setIndexNames((0, 'PRIVATE-SW0657840-MIB', 'sw0657840SMSUserIndex')) if mibBuilder.loadTexts: sw0657840SMSUserEntry.setStatus('current') sw0657840_sms_user_index = mib_table_column((1, 3, 6, 1, 4, 1, 5205, 2, 9, 1, 3, 3, 5, 1, 1), integer32().subtype(subtypeSpec=value_range_constraint(1, 6))).setMaxAccess('readonly') if mibBuilder.loadTexts: sw0657840SMSUserIndex.setStatus('current') sw0657840_sms_user_mobile_phone = mib_table_column((1, 3, 6, 1, 4, 1, 5205, 2, 9, 1, 3, 3, 5, 1, 2), display_string()).setMaxAccess('readwrite') if mibBuilder.loadTexts: sw0657840SMSUserMobilePhone.setStatus('current') sw0657840_tftp = mib_identifier((1, 3, 6, 1, 4, 1, 5205, 2, 9, 1, 4)) sw0657840_tftp_server = mib_scalar((1, 3, 6, 1, 4, 1, 5205, 2, 9, 1, 4, 1), ip_address()).setMaxAccess('readwrite') if mibBuilder.loadTexts: sw0657840TftpServer.setStatus('current') sw0657840_configuration = mib_identifier((1, 3, 6, 1, 4, 1, 5205, 2, 9, 1, 5)) sw0657840_save_restore = mib_identifier((1, 3, 6, 1, 4, 1, 5205, 2, 9, 1, 5, 1)) sw0657840_save_start = mib_scalar((1, 3, 6, 1, 4, 1, 5205, 2, 9, 1, 5, 1, 1), integer32().subtype(subtypeSpec=constraints_union(value_range_constraint(0, 0), value_range_constraint(1, 1)))).setMaxAccess('readwrite') if mibBuilder.loadTexts: sw0657840SaveStart.setStatus('current') sw0657840_save_user = mib_scalar((1, 3, 6, 1, 4, 1, 5205, 2, 9, 1, 5, 1, 2), integer32().subtype(subtypeSpec=constraints_union(value_range_constraint(0, 0), value_range_constraint(1, 1)))).setMaxAccess('readwrite') if mibBuilder.loadTexts: sw0657840SaveUser.setStatus('current') sw0657840_restore_default = mib_scalar((1, 3, 6, 1, 4, 1, 5205, 2, 9, 1, 5, 1, 3), integer32().subtype(subtypeSpec=constraints_union(value_range_constraint(0, 0), value_range_constraint(1, 1), value_range_constraint(2, 2)))).setMaxAccess('readwrite') if mibBuilder.loadTexts: sw0657840RestoreDefault.setStatus('current') sw0657840_restore_user = mib_scalar((1, 3, 6, 1, 4, 1, 5205, 2, 9, 1, 5, 1, 4), integer32().subtype(subtypeSpec=constraints_union(value_range_constraint(0, 0), value_range_constraint(1, 1)))).setMaxAccess('readwrite') if mibBuilder.loadTexts: sw0657840RestoreUser.setStatus('current') sw0657840_config_file = mib_identifier((1, 3, 6, 1, 4, 1, 5205, 2, 9, 1, 5, 2)) sw0657840_export_config_name = mib_scalar((1, 3, 6, 1, 4, 1, 5205, 2, 9, 1, 5, 2, 1), display_string()).setMaxAccess('readwrite') if mibBuilder.loadTexts: sw0657840ExportConfigName.setStatus('current') sw0657840_do_export_config = mib_scalar((1, 3, 6, 1, 4, 1, 5205, 2, 9, 1, 5, 2, 2), integer32().subtype(subtypeSpec=constraints_union(value_range_constraint(1, 1), value_range_constraint(2, 2)))).setMaxAccess('readwrite') if mibBuilder.loadTexts: sw0657840DoExportConfig.setStatus('current') sw0657840_import_config_name = mib_scalar((1, 3, 6, 1, 4, 1, 5205, 2, 9, 1, 5, 2, 3), display_string()).setMaxAccess('readwrite') if mibBuilder.loadTexts: sw0657840ImportConfigName.setStatus('current') sw0657840_do_import_config = mib_scalar((1, 3, 6, 1, 4, 1, 5205, 2, 9, 1, 5, 2, 4), integer32().subtype(subtypeSpec=constraints_union(value_range_constraint(1, 1), value_range_constraint(2, 2)))).setMaxAccess('readwrite') if mibBuilder.loadTexts: sw0657840DoImportConfig.setStatus('current') sw0657840_diagnostic = mib_identifier((1, 3, 6, 1, 4, 1, 5205, 2, 9, 1, 6)) sw0657840_eeprom_test = mib_scalar((1, 3, 6, 1, 4, 1, 5205, 2, 9, 1, 6, 1), display_string()).setMaxAccess('readonly') if mibBuilder.loadTexts: sw0657840EEPROMTest.setStatus('current') sw0657840_uart_test = mib_scalar((1, 3, 6, 1, 4, 1, 5205, 2, 9, 1, 6, 2), display_string()).setMaxAccess('readonly') if mibBuilder.loadTexts: sw0657840UartTest.setStatus('current') sw0657840_dram_test = mib_scalar((1, 3, 6, 1, 4, 1, 5205, 2, 9, 1, 6, 3), display_string()).setMaxAccess('readonly') if mibBuilder.loadTexts: sw0657840DramTest.setStatus('current') sw0657840_flash_test = mib_scalar((1, 3, 6, 1, 4, 1, 5205, 2, 9, 1, 6, 4), display_string()).setMaxAccess('readonly') if mibBuilder.loadTexts: sw0657840FlashTest.setStatus('current') sw0657840_internal_loopback_test = mib_scalar((1, 3, 6, 1, 4, 1, 5205, 2, 9, 1, 6, 5), display_string()).setMaxAccess('readonly') if mibBuilder.loadTexts: sw0657840InternalLoopbackTest.setStatus('current') sw0657840_external_loopback_test = mib_scalar((1, 3, 6, 1, 4, 1, 5205, 2, 9, 1, 6, 6), display_string()).setMaxAccess('readonly') if mibBuilder.loadTexts: sw0657840ExternalLoopbackTest.setStatus('current') sw0657840_ping_test = mib_scalar((1, 3, 6, 1, 4, 1, 5205, 2, 9, 1, 6, 7), display_string()).setMaxAccess('readwrite') if mibBuilder.loadTexts: sw0657840PingTest.setStatus('current') sw0657840_log = mib_identifier((1, 3, 6, 1, 4, 1, 5205, 2, 9, 1, 7)) sw0657840_clear_log = mib_scalar((1, 3, 6, 1, 4, 1, 5205, 2, 9, 1, 7, 1), integer32().subtype(subtypeSpec=constraints_union(value_range_constraint(0, 0), value_range_constraint(1, 1)))).setMaxAccess('readwrite') if mibBuilder.loadTexts: sw0657840ClearLog.setStatus('current') sw0657840_upload_log = mib_scalar((1, 3, 6, 1, 4, 1, 5205, 2, 9, 1, 7, 2), integer32().subtype(subtypeSpec=constraints_union(value_range_constraint(0, 0), value_range_constraint(1, 1)))).setMaxAccess('readwrite') if mibBuilder.loadTexts: sw0657840UploadLog.setStatus('current') sw0657840_auto_upload_log_state = mib_scalar((1, 3, 6, 1, 4, 1, 5205, 2, 9, 1, 7, 3), integer32().subtype(subtypeSpec=constraints_union(value_range_constraint(0, 0), value_range_constraint(1, 1)))).setMaxAccess('readwrite') if mibBuilder.loadTexts: sw0657840AutoUploadLogState.setStatus('current') sw0657840_log_number = mib_scalar((1, 3, 6, 1, 4, 1, 5205, 2, 9, 1, 7, 4), integer32().subtype(subtypeSpec=value_range_constraint(0, 120))).setMaxAccess('readonly') if mibBuilder.loadTexts: sw0657840LogNumber.setStatus('current') sw0657840_log_table = mib_table((1, 3, 6, 1, 4, 1, 5205, 2, 9, 1, 7, 5)) if mibBuilder.loadTexts: sw0657840LogTable.setStatus('current') sw0657840_log_entry = mib_table_row((1, 3, 6, 1, 4, 1, 5205, 2, 9, 1, 7, 5, 1)).setIndexNames((0, 'PRIVATE-SW0657840-MIB', 'sw0657840LogIndex')) if mibBuilder.loadTexts: sw0657840LogEntry.setStatus('current') sw0657840_log_index = mib_table_column((1, 3, 6, 1, 4, 1, 5205, 2, 9, 1, 7, 5, 1, 1), integer32().subtype(subtypeSpec=value_range_constraint(1, 120))).setMaxAccess('readonly') if mibBuilder.loadTexts: sw0657840LogIndex.setStatus('current') sw0657840_log_event = mib_table_column((1, 3, 6, 1, 4, 1, 5205, 2, 9, 1, 7, 5, 1, 2), display_string()).setMaxAccess('readonly') if mibBuilder.loadTexts: sw0657840LogEvent.setStatus('current') sw0657840_firmware = mib_identifier((1, 3, 6, 1, 4, 1, 5205, 2, 9, 1, 8)) sw0657840_firmware_file_name = mib_scalar((1, 3, 6, 1, 4, 1, 5205, 2, 9, 1, 8, 1), display_string()).setMaxAccess('readwrite') if mibBuilder.loadTexts: sw0657840FirmwareFileName.setStatus('current') sw0657840_do_firmware_upgrade = mib_scalar((1, 3, 6, 1, 4, 1, 5205, 2, 9, 1, 8, 2), integer32().subtype(subtypeSpec=constraints_union(value_range_constraint(0, 0), value_range_constraint(1, 1)))).setMaxAccess('readwrite') if mibBuilder.loadTexts: sw0657840DoFirmwareUpgrade.setStatus('current') sw0657840_port = mib_identifier((1, 3, 6, 1, 4, 1, 5205, 2, 9, 1, 9)) sw0657840_port_status = mib_identifier((1, 3, 6, 1, 4, 1, 5205, 2, 9, 1, 9, 1)) sw0657840_port_status_number = mib_scalar((1, 3, 6, 1, 4, 1, 5205, 2, 9, 1, 9, 1, 1), integer32().subtype(subtypeSpec=value_range_constraint(1, 2147483647))).setMaxAccess('readonly') if mibBuilder.loadTexts: sw0657840PortStatusNumber.setStatus('current') sw0657840_port_status_table = mib_table((1, 3, 6, 1, 4, 1, 5205, 2, 9, 1, 9, 1, 2)) if mibBuilder.loadTexts: sw0657840PortStatusTable.setStatus('current') sw0657840_port_status_entry = mib_table_row((1, 3, 6, 1, 4, 1, 5205, 2, 9, 1, 9, 1, 2, 1)).setIndexNames((0, 'PRIVATE-SW0657840-MIB', 'sw0657840PortStatusIndex')) if mibBuilder.loadTexts: sw0657840PortStatusEntry.setStatus('current') sw0657840_port_status_index = mib_table_column((1, 3, 6, 1, 4, 1, 5205, 2, 9, 1, 9, 1, 2, 1, 1), integer32().subtype(subtypeSpec=value_range_constraint(1, 2147483647))).setMaxAccess('readonly') if mibBuilder.loadTexts: sw0657840PortStatusIndex.setStatus('current') sw0657840_port_status_media = mib_table_column((1, 3, 6, 1, 4, 1, 5205, 2, 9, 1, 9, 1, 2, 1, 2), display_string()).setMaxAccess('readonly') if mibBuilder.loadTexts: sw0657840PortStatusMedia.setStatus('current') sw0657840_port_status_link = mib_table_column((1, 3, 6, 1, 4, 1, 5205, 2, 9, 1, 9, 1, 2, 1, 3), display_string()).setMaxAccess('readonly') if mibBuilder.loadTexts: sw0657840PortStatusLink.setStatus('current') sw0657840_port_status_port_state = mib_table_column((1, 3, 6, 1, 4, 1, 5205, 2, 9, 1, 9, 1, 2, 1, 4), display_string()).setMaxAccess('readonly') if mibBuilder.loadTexts: sw0657840PortStatusPortState.setStatus('current') sw0657840_port_status_auto_nego = mib_table_column((1, 3, 6, 1, 4, 1, 5205, 2, 9, 1, 9, 1, 2, 1, 5), display_string()).setMaxAccess('readonly') if mibBuilder.loadTexts: sw0657840PortStatusAutoNego.setStatus('current') sw0657840_port_status_spd_dpx = mib_table_column((1, 3, 6, 1, 4, 1, 5205, 2, 9, 1, 9, 1, 2, 1, 6), display_string()).setMaxAccess('readonly') if mibBuilder.loadTexts: sw0657840PortStatusSpdDpx.setStatus('current') sw0657840_port_status_flw_ctrl = mib_table_column((1, 3, 6, 1, 4, 1, 5205, 2, 9, 1, 9, 1, 2, 1, 7), display_string()).setMaxAccess('readonly') if mibBuilder.loadTexts: sw0657840PortStatusFlwCtrl.setStatus('current') sw0657840_port_statu_description = mib_table_column((1, 3, 6, 1, 4, 1, 5205, 2, 9, 1, 9, 1, 2, 1, 8), display_string()).setMaxAccess('readonly') if mibBuilder.loadTexts: sw0657840PortStatuDescription.setStatus('current') sw0657840_port_conf = mib_identifier((1, 3, 6, 1, 4, 1, 5205, 2, 9, 1, 9, 2)) sw0657840_port_conf_number = mib_scalar((1, 3, 6, 1, 4, 1, 5205, 2, 9, 1, 9, 2, 1), integer32().subtype(subtypeSpec=value_range_constraint(1, 2147483647))).setMaxAccess('readonly') if mibBuilder.loadTexts: sw0657840PortConfNumber.setStatus('current') sw0657840_port_conf_table = mib_table((1, 3, 6, 1, 4, 1, 5205, 2, 9, 1, 9, 2, 2)) if mibBuilder.loadTexts: sw0657840PortConfTable.setStatus('current') sw0657840_port_conf_entry = mib_table_row((1, 3, 6, 1, 4, 1, 5205, 2, 9, 1, 9, 2, 2, 1)).setIndexNames((0, 'PRIVATE-SW0657840-MIB', 'sw0657840PortConfIndex')) if mibBuilder.loadTexts: sw0657840PortConfEntry.setStatus('current') sw0657840_port_conf_index = mib_table_column((1, 3, 6, 1, 4, 1, 5205, 2, 9, 1, 9, 2, 2, 1, 1), integer32().subtype(subtypeSpec=value_range_constraint(1, 2147483647))).setMaxAccess('readonly') if mibBuilder.loadTexts: sw0657840PortConfIndex.setStatus('current') sw0657840_port_conf_port_state = mib_table_column((1, 3, 6, 1, 4, 1, 5205, 2, 9, 1, 9, 2, 2, 1, 2), integer32().subtype(subtypeSpec=constraints_union(value_range_constraint(0, 0), value_range_constraint(1, 1)))).setMaxAccess('readwrite') if mibBuilder.loadTexts: sw0657840PortConfPortState.setStatus('current') sw0657840_port_conf_spd_dpx = mib_table_column((1, 3, 6, 1, 4, 1, 5205, 2, 9, 1, 9, 2, 2, 1, 3), integer32().subtype(subtypeSpec=value_range_constraint(0, 5))).setMaxAccess('readwrite') if mibBuilder.loadTexts: sw0657840PortConfSpdDpx.setStatus('current') sw0657840_port_conf_flw_ctrl = mib_table_column((1, 3, 6, 1, 4, 1, 5205, 2, 9, 1, 9, 2, 2, 1, 4), integer32().subtype(subtypeSpec=constraints_union(value_range_constraint(0, 0), value_range_constraint(1, 1)))).setMaxAccess('readwrite') if mibBuilder.loadTexts: sw0657840PortConfFlwCtrl.setStatus('current') sw0657840_port_conf_description = mib_table_column((1, 3, 6, 1, 4, 1, 5205, 2, 9, 1, 9, 2, 2, 1, 5), display_string()).setMaxAccess('readwrite') if mibBuilder.loadTexts: sw0657840PortConfDescription.setStatus('current') sw0657840_mirror = mib_identifier((1, 3, 6, 1, 4, 1, 5205, 2, 9, 1, 10)) sw0657840_mirror_mode = mib_scalar((1, 3, 6, 1, 4, 1, 5205, 2, 9, 1, 10, 1), integer32().subtype(subtypeSpec=constraints_union(value_range_constraint(0, 0), value_range_constraint(1, 1)))).setMaxAccess('readwrite') if mibBuilder.loadTexts: sw0657840MirrorMode.setStatus('current') sw0657840_mirroring_port = mib_scalar((1, 3, 6, 1, 4, 1, 5205, 2, 9, 1, 10, 2), integer32().subtype(subtypeSpec=value_range_constraint(1, 2147483647))).setMaxAccess('readwrite') if mibBuilder.loadTexts: sw0657840MirroringPort.setStatus('current') sw0657840_mirrored_ports = mib_scalar((1, 3, 6, 1, 4, 1, 5205, 2, 9, 1, 10, 3), display_string()).setMaxAccess('readwrite') if mibBuilder.loadTexts: sw0657840MirroredPorts.setStatus('current') sw0657840_max_pkt_len = mib_identifier((1, 3, 6, 1, 4, 1, 5205, 2, 9, 1, 11)) sw0657840_max_pkt_len1 = mib_identifier((1, 3, 6, 1, 4, 1, 5205, 2, 9, 1, 11, 1)) sw0657840_max_pkt_len_port_number = mib_scalar((1, 3, 6, 1, 4, 1, 5205, 2, 9, 1, 11, 1, 1), integer32().subtype(subtypeSpec=value_range_constraint(1, 2147483647))).setMaxAccess('readonly') if mibBuilder.loadTexts: sw0657840MaxPktLenPortNumber.setStatus('current') sw0657840_max_pkt_len_conf_table = mib_table((1, 3, 6, 1, 4, 1, 5205, 2, 9, 1, 11, 1, 2)) if mibBuilder.loadTexts: sw0657840MaxPktLenConfTable.setStatus('current') sw0657840_max_pkt_len_conf_entry = mib_table_row((1, 3, 6, 1, 4, 1, 5205, 2, 9, 1, 11, 1, 2, 1)).setIndexNames((0, 'PRIVATE-SW0657840-MIB', 'sw0657840MaxPktLenConfIndex')) if mibBuilder.loadTexts: sw0657840MaxPktLenConfEntry.setStatus('current') sw0657840_max_pkt_len_conf_index = mib_table_column((1, 3, 6, 1, 4, 1, 5205, 2, 9, 1, 11, 1, 2, 1, 1), integer32().subtype(subtypeSpec=value_range_constraint(1, 2147483647))).setMaxAccess('readonly') if mibBuilder.loadTexts: sw0657840MaxPktLenConfIndex.setStatus('current') sw0657840_max_pkt_len_conf_setting = mib_table_column((1, 3, 6, 1, 4, 1, 5205, 2, 9, 1, 11, 1, 2, 1, 2), integer32().subtype(subtypeSpec=constraints_union(value_range_constraint(1518, 1518), value_range_constraint(1532, 1532), value_range_constraint(9216, 9216)))).setMaxAccess('readwrite') if mibBuilder.loadTexts: sw0657840MaxPktLenConfSetting.setStatus('current') sw0657840_bandwidth = mib_identifier((1, 3, 6, 1, 4, 1, 5205, 2, 9, 1, 12)) sw0657840_bandwidth1 = mib_identifier((1, 3, 6, 1, 4, 1, 5205, 2, 9, 1, 12, 1)) sw0657840_bandwidth_port_number = mib_scalar((1, 3, 6, 1, 4, 1, 5205, 2, 9, 1, 12, 1, 1), integer32().subtype(subtypeSpec=value_range_constraint(1, 2147483647))).setMaxAccess('readonly') if mibBuilder.loadTexts: sw0657840BandwidthPortNumber.setStatus('current') sw0657840_bandwidth_conf_table = mib_table((1, 3, 6, 1, 4, 1, 5205, 2, 9, 1, 12, 1, 2)) if mibBuilder.loadTexts: sw0657840BandwidthConfTable.setStatus('current') sw0657840_bandwidth_conf_entry = mib_table_row((1, 3, 6, 1, 4, 1, 5205, 2, 9, 1, 12, 1, 2, 1)).setIndexNames((0, 'PRIVATE-SW0657840-MIB', 'sw0657840BandwidthConfIndex')) if mibBuilder.loadTexts: sw0657840BandwidthConfEntry.setStatus('current') sw0657840_bandwidth_conf_index = mib_table_column((1, 3, 6, 1, 4, 1, 5205, 2, 9, 1, 12, 1, 2, 1, 1), integer32().subtype(subtypeSpec=value_range_constraint(1, 2147483647))).setMaxAccess('readonly') if mibBuilder.loadTexts: sw0657840BandwidthConfIndex.setStatus('current') sw0657840_bandwidth_conf_ingress_state = mib_table_column((1, 3, 6, 1, 4, 1, 5205, 2, 9, 1, 12, 1, 2, 1, 2), integer32().subtype(subtypeSpec=constraints_union(value_range_constraint(0, 0), value_range_constraint(1, 1)))).setMaxAccess('readwrite') if mibBuilder.loadTexts: sw0657840BandwidthConfIngressState.setStatus('current') sw0657840_bandwidth_conf_ingress_bw = mib_table_column((1, 3, 6, 1, 4, 1, 5205, 2, 9, 1, 12, 1, 2, 1, 3), integer32().subtype(subtypeSpec=value_range_constraint(0, 1000))).setMaxAccess('readwrite') if mibBuilder.loadTexts: sw0657840BandwidthConfIngressBW.setStatus('current') sw0657840_bandwidth_conf_storm_state = mib_table_column((1, 3, 6, 1, 4, 1, 5205, 2, 9, 1, 12, 1, 2, 1, 4), integer32().subtype(subtypeSpec=constraints_union(value_range_constraint(0, 0), value_range_constraint(1, 1)))).setMaxAccess('readwrite') if mibBuilder.loadTexts: sw0657840BandwidthConfStormState.setStatus('current') sw0657840_bandwidth_conf_storm_bw = mib_table_column((1, 3, 6, 1, 4, 1, 5205, 2, 9, 1, 12, 1, 2, 1, 5), integer32().subtype(subtypeSpec=value_range_constraint(0, 1000))).setMaxAccess('readwrite') if mibBuilder.loadTexts: sw0657840BandwidthConfStormBW.setStatus('current') sw0657840_bandwidth_conf_egress_state = mib_table_column((1, 3, 6, 1, 4, 1, 5205, 2, 9, 1, 12, 1, 2, 1, 6), integer32().subtype(subtypeSpec=constraints_union(value_range_constraint(0, 0), value_range_constraint(1, 1)))).setMaxAccess('readwrite') if mibBuilder.loadTexts: sw0657840BandwidthConfEgressState.setStatus('current') sw0657840_bandwidth_conf_egress_bw = mib_table_column((1, 3, 6, 1, 4, 1, 5205, 2, 9, 1, 12, 1, 2, 1, 7), integer32().subtype(subtypeSpec=value_range_constraint(0, 1000))).setMaxAccess('readwrite') if mibBuilder.loadTexts: sw0657840BandwidthConfEgressBW.setStatus('current') sw0657840_loop_detected_conf = mib_identifier((1, 3, 6, 1, 4, 1, 5205, 2, 9, 1, 13)) sw0657840_loop_detected_number = mib_scalar((1, 3, 6, 1, 4, 1, 5205, 2, 9, 1, 13, 1), integer32().subtype(subtypeSpec=value_range_constraint(1, 2147483647))).setMaxAccess('readonly') if mibBuilder.loadTexts: sw0657840LoopDetectedNumber.setStatus('current') sw0657840_loop_detected_table = mib_table((1, 3, 6, 1, 4, 1, 5205, 2, 9, 1, 13, 2)) if mibBuilder.loadTexts: sw0657840LoopDetectedTable.setStatus('current') sw0657840_loop_detected_entry = mib_table_row((1, 3, 6, 1, 4, 1, 5205, 2, 9, 1, 13, 2, 1)).setIndexNames((0, 'PRIVATE-SW0657840-MIB', 'sw0657840LoopDetectedfIndex')) if mibBuilder.loadTexts: sw0657840LoopDetectedEntry.setStatus('current') sw0657840_loop_detectedf_index = mib_table_column((1, 3, 6, 1, 4, 1, 5205, 2, 9, 1, 13, 2, 1, 1), integer32().subtype(subtypeSpec=value_range_constraint(1, 2147483647))).setMaxAccess('readonly') if mibBuilder.loadTexts: sw0657840LoopDetectedfIndex.setStatus('current') sw0657840_loop_detected_state_ebl = mib_table_column((1, 3, 6, 1, 4, 1, 5205, 2, 9, 1, 13, 2, 1, 2), integer32().subtype(subtypeSpec=constraints_union(value_range_constraint(0, 0), value_range_constraint(1, 1)))).setMaxAccess('readwrite') if mibBuilder.loadTexts: sw0657840LoopDetectedStateEbl.setStatus('current') sw0657840_loop_detected_current_status = mib_table_column((1, 3, 6, 1, 4, 1, 5205, 2, 9, 1, 13, 2, 1, 3), integer32().subtype(subtypeSpec=constraints_union(value_range_constraint(0, 0), value_range_constraint(1, 1)))).setMaxAccess('readonly') if mibBuilder.loadTexts: sw0657840LoopDetectedCurrentStatus.setStatus('current') sw0657840_loop_detected_resumed = mib_table_column((1, 3, 6, 1, 4, 1, 5205, 2, 9, 1, 13, 2, 1, 4), integer32().subtype(subtypeSpec=constraints_union(value_range_constraint(0, 0), value_range_constraint(1, 1)))).setMaxAccess('readwrite') if mibBuilder.loadTexts: sw0657840LoopDetectedResumed.setStatus('current') sw0657840_loop_detected_action = mib_scalar((1, 3, 6, 1, 4, 1, 5205, 2, 9, 1, 13, 3), integer32().subtype(subtypeSpec=constraints_union(value_range_constraint(0, 0), value_range_constraint(1, 1)))).setMaxAccess('readwrite') if mibBuilder.loadTexts: sw0657840LoopDetectedAction.setStatus('current') sw0657840_sfp_info = mib_identifier((1, 3, 6, 1, 4, 1, 5205, 2, 9, 1, 14)) sw0657840_sfp_info_number = mib_scalar((1, 3, 6, 1, 4, 1, 5205, 2, 9, 1, 14, 1), integer32().subtype(subtypeSpec=value_range_constraint(1, 2147483647))).setMaxAccess('readonly') if mibBuilder.loadTexts: sw0657840SFPInfoNumber.setStatus('current') sw0657840_sfp_info_table = mib_table((1, 3, 6, 1, 4, 1, 5205, 2, 9, 1, 14, 2)) if mibBuilder.loadTexts: sw0657840SFPInfoTable.setStatus('current') sw0657840_sfp_info_entry = mib_table_row((1, 3, 6, 1, 4, 1, 5205, 2, 9, 1, 14, 2, 1)).setIndexNames((0, 'PRIVATE-SW0657840-MIB', 'sw0657840SFPInfoIndex')) if mibBuilder.loadTexts: sw0657840SFPInfoEntry.setStatus('current') sw0657840_sfp_info_index = mib_table_column((1, 3, 6, 1, 4, 1, 5205, 2, 9, 1, 14, 2, 1, 1), integer32().subtype(subtypeSpec=value_range_constraint(1, 2147483647))).setMaxAccess('readonly') if mibBuilder.loadTexts: sw0657840SFPInfoIndex.setStatus('current') sw0657840_sfp_connector_type = mib_table_column((1, 3, 6, 1, 4, 1, 5205, 2, 9, 1, 14, 2, 1, 2), display_string()).setMaxAccess('readonly') if mibBuilder.loadTexts: sw0657840SFPConnectorType.setStatus('current') sw0657840_sfp_fiber_type = mib_table_column((1, 3, 6, 1, 4, 1, 5205, 2, 9, 1, 14, 2, 1, 3), display_string()).setMaxAccess('readonly') if mibBuilder.loadTexts: sw0657840SFPFiberType.setStatus('current') sw0657840_sfp_wavelength = mib_table_column((1, 3, 6, 1, 4, 1, 5205, 2, 9, 1, 14, 2, 1, 4), display_string()).setMaxAccess('readonly') if mibBuilder.loadTexts: sw0657840SFPWavelength.setStatus('current') sw0657840_sfp_baud_rate = mib_table_column((1, 3, 6, 1, 4, 1, 5205, 2, 9, 1, 14, 2, 1, 5), display_string()).setMaxAccess('readonly') if mibBuilder.loadTexts: sw0657840SFPBaudRate.setStatus('current') sw0657840_sfp_vendor_oui = mib_table_column((1, 3, 6, 1, 4, 1, 5205, 2, 9, 1, 14, 2, 1, 6), display_string()).setMaxAccess('readonly') if mibBuilder.loadTexts: sw0657840SFPVendorOUI.setStatus('current') sw0657840_sfp_vendor_name = mib_table_column((1, 3, 6, 1, 4, 1, 5205, 2, 9, 1, 14, 2, 1, 7), display_string()).setMaxAccess('readonly') if mibBuilder.loadTexts: sw0657840SFPVendorName.setStatus('current') sw0657840_sfp_vendor_pn = mib_table_column((1, 3, 6, 1, 4, 1, 5205, 2, 9, 1, 14, 2, 1, 8), display_string()).setMaxAccess('readonly') if mibBuilder.loadTexts: sw0657840SFPVendorPN.setStatus('current') sw0657840_sfp_vendor_rev = mib_table_column((1, 3, 6, 1, 4, 1, 5205, 2, 9, 1, 14, 2, 1, 9), display_string()).setMaxAccess('readonly') if mibBuilder.loadTexts: sw0657840SFPVendorRev.setStatus('current') sw0657840_sfp_vendor_sn = mib_table_column((1, 3, 6, 1, 4, 1, 5205, 2, 9, 1, 14, 2, 1, 10), display_string()).setMaxAccess('readonly') if mibBuilder.loadTexts: sw0657840SFPVendorSN.setStatus('current') sw0657840_sfp_date_code = mib_table_column((1, 3, 6, 1, 4, 1, 5205, 2, 9, 1, 14, 2, 1, 11), display_string()).setMaxAccess('readonly') if mibBuilder.loadTexts: sw0657840SFPDateCode.setStatus('current') sw0657840_sfp_temperature = mib_table_column((1, 3, 6, 1, 4, 1, 5205, 2, 9, 1, 14, 2, 1, 12), display_string()).setMaxAccess('readonly') if mibBuilder.loadTexts: sw0657840SFPTemperature.setStatus('current') sw0657840_sfp_vcc = mib_table_column((1, 3, 6, 1, 4, 1, 5205, 2, 9, 1, 14, 2, 1, 13), display_string()).setMaxAccess('readonly') if mibBuilder.loadTexts: sw0657840SFPVcc.setStatus('current') sw0657840_sfp_tx_bias = mib_table_column((1, 3, 6, 1, 4, 1, 5205, 2, 9, 1, 14, 2, 1, 14), display_string()).setMaxAccess('readonly') if mibBuilder.loadTexts: sw0657840SFPTxBias.setStatus('current') sw0657840_sfp_tx_pwr = mib_table_column((1, 3, 6, 1, 4, 1, 5205, 2, 9, 1, 14, 2, 1, 15), display_string()).setMaxAccess('readonly') if mibBuilder.loadTexts: sw0657840SFPTxPWR.setStatus('current') sw0657840_sfp_rx_pwr = mib_table_column((1, 3, 6, 1, 4, 1, 5205, 2, 9, 1, 14, 2, 1, 16), display_string()).setMaxAccess('readonly') if mibBuilder.loadTexts: sw0657840SFPRxPWR.setStatus('current') sw0657840_trap_entry = mib_identifier((1, 3, 6, 1, 4, 1, 5205, 2, 9, 1, 20)) sw0657840_module_inserted = notification_type((1, 3, 6, 1, 4, 1, 5205, 2, 9, 1, 20, 1)).setObjects(('IF-MIB', 'ifIndex')) if mibBuilder.loadTexts: sw0657840ModuleInserted.setStatus('current') sw0657840_module_removed = notification_type((1, 3, 6, 1, 4, 1, 5205, 2, 9, 1, 20, 2)).setObjects(('IF-MIB', 'ifIndex')) if mibBuilder.loadTexts: sw0657840ModuleRemoved.setStatus('current') sw0657840_dual_media_swapped = notification_type((1, 3, 6, 1, 4, 1, 5205, 2, 9, 1, 20, 3)).setObjects(('IF-MIB', 'ifIndex')) if mibBuilder.loadTexts: sw0657840DualMediaSwapped.setStatus('current') sw0657840_loop_detected = notification_type((1, 3, 6, 1, 4, 1, 5205, 2, 9, 1, 20, 5)).setObjects(('IF-MIB', 'ifIndex')) if mibBuilder.loadTexts: sw0657840LoopDetected.setStatus('current') sw0657840_stp_state_disabled = notification_type((1, 3, 6, 1, 4, 1, 5205, 2, 9, 1, 20, 100)) if mibBuilder.loadTexts: sw0657840StpStateDisabled.setStatus('current') sw0657840_stp_state_enabled = notification_type((1, 3, 6, 1, 4, 1, 5205, 2, 9, 1, 20, 101)) if mibBuilder.loadTexts: sw0657840StpStateEnabled.setStatus('current') sw0657840_stp_topology_changed = notification_type((1, 3, 6, 1, 4, 1, 5205, 2, 9, 1, 20, 102)).setObjects(('IF-MIB', 'ifIndex')) if mibBuilder.loadTexts: sw0657840StpTopologyChanged.setStatus('current') sw0657840_lacp_state_disabled = notification_type((1, 3, 6, 1, 4, 1, 5205, 2, 9, 1, 20, 120)).setObjects(('IF-MIB', 'ifIndex'), ('PRIVATE-SW0657840-MIB', 'groupId')) if mibBuilder.loadTexts: sw0657840LacpStateDisabled.setStatus('current') sw0657840_lacp_state_enabled = notification_type((1, 3, 6, 1, 4, 1, 5205, 2, 9, 1, 20, 121)).setObjects(('IF-MIB', 'ifIndex'), ('PRIVATE-SW0657840-MIB', 'groupId')) if mibBuilder.loadTexts: sw0657840LacpStateEnabled.setStatus('current') sw0657840_lacp_port_added = notification_type((1, 3, 6, 1, 4, 1, 5205, 2, 9, 1, 20, 123)).setObjects(('IF-MIB', 'ifIndex'), ('PRIVATE-SW0657840-MIB', 'actorkey'), ('PRIVATE-SW0657840-MIB', 'partnerkey')) if mibBuilder.loadTexts: sw0657840LacpPortAdded.setStatus('current') sw0657840_lacp_port_trunk_failure = notification_type((1, 3, 6, 1, 4, 1, 5205, 2, 9, 1, 20, 124)).setObjects(('IF-MIB', 'ifIndex'), ('PRIVATE-SW0657840-MIB', 'actorkey'), ('PRIVATE-SW0657840-MIB', 'partnerkey')) if mibBuilder.loadTexts: sw0657840LacpPortTrunkFailure.setStatus('current') sw0657840_gvrp_state_disabled = notification_type((1, 3, 6, 1, 4, 1, 5205, 2, 9, 1, 20, 140)) if mibBuilder.loadTexts: sw0657840GvrpStateDisabled.setStatus('current') sw0657840_gvrp_state_enabled = notification_type((1, 3, 6, 1, 4, 1, 5205, 2, 9, 1, 20, 141)) if mibBuilder.loadTexts: sw0657840GvrpStateEnabled.setStatus('current') sw0657840_vlan_state_disabled = notification_type((1, 3, 6, 1, 4, 1, 5205, 2, 9, 1, 20, 150)) if mibBuilder.loadTexts: sw0657840VlanStateDisabled.setStatus('current') sw0657840_vlan_port_base_enabled = notification_type((1, 3, 6, 1, 4, 1, 5205, 2, 9, 1, 20, 151)) if mibBuilder.loadTexts: sw0657840VlanPortBaseEnabled.setStatus('current') sw0657840_vlan_tag_base_enabled = notification_type((1, 3, 6, 1, 4, 1, 5205, 2, 9, 1, 20, 152)) if mibBuilder.loadTexts: sw0657840VlanTagBaseEnabled.setStatus('current') sw0657840_vlan_metro_mode_enabled = notification_type((1, 3, 6, 1, 4, 1, 5205, 2, 9, 1, 20, 153)).setObjects(('PRIVATE-SW0657840-MIB', 'uplink')) if mibBuilder.loadTexts: sw0657840VlanMetroModeEnabled.setStatus('current') sw0657840_vlan_double_tag_enabled = notification_type((1, 3, 6, 1, 4, 1, 5205, 2, 9, 1, 20, 154)) if mibBuilder.loadTexts: sw0657840VlanDoubleTagEnabled.setStatus('current') sw0657840_user_login = notification_type((1, 3, 6, 1, 4, 1, 5205, 2, 9, 1, 20, 200)).setObjects(('PRIVATE-SW0657840-MIB', 'username')) if mibBuilder.loadTexts: sw0657840UserLogin.setStatus('current') sw0657840_user_logout = notification_type((1, 3, 6, 1, 4, 1, 5205, 2, 9, 1, 20, 201)).setObjects(('PRIVATE-SW0657840-MIB', 'username')) if mibBuilder.loadTexts: sw0657840UserLogout.setStatus('current') sw0657840_trap_variable = mib_identifier((1, 3, 6, 1, 4, 1, 5205, 2, 9, 1, 21)) username = mib_scalar((1, 3, 6, 1, 4, 1, 5205, 2, 9, 1, 21, 1), display_string()).setMaxAccess('readonly') if mibBuilder.loadTexts: username.setStatus('current') group_id = mib_scalar((1, 3, 6, 1, 4, 1, 5205, 2, 9, 1, 21, 2), integer32().subtype(subtypeSpec=value_range_constraint(1, 8))).setMaxAccess('readonly') if mibBuilder.loadTexts: groupId.setStatus('current') actorkey = mib_scalar((1, 3, 6, 1, 4, 1, 5205, 2, 9, 1, 21, 3), integer32().subtype(subtypeSpec=value_range_constraint(1, 2147483647))).setMaxAccess('readonly') if mibBuilder.loadTexts: actorkey.setStatus('current') partnerkey = mib_scalar((1, 3, 6, 1, 4, 1, 5205, 2, 9, 1, 21, 4), integer32().subtype(subtypeSpec=value_range_constraint(1, 2147483647))).setMaxAccess('readonly') if mibBuilder.loadTexts: partnerkey.setStatus('current') uplink = mib_scalar((1, 3, 6, 1, 4, 1, 5205, 2, 9, 1, 21, 5), display_string()).setMaxAccess('readonly') if mibBuilder.loadTexts: uplink.setStatus('current') mibBuilder.exportSymbols('PRIVATE-SW0657840-MIB', sw0657840Diagnostic=sw0657840Diagnostic, sw0657840SMSUserTable=sw0657840SMSUserTable, sw0657840PortConfFlwCtrl=sw0657840PortConfFlwCtrl, sw0657840SerialNumber=sw0657840SerialNumber, sw0657840DevicePort=sw0657840DevicePort, sw0657840SFPTxPWR=sw0657840SFPTxPWR, username=username, sw0657840PortConfTable=sw0657840PortConfTable, sw0657840PingTest=sw0657840PingTest, sw0657840Time=sw0657840Time, sw0657840PortStatusTable=sw0657840PortStatusTable, sw0657840SFPVendorRev=sw0657840SFPVendorRev, sw0657840ModuleInserted=sw0657840ModuleInserted, sw0657840AccountNumber=sw0657840AccountNumber, sw0657840ModuleRemoved=sw0657840ModuleRemoved, sw0657840SFPWavelength=sw0657840SFPWavelength, sw0657840PortStatusLink=sw0657840PortStatusLink, sw0657840BandwidthConfStormBW=sw0657840BandwidthConfStormBW, sw0657840UploadLog=sw0657840UploadLog, sw0657840EventSendSMS=sw0657840EventSendSMS, sw0657840PortConf=sw0657840PortConf, sw0657840DoImportConfig=sw0657840DoImportConfig, sw0657840PortConfSpdDpx=sw0657840PortConfSpdDpx, sw0657840Alarm=sw0657840Alarm, switch=switch, sw0657840EEPROMTest=sw0657840EEPROMTest, sw0657840LoopDetectedConf=sw0657840LoopDetectedConf, sw0657840LacpStateDisabled=sw0657840LacpStateDisabled, sw0657840BandwidthConfIngressBW=sw0657840BandwidthConfIngressBW, sw0657840TrapHostIndex=sw0657840TrapHostIndex, actorkey=actorkey, sw0657840ExternalLoopbackTest=sw0657840ExternalLoopbackTest, sw0657840MirroringPort=sw0657840MirroringPort, sw0657840RestoreDefault=sw0657840RestoreDefault, sw0657840SFPVendorOUI=sw0657840SFPVendorOUI, sw0657840AccountIndex=sw0657840AccountIndex, sw0657840MirroredPorts=sw0657840MirroredPorts, sw0657840AutoUploadLogState=sw0657840AutoUploadLogState, sw0657840DoAccountAdd=sw0657840DoAccountAdd, sw0657840BandwidthPortNumber=sw0657840BandwidthPortNumber, sw0657840RamSize=sw0657840RamSize, sw0657840EventIndex=sw0657840EventIndex, sw0657840Produces=sw0657840Produces, sw0657840FlashSize=sw0657840FlashSize, sw0657840EmailPassword=sw0657840EmailPassword, sw0657840SMSUsername=sw0657840SMSUsername, sw0657840Mirror=sw0657840Mirror, sw0657840Configuration=sw0657840Configuration, sw0657840BandwidthConfStormState=sw0657840BandwidthConfStormState, sw0657840NTPTimeSync=sw0657840NTPTimeSync, sw0657840LoopDetectedfIndex=sw0657840LoopDetectedfIndex, sw0657840TrapEntry=sw0657840TrapEntry, sw0657840SMSServer=sw0657840SMSServer, sw0657840MirrorMode=sw0657840MirrorMode, sw0657840SFPTemperature=sw0657840SFPTemperature, sw0657840UartTest=sw0657840UartTest, sw0657840GvrpStateEnabled=sw0657840GvrpStateEnabled, sw0657840TrapVariable=sw0657840TrapVariable, sw0657840SaveRestore=sw0657840SaveRestore, sw0657840PortConfNumber=sw0657840PortConfNumber, sw0657840PortStatusIndex=sw0657840PortStatusIndex, sw0657840AccountPassword=sw0657840AccountPassword, sw0657840PortStatusMedia=sw0657840PortStatusMedia, sw0657840SMSUserEntry=sw0657840SMSUserEntry, sw0657840DoExportConfig=sw0657840DoExportConfig, sw0657840Bandwidth=sw0657840Bandwidth, sw0657840TrapHostTable=sw0657840TrapHostTable, sw0657840SystemCurrentTime=sw0657840SystemCurrentTime, sw0657840EventEntry=sw0657840EventEntry, sw0657840EventSendTrap=sw0657840EventSendTrap, sw0657840LoopDetectedEntry=sw0657840LoopDetectedEntry, sw0657840SFPRxPWR=sw0657840SFPRxPWR, sw0657840MaxPktLenConfTable=sw0657840MaxPktLenConfTable, sw0657840LoopDetectedAction=sw0657840LoopDetectedAction, sw0657840ProductID=sw0657840ProductID, sw0657840VlanPortBaseEnabled=sw0657840VlanPortBaseEnabled, sw0657840LogIndex=sw0657840LogIndex, sw0657840UserLogin=sw0657840UserLogin, sw0657840SFPBaudRate=sw0657840SFPBaudRate, sw0657840Account=sw0657840Account, sw0657840TrapHostCommunity=sw0657840TrapHostCommunity, sw0657840LacpPortTrunkFailure=sw0657840LacpPortTrunkFailure, sw0657840EventTable=sw0657840EventTable, sw0657840LoopDetectedCurrentStatus=sw0657840LoopDetectedCurrentStatus, sw0657840FirmwareVersion=sw0657840FirmwareVersion, sw0657840ImportConfigName=sw0657840ImportConfigName, sw0657840PortStatusAutoNego=sw0657840PortStatusAutoNego, sw0657840MaxPktLen=sw0657840MaxPktLen, sw0657840DhcpSetting=sw0657840DhcpSetting, sw0657840Reboot=sw0657840Reboot, sw0657840SaveUser=sw0657840SaveUser, sw0657840PortStatusPortState=sw0657840PortStatusPortState, sw0657840BandwidthConfIngressState=sw0657840BandwidthConfIngressState, sw0657840SetCommunity=sw0657840SetCommunity, sw0657840VlanDoubleTagEnabled=sw0657840VlanDoubleTagEnabled, sw0657840Log=sw0657840Log, sw0657840DoFirmwareUpgrade=sw0657840DoFirmwareUpgrade, sw0657840HostMacAddress=sw0657840HostMacAddress, sw0657840FirmwareFileName=sw0657840FirmwareFileName, sw0657840LoopDetectedTable=sw0657840LoopDetectedTable, sw0657840ManualTimeSetting=sw0657840ManualTimeSetting, sw0657840LogEvent=sw0657840LogEvent, sw0657840ClearLog=sw0657840ClearLog, sw0657840EventName=sw0657840EventName, sw0657840PortStatuDescription=sw0657840PortStatuDescription, sw0657840NTPTimeZone=sw0657840NTPTimeZone, sw0657840LacpStateEnabled=sw0657840LacpStateEnabled, sw0657840SMSUserMobilePhone=sw0657840SMSUserMobilePhone, sw0657840StpStateEnabled=sw0657840StpStateEnabled, sw0657840VlanTagBaseEnabled=sw0657840VlanTagBaseEnabled, sw0657840DnsServer=sw0657840DnsServer, sw0657840LogTable=sw0657840LogTable, sw0657840MaxPktLen1=sw0657840MaxPktLen1, sw0657840EmailUserIndex=sw0657840EmailUserIndex, sw0657840ConfigFile=sw0657840ConfigFile, sw0657840LoopDetected=sw0657840LoopDetected, sw0657840EmailUserTable=sw0657840EmailUserTable, sw0657840DaylightEndTime=sw0657840DaylightEndTime, sw0657840SaveStart=sw0657840SaveStart, sw0657840SMS=sw0657840SMS, sw0657840DnsSetting=sw0657840DnsSetting, sw0657840Snmp=sw0657840Snmp, sw0657840IPAddress=sw0657840IPAddress, sw0657840DefaultGateway=sw0657840DefaultGateway, sw0657840AccountDel=sw0657840AccountDel, sw0657840EmailUserNumber=sw0657840EmailUserNumber, sw0657840AccountAddPassword=sw0657840AccountAddPassword, sw0657840SFPVendorSN=sw0657840SFPVendorSN, sw0657840EmailUserAddress=sw0657840EmailUserAddress, sw0657840NTPServer=sw0657840NTPServer, sw0657840EventNumber=sw0657840EventNumber, sw0657840BandwidthConfEntry=sw0657840BandwidthConfEntry, sw0657840LoopDetectedStateEbl=sw0657840LoopDetectedStateEbl, sw0657840GvrpStateDisabled=sw0657840GvrpStateDisabled, sw0657840AccountName=sw0657840AccountName, sw0657840EmailUsername=sw0657840EmailUsername, sw0657840DramTest=sw0657840DramTest, sw0657840FlashTest=sw0657840FlashTest, sw0657840Tftp=sw0657840Tftp, sw0657840RestoreUser=sw0657840RestoreUser, sw0657840EmailUserEntry=sw0657840EmailUserEntry, sw0657840VlanMetroModeEnabled=sw0657840VlanMetroModeEnabled, sw0657840SFPInfoIndex=sw0657840SFPInfoIndex, sw0657840PortStatusFlwCtrl=sw0657840PortStatusFlwCtrl, partnerkey=partnerkey, sw0657840DualMediaSwapped=sw0657840DualMediaSwapped, sw0657840SFPInfoNumber=sw0657840SFPInfoNumber, sw0657840Email=sw0657840Email, sw0657840MaxPktLenPortNumber=sw0657840MaxPktLenPortNumber, sw0657840LoopDetectedNumber=sw0657840LoopDetectedNumber, groupId=groupId, sw0657840SFPInfo=sw0657840SFPInfo, sw0657840PortStatus=sw0657840PortStatus, sw0657840TrapHostIP=sw0657840TrapHostIP, sw0657840TftpServer=sw0657840TftpServer, sw0657840Event=sw0657840Event, sw0657840BandwidthConfEgressBW=sw0657840BandwidthConfEgressBW, sw0657840SFPFiberType=sw0657840SFPFiberType, sw0657840BiosVsersion=sw0657840BiosVsersion, sw0657840Bandwidth1=sw0657840Bandwidth1, sw0657840ExportConfigName=sw0657840ExportConfigName, sw0657840SFPInfoEntry=sw0657840SFPInfoEntry, sw0657840SFPInfoTable=sw0657840SFPInfoTable, sw0657840AccountAddName=sw0657840AccountAddName, sw0657840TrapHostPort=sw0657840TrapHostPort, sw0657840TrapHostEntry=sw0657840TrapHostEntry, sw0657840CommonSys=sw0657840CommonSys, privatetech=privatetech, sw0657840VlanStateDisabled=sw0657840VlanStateDisabled, sw0657840DaylightSavingTime=sw0657840DaylightSavingTime, sw0657840AccountTable=sw0657840AccountTable, sw0657840BandwidthConfTable=sw0657840BandwidthConfTable, sw0657840LoopDetectedResumed=sw0657840LoopDetectedResumed, sw0657840SMSUserIndex=sw0657840SMSUserIndex, sw0657840StpStateDisabled=sw0657840StpStateDisabled, sw0657840PortStatusEntry=sw0657840PortStatusEntry, sw0657840SMSUserNumber=sw0657840SMSUserNumber, sw0657840BandwidthConfEgressState=sw0657840BandwidthConfEgressState, sw0657840LogEntry=sw0657840LogEntry, sw0657840MechanicalVersion=sw0657840MechanicalVersion, sw0657840NetMask=sw0657840NetMask, sw0657840GetCommunity=sw0657840GetCommunity, sw0657840SFPConnectorType=sw0657840SFPConnectorType, sw0657840TrapHostNumber=sw0657840TrapHostNumber, sw0657840SFPVcc=sw0657840SFPVcc, sw0657840LogNumber=sw0657840LogNumber, sw0657840LacpPortAdded=sw0657840LacpPortAdded, sw0657840SFPVendorPN=sw0657840SFPVendorPN, sw0657840UserLogout=sw0657840UserLogout, sw0657840EmailServer=sw0657840EmailServer, sw0657840EventSendEmail=sw0657840EventSendEmail, sw0657840Port=sw0657840Port, sw0657840IP=sw0657840IP, sw0657840HardwareVersion=sw0657840HardwareVersion, sw0657840MaxPktLenConfEntry=sw0657840MaxPktLenConfEntry, sw0657840DaylightStartTime=sw0657840DaylightStartTime, sw0657840SFPVendorName=sw0657840SFPVendorName, sw0657840PortConfIndex=sw0657840PortConfIndex, sw0657840PortConfDescription=sw0657840PortConfDescription, sw0657840BandwidthConfIndex=sw0657840BandwidthConfIndex, sw0657840PortStatusNumber=sw0657840PortStatusNumber, sw0657840AccountEntry=sw0657840AccountEntry, sw0657840StpTopologyChanged=sw0657840StpTopologyChanged, sw0657840InternalLoopbackTest=sw0657840InternalLoopbackTest, sw0657840MaxPktLenConfSetting=sw0657840MaxPktLenConfSetting, sw0657840SFPTxBias=sw0657840SFPTxBias, sw0657840PortConfEntry=sw0657840PortConfEntry, sw0657840MaxPktLenConfIndex=sw0657840MaxPktLenConfIndex, uplink=uplink, sw0657840PortStatusSpdDpx=sw0657840PortStatusSpdDpx, sw0657840PortConfPortState=sw0657840PortConfPortState, sw0657840System=sw0657840System, sw0657840Firmware=sw0657840Firmware, PYSNMP_MODULE_ID=privatetech, sw0657840SMSPassword=sw0657840SMSPassword, sw0657840SFPDateCode=sw0657840SFPDateCode, sw0657840AccountAuthorization=sw0657840AccountAuthorization)
class MinDiffList: # def __init__(self): # self.diff = sys.maxint def findMinDiff(self, arr): arr.sort() self.diff = arr[len(arr) - 1] for iter in range(len(arr)): adjacentDiff = abs(arr[iter + 1]) - abs(arr[iter]) if adjacentDiff < self.diff: self.diff = adjacentDiff return adjacentDiff findDiff = MinDiffList() print(findDiff.findMinDiff([1, 2, 3, 4, 5, 888, 100, 120, -5, 0.8]))
class Mindifflist: def find_min_diff(self, arr): arr.sort() self.diff = arr[len(arr) - 1] for iter in range(len(arr)): adjacent_diff = abs(arr[iter + 1]) - abs(arr[iter]) if adjacentDiff < self.diff: self.diff = adjacentDiff return adjacentDiff find_diff = min_diff_list() print(findDiff.findMinDiff([1, 2, 3, 4, 5, 888, 100, 120, -5, 0.8]))
""" Author: CaptCorpMURICA Project: 100DaysPython File: module1_day06_lists.py Creation Date: 6/2/2019, 8:55 AM Description: Learn the basic of lists in python. """ list_1 = [] list_2 = list() print("List 1 Type: {}\nList 2 Type: {}".format(type(list_1), type(list_2))) text = "Luggage Combination" print(list(text)) luggage = [1, 3, 5, 2, 4] luggage.sort() print(luggage) numbers = [1, 2, 3, 4, 5] numbers_sorted = numbers numbers_sorted.sort(reverse=True) print("numbers: {}\nnumbers_sorted: {}".format(numbers, numbers_sorted)) numbers = [1, 2, 3, 4, 5] numbers_sorted = list(numbers) numbers_sorted.sort(reverse=True) print("numbers: {}\nnumbers_sorted: {}".format(numbers, numbers_sorted)) odd = [1, 3, 5] even = [2, 4] luggage = odd + even print(luggage) luggage = [1, 3, 5] even = [2, 4] luggage.extend(even) print(luggage) odd = [1, 3, 5] even = [2, 4] luggage = odd + even print("Unsorted list: {}".format(luggage)) print("Using the sorted() function: {}".format(sorted(luggage))) luggage.sort() print("Using the .sort() method: {}".format(luggage)) lines = [] lines.append("They told me to comb the desert, so I'm combing the desert") lines.append("YOGURT! I hate Yogurt! Even with strawberries!") lines.append("We'll meet again in Spaceballs 2 : The Quest for More Money.") print(lines) luggage = [1, 2, 3, 4, 5] print(luggage.index(2)) quote = list("YOGURT! I hate Yogurt! Even with strawberries!") print(quote.count("r")) luggage = [1, 2, 4, 5] luggage.insert(2, 3) print(luggage) luggage = [1, 2, 3, 3, 4, 5, 6] luggage.pop() print(luggage) luggage.pop(2) print(luggage) rng = list(range(0,10)) rng.remove(7) print(rng) countdown = [5, 4, 3, 2, 1] countdown.reverse() print(countdown) sample = list(range(1,13)) times_12 = [i * 12 for i in sample] print(times_12) luggage.clear() print(luggage) luggage = [2, 2, 3, 4, 5] luggage[0] = 1 print(luggage)
""" Author: CaptCorpMURICA Project: 100DaysPython File: module1_day06_lists.py Creation Date: 6/2/2019, 8:55 AM Description: Learn the basic of lists in python. """ list_1 = [] list_2 = list() print('List 1 Type: {}\nList 2 Type: {}'.format(type(list_1), type(list_2))) text = 'Luggage Combination' print(list(text)) luggage = [1, 3, 5, 2, 4] luggage.sort() print(luggage) numbers = [1, 2, 3, 4, 5] numbers_sorted = numbers numbers_sorted.sort(reverse=True) print('numbers: {}\nnumbers_sorted: {}'.format(numbers, numbers_sorted)) numbers = [1, 2, 3, 4, 5] numbers_sorted = list(numbers) numbers_sorted.sort(reverse=True) print('numbers: {}\nnumbers_sorted: {}'.format(numbers, numbers_sorted)) odd = [1, 3, 5] even = [2, 4] luggage = odd + even print(luggage) luggage = [1, 3, 5] even = [2, 4] luggage.extend(even) print(luggage) odd = [1, 3, 5] even = [2, 4] luggage = odd + even print('Unsorted list: {}'.format(luggage)) print('Using the sorted() function: {}'.format(sorted(luggage))) luggage.sort() print('Using the .sort() method: {}'.format(luggage)) lines = [] lines.append("They told me to comb the desert, so I'm combing the desert") lines.append('YOGURT! I hate Yogurt! Even with strawberries!') lines.append("We'll meet again in Spaceballs 2 : The Quest for More Money.") print(lines) luggage = [1, 2, 3, 4, 5] print(luggage.index(2)) quote = list('YOGURT! I hate Yogurt! Even with strawberries!') print(quote.count('r')) luggage = [1, 2, 4, 5] luggage.insert(2, 3) print(luggage) luggage = [1, 2, 3, 3, 4, 5, 6] luggage.pop() print(luggage) luggage.pop(2) print(luggage) rng = list(range(0, 10)) rng.remove(7) print(rng) countdown = [5, 4, 3, 2, 1] countdown.reverse() print(countdown) sample = list(range(1, 13)) times_12 = [i * 12 for i in sample] print(times_12) luggage.clear() print(luggage) luggage = [2, 2, 3, 4, 5] luggage[0] = 1 print(luggage)
class MagicDice: def __init__(self, account, active_key): self.account = account self.active_key = active_key
class Magicdice: def __init__(self, account, active_key): self.account = account self.active_key = active_key
def countWord(word): count = 0 with open('test.txt') as file: for line in file: if word in line: count += line.count(word) return count word = input('Enter word: ') count = countWord(word) print(word, '- occurence: ', count)
def count_word(word): count = 0 with open('test.txt') as file: for line in file: if word in line: count += line.count(word) return count word = input('Enter word: ') count = count_word(word) print(word, '- occurence: ', count)
header = """/* Icebreaker and IceSugar RSMB5 project - RV32I for Lattice iCE40 With complete open-source toolchain flow using: -> yosys -> icarus verilog -> icestorm project Tests are written in several languages -> Systemverilog Pure Testbench (Vivado) -> UVM testbench (Vivado) -> PyUvm (Icarus) -> Formal either using SVA and PSL (Vivado) or cuncurrent assertions with Yosys Copyright (c) 2021 Raffaele Signoriello (raff.signoriello92@gmail.com) Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ /* This file contains register parameters and is autogenerated */ """ sv_inclusion = """ `ifndef COCOTB_SIM // Main Inclusion `else // Main Inclusion `endif """ module_name_param = """ // Main Module module gen_rif #( // Parameter Declaration parameter REG_WIDTH = 32, parameter ERROUT_IF_NOT_ACCESS = 1 )""" standard_rif_input_ports = """ ( // Port Declaration // General RIF input port input logic rif_clk, // Clock input logic rif_arst, // Asynchronous reset active high input logic rif_write, // If 0 -> Read if 1 -> Write input logic rif_cs, // States if the slave has been properly selected input logic [REG_WIDTH-1:0] rif_addr, // Address coming into the bus input logic [REG_WIDTH-1:0] rif_wdata, // Write Data coming into the bus""" hw_write_template_port = """ input logic [REG_WIDTH-1:0] $input_port_hw_rw_access_name,""" hw_read_template_port = """ output logic [REG_WIDTH-1:0] $output_port_hw_rw_access_name,""" standard_rif_output_ports = """ // General RIF output ports output logic [REG_WIDTH-1:0] rif_rdata, // Read Data coming out the bus output logic rif_error, // Give error in few specific conditions only output logic rif_ready // Is controlled by the slave and claims if the specifc slave is busy or not );""" set_of_decoder_flags = """ logic $dec_val;""" set_register = """ logic [REG_WIDTH-1:0] $reg_rw;""" internal_additional_signals = """ // Register Access Process logic error_handler, error_access; logic wr_rq, rd_rq; // Register decoder we are addressing 1Word at time so remove the first 2 bits logic [REG_WIDTH-1:0] reg_dec, reg_dec_dly;""" internal_decoder_signals_generation = """ assign reg_dec = rif_addr >> 2; always_ff@(posedge rif_clk or posedge rif_arst) begin if(rif_arst) reg_dec_dly <= 'h0; else reg_dec_dly <= reg_dec; end""" internal_wr_rd_request = """ // Assign the WR_REQUEST and RD_REQUEST assign wr_rq = rif_write & rif_cs; assign rd_rq = ~rif_write & rif_cs; // Register the request to be used for the READY signal logic [1:0] regsistered_request; always_ff @(posedge rif_clk or posedge rif_arst) begin : request_reg if(rif_arst) begin regsistered_request <= 2'b11; end else begin // Regardless of the read of write request we have to register the CS regsistered_request[0] <= (~rif_cs); regsistered_request[1] <= regsistered_request[0]; end end """ initialize_decoder_state = """ // Address decoding with full combo logic always_comb begin: addres_decoding // Initialize error_access = 1'b0;""" init_dec_access = """ $dec_val = 1'b0;""" case_switch_over_address = """ // Select using the address case (rif_addr)""" selection = """ $define_name: begin $dec_val = 1'b1; end""" defualt_end_case = """ default: begin if(ERROUT_IF_NOT_ACCESS) error_access = 1'b1; else error_access = 1'b0; end endcase // Endcase end // addres_decoding """ initialize_write_decoder_std = """ // Register write access always_ff @(posedge rif_clk or posedge rif_arst) begin : proc_reg_write_access if(rif_arst) begin rif_rdata <= 'h0;""" initialize_write_decoder_init_start = """ $reg_name <= $reset_val; """ initialize_write_decoder_init_end = """ end else begin: reg_write_decoder""" register_write_decoder_start = """ // Logic for HW = R and SW = RW if($dec_val) begin if(wr_rq) begin $reg_name <= rif_wdata & $sw_write_mask; end end""" register_write_decoder_end = """ end // proc_reg_write_access """ errorr_handler_logic_start = """ // check the error using COMBO logic to fire an error if RD happens on a RO register always_comb begin: read_process_error_handle""" errorr_handler_logic = """ // Logic for HW = W and SW = RO if($dec_val) begin if(wr_rq) begin error_handler = 1'b1; end else if(rd_rq) begin rif_rdata = $read_reg & $sw_read_mask; error_handler = 1'b0; end end""" errorr_handler_logic_end = """ end // read_process_error_handle """ errorr_handler_write_logic_start = """ // check the error using COMBO logic to fire an error if RD happens on a WO register always_comb begin: write_process_error_handle""" errorr_handler_write_logic = """ // Logic for HW = R and SW = WO if($dec_val) begin if(rd_rq) begin error_handler = 1'b1; rif_rdata = 'h0' end else begin error_handler = 1'b0; end end""" errorr_handler_write_logic_end = """ end // write_process_error_handle """ internal_latest_assignement = """ // assign the Error output assign rif_error = rif_cs ? (error_handler | error_access) : 'h0; // Assign the ready signal assign rif_ready = &(regsistered_request); """ assign_for_hw_read_policy_reg = """ assign $out_port = rif_cs ? ($reg_name & $hw_read_mask) : 'h0;""" assign_for_hw_write_policy_reg = """ assign $reg_name = $in_port & $hw_write_mask;""" end_module_rif = """ endmodule : gen_rif"""
header = '/*\n Icebreaker and IceSugar RSMB5 project - RV32I for Lattice iCE40\n With complete open-source toolchain flow using:\n -> yosys \n -> icarus verilog\n -> icestorm project\n\n Tests are written in several languages\n -> Systemverilog Pure Testbench (Vivado)\n -> UVM testbench (Vivado)\n -> PyUvm (Icarus)\n -> Formal either using SVA and PSL (Vivado) or cuncurrent assertions with Yosys\n\n Copyright (c) 2021 Raffaele Signoriello (raff.signoriello92@gmail.com)\n\n Permission is hereby granted, free of charge, to any person obtaining a \n copy of this software and associated documentation files (the "Software"), \n to deal in the Software without restriction, including without limitation \n the rights to use, copy, modify, merge, publish, distribute, sublicense, \n and/or sell copies of the Software, and to permit persons to whom the \n Software is furnished to do so, subject to the following conditions:\n\n The above copyright notice and this permission notice shall be included \n in all copies or substantial portions of the Software.\n\n THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, \n EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF \n MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. \n IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY \n CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, \n TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE \n SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\n*/\n\n/* \n This file contains register parameters and is autogenerated\n*/\n' sv_inclusion = '\n`ifndef COCOTB_SIM\n// Main Inclusion\n`else\n// Main Inclusion\n`endif\n' module_name_param = '\n// Main Module\nmodule gen_rif #(\n\t// Parameter Declaration\n\tparameter REG_WIDTH \t\t\t = 32,\n\tparameter ERROUT_IF_NOT_ACCESS\t= 1\n )' standard_rif_input_ports = '\n (\n\t// Port Declaration\n\t// General RIF input port\n\tinput logic \t\t\t\t\t rif_clk, \t\t\t\t// Clock\n\tinput logic \t\t\t\t\t rif_arst, \t\t\t\t// Asynchronous reset active high\n\tinput logic \t\t\t\t\t rif_write, \t\t\t\t// If 0 -> Read if 1 -> Write\n\tinput logic \t\t\t\t\t rif_cs, \t\t\t\t// States if the slave has been properly selected \n input logic [REG_WIDTH-1:0] \trif_addr, \t\t\t\t\t// Address coming into the bus\n\tinput logic [REG_WIDTH-1:0] \trif_wdata, \t\t\t\t// Write Data coming into the bus' hw_write_template_port = '\n input logic [REG_WIDTH-1:0] \t$input_port_hw_rw_access_name,' hw_read_template_port = '\n output logic [REG_WIDTH-1:0] $output_port_hw_rw_access_name,' standard_rif_output_ports = '\n\t// General RIF output ports\n\toutput logic [REG_WIDTH-1:0]\trif_rdata, \t\t\t\t// Read Data coming out the bus\n\toutput logic \t\t\t\t \t rif_error, \t\t\t\t// Give error in few specific conditions only \n\toutput logic \t\t\t\t\t rif_ready \t\t\t\t// Is controlled by the slave and claims if the specifc slave is busy or not\n);' set_of_decoder_flags = '\n logic $dec_val;' set_register = '\n logic [REG_WIDTH-1:0] $reg_rw;' internal_additional_signals = '\n // Register Access Process\n logic error_handler, error_access;\n logic wr_rq, rd_rq;\n\n // Register decoder we are addressing 1Word at time so remove the first 2 bits\n logic [REG_WIDTH-1:0] reg_dec, reg_dec_dly;' internal_decoder_signals_generation = "\n assign reg_dec = rif_addr >> 2;\n always_ff@(posedge rif_clk or posedge rif_arst) begin\n if(rif_arst) reg_dec_dly <= 'h0;\n else \t reg_dec_dly <= reg_dec;\n end" internal_wr_rd_request = "\n\n \t// Assign the WR_REQUEST and RD_REQUEST\n \tassign wr_rq = rif_write & rif_cs;\n \tassign rd_rq = ~rif_write & rif_cs;\n\n \t// Register the request to be used for the READY signal\n \tlogic [1:0] regsistered_request;\n \talways_ff @(posedge rif_clk or posedge rif_arst) begin : request_reg\n \t\tif(rif_arst) begin\n \t\t\tregsistered_request <= 2'b11;\n \t\tend else begin\n \t\t\t// Regardless of the read of write request we have to register the CS\n \t\t\tregsistered_request[0] <= (~rif_cs);\n \t\t\tregsistered_request[1] <= regsistered_request[0];\n \t\tend\n \tend\n" initialize_decoder_state = "\n \t// Address decoding with full combo logic\n \talways_comb begin: addres_decoding\n \t\t// Initialize\n \terror_access = 1'b0;" init_dec_access = "\n\t\t $dec_val \t = 1'b0;" case_switch_over_address = '\n \t// Select using the address\n \tcase (rif_addr)' selection = "\n \t\t$define_name: \t\t\tbegin $dec_val = 1'b1; end" defualt_end_case = "\n \t\tdefault: begin \n \t\t\tif(ERROUT_IF_NOT_ACCESS)\terror_access = 1'b1;\n \t\t\telse \t\t\t\t\t\t\t\t\t\t \terror_access = 1'b0;\n \t\tend\n \tendcase // Endcase\n \tend // addres_decoding\n" initialize_write_decoder_std = "\n // Register write access\n always_ff @(posedge rif_clk or posedge rif_arst) begin : proc_reg_write_access\n if(rif_arst) begin\n rif_rdata\t\t\t<= 'h0;" initialize_write_decoder_init_start = '\n $reg_name \t\t\t<= $reset_val; ' initialize_write_decoder_init_end = '\n end \n else begin: reg_write_decoder' register_write_decoder_start = '\n \t// Logic for HW = R and SW = RW\n \tif($dec_val) begin\n if(wr_rq) begin\n \t$reg_name \t\t\t<= rif_wdata & $sw_write_mask;\n end\n end' register_write_decoder_end = '\n end // proc_reg_write_access\n' errorr_handler_logic_start = '\n // check the error using COMBO logic to fire an error if RD happens on a RO register\n always_comb begin: read_process_error_handle' errorr_handler_logic = "\n // Logic for HW = W and SW = RO\n if($dec_val) begin\n if(wr_rq) begin\n error_handler = 1'b1;\n end\n else if(rd_rq) begin\n rif_rdata = $read_reg & $sw_read_mask;\n error_handler = 1'b0;\n end \n end" errorr_handler_logic_end = '\n end // read_process_error_handle\n' errorr_handler_write_logic_start = '\n // check the error using COMBO logic to fire an error if RD happens on a WO register\n always_comb begin: write_process_error_handle' errorr_handler_write_logic = "\n // Logic for HW = R and SW = WO\n if($dec_val) begin\n if(rd_rq) begin\n error_handler = 1'b1;\n rif_rdata = 'h0'\n end\n else begin\n error_handler = 1'b0;\n end \n end" errorr_handler_write_logic_end = '\n end // write_process_error_handle\n' internal_latest_assignement = "\n // assign the Error output\n assign rif_error = rif_cs ? (error_handler | error_access) : 'h0;\n\n // Assign the ready signal\n assign rif_ready = &(regsistered_request);\n" assign_for_hw_read_policy_reg = "\n assign $out_port = rif_cs ? ($reg_name & $hw_read_mask) : 'h0;" assign_for_hw_write_policy_reg = '\n assign $reg_name \t= $in_port & $hw_write_mask;' end_module_rif = '\nendmodule : gen_rif'
num = int(input()) x = 0 if num == 0: print(1) exit() while num != 0: x +=1 num = num//10 print(x)
num = int(input()) x = 0 if num == 0: print(1) exit() while num != 0: x += 1 num = num // 10 print(x)
class SpecValidator: def __init__(self, type=None, default=None, choices=[], min=None, max=None): self.type = type self.default = default self.choices = choices self.min = min self.max = max
class Specvalidator: def __init__(self, type=None, default=None, choices=[], min=None, max=None): self.type = type self.default = default self.choices = choices self.min = min self.max = max
"""FactoryAggregate provider prototype.""" class FactoryAggregate: """FactoryAggregate provider prototype.""" def __init__(self, **factories): """Initialize instance.""" self.factories = factories def __call__(self, factory_name, *args, **kwargs): """Create object.""" return self.factories[factory_name](*args, **kwargs) def __getattr__(self, factory_name): """Return factory with specified name.""" return self.factories[factory_name]
"""FactoryAggregate provider prototype.""" class Factoryaggregate: """FactoryAggregate provider prototype.""" def __init__(self, **factories): """Initialize instance.""" self.factories = factories def __call__(self, factory_name, *args, **kwargs): """Create object.""" return self.factories[factory_name](*args, **kwargs) def __getattr__(self, factory_name): """Return factory with specified name.""" return self.factories[factory_name]
def f(x): #return 1*x**3 + 5*x**2 - 2*x - 24 #return 1*x**4 - 4*x**3 - 2*x**2 + 12*x - 3 return 82*x + 6*x**2 - 0.67*x**3 print(f(2)-f(1)) #print((f(3.5) - f(0.5)) / -3) #print(f(0.5))
def f(x): return 82 * x + 6 * x ** 2 - 0.67 * x ** 3 print(f(2) - f(1))
# Weird Algorithm # Consider an algorithm that takes as input a positive integer n. If n is even, the algorithm divides it by two, and if n is odd, the algorithm multiplies it by three and adds one. The algorithm repeats this, until n is one. n = int(input()) print(n, end=" ") while n != 1: if n % 2 == 0: n = n // 2 else: n = (n * 3) + 1 print(n, end=" ")
n = int(input()) print(n, end=' ') while n != 1: if n % 2 == 0: n = n // 2 else: n = n * 3 + 1 print(n, end=' ')
T = int(input()) if T > 100: print('Steam') elif T < 0: print('Ice') else: print('Water')
t = int(input()) if T > 100: print('Steam') elif T < 0: print('Ice') else: print('Water')
PSQL_CONNECTION_PARAMS = { 'dbname': 'ifcb', 'user': '******', 'password': '******', 'host': '/var/run/postgresql/' } DATA_DIR = '/mnt/ifcb'
psql_connection_params = {'dbname': 'ifcb', 'user': '******', 'password': '******', 'host': '/var/run/postgresql/'} data_dir = '/mnt/ifcb'
#!/usr/bin/env python2 # -*- coding: utf-8 -*- """ tunacell package ============ plotting/defs.py module ~~~~~~~~~~~~~~~~~~~~~~~~~~~ """ DEFAULT_COLORS = ('red', 'blue', 'purple', 'green', 'yellowgreen', 'cyan', 'magenta', 'indigo', 'darkorange', 'pink', 'yellow') colors = DEFAULT_COLORS # plotting parameters params = {'length': { 'bottom': 1., 'top': 8., 'delta': 2., 'unit': '$\mu$m' }, 'dot_length': { 'bottom': 1e-2, 'top': 1e-1, 'delta': 3e-2, 'unit': '$\mu$m/hr' }, 'dotlog_length': { 'bottom': 0.5, 'top': 2.5, 'delta': 0.5, 'unit': 'dbs/hr' }, 'width': { 'bottom': .5, 'top': 1.5, 'delta': .2, 'unit': '$\mu$m' }, 'fluo': { 'bottom': 1e5, 'top': 2e6, 'delta': 5e5, 'unit': 'A.U.' }, 'dot_fluo': { 'bottom': 1e2, 'top': 5e4, 'delta': 1e4, 'unit': 'A.U./hr' }, 'dotlog_fluo': { 'bottom': 0.1, 'top': 3, 'delta': 0.5, 'unit': 'dbs/hr' }, 'concentration': { 'bottom': 2e5, 'top': 5e5, 'delta': 1e5, }, 'volume': { 'bottom': 0., 'top': 4., 'delta': 1., 'unit': '$\mu$m$^3$' }, 'area': { 'bottom': 1., 'top': 8., 'delta': 2., 'unit': '$\mu$m$^2$' }, 'dotlog_area': { 'bottom': 0.5, 'top': 2.5, 'delta': 0.5, 'unit': 'dbs/hr' }, 'density': { 'bottom': 1e5, 'top': 4e5, 'delta': 1e5 }, 'ALratio': { 'bottom': .1, 'top': 1.5, 'delta': .4, 'unit': '$\mu$m' }, 'age': { 'bottom': 0., 'top': 1. } } def get_params(obs, params, *keys): return [params[obs][k] for k in keys]
""" tunacell package ============ plotting/defs.py module ~~~~~~~~~~~~~~~~~~~~~~~~~~~ """ default_colors = ('red', 'blue', 'purple', 'green', 'yellowgreen', 'cyan', 'magenta', 'indigo', 'darkorange', 'pink', 'yellow') colors = DEFAULT_COLORS params = {'length': {'bottom': 1.0, 'top': 8.0, 'delta': 2.0, 'unit': '$\\mu$m'}, 'dot_length': {'bottom': 0.01, 'top': 0.1, 'delta': 0.03, 'unit': '$\\mu$m/hr'}, 'dotlog_length': {'bottom': 0.5, 'top': 2.5, 'delta': 0.5, 'unit': 'dbs/hr'}, 'width': {'bottom': 0.5, 'top': 1.5, 'delta': 0.2, 'unit': '$\\mu$m'}, 'fluo': {'bottom': 100000.0, 'top': 2000000.0, 'delta': 500000.0, 'unit': 'A.U.'}, 'dot_fluo': {'bottom': 100.0, 'top': 50000.0, 'delta': 10000.0, 'unit': 'A.U./hr'}, 'dotlog_fluo': {'bottom': 0.1, 'top': 3, 'delta': 0.5, 'unit': 'dbs/hr'}, 'concentration': {'bottom': 200000.0, 'top': 500000.0, 'delta': 100000.0}, 'volume': {'bottom': 0.0, 'top': 4.0, 'delta': 1.0, 'unit': '$\\mu$m$^3$'}, 'area': {'bottom': 1.0, 'top': 8.0, 'delta': 2.0, 'unit': '$\\mu$m$^2$'}, 'dotlog_area': {'bottom': 0.5, 'top': 2.5, 'delta': 0.5, 'unit': 'dbs/hr'}, 'density': {'bottom': 100000.0, 'top': 400000.0, 'delta': 100000.0}, 'ALratio': {'bottom': 0.1, 'top': 1.5, 'delta': 0.4, 'unit': '$\\mu$m'}, 'age': {'bottom': 0.0, 'top': 1.0}} def get_params(obs, params, *keys): return [params[obs][k] for k in keys]
class KeyBoardService(): def __init__(self): pass def is_key_pressed(self, *keys): pass def is_key_released(self, *key): pass
class Keyboardservice: def __init__(self): pass def is_key_pressed(self, *keys): pass def is_key_released(self, *key): pass
#!/usr/bin/env python3 """Switcharoo. Create a function that takes a string and returns a new string with its first and last characters swapped, except under three conditions: If the length of the string is less than two, return "Incompatible.". If the argument is not a string, return "Incompatible.". If the first and last characters are the same, return "Two's a pair.". Source: https://edabit.com/challenge/tnKZCAkdnZpiuDiWA """ def flip_end_chars(txt): """Flip the first and last characters if txt is a string.""" if isinstance(txt, str) and txt and len(txt) > 1: first, last = txt[0], txt[-1] if first == last: return "Two's a pair." return "{}{}{}".format(last, txt[1:-1], first) return "Incompatible." def main(): assert flip_end_chars("Cat, dog, and mouse.") == ".at, dog, and mouseC" assert flip_end_chars("Anna, Banana") == "anna, BananA" assert flip_end_chars("[]") == "][" assert flip_end_chars("") == "Incompatible." assert flip_end_chars([1, 2, 3]) == "Incompatible." assert flip_end_chars("dfdkf49824fdfdfjhd") == "Two's a pair." assert flip_end_chars("#343473847#") == "Two's a pair." print('Passed.') if __name__ == "__main__": main()
"""Switcharoo. Create a function that takes a string and returns a new string with its first and last characters swapped, except under three conditions: If the length of the string is less than two, return "Incompatible.". If the argument is not a string, return "Incompatible.". If the first and last characters are the same, return "Two's a pair.". Source: https://edabit.com/challenge/tnKZCAkdnZpiuDiWA """ def flip_end_chars(txt): """Flip the first and last characters if txt is a string.""" if isinstance(txt, str) and txt and (len(txt) > 1): (first, last) = (txt[0], txt[-1]) if first == last: return "Two's a pair." return '{}{}{}'.format(last, txt[1:-1], first) return 'Incompatible.' def main(): assert flip_end_chars('Cat, dog, and mouse.') == '.at, dog, and mouseC' assert flip_end_chars('Anna, Banana') == 'anna, BananA' assert flip_end_chars('[]') == '][' assert flip_end_chars('') == 'Incompatible.' assert flip_end_chars([1, 2, 3]) == 'Incompatible.' assert flip_end_chars('dfdkf49824fdfdfjhd') == "Two's a pair." assert flip_end_chars('#343473847#') == "Two's a pair." print('Passed.') if __name__ == '__main__': main()
"""1/1 adventofcode""" with open("input.txt", "r", encoding="UTF-8") as i_file: data = list(map(int, i_file.read().splitlines())) values = ["i" if data[i] > data[i - 1] else "d" for i in range(1, len(data))] print(values.count("i"))
"""1/1 adventofcode""" with open('input.txt', 'r', encoding='UTF-8') as i_file: data = list(map(int, i_file.read().splitlines())) values = ['i' if data[i] > data[i - 1] else 'd' for i in range(1, len(data))] print(values.count('i'))
def past(h, m, s): h_ms = h * 3600000 m_ms = m * 60000 s_ms = s * 1000 return h_ms + m_ms + s_ms # Best Practices def past(h, m, s): return (3600*h + 60*m + s) * 1000
def past(h, m, s): h_ms = h * 3600000 m_ms = m * 60000 s_ms = s * 1000 return h_ms + m_ms + s_ms def past(h, m, s): return (3600 * h + 60 * m + s) * 1000
# Iteration: Repeat the same procedure until it reaches a end point. # Specify the data to iterate over,what to do to data at every step, and we need to specify when our loop should stop. # Infinite Loop: Bug that may occur when ending condition speicified incorrectly or not specified. spices = [ 'salt', 'pepper', 'cumin', 'turmeric' ] for spice in spices: # in is a python keyword that indicates that what follows is the set of values that we want to iterate over print(spice) print("No more boring omelettes!")
spices = ['salt', 'pepper', 'cumin', 'turmeric'] for spice in spices: print(spice) print('No more boring omelettes!')
# coding: utf-8 print(__import__('task_list_dev').tools.get_list())
print(__import__('task_list_dev').tools.get_list())
#Warmup-1 > not_string def not_string(str): if str.startswith('not'): return str else: return "not " + str
def not_string(str): if str.startswith('not'): return str else: return 'not ' + str
''' Docstring with single quotes instead of double quotes. ''' my_str = "not an int"
""" Docstring with single quotes instead of double quotes. """ my_str = 'not an int'
def selection_sort(input_list): for i in range(len(input_list)): min_index = i for k in range(i, len(input_list)): if input_list[k] < input_list[min_index]: min_index = k input_list[i], input_list[min_index] = input_list[min_index], input_list[i] return input_list
def selection_sort(input_list): for i in range(len(input_list)): min_index = i for k in range(i, len(input_list)): if input_list[k] < input_list[min_index]: min_index = k (input_list[i], input_list[min_index]) = (input_list[min_index], input_list[i]) return input_list
username = 'user@example.com' password = 'hunter2' # larger = less change of delays if you skip a lot # smaller = more responsive to ups/downs queue_size = 2
username = 'user@example.com' password = 'hunter2' queue_size = 2
machine_number = 43 user_number = int( raw_input("enter a number: ") ) print( type(user_number) ) if user_number == machine_number: print("Bravo!!!")
machine_number = 43 user_number = int(raw_input('enter a number: ')) print(type(user_number)) if user_number == machine_number: print('Bravo!!!')
def pedir_entero (mensaje,min,max): numero = input(mensaje.format(min,max)) if type(numero)==int: while numero <= min or numero>=max: numero = input("el numero debe estar entre {:d} y {:d} ".format(min,max)) return numero else: return "debes introducir un entero" valido = pedir_entero("Cual es tu numero favorito entre {:d} y {:d}? ",-25,25) if type(valido)==int: print("Has introducido un numero valido: {:d}".format(valido)) else : print(valido)
def pedir_entero(mensaje, min, max): numero = input(mensaje.format(min, max)) if type(numero) == int: while numero <= min or numero >= max: numero = input('el numero debe estar entre {:d} y {:d} '.format(min, max)) return numero else: return 'debes introducir un entero' valido = pedir_entero('Cual es tu numero favorito entre {:d} y {:d}? ', -25, 25) if type(valido) == int: print('Has introducido un numero valido: {:d}'.format(valido)) else: print(valido)
test_cases = int(input().strip()) def sum_sub_nums(idx, value): global result if value == K: result += 1 return if value > K or idx >= N: return sum_sub_nums(idx + 1, value) sum_sub_nums(idx + 1, value + nums[idx]) for t in range(1, test_cases + 1): N, K = map(int, input().strip().split()) nums = list(map(int, input().strip().split())) result = 0 sum_sub_nums(0, 0) print('#{} {}'.format(t, result))
test_cases = int(input().strip()) def sum_sub_nums(idx, value): global result if value == K: result += 1 return if value > K or idx >= N: return sum_sub_nums(idx + 1, value) sum_sub_nums(idx + 1, value + nums[idx]) for t in range(1, test_cases + 1): (n, k) = map(int, input().strip().split()) nums = list(map(int, input().strip().split())) result = 0 sum_sub_nums(0, 0) print('#{} {}'.format(t, result))
class VposConfigurationError(Exception): pass
class Vposconfigurationerror(Exception): pass
{ 'includes': ['common.gypi'], 'conditions': [ ['OS == "win"', { 'variables': { 'application_platform%': 'Win32', 'renderers%': ['Direct3D11', 'GL4'], 'audio%': 'XAudio2', 'input_devices%': ['DirectInput'], }, }], ['OS == "mac"', { 'variables': { 'application_platform%': 'Cocoa', 'renderers%': ['GL4'], 'audio%': 'OpenAL', 'input_devices%': [], }, }], ['OS == "ios"', { 'variables': { 'application_platform%': 'CocoaTouch', 'renderers%': ['Metal'], 'audio%': 'OpenAL', 'input_devices%': [], }, }], ['OS == "linux" or OS == "freebsd" or OS == "openbsd"', { 'variables': { 'application_platform%': 'X11', 'renderers%': ['GL4'], 'audio%': 'OpenAL', 'input_devices%': [], }, }], ], 'variables': { 'pomdog_third_party_dir%': '../third-party', 'pomdog_library_core_sources': [ '../include/Pomdog/Application/Duration.hpp', '../include/Pomdog/Application/Game.hpp', '../include/Pomdog/Application/GameClock.hpp', '../include/Pomdog/Application/GameHost.hpp', '../include/Pomdog/Application/GameWindow.hpp', '../include/Pomdog/Application/MouseCursor.hpp', '../include/Pomdog/Application/Timer.hpp', '../include/Pomdog/Application/TimePoint.hpp', # '../include/Pomdog/Async/Helpers.hpp', # '../include/Pomdog/Async/ImmediateScheduler.hpp', # '../include/Pomdog/Async/QueuedScheduler.hpp', # '../include/Pomdog/Async/Scheduler.hpp', # '../include/Pomdog/Async/Task.hpp', '../include/Pomdog/Audio/AudioClip.hpp', '../include/Pomdog/Audio/AudioChannels.hpp', '../include/Pomdog/Audio/AudioEmitter.hpp', '../include/Pomdog/Audio/AudioEngine.hpp', '../include/Pomdog/Audio/AudioListener.hpp', '../include/Pomdog/Audio/SoundEffect.hpp', '../include/Pomdog/Audio/SoundState.hpp', '../include/Pomdog/Audio/detail/ForwardDeclarations.hpp', '../include/Pomdog/Basic/Export.hpp', '../include/Pomdog/Basic/Platform.hpp', '../include/Pomdog/Basic/Version.hpp', '../include/Pomdog/Content/AssetManager.hpp', '../include/Pomdog/Content/AssetBuilders/Builder.hpp', '../include/Pomdog/Content/AssetBuilders/PipelineStateBuilder.hpp', '../include/Pomdog/Content/AssetBuilders/ShaderBuilder.hpp', '../include/Pomdog/Content/Utility/BinaryFileStream.hpp', '../include/Pomdog/Content/Utility/BinaryReader.hpp', '../include/Pomdog/Content/Utility/MakeFourCC.hpp', '../include/Pomdog/Content/Utility/PathHelper.hpp', '../include/Pomdog/Content/detail/AssetDictionary.hpp', '../include/Pomdog/Content/detail/AssetLoaderContext.hpp', '../include/Pomdog/Content/detail/AssetLoader.hpp', '../include/Pomdog/Content/detail/AssetLoaders/AudioClipLoader.hpp', '../include/Pomdog/Content/detail/AssetLoaders/Texture2DLoader.hpp', '../include/Pomdog/Graphics/Blend.hpp', '../include/Pomdog/Graphics/BlendDescription.hpp', '../include/Pomdog/Graphics/BlendFunction.hpp', '../include/Pomdog/Graphics/BufferUsage.hpp', '../include/Pomdog/Graphics/ClearOptions.hpp', '../include/Pomdog/Graphics/ComparisonFunction.hpp', '../include/Pomdog/Graphics/ConstantBuffer.hpp', '../include/Pomdog/Graphics/CullMode.hpp', '../include/Pomdog/Graphics/DepthFormat.hpp', '../include/Pomdog/Graphics/DepthStencilDescription.hpp', '../include/Pomdog/Graphics/DepthStencilOperation.hpp', '../include/Pomdog/Graphics/EffectAnnotation.hpp', '../include/Pomdog/Graphics/EffectConstantDescription.hpp', '../include/Pomdog/Graphics/EffectReflection.hpp', '../include/Pomdog/Graphics/EffectVariableClass.hpp', '../include/Pomdog/Graphics/EffectVariableType.hpp', '../include/Pomdog/Graphics/EffectVariable.hpp', '../include/Pomdog/Graphics/FillMode.hpp', '../include/Pomdog/Graphics/GraphicsCommandList.hpp', '../include/Pomdog/Graphics/GraphicsCommandQueue.hpp', '../include/Pomdog/Graphics/GraphicsDevice.hpp', '../include/Pomdog/Graphics/IndexBuffer.hpp', '../include/Pomdog/Graphics/IndexElementSize.hpp', '../include/Pomdog/Graphics/InputClassification.hpp', '../include/Pomdog/Graphics/InputElement.hpp', '../include/Pomdog/Graphics/InputElementFormat.hpp', '../include/Pomdog/Graphics/InputLayoutDescription.hpp', '../include/Pomdog/Graphics/InputLayoutHelper.hpp', '../include/Pomdog/Graphics/PipelineState.hpp', '../include/Pomdog/Graphics/PipelineStateDescription.hpp', '../include/Pomdog/Graphics/PresentationParameters.hpp', '../include/Pomdog/Graphics/PrimitiveTopology.hpp', '../include/Pomdog/Graphics/RasterizerDescription.hpp', '../include/Pomdog/Graphics/RenderTarget2D.hpp', '../include/Pomdog/Graphics/RenderTargetBlendDescription.hpp', '../include/Pomdog/Graphics/SamplerDescription.hpp', '../include/Pomdog/Graphics/SamplerState.hpp', '../include/Pomdog/Graphics/Shader.hpp', '../include/Pomdog/Graphics/ShaderLanguage.hpp', '../include/Pomdog/Graphics/ShaderPipelineStage.hpp', '../include/Pomdog/Graphics/SurfaceFormat.hpp', '../include/Pomdog/Graphics/StencilOperation.hpp', '../include/Pomdog/Graphics/Texture.hpp', '../include/Pomdog/Graphics/Texture2D.hpp', '../include/Pomdog/Graphics/TextureAddressMode.hpp', '../include/Pomdog/Graphics/TextureFilter.hpp', '../include/Pomdog/Graphics/VertexBuffer.hpp', '../include/Pomdog/Graphics/VertexBufferBinding.hpp', '../include/Pomdog/Graphics/Viewport.hpp', '../include/Pomdog/Graphics/detail/ForwardDeclarations.hpp', '../include/Pomdog/Graphics/detail/EffectBinaryParameter.hpp', '../include/Pomdog/Graphics/ShaderCompilers/GLSLCompiler.hpp', '../include/Pomdog/Graphics/ShaderCompilers/HLSLCompiler.hpp', '../include/Pomdog/Input/ButtonState.hpp', '../include/Pomdog/Input/Gamepad.hpp', '../include/Pomdog/Input/GamepadButtons.hpp', '../include/Pomdog/Input/GamepadCapabilities.hpp', '../include/Pomdog/Input/GamepadDPad.hpp', '../include/Pomdog/Input/GamepadState.hpp', '../include/Pomdog/Input/GamepadThumbSticks.hpp', '../include/Pomdog/Input/GamepadType.hpp', '../include/Pomdog/Input/Keyboard.hpp', '../include/Pomdog/Input/KeyboardState.hpp', '../include/Pomdog/Input/KeyState.hpp', '../include/Pomdog/Input/Keys.hpp', '../include/Pomdog/Input/Mouse.hpp', '../include/Pomdog/Input/MouseState.hpp', '../include/Pomdog/Input/PlayerIndex.hpp', '../include/Pomdog/Input/TouchLocation.hpp', '../include/Pomdog/Input/TouchLocationState.hpp', '../include/Pomdog/Logging/Log.hpp', '../include/Pomdog/Logging/LogChannel.hpp', '../include/Pomdog/Logging/LogEntry.hpp', '../include/Pomdog/Logging/LogLevel.hpp', '../include/Pomdog/Logging/LogStream.hpp', '../include/Pomdog/Math/BoundingBox.hpp', '../include/Pomdog/Math/BoundingBox2D.hpp', '../include/Pomdog/Math/BoundingCircle.hpp', '../include/Pomdog/Math/BoundingSphere.hpp', '../include/Pomdog/Math/Color.hpp', '../include/Pomdog/Math/ContainmentType.hpp', '../include/Pomdog/Math/Degree.hpp', '../include/Pomdog/Math/MathHelper.hpp', '../include/Pomdog/Math/Matrix2x2.hpp', '../include/Pomdog/Math/Matrix3x2.hpp', '../include/Pomdog/Math/Matrix3x3.hpp', '../include/Pomdog/Math/Matrix4x4.hpp', '../include/Pomdog/Math/Point2D.hpp', '../include/Pomdog/Math/Point3D.hpp', '../include/Pomdog/Math/Quaternion.hpp', '../include/Pomdog/Math/Radian.hpp', '../include/Pomdog/Math/Ray.hpp', '../include/Pomdog/Math/Rectangle.hpp', '../include/Pomdog/Math/Vector2.hpp', '../include/Pomdog/Math/Vector3.hpp', '../include/Pomdog/Math/Vector4.hpp', '../include/Pomdog/Math/detail/Coordinate2D.hpp', '../include/Pomdog/Math/detail/Coordinate2DImplementation.hpp', '../include/Pomdog/Math/detail/Coordinate3D.hpp', '../include/Pomdog/Math/detail/Coordinate3DImplementation.hpp', '../include/Pomdog/Math/detail/FloatingPointMatrix2x2.hpp', '../include/Pomdog/Math/detail/FloatingPointMatrix3x2.hpp', '../include/Pomdog/Math/detail/FloatingPointMatrix3x3.hpp', '../include/Pomdog/Math/detail/FloatingPointMatrix4x4.hpp', '../include/Pomdog/Math/detail/FloatingPointQuaternion.hpp', '../include/Pomdog/Math/detail/FloatingPointVector2.hpp', '../include/Pomdog/Math/detail/FloatingPointVector3.hpp', '../include/Pomdog/Math/detail/FloatingPointVector4.hpp', '../include/Pomdog/Math/detail/ForwardDeclarations.hpp', '../include/Pomdog/Math/detail/TaggedArithmetic.hpp', '../include/Pomdog/Signals/Connection.hpp', '../include/Pomdog/Signals/ConnectionList.hpp', '../include/Pomdog/Signals/Event.hpp', '../include/Pomdog/Signals/EventQueue.hpp', '../include/Pomdog/Signals/Helpers.hpp', '../include/Pomdog/Signals/ScopedConnection.hpp', '../include/Pomdog/Signals/Signal.hpp', '../include/Pomdog/Signals/detail/EventBody.hpp', '../include/Pomdog/Signals/detail/ForwardDeclarations.hpp', '../include/Pomdog/Signals/detail/SignalBody.hpp', '../include/Pomdog/Utility/Any.hpp', '../include/Pomdog/Utility/Assert.hpp', '../include/Pomdog/Utility/Exception.hpp', '../include/Pomdog/Utility/Optional.hpp', '../include/Pomdog/Utility/StringHelper.hpp', '../include/Pomdog/Utility/detail/CRC32.hpp', '../include/Pomdog/Utility/detail/FileSystem.hpp', '../include/Pomdog/Utility/detail/Tagged.hpp', '../src/Application/GameClock.cpp', '../src/Application/SubsystemScheduler.hpp', '../src/Application/SystemEvents.hpp', '../src/Application/Timer.cpp', '../src/Application/TimeSource.hpp', # '../src/Async/ImmediateScheduler.cpp', # '../src/Async/QueuedScheduler.cpp', # '../src/Async/Task.cpp', '../src/Audio/AudioClip.cpp', '../src/Audio/AudioEngine.cpp', '../src/Audio/SoundEffect.cpp', '../src/Content/AssetDictionary.cpp', '../src/Content/AssetLoaderContext.cpp', '../src/Content/AssetManager.cpp', '../src/Content/AssetBuilders/PipelineStateBuilder.cpp', '../src/Content/AssetBuilders/ShaderBuilder.cpp', '../src/Content/AssetLoaders/AudioClipLoader.cpp', '../src/Content/AssetLoaders/Texture2DLoader.cpp', '../src/Content/Utility/DDSTextureReader.cpp', '../src/Content/Utility/DDSTextureReader.hpp', '../src/Content/Utility/MSWaveAudioLoader.cpp', '../src/Content/Utility/MSWaveAudioLoader.hpp', '../src/Content/Utility/PNGTextureReader.cpp', '../src/Content/Utility/PNGTextureReader.hpp', '../src/Graphics/ClearOptions.cpp', '../src/Graphics/ConstantBuffer.cpp', '../src/Graphics/EffectBinaryParameter.cpp', '../src/Graphics/EffectReflection.cpp', '../src/Graphics/GraphicsCommandList.cpp', '../src/Graphics/GraphicsCommandQueue.cpp', '../src/Graphics/GraphicsDevice.cpp', '../src/Graphics/IndexBuffer.cpp', '../src/Graphics/InputLayoutHelper.cpp', '../src/Graphics/PipelineState.cpp', '../src/Graphics/RenderTarget2D.cpp', '../src/Graphics/SamplerState.cpp', '../src/Graphics/Texture2D.cpp', '../src/Graphics/Viewport.cpp', '../src/Graphics/VertexBuffer.cpp', '../src/Graphics/ShaderCompilers/GLSLCompiler.cpp', '../src/Graphics/ShaderCompilers/HLSLCompiler.cpp', '../src/Input/KeyboardState.cpp', '../src/InputSystem/InputDeviceCreator.hpp', '../src/InputSystem/InputDeviceFactory.cpp', '../src/InputSystem/InputDeviceFactory.hpp', '../src/Logging/Log.cpp', '../src/Logging/LogChannel.cpp', '../src/Logging/LogStream.cpp', '../src/Math/BoundingBox.cpp', '../src/Math/BoundingBox2D.cpp', '../src/Math/BoundingCircle.cpp', '../src/Math/BoundingSphere.cpp', '../src/Math/Color.cpp', '../src/Math/MathHelper.cpp', '../src/Math/Ray.cpp', '../src/Math/Rectangle.cpp', '../src/Math/detail/FloatingPointMatrix2x2.cpp', '../src/Math/detail/FloatingPointMatrix3x2.cpp', '../src/Math/detail/FloatingPointMatrix3x3.cpp', '../src/Math/detail/FloatingPointMatrix4x4.cpp', '../src/Math/detail/FloatingPointQuaternion.cpp', '../src/Math/detail/FloatingPointVector2.cpp', '../src/Math/detail/FloatingPointVector3.cpp', '../src/Math/detail/FloatingPointVector4.cpp', '../src/RenderSystem/GraphicsCapabilities.hpp', '../src/RenderSystem/GraphicsCommandListImmediate.cpp', '../src/RenderSystem/GraphicsCommandListImmediate.hpp', '../src/RenderSystem/GraphicsCommandQueueImmediate.cpp', '../src/RenderSystem/GraphicsCommandQueueImmediate.hpp', '../src/RenderSystem/GraphicsContext.cpp', '../src/RenderSystem/GraphicsContext.hpp', '../src/RenderSystem/NativeBuffer.hpp', '../src/RenderSystem/NativeEffectReflection.hpp', '../src/RenderSystem/NativeGraphicsCommandList.hpp', '../src/RenderSystem/NativeGraphicsCommandQueue.hpp', '../src/RenderSystem/NativeGraphicsContext.hpp', '../src/RenderSystem/NativeGraphicsDevice.hpp', '../src/RenderSystem/NativePipelineState.hpp', '../src/RenderSystem/NativeRenderTarget2D.hpp', '../src/RenderSystem/NativeSamplerState.hpp', '../src/RenderSystem/NativeTexture2D.hpp', '../src/RenderSystem/ShaderBytecode.hpp', '../src/RenderSystem/ShaderCompileOptions.hpp', '../src/RenderSystem/SurfaceFormatHelper.cpp', '../src/RenderSystem/SurfaceFormatHelper.hpp', '../src/RenderSystem/TextureHelper.cpp', '../src/RenderSystem/TextureHelper.hpp', '../src/Signals/Connection.cpp', '../src/Signals/ConnectionList.cpp', '../src/Signals/EventQueue.cpp', '../src/Signals/ScopedConnection.cpp', '../src/Utility/CRC32.cpp', '../src/Utility/Noncopyable.hpp', '../src/Utility/PathHelper.cpp', '../src/Utility/ScopeGuard.hpp', '../src/Utility/StringHelper.cpp', ], 'pomdog_library_opengl4_sources': [ '../src/RenderSystem.GL4/BlendStateGL4.cpp', '../src/RenderSystem.GL4/BlendStateGL4.hpp', '../src/RenderSystem.GL4/BufferGL4.cpp', '../src/RenderSystem.GL4/BufferGL4.hpp', '../src/RenderSystem.GL4/DepthStencilStateGL4.cpp', '../src/RenderSystem.GL4/DepthStencilStateGL4.hpp', '../src/RenderSystem.GL4/EffectReflectionGL4.cpp', '../src/RenderSystem.GL4/EffectReflectionGL4.hpp', '../src/RenderSystem.GL4/ErrorChecker.cpp', '../src/RenderSystem.GL4/ErrorChecker.hpp', '../src/RenderSystem.GL4/GraphicsContextGL4.cpp', '../src/RenderSystem.GL4/GraphicsContextGL4.hpp', '../src/RenderSystem.GL4/GraphicsDeviceGL4.cpp', '../src/RenderSystem.GL4/GraphicsDeviceGL4.hpp', '../src/RenderSystem.GL4/InputLayoutGL4.cpp', '../src/RenderSystem.GL4/InputLayoutGL4.hpp', '../src/RenderSystem.GL4/OpenGLContext.hpp', '../src/RenderSystem.GL4/OpenGLPrerequisites.hpp', '../src/RenderSystem.GL4/PipelineStateGL4.cpp', '../src/RenderSystem.GL4/PipelineStateGL4.hpp', '../src/RenderSystem.GL4/RasterizerStateGL4.cpp', '../src/RenderSystem.GL4/RasterizerStateGL4.hpp', '../src/RenderSystem.GL4/RenderTarget2DGL4.cpp', '../src/RenderSystem.GL4/RenderTarget2DGL4.hpp', '../src/RenderSystem.GL4/SamplerStateGL4.cpp', '../src/RenderSystem.GL4/SamplerStateGL4.hpp', '../src/RenderSystem.GL4/ShaderGL4.cpp', '../src/RenderSystem.GL4/ShaderGL4.hpp', '../src/RenderSystem.GL4/Texture2DGL4.cpp', '../src/RenderSystem.GL4/Texture2DGL4.hpp', '../src/RenderSystem.GL4/TypesafeGL4.hpp', '../src/RenderSystem.GL4/TypesafeHelperGL4.hpp', ], 'pomdog_library_openal_sources': [ '../src/SoundSystem.OpenAL/AudioClipAL.cpp', '../src/SoundSystem.OpenAL/AudioClipAL.hpp', '../src/SoundSystem.OpenAL/AudioEngineAL.cpp', '../src/SoundSystem.OpenAL/AudioEngineAL.hpp', '../src/SoundSystem.OpenAL/ContextOpenAL.cpp', '../src/SoundSystem.OpenAL/ContextOpenAL.hpp', '../src/SoundSystem.OpenAL/ErrorCheckerAL.cpp', '../src/SoundSystem.OpenAL/ErrorCheckerAL.hpp', '../src/SoundSystem.OpenAL/PrerequisitesOpenAL.hpp', '../src/SoundSystem.OpenAL/SoundEffectAL.cpp', '../src/SoundSystem.OpenAL/SoundEffectAL.hpp', ], 'pomdog_library_apple_sources': [ '../src/Platform.Apple/FileSystemApple.mm', '../src/Platform.Apple/TimeSourceApple.cpp', '../src/Platform.Apple/TimeSourceApple.hpp', ], 'pomdog_library_cocoa_sources': [ '../include/Pomdog/Platform/Cocoa/Bootstrap.hpp', '../include/Pomdog/Platform/Cocoa/PomdogOpenGLView.hpp', '../src/Platform.Cocoa/Bootstrap.mm', '../src/Platform.Cocoa/CocoaWindowDelegate.hpp', '../src/Platform.Cocoa/CocoaWindowDelegate.mm', '../src/Platform.Cocoa/GameHostCocoa.hpp', '../src/Platform.Cocoa/GameHostCocoa.mm', '../src/Platform.Cocoa/GameWindowCocoa.hpp', '../src/Platform.Cocoa/GameWindowCocoa.mm', '../src/Platform.Cocoa/KeyboardCocoa.hpp', '../src/Platform.Cocoa/KeyboardCocoa.cpp', '../src/Platform.Cocoa/MouseCocoa.hpp', '../src/Platform.Cocoa/MouseCocoa.cpp', '../src/Platform.Cocoa/OpenGLContextCocoa.hpp', '../src/Platform.Cocoa/OpenGLContextCocoa.mm', '../src/Platform.Cocoa/PomdogOpenGLView.mm', ], 'pomdog_library_dxgi_sources': [ '../src/RenderSystem.DXGI/DXGIFormatHelper.cpp', '../src/RenderSystem.DXGI/DXGIFormatHelper.hpp', ], 'pomdog_library_direct3d_sources': [ '../src/RenderSystem.Direct3D/HLSLCompiling.cpp', '../src/RenderSystem.Direct3D/HLSLCompiling.hpp', '../src/RenderSystem.Direct3D/HLSLReflectionHelper.cpp', '../src/RenderSystem.Direct3D/HLSLReflectionHelper.hpp', '../src/RenderSystem.Direct3D/PrerequisitesDirect3D.hpp', ], 'pomdog_library_direct3d11_sources': [ '../src/RenderSystem.Direct3D11/BufferDirect3D11.cpp', '../src/RenderSystem.Direct3D11/BufferDirect3D11.hpp', '../src/RenderSystem.Direct3D11/EffectReflectionDirect3D11.cpp', '../src/RenderSystem.Direct3D11/EffectReflectionDirect3D11.hpp', '../src/RenderSystem.Direct3D11/GraphicsContextDirect3D11.cpp', '../src/RenderSystem.Direct3D11/GraphicsContextDirect3D11.hpp', '../src/RenderSystem.Direct3D11/GraphicsDeviceDirect3D11.cpp', '../src/RenderSystem.Direct3D11/GraphicsDeviceDirect3D11.hpp', '../src/RenderSystem.Direct3D11/PipelineStateDirect3D11.cpp', '../src/RenderSystem.Direct3D11/PipelineStateDirect3D11.hpp', '../src/RenderSystem.Direct3D11/PrerequisitesDirect3D11.hpp', '../src/RenderSystem.Direct3D11/RenderTarget2DDirect3D11.cpp', '../src/RenderSystem.Direct3D11/RenderTarget2DDirect3D11.hpp', '../src/RenderSystem.Direct3D11/SamplerStateDirect3D11.cpp', '../src/RenderSystem.Direct3D11/SamplerStateDirect3D11.hpp', '../src/RenderSystem.Direct3D11/ShaderDirect3D11.cpp', '../src/RenderSystem.Direct3D11/ShaderDirect3D11.hpp', '../src/RenderSystem.Direct3D11/Texture2DDirect3D11.cpp', '../src/RenderSystem.Direct3D11/Texture2DDirect3D11.hpp', ], 'pomdog_library_xaudio2_sources': [ '../src/SoundSystem.XAudio2/AudioClipXAudio2.cpp', '../src/SoundSystem.XAudio2/AudioClipXAudio2.hpp', '../src/SoundSystem.XAudio2/AudioEngineXAudio2.cpp', '../src/SoundSystem.XAudio2/AudioEngineXAudio2.hpp', '../src/SoundSystem.XAudio2/PrerequisitesXAudio2.hpp', '../src/SoundSystem.XAudio2/SoundEffectXAudio2.cpp', '../src/SoundSystem.XAudio2/SoundEffectXAudio2.hpp', ], 'pomdog_library_directinput_sources': [ '../src/InputSystem.DirectInput/DeviceContextDirectInput.cpp', '../src/InputSystem.DirectInput/DeviceContextDirectInput.hpp', '../src/InputSystem.DirectInput/PrerequisitesDirectInput.hpp', ], 'pomdog_library_win32_sources': [ '../include/Pomdog/Platform/Win32/Bootstrap.hpp', '../include/Pomdog/Platform/Win32/BootstrapSettingsWin32.hpp', '../include/Pomdog/Platform/Win32/PrerequisitesWin32.hpp', '../src/Platform.Win32/Bootstrap.cpp', '../src/Platform.Win32/GameHostWin32.cpp', '../src/Platform.Win32/GameHostWin32.hpp', '../src/Platform.Win32/GameWindowWin32.cpp', '../src/Platform.Win32/GameWindowWin32.hpp', '../src/Platform.Win32/FileSystemWin32.cpp', '../src/Platform.Win32/KeyboardWin32.cpp', '../src/Platform.Win32/KeyboardWin32.hpp', '../src/Platform.Win32/MouseWin32.cpp', '../src/Platform.Win32/MouseWin32.hpp', '../src/Platform.Win32/TimeSourceWin32.cpp', '../src/Platform.Win32/TimeSourceWin32.hpp', ], 'pomdog_library_win32_opengl_sources': [ '../src/Platform.Win32/OpenGLContextWin32.cpp', '../src/Platform.Win32/OpenGLContextWin32.hpp', ], 'pomdog_library_x11_sources': [ '../include/Pomdog/Platform/X11/Bootstrap.hpp', '../src/Platform.X11/Bootstrap.cpp', '../src/Platform.X11/GameHostX11.cpp', '../src/Platform.X11/GameHostX11.hpp', '../src/Platform.X11/GameWindowX11.cpp', '../src/Platform.X11/GameWindowX11.hpp', '../src/Platform.X11/KeyboardX11.cpp', '../src/Platform.X11/KeyboardX11.hpp', '../src/Platform.X11/MouseX11.cpp', '../src/Platform.X11/MouseX11.hpp', '../src/Platform.X11/OpenGLContextX11.cpp', '../src/Platform.X11/OpenGLContextX11.hpp', '../src/Platform.X11/X11AtomCache.hpp', '../src/Platform.X11/X11Context.cpp', '../src/Platform.X11/X11Context.hpp', ], 'pomdog_library_linux_sources': [ '../src/Platform.Linux/FileSystemLinux.cpp', '../src/Platform.Linux/TimeSourceLinux.cpp', '../src/Platform.Linux/TimeSourceLinux.hpp', ], }, 'target_defaults': { 'dependencies': [ '<@(pomdog_third_party_dir)/libpng/libpng.gyp:libpng_static', ], 'include_dirs': [ '../include', '<@(pomdog_third_party_dir)/libpng', ], 'sources': [ '<@(pomdog_library_core_sources)', '../include/Pomdog/Pomdog.hpp', ], 'msbuild_settings': { 'ClCompile': { 'WarningLevel': 'Level4', # /W4 'TreatWarningAsError': 'true', # /WX }, }, 'xcode_settings': { 'GCC_VERSION': 'com.apple.compilers.llvm.clang.1_0', 'CLANG_CXX_LANGUAGE_STANDARD': 'c++14', 'CLANG_CXX_LIBRARY': 'libc++', # Warnings (Clang): 'CLANG_WARN_BOOL_CONVERSION': 'YES', 'CLANG_WARN_CONSTANT_CONVERSION': 'YES', 'CLANG_WARN_EMPTY_BODY': 'YES', 'CLANG_WARN_ENUM_CONVERSION': 'YES', 'CLANG_WARN_INT_CONVERSION': 'YES', 'CLANG_WARN_UNREACHABLE_CODE': 'YES', # Warnings (GCC and Clang): 'GCC_WARN_64_TO_32_BIT_CONVERSION': 'YES', 'GCC_WARN_ABOUT_DEPRECATED_FUNCTIONS': 'YES', 'GCC_WARN_ABOUT_MISSING_FIELD_INITIALIZERS': 'YES', 'GCC_WARN_ABOUT_MISSING_NEWLINE': 'YES', 'GCC_WARN_ABOUT_RETURN_TYPE': 'YES_ERROR', 'GCC_WARN_CHECK_SWITCH_STATEMENTS': 'YES', 'GCC_WARN_HIDDEN_VIRTUAL_FUNCTIONS': 'YES', 'GCC_WARN_MISSING_PARENTHESES': 'YES', 'GCC_WARN_NON_VIRTUAL_DESTRUCTOR': 'YES', 'GCC_WARN_SHADOW': 'YES', 'GCC_WARN_SIGN_COMPARE': 'YES', 'GCC_WARN_TYPECHECK_CALLS_TO_PRINTF': 'YES', 'GCC_WARN_UNINITIALIZED_AUTOS': 'YES_AGGRESSIVE', 'GCC_WARN_UNKNOWN_PRAGMAS': 'YES', 'GCC_WARN_UNUSED_FUNCTION': 'YES', 'GCC_WARN_UNUSED_LABEL': 'YES', 'GCC_WARN_UNUSED_VALUE': 'YES', 'GCC_WARN_UNUSED_VARIABLE': 'YES', # Warnings - Objective-C: 'CLANG_WARN_DIRECT_OBJC_ISA_USAGE': 'YES_ERROR', 'CLANG_WARN__DUPLICATE_METHOD_MATCH': 'YES', 'GCC_WARN_ALLOW_INCOMPLETE_PROTOCOL': 'YES', 'GCC_WARN_UNDECLARED_SELECTOR': 'YES', 'CLANG_WARN_OBJC_ROOT_CLASS': 'YES_ERROR', # Warning Policies: 'GCC_TREAT_WARNINGS_AS_ERRORS': 'YES', 'WARNING_CFLAGS': [ '-Wall', ], # Symbols: 'CLANG_ENABLE_OBJC_ARC': 'YES', 'GCC_INLINES_ARE_PRIVATE_EXTERN': 'YES', # '-fvisibility-inlines-hidden' 'GCC_SYMBOLS_PRIVATE_EXTERN': 'YES', # '-fvisibility=hidden' }, 'conditions': [ ['"Direct3D11" in renderers', { 'defines': ['POMDOG_ENABLE_DIRECT3D11'], 'sources': [ '<@(pomdog_library_dxgi_sources)', '<@(pomdog_library_direct3d_sources)', '<@(pomdog_library_direct3d11_sources)', ], 'link_settings': { 'libraries': [ '-ldxgi.lib', '-ld3d11.lib', '-ld3dcompiler.lib', '-ldxguid.lib', # using _IID_ID3D11ShaderReflection ], }, }], ['"GL4" in renderers', { 'defines': ['POMDOG_ENABLE_GL4'], 'sources': [ '<@(pomdog_library_opengl4_sources)', ], }], ['"GL4" in renderers and OS == "win"', { 'sources': [ '<@(pomdog_library_win32_opengl_sources)', ], 'defines': [ 'GLEW_STATIC', ], 'dependencies': [ '<@(pomdog_third_party_dir)/glew/glew.gyp:glew_static', ], 'include_dirs': [ '<@(pomdog_third_party_dir)/glew/include', ], 'link_settings': { 'libraries': [ '-lopengl32.lib', ], }, }], ['"Metal" in renderers and OS == "mac"', { 'link_settings': { 'libraries': [ '$(SDKROOT)/System/Library/Frameworks/Metal.framework', ], }, }], ['"Metal" in renderers and OS == "ios"', { 'link_settings': { 'libraries': [ '$(SDKROOT)/System/Library/Frameworks/Metal.framework', '$(SDKROOT)/System/Library/Frameworks/MetalKit.framework', '$(SDKROOT)/System/Library/Frameworks/ModelIO.framework', ], }, }], ['audio == "OpenAL"', { 'sources': [ '<@(pomdog_library_openal_sources)', ], }], ['audio == "OpenAL" and OS == "mac"', { 'link_settings': { 'libraries': [ '$(SDKROOT)/System/Library/Frameworks/AudioToolBox.framework', '$(SDKROOT)/System/Library/Frameworks/OpenAL.framework', ], }, }], ['audio == "OpenAL" and OS == "ios"', { 'link_settings': { 'libraries': [ '$(SDKROOT)/System/Library/Frameworks/AudioToolBox.framework', '$(SDKROOT)/System/Library/Frameworks/OpenAL.framework', ], }, }], ['audio == "OpenAL" and OS == "linux"', { 'link_settings': { 'libraries': [ '-lopenal', ], }, }], ['audio == "XAudio2"', { 'sources': [ '<@(pomdog_library_xaudio2_sources)', ], 'link_settings': { 'libraries': [ '-lxaudio2.lib', ], }, }], # audio == "XAudio2" ['"DirectInput" in input_devices', { 'sources': [ '<@(pomdog_library_directinput_sources)', ], 'link_settings': { 'libraries': [ '-ldinput8.lib', '-ldxguid.lib', ], }, }], ['application_platform == "X11"', { 'sources': [ '<@(pomdog_library_x11_sources)', ], }], ['application_platform == "X11" and OS == "linux"', { 'defines': [ 'GLEW_STATIC', ], 'dependencies': [ '<@(pomdog_third_party_dir)/glew/glew.gyp:glew_static', ], 'include_dirs': [ '/usr/X11R6/include', '<@(pomdog_third_party_dir)/glew/include', ], 'library_dirs': [ '/usr/X11R6/lib', ], 'link_settings': { 'libraries': [ '-lX11', '-lGL', ], }, }], ['application_platform == "Cocoa"', { 'sources': [ '<@(pomdog_library_cocoa_sources)', ], 'link_settings': { 'libraries': [ '$(SDKROOT)/System/Library/Frameworks/Cocoa.framework', '$(SDKROOT)/System/Library/Frameworks/OpenGL.framework', '$(SDKROOT)/System/Library/Frameworks/QuartzCore.framework', ], }, }], ['OS == "mac" or OS == "ios"', { 'sources': [ '<@(pomdog_library_apple_sources)', ], }], ['OS == "mac"', { 'xcode_settings': { 'MACOSX_DEPLOYMENT_TARGET': '10.9', }, }], ['OS == "ios"', { 'xcode_settings': { 'IPHONEOS_DEPLOYMENT_TARGET': '9.0', 'SDKROOT': 'iphoneos', }, 'link_settings': { 'libraries': [ '$(SDKROOT)/System/Library/Frameworks/Foundation.framework', '$(SDKROOT)/System/Library/Frameworks/UIKit.framework', ], }, }], ['OS == "win"', { 'sources': [ '<@(pomdog_library_win32_sources)', ], 'link_settings': { 'libraries': [ '-lkernel32.lib', '-luser32.lib', '-lgdi32.lib', '-lole32.lib', '-lwinmm.lib', #'-lws2_32.lib', #'-lwinspool.lib', #'-lcomdlg32.lib', #'-ladvapi32.lib', '-lshell32.lib', #'-loleaut32.lib', #'-luuid.lib', #'-lodbc32.lib', #'-lodbccp32.lib', ], }, }], # OS == "win" ['OS == "linux"', { 'sources': [ '<@(pomdog_library_linux_sources)', ], }], ], }, 'targets': [ { 'target_name': 'pomdog-static', 'product_name': 'pomdog', 'type': 'static_library', 'xcode_settings': { 'SKIP_INSTALL': 'YES', }, }, { 'target_name': 'pomdog-shared', 'product_name': 'Pomdog', 'type': 'shared_library', 'msvs_guid': 'A8F27BAE-660F-42B4-BC27-D5A435EF94BF', 'mac_bundle': 1, 'defines': ['POMDOG_BUILDING_LIBRARY_EXPORTS=1'], 'xcode_settings': { 'PRODUCT_NAME': 'Pomdog', #'$(TARGET_NAME)', 'PRODUCT_BUNDLE_IDENTIFIER': 'net.enginetrouble.pomdog', 'INFOPLIST_FILE': '../src/Platform.Apple/Info.plist', 'INSTALL_PATH': '$(LOCAL_LIBRARY_DIR)/Frameworks', 'SKIP_INSTALL': 'YES', #'DEFINES_MODULE': 'YES', 'DYLIB_INSTALL_NAME_BASE': '@rpath', 'LD_RUNPATH_SEARCH_PATHS': [ '$(inherited)', '@executable_path/../Frameworks', '@loader_path/Frameworks', ], }, }, ], }
{'includes': ['common.gypi'], 'conditions': [['OS == "win"', {'variables': {'application_platform%': 'Win32', 'renderers%': ['Direct3D11', 'GL4'], 'audio%': 'XAudio2', 'input_devices%': ['DirectInput']}}], ['OS == "mac"', {'variables': {'application_platform%': 'Cocoa', 'renderers%': ['GL4'], 'audio%': 'OpenAL', 'input_devices%': []}}], ['OS == "ios"', {'variables': {'application_platform%': 'CocoaTouch', 'renderers%': ['Metal'], 'audio%': 'OpenAL', 'input_devices%': []}}], ['OS == "linux" or OS == "freebsd" or OS == "openbsd"', {'variables': {'application_platform%': 'X11', 'renderers%': ['GL4'], 'audio%': 'OpenAL', 'input_devices%': []}}]], 'variables': {'pomdog_third_party_dir%': '../third-party', 'pomdog_library_core_sources': ['../include/Pomdog/Application/Duration.hpp', '../include/Pomdog/Application/Game.hpp', '../include/Pomdog/Application/GameClock.hpp', '../include/Pomdog/Application/GameHost.hpp', '../include/Pomdog/Application/GameWindow.hpp', '../include/Pomdog/Application/MouseCursor.hpp', '../include/Pomdog/Application/Timer.hpp', '../include/Pomdog/Application/TimePoint.hpp', '../include/Pomdog/Audio/AudioClip.hpp', '../include/Pomdog/Audio/AudioChannels.hpp', '../include/Pomdog/Audio/AudioEmitter.hpp', '../include/Pomdog/Audio/AudioEngine.hpp', '../include/Pomdog/Audio/AudioListener.hpp', '../include/Pomdog/Audio/SoundEffect.hpp', '../include/Pomdog/Audio/SoundState.hpp', '../include/Pomdog/Audio/detail/ForwardDeclarations.hpp', '../include/Pomdog/Basic/Export.hpp', '../include/Pomdog/Basic/Platform.hpp', '../include/Pomdog/Basic/Version.hpp', '../include/Pomdog/Content/AssetManager.hpp', '../include/Pomdog/Content/AssetBuilders/Builder.hpp', '../include/Pomdog/Content/AssetBuilders/PipelineStateBuilder.hpp', '../include/Pomdog/Content/AssetBuilders/ShaderBuilder.hpp', '../include/Pomdog/Content/Utility/BinaryFileStream.hpp', '../include/Pomdog/Content/Utility/BinaryReader.hpp', '../include/Pomdog/Content/Utility/MakeFourCC.hpp', '../include/Pomdog/Content/Utility/PathHelper.hpp', '../include/Pomdog/Content/detail/AssetDictionary.hpp', '../include/Pomdog/Content/detail/AssetLoaderContext.hpp', '../include/Pomdog/Content/detail/AssetLoader.hpp', '../include/Pomdog/Content/detail/AssetLoaders/AudioClipLoader.hpp', '../include/Pomdog/Content/detail/AssetLoaders/Texture2DLoader.hpp', '../include/Pomdog/Graphics/Blend.hpp', '../include/Pomdog/Graphics/BlendDescription.hpp', '../include/Pomdog/Graphics/BlendFunction.hpp', '../include/Pomdog/Graphics/BufferUsage.hpp', '../include/Pomdog/Graphics/ClearOptions.hpp', '../include/Pomdog/Graphics/ComparisonFunction.hpp', '../include/Pomdog/Graphics/ConstantBuffer.hpp', '../include/Pomdog/Graphics/CullMode.hpp', '../include/Pomdog/Graphics/DepthFormat.hpp', '../include/Pomdog/Graphics/DepthStencilDescription.hpp', '../include/Pomdog/Graphics/DepthStencilOperation.hpp', '../include/Pomdog/Graphics/EffectAnnotation.hpp', '../include/Pomdog/Graphics/EffectConstantDescription.hpp', '../include/Pomdog/Graphics/EffectReflection.hpp', '../include/Pomdog/Graphics/EffectVariableClass.hpp', '../include/Pomdog/Graphics/EffectVariableType.hpp', '../include/Pomdog/Graphics/EffectVariable.hpp', '../include/Pomdog/Graphics/FillMode.hpp', '../include/Pomdog/Graphics/GraphicsCommandList.hpp', '../include/Pomdog/Graphics/GraphicsCommandQueue.hpp', '../include/Pomdog/Graphics/GraphicsDevice.hpp', '../include/Pomdog/Graphics/IndexBuffer.hpp', '../include/Pomdog/Graphics/IndexElementSize.hpp', '../include/Pomdog/Graphics/InputClassification.hpp', '../include/Pomdog/Graphics/InputElement.hpp', '../include/Pomdog/Graphics/InputElementFormat.hpp', '../include/Pomdog/Graphics/InputLayoutDescription.hpp', '../include/Pomdog/Graphics/InputLayoutHelper.hpp', '../include/Pomdog/Graphics/PipelineState.hpp', '../include/Pomdog/Graphics/PipelineStateDescription.hpp', '../include/Pomdog/Graphics/PresentationParameters.hpp', '../include/Pomdog/Graphics/PrimitiveTopology.hpp', '../include/Pomdog/Graphics/RasterizerDescription.hpp', '../include/Pomdog/Graphics/RenderTarget2D.hpp', '../include/Pomdog/Graphics/RenderTargetBlendDescription.hpp', '../include/Pomdog/Graphics/SamplerDescription.hpp', '../include/Pomdog/Graphics/SamplerState.hpp', '../include/Pomdog/Graphics/Shader.hpp', '../include/Pomdog/Graphics/ShaderLanguage.hpp', '../include/Pomdog/Graphics/ShaderPipelineStage.hpp', '../include/Pomdog/Graphics/SurfaceFormat.hpp', '../include/Pomdog/Graphics/StencilOperation.hpp', '../include/Pomdog/Graphics/Texture.hpp', '../include/Pomdog/Graphics/Texture2D.hpp', '../include/Pomdog/Graphics/TextureAddressMode.hpp', '../include/Pomdog/Graphics/TextureFilter.hpp', '../include/Pomdog/Graphics/VertexBuffer.hpp', '../include/Pomdog/Graphics/VertexBufferBinding.hpp', '../include/Pomdog/Graphics/Viewport.hpp', '../include/Pomdog/Graphics/detail/ForwardDeclarations.hpp', '../include/Pomdog/Graphics/detail/EffectBinaryParameter.hpp', '../include/Pomdog/Graphics/ShaderCompilers/GLSLCompiler.hpp', '../include/Pomdog/Graphics/ShaderCompilers/HLSLCompiler.hpp', '../include/Pomdog/Input/ButtonState.hpp', '../include/Pomdog/Input/Gamepad.hpp', '../include/Pomdog/Input/GamepadButtons.hpp', '../include/Pomdog/Input/GamepadCapabilities.hpp', '../include/Pomdog/Input/GamepadDPad.hpp', '../include/Pomdog/Input/GamepadState.hpp', '../include/Pomdog/Input/GamepadThumbSticks.hpp', '../include/Pomdog/Input/GamepadType.hpp', '../include/Pomdog/Input/Keyboard.hpp', '../include/Pomdog/Input/KeyboardState.hpp', '../include/Pomdog/Input/KeyState.hpp', '../include/Pomdog/Input/Keys.hpp', '../include/Pomdog/Input/Mouse.hpp', '../include/Pomdog/Input/MouseState.hpp', '../include/Pomdog/Input/PlayerIndex.hpp', '../include/Pomdog/Input/TouchLocation.hpp', '../include/Pomdog/Input/TouchLocationState.hpp', '../include/Pomdog/Logging/Log.hpp', '../include/Pomdog/Logging/LogChannel.hpp', '../include/Pomdog/Logging/LogEntry.hpp', '../include/Pomdog/Logging/LogLevel.hpp', '../include/Pomdog/Logging/LogStream.hpp', '../include/Pomdog/Math/BoundingBox.hpp', '../include/Pomdog/Math/BoundingBox2D.hpp', '../include/Pomdog/Math/BoundingCircle.hpp', '../include/Pomdog/Math/BoundingSphere.hpp', '../include/Pomdog/Math/Color.hpp', '../include/Pomdog/Math/ContainmentType.hpp', '../include/Pomdog/Math/Degree.hpp', '../include/Pomdog/Math/MathHelper.hpp', '../include/Pomdog/Math/Matrix2x2.hpp', '../include/Pomdog/Math/Matrix3x2.hpp', '../include/Pomdog/Math/Matrix3x3.hpp', '../include/Pomdog/Math/Matrix4x4.hpp', '../include/Pomdog/Math/Point2D.hpp', '../include/Pomdog/Math/Point3D.hpp', '../include/Pomdog/Math/Quaternion.hpp', '../include/Pomdog/Math/Radian.hpp', '../include/Pomdog/Math/Ray.hpp', '../include/Pomdog/Math/Rectangle.hpp', '../include/Pomdog/Math/Vector2.hpp', '../include/Pomdog/Math/Vector3.hpp', '../include/Pomdog/Math/Vector4.hpp', '../include/Pomdog/Math/detail/Coordinate2D.hpp', '../include/Pomdog/Math/detail/Coordinate2DImplementation.hpp', '../include/Pomdog/Math/detail/Coordinate3D.hpp', '../include/Pomdog/Math/detail/Coordinate3DImplementation.hpp', '../include/Pomdog/Math/detail/FloatingPointMatrix2x2.hpp', '../include/Pomdog/Math/detail/FloatingPointMatrix3x2.hpp', '../include/Pomdog/Math/detail/FloatingPointMatrix3x3.hpp', '../include/Pomdog/Math/detail/FloatingPointMatrix4x4.hpp', '../include/Pomdog/Math/detail/FloatingPointQuaternion.hpp', '../include/Pomdog/Math/detail/FloatingPointVector2.hpp', '../include/Pomdog/Math/detail/FloatingPointVector3.hpp', '../include/Pomdog/Math/detail/FloatingPointVector4.hpp', '../include/Pomdog/Math/detail/ForwardDeclarations.hpp', '../include/Pomdog/Math/detail/TaggedArithmetic.hpp', '../include/Pomdog/Signals/Connection.hpp', '../include/Pomdog/Signals/ConnectionList.hpp', '../include/Pomdog/Signals/Event.hpp', '../include/Pomdog/Signals/EventQueue.hpp', '../include/Pomdog/Signals/Helpers.hpp', '../include/Pomdog/Signals/ScopedConnection.hpp', '../include/Pomdog/Signals/Signal.hpp', '../include/Pomdog/Signals/detail/EventBody.hpp', '../include/Pomdog/Signals/detail/ForwardDeclarations.hpp', '../include/Pomdog/Signals/detail/SignalBody.hpp', '../include/Pomdog/Utility/Any.hpp', '../include/Pomdog/Utility/Assert.hpp', '../include/Pomdog/Utility/Exception.hpp', '../include/Pomdog/Utility/Optional.hpp', '../include/Pomdog/Utility/StringHelper.hpp', '../include/Pomdog/Utility/detail/CRC32.hpp', '../include/Pomdog/Utility/detail/FileSystem.hpp', '../include/Pomdog/Utility/detail/Tagged.hpp', '../src/Application/GameClock.cpp', '../src/Application/SubsystemScheduler.hpp', '../src/Application/SystemEvents.hpp', '../src/Application/Timer.cpp', '../src/Application/TimeSource.hpp', '../src/Audio/AudioClip.cpp', '../src/Audio/AudioEngine.cpp', '../src/Audio/SoundEffect.cpp', '../src/Content/AssetDictionary.cpp', '../src/Content/AssetLoaderContext.cpp', '../src/Content/AssetManager.cpp', '../src/Content/AssetBuilders/PipelineStateBuilder.cpp', '../src/Content/AssetBuilders/ShaderBuilder.cpp', '../src/Content/AssetLoaders/AudioClipLoader.cpp', '../src/Content/AssetLoaders/Texture2DLoader.cpp', '../src/Content/Utility/DDSTextureReader.cpp', '../src/Content/Utility/DDSTextureReader.hpp', '../src/Content/Utility/MSWaveAudioLoader.cpp', '../src/Content/Utility/MSWaveAudioLoader.hpp', '../src/Content/Utility/PNGTextureReader.cpp', '../src/Content/Utility/PNGTextureReader.hpp', '../src/Graphics/ClearOptions.cpp', '../src/Graphics/ConstantBuffer.cpp', '../src/Graphics/EffectBinaryParameter.cpp', '../src/Graphics/EffectReflection.cpp', '../src/Graphics/GraphicsCommandList.cpp', '../src/Graphics/GraphicsCommandQueue.cpp', '../src/Graphics/GraphicsDevice.cpp', '../src/Graphics/IndexBuffer.cpp', '../src/Graphics/InputLayoutHelper.cpp', '../src/Graphics/PipelineState.cpp', '../src/Graphics/RenderTarget2D.cpp', '../src/Graphics/SamplerState.cpp', '../src/Graphics/Texture2D.cpp', '../src/Graphics/Viewport.cpp', '../src/Graphics/VertexBuffer.cpp', '../src/Graphics/ShaderCompilers/GLSLCompiler.cpp', '../src/Graphics/ShaderCompilers/HLSLCompiler.cpp', '../src/Input/KeyboardState.cpp', '../src/InputSystem/InputDeviceCreator.hpp', '../src/InputSystem/InputDeviceFactory.cpp', '../src/InputSystem/InputDeviceFactory.hpp', '../src/Logging/Log.cpp', '../src/Logging/LogChannel.cpp', '../src/Logging/LogStream.cpp', '../src/Math/BoundingBox.cpp', '../src/Math/BoundingBox2D.cpp', '../src/Math/BoundingCircle.cpp', '../src/Math/BoundingSphere.cpp', '../src/Math/Color.cpp', '../src/Math/MathHelper.cpp', '../src/Math/Ray.cpp', '../src/Math/Rectangle.cpp', '../src/Math/detail/FloatingPointMatrix2x2.cpp', '../src/Math/detail/FloatingPointMatrix3x2.cpp', '../src/Math/detail/FloatingPointMatrix3x3.cpp', '../src/Math/detail/FloatingPointMatrix4x4.cpp', '../src/Math/detail/FloatingPointQuaternion.cpp', '../src/Math/detail/FloatingPointVector2.cpp', '../src/Math/detail/FloatingPointVector3.cpp', '../src/Math/detail/FloatingPointVector4.cpp', '../src/RenderSystem/GraphicsCapabilities.hpp', '../src/RenderSystem/GraphicsCommandListImmediate.cpp', '../src/RenderSystem/GraphicsCommandListImmediate.hpp', '../src/RenderSystem/GraphicsCommandQueueImmediate.cpp', '../src/RenderSystem/GraphicsCommandQueueImmediate.hpp', '../src/RenderSystem/GraphicsContext.cpp', '../src/RenderSystem/GraphicsContext.hpp', '../src/RenderSystem/NativeBuffer.hpp', '../src/RenderSystem/NativeEffectReflection.hpp', '../src/RenderSystem/NativeGraphicsCommandList.hpp', '../src/RenderSystem/NativeGraphicsCommandQueue.hpp', '../src/RenderSystem/NativeGraphicsContext.hpp', '../src/RenderSystem/NativeGraphicsDevice.hpp', '../src/RenderSystem/NativePipelineState.hpp', '../src/RenderSystem/NativeRenderTarget2D.hpp', '../src/RenderSystem/NativeSamplerState.hpp', '../src/RenderSystem/NativeTexture2D.hpp', '../src/RenderSystem/ShaderBytecode.hpp', '../src/RenderSystem/ShaderCompileOptions.hpp', '../src/RenderSystem/SurfaceFormatHelper.cpp', '../src/RenderSystem/SurfaceFormatHelper.hpp', '../src/RenderSystem/TextureHelper.cpp', '../src/RenderSystem/TextureHelper.hpp', '../src/Signals/Connection.cpp', '../src/Signals/ConnectionList.cpp', '../src/Signals/EventQueue.cpp', '../src/Signals/ScopedConnection.cpp', '../src/Utility/CRC32.cpp', '../src/Utility/Noncopyable.hpp', '../src/Utility/PathHelper.cpp', '../src/Utility/ScopeGuard.hpp', '../src/Utility/StringHelper.cpp'], 'pomdog_library_opengl4_sources': ['../src/RenderSystem.GL4/BlendStateGL4.cpp', '../src/RenderSystem.GL4/BlendStateGL4.hpp', '../src/RenderSystem.GL4/BufferGL4.cpp', '../src/RenderSystem.GL4/BufferGL4.hpp', '../src/RenderSystem.GL4/DepthStencilStateGL4.cpp', '../src/RenderSystem.GL4/DepthStencilStateGL4.hpp', '../src/RenderSystem.GL4/EffectReflectionGL4.cpp', '../src/RenderSystem.GL4/EffectReflectionGL4.hpp', '../src/RenderSystem.GL4/ErrorChecker.cpp', '../src/RenderSystem.GL4/ErrorChecker.hpp', '../src/RenderSystem.GL4/GraphicsContextGL4.cpp', '../src/RenderSystem.GL4/GraphicsContextGL4.hpp', '../src/RenderSystem.GL4/GraphicsDeviceGL4.cpp', '../src/RenderSystem.GL4/GraphicsDeviceGL4.hpp', '../src/RenderSystem.GL4/InputLayoutGL4.cpp', '../src/RenderSystem.GL4/InputLayoutGL4.hpp', '../src/RenderSystem.GL4/OpenGLContext.hpp', '../src/RenderSystem.GL4/OpenGLPrerequisites.hpp', '../src/RenderSystem.GL4/PipelineStateGL4.cpp', '../src/RenderSystem.GL4/PipelineStateGL4.hpp', '../src/RenderSystem.GL4/RasterizerStateGL4.cpp', '../src/RenderSystem.GL4/RasterizerStateGL4.hpp', '../src/RenderSystem.GL4/RenderTarget2DGL4.cpp', '../src/RenderSystem.GL4/RenderTarget2DGL4.hpp', '../src/RenderSystem.GL4/SamplerStateGL4.cpp', '../src/RenderSystem.GL4/SamplerStateGL4.hpp', '../src/RenderSystem.GL4/ShaderGL4.cpp', '../src/RenderSystem.GL4/ShaderGL4.hpp', '../src/RenderSystem.GL4/Texture2DGL4.cpp', '../src/RenderSystem.GL4/Texture2DGL4.hpp', '../src/RenderSystem.GL4/TypesafeGL4.hpp', '../src/RenderSystem.GL4/TypesafeHelperGL4.hpp'], 'pomdog_library_openal_sources': ['../src/SoundSystem.OpenAL/AudioClipAL.cpp', '../src/SoundSystem.OpenAL/AudioClipAL.hpp', '../src/SoundSystem.OpenAL/AudioEngineAL.cpp', '../src/SoundSystem.OpenAL/AudioEngineAL.hpp', '../src/SoundSystem.OpenAL/ContextOpenAL.cpp', '../src/SoundSystem.OpenAL/ContextOpenAL.hpp', '../src/SoundSystem.OpenAL/ErrorCheckerAL.cpp', '../src/SoundSystem.OpenAL/ErrorCheckerAL.hpp', '../src/SoundSystem.OpenAL/PrerequisitesOpenAL.hpp', '../src/SoundSystem.OpenAL/SoundEffectAL.cpp', '../src/SoundSystem.OpenAL/SoundEffectAL.hpp'], 'pomdog_library_apple_sources': ['../src/Platform.Apple/FileSystemApple.mm', '../src/Platform.Apple/TimeSourceApple.cpp', '../src/Platform.Apple/TimeSourceApple.hpp'], 'pomdog_library_cocoa_sources': ['../include/Pomdog/Platform/Cocoa/Bootstrap.hpp', '../include/Pomdog/Platform/Cocoa/PomdogOpenGLView.hpp', '../src/Platform.Cocoa/Bootstrap.mm', '../src/Platform.Cocoa/CocoaWindowDelegate.hpp', '../src/Platform.Cocoa/CocoaWindowDelegate.mm', '../src/Platform.Cocoa/GameHostCocoa.hpp', '../src/Platform.Cocoa/GameHostCocoa.mm', '../src/Platform.Cocoa/GameWindowCocoa.hpp', '../src/Platform.Cocoa/GameWindowCocoa.mm', '../src/Platform.Cocoa/KeyboardCocoa.hpp', '../src/Platform.Cocoa/KeyboardCocoa.cpp', '../src/Platform.Cocoa/MouseCocoa.hpp', '../src/Platform.Cocoa/MouseCocoa.cpp', '../src/Platform.Cocoa/OpenGLContextCocoa.hpp', '../src/Platform.Cocoa/OpenGLContextCocoa.mm', '../src/Platform.Cocoa/PomdogOpenGLView.mm'], 'pomdog_library_dxgi_sources': ['../src/RenderSystem.DXGI/DXGIFormatHelper.cpp', '../src/RenderSystem.DXGI/DXGIFormatHelper.hpp'], 'pomdog_library_direct3d_sources': ['../src/RenderSystem.Direct3D/HLSLCompiling.cpp', '../src/RenderSystem.Direct3D/HLSLCompiling.hpp', '../src/RenderSystem.Direct3D/HLSLReflectionHelper.cpp', '../src/RenderSystem.Direct3D/HLSLReflectionHelper.hpp', '../src/RenderSystem.Direct3D/PrerequisitesDirect3D.hpp'], 'pomdog_library_direct3d11_sources': ['../src/RenderSystem.Direct3D11/BufferDirect3D11.cpp', '../src/RenderSystem.Direct3D11/BufferDirect3D11.hpp', '../src/RenderSystem.Direct3D11/EffectReflectionDirect3D11.cpp', '../src/RenderSystem.Direct3D11/EffectReflectionDirect3D11.hpp', '../src/RenderSystem.Direct3D11/GraphicsContextDirect3D11.cpp', '../src/RenderSystem.Direct3D11/GraphicsContextDirect3D11.hpp', '../src/RenderSystem.Direct3D11/GraphicsDeviceDirect3D11.cpp', '../src/RenderSystem.Direct3D11/GraphicsDeviceDirect3D11.hpp', '../src/RenderSystem.Direct3D11/PipelineStateDirect3D11.cpp', '../src/RenderSystem.Direct3D11/PipelineStateDirect3D11.hpp', '../src/RenderSystem.Direct3D11/PrerequisitesDirect3D11.hpp', '../src/RenderSystem.Direct3D11/RenderTarget2DDirect3D11.cpp', '../src/RenderSystem.Direct3D11/RenderTarget2DDirect3D11.hpp', '../src/RenderSystem.Direct3D11/SamplerStateDirect3D11.cpp', '../src/RenderSystem.Direct3D11/SamplerStateDirect3D11.hpp', '../src/RenderSystem.Direct3D11/ShaderDirect3D11.cpp', '../src/RenderSystem.Direct3D11/ShaderDirect3D11.hpp', '../src/RenderSystem.Direct3D11/Texture2DDirect3D11.cpp', '../src/RenderSystem.Direct3D11/Texture2DDirect3D11.hpp'], 'pomdog_library_xaudio2_sources': ['../src/SoundSystem.XAudio2/AudioClipXAudio2.cpp', '../src/SoundSystem.XAudio2/AudioClipXAudio2.hpp', '../src/SoundSystem.XAudio2/AudioEngineXAudio2.cpp', '../src/SoundSystem.XAudio2/AudioEngineXAudio2.hpp', '../src/SoundSystem.XAudio2/PrerequisitesXAudio2.hpp', '../src/SoundSystem.XAudio2/SoundEffectXAudio2.cpp', '../src/SoundSystem.XAudio2/SoundEffectXAudio2.hpp'], 'pomdog_library_directinput_sources': ['../src/InputSystem.DirectInput/DeviceContextDirectInput.cpp', '../src/InputSystem.DirectInput/DeviceContextDirectInput.hpp', '../src/InputSystem.DirectInput/PrerequisitesDirectInput.hpp'], 'pomdog_library_win32_sources': ['../include/Pomdog/Platform/Win32/Bootstrap.hpp', '../include/Pomdog/Platform/Win32/BootstrapSettingsWin32.hpp', '../include/Pomdog/Platform/Win32/PrerequisitesWin32.hpp', '../src/Platform.Win32/Bootstrap.cpp', '../src/Platform.Win32/GameHostWin32.cpp', '../src/Platform.Win32/GameHostWin32.hpp', '../src/Platform.Win32/GameWindowWin32.cpp', '../src/Platform.Win32/GameWindowWin32.hpp', '../src/Platform.Win32/FileSystemWin32.cpp', '../src/Platform.Win32/KeyboardWin32.cpp', '../src/Platform.Win32/KeyboardWin32.hpp', '../src/Platform.Win32/MouseWin32.cpp', '../src/Platform.Win32/MouseWin32.hpp', '../src/Platform.Win32/TimeSourceWin32.cpp', '../src/Platform.Win32/TimeSourceWin32.hpp'], 'pomdog_library_win32_opengl_sources': ['../src/Platform.Win32/OpenGLContextWin32.cpp', '../src/Platform.Win32/OpenGLContextWin32.hpp'], 'pomdog_library_x11_sources': ['../include/Pomdog/Platform/X11/Bootstrap.hpp', '../src/Platform.X11/Bootstrap.cpp', '../src/Platform.X11/GameHostX11.cpp', '../src/Platform.X11/GameHostX11.hpp', '../src/Platform.X11/GameWindowX11.cpp', '../src/Platform.X11/GameWindowX11.hpp', '../src/Platform.X11/KeyboardX11.cpp', '../src/Platform.X11/KeyboardX11.hpp', '../src/Platform.X11/MouseX11.cpp', '../src/Platform.X11/MouseX11.hpp', '../src/Platform.X11/OpenGLContextX11.cpp', '../src/Platform.X11/OpenGLContextX11.hpp', '../src/Platform.X11/X11AtomCache.hpp', '../src/Platform.X11/X11Context.cpp', '../src/Platform.X11/X11Context.hpp'], 'pomdog_library_linux_sources': ['../src/Platform.Linux/FileSystemLinux.cpp', '../src/Platform.Linux/TimeSourceLinux.cpp', '../src/Platform.Linux/TimeSourceLinux.hpp']}, 'target_defaults': {'dependencies': ['<@(pomdog_third_party_dir)/libpng/libpng.gyp:libpng_static'], 'include_dirs': ['../include', '<@(pomdog_third_party_dir)/libpng'], 'sources': ['<@(pomdog_library_core_sources)', '../include/Pomdog/Pomdog.hpp'], 'msbuild_settings': {'ClCompile': {'WarningLevel': 'Level4', 'TreatWarningAsError': 'true'}}, 'xcode_settings': {'GCC_VERSION': 'com.apple.compilers.llvm.clang.1_0', 'CLANG_CXX_LANGUAGE_STANDARD': 'c++14', 'CLANG_CXX_LIBRARY': 'libc++', 'CLANG_WARN_BOOL_CONVERSION': 'YES', 'CLANG_WARN_CONSTANT_CONVERSION': 'YES', 'CLANG_WARN_EMPTY_BODY': 'YES', 'CLANG_WARN_ENUM_CONVERSION': 'YES', 'CLANG_WARN_INT_CONVERSION': 'YES', 'CLANG_WARN_UNREACHABLE_CODE': 'YES', 'GCC_WARN_64_TO_32_BIT_CONVERSION': 'YES', 'GCC_WARN_ABOUT_DEPRECATED_FUNCTIONS': 'YES', 'GCC_WARN_ABOUT_MISSING_FIELD_INITIALIZERS': 'YES', 'GCC_WARN_ABOUT_MISSING_NEWLINE': 'YES', 'GCC_WARN_ABOUT_RETURN_TYPE': 'YES_ERROR', 'GCC_WARN_CHECK_SWITCH_STATEMENTS': 'YES', 'GCC_WARN_HIDDEN_VIRTUAL_FUNCTIONS': 'YES', 'GCC_WARN_MISSING_PARENTHESES': 'YES', 'GCC_WARN_NON_VIRTUAL_DESTRUCTOR': 'YES', 'GCC_WARN_SHADOW': 'YES', 'GCC_WARN_SIGN_COMPARE': 'YES', 'GCC_WARN_TYPECHECK_CALLS_TO_PRINTF': 'YES', 'GCC_WARN_UNINITIALIZED_AUTOS': 'YES_AGGRESSIVE', 'GCC_WARN_UNKNOWN_PRAGMAS': 'YES', 'GCC_WARN_UNUSED_FUNCTION': 'YES', 'GCC_WARN_UNUSED_LABEL': 'YES', 'GCC_WARN_UNUSED_VALUE': 'YES', 'GCC_WARN_UNUSED_VARIABLE': 'YES', 'CLANG_WARN_DIRECT_OBJC_ISA_USAGE': 'YES_ERROR', 'CLANG_WARN__DUPLICATE_METHOD_MATCH': 'YES', 'GCC_WARN_ALLOW_INCOMPLETE_PROTOCOL': 'YES', 'GCC_WARN_UNDECLARED_SELECTOR': 'YES', 'CLANG_WARN_OBJC_ROOT_CLASS': 'YES_ERROR', 'GCC_TREAT_WARNINGS_AS_ERRORS': 'YES', 'WARNING_CFLAGS': ['-Wall'], 'CLANG_ENABLE_OBJC_ARC': 'YES', 'GCC_INLINES_ARE_PRIVATE_EXTERN': 'YES', 'GCC_SYMBOLS_PRIVATE_EXTERN': 'YES'}, 'conditions': [['"Direct3D11" in renderers', {'defines': ['POMDOG_ENABLE_DIRECT3D11'], 'sources': ['<@(pomdog_library_dxgi_sources)', '<@(pomdog_library_direct3d_sources)', '<@(pomdog_library_direct3d11_sources)'], 'link_settings': {'libraries': ['-ldxgi.lib', '-ld3d11.lib', '-ld3dcompiler.lib', '-ldxguid.lib']}}], ['"GL4" in renderers', {'defines': ['POMDOG_ENABLE_GL4'], 'sources': ['<@(pomdog_library_opengl4_sources)']}], ['"GL4" in renderers and OS == "win"', {'sources': ['<@(pomdog_library_win32_opengl_sources)'], 'defines': ['GLEW_STATIC'], 'dependencies': ['<@(pomdog_third_party_dir)/glew/glew.gyp:glew_static'], 'include_dirs': ['<@(pomdog_third_party_dir)/glew/include'], 'link_settings': {'libraries': ['-lopengl32.lib']}}], ['"Metal" in renderers and OS == "mac"', {'link_settings': {'libraries': ['$(SDKROOT)/System/Library/Frameworks/Metal.framework']}}], ['"Metal" in renderers and OS == "ios"', {'link_settings': {'libraries': ['$(SDKROOT)/System/Library/Frameworks/Metal.framework', '$(SDKROOT)/System/Library/Frameworks/MetalKit.framework', '$(SDKROOT)/System/Library/Frameworks/ModelIO.framework']}}], ['audio == "OpenAL"', {'sources': ['<@(pomdog_library_openal_sources)']}], ['audio == "OpenAL" and OS == "mac"', {'link_settings': {'libraries': ['$(SDKROOT)/System/Library/Frameworks/AudioToolBox.framework', '$(SDKROOT)/System/Library/Frameworks/OpenAL.framework']}}], ['audio == "OpenAL" and OS == "ios"', {'link_settings': {'libraries': ['$(SDKROOT)/System/Library/Frameworks/AudioToolBox.framework', '$(SDKROOT)/System/Library/Frameworks/OpenAL.framework']}}], ['audio == "OpenAL" and OS == "linux"', {'link_settings': {'libraries': ['-lopenal']}}], ['audio == "XAudio2"', {'sources': ['<@(pomdog_library_xaudio2_sources)'], 'link_settings': {'libraries': ['-lxaudio2.lib']}}], ['"DirectInput" in input_devices', {'sources': ['<@(pomdog_library_directinput_sources)'], 'link_settings': {'libraries': ['-ldinput8.lib', '-ldxguid.lib']}}], ['application_platform == "X11"', {'sources': ['<@(pomdog_library_x11_sources)']}], ['application_platform == "X11" and OS == "linux"', {'defines': ['GLEW_STATIC'], 'dependencies': ['<@(pomdog_third_party_dir)/glew/glew.gyp:glew_static'], 'include_dirs': ['/usr/X11R6/include', '<@(pomdog_third_party_dir)/glew/include'], 'library_dirs': ['/usr/X11R6/lib'], 'link_settings': {'libraries': ['-lX11', '-lGL']}}], ['application_platform == "Cocoa"', {'sources': ['<@(pomdog_library_cocoa_sources)'], 'link_settings': {'libraries': ['$(SDKROOT)/System/Library/Frameworks/Cocoa.framework', '$(SDKROOT)/System/Library/Frameworks/OpenGL.framework', '$(SDKROOT)/System/Library/Frameworks/QuartzCore.framework']}}], ['OS == "mac" or OS == "ios"', {'sources': ['<@(pomdog_library_apple_sources)']}], ['OS == "mac"', {'xcode_settings': {'MACOSX_DEPLOYMENT_TARGET': '10.9'}}], ['OS == "ios"', {'xcode_settings': {'IPHONEOS_DEPLOYMENT_TARGET': '9.0', 'SDKROOT': 'iphoneos'}, 'link_settings': {'libraries': ['$(SDKROOT)/System/Library/Frameworks/Foundation.framework', '$(SDKROOT)/System/Library/Frameworks/UIKit.framework']}}], ['OS == "win"', {'sources': ['<@(pomdog_library_win32_sources)'], 'link_settings': {'libraries': ['-lkernel32.lib', '-luser32.lib', '-lgdi32.lib', '-lole32.lib', '-lwinmm.lib', '-lshell32.lib']}}], ['OS == "linux"', {'sources': ['<@(pomdog_library_linux_sources)']}]]}, 'targets': [{'target_name': 'pomdog-static', 'product_name': 'pomdog', 'type': 'static_library', 'xcode_settings': {'SKIP_INSTALL': 'YES'}}, {'target_name': 'pomdog-shared', 'product_name': 'Pomdog', 'type': 'shared_library', 'msvs_guid': 'A8F27BAE-660F-42B4-BC27-D5A435EF94BF', 'mac_bundle': 1, 'defines': ['POMDOG_BUILDING_LIBRARY_EXPORTS=1'], 'xcode_settings': {'PRODUCT_NAME': 'Pomdog', 'PRODUCT_BUNDLE_IDENTIFIER': 'net.enginetrouble.pomdog', 'INFOPLIST_FILE': '../src/Platform.Apple/Info.plist', 'INSTALL_PATH': '$(LOCAL_LIBRARY_DIR)/Frameworks', 'SKIP_INSTALL': 'YES', 'DYLIB_INSTALL_NAME_BASE': '@rpath', 'LD_RUNPATH_SEARCH_PATHS': ['$(inherited)', '@executable_path/../Frameworks', '@loader_path/Frameworks']}}]}
#coding:utf-8 ''' filename:exchange_keys_and_values.py chap:4 subject:10 conditions:a dict solution:exchanged keys and values ''' origin_dict = {'book':['python','djang','data'],'author':'laoqi','publisher':'phei'} def ishashable(obj): try: hash(obj) return True except: return False xchange_dict = {} for key,value in origin_dict.items(): if ishashable(value): xchange_dict.update({value:key}) else: for v in value: xchange_dict.update({v:key}) print(f'''origin_dict : {origin_dict} xchange_dict{xchange_dict}''')
""" filename:exchange_keys_and_values.py chap:4 subject:10 conditions:a dict solution:exchanged keys and values """ origin_dict = {'book': ['python', 'djang', 'data'], 'author': 'laoqi', 'publisher': 'phei'} def ishashable(obj): try: hash(obj) return True except: return False xchange_dict = {} for (key, value) in origin_dict.items(): if ishashable(value): xchange_dict.update({value: key}) else: for v in value: xchange_dict.update({v: key}) print(f'origin_dict : {origin_dict}\nxchange_dict{xchange_dict}')
class Input_data(): def __init__(self): self.s='' def getString(self): self.s = input() def printString(self): print(self.s.upper()) strobj=Input_data() strobj.getString() strobj.printString()
class Input_Data: def __init__(self): self.s = '' def get_string(self): self.s = input() def print_string(self): print(self.s.upper()) strobj = input_data() strobj.getString() strobj.printString()
class Solution: def minSessions(self, tasks: List[int], sessionTime: int) -> int: n = len(tasks) initial_state = int('0b'+'1'*n,2) dp = {} def find_dp(state): if state in dp: return dp[state] if state == 0: dp[state] = (1, 0) else: ans = (float('inf'), float('inf')) for i in range(n): if state & (1<<i): pieces, last = find_dp(state - (1 << i)) full = (last + tasks[i] > sessionTime) ans = min(ans, (pieces + full, tasks[i] + (1-full)*last)) dp[state] = ans return dp[state] return find_dp((1<<n)-1)[0] # reference: https://leetcode.com/problems/minimum-number-of-work-sessions-to-finish-the-tasks/discuss/1431829/Python-dynamic-programming-on-subsets-explained
class Solution: def min_sessions(self, tasks: List[int], sessionTime: int) -> int: n = len(tasks) initial_state = int('0b' + '1' * n, 2) dp = {} def find_dp(state): if state in dp: return dp[state] if state == 0: dp[state] = (1, 0) else: ans = (float('inf'), float('inf')) for i in range(n): if state & 1 << i: (pieces, last) = find_dp(state - (1 << i)) full = last + tasks[i] > sessionTime ans = min(ans, (pieces + full, tasks[i] + (1 - full) * last)) dp[state] = ans return dp[state] return find_dp((1 << n) - 1)[0]
""" Given a binary tree, find the root-to-leaf path with the maximum sum. """ class TreeNode: def __init__(self, val, left=None, right=None): self.val = val self.left = left self.right = right def find_paths(root): res = [] cur_path = [] find_max(root, res, cur_path, 0) return res max_sum = 0 def find_max(root, res, cur_path, cur_sum): global max_sum if not root: return cur_sum += root.val cur_path.append(root.val) if (not root.left) and (not root.right): if cur_sum > max_sum: max_sum = cur_sum res.clear() res.extend(cur_path) find_max(root.left, res, cur_path, cur_sum) find_max(root.right, res, cur_path, cur_sum) cur_path.pop() def main(): root = TreeNode(12) root.left = TreeNode(8) root.right = TreeNode(1) root.left.left = TreeNode(4) root.right.left = TreeNode(10) root.right.right = TreeNode(5) required_sum = 23 print("Tree paths max sum " + str(find_paths(root))) main() """ Time O(N) Space O(N) """
""" Given a binary tree, find the root-to-leaf path with the maximum sum. """ class Treenode: def __init__(self, val, left=None, right=None): self.val = val self.left = left self.right = right def find_paths(root): res = [] cur_path = [] find_max(root, res, cur_path, 0) return res max_sum = 0 def find_max(root, res, cur_path, cur_sum): global max_sum if not root: return cur_sum += root.val cur_path.append(root.val) if not root.left and (not root.right): if cur_sum > max_sum: max_sum = cur_sum res.clear() res.extend(cur_path) find_max(root.left, res, cur_path, cur_sum) find_max(root.right, res, cur_path, cur_sum) cur_path.pop() def main(): root = tree_node(12) root.left = tree_node(8) root.right = tree_node(1) root.left.left = tree_node(4) root.right.left = tree_node(10) root.right.right = tree_node(5) required_sum = 23 print('Tree paths max sum ' + str(find_paths(root))) main() '\nTime O(N)\nSpace O(N)\n'
print('Grocery list:') print('"add" to add items and "view" to view list') grocery_list = [] while True: command = input('Enter command: ') if command == 'add': to_add = input('Enter new item: ') grocery_list.append(to_add) # elif stands for "else if" elif command == 'view': for i in range(len(grocery_list)): print(grocery_list[i]) else: print('Invalid command')
print('Grocery list:') print('"add" to add items and "view" to view list') grocery_list = [] while True: command = input('Enter command: ') if command == 'add': to_add = input('Enter new item: ') grocery_list.append(to_add) elif command == 'view': for i in range(len(grocery_list)): print(grocery_list[i]) else: print('Invalid command')
class Solution: # @return an integer def uniquePaths(self, m, n): if ((m == 0) or (n == 0)): return 0 if (n > m): return self.uniquePaths(n, m) row = [1] * m for i in range(1, n): # print row r2 = [1] last = 1 for j in range(1, m): last = last + row[j] r2.append(last) row = r2 return row.pop()
class Solution: def unique_paths(self, m, n): if m == 0 or n == 0: return 0 if n > m: return self.uniquePaths(n, m) row = [1] * m for i in range(1, n): r2 = [1] last = 1 for j in range(1, m): last = last + row[j] r2.append(last) row = r2 return row.pop()
# # Copyright (C) 2018 The Android Open Source Project # # 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. # layout = BoolScalar("layout", False) # NHWC # TEST 1: SPACE_TO_BATCH_NCHW_1, block_size = [2, 2] i1 = Input("op1", "TENSOR_FLOAT32", "{1, 2, 2, 2}") pad1 = Parameter("paddings", "TENSOR_INT32", "{2, 2}", [0, 0, 0, 0]) o1 = Output("op4", "TENSOR_FLOAT32", "{4, 1, 1, 2}") Model().Operation("SPACE_TO_BATCH_ND", i1, [2, 2], pad1, layout).To(o1) # Additional data type quant8 = DataTypeConverter().Identify({ i1: ("TENSOR_QUANT8_ASYMM", 0.1, 0), o1: ("TENSOR_QUANT8_ASYMM", 0.1, 0) }) # Instantiate an example example = Example({ i1: [1.4, 2.3, 3.2, 4.1, 5.4, 6.3, 7.2, 8.1], o1: [1.4, 2.3, 3.2, 4.1, 5.4, 6.3, 7.2, 8.1] }).AddNchw(i1, o1, layout).AddVariations("relaxed", "float16", quant8) # TEST 2: SPACE_TO_BATCH_NCHW_2, block_size = [2, 2] i2 = Input("op1", "TENSOR_FLOAT32", "{1, 4, 4, 1}") o2 = Output("op4", "TENSOR_FLOAT32", "{4, 2, 2, 1}") Model().Operation("SPACE_TO_BATCH_ND", i2, [2, 2], pad1, layout).To(o2) # Additional data type quant8 = DataTypeConverter().Identify({ i2: ("TENSOR_QUANT8_ASYMM", 0.5, 0), o2: ("TENSOR_QUANT8_ASYMM", 0.5, 0) }) # Instantiate an example example = Example({ i2: [1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16], o2: [1, 3, 9, 11, 2, 4, 10, 12, 5, 7, 13, 15, 6, 8, 14, 16] }).AddNchw(i2, o2, layout).AddVariations("relaxed", "float16", quant8) # TEST 3: SPACE_TO_BATCH_NCHW_3, block_size = [3, 2] i3 = Input("op1", "TENSOR_FLOAT32", "{1, 5, 2, 1}") pad3 = Parameter("paddings", "TENSOR_INT32", "{2, 2}", [1, 0, 2, 0]) o3 = Output("op4", "TENSOR_FLOAT32", "{6, 2, 2, 1}") Model().Operation("SPACE_TO_BATCH_ND", i3, [3, 2], pad3, layout).To(o3) # Additional data type quant8 = DataTypeConverter().Identify({ i3: ("TENSOR_QUANT8_ASYMM", 0.5, 128), o3: ("TENSOR_QUANT8_ASYMM", 0.5, 128) }) # Instantiate an example example = Example({ i3: [1, 2, 3, 4, 5, 6, 7, 8, 9, 10], o3: [0, 0, 0, 5, 0, 0, 0, 6, 0, 1, 0, 7, 0, 2, 0, 8, 0, 3, 0, 9, 0, 4, 0, 10] }).AddNchw(i3, o3, layout).AddVariations("relaxed", "float16", quant8) # TEST 4: SPACE_TO_BATCH_NCHW_4, block_size = [3, 2] i4 = Input("op1", "TENSOR_FLOAT32", "{1, 4, 2, 1}") pad4 = Parameter("paddings", "TENSOR_INT32", "{2, 2}", [1, 1, 2, 4]) o4 = Output("op4", "TENSOR_FLOAT32", "{6, 2, 4, 1}") Model().Operation("SPACE_TO_BATCH_ND", i4, [3, 2], pad4, layout).To(o4) # Additional data type quant8 = DataTypeConverter().Identify({ i4: ("TENSOR_QUANT8_ASYMM", 0.25, 128), o4: ("TENSOR_QUANT8_ASYMM", 0.25, 128) }) # Instantiate an example example = Example({ i4: [1, 2, 3, 4, 5, 6, 7, 8], o4: [0, 0, 0, 0, 0, 5, 0, 0, 0, 0, 0, 0, 0, 6, 0, 0, 0, 1, 0, 0, 0, 7, 0, 0, 0, 2, 0, 0, 0, 8, 0, 0, 0, 3, 0, 0, 0, 0, 0, 0, 0, 4, 0, 0, 0, 0, 0, 0] }).AddNchw(i4, o4, layout).AddVariations("relaxed", "float16", quant8)
layout = bool_scalar('layout', False) i1 = input('op1', 'TENSOR_FLOAT32', '{1, 2, 2, 2}') pad1 = parameter('paddings', 'TENSOR_INT32', '{2, 2}', [0, 0, 0, 0]) o1 = output('op4', 'TENSOR_FLOAT32', '{4, 1, 1, 2}') model().Operation('SPACE_TO_BATCH_ND', i1, [2, 2], pad1, layout).To(o1) quant8 = data_type_converter().Identify({i1: ('TENSOR_QUANT8_ASYMM', 0.1, 0), o1: ('TENSOR_QUANT8_ASYMM', 0.1, 0)}) example = example({i1: [1.4, 2.3, 3.2, 4.1, 5.4, 6.3, 7.2, 8.1], o1: [1.4, 2.3, 3.2, 4.1, 5.4, 6.3, 7.2, 8.1]}).AddNchw(i1, o1, layout).AddVariations('relaxed', 'float16', quant8) i2 = input('op1', 'TENSOR_FLOAT32', '{1, 4, 4, 1}') o2 = output('op4', 'TENSOR_FLOAT32', '{4, 2, 2, 1}') model().Operation('SPACE_TO_BATCH_ND', i2, [2, 2], pad1, layout).To(o2) quant8 = data_type_converter().Identify({i2: ('TENSOR_QUANT8_ASYMM', 0.5, 0), o2: ('TENSOR_QUANT8_ASYMM', 0.5, 0)}) example = example({i2: [1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16], o2: [1, 3, 9, 11, 2, 4, 10, 12, 5, 7, 13, 15, 6, 8, 14, 16]}).AddNchw(i2, o2, layout).AddVariations('relaxed', 'float16', quant8) i3 = input('op1', 'TENSOR_FLOAT32', '{1, 5, 2, 1}') pad3 = parameter('paddings', 'TENSOR_INT32', '{2, 2}', [1, 0, 2, 0]) o3 = output('op4', 'TENSOR_FLOAT32', '{6, 2, 2, 1}') model().Operation('SPACE_TO_BATCH_ND', i3, [3, 2], pad3, layout).To(o3) quant8 = data_type_converter().Identify({i3: ('TENSOR_QUANT8_ASYMM', 0.5, 128), o3: ('TENSOR_QUANT8_ASYMM', 0.5, 128)}) example = example({i3: [1, 2, 3, 4, 5, 6, 7, 8, 9, 10], o3: [0, 0, 0, 5, 0, 0, 0, 6, 0, 1, 0, 7, 0, 2, 0, 8, 0, 3, 0, 9, 0, 4, 0, 10]}).AddNchw(i3, o3, layout).AddVariations('relaxed', 'float16', quant8) i4 = input('op1', 'TENSOR_FLOAT32', '{1, 4, 2, 1}') pad4 = parameter('paddings', 'TENSOR_INT32', '{2, 2}', [1, 1, 2, 4]) o4 = output('op4', 'TENSOR_FLOAT32', '{6, 2, 4, 1}') model().Operation('SPACE_TO_BATCH_ND', i4, [3, 2], pad4, layout).To(o4) quant8 = data_type_converter().Identify({i4: ('TENSOR_QUANT8_ASYMM', 0.25, 128), o4: ('TENSOR_QUANT8_ASYMM', 0.25, 128)}) example = example({i4: [1, 2, 3, 4, 5, 6, 7, 8], o4: [0, 0, 0, 0, 0, 5, 0, 0, 0, 0, 0, 0, 0, 6, 0, 0, 0, 1, 0, 0, 0, 7, 0, 0, 0, 2, 0, 0, 0, 8, 0, 0, 0, 3, 0, 0, 0, 0, 0, 0, 0, 4, 0, 0, 0, 0, 0, 0]}).AddNchw(i4, o4, layout).AddVariations('relaxed', 'float16', quant8)
class PrintDictResults: def __init__(self, dict_of_sorted_words): self.list_of_sorted_words = dict_of_sorted_words def print_items(self, counter): print(f'{counter + 1}. "{self.list_of_sorted_words[counter][1]}" : {self.list_of_sorted_words[counter][0]}') def get_all_words(self): for item in self.list_of_sorted_words: self.print_items((self.list_of_sorted_words.index(item))) def get_top(self, number_of_wanted_items): for i in range(0, number_of_wanted_items): self.print_items(i)
class Printdictresults: def __init__(self, dict_of_sorted_words): self.list_of_sorted_words = dict_of_sorted_words def print_items(self, counter): print(f'{counter + 1}. "{self.list_of_sorted_words[counter][1]}" : {self.list_of_sorted_words[counter][0]}') def get_all_words(self): for item in self.list_of_sorted_words: self.print_items(self.list_of_sorted_words.index(item)) def get_top(self, number_of_wanted_items): for i in range(0, number_of_wanted_items): self.print_items(i)
class Node(object): def __init__(self, value): self.value = value self.left = None self.right = None #Binary Tree class BinaryTree(object): def __init__(self, root): self.root = Node(root) def search(self, find_val): """Return True if the value is in the tree, return False otherwise.""" return self.preorder_search(self.root, find_val) def print_tree(self): """Print out all tree nodes as they are visited in a pre-order traversal.""" return self.preorder_print(self.root,"")[:-1] def preorder_search(self, start, find_val): """Helper method - use this to create a recursive search solution.""" if start: hasVal = False if start.value == find_val: hasVal = True return hasVal or self.preorder_search(start.left, find_val) or self.preorder_search(start.right, find_val) return False def preorder_print(self, start, traversal): """Helper method - use this to create a recursive print solution.""" if start: traversal += str(start.value) + "-" traversal = self.preorder_print(start.left, traversal) traversal = self.preorder_print(start.right, traversal) return traversal # Binary Search Tree class BST(object): def __init__(self, root): self.root = Node(root) def insert(self, new_val): self.insert_helper(self.root, new_val) def search(self, find_val): return self.search_helper(self.root, find_val) def search_helper(self, start, find_val): if start.value == find_val: return True elif find_val < start.value: if start.left: return self.search_helper(start.left, find_val) elif find_val > start.value: if start.right: return self.search_helper(start.right, find_val) return False def insert_helper(self, start, new_val): if start.value == new_val: return if new_val > start.value: if start.right: self.insert_helper(start.right, new_val) else: start.right = Node(new_val) if new_val < start.value: if start.left: self.insert_helper(start.left, new_val) else: start.left = Node(new_val) return def print_tree(self): """Print out all tree nodes as they are visited in a pre-order traversal.""" return self.preorder_print(self.root,"")[:-1] def preorder_print(self, start, traversal): """Helper method - use this to create a recursive print solution.""" if start: traversal += str(start.value) + "-" traversal = self.preorder_print(start.left, traversal) traversal = self.preorder_print(start.right, traversal) return traversal
class Node(object): def __init__(self, value): self.value = value self.left = None self.right = None class Binarytree(object): def __init__(self, root): self.root = node(root) def search(self, find_val): """Return True if the value is in the tree, return False otherwise.""" return self.preorder_search(self.root, find_val) def print_tree(self): """Print out all tree nodes as they are visited in a pre-order traversal.""" return self.preorder_print(self.root, '')[:-1] def preorder_search(self, start, find_val): """Helper method - use this to create a recursive search solution.""" if start: has_val = False if start.value == find_val: has_val = True return hasVal or self.preorder_search(start.left, find_val) or self.preorder_search(start.right, find_val) return False def preorder_print(self, start, traversal): """Helper method - use this to create a recursive print solution.""" if start: traversal += str(start.value) + '-' traversal = self.preorder_print(start.left, traversal) traversal = self.preorder_print(start.right, traversal) return traversal class Bst(object): def __init__(self, root): self.root = node(root) def insert(self, new_val): self.insert_helper(self.root, new_val) def search(self, find_val): return self.search_helper(self.root, find_val) def search_helper(self, start, find_val): if start.value == find_val: return True elif find_val < start.value: if start.left: return self.search_helper(start.left, find_val) elif find_val > start.value: if start.right: return self.search_helper(start.right, find_val) return False def insert_helper(self, start, new_val): if start.value == new_val: return if new_val > start.value: if start.right: self.insert_helper(start.right, new_val) else: start.right = node(new_val) if new_val < start.value: if start.left: self.insert_helper(start.left, new_val) else: start.left = node(new_val) return def print_tree(self): """Print out all tree nodes as they are visited in a pre-order traversal.""" return self.preorder_print(self.root, '')[:-1] def preorder_print(self, start, traversal): """Helper method - use this to create a recursive print solution.""" if start: traversal += str(start.value) + '-' traversal = self.preorder_print(start.left, traversal) traversal = self.preorder_print(start.right, traversal) return traversal
def iterative_levenshtein(string, target, costs=(1, 1, 1)): """ piglaker modified version : return edits iterative_levenshtein(s, t) -> ldist ldist is the Levenshtein distance between the strings s and t. For all i and j, dist[i,j] will contain the Levenshtein distance between the first i characters of s and the first j characters of t costs: a tuple or a list with three integers (d, i, s) where d defines the costs for a deletion i defines the costs for an insertion and s defines the costs for a substitution """ rows = len(string) + 1 cols = len(target) + 1 deletes, inserts, substitutes = costs dist = [[0 for x in range(cols)] for x in range(rows)] # dist = np.zeros(shape=(rows, cols)) edits = [ [[] for x in range(cols)] for x in range(rows)] # source prefixes can be transformed into empty strings # by deletions: for row in range(1, rows): dist[row][0] = row * deletes # target prefixes can be created from an empty source string # by inserting the characters for col in range(1, cols): dist[0][col] = col * inserts for col in range(1, cols): for row in range(1, rows): if string[row - 1] == target[col - 1]: cost = 0 else: cost = substitutes dist[row][col] = min(dist[row - 1][col] + deletes, dist[row][col - 1] + inserts, dist[row - 1][col - 1] + cost) # substitution # record edit min_distance = dist[row][col] if min_distance == dist[row - 1][col] + deletes: edit = ("delete", string[row - 1]) edits[row][col] = edits[row-1][col] + [edit] elif min_distance == dist[row][col - 1] + inserts: edit = ("insert", col, target[col-1]) edits[row][col] = edits[row][col-1] + [edit] else: edit = ("substitution", string[row-1], target[col-1]) edits[row][col] = edits[row-1][col-1] + [edit] return dist[row][col], edits[row][col] result, edits = iterative_levenshtein([1,2,3], [0,13]) print(result, edits)
def iterative_levenshtein(string, target, costs=(1, 1, 1)): """ piglaker modified version : return edits iterative_levenshtein(s, t) -> ldist ldist is the Levenshtein distance between the strings s and t. For all i and j, dist[i,j] will contain the Levenshtein distance between the first i characters of s and the first j characters of t costs: a tuple or a list with three integers (d, i, s) where d defines the costs for a deletion i defines the costs for an insertion and s defines the costs for a substitution """ rows = len(string) + 1 cols = len(target) + 1 (deletes, inserts, substitutes) = costs dist = [[0 for x in range(cols)] for x in range(rows)] edits = [[[] for x in range(cols)] for x in range(rows)] for row in range(1, rows): dist[row][0] = row * deletes for col in range(1, cols): dist[0][col] = col * inserts for col in range(1, cols): for row in range(1, rows): if string[row - 1] == target[col - 1]: cost = 0 else: cost = substitutes dist[row][col] = min(dist[row - 1][col] + deletes, dist[row][col - 1] + inserts, dist[row - 1][col - 1] + cost) min_distance = dist[row][col] if min_distance == dist[row - 1][col] + deletes: edit = ('delete', string[row - 1]) edits[row][col] = edits[row - 1][col] + [edit] elif min_distance == dist[row][col - 1] + inserts: edit = ('insert', col, target[col - 1]) edits[row][col] = edits[row][col - 1] + [edit] else: edit = ('substitution', string[row - 1], target[col - 1]) edits[row][col] = edits[row - 1][col - 1] + [edit] return (dist[row][col], edits[row][col]) (result, edits) = iterative_levenshtein([1, 2, 3], [0, 13]) print(result, edits)